From 310fcc20f113d3c39085b2adae09e3460d9e532a Mon Sep 17 00:00:00 2001 From: charleszhang Date: Wed, 27 Mar 2024 15:05:50 +0800 Subject: [PATCH] add: full framework --- .gitignore | 162 + README.md | 132 + environment.yaml | 18 + lib/overcooked_ai/.gitignore | 128 + lib/overcooked_ai/LICENSE | 21 + lib/overcooked_ai/README.md | 101 + .../common_tests/common_test_generator.py | 69 + .../common_tests/failing_traj.json | 1812 + lib/overcooked_ai/common_tests/test_traj.json | 1812 + .../trajectory_tests/test_full_traj.json | 1812 + lib/overcooked_ai/overcooked_ai_js/.babelrc | 11 + lib/overcooked_ai/overcooked_ai_js/.gitignore | 253 + .../overcooked_ai_js/.gitmodules | 3 + .../overcooked_ai_js/assets/chefs.json | 895 + .../overcooked_ai_js/assets/chefs.png | Bin 0 -> 3121 bytes .../assets/chefs/EAST-bluehat.png | Bin 0 -> 18082 bytes .../assets/chefs/EAST-dish.png | Bin 0 -> 18209 bytes .../assets/chefs/EAST-greenhat.png | Bin 0 -> 18082 bytes .../assets/chefs/EAST-onion.png | Bin 0 -> 18190 bytes .../assets/chefs/EAST-orangehat.png | Bin 0 -> 18080 bytes .../assets/chefs/EAST-purplehat.png | Bin 0 -> 18082 bytes .../assets/chefs/EAST-redhat.png | Bin 0 -> 18080 bytes .../assets/chefs/EAST-soup-onion.png | Bin 0 -> 18184 bytes .../assets/chefs/EAST-soup-tomato.png | Bin 0 -> 18176 bytes .../assets/chefs/EAST-tomato.png | Bin 0 -> 18181 bytes .../overcooked_ai_js/assets/chefs/EAST.png | Bin 0 -> 18037 bytes .../assets/chefs/NORTH-bluehat.png | Bin 0 -> 18091 bytes .../assets/chefs/NORTH-dish.png | Bin 0 -> 18182 bytes .../assets/chefs/NORTH-greenhat.png | Bin 0 -> 18091 bytes .../assets/chefs/NORTH-onion.png | Bin 0 -> 18171 bytes .../assets/chefs/NORTH-orangehat.png | Bin 0 -> 18089 bytes .../assets/chefs/NORTH-purplehat.png | Bin 0 -> 18091 bytes .../assets/chefs/NORTH-redhat.png | Bin 0 -> 18089 bytes .../assets/chefs/NORTH-soup-onion.png | Bin 0 -> 18143 bytes .../assets/chefs/NORTH-soup-tomato.png | Bin 0 -> 18143 bytes .../assets/chefs/NORTH-tomato.png | Bin 0 -> 18171 bytes .../overcooked_ai_js/assets/chefs/NORTH.png | Bin 0 -> 18008 bytes .../assets/chefs/SOUTH-bluehat.png | Bin 0 -> 18082 bytes .../assets/chefs/SOUTH-dish.png | Bin 0 -> 18223 bytes .../assets/chefs/SOUTH-greenhat.png | Bin 0 -> 18082 bytes .../assets/chefs/SOUTH-onion.png | Bin 0 -> 18230 bytes .../assets/chefs/SOUTH-orangehat.png | Bin 0 -> 18080 bytes .../assets/chefs/SOUTH-purplehat.png | Bin 0 -> 18082 bytes .../assets/chefs/SOUTH-redhat.png | Bin 0 -> 18080 bytes .../assets/chefs/SOUTH-soup-onion.png | Bin 0 -> 18202 bytes .../assets/chefs/SOUTH-soup-tomato.png | Bin 0 -> 18194 bytes .../assets/chefs/SOUTH-tomato.png | Bin 0 -> 18220 bytes .../overcooked_ai_js/assets/chefs/SOUTH.png | Bin 0 -> 18039 bytes .../assets/chefs/WEST-bluehat.png | Bin 0 -> 18082 bytes .../assets/chefs/WEST-dish.png | Bin 0 -> 228 bytes .../assets/chefs/WEST-greenhat.png | Bin 0 -> 18082 bytes .../assets/chefs/WEST-onion.png | Bin 0 -> 18180 bytes .../assets/chefs/WEST-orangehat.png | Bin 0 -> 18080 bytes .../assets/chefs/WEST-purplehat.png | Bin 0 -> 18082 bytes .../assets/chefs/WEST-redhat.png | Bin 0 -> 18080 bytes .../assets/chefs/WEST-soup-onion.png | Bin 0 -> 18187 bytes .../assets/chefs/WEST-soup-tomato.png | Bin 0 -> 18180 bytes .../assets/chefs/WEST-tomato.png | Bin 0 -> 18179 bytes .../overcooked_ai_js/assets/chefs/WEST.png | Bin 0 -> 18031 bytes .../overcooked_ai_js/assets/objects.json | 315 + .../overcooked_ai_js/assets/objects.png | Bin 0 -> 1508 bytes .../overcooked_ai_js/assets/objects/dish.png | Bin 0 -> 18271 bytes .../overcooked_ai_js/assets/objects/onion.png | Bin 0 -> 18124 bytes .../assets/objects/pot-explosion.png | Bin 0 -> 18246 bytes .../assets/objects/soup-onion-1-cooking.png | Bin 0 -> 18194 bytes .../assets/objects/soup-onion-2-cooking.png | Bin 0 -> 18214 bytes .../assets/objects/soup-onion-3-cooking.png | Bin 0 -> 18267 bytes .../assets/objects/soup-onion-cooked.png | Bin 0 -> 18085 bytes .../assets/objects/soup-onion-dish.png | Bin 0 -> 18262 bytes .../assets/objects/soup-tomato-1-cooking.png | Bin 0 -> 18180 bytes .../assets/objects/soup-tomato-2-cooking.png | Bin 0 -> 18212 bytes .../assets/objects/soup-tomato-3-0.png | Bin 0 -> 18264 bytes .../assets/objects/soup-tomato-3-cooking.png | Bin 0 -> 18264 bytes .../assets/objects/soup-tomato-cooked.png | Bin 0 -> 18082 bytes .../assets/objects/soup-tomato-dish.png | Bin 0 -> 18249 bytes .../assets/objects/tomato.png | Bin 0 -> 18126 bytes .../overcooked_ai_js/assets/terrain.json | 155 + .../overcooked_ai_js/assets/terrain.png | Bin 0 -> 912 bytes .../assets/terrain/counter.png | Bin 0 -> 17950 bytes .../assets/terrain/dishes.png | Bin 0 -> 18402 bytes .../overcooked_ai_js/assets/terrain/floor.png | Bin 0 -> 17964 bytes .../assets/terrain/onions.png | Bin 0 -> 18202 bytes .../overcooked_ai_js/assets/terrain/pot.png | Bin 0 -> 18096 bytes .../overcooked_ai_js/assets/terrain/serve.png | Bin 0 -> 17950 bytes .../overcooked_ai_js/assets/terrain/template | Bin 0 -> 39163 bytes .../assets/terrain/tomatoes.png | Bin 0 -> 18111 bytes .../overcooked_ai_js/assets/tiles.json | 236 + .../overcooked_ai_js/assets/tiles.png | Bin 0 -> 10510 bytes lib/overcooked_ai/overcooked_ai_js/demo.html | 87 + .../overcooked_ai_js/images/screenshot.png | Bin 0 -> 11051 bytes .../images/thepotexploded.png | Bin 0 -> 18620 bytes .../overcooked_ai_js/index-window.js | 4 + lib/overcooked_ai/overcooked_ai_js/index.js | 4 + lib/overcooked_ai/overcooked_ai_js/js/mdp.es6 | 707 + .../overcooked_ai_js/js/task.es6 | 372 + .../overcooked_ai_js/overcooked-window.js | 190256 +++++++++++++++ .../overcooked_ai_js/overcooked.js | 190242 ++++++++++++++ .../overcooked_ai_js/package-lock.json | 8396 + .../overcooked_ai_js/package.json | 46 + .../overcooked_ai_js/tests/mdp.unit.test.js | 490 + .../overcooked_ai_js/tests/replay.test.js | 127 + .../overcooked_ai_py/__init__.py | 6 + .../overcooked_ai_py/agents/__init__.py | 0 .../overcooked_ai_py/agents/agent.py | 520 + .../overcooked_ai_py/agents/agent_test.py | 375 + .../overcooked_ai_py/agents/benchmarking.py | 206 + .../overcooked_ai_py/data/layouts/__init__.py | 7 + .../data/layouts/corridor.layout | 16 + .../data/layouts/five_by_five.layout | 12 + .../data/layouts/mdp_test.layout | 11 + .../data/layouts/multiplayer_schelling.layout | 14 + .../data/layouts/random0.layout | 12 + .../data/layouts/random1.layout | 12 + .../data/layouts/random2.layout | 12 + .../data/layouts/random3.layout | 12 + .../data/layouts/scenario1_s.layout | 12 + .../data/layouts/scenario2.layout | 11 + .../data/layouts/scenario2_s.layout | 11 + .../data/layouts/scenario3.layout | 13 + .../data/layouts/scenario4.layout | 13 + .../data/layouts/schelling.layout | 14 + .../data/layouts/schelling_s.layout | 12 + .../data/layouts/simple.layout | 11 + .../data/layouts/simple_single.layout | 11 + .../data/layouts/simple_tomato.layout | 11 + .../data/layouts/small_corridor.layout | 12 + .../data/layouts/unident.layout | 12 + .../data/layouts/unident_s.layout | 12 + .../overcooked_ai_py/data/planners/.gitignore | 2 + .../lossless_state_featurization.pickle | Bin 0 -> 12953853 bytes .../data/testing/state_featurization.pickle | Bin 0 -> 2120431 bytes .../overcooked_ai_py/mdp/__init__.py | 0 .../overcooked_ai_py/mdp/actions.py | 86 + .../overcooked_ai_py/mdp/layout_generator.py | 374 + .../overcooked_ai_py/mdp/overcooked_env.py | 415 + .../overcooked_ai_py/mdp/overcooked_mdp.py | 1369 + .../overcooked_ai_py/mdp/overcooked_test.py | 313 + .../overcooked_ai_py/planning/__init__.py | 0 .../overcooked_ai_py/planning/planners.py | 1622 + .../planning/planners_test.py | 454 + .../overcooked_ai_py/planning/search.py | 461 + .../overcooked_ai_py/run_tests_fast.py | 7 + .../overcooked_ai_py/run_tests_full.py | 8 + lib/overcooked_ai/overcooked_ai_py/static.py | 10 + lib/overcooked_ai/overcooked_ai_py/utils.py | 114 + .../visualization/__init__.py | 0 .../visualization/pygame_utils.py | 97 + .../visualization/state_visualizer.py | 457 + .../visualization/visualization_utils.py | 15 + lib/overcooked_ai/setup.py | 16 + lib/stable-baselines/.coveragerc | 17 + .../.github/ISSUE_TEMPLATE/issue-template.md | 26 + lib/stable-baselines/.gitignore | 42 + lib/stable-baselines/.travis.yml | 17 + lib/stable-baselines/CONTRIBUTING.md | 103 + lib/stable-baselines/LICENSE | 22 + lib/stable-baselines/README.md | 217 + lib/stable-baselines/conftest.py | 14 + lib/stable-baselines/docker/Dockerfile.cpu | 37 + lib/stable-baselines/docker/Dockerfile.gpu | 37 + lib/stable-baselines/docs/Makefile | 20 + lib/stable-baselines/docs/README.md | 25 + .../docs/_static/css/baselines_theme.css | 52 + .../_static/img/Tensorboard_example_1.png | Bin 0 -> 187299 bytes .../_static/img/Tensorboard_example_2.png | Bin 0 -> 148408 bytes .../_static/img/Tensorboard_example_3.png | Bin 0 -> 167980 bytes .../docs/_static/img/breakout.gif | Bin 0 -> 199418 bytes .../docs/_static/img/colab.svg | 7 + .../docs/_static/img/learning_curve.png | Bin 0 -> 25521 bytes .../docs/_static/img/logo.png | Bin 0 -> 132717 bytes .../docs/_static/img/try_it.png | Bin 0 -> 12156 bytes .../docs/common/cmd_utils.rst | 7 + .../docs/common/distributions.rst | 24 + .../docs/common/schedules.rst | 11 + lib/stable-baselines/docs/common/tf_utils.rst | 7 + lib/stable-baselines/docs/conf.py | 196 + lib/stable-baselines/docs/guide/algos.rst | 52 + .../docs/guide/custom_env.rst | 57 + .../docs/guide/custom_policy.rst | 248 + lib/stable-baselines/docs/guide/examples.rst | 451 + lib/stable-baselines/docs/guide/install.rst | 162 + lib/stable-baselines/docs/guide/pretrain.rst | 152 + .../docs/guide/quickstart.rst | 45 + lib/stable-baselines/docs/guide/rl.rst | 15 + lib/stable-baselines/docs/guide/rl_zoo.rst | 86 + .../docs/guide/tensorboard.rst | 97 + lib/stable-baselines/docs/guide/vec_envs.rst | 71 + lib/stable-baselines/docs/index.rst | 117 + lib/stable-baselines/docs/make.bat | 36 + lib/stable-baselines/docs/misc/changelog.rst | 283 + lib/stable-baselines/docs/misc/projects.rst | 92 + .../docs/misc/results_plotter.rst | 8 + lib/stable-baselines/docs/modules/a2c.rst | 78 + lib/stable-baselines/docs/modules/acer.rst | 73 + lib/stable-baselines/docs/modules/acktr.rst | 74 + lib/stable-baselines/docs/modules/base.rst | 12 + lib/stable-baselines/docs/modules/ddpg.rst | 164 + lib/stable-baselines/docs/modules/dqn.rst | 164 + lib/stable-baselines/docs/modules/gail.rst | 131 + lib/stable-baselines/docs/modules/her.rst | 67 + .../docs/modules/policies.rst | 70 + lib/stable-baselines/docs/modules/ppo1.rst | 83 + lib/stable-baselines/docs/modules/ppo2.rst | 91 + lib/stable-baselines/docs/modules/sac.rst | 153 + lib/stable-baselines/docs/modules/trpo.rst | 73 + lib/stable-baselines/run_docker_cpu.sh | 12 + lib/stable-baselines/run_docker_gpu.sh | 12 + lib/stable-baselines/run_tests.sh | 2 + lib/stable-baselines/setup.cfg | 3 + lib/stable-baselines/setup.py | 150 + .../stable_baselines/__init__.py | 12 + .../stable_baselines/a2c/__init__.py | 1 + .../stable_baselines/a2c/a2c.py | 370 + .../stable_baselines/a2c/run_atari.py | 53 + .../stable_baselines/a2c/utils.py | 592 + .../stable_baselines/acer/__init__.py | 1 + .../stable_baselines/acer/acer_simple.py | 660 + .../stable_baselines/acer/buffer.py | 162 + .../stable_baselines/acer/run_atari.py | 54 + .../stable_baselines/acktr/__init__.py | 1 + .../stable_baselines/acktr/acktr_cont.py | 171 + .../stable_baselines/acktr/acktr_disc.py | 369 + .../stable_baselines/acktr/kfac.py | 1007 + .../stable_baselines/acktr/kfac_utils.py | 128 + .../stable_baselines/acktr/policies.py | 75 + .../stable_baselines/acktr/run_atari.py | 32 + .../stable_baselines/acktr/run_mujoco.py | 46 + .../stable_baselines/acktr/utils.py | 49 + .../stable_baselines/acktr/value_functions.py | 87 + .../stable_baselines/bench/__init__.py | 1 + .../stable_baselines/bench/benchmarks.py | 182 + .../stable_baselines/bench/monitor.py | 200 + .../stable_baselines/common/__init__.py | 9 + .../stable_baselines/common/atari_wrappers.py | 313 + .../stable_baselines/common/base_class.py | 743 + .../stable_baselines/common/cg.py | 49 + .../stable_baselines/common/cmd_util.py | 138 + .../stable_baselines/common/console_util.py | 78 + .../stable_baselines/common/dataset.py | 101 + .../stable_baselines/common/distributions.py | 506 + .../stable_baselines/common/filters.py | 211 + .../stable_baselines/common/identity_env.py | 105 + .../stable_baselines/common/input.py | 51 + .../stable_baselines/common/math_util.py | 103 + .../stable_baselines/common/misc_util.py | 246 + .../stable_baselines/common/mpi_adam.py | 121 + .../stable_baselines/common/mpi_fork.py | 31 + .../stable_baselines/common/mpi_moments.py | 71 + .../common/mpi_running_mean_std.py | 105 + .../stable_baselines/common/policies.py | 630 + .../stable_baselines/common/runners.py | 29 + .../common/running_mean_std.py | 37 + .../stable_baselines/common/running_stat.py | 75 + .../stable_baselines/common/schedules.py | 108 + .../stable_baselines/common/segment_tree.py | 137 + .../stable_baselines/common/tf_util.py | 535 + .../stable_baselines/common/tile_images.py | 28 + .../common/vec_env/__init__.py | 8 + .../common/vec_env/base_vec_env.py | 224 + .../common/vec_env/dummy_vec_env.py | 90 + .../common/vec_env/subproc_vec_env.py | 201 + .../stable_baselines/common/vec_env/util.py | 73 + .../common/vec_env/vec_frame_stack.py | 44 + .../common/vec_env/vec_normalize.py | 105 + .../common/vec_env/vec_video_recorder.py | 108 + .../stable_baselines/ddpg/__init__.py | 3 + .../stable_baselines/ddpg/ddpg.py | 1061 + .../stable_baselines/ddpg/main.py | 140 + .../stable_baselines/ddpg/memory.py | 130 + .../stable_baselines/ddpg/noise.py | 109 + .../stable_baselines/ddpg/policies.py | 264 + .../stable_baselines/deepq/__init__.py | 15 + .../stable_baselines/deepq/build_graph.py | 467 + .../stable_baselines/deepq/dqn.py | 365 + .../stable_baselines/deepq/policies.py | 255 + .../stable_baselines/deepq/replay_buffer.py | 172 + .../stable_baselines/gail/__init__.py | 3 + .../stable_baselines/gail/adversary.py | 164 + .../stable_baselines/gail/dataset/__init__.py | 0 .../stable_baselines/gail/dataset/dataset.py | 344 + .../gail/dataset/record_expert.py | 170 + .../stable_baselines/gail/model.py | 54 + .../stable_baselines/her/__init__.py | 1 + .../stable_baselines/her/actor_critic.py | 52 + .../stable_baselines/her/ddpg.py | 417 + .../her/experiment/__init__.py | 0 .../stable_baselines/her/experiment/config.py | 215 + .../stable_baselines/her/experiment/play.py | 69 + .../stable_baselines/her/experiment/plot.py | 141 + .../stable_baselines/her/experiment/train.py | 236 + .../stable_baselines/her/her.py | 117 + .../stable_baselines/her/normalizer.py | 199 + .../stable_baselines/her/replay_buffer.py | 132 + .../stable_baselines/her/rollout.py | 228 + .../stable_baselines/her/util.py | 150 + .../stable_baselines/logger.py | 721 + .../stable_baselines/ppo1/__init__.py | 1 + .../stable_baselines/ppo1/pposgd_simple.py | 359 + .../stable_baselines/ppo1/run_atari.py | 54 + .../stable_baselines/ppo1/run_humanoid.py | 78 + .../stable_baselines/ppo1/run_mujoco.py | 34 + .../stable_baselines/ppo1/run_robotics.py | 42 + .../stable_baselines/ppo2/__init__.py | 1 + .../stable_baselines/ppo2/ppo2.py | 519 + .../stable_baselines/ppo2/run_atari.py | 47 + .../stable_baselines/ppo2/run_mujoco.py | 58 + .../stable_baselines/results_plotter.py | 142 + .../stable_baselines/sac/__init__.py | 2 + .../stable_baselines/sac/policies.py | 371 + .../stable_baselines/sac/sac.py | 547 + .../stable_baselines/trpo_mpi/__init__.py | 1 + .../stable_baselines/trpo_mpi/run_atari.py | 55 + .../stable_baselines/trpo_mpi/run_mujoco.py | 45 + .../stable_baselines/trpo_mpi/trpo_mpi.py | 522 + .../stable_baselines/trpo_mpi/utils.py | 199 + lib/stable-baselines/tests/__init__.py | 0 .../tests/test_action_space.py | 71 + lib/stable-baselines/tests/test_atari.py | 99 + .../tests/test_auto_vec_detection.py | 107 + lib/stable-baselines/tests/test_common.py | 6 + lib/stable-baselines/tests/test_continuous.py | 207 + .../tests/test_custom_policy.py | 144 + lib/stable-baselines/tests/test_deepq.py | 31 + .../tests/test_deterministic.py | 71 + lib/stable-baselines/tests/test_distri.py | 68 + lib/stable-baselines/tests/test_gail.py | 111 + lib/stable-baselines/tests/test_identity.py | 83 + lib/stable-baselines/tests/test_logger.py | 40 + .../tests/test_lstm_policy.py | 65 + lib/stable-baselines/tests/test_math_util.py | 15 + lib/stable-baselines/tests/test_monitor.py | 36 + lib/stable-baselines/tests/test_mpi_adam.py | 18 + .../tests/test_running_stat.py | 20 + lib/stable-baselines/tests/test_save.py | 131 + lib/stable-baselines/tests/test_schedules.py | 33 + .../tests/test_segment_tree.py | 118 + .../tests/test_tensorboard.py | 33 + lib/stable-baselines/tests/test_tf_util.py | 61 + lib/stable-baselines/tests/test_vec_envs.py | 214 + .../tests/test_vec_normalize.py | 60 + requirements.txt | 13 + src/main.py | 206 + src/proagent/__init__.py | 0 src/proagent/modules.py | 142 + src/proagent/proagent.py | 820 + src/proagent/utils.py | 104 + src/prompts/claude/claude.txt | 79 + .../gpt/explainer/asymmetric_advantages_0.txt | 35 + .../gpt/explainer/asymmetric_advantages_1.txt | 35 + .../gpt/explainer/coordination_ring_0.txt | 74 + .../gpt/explainer/coordination_ring_1.txt | 74 + .../gpt/explainer/counter_circuit_0.txt | 35 + .../gpt/explainer/counter_circuit_1.txt | 26 + src/prompts/gpt/explainer/cramped_room_0.txt | 35 + src/prompts/gpt/explainer/cramped_room_1.txt | 26 + .../gpt/explainer/forced_coordination_0.txt | 36 + .../gpt/explainer/forced_coordination_1.txt | 17 + src/prompts/gpt/explainer/player0.txt | 35 + src/prompts/gpt/explainer/player1.txt | 26 + .../gpt/planner/l1-p/cramped_room_0.txt | 47 + .../planner/l2-ap/asymmetric_advantages_0.txt | 97 + .../planner/l2-ap/asymmetric_advantages_1.txt | 97 + .../gpt/planner/l2-ap/coordination_ring_0.txt | 74 + .../gpt/planner/l2-ap/coordination_ring_1.txt | 74 + .../gpt/planner/l2-ap/counter_circuit_0.txt | 128 + .../gpt/planner/l2-ap/counter_circuit_1.txt | 128 + .../gpt/planner/l2-ap/cramped_room_0.txt | 51 + .../gpt/planner/l2-ap/cramped_room_1.txt | 51 + .../planner/l2-ap/forced_coordination_0.txt | 75 + .../planner/l2-ap/forced_coordination_1.txt | 63 + .../gpt/planner/l3-aip/cramped_room_0.txt | 89 + src/run.py | 59 + src/utils.py | 322 + 373 files changed, 434273 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 environment.yaml create mode 100644 lib/overcooked_ai/.gitignore create mode 100644 lib/overcooked_ai/LICENSE create mode 100644 lib/overcooked_ai/README.md create mode 100644 lib/overcooked_ai/common_tests/common_test_generator.py create mode 100644 lib/overcooked_ai/common_tests/failing_traj.json create mode 100644 lib/overcooked_ai/common_tests/test_traj.json create mode 100644 lib/overcooked_ai/common_tests/trajectory_tests/test_full_traj.json create mode 100644 lib/overcooked_ai/overcooked_ai_js/.babelrc create mode 100644 lib/overcooked_ai/overcooked_ai_js/.gitignore create mode 100644 lib/overcooked_ai/overcooked_ai_js/.gitmodules create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs.json create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-bluehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-dish.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-greenhat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-onion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-orangehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-purplehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-redhat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-soup-onion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-soup-tomato.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-tomato.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-bluehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-dish.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-greenhat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-onion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-orangehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-purplehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-redhat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-soup-onion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-soup-tomato.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-tomato.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-bluehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-dish.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-greenhat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-onion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-orangehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-purplehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-redhat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-soup-onion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-soup-tomato.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-tomato.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-bluehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-dish.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-greenhat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-onion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-orangehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-purplehat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-redhat.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-soup-onion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-soup-tomato.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-tomato.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects.json create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/dish.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/onion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/pot-explosion.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-onion-1-cooking.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-onion-2-cooking.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-onion-3-cooking.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-onion-cooked.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-onion-dish.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-1-cooking.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-2-cooking.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-3-0.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-3-cooking.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-cooked.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-dish.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/objects/tomato.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain.json create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain/counter.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain/dishes.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain/floor.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain/onions.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain/pot.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain/serve.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain/template create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/terrain/tomatoes.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/tiles.json create mode 100644 lib/overcooked_ai/overcooked_ai_js/assets/tiles.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/demo.html create mode 100644 lib/overcooked_ai/overcooked_ai_js/images/screenshot.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/images/thepotexploded.png create mode 100644 lib/overcooked_ai/overcooked_ai_js/index-window.js create mode 100644 lib/overcooked_ai/overcooked_ai_js/index.js create mode 100644 lib/overcooked_ai/overcooked_ai_js/js/mdp.es6 create mode 100644 lib/overcooked_ai/overcooked_ai_js/js/task.es6 create mode 100644 lib/overcooked_ai/overcooked_ai_js/overcooked-window.js create mode 100644 lib/overcooked_ai/overcooked_ai_js/overcooked.js create mode 100644 lib/overcooked_ai/overcooked_ai_js/package-lock.json create mode 100644 lib/overcooked_ai/overcooked_ai_js/package.json create mode 100644 lib/overcooked_ai/overcooked_ai_js/tests/mdp.unit.test.js create mode 100644 lib/overcooked_ai/overcooked_ai_js/tests/replay.test.js create mode 100644 lib/overcooked_ai/overcooked_ai_py/__init__.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/agents/__init__.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/agents/agent.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/agents/agent_test.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/agents/benchmarking.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/__init__.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/corridor.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/five_by_five.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/mdp_test.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/multiplayer_schelling.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/random0.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/random1.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/random2.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/random3.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/scenario1_s.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/scenario2.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/scenario2_s.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/scenario3.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/scenario4.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/schelling.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/schelling_s.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/simple.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/simple_single.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/simple_tomato.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/small_corridor.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/unident.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/layouts/unident_s.layout create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/planners/.gitignore create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/testing/lossless_state_featurization.pickle create mode 100644 lib/overcooked_ai/overcooked_ai_py/data/testing/state_featurization.pickle create mode 100644 lib/overcooked_ai/overcooked_ai_py/mdp/__init__.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/mdp/actions.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/mdp/layout_generator.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/mdp/overcooked_env.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/mdp/overcooked_mdp.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/mdp/overcooked_test.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/planning/__init__.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/planning/planners.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/planning/planners_test.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/planning/search.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/run_tests_fast.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/run_tests_full.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/static.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/utils.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/visualization/__init__.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/visualization/pygame_utils.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/visualization/state_visualizer.py create mode 100644 lib/overcooked_ai/overcooked_ai_py/visualization/visualization_utils.py create mode 100644 lib/overcooked_ai/setup.py create mode 100644 lib/stable-baselines/.coveragerc create mode 100644 lib/stable-baselines/.github/ISSUE_TEMPLATE/issue-template.md create mode 100644 lib/stable-baselines/.gitignore create mode 100644 lib/stable-baselines/.travis.yml create mode 100644 lib/stable-baselines/CONTRIBUTING.md create mode 100644 lib/stable-baselines/LICENSE create mode 100644 lib/stable-baselines/README.md create mode 100644 lib/stable-baselines/conftest.py create mode 100644 lib/stable-baselines/docker/Dockerfile.cpu create mode 100644 lib/stable-baselines/docker/Dockerfile.gpu create mode 100644 lib/stable-baselines/docs/Makefile create mode 100644 lib/stable-baselines/docs/README.md create mode 100644 lib/stable-baselines/docs/_static/css/baselines_theme.css create mode 100644 lib/stable-baselines/docs/_static/img/Tensorboard_example_1.png create mode 100644 lib/stable-baselines/docs/_static/img/Tensorboard_example_2.png create mode 100644 lib/stable-baselines/docs/_static/img/Tensorboard_example_3.png create mode 100644 lib/stable-baselines/docs/_static/img/breakout.gif create mode 100644 lib/stable-baselines/docs/_static/img/colab.svg create mode 100644 lib/stable-baselines/docs/_static/img/learning_curve.png create mode 100644 lib/stable-baselines/docs/_static/img/logo.png create mode 100644 lib/stable-baselines/docs/_static/img/try_it.png create mode 100644 lib/stable-baselines/docs/common/cmd_utils.rst create mode 100644 lib/stable-baselines/docs/common/distributions.rst create mode 100644 lib/stable-baselines/docs/common/schedules.rst create mode 100644 lib/stable-baselines/docs/common/tf_utils.rst create mode 100644 lib/stable-baselines/docs/conf.py create mode 100644 lib/stable-baselines/docs/guide/algos.rst create mode 100644 lib/stable-baselines/docs/guide/custom_env.rst create mode 100644 lib/stable-baselines/docs/guide/custom_policy.rst create mode 100644 lib/stable-baselines/docs/guide/examples.rst create mode 100644 lib/stable-baselines/docs/guide/install.rst create mode 100644 lib/stable-baselines/docs/guide/pretrain.rst create mode 100644 lib/stable-baselines/docs/guide/quickstart.rst create mode 100644 lib/stable-baselines/docs/guide/rl.rst create mode 100644 lib/stable-baselines/docs/guide/rl_zoo.rst create mode 100644 lib/stable-baselines/docs/guide/tensorboard.rst create mode 100644 lib/stable-baselines/docs/guide/vec_envs.rst create mode 100644 lib/stable-baselines/docs/index.rst create mode 100644 lib/stable-baselines/docs/make.bat create mode 100644 lib/stable-baselines/docs/misc/changelog.rst create mode 100644 lib/stable-baselines/docs/misc/projects.rst create mode 100644 lib/stable-baselines/docs/misc/results_plotter.rst create mode 100644 lib/stable-baselines/docs/modules/a2c.rst create mode 100644 lib/stable-baselines/docs/modules/acer.rst create mode 100644 lib/stable-baselines/docs/modules/acktr.rst create mode 100644 lib/stable-baselines/docs/modules/base.rst create mode 100644 lib/stable-baselines/docs/modules/ddpg.rst create mode 100644 lib/stable-baselines/docs/modules/dqn.rst create mode 100644 lib/stable-baselines/docs/modules/gail.rst create mode 100644 lib/stable-baselines/docs/modules/her.rst create mode 100644 lib/stable-baselines/docs/modules/policies.rst create mode 100644 lib/stable-baselines/docs/modules/ppo1.rst create mode 100644 lib/stable-baselines/docs/modules/ppo2.rst create mode 100644 lib/stable-baselines/docs/modules/sac.rst create mode 100644 lib/stable-baselines/docs/modules/trpo.rst create mode 100644 lib/stable-baselines/run_docker_cpu.sh create mode 100644 lib/stable-baselines/run_docker_gpu.sh create mode 100644 lib/stable-baselines/run_tests.sh create mode 100644 lib/stable-baselines/setup.cfg create mode 100644 lib/stable-baselines/setup.py create mode 100644 lib/stable-baselines/stable_baselines/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/a2c/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/a2c/a2c.py create mode 100644 lib/stable-baselines/stable_baselines/a2c/run_atari.py create mode 100644 lib/stable-baselines/stable_baselines/a2c/utils.py create mode 100644 lib/stable-baselines/stable_baselines/acer/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/acer/acer_simple.py create mode 100644 lib/stable-baselines/stable_baselines/acer/buffer.py create mode 100644 lib/stable-baselines/stable_baselines/acer/run_atari.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/acktr_cont.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/acktr_disc.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/kfac.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/kfac_utils.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/policies.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/run_atari.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/run_mujoco.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/utils.py create mode 100644 lib/stable-baselines/stable_baselines/acktr/value_functions.py create mode 100644 lib/stable-baselines/stable_baselines/bench/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/bench/benchmarks.py create mode 100644 lib/stable-baselines/stable_baselines/bench/monitor.py create mode 100644 lib/stable-baselines/stable_baselines/common/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/common/atari_wrappers.py create mode 100644 lib/stable-baselines/stable_baselines/common/base_class.py create mode 100644 lib/stable-baselines/stable_baselines/common/cg.py create mode 100644 lib/stable-baselines/stable_baselines/common/cmd_util.py create mode 100644 lib/stable-baselines/stable_baselines/common/console_util.py create mode 100644 lib/stable-baselines/stable_baselines/common/dataset.py create mode 100644 lib/stable-baselines/stable_baselines/common/distributions.py create mode 100644 lib/stable-baselines/stable_baselines/common/filters.py create mode 100644 lib/stable-baselines/stable_baselines/common/identity_env.py create mode 100644 lib/stable-baselines/stable_baselines/common/input.py create mode 100644 lib/stable-baselines/stable_baselines/common/math_util.py create mode 100644 lib/stable-baselines/stable_baselines/common/misc_util.py create mode 100644 lib/stable-baselines/stable_baselines/common/mpi_adam.py create mode 100644 lib/stable-baselines/stable_baselines/common/mpi_fork.py create mode 100644 lib/stable-baselines/stable_baselines/common/mpi_moments.py create mode 100644 lib/stable-baselines/stable_baselines/common/mpi_running_mean_std.py create mode 100644 lib/stable-baselines/stable_baselines/common/policies.py create mode 100644 lib/stable-baselines/stable_baselines/common/runners.py create mode 100644 lib/stable-baselines/stable_baselines/common/running_mean_std.py create mode 100644 lib/stable-baselines/stable_baselines/common/running_stat.py create mode 100644 lib/stable-baselines/stable_baselines/common/schedules.py create mode 100644 lib/stable-baselines/stable_baselines/common/segment_tree.py create mode 100644 lib/stable-baselines/stable_baselines/common/tf_util.py create mode 100644 lib/stable-baselines/stable_baselines/common/tile_images.py create mode 100644 lib/stable-baselines/stable_baselines/common/vec_env/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/common/vec_env/base_vec_env.py create mode 100644 lib/stable-baselines/stable_baselines/common/vec_env/dummy_vec_env.py create mode 100644 lib/stable-baselines/stable_baselines/common/vec_env/subproc_vec_env.py create mode 100644 lib/stable-baselines/stable_baselines/common/vec_env/util.py create mode 100644 lib/stable-baselines/stable_baselines/common/vec_env/vec_frame_stack.py create mode 100644 lib/stable-baselines/stable_baselines/common/vec_env/vec_normalize.py create mode 100644 lib/stable-baselines/stable_baselines/common/vec_env/vec_video_recorder.py create mode 100644 lib/stable-baselines/stable_baselines/ddpg/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/ddpg/ddpg.py create mode 100644 lib/stable-baselines/stable_baselines/ddpg/main.py create mode 100644 lib/stable-baselines/stable_baselines/ddpg/memory.py create mode 100644 lib/stable-baselines/stable_baselines/ddpg/noise.py create mode 100644 lib/stable-baselines/stable_baselines/ddpg/policies.py create mode 100644 lib/stable-baselines/stable_baselines/deepq/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/deepq/build_graph.py create mode 100644 lib/stable-baselines/stable_baselines/deepq/dqn.py create mode 100644 lib/stable-baselines/stable_baselines/deepq/policies.py create mode 100644 lib/stable-baselines/stable_baselines/deepq/replay_buffer.py create mode 100644 lib/stable-baselines/stable_baselines/gail/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/gail/adversary.py create mode 100644 lib/stable-baselines/stable_baselines/gail/dataset/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/gail/dataset/dataset.py create mode 100644 lib/stable-baselines/stable_baselines/gail/dataset/record_expert.py create mode 100644 lib/stable-baselines/stable_baselines/gail/model.py create mode 100644 lib/stable-baselines/stable_baselines/her/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/her/actor_critic.py create mode 100644 lib/stable-baselines/stable_baselines/her/ddpg.py create mode 100644 lib/stable-baselines/stable_baselines/her/experiment/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/her/experiment/config.py create mode 100644 lib/stable-baselines/stable_baselines/her/experiment/play.py create mode 100644 lib/stable-baselines/stable_baselines/her/experiment/plot.py create mode 100644 lib/stable-baselines/stable_baselines/her/experiment/train.py create mode 100644 lib/stable-baselines/stable_baselines/her/her.py create mode 100644 lib/stable-baselines/stable_baselines/her/normalizer.py create mode 100644 lib/stable-baselines/stable_baselines/her/replay_buffer.py create mode 100644 lib/stable-baselines/stable_baselines/her/rollout.py create mode 100644 lib/stable-baselines/stable_baselines/her/util.py create mode 100644 lib/stable-baselines/stable_baselines/logger.py create mode 100644 lib/stable-baselines/stable_baselines/ppo1/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/ppo1/pposgd_simple.py create mode 100644 lib/stable-baselines/stable_baselines/ppo1/run_atari.py create mode 100644 lib/stable-baselines/stable_baselines/ppo1/run_humanoid.py create mode 100644 lib/stable-baselines/stable_baselines/ppo1/run_mujoco.py create mode 100644 lib/stable-baselines/stable_baselines/ppo1/run_robotics.py create mode 100644 lib/stable-baselines/stable_baselines/ppo2/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/ppo2/ppo2.py create mode 100644 lib/stable-baselines/stable_baselines/ppo2/run_atari.py create mode 100644 lib/stable-baselines/stable_baselines/ppo2/run_mujoco.py create mode 100644 lib/stable-baselines/stable_baselines/results_plotter.py create mode 100644 lib/stable-baselines/stable_baselines/sac/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/sac/policies.py create mode 100644 lib/stable-baselines/stable_baselines/sac/sac.py create mode 100644 lib/stable-baselines/stable_baselines/trpo_mpi/__init__.py create mode 100644 lib/stable-baselines/stable_baselines/trpo_mpi/run_atari.py create mode 100644 lib/stable-baselines/stable_baselines/trpo_mpi/run_mujoco.py create mode 100644 lib/stable-baselines/stable_baselines/trpo_mpi/trpo_mpi.py create mode 100644 lib/stable-baselines/stable_baselines/trpo_mpi/utils.py create mode 100644 lib/stable-baselines/tests/__init__.py create mode 100644 lib/stable-baselines/tests/test_action_space.py create mode 100644 lib/stable-baselines/tests/test_atari.py create mode 100644 lib/stable-baselines/tests/test_auto_vec_detection.py create mode 100644 lib/stable-baselines/tests/test_common.py create mode 100644 lib/stable-baselines/tests/test_continuous.py create mode 100644 lib/stable-baselines/tests/test_custom_policy.py create mode 100644 lib/stable-baselines/tests/test_deepq.py create mode 100644 lib/stable-baselines/tests/test_deterministic.py create mode 100644 lib/stable-baselines/tests/test_distri.py create mode 100644 lib/stable-baselines/tests/test_gail.py create mode 100644 lib/stable-baselines/tests/test_identity.py create mode 100644 lib/stable-baselines/tests/test_logger.py create mode 100644 lib/stable-baselines/tests/test_lstm_policy.py create mode 100644 lib/stable-baselines/tests/test_math_util.py create mode 100644 lib/stable-baselines/tests/test_monitor.py create mode 100644 lib/stable-baselines/tests/test_mpi_adam.py create mode 100644 lib/stable-baselines/tests/test_running_stat.py create mode 100644 lib/stable-baselines/tests/test_save.py create mode 100644 lib/stable-baselines/tests/test_schedules.py create mode 100644 lib/stable-baselines/tests/test_segment_tree.py create mode 100644 lib/stable-baselines/tests/test_tensorboard.py create mode 100644 lib/stable-baselines/tests/test_tf_util.py create mode 100644 lib/stable-baselines/tests/test_vec_envs.py create mode 100644 lib/stable-baselines/tests/test_vec_normalize.py create mode 100644 requirements.txt create mode 100644 src/main.py create mode 100644 src/proagent/__init__.py create mode 100644 src/proagent/modules.py create mode 100644 src/proagent/proagent.py create mode 100644 src/proagent/utils.py create mode 100644 src/prompts/claude/claude.txt create mode 100644 src/prompts/gpt/explainer/asymmetric_advantages_0.txt create mode 100644 src/prompts/gpt/explainer/asymmetric_advantages_1.txt create mode 100644 src/prompts/gpt/explainer/coordination_ring_0.txt create mode 100644 src/prompts/gpt/explainer/coordination_ring_1.txt create mode 100644 src/prompts/gpt/explainer/counter_circuit_0.txt create mode 100644 src/prompts/gpt/explainer/counter_circuit_1.txt create mode 100644 src/prompts/gpt/explainer/cramped_room_0.txt create mode 100644 src/prompts/gpt/explainer/cramped_room_1.txt create mode 100644 src/prompts/gpt/explainer/forced_coordination_0.txt create mode 100644 src/prompts/gpt/explainer/forced_coordination_1.txt create mode 100644 src/prompts/gpt/explainer/player0.txt create mode 100644 src/prompts/gpt/explainer/player1.txt create mode 100644 src/prompts/gpt/planner/l1-p/cramped_room_0.txt create mode 100644 src/prompts/gpt/planner/l2-ap/asymmetric_advantages_0.txt create mode 100644 src/prompts/gpt/planner/l2-ap/asymmetric_advantages_1.txt create mode 100644 src/prompts/gpt/planner/l2-ap/coordination_ring_0.txt create mode 100644 src/prompts/gpt/planner/l2-ap/coordination_ring_1.txt create mode 100644 src/prompts/gpt/planner/l2-ap/counter_circuit_0.txt create mode 100644 src/prompts/gpt/planner/l2-ap/counter_circuit_1.txt create mode 100644 src/prompts/gpt/planner/l2-ap/cramped_room_0.txt create mode 100644 src/prompts/gpt/planner/l2-ap/cramped_room_1.txt create mode 100644 src/prompts/gpt/planner/l2-ap/forced_coordination_0.txt create mode 100644 src/prompts/gpt/planner/l2-ap/forced_coordination_1.txt create mode 100644 src/prompts/gpt/planner/l3-aip/cramped_room_0.txt create mode 100644 src/run.py create mode 100644 src/utils.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a7e244 --- /dev/null +++ b/.gitignore @@ -0,0 +1,162 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +# lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +# *.egg-info/ +.installed.cfg +# *.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# OS generated files +.DS_Store +.Trashes + + + +*.log +*.pth +*.pdf +*.pkl +*.zip +**/.vscode/ +**/output/ +**/overcooked-demo-legacy/ + +# /src/overcooked_ai/overcooked_ai_py/data/planners/*.pkl +output.txt +src/openai_key.txt + +src/GARBAGE +backups/ +bc/ + +# ingore files +models/ +baseline_models/ + +wandb/ +experiments/ +history/ +# data/ +results/ + +roadmap.md + +src/agents + diff --git a/README.md b/README.md new file mode 100644 index 0000000..3d1f1fe --- /dev/null +++ b/README.md @@ -0,0 +1,132 @@ +# ProAgent: Building Proactive Cooperative Agents with Large Language Models + +## Getting Started + +### How to setup +We highly recommend to use Linux or WSL to run instead of Windows, especially you should VPN to link OpenAI API. +It is useful to setup a conda environment with Python 3.7 (python3.8 not support tf1 which is the precondition package used in the baselines): +- Install requirements + - Do it directly by `conda env create --file environment.yaml`, which will automatically install the conda env, and all Python dependencies in it. + - Another choice: + ``` + conda create -n proagent python=3.7 + conda activate proagent + + pip install -r requirements.txt + conda install mpi4py==3.1.4 # pip install often fails + ``` + + Notes: Here we use `tf1-cpu`. If you are only familiar with `pytorch`. Don't worry! The baseline models are trained with tf1, so we have to use tf1 to load the model and we ONLY use tf1 when loading the models. + +- Install the game environment `overcooked_ai` and another supporting package `stable_baselines` locally. + ``` + cd ./lib/overcooked_ai + pip install -e . + + + cd ./lib/stable_baselines + pip install -e . + ``` + Notes 1: Overcooked-AI is a benchmark environment for fully cooperative human-AI task performance, based on the wildly popular video game Overcooked. https://github.com/HumanCompatibleAI/overcooked_ai. + Notes 2: `stable_baselines` package is only used for supporting `BC` method, which is trained through the GAIL in `stable_baselines`. + + +- Download the baselines. We now support baselines: Greedy, Random, Behavior Cloning(BC), Self-Play(SP),Population-Based Training(PBT), [Fictitious Co-Play (FCP)](https://arxiv.org/abs/2110.08176), [Maximum Entropy Population-Based Training (MEP)](https://arxiv.org/abs/2112.11701), [Cooperative Open-ended Learning (COLE)](https://arxiv.org/abs/2302.04831). + - Greedy (rule-based) and Random algorithms are built-in methods in the *overcooked_ai* package. + - For those learning-based algorithms, COLE, FCP, MEP, PBT, SP. Thanks to [COLE-Platform](https://github.com/liyang619/COLE-Platform), we can download those trained models in [here](https://drive.google.com/drive/folders/1s88a_muyG6pVlfcKDKop6R1Fhxr8dcGH) directly, with the structure `layout/model`. + + - Note: The layout names in code and google drive are not aligned with the layout names in recent papers. Here is the mapping: + ``` + PYTHON_LAYOUT_NAME_TO_ENV_NAME = { + "unident_s": "Asymmetric Advantages", + "simple": "Cramped Room", + "random1": "Coordination Ring", + "random0": "Forced Coordination", + "random3": "Counter Circuit" + } + ``` + You need to download those model file and put in the dir ./models. + +### How to Run + +- Build a `./src/openai_key.txt` file and put your openai key in it. +- Run `./src/main.py`. For example + + ``` + python main.py --layout cramped_room --p0 Greedy --p1 Greedy --horizon 20 + python main.py --layout coordination_ring --p0 ProAgent --p1 Greedy + ``` + We support five classical layouts: ['cramped_room', 'asymmetric_advantages', 'forced_coordination', 'coordination_ring', 'counter_circuit']. + +- To run many experiments simultaneously, you can use `./src/run.py` where you can select the layouts and algorithms you want to use. + + + +## GPT parser choice + +### GPT Model + +- Our main experiments were completed between June and August 2023 based on `gpt-3.5-turbo-0301`, which will be deprecated on June 13th 2024, see: https://platform.openai.com/docs/models/gpt-3-5. + +- We also test the `text-davinci-003` and `gpt-4-0314` as the comparsions in our extention version. + - However, the model `text-davinci-003` has already been deprecated on Januray 4th 2024 and the official recommended replacement is `gpt-3.5-turbo-instruct`, but we haven't test it yet. + - To use GPT-4, please insure your openai key has the right first. As to the first GPT-4 version, model `gpt-4-0314` may be shutdown at earliest 2024-06-13, and the recommended replacement is model `gpt-4-0613`. + - Learn more here: https://platform.openai.com/docs/deprecations. + +### Prompts level + +### Memory length +We now support retrival recent K dialogs and use BERT+cos to retrival top K similarity dialogs +``` +# without any in-context in the query +python main.py --layout cramped_room --p0 ProAgent --p1 Greedy --retrival_method recent_k --K 0 + +# with recent 10 dialogs in the query +python main.py --layout cramped_room --p0 ProAgent --p1 Greedy --retrival_method recent_k --K 10 +``` + +## ToDoList +- [] human interaction + + +## Q&A + +> [OPENAI ERROR]: Rate limit reached for default-gpt-3.5-turbo in organization org-xxxx tokens per min. Limit: 90000 / min. Current: 88214 / min. Contact us through our help + +> [OPENAI ERROR]: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by +SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))) +> +> `Answer`: Check your VPN connection. + +> [OPENAI ERROR]: You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer +auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API +from your browser and are prompted for a username and password. +> +> `Answer`: Please delete the blank lines in your `openai_key.txt` file. For example, if you have only one key, just make the file only one line. + +> pkg_resources.DistributionNotFound: The 'overcooked_ai' distribution was not found and is required by the application +> +> `Answer`: You may forget to install the `overcooked_ai` package. + + +## Citation + +```bibtex +@inproceedings{li2023cooperative, + title={Cooperative Open-Ended Learning Framework for Zero-Shot Coordination}, + author={Li, Yang and Zhang, Shao and Sun, Jichen and Du, Yali and Wen, Ying and Wang, Xinbing and Pan, Wei}, + booktitle={International conference on machine learning}, + pages={}, + year={2023}, + organization={PMLR} +} + +@inproceedings{carroll2019utility, + title={On the Utility of Learning About Humans for Human-AI Coordination}, + author={Carroll, Micah and Shah, Rohin and Ho, Mark K and Griffiths, Tom and Seshia, Sanjit and Abbeel, Pieter and Dragan, Anca}, + booktitle={Advances in Neural Information Processing Systems}, + pages={}, + volume={32}, + year={2019}, +} +``` \ No newline at end of file diff --git a/environment.yaml b/environment.yaml new file mode 100644 index 0000000..c8afe35 --- /dev/null +++ b/environment.yaml @@ -0,0 +1,18 @@ +name: proagent +channels: + - conda-forge + - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main + - defaults +dependencies: + - python==3.7.16 + - pip==22.3.1 + - mpi4py==3.1.4 + - pip: + - openai==0.27.8 + - tensorflow==1.13.1 + - pandas==1.0.5 + - scipy==1.5.2 + - matplotlib==3.0.3 + - seaborn==0.9.0 + - protobuf==3.20.3 + - rich==13.5.2 \ No newline at end of file diff --git a/lib/overcooked_ai/.gitignore b/lib/overcooked_ai/.gitignore new file mode 100644 index 0000000..ff46ded --- /dev/null +++ b/lib/overcooked_ai/.gitignore @@ -0,0 +1,128 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# OS generated files +.DS_Store +.Trashes diff --git a/lib/overcooked_ai/LICENSE b/lib/overcooked_ai/LICENSE new file mode 100644 index 0000000..c820622 --- /dev/null +++ b/lib/overcooked_ai/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Center for Human-Compatible AI + +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/lib/overcooked_ai/README.md b/lib/overcooked_ai/README.md new file mode 100644 index 0000000..7ca2406 --- /dev/null +++ b/lib/overcooked_ai/README.md @@ -0,0 +1,101 @@ +# Overcooked-AI +

+ +

+
+ +## Introduction + +Overcooked-AI is a benchmark environment for fully cooperative multi-agent performance, based on the widly popular video game [Overcooked](http://www.ghosttowngames.com/overcooked/). + +The goal of the game is to deliver soups as fast as possible. Each soup requires taking 3 items and placing them in a pot, waiting for the soup to cook, and then having an agent pick up the soup and delivering it. The agents should split up tasks on the fly and coordinate effectively in order to achieve high reward. + +To play the game with some previously trained DRL agents, use [Overcooked-Demo](https://github.com/HumanCompatibleAI/overcooked-demo). + +For DRL implementations compatible with the environment and reproducibile results to [our paper](https://bit.ly/2XoYHAm), check out [this repo](https://github.com/HumanCompatibleAI/human_aware_rl). + +## Installation + +When cloning the repo, make sure you also clone the submodules. + +``` +git clone --recurse-submodules -j8 git@github.com:HumanCompatibleAI/overcooked_ai.git +``` + +It is useful to setup a conda environment with Python 3.7: + +``` +conda create -n overcooked_ai python=3.7 +conda activate overcooked_ai +``` + +To complete the installation, run the following commands: + +``` +cd overcooked_ai +python setup.py develop +``` + +In `overcooked_ai_js` there is a javascript implementation of the Overcooked MDP and game visualizer. + +To install it, cd into `overcooked_ai_js` and set up the package with `npm install`. + +For development, you will also need to install browserify: + +``` +npm install -g browserify +``` + +### Verifying Installation + +#### Python Code + +To verify your python installation, you can try running the following command from the inner `overcooked_ai_py` folder: + +``` +python run_tests_fast.py +``` + +or (this can take 5-10 mins): +``` +python run_tests_full.py +``` + +#### Javascript Code + +Run tests with `npm run test`. Testing scripts use `jest`, which exposes a `window` object, and so +`npm run build-window` should be run before running modified tests. + +`overcooked-window.js` is used for the demo and testing. + +## Python Code Structure Overview + +`overcooked_ai_py` contains: + +`mdp/`: +- `overcooked_mdp.py`: main Overcooked game logic +- `overcooked_env.py`: environment classes built on top of the Overcooked mdp +- `layout_generator.py`: functions to generate random layouts programmatically + +`agents/`: +- `agent.py`: location of agent classes +- `benchmarking.py`: sample trajectories of agents (both trained and planners) and load various models + +`planning`: +- `planners.py`: near-optimal agent planning logic +- `search.py`: A* search and shortest path logic + +`run_tests.py`: script to run all tests + +## Python Visualizations + +One can adapt a version of [this file](https://github.com/HumanCompatibleAI/human_aware_rl/blob/master/human_aware_rl/overcooked_interactive.py) in order to be able to play games in terminal graphics with custom-defined agents. + +## Javascript Visualizations + +To run a simple demo that plays a trajectory demonstrating the +transitions in the game (requires having npm installed): + +``` +$ npm run demo +``` diff --git a/lib/overcooked_ai/common_tests/common_test_generator.py b/lib/overcooked_ai/common_tests/common_test_generator.py new file mode 100644 index 0000000..bfdaf7a --- /dev/null +++ b/lib/overcooked_ai/common_tests/common_test_generator.py @@ -0,0 +1,69 @@ +from overcooked_ai_py.mdp.actions import Direction, Action +from overcooked_ai_py.mdp.overcooked_mdp import OvercookedState, ObjectState, PlayerState +from overcooked_ai_py.agents.benchmarking import AgentEvaluator + +n, s = Direction.NORTH, Direction.SOUTH +e, w = Direction.EAST, Direction.WEST +stay, interact = Action.STAY, Action.INTERACT +S, P, Obj = OvercookedState, PlayerState, ObjectState + +delivery_reward = 20 + +s_a_r_pairs = [ + (S([P((1, 2), n), P((3, 1), n)], {}, order_list=['onion', 'any']), [n, e], 0), + (S([P((1, 1), n), P((3, 1), e)], {}, order_list=['onion', 'any']), [w, interact], 0), + (S([P((1, 1), w), P((3, 1), e, Obj('onion', (3, 1)))], {}, order_list=['onion', 'any']), [interact, w], 0), + (S([P((1, 1), w, Obj('onion', (1, 1))),P((2, 1), w, Obj('onion', (2, 1)))],{}, order_list=['onion', 'any']), [e, n], 0), + (S([P((1, 1), e, Obj('onion', (1, 1))),P((2, 1), n, Obj('onion', (2, 1)))],{}, order_list=['onion', 'any']), [stay, interact], 0), + (S([P((1, 1), e, Obj('onion', (1, 1))),P((2, 1), n)],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0))},order_list=['onion', 'any']), [e, e], 0), + (S([P((2, 1), e, Obj('onion', (2, 1))),P((3, 1), e)],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0))},order_list=['onion', 'any']), [n, interact], 0), + (S([P((2, 1), n, Obj('onion', (2, 1))),P((3, 1), e, Obj('onion', (3, 1)))],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0))},order_list=['onion', 'any']), [interact, w], 0), + (S([P((2, 1), n),P((3, 1), w, Obj('onion', (3, 1)))],{(2, 0): Obj('soup', (2, 0), ('onion', 2, 0))},order_list=['onion', 'any']), [w, w], 0), + (S([P((1, 1), w),P((2, 1), w, Obj('onion', (2, 1)))],{(2, 0): Obj('soup', (2, 0), ('onion', 2, 0))},order_list=['onion', 'any']), [s, n], 0), + (S([P((1, 2), s),P((2, 1), n, Obj('onion', (2, 1)))],{(2, 0): Obj('soup', (2, 0), ('onion', 2, 0))},order_list=['onion', 'any']), [interact, interact], 0), + (S([P((1, 2), s, Obj('dish', (1, 2))),P((2, 1), n)],{(2, 0): Obj('soup', (2, 0), ('onion', 3, 1))},order_list=['onion', 'any']), [e, s], 0), + (S([P((1, 2), e, Obj('dish', (1, 2))),P((2, 1), s)],{(2, 0): Obj('soup', (2, 0), ('onion', 3, 2))},order_list=['onion', 'any']), [e, interact], 0), + (S([P((2, 2), e, Obj('dish', (2, 2))),P((2, 1), s)],{(2, 0): Obj('soup', (2, 0), ('onion', 3, 3))},order_list=['onion', 'any']), [n, e], 0), + (S([P((2, 1), n, Obj('dish', (2, 1))),P((3, 1), e)],{(2, 0): Obj('soup', (2, 0), ('onion', 3, 4))},order_list=['onion', 'any']), [interact, interact], 0), + (S([P((2, 1), n, Obj('dish', (2, 1))),P((3, 1), e, Obj('onion', (3, 1)))],{(2, 0): Obj('soup', (2, 0), ('onion', 3, 5))},order_list=['onion', 'any']), [stay, stay], 0), + (S([P((2, 1), n, Obj('dish', (2, 1))),P((3, 1), e, Obj('onion', (3, 1)))],{(2, 0): Obj('soup', (2, 0), ('onion', 3, 5))},order_list=['onion', 'any']), [interact, interact], 0), + (S([P((2, 1), n, Obj('soup', (2, 1), ('onion', 3, 5))),P((3, 1), e, Obj('onion', (3, 1)))],{}, order_list=['onion', 'any']), [e, w], 0), + (S([P((2, 1), e, Obj('soup', (2, 1), ('onion', 3, 5))),P((3, 1), w, Obj('onion', (3, 1)))],{}, order_list=['onion', 'any']), [e, s], 0), + (S([P((3, 1), e, Obj('soup', (3, 1), ('onion', 3, 5))),P((3, 2), s, Obj('onion', (3, 2)))],{}, order_list=['onion', 'any']), [s, interact], 0), + (S([P((3, 1), s, Obj('soup', (3, 1), ('onion', 3, 5))),P((3, 2), s, Obj('onion', (3, 2)))],{}, order_list=['onion', 'any']), [s, w], 0), + (S([P((3, 2), s, Obj('soup', (3, 2), ('onion', 3, 5))),P((2, 2), w, Obj('onion', (2, 2)))],{}, order_list=['onion', 'any']), [interact, n], delivery_reward), + (S([P((3, 2), s),P((2, 1), n, Obj('onion', (2, 1)))],{}, order_list=['any']), [e, interact], 0), + (S([P((3, 2), e),P((2, 1), n)],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0))}, order_list=['any']), [interact, s], 0), + (S([P((3, 2), e, Obj('tomato', (3, 2))),P((2, 2), s)],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0))},order_list=['any']), [w, w], 0), + (S([P((2, 2), w, Obj('tomato', (2, 2))),P((1, 2), w)],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0))},order_list=['any']), [n, interact], 0), + (S([P((2, 1), n, Obj('tomato', (2, 1))),P((1, 2), w, Obj('tomato', (1, 2)))],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0))},order_list=['any']), [interact, interact], 0), + (S([P((2, 1), n, Obj('tomato', (2, 1))),P((1, 2), w, Obj('tomato', (1, 2)))],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0))},order_list=['any']), [s, interact], 0), + (S([P((2, 2), s, Obj('tomato', (2, 2))),P((1, 2), w, Obj('tomato', (1, 2)))],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0))},order_list=['any']), [interact, interact], 0), + (S([P((2, 2), s),P((1, 2), w, Obj('tomato', (1, 2)))],{(2, 0): Obj('soup', (2, 0), ('onion', 1, 0)),(2, 3): Obj('soup', (2, 3), ('tomato', 1, 0))}, order_list=['any']), [interact, interact], 0) +] + +curr_ep_rewards = [s_a_r[2] for s_a_r in s_a_r_pairs] + +traj = { + "ep_observations": [[s_a_r[0] for s_a_r in s_a_r_pairs]], + "ep_actions": [[s_a_r[1] for s_a_r in s_a_r_pairs]], + "ep_rewards": [curr_ep_rewards], + "ep_dones": [False] * len(s_a_r_pairs), + + "ep_returns": [sum(curr_ep_rewards)], + "ep_returns_sparse": [sum(curr_ep_rewards)], + "ep_lengths": [len(curr_ep_rewards)], + "mdp_params": [{ + "layout_name": "mdp_test", + "cook_time": 5, + "start_order_list": ["onion", "any"], + "num_items_for_soup": 3, + "rew_shaping_params": None + }], + "env_params": [{ + "horizon": 100, + "start_state_fn": None + }] +} + +AgentEvaluator.save_traj_as_json(traj, "test_traj") diff --git a/lib/overcooked_ai/common_tests/failing_traj.json b/lib/overcooked_ai/common_tests/failing_traj.json new file mode 100644 index 0000000..c0f5f93 --- /dev/null +++ b/lib/overcooked_ai/common_tests/failing_traj.json @@ -0,0 +1,1812 @@ +{ + "ep_observations": [ + [ + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 1, + 1 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 1, + 1 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 1, + 1 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 2, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 2, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 2, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "dish", + "position": [ + 1, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 1 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "dish", + "position": [ + 1, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 2 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 3 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 4 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 5 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 5 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "soup", + "position": [ + 2, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "soup", + "position": [ + 2, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "soup", + "position": [ + 3, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 2 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 1 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "soup", + "position": [ + 3, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 2 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "soup", + "position": [ + 3, + 2 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 2, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 2 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 3, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 2 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 2 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + }, + { + "name": "soup", + "position": [ + 2, + 3 + ], + "state": [ + "tomato", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + } + ] + ], + "ep_actions": [ + [ + [ + [ + 0, + -1 + ], + [ + 1, + 0 + ] + ], + [ + [ + -1, + 0 + ], + "interact" + ], + [ + "interact", + [ + -1, + 0 + ] + ], + [ + [ + 1, + 0 + ], + [ + 0, + -1 + ] + ], + [ + [ + 0, + 0 + ], + "interact" + ], + [ + [ + 1, + 0 + ], + [ + 1, + 0 + ] + ], + [ + [ + 0, + -1 + ], + "interact" + ], + [ + "interact", + [ + -1, + 0 + ] + ], + [ + [ + -1, + 0 + ], + [ + -1, + 0 + ] + ], + [ + [ + 0, + 1 + ], + [ + 0, + -1 + ] + ], + [ + "interact", + "interact" + ], + [ + [ + 1, + 0 + ], + [ + 0, + 1 + ] + ], + [ + [ + 1, + 0 + ], + "interact" + ], + [ + [ + 0, + -1 + ], + [ + 1, + 0 + ] + ], + [ + "interact", + "interact" + ], + [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + [ + "interact", + "interact" + ], + [ + [ + 1, + 0 + ], + [ + -1, + 0 + ] + ], + [ + [ + 1, + 0 + ], + [ + 0, + 1 + ] + ], + [ + [ + 0, + 1 + ], + "interact" + ], + [ + [ + 0, + 1 + ], + [ + -1, + 0 + ] + ], + [ + "interact", + [ + 0, + -1 + ] + ], + [ + [ + 1, + 0 + ], + "interact" + ], + [ + "interact", + [ + 0, + 1 + ] + ], + [ + [ + -1, + 0 + ], + [ + -1, + 0 + ] + ], + [ + [ + 0, + -1 + ], + "interact" + ], + [ + "interact", + "interact" + ], + [ + [ + 0, + 1 + ], + "interact" + ], + [ + "interact", + "interact" + ], + [ + "interact", + "interact" + ] + ] + ], + "ep_rewards": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 20, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + ], + "ep_dones": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "ep_returns": [ + 20 + ], + "ep_returns_sparse": [ + 20 + ], + "ep_lengths": [ + 30 + ], + "mdp_params": [ + { + "layout_name": "mdp_test", + "cook_time": 5, + "start_order_list": [ + "onion", + "any" + ], + "num_items_for_soup": 3, + "rew_shaping_params": null + } + ], + "env_params": [ + { + "horizon": 100, + "start_state_fn": null + } + ] +} \ No newline at end of file diff --git a/lib/overcooked_ai/common_tests/test_traj.json b/lib/overcooked_ai/common_tests/test_traj.json new file mode 100644 index 0000000..4b39c9e --- /dev/null +++ b/lib/overcooked_ai/common_tests/test_traj.json @@ -0,0 +1,1812 @@ +{ + "ep_observations": [ + [ + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 1, + 1 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 1, + 1 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 1, + 1 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 2, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 2, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 2, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "dish", + "position": [ + 1, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 1 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "dish", + "position": [ + 1, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 2 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 3 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 4 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 5 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 5 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "soup", + "position": [ + 2, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "soup", + "position": [ + 2, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "soup", + "position": [ + 3, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 2 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 1 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "soup", + "position": [ + 3, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 2 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "soup", + "position": [ + 3, + 2 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 2, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 2 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 3, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 2 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 2 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + }, + { + "name": "soup", + "position": [ + 2, + 3 + ], + "state": [ + "tomato", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + } + ] + ], + "ep_actions": [ + [ + [ + [ + 0, + -1 + ], + [ + 1, + 0 + ] + ], + [ + [ + -1, + 0 + ], + "interact" + ], + [ + "interact", + [ + -1, + 0 + ] + ], + [ + [ + 1, + 0 + ], + [ + 0, + -1 + ] + ], + [ + [ + 0, + 0 + ], + "interact" + ], + [ + [ + 1, + 0 + ], + [ + 1, + 0 + ] + ], + [ + [ + 0, + -1 + ], + "interact" + ], + [ + "interact", + [ + -1, + 0 + ] + ], + [ + [ + -1, + 0 + ], + [ + -1, + 0 + ] + ], + [ + [ + 0, + 1 + ], + [ + 0, + -1 + ] + ], + [ + "interact", + "interact" + ], + [ + [ + 1, + 0 + ], + [ + 0, + 1 + ] + ], + [ + [ + 1, + 0 + ], + "interact" + ], + [ + [ + 0, + -1 + ], + [ + 1, + 0 + ] + ], + [ + "interact", + "interact" + ], + [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + [ + "interact", + "interact" + ], + [ + [ + 1, + 0 + ], + [ + -1, + 0 + ] + ], + [ + [ + 1, + 0 + ], + [ + 0, + 1 + ] + ], + [ + [ + 0, + 1 + ], + "interact" + ], + [ + [ + 0, + 1 + ], + [ + -1, + 0 + ] + ], + [ + "interact", + [ + 0, + -1 + ] + ], + [ + [ + 1, + 0 + ], + "interact" + ], + [ + "interact", + [ + 0, + 1 + ] + ], + [ + [ + -1, + 0 + ], + [ + -1, + 0 + ] + ], + [ + [ + 0, + -1 + ], + "interact" + ], + [ + "interact", + "interact" + ], + [ + [ + 0, + 1 + ], + "interact" + ], + [ + "interact", + "interact" + ], + [ + "interact", + "interact" + ] + ] + ], + "ep_rewards": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 20, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + ], + "ep_dones": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "ep_returns": [ + 20 + ], + "ep_returns_sparse": [ + 20 + ], + "ep_lengths": [ + 30 + ], + "mdp_params": [ + { + "layout_name": "mdp_test", + "cook_time": 5, + "start_order_list": [ + "onion", + "any" + ], + "num_items_for_soup": 3, + "rew_shaping_params": null + } + ], + "env_params": [ + { + "horizon": 100, + "start_state_fn": null + } + ] +} \ No newline at end of file diff --git a/lib/overcooked_ai/common_tests/trajectory_tests/test_full_traj.json b/lib/overcooked_ai/common_tests/trajectory_tests/test_full_traj.json new file mode 100644 index 0000000..4b39c9e --- /dev/null +++ b/lib/overcooked_ai/common_tests/trajectory_tests/test_full_traj.json @@ -0,0 +1,1812 @@ +{ + "ep_observations": [ + [ + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 1, + 1 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 1, + 1 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 1, + 1 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 2, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 2, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 2, + 0 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "dish", + "position": [ + 1, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 1 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 1, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "dish", + "position": [ + 1, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 2 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 3 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 4 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 5 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "dish", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 3, + 5 + ] + } + ], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "soup", + "position": [ + 2, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "soup", + "position": [ + 2, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 1 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 1 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "soup", + "position": [ + 3, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 2 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 1 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "soup", + "position": [ + 3, + 1 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "onion", + "position": [ + 3, + 2 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "soup", + "position": [ + 3, + 2 + ], + "state": [ + "onion", + 3, + 5 + ] + } + }, + { + "position": [ + 2, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 2 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "onion", + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "onion", + "position": [ + 2, + 1 + ], + "state": null + } + } + ], + "objects": [], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": null + }, + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 3, + 2 + ], + "orientation": [ + 1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 3, + 2 + ], + "state": null + } + }, + { + "position": [ + 2, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 2 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": null + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 1 + ], + "orientation": [ + 0, + -1 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 1 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": { + "name": "tomato", + "position": [ + 2, + 2 + ], + "state": null + } + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + }, + { + "players": [ + { + "position": [ + 2, + 2 + ], + "orientation": [ + 0, + 1 + ], + "held_object": null + }, + { + "position": [ + 1, + 2 + ], + "orientation": [ + -1, + 0 + ], + "held_object": { + "name": "tomato", + "position": [ + 1, + 2 + ], + "state": null + } + } + ], + "objects": [ + { + "name": "soup", + "position": [ + 2, + 0 + ], + "state": [ + "onion", + 1, + 0 + ] + }, + { + "name": "soup", + "position": [ + 2, + 3 + ], + "state": [ + "tomato", + 1, + 0 + ] + } + ], + "order_list": [ + "any" + ] + } + ] + ], + "ep_actions": [ + [ + [ + [ + 0, + -1 + ], + [ + 1, + 0 + ] + ], + [ + [ + -1, + 0 + ], + "interact" + ], + [ + "interact", + [ + -1, + 0 + ] + ], + [ + [ + 1, + 0 + ], + [ + 0, + -1 + ] + ], + [ + [ + 0, + 0 + ], + "interact" + ], + [ + [ + 1, + 0 + ], + [ + 1, + 0 + ] + ], + [ + [ + 0, + -1 + ], + "interact" + ], + [ + "interact", + [ + -1, + 0 + ] + ], + [ + [ + -1, + 0 + ], + [ + -1, + 0 + ] + ], + [ + [ + 0, + 1 + ], + [ + 0, + -1 + ] + ], + [ + "interact", + "interact" + ], + [ + [ + 1, + 0 + ], + [ + 0, + 1 + ] + ], + [ + [ + 1, + 0 + ], + "interact" + ], + [ + [ + 0, + -1 + ], + [ + 1, + 0 + ] + ], + [ + "interact", + "interact" + ], + [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + [ + "interact", + "interact" + ], + [ + [ + 1, + 0 + ], + [ + -1, + 0 + ] + ], + [ + [ + 1, + 0 + ], + [ + 0, + 1 + ] + ], + [ + [ + 0, + 1 + ], + "interact" + ], + [ + [ + 0, + 1 + ], + [ + -1, + 0 + ] + ], + [ + "interact", + [ + 0, + -1 + ] + ], + [ + [ + 1, + 0 + ], + "interact" + ], + [ + "interact", + [ + 0, + 1 + ] + ], + [ + [ + -1, + 0 + ], + [ + -1, + 0 + ] + ], + [ + [ + 0, + -1 + ], + "interact" + ], + [ + "interact", + "interact" + ], + [ + [ + 0, + 1 + ], + "interact" + ], + [ + "interact", + "interact" + ], + [ + "interact", + "interact" + ] + ] + ], + "ep_rewards": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 20, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + ], + "ep_dones": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "ep_returns": [ + 20 + ], + "ep_returns_sparse": [ + 20 + ], + "ep_lengths": [ + 30 + ], + "mdp_params": [ + { + "layout_name": "mdp_test", + "cook_time": 5, + "start_order_list": [ + "onion", + "any" + ], + "num_items_for_soup": 3, + "rew_shaping_params": null + } + ], + "env_params": [ + { + "horizon": 100, + "start_state_fn": null + } + ] +} \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/.babelrc b/lib/overcooked_ai/overcooked_ai_js/.babelrc new file mode 100644 index 0000000..3424f2d --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/.babelrc @@ -0,0 +1,11 @@ +{ + "presets": [ + ["env", + { + "targets": { + "node": "current" + } + }], + "jest" + ] +} \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/.gitignore b/lib/overcooked_ai/overcooked_ai_js/.gitignore new file mode 100644 index 0000000..cd75bf3 --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/.gitignore @@ -0,0 +1,253 @@ +# +# Node Package Manager Stuff +# + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless + +# +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +# + +.idea/* + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/dictionaries +.idea/**/shelf + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ +cmake-build-release/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +*.pyc + +# +# Psiturk stuff +# +# +participants.db +*.log + +# adobe files +*.ai +*.psd + diff --git a/lib/overcooked_ai/overcooked_ai_js/.gitmodules b/lib/overcooked_ai/overcooked_ai_js/.gitmodules new file mode 100644 index 0000000..a69cbb0 --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/.gitmodules @@ -0,0 +1,3 @@ +[submodule "python"] + path = python + url = https://github.com/HumanCompatibleAI/hr-coordination.git diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs.json b/lib/overcooked_ai/overcooked_ai_js/assets/chefs.json new file mode 100644 index 0000000..042ebfb --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/assets/chefs.json @@ -0,0 +1,895 @@ +{ + "frames": { + "EAST.png": { + "frame": { + "x": 1, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-bluehat.png": { + "frame": { + "x": 18, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-dish.png": { + "frame": { + "x": 35, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-greenhat.png": { + "frame": { + "x": 52, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-onion.png": { + "frame": { + "x": 69, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-orangehat.png": { + "frame": { + "x": 86, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-purplehat.png": { + "frame": { + "x": 1, + "y": 18, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-redhat.png": { + "frame": { + "x": 18, + "y": 18, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-soup-onion.png": { + "frame": { + "x": 35, + "y": 18, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-soup-tomato.png": { + "frame": { + "x": 52, + "y": 18, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "EAST-tomato.png": { + "frame": { + "x": 69, + "y": 18, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH.png": { + "frame": { + "x": 86, + "y": 18, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-bluehat.png": { + "frame": { + "x": 1, + "y": 35, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-dish.png": { + "frame": { + "x": 18, + "y": 35, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-greenhat.png": { + "frame": { + "x": 35, + "y": 35, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-onion.png": { + "frame": { + "x": 52, + "y": 35, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-orangehat.png": { + "frame": { + "x": 69, + "y": 35, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-purplehat.png": { + "frame": { + "x": 86, + "y": 35, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-redhat.png": { + "frame": { + "x": 1, + "y": 52, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-soup-onion.png": { + "frame": { + "x": 18, + "y": 52, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-soup-tomato.png": { + "frame": { + "x": 35, + "y": 52, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "NORTH-tomato.png": { + "frame": { + "x": 52, + "y": 52, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH.png": { + "frame": { + "x": 69, + "y": 52, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-bluehat.png": { + "frame": { + "x": 86, + "y": 52, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-dish.png": { + "frame": { + "x": 1, + "y": 69, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-greenhat.png": { + "frame": { + "x": 18, + "y": 69, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-onion.png": { + "frame": { + "x": 35, + "y": 69, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-orangehat.png": { + "frame": { + "x": 52, + "y": 69, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-purplehat.png": { + "frame": { + "x": 69, + "y": 69, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-redhat.png": { + "frame": { + "x": 86, + "y": 69, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-soup-onion.png": { + "frame": { + "x": 1, + "y": 86, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-soup-tomato.png": { + "frame": { + "x": 18, + "y": 86, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "SOUTH-tomato.png": { + "frame": { + "x": 35, + "y": 86, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST.png": { + "frame": { + "x": 52, + "y": 86, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-bluehat.png": { + "frame": { + "x": 69, + "y": 86, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-dish.png": { + "frame": { + "x": 86, + "y": 86, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-greenhat.png": { + "frame": { + "x": 103, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-onion.png": { + "frame": { + "x": 103, + "y": 18, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-orangehat.png": { + "frame": { + "x": 103, + "y": 35, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-purplehat.png": { + "frame": { + "x": 103, + "y": 52, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-redhat.png": { + "frame": { + "x": 103, + "y": 69, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-soup-onion.png": { + "frame": { + "x": 103, + "y": 86, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-soup-tomato.png": { + "frame": { + "x": 1, + "y": 103, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "WEST-tomato.png": { + "frame": { + "x": 18, + "y": 103, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + } + }, + "meta": { + "app": "http://www.codeandweb.com/texturepacker", + "version": "1.0", + "image": "spritesheet.png", + "format": "RGBA8888", + "size": { + "w": 119, + "h": 119 + }, + "scale": "1" + } +} \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs.png new file mode 100644 index 0000000000000000000000000000000000000000..dd0590cbb059671f4d9fb8aaa859e00023d3fcd1 GIT binary patch literal 3121 zcmV-149@e3P)#DMYf2wvq$Ur66q11NeQ?0WF34^2)(`TWRyKD_UK{cs^trFu4N?ky zEUilDLx~Jkt&}8i*N{HcG>{OfvZ1uLTYaRCY-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iyRl55zyec01URs zaj_Wz4UP-IV2d0Vn-S39xBv{c$Z@e50S%4|z+j6U7n>2#;J5$`w#ad@837HB3&3ED z92c7r(BQZL47SK|u^9mkjtjtGiyRl55zyec01URsaj_Wz4UP-IV2d0Vn-S39xBv{c z$Z@e50S%4|z+j6U7n>2#;J5$`w#ad@837HB3&3ED92c7r(BQZL47SK|u^9mkjtjtG ziyRl55zyec01URsaj_Wz4UP-IV2g+1nj3v<3km2~wd~OEWZAuaHvRq=(OF(?3&P$@ zf^hRaLAbk5KYtU1EhGrPUl#=HQ$ctx{P^wf&QslmmDb`~{}=o3{rxkK9Y=RAUg&*w zbKkF?`snVZE!j+U)3+}y!cb&_Ge$;Iz}z`_a779|7Y&h`k!w# Q>A%9txy!9D&t8A`U&?)`jsO4v literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-onion.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-onion.png new file mode 100644 index 0000000000000000000000000000000000000000..a40ee1f4120e59f2553eb468e24dce5e02088d22 GIT binary patch literal 18190 zcmeI4Z-^vE6~KErST1`x0-j(_M4CAjh4l9S?&)@RE|;C#?22<<_Ey~eAYM&%^=@-B z-IMO#-MRY|6v5~U{^3AG5LASqD42jB3?!fi#c&}A5k%1>A0#4(kPm16aH*c2?s+pi zb2V{K;iLw3_igoiud05p>Q%k|Fppon@bJln_b&*7aB^+6u}=Tqm;D@{r@ue`()CZ! zKlgN3w-P}(aVqryVA4 zZ>iGv>ry#umMdakCB3p#IhS=PZZT6nxa~=;>fBY zDXObDuA+*APo=&j76sj`!%U00U(_xBg~^~EUOmQ}}bWJQxTO`;l7 zay3j*PYRPWxs$?AgCsZ(x@i!FV&)gMqTO_O{NlPLxK;PBf*<^6}J;X-t~UvhRuG?Q|w~ouudY zD1rgfiI&O6)h?0ONfPbGn4I6EQ#mtf_DQ-QMeTaNTrU=}5SN#;>$4OTw~JcPDKTZ;$npq^(SFT#Q64m&k0-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*{>^)S`-rEX(Ej$12Tncx<*)w!#@GBO*WTFr-rEOr zH=Z}1JALX0H&35=_Wl=NIsK!P2L}iDZr^zRPsgq&rgZ`T>bTPW>mPn9-~02hgKob5 z+7l->cI+2#`1ny$A3D4I{hj-c9sA|n{QUgGKmOOjdzD*Xf9rS0Pdxg1 y@44g3%F4>YgKyF?z2tpGdg}4{$L54DzMy>fhd=vl_RTlK+W8BOpFDK=^X~v*jocCd literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-orangehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-orangehat.png new file mode 100644 index 0000000000000000000000000000000000000000..7fb4aa02a1600a4856d934d407aec1f4ce4a853d GIT binary patch literal 18080 zcmeI4&u`mQ9KbzILaZ<$jY%+skd+AuBwYW9W5-^au{GUVv}{!uM0cXk&(E#3#16LG zW;^ji9FVwxgai|R0SE5DffG02fPe!RByMm4jz~!5IkuB;QfDut18LHW)b`uw?~nIB z-}me5L*7}xdimtSQwxG1oLpONZP34ur9TfpM1PpA-Gn8?hif@_71lOt|y$ zlY+4Fv)|cFHrrQh9QGEG8#-ih(CbreL1>&G^bx*E644>sey~*e{fjRvqVFzMUa7T} zc7K`d_^Y=ga{czz4!(U8TW;libD=S?se>L#kT~ddgV-J{Rfc|TDyPkIMI5RmHFWqE&pe{sLM7)IN&YFU=7XtJhBR6~ky1qm8RL3}oIQut|+7)O3T z@xwq&{URsaO_nN^G|=dikE_=o1q$Mv9i=D_P+wLT6}imF#Uq>kZqyxi&BZe5k{$_? znA)kOcKw|&3FDn`M#$0QnSp6e+U-&7(*E{(rJ>_wWsf4rk(OG3jjbX!q? zlT35UM>}+V@7CCds!593Q7!7g)~UsE3lK-$UC( z?g!fqdE5vzM-$Xu4!dDQyG5GShFsQMYSjwyZn{D)1enA$9Wh7~P1bM^xQMnVTZ;!> zznSeoZis!?9tYJ8uclhMDQU=5B~>-CWGQt^axpehO~*A)^%`=z4^S85e&w?xZ>RZQ zbg5hHD4L~ts)UHCNP5jMBuCe)l5QwQy>59X!D_j)taY;ckj>o&pU$av+g=Oe1W`6? zt!COEpZ2G!7&NAbq#80*NjDW$aty_hRL8-dPHH;R@o=I|nvaK>yDp+r*X0zeo?}vn zs#HZZT29e5BoCR$bv;)nmR{(5!5Q8z{3Sy`;`sD)q_rNqrRT9Jp=7&k~>BYllz(@K(7 zHN*R1la}s>+JLv=v(2<3?CuULK2uZZM^@9{xhZ@+ZF=MGrttB!>Dcn+z)zZ59&M@_ zSf%f}vez)z>HA&MG-|bKtszf0Pg|_}1Jd1W`SdkRoYu5zVKe=p)bPeEL+~Is%$5y! z6FW>y)=J;=(pSv#=p8f28Mw{dZ*e@L`|TO{<3Runw#ad@837HB3&3ED92c7r(BQZL z47SK|u^9mkjtjtGiyRl55zyec01URsaj_Wz4UP-IV2d0Vn-S39xBv{c$Z@e50S%4| zz+j6U7n>2#;J5$`w#ad@837HB3&3ED92c7r(BQZL47SK|u^9mkjtjtGiyRl55zyec z01URsaj_Wz4UP-IV2d0Vn-S39xBv{c$Z@e50S%4|z+j6U7n>2#;J5$`w#ad@837HB z3&3ED92c7r(BQZL47SK|u^9mkjtjtGi+9DfF#gsS640+|*{9#ha%~wa^!r>yyt>gA zgxk*w!s~Ad!e0mU@2`TeOP~F=B?$J1g78H6{;OYIqPpkSS{FKlpPauB4$dEc`fI24 z%hoaf;LLlUU3v7hkbLv*;Ct=VcUMkrwf?NW{p~Y9G(P$0^E=0=-NC_e;q)IT&Rl-u S#f1JVtgT#aeR^^0&3^z%T&YO_ literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-purplehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-purplehat.png new file mode 100644 index 0000000000000000000000000000000000000000..2413ad4f6841a82e00475d11d303d9388b5980db GIT binary patch literal 18082 zcmeI4&1)n@6u^5CM57|Cf~yBb{oOO&PG(&*yPL?)x@03}Po}1;I%#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J7y3waGSZ&;&?_k+B5JcIsq{FqQJ#x1T+LL0D~_I zTzp1AL*N21_@cnYX9P3^E&zis3S4|fKttdHF!-Xt#b*RG1TFxBFA7|IMnFU00xJR-0$m`#-e* zIy^jm%boAF-hbt%%@bc3-<*2=&kJ|nE2Uq)*8f&N`Spd9o6SFr55IcwyZT4(eDdxI fW_fsci}b+@3-@pR{=#|oue5shV)NrCH(&Z24@#;M literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-redhat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-redhat.png new file mode 100644 index 0000000000000000000000000000000000000000..f87615603898921ce9c6a6ff3434d45593797e93 GIT binary patch literal 18080 zcmeI4&ubi29KfdtVxvWuO^ErNoR`ML9}n=NTJHIZ&DX~gto-@bX14BegC&PXZO3C*}Sc(Lgg(a`R2{{$9tde zd*Aoo9QK_nmtQ_L_spCi2&Yz88f*0L{~WAuq#MmkE{;0$$ctKJzSrqeZ9%A=?{yKrK~k|rHiK}X^7|KGR>Z(tsJvcn zD$VW^*$P(nV{&!>@;ctXfgP`MzCKs$xzs_2q)6;_+F|1M7Ak$eE|s%pxgz#e(i;nv z#Vnw>(YzuqMKKYp^QMGV-4-opUadN|X1pY7ifYP=Bddm_sIKC;iYg91mHHf&YO&|L zYmJM8aP+^0%2t|oU0L4U-JRdn=c9O2RvpKY6;0MOiE2p6UYMeu6eeeLCxxE|NpKu= z(;y1P%r9z1+v!53k_8%m2IJ~ZRsd#Ed`^NL(%b*ozl=ry1YXX43L&uChL1$BCnAo+Kw?< z-l0P|TQ>S6T_dCH%;1WumpV!Ve~O>%$y5lW7fdnBp5$izIhCinMxnV&F+ph*uSZe4 zo=?{+MJ~jprEGdy;tNfLgD^|bi#2)DXf$<3{zwC*q)u&ZNpU2_Ue|P2w_VMY6vI^% z;3U_a@X?ICz~3ABP&G-h)>YG0Y*)1;r8@KhG$(z~rRbp)&Ey5@0zV#h{V49Bv>tTO zCX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onion.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST-soup-onion.png new file mode 100644 index 0000000000000000000000000000000000000000..45d1e750b4c72f7c5a4806c0e3c716c876ffe051 GIT binary patch literal 18184 zcmeI4ZHOer8G!qYoVw9dG+;Opno&W+_4LQ|^jBs_&z)U&HFG)lX1Tp!$klXL?>0Bn zJ$Co*&Mqg2qMUzJL`6h7Lgnm3cV=g< zM)wp>YG8KWt$shMp110)uKv*v9XxQ`Wm9{nIF7q)VZO3RelJhH7w;y2fBNAQx09bs zTJuLDj{D(N$#)m`^fN!^xYD>M#AirEa$j<~J=8Jhvu;qfm>tm~ z)E4~cy3|SLr-CCp^jfhO_=66L%kjxuuW zo=s~lY;?Nj*dlJ=Cidfq*vTX9TB|`EM61D=kiE-e1CyLotG(DG``c`e3?0R@>jXg; z=}60{w%NksB94N!(8jatWGL5-8hsQm;(m4}a7ENdI*L7ajGyGnSO~c7jWJ8Eq-LEt zm8QBxpjk5^MsX0_4%Yv-e^yDllF;>rTTx+JJYO%v*>S`buC(hS3Nb!^L{ou#dV z-G^+>Huz*tRjby5AH|5US*Vng{&=K6rh<{C6kNfy3#1o@;Rr?@IfAY!2uawnHG^be zn|XhjUDsK3;(9bi6Jy7fRY_3l1v90H3Wg-OripZwd|iyPK)~6yKtB&Xvdy3d(8<^q zuq4C@alx<^$H8?K+eIx)G|1!d5R<_G#GSn$spDEr)+|Y}WU?2ebsT7ocQVLxqK#^j zMD%-UuOfd1J7qB&Th=h#r*AQLcHpn$@arrjvRo0l>BMBiaKoU<_x3414tUgRH9Q+7 zD^y(fo$f7MZ+plF3VeKrV|8%oeVv&KdfCIopJ!v<@!Fhh4^AgOTbsRIr+Wj{@OH4p z?KpRJUDDLLBMYwT8iMMOQ<^Ck6v0(=a~1QqMNtgGkGn0LH3Cp$}g+6bl;y#?pBf$CRrtv z0|&W{B+p4KP!qEw;G`vW$b4WmcD*~@1NhieprUHzgWcpTt&TlQr(FfkM#TztdJs&b zjBwMBmgS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0S1+M$;p&VdC^oD;GAC z52hNPoMi|ec%Ms&SB1AibdlkrGXfe67l1(*87?{_puunf7<7^0qB8;-3>Sbw7a1-(BcQ=>0T^_V;i5AF z8VnbJK^GY=IwPRLZ~+)}k>R2<0vZe#fI$}-E;=Ki!EgZ>bdlkrGXfe67l1(*87?{_ zpuunf7<7^0qB8;-3>Sbw7a1-(BcQ=>0T^_V;i5AF8VnbJK^GY=IwPRLZ~+)}k>R2< z0vZe#fI$}-E;=Ki!EgZ>bdlkrGXfe67l1(*87?{_puunf7<2F%Cc3{~ zZ7#0&-?;SiqYE!cpKo@S{#0MOdf&m$Pp&+1?^EZma#zuj=Ps7-f9%JXzVMZsHeSE- z@P+2;$`iLAkX!ri{X_Wvd(U4!`pWOrfBh}_;PsdP{^Wbk0~h0?zU7`TW{sUHB+$;b9 literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/EAST.png new file mode 100644 index 0000000000000000000000000000000000000000..7a823f9c8afeb25c2cd1392d6a940a34583087d7 GIT binary patch literal 18037 zcmeI4UuYaf7{IqLrA9)lA{IqhuC-Kfvwv=P?{<5+n&wgy_1c(5nkdrF&CXqx-0hyb zo7^Q28mjmQMX*v)kv<731wlj*`e6H@FNKJrJ_!2cgNmq+`l8P6-tEm@?lLJU)xsR4 z_jUIBzM1)bGvCfP5BK8qu?L2S?i}JcZg^_4FoVB$hkv_v;(rf)d+tH}byIzE-siZR zZwvo+aBsc6m*Xau?b*3tuK2JC-P#DS+!7jT*6LWB<8p_abpRJpz?V?Pc1BabU;H%1 z+tz66q*j!Q^>MUdPp*3C#OkqGxVi`pD|I+Olxv#UK@A0fZ`P`gZ#G9$kzW(bVY8Ux zBb8urG&L4>$j=q0`El1nyf&f>P)=w0j4>i>MpjYp;}uEPMad9lRgh#;GE7P4Tc1>Z z2unH7Dw{Kfqpj}n|3*^_K~OhEvC(LZG}0rkR}p2yFhofa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assets/chefs/NORTH-bluehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-bluehat.png new file mode 100644 index 0000000000000000000000000000000000000000..13e89649d22ab98d8ca6d815da5faedfd03ef623 GIT binary patch literal 18091 zcmeI4PiW*+7{Id%i&hsw53UMJm_<=A&Hv0KPG{+MwzlG|OSfXzi@tezY2(f$F-hC$ zo)$gnMGyrM&)yWzdhjH8QxH7p!Gm7hi+B`-`ZAehzL{qB&DvGixmrHjv>T6lax5QJ0fYwZpC_o3|PzLWI#b3cCg0{wG;w00#Cga;nUeohDN|NQEfqJo*P66UnQy7CEI?mRQuzruWO?3F4bN!J4z>7 zAv^xswU}JKc5xG5yNYeMcCNM195~cLpQK0}^m{?#43=s`zYdkNX1OK~Rnn_VwdE|J zxYfBNu7oiW%|%PXs@@Rm_M&Rq4b6B~)D+c{6x*H$EvvR|%ZesznnX3E4XgBT+yXIn<^hlosX+rJP zO1o$$Ov7X+oDs5oJToxONvBiBuIz8WUl}?{FYHkSBczp<$>u>sTnWj8#G@d$Rf2564(xSEvNwFoRv8m~f-f%QaQVd5?fRkKv z%10-3eeYoGL)9duzNy-dt~#bFDQ4*dXioc}OVLFsn#&8+1%6!YcwyW}Y0K}UZ6Zg( zc2gcV0?l%QIxAr>jA^$>OK-|m&6QT|5btIyWI4bjq3K9KnrO0yd%$_LJ=t13==rUD z2XaH~yUsYMVR@!%8+A!TbyZT;I+kpuVM{K?bz~aY^i;1YXZrwkG49uBc8uC-z878U z7IziR);v{0q^?MYX<1U&Fm%bV6sys&y*j~awX?i+vip$D%?6*%sZPgP50Vs7HtX$H z)*qkt2VqY!v4JJiFkQ(oY$7!jQ*CS4xLplm%&vTak5w621b zF0l+9HHr`wZjOXn^Rr2GFqzZgB)UxAoNOIWqTzuMp*SJgcDGb3_Pg=~$>+srb_};o znuP2qY2j=WA#PKiXdQQ}v~1=I{?T;Khv10$>=^qyB)HiYl)D;g&32N6Ub>HBvb;?f z=Y0EP?sw8~IzaV0xh<(k(B3fzagY#gYsS*QG99;!*=^u1mTG!KPIt8su?$ zh}mEO;^A4K(oM+PR4qr*9F?90`92P`W;>bWIoCloPa?*>#5*Y1CT>eE##S^;_vt^( z9S(y%65q-~qRSQ0ODCZRh8Kr@u{@{5G!#)3^?Z!76)Nuq?&u0v9uLJpfsg-jtS*WD zTbZe#mnA0g4jc2a*XDd@a6a+*+AL3<(FLmKALEESe(s1>S8RGqF}ht(G8(o*Z&C`9 zu&W~4qPcp#JV0+Xca`^JzORSt zO=z;BD5{jB6-ZHT<>&rtc3a6ROm@LRuaWdUi39e;q6EZqZmCn|6Stg^cXw2P&#VG9 z!=fMJWwo?XRDnlo>Ab7JSyim?xP@RIrNYfPT9JqL7&oZ@zphjeq=TKJu-!lr%kWi+!Q{ZHXU2O9QbKV8%3LH23Fa-uKYF3 zW%_=Xv@Fxq&89rvJZ*8wACTTw+o!K#lB}jx3!CW&m4;Vl8G;8R!+hC*H?hOS1mJb%Le@4I0MZ{|x9YMJEq##^> zTM+&_qg#I)%EuB=HRF9--n0i?tM`C^tbp25O z;WX+!b#g)Y(p$af#$$i_pMLATYw8dG>Yk*Z)!)896K%iu#+eU3K0#d^9^NaQes$pq V^^-4trvD1-7cRCxKmYn${{U48tf>G1 literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-dish.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-dish.png new file mode 100644 index 0000000000000000000000000000000000000000..3d747ea6d030334a0cfb274ea09cded2c6cf35f3 GIT binary patch literal 18182 zcmeI4Ux*~d8NfRU1YL9Za1ccZv~wP6Oi%xr?w;;;cFel7=WdcYH+z$0&m-|_s;hUK zo9Q0Adw1s!l|vEH;Dd)pj0hTHNb;Z|M@$|S))Cp|6g67y$eiSUY9z*y-%0#15L3UX8Ez%>g+dx=@ad1M-5CT5;yyb{QSPFStQHk{ zl97uCHl3}g)$5vzWzr&T5+pITQzzPWHp3*0H^V6*2al%)ra7tC2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jy|5{KJZ?I){9fQERa(>cIy2S`tkQQ~*=v|1^!+ZWnubv_D)M;qxW%g9C9U=_ zgX01)*doWpW&|`iE&ziqa$IaiK!f7~FxVo;#byLFI4%H#Epl9JMnHq(0x;Mj$His@ zG&n8*gDrAgY(_wX;{q_)BFDvM1T;7<0D~=ZTx>=_gX01)*doWpW&|`iE&ziqa$Iai zK!f7~FxVo;#byLFI4%H#Epl9JMnHq(0x;Mj$His@G&n8*gDrAgY(_wX;{q_);stTd z4ZpR81oW#~cIbDq96s@JlYXCzh?m#uf^h1fAe_Em5I+8t{(V~zwiH2l=eQs^j|;+8 z;h8&MK16kYwo+SYbpQFxnHTrnuY6_csqf0RdrkE2^YMp&fAs5TzqWeSwKqSu|J$`s z<`-W7=C4j)zx42d*YAA)4=Zo}_^GE)Kk}1@zts4}bDuUoy5WlMy#?R-_s|Tw_~r929egqt?)uO9PhNZWj<^1F{vSUQ{wDnXFX#Pt zjy>!A?z#u>E{5x^FaGxO@2{Tw*8_JSfBdKCnrA=Qc==fOO5x8B9(&@~=N@^Lc2-zf MI$V41*5mj67p(K#ApigX literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-greenhat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-greenhat.png new file mode 100644 index 0000000000000000000000000000000000000000..a76c3bb7dc215a9702c52d19eb7c3eb9a92d0322 GIT binary patch literal 18091 zcmeI4&u`mQ9Kby$O;DJS;J^mbWMu+@gySFakJzM{x~5$_kukMJv|QMW{hXR5wz1td z?P+2sxF8{r(8L*W;tzlWCnQc2Ck|XVz=d4^i3<`^d5+`co7Cyc=s+5Jk=lOy{QdFX z=lgzreaL&)uU$Di_v{?Uac5Uo8f)b5lj+Z+XUOkYzW?|t`SVz~vK4dO<4>nQr?@+x zp5wTsAH9vuWV89IWe43da)K5v_qrj`=D6CWUWn|QIN@8k?fLViU%&dg#Cy(s=?$$Z zHN!=`?X4U{c>UnohJA3;Hl5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b~SL)DsC({XR0 z4Vw?TnYzwuC$7g+w2OvrmsBIBXiTJ-v=cbnRMCOJCEE;Y0iBF(0n3h~7c??GP}~nqqh(-M@p>S;}O z68cWGjsm=AnM}^<*2l!}u;FM0*~4F z=Pl38>2e7+H-}S)+Lk0{4~Q&aeO)O6|0rttBo>A>=4&yA`| zTH8o5u!`@xl53bl7N&pPH$Z*ja0S$%=z@Uo^7o8E% zV7LGby2xTdd&|tU#47$j0(HQ{^h6});iwqZ?5zt_`01UdwaM2k7 z4TcNApoTdd z&|tU#47$j0(HQ{^h6});iwqZ?5zt_`01UdwaM2k74TcNApoW5t?kG|MBaLI{nN8Y>l-_NyXpQ^la`Oc-2?_B?x^IUG}rk_85 d>hP%@oZrQ#KdL^tNLt9v@7-Vf$8|^k`YS~y+1LO8 literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-orangehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-orangehat.png new file mode 100644 index 0000000000000000000000000000000000000000..2bd73c95ff281bb012b4c185ed09c5e2ee99173e GIT binary patch literal 18089 zcmeI4&5zs06~Ji+FzPLg0PP`7QUrvI6fF=gzbTQ{%CJ}7>=u?|tT)K|6px0(UDgt* zlH6UbPeFQWE&&P`D2$wPNN@QA(nC%Ga>ya49CAs}o|;S1Q&Awm=1~--CoScXvu*(c zLqMyy!}s3I{N8-MIp~kKZ@qqL<)sx#k}hp+wzuK?`TX;f3-I^KSAYI3d|e!D-c2Rx zr$5g>=cGp;{6dm$d=u{MX1kr69*z5}#E-jdb=V((wj?#L4hMwZXPMk(dttOz``6z- zt;wOkR(s3tXq~}2+YdJ%B<#+ETRZf@ed_wPtF4vh&;tj3mJxZ_??tIMT&s=zdLZY; zYE2%gWcSx<*YXPG-Og=!Jx-WxuR03V&4yfeS9RNM7}jgDq3MpQxvFj{n(k??r|I(e zskK%>Y9@Z*ZMQeZ)xm#jwf!s`c&d7IbhLV8uExops=KbMYKCeU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Pw=3i7A z-d$vfUW^TkX@hQJM}a9y;hq<+nAOQ0Gm05H%{*;!+M}oK8Tk{HAQ*g6;Nmkv8Uh!B z!50NCJ|mapBcvg4AsBp7;Nmkv8Uh!B!50NCJ|mapBcvg4 zAsBp7;Nmkv8Uh!B!50NCJ|mopK3XR-(y&b;8jU_=MR$f-xK)$rz9O{lJwm@N%H<8NiW2Idi%2t&~0zEuk8%K z?tXuAa`m}ie$j3J{aYzKd6C@w)rA%5lVIcgcQ5`s{OI%GJ=^@*Kl}^uY&`t(mHoZ< lfA`A6N9Vx7$;orlUq8I~vNt$?1^$(`Zro~reEr_LKLD6gq>TUo literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-purplehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-purplehat.png new file mode 100644 index 0000000000000000000000000000000000000000..c2247cf58a15984f56d8fc0033c0805959315929 GIT binary patch literal 18091 zcmeI4&2QX96u{k9svuC1K&Smn z-#8@*7k&!X*3K&^T>-@WWLwwQf)z~o$YlIzD829MK*$Pq4N8eUsc4wTd2Hh zHkD>~k!%Lbdoj7ZcX18xUBix7Ia{Br^<3(pLsBI6I_)rVdkdAmUzf^Rvs@ATD(SU_ z%DJpValLs-T#RBOn)8-~RlO?O&b(?mRn2%#)D+c{6-QPLNl{(JaTQe@T$TD9m1?o) zyQ__*L3i}Oh011{c3oNC+1Z)j(dVOhLslKfkrhqWG>K|R$!?gUo)ji$awmnK21#%n zbkiUT#mp~iMO*1YrIK|tyaw~?bcY><$$%ZDDEClTR_7JD%*ew-o9)@I!P~VQv?H~rIyLsZkNcbB#E|S zOfGEGshlaBeUh${QFLZ-Mb%3krGY=iPj+W21kwwpm}Pfzv;LaOLtUfL+{KunG>X@v zs9n#O>!l(V;^JbqJZ8@UNHA_+q zS5bhITyw%lGx7p|cjQCWB*k7+9anQ)U6&Md=mTg@`k-6ULn)fc3)BUEJnZ^W+(BtQ z=%5WEcf*aEJZc1*!v*RtM(rr3!yQKyFGo2p~jl7?(mQdJvEj#70b4`Umd1~z@wugO^+pe{z^8mx{% zJB|0eN8RFeRoY;HICY)v(r?n;=X zh_YE})U)vf*?3f9Sy*=@$HAIpI7E{i-DpX+PITR*KbAuJ3vJwdG|hqQqIc@LoFdXS zn)@|J(vgn}ik>C;$VQ&$dj@fgq9fq!Ku0gf0X=3=8|V~lb)x#drJHnnAcL~?>0BIB zk+hbAloqiJ9aW1iO57aiYB|Uj(e8Lm`-|u@d1JhFw21l#LKnpe$A-HN<8nIi&mb}y0l|CQyygGb5IdooSq|z+g4pVOtM3AxW$-H{+%=yrJ zbGBOIpXJs6@7~OxgvKk1qDnbfffVIde(o=2Pb*o4Np}gO;GmC@^gW3Sa$->e&YDsu z%*S@)z`Hjnz^7J$nqkq4_*pG&6jk7XS~?#pa8}k=bl5^L@1?}esJ9{xjS+58_tmo3 zNG`1;X;ssIKCIKy{XiS=*1xx&RfO%We#K{N3cX}C`#Ug&w2L5;_00vv+xY&$<2FC?putkoG z%?N04TmS}J&t= h@cI$zVt@abV9w1w`RPL^HTtixa^Yg*^Yd5V`WyN?rtts( literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-redhat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-redhat.png new file mode 100644 index 0000000000000000000000000000000000000000..b82737e91852e367e6fe0b8cf4a7ceceed38af6a GIT binary patch literal 18089 zcmeI4&5zqe6u@07Rj^PY!2t@WvQmLS)a#GfPHeKNwwqmcQB$hzBDN{&rr{@L5uj5nK?Y#emwkrTAYe81bH+JaEK(C;C9gT!Ksv^{^J^!wM}mPF54D7|eo zm1b{=YqyVOUd%Ah%Yx0_WUG3uhis8qtVhC`6CS!lRCAnN{S^Z)eWs|m#emBN{VhP z3UHEXPWWgBj_2-;e5jhFR5n!8Rt(#q{*0jypgHM-Zbb*hXeKXE7x;0o?FL~N#dWWX z+C=X8?V3Dl1e(JIYA*$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UH9=D2h|3bc7$xoOtN;n4&*ha!V ziHp{=@(8%>lsaQRH5y0W{m}t@;VDozEcmb>KT8`6&(cLzk+XTR;?o`kizsv4Orn)} zXijjWZT4^); zV6NfiMTY3X$gmhT=q7fUn4%Q!dEts#9p5pdoT1&!-4-V;y4#+SKM@4M;EMtmpApg! zxDX7!C~)x^Aq{~G!QhJm7oQQ*5V#Nwz9?|<86gdU3&G%v0vDeV(h#^148ACE@fjfv zfeXRlivky)5z-L25DdO3aPb)-4S@^6;EMtmpApg!xDX7!C~)x^Aq{~G!QhJm7oQQ* z5V#Nwz9?|<86gdU3&G%v0vDeV(h#^148ACE@fjfvfeXRlivky)5z-L25DdO3aPb)- z4S@^6;EMtmpApg!xDX7!C~)x^Aq{~G!QhJm7oQQ*5V#NwzIaDmE0edjun1n&as=;W zdF4A_?!xw7^pIrdm zdEmXTKYQ!>Uw!EI?|<@{r(bLAJpbyMo43FFr>kdoe({^1|L(c=ea}61j{IZ&m3MsQ zZBJaWZoY5uudOe$9 literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-soup-tomato.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-soup-tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..5cd0e845c91c57ec2425fb0fef8b64527d648907 GIT binary patch literal 18143 zcmeI4PlzPd8Nf?X(b=p4MGc9EqE%wVn)+W|Rq1J&o!)gOv3G~rS)3(;zJB$pr`YbQ zwyI{PXHK#?Ng%<0ASxaeB#Mb5iiCuqH&1&I*@J>!j2BTs6cv5d)z$rVPxrnyvkD8Z zVP?L0_5FG8_q~5#9s1$b<98pP`}Le42!~geYisoHFSDPkucE(y|LzlipntCEET2vU z;n4Nj&t<|>&-_Xdj(!lVZ=@Ubdt4l~=aCmR$b7fmq1u8_xvSej_zX$K25AQ2Lg~{t z|6LLTZ=rOrSy$?vC9)YT@5SWg-tl$3cLqCN>8|QrrR!1$ZIU9f+ir!4+g&L2{JK=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cy&)4SQ)ahTKTEPL1xP#|TF&hYB zddAzxmgtG@OOEY0lI2)f(R|0WvWxNmoxA<_W4^Brt|tfHR~cJrw%ZQ2-Xe)$$GRl< z)k|m02VR@A)e?Mdj+PGjO=z^DD5{kG6-ZHT<>&sf?6#6sm~@pe3J!XWr0+>waGn(< zAf9nc9Wx(UjeYN4zW|?F1!{&xKZMqowCI~!OXpn$&L+i*4q6E2Q6{({c+;nJp zDh$%9){i#U46L$uUHNO6ll1*AsamF~n-zJydE8<(=#th(EugPqlB}jx3!Cu=6Ae#K zGXxL%hWWAqZ(@6i$y@1rUiykz9=u})IRm$ui!BaEbg?}He>@0)!4^3#HY1?HaRC@? zk>g@B0va3_fWa0yE;b{e!Epf?Y?0$)GXfeM7l6SQIW9IMpuuqg7;KT_Vlx6792bDW z7CA09BcQ=?0T^tN<6<)c8XOmZ!4^3#HY1?HaRC@?k>g@B0va3_fWa0yE;b{e!Epf? zY?0$)GXfeM7l6SQIW9IMpuuqg7;KT_Vlx6792bDW7CA09BcQ=?0T^tN<6<)c8XOmZ z!4^3#HY1?HaRC@?k>g@B0va3_fWa0yE;b{e!Epf?Z1IA)=7!(eLPGjgEj#o(Sz6~G z{|o&-7ZES7)dgYiHbHpk&w}vv_w?`o1Yt`Ngijt21oufnxG8${{-Z*vQ#Y2}LQ?9s7D4AdV!hcqHXZOLwi(fqQ z?Z>aY{M)66KPT_|&%O26e{H<@?YaNH@Q-T+?G3GV!7 B#)JR> literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-tomato.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH-tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..7d1c7ab7e50e047701b3288f6997d7c0cc281297 GIT binary patch literal 18171 zcmeI4U1%KF6@bUMm{i5MkU-r&O*gdEiAVFZ^RqKqtt)F~OD5|IStjyBiSN$bk*40A z8PANQmHbfm=f#CKI8IDrO!8I=EqN-TG!KcLg#JML))q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PPmMAJ z4?2d~wgGQq+kwei$$MV%idoFxF@uSbw7a1-(BcQ=>0T^_V;i5AF8VnbJK^GY=IwPRLZ~+)}k>R2<0vZe#fI$}- zE;=Ki!EgZ>bdlkrGXfe67l1(*87?{_puunf7<7^0qB8;-3>Sbw7a1-(BcQ=>0T^_V z;i5AF8VnbJK^GY=IwPRLZ~+)}k>R2<0vZe#fI$}-E;=Ki!EgZ>bdlkrGXfe67l1(* z87?{_puunf7<7^0qB8;-3>Sbw7a1-(BcQ=>0T^`gzPKiO-`awG@>MMxD%YOeB*KB@^@bS^$*Rh)4P;Q=1a%CE8j1C>%ii_|J!`}UoSK+oj&`M zum9)Af8Cd8e+b^VXZ=e0c{8~3m+Di`{OL2d|9AA(W8tcH`4;!i?q3|ddhgCpzxeX* z_s;DLUz=F}<(s=+d-FL*|NPN+f3tq~_rJS(>B66lzwO_1@~g)-Cw^Pm^WxQu-@Nnu f#cy9b$9-_6>F@p@q|?{B literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/NORTH.png new file mode 100644 index 0000000000000000000000000000000000000000..99fd4dbee70c755728e72e0ac454e16ac5ecd380 GIT binary patch literal 18008 zcmeI4Pi)&%7{HAtCRQ{iF$p>@c$t`ngyTQ4o!BH9U9-``GD=riCn3@2=jYT~VrRD7 zraesqO+rE-O+x(9ZU`YRyX?pTBm_6E95{j4fsF$kK|(6ecJkt+N%uy^(4-fs?bqk; z&wIbm@ALb7$U6&XUfe(R)D*{Y`{(Csi}>$>_~((m`1kWaeDD(fv#&jOKIFJZ55_+a zai3h9=D3sV?$UC!Tt96>zm*5JZ=rmr)yCQ!S3cfp19$;NyoDOBSIPbUv9DS||d1r`7aAvs1|>eoZXL!(xt4RH6%& z+)NyhU#>6kvwnbhEw2kuE|mD9k(V{2q^QsFiX`izWQejVNU|vzrX=&-Pp&$JrE*|9 z=3?zsHyr-2l3R_Uwke7m8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Q+8CNy19lvT>%3ZyKzigW*Lep|^aOtwlm1qZuEviBq|IM2!waM3Mw#(Ziuj=X!L z0(@>2s2djhP(QDwjj{?nR7)3K1t<7(ZJxC_9}H-3s~xb{Flk=XYNgHWgG$4T^9;d*kzuiHz?;}% zVv1Jwo|nC1R>$v{LC(N!=5~vd5#4Ujz@G>LVDLqOi_ZvX2wVULUlh3bjDUu~1z_++ zfs4-wXb4;Y2457o_>6#tzy)CNMS+XY2xtgg00v(axcH2KhQI}2@I`@(&j@G;TmS}N z6u9_|fQG;YVDLqOi_ZvX2wVULUlh3bjDUu~1z_++fs4-wXb4;Y2457o_>6#tzy)CN zMS+XY2xtgg00v(axcH2KhQI}2@I`@(&j@G;TmS}N6u9_|fQG;YVDLqOi_ZvX2wVUL zUlh3bjDUu~1z_++fs4-wXb4;Y24B1>uBFMhw$PA$Rm(p6PL>znK5>J6pNmY^Hae1Y z^(jfZ_MRmDdBFbuCP}+UlCEEpB==)UdNlg*jc?B~-IewBsm;O9-MNTUq5rM{pIOP@BRaC`KI~+ literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-dish.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-dish.png new file mode 100644 index 0000000000000000000000000000000000000000..54abb5e8d4eba23657238d3a8484d5dd1109ae4a GIT binary patch literal 18223 zcmeI4U5F&b9l$%BS-j01fgI|tA*3_MiGscTG5wv{IoF-N+ZE?r_r_#T1g)vA-feEC zd(z#zGrKP*XCeq8AqmDLnnV(U<|QwOf_i8mCm136CSFL0hk}?7@{l8tAh)TWo}Q_h zow*vbm%u>{%+7zS{vTDpe|`2tKe2q`_`%6rCpnHgxU^VW!M~qPzBf+bzh8dm$$Rk6 z{>I{|h~qwUDEWSh`_VH~9JlZ%ud*7imhZJ;P@e%#P(?GXdIM{7T;XV|0pMvA^HsFw z`Lnsdzw%m+_ng_>SGBTKZp@=~Z*ej;Pz=~Ik}_7$wJG<4(ccde5+p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W`89pcumONyzuvVd?=5;WZ~gu14wf@VlYsbsoE zY|F!)rLFzLhioo1`D9JiYSyeD#fY$(tyYrpcw{^!9cv}0E(yA9JA#I7G9I_239gPb zY)Z1KJ7hdt%zM+!T<5(L*TX65b*vS2yPi-)BPpgG0cTq}x-Im`F@qXFCz(saR>iXG z8mdmV2hs>zR}oB8mjtCQA*qfHO+}@AE<@aG>1xJH7SZwkn06M?5qwvFYi|*C4ulp8 zBb=nWsY0Ibx+h4wF0$3pNt+h3lcS_!CrJc5WwEcdH>|E@IaTnshI2dwTg*rIv9XH% z3#FjcRYz;IlPGZG4HV)7D`azymmgEV{f2`b4BsagB@_`_-)0~TO>^v`A|O*T1WmDv zLY-`Jp=2wLgX?6Y=|&!C5XZqOCX)e(J7+_!_)Bcg+uobwox$nCXM3}I>SPzFhPRC)ZribQO-)i2 zjD)&FYCTOxC82J+x}ZC%qSv*Oq}qDECI7S74cw1eUhQ5_ww+fgsWi#9-PD^05oD}O zGOu1bbKdse9IuwxPG0?g+?(l5sK27ftCX!3NM3HG=l-GOwvtqsWS3A14swko?@26> z6Y~;q+>|{1I+~&0$_qDHc+&k}+zklYqHHqWiILdL>gB-^r`-}upoi*q-hncI8&mDk^P z&(n=vpZ@Vf&U-JM_~*a=s>`%!T>S3izj(g+$hoUdKX-EOo=0~+uKw-B(utp*ed3)fPW@ax^`URQ^8V?2zj^+S z^KU%&!?|bTcvIi_!O!%oUOT+wkLLc@7xwKfoP1!narW-FpL}rnyMOt@j{DHx@7{Mi ze(H{D_0gZa{MKdW=XX?J{LW{8_p3LB&z(HaExfh*)&1ul`vaLAH+%4K^{HEqp8Pk- C6!8`S literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-orangehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-orangehat.png new file mode 100644 index 0000000000000000000000000000000000000000..b8aa0ccd979da8eeda7573d2b3c0d55260d47d1d GIT binary patch literal 18080 zcmeI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^QJfMZVDgIn@%lXjl!&Bl+oszfmQyl zt9T7_oxR_s9mlp!yRFVQ&s$szN3_4w4cTj$G_Ps(%4YsSt>KMDhTuVISS%axCU%^d zqLsbpWv`gk$vb9{GjN-^*Wz?U_u4b?CxQSNd{N-yGXfd{7l6SR1ui}#pdoMp7<^IS z;xhso0vCY67X>apBcLI00T_Hy;Nmj^8Uh!9!50NCJ|mzZZ~+*6QQ+b;0vZArfWa39 zEapBcLI00T_Hy z;Nmj^8Uh!9!50NCJ|mzZZ~+*6QQ+b;0vZArfWa39E%}u<=^MNe3E^ii;Oq6dXjYe zSxI{5JxTiYi2eOhlJ+%8`sqzc@;;WN$Kwy*_~tUxeQC3MVSDsH|F@%~^QWHr*6;rC zy%ZjuMOV%}v?6^KTz>GUv%iGrPHUgv`Q+m62X8(7pDV9_$IPUoqf^qO+o#W-`Si{U Q`Tv`ju6Dn;_~yI610cGp6aWAK literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-purplehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-purplehat.png new file mode 100644 index 0000000000000000000000000000000000000000..8b9e29cd5a0654af28e6978c505f39bf35ae0659 GIT binary patch literal 18082 zcmeI4&2QsG6u=EDt=Phf0|$0FAS)|YAmREWwiBB)t8UZMqRmoui|8H@I~k8tvxyyS zw@oV{ArKOrkQN~UT8X~^&Ik^i;Km8TfeT#O3*v}CD&shIUQ(x%r3=!ciPZLW{N9_H z-rG5|Ln(J86of=H=1mE!<*Hb*=2gS0YWlOHrl_W@ShA{1ifSvCt*GMgQ>xEVsTMk} zz0p`1c1QnPC~e1a&z9xAy}kLp@_Z1sW!17QS1v?=o z%e!i<%3q8Ufx(cF3ZSNkqdDfiTfv4RXL`)E;lm z9(25Vnt_}EdyYNoR5x8iwJ0$SRa8k;D_F9WswFuXSCFA&!&Tjyoa6!OVl=Md>KL}u zc+Wf3Ep92ArMaqvNJWu!!!)Iqu9qd^!@!>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});iwqZ?5zt_`01UdwaM2k74TcNApoTdd&|tU#47$j0(HQ{^h6});iwqZ? z5zt_`01UdwaM2k74TcNApo2@xIdrcIOlsD zcVG1ElfO7gbYEVsomlI>etGr9yRP#0zVhhdi^ncqzy9j;mv5Z9z{>)!K_lVP}cYgBHw~t)={$l*rPIJZB zxb&+hpW6N1S3fJ-r(b;M-JQGsezh}y^jjZ1`udN*bnT0GZ+G9W9(w-ge@ox^=dVA0 z<+qP596s>Ey;pv7@bb%lcuM_;_Rd2GpE!B-(ntPyOnqT@_xH6g{P5r}tA}=Xe`Lka h9Dn1+ktYsvPrr2TmFT-qYh(c2^5W^*l?Ts#^FMQK;S&G= literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-soup-tomato.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-soup-tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..e224c668a53492dea4921e3b0c7c37eb5357154d GIT binary patch literal 18194 zcmeI4TZklA8GuUzVKdov7xqCD5-5976s)OBSJy4woy<e?xe;Ac2)?p1GPHD0ZM*|LMyG;)Flp6;~Tpv`gR8#`@eZ{V13 z;5E;$6wW{Wy8`bymBLp_b*bK-#p~X}$q*ksd1S>txnY}5;l}DzxnqHY7LF0$X*K=G z>QoA;Ukl`2TJ7Y$xFr{$7qDC(DZMUpj9GDTSx zB-xToOOpBSr%;^&sT?}4wOpI;hJ*hqh4naYTcWtVy*<5MoDRY@Q8rCeloU}>1kezo z6Ml?3f*&2qoaBCLII=^p9eaV#Cw@^Q*o-TMLK3L=>5i+_?gjFrE<2zoc2HZCrzLTe zkz@C4+M8iB?V4kYxQScXk0Y>?N7}X5gE)xRgE1j{kH-dvoYd>R*dzPfYK;sX#dBML zpo?^*Wwdgljm2dg1)HIb=eA%dhenM)ikEReI}^A9^^uNZ&mH3@c`_CP?s#L&k|&v2 zI;XN!mjRkJ8)6g(;YtuRtJ!p2%5%Zb&L-1S=f6-#w&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/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-tomato.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH-tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..6b1756e943ce7df860f8f519a4d419f4a2550c29 GIT binary patch literal 18220 zcmeI4eTXE*6~OyENp$rRHDV-SXyynxqrLqx-96py%pB{^-tC^wx$JJpu9u+I)z!Q0 z&2&$?dw1u~2xkuR`G+RQfu0{pAcVsMJ^xW5#*c#|fnfegh@fH!+#hNZ67UNVJ*%gu zXKH3=u15DF9Mr(>zO8=mRn_lRy{gxL%ui?c?%p=`wK0z4w#`ge=J4MyCqI{b0sp?~ z???CGKbJP9mm-e4>?_I77Vg-?*K*v{KfHy-c(Hn`1%vuHZ~_~RH|q_o&2hz@%?5z` zQOw(D+4D=e|Nj2@9Pc@$+;_C9RBcS66>s`rh~^LOU4RGoL(|FaERPkN7IsiaG2ol^ znjcxsQm*CK!gA6q=J=LMyuXy2NIK*ftF!!M5F%b1*99o&4ZdKG%bIB@>W#c2$+{?+ zqO1y%Y)Pgi$$a~hE01BR7&@*sSJ~C>4*yrmt;BJ|62`5A{cs&*b96<@eAx=H7@0HNk^SedtUWMrz1aVv%?g{CTNKA zxFilTa$v`%u^QG|Lvx^rYN(F@QLP|_O@;`>LAVeEwQ{;#XR}!FlatBvEbu$30D68BpzDibzfpJTbp4?U zh*25a8iHgBlChxVt-N6=x*(~RBoR(h%|0L1!13GzT_3V6$b|(No9cLn2$I(EL1^~- zz+2G)F&N1UsZ02ApydW(9mHj?4wjMF@Ry5Xw~^57EKqAQs0AS&7Aoh9;-Kb%R+Rv* zCOc%phbY3~h=?%ZV6}3<&0x8=HG5F=%4r620_Ztbw^LPjHQ7`Pf&vN{p)z z@?d9aYwz$$Hs_jrvZkt4YsQaafZ5Dc%E@>EN4JF@K4w6T(8<{5k?gv9 zUc=i1sCX`}BABKo;T|O**+^IOz{ut@z|DrProChl9q5f|YZ1+(@AtNL7g6g#Xn-(6 zNxCcLvV7M$LDF^6ULCEpX#toVC1sc-5#$ubp4RTLI+n#$!P^+l(GYAfAKu6M3i8jD zf>Kv4t>I3hz>U{Ih$fct<{T|Qrha=3`#TuCPtHpyBCxi}Kjr;Qn!=3c<9OhGgtsfemrjHa3^xqweCM3v!DBNw)2z-Ykej z#=0Q$>V-4sP4CUoY6-SCdrOD(Ce&L|WL3(>3M4DH(sO@Ta$89%OuS1d1qZ%H;`byL zah_!*ARIBJ_L=wW#C%i=B7OM9hfW%=s3(Gdka%34g2;0tQ`Vxaf=s z4Tg(=K^GY=IwL}Z;UZwrMTU#ch|plT2pDvc;i5AlG#D-d23=&h=!^&rhKqnf7a1-( zBSM4WB4E%(hKtUK&|tU-7<7^0qB9~i7%l<^U1YfEj0g>ei-18F87?{_LWAKVV9-T| zi_VD9V7LevbdlkrGa@t?E&>K!WVq;z2n~jdfI$}-E;=JZgW)1z&_#xe&WO-pxCj_@ zk>R2UIw)NuU$B#dJW$~5=eze8D^vT)RUbyJwALPU(SB~_P*&;_wLT!fBm0MUbJ-Mzn*yP#0|lB?dl^}pZML+@7VW< z!2SBEYu>&3z7JpidhzM0Z+ZVa_QpqzQzu_4{b66}-yiJBKlk94_nuyUrSwF&bk#j) zf3x+_Yri`D%&YH(?;>>$ literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/SOUTH.png new file mode 100644 index 0000000000000000000000000000000000000000..07b59bd8fec45f96e9501746e9bd9f9cf30e12c8 GIT binary patch literal 18039 zcmeI4UuYaf7{IqLwv85{6)aU`xvD6*+5daD+sl2Hc@8;WwJ9YTbfo(&(hB%JfHaStA!k@QCe_L+B?|Ux3_%Qz1+MJjTIPTUR z(cdQSAiX3X89JWJM}9%oTL?#TxhPQf>a45L%mTSVhaILUwn0;rhb3{4kqtAO=7L|3r)EPD z)lmbvVSw%Afp*P#FZ6H{5xPHhc8(UmnJptiGyS#%{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#ljDcV@9sN#;%~XnsDS_g literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-bluehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-bluehat.png new file mode 100644 index 0000000000000000000000000000000000000000..2c5aeb9a5b0472b9ea6b6476a034abfabb125ba0 GIT binary patch literal 18082 zcmeI4O^Do79Ka)mqANwjgVj@*B2+P(&q*e6c1pX`x+|T!Zb#gn?90o`Zs<%hCfVI- zy%awVUPVDg@ajqM?7@@g;z1Fi2;S^L58^=(*Oy5$^PkyF-_)%_;SKD}e_#F|@BRMo z`;hlGF1>hS>FFgw5KgSGwKwVSW7*%s$LaSA-+%ZL{dr`tb|n#nN1w?49uhwJ^rRr1 z|0(EhrCXhg4vzZE$ctREJnRpswjeam3QWxL2hHbBQrnS@@I@Cd*q(~h0dtu@XS85}_4wbWFxh9TO(rYWVvsplK ztFs}lMlliV%cg`?y&+omvRbzrn(@4-DXJ+ewyYYGqB@H0D5_X|YON(IHDk|rHrp49 zaP+^G+D@7d99iDq-(TL>m!o)FR&Cps6;0MOiE2p6^)N+4DNIh~PD(#*lHfQPq(Kyl znP22ayXi`;mIWGrigxt}<3M3ju%i^^AsWc)vLaU*d3bCy*o}Lms(Dx@J<=y(nov8n z(r&O5rBSjI%?UYvJU1}SNvAW8U0L6LzcO@^p5LPg3Z#{mN%#7I$eSdIc4JJ=@6o25 zs%m|bZjwoM7H~z?D;=eQKgUn@WG)0U4Ca_+Pja(SpUP9+q|ltzn4mO@yHV6@<=u6o z%!RnRnsrZ0Jl#P!2(tt|+mvUGCS7OZkF-%rTGX~7DYm3Ex|;6j4M#I2#c&h_ILS3< zd~_l&@UKsNsG6i$UDbAU&8btlKK21LXMND2=%ExXDN`;up|vxs-&tGmTaYAOCH7+svEfOtA10?<^k$rQm>+S6y-GE%N})$ zT}87sUzHHC6v?QYrsNuiE*Yj`HX62X5v*1_%S)%L582$U@mZhhbe#1tNfBkU-fm^} z39|ZNtwBQ*$?`0p)~7*e<7`?Vi_WXA?)i0uMjdV1eA3Lqbs3$yuBND34cBvhSJDyv zDkyrUqOV5b2{oom&qH`rISuHS`Y>(PDnQ0t<=i-ZoGoz{i5g{qiNGY zI9p0uIGaR>*OaG9C)FBTHgkpGa5@)5aL9aqjQt%F-farXU5&KnJ4qrx-A6GwyG;k@ zV)J9}ciM0^K=nAeFR4h--VqaF8it20O+vO}N`{6l$))2=YGBRth-(mBH_JqWJkB;T zYYady(&AA{q>O0Y=#fmG?rg*ussMhq9r-$N$(?kHo>f z^i)vGF(&Z=Yx9xE=3;Ab-tqa^9IraX2C5evVTn6(?tGnihJhQBY3fKa6uKF68?GYx zbQj}luJ5}V-7)^V+*R(6`Mf&bo*a2zWlW{nY&)KM%Orvs>w%nCADlKHd2B9rmf&M^ z`sk4Fgr-jvg@B0va3_fWa0yE;b{e!Epf?Y?0$)GXfeM7l6SQIW9IMpuuqg7;KT_Vlx6792bDW z7CA09BcQ=?0T^tN<6<)c8XOmZ!4^3#HY1?HaRC@?k>g@B0va3_fWa0yE;b{e!Epf? zY?0$)GXfeM7l6SQIW9IMpuuqg7;N#bxRxewZ6P6jRm(noC(CW^0-^775%Jn)M-Xm2 zBM3L&7KA?!=}Bvvfe)19scP4b#QRzn0EEzXYW3D z^Z4JlF5-8-{P^T);Ri$i`ITF1Yx=i0AHRL;1Lw`|@1Og3g6w582M5Q5{XdqT`flS_ RgZ?Y5pTE@p;@s7@{sF=DtN8!` literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-dish.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-dish.png new file mode 100644 index 0000000000000000000000000000000000000000..b24c70cefb86c2985fe679a548aa16b91034bbd5 GIT binary patch literal 228 zcmVynGw=?CTE8vi&gSir`=1w_Z%7A{U-Eh-c4f-(rB|q(H><__D=iK9V|7=1*ae4rL#+d6o z&m^Tx_ny@!YtEb}Aw+m+w|f9O0I=3#8h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MB1Gky`EsjTYzdZwgJP3fn7CA09BcQ=?0T^tN<6<)c8XOmZ z!4^3#HY1?HaRC@?k>g@B0va3_fWa0yE;b{e!Epf?Y?0$)GXfeM7l6SQIW9IMpuuqg z7;KT_Vlx6792bDW7CA09BcQ=?0T^tN<6<)c8XOmZ!4^3#HY1?HaRC@?k>g@B0va3_ zfWa0yE;b{e!Epf?Y?0$)GXfeM7l6SQIW9IMpuuqg7;KT_Vlx6792bDW7CA09BcQ=? z0T^tN<6<)c8XOmZ!4^3#HY1?HaRC@?@vgWQ#^2gPLi$xLJM=qQ-n;nzKK(uy5wEPZ z1Yz%4LD+v=5dJ)%e}5H(EkzLSTo(lAV?lT-`tbE{E>PX2)#llD|3~+)gM%~2wClHS ze(?PM@xMR&)_dp6Pfnf|elYZ3uH0T((ZAb&{HNO=Id8Uq|J=V5WM4LOaBxi6`D5Yf U-6yY5r-HD0{!;UcbJySc2co5{-~a#s literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-onion.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-onion.png new file mode 100644 index 0000000000000000000000000000000000000000..4aa803f64b8f0b14f945eddeacf38f5bfa2aec28 GIT binary patch literal 18180 zcmeI4Z-^wt6~J4;KUrN)P;+8X+BpOR_V%CY?wRh)j;=d*?k3K;?Co9l492UeuHJ2K zrhDw}-JLzZoE|EE5E5fR zGdpuNvZruR1GDqC`n^|GzgPcWeds3^_TD`?apQy_2$S=3l|}lyBl%u=IsN;SfB*KU z^ydf7xr31)Ty<^oy+nBS_zi-v`(1BoIbN>bW8^{E3#@?maJ&9rb$#o ziZ=ZiwIn~TCf&R=W))7ER#BE5I>HnojTO6xf;Ylv>J@4vio>s#WW_>YPas8?QJxMRvpE= z*C~Pw=}^mPX|qY>MG^&TAtt-mX;*d)>wOe2l3sMia7ERJI*L7agrDTeNC>3mjWA1| zq-O0gm4>=Rq1m$`L2(c+1wp->4%dZFEX3K_WOx?D+o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1T;7<0D~=ZTx>=_gX01) z*doWpW&|`iE&ziqa$IaiK!f7~FxVo;#byLFI4%H#Epl9JMnHq(0x;Mj$His@G&n8* zgDrAgY(_wX;{q_)BFDvM1T;7<0D~=ZTx>=_gX01)*doWpW&|`iE&ziqa$IaiK!f7~ zFxVo;#byLFI4%H#Epl9JMnHq(0x;Mj$His@G&n8*gDsvH*F^8FEySmPu}}U^O47qK|9$d{y}#M~ z^!<;Yc%i2J?1s6kCk~uk{_yyF2deM9UHQZRpF3&4eD?HPkDu@l9Q|zZ+&T2GznzJ$ zeEHHz@vSdUUGeqGlmFat_~@=X|8xJ@uXd8Zyz$G2est`EbH}f{?~|Kb!YhBe>0sd( tCw{l%%+pUl-x4eO{;&2QKlZus`m@HFm##RqPMa#s@7`N^>8?YMd;^$X->3ip literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-orangehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-orangehat.png new file mode 100644 index 0000000000000000000000000000000000000000..2090a5c2064b4cc8f7e7b9cba065e0c049ea3b07 GIT binary patch literal 18080 zcmeI4&5t9+6~H@M39&;^4n#`e)G{OjDLwt&b~hfcmho<8qV=+xHDdMxTduD5wASu6 z-90m&Js}Vha72l;LCGzLC6W8`g(ovdpEBC`pJ!FHY7=Ua(Ab_2Y-K(|2+N}{C@FozxxgRxj5Rnl}geR zPvt*9l0N*y&n4-~zryZ*w%@tt(RjE?{J6(9$HNh5OH%XFctq$OmdQQV52LNxS08^; zlS6;2_Nv{{I-_lN5boSf*v-4wyY%iI>iV@yt&Qf`0|!Hv5qUfuM5#C4s!jZQAm`0$ zO`fP^ceZMm^MLYx=Z3r;Crq|C9fj&sPX&>5i(os%|No?rE;4>GJeb zYi)qkO#HyxYhRs)ga5W_2U#}qRQ34yc=OoYjFY~qyRNHhhH4lJXejAPl##I#rOy^l zNbEs$2A-RL0B;`AV15pwo;Wnjojr!$LP+27%?GIW| zJ(k9Y31wG~U?|U4jXurx*gQLHxB~S`M_CxG@RL7T34x8n6=wO9!fZ09ic~iNnzx-W zlEq0kjt8w`y51;rA#ZQz)3Yu=-yt-N@&vumRF{qBQ)ljvwMoWWVB1hMSJ4_>!}QFC zXE=&xd76ft6q-vuIj0ZY**8ClB<)IHE! zBv~sQl0H*MQNO9q8>SEEQNHWC{2*8$sX_$ z=`XgH4+deY*n#|*hQ2osYB_NL^QSy-pQZYq*L}X`R>>wF5n9s`)+uF6RB3 z&W>q2tk_?Ya&9(QSn|^`2tejP-mQ8d-fZ(H70;!<@Pe zil**s8X!|l5|EOj?~bF#=X(2N;djw+IY9L~c_^t!$xM#H%~4>D)s-GBaiu{G-)B9G zQQIjKjqq&vC?^J9ip&iLIMd(QRLc zTN5!9IN1%wV2*3}mT52w_m%%Hca`^Jv9HdqC+FT*Ia_JI+s?M$GKpx%dL;MNM`z6E zUYqOH5@KyGmJY>DXtAOwtCX`9NLg+b=l<3Fwvtzvuu3=u2V5iJJ&A|Tv$6zScS~I| zUs#P(@BXv^Us(kjmIEIa7uL1Syim~yoF#9rNYfTTA7FT95+f{Gk=Zb zK_v-Q&E$UAg3|p=8}c@Jwx3sogTqP1S2r~HsCxc;YKk8(o8G#=DSo_cI=6f!3bU3m zjkeT`tnznV#cPUeoHO&GLgv!&|Ei(SxaB zv24(r*hylFR(Q_~ub9=@J7$zKbennD;(SC8+cWYff*=@tQQ+b;LK*@Wg25LBEapBcvg4AsBp7;Nmkv z8Uh!B!50NCJ|mapBcvg4AsBp7;Nmkv8Uh!B!50NCJ|mPrpC-^xc2=H~zTwmy@pfjdcO+PERjL akN@Z5)4%=udk65Zw0q@x`=gg`zx4y1d#J4d literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-purplehat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-purplehat.png new file mode 100644 index 0000000000000000000000000000000000000000..2df04497ab2a55908cda3ab5d1a9676b179d38c4 GIT binary patch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b5*?O;a#usG`A*U}$o5b| z&Ti4oxmbS8{Z1Rsc2K@g?nx+8w0p!rIBc<34F$QHqgV#6DjmATl^QmDpL8sOZKnt{ zh~w-O*<=9X;aQ;5B;>Sp$I}c?r)NQ)$AQ*-C(}F^I;a*2#AK9s8%0~hZ>YuGiiX)S z{fn`~akNX4yV*!|yCQn&B=o=tlDH?2&nY>JWz_F?LyXuCRd*wQbcGuq55+`*kNSn&Be~(eBq0|IX-np7pQJ{gd^_Au`>+AMy8JxLRelUwT^;( zdVg{)+qO-F-KtHBEqS-GE4?3!ygI&~967IYQYp)}3pcbSy^B4Q47Jmml8LV-ikOhC%8e~S7)!0JX%T8 zs%CgUY|zsEKpXHje74Cd!tTzn;;R}O{ir(oJu-!lXHBmjZVDgInocZVj>4>AjCz}C z23G7{SNcqum%d_F$M2Xy%)o8tUW=0%-D}UlpXda@;EMtmpApayxBv{kC~)x^0S$o* zz~GAl7oQQ(5V!ygz9?|<837G}3&7xu0vDeV&=9x)48ACE@fiUPfeXOkivky)5zr90 z01Un;aPb)d4S@^5;EMtmpApayxBv{kC~)x^0S$o*z~GAl7oQQ(5V!ygz9?|<837G} z3&7xu0vDeV&=9x)48ACE@fiUPfeXOkivky)5zr9001Un;aPb)d4S@^5;EMtmpApay zxBv{kC~)x^0S$o*z~GAl7oQQ(5V!ygzIZ6ErOCIpkcfU&%O3qsmM`%mJ^FnvGG5zg zNz%=yCF$1NlJw_3{rj6F?P!v8=b9vWA4$>^@%yiTcY*4ztT)fL2S0WG+TTBO%&2|Z zIR3J9;^gg%_?@pmK6zUD(K3I1>Gs;1`TecOe!l&I_h$Q#&x1Q5`?8t+{bSO5J4;V~ U@ycse`meNp{!;U+bJyPb8*_Q5xBvhE literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-redhat.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-redhat.png new file mode 100644 index 0000000000000000000000000000000000000000..fe694af1608b72af20916a9b0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@JG#P+kB5Aqz{meMRu@P9 z{mfL*%P}VYAsh3F*XCkpa5nMT+8m!cqYG5mKfw`q;@nlpWx;jQ3yPH9n%WgdFlF6K ze__?s%(kqNYsA0HUE%$h?W^PK$%*$>%2t~0w&SfgPa@c{9?E_7;TiLZ*XCli1Y4Wa zr9*ZTnyx7FD&=Sel9yZAxql_St)vwuStXQ$gIpuYdlDO*XL$*@=$1NTKD8Q0-rZ3F zKDP=~RGoaVm)6p1UIiYhrL(RAXGO8XlNN$mlma)CXn7tQ6Wkzq)$}!zO)5!J)eP^4 zbyB(?X#?Jd&$iNvu)8y?_zXoNA5l(!k4)j?S<~yso5IJlrW4E813#%Nqi8eDz$$&$ zmA!_!M&9q@x~^#ztt!qo&suEw1Kize_~bQAoYu5*ZZrF!(D3>^L-1f^m@OOdCU%&Z ztd+dyC9jyp@jGUaGjN-E(Bfo7585;E$ASPDbdlkrGXfe67l1(*87?{_puunf7<7^0 zqB8;-3>Sbw7a1-(BcQ=>0T^_V;i5AF8VnbJK^GY=IwPRLZ~+)}k>R2<0vZe#fI$}- zE;=Ki!EgZ>bdlkrGXfe67l1(*87?{_puunf7<7^0qB8;-3>Sbw7a1-(BcQ=>0T^_V z;i5AF8VnbJK^GY=IwPRLZ~+)}k>R2<0vZe#fI$}-E;=Ki!EgZ>bdlkrGXfe67l1(* z87?{_puunf7<7^0qB8;-3>Sbw7mvlYH2KyR9FVVS*(2Y{^24QDcggp;@Xp$1lj9Da z=eT!naok^r literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-soup-onion.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-soup-onion.png new file mode 100644 index 0000000000000000000000000000000000000000..8490dc92ca4c619265325eb5baea9697a3a62868 GIT binary patch literal 18187 zcmeI4TZklA8GtJ{FIOXD~Q$}9YBIRDEOSJ`|dUvmj@Hvu-EwUMe zi>23}eXb-1-eT!Kv!OJ)OJplp*^9}Uz0*y+cMdyV>F(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igpUjF`>WAA@nIr_Knxep$BE=gIympw@ PSXf;?UH{>U2R`>7^SanX literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-soup-tomato.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-soup-tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..35871a68d570b7db0c02bd0fc495ece9a198247d GIT binary patch literal 18180 zcmeI4U5F&b9l$$CByR3ZKuO{eu$_%)FunaT{W0A)J9_Tixf?Qfo4qyeg*&~P>gwHQ zXS&Dk-rc#wfSL#KDIrD>J@F(Eg86s}Ash-PeiQN#4w8r=9vmnrgd-1mi1%Qsr>AHB zGdpuNx);-UU%Hn5-ut&F zzf1pI*P1^P3&NLgNPoT{JbmgLg0TO*zr2#H)V}B7usMU=uuf*$%@)-bgz}y37Q*W! z5$j~t4`vG&Up!k7eRsBSpHWk4tvRyh&!3FQ;gbiK@yT^;yM;R|Q{}cp9W+UT#CEe0 z#7=v*(DCa~Ic=5;Vn-!epDpZ51BxrPMR6{Sh-l215>|^P(XwY$!!Bw1cSKE5OpN*uXR=wOTLs$o@8)BSXi@ z{!NOYi*%%AynLcXI_Q#l| zPcpO4oXS#NrqG%E_;Io0g;5hF6~BpAiQEcS%W}UFX!a(kGZ!|(h<1xqie-6J^GK^|h&R#| zvM<0Srs;@5nrN~*HQ;WvI@p>&X!w<^0=XgfU8f&ZH$6kObxYEaMG>kNmTaYDOD@J1 zGIVTss#liNIzV0Y`_-Kt-FBMq8JD`nbw#r^Pn8g{6iGKsQ>yEFQPNGtER}4}B3K>m zENdO?K4f#b!KZVoR&y4DI6;)nLba0i$EW>KEu(H?gGd-_NYY)K4z6T)Qn83^1!-Dc zQ>@NJ8#M0^v+FvKPF;_osOqMzVI*nwBFZSDVo8xa+eVg7e>{TnK)~6yK!+lqZZoI> zbaJ*uqI#ZLH0bg`I%Vr=l5HCbji?}{PE5UsN_mJ8ZnlM*_tQyqVlbzjNpzSzIM~{s zM4b(xg`$|GhlFf_m?C6wD2jO%pso=DT5VtH3wD!Bzvn*!{{`PcEhG3id z_!wJjB)D7&%3O7{#yg2aFWEv7*|$m;=VbLU^E+rb9ANZ1xgx2E(dG^lVd}bzElr}! z$dq&qTT-1aajAqg*ClnGV8hH44e~fV#B?wKac3_`>$use$=y&$XOKx@2{L7o$B zRFfp4-%GrPf>q*HkwQ(_W|sMTut z7^N#z-VEIC5w5pA8z{3*{E3IPA`I4 zlo4+F(egZ0`?$fqubjR{a_CKx-fBAM!wS8+Z)*eII?qmvXxOv!O(QlK+O4X;Y zVdC^otL8St4@Mdu8D|I{bPcm*1Kz}T5|g#k_q_BKv)p^f3~~leGgn&dkLXH!2L5;u z0D~=ZTx>=_gX01)*doWpW&|`iE&ziqa$IaiK!f7~FxVo;#byLFI4%H#Epl9JMnHq( z0x;Mj$His@G&n8*gDrAgY(_wX;{q_)BFDvM1T;7<0D~=ZTx>=_gX01)*doWpW&|`i zE&ziqa$IaiK!f7~FxVo;#byLFI4%H#Epl9JMnHq(0x;Mj$His@G&n8*gDrAgY(_wX z;{q_)BFDvM1T;7<0D~=ZTx>=_gX01)*doWpW&|`iE&ziqa$IaiK!f7~FxcW{aZUBV zwS@%qt6H|`cd}f#XueCo&qc)ZOEp0_d8;5i{9{4*@5l7-2ZFGn2*QWQ1;Ker5WXJ% z?19%0P~GPis{5AP@BHS8z1P2@e6@Q1z|mX3xN+_yr}|A_I&-1)w)On;r%(TI>PGj} zPo`g)pFVQwng6VOt@w+VzqNSR8*{H-udhF`e&*Pp9@BpM(AjtX@@)OsnVZiY+A<&h z)j!YgzQg_V;$I(o@Pl6;YrOmD--VxF_|fCn{Py54X;+1X{RgYRyZiW~ F{{z+_+4=wg literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-tomato.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST-tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..f23c98c8aed1733e0332ac584d8e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+sGF-V&Z!r4($$5|2~ZdIOW9S>_{S?V*^g?9k1*Sbog?P8v>kFnga|lTajR?~sA848z4`O+vOp_mzgrQj2bJse(1v zB`t$s(<%ZD;y69UY%&1x;4H}UxV5EPj-oj#Jqz+Y4z%VwndG_9LA6LA#-qe-6zmYU zE*Env8m7neUyL0NgFO3zSDB z(=!pxt2WK6L_rcEhSsVWMp*u{(G_=6Q8=JvnqJ07T|NMK+Uk|hj>{nZOp9#^PvJ~v-%1TTL|X8%y2XAt%yToj2qN_ z)$BErLn}#I)eP>3by~U~Xan8`&$hFQu(La;_{y3>KeC$r9-6|()23&xZVDeyn~p6{ z2Yy=DhP_QS1FP&^SNXvEhW>ubUp0+sY_ep2F;nUYJNmkRUh0XMXnTBWP z8G;8x!+hI-H?f1jg@B0va3_fWa0yE;b{e!Epf?Y?0$)GXfeM7l6SQIW9IMpuuqg7;KT_Vlx6792bDW z7CA09BcQ=?0T^tN<6<)c8XOmZ!4^3#HY1?HaRC@?k>g@B0va3_fWa0yE;b{e!Epf? zY?0$)GXfeM7l6SQIW9IMpuuqg7;KT_Vlx6792bDW7CA09BcQ=?0T^tN<6<)c8XOmZ z!4^3#HY1?HaRC@?k>g@B0va3_fWa0yE;b{e!Epf?Z1JkNmd4-OLIV0#Ej{|3EWi2u z2QSj^a}n|SW>XL@+#?8|drT1id4>M{gCOiGg7C+)g5W$Y2)Bn%KJvq3RQK79#>!Uz z*Ux`><<`f<_pQDD^yN=qe0%>#`Ws(;>+~mnapRBCrM)Zr&)s$7Y2)9&y;phlihlf+ z4?Xeqo89mEKZ|bo=~Ic+`_^CXx$U(F_wSEB`<;h_{g=M+!kxc+|JkKW->lu#YoGnW z@ylO)_3e+{65Q~{6YHOO^y9BQdEcGwpQtabzWM#K{s#!A;KTp` literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST.png b/lib/overcooked_ai/overcooked_ai_js/assets/chefs/WEST.png new file mode 100644 index 0000000000000000000000000000000000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z5rD-FCPG(L3lH+C&l*POhkk{ zi4W(2Gl#5-n651yxP-ZbuCs{zi`htcy8`@Vh;UVJ_->2OzD)Sg<$>olZ3v+0pR z<_*`?_4N`PtE>ONy_r14_I4C$mvUhTlD1pP_x^bFv=TKWc$ZKb4*YL@nCPr;j z)B>)zr1qKj?8c6F-1Nm=a;L#uf5V$hjxZnO-Q8&GmqZ!hrW-9KU+n@WI=ymqx?|$r z5%)3i6JZ56>lcg>-r{SsQ4iQ$h0j_k$9uBf7GT0tv|{lonhQ+69QXR9_o9SNc?R!(jDFAOx?znUR&p<|eA z6ykt1PE0b2k6-c0ub3VE5;-HDU;b&ayP|*EGvSW~Az;u&hKtUK&|tU-7<7^0qB9~i z7%l<^U1YfEj0g>ei-18F87?{_LWAKVV9-T|i_VD9V7LevbdlkrGa@t?E&>K!WVq;z z2n~jdfI$}-E;=JZgW)1z&_#xe&WO-pxCj_@k>R2ei-18F*Tgl{{V^5f;9pQ#!atSrhxN=D z{+SgXPE6N0ZsjhHJA9Pm&i#o$PjlRY#Bsko&T;0;9CwTR+<}kBv2HL~9hqr=`_{uF z*B$1!96Yx3Nb&S5XKH8OSjj!?-S^Sm4}SW{_TRQ&d-L(}O)nn(@XE)2KlOQYa{0s^ z=eB&e`OqGC%KK^0Yn!+o=fA(|*C+D_4t?{~iTbl=m-lV^`HPp%zIoHI_2UQcJpb9r p_ilLo)NR|eAN;%bZT_0uv1{t-PtL#lB@WL`j_t0#egES}{sNRMrZ4~i literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects.json b/lib/overcooked_ai/overcooked_ai_js/assets/objects.json new file mode 100644 index 0000000..28e2347 --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/assets/objects.json @@ -0,0 +1,315 @@ +{ + "frames": { + "dish.png": { + "frame": { + "x": 1, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "onion.png": { + "frame": { + "x": 18, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "pot-explosion.png": { + "frame": { + "x": 35, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-onion-1-cooking.png": { + "frame": { + "x": 52, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-onion-2-cooking.png": { + "frame": { + "x": 69, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-onion-3-cooking.png": { + "frame": { + "x": 86, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-onion-cooked.png": { + "frame": { + "x": 103, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-onion-dish.png": { + "frame": { + "x": 120, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-tomato-1-cooking.png": { + "frame": { + "x": 137, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-tomato-2-cooking.png": { + "frame": { + "x": 154, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-tomato-3-0.png": { + "frame": { + "x": 171, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-tomato-3-cooking.png": { + "frame": { + "x": 188, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-tomato-cooked.png": { + "frame": { + "x": 205, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "soup-tomato-dish.png": { + "frame": { + "x": 222, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "tomato.png": { + "frame": { + "x": 239, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + } + }, + "meta": { + "app": "http://www.codeandweb.com/texturepacker", + "version": "1.0", + "image": "spritesheet.png", + "format": "RGBA8888", + "size": { + "w": 255, + "h": 17 + }, + "scale": "1" + } +} \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects.png new file mode 100644 index 0000000000000000000000000000000000000000..b477b48298c8f0ab54a2e3aaecebd0f3cd25aa7b GIT binary patch literal 1508 zcmV1lqF~V?`Q4NoNmAMLbw~P_&nN5W(9H zHYo^#dh?n~Qwl}MU{YcajTKtc(hV3y*L0KJ>?d!sGdnx`-u&C$bX;dIN%np3_rCXi z@Av)QHxq{F6Gb43!2dD=EUdd$08#Wf3Rog)jHw?G&9c9qTPQU@C;J)E0sTgL!17qAVZtcJb zO=A2zA|yW%ymzHMCp`%CNam+0z|D>woG%x-&lKr%IFQ(FI zUomyVxc2ZNUfI}aSYu{tsv)L!jBUoyLv_vIzwwA#{pslg|2{A<@C#$?uoq&=dR*CD{o0>b08PaQ?=Ced|Ai|fKxSuL{|Vr$GZ&l4 z@21+K^>;)0S5_XOR4U`(!Dn&z?j!W}#&PJ-bGxbh%bKR@xfOjf8AX^|tMVK3T2X!( zhN1k{ahYlxHjBw5HexZnTq@z`WD*G?WS%@Rx5xeL1V)?5zYNBtc>$4U&Ji#N;Iwh` z0dSoG6QX>J$iKO|y1IuOS1naI7K`cg)9LgUW2`Q#4pl(Y@^eJ`ZL#)Y*Rxqg=mcu(9|27 zg#5zX8a@A8^Ya)f6u|rHZ^p;*M}VH+34{0iqH%k_9tMnd=LL*O^8zBzoFm|Gpy86X z#Q-5+JFWapj%2erY2h%*@1>pM1;AowC4Z}l;fK9jFs%C^qQJ`EE%69TZtZz#xAI%? zeJTHBrBczK=t~~>y}=lBetK40Ik56afKT~% zURB?Z6NasC@<-QxX_y_}^ZU+iHz{sd_R=JLM85M9gkz4%-zs1$^C_Pp^J%`D_(#g` z7-|{$gXAYHgy|+fg5;syb3*m+y`21Sf22wGcC~8h~z}BXK!`ZXW__yt=evqjBHun-`}tAH|k-uBP*6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6u00r?h~ee!iL z8-HJUoP1S`h&Hymf^c}JAbk0&g7DA(kk3~IVGjtxpDzi5{VhQ_8D9OuGwVe6yPKWW z-sI)qUR_=JmH58X58nGB=OOdiAGXeZME=hB;m?o%c-s^8E9U**c<2L<4s7rqC;5f* zmyJKXV8b&Xy>jqu>z$KVF24BG#`6z+<}T&?oeQrx&-E^xSdSii?zO}53om}`=l?h< z-1_k^eNVYXxb&k3grA+b5k literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects/onion.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/onion.png new file mode 100644 index 0000000000000000000000000000000000000000..5a069c812aa743d310c4e9336c7b2b1eab15a71c GIT binary patch literal 18124 zcmeI4O^77b9l$Fa2xdeAS=5QAqL-k8Z|eIqJ-v+6vzd|fy3CF^dkFTcSFfgv?XGI8 zYG!&j9$dwPAs$>2L<5R=&LKh|c!;7N#ha*?oDwjXgxmyS^Qx+=`*lzCzBaQ7EWBpA z`#-P#AMgGC@B7d%U%L3q`&J%W5d`7Bo$dB6`Tj}%zUN2e^A}&d{sj5@@o@V}DhT(U z&EG!|-u(TlAZ-0L+}qFgJHK*KJXnK%?BTW1U`VtDp?Q8Zgy<^HL=PW?(R$;bAN-{u zhW>ivX`>@|hMTw-ZeLIE@4AmsMk8m!eD`){K-NHcoZ%$%b%2HMV~5D-6YW5%>=_N zPWIxs-zvN7r79QV=4ReKE%A{KL}8RC=+UM$Z#3;XQ-8P(Gu$G!Hjo`4+k2|!YPPGI zK-OJZrks?Tb3Qt;9|qT^J`@FL@}6S4x=Q|lY)pJmn)5!$Q1oF2m-0gEQht2o25~Zg zSt}gC11t@rgQhesq%4a-J~Q*^Xh^Jz23uB+(8bv;GR z)+`OnKF|yjsGw;3o)7#$)>K~!d@oR|K$No+fu2l4vdq9frBkuhuo48OW{}|lb;34K zf#Vo5P(2yS9yWCi+Es`eHzz`Ehj}NuHk;F;6J5s7&X!I)QL!KlVUpr}x?68l^W9_x zDf`8^cNEj63sJt5v`{{YV81ENluoNPv22zK;mLF^hv0(%Yr%r0hS@q zJtY8+uXw;Qv96ga44^~yPycQ1YWBx`UY%@DPCc(OrqX=2olLz|5~&&MuAEozo;II) zY%X_};A3<4=uqy2W=|B=Ddpq|q&jYu>;8p&x00VQ$tYnQILJ1V+>^M}dR83)mz`4Q z%x6a9*ttAXrAJaWjop<)J;rO(n0HUn9BXBuP#+#s08G zmYx%3l(*v9etshC9~LJ*OO?q>Qu5ESDgAif^vdl`>BsY?Q_H8KFl&*cc2SwRV#+GN z>ng8dE|dFR+%gSAGn&$T@w~;QaD@B&?T}og@BqBJ-z z3IU&!<6<+SG&n8_23zE~*o-I* zj*Ei97CA09BT9qgqF}H^j*HER(%`r#7;N#jxK^gW+JYnUQ!U5jH(B2J%zKvno{NaK zcRPY`{pW)4{ELF{?Je^CjUXJ#g7A;7Ah>S`!h`Y6XFk0^bPsmg8+)U#z3*<_I{(8z zKmYQLGjiK_zk9a%o1+JQ_wCy^Zrpg4yg&NVex>);-&R*wk2b#g;GO5*H9p7P?(n5Q z{`zODs}J0K_p39n#9P1p``O-i=)K;>pxgcO;}1Xl*ZogC+`asXede`?yTS`MfBMnC UZ~f^U2`TJsU2Om1@$L)%0T|%EvH$=8 literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects/pot-explosion.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/pot-explosion.png new file mode 100644 index 0000000000000000000000000000000000000000..f049a7c98dc1aa3d97138a981f12e0152d83c42a GIT binary patch literal 18246 zcmeI4UyK{Y8NfF!g7gqA5(26;QWpblin886-v9WVhV!L&G!D_lh)aajjAzGp+p~Ag z?%vsn(lmvqhE`NGNPr5c6>lw#TD1}qZCX_{hz5$pLsV656A%)D7Z4JWstSc!@2)-e z*%`y7l~T<~cm8hn`!no^M>ULg{WL=ajQC0;> zwk6A!WIp}Lm8P&%44k^XP~Me>!~ad^mZPX;i(pN*uXd^l}a!6$o@8)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cooked_ai/overcooked_ai_js/assets/objects/soup-onion-cooked.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-onion-cooked.png new file mode 100644 index 0000000000000000000000000000000000000000..7925d02f37a3b5271ffa10748ad0235e34b8f957 GIT binary patch literal 18085 zcmeI4&5ImG6u{dAL|38*4-r9VCPWnM?e9-#C&rz`UCG3_S#j5ksj05sZ8Fn6cK7a1 za`Nkvn+l4Epnrjf7!mPc5X?=F9t82M7teyQR!?`&yqTRzP24C1YGHTYR=Z66 z)rYxu;rt8779L*^1mW1~N^^~VK9c`Fa6kR~?9U&*NIxFzt!$=(@X(|A?|s52pFSoC zXMPLUH?ob^ISo3&?emyGZ&2mi~sAQLyYNzvn z;zsL&xEv=$G#4!itGXlF?xJeCj%GX~YKm&fiYu#zq^O?adWtHRKefgJmFkHfcx%nG zWjOlZQf)iSdY&xr?d>h@>5Fl)C9AIM%8DjynnX3E^h%VWz7(Y=3MZAHCP{G;_OdXJ z#N01x$2-|lt(FHG{*>eD_J)C?v}8vq%6-(6)kQ^~X5{0cO>ZaZ47%oHnRG~(L|IDh z)Tws8?Kq3m?RZAW;p3TsX--?RKYzPO~$+6hVn}s%5%vC z*9%oH#O39DdfMVsEri1;PtenKdD3V!bw>V36J?}9Z5>H*CB<3SbWe9Y&5{(uQxxE& z(46qmiv2LSGV-CSl4`H3mPg%arlgodA3$@`2VIIj%FtY1pf2#^V=su4F3K8V7i|%_ z7j4z$Q6tbCPEc<-?!*c07HQ~pd0O*St7eRM@)dGA!X%~XNI{xtvIaHad9*d&T0Q85 zjiLhiF%Eri6qI1wave*PG-NxHs@hm`6~~o)jBR8Z*bLO5F6VWCx)}AVoE>F5&G({D z-Qu>Qxmut~h}eo`n3g5A4MUdCTGQ@$N%5w;Oyur&=vbv>P;WoU|G2D+rR zb-$qKSeQsi^;HL{hE8len9(#4aCRWjOG!w#8Powf6**3l#yYzRG+q$DqQOSP)r4R?@YUX-(A zP&Pe;^R1+T^CCk0x;)l8>ekS*UMPeI(>Wi41Lm`1>}`|ib|t8AHPD*vB#nb?4<+RE z7G0e4)yKl`xZz}g>FeaKq#{MThfIWJ7(TW&3Au_T85*{wHeKS9gEikLZG&LbsuB(I zI61_8FaYsjFUae-mDh1a^HjPQ6m=YE&2}=*bFPhQo5}360+?A^(_+Pky$BXjrnnhJtMbqs;Rea8=dY1GdXuELn!)+7L9gxy+JLvg zvyJ>l*x4D}_-uM7Ruoyy|CXlk@ucbI?M>n1Nz;+#D^Zv=v@+U6GqB3vbrr8+F4FhA zq+yw+Zr0_==1GeSVV`t1njw7+lje6?wX&IfFx7B#mLYgh8Wzh2yontorf8+_dFd-= zdH9YQEkU??QV`yJM-cwn zr=PzI!j2*ce_Rp-?_)tY9)Ixq4`-?FbF0nM>-}HafA8;~I{M9<*WNnv-21_;8#j#W zzyA3B&6_vh`zSbf{nqA}KRx{UXPcMKKla+oX4BLk-nd0=h5h}b!dG7(JNJb0?vwfd Ot7pzPzj*%A+y4M``ly)z literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-onion-dish.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-onion-dish.png new file mode 100644 index 0000000000000000000000000000000000000000..07a92f2878f0d128f1ccd158afa165eb6132188e GIT binary patch literal 18262 zcmeI4O^hQ)6@VKSA(*g2C-UU2(_;0a~G45CH@c5~nCa3W!_8fk;tuiE@Y{} zo7qI#s4UrjQ~lnns_)g`D`|Xvs>qAlq&n#JskR{0&kXtqUnZ&8CY>N$ zuKedOf31jtw_N#w*-~2l6|x(wU5&|wtLL}y)yvrNDrXu?^?^$r^hk=tL9ZJo?qInx z^y^YNE0!zbP$j**TsfOnC~mhl#FZ!}qFJ>htm?K{bE>N8*qU)#)D+c{6-QPLNl{(J zaTQe@y(*0*D%E4pcQ>1>qw45i%az?U?YpvkaBxsP(5q40kyXcWWJQxTO`;l7awSaB zKnjynxs$?AlO#9}`e_h_V&)gMqrG&wQpqYBzefG)^~V*3$%q}L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tN<6<)c8XOmZ!4^3#HY1?HaRC@?k>g@B0va3_fWa1Th-+!` zgD@ndzXEeWf9_>V{>~fpr(#6Bw%HPdtKSfW$A2UU?;XvjF z&o92TN_Bs^-aNZC_*?sf!^1Nto`3xMwNKx__bS@>;g7Ffd;6Qe_{sI(3#-PNpMLP( zyB+hyi4!lr^s{&0dgA@}*T0axPM<#gHvRg;f8D!xPFaoWZ~yr8@_i59{i}PPeDd|@ z=)Xn0^VXktp1S|8Xa9M}pZ@+C;~y_S^Zb{-V!tDN`^|@x-@SJ71tPw9czF2QWA>LX q{*Masy(jNndE^z_c-^`rbiTiR@xf=lj%f>p^>gQ&&pmMIiT?vg8tnG~ literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-1-cooking.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-1-cooking.png new file mode 100644 index 0000000000000000000000000000000000000000..76ed2cc6717b356dc6433abf5e9decf843b773a0 GIT binary patch literal 18180 zcmeI4--{eY9>Dt|C%VQ9oZJ~tgl0t1!=C;*{VTJRi#y5fiW9?T#SQlmYpQE@`!dr# zcK7a10&?*Z4!nbVP((ch@gF!4Up(%PTg8Znh!R0KeK>*-qCOa(P7g_}o}Qlh&g@KT zl8r*726p$G>hF)L&$sGZRSlUZ4;}pV%`?B45d`7ph570t{ktpux#4>Hd(Q{YJV5{4 z*q%QU3&Kseq(46r{_?_ZLD>Iae`z^cu081DuvJ7}SSQ6!t4*~9p}e=#M)(*>#5!5= zgW19tfB#oO^u5`_Bc+;BYtNBYfBr;74xc!YzmuBz9WOAa*;m zg|1(h%4xG)5W6bLvDw1DG@!U#J0#A95fMv8Q^Klli_lcUKnzG`^sv#+= zt2nNrioH*vGDD?uVaN3`mfo-YLc{FS>D*#C~oM*Fj|pS$8lsulQm7E8d7{b zNKi)#;yW`Zxt}VDapboXKMcgwFRF)Y$!wvJ2I_x$<7&10fr7Zlj#896s4c5SMILA5 z;l53KEoyeV=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4UP-IV2d0Vn-S39xBv{c$Z@e50S%4|z+j6U7n>2# z;J5$`w#ad@837HB3&3ED92c7r(BQZL47SK|u^9mkjtjtGiyRl55zyec01URsaj_Wz z4UP-IV2d0Vn-S39xBv{c$Z@e50S%4|z+j6U7n>2#;J5$`w#ad@837HB3&3ED92c7r z(BQZL47SK|u^9mkjtjtGiyRl55zyec01URsaj_Wz4UP-IV2hW;H8c3u781~}YT2OQ z$+G^|t3RgS=OW_y#hM_TxJwXDo)UzwFVerC3c{Kq2%kMF2<~%&aBKL~(K83A?u!f6 zeM_AW>)%|wxc9ohoqY0%9h^MrhDlF_jSpDn$kN*B!o`T(x literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-2-cooking.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-2-cooking.png new file mode 100644 index 0000000000000000000000000000000000000000..deb02567ce3db6c2e2024f51654c3f4874f23c55 GIT binary patch literal 18212 zcmeI4U2Gi19l)1{7H}Kd3Y9=Bq2(e(Ds{adx8J?H)bTmkh)XTUDUJkf=4R*YmG5?s z-L-vjgp`JtQjm~>N@+o@!~<&7LRE=3)S>|GTi}6@HiRl5gb)!@AKHiTRAz5)XZOx~ zVZeckYAo6J_w4^;=J%iZ&(1vD{qqNI+d1*=36A4-&dt^r@aNa#->biZ|9=1VU)+vA zuIbJm4ms|t*TuhAaKC>129BFK?=CJyON~2h=yxW8<2TV{uhYfa99P-f>jJonBEE^1 zU9VdD*R#)+c-N_x?$jDmqdSdO+}X_l9o#&y2sc-u<&^f;CMrD}JLsSY@V!pk3+-OD z)c0#+Ic^q9d|xG6t(K1khtUGcvP0nts~0+o+}0RB@sqI-P|qD>7C%YM`g1Bt zbp=DSrvn5cKUnnrb}gB%^Jy;l>FIcS8vLFHfUXxO=(`nh)F_)enLktq5vpNZQ;;k{ zG8dJyT{dk+7bMk|q@0sPbHqo(cih&|%!e!svau-Zwj$YzEJzyhk<%RYftR8KB0%LO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/assets/objects/soup-tomato-3-0.png new file mode 100644 index 0000000000000000000000000000000000000000..be43615da2472cff750d6befce8a1ef446a05d8b GIT binary patch literal 18264 zcmeI4Yit}x9l*C$pv0si1tdxp#OeZVX|mqO?Yno^ral`RIO94tI6{TY&Cc4J-0dE_ zYx`^=wQ7XaMtlKOiAN~qtyW4@RXkN7l~5=kwV+V7Qa=zXDhd%2P=6?h@|eB7y_-AV zWv)0NMH)-?{XP4C%>4c{|C!kjcmLe%d#@e4VT|LrYiFj*^Z4^k$?qFpkN@8K>;vz^ zAG;gVM>Oo$SWL=ajQC0;> zwk6A!WWN2AD~(~P5IU|sU!H1*!~Yd?D{NAWYYr4q4b_n!N7zmtXxCT?;viZHhJ@@q9vT?uq*Cd`9@yV{ePHM)o?OES z+DHdlMhhDaB+jEKSPdbXT*E`zKWOw(Jde8B8Nn4+ALuCd+#!CFCqp5irZ>bad6Js7 z=2V*M0)}Q!gb2hzxDW)jQaWAdvRv>J6Up>6_?s&LdVZ3i_Y}l_qwdt{`a@+9qY}0? z1<4X5b3w`5dDB*OK~il=BAld}eLgCIlVEcdo%4{Ba1tw2ryJ;&|_MbOYKQ&$897^Wc01{5sGv;+r2186GL zT-hy%Ngcp0y8UX;j&?iF_qc=I!m6ZLiYp5M8IquCx-L{zH7}^Tq?@MY8VJgRou#e4 z-6z>xYVgUNs#NS5KZ*fnGgB@l{qb;rs&dtmETjl|#l*dE6d+iJrVDvfLb{?EhLx|j zCR(p~cbIM0S#<1rFhwX?0J$0zlxiNP6ipo>0mzPQ0$I%?17?8;XWIgOF!b;?18Rg$ z#x{>+*VXeHULHWjY+XgLEKR}@B_LIiuI7Q6g&5#wTc~L-nM51CIc-g%!|3C^t=&n~ z+7KEbj8IbUin*-bb#{<+UbJUNt8Cf;CR<4fCPf4}1+k~K+pUgeAyx3Ur*kv}+suc@ zSYJW@rAkohs--pDNffy8ItbCBWxO~?tB$XgV)JrNks(Kc9;lVRUK$304Ag$ws)^I1iJV)B7 zMoC1smv9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ai_js/assets/objects/soup-tomato-3-cooking.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-3-cooking.png new file mode 100644 index 0000000000000000000000000000000000000000..44014fb412ef4f0b0567b57daa3b1e10bc3b7965 GIT binary patch literal 18264 zcmeI4eQX>@6~MPupv0si1tdxp#OgvnXtLgq+wb08oBC{Q=o#0s!4WECZg$q*5y%GPt?YW2E zk3V)drjJA%_vW`HzgKZzICVY8O;ecpSxi z6)k&yG541z&gOW}Dds+`RisK|0oq^J zo5ftquZ`uTSLl}1MiC6XM(hPXpZEpUU^Oo0a!E&>pZ2`!jZQ~?)Mke%icQcE<#9I(-iuZ@oUS>nNUF z!wA|)2UbUDE8bTev&6cA)ux=#4LG| znzhzc8tMXuW>16h?a1hrDST<5Y_@Dmfs@-+BcDgb(Z5}@}M#D1gh(&_p`We}qh zwlxLG5+rj$$=i9;R&+s9ZAl`Wq?&y`DuLs<8(kl=EXc-!tlNrY=M_QHIz9-^ejj)% zIv@rkc_DQPKMu6rAgqJ9ufUj;p;o+U+>r;|_KUtCC_Vt}Fm#NP?>Ax=>ZsyrAlmZkm>BASe%Z zmbUf|pJa2X$tP>7Qn6?JCy&*Vt|`%T}^w*BHHMUX=@Q3Mj!8O z?JlC$fzSY9gpzbu%w_qmbAqJnqP;p=Y10NUIZ8?}Ng~K8h&`>{VRbAEse-pXoTDMw zW!v1NP~q|o%pq44!=B)nY#zH}mdV7OsW=R4;V9|t^W zG-@6M$qp6Qe5ZYd>l_c+L#AKHHm}Q>T4_ zs(Cv&;&vRnyyWVd1)<<54!%E`0OGuA;DWF!sd^sYX4K>|_Fug~H@3Yy?E-vg6*yWgoeq_7HmI*)r-fkJ%K$gs-m*B9 zySRzq6_VFTHm)RbRnxj3mT>95t&Q;3dbX5QgtgUH#b+oI{t@NmZ`+i7+;4j1(x&9& ze$%eyqVL5eT+_D()7MN`CGWb@*D#0i`(0GhH7&0d#Qx@fi#e}}YD;AgzlMpDnpVzi z`X3B5JTlCXc+fUXw+-Tddp}}wwFz6z~MQ224FkA!-y2x!aM2kN8VnZ!gDx^$bVh^*!$rWLiwqZ?5uw3w5isZ?!$oIAXfRv^ z47$j0(HRjM3>N`|E;3wnMuY~#MZlno3>Tddp}}wwFz6z~MQ224FkA!-x_C)kW8H6U zK|cPfmUaA{ENJn@yYTn9@Njy*!f~57a@>6n#_{w>2k2&>{CfxMsvET3g!7IiSCx7+oHK$HL|G@p)W4C@_R(#=I z_rCMkZ-0Ev;&;7$zx?$BU(UJrJoDuDcAx!uba*l1UcRuUU3bsp7xWiz{$l0Xs}8<( z|HF@eYUA#|zPNAeYezr-^1Xk5>fk@+KY#U%b?Rx;`^bmTFY1eb`$O^hFE#gFeNOz> vnMdsti?5cx1Mhh4H%}=q!95pW)40j9bMqr#seKzypPQMSEuXpb=>7iz;b{c_ literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-cooked.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-cooked.png new file mode 100644 index 0000000000000000000000000000000000000000..1cb3b849ca295e6ef030fc324e14adf53d2f65fc GIT binary patch literal 18082 zcmeI4OKclO7=X7_LJ$=7zyZVotz032)XhG;Uhi&ghcr$}5H3;biu6Rsv*Tn{d)Mr4 z5+{eMzybA0B_xD;<#pizy&w)$Nc4iZ_JD*q!-X>vQkeBV{M)fJE-6Tr#**Vdv;Sk} z`{#YwTkDrzo1c4OP7s9owbl9t{XG+ZpL&x1J^$dN*XhsGz16FsAUyMI{5>Una_4zL zSozIuZbqApH*D;87m(w($U?u{quPQ{S?u=^zD^>sMYde8TKMz3?+c>qR10sF8cL(L zOt#(CgMeHZRRX7NZ`3cQ z;pl(W!gdt(Y+2sh+gsQxF8INgtXh^OE1Iln64j8xeJ?_N$qUaWPBK4r65_z^MXv9O zv0v2kccN;c5C_UXX}h|;JdhWr>?lRKk9xAYpvaSq9Gu(qc7o2JY7Ul3hjfV-h15=+ zXxH2JBR|~sr-aNOPYq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-n{kh6R&>QzJK?w{`Idv z|8Vc#Jtcf_?sn<3&p(~NvUujsHy?b_zJKZ``aT&!I6OQpoL`*ZzcE*RG5&vT5t I3)kNJ2ZqY3=l}o! literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-dish.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/soup-tomato-dish.png new file mode 100644 index 0000000000000000000000000000000000000000..247e03e8a3bdab7c73da2588078e74a286929130 GIT binary patch literal 18249 zcmeI4+lwUC8NkaRiy0#!k+@=5Q?!^ENKIY4Zr1d$PVZ(W+M8u|)EOknR-ZaGQ*3ut zTU9gDyP_m&2tFm41QO#vAfizcLWqbUhzMRoSlLB<2!fc0UGfr;7~-j}uIjIQs`s?c zCa`b@X8M~`-{qX&cWz%j^kc`5efPS#o8~xgs=)aCo#PMFyJh1$Tc zP2{XutnmYt^wdJ_a2AkXZyo2Cq8Rh_d0jxVYVw9PFV`(o(Z0hglB|o8CCZv0$+l$K zlFSc(YK=J}IkD&4tIeasaOA&*+E$wOY*F0Z-JRc6=c9O2lr75=B}G&efoKTH=`eNs zLYUl=J1P7$af0HYmj+SDXMWvww4E;0YFVK2XE?5IuM89>Lw1Cs*mrxPJTHk=Mjk3{ zdfRbl&@~Tv-I=^V zUEs$!5(mjyE)!kJm>_Cdz)vhrzbj#G0%(eM>U6ZLa?~xv(wxn2!FAFXY9T&JZ?TBICNb^C$6h0svb5}#b^s^y`X4%Z4%d)NIcp1+P+c*0?zgX z`hFac6U^-Zor0~3W#8A;I$3$HM%em_U|DrZP}-6!wXv>&u~fL(6KXlg=I810=`xs~ zC-D8_t)uxlIBR-toZxIHU8ogXX?Zy1Q*Jo%20OCtqU@AvplpA_o+FO6j=EJ^I=Mnn zk@lAnV|NROm)hNOR|Bo-PLjw^cik8t-X!aOwyih!J8n1`pn9ELmQ*C}&OQ^N zYnq1)MQ|-i7c>PKLYpjc!9d?z5PjMSdK0`SJ+l z(};I_y-tAKY=w$Dp*Or8mM2d!P~hYLI93nG!DpGNpqC{k{t6rOzSrh#XK+68+1e~m zo#EZA6YS%N+js7KOV(sv!UEE>`--8G`;$R-MAz3XthSM5_~f4Vd2?5B^=A8Oc|F

I}*7j4Yz}af)ysN-jRjg>ggQ}}q&bmP*d z@bRSS$nx$mNE@Wo9&~1+8CYen(egJuC&;T~+|cWFweEIp!=vTZ7RQ~rmE(T=2*-W=U-J18$8Ad-_m7htXa9!d4n~jv=#`^H z_pz1c;kEwxzdioW+#}MLjzq7%_t4wtz9ByF&pWl3&)xa0=l}4v_kMW8pC5hnkH(Wa zXMg?RgI`%(bi7+vPP}>XeVzOL`>#vtFYb9};l@usxp4m7XHT82fB3t}y| z>YG39J^j^(H~#wKfsVsDe>(fnuby)>{^l>-_xcmtZ)|-0uWOv2SRbzc<-%3}{^d*m dxrsY;^0ilge(-lcAf4h?jvQ+~d&kL#KL!29>D~YU literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/objects/tomato.png b/lib/overcooked_ai/overcooked_ai_js/assets/objects/tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..8cd63e9d9e897e39ebd6ccf1e8fc61cd8a330291 GIT binary patch literal 18126 zcmeI4ON=AM8Gt(oh0TN&K>>j{wTwuJL`^^3Z#-Uh$Fs~pysTy?%It|PcU5~@Yj-={ zJ!9`E5-$m9Pmwl4iBJwXM2dvO;~pd=L=Hi42p~kFBHw?DMw#_ry2Z-v{4+?h*F!t={Iv zRFb~^-Te0(((}K%Taq^34R?04-R2KHKklw#61V8;pxa~Gl2ki2=wbgd&EytshtXQ) zli$5okwdap`LWqlo4s|q7j7OV^upn}9slsM?~=-?`bur!F$Z0mVR_K)M5#Aes|@{m zOwOB?iab=wF0WNi=KTDn&~>a@qnzWnx&|&q8UilJk|A7 zO&MKmDB_!~+8)rx1*nex4y)5f_iqh}*SNqk~IB6@I>$-}nE4q%D21>6)86Kc0 zy|-{u`f1SAPr_an#*v)+#jSWhTdP#^K;xg$xVpV@peP-&V-%GE?kU=;s?0MY{@A9s zpLB*@BfdgAv`eEbWp>(JyWU=$#pzzWAmsS*!oVyi&E`1v-2QgEb3>=u#sNbxLORzn z-MP}E$~H~o{lupm2W%+!&KrH2ZPQ71mT<+?=Q_&5V1b|f$wCNp5H2vwpA=@pIaQ>( z#-MrY3B_5Q?8I@WUQE~XWiI6P^?Z8T^8HQhhf$uOAJmjtqsi2n_@fP+(K@qrkm@4U z+0m030R}VCVsjVWzv@Fyzj4CoL)p8s+u&J-jcUH7ccOSC3-r)1u z)NFcNQJP`KW~))p`xEBBbVziO}pBzrgFft{?p{4HBdXUwP0 zHzV(4boE|%|6A@BU33*Vn-?oS?iH|zGRMs%TA7E&1UIv@fzm%lA;%krp{w&ko-)fxR8T|P#*R+)u+;rkZ^o!qIKBIgGy;D#B{@Gh=&;9Av_ihO`UfAwF_S?gswjON!?a?>B_t$^E hcItsgUp*;3|6=QjpZ)9of3OZnTN~#ZFP*vc^cQhp!N33j literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/terrain.json b/lib/overcooked_ai/overcooked_ai_js/assets/terrain.json new file mode 100644 index 0000000..50b11c1 --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/assets/terrain.json @@ -0,0 +1,155 @@ +{ + "frames": { + "counter.png": { + "frame": { + "x": 1, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "dishes.png": { + "frame": { + "x": 18, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "floor.png": { + "frame": { + "x": 35, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "onions.png": { + "frame": { + "x": 52, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "pot.png": { + "frame": { + "x": 69, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "serve.png": { + "frame": { + "x": 86, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + }, + "tomatoes.png": { + "frame": { + "x": 103, + "y": 1, + "w": 15, + "h": 15 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 15, + "h": 15 + }, + "sourceSize": { + "w": 15, + "h": 15 + } + } + }, + "meta": { + "app": "http://www.codeandweb.com/texturepacker", + "version": "1.0", + "image": "spritesheet.png", + "format": "RGBA8888", + "size": { + "w": 119, + "h": 17 + }, + "scale": "1" + } +} \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/terrain.png b/lib/overcooked_ai/overcooked_ai_js/assets/terrain.png new file mode 100644 index 0000000000000000000000000000000000000000..8c19326627493d4960365026363f63ebb8f012cf GIT binary patch literal 912 zcmV;B18@9^P)Ugd6s$A7>7@AJOD-}m>M0|%df zHUkcFv!n#I+8f4Y>^LLPas{EbdpPO~;#>YbX43buFg<2@yne>i%VgDYobQP5`z|3V zi5WRwj?H|RYI35VF*!L|^<7$9TP^QGB2MlS9EoG!2{E5(Oi19&Wkha0L!nSWu~>xL z?S|LuMJCl{30O2-GsGhvFB&g&qxM7-)|Te5`1&z6lmhGy*P{Sko^1k86+kh3H?rXl zx3ljZHV@ZfeSN+BJ2f>maBZz%yuX?Gu8D%nf*5S;MQuY(f;ciW;Jt%+w-W1+}AuxrBXR@PNx&~$9x!0xPLob7R1xBAvj&z@u;OO z%nm2Ya3x8qx}?gotW`r1WjU4tT$|fzEIEPa*XU~I4tF=@vih+o<+32|rd$G7mSruA z!C-LDtv4EtLL^*Wxq3iExvGP%X6|qUp-x0@j#TvAZ0b7H(hp`oz9fxlZ#!>8#e%4n z>u@(b{s5Ha1uSNtU_)8mp_xr$JG zA8LK4u$KRTnTdXUoF0Xhs=W=(+~E=v^>*Yg6{1m!Mzf_?5W6au=8|b@CVf~4TviRU z>c@v%Zfcf2ai37g}hnXTAhL5ss~J=e-56W~kfooXfyS{PhfZzZ!Y%SrQ8?yDEQ zD$NO-;nGTWv}3@QaA__%6R{qPgurFZx^tO_Xo}pX_T!7vC^zN4nHo}QPME+omSCFM zI(sf*OSm+b{N*@%EYe0J5k1$cx6Y;?Q2Q}Yw@g#+r%bA1X+aE?S>bk9uF)met z{)`Z~)y%p);c7kCyPr4W;MuyG$ literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/terrain/counter.png b/lib/overcooked_ai/overcooked_ai_js/assets/terrain/counter.png new file mode 100644 index 0000000000000000000000000000000000000000..07c905f4d601eae8551e163b3b415708dad54bf5 GIT binary patch literal 17950 zcmeI4PjBNy6u`Y8At+iQfdnhW!O98=Bpi>O*s)ELrQ39A(PpW-L3AY~b~2u{)+Tna z-8SusKPRq8NDEqtBZ328fCC(WZvY3r0bJn9X&KwG^O7c=EL|-unn-D0$M4U~?|EM4 z`H+vduDyPK<@ps!lFn~#w6@vjQ_1`B$JpOjfBEzc_VL7U<3=P&Pd<~p&q<%(xgbgF z2VQ3<-f3TTNH8d4H|WyxXfR~jl2pGm8e(#b#&VbLdVZty$G6{=WY2As-Zt8(JzS%E z-o|lAuODCQkmFm#c1xFW=eGbg#97L7>g4P!6x<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001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/terrain/dishes.png b/lib/overcooked_ai/overcooked_ai_js/assets/terrain/dishes.png new file mode 100644 index 0000000000000000000000000000000000000000..71f71cfd55776886d6f21d978fd59b7e892bab8a GIT binary patch literal 18402 zcmeI4eQXrR6~Gs@iV`QNR3((+sM=mW2vYa<^Y(7H=cC4FY7?I^#t0LNU~hNU-uiC$ zxLtE+E0rjLKw8?gX^0|()Ci|Ytp| z?R|{TcZ?I$N>pRXzUSHZ-pu^o%$s@p$KBi4`=$9UOIj$3n%~`(?1!J9@PDtp2LAoR zOZ!&AkLz+>8(fOI{!{+%JZk@e#T3;!X$=f|gQ*@>cd}v4aMB=L%;umrMa7pFbDBN^ zJUR`AEW0gq;b+f=Xv=5|t&gO*RIURITV3OMuy(w6Kp!8`6(h7f(GoAJ&_Nb>8ePn0 zY*#I|g-U)^DErN9h%TvkBWGQO}@iNOP zEH5z}uX2jY@pSnolxTrcJa3q4e{yBHJNRE)XxQ^|D$5oMg>XR(JNY4&R}_Wi1Xd6j zsKK~nwx<;t+r2q(Qt^`nuAaAYp5@rI?^jDZqh4Dmf@#z!!U~1J@bN>!5QRoXX9OX776apcb83xPs~p9eI}7#E<`^DFjfo znwa@d0<+SZ3PK%+(A17R&^#wU;5eB?uw45pv7kFT{N)*?Z%=8uW%~hI7H8{?YD=f) z423naui+o-vr zRnpN%{T%fKKaFH;^iT13(#CU3@BKMz0`wQ-eKN4XuwJ8VF=dYTgy!Q>eYL^(!^$TE|bB$1J1 zPL9PCGYWLRv9q9c`tVUUmz%u5rcx=j+jcz-vguAH{P9?DJfdOJn$fkiEJ+Zg0E9|M zh_e|Tt5jb(FPN}dk(GTav4k4{2j_}vyJiAA&?FvSRdkJ!I1c7jEe4pVEb1aBnp#>+ zSGMFwh~3QlG0Cgd>&cw+Dkhcs*|wT`D?vmu)>WBTubw&2d2i0HmiWkd_5XBl1~;MU z6-A{=nOT8U%B|qsU+Ldg{0bB95=_AXuaWRQiHhXJN(ngIlv-y#Z8w&^8|4DLX%#5R zW`tLys9#INYiyHRIv6VAtWjUiTnoXVmj-TXy;b6ntl>uLzPSGyNrjaptZGX4!vrjq zXS5;SO3w!UiZC-;s`#P;2Y*=J|64XiAJ?01xV$O)xZbp8xz4t{1T3{ngQ;sqto(Of z!E2bc@ck}G$dQN`iL>?1^%i|r5o89F7JLok`ZX!vR7rtU5?pvjhz7xhz`%5SIo)Mx!a3L`8BEf}cglG_4 z2n@VPaN!vt8Uz;t11}O>ct(f@!G*xUiv$;*5u!nGAu#YF!G&jpXb@Zo47^Bi;Ta(s z1Q!AWFA`jMMu-N%g}}gz1Q(tWqCs#WF!17KakbRGwFTJlt6B>1J6WE4BI|#j3$1tc zrzmRtR*KqwH$}aB34WfVs8Noh-rPb_>O&OuY3KgUzgkIA^S;`hY#%88ap(QV*^h0# z>DS8(`#0OafAWp9XR^bu^-ZL?(FNal<(H>-?b-M27oWa3|C;aK`^eG5uk_roeq!gL z+nC<*(G~wZzv=PFo(FSp9Z9@<%jDG9GcP=+GTUE2Eu7oMoVjP$)WT&4-pV^u=We@^ zR*ogjvwP?VAHMkSo&|S&dxH{Ej=t8~%i4c^D%`*7&L1u6U-jjeZ$19wKeT?UbvnACZup%vf78py zUT}mhhkolmB^N;W?bZkWc9VO4 zEb-=7-v8msiS`8_-@AA9#9gaz{Ql7o)O|~Ln@3(U{p>n#1m;<=sOg|M>02W23L{p0}{K5IXYC&I{Ks{m!cg|D{l;T2C!_biXmr Pk6L$UZ}PDfTXy^h{pwF~ literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/terrain/floor.png b/lib/overcooked_ai/overcooked_ai_js/assets/terrain/floor.png new file mode 100644 index 0000000000000000000000000000000000000000..3c706e4868ab9f2a1fb497bfcbfb61c6a0c86af7 GIT binary patch literal 17964 zcmeI4&2QX96u@0oR1j2g=mEsZ+6n;@UVnSnX0uhAO-T@2Lb{0b)Q;_OVs+PEY$w^| z0s<~vk&qD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`w#ad@ z837HB3&3ED92c7r(BQZL47SK|u^9mkjtjtGiyRl55zyec01URsaj_Wz4UP-IV2d0V zn-S39xBv{c$Z@e50S%4|z+j6U7n>2#;J5$`w#ad@837HB3&3ED92c7r(BQZL47SK| zu^9mkjtjtGiyRl55zyec01UQxBCe&$SF7NNe4okz`Qnr>fBoeO`O+29Ti@ym!qIbr z@b3G9@Yg-^_cuYfV^YYg}Iji*ljkW8Yudd#H?{D8xfz1E_ literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/terrain/onions.png b/lib/overcooked_ai/overcooked_ai_js/assets/terrain/onions.png new file mode 100644 index 0000000000000000000000000000000000000000..2fd4283e0eea4fc163fea0c369ebf83e98daef1f GIT binary patch literal 18202 zcmeI4e~cVe9l+;Ah#t~H(AYF$CW{psnVTOwJF_$0+ve`J^$ywgydH8VMtJ+?&E2HC zGuxTj+r35sYoZ|4#0I2+0;z-s2mxt~Bs2{mLij_hp^=b6H6hfb#?X{VOe0m_?Cj3I z+uQ5AdIW*IP44b{Z@xd?`+Vnp=Y8joy<>dK*DvW`+s|>_C1az73H*0;^z)gE@b3+; z-F+?o^V#a?bii>JUmpGRarf?9!*QGDoXM$hs(76Vy~+Tvyb>B{RH|5;<8m7tRRFi6 zkT0Pb#~nKqkQ=nvVTxh{R7H6} z5_=h0FtMrD{Bm<@78Fq#RgfD7*iP!LDTm93JCK~1dxfE&LE+g+@R)&SN427EtF5^#9qTatqLBj zMLT53g($%32#7S{WHoERFqm05+P+YB@;E62mSdT)Bq@es%K|{UB&Zop6H2O@7F12r zvRT8{5tMUcwDYl1XC{%S=IFv0Uch;Q8oj%`mcRR?u|A z5>&mU3)ze&30Vt4L$Z*fBaCU0d1q!V*X`)obzE#M4`TNnzLpKr8n9$R0Xn{0WE~2I zlr;nkLLFpOn6YKM9f)wYD9~2l!OsFvCUn|t(@3^$EuF#lFi(BBB3#vN->dM+ z!-Nk#9#pGk2ZCsaigT{jI%g$?t-Vmf$A`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BT5Ox$n`1QOXcy9{AZSm{ReQ}EFKDO3e-su1E-KFKD zf_U@FrDLCeee1jDgI{0WKXH6h>}~%1=X>EZuWUa1{_n5d_v5{vd@0;=-HUJCwX*l^ tk2j0IeEdPx-`pt(moHy095aqQb>xMwexPoJwUeitADuY=(qB{(uMhwL literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/terrain/serve.png b/lib/overcooked_ai/overcooked_ai_js/assets/terrain/serve.png new file mode 100644 index 0000000000000000000000000000000000000000..a52fd7f5b9c7154d2b97f898211ebfc0d13e5270 GIT binary patch literal 17950 zcmeI4&2QsG6u`Y&v4Wx%hdqEeSy>^0gyWCcj_pmeYMU-CBFoYZqI+T|<4J2Zv4icl zX#s)Y#1#n%AtbJx_y>^S#E~lp#2E=L95^8k%Zwd6FKN=rs%T-QiPZLW=6%fkp6A)m zhkSD9_A6Ico?nq9>FV}YYlr@QhW$Kwh5o+r(`T>JKTi#}?j@4+^fmT#N&4c;=Ok(K zDCq2_yY1IJ91W_-kGiBf8VsqnBsFf1h6o>!RPK_!AY85d@$L5&Iq+92Z&_`vJ=`Gs z!PaR^?w;Q6;L`)_`jwl_mBz@U4hAGe@@UWx6K}Ly$^3d$X2WVl&Q#Ka)yf(RDDSrK z$Qw~iWUFc`Sg$#9-L2}D>lo(CvZ3j=s=2CeDw^(TuBYkp_)}@FP^l67J#VLVYaEXL zw_4dx)1jxT$H&Lj<61R}_f*|=T~#ww!%(P(lAMGo8Yy9NJ$F+0X^{lS!7vS?P-cEn zH#$sLD-{-~{EYWC7?y#;WXz6IR7Ys2>QzmhXXNA3W_TF)v!(f1C4Dj=VVY1oeXiYb zKT4xyKUxs7oL(51=A_*&W6xdhU@$jyl5QSR1Y@LgEtAg4kf=K(i4J2-Hjn65uFur^to8 zvB56Sy8L1r;UHuQda0q#8ci;pi9gapDQQw$N6}nGb2>)Nt2v%wE1KzP8gP!G+>6T|vmsaTmXwLeeN6|+qTFML51%7<&^`dxy(q=F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?040lgVE_OC literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/terrain/template b/lib/overcooked_ai/overcooked_ai_js/assets/terrain/template new file mode 100644 index 0000000000000000000000000000000000000000..0d6f10553a6de6969597b32d3ff215477a4c3480 GIT binary patch literal 39163 zcmeHQ4RjpUb$+A&Kg*V7V`8WFBL6@F>;2K{7g?4i{~jzOB-w@>XgWJPyIQ>3S$0>l zGjR@boH zRnt)K_FQFiJ6*L7XM@A#u{&Lj&W1*(%ch2^<`TGSiu(MGovYWX)j?`SRZlz~X>>TY zZ{NOrd-ZZ98gRH88X6o{7>3GG(=7FNe($A_sZdT4ES6r z`64|^T#5B4V^paZk6AH{Nqf6qcgptm_NJ^l7GKj35U7x*Mr22)98>zDlDwuL zy0SP`?_=>!IWamJhywD&00I6@(2d5ns4T{nXt$z-nz;gXXz1A5+E8KYY*)04QZS5= zeWuBg%#;|+ggkk*7?+!Yx8Ck-usiF!-PMiN^^NXYyVKL?bQ*+k$|M=>iZAFNOvrG# z?5?_QS6ySZv(Z^&ch=}K43x<-U~>4xxR{X?BdtM>Pipil(Oxm$EJh-spd_LuJNm;u zRX=q_X>ue;4g7j}W1A9EqR?2mxw^@bDmx|DYDMZpO3ZEhceT|7qWvQ;Vp}y8_cZ+rPc9*M8vNt&E8|*$wsuOEGQjOo`Z*r(2 z67AyEYNA04mis`gZ|LW zb+x2^X7)rkRnc1QAUZXQo?3s6tHD!;D1v&9fg*3GLD;B@u8js^IS@kz8V%cO+2!}w zR)fNOL=Rx=ciS5pYMger*C{%^a;>LYtk?RILd>YD)(26E2F>b11KK6uV$Mw{5gG1? z7>&tjmR3}0c1gGNx;i2cnYTt!!imx>p=ptQO%79TqFFkp$`%|woS8wuQVq+?C!&CJ%|?A)A$CGMQZE;D~+!eckuYyL#oRlZW1y%xM4mo$5@z9+YliPbFPBSND=b zkU~tNHVygJ34pb!#s|vq9DoXVE<9y`2OJLl35Uj`yM>c-k!bd$i04AHl~@8d3s)8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| z8qaO(i3ekpf$>FZbE*>0U`#frh%dmP=w=`1$}xPLMfA)D9~Mm5<`{gO3~Ubl8gJ^~ zQ~fHv&H2Myo1T4Z({RfI8ip+?{2UyCM9B0_9}WbDD>C_gBhnQ3g0UWWdrB?f-_G#w zzI^c27yjsV^n26K5^dtWDgDOhf`0dP%KQxghrn=#-yNs>J28^(4{S$z?x7QD{>J6@ zpGfmJE;l=o=8w1w;2WQ@|8kB4Oeg4F=lMT_>~XL|WRLF~?=K@MKRiCpUq(`fj*s&< z1u)eVJ0-TMG@0651W#y+jGBDHpW|oj{iSSFY}CjL#;f(x5QCa7{OQO~7w(4llY8HV z(`mX|xckq$7cur++Ax0kP}+da$ku;x<8M$!xe+w3O)2QR+e!AKZSEuRfv?*^hWoPhJn#p}jDxE-MbQZYKpwY)!A7*`&^_;{Qj~e2nHe!oUjU@ji_vDI0jd!K0K_A7_1*PU9Jj_p%*gJdT~h>$UB)uM2!Np??7i5BP_McE5A>o!z>J zxch^nuO0nBPrq~Y@ZrNp-_eTCz7EOP&uU4nR29K__vj+_96Nh#&yYr>G9^S1mtM-b zUZCpt3~5|k#L!TJi^S+$T&P;H)~q3o3p4!wT}M7RvJ1Qs9`2_a^z;$x;1R9#1M1)h zT2d=jMGSFXUBs?8K73=BUn5eP5+aC8FXddksZhO|&qetC2`&<&b8(?+#agrc8W(0H zOf^^EZfYd0(U`HHI*6+?h11kQT%svxrK+{xOuSol5qySdL@G~01aax5oa=5bLa$hx SWC<=)#i~rTVl`!U75*Pv(dokg literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/terrain/tomatoes.png b/lib/overcooked_ai/overcooked_ai_js/assets/terrain/tomatoes.png new file mode 100644 index 0000000000000000000000000000000000000000..8f5a33fe452e496fad88b39b25a928bf365b1dec GIT binary patch literal 18111 zcmeI4U2G%O6@Z83M@xW0Rkf6r3R6=gy6Sj-JY#zX$8UlZ?-{{Mc0z!lRM|<-tXLdJZB#KF1^Kd;10S?{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&*ztShaa_`YE$QihQ`J~1Eiau%2z#k6+V6a7w zi_HjVa9jWeTjaRdjDQBm1z@m6j*HC*XmDHr23zE~*o=S%#|2=pMUIQj2xxFz00vv+ zxY&$<2FC?putkoG%?N04TmS}JOMbN+cnd9?PvF!U$|SjZ2YP(K6-F<_uGw?qu<{5@_Bb1{ppog{b>8+x9$l>E;{n> zocfc?PyOYiQ@=X)j&j}`=fC^NiN)tGdu{dRZ4b+ToIY~JKVQFi>fYlIe&d#7*KMDA z`H*qtvtN08Ie+4g%IxF=JKsOK__cpLvE%SZ7eBM@gO_gFUq8O%vEa`q=T7|k(9Z9k z@2nns@;}dA`r+eWzH{}N3#4t{Js;d~*Due#=a!>aocz<*e=&C9z4yK7+*$bE&fm&U t{Izuizp{MCzn(h0FGNrO=7k>$Pyg-*Z^`nT&(h@xljD19$9Lbp`d`lY$+G|e literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/tiles.json b/lib/overcooked_ai/overcooked_ai_js/assets/tiles.json new file mode 100644 index 0000000..c01e78a --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/assets/tiles.json @@ -0,0 +1,236 @@ +{"frames": [ + +{ + "filename": "aqua.png", + "frame": {"x":0,"y":0,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "aquamarine.png", + "frame": {"x":264,"y":0,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "beige.png", + "frame": {"x":528,"y":0,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "black.png", + "frame": {"x":792,"y":0,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "blue.png", + "frame": {"x":1056,"y":0,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "blueviolet.png", + "frame": {"x":1320,"y":0,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "brown.png", + "frame": {"x":1584,"y":0,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "chocolate.png", + "frame": {"x":0,"y":264,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "coral.png", + "frame": {"x":264,"y":264,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "cornflowerblue.png", + "frame": {"x":528,"y":264,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "crimson.png", + "frame": {"x":792,"y":264,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "cyan.png", + "frame": {"x":1056,"y":264,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "darkblue.png", + "frame": {"x":1320,"y":264,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "darkgreen.png", + "frame": {"x":1584,"y":264,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "darkorange.png", + "frame": {"x":0,"y":528,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "dimgrey.png", + "frame": {"x":264,"y":528,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "green.png", + "frame": {"x":528,"y":528,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "ivory.png", + "frame": {"x":792,"y":528,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "lightblue.png", + "frame": {"x":1056,"y":528,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "lightgray.png", + "frame": {"x":1320,"y":528,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "orange.png", + "frame": {"x":1584,"y":528,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "orangered.png", + "frame": {"x":0,"y":792,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "purple.png", + "frame": {"x":264,"y":792,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "red.png", + "frame": {"x":528,"y":792,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "teal.png", + "frame": {"x":792,"y":792,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "turquoise.png", + "frame": {"x":1056,"y":792,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "white.png", + "frame": {"x":1320,"y":792,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}, +{ + "filename": "yellow.png", + "frame": {"x":1584,"y":792,"w":264,"h":264}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":264,"h":264}, + "sourceSize": {"w":264,"h":264} +}], +"meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "1.0", + "image": "colortiles.png", + "format": "RGBA8888", + "size": {"w":1848,"h":1056}, + "scale": "1", + "smartupdate": "$TexturePacker:SmartUpdate:52b00d7d091b084365e705986054b3da:6e23a407a57817c9e7eedd68e1d2c420:76a249431ae82685e78277c252e06348$" +} +} diff --git a/lib/overcooked_ai/overcooked_ai_js/assets/tiles.png b/lib/overcooked_ai/overcooked_ai_js/assets/tiles.png new file mode 100644 index 0000000000000000000000000000000000000000..bdcfad839352f76503de2acbe09a7056d627705a GIT binary patch literal 10510 zcmeAS@N?(olHy`uVBq!ia0y~yV7FjkU{T;;1B%Ql@2UV&oCO|{#S9GG!XV7ZFl&wk z1A_vCr;B4q#jQ8D7j}gt%CtZHKQT9&#g}cevvzzG4E5YMO(G;l^kVl+*R<_=H@G>m42(X23< z6-KiHFa$uKVz-J+NWsOv}28%;JAVKl?zOo!|cc{dRDd6zh$>2|D$*6`8^b z&p&?qaX{(7xsNy7rRP9waA-Tg31Ovhj0%m01SkYX)5K_27%ddQWx;4x7|jZ!Sz$CQ zfI@(74Wwg6#;Ya4Vb0LN1RuS_(kt)T`&s|Bb}~cyH22$|A3j_NZUb6b-Lk7l6Mk@i zKl|%nm(>p3{C%{ju(MQa(iirkOfy@}1T~6+u%sci(o)cK25XN0AYW zA0(<2oFA}2SffItAu*aJMso)+1V#&m(c*EmRsa_TqgjDoSt0rCnLHjy1?13(Z=mnk z!>^m>^D)SukOcogBp8=``-_~EHeeoJL}mWKmYmYyB0>9 z^WxcmZ}O)x?fG{2@k=($VM;6`m&03#^|(PT0|Unv&{_a+m}48f9o|7O>TO^MAPv=z z#x|aLjM2au4IFTRF`8jUv%+Xrpi5TRn3iS^TFeLp3l8wY#;YFl{bBX7pKj|W3X<@2 L^>bP0l+XkKti%-C literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/demo.html b/lib/overcooked_ai/overcooked_ai_js/demo.html new file mode 100644 index 0000000..c8d357c --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/demo.html @@ -0,0 +1,87 @@ + + + + + Overcook Demo + + + +

+ + + + \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/images/screenshot.png b/lib/overcooked_ai/overcooked_ai_js/images/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..7bdb4513b9ba1957af98f1b4015bfb6db988fe64 GIT binary patch literal 11051 zcmd6Nby$>L*Y7ZZln9D|f}{dUhjh#sfJ!Q*BB6l9&mRJALxA(Yc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!8F*CCY`Y)EEm=?|r_XIr6wJ)1f3Y}JGaQEDVJW#yI$$>Z&1sscKmI(?9K z^e7`czrTMX1;$H#@C5AffJ51T9>4pN6L>~&)#k3#RZR%t5Fy-)LKC) zCDEnN1cK3BgBr_lQ`R})C7uxAs}G*>SE%l?gE|uX9PHH4Vsju7Kp5Kp;UxvU=RyiK zdQA*?ZT?U5g1P4e!gqb%P$cQ|x1wCP+|_~ni%~rbdsuRwvo~!6NQ~ntQC{*u;}k=Tfu9x^ciGvBxHh9UHb*-W8Z{`QY`t1H=lJ#L{P@b!%dh2S@TTF~TYVLs$T^DuPtfi~(NMxi@im5jpVbFx{2PKB|^h5i~ z5QbF4WsLv@RLvrKP!6f+h{@3By8~sMzvDj)=$4xj-GId(Igs=YM9WiDVJ&hyoEouaK8W*PZH*SyBP&SvrIx+8HCYB+JHWqMPhgO z;3K0(-MjEmd#={G7!IOs{C+TH`;_M6ydM+mc?yK<{|jt#=6?VH literal 0 HcmV?d00001 diff --git a/lib/overcooked_ai/overcooked_ai_js/index-window.js b/lib/overcooked_ai/overcooked_ai_js/index-window.js new file mode 100644 index 0000000..12f5c10 --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/index-window.js @@ -0,0 +1,4 @@ +import * as OvercookedMDP from "./js/mdp.es6"; +import * as OvercookedGame from "./js/task.es6" + +window.Overcooked = {OvercookedMDP, OvercookedGame}; \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/index.js b/lib/overcooked_ai/overcooked_ai_js/index.js new file mode 100644 index 0000000..f0309a1 --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/index.js @@ -0,0 +1,4 @@ +import * as OvercookedMDP from "./js/mdp.es6"; +import * as OvercookedGame from "./js/task.es6" + +module.exports = {OvercookedMDP, OvercookedGame}; \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/js/mdp.es6 b/lib/overcooked_ai/overcooked_ai_js/js/mdp.es6 new file mode 100644 index 0000000..a149fc9 --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/js/mdp.es6 @@ -0,0 +1,707 @@ +import _ from 'lodash'; +import assert from 'assert'; + +export class Direction { + static move_in_direction(point, direction) { + /*Takes a step in the given direction and returns the new point. + point: Tuple (x, y) representing a point in the x-y plane. + direction: One of the Directions, except not Direction.STAY or + Direction.SELF_LOOP.*/ + let [x, y] = point; + let [dx, dy] = direction; + return [x + dx, y + dy] + } +} +Direction.NORTH = [0, -1]; +Direction.SOUTH = [0, 1]; +Direction.EAST = [1, 0]; +Direction.WEST = [-1, 0]; +Direction.STAY = [0, 0]; +Direction.CARDINAL = [ + Direction.NORTH, Direction.SOUTH, + Direction.EAST, Direction.WEST +]; +Direction.INDEX_TO_DIRECTION = [ + Direction.NORTH, Direction.SOUTH, + Direction.EAST, Direction.WEST, Direction.STAY +]; +Direction.DIRECTION_TO_INDEX = + _.fromPairs(Direction.INDEX_TO_DIRECTION.map((d, i) => { + return [d, i] + })); +Direction.ALL_DIRECTIONS = Direction.INDEX_TO_DIRECTION; +Direction.OPPOSITE_DIRECTIONS = _.fromPairs([ + [Direction.NORTH, Direction.SOUTH], + [Direction.SOUTH, Direction.NORTH], + [Direction.EAST, Direction.WEST], + [Direction.WEST, Direction.EAST] +]); +Direction.DIRECTION_TO_NAME = { + '0,-1': 'NORTH', + '0,1': 'SOUTH', + '1,0': 'EAST', + '-1,0': 'WEST' +} + +export class Action {} +Action.INTERACT = "INTERACT"; +Action.INDEX_TO_ACTION = _.clone(Direction.INDEX_TO_DIRECTION); +Action.INDEX_TO_ACTION.push(Action.INTERACT); +Action.ACTION_TO_INDEX = _.fromPairs(Action.INDEX_TO_ACTION.map((a, i) => [a, i])); +Action.ALL_ACTIONS = Action.INDEX_TO_ACTION; +Action.MOTION_ACTIONS = Direction.INDEX_TO_DIRECTION; + +export class PlayerState { + constructor({ + position, + orientation, + held_object = undefined + }) { + assert(Array.isArray(position)); + // assert(orientation in Direction.ALL_DIRECTIONS) + if (typeof(held_object) !== "undefined") { + // assert(ObjectState.is_object(held_object)); + assert(_.isEqual(held_object.position, position)); + } + this.position = position; + this.orientation = orientation; + this.held_object = held_object; + } + + // pos_and_or () {} + has_object () { + return typeof(this.held_object) !== 'undefined' + } + get_object () { + assert(this.has_object()); + return this.held_object + } + set_object (obj) { + assert(!this.has_object()); + obj.position = this.position; + this.held_object = obj; + } + remove_object () { + assert(this.has_object()); + let obj = this.held_object; + this.held_object = undefined; + return obj + } + update_pos_and_or (new_position, new_orientation) { + assert(Array.isArray(new_position)); + this.position = new_position; + this.orientation = new_orientation; + if (this.has_object()) { + this.get_object().position = new_position; + } + } + deepcopy () { + let new_obj; + if (this.has_object()) { + new_obj = this.held_object.deepcopy(); + } + return new PlayerState({ + position: this.position, + orientation: this.orientation, + held_object: new_obj + }); + } +} + +export class ObjectState { + constructor ({ + name, + position, + state + }) { + //TODO: Use numbers instead of strings for name, and have a dictionary + //to convert to and from + this.name = name; + this.position = position; + if (name === 'soup') { + assert(state.length === OvercookedGridworld.num_items_for_soup) + } + this.state = state; + } + is_valid () { + if (this.name === 'onion') { + return typeof(this.state) === 'undefined' + } + if (this.name === 'tomato') { + return typeof(this.state) === 'undefined' + } + if (this.name === 'dish') { + return typeof(this.state) === 'undefined' + } + if (this.name === 'soup') { + let [soup_type, num_items, cook_time] = this.state; + let valid_soup_type = _.includes(ObjectState.SOUP_TYPES, soup_type); + let valid_item_num = (1 <= num_items) && (num_items <= 3); + let valid_cook_time = 0 <= cook_time; + return valid_soup_type && valid_item_num && valid_cook_time + } + return false + } + deepcopy () { + return new ObjectState({ + name: this.name, + position: this.position, + state: this.state + }) + } +} +ObjectState.SOUP_TYPES = ['onion', 'tomato']; + +export class OvercookedState { + constructor ({ + players, + objects, + order_list = [], + pot_explosion=false + }) { + // Represents a state in Overcooked. + // players: List of PlayerStates. + // objects: Dictionary mapping positions (x, y) to ObjectStates. Does NOT + // include objects held by players. + // Order is important for players but not for objects + for (let pos in objects) { + if (!objects.hasOwnProperty(pos)) {continue} + let obj = objects[pos]; + assert( + _.isEqual(String(obj.position), String(pos)), + `${String(obj.position)} !== ${String(pos)}` + ); + } + this.players = players.map((p) => {return p.deepcopy()}); + this.objects = objects; + // assert all([o in OvercookedGridworld.ORDER_TYPES for o in order_list]) + this.order_list = order_list; + this.pot_explosion = pot_explosion; + } + + static from_object(obj) { + obj['players'] = obj['players'].map((p) => { + if (typeof(p.held_object) !== 'undefined') { + p.held_object = new ObjectState(p.held_object); + } + return p + }); + obj['players'] = obj['players'].map((p) => {return new PlayerState(p)}); + obj['objects'] = _.mapValues(obj['objects'], (o) => {return new ObjectState(o)}); + return new OvercookedState(obj); + } + + player_positions () { + return this.players.map((p) => {return p.position}) + } + player_orientations () { + return this.players.map((p) => {return p.orientation}) + } + has_object (pos) { + return _.includes(_.keys(this.objects).map(String), String(pos)); + } + get_object (pos) { + assert(this.has_object(pos)); + return this.objects[pos] + } + add_object (obj, pos) { + if (typeof(pos) === 'undefined') { + pos = obj.position + } + assert(!this.has_object(pos)); + obj.position = pos; + this.objects[pos] = obj; + } + remove_object(pos) { + assert(this.has_object(pos)); + let obj = this.objects[pos]; + delete this.objects[pos]; + return obj + } + deepcopy() { + return new OvercookedState({ + players: this.players.map((p) => p.deepcopy()), + objects: _.fromPairs(_.map(this.objects, (obj, pos) => { + return [pos, obj.deepcopy()] + })), + order_list: this.order_list.map((i) => i), + pot_explosion: this.pot_explosion + }) + } + + //static methods + static from_players_pos_and_or(players_pos_and_or, order_list) { + return new OvercookedState({ + players: players_pos_and_or.map((params) => { + params = {position: params[0], orientation: params[1]}; + return new PlayerState(params) + }), + objects: {}, + order_list: order_list + }) + } + static from_player_positions(player_positions, order_list) { + let dummy_pos_and_or = player_positions.map((pos) => [pos, Direction.NORTH]); + return OvercookedState.from_players_pos_and_or(dummy_pos_and_or, order_list); + } +} + +export function dictToState(state_dict) { + let object_dict = {} + if (state_dict['objects'].length > 0) { + state_dict['objects'].forEach(function (item, index) { + object_dict[item['position']] = dictToObjectState(item) + }) + } + state_dict['objects'] = object_dict + + return new OvercookedState({ + players: [dictToPlayerState(state_dict['players'][0]), dictToPlayerState(state_dict['players'][1])], + objects: state_dict['objects'], + order_list: state_dict['order_list'] + }) +} + +export function dictToPlayerState(player_dict) { + if (player_dict['held_object'] == null) { + player_dict['held_object'] = undefined + } + else { + player_dict['held_object'] = dictToObjectState(player_dict['held_object']) + } + return new PlayerState({ + position: player_dict['position'], + orientation: player_dict['orientation'], + held_object: player_dict['held_object'] + }) + } + +export function dictToObjectState(object_dict) { + if (object_dict['state'] == null) { + object_dict['state'] = undefined; + } + return new ObjectState( + {name: object_dict['name'], + position: object_dict['position'], + state: object_dict['state'] + }) +} + + +export function lookupActions(actions_arr) { + let actions = []; + actions_arr.forEach(function (item, index) { + if (item == "interact") { + item = Action.INTERACT; + } + if (arraysEqual(Direction.STAY, item) || item == "stay") { + item = Direction.STAY; + } + actions.push(item); + } + ) + return actions; + +} + +function arraysEqual(a, b) { + // Stolen from https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript + if (a === b) return true; + if (a == null || b == null) return false; + if (a.length != b.length) return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) return false; + } + return true; + +} +/* + + Main MDP Class + + */ + +export class OvercookedGridworld { + constructor ({ + terrain, + player_positions, + explosion_time=Number.MAX_SAFE_INTEGER, + COOK_TIME = OvercookedGridworld.COOK_TIME, + DELIVERY_REWARD = OvercookedGridworld.DELIVERY_REWARD, + num_items_for_soup = OvercookedGridworld.num_items_for_soup, + always_serve = false //when this is set to a string, its what's always served + }) { + this.terrain_mtx = terrain; + this.terrain_pos_dict = this._get_terrain_type_pos_dict(); + this.start_player_positions = player_positions; + this.explosion_time = explosion_time; + this.COOK_TIME = COOK_TIME + this.DELIVERY_REWARD = DELIVERY_REWARD + this.always_serve = always_serve; + this.num_items_for_soup = num_items_for_soup; + } + + get_start_state (order_list) { + if (this.always_serve) { + order_list = [this.always_serve] + } + return OvercookedState.from_player_positions( + this.start_player_positions, + order_list + ); + } + + get_actions (state) { + /* Returns the list of lists of valid actions for 'state'. + The ith element of the list is the list of valid actions that player i + can take. + Note that you can request moves into terrain, which are equivalent to + STAY. The order in which actions are returned is guaranteed to be + deterministic, in order to allow agents to implement deterministic + behavior. */ + this._check_valid_state(state); + return state.players.map((p, i) => {return this._get_player_actions(state, i)}) + } + + _get_player_actions (state, player_num) { + return Action.ALL_ACTIONS + } + + is_terminal ({state}) { + return (state.order_list.length === 0) || (state.pot_explosion) + } + + get_transition_states_and_probs ({state, joint_action}) { + /*Gets information about possible transitions for the action. + Returns list of (next_state, prob) pairs representing the states + reachable from 'state' by taking 'action' along with their transition + probabilities.*/ + let action_sets = this.get_actions(state); + for (let pi = 0; pi < state.players.length; pi++) { + let [player, action, action_set] = + [state.players[pi], joint_action[pi], action_sets[pi]]; + assert(_.includes(action_set.map(String), String(action))) + } + let new_state = state.deepcopy(); + + assert(_.isEqual(new_state.objects, state.objects), + `${JSON.stringify(new_state.objects)} !== ${JSON.stringify(state.objects)}`); + + //resolve interacts first + let reward = this.resolve_interacts(new_state, joint_action); + + assert(_.isEqual(new_state.player_positions().map(String), state.player_positions().map(String))); + assert(_.isEqual(new_state.player_orientations().map(String), state.player_orientations().map(String))); + + + //resolve player movements + this.resolve_movement(new_state, joint_action); + + //finally, environment effects + this.step_environment_effects(new_state); + return [[new_state, 1.0], reward] + } + + resolve_interacts (new_state, joint_action) { + /*TODO: Currently if two players both interact with a terrain, we + resolve player 1's interact first and then player 2's, without doing + anything like collision checking. Is this okay?*/ + let reward = 0; + for (let pi = 0; pi < new_state.players.length; pi++) { + let [player, action] = [new_state.players[pi], joint_action[pi]]; + if (action !== Action.INTERACT) { + continue + } + + let [pos, o] = [player.position, player.orientation]; + let i_pos = Direction.move_in_direction(pos, o); + let terrain_type = this.get_terrain_type_at(i_pos); + + if (terrain_type === 'X') { + if (player.has_object() && !new_state.has_object(i_pos)) { + new_state.add_object(player.remove_object(), i_pos); + } + else if (!player.has_object() && new_state.has_object(i_pos)) { + player.set_object(new_state.remove_object(i_pos)); + } + } + else if (!player.has_object()) { + if (terrain_type === 'O') { + player.set_object(new ObjectState({name: 'onion', position: pos})); + } + else if (terrain_type === 'T') { + player.set_object(new ObjectState({name: 'tomato', position: pos})); + } + else if (terrain_type === 'D') { + player.set_object(new ObjectState({name: 'dish', position: pos})); + } + } + else if (player.has_object()) { + if (terrain_type === 'P') { + if ((player.get_object().name === 'dish') && (new_state.has_object(i_pos))) { + let obj = new_state.get_object(i_pos); + assert(obj.name === 'soup', "Object in pot was not soup"); + let [temp, num_items, cook_time] = obj.state; + if ((num_items === this.num_items_for_soup) && (cook_time >= this.COOK_TIME)) { + player.remove_object(); //turnt he dish into the soup + player.set_object(new_state.remove_object(i_pos)); + } + } + else if (_.includes(['onion', 'tomato'], player.get_object().name)) { + let item_type = player.get_object().name; + if (!new_state.has_object(i_pos)) { + player.remove_object(); + new_state.add_object( + new ObjectState({ + name: 'soup', + position: i_pos, + state: [item_type, 1, 0] + }), + i_pos); + } + else { + let obj = new_state.get_object(i_pos); + // assert(obj.name === 'soup', "Object in pot was not soup") + let [soup_type, num_items, cook_time] = obj.state; + if ((num_items < this.num_items_for_soup) && soup_type === item_type) { + player.remove_object(); + obj.state = [soup_type, num_items + 1, 0]; + } + } + } + } + else if (terrain_type === 'S') { + let obj = player.get_object(); + if (obj.name === 'soup') { + let [soup_type, num_items, cook_time] = obj.state; + assert(_.includes(ObjectState.SOUP_TYPES, soup_type)); + assert(num_items === this.num_items_for_soup && + cook_time >= this.COOK_TIME && + cook_time < this.explosion_time); + player.remove_object(); + + //If the delivered soup is the one currently required + let current_order = new_state.order_list[0]; + if ((current_order === 'any') || (soup_type === current_order)) { + new_state.order_list = new_state.order_list.slice(1); + reward += this.DELIVERY_REWARD; + } + if (this.always_serve) { + new_state.order_list = [this.always_serve, ] + } + } + } + } + } + return reward + } + + resolve_movement (state, joint_action){ + // Resolve player movement and deal with possible collisions + let [new_positions, new_orientations] = + this.compute_new_positions_and_orientations({ + old_player_states: state.players, + joint_action + }); + for (let pi = 0; pi < state.players.length; pi++) { + let [player_state, new_pos, new_o] = + [state.players[pi], new_positions[pi], new_orientations[pi]]; + player_state.update_pos_and_or(new_pos, new_o); + } + } + + compute_new_positions_and_orientations ({old_player_states, joint_action}) { + //Compute new positions and orientations ignoring collisions + let new_positions = []; + let old_positions = []; + let new_orientations = []; + for (let pi = 0; pi < old_player_states.length; pi++) { + let p = old_player_states[pi]; + let a = joint_action[pi]; + let [new_pos, new_o] = this._move_if_direction(p.position, p.orientation, a); + new_positions.push(new_pos); + old_positions.push(p.position); + new_orientations.push(new_o); + } + new_positions = this._handle_collisions(old_positions, new_positions); + return [new_positions, new_orientations] + } + + _handle_collisions(old_positions, new_positions) { + //only 2 players for nwo + if (this.is_collision(old_positions, new_positions)) { + return old_positions + } + return new_positions + } + + is_collision(old_positions, new_positions) { + let [p1_old, p2_old] = old_positions; + let [p1_new, p2_new] = new_positions; + if (_.isEqual(p1_new, p2_new)) { + return true + } + else if (_.isEqual(p1_new, p2_old) && _.isEqual(p1_old, p2_new)) { + return true + } + return false + } + + _move_if_direction(position, orientation, action) { + if (!_.includes(Action.MOTION_ACTIONS.map(String), String(action))) { + return [position, orientation] + } + let new_pos = Direction.move_in_direction(position, action); + let new_orientation; + + if (_.isEqual(Direction.STAY, action)) { + new_orientation = orientation; + } + else { + new_orientation = action; + } + + if (!_.includes(this.get_valid_player_positions().map(String), String(new_pos))) { + return [position, new_orientation] + } + + return [new_pos, new_orientation] + } + + get_valid_player_positions () { + return this.terrain_pos_dict[' ']; + } + + _get_terrain_type_pos_dict () { + let pos_dict = {}; + for (let y = 0; y < this.terrain_mtx.length; y++) { + for (let x = 0; x < this.terrain_mtx[y].length; x++) { + let ttype = this.terrain_mtx[y][x]; + if (!pos_dict.hasOwnProperty(ttype)) { + pos_dict[ttype] = []; + } + pos_dict[ttype].push([x, y]); + } + } + return pos_dict + } + + _check_valid_state (state) { + /*Checks that the state is valid. + Conditions checked: + - Players are on free spaces, not terrain + - Held objects have the same position as the player holding them + - Non-held objects are on terrain + - No two players or non-held objects occupy the same position + - Objects have a valid state (eg. no pot with 4 onions)*/ + let all_objects = _.values(state.objects); + for (let pi = 0; pi < state.players.length; pi++) { + let pstate = state.players[pi]; + //Check that players are not on terrain + let pos = pstate.position; + assert(_.includes(this.get_valid_player_positions().map(String), String(pos)), + JSON.stringify(this.get_valid_player_positions())+" "+pos); + + //check that held obj have the same position + if (pstate.has_object()) { + all_objects.push(pstate.held_object); + assert(_.isEqual(pstate.held_object.position, pstate.position)); + } + } + + for (let obj_pos in state.objects) { + if (!state.objects.hasOwnProperty(obj_pos)) {continue} + obj_pos = str_to_array(obj_pos); + let obj_state = state.objects[obj_pos]; + //check that the hash key position agrees with the position stored in the object state + assert( + _.isEqual(obj_state.position, obj_pos), + `${obj_state.position}, ${obj_pos}` + ); + //check that the non-held obj are on terrain + assert(!_.isEqual(this.get_terrain_type_at(obj_pos), ' ')); + } + + //check that players and non-held objects don't overlap + let all_pos = state.players.map((p) => p.position); + let all_objpos = _.values(state.objects).map((o) => o.position); + all_pos = _.concat(all_pos, all_objpos); + assert(all_pos.length === _.uniq(all_pos).length, "Overlapping players or objects"); + + //check that objects have a valid state + all_objects.map((o) => assert(o.is_valid(), "Invalid Obj: "+JSON.stringify(o))) + } + + get_terrain_type_at (pos) { + let [x, y] = pos; + return this.terrain_mtx[y][x]; + } + + step_environment_effects(state) { + for (let pos in state.objects) { + if (!state.objects.hasOwnProperty(pos)) { + continue + } + let obj = state.objects[pos]; + if (obj.name === 'soup') { + let [x, y] = obj.position; + let [soup_type, num_items, cook_time] = obj.state; + if ( + (this.terrain_mtx[y][x] === 'P') && + (cook_time < this.explosion_time) && + (num_items === this.num_items_for_soup)) { + obj.state = [soup_type, num_items, Math.min(cook_time + 1, this.COOK_TIME)]; + } + if ((obj.state[2] === this.explosion_time) && (num_items === this.num_items_for_soup)) { + state.pot_explosion = true + } + } + } + } + + static from_grid (grid, params) { + grid = grid.map((r) => _.map(r, (c) => c)); + let player_pos = [null, null]; + for (let y = 0; y < grid.length; y++) { + for (let x = 0; x < grid[0].length; x++) { + let c = grid[y][x]; + if (_.includes(['1', '2'], c)) { + grid[y][x] = ' '; + assert(player_pos[parseInt(c)-1] === null, "Duplicate player in grid"); + player_pos[parseInt(c)-1] = [x, y]; + } + } + } + assert(_.every(player_pos), 'A player was missing'); + params = typeof(params) === 'undefined' ? {} : params; + params = Object.assign({}, params, { + terrain: grid, + player_positions: player_pos + }); + return new OvercookedGridworld(params) + } +} +OvercookedGridworld.COOK_TIME = 5; +OvercookedGridworld.DELIVERY_REWARD = 20; +OvercookedGridworld.ORDER_TYPES = ObjectState.SOUP_TYPES + ['any']; +OvercookedGridworld.num_items_for_soup = 3; + +let str_to_array = (val) => { + if (Array.isArray(val)) { + return val + } + return val.split(',').map((i) => parseInt(i)) +}; + +// let assert = function (bool, msg) { +// if (typeof(msg) === 'undefined') { +// msg = "Assert Failed"; +// } +// if (bool) { +// return +// } +// else { +// console.log(msg); +// console.trace(); +// } +// }; \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/js/task.es6 b/lib/overcooked_ai/overcooked_ai_js/js/task.es6 new file mode 100644 index 0000000..ee918b9 --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/js/task.es6 @@ -0,0 +1,372 @@ +import Phaser from 'phaser' +import * as OvercookedMDP from "./mdp.es6" + +let Direction = OvercookedMDP.Direction; + +export class OvercookedGame { + constructor ({ + start_grid, + + container_id, + + tileSize = 128, + gameWidth = tileSize*start_grid[0].length, + gameHeight = tileSize*start_grid.length, + + ANIMATION_DURATION = 500, + TIMESTEP_DURATION = 600, + player_colors = {0: 'green', 1: 'blue'}, + assets_loc = "./assets/", + show_post_cook_time = false, + + COOK_TIME = 2, + explosion_time = Number.MAX_SAFE_INTEGER, + DELIVERY_REWARD = OvercookedMDP.OvercookedGridworld.DELIVERY_REWARD, + always_serve = false + }){ + this.gameWidth = gameWidth; + this.gameHeight = gameHeight; + this.container_id = container_id; + let params = {COOK_TIME, explosion_time, DELIVERY_REWARD, always_serve}; + this.mdp = OvercookedMDP.OvercookedGridworld.from_grid(start_grid, params); + this.state = this.mdp.get_start_state(); + this.joint_action = [OvercookedMDP.Direction.STAY, OvercookedMDP.Direction.STAY]; + this.player_colors = player_colors; + this.assets_loc = assets_loc; + this.show_post_cook_time = show_post_cook_time; + + let gameparent = this; + this.scene = new Phaser.Class({ + gameparent, + Extends: Phaser.Scene, + initialize: function() { + Phaser.Scene.call(this, {key: "PlayGame"}) + }, + preload: function () { + this.load.atlas("tiles", + this.gameparent.assets_loc+"terrain.png", + this.gameparent.assets_loc+"terrain.json"); + this.load.atlas("chefs", + this.gameparent.assets_loc+"chefs.png", + this.gameparent.assets_loc+"chefs.json"); + this.load.atlas("objects", + this.gameparent.assets_loc+"objects.png", + this.gameparent.assets_loc+"objects.json"); + }, + create: function () { + // this.gameparent = gameparent; + this.mdp = gameparent.mdp; + this.sprites = {}; + this.drawLevel(); + this._drawState(gameparent.state, this.sprites); + // this.cursors = this.input.keyboard.createCursorKeys(); //this messes with the keys a lot + // this.player.can_take_input = true; + // this.animating_transition = false; + }, + drawLevel: function() { + //draw tiles + let terrain_to_img = { + ' ': 'floor.png', + 'X': 'counter.png', + 'P': 'pot.png', + 'O': 'onions.png', + 'T': 'tomatoes.png', + 'D': 'dishes.png', + 'S': 'serve.png' + }; + let pos_dict = this.mdp._get_terrain_type_pos_dict(); + for (let ttype in pos_dict) { + if (!pos_dict.hasOwnProperty(ttype)) {continue} + for (let i = 0; i < pos_dict[ttype].length; i++) { + let [x, y] = pos_dict[ttype][i]; + let tile = this.add.sprite( + tileSize * x, + tileSize * y, + "tiles", + terrain_to_img[ttype] + ); + tile.setDisplaySize(tileSize, tileSize); + tile.setOrigin(0); + } + } + + }, + _drawState: function (state, sprites) { + sprites = typeof(sprites) === 'undefined' ? {} : sprites; + + //draw chefs + sprites['chefs'] = + typeof(sprites['chefs']) === 'undefined' ? {} : sprites['chefs']; + for (let pi = 0; pi < state.players.length; pi++) { + let chef = state.players[pi]; + let [x, y] = chef.position; + let dir = Direction.DIRECTION_TO_NAME[chef.orientation]; + let held_obj = chef.held_object; + if (typeof(held_obj) !== 'undefined') { + if (held_obj.name === 'soup') { + held_obj = "-soup-"+held_obj.state[0]; + } + else { + held_obj = "-"+held_obj.name; + } + } + else { + held_obj = ""; + } + if (typeof(sprites['chefs'][pi]) === 'undefined') { + let chefsprite = this.add.sprite( + tileSize*x, + tileSize*y, + "chefs", + `${dir}${held_obj}.png` + ); + chefsprite.setDisplaySize(tileSize, tileSize); + chefsprite.depth = 1; + chefsprite.setOrigin(0); + let hatsprite = this.add.sprite( + tileSize*x, + tileSize*y, + "chefs", + `${dir}-${this.gameparent.player_colors[pi]}hat.png` + ); + hatsprite.setDisplaySize(tileSize, tileSize); + hatsprite.depth = 2; + hatsprite.setOrigin(0); + sprites['chefs'][pi] = {chefsprite, hatsprite}; + } + else { + let chefsprite = sprites['chefs'][pi]['chefsprite']; + let hatsprite = sprites['chefs'][pi]['hatsprite']; + chefsprite.setFrame(`${dir}${held_obj}.png`); + hatsprite.setFrame(`${dir}-${this.gameparent.player_colors[pi]}hat.png`); + this.tweens.add({ + targets: [chefsprite, hatsprite], + x: tileSize*x, + y: tileSize*y, + duration: ANIMATION_DURATION, + ease: 'Linear', + onComplete: (tween, target, player) => { + target[0].setPosition(tileSize*x, tileSize*y); + //this.animating = false; + } + }) + } + } + + //draw environment objects + if (typeof(sprites['objects']) !== 'undefined') { + for (let objpos in sprites.objects) { + let {objsprite, timesprite} = sprites.objects[objpos]; + objsprite.destroy(); + if (typeof(timesprite) !== 'undefined') { + timesprite.destroy(); + } + } + } + sprites['objects'] = {}; + + for (let objpos in state.objects) { + if (!state.objects.hasOwnProperty(objpos)) { continue } + let obj = state.objects[objpos]; + let [x, y] = obj.position; + let terrain_type = this.mdp.get_terrain_type_at(obj.position); + let spriteframe, souptype, n_ingredients; + let cooktime = ""; + if ((obj.name === 'soup') && (terrain_type === 'P')) { + [souptype, n_ingredients, cooktime] = obj.state; + + // select pot sprite + if (cooktime <= this.mdp.COOK_TIME) { + spriteframe = + `soup-${souptype}-${n_ingredients}-cooking.png`; + } + else if (cooktime >= this.mdp.explosion_time) { + spriteframe = 'pot-explosion.png'; + } + else { + spriteframe = `soup-${souptype}-cooked.png`; + } + let objsprite = this.add.sprite( + tileSize*x, + tileSize*y, + "objects", + spriteframe + ); + objsprite.setDisplaySize(tileSize, tileSize); + objsprite.depth = 1; + objsprite.setOrigin(0); + let objs_here = {objsprite}; + + // show time accordingly + let show_time = true; + if ((cooktime > this.mdp.COOK_TIME) && !this.show_post_cook_time) { + show_time = false; + } + if (show_time) { + let timesprite = this.add.text( + tileSize*(x+.5), + tileSize*(y+.6), + String(cooktime), + { + font: "25px Arial", + fill: "red", + align: "center", + } + ); + timesprite.depth = 2; + objs_here['timesprite'] = timesprite; + } + + sprites['objects'][objpos] = objs_here + } + else if (obj.name === 'soup') { + [souptype, n_ingredients, cooktime] = obj.state; + spriteframe = `soup-${souptype}-dish.png`; + let objsprite = this.add.sprite( + tileSize*x, + tileSize*y, + "objects", + spriteframe + ); + objsprite.setDisplaySize(tileSize, tileSize); + objsprite.depth = 1; + objsprite.setOrigin(0); + sprites['objects'][objpos] = {objsprite}; + } + else { + if (obj.name === 'onion') { + spriteframe = "onion.png"; + } + else if (obj.name === 'tomato') { + spriteframe = "tomato.png"; + } + else if (obj.name === 'dish') { + spriteframe = "dish.png"; + } + let objsprite = this.add.sprite( + tileSize*x, + tileSize*y, + "objects", + spriteframe + ); + objsprite.setDisplaySize(tileSize, tileSize); + objsprite.depth = 1; + objsprite.setOrigin(0); + sprites['objects'][objpos] = {objsprite}; + } + } + + //draw order list + let order_list = "Orders: "+state.order_list.join(", "); + if (typeof(sprites['order_list']) !== 'undefined') { + sprites['order_list'].setText(order_list); + } + else { + sprites['order_list'] = this.add.text( + 5, 5, order_list, + { + font: "20px Arial", + fill: "yellow", + align: "left" + } + ) + } + }, + _drawScore: function(score, sprites) { + score = "Score: "+score; + if (typeof(sprites['score']) !== 'undefined') { + sprites['score'].setText(score); + } + else { + sprites['score'] = this.add.text( + 5, 25, score, + { + font: "20px Arial", + fill: "yellow", + align: "left" + } + ) + } + }, + _drawTimeLeft: function(time_left, sprites) { + time_left = "Time Left: "+time_left; + if (typeof(sprites['time_left']) !== 'undefined') { + sprites['time_left'].setText(time_left); + } + else { + sprites['time_left'] = this.add.text( + 5, 45, time_left, + { + font: "20px Arial", + fill: "yellow", + align: "left" + } + ) + } + }, + update: function() { + // let state, score_; + // let redraw = false; + if (typeof(this.gameparent.state_to_draw) !== 'undefined') { + let state = this.gameparent.state_to_draw; + delete this.gameparent.state_to_draw; + // redraw = true; + this._drawState(state, this.sprites); + } + if (typeof(this.gameparent.score_to_draw) !== 'undefined') { + let score = this.gameparent.score_to_draw; + delete this.gameparent.score_to_draw; + this._drawScore(score, this.sprites); + } + if (typeof(this.gameparent.time_left) !== 'undefined') { + let time_left = this.gameparent.time_left; + delete this.gameparent.time_left; + this._drawTimeLeft(time_left, this.sprites); + } + // if (!redraw) { + // return + // } + + } + }); + } + + init () { + let gameConfig = { + type: Phaser.WEBGL, + width: this.gameWidth, + height: this.gameHeight, + scene: [this.scene], + parent: this.container_id, + pixelArt: true, + audio: { + noAudio: true + } + }; + this.game = new Phaser.Game(gameConfig); + } + + drawState(state) { + this.state_to_draw = state; + } + + setAction(player_index, action) { + + } + + drawScore(score) { + this.score_to_draw = String(score); + } + + drawTimeLeft(time_left) { + this.time_left = String(time_left); + } + + close (msg) { + this.game.renderer.destroy(); + this.game.loop.stop(); + // this.game.canvas.remove(); + this.game.destroy(); + } + +} \ No newline at end of file diff --git a/lib/overcooked_ai/overcooked_ai_js/overcooked-window.js b/lib/overcooked_ai/overcooked_ai_js/overcooked-window.js new file mode 100644 index 0000000..654e52f --- /dev/null +++ b/lib/overcooked_ai/overcooked_ai_js/overcooked-window.js @@ -0,0 +1,190256 @@ +(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i { + return [d, i]; +})); +Direction.ALL_DIRECTIONS = Direction.INDEX_TO_DIRECTION; +Direction.OPPOSITE_DIRECTIONS = _lodash2.default.fromPairs([[Direction.NORTH, Direction.SOUTH], [Direction.SOUTH, Direction.NORTH], [Direction.EAST, Direction.WEST], [Direction.WEST, Direction.EAST]]); +Direction.DIRECTION_TO_NAME = { + '0,-1': 'NORTH', + '0,1': 'SOUTH', + '1,0': 'EAST', + '-1,0': 'WEST' +}; + +class Action {} +exports.Action = Action; +Action.INTERACT = "INTERACT"; +Action.INDEX_TO_ACTION = _lodash2.default.clone(Direction.INDEX_TO_DIRECTION); +Action.INDEX_TO_ACTION.push(Action.INTERACT); +Action.ACTION_TO_INDEX = _lodash2.default.fromPairs(Action.INDEX_TO_ACTION.map((a, i) => [a, i])); +Action.ALL_ACTIONS = Action.INDEX_TO_ACTION; +Action.MOTION_ACTIONS = Direction.INDEX_TO_DIRECTION; + +class PlayerState { + constructor({ + position, + orientation, + held_object = undefined + }) { + (0, _assert2.default)(Array.isArray(position)); + // assert(orientation in Direction.ALL_DIRECTIONS) + if (typeof held_object !== "undefined") { + // assert(ObjectState.is_object(held_object)); + (0, _assert2.default)(_lodash2.default.isEqual(held_object.position, position)); + } + this.position = position; + this.orientation = orientation; + this.held_object = held_object; + } + + // pos_and_or () {} + has_object() { + return typeof this.held_object !== 'undefined'; + } + get_object() { + (0, _assert2.default)(this.has_object()); + return this.held_object; + } + set_object(obj) { + (0, _assert2.default)(!this.has_object()); + obj.position = this.position; + this.held_object = obj; + } + remove_object() { + (0, _assert2.default)(this.has_object()); + let obj = this.held_object; + this.held_object = undefined; + return obj; + } + update_pos_and_or(new_position, new_orientation) { + (0, _assert2.default)(Array.isArray(new_position)); + this.position = new_position; + this.orientation = new_orientation; + if (this.has_object()) { + this.get_object().position = new_position; + } + } + deepcopy() { + let new_obj; + if (this.has_object()) { + new_obj = this.held_object.deepcopy(); + } + return new PlayerState({ + position: this.position, + orientation: this.orientation, + held_object: new_obj + }); + } +} + +exports.PlayerState = PlayerState; +class ObjectState { + constructor({ + name, + position, + state + }) { + //TODO: Use numbers instead of strings for name, and have a dictionary + //to convert to and from + this.name = name; + this.position = position; + if (name === 'soup') { + (0, _assert2.default)(state.length === OvercookedGridworld.num_items_for_soup); + } + this.state = state; + } + is_valid() { + if (this.name === 'onion') { + return typeof this.state === 'undefined'; + } + if (this.name === 'tomato') { + return typeof this.state === 'undefined'; + } + if (this.name === 'dish') { + return typeof this.state === 'undefined'; + } + if (this.name === 'soup') { + let [soup_type, num_items, cook_time] = this.state; + let valid_soup_type = _lodash2.default.includes(ObjectState.SOUP_TYPES, soup_type); + let valid_item_num = 1 <= num_items && num_items <= 3; + let valid_cook_time = 0 <= cook_time; + return valid_soup_type && valid_item_num && valid_cook_time; + } + return false; + } + deepcopy() { + return new ObjectState({ + name: this.name, + position: this.position, + state: this.state + }); + } +} +exports.ObjectState = ObjectState; +ObjectState.SOUP_TYPES = ['onion', 'tomato']; + +class OvercookedState { + constructor({ + players, + objects, + order_list = [], + pot_explosion = false + }) { + // Represents a state in Overcooked. + // players: List of PlayerStates. + // objects: Dictionary mapping positions (x, y) to ObjectStates. Does NOT + // include objects held by players. + // Order is important for players but not for objects + for (let pos in objects) { + if (!objects.hasOwnProperty(pos)) { + continue; + } + let obj = objects[pos]; + (0, _assert2.default)(_lodash2.default.isEqual(String(obj.position), String(pos)), `${String(obj.position)} !== ${String(pos)}`); + } + this.players = players.map(p => { + return p.deepcopy(); + }); + this.objects = objects; + // assert all([o in OvercookedGridworld.ORDER_TYPES for o in order_list]) + this.order_list = order_list; + this.pot_explosion = pot_explosion; + } + + static from_object(obj) { + obj['players'] = obj['players'].map(p => { + if (typeof p.held_object !== 'undefined') { + p.held_object = new ObjectState(p.held_object); + } + return p; + }); + obj['players'] = obj['players'].map(p => { + return new PlayerState(p); + }); + obj['objects'] = _lodash2.default.mapValues(obj['objects'], o => { + return new ObjectState(o); + }); + return new OvercookedState(obj); + } + + player_positions() { + return this.players.map(p => { + return p.position; + }); + } + player_orientations() { + return this.players.map(p => { + return p.orientation; + }); + } + has_object(pos) { + return _lodash2.default.includes(_lodash2.default.keys(this.objects).map(String), String(pos)); + } + get_object(pos) { + (0, _assert2.default)(this.has_object(pos)); + return this.objects[pos]; + } + add_object(obj, pos) { + if (typeof pos === 'undefined') { + pos = obj.position; + } + (0, _assert2.default)(!this.has_object(pos)); + obj.position = pos; + this.objects[pos] = obj; + } + remove_object(pos) { + (0, _assert2.default)(this.has_object(pos)); + let obj = this.objects[pos]; + delete this.objects[pos]; + return obj; + } + deepcopy() { + return new OvercookedState({ + players: this.players.map(p => p.deepcopy()), + objects: _lodash2.default.fromPairs(_lodash2.default.map(this.objects, (obj, pos) => { + return [pos, obj.deepcopy()]; + })), + order_list: this.order_list.map(i => i), + pot_explosion: this.pot_explosion + }); + } + + //static methods + static from_players_pos_and_or(players_pos_and_or, order_list) { + return new OvercookedState({ + players: players_pos_and_or.map(params => { + params = { position: params[0], orientation: params[1] }; + return new PlayerState(params); + }), + objects: {}, + order_list: order_list + }); + } + static from_player_positions(player_positions, order_list) { + let dummy_pos_and_or = player_positions.map(pos => [pos, Direction.NORTH]); + return OvercookedState.from_players_pos_and_or(dummy_pos_and_or, order_list); + } +} + +exports.OvercookedState = OvercookedState; +function dictToState(state_dict) { + let object_dict = {}; + if (state_dict['objects'].length > 0) { + state_dict['objects'].forEach(function (item, index) { + object_dict[item['position']] = dictToObjectState(item); + }); + } + state_dict['objects'] = object_dict; + + return new OvercookedState({ + players: [dictToPlayerState(state_dict['players'][0]), dictToPlayerState(state_dict['players'][1])], + objects: state_dict['objects'], + order_list: state_dict['order_list'] + }); +} + +function dictToPlayerState(player_dict) { + if (player_dict['held_object'] == null) { + player_dict['held_object'] = undefined; + } else { + player_dict['held_object'] = dictToObjectState(player_dict['held_object']); + } + return new PlayerState({ + position: player_dict['position'], + orientation: player_dict['orientation'], + held_object: player_dict['held_object'] + }); +} + +function dictToObjectState(object_dict) { + if (object_dict['state'] == null) { + object_dict['state'] = undefined; + } + return new ObjectState({ name: object_dict['name'], + position: object_dict['position'], + state: object_dict['state'] + }); +} + +function lookupActions(actions_arr) { + let actions = []; + actions_arr.forEach(function (item, index) { + if (item == "interact") { + item = Action.INTERACT; + } + if (arraysEqual(Direction.STAY, item) || item == "stay") { + item = Direction.STAY; + } + actions.push(item); + }); + return actions; +} + +function arraysEqual(a, b) { + // Stolen from https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript + if (a === b) return true; + if (a == null || b == null) return false; + if (a.length != b.length) return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) return false; + } + return true; +} +/* + + Main MDP Class + + */ + +class OvercookedGridworld { + constructor({ + terrain, + player_positions, + explosion_time = Number.MAX_SAFE_INTEGER, + COOK_TIME = OvercookedGridworld.COOK_TIME, + DELIVERY_REWARD = OvercookedGridworld.DELIVERY_REWARD, + num_items_for_soup = OvercookedGridworld.num_items_for_soup, + always_serve = false //when this is set to a string, its what's always served + }) { + this.terrain_mtx = terrain; + this.terrain_pos_dict = this._get_terrain_type_pos_dict(); + this.start_player_positions = player_positions; + this.explosion_time = explosion_time; + this.COOK_TIME = COOK_TIME; + this.DELIVERY_REWARD = DELIVERY_REWARD; + this.always_serve = always_serve; + this.num_items_for_soup = num_items_for_soup; + } + + get_start_state(order_list) { + if (this.always_serve) { + order_list = [this.always_serve]; + } + return OvercookedState.from_player_positions(this.start_player_positions, order_list); + } + + get_actions(state) { + /* Returns the list of lists of valid actions for 'state'. + The ith element of the list is the list of valid actions that player i + can take. + Note that you can request moves into terrain, which are equivalent to + STAY. The order in which actions are returned is guaranteed to be + deterministic, in order to allow agents to implement deterministic + behavior. */ + this._check_valid_state(state); + return state.players.map((p, i) => { + return this._get_player_actions(state, i); + }); + } + + _get_player_actions(state, player_num) { + return Action.ALL_ACTIONS; + } + + is_terminal({ state }) { + return state.order_list.length === 0 || state.pot_explosion; + } + + get_transition_states_and_probs({ state, joint_action }) { + /*Gets information about possible transitions for the action. + Returns list of (next_state, prob) pairs representing the states + reachable from 'state' by taking 'action' along with their transition + probabilities.*/ + let action_sets = this.get_actions(state); + for (let pi = 0; pi < state.players.length; pi++) { + let [player, action, action_set] = [state.players[pi], joint_action[pi], action_sets[pi]]; + (0, _assert2.default)(_lodash2.default.includes(action_set.map(String), String(action))); + } + let new_state = state.deepcopy(); + + (0, _assert2.default)(_lodash2.default.isEqual(new_state.objects, state.objects), `${JSON.stringify(new_state.objects)} !== ${JSON.stringify(state.objects)}`); + + //resolve interacts first + let reward = this.resolve_interacts(new_state, joint_action); + + (0, _assert2.default)(_lodash2.default.isEqual(new_state.player_positions().map(String), state.player_positions().map(String))); + (0, _assert2.default)(_lodash2.default.isEqual(new_state.player_orientations().map(String), state.player_orientations().map(String))); + + //resolve player movements + this.resolve_movement(new_state, joint_action); + + //finally, environment effects + this.step_environment_effects(new_state); + return [[new_state, 1.0], reward]; + } + + resolve_interacts(new_state, joint_action) { + /*TODO: Currently if two players both interact with a terrain, we + resolve player 1's interact first and then player 2's, without doing + anything like collision checking. Is this okay?*/ + let reward = 0; + for (let pi = 0; pi < new_state.players.length; pi++) { + let [player, action] = [new_state.players[pi], joint_action[pi]]; + if (action !== Action.INTERACT) { + continue; + } + + let [pos, o] = [player.position, player.orientation]; + let i_pos = Direction.move_in_direction(pos, o); + let terrain_type = this.get_terrain_type_at(i_pos); + + if (terrain_type === 'X') { + if (player.has_object() && !new_state.has_object(i_pos)) { + new_state.add_object(player.remove_object(), i_pos); + } else if (!player.has_object() && new_state.has_object(i_pos)) { + player.set_object(new_state.remove_object(i_pos)); + } + } else if (!player.has_object()) { + if (terrain_type === 'O') { + player.set_object(new ObjectState({ name: 'onion', position: pos })); + } else if (terrain_type === 'T') { + player.set_object(new ObjectState({ name: 'tomato', position: pos })); + } else if (terrain_type === 'D') { + player.set_object(new ObjectState({ name: 'dish', position: pos })); + } + } else if (player.has_object()) { + if (terrain_type === 'P') { + if (player.get_object().name === 'dish' && new_state.has_object(i_pos)) { + let obj = new_state.get_object(i_pos); + (0, _assert2.default)(obj.name === 'soup', "Object in pot was not soup"); + let [temp, num_items, cook_time] = obj.state; + if (num_items === this.num_items_for_soup && cook_time >= this.COOK_TIME) { + player.remove_object(); //turnt he dish into the soup + player.set_object(new_state.remove_object(i_pos)); + } + } else if (_lodash2.default.includes(['onion', 'tomato'], player.get_object().name)) { + let item_type = player.get_object().name; + if (!new_state.has_object(i_pos)) { + player.remove_object(); + new_state.add_object(new ObjectState({ + name: 'soup', + position: i_pos, + state: [item_type, 1, 0] + }), i_pos); + } else { + let obj = new_state.get_object(i_pos); + // assert(obj.name === 'soup', "Object in pot was not soup") + let [soup_type, num_items, cook_time] = obj.state; + if (num_items < this.num_items_for_soup && soup_type === item_type) { + player.remove_object(); + obj.state = [soup_type, num_items + 1, 0]; + } + } + } + } else if (terrain_type === 'S') { + let obj = player.get_object(); + if (obj.name === 'soup') { + let [soup_type, num_items, cook_time] = obj.state; + (0, _assert2.default)(_lodash2.default.includes(ObjectState.SOUP_TYPES, soup_type)); + (0, _assert2.default)(num_items === this.num_items_for_soup && cook_time >= this.COOK_TIME && cook_time < this.explosion_time); + player.remove_object(); + + //If the delivered soup is the one currently required + let current_order = new_state.order_list[0]; + if (current_order === 'any' || soup_type === current_order) { + new_state.order_list = new_state.order_list.slice(1); + reward += this.DELIVERY_REWARD; + } + if (this.always_serve) { + new_state.order_list = [this.always_serve]; + } + } + } + } + } + return reward; + } + + resolve_movement(state, joint_action) { + // Resolve player movement and deal with possible collisions + let [new_positions, new_orientations] = this.compute_new_positions_and_orientations({ + old_player_states: state.players, + joint_action + }); + for (let pi = 0; pi < state.players.length; pi++) { + let [player_state, new_pos, new_o] = [state.players[pi], new_positions[pi], new_orientations[pi]]; + player_state.update_pos_and_or(new_pos, new_o); + } + } + + compute_new_positions_and_orientations({ old_player_states, joint_action }) { + //Compute new positions and orientations ignoring collisions + let new_positions = []; + let old_positions = []; + let new_orientations = []; + for (let pi = 0; pi < old_player_states.length; pi++) { + let p = old_player_states[pi]; + let a = joint_action[pi]; + let [new_pos, new_o] = this._move_if_direction(p.position, p.orientation, a); + new_positions.push(new_pos); + old_positions.push(p.position); + new_orientations.push(new_o); + } + new_positions = this._handle_collisions(old_positions, new_positions); + return [new_positions, new_orientations]; + } + + _handle_collisions(old_positions, new_positions) { + //only 2 players for nwo + if (this.is_collision(old_positions, new_positions)) { + return old_positions; + } + return new_positions; + } + + is_collision(old_positions, new_positions) { + let [p1_old, p2_old] = old_positions; + let [p1_new, p2_new] = new_positions; + if (_lodash2.default.isEqual(p1_new, p2_new)) { + return true; + } else if (_lodash2.default.isEqual(p1_new, p2_old) && _lodash2.default.isEqual(p1_old, p2_new)) { + return true; + } + return false; + } + + _move_if_direction(position, orientation, action) { + if (!_lodash2.default.includes(Action.MOTION_ACTIONS.map(String), String(action))) { + return [position, orientation]; + } + let new_pos = Direction.move_in_direction(position, action); + let new_orientation; + + if (_lodash2.default.isEqual(Direction.STAY, action)) { + new_orientation = orientation; + } else { + new_orientation = action; + } + + if (!_lodash2.default.includes(this.get_valid_player_positions().map(String), String(new_pos))) { + return [position, new_orientation]; + } + + return [new_pos, new_orientation]; + } + + get_valid_player_positions() { + return this.terrain_pos_dict[' ']; + } + + _get_terrain_type_pos_dict() { + let pos_dict = {}; + for (let y = 0; y < this.terrain_mtx.length; y++) { + for (let x = 0; x < this.terrain_mtx[y].length; x++) { + let ttype = this.terrain_mtx[y][x]; + if (!pos_dict.hasOwnProperty(ttype)) { + pos_dict[ttype] = []; + } + pos_dict[ttype].push([x, y]); + } + } + return pos_dict; + } + + _check_valid_state(state) { + /*Checks that the state is valid. + Conditions checked: + - Players are on free spaces, not terrain + - Held objects have the same position as the player holding them + - Non-held objects are on terrain + - No two players or non-held objects occupy the same position + - Objects have a valid state (eg. no pot with 4 onions)*/ + let all_objects = _lodash2.default.values(state.objects); + for (let pi = 0; pi < state.players.length; pi++) { + let pstate = state.players[pi]; + //Check that players are not on terrain + let pos = pstate.position; + (0, _assert2.default)(_lodash2.default.includes(this.get_valid_player_positions().map(String), String(pos)), JSON.stringify(this.get_valid_player_positions()) + " " + pos); + + //check that held obj have the same position + if (pstate.has_object()) { + all_objects.push(pstate.held_object); + (0, _assert2.default)(_lodash2.default.isEqual(pstate.held_object.position, pstate.position)); + } + } + + for (let obj_pos in state.objects) { + if (!state.objects.hasOwnProperty(obj_pos)) { + continue; + } + obj_pos = str_to_array(obj_pos); + let obj_state = state.objects[obj_pos]; + //check that the hash key position agrees with the position stored in the object state + (0, _assert2.default)(_lodash2.default.isEqual(obj_state.position, obj_pos), `${obj_state.position}, ${obj_pos}`); + //check that the non-held obj are on terrain + (0, _assert2.default)(!_lodash2.default.isEqual(this.get_terrain_type_at(obj_pos), ' ')); + } + + //check that players and non-held objects don't overlap + let all_pos = state.players.map(p => p.position); + let all_objpos = _lodash2.default.values(state.objects).map(o => o.position); + all_pos = _lodash2.default.concat(all_pos, all_objpos); + (0, _assert2.default)(all_pos.length === _lodash2.default.uniq(all_pos).length, "Overlapping players or objects"); + + //check that objects have a valid state + all_objects.map(o => (0, _assert2.default)(o.is_valid(), "Invalid Obj: " + JSON.stringify(o))); + } + + get_terrain_type_at(pos) { + let [x, y] = pos; + return this.terrain_mtx[y][x]; + } + + step_environment_effects(state) { + for (let pos in state.objects) { + if (!state.objects.hasOwnProperty(pos)) { + continue; + } + let obj = state.objects[pos]; + if (obj.name === 'soup') { + let [x, y] = obj.position; + let [soup_type, num_items, cook_time] = obj.state; + if (this.terrain_mtx[y][x] === 'P' && cook_time < this.explosion_time && num_items === this.num_items_for_soup) { + obj.state = [soup_type, num_items, Math.min(cook_time + 1, this.COOK_TIME)]; + } + if (obj.state[2] === this.explosion_time && num_items === this.num_items_for_soup) { + state.pot_explosion = true; + } + } + } + } + + static from_grid(grid, params) { + grid = grid.map(r => _lodash2.default.map(r, c => c)); + let player_pos = [null, null]; + for (let y = 0; y < grid.length; y++) { + for (let x = 0; x < grid[0].length; x++) { + let c = grid[y][x]; + if (_lodash2.default.includes(['1', '2'], c)) { + grid[y][x] = ' '; + (0, _assert2.default)(player_pos[parseInt(c) - 1] === null, "Duplicate player in grid"); + player_pos[parseInt(c) - 1] = [x, y]; + } + } + } + (0, _assert2.default)(_lodash2.default.every(player_pos), 'A player was missing'); + params = typeof params === 'undefined' ? {} : params; + params = Object.assign({}, params, { + terrain: grid, + player_positions: player_pos + }); + return new OvercookedGridworld(params); + } +} +exports.OvercookedGridworld = OvercookedGridworld; +OvercookedGridworld.COOK_TIME = 5; +OvercookedGridworld.DELIVERY_REWARD = 20; +OvercookedGridworld.ORDER_TYPES = ObjectState.SOUP_TYPES + ['any']; +OvercookedGridworld.num_items_for_soup = 3; + +let str_to_array = val => { + if (Array.isArray(val)) { + return val; + } + return val.split(',').map(i => parseInt(i)); +}; + +// let assert = function (bool, msg) { +// if (typeof(msg) === 'undefined') { +// msg = "Assert Failed"; +// } +// if (bool) { +// return +// } +// else { +// console.log(msg); +// console.trace(); +// } +// }; + +},{"assert":1150,"lodash":5}],3:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.OvercookedGame = undefined; + +var _phaser = require('phaser'); + +var _phaser2 = _interopRequireDefault(_phaser); + +var _mdp = require('./mdp.es6'); + +var OvercookedMDP = _interopRequireWildcard(_mdp); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {};if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + }newObj.default = obj;return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +let Direction = OvercookedMDP.Direction; + +class OvercookedGame { + constructor({ + start_grid, + + container_id, + + tileSize = 128, + gameWidth = tileSize * start_grid[0].length, + gameHeight = tileSize * start_grid.length, + + ANIMATION_DURATION = 500, + TIMESTEP_DURATION = 600, + player_colors = { 0: 'green', 1: 'blue' }, + assets_loc = "./assets/", + show_post_cook_time = false, + + COOK_TIME = 2, + explosion_time = Number.MAX_SAFE_INTEGER, + DELIVERY_REWARD = OvercookedMDP.OvercookedGridworld.DELIVERY_REWARD, + always_serve = false + }) { + this.gameWidth = gameWidth; + this.gameHeight = gameHeight; + this.container_id = container_id; + let params = { COOK_TIME, explosion_time, DELIVERY_REWARD, always_serve }; + this.mdp = OvercookedMDP.OvercookedGridworld.from_grid(start_grid, params); + this.state = this.mdp.get_start_state(); + this.joint_action = [OvercookedMDP.Direction.STAY, OvercookedMDP.Direction.STAY]; + this.player_colors = player_colors; + this.assets_loc = assets_loc; + this.show_post_cook_time = show_post_cook_time; + + let gameparent = this; + this.scene = new _phaser2.default.Class({ + gameparent, + Extends: _phaser2.default.Scene, + initialize: function () { + _phaser2.default.Scene.call(this, { key: "PlayGame" }); + }, + preload: function () { + this.load.atlas("tiles", this.gameparent.assets_loc + "terrain.png", this.gameparent.assets_loc + "terrain.json"); + this.load.atlas("chefs", this.gameparent.assets_loc + "chefs.png", this.gameparent.assets_loc + "chefs.json"); + this.load.atlas("objects", this.gameparent.assets_loc + "objects.png", this.gameparent.assets_loc + "objects.json"); + }, + create: function () { + // this.gameparent = gameparent; + this.mdp = gameparent.mdp; + this.sprites = {}; + this.drawLevel(); + this._drawState(gameparent.state, this.sprites); + // this.cursors = this.input.keyboard.createCursorKeys(); //this messes with the keys a lot + // this.player.can_take_input = true; + // this.animating_transition = false; + }, + drawLevel: function () { + //draw tiles + let terrain_to_img = { + ' ': 'floor.png', + 'X': 'counter.png', + 'P': 'pot.png', + 'O': 'onions.png', + 'T': 'tomatoes.png', + 'D': 'dishes.png', + 'S': 'serve.png' + }; + let pos_dict = this.mdp._get_terrain_type_pos_dict(); + for (let ttype in pos_dict) { + if (!pos_dict.hasOwnProperty(ttype)) { + continue; + } + for (let i = 0; i < pos_dict[ttype].length; i++) { + let [x, y] = pos_dict[ttype][i]; + let tile = this.add.sprite(tileSize * x, tileSize * y, "tiles", terrain_to_img[ttype]); + tile.setDisplaySize(tileSize, tileSize); + tile.setOrigin(0); + } + } + }, + _drawState: function (state, sprites) { + sprites = typeof sprites === 'undefined' ? {} : sprites; + + //draw chefs + sprites['chefs'] = typeof sprites['chefs'] === 'undefined' ? {} : sprites['chefs']; + for (let pi = 0; pi < state.players.length; pi++) { + let chef = state.players[pi]; + let [x, y] = chef.position; + let dir = Direction.DIRECTION_TO_NAME[chef.orientation]; + let held_obj = chef.held_object; + if (typeof held_obj !== 'undefined') { + if (held_obj.name === 'soup') { + held_obj = "-soup-" + held_obj.state[0]; + } else { + held_obj = "-" + held_obj.name; + } + } else { + held_obj = ""; + } + if (typeof sprites['chefs'][pi] === 'undefined') { + let chefsprite = this.add.sprite(tileSize * x, tileSize * y, "chefs", `${dir}${held_obj}.png`); + chefsprite.setDisplaySize(tileSize, tileSize); + chefsprite.depth = 1; + chefsprite.setOrigin(0); + let hatsprite = this.add.sprite(tileSize * x, tileSize * y, "chefs", `${dir}-${this.gameparent.player_colors[pi]}hat.png`); + hatsprite.setDisplaySize(tileSize, tileSize); + hatsprite.depth = 2; + hatsprite.setOrigin(0); + sprites['chefs'][pi] = { chefsprite, hatsprite }; + } else { + let chefsprite = sprites['chefs'][pi]['chefsprite']; + let hatsprite = sprites['chefs'][pi]['hatsprite']; + chefsprite.setFrame(`${dir}${held_obj}.png`); + hatsprite.setFrame(`${dir}-${this.gameparent.player_colors[pi]}hat.png`); + this.tweens.add({ + targets: [chefsprite, hatsprite], + x: tileSize * x, + y: tileSize * y, + duration: ANIMATION_DURATION, + ease: 'Linear', + onComplete: (tween, target, player) => { + target[0].setPosition(tileSize * x, tileSize * y); + //this.animating = false; + } + }); + } + } + + //draw environment objects + if (typeof sprites['objects'] !== 'undefined') { + for (let objpos in sprites.objects) { + let { objsprite, timesprite } = sprites.objects[objpos]; + objsprite.destroy(); + if (typeof timesprite !== 'undefined') { + timesprite.destroy(); + } + } + } + sprites['objects'] = {}; + + for (let objpos in state.objects) { + if (!state.objects.hasOwnProperty(objpos)) { + continue; + } + let obj = state.objects[objpos]; + let [x, y] = obj.position; + let terrain_type = this.mdp.get_terrain_type_at(obj.position); + let spriteframe, souptype, n_ingredients; + let cooktime = ""; + if (obj.name === 'soup' && terrain_type === 'P') { + [souptype, n_ingredients, cooktime] = obj.state; + + // select pot sprite + if (cooktime <= this.mdp.COOK_TIME) { + spriteframe = `soup-${souptype}-${n_ingredients}-cooking.png`; + } else if (cooktime >= this.mdp.explosion_time) { + spriteframe = 'pot-explosion.png'; + } else { + spriteframe = `soup-${souptype}-cooked.png`; + } + let objsprite = this.add.sprite(tileSize * x, tileSize * y, "objects", spriteframe); + objsprite.setDisplaySize(tileSize, tileSize); + objsprite.depth = 1; + objsprite.setOrigin(0); + let objs_here = { objsprite }; + + // show time accordingly + let show_time = true; + if (cooktime > this.mdp.COOK_TIME && !this.show_post_cook_time) { + show_time = false; + } + if (show_time) { + let timesprite = this.add.text(tileSize * (x + .5), tileSize * (y + .6), String(cooktime), { + font: "25px Arial", + fill: "red", + align: "center" + }); + timesprite.depth = 2; + objs_here['timesprite'] = timesprite; + } + + sprites['objects'][objpos] = objs_here; + } else if (obj.name === 'soup') { + [souptype, n_ingredients, cooktime] = obj.state; + spriteframe = `soup-${souptype}-dish.png`; + let objsprite = this.add.sprite(tileSize * x, tileSize * y, "objects", spriteframe); + objsprite.setDisplaySize(tileSize, tileSize); + objsprite.depth = 1; + objsprite.setOrigin(0); + sprites['objects'][objpos] = { objsprite }; + } else { + if (obj.name === 'onion') { + spriteframe = "onion.png"; + } else if (obj.name === 'tomato') { + spriteframe = "tomato.png"; + } else if (obj.name === 'dish') { + spriteframe = "dish.png"; + } + let objsprite = this.add.sprite(tileSize * x, tileSize * y, "objects", spriteframe); + objsprite.setDisplaySize(tileSize, tileSize); + objsprite.depth = 1; + objsprite.setOrigin(0); + sprites['objects'][objpos] = { objsprite }; + } + } + + //draw order list + let order_list = "Orders: " + state.order_list.join(", "); + if (typeof sprites['order_list'] !== 'undefined') { + sprites['order_list'].setText(order_list); + } else { + sprites['order_list'] = this.add.text(5, 5, order_list, { + font: "20px Arial", + fill: "yellow", + align: "left" + }); + } + }, + _drawScore: function (score, sprites) { + score = "Score: " + score; + if (typeof sprites['score'] !== 'undefined') { + sprites['score'].setText(score); + } else { + sprites['score'] = this.add.text(5, 25, score, { + font: "20px Arial", + fill: "yellow", + align: "left" + }); + } + }, + _drawTimeLeft: function (time_left, sprites) { + time_left = "Time Left: " + time_left; + if (typeof sprites['time_left'] !== 'undefined') { + sprites['time_left'].setText(time_left); + } else { + sprites['time_left'] = this.add.text(5, 45, time_left, { + font: "20px Arial", + fill: "yellow", + align: "left" + }); + } + }, + update: function () { + // let state, score_; + // let redraw = false; + if (typeof this.gameparent.state_to_draw !== 'undefined') { + let state = this.gameparent.state_to_draw; + delete this.gameparent.state_to_draw; + // redraw = true; + this._drawState(state, this.sprites); + } + if (typeof this.gameparent.score_to_draw !== 'undefined') { + let score = this.gameparent.score_to_draw; + delete this.gameparent.score_to_draw; + this._drawScore(score, this.sprites); + } + if (typeof this.gameparent.time_left !== 'undefined') { + let time_left = this.gameparent.time_left; + delete this.gameparent.time_left; + this._drawTimeLeft(time_left, this.sprites); + } + // if (!redraw) { + // return + // } + } + }); + } + + init() { + let gameConfig = { + type: _phaser2.default.WEBGL, + width: this.gameWidth, + height: this.gameHeight, + scene: [this.scene], + parent: this.container_id, + pixelArt: true, + audio: { + noAudio: true + } + }; + this.game = new _phaser2.default.Game(gameConfig); + } + + drawState(state) { + this.state_to_draw = state; + } + + setAction(player_index, action) {} + + drawScore(score) { + this.score_to_draw = String(score); + } + + drawTimeLeft(time_left) { + this.time_left = String(time_left); + } + + close(msg) { + this.game.renderer.destroy(); + this.game.loop.stop(); + // this.game.canvas.remove(); + this.game.destroy(); + } + +} +exports.OvercookedGame = OvercookedGame; + +},{"./mdp.es6":2,"phaser":780}],4:[function(require,module,exports){ +'use strict'; + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} + +},{}],5:[function(require,module,exports){ +(function (global){ +/** + * @license + * Lodash + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.11'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g, + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + + return result; + } + + if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + + return result; + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': '