diff --git a/404.html b/404.html index 5df99b0ce..fa0871796 100644 --- a/404.html +++ b/404.html @@ -5,13 +5,13 @@ Page Not Found | Mephisto - - + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- - + + \ No newline at end of file diff --git a/assets/js/04e58e9c.30fc8b7b.js b/assets/js/04e58e9c.30fc8b7b.js new file mode 100644 index 000000000..077672d25 --- /dev/null +++ b/assets/js/04e58e9c.30fc8b7b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[6907],{4127:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return k}});var a=n(1987);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},u=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(n),d=o,k=c["".concat(l,".").concat(d)]||c[d]||m[d]||i;return n?a.createElement(k,r(r({ref:t},u),{},{components:n})):a.createElement(k,r({ref:t},u))}));function k(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:o,r[1]=s;for(var p=2;pmephisto wut",id:"21-discovering-options-with-mephisto-wut",level:3},{value:"2.2 Configuring options via the command line",id:"22-configuring-options-via-the-command-line",level:3},{value:"2.3 Using yaml configurations",id:"23-using-yaml-configurations",level:3},{value:"2.4 (optional) Launch your task live",id:"24-optional-launch-your-task-live",level:3},{value:"2.4.1 Launching live on MTurk sandbox",id:"241-launching-live-on-mturk-sandbox",level:4},{value:"2.4.2 Launching live on Prolific",id:"242-launching-live-on-prolific",level:4},{value:"3. Create your own Task",id:"3-create-your-own-task",level:2}],m={toc:c};function d(e){var t=e.components,n=(0,o.Z)(e,r);return(0,i.kt)("wrapper",(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"running-your-first-task"},"Running your first task"),(0,i.kt)("p",null,"So you want to launch your first task.\nThankfully Mephisto makes this fairly easy!\nWe'll launch an HTML-based task as a way to get you started.\nThis guide assumes you've worked through ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/quickstart/"},"the quickstart"),", so begin there if you haven't."),(0,i.kt)("h2",{id:"1-launching-with-default-arguments"},"1. Launching with default arguments"),(0,i.kt)("p",null,"Before every task run, we recommend to remove content of folder ",(0,i.kt)("inlineCode",{parentName:"p"},"/tmp")," (in case the previous Task run didn't shut down correctly)."),(0,i.kt)("h3",{id:"11-run-the-task"},"1.1 Run the task"),(0,i.kt)("p",null,"To get started, you can launch a task by executing a run script. For instance, let's try the form-based simple task:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task__local__inhouse.py\n")),(0,i.kt)("p",null,"or without using Docker"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"cd /mephisto/examples/form_composer_demo/\npython run_task__local__inhouse.py\n")),(0,i.kt)("p",null,"This will launch a local HTTP server with the task hosted, based on the default configuration options:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},"# examples/form_composer_demo/hydra_configs/conf/example__local__inhouse.yaml\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: inhouse\n")),(0,i.kt)("p",null,"We'll dig into ",(0,i.kt)("em",{parentName:"p"},"how")," this works ",(0,i.kt)("a",{parentName:"p",href:"#33-default-abstraction-usage"},"later"),"."),(0,i.kt)("h3",{id:"12-access-the-task"},"1.2 Access the task"),(0,i.kt)("p",null,"By default, the task should be hosted at ",(0,i.kt)("a",{parentName:"p",href:"http://localhost:3000"},"http://localhost:3000")," in browser. If you used the Docker command, then the URL will be ",(0,i.kt)("a",{parentName:"p",href:"http://localhost:3001"},"http://localhost:3001"),"."),(0,i.kt)("p",null,"This default is set by the ",(0,i.kt)("inlineCode",{parentName:"p"},"LocalArchitect"),", which is used based on the ",(0,i.kt)("inlineCode",{parentName:"p"},"- /mephisto/architect: local")," line above.\nNavigating to this address should show you the preview view for the task."),(0,i.kt)("p",null,"Actually being able to access this task is done by providing ",(0,i.kt)("inlineCode",{parentName:"p"},"worker_id")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"assignment_id")," URL params, like ",(0,i.kt)("inlineCode",{parentName:"p"},"localhost:3000/?worker_id=x&id=1"),".\nThe ",(0,i.kt)("inlineCode",{parentName:"p"},"InhouseProvider")," interprets these to be a test worker, which you can use to try out tasks."),(0,i.kt)("p",null,"Try navigating here and completing a task by selecting a value (no need to use the file upload).\nAfter hitting submit you'll note that the window alerts you to the data that was sent to the Mephisto backend."),(0,i.kt)("p",null,"To work on another task, you'll want to change the ",(0,i.kt)("inlineCode",{parentName:"p"},"id")," in your url. This will let ",(0,i.kt)("inlineCode",{parentName:"p"},"Worker"),' "x" work on another task.\nComplete and submit this too.'),(0,i.kt)("p",null,"If you try to work on another task, you'll note that the system states you've worked on the maximum number of tasks.\nOn this task, this is because Mephisto has launched the same two tasks twice to attempt to get different workers to complete them, and as \"x\" you've already completed both tasks.\nMore on this ",(0,i.kt)("a",{parentName:"p",href:"#unit-creation-explained"},"later.")),(0,i.kt)("p",null,"If you change to another ",(0,i.kt)("inlineCode",{parentName:"p"},"worker_id"),", however, you can complete two more tasks.\nDo this and the Mephisto process should shut down cleanly."),(0,i.kt)("h3",{id:"13-review-task-results"},"1.3 Review task results"),(0,i.kt)("p",null,"By this stage, we've collected data and can now review it. For your convenience, for most cases we already wrote a browser-based application to review task results."),(0,i.kt)("p",null,"TaskReview app even can display your task unit content as it was presented to workers. ",(0,i.kt)("em",{parentName:"p"},"In your own tasks you may need to write ",(0,i.kt)("a",{parentName:"em",href:"/docs/guides/how_to_use/review_app/enabling_original_unit_preview/"},"additional react application")," to do this, but we've already done this for you in this example.")),(0,i.kt)("h3",{id:"131-run-taskreview-app"},"1.3.1 Run TaskReview app"),(0,i.kt)("p",null,"Use the following command to start TaskReview app:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 8081:8000 \\\n --rm mephisto_dc \\\n mephisto review_app --host 0.0.0.0 --port 8000\n")),(0,i.kt)("p",null,"or without using Docker"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"mephisto review_app\n")),(0,i.kt)("h3",{id:"132-access-taskreview-app"},"1.3.2 Access TaskReview app"),(0,i.kt)("p",null,"You will see a message like this in your console:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"2024-03-21 16:50:55,300 - werkzeug - INFO - * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)\n")),(0,i.kt)("p",null,"You can open the provided URL in browser ",(0,i.kt)("a",{parentName:"p",href:"http://127.0.0.1:5000"},"http://127.0.0.1:5000"),".\nIf you used the Docker command, then the URL will be ",(0,i.kt)("a",{parentName:"p",href:"http://localhost:8081"},"http://localhost:8081"),"."),(0,i.kt)("p",null,"There you will see a page showing all of your completed tasks. Clicking on a task name will let you review task units completed by each worker. Upon reviewing all task units you will be redirected back to the tasks list page, where you can download task results as one JSON file."),(0,i.kt)("p",null,"For more details, see ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/tutorials/review_app/"},"Reviewing task results"),"."),(0,i.kt)("p",null,"Congrats on finishing your first complete batch!"),(0,i.kt)("h2",{id:"2-change-some-defaults"},"2. Change some defaults"),(0,i.kt)("p",null,"Mephisto uses ",(0,i.kt)("a",{parentName:"p",href:"https://hydra.cc/"},"Hydra")," for our task configuration.\nAs such you can use any of the Hydra methods for configuration.\nOf course, to configure you have to know your options."),(0,i.kt)("h3",{id:"21-discovering-options-with-mephisto-wut"},"2.1 Discovering options with ",(0,i.kt)("inlineCode",{parentName:"h3"},"mephisto wut")),(0,i.kt)("p",null,"Mephisto configuration options can be inherited from a number of different locations, so it can be difficult to track down all available arguments on your own. We provide the ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto wut")," cli tool to make this process simpler. For instance, knowing that we're launching a ",(0,i.kt)("inlineCode",{parentName:"p"},"static_task")," with the ",(0,i.kt)("inlineCode",{parentName:"p"},"local")," architect, we can examine these for configuration options."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"# show available architect options\nmephisto wut architect=local\n# show available blueprint options\nmephisto wut blueprint=static_task\n")),(0,i.kt)("p",null,"A list of all available values is available at ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/how_to_use/efficiency_organization/config_faq/"},"Common Configurations and FAQs"),"."),(0,i.kt)("p",null,"For our given example task, the values we are using for these options are available in the ",(0,i.kt)("inlineCode",{parentName:"p"},"hydra_configs/conf/example.yaml")," file. Let's try overriding some defaults."),(0,i.kt)("h3",{id:"22-configuring-options-via-the-command-line"},"2.2 Configuring options via the command line"),(0,i.kt)("p",null,"As a simple starting point, we can try launching the server on a different port. Right now the default is ",(0,i.kt)("inlineCode",{parentName:"p"},"3000"),", but with the following command we can set that ourselves:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"python run_task__local__inhouse.py mephisto.architect.port=1234\n")),(0,i.kt)("p",null,"This should launch the same task, but now available on the port ",(0,i.kt)("inlineCode",{parentName:"p"},"1234")," rather than ",(0,i.kt)("inlineCode",{parentName:"p"},"3000"),"."),(0,i.kt)("p",null,"Once we see the task is running, we can shut down with ",(0,i.kt)("inlineCode",{parentName:"p"},"Ctrl-C"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Tip:")," Shutting down Mephisto via a single ",(0,i.kt)("inlineCode",{parentName:"p"},"Ctrl-C")," interrupt ",(0,i.kt)("em",{parentName:"p"},"attempts")," to cleanup everything, but sometimes takes time for cleanup steps.\nYou can skip some steps with additional ",(0,i.kt)("inlineCode",{parentName:"p"},"Ctrl-C")," presses, but then you'll need to clean up resources yourself.")),(0,i.kt)("h3",{id:"23-using-yaml-configurations"},"2.3 Using yaml configurations"),(0,i.kt)("p",null,"While it makes sense to update some parameters on the command line while iterating, generally it's easier to extend the ",(0,i.kt)("inlineCode",{parentName:"p"},"conf")," files directly, then apply all of the options by overriding ",(0,i.kt)("inlineCode",{parentName:"p"},"conf"),".\nTry copying the ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/hydra_configs/conf/example__local__inhouse.yaml")," file into ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/hydra_configs/conf/my_config.yaml"),".\nAlso file ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/data/simple/task_data.json")," into ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/data/simple/my_task_data.json")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},'#examples/form_composer_demo/hydra_configs/conf/my_config.yaml\n\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: inhouse\n\nmephisto:\n blueprint:\n data_json: ${task_dir}/data/simple/my_task_data.json # Change path to your new file and change some data in it\n task_source: ${task_dir}/webapp/build/bundle.js\n task_source_review: ${task_dir}/webapp/build/bundle.review.js\n link_task_source: false\n extra_source_dir: ${task_dir}/webapp/src/static\n units_per_assignment: 3\n task:\n task_name: "My first own task" # Change the task name\n task_title: "New title" # Change the task title\n task_description: "In this Task, we use FormComposer feature." # Change the task description\n task_reward: 0\n task_tags: "test,simple,form"\n force_rebuild: true\n')),(0,i.kt)("p",null,"Save this configuration file, and you're ready to launch again:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task__local__inhouse.py conf=my_config\n")),(0,i.kt)("p",null,"or without using Docker"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cd /mephisto/examples/form_composer_demo/\npython run_task__local__inhouse.py conf=my_config\n")),(0,i.kt)("p",null,"Now you'll notice that Mephisto launches your task under the new task name:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"[...][...][INFO] - Creating a task run under task name: My first own task\n")),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"A note on ",(0,i.kt)("inlineCode",{parentName:"strong"},"task_name"),"s:"),"\nThe ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," parameter is particularly important for setting up workflows. Many of Mephisto's features are shared under a specific ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," namespace, including review flows and unit completion maximums per worker per namespace. Later ",(0,i.kt)("a",{parentName:"p",href:"../workflows"},"guides")," go more in-depth on best practices.")),(0,i.kt)("p",null,"Navigating to a task (",(0,i.kt)("inlineCode",{parentName:"p"},"localhost:3000/?worker_id=x&id=1")," or woth Docker on ",(0,i.kt)("inlineCode",{parentName:"p"},"3001")," port) should now show you a task loaded from a different data file.\nCompleting this task will lead Mephisto to shut down cleanly."),(0,i.kt)("p",null,"You can now review this task with the review script again, this time providing the task name ",(0,i.kt)("inlineCode",{parentName:"p"},"My first own task"),"."),(0,i.kt)("h3",{id:"24-optional-launch-your-task-live"},"2.4 (optional) Launch your task live"),(0,i.kt)("p",null,"So far we've been launching our task in a testing mode (with ",(0,i.kt)("inlineCode",{parentName:"p"},"local")," architect and ",(0,i.kt)("inlineCode",{parentName:"p"},"inhouse")," provider)."),(0,i.kt)("p",null,"To make your Task page accessible to the others (e.g. external workers), you will either need to obtain a publicly accessible static IP address for you machine, or launch the task with a non-",(0,i.kt)("inlineCode",{parentName:"p"},"inhouse")," human cloud platform and a non-",(0,i.kt)("inlineCode",{parentName:"p"},"local")," architect."),(0,i.kt)("p",null,"In the below examples we consider an EC2 architect and a few common providers. This configuration is different from the testing mode:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"EC2 architect will build a temporary EC2 server in the cloud, which will:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"serve webpages with newly assigned units of your (now publicly accessible) Task to workers on human cloud provider's platform"),(0,i.kt)("li",{parentName:"ul"},"send completed task results to your machine"),(0,i.kt)("li",{parentName:"ul"},"dismantle the EC2 server if the Task is terminated for whichever reason"))),(0,i.kt)("li",{parentName:"ul"},"non-mock provider will maintain an API connection with a human cloud platform to:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"direct workers willing to work on your Task to an EC2 webpage for their newly assigned task unit"),(0,i.kt)("li",{parentName:"ul"},"monitor status of all task units currently being worked on"),(0,i.kt)("li",{parentName:"ul"},"handle routine opeartions on task units and workers (expire a stalled unit; give bonus to worker; etc)")))),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Note: The Mephisto process must remain continuously running when in-use, so you must leave your machine running to be able to access a task.")),(0,i.kt)("h4",{id:"241-launching-live-on-mturk-sandbox"},"2.4.1 Launching live on MTurk sandbox"),(0,i.kt)("p",null,"First, let's specify the API credentials:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Create file ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/aws_credentials")," and populate it with your AWS keys info (for EC2 architect)"),(0,i.kt)("li",{parentName:"ul"},"Add your Mturk account API keys to ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/aws_credentials")," file"),(0,i.kt)("li",{parentName:"ul"},"Clone file ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/docker-compose.dev.yml")," as ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/docker-compose.local.yml"),", and point its ",(0,i.kt)("inlineCode",{parentName:"li"},"env_file")," to ",(0,i.kt)("inlineCode",{parentName:"li"},"envs/env.local")),(0,i.kt)("li",{parentName:"ul"},"Ensure ",(0,i.kt)("inlineCode",{parentName:"li"},"envs/env.local")," file has a defeinition of these env variables:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"CYPRESS_CACHE_FOLDER"),": set it to any writable folder, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"/tmp"))))),(0,i.kt)("p",null,"Now we're ready to launch an example task on Mturk platform:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.local.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task_dynamic__ec2__mturk_sandbox.py\n")),(0,i.kt)("p",null,"Note that this command reads task parameters from task config file referenced within the ",(0,i.kt)("inlineCode",{parentName:"p"},"run_task_dynamic__ec2__mturk_sandbox.py")," script."),(0,i.kt)("p",null,"Generally, you would want to adjust task config file to your needs.\nYou don't need to do this step ",(0,i.kt)("em",{parentName:"p"},"right now"),", however it's important for understanding how to take one of these tasks live.\nAssuming you've completed the optional steps in ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/quickstart/#optional-set-up-mturk"},"the quickstart"),",\nyou can make the following changes to your config file, replacing ",(0,i.kt)("inlineCode",{parentName:"p"},"my_mturk_user_sandbox")," with the id you used in it's place when registering initially:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},'#examples/form_composer_demo/hydra_configs/conf/my_config.yaml\n\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: ec2 # To launch live, we\'ll need an external server\n - /mephisto/provider: mturk_sandbox # And an external provider\n\nmephisto:\n architect:\n _architect_type: ec2\n profile_name: my_ec2_user # Name of EC2 user\n subdomain: "0123" # Each Task Run must have a unique subdomain\n blueprint:\n data_json: ${task_dir}/data/dynamic/task_data.json\n task_source: ${task_dir}/webapp/build/bundle.js\n task_source_review: ${task_dir}/webapp/build/bundle.review.js\n preview_source: ${task_dir}/preview/mturk_preview.html\n link_task_source: false\n extra_source_dir: ${task_dir}/webapp/src/static\n units_per_assignment: 1\n log_level: "debug"\n task:\n task_name: "Sample Questionnaire"\n task_title: "Dynamic form-based Tasks for Mturk"\n task_description: "In this Task, we use dynamic FormComposer feature."\n task_reward: 0.05\n task_tags: "dynamic,form,testing"\n assignment_duration_in_seconds: 3600\n force_rebuild: true\n max_num_concurrent_units: 1\n maximum_units_per_worker: 2\n provider:\n requester_name: my_mturk_user_sandbox # Or whatever ID you provided with `mephisto register mturk_sandbox`\n')),(0,i.kt)("p",null,"Save this configuration file as ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/hydra_configs/conf/my_config.yaml"),", and you will see your task go live on Mturk platform!"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task_dynamic__ec2__mturk_sandbox.py conf=my_config\n")),(0,i.kt)("p",null,"or without using Docker"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cd /mephisto/examples/form_composer_demo/\npython run_task_dynamic__ec2__mturk_sandbox.py conf=my_config\n")),(0,i.kt)("p",null,"Mephisto should print out links to view your task on the mturk sandbox,\nlike ",(0,i.kt)("inlineCode",{parentName:"p"},"https://workersandbox.mturk.com/mturk/preview?groupId=XXXXXXXXXXXXXXXX"),".\nNavigate here and you'll be see your task live on Mturk sandbox, as if you were a worker!"),(0,i.kt)("p",null,"Complete this task, and you can review it in the same way as usual."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Tip"),": You can reuse common configurations by ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/how_to_use/efficiency_organization/reusing_configs/"},"associating them with a profile"),".\nUsually these contain ",(0,i.kt)("inlineCode",{parentName:"p"},"Provider")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"Architect")," arguments, as these usually aren't related to a specific task.")),(0,i.kt)("h4",{id:"242-launching-live-on-prolific"},"2.4.2 Launching live on Prolific"),(0,i.kt)("p",null,"First, let's specify the API credentials:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Create file ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/aws_credentials")," and populate it with your AWS keys info (for EC2 architect)"),(0,i.kt)("li",{parentName:"ul"},"Clone file ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/docker-compose.dev.yml")," as ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/docker-compose.local.yml"),", and point its ",(0,i.kt)("inlineCode",{parentName:"li"},"env_file")," to ",(0,i.kt)("inlineCode",{parentName:"li"},"envs/env.local")),(0,i.kt)("li",{parentName:"ul"},"Ensure ",(0,i.kt)("inlineCode",{parentName:"li"},"envs/env.local")," file has a defeinition of these env variables:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"PROLIFIC_API_KEY"),": set it to your Prolific API key"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"CYPRESS_CACHE_FOLDER"),": set it to any writable folder, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"/tmp"))))),(0,i.kt)("p",null,"Now we're ready to launch an example task on Prolific platform:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.local.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task_dynamic__ec2__prolific.py\n")),(0,i.kt)("p",null,"The other steps are similar to launching on MTurk, just task config file is a bit different."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},'#examples/form_composer_demo/hydra_configs/conf/my_config.yaml\n\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: ec2 # To launch live, we\'ll need an external server\n - /mephisto/provider: prolific # And an external provider\n\nmephisto:\n architect:\n _architect_type: ec2\n profile_name: my_ec2_user # Name of EC2 user\n subdomain: "0123" # Each Task Run must have a new subdomain\n blueprint:\n data_json: ${task_dir}/data/dynamic/task_data.json\n task_source: ${task_dir}/webapp/build/bundle.js\n task_source_review: ${task_dir}/webapp/build/bundle.review.js\n link_task_source: false\n extra_source_dir: ${task_dir}/webapp/src/static\n units_per_assignment: 1\n log_level: "debug"\n task:\n task_name: "Sample Questionnaire"\n # Note: don\'t use `Prolific` in task names, because Prolific will (silently) block your account\n task_title: "Dynamic form-based Tasks for Prolifik"\n task_description: "In this Task, we use dynamic FormComposer feature."\n task_reward: 70\n task_tags: "test,simple,form"\n force_rebuild: true\n max_num_concurrent_units: 1\n provider:\n # Prolific researcher has Workspaces to group Projects\n prolific_workspace_name: "My Workspace"\n # Prolific researcher has Projects to group Studies\n prolific_project_name: "Project"\n # Temporary Prolific Participant Group where we save known workers\n # who satisfy Mephisto qualifications required in this Task\n prolific_allow_list_group_name: "Allow list"\n # Temporary Prolific Participant Group where we save known workers\n # that we have banned during previous task reviews\n prolific_block_list_group_name: "Block list"\n # We can additionally use worker filtering criteria that Prolific platform supprts\n prolific_eligibility_requirements:\n - name: "CustomWhitelistEligibilityRequirement"\n # This limits your Task only to Prolific Participants (workers) with these IDs\n white_list:\n - 6528ff4ac201b9605db841e4\n - 6528ff6b4a6e8ccb70226c4b\n - 6528ff850867369791a99491\n - 6528ffa32c90c600f42b3589\n - 6528ffc2618c084ccb2b37a0\n - 6528ffe199313384fde5028e\n - 652907b023fbe4ed22234d75\n - 652907fb98474afcbe5cb5cd\n # This limits your Task only to Prolific Participants (workers) in this age range\n - name: "ApprovalRateEligibilityRequirement"\n minimum_approval_rate: 1\n maximum_approval_rate: 100\n')),(0,i.kt)("p",null,"For more details, see ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/how_to_use/providers/prolific/intro/"},"Prolific overview"),"."),(0,i.kt)("h2",{id:"3-create-your-own-task"},"3. Create your own Task"),(0,i.kt)("p",null,"In the introductory examples we user pre-created Tasks. To design your own custom Tasks, you have two options:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Code your own Task application (build components like React-based UI, custom Agent state, etc). This works best for highly customized Task logic.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Examples of custom Tasks include ",(0,i.kt)("inlineCode",{parentName:"li"},"examples/remote_procedure")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"examples/parlai_chat_task_demo")))),(0,i.kt)("li",{parentName:"ul"},"Use an existing Task generator (and specify your task via configs with little, if any, custom coding required). This works best for fairly standard Task logic.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"form-based Tasks: see ",(0,i.kt)("a",{parentName:"li",href:"/docs/guides/how_to_use/form_composer/running/"},"Run FormComposer tasks"))))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/04e58e9c.a3538379.js b/assets/js/04e58e9c.a3538379.js deleted file mode 100644 index 001fcc5b1..000000000 --- a/assets/js/04e58e9c.a3538379.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[6907],{4127:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return k}});var a=n(1987);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},u=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(n),d=o,k=c["".concat(l,".").concat(d)]||c[d]||m[d]||i;return n?a.createElement(k,r(r({ref:t},u),{},{components:n})):a.createElement(k,r({ref:t},u))}));function k(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:o,r[1]=s;for(var p=2;pmephisto wut",id:"21-discovering-options-with-mephisto-wut",level:3},{value:"2.2 Configuring options via the command line",id:"22-configuring-options-via-the-command-line",level:3},{value:"2.3 Using yaml configurations",id:"23-using-yaml-configurations",level:3},{value:"2.4 (optional) Launch your task live",id:"24-optional-launch-your-task-live",level:3},{value:"2.4.1 Launching live on MTurk sandbox",id:"241-launching-live-on-mturk-sandbox",level:4},{value:"2.4.2 Launching live on Prolific",id:"242-launching-live-on-prolific",level:4},{value:"3. Create your own Task",id:"3-create-your-own-task",level:2}],m={toc:c};function d(e){var t=e.components,n=(0,o.Z)(e,r);return(0,i.kt)("wrapper",(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"running-your-first-task"},"Running your first task"),(0,i.kt)("p",null,"So you want to launch your first task.\nThankfully Mephisto makes this fairly easy!\nWe'll launch an HTML-based task as a way to get you started.\nThis guide assumes you've worked through ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/quickstart/"},"the quickstart"),", so begin there if you haven't."),(0,i.kt)("h2",{id:"1-launching-with-default-arguments"},"1. Launching with default arguments"),(0,i.kt)("p",null,"Before every task run, we recommend to remove content of folder ",(0,i.kt)("inlineCode",{parentName:"p"},"/tmp")," (in case the previous Task run didn't shut down correctly)."),(0,i.kt)("h3",{id:"11-run-the-task"},"1.1 Run the task"),(0,i.kt)("p",null,"To get started, you can launch a task by executing a run script. For instance, let's try the form-based simple task:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task.py\n")),(0,i.kt)("p",null,"or without using Docker"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"cd /mephisto/examples/form_composer_demo/\npython run_task.py\n")),(0,i.kt)("p",null,"This will launch a local HTTP server with the task hosted, based on the default configuration options:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},"# examples/form_composer_demo/hydra_configs/conf/example_local_mock.yaml\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: mock\n")),(0,i.kt)("p",null,"We'll dig into ",(0,i.kt)("em",{parentName:"p"},"how")," this works ",(0,i.kt)("a",{parentName:"p",href:"#33-default-abstraction-usage"},"later"),"."),(0,i.kt)("h3",{id:"12-access-the-task"},"1.2 Access the task"),(0,i.kt)("p",null,"By default, the task should be hosted at ",(0,i.kt)("a",{parentName:"p",href:"http://localhost:3000"},"http://localhost:3000")," in browser. If you used the Docker command, then the URL will be ",(0,i.kt)("a",{parentName:"p",href:"http://localhost:3001"},"http://localhost:3001"),"."),(0,i.kt)("p",null,"This default is set by the ",(0,i.kt)("inlineCode",{parentName:"p"},"LocalArchitect"),", which is used based on the ",(0,i.kt)("inlineCode",{parentName:"p"},"- /mephisto/architect: local")," line above.\nNavigating to this address should show you the preview view for the task."),(0,i.kt)("p",null,"Actually being able to access this task is done by providing ",(0,i.kt)("inlineCode",{parentName:"p"},"worker_id")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"assignment_id")," URL params, like ",(0,i.kt)("inlineCode",{parentName:"p"},"localhost:3000/?worker_id=x&assignment_id=1"),".\nThe ",(0,i.kt)("inlineCode",{parentName:"p"},"MockProvider")," interprets these to be a test worker, which you can use to try out tasks."),(0,i.kt)("p",null,"Try navigating here and completing a task by selecting a value (no need to use the file upload).\nAfter hitting submit you'll note that the window alerts you to the data that was sent to the Mephisto backend."),(0,i.kt)("p",null,"To work on another task, you'll want to change the ",(0,i.kt)("inlineCode",{parentName:"p"},"assignment_id")," in your url. This will let ",(0,i.kt)("inlineCode",{parentName:"p"},"Worker"),' "x" work on another task.\nComplete and submit this too.'),(0,i.kt)("p",null,"If you try to work on another task, you'll note that the system states you've worked on the maximum number of tasks.\nOn this task, this is because Mephisto has launched the same two tasks twice to attempt to get different workers to complete them, and as \"x\" you've already completed both tasks.\nMore on this ",(0,i.kt)("a",{parentName:"p",href:"#unit-creation-explained"},"later.")),(0,i.kt)("p",null,"If you change to another ",(0,i.kt)("inlineCode",{parentName:"p"},"worker_id"),", however, you can complete two more tasks.\nDo this and the Mephisto process should shut down cleanly."),(0,i.kt)("h3",{id:"13-review-task-results"},"1.3 Review task results"),(0,i.kt)("p",null,"By this stage, we've collected data and can now review it. For your convenience, for most cases we already wrote a browser-based application to review task results."),(0,i.kt)("p",null,"TaskReview app even can display your task unit content as it was presented to workers. ",(0,i.kt)("em",{parentName:"p"},"In your own tasks you may need to write ",(0,i.kt)("a",{parentName:"em",href:"/docs/guides/how_to_use/review_app/enabling_original_unit_preview/"},"additional react application")," to do this, but we've already done this for you in this example.")),(0,i.kt)("h3",{id:"131-run-taskreview-app"},"1.3.1 Run TaskReview app"),(0,i.kt)("p",null,"Use the following command to start TaskReview app:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 8081:8000 \\\n --rm mephisto_dc \\\n mephisto review_app --host 0.0.0.0 --port 8000\n")),(0,i.kt)("p",null,"or without using Docker"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"mephisto review_app\n")),(0,i.kt)("h3",{id:"132-access-taskreview-app"},"1.3.2 Access TaskReview app"),(0,i.kt)("p",null,"You will see a message like this in your console:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"2024-03-21 16:50:55,300 - werkzeug - INFO - * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)\n")),(0,i.kt)("p",null,"You can open the provided URL in browser ",(0,i.kt)("a",{parentName:"p",href:"http://127.0.0.1:5000"},"http://127.0.0.1:5000"),".\nIf you used the Docker command, then the URL will be ",(0,i.kt)("a",{parentName:"p",href:"http://localhost:8081"},"http://localhost:8081"),"."),(0,i.kt)("p",null,"There you will see a page showing all of your completed tasks. Clicking on a task name will let you review task units completed by each worker. Upon reviewing all task units you will be redirected back to the tasks list page, where you can download task results as one JSON file."),(0,i.kt)("p",null,"For more details, see ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/tutorials/review_app/"},"Reviewing task results"),"."),(0,i.kt)("p",null,"Congrats on finishing your first complete batch!"),(0,i.kt)("h2",{id:"2-change-some-defaults"},"2. Change some defaults"),(0,i.kt)("p",null,"Mephisto uses ",(0,i.kt)("a",{parentName:"p",href:"https://hydra.cc/"},"Hydra")," for our task configuration.\nAs such you can use any of the Hydra methods for configuration.\nOf course, to configure you have to know your options."),(0,i.kt)("h3",{id:"21-discovering-options-with-mephisto-wut"},"2.1 Discovering options with ",(0,i.kt)("inlineCode",{parentName:"h3"},"mephisto wut")),(0,i.kt)("p",null,"Mephisto configuration options can be inherited from a number of different locations, so it can be difficult to track down all available arguments on your own. We provide the ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto wut")," cli tool to make this process simpler. For instance, knowing that we're launching a ",(0,i.kt)("inlineCode",{parentName:"p"},"static_task")," with the ",(0,i.kt)("inlineCode",{parentName:"p"},"local")," architect, we can examine these for configuration options."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"# show available architect options\nmephisto wut architect=local\n# show available blueprint options\nmephisto wut blueprint=static_task\n")),(0,i.kt)("p",null,"A list of all available values is available at ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/how_to_use/efficiency_organization/config_faq/"},"Common Configurations and FAQs"),"."),(0,i.kt)("p",null,"For our given example task, the values we are using for these options are available in the ",(0,i.kt)("inlineCode",{parentName:"p"},"hydra_configs/conf/example.yaml")," file. Let's try overriding some defaults."),(0,i.kt)("h3",{id:"22-configuring-options-via-the-command-line"},"2.2 Configuring options via the command line"),(0,i.kt)("p",null,"As a simple starting point, we can try launching the server on a different port. Right now the default is ",(0,i.kt)("inlineCode",{parentName:"p"},"3000"),", but with the following command we can set that ourselves:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"python run_task.py mephisto.architect.port=1234\n")),(0,i.kt)("p",null,"This should launch the same task, but now available on the port ",(0,i.kt)("inlineCode",{parentName:"p"},"1234")," rather than ",(0,i.kt)("inlineCode",{parentName:"p"},"3000"),"."),(0,i.kt)("p",null,"Once we see the task is running, we can shut down with ",(0,i.kt)("inlineCode",{parentName:"p"},"Ctrl-C"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Tip:")," Shutting down Mephisto via a single ",(0,i.kt)("inlineCode",{parentName:"p"},"Ctrl-C")," interrupt ",(0,i.kt)("em",{parentName:"p"},"attempts")," to cleanup everything, but sometimes takes time for cleanup steps.\nYou can skip some steps with additional ",(0,i.kt)("inlineCode",{parentName:"p"},"Ctrl-C")," presses, but then you'll need to clean up resources yourself.")),(0,i.kt)("h3",{id:"23-using-yaml-configurations"},"2.3 Using yaml configurations"),(0,i.kt)("p",null,"While it makes sense to update some parameters on the command line while iterating, generally it's easier to extend the ",(0,i.kt)("inlineCode",{parentName:"p"},"conf")," files directly, then apply all of the options by overriding ",(0,i.kt)("inlineCode",{parentName:"p"},"conf"),".\nTry copying the ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/hydra_configs/conf/example_local_mock.yaml")," file into ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/hydra_configs/conf/my_config.yaml"),".\nAlso file ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/data/simple/task_data.json")," into ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/data/simple/my_task_data.json")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},'#examples/form_composer_demo/hydra_configs/conf/my_config.yaml\n\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: mock\n\nmephisto:\n blueprint:\n data_json: ${task_dir}/data/simple/my_task_data.json # Change path to your new file and change some data in it\n task_source: ${task_dir}/webapp/build/bundle.js\n task_source_review: ${task_dir}/webapp/build/bundle.review.js\n link_task_source: false\n extra_source_dir: ${task_dir}/webapp/src/static\n units_per_assignment: 3\n task:\n task_name: "My first own task" # Change the task name\n task_title: "New title" # Change the task title\n task_description: "In this Task, we use FormComposer feature." # Change the task description\n task_reward: 0\n task_tags: "test,simple,form"\n force_rebuild: true\n')),(0,i.kt)("p",null,"Save this configuration file, and you're ready to launch again:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task.py conf=my_config\n")),(0,i.kt)("p",null,"or without using Docker"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cd /mephisto/examples/form_composer_demo/\npython run_task.py conf=my_config\n")),(0,i.kt)("p",null,"Now you'll notice that Mephisto launches your task under the new task name:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"[...][...][INFO] - Creating a task run under task name: My first own task\n")),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"A note on ",(0,i.kt)("inlineCode",{parentName:"strong"},"task_name"),"s:"),"\nThe ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," parameter is particularly important for setting up workflows. Many of Mephisto's features are shared under a specific ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," namespace, including review flows and unit completion maximums per worker per namespace. Later ",(0,i.kt)("a",{parentName:"p",href:"../workflows"},"guides")," go more in-depth on best practices.")),(0,i.kt)("p",null,"Navigating to a task (",(0,i.kt)("inlineCode",{parentName:"p"},"localhost:3000/?worker_id=x&assignment_id=1")," or woth Docker on ",(0,i.kt)("inlineCode",{parentName:"p"},"3001")," port) should now show you a task loaded from a different data file.\nCompleting this task will lead Mephisto to shut down cleanly."),(0,i.kt)("p",null,"You can now review this task with the review script again, this time providing the task name ",(0,i.kt)("inlineCode",{parentName:"p"},"My first own task"),"."),(0,i.kt)("h3",{id:"24-optional-launch-your-task-live"},"2.4 (optional) Launch your task live"),(0,i.kt)("p",null,"So far we've been launching our task in a testing mode (with ",(0,i.kt)("inlineCode",{parentName:"p"},"local")," architect and ",(0,i.kt)("inlineCode",{parentName:"p"},"mock")," provider)."),(0,i.kt)("p",null,"To make your Task page accessible to the others (e.g. external workers), you will either need to obtain a publicly accessible static IP address for you machine, or launch the task with a non-",(0,i.kt)("inlineCode",{parentName:"p"},"mock")," human cloud platform and a non-",(0,i.kt)("inlineCode",{parentName:"p"},"local")," architect."),(0,i.kt)("p",null,"In the below examples we consider an EC2 architect and a few common providers. This configuration is different from the testing mode:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"EC2 architect will build a temporary EC2 server in the cloud, which will:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"serve webpages with newly assigned units of your (now publicly accessible) Task to workers on human cloud provider's platform"),(0,i.kt)("li",{parentName:"ul"},"send completed task results to your machine"),(0,i.kt)("li",{parentName:"ul"},"dismantle the EC2 server if the Task is terminated for whichever reason"))),(0,i.kt)("li",{parentName:"ul"},"non-mock provider will maintain an API connection with a human cloud platform to:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"direct workers willing to work on your Task to an EC2 webpage for their newly assigned task unit"),(0,i.kt)("li",{parentName:"ul"},"monitor status of all task units currently being worked on"),(0,i.kt)("li",{parentName:"ul"},"handle routine opeartions on task units and workers (expire a stalled unit; give bonus to worker; etc)")))),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Note: The Mephisto process must remain continuously running when in-use, so you must leave your machine running to be able to access a task.")),(0,i.kt)("h4",{id:"241-launching-live-on-mturk-sandbox"},"2.4.1 Launching live on MTurk sandbox"),(0,i.kt)("p",null,"First, let's specify the API credentials:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Create file ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/aws_credentials")," and populate it with your AWS keys info (for EC2 architect)"),(0,i.kt)("li",{parentName:"ul"},"Add your Mturk account API keys to ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/aws_credentials")," file"),(0,i.kt)("li",{parentName:"ul"},"Clone file ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/docker-compose.dev.yml")," as ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/docker-compose.local.yml"),", and point its ",(0,i.kt)("inlineCode",{parentName:"li"},"env_file")," to ",(0,i.kt)("inlineCode",{parentName:"li"},"envs/env.local")),(0,i.kt)("li",{parentName:"ul"},"Ensure ",(0,i.kt)("inlineCode",{parentName:"li"},"envs/env.local")," file has a defeinition of these env variables:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"CYPRESS_CACHE_FOLDER"),": set it to any writable folder, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"/tmp"))))),(0,i.kt)("p",null,"Now we're ready to launch an example task on Mturk platform:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.local.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task_dynamic_ec2_mturk_sandbox.py\n")),(0,i.kt)("p",null,"Note that this command reads task parameters from task config file referenced within the ",(0,i.kt)("inlineCode",{parentName:"p"},"run_task_dynamic_ec2_mturk_sandbox.py")," script."),(0,i.kt)("p",null,"Generally, you would want to adjust task config file to your needs.\nYou don't need to do this step ",(0,i.kt)("em",{parentName:"p"},"right now"),", however it's important for understanding how to take one of these tasks live.\nAssuming you've completed the optional steps in ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/quickstart/#optional-set-up-mturk"},"the quickstart"),",\nyou can make the following changes to your config file, replacing ",(0,i.kt)("inlineCode",{parentName:"p"},"my_mturk_user_sandbox")," with the id you used in it's place when registering initially:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},'#examples/form_composer_demo/hydra_configs/conf/my_config.yaml\n\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: ec2 # To launch live, we\'ll need an external server\n - /mephisto/provider: mturk_sandbox # And an external provider\n\nmephisto:\n architect:\n _architect_type: ec2\n profile_name: my_ec2_user # Name of EC2 user\n subdomain: "0123" # Each Task Run must have a unique subdomain\n blueprint:\n data_json: ${task_dir}/data/dynamic/task_data.json\n task_source: ${task_dir}/webapp/build/bundle.js\n task_source_review: ${task_dir}/webapp/build/bundle.review.js\n preview_source: ${task_dir}/preview/mturk_preview.html\n link_task_source: false\n extra_source_dir: ${task_dir}/webapp/src/static\n units_per_assignment: 1\n log_level: "debug"\n task:\n task_name: "Sample Questionnaire"\n task_title: "Dynamic form-based Tasks for Mturk"\n task_description: "In this Task, we use dynamic FormComposer feature."\n task_reward: 0.05\n task_tags: "dynamic,form,testing"\n assignment_duration_in_seconds: 3600\n force_rebuild: true\n max_num_concurrent_units: 1\n maximum_units_per_worker: 2\n provider:\n requester_name: my_mturk_user_sandbox # Or whatever ID you provided with `mephisto register mturk_sandbox`\n')),(0,i.kt)("p",null,"Save this configuration file as ",(0,i.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo/hydra_configs/conf/my_config.yaml"),", and you will see your task go live on Mturk platform!"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task_dynamic_ec2_mturk_sandbox.py conf=my_config\n")),(0,i.kt)("p",null,"or without using Docker"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cd /mephisto/examples/form_composer_demo/\npython run_task_dynamic_ec2_mturk_sandbox.py conf=my_config\n")),(0,i.kt)("p",null,"Mephisto should print out links to view your task on the mturk sandbox,\nlike ",(0,i.kt)("inlineCode",{parentName:"p"},"https://workersandbox.mturk.com/mturk/preview?groupId=XXXXXXXXXXXXXXXX"),".\nNavigate here and you'll be see your task live on Mturk sandbox, as if you were a worker!"),(0,i.kt)("p",null,"Complete this task, and you can review it in the same way as usual."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Tip"),": You can reuse common configurations by ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/how_to_use/efficiency_organization/reusing_configs/"},"associating them with a profile"),".\nUsually these contain ",(0,i.kt)("inlineCode",{parentName:"p"},"Provider")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"Architect")," arguments, as these usually aren't related to a specific task.")),(0,i.kt)("h4",{id:"242-launching-live-on-prolific"},"2.4.2 Launching live on Prolific"),(0,i.kt)("p",null,"First, let's specify the API credentials:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Create file ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/aws_credentials")," and populate it with your AWS keys info (for EC2 architect)"),(0,i.kt)("li",{parentName:"ul"},"Clone file ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/docker-compose.dev.yml")," as ",(0,i.kt)("inlineCode",{parentName:"li"},"docker/docker-compose.local.yml"),", and point its ",(0,i.kt)("inlineCode",{parentName:"li"},"env_file")," to ",(0,i.kt)("inlineCode",{parentName:"li"},"envs/env.local")),(0,i.kt)("li",{parentName:"ul"},"Ensure ",(0,i.kt)("inlineCode",{parentName:"li"},"envs/env.local")," file has a defeinition of these env variables:",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"PROLIFIC_API_KEY"),": set it to your Prolific API key"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"CYPRESS_CACHE_FOLDER"),": set it to any writable folder, e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"/tmp"))))),(0,i.kt)("p",null,"Now we're ready to launch an example task on Prolific platform:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.local.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task_dynamic_ec2_prolific.py\n")),(0,i.kt)("p",null,"The other steps are similar to launching on MTurk, just task config file is a bit different."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},'#examples/form_composer_demo/hydra_configs/conf/my_config.yaml\n\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: ec2 # To launch live, we\'ll need an external server\n - /mephisto/provider: prolific # And an external provider\n\nmephisto:\n architect:\n _architect_type: ec2\n profile_name: my_ec2_user # Name of EC2 user\n subdomain: "0123" # Each Task Run must have a new subdomain\n blueprint:\n data_json: ${task_dir}/data/dynamic/task_data.json\n task_source: ${task_dir}/webapp/build/bundle.js\n task_source_review: ${task_dir}/webapp/build/bundle.review.js\n link_task_source: false\n extra_source_dir: ${task_dir}/webapp/src/static\n units_per_assignment: 1\n log_level: "debug"\n task:\n task_name: "Sample Questionnaire"\n # Note: don\'t use `Prolific` in task names, because Prolific will (silently) block your account\n task_title: "Dynamic form-based Tasks for Prolifik"\n task_description: "In this Task, we use dynamic FormComposer feature."\n task_reward: 70\n task_tags: "test,simple,form"\n force_rebuild: true\n max_num_concurrent_units: 1\n provider:\n # Prolific researcher has Workspaces to group Projects\n prolific_workspace_name: "My Workspace"\n # Prolific researcher has Projects to group Studies\n prolific_project_name: "Project"\n # Temporary Prolific Participant Group where we save known workers\n # who satisfy Mephisto qualifications required in this Task\n prolific_allow_list_group_name: "Allow list"\n # Temporary Prolific Participant Group where we save known workers\n # that we have banned during previous task reviews\n prolific_block_list_group_name: "Block list"\n # We can additionally use worker filtering criteria that Prolific platform supprts\n prolific_eligibility_requirements:\n - name: "CustomWhitelistEligibilityRequirement"\n # This limits your Task only to Prolific Participants (workers) with these IDs\n white_list:\n - 6528ff4ac201b9605db841e4\n - 6528ff6b4a6e8ccb70226c4b\n - 6528ff850867369791a99491\n - 6528ffa32c90c600f42b3589\n - 6528ffc2618c084ccb2b37a0\n - 6528ffe199313384fde5028e\n - 652907b023fbe4ed22234d75\n - 652907fb98474afcbe5cb5cd\n # This limits your Task only to Prolific Participants (workers) in this age range\n - name: "ApprovalRateEligibilityRequirement"\n minimum_approval_rate: 1\n maximum_approval_rate: 100\n')),(0,i.kt)("p",null,"For more details, see ",(0,i.kt)("a",{parentName:"p",href:"/docs/guides/how_to_use/providers/prolific/intro/"},"Prolific overview"),"."),(0,i.kt)("h2",{id:"3-create-your-own-task"},"3. Create your own Task"),(0,i.kt)("p",null,"In the introductory examples we user pre-created Tasks. To design your own custom Tasks, you have two options:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Code your own Task application (build components like React-based UI, custom Agent state, etc). This works best for highly customized Task logic.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Examples of custom Tasks include ",(0,i.kt)("inlineCode",{parentName:"li"},"examples/remote_procedure")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"examples/parlai_chat_task_demo")))),(0,i.kt)("li",{parentName:"ul"},"Use an existing Task generator (and specify your task via configs with little, if any, custom coding required). This works best for fairly standard Task logic.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"form-based Tasks: see ",(0,i.kt)("a",{parentName:"li",href:"/docs/guides/how_to_use/form_composer/running/"},"Run FormComposer tasks"))))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/206abefe.91a8cd12.js b/assets/js/206abefe.91a8cd12.js deleted file mode 100644 index 0a0b1cd87..000000000 --- a/assets/js/206abefe.91a8cd12.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[8122],{4127:function(e,n,t){t.d(n,{Zo:function(){return u},kt:function(){return h}});var a=t(1987);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function i(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var l=a.createContext({}),p=function(e){var n=a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},u=function(e){var n=p(e.components);return a.createElement(l.Provider,{value:n},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},m=a.forwardRef((function(e,n){var t=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(t),m=o,h=c["".concat(l,".").concat(m)]||c[m]||d[m]||r;return t?a.createElement(h,i(i({ref:n},u),{},{components:t})):a.createElement(h,i({ref:n},u))}));function h(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var r=t.length,i=new Array(r);i[0]=m;var s={};for(var l in n)hasOwnProperty.call(n,l)&&(s[l]=n[l]);s.originalType=e,s[c]="string"==typeof e?e:o,i[1]=s;for(var p=2;pUnit creation explained",id:"34-unit-creation-explained",level:3},{value:"3.5 Server Callbacks",id:"35-server-callbacks",level:3}],d={toc:c};function m(e){var n=e.components,t=(0,o.Z)(e,i);return(0,r.kt)("wrapper",(0,a.Z)({},d,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"how-task-run-works"},"How task run works"),(0,r.kt)("p",null,"Let's understand basic components of the task launch, such as configs and the ",(0,r.kt)("inlineCode",{parentName:"p"},"run_task.py")," script. This will help with customization of tash launch behaviors."),(0,r.kt)("h3",{id:"31-config-registration"},"3.1 Config registration"),(0,r.kt)("p",null,"Mephisto wires up to configuration using standard Hydra syntax, but with both ",(0,r.kt)("inlineCode",{parentName:"p"},"yaml")," files (for ease of writing) ",(0,r.kt)("em",{parentName:"p"},"and")," structured configs (for ease of documentation).\nHere's the config we've set up for this example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'# examples/form_composer_demo/run_task.py\nimport os\n\nfrom omegaconf import DictConfig\n\nfrom mephisto.operations.operator import Operator\nfrom mephisto.tools.scripts import build_custom_bundle\nfrom mephisto.tools.scripts import task_script\n\n\n@task_script(default_config_file="example_local_mock")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n')),(0,r.kt)("p",null,"This is all you really ",(0,r.kt)("em",{parentName:"p"},"need")," to launch a Mephisto task! The ",(0,r.kt)("inlineCode",{parentName:"p"},"@task_script")," decorator does the job of attaching your hydra yaml as default arguments for the main."),(0,r.kt)("p",null,"Of course, there's quite a bit of 'magic' happening underneath the hood thanks to the script utilities.\nThis version is explicit to show where you may add customization, and re-ordered for understanding:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"# modified examples/form_composer_demo/run_task.py\nimport os\nfrom dataclasses import dataclass\nfrom typing import Any\n\nfrom omegaconf import DictConfig\n\nfrom mephisto.operations.operator import Operator\nfrom mephisto.operations.hydra_config import build_default_task_config\nfrom mephisto.tools.scripts import build_custom_bundle\nfrom mephisto.tools.scripts import task_script\n\n@dataclass\nclass MyTaskConfig(build_default_task_config('example_local_mock')):\n custom_args: Any = 4\n\n@task_script(config=MyTaskConfig)\ndef main(operator: Operator, cfg: DictConfig) -> None:\n")),(0,r.kt)("p",null,"In this snippet, we do a few things:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"We set up the default ",(0,r.kt)("a",{parentName:"li",href:"https://hydra.cc/docs/tutorials/basic/your_first_app/config_file/"},(0,r.kt)("inlineCode",{parentName:"a"},"conf"))," file to be ",(0,r.kt)("inlineCode",{parentName:"li"},"example_local_mock"),",\nusing ",(0,r.kt)("inlineCode",{parentName:"li"},"build_default_task_config"),", which returns a ",(0,r.kt)("inlineCode",{parentName:"li"},"TaskConfig")," that we can extend."),(0,r.kt)("li",{parentName:"ol"},"We extend the returned ",(0,r.kt)("inlineCode",{parentName:"li"},"TaskConfig")," with ",(0,r.kt)("inlineCode",{parentName:"li"},"MyTaskConfig"),", which allows us to specify custom arguments."),(0,r.kt)("li",{parentName:"ol"},"We decorate the main, noting that the correct config is ",(0,r.kt)("inlineCode",{parentName:"li"},"MyTaskConfig"),".\nNote that the ",(0,r.kt)("inlineCode",{parentName:"li"},"default_config_file")," version of this simply takes care of the above steps inline in the decorator.")),(0,r.kt)("p",null,"With all the above, we're able to just make edits to ",(0,r.kt)("inlineCode",{parentName:"p"},"example_local_mock.yaml")," or make other configs in the ",(0,r.kt)("inlineCode",{parentName:"p"},"conf/")," directory and route to them directly."),(0,r.kt)("h3",{id:"32-invoking-mephisto"},"3.2 Invoking Mephisto"),(0,r.kt)("p",null,"Mephisto itself is actually invoked just a little later:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'@task_script(default_config_file="example_local_mock")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n # Build packages\n _build_custom_bundles(cfg)\n\n operator.launch_task_run(cfg.mephisto)\n operator.wait_for_runs_then_shutdown(skip_input=True, log_rate=30)\n')),(0,r.kt)("p",null,"Under the hood the ",(0,r.kt)("inlineCode",{parentName:"p"},"task_script")," decorator extracts specific arguments out of your configuration\n(and surface warnings about incompatibilities) and initializes an ",(0,r.kt)("inlineCode",{parentName:"p"},"Operator")," on the correct ",(0,r.kt)("inlineCode",{parentName:"p"},"MephistoDB")," for the task.\nUsing this we can launch a ",(0,r.kt)("inlineCode",{parentName:"p"},"TaskRun")," the given config, then wait for it to run.\nTo ensure we're not frozen, the operator takes in a ",(0,r.kt)("inlineCode",{parentName:"p"},"log_rate")," in seconds to print status messages while the run is underway."),(0,r.kt)("h3",{id:"33-default-abstraction-usage"},"3.3 Default abstraction usage"),(0,r.kt)("p",null,"Again we can look back at the ",(0,r.kt)("inlineCode",{parentName:"p"},"example_local_mock.yaml")," file to see this setup:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"# examples/form_composer_demo/hydra_configs/conf/example_local_mock.yaml\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: mock\n")),(0,r.kt)("p",null,"These ensure that, when not provided other arguments, we launch this task locally using a ",(0,r.kt)("inlineCode",{parentName:"p"},"LocalArchitect")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"MockProvider"),'.\nWith these defaults, this and other example tasks are run using a "local" architect, and a "mock" requester without arguments.\nThe "local" architect is reponsible for running a server on your local machine to host the task,\nand the "mock" requester lets ',(0,r.kt)("em",{parentName:"p"},"you")," simulate a worker without using an external crowd-provider platform such as Prolific or MTurk to launch the task."),(0,r.kt)("h3",{id:"34-unit-creation-explained"},"3.4 ",(0,r.kt)("inlineCode",{parentName:"h3"},"Unit")," creation explained"),(0,r.kt)("p",null,"When stepping through this task the first time, you ended up working on two ",(0,r.kt)("inlineCode",{parentName:"p"},"Unit"),"s as two different ",(0,r.kt)("inlineCode",{parentName:"p"},"Worker"),"s.\nIt's useful to understand how this happens.\nTaking a look at the config and data:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"# examples/form_composer_demo/hydra_configs/conf/example_local_mock.yaml\n\n#@package _global_\ndefaults:\n...\nmephisto:\n ...\n blueprint:\n data_json: ${task_dir}/data/simple/task_data.json\n ...\n units_per_assignment: 1\n task:\n ...\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-json"},'// examples/form_composer_demo/data/simple/task_data.json\n\n[\n {\n "form": {\n "title": "Form example",\n "instruction": "Please answer all questions to the best of your ability as part of our study.",\n "sections": [\n {\n "name": "section_about",\n "title": "About you",\n "instruction": "Please introduce yourself. We would like to know more about your background, personal information, etc.",\n "fieldsets": [\n {\n "title": "Personal information",\n "instruction": "",\n "rows": [\n {\n "fields": [\n {\n "help": "",\n "id": "id_name_first",\n "label": "First name",\n "name": "name_first",\n "placeholder": "Type first name",\n "tooltip": "Your first name",\n "type": "input",\n "validators": {\n "required": true,\n "minLength": 2,\n "maxLength": 20\n },\n "value": ""\n },\n {\n "help": "Optional",\n "id": "id_name_last",\n "label": "Last name",\n "name": "name_last",\n "placeholder": "Type last name",\n "tooltip": "Your last name",\n "type": "input",\n "validators": { "required": true },\n "value": ""\n }\n ],\n "help": "Please use your legal name"\n },\n {\n "fields": [\n {\n "help": "We may contact you later for additional information",\n "id": "id_email",\n "label": "Email address for Mephisto",\n "name": "email",\n "placeholder": "user@mephisto.ai",\n "tooltip": "Email address for Mephisto",\n "type": "email",\n "validators": {\n "required": true,\n "regexp": ["^[a-zA-Z0-9._-]+@mephisto\\\\.ai$", "ig"]\n },\n "value": ""\n }\n ]\n }\n ]\n },\n {\n "title": "Cultural background",\n "instruction": "Please tell us about your cultural affiliations and values that you use in your daily life.",\n "rows": [\n {\n "fields": [\n {\n "help": "Select country of your residence",\n "id": "id_country",\n "label": "Country",\n "multiple": false,\n "name": "country",\n "options": [\n {\n "label": "---",\n "value": ""\n },\n {\n "label": "United States of America",\n "value": "USA"\n },\n {\n "label": "Canada",\n "value": "CAN"\n }\n ],\n "placeholder": "",\n "tooltip": "Country",\n "type": "select",\n "validators": { "required": true },\n "value": ""\n },\n {\n "help": "Select language spoken in your local community",\n "id": "id_language",\n "label": "Language",\n "multiple": true,\n "name": "language",\n "options": [\n {\n "label": "English",\n "value": "en"\n },\n {\n "label": "French",\n "value": "fr"\n },\n {\n "label": "Spanish",\n "value": "es"\n },\n {\n "label": "Chinese",\n "value": "ch"\n }\n ],\n "placeholder": "",\n "tooltip": "Language",\n "type": "select",\n "validators": {\n "required": true,\n "minLength": 2,\n "maxLength": 3\n },\n "value": ""\n }\n ]\n }\n ],\n "help": "This information will help us compile study statistics"\n },\n {\n "title": "Additional information",\n "instruction": "Optional details about you. You can fill out what you are most comfortable with.",\n "rows": [\n {\n "fields": [\n {\n "help": "",\n "id": "id_bio",\n "label": "Biography since age of 18",\n "name": "bio",\n "placeholder": "",\n "tooltip": "Your bio in a few paragraphs",\n "type": "textarea",\n "validators": { "required": false },\n "value": ""\n }\n ]\n },\n {\n "fields": [\n {\n "help": "",\n "id": "id_skills",\n "label": "Technical Skills",\n "name": "skills",\n "options": [\n {\n "checked": false,\n "label": "React",\n "value": "react"\n },\n {\n "checked": true,\n "label": "JavaScript",\n "value": "javascript"\n },\n {\n "checked": false,\n "label": "Python",\n "value": "python"\n },\n {\n "checked": false,\n "label": "SQL",\n "value": "sql"\n }\n ],\n "tooltip": "Technical skills you may possess",\n "type": "checkbox",\n "validators": {\n "required": true,\n "minLength": 2,\n "maxLength": 3\n }\n }\n ]\n },\n {\n "fields": [\n {\n "help": "",\n "id": "id_kids",\n "label": "How many children do you have?",\n "name": "kids",\n "options": [\n {\n "checked": false,\n "label": "None",\n "value": "0"\n },\n {\n "checked": false,\n "label": "One",\n "value": "1"\n },\n {\n "checked": false,\n "label": "Two",\n "value": "2"\n },\n {\n "checked": false,\n "label": "Three or more",\n "value": ">=3"\n }\n ],\n "tooltip": "How many children do you have?",\n "type": "radio",\n "validators": { "required": true }\n }\n ]\n },\n {\n "fields": [\n {\n "help": "",\n "id": "id_avatar",\n "label": "Profile Picture",\n "name": "avatar",\n "placeholder": "Select a file",\n "tooltip": "Your profile photo",\n "type": "file",\n "validators": { "required": true },\n "value": ""\n },\n {\n "help": "",\n "id": "id_resume",\n "label": "Resume",\n "name": "resume",\n "placeholder": "Select a file",\n "tooltip": "Your current resume",\n "type": "file",\n "validators": { "required": false },\n "value": ""\n }\n ]\n }\n ],\n "help": "Some additional details about your persona"\n }\n ]\n },\n {\n "name": "section_second",\n "title": "Second section",\n "instruction": "Example of another section",\n "fieldsets": [\n {\n "title": "Motivation",\n "instruction": "",\n "rows": [\n {\n "fields": [\n {\n "help": "",\n "id": "id_motto",\n "label": "Personal Motto",\n "name": "motto",\n "placeholder": "",\n "tooltip": "Your personal motto",\n "type": "input",\n "validators": { "required": true },\n "value": ""\n }\n ],\n "help": "Please type in your favorite personal motto"\n }\n ]\n }\n ]\n }\n ],\n "submit_button": {\n "text": "Submit",\n "tooltip": "Submit form"\n }\n }\n }\n]\n\n')),(0,r.kt)("p",null,"From this, we know we're loading from ",(0,r.kt)("inlineCode",{parentName:"p"},"task_data.json"),", and that this file only has one listed item.\nMephisto creates an ",(0,r.kt)("inlineCode",{parentName:"p"},"Assignment")," for each of these lines, representing a group of work for which a worker can only contribute to once.\nWe also specify two ",(0,r.kt)("inlineCode",{parentName:"p"},"units_per_assignment"),", meaning that Mephisto creates one ",(0,r.kt)("inlineCode",{parentName:"p"},"Unit"),"s per ",(0,r.kt)("inlineCode",{parentName:"p"},"Assignment"),",\nmeaning in this case that different workers can complete the same job, usually to get inter-annotator agreement.\n(In some cases Mephisto can use an ",(0,r.kt)("inlineCode",{parentName:"p"},"Assignment")," to connect multiple workers each with one ",(0,r.kt)("inlineCode",{parentName:"p"},"Unit")," on a collaborative live task).\nAs we had one assignment, it makes sense that each worker ",(0,r.kt)("inlineCode",{parentName:"p"},"x")," and your second worker could only complete one task each."),(0,r.kt)("h3",{id:"35-server-callbacks"},"3.5 Server Callbacks"),(0,r.kt)("p",null,"To make your Tasks more dynamic and flexible, we have server callbacks or remote procedures how we call them."),(0,r.kt)("p",null,"In two words, remote procedures are server Pythong functions that can be called from the UI via JS in the middle of the Task progress."),(0,r.kt)("p",null,"To start working with them, you need to follow several rules:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Use blueprint ",(0,r.kt)("inlineCode",{parentName:"p"},"remote_procedure"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Use agent state ",(0,r.kt)("inlineCode",{parentName:"p"},"SharedRemoteProcedureTaskState"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Write your own remote procedure(-s) and pass them in the Task intialization into agent state"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-python"},'from mephisto.abstractions.blueprints.remote_procedure.remote_procedure_agent_state import (\n RemoteProcedureAgentState,\n)\nfrom mephisto.abstractions.blueprints.remote_procedure.remote_procedure_blueprint import (\n SharedRemoteProcedureTaskState,\n)\n\n...\n\ndef my_remote_procedure(\n request_id: str,\n args: dict,\n agent_state: RemoteProcedureAgentState,\n):\n # Your logic here\n pass\n \n... \n\ntask_data = ...\nshared_state = SharedRemoteProcedureTaskState(\n static_task_data=task_data,\n function_registry={\n "nameProcedureNameForJs": my_remote_procedure,\n },\n)\n'))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Use ",(0,r.kt)("inlineCode",{parentName:"p"},"useMephistoRemoteProcedureTask")," in yout React-app"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-js"},'const {\n isLoading,\n initialTaskData,\n remoteProcedure,\n handleSubmit,\n handleFatalError,\n} = useMephistoRemoteProcedureTask();\n \nconst nameProcedureNameForJsFn = remoteProcedure("nameProcedureNameForJs");\n \nconst requestArgs = {\n // your args that will be passed into `my_remote_procedure` under `args` argument\n};\nnameProcedureNameForJsFn(requestArgs)\n .then((response) => {\n // Your logic here\n })\n .catch((error) => {\n // JS errors\n });\n')))),(0,r.kt)("p",null,"We recommend to pay attention to our comprehensive ",(0,r.kt)("a",{parentName:"p",href:"/docs/guides/tutorials/model_in_the_loop/"},"example"),",\nwhere we touched all related aspects of remote procedures feature."))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/206abefe.c2ad0aaf.js b/assets/js/206abefe.c2ad0aaf.js new file mode 100644 index 000000000..0d2864222 --- /dev/null +++ b/assets/js/206abefe.c2ad0aaf.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[8122],{4127:function(e,n,t){t.d(n,{Zo:function(){return p},kt:function(){return h}});var a=t(1987);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function i(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var l=a.createContext({}),u=function(e){var n=a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},p=function(e){var n=u(e.components);return a.createElement(l.Provider,{value:n},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},m=a.forwardRef((function(e,n){var t=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),c=u(t),m=o,h=c["".concat(l,".").concat(m)]||c[m]||d[m]||r;return t?a.createElement(h,i(i({ref:n},p),{},{components:t})):a.createElement(h,i({ref:n},p))}));function h(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var r=t.length,i=new Array(r);i[0]=m;var s={};for(var l in n)hasOwnProperty.call(n,l)&&(s[l]=n[l]);s.originalType=e,s[c]="string"==typeof e?e:o,i[1]=s;for(var u=2;uUnit creation explained",id:"34-unit-creation-explained",level:3},{value:"3.5 Server Callbacks",id:"35-server-callbacks",level:3}],d={toc:c};function m(e){var n=e.components,t=(0,o.Z)(e,i);return(0,r.kt)("wrapper",(0,a.Z)({},d,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"how-task-run-works"},"How task run works"),(0,r.kt)("p",null,"Let's understand basic components of the task launch, such as configs and the ",(0,r.kt)("inlineCode",{parentName:"p"},"run_task__local__inhouse.py")," script.\nThis will help with customization of tash launch behaviors."),(0,r.kt)("h3",{id:"31-config-registration"},"3.1 Config registration"),(0,r.kt)("p",null,"Mephisto wires up to configuration using standard Hydra syntax, but with both ",(0,r.kt)("inlineCode",{parentName:"p"},"yaml")," files (for ease of writing) ",(0,r.kt)("em",{parentName:"p"},"and")," structured configs (for ease of documentation).\nHere's the config we've set up for this example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'# examples/form_composer_demo/run_task__local__inhouse.py\nimport os\n\nfrom omegaconf import DictConfig\n\nfrom mephisto.operations.operator import Operator\nfrom mephisto.tools.scripts import build_custom_bundle\nfrom mephisto.tools.scripts import task_script\n\n\n@task_script(default_config_file="example__local__inhouse")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n')),(0,r.kt)("p",null,"This is all you really ",(0,r.kt)("em",{parentName:"p"},"need")," to launch a Mephisto task! The ",(0,r.kt)("inlineCode",{parentName:"p"},"@task_script")," decorator does the job of attaching your hydra yaml as default arguments for the main."),(0,r.kt)("p",null,"Of course, there's quite a bit of 'magic' happening underneath the hood thanks to the script utilities.\nThis version is explicit to show where you may add customization, and re-ordered for understanding:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"# modified examples/form_composer_demo/run_task__local__inhouse.py\nimport os\nfrom dataclasses import dataclass\nfrom typing import Any\n\nfrom omegaconf import DictConfig\n\nfrom mephisto.operations.operator import Operator\nfrom mephisto.operations.hydra_config import build_default_task_config\nfrom mephisto.tools.scripts import build_custom_bundle\nfrom mephisto.tools.scripts import task_script\n\n@dataclass\nclass MyTaskConfig(build_default_task_config('example__local__inhouse')):\n custom_args: Any = 4\n\n@task_script(config=MyTaskConfig)\ndef main(operator: Operator, cfg: DictConfig) -> None:\n")),(0,r.kt)("p",null,"In this snippet, we do a few things:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"We set up the default ",(0,r.kt)("a",{parentName:"li",href:"https://hydra.cc/docs/tutorials/basic/your_first_app/config_file/"},(0,r.kt)("inlineCode",{parentName:"a"},"conf"))," file to be ",(0,r.kt)("inlineCode",{parentName:"li"},"example__local__inhouse"),",\nusing ",(0,r.kt)("inlineCode",{parentName:"li"},"build_default_task_config"),", which returns a ",(0,r.kt)("inlineCode",{parentName:"li"},"TaskConfig")," that we can extend."),(0,r.kt)("li",{parentName:"ol"},"We extend the returned ",(0,r.kt)("inlineCode",{parentName:"li"},"TaskConfig")," with ",(0,r.kt)("inlineCode",{parentName:"li"},"MyTaskConfig"),", which allows us to specify custom arguments."),(0,r.kt)("li",{parentName:"ol"},"We decorate the main, noting that the correct config is ",(0,r.kt)("inlineCode",{parentName:"li"},"MyTaskConfig"),".\nNote that the ",(0,r.kt)("inlineCode",{parentName:"li"},"default_config_file")," version of this simply takes care of the above steps inline in the decorator.")),(0,r.kt)("p",null,"With all the above, we're able to just make edits to ",(0,r.kt)("inlineCode",{parentName:"p"},"example__local__inhouse.yaml")," or make other configs in the ",(0,r.kt)("inlineCode",{parentName:"p"},"conf/")," directory and route to them directly."),(0,r.kt)("h3",{id:"32-invoking-mephisto"},"3.2 Invoking Mephisto"),(0,r.kt)("p",null,"Mephisto itself is actually invoked just a little later:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'@task_script(default_config_file="example__local__inhouse")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n # Build packages\n _build_custom_bundles(cfg)\n\n operator.launch_task_run(cfg.mephisto)\n operator.wait_for_runs_then_shutdown(skip_input=True, log_rate=30)\n')),(0,r.kt)("p",null,"Under the hood the ",(0,r.kt)("inlineCode",{parentName:"p"},"task_script")," decorator extracts specific arguments out of your configuration\n(and surface warnings about incompatibilities) and initializes an ",(0,r.kt)("inlineCode",{parentName:"p"},"Operator")," on the correct ",(0,r.kt)("inlineCode",{parentName:"p"},"MephistoDB")," for the task.\nUsing this we can launch a ",(0,r.kt)("inlineCode",{parentName:"p"},"TaskRun")," the given config, then wait for it to run.\nTo ensure we're not frozen, the operator takes in a ",(0,r.kt)("inlineCode",{parentName:"p"},"log_rate")," in seconds to print status messages while the run is underway."),(0,r.kt)("h3",{id:"33-default-abstraction-usage"},"3.3 Default abstraction usage"),(0,r.kt)("p",null,"Again we can look back at the ",(0,r.kt)("inlineCode",{parentName:"p"},"example_local_mock.yaml")," file to see this setup:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"# examples/form_composer_demo/hydra_configs/conf/example__local__inhouse.yaml\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: inhouse\n")),(0,r.kt)("p",null,"These ensure that, when not provided other arguments, we launch this task locally using a ",(0,r.kt)("inlineCode",{parentName:"p"},"LocalArchitect")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"InhouseProvider"),'.\nWith these defaults, this and other example tasks are run using a "local" architect, and a "inhouse" requester without arguments.\nThe "local" architect is reponsible for running a server on your local machine to host the task,\nand the "inhouse" requester lets ',(0,r.kt)("em",{parentName:"p"},"you")," simulate a worker without using an external crowd-provider platform such as Prolific or MTurk to launch the task."),(0,r.kt)("h3",{id:"34-unit-creation-explained"},"3.4 ",(0,r.kt)("inlineCode",{parentName:"h3"},"Unit")," creation explained"),(0,r.kt)("p",null,"When stepping through this task the first time, you ended up working on two ",(0,r.kt)("inlineCode",{parentName:"p"},"Unit"),"s as two different ",(0,r.kt)("inlineCode",{parentName:"p"},"Worker"),"s.\nIt's useful to understand how this happens.\nTaking a look at the config and data:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"# examples/form_composer_demo/hydra_configs/conf/example__local__inhouse.yaml\n\n#@package _global_\ndefaults:\n...\nmephisto:\n ...\n blueprint:\n data_json: ${task_dir}/data/simple/task_data.json\n ...\n units_per_assignment: 1\n task:\n ...\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-json"},'// examples/form_composer_demo/data/simple/task_data.json\n\n[\n {\n "form": {\n "title": "Form example",\n "instruction": "Please answer all questions to the best of your ability as part of our study.",\n "sections": [\n {\n "name": "section_about",\n "title": "About you",\n "instruction": "Please introduce yourself. We would like to know more about your background, personal information, etc.",\n "fieldsets": [\n {\n "title": "Personal information",\n "instruction": "",\n "rows": [\n {\n "fields": [\n {\n "help": "",\n "id": "id_name_first",\n "label": "First name",\n "name": "name_first",\n "placeholder": "Type first name",\n "tooltip": "Your first name",\n "type": "input",\n "validators": {\n "required": true,\n "minLength": 2,\n "maxLength": 20\n },\n "value": ""\n },\n {\n "help": "Optional",\n "id": "id_name_last",\n "label": "Last name",\n "name": "name_last",\n "placeholder": "Type last name",\n "tooltip": "Your last name",\n "type": "input",\n "validators": { "required": true },\n "value": ""\n }\n ],\n "help": "Please use your legal name"\n },\n {\n "fields": [\n {\n "help": "We may contact you later for additional information",\n "id": "id_email",\n "label": "Email address for Mephisto",\n "name": "email",\n "placeholder": "user@mephisto.ai",\n "tooltip": "Email address for Mephisto",\n "type": "email",\n "validators": {\n "required": true,\n "regexp": ["^[a-zA-Z0-9._-]+@mephisto\\\\.ai$", "ig"]\n },\n "value": ""\n }\n ]\n }\n ]\n },\n {\n "title": "Cultural background",\n "instruction": "Please tell us about your cultural affiliations and values that you use in your daily life.",\n "rows": [\n {\n "fields": [\n {\n "help": "Select country of your residence",\n "id": "id_country",\n "label": "Country",\n "multiple": false,\n "name": "country",\n "options": [\n {\n "label": "---",\n "value": ""\n },\n {\n "label": "United States of America",\n "value": "USA"\n },\n {\n "label": "Canada",\n "value": "CAN"\n }\n ],\n "placeholder": "",\n "tooltip": "Country",\n "type": "select",\n "validators": { "required": true },\n "value": ""\n },\n {\n "help": "Select language spoken in your local community",\n "id": "id_language",\n "label": "Language",\n "multiple": true,\n "name": "language",\n "options": [\n {\n "label": "English",\n "value": "en"\n },\n {\n "label": "French",\n "value": "fr"\n },\n {\n "label": "Spanish",\n "value": "es"\n },\n {\n "label": "Chinese",\n "value": "ch"\n }\n ],\n "placeholder": "",\n "tooltip": "Language",\n "type": "select",\n "validators": {\n "required": true,\n "minLength": 2,\n "maxLength": 3\n },\n "value": ""\n }\n ]\n }\n ],\n "help": "This information will help us compile study statistics"\n },\n {\n "title": "Additional information",\n "instruction": "Optional details about you. You can fill out what you are most comfortable with.",\n "rows": [\n {\n "fields": [\n {\n "help": "",\n "id": "id_bio",\n "label": "Biography since age of 18",\n "name": "bio",\n "placeholder": "",\n "tooltip": "Your bio in a few paragraphs",\n "type": "textarea",\n "validators": { "required": false },\n "value": ""\n }\n ]\n },\n {\n "fields": [\n {\n "help": "",\n "id": "id_skills",\n "label": "Technical Skills",\n "name": "skills",\n "options": [\n {\n "checked": false,\n "label": "React",\n "value": "react"\n },\n {\n "checked": true,\n "label": "JavaScript",\n "value": "javascript"\n },\n {\n "checked": false,\n "label": "Python",\n "value": "python"\n },\n {\n "checked": false,\n "label": "SQL",\n "value": "sql"\n }\n ],\n "tooltip": "Technical skills you may possess",\n "type": "checkbox",\n "validators": {\n "required": true,\n "minLength": 2,\n "maxLength": 3\n }\n }\n ]\n },\n {\n "fields": [\n {\n "help": "",\n "id": "id_kids",\n "label": "How many children do you have?",\n "name": "kids",\n "options": [\n {\n "checked": false,\n "label": "None",\n "value": "0"\n },\n {\n "checked": false,\n "label": "One",\n "value": "1"\n },\n {\n "checked": false,\n "label": "Two",\n "value": "2"\n },\n {\n "checked": false,\n "label": "Three or more",\n "value": ">=3"\n }\n ],\n "tooltip": "How many children do you have?",\n "type": "radio",\n "validators": { "required": true }\n }\n ]\n },\n {\n "fields": [\n {\n "help": "",\n "id": "id_avatar",\n "label": "Profile Picture",\n "name": "avatar",\n "placeholder": "Select a file",\n "tooltip": "Your profile photo",\n "type": "file",\n "validators": { "required": true },\n "value": ""\n },\n {\n "help": "",\n "id": "id_resume",\n "label": "Resume",\n "name": "resume",\n "placeholder": "Select a file",\n "tooltip": "Your current resume",\n "type": "file",\n "validators": { "required": false },\n "value": ""\n }\n ]\n }\n ],\n "help": "Some additional details about your persona"\n }\n ]\n },\n {\n "name": "section_second",\n "title": "Second section",\n "instruction": "Example of another section",\n "fieldsets": [\n {\n "title": "Motivation",\n "instruction": "",\n "rows": [\n {\n "fields": [\n {\n "help": "",\n "id": "id_motto",\n "label": "Personal Motto",\n "name": "motto",\n "placeholder": "",\n "tooltip": "Your personal motto",\n "type": "input",\n "validators": { "required": true },\n "value": ""\n }\n ],\n "help": "Please type in your favorite personal motto"\n }\n ]\n }\n ]\n }\n ],\n "submit_button": {\n "text": "Submit",\n "tooltip": "Submit form"\n }\n }\n }\n]\n\n')),(0,r.kt)("p",null,"From this, we know we're loading from ",(0,r.kt)("inlineCode",{parentName:"p"},"task_data.json"),", and that this file only has one listed item.\nMephisto creates an ",(0,r.kt)("inlineCode",{parentName:"p"},"Assignment")," for each of these lines, representing a group of work for which a worker can only contribute to once.\nWe also specify two ",(0,r.kt)("inlineCode",{parentName:"p"},"units_per_assignment"),", meaning that Mephisto creates one ",(0,r.kt)("inlineCode",{parentName:"p"},"Unit"),"s per ",(0,r.kt)("inlineCode",{parentName:"p"},"Assignment"),",\nmeaning in this case that different workers can complete the same job, usually to get inter-annotator agreement.\n(In some cases Mephisto can use an ",(0,r.kt)("inlineCode",{parentName:"p"},"Assignment")," to connect multiple workers each with one ",(0,r.kt)("inlineCode",{parentName:"p"},"Unit")," on a collaborative live task).\nAs we had one assignment, it makes sense that each worker ",(0,r.kt)("inlineCode",{parentName:"p"},"x")," and your second worker could only complete one task each."),(0,r.kt)("h3",{id:"35-server-callbacks"},"3.5 Server Callbacks"),(0,r.kt)("p",null,"To make your Tasks more dynamic and flexible, we have server callbacks or remote procedures how we call them."),(0,r.kt)("p",null,"In two words, remote procedures are server Pythong functions that can be called from the UI via JS in the middle of the Task progress."),(0,r.kt)("p",null,"To start working with them, you need to follow several rules:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Use blueprint ",(0,r.kt)("inlineCode",{parentName:"p"},"remote_procedure"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Use agent state ",(0,r.kt)("inlineCode",{parentName:"p"},"SharedRemoteProcedureTaskState"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Write your own remote procedure(-s) and pass them in the Task intialization into agent state"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-python"},'from mephisto.abstractions.blueprints.remote_procedure.remote_procedure_agent_state import (\n RemoteProcedureAgentState,\n)\nfrom mephisto.abstractions.blueprints.remote_procedure.remote_procedure_blueprint import (\n SharedRemoteProcedureTaskState,\n)\n\n...\n\ndef my_remote_procedure(\n request_id: str,\n args: dict,\n agent_state: RemoteProcedureAgentState,\n):\n # Your logic here\n pass\n \n... \n\ntask_data = ...\nshared_state = SharedRemoteProcedureTaskState(\n static_task_data=task_data,\n function_registry={\n "nameProcedureNameForJs": my_remote_procedure,\n },\n)\n'))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Use ",(0,r.kt)("inlineCode",{parentName:"p"},"useMephistoRemoteProcedureTask")," in yout React-app"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-js"},'const {\n isLoading,\n initialTaskData,\n remoteProcedure,\n handleSubmit,\n handleFatalError,\n} = useMephistoRemoteProcedureTask();\n \nconst nameProcedureNameForJsFn = remoteProcedure("nameProcedureNameForJs");\n \nconst requestArgs = {\n // your args that will be passed into `my_remote_procedure` under `args` argument\n};\nnameProcedureNameForJsFn(requestArgs)\n .then((response) => {\n // Your logic here\n })\n .catch((error) => {\n // JS errors\n });\n')))),(0,r.kt)("p",null,"We recommend to pay attention to our comprehensive ",(0,r.kt)("a",{parentName:"p",href:"/docs/guides/tutorials/model_in_the_loop/"},"example"),",\nwhere we touched all related aspects of remote procedures feature."))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/26d8019b.441cfec5.js b/assets/js/26d8019b.441cfec5.js new file mode 100644 index 000000000..801457923 --- /dev/null +++ b/assets/js/26d8019b.441cfec5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[1395],{3628:function(e,t,n){n.r(t),n.d(t,{assets:function(){return c},contentTitle:function(){return d},default:function(){return g},frontMatter:function(){return u},metadata:function(){return h},toc:function(){return p}});var o=n(9375),i=n(8933),a=(n(1987),n(4127)),r=n(4093),s=n(2590),l=["components"],u={sidebar_position:3},d="Teach potential workers with Onboarding",h={unversionedId:"guides/how_to_use/worker_quality/using_onboarding",id:"guides/how_to_use/worker_quality/using_onboarding",title:"Teach potential workers with Onboarding",description:"The first step to getting quality data is describing your task properly and ensuring that workers have understood your instructions.",source:"@site/docs/guides/how_to_use/worker_quality/using_onboarding.mdx",sourceDirName:"guides/how_to_use/worker_quality",slug:"/guides/how_to_use/worker_quality/using_onboarding",permalink:"/docs/guides/how_to_use/worker_quality/using_onboarding",draft:!1,editUrl:"https://github.com/facebookresearch/Mephisto/tree/main/docs/web/docs/guides/how_to_use/worker_quality/using_onboarding.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"guides",previous:{title:"Managing worker qualifications",permalink:"/docs/guides/how_to_use/worker_quality/managing_worker_qualifications"},next:{title:"Check worker quality with Screening Units",permalink:"/docs/guides/how_to_use/worker_quality/using_screen_units"}},c={},p=[{value:"Showcase",id:"showcase",level:2},{value:"Things to note in the showcase:",id:"things-to-note-in-the-showcase",level:3},{value:"Basic configuration",id:"basic-configuration",level:2},{value:"See the full code here",id:"see-the-full-code-here",level:3},{value:"See hydra configuration here",id:"see-hydra-configuration-here",level:3},{value:"Simple example of OnboardingComponent",id:"simple-example-of-onboardingcomponent",level:3},{value:"Additional Questions?",id:"additional-questions",level:2}],k={toc:p};function g(e){var t=e.components,n=(0,i.Z)(e,l);return(0,a.kt)("wrapper",(0,o.Z)({},k,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"teach-potential-workers-with-onboarding"},"Teach potential workers with Onboarding"),(0,a.kt)("p",null,"The first step to getting quality data is describing your task properly and ensuring that workers have understood your instructions.\nTo this end, Mephisto provides the ",(0,a.kt)("inlineCode",{parentName:"p"},"OnboardingRequired")," Blueprint mixin."),(0,a.kt)("p",null,"Onboarding is an opportunity to give workers complete context of your task the first time they work on it.\nYou can also use it to provide workers with a simple test to ensure they read and understand task instructions."),(0,a.kt)("p",null,"Mephisto's onboarding disqualifies workers that fail the test,\nso it's good practice to ensure that the tests should be completable by anyone\nwho reads through the instructions and also don't take up too much time."),(0,a.kt)("p",null,"If you're instead interested in filtering out workers who don't hit a specific quality bar,\nrefer to ",(0,a.kt)("a",{parentName:"p",href:"../using_screen_units"},"using screening units"),", as Mephisto doesn't pay out for failed onboarding."),(0,a.kt)("h2",{id:"showcase"},"Showcase"),(0,a.kt)(r.Z,{playing:!0,controls:!0,width:"100%",height:"auto",url:"https://user-images.githubusercontent.com/55665282/183516125-c466fb96-f688-4903-90ea-d48b6cb5c46b.mp4",mdxType:"ReactPlayer"}),(0,a.kt)("h3",{id:"things-to-note-in-the-showcase"},"Things to note in the showcase:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("inlineCode",{parentName:"li"},"static_react_task")," example is ran with the ",(0,a.kt)("inlineCode",{parentName:"li"},"example_with_onboarding__local__inhouse")," configuration enabled to ensure that onboarding page will be shown."),(0,a.kt)("li",{parentName:"ul"},'Worker "x" clicks the "Get Blocked" button and this doesn\'t allow the worker to progress'),(0,a.kt)("li",{parentName:"ul"},'Worker "y" clicks the "Move To Main Task" button and this allows the worker to go to the main task.')),(0,a.kt)("h2",{id:"basic-configuration"},"Basic configuration"),(0,a.kt)("p",null,"There are a few primary configuration parts for using onboarding units:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Hydra args",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.onboarding_qualification"),": A string qualification to mark a worker's onboarding status. Workers without this qualification will be shown the onboarding, and Mephisto will either grant a positive or negative value for this qualification to all workers that complete onboarding. Setting this to ",(0,a.kt)("inlineCode",{parentName:"li"},"None")," disables onboarding."))),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"OnboardingSharedState"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"onboarding_data"),": ",(0,a.kt)("inlineCode",{parentName:"li"},"Dict[str, Any]")," of data you would like to populate the onboarding task's"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"validate_onboarding"),": A function that takes the data returned by your onboarding task's ",(0,a.kt)("inlineCode",{parentName:"li"},"handleSubmit")," and returns a bool for if the worker passed the onboarding.")))),(0,a.kt)("p",null,"A shortened version of the run script for the video above looks like:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-python"},'def handle_onboarding(onboarding_data):\n if onboarding_data["outputs"]["success"] == True:\n return True\n return False\n\n@task_script(default_config_file="example__local__inhouse.yaml")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n ...\n shared_state = SharedStaticTaskState(\n static_task_data=[\n {"text": "This text is good text!"},\n {"text": "This text is bad text!"},\n ],\n validate_onboarding=handle_onboarding,\n )\n ...\n')),(0,a.kt)("h3",{id:"see-the-full-code-here"},"See the full code ",(0,a.kt)("a",{parentName:"h3",href:"https://github.com/facebookresearch/Mephisto/blob/main/examples/static_react_task/run_task__local__inhouse.py"},"here")),(0,a.kt)("h3",{id:"see-hydra-configuration-here"},"See hydra configuration ",(0,a.kt)("a",{parentName:"h3",href:"https://github.com/facebookresearch/Mephisto/blob/main/examples/static_react_task/hydra_configs/conf/example_with_onboarding__local__inhouse.yaml"},"here")),(0,a.kt)("p",null,"Unlike Screening and Gold units, Onboarding expects that you set up a custom frontend compared to your main task.\nYou want to provide workers with an in-depth exploration of your task up-front\n(though you can always re-use onboarding components in your main task as reference materials)."),(0,a.kt)("p",null,"The handleSubmit method of ",(0,a.kt)("inlineCode",{parentName:"p"},"mephisto-core")," is used to send onboarding data from frontend to backend.\nFor more info on how to build out onboarding frontends, check out our ",(0,a.kt)("a",{parentName:"p",href:"../../../tutorials/worker_controls"},"tutorial"),"."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Note:")," We've observed that some workers may share out the answers for onboarding tasks,\nso we encourage that you make your validation questions configurable such that you can update them with a change to ",(0,a.kt)("inlineCode",{parentName:"p"},"onboarding_data"),"."),(0,a.kt)("h3",{id:"simple-example-of-onboardingcomponent"},"Simple example of ",(0,a.kt)("inlineCode",{parentName:"h3"},"OnboardingComponent")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-javascript"},'function OnboardingComponent({ onSubmit }) {\n return (\n
\n \n This component only renders if you have chosen to assign an onboarding\n qualification for your task. Click the button to move on to the main\n task.\n \n \n onSubmit({ success: true })}\n >\n Move to Main Task\n \n onSubmit({ success: false })}\n >\n Get Blocked\n \n
\n \n );\n}\n')),(0,a.kt)("p",null,'To show pretty "blocked user" banner after not passing onboarding, you may need to add a react component in your app as well:'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-javascript"},'if (blockedReason !== null) {\n return (\n
\n
\n

\n {blockedExplanation}\n

\n
\n
\n );\n}\n')),(0,a.kt)("h2",{id:"additional-questions"},"Additional Questions?"),(0,a.kt)("p",null,"You can find more information on using onboarding before your units in the reference documentation for"),(0,a.kt)(s.Z,{target:null,to:"pathname:///python_api/mephisto/abstractions/blueprints/mixins/onboarding_required.html",mdxType:"Link"},"`OnboardingRequired`"),".")}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/26d8019b.d7844292.js b/assets/js/26d8019b.d7844292.js deleted file mode 100644 index 8270046b2..000000000 --- a/assets/js/26d8019b.d7844292.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[1395],{3628:function(e,t,n){n.r(t),n.d(t,{assets:function(){return c},contentTitle:function(){return d},default:function(){return g},frontMatter:function(){return u},metadata:function(){return h},toc:function(){return p}});var o=n(9375),i=n(8933),a=(n(1987),n(4127)),r=n(4093),s=n(2590),l=["components"],u={sidebar_position:3},d="Teach potential workers with Onboarding",h={unversionedId:"guides/how_to_use/worker_quality/using_onboarding",id:"guides/how_to_use/worker_quality/using_onboarding",title:"Teach potential workers with Onboarding",description:"The first step to getting quality data is describing your task properly and ensuring that workers have understood your instructions.",source:"@site/docs/guides/how_to_use/worker_quality/using_onboarding.mdx",sourceDirName:"guides/how_to_use/worker_quality",slug:"/guides/how_to_use/worker_quality/using_onboarding",permalink:"/docs/guides/how_to_use/worker_quality/using_onboarding",draft:!1,editUrl:"https://github.com/facebookresearch/Mephisto/tree/main/docs/web/docs/guides/how_to_use/worker_quality/using_onboarding.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"guides",previous:{title:"Managing worker qualifications",permalink:"/docs/guides/how_to_use/worker_quality/managing_worker_qualifications"},next:{title:"Check worker quality with Screening Units",permalink:"/docs/guides/how_to_use/worker_quality/using_screen_units"}},c={},p=[{value:"Showcase",id:"showcase",level:2},{value:"Things to note in the showcase:",id:"things-to-note-in-the-showcase",level:3},{value:"Basic configuration",id:"basic-configuration",level:2},{value:"See the full code here",id:"see-the-full-code-here",level:3},{value:"See hydra configuration here",id:"see-hydra-configuration-here",level:3},{value:"Simple example of OnboardingComponent",id:"simple-example-of-onboardingcomponent",level:3},{value:"Additional Questions?",id:"additional-questions",level:2}],k={toc:p};function g(e){var t=e.components,n=(0,i.Z)(e,l);return(0,a.kt)("wrapper",(0,o.Z)({},k,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"teach-potential-workers-with-onboarding"},"Teach potential workers with Onboarding"),(0,a.kt)("p",null,"The first step to getting quality data is describing your task properly and ensuring that workers have understood your instructions.\nTo this end, Mephisto provides the ",(0,a.kt)("inlineCode",{parentName:"p"},"OnboardingRequired")," Blueprint mixin."),(0,a.kt)("p",null,"Onboarding is an opportunity to give workers complete context of your task the first time they work on it.\nYou can also use it to provide workers with a simple test to ensure they read and understand task instructions."),(0,a.kt)("p",null,"Mephisto's onboarding disqualifies workers that fail the test,\nso it's good practice to ensure that the tests should be completable by anyone\nwho reads through the instructions and also don't take up too much time."),(0,a.kt)("p",null,"If you're instead interested in filtering out workers who don't hit a specific quality bar,\nrefer to ",(0,a.kt)("a",{parentName:"p",href:"../using_screen_units"},"using screening units"),", as Mephisto doesn't pay out for failed onboarding."),(0,a.kt)("h2",{id:"showcase"},"Showcase"),(0,a.kt)(r.Z,{playing:!0,controls:!0,width:"100%",height:"auto",url:"https://user-images.githubusercontent.com/55665282/183516125-c466fb96-f688-4903-90ea-d48b6cb5c46b.mp4",mdxType:"ReactPlayer"}),(0,a.kt)("h3",{id:"things-to-note-in-the-showcase"},"Things to note in the showcase:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"The ",(0,a.kt)("inlineCode",{parentName:"li"},"static_react_task")," example is ran with the ",(0,a.kt)("inlineCode",{parentName:"li"},"onboarding_example")," configuration enabled to ensure that onboarding page will be shown."),(0,a.kt)("li",{parentName:"ul"},'Worker "x" clicks the "Get Blocked" button and this doesn\'t allow the worker to progress'),(0,a.kt)("li",{parentName:"ul"},'Worker "y" clicks the "Move To Main Task" button and this allows the worker to go to the main task.')),(0,a.kt)("h2",{id:"basic-configuration"},"Basic configuration"),(0,a.kt)("p",null,"There are a few primary configuration parts for using onboarding units:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Hydra args",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.onboarding_qualification"),": A string qualification to mark a worker's onboarding status. Workers without this qualification will be shown the onboarding, and Mephisto will either grant a positive or negative value for this qualification to all workers that complete onboarding. Setting this to ",(0,a.kt)("inlineCode",{parentName:"li"},"None")," disables onboarding."))),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"OnboardingSharedState"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"onboarding_data"),": ",(0,a.kt)("inlineCode",{parentName:"li"},"Dict[str, Any]")," of data you would like to populate the onboarding task's"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"validate_onboarding"),": A function that takes the data returned by your onboarding task's ",(0,a.kt)("inlineCode",{parentName:"li"},"handleSubmit")," and returns a bool for if the worker passed the onboarding.")))),(0,a.kt)("p",null,"A shortened version of the run script for the video above looks like:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-python"},'def handle_onboarding(onboarding_data):\n if onboarding_data["outputs"]["success"] == True:\n return True\n return False\n\n@task_script(default_config_file="example.yaml")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n ...\n shared_state = SharedStaticTaskState(\n static_task_data=[\n {"text": "This text is good text!"},\n {"text": "This text is bad text!"},\n ],\n validate_onboarding=handle_onboarding,\n )\n ...\n')),(0,a.kt)("h3",{id:"see-the-full-code-here"},"See the full code ",(0,a.kt)("a",{parentName:"h3",href:"https://github.com/facebookresearch/Mephisto/blob/main/examples/static_react_task/run_task.py"},"here")),(0,a.kt)("h3",{id:"see-hydra-configuration-here"},"See hydra configuration ",(0,a.kt)("a",{parentName:"h3",href:"https://github.com/facebookresearch/Mephisto/blob/main/examples/static_react_task/hydra_configs/conf/onboarding_example.yaml"},"here")),(0,a.kt)("p",null,"Unlike Screening and Gold units, Onboarding expects that you set up a custom frontend compared to your main task.\nYou want to provide workers with an in-depth exploration of your task up-front\n(though you can always re-use onboarding components in your main task as reference materials)."),(0,a.kt)("p",null,"The handleSubmit method of ",(0,a.kt)("inlineCode",{parentName:"p"},"mephisto-core")," is used to send onboarding data from frontend to backend.\nFor more info on how to build out onboarding frontends, check out our ",(0,a.kt)("a",{parentName:"p",href:"../../../tutorials/worker_controls"},"tutorial"),"."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Note:")," We've observed that some workers may share out the answers for onboarding tasks,\nso we encourage that you make your validation questions configurable such that you can update them with a change to ",(0,a.kt)("inlineCode",{parentName:"p"},"onboarding_data"),"."),(0,a.kt)("h3",{id:"simple-example-of-onboardingcomponent"},"Simple example of ",(0,a.kt)("inlineCode",{parentName:"h3"},"OnboardingComponent")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-javascript"},'function OnboardingComponent({ onSubmit }) {\n return (\n
\n \n This component only renders if you have chosen to assign an onboarding\n qualification for your task. Click the button to move on to the main\n task.\n \n \n onSubmit({ success: true })}\n >\n Move to Main Task\n \n onSubmit({ success: false })}\n >\n Get Blocked\n \n
\n \n );\n}\n')),(0,a.kt)("p",null,'To show pretty "blocked user" banner after not passing onboarding, you may need to add a react component in your app as well:'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-javascript"},'if (blockedReason !== null) {\n return (\n
\n
\n

\n {blockedExplanation}\n

\n
\n
\n );\n}\n')),(0,a.kt)("h2",{id:"additional-questions"},"Additional Questions?"),(0,a.kt)("p",null,"You can find more information on using onboarding before your units in the reference documentation for"),(0,a.kt)(s.Z,{target:null,to:"pathname:///python_api/mephisto/abstractions/blueprints/mixins/onboarding_required.html",mdxType:"Link"},"`OnboardingRequired`"),".")}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/34c96258.ae17eb03.js b/assets/js/34c96258.ae17eb03.js deleted file mode 100644 index 0c6271908..000000000 --- a/assets/js/34c96258.ae17eb03.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[8876],{4127:function(e,t,i){i.d(t,{Zo:function(){return p},kt:function(){return v}});var s=i(1987);function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function r(e){for(var t=1;t=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var l=s.createContext({}),u=function(e){var t=s.useContext(l),i=t;return e&&(i="function"==typeof e?e(t):r(r({},t),e)),i},p=function(e){var t=u(e.components);return s.createElement(l.Provider,{value:t},e.children)},c="mdxType",k={inlineCode:"code",wrapper:function(e){var t=e.children;return s.createElement(s.Fragment,{},t)}},d=s.forwardRef((function(e,t){var i=e.components,a=e.mdxType,n=e.originalType,l=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=u(i),d=a,v=c["".concat(l,".").concat(d)]||c[d]||k[d]||n;return i?s.createElement(v,r(r({ref:t},p),{},{components:i})):s.createElement(v,r({ref:t},p))}));function v(e,t){var i=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var n=i.length,r=new Array(n);r[0]=d;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o[c]="string"==typeof e?e:a,r[1]=o;for(var u=2;u=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var l=s.createContext({}),u=function(e){var t=s.useContext(l),i=t;return e&&(i="function"==typeof e?e(t):r(r({},t),e)),i},p=function(e){var t=u(e.components);return s.createElement(l.Provider,{value:t},e.children)},c="mdxType",k={inlineCode:"code",wrapper:function(e){var t=e.children;return s.createElement(s.Fragment,{},t)}},d=s.forwardRef((function(e,t){var i=e.components,a=e.mdxType,n=e.originalType,l=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=u(i),d=a,v=c["".concat(l,".").concat(d)]||c[d]||k[d]||n;return i?s.createElement(v,r(r({ref:t},p),{},{components:i})):s.createElement(v,r({ref:t},p))}));function v(e,t){var i=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var n=i.length,r=new Array(n);r[0]=d;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o[c]="string"==typeof e?e:a,r[1]=o;for(var u=2;u=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var l=a.createContext({}),u=function(t){var e=a.useContext(l),n=e;return t&&(n="function"==typeof t?t(e):r(r({},e),t)),n},c=function(t){var e=u(t.components);return a.createElement(l.Provider,{value:e},t.children)},p="mdxType",d={inlineCode:"code",wrapper:function(t){var e=t.children;return a.createElement(a.Fragment,{},e)}},f=a.forwardRef((function(t,e){var n=t.components,o=t.mdxType,i=t.originalType,l=t.parentName,c=s(t,["components","mdxType","originalType","parentName"]),p=u(n),f=o,m=p["".concat(l,".").concat(f)]||p[f]||d[f]||i;return n?a.createElement(m,r(r({ref:e},c),{},{components:n})):a.createElement(m,r({ref:e},c))}));function m(t,e){var n=arguments,o=e&&e.mdxType;if("string"==typeof t||o){var i=n.length,r=new Array(i);r[0]=f;var s={};for(var l in e)hasOwnProperty.call(e,l)&&(s[l]=e[l]);s.originalType=t,s[p]="string"==typeof t?t:o,r[1]=s;for(var u=2;utask_name",id:"proper-use-of-task_name",level:2},{value:"Multi-purpose run scripts",id:"multi-purpose-run-scripts",level:2}],d={toc:p};function f(t){var e=t.components,n=(0,o.Z)(t,r);return(0,i.kt)("wrapper",(0,a.Z)({},d,n,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"developing-a-workflow"},"Developing a workflow"),(0,i.kt)("p",null,"While it's nice to imagine that you'll be able to collect quality data on the first pass, crowdsourcing can be a bit more trial-and-error. This guide focuses on setting up a good workflow, and extending your run-script to support additional functionality. "),(0,i.kt)("p",null,"This tutorial is pretty loose at the moment, as many of these practices are ",(0,i.kt)("em",{parentName:"p"},"about")," clever Mephisto usage rather than specific features that are codified yet. We aim to be flexible, and while these workflows have worked for us we expect many to adapt from and expand on them."),(0,i.kt)("h2",{id:"proper-use-of-task_name"},"Proper use of ",(0,i.kt)("inlineCode",{parentName:"h2"},"task_name")),(0,i.kt)("p",null,"It's generally advisable to use different ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name"),"s for every iteration you do on a task, generally moving from ",(0,i.kt)("inlineCode",{parentName:"p"},"testing")," through ",(0,i.kt)("inlineCode",{parentName:"p"},"pilots")," to deploys. Mephisto does not prescribe a specific method for what you must do, but you may find this framework a good starting point."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"# for local use while testing and debugging\nmy-cool-task-local-testing\n# For rounds of pilots\nmy-cool-task-pilot-1\nmy-cool-task-pilot-2\n...\n# For actual launches\nmy-cool-task-live-batch-1\nmy-cool-task-live-batch-2\n...\n")),(0,i.kt)("p",null,"Generally it's best to put the ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," ",(0,i.kt)("em",{parentName:"p"},"into")," your Hydra ",(0,i.kt)("inlineCode",{parentName:"p"},".yaml")," config and create different configs for different purposes. For instance:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},"# local_testing.yaml\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: mock\nmephisto:\n blueprint:\n ...\n onboarding_qualification: my-task-onboarding-qualification-sandbox\n task:\n task_name: my-task-local-testing\n ...\nnum_tasks: 2\n\n# live_batch_1.yaml\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: heroku\n - /mephisto/provider: mturk\nmephisto:\n blueprint:\n ...\n onboarding_qualification: my-task-onboarding-qualification\n task:\n task_name: react-static-task-example\n ...\n max_num_concurrent_units: 100\nnum_tasks: 2000\n")),(0,i.kt)("p",null,"This also means you can go back and find the configuration details for a specific task run that you launched."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Note:")," The ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto.task.maximum_units_per_worker")," argument is tied specifically to tasks sharing the same ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name"),", so if you want to limit the number of times a worker can do a task in this way you'll have to use the same ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," for all tasks you want to instill the limit on."),(0,i.kt)("h2",{id:"multi-purpose-run-scripts"},"Multi-purpose run scripts"),(0,i.kt)("p",null,"For complex tasks with many configuration arguments, we make it possible to add arguments to your run script to simplify your workflows and allow for code reuse. For instance, say you had the following script:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'# examples/static_react_task/run_task.py\nfrom mephisto.operations.operator import Operator\nfrom mephisto.tools.scripts import task_script, build_and_return_custom_bundle\nfrom mephisto.abstractions.blueprints.abstract.static_task.static_blueprint import (\n SharedStaticTaskState,\n)\n\nfrom omegaconf import DictConfig\n\n\n@task_script(default_config_file="example")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n def onboarding_always_valid(onboarding_data):\n return True\n\n shared_state = SharedStaticTaskState(\n static_task_data=[\n {"text": "This text is good text!"},\n {"text": "This text is bad text!"},\n ],\n validate_onboarding=onboarding_always_valid,\n )\n\n task_dir = cfg.task_dir\n build_and_return_custom_bundle(task_dir)\n\n operator.launch_task_run(cfg.mephisto, shared_state)\n operator.wait_for_runs_then_shutdown(skip_input=True, log_rate=30)\n\n\nif __name__ == "__main__":\n main()\n')),(0,i.kt)("p",null,"And you collected some initial pilot data, reviewed, and chose some specific high-quality workers to assign an ",(0,i.kt)("a",{parentName:"p",href:"../../how_to_use/worker_quality/common_qualification_flows#allowlists-and-blocklists"},"allowlist qualification")," to."),(0,i.kt)("p",null,"Now sometimes you want to launch with that allowlist, while othertimes you want to specifically look for new workers to add to your allowlist. Rather than require two separate scripts, you may create something like the following:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'from mephisto.data_model.qualification import QUAL_NOT_EXIST, QUAL_EXISTS\nfrom mephisto.utils.qualifications import make_qualification_dict\nfrom mephisto.operations.operator import Operator\nfrom mephisto.tools.scripts import task_script\nfrom mephisto.operations.hydra_config import build_default_task_config\nfrom mephisto.abstractions.blueprints.abstract.static_task.static_blueprint import (\n SharedStaticTaskState,\n)\n\nfrom omegaconf import DictConfig\nfrom dataclasses import dataclass\n\n\n@dataclass\nclass MyTaskConfig(build_default_task_config("onboarding_example")): # type: ignore\n am_qualifiying_new_workers: str = False\n allowlist_qualification: str = \'my-allowlist-qual\'\n\n\n@task_script(config=MyTaskConfig)\ndef main(operator: Operator, cfg: DictConfig) -> None:\n correct_config_answer = cfg.correct_answer\n\n def onboarding_is_valid(onboarding_data):\n inputs = onboarding_data["inputs"]\n outputs = onboarding_data["outputs"]\n return outputs.get("answer") == correct_config_answer\n\n\n if cfg.am_qualifiying_new_workers:\n use_qualifications = [\n make_qualification_dict(\n cfg.allowlist_qualification,\n QUAL_NOT_EXIST,\n None,\n ),\n ]\n else:\n use_qualifications = [\n make_qualification_dict(\n cfg.allowlist_qualification,\n QUAL_EXISTS,\n None,\n ),\n ]\n\n shared_state = SharedStaticTaskState(\n onboarding_data={"correct_answer": correct_config_answer},\n validate_onboarding=onboarding_is_valid,\n qualifications=use_qualifications\n )\n\n if cfg.am_qualifiying_new_workers:\n shared_state.mturk_specific_qualifications = [\n # MTurk-specific quality control qualifications\n ]\n\n operator.launch_task_run(cfg.mephisto, shared_state)\n operator.wait_for_runs_then_shutdown(skip_input=True, log_rate=30)\n\n\nif __name__ == "__main__":\n main()\n\n')),(0,i.kt)("p",null,"Now you can launch the same tasks in the two different contexts, adding workers to the pool when you want to extend the workers who are qualified, and using the allowlist when you just want to collect."))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[6731],{4127:function(t,e,n){n.d(e,{Zo:function(){return c},kt:function(){return m}});var a=n(1987);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function r(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var l=a.createContext({}),u=function(t){var e=a.useContext(l),n=e;return t&&(n="function"==typeof t?t(e):r(r({},e),t)),n},c=function(t){var e=u(t.components);return a.createElement(l.Provider,{value:e},t.children)},p="mdxType",d={inlineCode:"code",wrapper:function(t){var e=t.children;return a.createElement(a.Fragment,{},e)}},f=a.forwardRef((function(t,e){var n=t.components,o=t.mdxType,i=t.originalType,l=t.parentName,c=s(t,["components","mdxType","originalType","parentName"]),p=u(n),f=o,m=p["".concat(l,".").concat(f)]||p[f]||d[f]||i;return n?a.createElement(m,r(r({ref:e},c),{},{components:n})):a.createElement(m,r({ref:e},c))}));function m(t,e){var n=arguments,o=e&&e.mdxType;if("string"==typeof t||o){var i=n.length,r=new Array(i);r[0]=f;var s={};for(var l in e)hasOwnProperty.call(e,l)&&(s[l]=e[l]);s.originalType=t,s[p]="string"==typeof t?t:o,r[1]=s;for(var u=2;utask_name",id:"proper-use-of-task_name",level:2},{value:"Multi-purpose run scripts",id:"multi-purpose-run-scripts",level:2}],d={toc:p};function f(t){var e=t.components,n=(0,o.Z)(t,r);return(0,i.kt)("wrapper",(0,a.Z)({},d,n,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"developing-a-workflow"},"Developing a workflow"),(0,i.kt)("p",null,"While it's nice to imagine that you'll be able to collect quality data on the first pass, crowdsourcing can be a bit more trial-and-error. This guide focuses on setting up a good workflow, and extending your run-script to support additional functionality. "),(0,i.kt)("p",null,"This tutorial is pretty loose at the moment, as many of these practices are ",(0,i.kt)("em",{parentName:"p"},"about")," clever Mephisto usage rather than specific features that are codified yet. We aim to be flexible, and while these workflows have worked for us we expect many to adapt from and expand on them."),(0,i.kt)("h2",{id:"proper-use-of-task_name"},"Proper use of ",(0,i.kt)("inlineCode",{parentName:"h2"},"task_name")),(0,i.kt)("p",null,"It's generally advisable to use different ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name"),"s for every iteration you do on a task, generally moving from ",(0,i.kt)("inlineCode",{parentName:"p"},"testing")," through ",(0,i.kt)("inlineCode",{parentName:"p"},"pilots")," to deploys. Mephisto does not prescribe a specific method for what you must do, but you may find this framework a good starting point."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"# for local use while testing and debugging\nmy-cool-task-local-testing\n# For rounds of pilots\nmy-cool-task-pilot-1\nmy-cool-task-pilot-2\n...\n# For actual launches\nmy-cool-task-live-batch-1\nmy-cool-task-live-batch-2\n...\n")),(0,i.kt)("p",null,"Generally it's best to put the ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," ",(0,i.kt)("em",{parentName:"p"},"into")," your Hydra ",(0,i.kt)("inlineCode",{parentName:"p"},".yaml")," config and create different configs for different purposes. For instance:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},"# local_testing.yaml\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: inhouse\nmephisto:\n blueprint:\n ...\n onboarding_qualification: my-task-onboarding-qualification-sandbox\n task:\n task_name: my-task-local-testing\n ...\nnum_tasks: 2\n\n# live_batch_1.yaml\n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: heroku\n - /mephisto/provider: mturk\nmephisto:\n blueprint:\n ...\n onboarding_qualification: my-task-onboarding-qualification\n task:\n task_name: react-static-task-example\n ...\n max_num_concurrent_units: 100\nnum_tasks: 2000\n")),(0,i.kt)("p",null,"This also means you can go back and find the configuration details for a specific task run that you launched."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Note:")," The ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto.task.maximum_units_per_worker")," argument is tied specifically to tasks sharing the same ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name"),", so if you want to limit the number of times a worker can do a task in this way you'll have to use the same ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," for all tasks you want to instill the limit on."),(0,i.kt)("h2",{id:"multi-purpose-run-scripts"},"Multi-purpose run scripts"),(0,i.kt)("p",null,"For complex tasks with many configuration arguments, we make it possible to add arguments to your run script to simplify your workflows and allow for code reuse. For instance, say you had the following script:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'# examples/static_react_task/run_task__local__inhouse.py\nfrom mephisto.operations.operator import Operator\nfrom mephisto.tools.scripts import task_script, build_and_return_custom_bundle\nfrom mephisto.abstractions.blueprints.abstract.static_task.static_blueprint import (\n SharedStaticTaskState,\n)\n\nfrom omegaconf import DictConfig\n\n\n@task_script(default_config_file="example__local__inhouse")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n def onboarding_always_valid(onboarding_data):\n return True\n\n shared_state = SharedStaticTaskState(\n static_task_data=[\n {"text": "This text is good text!"},\n {"text": "This text is bad text!"},\n ],\n validate_onboarding=onboarding_always_valid,\n )\n\n task_dir = cfg.task_dir\n build_and_return_custom_bundle(task_dir)\n\n operator.launch_task_run(cfg.mephisto, shared_state)\n operator.wait_for_runs_then_shutdown(skip_input=True, log_rate=30)\n\n\nif __name__ == "__main__":\n main()\n')),(0,i.kt)("p",null,"And you collected some initial pilot data, reviewed, and chose some specific high-quality workers to assign an ",(0,i.kt)("a",{parentName:"p",href:"../../how_to_use/worker_quality/common_qualification_flows#allowlists-and-blocklists"},"allowlist qualification")," to."),(0,i.kt)("p",null,"Now sometimes you want to launch with that allowlist, while othertimes you want to specifically look for new workers to add to your allowlist. Rather than require two separate scripts, you may create something like the following:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'from mephisto.data_model.qualification import QUAL_NOT_EXIST, QUAL_EXISTS\nfrom mephisto.utils.qualifications import make_qualification_dict\nfrom mephisto.operations.operator import Operator\nfrom mephisto.tools.scripts import task_script\nfrom mephisto.operations.hydra_config import build_default_task_config\nfrom mephisto.abstractions.blueprints.abstract.static_task.static_blueprint import (\n SharedStaticTaskState,\n)\n\nfrom omegaconf import DictConfig\nfrom dataclasses import dataclass\n\n\n@dataclass\nclass MyTaskConfig(build_default_task_config("onboarding_example")): # type: ignore\n am_qualifiying_new_workers: str = False\n allowlist_qualification: str = \'my-allowlist-qual\'\n\n\n@task_script(config=MyTaskConfig)\ndef main(operator: Operator, cfg: DictConfig) -> None:\n correct_config_answer = cfg.correct_answer\n\n def onboarding_is_valid(onboarding_data):\n inputs = onboarding_data["inputs"]\n outputs = onboarding_data["outputs"]\n return outputs.get("answer") == correct_config_answer\n\n\n if cfg.am_qualifiying_new_workers:\n use_qualifications = [\n make_qualification_dict(\n cfg.allowlist_qualification,\n QUAL_NOT_EXIST,\n None,\n ),\n ]\n else:\n use_qualifications = [\n make_qualification_dict(\n cfg.allowlist_qualification,\n QUAL_EXISTS,\n None,\n ),\n ]\n\n shared_state = SharedStaticTaskState(\n onboarding_data={"correct_answer": correct_config_answer},\n validate_onboarding=onboarding_is_valid,\n qualifications=use_qualifications\n )\n\n if cfg.am_qualifiying_new_workers:\n shared_state.mturk_specific_qualifications = [\n # MTurk-specific quality control qualifications\n ]\n\n operator.launch_task_run(cfg.mephisto, shared_state)\n operator.wait_for_runs_then_shutdown(skip_input=True, log_rate=30)\n\n\nif __name__ == "__main__":\n main()\n\n')),(0,i.kt)("p",null,"Now you can launch the same tasks in the two different contexts, adding workers to the pool when you want to extend the workers who are qualified, and using the allowlist when you just want to collect."))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/4d8b778b.12cfd0f7.js b/assets/js/4d8b778b.12cfd0f7.js deleted file mode 100644 index c8cfb6218..000000000 --- a/assets/js/4d8b778b.12cfd0f7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[8374],{4127:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return m}});var a=n(1987);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),d=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},u=function(e){var t=d(e.components);return a.createElement(l.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=d(n),h=o,m=p["".concat(l,".").concat(h)]||p[h]||c[h]||i;return n?a.createElement(m,r(r({ref:t},u),{},{components:n})):a.createElement(m,r({ref:t},u))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=h;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:o,r[1]=s;for(var d=2;dSharedTaskState object and static_task_data attribute",id:"21-the-sharedtaskstate-object-and-static_task_data-attribute",level:3},{value:"2.2 Editing static_task_data",id:"22-editing-static_task_data",level:3},{value:"3. Accessing the new data",id:"3-accessing-the-new-data",level:2},{value:"3.1 Using React Dev Tools",id:"31-using-react-dev-tools",level:3},{value:"3.2 A prop-flow exercise for React newcomers",id:"32-a-prop-flow-exercise-for-react-newcomers",level:3},{value:"3.3 Making a component to render the new data",id:"33-making-a-component-to-render-the-new-data",level:3},{value:"3.4 Adding a component to respond with new data",id:"34-adding-a-component-to-respond-with-new-data",level:3},{value:"4. Setting up a review",id:"4-setting-up-a-review",level:2},{value:"4.1 Examining the raw data",id:"41-examining-the-raw-data",level:3},{value:"4.2 Using a web-based review flow",id:"42-using-a-web-based-review-flow",level:3},{value:"4.3 Customizing the web-based review flow",id:"43-customizing-the-web-based-review-flow",level:3}],c={toc:p};function h(e){var t=e.components,s=(0,o.Z)(e,r);return(0,i.kt)("wrapper",(0,a.Z)({},c,s,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"working-on-a-custom-task"},"Working on a custom task"),(0,i.kt)("p",null,"Now that you've ",(0,i.kt)("a",{parentName:"p",href:"../first_task"},"launched a task or two"),", it's time to get into building your own. This tutorial focuses on giving you the tools to collect the specific data you're looking for by building a task of your own. This tutorial itself won't produce a useful task, but it should be useful for understanding how to go about creating a real one. You don't ",(0,i.kt)("em",{parentName:"p"},"need")," any React experience to get through this guide, though it will be helpful for understanding the usage more deeply."),(0,i.kt)("h2",{id:"1-getting-started"},"1. Getting started"),(0,i.kt)("h3",{id:"11-making-a-new-workspace"},"1.1 Making a new workspace"),(0,i.kt)("p",null,"We'll extend from the static react task example, but we'll want to move it to it's own workspace. From within the main Mephisto directory:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cp -r examples/static_react_task/ tmp/static_tutorial/\ncd tmp/static_tutorial/\n")),(0,i.kt)("p",null,"Now that we're here, we should also set up your config file"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},'# hydra_configs/conf/example.yaml \n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: mock\nmephisto:\n blueprint:\n task_source: ${task_dir}/webapp/build/bundle.js\n link_task_source: false\n extra_source_dir: ${task_dir}/webapp/src/static\n units_per_assignment: 1\n task:\n task_name: custom-react-tutorial # Remember to set an appropriate task_name!\n task_title: "Rating a sentence as good or bad"\n task_description: "In this task, you\'ll be given a sentence. It is your job to rate it as either good or bad."\n task_reward: 0.05\n task_tags: "test,simple,button"\n')),(0,i.kt)("p",null,"It is important to give a new ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," as we are creating a custom task. For local development ",(0,i.kt)("strong",{parentName:"p"},"only")," it also makes sense to set ",(0,i.kt)("inlineCode",{parentName:"p"},"link_task_source")," to true. This allows changes to propagate to your localhost server when you reload the page (otherwise you would have to shutdown and restart the server to see changes). "),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"task_source")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"extra_source_dir")," arguments are also of importance, as this is where the ",(0,i.kt)("inlineCode",{parentName:"p"},"StaticReactBlueprint")," class will be looking for the compiled React app's Javascript bundle as well as a folder for extra static resources for the page, respectively."),(0,i.kt)("h3",{id:"12-launching-the-task"},"1.2 Launching the task"),(0,i.kt)("p",null,"From the current directory, you should be able to execute the run script and get a job working. We're using a different ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," to prevent polluting our later task with data that won't share the same format. It is a good practice to do this with initial iterations, and to change the ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," any time you change input or output arguments."),(0,i.kt)("p",null,"You can update the ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"link_task_source")," values in your config and run the task like below"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"python run_task.py\n")),(0,i.kt)("p",null,"or you can set them when you run the task:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"python run_task.py mephisto.task.task_name=custom-react-tutorial-iterating mephisto.blueprint.link_task_source=true\n")),(0,i.kt)("p",null,"This will launch a simple task where an annotator is supposed to note a sentence as being good or bad. Clicking a button auto-submits the task. In the next sections we'll add other content. "),(0,i.kt)("p",null,"To establish a link where your changes will be propagated to the localhost server(when you reload), create a separate terminal window and run"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cd webapp && npm run dev:watch\n")),(0,i.kt)("p",null,"Moving forward, we'll update this task so that workers are able to edit the text as well as rate the original sentence."),(0,i.kt)("h2",{id:"2-providing-new-data-to-the-task"},"2. Providing new data to the task"),(0,i.kt)("h3",{id:"21-the-sharedtaskstate-object-and-static_task_data-attribute"},"2.1 The ",(0,i.kt)("inlineCode",{parentName:"h3"},"SharedTaskState")," object and ",(0,i.kt)("inlineCode",{parentName:"h3"},"static_task_data")," attribute"),(0,i.kt)("p",null,"We'll begin by modifying the ",(0,i.kt)("inlineCode",{parentName:"p"},"SharedStaticTaskState"),"'s ",(0,i.kt)("inlineCode",{parentName:"p"},"static_task_data")," attribute. For info on this attribute, recall ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto wut"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ mephisto wut blueprint=static_react_task static_task_data\n\n\n Tasks launched from static blueprints need\n a prebuilt javascript bundle containing the task. We suggest building\n with our provided useMephistoTask hook.\n \n\n\nAdditional SharedTaskState args from SharedStaticTaskState, which may be configured in your run script\n \n Additional Shared TaskState args \n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 dest \u2502 type \u2502 default \u2502 help \u2502 choices \u2502 required \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 static_task_data \u2502 Iterable[Dict] \u2502 [] \u2502 List or generator that \u2502 None \u2502 False \u2502\n\u2502 \u2502 \u2502 \u2502 returns dicts of task \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 data. Generators can \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 be used for tasks with \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 lengths that aren't \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 known at the start of \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 a run, or are \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 otherwise determined \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 during the run. \u2502 \u2502 \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n")),(0,i.kt)("p",null,"This field replaces using the ",(0,i.kt)("inlineCode",{parentName:"p"},"csv_file")," used in the previous tutorial, allowing our run script to specify data directly. React tasks can be run off of ",(0,i.kt)("inlineCode",{parentName:"p"},".csv")," files as well, if you'd prefer."),(0,i.kt)("p",null,"At the moment, the data we're providing is as follows:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'shared_state = SharedStaticTaskState(\n static_task_data=[\n {"text": "This text is good text!"},\n {"text": "This text is bad text!"},\n ],\n ...\n)\n')),(0,i.kt)("p",null,"This corresponds to two ",(0,i.kt)("inlineCode",{parentName:"p"},"Assignment"),"s, each with an entry for ",(0,i.kt)("inlineCode",{parentName:"p"},"text"),". Altering these will change the text that is present, while adding new entries to the array will lead to Mephisto generating more ",(0,i.kt)("inlineCode",{parentName:"p"},"Assignment"),"s. "),(0,i.kt)("h3",{id:"22-editing-static_task_data"},"2.2 Editing ",(0,i.kt)("inlineCode",{parentName:"h3"},"static_task_data")),(0,i.kt)("p",null,"For now let's just edit the data and add a new field. Update the ",(0,i.kt)("inlineCode",{parentName:"p"},"static_task_data")," to look like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'static_task_data=[\n {"text": "This text is good text! Now it is extra good", "edited_by_requester": True},\n {"text": "This text is bad text!", "edited_by_requester": False},\n],\n')),(0,i.kt)("p",null,"At this point you can run the task again."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"python run_task.py mephisto.task.task_name=custom-react-tutorial-iterating\n")),(0,i.kt)("p",null,"Note the first one you work on displays your new edited text. But what about the new ",(0,i.kt)("inlineCode",{parentName:"p"},"edited_by_requester")," field?"),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Tip:")," In your own tasks, you can use a function that creates static task data, or even a generator for it, but this is discussed more in the ",(0,i.kt)("a",{parentName:"p",href:"../workflows"},"workflows")," tutorial.")),(0,i.kt)("h2",{id:"3-accessing-the-new-data"},"3. Accessing the new data"),(0,i.kt)("h3",{id:"31-using-react-dev-tools"},"3.1 Using React Dev Tools"),(0,i.kt)("p",null,"Generally, developing with React is easiest if you have the React Dev Tools extension in your browser. It's currently available in ",(0,i.kt)("a",{parentName:"p",href:"https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi"},"Chrome")," and ",(0,i.kt)("a",{parentName:"p",href:"https://addons.mozilla.org/en-US/firefox/addon/react-devtools/"},"Firefox"),". With this you can peer into the react state and see what's inside:\n",(0,i.kt)("img",{src:n(706).Z,width:"1630",height:"523"}),"\nHere on the right you can see the ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"edited_by_requester")," fields accessible in ",(0,i.kt)("inlineCode",{parentName:"p"},"taskData"),". Now that we know it's there, we can do something with it."),(0,i.kt)("h3",{id:"32-a-prop-flow-exercise-for-react-newcomers"},"3.2 A prop-flow exercise for React newcomers"),(0,i.kt)("p",null,"The source code for your frontend exists in the ",(0,i.kt)("inlineCode",{parentName:"p"},"webapp/src")," directory. For those who are new to React let's take a stop at ",(0,i.kt)("inlineCode",{parentName:"p"},"MainApp")," in ",(0,i.kt)("inlineCode",{parentName:"p"},"webapp/src/app.jsx")," to follow the path of the props through the application:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-javascript"},"// webapp/src/app.jsx\nfunction MainApp() {\n const {\n blockedReason,\n blockedExplanation,\n isPreview,\n isLoading,\n initialTaskData, // Task data comes from this hook\n handleSubmit,\n handleFatalError,\n isOnboarding,\n } = useMephistoTask();\n")),(0,i.kt)("p",null,"Any Mephisto frontend task relies on either the ",(0,i.kt)("inlineCode",{parentName:"p"},"useMephistoTask")," or ",(0,i.kt)("inlineCode",{parentName:"p"},"useMephistoLiveTask")," hooks to get underlying state about the worker and the task. For now it's only important to note that we pull ",(0,i.kt)("inlineCode",{parentName:"p"},"initialTaskData")," from Mephisto, as well as a ",(0,i.kt)("inlineCode",{parentName:"p"},"handleSubmit")," function. (More details on usage of these hooks is available ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/facebookresearch/Mephisto/tree/main/packages/mephisto-core"},"here"),".)"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-javascript"}," if (blockedReason !== null) {\n return ...\n }\n if (isLoading) {\n return ;\n }\n if (isPreview) {\n return ...\n }\n")),(0,i.kt)("p",null,"Mephisto tasks can have a few states, loading, blocked, preview, onboarding, and main task. At the moment we'll leave discussion of these states to later tutorials."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},' return (\n
\n \n \n \n
\n );\n}\n\nReactDOM.render(, document.getElementById("app"));\n')),(0,i.kt)("p",null,"In this last segment, we find that we can access the ",(0,i.kt)("inlineCode",{parentName:"p"},"initialTaskData")," from Mephisto in the ",(0,i.kt)("inlineCode",{parentName:"p"},"BaseFrontend"),"'s ",(0,i.kt)("inlineCode",{parentName:"p"},"taskData")," prop, and will be able to call ",(0,i.kt)("inlineCode",{parentName:"p"},"handleSubmit")," through ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit"),". "),(0,i.kt)("h3",{id:"33-making-a-component-to-render-the-new-data"},"3.3 Making a component to render the new data"),(0,i.kt)("p",null,"Lets add a component to the frontend that will inform the worker if the ",(0,i.kt)("inlineCode",{parentName:"p"},"edited_by_requester")," flag has been set. For this we'll be editing the ",(0,i.kt)("inlineCode",{parentName:"p"},"BaseFrontend")," in ",(0,i.kt)("inlineCode",{parentName:"p"},"webapp/src/components/core_components.jsx"),". Let's create a ",(0,i.kt)("inlineCode",{parentName:"p"},"TellTextIsEditedBlock")," component:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},"// webapp/src/components/core_components.jsx\nfunction TellTextIsEdited({ taskData }) {\n if (taskData.edited_by_requester) {\n return

\n Note: this text was pre-screened by the requester\n

;\n } else {\n return null;\n }\n}\n")),(0,i.kt)("p",null,"And now we can drop this into the ",(0,i.kt)("inlineCode",{parentName:"p"},"SimpleFrontend")," component:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},"// webapp/src/components/core_components.jsx\nfunction SimpleFrontend({ taskData, isOnboarding, onSubmit, onError }) {\n if (!taskData) {\n return ;\n }\n if (isOnboarding) {\n return ;\n }\n return (\n
\n \n Directions: Please rate the below sentence as good or bad.\n \n \n ...\n")),(0,i.kt)("p",null,"Launching again we find that the first task has our new text, but the second task doesn't. Success!"),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(459).Z,width:"3016",height:"720"})),(0,i.kt)("h3",{id:"34-adding-a-component-to-respond-with-new-data"},"3.4 Adding a component to respond with new data"),(0,i.kt)("p",null,"Now that we've used the full flow of providing custom task data to the worker and having components use these, the next step is to allow submission of whatever data you would like. At the moment, all that is sent to the backend is the ",(0,i.kt)("inlineCode",{parentName:"p"},"rating"),", as can be seen in the two ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit")," calls:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'onClick={() => onSubmit({ rating: "good" })}\n...\nonClick={() => onSubmit({ rating: "bad" })}\n')),(0,i.kt)("p",null,"Based on how ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit")," is wired to Mephisto's ",(0,i.kt)("inlineCode",{parentName:"p"},"handleSubmit")," function, anything (json-serializable) in the object passed to ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit")," will be what is saved for the task. For this tutorial we'll want to put something else useful into this object. To this end, let's add an input box that allows workers to submit an edit to correct the sentence in some way. "),(0,i.kt)("p",null,"We can add some state to ",(0,i.kt)("inlineCode",{parentName:"p"},"SimpleFrontend")," with the ",(0,i.kt)("a",{parentName:"p",href:"https://reactjs.org/docs/hooks-state.html"},(0,i.kt)("inlineCode",{parentName:"a"},"useState")," React Hook"),". This provides us with an ",(0,i.kt)("inlineCode",{parentName:"p"},"editedText")," value initialized to ",(0,i.kt)("inlineCode",{parentName:"p"},"taskData.text"),", which we'll set to track the worker edits, and a setter to alter that value."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},"// webapp/src/components/core_components.jsx\nfunction SimpleFrontend({ taskData, isOnboarding, onSubmit, onError }) {\n const [editedText, setEditedText] = React.useState(taskData.text); // <=\n return (\n ...\n")),(0,i.kt)("p",null,"We now need to create a text input field that is wired to this state:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'...\n

{taskData.text}

\n
\n Corrections:\n setEditedText(e.target.value)} \n size="50" \n />\n
\n
\n...\n')),(0,i.kt)("p",null,"And lastly, make sure to add the new text to the submission packet in both ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit")," calls:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'onClick={() => onSubmit({ rating: "good", editedText: editedText })}\n...\nonClick={() => onSubmit({ rating: "bad", editedText: editedText })}\n')),(0,i.kt)("p",null,"Let's launch one last time."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"python run_task.py mephisto.task.task_name=custom-react-tutorial-iterating\n")),(0,i.kt)("p",null,"And just like that we're able to see an input field:\n",(0,i.kt)("img",{src:n(2527).Z,width:"940",height:"470"}),"\nWhen we hit submit, we can see our custom data is passed along as well:\n",(0,i.kt)("img",{src:n(2192).Z,width:"1049",height:"508"}),"\nCongrats! You've been able to collect some custom data through Mephisto. Of course, this is just scratching the surface on the types of tasks you can create."),(0,i.kt)("h2",{id:"4-setting-up-a-review"},"4. Setting up a review"),(0,i.kt)("h3",{id:"41-examining-the-raw-data"},"4.1 Examining the raw data"),(0,i.kt)("p",null,"Now that we've finished creating the task, we'll want to be able to review the data inside. Let's start by creating an ",(0,i.kt)("inlineCode",{parentName:"p"},"examine_results.py")," script:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'# examine_results.py\nfrom mephisto.abstractions.databases.local_database import LocalMephistoDB\nfrom mephisto.tools.examine_utils import run_examine_or_review, print_results\nfrom mephisto.data_model.worker import Worker\nfrom mephisto.data_model.unit import Unit\n\ndb = None\n\ndef format_data_for_printing(data):\n global db\n # Custom tasks can define methods for how to display their data in a relevant way\n worker_name = Worker.get(db, data["worker_id"]).worker_name\n contents = data["data"]\n duration = contents["times"]["task_end"] - contents["times"]["task_start"]\n metadata_string = (\n f"Worker: {worker_name}\\nUnit: {data[\'unit_id\']}\\n"\n f"Duration: {int(duration)}\\nStatus: {data[\'status\']}\\n"\n )\n\n inputs = contents["inputs"]\n inputs_string = f"Provided input: {inputs}\\n"\n outputs = contents["outputs"][\'final_data\']\n output_string = f"Provided output: {outputs}\\n"\n return f"-------------------\\n{metadata_string}{inputs_string}{output_string}"\n\n\ndef main():\n global db\n db = LocalMephistoDB()\n run_examine_or_review(db, format_data_for_printing)\n\n\nif __name__ == "__main__":\n main()\n')),(0,i.kt)("p",null,"This review script is very much like the one we used in the first tutorial, however we've left things particularly generic for now. You'll recall that all of the tasks we'd launched so far used the same ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"custom-react-tutorial-iterating"),". Let's see what happens when we check it out:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},">> python examine_results.py \nDo you want to (r)eview, or (e)xamine data? Default examine. Can put e or e to choose how many to view\ne\nInput task name: custom-react-tutorial-iterating\n-------------------\nWorker: x\nUnit: 5984\nDuration: 10\nStatus: completed\nProvided input: {'text': 'This text is good text! Now it is extra good!', 'edited_by_requester': True}\nProvided output: {'rating': 'good', 'editedText': \"I've edited the text via the corrections box!\"}\n\n-------------------\nWorker: x\nUnit: 5982\nDuration: 10\nStatus: completed\nProvided input: {'text': 'This text is good text! Now it is extra good!', 'edited_by_requester': True}\nProvided output: {'rating': 'good'}\n\n-------------------\nWorker: x\nUnit: 5975\nDuration: 11\nStatus: completed\nProvided input: {'text': 'This text is bad text!', 'edited_by_requester': False}\nProvided output: {'rating': 'bad'}\n\n")),(0,i.kt)("p",null,"You may have a different number of submissions depending on how many you did in the tutorial, but importantly you'll find that not all of them have a provided output entry for ",(0,i.kt)("inlineCode",{parentName:"p"},"editedText"),". This is because we changed the format mid-way while continuing to use the same ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name"),". "),(0,i.kt)("p",null,"Generally, you should change the ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," between runs such that your data format is consistent throughout, but you can also ensure that your ",(0,i.kt)("inlineCode",{parentName:"p"},"format_for_printing_data")," function is tolerant of the changes."),(0,i.kt)("p",null,"In any case, for future runs you could have formatting that explicitly extracts the portions you're interested in, or does additional logic to make your review easier. For instance, you could make it so that the corrected text is only shown if the worker made an edit:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"...\noutputs = contents[\"outputs\"]['final_data']\ndid_edit_text = outputs['editedText'] == inputs['text']\nedit_text_string = f\"Corrected Text: {outputs['editedText']}\\n\" if did_edit_text else \"\"\noutput_string = f\"Provided rating: {outputs['rating']}\\n{edit_text_string}\"\n...\n")),(0,i.kt)("p",null,"While creating review scripts is powerful, it's not always the easiest way to review data. Annotations that are best in full context, like videos for instance, would likely benefit from being able to view the data directly."),(0,i.kt)("h3",{id:"42-using-a-web-based-review-flow"},"4.2 Using a web-based review flow"),(0,i.kt)("p",null,"For tasks that are best reviewed through a full UI, Mephisto offers a way to create web-based review flows. "),(0,i.kt)("p",null,"To view the results of the task we just ran through the web-based workflow, run the ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto review")," CLI tool:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"mephisto review --db custom-react-tutorial-iterating --stdout --all\n")),(0,i.kt)("p",null,"This will launch a local server where you will be able to browse, filter, and drill into the data collected for your task."),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(7501).Z,width:"2626",height:"1902"})),(0,i.kt)("p",null,"You can also drill into a specific task to explore the details further."),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(511).Z,width:"2626",height:"1902"})),(0,i.kt)("h3",{id:"43-customizing-the-web-based-review-flow"},"4.3 Customizing the web-based review flow"),(0,i.kt)("p",null,'By default, we ship with a batteries-included review experience, however you can easily create your own interface with custom "renderers" for visualizing your collected data.'),(0,i.kt)("p",null,"Let's walk through creating our own custom renderer for our data."),(0,i.kt)("p",null,"First, we'll create our review application by using the ",(0,i.kt)("inlineCode",{parentName:"p"},"create-react-app")," npm package, with a mephisto review template. Continuing from within our project folder at ",(0,i.kt)("inlineCode",{parentName:"p"},"tmp/static_tutorial/")," let's run:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"npx create-react-app@latest custom-review --template mephisto-review \n")),(0,i.kt)("p",null,"Once the template is done installing we'll create a new file at ",(0,i.kt)("inlineCode",{parentName:"p"},"custom-review/src/custom/MyDataItem.js")," and fill it in as such:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'import React from "react";\nimport { Card } from "@blueprintjs/core";\n\nexport default function MyDataItem({item}) {\n const rating = item.data.data.outputs.final_data.rating;\n const duration = Math.round(item.data.data.times.task_end - item.data.data.times.task_start);\n return \n

{ rating === "good" ? "\ud83d\udc4d" : "\ud83d\udc4e"}

\n

{duration} seconds

\n
\n}\n\n')),(0,i.kt)("p",null,"Note that we're leveraging the ",(0,i.kt)("inlineCode",{parentName:"p"},"")," component from the rich suite of components ",(0,i.kt)("a",{parentName:"p",href:"https://blueprintjs.com/docs/#core/components/card"},"provided by BlueprintJS")," to create our renderer. By default, the review template imports the ",(0,i.kt)("inlineCode",{parentName:"p"},"@blueprintjs/core")," library so you can immediately start using any of the UI components provided there."),(0,i.kt)("p",null,"Now that we've created our own ItemRenderer, we'll use it by updating ",(0,i.kt)("inlineCode",{parentName:"p"},"custom-review/src/index.js")," to first import the renderer:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'import MyDataItem from "./custom/MyDataItem"\n')),(0,i.kt)("p",null,"Then we'll pass it to the ",(0,i.kt)("inlineCode",{parentName:"p"},"")," component to modify the way in which our data renders in the grid view:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},"\n")),(0,i.kt)("p",null,"To see our new renderer in action, let's build our app and invoke the mephisto review CLI with it."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cd custom-review/\nnpm run build\nmephisto review build/ --db custom-react-tutorial-iterating --stdout --all\n")),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Note:")," Notice that the ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto review")," command here is similar to the one run in the previous section, except this time we pass in the relative path to the build folder as an argument."),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(6030).Z,width:"2626",height:"1902"})),(0,i.kt)("h1",{id:"building-from-task-blocks-with-annotated-beta"},"Building from task blocks with ",(0,i.kt)("inlineCode",{parentName:"h1"},"@annotated")," ","[BETA]"),(0,i.kt)("p",null,"Mephisto at the core is built for complete flexibility over the kinds of tasks you can create. Building everything from scratch though can be a lot, so we've created the annotation toolkit and ",(0,i.kt)("inlineCode",{parentName:"p"},"@annotated")," suite of libraries. These have components that may be useful for your annotation tasks, as well as examples of developed flows you can use or extend for your tasks."),(0,i.kt)("p",null,"The full suite of tools is currently in beta and can be found in the ",(0,i.kt)("a",{parentName:"p",href:"https://annotation-toolkit-storybook.vercel.app/"},"Storybook here"),"."))}h.isMDXComponent=!0},7501:function(e,t,n){t.Z=n.p+"assets/images/custom_react_review_all-6ac8053338f27836f35fe86f1c18e17c.png"},6030:function(e,t,n){t.Z=n.p+"assets/images/custom_react_review_renderer-2516b0fbd23108a9cd153b931bbeb358.png"},511:function(e,t,n){t.Z=n.p+"assets/images/custom_react_review_single-0164de5a41b062c6eb0d6788535c7629.png"},706:function(e,t,n){t.Z=n.p+"assets/images/react_dev_tools_see_props-7e8a0003bae24974b5d13e550b3ffd11.png"},2192:function(e,t,n){t.Z=n.p+"assets/images/static_task_correction_submit-613e73014a531407d176fb912c592508.png"},2527:function(e,t,n){t.Z=n.p+"assets/images/static_task_with_corrections_box-30844c659f834608cc5a4ad3d1885677.png"},459:function(e,t,n){t.Z=n.p+"assets/images/with_requester_screening_text-32b0ca1a0bd04c2e1e555be70f6bf07c.png"}}]); \ No newline at end of file diff --git a/assets/js/4d8b778b.e1e3c22f.js b/assets/js/4d8b778b.e1e3c22f.js new file mode 100644 index 000000000..e3f879b1f --- /dev/null +++ b/assets/js/4d8b778b.e1e3c22f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[8374],{4127:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return m}});var a=n(1987);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),d=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},u=function(e){var t=d(e.components);return a.createElement(l.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=d(n),h=o,m=p["".concat(l,".").concat(h)]||p[h]||c[h]||i;return n?a.createElement(m,r(r({ref:t},u),{},{components:n})):a.createElement(m,r({ref:t},u))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=h;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:o,r[1]=s;for(var d=2;dSharedTaskState object and static_task_data attribute",id:"21-the-sharedtaskstate-object-and-static_task_data-attribute",level:3},{value:"2.2 Editing static_task_data",id:"22-editing-static_task_data",level:3},{value:"3. Accessing the new data",id:"3-accessing-the-new-data",level:2},{value:"3.1 Using React Dev Tools",id:"31-using-react-dev-tools",level:3},{value:"3.2 A prop-flow exercise for React newcomers",id:"32-a-prop-flow-exercise-for-react-newcomers",level:3},{value:"3.3 Making a component to render the new data",id:"33-making-a-component-to-render-the-new-data",level:3},{value:"3.4 Adding a component to respond with new data",id:"34-adding-a-component-to-respond-with-new-data",level:3},{value:"4. Setting up a review",id:"4-setting-up-a-review",level:2},{value:"4.1 Examining the raw data",id:"41-examining-the-raw-data",level:3},{value:"4.2 Using a web-based review flow",id:"42-using-a-web-based-review-flow",level:3},{value:"4.3 Customizing the web-based review flow",id:"43-customizing-the-web-based-review-flow",level:3}],c={toc:p};function h(e){var t=e.components,s=(0,o.Z)(e,r);return(0,i.kt)("wrapper",(0,a.Z)({},c,s,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"working-on-a-custom-task"},"Working on a custom task"),(0,i.kt)("p",null,"Now that you've ",(0,i.kt)("a",{parentName:"p",href:"../first_task"},"launched a task or two"),", it's time to get into building your own. This tutorial focuses on giving you the tools to collect the specific data you're looking for by building a task of your own. This tutorial itself won't produce a useful task, but it should be useful for understanding how to go about creating a real one. You don't ",(0,i.kt)("em",{parentName:"p"},"need")," any React experience to get through this guide, though it will be helpful for understanding the usage more deeply."),(0,i.kt)("h2",{id:"1-getting-started"},"1. Getting started"),(0,i.kt)("h3",{id:"11-making-a-new-workspace"},"1.1 Making a new workspace"),(0,i.kt)("p",null,"We'll extend from the static react task example, but we'll want to move it to it's own workspace. From within the main Mephisto directory:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cp -r examples/static_react_task/ tmp/static_tutorial/\ncd tmp/static_tutorial/\n")),(0,i.kt)("p",null,"Now that we're here, we should also set up your config file"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml"},'# hydra_configs/conf/example.yaml \n#@package _global_\ndefaults:\n - /mephisto/blueprint: static_react_task\n - /mephisto/architect: local\n - /mephisto/provider: inhouse\nmephisto:\n blueprint:\n task_source: ${task_dir}/webapp/build/bundle.js\n link_task_source: false\n extra_source_dir: ${task_dir}/webapp/src/static\n units_per_assignment: 1\n task:\n task_name: custom-react-tutorial # Remember to set an appropriate task_name!\n task_title: "Rating a sentence as good or bad"\n task_description: "In this task, you\'ll be given a sentence. It is your job to rate it as either good or bad."\n task_reward: 0.05\n task_tags: "test,simple,button"\n')),(0,i.kt)("p",null,"It is important to give a new ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," as we are creating a custom task. For local development ",(0,i.kt)("strong",{parentName:"p"},"only")," it also makes sense to set ",(0,i.kt)("inlineCode",{parentName:"p"},"link_task_source")," to true. This allows changes to propagate to your localhost server when you reload the page (otherwise you would have to shutdown and restart the server to see changes). "),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"task_source")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"extra_source_dir")," arguments are also of importance, as this is where the ",(0,i.kt)("inlineCode",{parentName:"p"},"StaticReactBlueprint")," class will be looking for the compiled React app's Javascript bundle as well as a folder for extra static resources for the page, respectively."),(0,i.kt)("h3",{id:"12-launching-the-task"},"1.2 Launching the task"),(0,i.kt)("p",null,"From the current directory, you should be able to execute the run script and get a job working. We're using a different ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," to prevent polluting our later task with data that won't share the same format. It is a good practice to do this with initial iterations, and to change the ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," any time you change input or output arguments."),(0,i.kt)("p",null,"You can update the ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"link_task_source")," values in your config and run the task like below"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"python run_task__local__inhouse.py\n")),(0,i.kt)("p",null,"or you can set them when you run the task:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"python run_task__local__inhouse.py mephisto.task.task_name=custom-react-tutorial-iterating mephisto.blueprint.link_task_source=true\n")),(0,i.kt)("p",null,"This will launch a simple task where an annotator is supposed to note a sentence as being good or bad. Clicking a button auto-submits the task. In the next sections we'll add other content. "),(0,i.kt)("p",null,"To establish a link where your changes will be propagated to the localhost server(when you reload), create a separate terminal window and run"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cd webapp && npm run dev:watch\n")),(0,i.kt)("p",null,"Moving forward, we'll update this task so that workers are able to edit the text as well as rate the original sentence."),(0,i.kt)("h2",{id:"2-providing-new-data-to-the-task"},"2. Providing new data to the task"),(0,i.kt)("h3",{id:"21-the-sharedtaskstate-object-and-static_task_data-attribute"},"2.1 The ",(0,i.kt)("inlineCode",{parentName:"h3"},"SharedTaskState")," object and ",(0,i.kt)("inlineCode",{parentName:"h3"},"static_task_data")," attribute"),(0,i.kt)("p",null,"We'll begin by modifying the ",(0,i.kt)("inlineCode",{parentName:"p"},"SharedStaticTaskState"),"'s ",(0,i.kt)("inlineCode",{parentName:"p"},"static_task_data")," attribute. For info on this attribute, recall ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto wut"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"$ mephisto wut blueprint=static_react_task static_task_data\n\n\n Tasks launched from static blueprints need\n a prebuilt javascript bundle containing the task. We suggest building\n with our provided useMephistoTask hook.\n \n\n\nAdditional SharedTaskState args from SharedStaticTaskState, which may be configured in your run script\n \n Additional Shared TaskState args \n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 dest \u2502 type \u2502 default \u2502 help \u2502 choices \u2502 required \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 static_task_data \u2502 Iterable[Dict] \u2502 [] \u2502 List or generator that \u2502 None \u2502 False \u2502\n\u2502 \u2502 \u2502 \u2502 returns dicts of task \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 data. Generators can \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 be used for tasks with \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 lengths that aren't \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 known at the start of \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 a run, or are \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 otherwise determined \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 during the run. \u2502 \u2502 \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n")),(0,i.kt)("p",null,"This field replaces using the ",(0,i.kt)("inlineCode",{parentName:"p"},"csv_file")," used in the previous tutorial, allowing our run script to specify data directly. React tasks can be run off of ",(0,i.kt)("inlineCode",{parentName:"p"},".csv")," files as well, if you'd prefer."),(0,i.kt)("p",null,"At the moment, the data we're providing is as follows:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'shared_state = SharedStaticTaskState(\n static_task_data=[\n {"text": "This text is good text!"},\n {"text": "This text is bad text!"},\n ],\n ...\n)\n')),(0,i.kt)("p",null,"This corresponds to two ",(0,i.kt)("inlineCode",{parentName:"p"},"Assignment"),"s, each with an entry for ",(0,i.kt)("inlineCode",{parentName:"p"},"text"),". Altering these will change the text that is present, while adding new entries to the array will lead to Mephisto generating more ",(0,i.kt)("inlineCode",{parentName:"p"},"Assignment"),"s. "),(0,i.kt)("h3",{id:"22-editing-static_task_data"},"2.2 Editing ",(0,i.kt)("inlineCode",{parentName:"h3"},"static_task_data")),(0,i.kt)("p",null,"For now let's just edit the data and add a new field. Update the ",(0,i.kt)("inlineCode",{parentName:"p"},"static_task_data")," to look like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'static_task_data=[\n {"text": "This text is good text! Now it is extra good", "edited_by_requester": True},\n {"text": "This text is bad text!", "edited_by_requester": False},\n],\n')),(0,i.kt)("p",null,"At this point you can run the task again."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"python run_task__local__inhouse.py mephisto.task.task_name=custom-react-tutorial-iterating\n")),(0,i.kt)("p",null,"Note the first one you work on displays your new edited text. But what about the new ",(0,i.kt)("inlineCode",{parentName:"p"},"edited_by_requester")," field?"),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Tip:")," In your own tasks, you can use a function that creates static task data, or even a generator for it, but this is discussed more in the ",(0,i.kt)("a",{parentName:"p",href:"../workflows"},"workflows")," tutorial.")),(0,i.kt)("h2",{id:"3-accessing-the-new-data"},"3. Accessing the new data"),(0,i.kt)("h3",{id:"31-using-react-dev-tools"},"3.1 Using React Dev Tools"),(0,i.kt)("p",null,"Generally, developing with React is easiest if you have the React Dev Tools extension in your browser. It's currently available in ",(0,i.kt)("a",{parentName:"p",href:"https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi"},"Chrome")," and ",(0,i.kt)("a",{parentName:"p",href:"https://addons.mozilla.org/en-US/firefox/addon/react-devtools/"},"Firefox"),". With this you can peer into the react state and see what's inside:\n",(0,i.kt)("img",{src:n(706).Z,width:"1630",height:"523"}),"\nHere on the right you can see the ",(0,i.kt)("inlineCode",{parentName:"p"},"text")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"edited_by_requester")," fields accessible in ",(0,i.kt)("inlineCode",{parentName:"p"},"taskData"),". Now that we know it's there, we can do something with it."),(0,i.kt)("h3",{id:"32-a-prop-flow-exercise-for-react-newcomers"},"3.2 A prop-flow exercise for React newcomers"),(0,i.kt)("p",null,"The source code for your frontend exists in the ",(0,i.kt)("inlineCode",{parentName:"p"},"webapp/src")," directory. For those who are new to React let's take a stop at ",(0,i.kt)("inlineCode",{parentName:"p"},"MainApp")," in ",(0,i.kt)("inlineCode",{parentName:"p"},"webapp/src/app.jsx")," to follow the path of the props through the application:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-javascript"},"// webapp/src/app.jsx\nfunction MainApp() {\n const {\n blockedReason,\n blockedExplanation,\n isPreview,\n isLoading,\n initialTaskData, // Task data comes from this hook\n handleSubmit,\n handleFatalError,\n isOnboarding,\n } = useMephistoTask();\n")),(0,i.kt)("p",null,"Any Mephisto frontend task relies on either the ",(0,i.kt)("inlineCode",{parentName:"p"},"useMephistoTask")," or ",(0,i.kt)("inlineCode",{parentName:"p"},"useMephistoLiveTask")," hooks to get underlying state about the worker and the task. For now it's only important to note that we pull ",(0,i.kt)("inlineCode",{parentName:"p"},"initialTaskData")," from Mephisto, as well as a ",(0,i.kt)("inlineCode",{parentName:"p"},"handleSubmit")," function. (More details on usage of these hooks is available ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/facebookresearch/Mephisto/tree/main/packages/mephisto-core"},"here"),".)"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-javascript"}," if (blockedReason !== null) {\n return ...\n }\n if (isLoading) {\n return ;\n }\n if (isPreview) {\n return ...\n }\n")),(0,i.kt)("p",null,"Mephisto tasks can have a few states, loading, blocked, preview, onboarding, and main task. At the moment we'll leave discussion of these states to later tutorials."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},' return (\n
\n \n \n \n
\n );\n}\n\nReactDOM.render(, document.getElementById("app"));\n')),(0,i.kt)("p",null,"In this last segment, we find that we can access the ",(0,i.kt)("inlineCode",{parentName:"p"},"initialTaskData")," from Mephisto in the ",(0,i.kt)("inlineCode",{parentName:"p"},"BaseFrontend"),"'s ",(0,i.kt)("inlineCode",{parentName:"p"},"taskData")," prop, and will be able to call ",(0,i.kt)("inlineCode",{parentName:"p"},"handleSubmit")," through ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit"),". "),(0,i.kt)("h3",{id:"33-making-a-component-to-render-the-new-data"},"3.3 Making a component to render the new data"),(0,i.kt)("p",null,"Lets add a component to the frontend that will inform the worker if the ",(0,i.kt)("inlineCode",{parentName:"p"},"edited_by_requester")," flag has been set. For this we'll be editing the ",(0,i.kt)("inlineCode",{parentName:"p"},"BaseFrontend")," in ",(0,i.kt)("inlineCode",{parentName:"p"},"webapp/src/components/core_components.jsx"),". Let's create a ",(0,i.kt)("inlineCode",{parentName:"p"},"TellTextIsEditedBlock")," component:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},"// webapp/src/components/core_components.jsx\nfunction TellTextIsEdited({ taskData }) {\n if (taskData.edited_by_requester) {\n return

\n Note: this text was pre-screened by the requester\n

;\n } else {\n return null;\n }\n}\n")),(0,i.kt)("p",null,"And now we can drop this into the ",(0,i.kt)("inlineCode",{parentName:"p"},"SimpleFrontend")," component:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},"// webapp/src/components/core_components.jsx\nfunction SimpleFrontend({ taskData, isOnboarding, onSubmit, onError }) {\n if (!taskData) {\n return ;\n }\n if (isOnboarding) {\n return ;\n }\n return (\n
\n \n Directions: Please rate the below sentence as good or bad.\n \n \n ...\n")),(0,i.kt)("p",null,"Launching again we find that the first task has our new text, but the second task doesn't. Success!"),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(459).Z,width:"3016",height:"720"})),(0,i.kt)("h3",{id:"34-adding-a-component-to-respond-with-new-data"},"3.4 Adding a component to respond with new data"),(0,i.kt)("p",null,"Now that we've used the full flow of providing custom task data to the worker and having components use these, the next step is to allow submission of whatever data you would like. At the moment, all that is sent to the backend is the ",(0,i.kt)("inlineCode",{parentName:"p"},"rating"),", as can be seen in the two ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit")," calls:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'onClick={() => onSubmit({ rating: "good" })}\n...\nonClick={() => onSubmit({ rating: "bad" })}\n')),(0,i.kt)("p",null,"Based on how ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit")," is wired to Mephisto's ",(0,i.kt)("inlineCode",{parentName:"p"},"handleSubmit")," function, anything (json-serializable) in the object passed to ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit")," will be what is saved for the task. For this tutorial we'll want to put something else useful into this object. To this end, let's add an input box that allows workers to submit an edit to correct the sentence in some way. "),(0,i.kt)("p",null,"We can add some state to ",(0,i.kt)("inlineCode",{parentName:"p"},"SimpleFrontend")," with the ",(0,i.kt)("a",{parentName:"p",href:"https://reactjs.org/docs/hooks-state.html"},(0,i.kt)("inlineCode",{parentName:"a"},"useState")," React Hook"),". This provides us with an ",(0,i.kt)("inlineCode",{parentName:"p"},"editedText")," value initialized to ",(0,i.kt)("inlineCode",{parentName:"p"},"taskData.text"),", which we'll set to track the worker edits, and a setter to alter that value."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},"// webapp/src/components/core_components.jsx\nfunction SimpleFrontend({ taskData, isOnboarding, onSubmit, onError }) {\n const [editedText, setEditedText] = React.useState(taskData.text); // <=\n return (\n ...\n")),(0,i.kt)("p",null,"We now need to create a text input field that is wired to this state:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'...\n

{taskData.text}

\n
\n Corrections:\n setEditedText(e.target.value)} \n size="50" \n />\n
\n
\n...\n')),(0,i.kt)("p",null,"And lastly, make sure to add the new text to the submission packet in both ",(0,i.kt)("inlineCode",{parentName:"p"},"onSubmit")," calls:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'onClick={() => onSubmit({ rating: "good", editedText: editedText })}\n...\nonClick={() => onSubmit({ rating: "bad", editedText: editedText })}\n')),(0,i.kt)("p",null,"Let's launch one last time."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"python run_task__local__inhouse.py mephisto.task.task_name=custom-react-tutorial-iterating\n")),(0,i.kt)("p",null,"And just like that we're able to see an input field:\n",(0,i.kt)("img",{src:n(2527).Z,width:"940",height:"470"}),"\nWhen we hit submit, we can see our custom data is passed along as well:\n",(0,i.kt)("img",{src:n(2192).Z,width:"1049",height:"508"}),"\nCongrats! You've been able to collect some custom data through Mephisto. Of course, this is just scratching the surface on the types of tasks you can create."),(0,i.kt)("h2",{id:"4-setting-up-a-review"},"4. Setting up a review"),(0,i.kt)("h3",{id:"41-examining-the-raw-data"},"4.1 Examining the raw data"),(0,i.kt)("p",null,"Now that we've finished creating the task, we'll want to be able to review the data inside. Let's start by creating an ",(0,i.kt)("inlineCode",{parentName:"p"},"examine_results.py")," script:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},'# examine_results.py\nfrom mephisto.abstractions.databases.local_database import LocalMephistoDB\nfrom mephisto.tools.examine_utils import run_examine_or_review, print_results\nfrom mephisto.data_model.worker import Worker\nfrom mephisto.data_model.unit import Unit\n\ndb = None\n\ndef format_data_for_printing(data):\n global db\n # Custom tasks can define methods for how to display their data in a relevant way\n worker_name = Worker.get(db, data["worker_id"]).worker_name\n contents = data["data"]\n duration = contents["times"]["task_end"] - contents["times"]["task_start"]\n metadata_string = (\n f"Worker: {worker_name}\\nUnit: {data[\'unit_id\']}\\n"\n f"Duration: {int(duration)}\\nStatus: {data[\'status\']}\\n"\n )\n\n inputs = contents["inputs"]\n inputs_string = f"Provided input: {inputs}\\n"\n outputs = contents["outputs"][\'final_data\']\n output_string = f"Provided output: {outputs}\\n"\n return f"-------------------\\n{metadata_string}{inputs_string}{output_string}"\n\n\ndef main():\n global db\n db = LocalMephistoDB()\n run_examine_or_review(db, format_data_for_printing)\n\n\nif __name__ == "__main__":\n main()\n')),(0,i.kt)("p",null,"This review script is very much like the one we used in the first tutorial, however we've left things particularly generic for now. You'll recall that all of the tasks we'd launched so far used the same ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"custom-react-tutorial-iterating"),". Let's see what happens when we check it out:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},">> python examine_results.py \nDo you want to (r)eview, or (e)xamine data? Default examine. Can put e or e to choose how many to view\ne\nInput task name: custom-react-tutorial-iterating\n-------------------\nWorker: x\nUnit: 5984\nDuration: 10\nStatus: completed\nProvided input: {'text': 'This text is good text! Now it is extra good!', 'edited_by_requester': True}\nProvided output: {'rating': 'good', 'editedText': \"I've edited the text via the corrections box!\"}\n\n-------------------\nWorker: x\nUnit: 5982\nDuration: 10\nStatus: completed\nProvided input: {'text': 'This text is good text! Now it is extra good!', 'edited_by_requester': True}\nProvided output: {'rating': 'good'}\n\n-------------------\nWorker: x\nUnit: 5975\nDuration: 11\nStatus: completed\nProvided input: {'text': 'This text is bad text!', 'edited_by_requester': False}\nProvided output: {'rating': 'bad'}\n\n")),(0,i.kt)("p",null,"You may have a different number of submissions depending on how many you did in the tutorial, but importantly you'll find that not all of them have a provided output entry for ",(0,i.kt)("inlineCode",{parentName:"p"},"editedText"),". This is because we changed the format mid-way while continuing to use the same ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name"),". "),(0,i.kt)("p",null,"Generally, you should change the ",(0,i.kt)("inlineCode",{parentName:"p"},"task_name")," between runs such that your data format is consistent throughout, but you can also ensure that your ",(0,i.kt)("inlineCode",{parentName:"p"},"format_for_printing_data")," function is tolerant of the changes."),(0,i.kt)("p",null,"In any case, for future runs you could have formatting that explicitly extracts the portions you're interested in, or does additional logic to make your review easier. For instance, you could make it so that the corrected text is only shown if the worker made an edit:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"...\noutputs = contents[\"outputs\"]['final_data']\ndid_edit_text = outputs['editedText'] == inputs['text']\nedit_text_string = f\"Corrected Text: {outputs['editedText']}\\n\" if did_edit_text else \"\"\noutput_string = f\"Provided rating: {outputs['rating']}\\n{edit_text_string}\"\n...\n")),(0,i.kt)("p",null,"While creating review scripts is powerful, it's not always the easiest way to review data. Annotations that are best in full context, like videos for instance, would likely benefit from being able to view the data directly."),(0,i.kt)("h3",{id:"42-using-a-web-based-review-flow"},"4.2 Using a web-based review flow"),(0,i.kt)("p",null,"For tasks that are best reviewed through a full UI, Mephisto offers a way to create web-based review flows. "),(0,i.kt)("p",null,"To view the results of the task we just ran through the web-based workflow, run the ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto review")," CLI tool:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"mephisto review --db custom-react-tutorial-iterating --stdout --all\n")),(0,i.kt)("p",null,"This will launch a local server where you will be able to browse, filter, and drill into the data collected for your task."),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(7501).Z,width:"2626",height:"1902"})),(0,i.kt)("p",null,"You can also drill into a specific task to explore the details further."),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(511).Z,width:"2626",height:"1902"})),(0,i.kt)("h3",{id:"43-customizing-the-web-based-review-flow"},"4.3 Customizing the web-based review flow"),(0,i.kt)("p",null,'By default, we ship with a batteries-included review experience, however you can easily create your own interface with custom "renderers" for visualizing your collected data.'),(0,i.kt)("p",null,"Let's walk through creating our own custom renderer for our data."),(0,i.kt)("p",null,"First, we'll create our review application by using the ",(0,i.kt)("inlineCode",{parentName:"p"},"create-react-app")," npm package, with a mephisto review template. Continuing from within our project folder at ",(0,i.kt)("inlineCode",{parentName:"p"},"tmp/static_tutorial/")," let's run:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"npx create-react-app@latest custom-review --template mephisto-review \n")),(0,i.kt)("p",null,"Once the template is done installing we'll create a new file at ",(0,i.kt)("inlineCode",{parentName:"p"},"custom-review/src/custom/MyDataItem.js")," and fill it in as such:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'import React from "react";\nimport { Card } from "@blueprintjs/core";\n\nexport default function MyDataItem({item}) {\n const rating = item.data.data.outputs.final_data.rating;\n const duration = Math.round(item.data.data.times.task_end - item.data.data.times.task_start);\n return \n

{ rating === "good" ? "\ud83d\udc4d" : "\ud83d\udc4e"}

\n

{duration} seconds

\n
\n}\n\n')),(0,i.kt)("p",null,"Note that we're leveraging the ",(0,i.kt)("inlineCode",{parentName:"p"},"")," component from the rich suite of components ",(0,i.kt)("a",{parentName:"p",href:"https://blueprintjs.com/docs/#core/components/card"},"provided by BlueprintJS")," to create our renderer. By default, the review template imports the ",(0,i.kt)("inlineCode",{parentName:"p"},"@blueprintjs/core")," library so you can immediately start using any of the UI components provided there."),(0,i.kt)("p",null,"Now that we've created our own ItemRenderer, we'll use it by updating ",(0,i.kt)("inlineCode",{parentName:"p"},"custom-review/src/index.js")," to first import the renderer:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},'import MyDataItem from "./custom/MyDataItem"\n')),(0,i.kt)("p",null,"Then we'll pass it to the ",(0,i.kt)("inlineCode",{parentName:"p"},"")," component to modify the way in which our data renders in the grid view:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-jsx"},"\n")),(0,i.kt)("p",null,"To see our new renderer in action, let's build our app and invoke the mephisto review CLI with it."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"cd custom-review/\nnpm run build\nmephisto review build/ --db custom-react-tutorial-iterating --stdout --all\n")),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Note:")," Notice that the ",(0,i.kt)("inlineCode",{parentName:"p"},"mephisto review")," command here is similar to the one run in the previous section, except this time we pass in the relative path to the build folder as an argument."),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(6030).Z,width:"2626",height:"1902"})),(0,i.kt)("h1",{id:"building-from-task-blocks-with-annotated-beta"},"Building from task blocks with ",(0,i.kt)("inlineCode",{parentName:"h1"},"@annotated")," ","[BETA]"),(0,i.kt)("p",null,"Mephisto at the core is built for complete flexibility over the kinds of tasks you can create. Building everything from scratch though can be a lot, so we've created the annotation toolkit and ",(0,i.kt)("inlineCode",{parentName:"p"},"@annotated")," suite of libraries. These have components that may be useful for your annotation tasks, as well as examples of developed flows you can use or extend for your tasks."),(0,i.kt)("p",null,"The full suite of tools is currently in beta and can be found in the ",(0,i.kt)("a",{parentName:"p",href:"https://annotation-toolkit-storybook.vercel.app/"},"Storybook here"),"."))}h.isMDXComponent=!0},7501:function(e,t,n){t.Z=n.p+"assets/images/custom_react_review_all-6ac8053338f27836f35fe86f1c18e17c.png"},6030:function(e,t,n){t.Z=n.p+"assets/images/custom_react_review_renderer-2516b0fbd23108a9cd153b931bbeb358.png"},511:function(e,t,n){t.Z=n.p+"assets/images/custom_react_review_single-0164de5a41b062c6eb0d6788535c7629.png"},706:function(e,t,n){t.Z=n.p+"assets/images/react_dev_tools_see_props-7e8a0003bae24974b5d13e550b3ffd11.png"},2192:function(e,t,n){t.Z=n.p+"assets/images/static_task_correction_submit-613e73014a531407d176fb912c592508.png"},2527:function(e,t,n){t.Z=n.p+"assets/images/static_task_with_corrections_box-30844c659f834608cc5a4ad3d1885677.png"},459:function(e,t,n){t.Z=n.p+"assets/images/with_requester_screening_text-32b0ca1a0bd04c2e1e555be70f6bf07c.png"}}]); \ No newline at end of file diff --git a/assets/js/7282321b.ccb1a120.js b/assets/js/7282321b.2fb5bd08.js similarity index 62% rename from assets/js/7282321b.ccb1a120.js rename to assets/js/7282321b.2fb5bd08.js index 5d543be97..6eeb5c71c 100644 --- a/assets/js/7282321b.ccb1a120.js +++ b/assets/js/7282321b.2fb5bd08.js @@ -1 +1 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[914],{4127:function(e,t,o){o.d(t,{Zo:function(){return p},kt:function(){return f}});var n=o(1987);function r(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function a(e){for(var t=1;t=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}var l=n.createContext({}),m=function(e){var t=n.useContext(l),o=t;return e&&(o="function"==typeof e?e(t):a(a({},t),e)),o},p=function(e){var t=m(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var o=e.components,r=e.mdxType,i=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),c=m(o),d=r,f=c["".concat(l,".").concat(d)]||c[d]||u[d]||i;return o?n.createElement(f,a(a({ref:t},p),{},{components:o})):n.createElement(f,a({ref:t},p))}));function f(e,t){var o=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=o.length,a=new Array(i);a[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:r,a[1]=s;for(var m=2;m=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}var l=n.createContext({}),m=function(e){var t=n.useContext(l),o=t;return e&&(o="function"==typeof e?e(t):a(a({},t),e)),o},p=function(e){var t=m(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var o=e.components,r=e.mdxType,i=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),c=m(o),d=r,f=c["".concat(l,".").concat(d)]||c[d]||u[d]||i;return o?n.createElement(f,a(a({ref:t},p),{},{components:o})):n.createElement(f,a({ref:t},p))}));function f(e,t){var o=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=o.length,a=new Array(i);a[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:r,a[1]=s;for(var m=2;m=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=n.createContext({}),l=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},c=function(e){var t=l(e.components);return n.createElement(p.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,p=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=l(r),d=o,k=u["".concat(p,".").concat(d)]||u[d]||m[d]||a;return r?n.createElement(k,i(i({ref:t},c),{},{components:r})):n.createElement(k,i({ref:t},c))}));function k(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=d;var s={};for(var p in t)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s[u]="string"==typeof e?e:o,i[1]=s;for(var l=2;l\n"))),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Run you first example (a simple form-based task):"),(0,a.kt)("pre",{parentName:"li"},(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task.py\n"))),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"After the script finishes building, in your console output you will see URLs like this: ",(0,a.kt)("inlineCode",{parentName:"p"},"localhost:3000/?worker_id=x&assignment_id=1"),". Each URL represents a unit of your Task. Copy them one-by-one into your browser, changing port from ",(0,a.kt)("inlineCode",{parentName:"p"},"3000")," to ",(0,a.kt)("inlineCode",{parentName:"p"},"3001"),".")),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"After completing all units, you will see your task automatically shut down")),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Now we are ready to review Task results. Run command:"),(0,a.kt)("pre",{parentName:"li"},(0,a.kt)("code",{parentName:"pre"},"```shell\ndocker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 8081:8000 \\\n --rm mephisto_dc \\\n mephisto review_app --host 0.0.0.0 --port 8000\n```\n")),(0,a.kt)("p",{parentName:"li"},"and open TaskReview app in your browser at ",(0,a.kt)("a",{parentName:"p",href:"http://localhost:8081"},"http://localhost:8081"))),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Click on your Task name, and review the task units (that you have just completed yourself earlier)."))),(0,a.kt)("p",null,"Congratulations - you have just run and reviewed your very first task!"),(0,a.kt)("hr",null),(0,a.kt)("h2",{id:"next-steps"},"Next Steps"),(0,a.kt)("p",null,"To understand how to customize Mephisto to your specific needs, we recommend these chapters:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guides/tutorials/first_task/"},"Running your first task")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guides/tutorials/review_app/"},"Reviewing task results")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guides/how_to_use/providers/prolific/intro/"},"Prolific overview"))))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[7356],{4127:function(e,t,r){r.d(t,{Zo:function(){return c},kt:function(){return k}});var n=r(1987);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=n.createContext({}),p=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},c=function(e){var t=p(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=p(r),d=o,k=u["".concat(l,".").concat(d)]||u[d]||m[d]||a;return r?n.createElement(k,i(i({ref:t},c),{},{components:r})):n.createElement(k,i({ref:t},c))}));function k(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[u]="string"==typeof e?e:o,i[1]=s;for(var p=2;p\n"))),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Run you first example (a simple form-based task):"),(0,a.kt)("pre",{parentName:"li"},(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 3001:3000 \\\n --rm mephisto_dc \\\n python /mephisto/examples/form_composer_demo/run_task__local__inhouse.py\n"))),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"After the script finishes building, in your console output you will see URLs like this: ",(0,a.kt)("inlineCode",{parentName:"p"},"localhost:3000/?worker_id=x&id=1"),". Each URL represents a unit of your Task. Copy them one-by-one into your browser, changing port from ",(0,a.kt)("inlineCode",{parentName:"p"},"3000")," to ",(0,a.kt)("inlineCode",{parentName:"p"},"3001"),".")),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"After completing all units, you will see your task automatically shut down")),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Now we are ready to review Task results. Run command:"),(0,a.kt)("pre",{parentName:"li"},(0,a.kt)("code",{parentName:"pre"},"```shell\ndocker-compose -f docker/docker-compose.dev.yml run \\\n --build \\\n --publish 8081:8000 \\\n --rm mephisto_dc \\\n mephisto review_app --host 0.0.0.0 --port 8000\n```\n")),(0,a.kt)("p",{parentName:"li"},"and open TaskReview app in your browser at ",(0,a.kt)("a",{parentName:"p",href:"http://localhost:8081"},"http://localhost:8081"))),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Click on your Task name, and review the task units (that you have just completed yourself earlier)."))),(0,a.kt)("p",null,"Congratulations - you have just run and reviewed your very first task!"),(0,a.kt)("hr",null),(0,a.kt)("h2",{id:"next-steps"},"Next Steps"),(0,a.kt)("p",null,"To understand how to customize Mephisto to your specific needs, we recommend these chapters:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guides/tutorials/first_task/"},"Running your first task")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guides/tutorials/review_app/"},"Reviewing task results")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/guides/how_to_use/providers/prolific/intro/"},"Prolific overview"))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.dcd77e98.js b/assets/js/935f2afb.17d5aa34.js similarity index 69% rename from assets/js/935f2afb.dcd77e98.js rename to assets/js/935f2afb.17d5aa34.js index f576b4390..531f2a85b 100644 --- a/assets/js/935f2afb.dcd77e98.js +++ b/assets/js/935f2afb.17d5aa34.js @@ -1 +1 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[53],{4612:function(e){e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"guides":[{"type":"link","label":"10-minute Quickstart","href":"/docs/guides/quickstart","docId":"guides/quickstart"},{"type":"category","label":"Tutorials + Getting Started","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Running your first task","href":"/docs/guides/tutorials/first_task","docId":"guides/tutorials/first_task"},{"type":"link","label":"Working on a custom task","href":"/docs/guides/tutorials/custom_react","docId":"guides/tutorials/custom_react"},{"type":"link","label":"Introducing worker controls","href":"/docs/guides/tutorials/worker_controls","docId":"guides/tutorials/worker_controls"},{"type":"link","label":"Developing a workflow","href":"/docs/guides/tutorials/workflows","docId":"guides/tutorials/workflows"},{"type":"link","label":"Reviewing task results","href":"/docs/guides/tutorials/review_app","docId":"guides/tutorials/review_app"},{"type":"link","label":"Run form-based tasks","href":"/docs/guides/tutorials/form_composer","docId":"guides/tutorials/form_composer"},{"type":"link","label":"Run model-in-the-loop tasks","href":"/docs/guides/tutorials/model_in_the_loop","docId":"guides/tutorials/model_in_the_loop"}]},{"type":"category","label":"In-depth use","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"Creating a Task","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Developing and debugging frontends","href":"/docs/guides/how_to_use/task_creation/developing_frontends","docId":"guides/how_to_use/task_creation/developing_frontends"},{"type":"link","label":"How task run works","href":"/docs/guides/how_to_use/task_creation/task_run","docId":"guides/how_to_use/task_creation/task_run"},{"type":"link","label":"Hosting task assets","href":"/docs/guides/how_to_use/task_creation/hosting_assets","docId":"guides/how_to_use/task_creation/hosting_assets"}]},{"type":"category","label":"Worker Experience","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Mephisto Task Addons","href":"/docs/guides/how_to_use/worker_experience/mephisto-task-addons","docId":"guides/how_to_use/worker_experience/mephisto-task-addons"},{"type":"link","label":"WorkerOpinion widget","href":"/docs/guides/how_to_use/worker_experience/worker_opinion","docId":"guides/how_to_use/worker_experience/worker_opinion"}]},{"type":"category","label":"Worker Quality Control","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Using qualifications to improve worker quality","href":"/docs/guides/how_to_use/worker_quality/common_qualification_flows","docId":"guides/how_to_use/worker_quality/common_qualification_flows"},{"type":"link","label":"Managing worker qualifications","href":"/docs/guides/how_to_use/worker_quality/managing_worker_qualifications","docId":"guides/how_to_use/worker_quality/managing_worker_qualifications"},{"type":"link","label":"Teach potential workers with Onboarding","href":"/docs/guides/how_to_use/worker_quality/using_onboarding","docId":"guides/how_to_use/worker_quality/using_onboarding"},{"type":"link","label":"Check worker quality with Screening Units","href":"/docs/guides/how_to_use/worker_quality/using_screen_units","docId":"guides/how_to_use/worker_quality/using_screen_units"},{"type":"link","label":"Check against standards with Gold Labels","href":"/docs/guides/how_to_use/worker_quality/using_golds","docId":"guides/how_to_use/worker_quality/using_golds"},{"type":"link","label":"Other methods for quality control","href":"/docs/guides/how_to_use/worker_quality/other_methods","docId":"guides/how_to_use/worker_quality/other_methods"}]},{"type":"category","label":"Efficiency and Organization","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Use the same configs across tasks","href":"/docs/guides/how_to_use/efficiency_organization/reusing_configs","docId":"guides/how_to_use/efficiency_organization/reusing_configs"},{"type":"link","label":"View task health and status with Mephisto Metrics","href":"/docs/guides/how_to_use/efficiency_organization/metrics_dashboard","docId":"guides/how_to_use/efficiency_organization/metrics_dashboard"},{"type":"link","label":"Running Mephisto with Docker","href":"/docs/guides/how_to_use/efficiency_organization/docker","docId":"guides/how_to_use/efficiency_organization/docker"},{"type":"link","label":"Manually installing Mephisto","href":"/docs/guides/how_to_use/efficiency_organization/manual_installation","docId":"guides/how_to_use/efficiency_organization/manual_installation"},{"type":"link","label":"Common Configurations and FAQs","href":"/docs/guides/how_to_use/efficiency_organization/config_faq","docId":"guides/how_to_use/efficiency_organization/config_faq"}]},{"type":"category","label":"Reviewing task results","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Overview","href":"/docs/guides/how_to_use/review_app/overview","docId":"guides/how_to_use/review_app/overview"},{"type":"link","label":"Run TaskReview app","href":"/docs/guides/how_to_use/review_app/running","docId":"guides/how_to_use/review_app/running"},{"type":"link","label":"Enable unit preview in TaskReview app","href":"/docs/guides/how_to_use/review_app/enabling_original_unit_preview","docId":"guides/how_to_use/review_app/enabling_original_unit_preview"},{"type":"link","label":"Enable Responses Histogram","href":"/docs/guides/how_to_use/review_app/enabling_responses_histogram","docId":"guides/how_to_use/review_app/enabling_responses_histogram"},{"type":"link","label":"TaskReview app API","href":"/docs/guides/how_to_use/review_app/server_api","docId":"guides/how_to_use/review_app/server_api"},{"type":"link","label":"TaskReview app flow","href":"/docs/guides/how_to_use/review_app/diagram","docId":"guides/how_to_use/review_app/diagram"}]},{"type":"category","label":"Form-based tasks","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"FormComposer overview","href":"/docs/guides/how_to_use/form_composer/overview","docId":"guides/how_to_use/form_composer/overview"},{"type":"link","label":"Run FormComposer tasks","href":"/docs/guides/how_to_use/form_composer/running","docId":"guides/how_to_use/form_composer/running"},{"type":"category","label":"Configure FormComposer tasks","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Config files reference","href":"/docs/guides/how_to_use/form_composer/configuration/config_files","docId":"guides/how_to_use/form_composer/configuration/config_files"},{"type":"link","label":"Multiple form versions","href":"/docs/guides/how_to_use/form_composer/configuration/multiple_form_versions","docId":"guides/how_to_use/form_composer/configuration/multiple_form_versions"},{"type":"link","label":"`form_composer config` command","href":"/docs/guides/how_to_use/form_composer/configuration/form_composer_config_command","docId":"guides/how_to_use/form_composer/configuration/form_composer_config_command"},{"type":"link","label":"FormComposer configuration","href":"/docs/guides/how_to_use/form_composer/configuration/setup","docId":"guides/how_to_use/form_composer/configuration/setup"},{"type":"link","label":"Form rendering callbacks","href":"/docs/guides/how_to_use/form_composer/configuration/form_callbacks","docId":"guides/how_to_use/form_composer/configuration/form_callbacks"},{"type":"link","label":"Using code insertions","href":"/docs/guides/how_to_use/form_composer/configuration/insertions","docId":"guides/how_to_use/form_composer/configuration/insertions"}]},{"type":"link","label":"Embed FormComposer into custom application","href":"/docs/guides/how_to_use/form_composer/embedding","docId":"guides/how_to_use/form_composer/embedding"}]},{"type":"category","label":"Video annotation tasks","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"VideoAnnotator overview","href":"/docs/guides/how_to_use/video_annotator/overview","docId":"guides/how_to_use/video_annotator/overview"},{"type":"link","label":"Run VideoAnnotator tasks","href":"/docs/guides/how_to_use/video_annotator/running","docId":"guides/how_to_use/video_annotator/running"},{"type":"category","label":"Configure VideoAnnotator tasks","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Config files reference","href":"/docs/guides/how_to_use/video_annotator/configuration/config_files","docId":"guides/how_to_use/video_annotator/configuration/config_files"},{"type":"link","label":"Multiple annotator versions","href":"/docs/guides/how_to_use/video_annotator/configuration/multiple_annotator_versions","docId":"guides/how_to_use/video_annotator/configuration/multiple_annotator_versions"},{"type":"link","label":"`video_annotator config` command","href":"/docs/guides/how_to_use/video_annotator/configuration/video_annotator_config_command","docId":"guides/how_to_use/video_annotator/configuration/video_annotator_config_command"},{"type":"link","label":"VideoAnnotator configuration","href":"/docs/guides/how_to_use/video_annotator/configuration/setup","docId":"guides/how_to_use/video_annotator/configuration/setup"},{"type":"link","label":"Segment rendering callbacks","href":"/docs/guides/how_to_use/video_annotator/configuration/form_callbacks","docId":"guides/how_to_use/video_annotator/configuration/form_callbacks"},{"type":"link","label":"Using code insertions","href":"/docs/guides/how_to_use/video_annotator/configuration/insertions","docId":"guides/how_to_use/video_annotator/configuration/insertions"}]},{"type":"link","label":"Embed VideoAnnotator into custom application","href":"/docs/guides/how_to_use/video_annotator/embedding","docId":"guides/how_to_use/video_annotator/embedding"}]},{"type":"category","label":"JS packages","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Mephisto Packages","href":"/docs/guides/how_to_use/js_packages/main","docId":"guides/how_to_use/js_packages/main"},{"type":"link","label":"Custom packages","href":"/docs/guides/how_to_use/js_packages/custom","docId":"guides/how_to_use/js_packages/custom"}]},{"type":"category","label":"Providers","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"Prolific","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Prolific overview","href":"/docs/guides/how_to_use/providers/prolific/intro","docId":"guides/how_to_use/providers/prolific/intro"},{"type":"link","label":"Steps of running a Study","href":"/docs/guides/how_to_use/providers/prolific/running_study","docId":"guides/how_to_use/providers/prolific/running_study"},{"type":"link","label":"Participant Eligibility Requirements","href":"/docs/guides/how_to_use/providers/prolific/eligibility_requirements","docId":"guides/how_to_use/providers/prolific/eligibility_requirements"},{"type":"link","label":"Prolific API oddities","href":"/docs/guides/how_to_use/providers/prolific/prolific_api_oddities","docId":"guides/how_to_use/providers/prolific/prolific_api_oddities"},{"type":"link","label":"Prolific Python SDK","href":"/docs/guides/how_to_use/providers/prolific/prolific_python_sdk","docId":"guides/how_to_use/providers/prolific/prolific_python_sdk"}]},{"type":"link","label":"MTurk","href":"/docs/guides/how_to_use/providers/mturk","docId":"guides/how_to_use/providers/mturk"}]},{"type":"category","label":"Move data around","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Simple usage","href":"/docs/guides/how_to_use/data_porter/simple_usage","docId":"guides/how_to_use/data_porter/simple_usage"},{"type":"link","label":"Reference","href":"/docs/guides/how_to_use/data_porter/reference","docId":"guides/how_to_use/data_porter/reference"},{"type":"link","label":"Custom conflict resolver","href":"/docs/guides/how_to_use/data_porter/custom_conflict_resolver","docId":"guides/how_to_use/data_porter/custom_conflict_resolver"}]}]},{"type":"category","label":"How to Contribute","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Contributing to Mephisto","href":"/docs/guides/how_to_contribute/getting_started","docId":"guides/how_to_contribute/getting_started"},{"type":"link","label":"Frontend setup","href":"/docs/guides/how_to_contribute/frontend_development","docId":"guides/how_to_contribute/frontend_development"},{"type":"link","label":"Backend setup","href":"/docs/guides/how_to_contribute/backend_development","docId":"guides/how_to_contribute/backend_development"},{"type":"link","label":"Database migrations","href":"/docs/guides/how_to_contribute/db_migrations","docId":"guides/how_to_contribute/db_migrations"},{"type":"link","label":"Updating documentation","href":"/docs/guides/how_to_contribute/documentation","docId":"guides/how_to_contribute/documentation"},{"type":"link","label":"Known issues","href":"/docs/guides/how_to_contribute/known_issues","docId":"guides/how_to_contribute/known_issues"}]}],"explanations":[{"type":"link","label":"architecture_overview","href":"/docs/explanations/architecture_overview","docId":"explanations/architecture_overview"},{"type":"link","label":"Mephisto Abstractions","href":"/docs/explanations/abstractions_overview","docId":"explanations/abstractions_overview"},{"type":"link","label":"Architect API","href":"/docs/explanations/architect_api","docId":"explanations/architect_api"}],"reference":[{"type":"link","label":"Overview","href":"/docs/reference/overview","docId":"reference/overview"},{"type":"link","label":"Architects","href":"/docs/reference/architects","docId":"reference/architects"},{"type":"link","label":"Blueprints","href":"/docs/reference/blueprints","docId":"reference/blueprints"},{"type":"link","label":"Providers","href":"/docs/reference/providers","docId":"reference/providers"},{"type":"link","label":"Requesters","href":"/docs/reference/requesters","docId":"reference/requesters"},{"type":"link","label":"Tasks","href":"/docs/reference/tasks","docId":"reference/tasks"}]},"docs":{"explanations/abstractions_overview":{"id":"explanations/abstractions_overview","title":"Mephisto Abstractions","description":"This document seeks to explain the ideas that guided the creation of Mephisto. It will speak about the broad categories of how Mephisto works and how these parts are supposed to play together. It speaks a lot about the design goals of the Mephisto architecture. It isn\'t a perfect 1:1 representation of how the code is organized at the moment, but rather the ideal we were striving to reach. Understanding these ideals makes it easier to understand Mephisto, both for usage and for joining in on development.","sidebar":"explanations"},"explanations/architect_api":{"id":"explanations/architect_api","title":"Architect API","description":"The Architect API is what allows Mephisto to completely abstract away the process of getting workers to operate in Mephisto tasks. In short, it aims to cover 4 primary functions:","sidebar":"explanations"},"explanations/architecture_overview":{"id":"explanations/architecture_overview","title":"architecture_overview","description":"Architecture diagram","sidebar":"explanations"},"guides/how_to_contribute/backend_development":{"id":"guides/how_to_contribute/backend_development","title":"Backend setup","description":"We use pre-commit to enforce code styles on the code base (using black for Python and prettier for Javascript).","sidebar":"guides"},"guides/how_to_contribute/db_migrations":{"id":"guides/how_to_contribute/db_migrations","title":"Database migrations","description":"Overview","sidebar":"guides"},"guides/how_to_contribute/documentation":{"id":"guides/how_to_contribute/documentation","title":"Updating documentation","description":"For large functionality changes, please remember to update mephisto.ai documentation.","sidebar":"guides"},"guides/how_to_contribute/frontend_development":{"id":"guides/how_to_contribute/frontend_development","title":"Frontend setup","description":"We use pre-commit to enforce code styles on the code base (using black for Python and prettier for Javascript).","sidebar":"guides"},"guides/how_to_contribute/getting_started":{"id":"guides/how_to_contribute/getting_started","title":"Contributing to Mephisto","description":"Mephisto is built for developing on, but developing for Mephisto can sometimes be unclear. We aim to provide some guides on contributions for abstractions, underlying infrastructure, or developer experience, but oftentimes the best resource will be opening an issue on our Github directly.","sidebar":"guides"},"guides/how_to_contribute/known_issues":{"id":"guides/how_to_contribute/known_issues","title":"Known issues","description":"While we strive to make Mephisto work its best, there are a few \\"perennial\\" issues to be aware of:","sidebar":"guides"},"guides/how_to_use/data_porter/custom_conflict_resolver":{"id":"guides/how_to_use/data_porter/custom_conflict_resolver","title":"Custom conflict resolver","description":"When importing dump data into local DB, some rows may refer to the same object","sidebar":"guides"},"guides/how_to_use/data_porter/reference":{"id":"guides/how_to_use/data_porter/reference","title":"Reference","description":"This is a reference describing set of commands under the mephisto db command group.","sidebar":"guides"},"guides/how_to_use/data_porter/simple_usage":{"id":"guides/how_to_use/data_porter/simple_usage","title":"Simple usage","description":"Introduction","sidebar":"guides"},"guides/how_to_use/efficiency_organization/config_faq":{"id":"guides/how_to_use/efficiency_organization/config_faq","title":"Common Configurations and FAQs","description":"This document contains some Mephisto usage patterns that should be fairly common, as well as usage tips and other know-how.","sidebar":"guides"},"guides/how_to_use/efficiency_organization/docker":{"id":"guides/how_to_use/efficiency_organization/docker","title":"Running Mephisto with Docker","description":"You may want to keep Mephisto environment entirely contained, and set it up with just a few commands. To do this, we support Docker and Docker Compose as a launch option.","sidebar":"guides"},"guides/how_to_use/efficiency_organization/manual_installation":{"id":"guides/how_to_use/efficiency_organization/manual_installation","title":"Manually installing Mephisto","description":"We strongly recommend running Mephisto with Docker as we\'ve shown in all included task examples.","sidebar":"guides"},"guides/how_to_use/efficiency_organization/metrics_dashboard":{"id":"guides/how_to_use/efficiency_organization/metrics_dashboard","title":"View task health and status with Mephisto Metrics","description":"Mephisto provides an optional extension to view task health metrics via dashboard using Prometheus and Grafana. This lets you see the progress of your task with the following:","sidebar":"guides"},"guides/how_to_use/efficiency_organization/reusing_configs":{"id":"guides/how_to_use/efficiency_organization/reusing_configs","title":"Use the same configs across tasks","description":"As you begin launching many Mephisto tasks, you may find that there are some specific argument options that you frequently use across multiple tasks. Mephisto provides a way to reuse these types of configurations with profiles.","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/config_files":{"id":"guides/how_to_use/form_composer/configuration/config_files","title":"Config files reference","description":"This section is a reference on FormComposer\'s standard configuration files and object attributes.","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/form_callbacks":{"id":"guides/how_to_use/form_composer/configuration/form_callbacks","title":"Form rendering callbacks","description":"During rendering of a Task in the browser, we may send calls to the server-side for additional data. In Mephisto, API views servicing such requests are called \\"remote procedures\\".","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/form_composer_config_command":{"id":"guides/how_to_use/form_composer/configuration/form_composer_config_command","title":"`form_composer config` command","description":"The form_composer config utility command helps auto-generate FormComposer config. It supports several options:","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/insertions":{"id":"guides/how_to_use/form_composer/configuration/insertions","title":"Using code insertions","description":"FormComposer allows using custom code insertions in these scenarios:","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/multiple_form_versions":{"id":"guides/how_to_use/form_composer/configuration/multiple_form_versions","title":"Multiple form versions","description":"The simplest Task scenario is showing the same exact form to all of your workers. In that case you need to:","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/setup":{"id":"guides/how_to_use/form_composer/configuration/setup","title":"FormComposer configuration","description":"FormComposer tasks are fully defined by their configuration files. These files comprise:","sidebar":"guides"},"guides/how_to_use/form_composer/embedding":{"id":"guides/how_to_use/form_composer/embedding","title":"Embed FormComposer into custom application","description":"A few tips if you wish to embed FormComposer in your custom application:","sidebar":"guides"},"guides/how_to_use/form_composer/overview":{"id":"guides/how_to_use/form_composer/overview","title":"FormComposer overview","description":"You can easily generate form-based Tasks using our FormComposer task generator feature. It produces clean cross-platform Bootstrap forms with client-side form validation.","sidebar":"guides"},"guides/how_to_use/form_composer/running":{"id":"guides/how_to_use/form_composer/running","title":"Run FormComposer tasks","description":"To create and launch a FormComposer task, first create your JSON form configuration,","sidebar":"guides"},"guides/how_to_use/js_packages/custom":{"id":"guides/how_to_use/js_packages/custom","title":"Custom packages","description":"If you want to customize existing packages or create a new one, you can place them into packages directory (and update installed dependencies list in your package.json accordingly).","sidebar":"guides"},"guides/how_to_use/js_packages/main":{"id":"guides/how_to_use/js_packages/main","title":"Mephisto Packages","description":"Mephisto repository contains JavaScript libraries that are located in packages directory.","sidebar":"guides"},"guides/how_to_use/providers/mturk":{"id":"guides/how_to_use/providers/mturk","title":"MTurk","description":"Set up MTurk","sidebar":"guides"},"guides/how_to_use/providers/prolific/eligibility_requirements":{"id":"guides/how_to_use/providers/prolific/eligibility_requirements","title":"Participant Eligibility Requirements","description":"Prolific offers Eligibility Requirements to limit access to your Task (or Study, as Prolific calls it)","sidebar":"guides"},"guides/how_to_use/providers/prolific/intro":{"id":"guides/how_to_use/providers/prolific/intro","title":"Prolific overview","description":"Mephisto supports integration with Prolific human cloud provider.","sidebar":"guides"},"guides/how_to_use/providers/prolific/prolific_api_oddities":{"id":"guides/how_to_use/providers/prolific/prolific_api_oddities","title":"Prolific API oddities","description":"Last updated 2023.07.08","sidebar":"guides"},"guides/how_to_use/providers/prolific/prolific_python_sdk":{"id":"guides/how_to_use/providers/prolific/prolific_python_sdk","title":"Prolific Python SDK","description":"Prolific does not provide a Python implementation of the client.","sidebar":"guides"},"guides/how_to_use/providers/prolific/running_study":{"id":"guides/how_to_use/providers/prolific/running_study","title":"Steps of running a Study","description":"1. Create inactive Study during TaskRun launch, set its totalavailableplaces = None.","sidebar":"guides"},"guides/how_to_use/review_app/diagram":{"id":"guides/how_to_use/review_app/diagram","title":"TaskReview app flow","description":"Here is how TaskReview app works under the hood to enable review of Task results in a local web browser.","sidebar":"guides"},"guides/how_to_use/review_app/enabling_original_unit_preview":{"id":"guides/how_to_use/review_app/enabling_original_unit_preview","title":"Enable unit preview in TaskReview app","description":"By default, TaskReview app UI always shows a generic results view (i.e. unit content submitted by worker in the format saved by AgentState, such as data/data/runs/...../agent_data.json content).","sidebar":"guides"},"guides/how_to_use/review_app/enabling_responses_histogram":{"id":"guides/how_to_use/review_app/enabling_responses_histogram","title":"Enable Responses Histogram","description":"Some tasks can display simple histograms with response frequencies.","sidebar":"guides"},"guides/how_to_use/review_app/overview":{"id":"guides/how_to_use/review_app/overview","title":"Overview","description":"Generally, to view/export the data, you could write a Python script using the Mephisto DataBrowser class to access the submitted data.","sidebar":"guides"},"guides/how_to_use/review_app/running":{"id":"guides/how_to_use/review_app/running","title":"Run TaskReview app","description":"Run with Docker","sidebar":"guides"},"guides/how_to_use/review_app/server_api":{"id":"guides/how_to_use/review_app/server_api","title":"TaskReview app API","description":"If you wish to customize or improve the TaskReview app, it\'s helpful to know how its UI and server parts interact.","sidebar":"guides"},"guides/how_to_use/task_creation/developing_frontends":{"id":"guides/how_to_use/task_creation/developing_frontends","title":"Developing and debugging frontends","description":"The mephisto-core package","sidebar":"guides"},"guides/how_to_use/task_creation/hosting_assets":{"id":"guides/how_to_use/task_creation/hosting_assets","title":"Hosting task assets","description":"Generally there are two models for hosting assets related to a task, with distinct tradeoffs. These are to upload files to the routing server, or to store the files locally on Mephisto and share the data on connection. The former is generally the easier solution.","sidebar":"guides"},"guides/how_to_use/task_creation/task_run":{"id":"guides/how_to_use/task_creation/task_run","title":"How task run works","description":"Let\'s understand basic components of the task launch, such as configs and the run_task.py script. This will help with customization of tash launch behaviors.","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/config_files":{"id":"guides/how_to_use/video_annotator/configuration/config_files","title":"Config files reference","description":"This section is a reference on VideoAnnotators\'s standard configuration files and object attributes.","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/form_callbacks":{"id":"guides/how_to_use/video_annotator/configuration/form_callbacks","title":"Segment rendering callbacks","description":"During rendering of a Task in the browser, we may send calls to the server-side for additional data. In Mephisto, API views servicing such requests are called \\"remote procedures\\".","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/insertions":{"id":"guides/how_to_use/video_annotator/configuration/insertions","title":"Using code insertions","description":"VideoAnnotator allows using custom code insertions in these scenarios:","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/multiple_annotator_versions":{"id":"guides/how_to_use/video_annotator/configuration/multiple_annotator_versions","title":"Multiple annotator versions","description":"The simplest Task scenario is showing the same exact annotator to all of your workers. In that case you need to:","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/setup":{"id":"guides/how_to_use/video_annotator/configuration/setup","title":"VideoAnnotator configuration","description":"VideoAnnotator tasks are fully defined by their configuration files. These files comprise:","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/video_annotator_config_command":{"id":"guides/how_to_use/video_annotator/configuration/video_annotator_config_command","title":"`video_annotator config` command","description":"The video_annotator config utility command helps auto-generate VideoAnnotator config. It supports several options:","sidebar":"guides"},"guides/how_to_use/video_annotator/embedding":{"id":"guides/how_to_use/video_annotator/embedding","title":"Embed VideoAnnotator into custom application","description":"A few tips if you wish to embed VideoAnnotator in your custom application:","sidebar":"guides"},"guides/how_to_use/video_annotator/overview":{"id":"guides/how_to_use/video_annotator/overview","title":"VideoAnnotator overview","description":"You can easily generate tasks to annotate any preuploaded video with our VideoAnnotator feature.","sidebar":"guides"},"guides/how_to_use/video_annotator/running":{"id":"guides/how_to_use/video_annotator/running","title":"Run VideoAnnotator tasks","description":"To create and launch a VideoAnnotator task, first create your JSON form configuration,","sidebar":"guides"},"guides/how_to_use/worker_experience/mephisto-task-addons":{"id":"guides/how_to_use/worker_experience/mephisto-task-addons","title":"Mephisto Task Addons","description":"Overview","sidebar":"guides"},"guides/how_to_use/worker_experience/worker_opinion":{"id":"guides/how_to_use/worker_experience/worker_opinion","title":"WorkerOpinion widget","description":"Workers can leave their feedback about a Task if you add a WorkerOpinion feature to it.","sidebar":"guides"},"guides/how_to_use/worker_quality/common_qualification_flows":{"id":"guides/how_to_use/worker_quality/common_qualification_flows","title":"Using qualifications to improve worker quality","description":"Qualification control is a powerful component of Mephisto, allowing you to filter out workers with both manual and automatic controls. Within this are typical allowlists and blocklists, setting up value-based qualifications, making automatic qualifications for onboarding, and also utilizing the qualifications that various crowdsourcing providers have to offer. This document seeks to describe some common use cases for qualifications, and how we currently go about using them.","sidebar":"guides"},"guides/how_to_use/worker_quality/managing_worker_qualifications":{"id":"guides/how_to_use/worker_quality/managing_worker_qualifications","title":"Managing worker qualifications","description":"You can easily manage qualification via TaskReview app UI.","sidebar":"guides"},"guides/how_to_use/worker_quality/other_methods":{"id":"guides/how_to_use/worker_quality/other_methods","title":"Other methods for quality control","description":"While not yet implemented in Mephisto\'s core codebase, there are a few additional methods of quality control that may be successful. This doc lists a few that we\'ve considered for Mephisto thusfar.","sidebar":"guides"},"guides/how_to_use/worker_quality/using_golds":{"id":"guides/how_to_use/worker_quality/using_golds","title":"Check against standards with Gold Labels","description":"Gold labeling is commonly used for ensuring worker quality over the full duration of a task. It\'s valuable as an automated measure to track the consistency your workers. For this Mephisto provides the UseGoldUnit blueprint mixin.","sidebar":"guides"},"guides/how_to_use/worker_quality/using_onboarding":{"id":"guides/how_to_use/worker_quality/using_onboarding","title":"Teach potential workers with Onboarding","description":"The first step to getting quality data is describing your task properly and ensuring that workers have understood your instructions.","sidebar":"guides"},"guides/how_to_use/worker_quality/using_screen_units":{"id":"guides/how_to_use/worker_quality/using_screen_units","title":"Check worker quality with Screening Units","description":"Screening units help filter out low-quality work,","sidebar":"guides"},"guides/quickstart":{"id":"guides/quickstart","title":"10-minute Quickstart","description":"1. Install Docker and Docker Compose following their official documentation","sidebar":"guides"},"guides/tutorials/custom_react":{"id":"guides/tutorials/custom_react","title":"Working on a custom task","description":"Now that you\'ve launched a task or two, it\'s time to get into building your own. This tutorial focuses on giving you the tools to collect the specific data you\'re looking for by building a task of your own. This tutorial itself won\'t produce a useful task, but it should be useful for understanding how to go about creating a real one. You don\'t need_ any React experience to get through this guide, though it will be helpful for understanding the usage more deeply.","sidebar":"guides"},"guides/tutorials/first_task":{"id":"guides/tutorials/first_task","title":"Running your first task","description":"So you want to launch your first task.","sidebar":"guides"},"guides/tutorials/form_composer":{"id":"guides/tutorials/form_composer","title":"Run form-based tasks","description":"If your task has questionnaire format, you can build it out-of-the box with no custom code, by using our FormComposer task generator. All you need to do is to specify your JSON-based form configuration, and run a few commands.","sidebar":"guides"},"guides/tutorials/model_in_the_loop":{"id":"guides/tutorials/model_in_the_loop","title":"Run model-in-the-loop tasks","description":"Mephisto allows to create interactive Tasks where worker can interact with the server during completion of their Task.","sidebar":"guides"},"guides/tutorials/review_app":{"id":"guides/tutorials/review_app","title":"Reviewing task results","description":"Once you\'ve installed Mephisto, you have access to the mephisto command line utility,","sidebar":"guides"},"guides/tutorials/worker_controls":{"id":"guides/tutorials/worker_controls","title":"Introducing worker controls","description":"Now that you have a task to show workers, in order to get quality data you\'ll want to include a mix of automated and manual reviewing. This guide introduces onboarding, which is a good opportunity to provide workers with a simple test to ensure they read and understand task instructions. A more in-depth guide into their use can be found here. We expect familiarity with React\'s core concepts to understand the frontend part of this tutorial.","sidebar":"guides"},"guides/tutorials/workflows":{"id":"guides/tutorials/workflows","title":"Developing a workflow","description":"While it\'s nice to imagine that you\'ll be able to collect quality data on the first pass, crowdsourcing can be a bit more trial-and-error. This guide focuses on setting up a good workflow, and extending your run-script to support additional functionality.","sidebar":"guides"},"reference/architects":{"id":"reference/architects","title":"Architects","description":"Architects contain the logic surrounding deploying a server that workers will be able to access.","sidebar":"reference"},"reference/blueprints":{"id":"reference/blueprints","title":"Blueprints","description":"The blueprints contain all of the related code required to set up a task run.","sidebar":"reference"},"reference/overview":{"id":"reference/overview","title":"Overview","description":"Our Python API documentation can be found here.","sidebar":"reference"},"reference/providers":{"id":"reference/providers","title":"Providers","description":"Crowd providers standardize access to external crowd workers, by wrapping external API communication through a standardized interface.","sidebar":"reference"},"reference/requesters":{"id":"reference/requesters","title":"Requesters","description":"Requesters are Mephisto\'s wrapper around an identity for a CrowdProvider, usually storing the credentials for an account to launch tasks from.","sidebar":"reference"},"reference/tasks":{"id":"reference/tasks","title":"Tasks","description":"The tasks contain all of the related code required to set up a task run.","sidebar":"reference"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[53],{4612:function(e){e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"guides":[{"type":"link","label":"10-minute Quickstart","href":"/docs/guides/quickstart","docId":"guides/quickstart"},{"type":"category","label":"Tutorials + Getting Started","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Running your first task","href":"/docs/guides/tutorials/first_task","docId":"guides/tutorials/first_task"},{"type":"link","label":"Working on a custom task","href":"/docs/guides/tutorials/custom_react","docId":"guides/tutorials/custom_react"},{"type":"link","label":"Introducing worker controls","href":"/docs/guides/tutorials/worker_controls","docId":"guides/tutorials/worker_controls"},{"type":"link","label":"Developing a workflow","href":"/docs/guides/tutorials/workflows","docId":"guides/tutorials/workflows"},{"type":"link","label":"Reviewing task results","href":"/docs/guides/tutorials/review_app","docId":"guides/tutorials/review_app"},{"type":"link","label":"Run form-based tasks","href":"/docs/guides/tutorials/form_composer","docId":"guides/tutorials/form_composer"},{"type":"link","label":"Run model-in-the-loop tasks","href":"/docs/guides/tutorials/model_in_the_loop","docId":"guides/tutorials/model_in_the_loop"}]},{"type":"category","label":"In-depth use","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"Creating a Task","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Developing and debugging frontends","href":"/docs/guides/how_to_use/task_creation/developing_frontends","docId":"guides/how_to_use/task_creation/developing_frontends"},{"type":"link","label":"How task run works","href":"/docs/guides/how_to_use/task_creation/task_run","docId":"guides/how_to_use/task_creation/task_run"},{"type":"link","label":"Hosting task assets","href":"/docs/guides/how_to_use/task_creation/hosting_assets","docId":"guides/how_to_use/task_creation/hosting_assets"}]},{"type":"category","label":"Worker Experience","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Mephisto Task Addons","href":"/docs/guides/how_to_use/worker_experience/mephisto-task-addons","docId":"guides/how_to_use/worker_experience/mephisto-task-addons"},{"type":"link","label":"WorkerOpinion widget","href":"/docs/guides/how_to_use/worker_experience/worker_opinion","docId":"guides/how_to_use/worker_experience/worker_opinion"}]},{"type":"category","label":"Worker Quality Control","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Using qualifications to improve worker quality","href":"/docs/guides/how_to_use/worker_quality/common_qualification_flows","docId":"guides/how_to_use/worker_quality/common_qualification_flows"},{"type":"link","label":"Managing worker qualifications","href":"/docs/guides/how_to_use/worker_quality/managing_worker_qualifications","docId":"guides/how_to_use/worker_quality/managing_worker_qualifications"},{"type":"link","label":"Teach potential workers with Onboarding","href":"/docs/guides/how_to_use/worker_quality/using_onboarding","docId":"guides/how_to_use/worker_quality/using_onboarding"},{"type":"link","label":"Check worker quality with Screening Units","href":"/docs/guides/how_to_use/worker_quality/using_screen_units","docId":"guides/how_to_use/worker_quality/using_screen_units"},{"type":"link","label":"Check against standards with Gold Labels","href":"/docs/guides/how_to_use/worker_quality/using_golds","docId":"guides/how_to_use/worker_quality/using_golds"},{"type":"link","label":"Other methods for quality control","href":"/docs/guides/how_to_use/worker_quality/other_methods","docId":"guides/how_to_use/worker_quality/other_methods"}]},{"type":"category","label":"Efficiency and Organization","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Use the same configs across tasks","href":"/docs/guides/how_to_use/efficiency_organization/reusing_configs","docId":"guides/how_to_use/efficiency_organization/reusing_configs"},{"type":"link","label":"View task health and status with Mephisto Metrics","href":"/docs/guides/how_to_use/efficiency_organization/metrics_dashboard","docId":"guides/how_to_use/efficiency_organization/metrics_dashboard"},{"type":"link","label":"Running Mephisto with Docker","href":"/docs/guides/how_to_use/efficiency_organization/docker","docId":"guides/how_to_use/efficiency_organization/docker"},{"type":"link","label":"Manually installing Mephisto","href":"/docs/guides/how_to_use/efficiency_organization/manual_installation","docId":"guides/how_to_use/efficiency_organization/manual_installation"},{"type":"link","label":"Common Configurations and FAQs","href":"/docs/guides/how_to_use/efficiency_organization/config_faq","docId":"guides/how_to_use/efficiency_organization/config_faq"}]},{"type":"category","label":"Reviewing task results","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Overview","href":"/docs/guides/how_to_use/review_app/overview","docId":"guides/how_to_use/review_app/overview"},{"type":"link","label":"Run TaskReview app","href":"/docs/guides/how_to_use/review_app/running","docId":"guides/how_to_use/review_app/running"},{"type":"link","label":"Enable unit preview in TaskReview app","href":"/docs/guides/how_to_use/review_app/enabling_original_unit_preview","docId":"guides/how_to_use/review_app/enabling_original_unit_preview"},{"type":"link","label":"Enable Responses Histogram","href":"/docs/guides/how_to_use/review_app/enabling_responses_histogram","docId":"guides/how_to_use/review_app/enabling_responses_histogram"},{"type":"link","label":"TaskReview app API","href":"/docs/guides/how_to_use/review_app/server_api","docId":"guides/how_to_use/review_app/server_api"},{"type":"link","label":"TaskReview app flow","href":"/docs/guides/how_to_use/review_app/diagram","docId":"guides/how_to_use/review_app/diagram"}]},{"type":"category","label":"Form-based tasks","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"FormComposer overview","href":"/docs/guides/how_to_use/form_composer/overview","docId":"guides/how_to_use/form_composer/overview"},{"type":"link","label":"Run FormComposer tasks","href":"/docs/guides/how_to_use/form_composer/running","docId":"guides/how_to_use/form_composer/running"},{"type":"category","label":"Configure FormComposer tasks","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Config files reference","href":"/docs/guides/how_to_use/form_composer/configuration/config_files","docId":"guides/how_to_use/form_composer/configuration/config_files"},{"type":"link","label":"Multiple form versions","href":"/docs/guides/how_to_use/form_composer/configuration/multiple_form_versions","docId":"guides/how_to_use/form_composer/configuration/multiple_form_versions"},{"type":"link","label":"`form_composer config` command","href":"/docs/guides/how_to_use/form_composer/configuration/form_composer_config_command","docId":"guides/how_to_use/form_composer/configuration/form_composer_config_command"},{"type":"link","label":"FormComposer configuration","href":"/docs/guides/how_to_use/form_composer/configuration/setup","docId":"guides/how_to_use/form_composer/configuration/setup"},{"type":"link","label":"Form rendering callbacks","href":"/docs/guides/how_to_use/form_composer/configuration/form_callbacks","docId":"guides/how_to_use/form_composer/configuration/form_callbacks"},{"type":"link","label":"Using code insertions","href":"/docs/guides/how_to_use/form_composer/configuration/insertions","docId":"guides/how_to_use/form_composer/configuration/insertions"}]},{"type":"link","label":"Embed FormComposer into custom application","href":"/docs/guides/how_to_use/form_composer/embedding","docId":"guides/how_to_use/form_composer/embedding"}]},{"type":"category","label":"Video annotation tasks","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"VideoAnnotator overview","href":"/docs/guides/how_to_use/video_annotator/overview","docId":"guides/how_to_use/video_annotator/overview"},{"type":"link","label":"Run VideoAnnotator tasks","href":"/docs/guides/how_to_use/video_annotator/running","docId":"guides/how_to_use/video_annotator/running"},{"type":"category","label":"Configure VideoAnnotator tasks","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Config files reference","href":"/docs/guides/how_to_use/video_annotator/configuration/config_files","docId":"guides/how_to_use/video_annotator/configuration/config_files"},{"type":"link","label":"Multiple annotator versions","href":"/docs/guides/how_to_use/video_annotator/configuration/multiple_annotator_versions","docId":"guides/how_to_use/video_annotator/configuration/multiple_annotator_versions"},{"type":"link","label":"`video_annotator config` command","href":"/docs/guides/how_to_use/video_annotator/configuration/video_annotator_config_command","docId":"guides/how_to_use/video_annotator/configuration/video_annotator_config_command"},{"type":"link","label":"VideoAnnotator configuration","href":"/docs/guides/how_to_use/video_annotator/configuration/setup","docId":"guides/how_to_use/video_annotator/configuration/setup"},{"type":"link","label":"Segment rendering callbacks","href":"/docs/guides/how_to_use/video_annotator/configuration/form_callbacks","docId":"guides/how_to_use/video_annotator/configuration/form_callbacks"},{"type":"link","label":"Using code insertions","href":"/docs/guides/how_to_use/video_annotator/configuration/insertions","docId":"guides/how_to_use/video_annotator/configuration/insertions"}]},{"type":"link","label":"Embed VideoAnnotator into custom application","href":"/docs/guides/how_to_use/video_annotator/embedding","docId":"guides/how_to_use/video_annotator/embedding"}]},{"type":"category","label":"JS packages","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Mephisto Packages","href":"/docs/guides/how_to_use/js_packages/main","docId":"guides/how_to_use/js_packages/main"},{"type":"link","label":"Custom packages","href":"/docs/guides/how_to_use/js_packages/custom","docId":"guides/how_to_use/js_packages/custom"}]},{"type":"category","label":"Providers","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"Prolific","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Prolific overview","href":"/docs/guides/how_to_use/providers/prolific/intro","docId":"guides/how_to_use/providers/prolific/intro"},{"type":"link","label":"Steps of running a Study","href":"/docs/guides/how_to_use/providers/prolific/running_study","docId":"guides/how_to_use/providers/prolific/running_study"},{"type":"link","label":"Participant Eligibility Requirements","href":"/docs/guides/how_to_use/providers/prolific/eligibility_requirements","docId":"guides/how_to_use/providers/prolific/eligibility_requirements"},{"type":"link","label":"Prolific API oddities","href":"/docs/guides/how_to_use/providers/prolific/prolific_api_oddities","docId":"guides/how_to_use/providers/prolific/prolific_api_oddities"},{"type":"link","label":"Prolific Python SDK","href":"/docs/guides/how_to_use/providers/prolific/prolific_python_sdk","docId":"guides/how_to_use/providers/prolific/prolific_python_sdk"}]},{"type":"link","label":"MTurk","href":"/docs/guides/how_to_use/providers/mturk","docId":"guides/how_to_use/providers/mturk"}]},{"type":"category","label":"Move data around","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Simple usage","href":"/docs/guides/how_to_use/data_porter/simple_usage","docId":"guides/how_to_use/data_porter/simple_usage"},{"type":"link","label":"Reference","href":"/docs/guides/how_to_use/data_porter/reference","docId":"guides/how_to_use/data_porter/reference"},{"type":"link","label":"Custom conflict resolver","href":"/docs/guides/how_to_use/data_porter/custom_conflict_resolver","docId":"guides/how_to_use/data_porter/custom_conflict_resolver"}]}]},{"type":"category","label":"How to Contribute","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Contributing to Mephisto","href":"/docs/guides/how_to_contribute/getting_started","docId":"guides/how_to_contribute/getting_started"},{"type":"link","label":"Frontend setup","href":"/docs/guides/how_to_contribute/frontend_development","docId":"guides/how_to_contribute/frontend_development"},{"type":"link","label":"Backend setup","href":"/docs/guides/how_to_contribute/backend_development","docId":"guides/how_to_contribute/backend_development"},{"type":"link","label":"Database migrations","href":"/docs/guides/how_to_contribute/db_migrations","docId":"guides/how_to_contribute/db_migrations"},{"type":"link","label":"Updating documentation","href":"/docs/guides/how_to_contribute/documentation","docId":"guides/how_to_contribute/documentation"},{"type":"link","label":"Known issues","href":"/docs/guides/how_to_contribute/known_issues","docId":"guides/how_to_contribute/known_issues"}]}],"explanations":[{"type":"link","label":"architecture_overview","href":"/docs/explanations/architecture_overview","docId":"explanations/architecture_overview"},{"type":"link","label":"Mephisto Abstractions","href":"/docs/explanations/abstractions_overview","docId":"explanations/abstractions_overview"},{"type":"link","label":"Architect API","href":"/docs/explanations/architect_api","docId":"explanations/architect_api"}],"reference":[{"type":"link","label":"Overview","href":"/docs/reference/overview","docId":"reference/overview"},{"type":"link","label":"Architects","href":"/docs/reference/architects","docId":"reference/architects"},{"type":"link","label":"Blueprints","href":"/docs/reference/blueprints","docId":"reference/blueprints"},{"type":"link","label":"Providers","href":"/docs/reference/providers","docId":"reference/providers"},{"type":"link","label":"Requesters","href":"/docs/reference/requesters","docId":"reference/requesters"},{"type":"link","label":"Tasks","href":"/docs/reference/tasks","docId":"reference/tasks"}]},"docs":{"explanations/abstractions_overview":{"id":"explanations/abstractions_overview","title":"Mephisto Abstractions","description":"This document seeks to explain the ideas that guided the creation of Mephisto. It will speak about the broad categories of how Mephisto works and how these parts are supposed to play together. It speaks a lot about the design goals of the Mephisto architecture. It isn\'t a perfect 1:1 representation of how the code is organized at the moment, but rather the ideal we were striving to reach. Understanding these ideals makes it easier to understand Mephisto, both for usage and for joining in on development.","sidebar":"explanations"},"explanations/architect_api":{"id":"explanations/architect_api","title":"Architect API","description":"The Architect API is what allows Mephisto to completely abstract away the process of getting workers to operate in Mephisto tasks. In short, it aims to cover 4 primary functions:","sidebar":"explanations"},"explanations/architecture_overview":{"id":"explanations/architecture_overview","title":"architecture_overview","description":"Architecture diagram","sidebar":"explanations"},"guides/how_to_contribute/backend_development":{"id":"guides/how_to_contribute/backend_development","title":"Backend setup","description":"We use pre-commit to enforce code styles on the code base (using black for Python and prettier for Javascript).","sidebar":"guides"},"guides/how_to_contribute/db_migrations":{"id":"guides/how_to_contribute/db_migrations","title":"Database migrations","description":"Overview","sidebar":"guides"},"guides/how_to_contribute/documentation":{"id":"guides/how_to_contribute/documentation","title":"Updating documentation","description":"For large functionality changes, please remember to update mephisto.ai documentation.","sidebar":"guides"},"guides/how_to_contribute/frontend_development":{"id":"guides/how_to_contribute/frontend_development","title":"Frontend setup","description":"We use pre-commit to enforce code styles on the code base (using black for Python and prettier for Javascript).","sidebar":"guides"},"guides/how_to_contribute/getting_started":{"id":"guides/how_to_contribute/getting_started","title":"Contributing to Mephisto","description":"Mephisto is built for developing on, but developing for Mephisto can sometimes be unclear. We aim to provide some guides on contributions for abstractions, underlying infrastructure, or developer experience, but oftentimes the best resource will be opening an issue on our Github directly.","sidebar":"guides"},"guides/how_to_contribute/known_issues":{"id":"guides/how_to_contribute/known_issues","title":"Known issues","description":"While we strive to make Mephisto work its best, there are a few \\"perennial\\" issues to be aware of:","sidebar":"guides"},"guides/how_to_use/data_porter/custom_conflict_resolver":{"id":"guides/how_to_use/data_porter/custom_conflict_resolver","title":"Custom conflict resolver","description":"When importing dump data into local DB, some rows may refer to the same object","sidebar":"guides"},"guides/how_to_use/data_porter/reference":{"id":"guides/how_to_use/data_porter/reference","title":"Reference","description":"This is a reference describing set of commands under the mephisto db command group.","sidebar":"guides"},"guides/how_to_use/data_porter/simple_usage":{"id":"guides/how_to_use/data_porter/simple_usage","title":"Simple usage","description":"Introduction","sidebar":"guides"},"guides/how_to_use/efficiency_organization/config_faq":{"id":"guides/how_to_use/efficiency_organization/config_faq","title":"Common Configurations and FAQs","description":"This document contains some Mephisto usage patterns that should be fairly common, as well as usage tips and other know-how.","sidebar":"guides"},"guides/how_to_use/efficiency_organization/docker":{"id":"guides/how_to_use/efficiency_organization/docker","title":"Running Mephisto with Docker","description":"You may want to keep Mephisto environment entirely contained, and set it up with just a few commands. To do this, we support Docker and Docker Compose as a launch option.","sidebar":"guides"},"guides/how_to_use/efficiency_organization/manual_installation":{"id":"guides/how_to_use/efficiency_organization/manual_installation","title":"Manually installing Mephisto","description":"We strongly recommend running Mephisto with Docker as we\'ve shown in all included task examples.","sidebar":"guides"},"guides/how_to_use/efficiency_organization/metrics_dashboard":{"id":"guides/how_to_use/efficiency_organization/metrics_dashboard","title":"View task health and status with Mephisto Metrics","description":"Mephisto provides an optional extension to view task health metrics via dashboard using Prometheus and Grafana. This lets you see the progress of your task with the following:","sidebar":"guides"},"guides/how_to_use/efficiency_organization/reusing_configs":{"id":"guides/how_to_use/efficiency_organization/reusing_configs","title":"Use the same configs across tasks","description":"As you begin launching many Mephisto tasks, you may find that there are some specific argument options that you frequently use across multiple tasks. Mephisto provides a way to reuse these types of configurations with profiles.","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/config_files":{"id":"guides/how_to_use/form_composer/configuration/config_files","title":"Config files reference","description":"This section is a reference on FormComposer\'s standard configuration files and object attributes.","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/form_callbacks":{"id":"guides/how_to_use/form_composer/configuration/form_callbacks","title":"Form rendering callbacks","description":"During rendering of a Task in the browser, we may send calls to the server-side for additional data. In Mephisto, API views servicing such requests are called \\"remote procedures\\".","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/form_composer_config_command":{"id":"guides/how_to_use/form_composer/configuration/form_composer_config_command","title":"`form_composer config` command","description":"The form_composer config utility command helps auto-generate FormComposer config. It supports several options:","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/insertions":{"id":"guides/how_to_use/form_composer/configuration/insertions","title":"Using code insertions","description":"FormComposer allows using custom code insertions in these scenarios:","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/multiple_form_versions":{"id":"guides/how_to_use/form_composer/configuration/multiple_form_versions","title":"Multiple form versions","description":"The simplest Task scenario is showing the same exact form to all of your workers. In that case you need to:","sidebar":"guides"},"guides/how_to_use/form_composer/configuration/setup":{"id":"guides/how_to_use/form_composer/configuration/setup","title":"FormComposer configuration","description":"FormComposer tasks are fully defined by their configuration files. These files comprise:","sidebar":"guides"},"guides/how_to_use/form_composer/embedding":{"id":"guides/how_to_use/form_composer/embedding","title":"Embed FormComposer into custom application","description":"A few tips if you wish to embed FormComposer in your custom application:","sidebar":"guides"},"guides/how_to_use/form_composer/overview":{"id":"guides/how_to_use/form_composer/overview","title":"FormComposer overview","description":"You can easily generate form-based Tasks using our FormComposer task generator feature. It produces clean cross-platform Bootstrap forms with client-side form validation.","sidebar":"guides"},"guides/how_to_use/form_composer/running":{"id":"guides/how_to_use/form_composer/running","title":"Run FormComposer tasks","description":"To create and launch a FormComposer task, first create your JSON form configuration,","sidebar":"guides"},"guides/how_to_use/js_packages/custom":{"id":"guides/how_to_use/js_packages/custom","title":"Custom packages","description":"If you want to customize existing packages or create a new one, you can place them into packages directory (and update installed dependencies list in your package.json accordingly).","sidebar":"guides"},"guides/how_to_use/js_packages/main":{"id":"guides/how_to_use/js_packages/main","title":"Mephisto Packages","description":"Mephisto repository contains JavaScript libraries that are located in packages directory.","sidebar":"guides"},"guides/how_to_use/providers/mturk":{"id":"guides/how_to_use/providers/mturk","title":"MTurk","description":"Set up MTurk","sidebar":"guides"},"guides/how_to_use/providers/prolific/eligibility_requirements":{"id":"guides/how_to_use/providers/prolific/eligibility_requirements","title":"Participant Eligibility Requirements","description":"Prolific offers Eligibility Requirements to limit access to your Task (or Study, as Prolific calls it)","sidebar":"guides"},"guides/how_to_use/providers/prolific/intro":{"id":"guides/how_to_use/providers/prolific/intro","title":"Prolific overview","description":"Mephisto supports integration with Prolific human cloud provider.","sidebar":"guides"},"guides/how_to_use/providers/prolific/prolific_api_oddities":{"id":"guides/how_to_use/providers/prolific/prolific_api_oddities","title":"Prolific API oddities","description":"Last updated 2023.07.08","sidebar":"guides"},"guides/how_to_use/providers/prolific/prolific_python_sdk":{"id":"guides/how_to_use/providers/prolific/prolific_python_sdk","title":"Prolific Python SDK","description":"Prolific does not provide a Python implementation of the client.","sidebar":"guides"},"guides/how_to_use/providers/prolific/running_study":{"id":"guides/how_to_use/providers/prolific/running_study","title":"Steps of running a Study","description":"1. Create inactive Study during TaskRun launch, set its totalavailableplaces = None.","sidebar":"guides"},"guides/how_to_use/review_app/diagram":{"id":"guides/how_to_use/review_app/diagram","title":"TaskReview app flow","description":"Here is how TaskReview app works under the hood to enable review of Task results in a local web browser.","sidebar":"guides"},"guides/how_to_use/review_app/enabling_original_unit_preview":{"id":"guides/how_to_use/review_app/enabling_original_unit_preview","title":"Enable unit preview in TaskReview app","description":"By default, TaskReview app UI always shows a generic results view (i.e. unit content submitted by worker in the format saved by AgentState, such as data/data/runs/...../agent_data.json content).","sidebar":"guides"},"guides/how_to_use/review_app/enabling_responses_histogram":{"id":"guides/how_to_use/review_app/enabling_responses_histogram","title":"Enable Responses Histogram","description":"Some tasks can display simple histograms with response frequencies.","sidebar":"guides"},"guides/how_to_use/review_app/overview":{"id":"guides/how_to_use/review_app/overview","title":"Overview","description":"Generally, to view/export the data, you could write a Python script using the Mephisto","sidebar":"guides"},"guides/how_to_use/review_app/running":{"id":"guides/how_to_use/review_app/running","title":"Run TaskReview app","description":"Run with Docker","sidebar":"guides"},"guides/how_to_use/review_app/server_api":{"id":"guides/how_to_use/review_app/server_api","title":"TaskReview app API","description":"If you wish to customize or improve the TaskReview app, it\'s helpful to know how its UI and server parts interact.","sidebar":"guides"},"guides/how_to_use/task_creation/developing_frontends":{"id":"guides/how_to_use/task_creation/developing_frontends","title":"Developing and debugging frontends","description":"The mephisto-core package","sidebar":"guides"},"guides/how_to_use/task_creation/hosting_assets":{"id":"guides/how_to_use/task_creation/hosting_assets","title":"Hosting task assets","description":"Generally there are two models for hosting assets related to a task, with distinct tradeoffs. These are to upload files to the routing server, or to store the files locally on Mephisto and share the data on connection. The former is generally the easier solution.","sidebar":"guides"},"guides/how_to_use/task_creation/task_run":{"id":"guides/how_to_use/task_creation/task_run","title":"How task run works","description":"Let\'s understand basic components of the task launch, such as configs and the runtasklocal_inhouse.py script.","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/config_files":{"id":"guides/how_to_use/video_annotator/configuration/config_files","title":"Config files reference","description":"This section is a reference on VideoAnnotators\'s standard configuration files and object attributes.","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/form_callbacks":{"id":"guides/how_to_use/video_annotator/configuration/form_callbacks","title":"Segment rendering callbacks","description":"During rendering of a Task in the browser, we may send calls to the server-side for additional data. In Mephisto, API views servicing such requests are called \\"remote procedures\\".","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/insertions":{"id":"guides/how_to_use/video_annotator/configuration/insertions","title":"Using code insertions","description":"VideoAnnotator allows using custom code insertions in these scenarios:","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/multiple_annotator_versions":{"id":"guides/how_to_use/video_annotator/configuration/multiple_annotator_versions","title":"Multiple annotator versions","description":"The simplest Task scenario is showing the same exact annotator to all of your workers. In that case you need to:","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/setup":{"id":"guides/how_to_use/video_annotator/configuration/setup","title":"VideoAnnotator configuration","description":"VideoAnnotator tasks are fully defined by their configuration files. These files comprise:","sidebar":"guides"},"guides/how_to_use/video_annotator/configuration/video_annotator_config_command":{"id":"guides/how_to_use/video_annotator/configuration/video_annotator_config_command","title":"`video_annotator config` command","description":"The video_annotator config utility command helps auto-generate VideoAnnotator config. It supports several options:","sidebar":"guides"},"guides/how_to_use/video_annotator/embedding":{"id":"guides/how_to_use/video_annotator/embedding","title":"Embed VideoAnnotator into custom application","description":"A few tips if you wish to embed VideoAnnotator in your custom application:","sidebar":"guides"},"guides/how_to_use/video_annotator/overview":{"id":"guides/how_to_use/video_annotator/overview","title":"VideoAnnotator overview","description":"You can easily generate tasks to annotate any preuploaded video with our VideoAnnotator feature.","sidebar":"guides"},"guides/how_to_use/video_annotator/running":{"id":"guides/how_to_use/video_annotator/running","title":"Run VideoAnnotator tasks","description":"To create and launch a VideoAnnotator task, first create your JSON form configuration,","sidebar":"guides"},"guides/how_to_use/worker_experience/mephisto-task-addons":{"id":"guides/how_to_use/worker_experience/mephisto-task-addons","title":"Mephisto Task Addons","description":"Overview","sidebar":"guides"},"guides/how_to_use/worker_experience/worker_opinion":{"id":"guides/how_to_use/worker_experience/worker_opinion","title":"WorkerOpinion widget","description":"Workers can leave their feedback about a Task if you add a WorkerOpinion feature to it.","sidebar":"guides"},"guides/how_to_use/worker_quality/common_qualification_flows":{"id":"guides/how_to_use/worker_quality/common_qualification_flows","title":"Using qualifications to improve worker quality","description":"Qualification control is a powerful component of Mephisto, allowing you to filter out workers with both manual and automatic controls. Within this are typical allowlists and blocklists, setting up value-based qualifications, making automatic qualifications for onboarding, and also utilizing the qualifications that various crowdsourcing providers have to offer. This document seeks to describe some common use cases for qualifications, and how we currently go about using them.","sidebar":"guides"},"guides/how_to_use/worker_quality/managing_worker_qualifications":{"id":"guides/how_to_use/worker_quality/managing_worker_qualifications","title":"Managing worker qualifications","description":"You can easily manage qualification via TaskReview app UI.","sidebar":"guides"},"guides/how_to_use/worker_quality/other_methods":{"id":"guides/how_to_use/worker_quality/other_methods","title":"Other methods for quality control","description":"While not yet implemented in Mephisto\'s core codebase, there are a few additional methods of quality control that may be successful. This doc lists a few that we\'ve considered for Mephisto thusfar.","sidebar":"guides"},"guides/how_to_use/worker_quality/using_golds":{"id":"guides/how_to_use/worker_quality/using_golds","title":"Check against standards with Gold Labels","description":"Gold labeling is commonly used for ensuring worker quality over the full duration of a task. It\'s valuable as an automated measure to track the consistency your workers. For this Mephisto provides the UseGoldUnit blueprint mixin.","sidebar":"guides"},"guides/how_to_use/worker_quality/using_onboarding":{"id":"guides/how_to_use/worker_quality/using_onboarding","title":"Teach potential workers with Onboarding","description":"The first step to getting quality data is describing your task properly and ensuring that workers have understood your instructions.","sidebar":"guides"},"guides/how_to_use/worker_quality/using_screen_units":{"id":"guides/how_to_use/worker_quality/using_screen_units","title":"Check worker quality with Screening Units","description":"Screening units help filter out low-quality work,","sidebar":"guides"},"guides/quickstart":{"id":"guides/quickstart","title":"10-minute Quickstart","description":"1. Install Docker and Docker Compose following their official documentation","sidebar":"guides"},"guides/tutorials/custom_react":{"id":"guides/tutorials/custom_react","title":"Working on a custom task","description":"Now that you\'ve launched a task or two, it\'s time to get into building your own. This tutorial focuses on giving you the tools to collect the specific data you\'re looking for by building a task of your own. This tutorial itself won\'t produce a useful task, but it should be useful for understanding how to go about creating a real one. You don\'t need_ any React experience to get through this guide, though it will be helpful for understanding the usage more deeply.","sidebar":"guides"},"guides/tutorials/first_task":{"id":"guides/tutorials/first_task","title":"Running your first task","description":"So you want to launch your first task.","sidebar":"guides"},"guides/tutorials/form_composer":{"id":"guides/tutorials/form_composer","title":"Run form-based tasks","description":"If your task has questionnaire format, you can build it out-of-the box with no custom code, by using our FormComposer task generator. All you need to do is to specify your JSON-based form configuration, and run a few commands.","sidebar":"guides"},"guides/tutorials/model_in_the_loop":{"id":"guides/tutorials/model_in_the_loop","title":"Run model-in-the-loop tasks","description":"Mephisto allows to create interactive Tasks where worker can interact with the server during completion of their Task.","sidebar":"guides"},"guides/tutorials/review_app":{"id":"guides/tutorials/review_app","title":"Reviewing task results","description":"Once you\'ve installed Mephisto, you have access to the mephisto command line utility,","sidebar":"guides"},"guides/tutorials/worker_controls":{"id":"guides/tutorials/worker_controls","title":"Introducing worker controls","description":"Now that you have a task to show workers, in order to get quality data you\'ll want to include a mix of automated and manual reviewing. This guide introduces onboarding, which is a good opportunity to provide workers with a simple test to ensure they read and understand task instructions. A more in-depth guide into their use can be found here. We expect familiarity with React\'s core concepts to understand the frontend part of this tutorial.","sidebar":"guides"},"guides/tutorials/workflows":{"id":"guides/tutorials/workflows","title":"Developing a workflow","description":"While it\'s nice to imagine that you\'ll be able to collect quality data on the first pass, crowdsourcing can be a bit more trial-and-error. This guide focuses on setting up a good workflow, and extending your run-script to support additional functionality.","sidebar":"guides"},"reference/architects":{"id":"reference/architects","title":"Architects","description":"Architects contain the logic surrounding deploying a server that workers will be able to access.","sidebar":"reference"},"reference/blueprints":{"id":"reference/blueprints","title":"Blueprints","description":"The blueprints contain all of the related code required to set up a task run.","sidebar":"reference"},"reference/overview":{"id":"reference/overview","title":"Overview","description":"Our Python API documentation can be found here.","sidebar":"reference"},"reference/providers":{"id":"reference/providers","title":"Providers","description":"Crowd providers standardize access to external crowd workers, by wrapping external API communication through a standardized interface.","sidebar":"reference"},"reference/requesters":{"id":"reference/requesters","title":"Requesters","description":"Requesters are Mephisto\'s wrapper around an identity for a CrowdProvider, usually storing the credentials for an account to launch tasks from.","sidebar":"reference"},"reference/tasks":{"id":"reference/tasks","title":"Tasks","description":"The tasks contain all of the related code required to set up a task run.","sidebar":"reference"}}}')}}]); \ No newline at end of file diff --git a/assets/js/a2c7551e.3cef4adf.js b/assets/js/a2c7551e.3cef4adf.js deleted file mode 100644 index ba07d610e..000000000 --- a/assets/js/a2c7551e.3cef4adf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[3372],{4127:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return k}});var a=n(1987);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=p(n),m=r,k=u["".concat(l,".").concat(m)]||u[m]||d[m]||o;return n?a.createElement(k,i(i({ref:t},c),{},{components:n})):a.createElement(k,i({ref:t},c))}));function k(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[u]="string"==typeof e?e:r,i[1]=s;for(var p=2;p= 2.0 have codename berry). This version of yarn is checked into the repo at ",(0,o.kt)("inlineCode",{parentName:"em"},".yarn/releases")," and is targeted by the ",(0,o.kt)("inlineCode",{parentName:"em"},'"yarnPath"')," property in the root ",(0,o.kt)("inlineCode",{parentName:"em"},".yarnrc.yml")," file. More details can be found ",(0,o.kt)("a",{parentName:"em",href:"https://yarnpkg.com/cli/set/version"},"here")," and ",(0,o.kt)("a",{parentName:"em",href:"https://yarnpkg.com/configuration/yarnrc#yarnPath"},"here"),"."))),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Install all dependencies.")),(0,o.kt)("p",null,"You can think of this as both running ",(0,o.kt)("inlineCode",{parentName:"p"},"npm install")," in all local workspaces and running ",(0,o.kt)("inlineCode",{parentName:"p"},"npm link")," to link local package dependencies where appropriate."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn install\n\n# This is similar to running `lerna --hoist` in the past\n")),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},"You'll notice that individual packages don't have ",(0,o.kt)("inlineCode",{parentName:"p"},"node_modules/")," folders anymore. This is because all packages are hoisted to the top level and placed within the ",(0,o.kt)("inlineCode",{parentName:"p"},".yarn/cache")," folder. This speeds up ",(0,o.kt)("inlineCode",{parentName:"p"},"npm install"),"s, attempts to share dependencies between projects when necessary, and avoids ambiguous module resolutions.")),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Build the workspaces")),(0,o.kt)("p",null,"We can use yarn to build all the dependencies in our project easily."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn build-all\n")),(0,o.kt)("p",null,(0,o.kt)("em",{parentName:"p"},"Note: You can see the root ",(0,o.kt)("inlineCode",{parentName:"em"},"package.json")," to see the underlying command under this convenience script.")),(0,o.kt)("h3",{id:"tips--recipes"},"Tips & Recipes"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"View all of the workspaces in the project:"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn workspaces list\n\n\u27a4 YN0000: .\n\u27a4 YN0000: docs/sb\n\u27a4 YN0000: packages/annotated/bbox\n\u27a4 YN0000: packages/annotated/dev-scripts\n\u27a4 YN0000: packages/annotated/keypoint\n\u27a4 YN0000: packages/annotated/shell\n\u27a4 YN0000: packages/annotated/video-player\n"))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"Run a command in a specific workspace"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn workspace sb build-storybook\n\n$ yarn workspace @annotated/bbox build\n"))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"Run a command in all workspaces"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn workspaces foreach -ptA run build\n")),(0,o.kt)("p",{parentName:"li"}," More information on the flags for ",(0,o.kt)("inlineCode",{parentName:"p"},"foreach")," can be found ",(0,o.kt)("a",{parentName:"p",href:"https://yarnpkg.com/cli/workspaces/foreach"},"here"),"."))),(0,o.kt)("h2",{id:"package-development-old"},"Package Development (old)"),(0,o.kt)("p",null,(0,o.kt)("em",{parentName:"p"},"For commits before the ",(0,o.kt)("inlineCode",{parentName:"em"},"yarn-pkg-reorg")," tag or for non-workspace packages, e.g. ",(0,o.kt)("inlineCode",{parentName:"em"},"global-context-store"),", ",(0,o.kt)("inlineCode",{parentName:"em"},"annotation-toolkit"),", ",(0,o.kt)("inlineCode",{parentName:"em"},"bootstrap-chat"),".")),(0,o.kt)("p",null,"This repo has a few npm packages. If you're developing on them, you may want them to reference each other so your local edits across packages are reflected in your build.\nTo accomplish this we use ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/lerna/lerna"},"Lerna"),". Lerna is also used to hoist ",(0,o.kt)("inlineCode",{parentName:"p"},"react")," across packages to avoid this dreaded warning/error: ",(0,o.kt)("a",{parentName:"p",href:"https://reactjs.org/warnings/invalid-hook-call-warning.html"},"https://reactjs.org/warnings/invalid-hook-call-warning.html")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre"},"# In the root of the repo, install Lerna:\nnpm install\n\nnpm run bootstrap\n# under the hood, this runs: lerna bootstrap --hoist=\"{react,react-dom}\" which will link all packages that depend on each other, to each other, while also\n# hoisting react and react-dom to ensure that all packages uses the same version of react.\n\n# You can then link the common react version hoisted at the root, to your client project located somewhere else on disk.\n# Again, from the root:\nnpm link /other-project/located-somewhere-else/node_modules/react\n# This ensure that all projects use the same version of React.\n\n# then in your client project, you can do something like this:\nnpm link annotation-toolkit global-context-store\n\n# NOTE: It's important to specify the 2 links together! otherwise i'm noticing behavior where\n# the second link wipes out the first (npm v7.6.0 & node v15.8.0)\n")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/a2c7551e.f4306f75.js b/assets/js/a2c7551e.f4306f75.js new file mode 100644 index 000000000..5427d5bec --- /dev/null +++ b/assets/js/a2c7551e.f4306f75.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[3372],{4127:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return k}});var a=n(1987);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=p(n),m=r,k=u["".concat(l,".").concat(m)]||u[m]||d[m]||o;return n?a.createElement(k,i(i({ref:t},c),{},{components:n})):a.createElement(k,i({ref:t},c))}));function k(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[u]="string"==typeof e?e:r,i[1]=s;for(var p=2;p= 2.0 have codename berry). This version of yarn is checked into the repo at ",(0,o.kt)("inlineCode",{parentName:"em"},".yarn/releases")," and is targeted by the ",(0,o.kt)("inlineCode",{parentName:"em"},'"yarnPath"')," property in the root ",(0,o.kt)("inlineCode",{parentName:"em"},".yarnrc.yml")," file. More details can be found ",(0,o.kt)("a",{parentName:"em",href:"https://yarnpkg.com/cli/set/version"},"here")," and ",(0,o.kt)("a",{parentName:"em",href:"https://yarnpkg.com/configuration/yarnrc#yarnPath"},"here"),"."))),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Install all dependencies.")),(0,o.kt)("p",null,"You can think of this as both running ",(0,o.kt)("inlineCode",{parentName:"p"},"npm install")," in all local workspaces and running ",(0,o.kt)("inlineCode",{parentName:"p"},"npm link")," to link local package dependencies where appropriate."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn install\n\n# This is similar to running `lerna --hoist` in the past\n")),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},"You'll notice that individual packages don't have ",(0,o.kt)("inlineCode",{parentName:"p"},"node_modules/")," folders anymore. This is because all packages are hoisted to the top level and placed within the ",(0,o.kt)("inlineCode",{parentName:"p"},".yarn/cache")," folder. This speeds up ",(0,o.kt)("inlineCode",{parentName:"p"},"npm install"),"s, attempts to share dependencies between projects when necessary, and avoids ambiguous module resolutions.")),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Build the workspaces")),(0,o.kt)("p",null,"We can use yarn to build all the dependencies in our project easily."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn build-all\n")),(0,o.kt)("p",null,(0,o.kt)("em",{parentName:"p"},"Note: You can see the root ",(0,o.kt)("inlineCode",{parentName:"em"},"package.json")," to see the underlying command under this convenience script.")),(0,o.kt)("h3",{id:"tips--recipes"},"Tips & Recipes"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"View all of the workspaces in the project:"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn workspaces list\n\n\u27a4 YN0000: .\n\u27a4 YN0000: docs/sb\n\u27a4 YN0000: packages/annotated/bbox\n\u27a4 YN0000: packages/annotated/dev-scripts\n\u27a4 YN0000: packages/annotated/keypoint\n\u27a4 YN0000: packages/annotated/shell\n\u27a4 YN0000: packages/annotated/video-player\n"))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"Run a command in a specific workspace"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn workspace sb build-storybook\n\n$ yarn workspace @annotated/bbox build\n"))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("p",{parentName:"li"},"Run a command in all workspaces"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn workspaces foreach -ptA run build\n")),(0,o.kt)("p",{parentName:"li"}," More information on the flags for ",(0,o.kt)("inlineCode",{parentName:"p"},"foreach")," can be found ",(0,o.kt)("a",{parentName:"p",href:"https://yarnpkg.com/cli/workspaces/foreach"},"here"),"."))),(0,o.kt)("h2",{id:"package-development-old"},"Package Development (old)"),(0,o.kt)("p",null,(0,o.kt)("em",{parentName:"p"},"For commits before the ",(0,o.kt)("inlineCode",{parentName:"em"},"yarn-pkg-reorg")," tag or for non-workspace packages, e.g. ",(0,o.kt)("inlineCode",{parentName:"em"},"global-context-store"),", ",(0,o.kt)("inlineCode",{parentName:"em"},"annotation-toolkit"),", ",(0,o.kt)("inlineCode",{parentName:"em"},"bootstrap-chat"),".")),(0,o.kt)("p",null,"This repo has a few npm packages. If you're developing on them, you may want them to reference each other so your local edits across packages are reflected in your build.\nTo accomplish this we use ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/lerna/lerna"},"Lerna"),". Lerna is also used to hoist ",(0,o.kt)("inlineCode",{parentName:"p"},"react")," across packages to avoid this dreaded warning/error: ",(0,o.kt)("a",{parentName:"p",href:"https://reactjs.org/warnings/invalid-hook-call-warning.html"},"https://reactjs.org/warnings/invalid-hook-call-warning.html")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre"},"# In the root of the repo, install Lerna:\nnpm install\n\nnpm run bootstrap\n# under the hood, this runs: lerna bootstrap --hoist=\"{react,react-dom}\" which will link all packages that depend on each other, to each other, while also\n# hoisting react and react-dom to ensure that all packages uses the same version of react.\n\n# You can then link the common react version hoisted at the root, to your client project located somewhere else on disk.\n# Again, from the root:\nnpm link /other-project/located-somewhere-else/node_modules/react\n# This ensure that all projects use the same version of React.\n\n# then in your client project, you can do something like this:\nnpm link annotation-toolkit global-context-store\n\n# NOTE: It's important to specify the 2 links together! otherwise i'm noticing behavior where\n# the second link wipes out the first (npm v7.6.0 & node v15.8.0)\n")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/afcbdae1.5753c02f.js b/assets/js/afcbdae1.7870803b.js similarity index 61% rename from assets/js/afcbdae1.5753c02f.js rename to assets/js/afcbdae1.7870803b.js index 4f7b9b10a..adcd1098a 100644 --- a/assets/js/afcbdae1.5753c02f.js +++ b/assets/js/afcbdae1.7870803b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[3916],{4127:function(e,t,n){n.d(t,{Zo:function(){return p},kt:function(){return k}});var o=n(1987);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=o.createContext({}),c=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=c(e.components);return o.createElement(s.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},d=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(n),d=r,k=u["".concat(s,".").concat(d)]||u[d]||m[d]||i;return n?o.createElement(k,a(a({ref:t},p),{},{components:n})):o.createElement(k,a({ref:t},p))}));function k(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,a=new Array(i);a[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:r,a[1]=l;for(var c=2;c=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=o.createContext({}),c=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=c(e.components);return o.createElement(s.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},d=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(n),d=r,k=u["".concat(s,".").concat(d)]||u[d]||m[d]||i;return n?o.createElement(k,a(a({ref:t},p),{},{components:n})):o.createElement(k,a({ref:t},p))}));function k(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,a=new Array(i);a[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:r,a[1]=l;for(var c=2;cScreeningComponent",id:"simple-example-of-screeningcomponent",level:3},{value:"Additional Questions?",id:"additional-questions",level:2}],g={toc:p};function m(e){var n=e.components,t=(0,a.Z)(e,l);return(0,r.kt)("wrapper",(0,i.Z)({},g,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"check-worker-quality-with-screening-units"},"Check worker quality with Screening Units"),(0,r.kt)("p",null,"Screening units help filter out low-quality work,\ngenerally by hiding parts of the validation you're paying attention to behind the Mephisto server.\nTo support this we provide the ",(0,r.kt)("inlineCode",{parentName:"p"},"ScreenTaskRequired")," blueprint mixin."),(0,r.kt)("p",null,"Screening units are a heuristic-based way to determine, on the first task completion,\nif a worker has understood the instructions of a task.\nThey can be run either on real data you want annotated (for cases where your heuristics can be run whenever)\nor on specific 'test' data you believe it's easier to validate on."),(0,r.kt)("h2",{id:"showcase"},"Showcase"),(0,r.kt)(o.Z,{playing:!0,controls:!0,width:"100%",height:"auto",url:"https://user-images.githubusercontent.com/55665282/183139879-d252d899-454c-4c15-afaa-474e6f02812b.mp4",mdxType:"ReactPlayer"}),(0,r.kt)("h3",{id:"things-to-note-in-the-showcase"},"Things to note in the showcase:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"remote_procedure/mnist")," example is ran with the ",(0,r.kt)("inlineCode",{parentName:"li"},"example_with_screening__local__inhouse")," configuration enabled to ensure that screening units are generated."),(0,r.kt)("li",{parentName:"ul"},"When a worker goes to an assignment for the first time they see a screening unit."),(0,r.kt)("li",{parentName:"ul"},'Drawing a "3" gives the worker the passing qualification'),(0,r.kt)("li",{parentName:"ul"},'Drawing any number other than "3" gives the worker the blocked qualification'),(0,r.kt)("li",{parentName:"ul"},"Going to a different assignment when you have a blocked qualification shows you a not qualified screen."),(0,r.kt)("li",{parentName:"ul"},"Going to a different assignment when you have a passing qualification allows you to see the real unit")),(0,r.kt)("h2",{id:"basic-configuration"},"Basic configuration"),(0,r.kt)("p",null,"There are a few required configuration parts for using screening units:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Hydra args",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"blueprint.passed_qualification_name"),": A string qualification to mark people who have passed screening."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"blueprint.block_qualification"),": A string qualification to mark people who have failed screening."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"blueprint.use_screening_task"),": Determines if the screening units feature will be enabled. Set to ",(0,r.kt)("strong",{parentName:"li"},"true to enable screening units")," and set to ",(0,r.kt)("strong",{parentName:"li"},"false to disable screening units"),"."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"blueprint.max_screening_units"),": An int for the maximum number of screening tasks you're willing to launch with this batch. Used to limit how much you will pay out for units that aren't annotating your desired data.",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"Must be set to 0 if ",(0,r.kt)("inlineCode",{parentName:"li"},"screening_data_factory")," is set to False"),(0,r.kt)("li",{parentName:"ul"},"Must be greater than 0 if ",(0,r.kt)("inlineCode",{parentName:"li"},"screening_data_factory")," is not False"))),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"task.allowed_concurrent:")," An int for the number of allowed concurrent units at a time per worker. This value ",(0,r.kt)("strong",{parentName:"li"},"must be set to 1"),".",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"Screening units can only run this task type with one allowed concurrent unit at a time per worker, to ensure screening before moving into real units."))))),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"ScreenTaskSharedState"),":",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"screening_data_factory"),": ",(0,r.kt)("inlineCode",{parentName:"li"},"False")," if you want to validate on real data. Otherwise, a factory that generates input data for a screening unit for a worker. Explained in-depth below.")))),(0,r.kt)("h2",{id:"setting-up-sharedtaskstate"},"Setting up SharedTaskState"),(0,r.kt)("p",null,"With the basic configuration done, you'll also need to provide additional arguments to your ",(0,r.kt)("inlineCode",{parentName:"p"},"SharedTaskState"),"\nto register the required qualifications and the screening validation function."),(0,r.kt)("p",null,"A shortened version of the run script for the video above looks like:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'# run_task__local__inhouse.py\n\ndef my_screening_unit_generator():\n """\n The frontend react webapp reads in\n isScreeningUnit using the initialTaskData\n prop\n """\n while True:\n yield {"isScreeningUnit": True}\n\ndef validate_screening_unit(unit: Unit):\n """Checking if the drawn number is 3"""\n agent = unit.get_assigned_agent()\n if agent is not None:\n data = agent.state.get_data()\n annotation = data["outputs"]["final_submission"]["annotations"][0]\n if annotation["isCorrect"] and annotation["currentAnnotation"] == 3:\n return True\n return False\n\n@task_script(default_config_file="example__local__inhouse.yaml")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n is_using_screening_units = cfg.mephisto.blueprint["use_screening_task"]\n tasks: List[Dict[str, Any]] = [{"isScreeningUnit": False}] * cfg.num_tasks\n ...\n shared_state = SharedRemoteProcedureTaskState(\n static_task_data=tasks,\n function_registry=function_registry,\n )\n\n if is_using_screening_units:\n """You have to defined a few more properties to enable screening units"""\n shared_state.on_unit_submitted = ScreenTaskRequired.create_validation_function(\n cfg.mephisto,\n validate_screening_unit,\n )\n shared_state.screening_data_factory = my_screening_unit_generator()\n shared_state.qualifications += ScreenTaskRequired.get_mixin_qualifications(\n cfg.mephisto, shared_state,\n )\n ...\n')),(0,r.kt)("h3",{id:"see-the-full-code-here"},"See the full code ",(0,r.kt)("a",{parentName:"h3",href:"https://github.com/facebookresearch/Mephisto/blob/main/examples/remote_procedure/mnist/run_task__local__inhouse.py"},"here")),(0,r.kt)("h3",{id:"see-hydra-configuration-here"},"See hydra configuration ",(0,r.kt)("a",{parentName:"h3",href:"https://github.com/facebookresearch/Mephisto/blob/main/examples/remote_procedure/mnist/hydra_configs/conf/example_with_screening__local__inhouse.yaml"},"here")),(0,r.kt)("h3",{id:"simple-example-of-screeningcomponent"},"Simple example of ",(0,r.kt)("inlineCode",{parentName:"h3"},"ScreeningComponent")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"function ScreeningComponent({ taskData }) {\n return (\n
\n Do to succeed screening\n
\n );\n}\n")),(0,r.kt)("p",null,'To show pretty "blocked user" banner after not passing onboarding, you may need to add a react component in your app as well:'),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},'if (blockedReason !== null) {\n return (\n
\n
\n

\n {blockedExplanation}\n

\n
\n
\n );\n}\n')),(0,r.kt)("h2",{id:"additional-questions"},"Additional Questions?"),(0,r.kt)("p",null,"You can find more information on using screening units in the reference documentation for"),(0,r.kt)(s.Z,{target:null,to:"pathname:///python_api/mephisto/abstractions/blueprints/mixins/screen_task_required.html",mdxType:"Link"},"`ScreenTaskRequired`"),".")}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/b026c61a.cb0fdffe.js b/assets/js/b026c61a.cb0fdffe.js deleted file mode 100644 index 16b94a1c8..000000000 --- a/assets/js/b026c61a.cb0fdffe.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[6743],{352:function(e,n,t){t.r(n),t.d(n,{assets:function(){return h},contentTitle:function(){return c},default:function(){return m},frontMatter:function(){return u},metadata:function(){return d},toc:function(){return p}});var i=t(9375),a=t(8933),r=(t(1987),t(4127)),o=t(4093),s=t(2590),l=["components"],u={sidebar_position:4},c="Check worker quality with Screening Units",d={unversionedId:"guides/how_to_use/worker_quality/using_screen_units",id:"guides/how_to_use/worker_quality/using_screen_units",title:"Check worker quality with Screening Units",description:"Screening units help filter out low-quality work,",source:"@site/docs/guides/how_to_use/worker_quality/using_screen_units.mdx",sourceDirName:"guides/how_to_use/worker_quality",slug:"/guides/how_to_use/worker_quality/using_screen_units",permalink:"/docs/guides/how_to_use/worker_quality/using_screen_units",draft:!1,editUrl:"https://github.com/facebookresearch/Mephisto/tree/main/docs/web/docs/guides/how_to_use/worker_quality/using_screen_units.mdx",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"guides",previous:{title:"Teach potential workers with Onboarding",permalink:"/docs/guides/how_to_use/worker_quality/using_onboarding"},next:{title:"Check against standards with Gold Labels",permalink:"/docs/guides/how_to_use/worker_quality/using_golds"}},h={},p=[{value:"Showcase",id:"showcase",level:2},{value:"Things to note in the showcase:",id:"things-to-note-in-the-showcase",level:3},{value:"Basic configuration",id:"basic-configuration",level:2},{value:"Setting up SharedTaskState",id:"setting-up-sharedtaskstate",level:2},{value:"See the full code here",id:"see-the-full-code-here",level:3},{value:"See hydra configuration here",id:"see-hydra-configuration-here",level:3},{value:"Simple example of ScreeningComponent",id:"simple-example-of-screeningcomponent",level:3},{value:"Additional Questions?",id:"additional-questions",level:2}],g={toc:p};function m(e){var n=e.components,t=(0,a.Z)(e,l);return(0,r.kt)("wrapper",(0,i.Z)({},g,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"check-worker-quality-with-screening-units"},"Check worker quality with Screening Units"),(0,r.kt)("p",null,"Screening units help filter out low-quality work,\ngenerally by hiding parts of the validation you're paying attention to behind the Mephisto server.\nTo support this we provide the ",(0,r.kt)("inlineCode",{parentName:"p"},"ScreenTaskRequired")," blueprint mixin."),(0,r.kt)("p",null,"Screening units are a heuristic-based way to determine, on the first task completion,\nif a worker has understood the instructions of a task.\nThey can be run either on real data you want annotated (for cases where your heuristics can be run whenever)\nor on specific 'test' data you believe it's easier to validate on."),(0,r.kt)("h2",{id:"showcase"},"Showcase"),(0,r.kt)(o.Z,{playing:!0,controls:!0,width:"100%",height:"auto",url:"https://user-images.githubusercontent.com/55665282/183139879-d252d899-454c-4c15-afaa-474e6f02812b.mp4",mdxType:"ReactPlayer"}),(0,r.kt)("h3",{id:"things-to-note-in-the-showcase"},"Things to note in the showcase:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"remote_procedure/mnist")," example is ran with the ",(0,r.kt)("inlineCode",{parentName:"li"},"screening_example")," configuration enabled to ensure that screening units are generated."),(0,r.kt)("li",{parentName:"ul"},"When a worker goes to an assignment for the first time they see a screening unit."),(0,r.kt)("li",{parentName:"ul"},'Drawing a "3" gives the worker the passing qualification'),(0,r.kt)("li",{parentName:"ul"},'Drawing any number other than "3" gives the worker the blocked qualification'),(0,r.kt)("li",{parentName:"ul"},"Going to a different assignment when you have a blocked qualification shows you a not qualified screen."),(0,r.kt)("li",{parentName:"ul"},"Going to a different assignment when you have a passing qualification allows you to see the real unit")),(0,r.kt)("h2",{id:"basic-configuration"},"Basic configuration"),(0,r.kt)("p",null,"There are a few required configuration parts for using screening units:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Hydra args",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"blueprint.passed_qualification_name"),": A string qualification to mark people who have passed screening."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"blueprint.block_qualification"),": A string qualification to mark people who have failed screening."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"blueprint.use_screening_task"),": Determines if the screening units feature will be enabled. Set to ",(0,r.kt)("strong",{parentName:"li"},"true to enable screening units")," and set to ",(0,r.kt)("strong",{parentName:"li"},"false to disable screening units"),"."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"blueprint.max_screening_units"),": An int for the maximum number of screening tasks you're willing to launch with this batch. Used to limit how much you will pay out for units that aren't annotating your desired data.",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"Must be set to 0 if ",(0,r.kt)("inlineCode",{parentName:"li"},"screening_data_factory")," is set to False"),(0,r.kt)("li",{parentName:"ul"},"Must be greater than 0 if ",(0,r.kt)("inlineCode",{parentName:"li"},"screening_data_factory")," is not False"))),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"task.allowed_concurrent:")," An int for the number of allowed concurrent units at a time per worker. This value ",(0,r.kt)("strong",{parentName:"li"},"must be set to 1"),".",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"Screening units can only run this task type with one allowed concurrent unit at a time per worker, to ensure screening before moving into real units."))))),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"ScreenTaskSharedState"),":",(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"screening_data_factory"),": ",(0,r.kt)("inlineCode",{parentName:"li"},"False")," if you want to validate on real data. Otherwise, a factory that generates input data for a screening unit for a worker. Explained in-depth below.")))),(0,r.kt)("h2",{id:"setting-up-sharedtaskstate"},"Setting up SharedTaskState"),(0,r.kt)("p",null,"With the basic configuration done, you'll also need to provide additional arguments to your ",(0,r.kt)("inlineCode",{parentName:"p"},"SharedTaskState"),"\nto register the required qualifications and the screening validation function."),(0,r.kt)("p",null,"A shortened version of the run script for the video above looks like:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'# run_task.py\n\ndef my_screening_unit_generator():\n """\n The frontend react webapp reads in\n isScreeningUnit using the initialTaskData\n prop\n """\n while True:\n yield {"isScreeningUnit": True}\n\ndef validate_screening_unit(unit: Unit):\n """Checking if the drawn number is 3"""\n agent = unit.get_assigned_agent()\n if agent is not None:\n data = agent.state.get_data()\n annotation = data["outputs"]["final_submission"]["annotations"][0]\n if annotation["isCorrect"] and annotation["currentAnnotation"] == 3:\n return True\n return False\n\n@task_script(default_config_file="example.yaml")\ndef main(operator: Operator, cfg: DictConfig) -> None:\n is_using_screening_units = cfg.mephisto.blueprint["use_screening_task"]\n tasks: List[Dict[str, Any]] = [{"isScreeningUnit": False}] * cfg.num_tasks\n ...\n shared_state = SharedRemoteProcedureTaskState(\n static_task_data=tasks,\n function_registry=function_registry,\n )\n\n if is_using_screening_units:\n """You have to defined a few more properties to enable screening units"""\n shared_state.on_unit_submitted = ScreenTaskRequired.create_validation_function(\n cfg.mephisto,\n validate_screening_unit,\n )\n shared_state.screening_data_factory = my_screening_unit_generator()\n shared_state.qualifications += ScreenTaskRequired.get_mixin_qualifications(\n cfg.mephisto, shared_state,\n )\n ...\n')),(0,r.kt)("h3",{id:"see-the-full-code-here"},"See the full code ",(0,r.kt)("a",{parentName:"h3",href:"https://github.com/facebookresearch/Mephisto/blob/main/examples/remote_procedure/mnist/run_task.py"},"here")),(0,r.kt)("h3",{id:"see-hydra-configuration-here"},"See hydra configuration ",(0,r.kt)("a",{parentName:"h3",href:"https://github.com/facebookresearch/Mephisto/blob/main/examples/remote_procedure/mnist/hydra_configs/conf/screening_example.yaml"},"here")),(0,r.kt)("h3",{id:"simple-example-of-screeningcomponent"},"Simple example of ",(0,r.kt)("inlineCode",{parentName:"h3"},"ScreeningComponent")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"function ScreeningComponent({ taskData }) {\n return (\n
\n Do to succeed screening\n
\n );\n}\n")),(0,r.kt)("p",null,'To show pretty "blocked user" banner after not passing onboarding, you may need to add a react component in your app as well:'),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},'if (blockedReason !== null) {\n return (\n
\n
\n

\n {blockedExplanation}\n

\n
\n
\n );\n}\n')),(0,r.kt)("h2",{id:"additional-questions"},"Additional Questions?"),(0,r.kt)("p",null,"You can find more information on using screening units in the reference documentation for"),(0,r.kt)(s.Z,{target:null,to:"pathname:///python_api/mephisto/abstractions/blueprints/mixins/screen_task_required.html",mdxType:"Link"},"`ScreenTaskRequired`"),".")}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/d4b9235d.3f07127a.js b/assets/js/d4b9235d.9ab48252.js similarity index 99% rename from assets/js/d4b9235d.3f07127a.js rename to assets/js/d4b9235d.9ab48252.js index 4d6e19ccd..e58057b5a 100644 --- a/assets/js/d4b9235d.3f07127a.js +++ b/assets/js/d4b9235d.9ab48252.js @@ -1 +1 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[3548],{4127:function(t,e,a){a.d(e,{Zo:function(){return m},kt:function(){return u}});var r=a(1987);function n(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function i(t){for(var e=1;e=0||(n[a]=t[a]);return n}(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}var p=r.createContext({}),s=function(t){var e=r.useContext(p),a=e;return t&&(a="function"==typeof t?t(e):i(i({},e),t)),a},m=function(t){var e=s(t.components);return r.createElement(p.Provider,{value:e},t.children)},f="mdxType",d={inlineCode:"code",wrapper:function(t){var e=t.children;return r.createElement(r.Fragment,{},e)}},k=r.forwardRef((function(t,e){var a=t.components,n=t.mdxType,l=t.originalType,p=t.parentName,m=o(t,["components","mdxType","originalType","parentName"]),f=s(a),k=n,u=f["".concat(p,".").concat(k)]||f[k]||d[k]||l;return a?r.createElement(u,i(i({ref:e},m),{},{components:a})):r.createElement(u,i({ref:e},m))}));function u(t,e){var a=arguments,n=e&&e.mdxType;if("string"==typeof t||n){var l=a.length,i=new Array(l);i[0]=k;var o={};for(var p in e)hasOwnProperty.call(e,p)&&(o[p]=e[p]);o.originalType=t,o[f]="string"==typeof t?t:n,i[1]=o;for(var s=2;s"),(0,l.kt)("td",{parentName:"tr",align:"left"},"Any auxiliary parameter you need to pass for your task."),(0,l.kt)("td",{parentName:"tr",align:"left"},"None"),(0,l.kt)("td",{parentName:"tr",align:"left"},"False")))))}k.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[3548],{4127:function(t,e,a){a.d(e,{Zo:function(){return m},kt:function(){return u}});var r=a(1987);function n(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function i(t){for(var e=1;e=0||(n[a]=t[a]);return n}(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}var p=r.createContext({}),s=function(t){var e=r.useContext(p),a=e;return t&&(a="function"==typeof t?t(e):i(i({},e),t)),a},m=function(t){var e=s(t.components);return r.createElement(p.Provider,{value:e},t.children)},f="mdxType",d={inlineCode:"code",wrapper:function(t){var e=t.children;return r.createElement(r.Fragment,{},e)}},k=r.forwardRef((function(t,e){var a=t.components,n=t.mdxType,l=t.originalType,p=t.parentName,m=o(t,["components","mdxType","originalType","parentName"]),f=s(a),k=n,u=f["".concat(p,".").concat(k)]||f[k]||d[k]||l;return a?r.createElement(u,i(i({ref:e},m),{},{components:a})):r.createElement(u,i({ref:e},m))}));function u(t,e){var a=arguments,n=e&&e.mdxType;if("string"==typeof t||n){var l=a.length,i=new Array(l);i[0]=k;var o={};for(var p in e)hasOwnProperty.call(e,p)&&(o[p]=e[p]);o.originalType=t,o[f]="string"==typeof t?t:n,i[1]=o;for(var s=2;s"),(0,l.kt)("td",{parentName:"tr",align:"left"},"Any auxiliary parameter you need to pass for your task."),(0,l.kt)("td",{parentName:"tr",align:"left"},"None"),(0,l.kt)("td",{parentName:"tr",align:"left"},"False")))))}k.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/d6c92909.635a69b9.js b/assets/js/d6c92909.909403b9.js similarity index 72% rename from assets/js/d6c92909.635a69b9.js rename to assets/js/d6c92909.909403b9.js index b18259e01..dc686f506 100644 --- a/assets/js/d6c92909.635a69b9.js +++ b/assets/js/d6c92909.909403b9.js @@ -1 +1 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[8487],{4127:function(e,t,n){n.d(t,{Zo:function(){return p},kt:function(){return m}});var r=n(1987);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=r.createContext({}),u=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=u(e.components);return r.createElement(c.Provider,{value:t},e.children)},l="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,c=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),l=u(n),h=o,m=l["".concat(c,".").concat(h)]||l[h]||f[h]||i;return n?r.createElement(m,a(a({ref:t},p),{},{components:n})):r.createElement(m,a({ref:t},p))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=h;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[l]="string"==typeof e?e:o,a[1]=s;for(var u=2;u=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=r.createContext({}),u=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=u(e.components);return r.createElement(c.Provider,{value:t},e.children)},l="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,c=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),l=u(n),h=o,m=l["".concat(c,".").concat(h)]||l[h]||f[h]||i;return n?r.createElement(m,a(a({ref:t},p),{},{components:n})):r.createElement(m,a({ref:t},p))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=h;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[l]="string"==typeof e?e:o,a[1]=s;for(var u=2;u=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=o.createContext({}),u=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},d=function(e){var t=u(e.components);return o.createElement(s.Provider,{value:t},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),c=u(n),m=i,g=c["".concat(s,".").concat(m)]||c[m]||p[m]||a;return n?o.createElement(g,r(r({ref:t},d),{},{components:n})):o.createElement(g,r({ref:t},d))}));function g(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,r=new Array(a);r[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:i,r[1]=l;for(var u=2;uget_gold_for_worker",id:"get_gold_for_worker",level:3},{value:"Example project",id:"example-project",level:2},{value:"Understanding the code",id:"understanding-the-code",level:3},{value:"Advanced configuration",id:"advanced-configuration",level:2},{value:"worker_needs_gold",id:"worker_needs_gold",level:3},{value:"worker_qualifies",id:"worker_qualifies",level:3},{value:"Additional Questions?",id:"additional-questions",level:2}],m={toc:p};function g(e){var t=e.components,n=(0,i.Z)(e,l);return(0,a.kt)("wrapper",(0,o.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"check-against-standards-with-gold-labels"},"Check against standards with Gold Labels"),(0,a.kt)("p",null,"Gold labeling is commonly used for ensuring worker quality over the full duration of a task. It's valuable as an automated measure to track the consistency your workers. For this Mephisto provides the ",(0,a.kt)("inlineCode",{parentName:"p"},"UseGoldUnit")," blueprint mixin."),(0,a.kt)("h2",{id:"basic-configuration"},"Basic configuration"),(0,a.kt)("p",null,"There are a few primary configuration parts for using gold units:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Hydra args",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.gold_qualification_base"),": A string representing the base qualification that required qualifications keeping track of success will be built from."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.use_golds"),": Set to ",(0,a.kt)("inlineCode",{parentName:"li"},"True")," to enable the feature."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.max_gold_units"),": The maximum number of additional units you will pay out for evaluating on gold units. Note that you do pay for gold units, they are just like any other units."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.min_golds"),": An int for the minimum number of golds a worker needs to complete for the first time before receiving real units."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.max_incorrect_golds"),": An int for the number of golds a worker can get incorrect before being disqualified from this task."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"task.allowed_concurrent"),": Can only run this task type with one allowed concurrent unit at a time per worker, to ensure golds are completed in order."))),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"GoldUnitSharedState"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"get_gold_for_worker"),": A factory that generates input data for a gold unit for a worker. Explained in-depth below.")))),(0,a.kt)("p",null,"With these set up, you'll also need to provide additional arguments to your ",(0,a.kt)("inlineCode",{parentName:"p"},"SharedTaskState")," to register the required qualifications and the gold validation function. For example, your run script main may look something like like:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-python"},"...\ngold_data: List[Dict[str, Any]] = ...\ngold_ans = ...\n\ndef validate_gold_unit(unit: \"Unit\"):\n agent = unit.get_assigned_agent()\n data = agent.state.get_data()\n return data['outputs']['val'] == gold_ans[data['inputs']['ans_key']]\n\nshared_state = SharedStaticTaskState(\n ...\n get_gold_for_worker=get_gold_factory(gold_data),\n on_unit_submitted=UseGoldUnit.create_validation_function(cfg.mephisto, validate_gold_unit),\n)\nshared_state.qualifications += UseGoldUnit.get_mixin_qualifications(cfg.mephisto, shared_state)\n...\n")),(0,a.kt)("h3",{id:"get_gold_for_worker"},(0,a.kt)("inlineCode",{parentName:"h3"},"get_gold_for_worker")),(0,a.kt)("p",null,"The core functionality to provide to your ",(0,a.kt)("inlineCode",{parentName:"p"},"SharedTaskState")," to enable gold units is a ",(0,a.kt)("inlineCode",{parentName:"p"},"get_gold_for_worker")," factory function which produces the input data that a worker should receive when Mephisto is giving them a gold unit."),(0,a.kt)("p",null,"We provide a helper ",(0,a.kt)("inlineCode",{parentName:"p"},"get_gold_factory")," method which takes in a list of ",(0,a.kt)("em",{parentName:"p"},"all")," possible gold data inputs, and returns a factory that randomly selects a gold not yet completed by the given worker. This should be sufficient for most cases, though you can write your own factory if you want to be even more specific about how you assign golds."),(0,a.kt)("h2",{id:"example-project"},"Example project"),(0,a.kt)("p",null,"You can run an example project to try gold units for yourself."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml up\ndocker exec -it mephisto_dc bash\ncd /mephisto/examples/form_composer_demo\npython ./run_task_with_gold_unit.py\n")),(0,a.kt)("p",null,"The first unit that you will see will be the gold one.\nTo get past these example gold units, provide these predefined values:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"First name"),' - type "First"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Last name"),' - type "Last"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Email address for Mephisto"),' - type "',(0,a.kt)("a",{parentName:"li",href:"mailto:gold_user@mephisto.ai"},"gold_user@mephisto.ai"),'"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Country"),' - select "United States of America"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Language"),' - select "English" and "Spanish"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Biography since age of 18"),' - type a string that is longer than 10 chars, contains a word "Gold" and does not contain a word "Bad"')),(0,a.kt)("h3",{id:"understanding-the-code"},"Understanding the code"),(0,a.kt)("p",null,"For an in-depth look at code underlying this example, you can read these Python files in ",(0,a.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo")," directory:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"run_task_with_gold_unit.py")," - script to configure and launch this Task"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"hydra_configs/conf/example_local_mock_with_gold_unit.yaml")," - YAML configuration for this Task"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"data/simple/gold_units/gold_units_data.json")," - configuration for form that will be used specifically for gold units"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"data/simple/gold_units/gold_units_validation.py")," - logic of validating worker's output in gold unit form")),(0,a.kt)("h2",{id:"advanced-configuration"},"Advanced configuration"),(0,a.kt)("p",null,"There are additional arguments that you can use for more advanced configuration of gold units:\nThere are a few primary configuration parts for using gold units:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"GoldUnitSharedState"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"worker_needs_gold"),": A function that, given the counts of completed, correct, and incorrect golds for a given worker, as well as the minimum number of required golds, returns whether or not the worker should be shown a gold task."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"worker_qualifies"),": A function that, given the counts of completed, correct, and incorrect golds for a given worker, as well as the maximum number of incorrect, returns whether or not the worker is eligible to work on the task.")))),(0,a.kt)("h3",{id:"worker_needs_gold"},(0,a.kt)("inlineCode",{parentName:"h3"},"worker_needs_gold")),(0,a.kt)("p",null,"By default we use a logrithmic function that decreases the frequency of gold units as the worker successfully completes them, starting at the ",(0,a.kt)("inlineCode",{parentName:"p"},"min_golds")," value of golds, then 1 gold in the first 10 units, ~%5 golds at 100 units, and ~1% golds at 1000 units."),(0,a.kt)("p",null,"If you want to do something more complicated, or use a different rate, you can override this for a custom scaling rate."),(0,a.kt)("h3",{id:"worker_qualifies"},(0,a.kt)("inlineCode",{parentName:"h3"},"worker_qualifies")),(0,a.kt)("p",null,"By default we use a strikes system, where if the worker exceeds the ",(0,a.kt)("inlineCode",{parentName:"p"},"max_incorrect_golds")," value we prevent them from working on more tasks. Depending on your acceptable level of noise (either in your gold labels, interpretation, or output dataset), you may instead want to base this on a fraction of incorrect golds to golds completed so far."),(0,a.kt)("h2",{id:"additional-questions"},"Additional Questions?"),(0,a.kt)("p",null,"You can find more information on using gold units in the reference documentation for ",(0,a.kt)(r.Z,{target:null,to:"pathname:///python_api/mephisto/abstractions/blueprints/mixins/use_gold_unit.html",mdxType:"Link"},(0,a.kt)("inlineCode",{parentName:"p"},"UseGoldUnit")),"."))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[6628],{4127:function(e,t,n){n.d(t,{Zo:function(){return d},kt:function(){return g}});var o=n(1987);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=o.createContext({}),u=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},d=function(e){var t=u(e.components);return o.createElement(s.Provider,{value:t},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),c=u(n),m=i,g=c["".concat(s,".").concat(m)]||c[m]||p[m]||a;return n?o.createElement(g,r(r({ref:t},d),{},{components:n})):o.createElement(g,r({ref:t},d))}));function g(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,r=new Array(a);r[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:i,r[1]=l;for(var u=2;uget_gold_for_worker",id:"get_gold_for_worker",level:3},{value:"Example project",id:"example-project",level:2},{value:"Understanding the code",id:"understanding-the-code",level:3},{value:"Advanced configuration",id:"advanced-configuration",level:2},{value:"worker_needs_gold",id:"worker_needs_gold",level:3},{value:"worker_qualifies",id:"worker_qualifies",level:3},{value:"Additional Questions?",id:"additional-questions",level:2}],m={toc:p};function g(e){var t=e.components,n=(0,i.Z)(e,l);return(0,a.kt)("wrapper",(0,o.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"check-against-standards-with-gold-labels"},"Check against standards with Gold Labels"),(0,a.kt)("p",null,"Gold labeling is commonly used for ensuring worker quality over the full duration of a task. It's valuable as an automated measure to track the consistency your workers. For this Mephisto provides the ",(0,a.kt)("inlineCode",{parentName:"p"},"UseGoldUnit")," blueprint mixin."),(0,a.kt)("h2",{id:"basic-configuration"},"Basic configuration"),(0,a.kt)("p",null,"There are a few primary configuration parts for using gold units:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Hydra args",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.gold_qualification_base"),": A string representing the base qualification that required qualifications keeping track of success will be built from."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.use_golds"),": Set to ",(0,a.kt)("inlineCode",{parentName:"li"},"True")," to enable the feature."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.max_gold_units"),": The maximum number of additional units you will pay out for evaluating on gold units. Note that you do pay for gold units, they are just like any other units."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.min_golds"),": An int for the minimum number of golds a worker needs to complete for the first time before receiving real units."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"blueprint.max_incorrect_golds"),": An int for the number of golds a worker can get incorrect before being disqualified from this task."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"task.allowed_concurrent"),": Can only run this task type with one allowed concurrent unit at a time per worker, to ensure golds are completed in order."))),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"GoldUnitSharedState"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"get_gold_for_worker"),": A factory that generates input data for a gold unit for a worker. Explained in-depth below.")))),(0,a.kt)("p",null,"With these set up, you'll also need to provide additional arguments to your ",(0,a.kt)("inlineCode",{parentName:"p"},"SharedTaskState")," to register the required qualifications and the gold validation function. For example, your run script main may look something like like:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-python"},"...\ngold_data: List[Dict[str, Any]] = ...\ngold_ans = ...\n\ndef validate_gold_unit(unit: \"Unit\"):\n agent = unit.get_assigned_agent()\n data = agent.state.get_data()\n return data['outputs']['val'] == gold_ans[data['inputs']['ans_key']]\n\nshared_state = SharedStaticTaskState(\n ...\n get_gold_for_worker=get_gold_factory(gold_data),\n on_unit_submitted=UseGoldUnit.create_validation_function(cfg.mephisto, validate_gold_unit),\n)\nshared_state.qualifications += UseGoldUnit.get_mixin_qualifications(cfg.mephisto, shared_state)\n...\n")),(0,a.kt)("h3",{id:"get_gold_for_worker"},(0,a.kt)("inlineCode",{parentName:"h3"},"get_gold_for_worker")),(0,a.kt)("p",null,"The core functionality to provide to your ",(0,a.kt)("inlineCode",{parentName:"p"},"SharedTaskState")," to enable gold units is a ",(0,a.kt)("inlineCode",{parentName:"p"},"get_gold_for_worker")," factory function which produces the input data that a worker should receive when Mephisto is giving them a gold unit."),(0,a.kt)("p",null,"We provide a helper ",(0,a.kt)("inlineCode",{parentName:"p"},"get_gold_factory")," method which takes in a list of ",(0,a.kt)("em",{parentName:"p"},"all")," possible gold data inputs, and returns a factory that randomly selects a gold not yet completed by the given worker. This should be sufficient for most cases, though you can write your own factory if you want to be even more specific about how you assign golds."),(0,a.kt)("h2",{id:"example-project"},"Example project"),(0,a.kt)("p",null,"You can run an example project to try gold units for yourself."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"docker-compose -f docker/docker-compose.dev.yml up\ndocker exec -it mephisto_dc bash\ncd /mephisto/examples/form_composer_demo\npython ./run_task_with_gold_unit__local__inhouse.py\n")),(0,a.kt)("p",null,"The first unit that you will see will be the gold one.\nTo get past these example gold units, provide these predefined values:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"First name"),' - type "First"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Last name"),' - type "Last"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Email address for Mephisto"),' - type "',(0,a.kt)("a",{parentName:"li",href:"mailto:gold_user@mephisto.ai"},"gold_user@mephisto.ai"),'"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Country"),' - select "United States of America"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Language"),' - select "English" and "Spanish"'),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Biography since age of 18"),' - type a string that is longer than 10 chars, contains a word "Gold" and does not contain a word "Bad"')),(0,a.kt)("h3",{id:"understanding-the-code"},"Understanding the code"),(0,a.kt)("p",null,"For an in-depth look at code underlying this example, you can read these Python files in ",(0,a.kt)("inlineCode",{parentName:"p"},"examples/form_composer_demo")," directory:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"run_task_with_gold_unit__local__inhouse.py")," - script to configure and launch this Task"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"hydra_configs/conf/example_with_gold_unit__local__inhouse.yaml")," - YAML configuration for this Task"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"data/simple/gold_units/gold_units_data.json")," - configuration for form that will be used specifically for gold units"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"data/simple/gold_units/gold_units_validation.py")," - logic of validating worker's output in gold unit form")),(0,a.kt)("h2",{id:"advanced-configuration"},"Advanced configuration"),(0,a.kt)("p",null,"There are additional arguments that you can use for more advanced configuration of gold units:\nThere are a few primary configuration parts for using gold units:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"GoldUnitSharedState"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"worker_needs_gold"),": A function that, given the counts of completed, correct, and incorrect golds for a given worker, as well as the minimum number of required golds, returns whether or not the worker should be shown a gold task."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"worker_qualifies"),": A function that, given the counts of completed, correct, and incorrect golds for a given worker, as well as the maximum number of incorrect, returns whether or not the worker is eligible to work on the task.")))),(0,a.kt)("h3",{id:"worker_needs_gold"},(0,a.kt)("inlineCode",{parentName:"h3"},"worker_needs_gold")),(0,a.kt)("p",null,"By default we use a logrithmic function that decreases the frequency of gold units as the worker successfully completes them, starting at the ",(0,a.kt)("inlineCode",{parentName:"p"},"min_golds")," value of golds, then 1 gold in the first 10 units, ~%5 golds at 100 units, and ~1% golds at 1000 units."),(0,a.kt)("p",null,"If you want to do something more complicated, or use a different rate, you can override this for a custom scaling rate."),(0,a.kt)("h3",{id:"worker_qualifies"},(0,a.kt)("inlineCode",{parentName:"h3"},"worker_qualifies")),(0,a.kt)("p",null,"By default we use a strikes system, where if the worker exceeds the ",(0,a.kt)("inlineCode",{parentName:"p"},"max_incorrect_golds")," value we prevent them from working on more tasks. Depending on your acceptable level of noise (either in your gold labels, interpretation, or output dataset), you may instead want to base this on a fraction of incorrect golds to golds completed so far."),(0,a.kt)("h2",{id:"additional-questions"},"Additional Questions?"),(0,a.kt)("p",null,"You can find more information on using gold units in the reference documentation for ",(0,a.kt)(r.Z,{target:null,to:"pathname:///python_api/mephisto/abstractions/blueprints/mixins/use_gold_unit.html",mdxType:"Link"},(0,a.kt)("inlineCode",{parentName:"p"},"UseGoldUnit")),"."))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/dee53823.ef2d5176.js b/assets/js/dee53823.2adcee8f.js similarity index 61% rename from assets/js/dee53823.ef2d5176.js rename to assets/js/dee53823.2adcee8f.js index f76e4f4a1..6a0982f11 100644 --- a/assets/js/dee53823.ef2d5176.js +++ b/assets/js/dee53823.2adcee8f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[4284],{4127:function(e,i,t){t.d(i,{Zo:function(){return p},kt:function(){return f}});var n=t(1987);function r(e,i,t){return i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function l(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var i=1;i=0||(r[t]=e[t]);return r}(e,i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=n.createContext({}),u=function(e){var i=n.useContext(s),t=i;return e&&(t="function"==typeof e?e(i):a(a({},i),e)),t},p=function(e){var i=u(e.components);return n.createElement(s.Provider,{value:i},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var i=e.children;return n.createElement(n.Fragment,{},i)}},d=n.forwardRef((function(e,i){var t=e.components,r=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=u(t),d=r,f=c["".concat(s,".").concat(d)]||c[d]||m[d]||l;return t?n.createElement(f,a(a({ref:i},p),{},{components:t})):n.createElement(f,a({ref:i},p))}));function f(e,i){var t=arguments,r=i&&i.mdxType;if("string"==typeof e||r){var l=t.length,a=new Array(l);a[0]=d;var o={};for(var s in i)hasOwnProperty.call(i,s)&&(o[s]=i[s]);o.originalType=e,o[c]="string"==typeof e?e:r,a[1]=o;for(var u=2;u",\n "max_age": "",\n },\n {\n "name": "ApprovalNumbersEligibilityRequirement",\n "minimum_approvals": "",\n "maximum_approvals": "",\n },\n {\n "name": "ApprovalRateEligibilityRequirement",\n "minimum_approval_rate": "",\n "maximum_approval_rate": "",\n },\n {\n "name": "CustomBlacklistEligibilityRequirement",\n "black_list": "",\n },\n {\n "name": "CustomWhitelistEligibilityRequirement",\n "white_list": "",\n },\n {\n "name": "JoinedBeforeEligibilityRequirement",\n "joined_before": "",\n },\n {\n "name": "ParticipantGroupEligibilityRequirement",\n "id": "",\n },\n]\n')),(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"NOTE: this list (last updated 2023.07.11) is derived from list of available classes\nin ",(0,l.kt)("inlineCode",{parentName:"em"},"mephisto/abstractions/providers/prolific/api/eligibility_requirement_classes"),".")),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"block-and-allow-lists"},"Block and Allow lists"),(0,l.kt)("p",null,"Prolific provides a way to limit Study participants based on their IDs\nvia EGPs called ",(0,l.kt)("inlineCode",{parentName:"p"},"prolific_allow_list_group_name"),"\nand ",(0,l.kt)("inlineCode",{parentName:"p"},"prolific_block_list_group_name"),":"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Manual allow list is applied via ",(0,l.kt)("inlineCode",{parentName:"li"},"CustomWhitelistEligibilityRequirement"),(0,l.kt)("ul",{parentName:"li"},(0,l.kt)("li",{parentName:"ul"},"This can be useful when testing your Task, and limiting its visibility to only a few test workers"))),(0,l.kt)("li",{parentName:"ul"},"Manual block list is applied via ",(0,l.kt)("inlineCode",{parentName:"li"},"CustomBlacklistEligibilityRequirement"),(0,l.kt)("pre",{parentName:"li"},(0,l.kt)("code",{parentName:"pre"},"- We do not recommend using manual block list directly, because we auto-compose it during every TaskRun,\n")),"based on ",(0,l.kt)("inlineCode",{parentName:"li"},"is_blocked")," column in the local datastore.")))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[4284],{4127:function(e,i,t){t.d(i,{Zo:function(){return p},kt:function(){return f}});var n=t(1987);function r(e,i,t){return i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function l(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var i=1;i=0||(r[t]=e[t]);return r}(e,i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=n.createContext({}),u=function(e){var i=n.useContext(s),t=i;return e&&(t="function"==typeof e?e(i):a(a({},i),e)),t},p=function(e){var i=u(e.components);return n.createElement(s.Provider,{value:i},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var i=e.children;return n.createElement(n.Fragment,{},i)}},d=n.forwardRef((function(e,i){var t=e.components,r=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=u(t),d=r,f=c["".concat(s,".").concat(d)]||c[d]||m[d]||l;return t?n.createElement(f,a(a({ref:i},p),{},{components:t})):n.createElement(f,a({ref:i},p))}));function f(e,i){var t=arguments,r=i&&i.mdxType;if("string"==typeof e||r){var l=t.length,a=new Array(l);a[0]=d;var o={};for(var s in i)hasOwnProperty.call(i,s)&&(o[s]=i[s]);o.originalType=e,o[c]="string"==typeof e?e:r,a[1]=o;for(var u=2;u",\n "max_age": "",\n },\n {\n "name": "ApprovalNumbersEligibilityRequirement",\n "minimum_approvals": "",\n "maximum_approvals": "",\n },\n {\n "name": "ApprovalRateEligibilityRequirement",\n "minimum_approval_rate": "",\n "maximum_approval_rate": "",\n },\n {\n "name": "CustomBlacklistEligibilityRequirement",\n "black_list": "",\n },\n {\n "name": "CustomWhitelistEligibilityRequirement",\n "white_list": "",\n },\n {\n "name": "JoinedBeforeEligibilityRequirement",\n "joined_before": "",\n },\n {\n "name": "ParticipantGroupEligibilityRequirement",\n "id": "",\n },\n]\n')),(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"NOTE: this list (last updated 2023.07.11) is derived from list of available classes\nin ",(0,l.kt)("inlineCode",{parentName:"em"},"mephisto/abstractions/providers/prolific/api/eligibility_requirement_classes"),".")),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"block-and-allow-lists"},"Block and Allow lists"),(0,l.kt)("p",null,"Prolific provides a way to limit Study participants based on their IDs\nvia EGPs called ",(0,l.kt)("inlineCode",{parentName:"p"},"prolific_allow_list_group_name"),"\nand ",(0,l.kt)("inlineCode",{parentName:"p"},"prolific_block_list_group_name"),":"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Manual allow list is applied via ",(0,l.kt)("inlineCode",{parentName:"li"},"CustomWhitelistEligibilityRequirement"),(0,l.kt)("ul",{parentName:"li"},(0,l.kt)("li",{parentName:"ul"},"This can be useful when testing your Task, and limiting its visibility to only a few test workers"))),(0,l.kt)("li",{parentName:"ul"},"Manual block list is applied via ",(0,l.kt)("inlineCode",{parentName:"li"},"CustomBlacklistEligibilityRequirement"),(0,l.kt)("pre",{parentName:"li"},(0,l.kt)("code",{parentName:"pre"},"- We do not recommend using manual block list directly, because we auto-compose it during every TaskRun,\n")),"based on ",(0,l.kt)("inlineCode",{parentName:"li"},"is_blocked")," column in the local datastore.")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f5e01c1b.63912a79.js b/assets/js/f5e01c1b.2230f314.js similarity index 62% rename from assets/js/f5e01c1b.63912a79.js rename to assets/js/f5e01c1b.2230f314.js index 31f8d7554..c1fb545c5 100644 --- a/assets/js/f5e01c1b.63912a79.js +++ b/assets/js/f5e01c1b.2230f314.js @@ -1 +1 @@ -"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[6231],{4127:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return f}});var o=n(1987);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=o.createContext({}),u=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=u(e.components);return o.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=u(n),m=a,f=p["".concat(s,".").concat(m)]||p[m]||d[m]||r;return n?o.createElement(f,i(i({ref:t},c),{},{components:n})):o.createElement(f,i({ref:t},c))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,i=new Array(r);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:a,i[1]=l;for(var u=2;u=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=o.createContext({}),u=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=u(e.components);return o.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=u(n),m=a,f=p["".concat(s,".").concat(m)]||p[m]||d[m]||r;return n?o.createElement(f,i(i({ref:t},c),{},{components:n})):o.createElement(f,i({ref:t},c))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,i=new Array(r);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:a,i[1]=l;for(var u=2;u=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var d=a.createContext({}),l=function(t){var e=a.useContext(d),n=e;return t&&(n="function"==typeof t?t(e):r(r({},e),t)),n},u=function(t){var e=l(t.components);return a.createElement(d.Provider,{value:e},t.children)},c="mdxType",p={inlineCode:"code",wrapper:function(t){var e=t.children;return a.createElement(a.Fragment,{},e)}},g=a.forwardRef((function(t,e){var n=t.components,o=t.mdxType,i=t.originalType,d=t.parentName,u=s(t,["components","mdxType","originalType","parentName"]),c=l(n),g=o,h=c["".concat(d,".").concat(g)]||c[g]||p[g]||i;return n?a.createElement(h,r(r({ref:e},u),{},{components:n})):a.createElement(h,r({ref:e},u))}));function h(t,e){var n=arguments,o=e&&e.mdxType;if("string"==typeof t||o){var i=n.length,r=new Array(i);r[0]=g;var s={};for(var d in e)hasOwnProperty.call(e,d)&&(s[d]=e[d]);s.originalType=t,s[c]="string"==typeof t?t:o,r[1]=s;for(var l=2;l;\n }\n...\n")),(0,i.kt)("p",null,"And now we can go to ",(0,i.kt)("inlineCode",{parentName:"p"},"core_components.jsx")," and put some new components here:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},'// webapp/src/components/core_components.jsx\n// Component for displaying an individual sentence and picking the response\nfunction SentenceDisplay({idx, currSelected, displayText, onChangeSelected}) {\n return (\n <>\n

{displayText}

\n
\n
\n onChangeSelected({idx, rating: "good" })}\n >\n Mark as Good\n \n
\n
\n onChangeSelected({idx, rating: "bad" })}\n >\n Mark as Bad\n \n
\n
\n
\n \n );\n}\n\n// Replace the existing OnboardingComponent with this one\nfunction OnboardingComponent({ onboardingData, onSubmit }) {\n // Grab the list of good and bad phrases and shuffle them\n const [textList, _setTextList] = React.useState(\n [...onboardingData[\'good\'], ...onboardingData[\'bad\']]\n .map(text => ({ text, rand: Math.random() }))\n .sort((a, b) => a.rand - b.rand)\n .map(({ text }) => text)\n );\n // Create a ratings object to hold the annotations\n const [ratings, updateRatings] = React.useReducer(\n (oldRatings, {idx, rating}) => {\n return oldRatings.map((oldRating, i) =>\n i == idx ? rating : oldRating\n );\n },\n (textList.map(() => null))\n );\n // Function to zip the text list to the ratings\n function zipResults() {\n return Object.fromEntries(textList.map((t, idx) => [t, ratings[idx]]));\n }\n return (\n
\n \n In this task you\'ll be presented with a sentence, and need to provide a rating of either "Good" or "Bad". For our definition, all sentences are "good" by default, unless they contain the word "bad". Complete the following 4 examples.\n \n
\n {\n // Construct an input for each question\n textList.map((text, idx) => )\n }\n val === null)}\n onClick={() => onSubmit({ ratings: zipResults()})}\n >\n Submit Answers\n \n
\n
\n );\n}\n')),(0,i.kt)("p",null,"With this, let's launch again with ",(0,i.kt)("inlineCode",{parentName:"p"},"python run_task.py conf=onboarding_example"),". Once launched, you can follow through to ",(0,i.kt)("a",{parentName:"p",href:"localhost:3000/?worker_id=y&assignment_id=1"},(0,i.kt)("inlineCode",{parentName:"a"},"localhost:3000/?worker_id=y&assignment_id=1")),". ",(0,i.kt)("strong",{parentName:"p"},"Note")," that now we're accessing as worker ",(0,i.kt)("inlineCode",{parentName:"p"},"y"),". We do this because worker ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," has already completed onboarding for our task name, and so they'd skip it! Onboarding is only surfaced the ",(0,i.kt)("em",{parentName:"p"},"first time")," a worker completes a task by a given ",(0,i.kt)("inlineCode",{parentName:"p"},"onboarding_qualification"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(5e3).Z,width:"1283",height:"916"})),(0,i.kt)("p",null,"This is much more relevant to the core task! Now that we can collect an onboarding, let's move on to validating the content to ensure workers understood the task."),(0,i.kt)("h3",{id:"23-onboarding-validation"},"2.3 Onboarding validation"),(0,i.kt)("p",null,"The crux of onboarding validation occurs in the function we provide to ",(0,i.kt)("inlineCode",{parentName:"p"},"validate_onboarding"),". In this case, it was:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"}," def onboarding_always_valid(onboarding_data):\n return True\n")),(0,i.kt)("p",null,"Well, this isn't going to be doing any validation just yet. We'll have to write a new validation function. To do this, let's see what we would have received from ",(0,i.kt)("inlineCode",{parentName:"p"},"onboarding_data"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"{\n 'inputs': {\n 'good': ['Today was good', 'I like ice cream'], \n 'bad': ['Dirt tastes bad', 'Bad news']\n },\n 'outputs': {\n 'ratings': {\n 'Dirt tastes bad': 'good', \n 'Today was good': 'good', \n 'I like ice cream': 'bad', \n 'Bad news': 'bad'\n }\n }, \n 'times': {'task_start': 1646947187.8276632, 'task_end': 1646947350.760277}\n}\n")),(0,i.kt)("p",null,"From here we can check the inputs and outputs to generate a new onboarding test:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"def onboarding_labeled_correctly(onboarding_data):\n for text, rating in onboarding_data['outputs']['ratings'].items():\n if text not in onboarding_data['inputs'][rating]:\n return False\n return True\n\n...\n\nshared_state = SharedStaticTaskState(\n ...\n validate_onboarding=onboarding_labeled_correctly,\n)\n")),(0,i.kt)("p",null,"And that's it! Let's move forward to test that this works."),(0,i.kt)("h3",{id:"24-testing"},"2.4 Testing"),(0,i.kt)("p",null,"Let's launch again with ",(0,i.kt)("inlineCode",{parentName:"p"},"python run_task.py conf=onboarding_example"),". Once launched, we should open a tab for ",(0,i.kt)("a",{parentName:"p",href:"localhost:3000/?worker_id=a&assignment_id=1"},(0,i.kt)("inlineCode",{parentName:"a"},"worker a"))," and ",(0,i.kt)("a",{parentName:"p",href:"localhost:3000/?worker_id=b&assignment_id=1"},(0,i.kt)("inlineCode",{parentName:"a"},"worker b")),". Complete the onboarding correctly as one worker, and assert that you're able to make it through to the task! Complete it incorrectly as the other, and note that you are not qualified to work on the task. With this, you have a functioning basic onboarding task!"),(0,i.kt)("h2",{id:"3-reviews-with-onboarding"},"3. Reviews with onboarding"),(0,i.kt)("p",null,"Mephisto doesn't currently provide out-of-the-box tooling for manually reviewing onboarding tasks, as these should be handled by your own tools. It is certainly possible to query these agents directly to see them though, as you may want to examine what workers are putting in during your onboarding"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"from mephisto.abstractions.databases.local_database import LocalMephistoDB\ndb = LocalMephistoDB()\ntask = db.find_tasks(task_name='onboarding-tutorial-iterating')[0]\nonboarding_agents = db.find_onboarding_agents(task_id=task.db_id)\nprint(onboarding_agents[-1].state.get_data())\n# {'inputs': {'good': ['Today was good', 'I like ice cream'], 'bad': ['Dirt tastes bad', 'Bad news']}, 'outputs': {'ratings': {'Today was good': 'good', 'I like ice cream': 'good', 'Bad news': 'bad', 'Dirt tastes bad': 'bad'}}, 'times': {'task_start': 1646948706.989197, 'task_end': 1646948712.4583411}}\n")),(0,i.kt)("p",null,"Retrieving the onboarding unit associated with a specific task unit isn't yet supported, see ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/facebookresearch/Mephisto/issues/600"},"#600")," if you're interested in potentially helping build this!"))}g.isMDXComponent=!0},5e3:function(t,e,n){e.Z=n.p+"assets/images/tutorial_onboarding_new_interface-5edb8c3c152f1fb67278626819c2b0d2.png"}}]); \ No newline at end of file diff --git a/assets/js/ffe02791.96828ad8.js b/assets/js/ffe02791.96828ad8.js new file mode 100644 index 000000000..0586aa1cd --- /dev/null +++ b/assets/js/ffe02791.96828ad8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[1457],{4127:function(t,e,n){n.d(e,{Zo:function(){return u},kt:function(){return g}});var a=n(1987);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function r(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var d=a.createContext({}),l=function(t){var e=a.useContext(d),n=e;return t&&(n="function"==typeof t?t(e):r(r({},e),t)),n},u=function(t){var e=l(t.components);return a.createElement(d.Provider,{value:e},t.children)},c="mdxType",p={inlineCode:"code",wrapper:function(t){var e=t.children;return a.createElement(a.Fragment,{},e)}},h=a.forwardRef((function(t,e){var n=t.components,o=t.mdxType,i=t.originalType,d=t.parentName,u=s(t,["components","mdxType","originalType","parentName"]),c=l(n),h=o,g=c["".concat(d,".").concat(h)]||c[h]||p[h]||i;return n?a.createElement(g,r(r({ref:e},u),{},{components:n})):a.createElement(g,r({ref:e},u))}));function g(t,e){var n=arguments,o=e&&e.mdxType;if("string"==typeof t||o){var i=n.length,r=new Array(i);r[0]=h;var s={};for(var d in e)hasOwnProperty.call(e,d)&&(s[d]=e[d]);s.originalType=t,s[c]="string"==typeof t?t:o,r[1]=s;for(var l=2;l;\n }\n...\n")),(0,i.kt)("p",null,"And now we can go to ",(0,i.kt)("inlineCode",{parentName:"p"},"core_components.jsx")," and put some new components here:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},'// webapp/src/components/core_components.jsx\n// Component for displaying an individual sentence and picking the response\nfunction SentenceDisplay({idx, currSelected, displayText, onChangeSelected}) {\n return (\n <>\n

{displayText}

\n
\n
\n onChangeSelected({idx, rating: "good" })}\n >\n Mark as Good\n \n
\n
\n onChangeSelected({idx, rating: "bad" })}\n >\n Mark as Bad\n \n
\n
\n
\n \n );\n}\n\n// Replace the existing OnboardingComponent with this one\nfunction OnboardingComponent({ onboardingData, onSubmit }) {\n // Grab the list of good and bad phrases and shuffle them\n const [textList, _setTextList] = React.useState(\n [...onboardingData[\'good\'], ...onboardingData[\'bad\']]\n .map(text => ({ text, rand: Math.random() }))\n .sort((a, b) => a.rand - b.rand)\n .map(({ text }) => text)\n );\n // Create a ratings object to hold the annotations\n const [ratings, updateRatings] = React.useReducer(\n (oldRatings, {idx, rating}) => {\n return oldRatings.map((oldRating, i) =>\n i == idx ? rating : oldRating\n );\n },\n (textList.map(() => null))\n );\n // Function to zip the text list to the ratings\n function zipResults() {\n return Object.fromEntries(textList.map((t, idx) => [t, ratings[idx]]));\n }\n return (\n
\n \n In this task you\'ll be presented with a sentence, and need to provide a rating of either "Good" or "Bad". For our definition, all sentences are "good" by default, unless they contain the word "bad". Complete the following 4 examples.\n \n
\n {\n // Construct an input for each question\n textList.map((text, idx) => )\n }\n val === null)}\n onClick={() => onSubmit({ ratings: zipResults()})}\n >\n Submit Answers\n \n
\n
\n );\n}\n')),(0,i.kt)("p",null,"With this, let's launch again with ",(0,i.kt)("inlineCode",{parentName:"p"},"python run_task__local__inhouse.py conf=example_with_onboarding__local__inhouse"),". Once launched, you can follow through to ",(0,i.kt)("a",{parentName:"p",href:"localhost:3000/?worker_id=y&id=1"},(0,i.kt)("inlineCode",{parentName:"a"},"localhost:3000/?worker_id=y&assignment_id=1")),". ",(0,i.kt)("strong",{parentName:"p"},"Note")," that now we're accessing as worker ",(0,i.kt)("inlineCode",{parentName:"p"},"y"),". We do this because worker ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," has already completed onboarding for our task name, and so they'd skip it! Onboarding is only surfaced the ",(0,i.kt)("em",{parentName:"p"},"first time")," a worker completes a task by a given ",(0,i.kt)("inlineCode",{parentName:"p"},"onboarding_qualification"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{src:n(5e3).Z,width:"1283",height:"916"})),(0,i.kt)("p",null,"This is much more relevant to the core task! Now that we can collect an onboarding, let's move on to validating the content to ensure workers understood the task."),(0,i.kt)("h3",{id:"23-onboarding-validation"},"2.3 Onboarding validation"),(0,i.kt)("p",null,"The crux of onboarding validation occurs in the function we provide to ",(0,i.kt)("inlineCode",{parentName:"p"},"validate_onboarding"),". In this case, it was:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"}," def onboarding_always_valid(onboarding_data):\n return True\n")),(0,i.kt)("p",null,"Well, this isn't going to be doing any validation just yet. We'll have to write a new validation function. To do this, let's see what we would have received from ",(0,i.kt)("inlineCode",{parentName:"p"},"onboarding_data"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"{\n 'inputs': {\n 'good': ['Today was good', 'I like ice cream'], \n 'bad': ['Dirt tastes bad', 'Bad news']\n },\n 'outputs': {\n 'ratings': {\n 'Dirt tastes bad': 'good', \n 'Today was good': 'good', \n 'I like ice cream': 'bad', \n 'Bad news': 'bad'\n }\n }, \n 'times': {'task_start': 1646947187.8276632, 'task_end': 1646947350.760277}\n}\n")),(0,i.kt)("p",null,"From here we can check the inputs and outputs to generate a new onboarding test:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"def onboarding_labeled_correctly(onboarding_data):\n for text, rating in onboarding_data['outputs']['ratings'].items():\n if text not in onboarding_data['inputs'][rating]:\n return False\n return True\n\n...\n\nshared_state = SharedStaticTaskState(\n ...\n validate_onboarding=onboarding_labeled_correctly,\n)\n")),(0,i.kt)("p",null,"And that's it! Let's move forward to test that this works."),(0,i.kt)("h3",{id:"24-testing"},"2.4 Testing"),(0,i.kt)("p",null,"Let's launch again with ",(0,i.kt)("inlineCode",{parentName:"p"},"python run_task__local__inhouse.py conf=example_with_onboarding__local__inhouse"),". Once launched, we should open a tab for ",(0,i.kt)("a",{parentName:"p",href:"localhost:3000/?worker_id=a&id=1"},(0,i.kt)("inlineCode",{parentName:"a"},"worker a"))," and ",(0,i.kt)("a",{parentName:"p",href:"localhost:3000/?worker_id=b&id=1"},(0,i.kt)("inlineCode",{parentName:"a"},"worker b")),". Complete the onboarding correctly as one worker, and assert that you're able to make it through to the task! Complete it incorrectly as the other, and note that you are not qualified to work on the task. With this, you have a functioning basic onboarding task!"),(0,i.kt)("h2",{id:"3-reviews-with-onboarding"},"3. Reviews with onboarding"),(0,i.kt)("p",null,"Mephisto doesn't currently provide out-of-the-box tooling for manually reviewing onboarding tasks, as these should be handled by your own tools. It is certainly possible to query these agents directly to see them though, as you may want to examine what workers are putting in during your onboarding"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-python"},"from mephisto.abstractions.databases.local_database import LocalMephistoDB\ndb = LocalMephistoDB()\ntask = db.find_tasks(task_name='onboarding-tutorial-iterating')[0]\nonboarding_agents = db.find_onboarding_agents(task_id=task.db_id)\nprint(onboarding_agents[-1].state.get_data())\n# {'inputs': {'good': ['Today was good', 'I like ice cream'], 'bad': ['Dirt tastes bad', 'Bad news']}, 'outputs': {'ratings': {'Today was good': 'good', 'I like ice cream': 'good', 'Bad news': 'bad', 'Dirt tastes bad': 'bad'}}, 'times': {'task_start': 1646948706.989197, 'task_end': 1646948712.4583411}}\n")),(0,i.kt)("p",null,"Retrieving the onboarding unit associated with a specific task unit isn't yet supported, see ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/facebookresearch/Mephisto/issues/600"},"#600")," if you're interested in potentially helping build this!"))}h.isMDXComponent=!0},5e3:function(t,e,n){e.Z=n.p+"assets/images/tutorial_onboarding_new_interface-5edb8c3c152f1fb67278626819c2b0d2.png"}}]); \ No newline at end of file diff --git a/assets/js/main.6e57e084.js b/assets/js/main.78083203.js similarity index 99% rename from assets/js/main.6e57e084.js rename to assets/js/main.78083203.js index af9d07518..c1632f916 100644 --- a/assets/js/main.6e57e084.js +++ b/assets/js/main.78083203.js @@ -1,2 +1,2 @@ -/*! For license information please see main.6e57e084.js.LICENSE.txt */ -(self.webpackChunkweb=self.webpackChunkweb||[]).push([[179],{6160:function(e,t,n){"use strict";n.d(t,{_:function(){return o},t:function(){return i}});var r=n(1987),o=r.createContext(!1);function i(e){var t=e.children,n=(0,r.useState)(!1),i=n[0],a=n[1];return(0,r.useEffect)((function(){a(!0)}),[]),r.createElement(o.Provider,{value:i},t)}},7532:function(e,t,n){"use strict";var r=n(1987),o=n(3717),i=n(1727),a=n(9246),s=n(6153),u=[n(6714),n(4990),n(7237),n(1250)],l=n(2811),c=n(4593),d=n(1158);function f(e){var t=e.children;return r.createElement(r.Fragment,null,t)}var p=n(9375),h=n(1367),m=n(1109),g=n(1244),v=n(2564),b=n(3930),y=n(9612),w=n(4135),_=n(423),k=n(4674);function E(){var e=(0,m.Z)().i18n,t=e.defaultLocale,n=e.localeConfigs,o=(0,y.l)();return r.createElement(h.Z,null,Object.entries(n).map((function(e){var t=e[0],n=e[1].htmlLang;return r.createElement("link",{key:t,rel:"alternate",href:o.createUrl({locale:t,fullyQualified:!0}),hrefLang:n})})),r.createElement("link",{rel:"alternate",href:o.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}))}function S(e){var t=e.permalink,n=(0,m.Z)().siteConfig.url,o=function(){var e=(0,m.Z)().siteConfig.url,t=(0,c.TH)().pathname;return e+(0,g.Z)(t)}(),i=t?""+n+t:o;return r.createElement(h.Z,null,r.createElement("meta",{property:"og:url",content:i}),r.createElement("link",{rel:"canonical",href:i}))}function x(){var e=(0,m.Z)().i18n.currentLocale,t=(0,v.L)(),n=t.metadata,o=t.image;return r.createElement(r.Fragment,null,r.createElement(h.Z,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:w.h})),o&&r.createElement(b.d,{image:o}),r.createElement(S,null),r.createElement(E,null),r.createElement(k.Z,{tag:_.HX,locale:e}),r.createElement(h.Z,null,n.map((function(e,t){return r.createElement("meta",(0,p.Z)({key:t},e))}))))}var C=new Map;function T(e){if(C.has(e.pathname))return Object.assign({},e,{pathname:C.get(e.pathname)});if((0,d.f)(l.Z,e.pathname).some((function(e){return!0===e.route.exact})))return C.set(e.pathname,e.pathname),e;var t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return C.set(e.pathname,t),Object.assign({},e,{pathname:t})}var L=n(6160),A=n(9484),D=n(5318);function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = '+e+" "+("/"===e?" (default value)":"")+'

\n

We suggest trying baseUrl =

\n
\n'}(e)).replace(/0)&&(j.current.unobserve(e),j.current.disconnect(),null!=O&&window.docusaurus.prefetch(O))}))})),j.current.observe(e))},to:O},m&&{isActive:y,activeClassName:b}))}var m=i.forwardRef(h)},158:function(e,t,n){"use strict";n.d(t,{Z:function(){return u},I:function(){return s}});var r=n(1987);function o(e,t){var n=e.split(/(\{\w+\})/).map((function(e,n){if(n%2==1){var r=null==t?void 0:t[e.slice(1,-1)];if(void 0!==r)return r}return e}));return n.some((function(e){return(0,r.isValidElement)(e)}))?n.map((function(e,t){return(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e})).filter((function(e){return""!==e})):n.join("")}var i=n(7529);function a(e){var t,n,r=e.id,o=e.message;if(void 0===r&&void 0===o)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return null!=(t=null!=(n=i[null!=r?r:o])?n:o)?t:r}function s(e,t){return o(a({message:e.message,id:e.id}),t)}function u(e){var t=e.children,n=e.id,i=e.values;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");var s=a({message:t,id:n});return r.createElement(r.Fragment,null,o(s,i))}},5800:function(e,t,n){"use strict";n.d(t,{m:function(){return r}});var r="default"},6183:function(e,t,n){"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,{Z:function(){return o},b:function(){return r}})},1244:function(e,t,n){"use strict";n.d(t,{C:function(){return i},Z:function(){return a}});var r=n(1109),o=n(6183);function i(){var e=(0,r.Z)().siteConfig,t=e.baseUrl,n=e.url;return{withBaseUrl:function(e,r){return function(e,t,n,r){var i=void 0===r?{}:r,a=i.forcePrependBaseUrl,s=void 0!==a&&a,u=i.absolute,l=void 0!==u&&u;if(!n||n.startsWith("#")||(0,o.b)(n))return n;if(s)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;var c=n.startsWith(t)?n:t+n.replace(/^\//,"");return l?e+c:c}(n,t,e,r)}}}function a(e,t){return void 0===t&&(t={}),(0,i().withBaseUrl)(e,t)}},1109:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1987),o=n(9484);function i(){return(0,r.useContext)(o._)}},6099:function(e,t,n){"use strict";n.d(t,{OD:function(){return i},eZ:function(){return a}});var r=n(1109),o=n(5800);function i(e,t){void 0===t&&(t={});var n=(0,r.Z)().globalData[e];if(!n&&t.failfast)throw new Error('Docusaurus plugin global data not found for "'+e+'" plugin.');return n}function a(e,t,n){void 0===t&&(t=o.m),void 0===n&&(n={});var r=i(e),a=null==r?void 0:r[t];if(!a&&n.failfast)throw new Error('Docusaurus plugin global data not found for "'+e+'" plugin with id "'+t+'".');return a}},1316:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1987),o=n(6160);function i(){return(0,r.useContext)(o._)}},6925:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){var t={};return function e(n,r){Object.entries(n).forEach((function(n){var o,i=n[0],a=n[1],s=r?r+"."+i:i;"object"==typeof(o=a)&&o&&Object.keys(o).length>0?e(a,s):t[s]=a}))}(e),t}},5673:function(e,t,n){"use strict";n.d(t,{_:function(){return o},z:function(){return i}});var r=n(1987),o=r.createContext(null);function i(e){var t=e.children,n=e.value,i=r.useContext(o),a=(0,r.useMemo)((function(){return function(e){var t=e.parent,n=e.value;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}var r=Object.assign({},t.data,null==n?void 0:n.data);return{plugin:t.plugin,data:r}}({parent:i,value:n})}),[i,n]);return r.createElement(o.Provider,{value:a},t)}},4606:function(e,t,n){"use strict";n.d(t,{Iw:function(){return d},gA:function(){return l},Jo:function(){return f},gB:function(){return c}});var r=n(4593),o=n(6099);var i=function(e){return e.versions.find((function(e){return e.isLast}))};function a(e,t){var n,o,a=function(e,t){var n=i(e);return[].concat(e.versions.filter((function(e){return e!==n})),[n]).find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})}))}(e,t),s=null==a?void 0:a.docs.find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})}));return{activeVersion:a,activeDoc:s,alternateDocVersions:s?(n=s.id,o={},e.versions.forEach((function(e){e.docs.forEach((function(t){t.id===n&&(o[e.name]=t)}))})),o):{}}}var s={},u=function(e){return(0,o.eZ)("docusaurus-plugin-content-docs",e,{failfast:!0})};function l(e){var t;return void 0===e&&(e={}),function(e,t,n){void 0===n&&(n={});var o=Object.entries(e).sort((function(e,t){return t[1].path.localeCompare(e[1].path)})).find((function(e){var n=e[1];return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),i=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!i&&n.failfast)throw new Error("Can't find active docs plugin for \""+t+'" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: '+Object.values(e).map((function(e){return e.path})).join(", "));return i}(null!=(t=(0,o.OD)("docusaurus-plugin-content-docs"))?t:s,(0,r.TH)().pathname,e)}function c(e){return u(e).versions}function d(e){return a(u(e),(0,r.TH)().pathname)}function f(e){return function(e,t){var n=i(e);return{latestDocSuggestion:a(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(u(e),(0,r.TH)().pathname)}},1236:function(e,t,n){"use strict";n.d(t,{Iw:function(){return f},gA:function(){return c},_r:function(){return u},zh:function(){return l},yW:function(){return d}});var r=n(4593),o=n(6099);var i=function(e){return e.versions.find((function(e){return e.isLast}))};function a(e,t){var n,o,a=function(e,t){var n=i(e);return[].concat(e.versions.filter((function(e){return e!==n})),[n]).find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})}))}(e,t),s=null==a?void 0:a.docs.find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})}));return{activeVersion:a,activeDoc:s,alternateDocVersions:s?(n=s.id,o={},e.versions.forEach((function(e){e.docs.forEach((function(t){t.id===n&&(o[e.name]=t)}))})),o):{}}}var s={},u=function(){var e;return null!=(e=(0,o.OD)("docusaurus-plugin-content-docs"))?e:s},l=function(e){return(0,o.eZ)("docusaurus-plugin-content-docs",e,{failfast:!0})};function c(e){return void 0===e&&(e={}),function(e,t,n){void 0===n&&(n={});var o=Object.entries(e).sort((function(e,t){return t[1].path.localeCompare(e[1].path)})).find((function(e){var n=e[1];return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),i=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!i&&n.failfast)throw new Error("Can't find active docs plugin for \""+t+'" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: '+Object.values(e).map((function(e){return e.path})).join(", "));return i}(u(),(0,r.TH)().pathname,e)}function d(e){var t=l(e);return i(t)}function f(e){return a(l(e),(0,r.TH)().pathname)}},1687:function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){return a=Object.assign||function(e){for(var t=1;t'):s&&c.push('');var d=c.map((function(e){return''+e+""})),f=''+(u?'':l?'':'')+"",p=[''+(0,Ze.o)(t.t,(0,Ue.m)(o,"t"),i)+""];if(!a&&!s&&Ae.H6){var h,m=r?(null!=(h=r.b)?h:[]).concat(r.t).concat(t.s&&t.s!==r.t?t.s:[]):t.b;p.push(''+(0,ze.e)(null!=m?m:[])+"")}else u||p.push(''+(0,qe.C)(r.t||(t.u.startsWith("/docs/api-reference/")?"API Reference":""),i)+"");return[].concat(d,[f,''],p,["",'']).join("")}function vt(){return''+(0,l.I)({id:"theme.SearchBar.noResultsText",message:"No results"})+""}var bt=n(9718);function yt(){return wt.apply(this,arguments)}function wt(){return(wt=(0,Ne.Z)((0,De.Z)().mark((function e(){var t,r;return(0,De.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([n.e(2149),n.e(189)]).then(n.t.bind(n,2149,23));case 2:return t=e.sent,(r=t.default).noConflict?r.noConflict():t.noConflict&&t.noConflict(),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _t="_highlight";var kt=function(e){var t,n,i,a=e.handleSearchBarToggle,s=(0,ge.Z)().siteConfig.baseUrl,c=Me(),d=s;try{var f,p=(0,Oe.J)(null!=(f=null==c?void 0:c.pluginId)?f:Ae.gQ).preferredVersion;p&&!p.isLast&&(d=p.path+"/")}catch(H){if(Ae.l9&&!(H instanceof F.i6))throw H}var h=(0,u.k6)(),m=(0,u.TH)(),g=(0,r.useRef)(null),v=(0,r.useRef)(new Map),b=(0,r.useRef)(!1),y=(0,r.useState)(!1),w=y[0],_=y[1],k=(0,r.useState)(!1),E=k[0],S=k[1],x=(0,r.useState)(""),C=x[0],T=x[1],L=(0,r.useRef)(null),A=(0,r.useRef)(""),D=(0,r.useState)(""),R=D[0],N=D[1];(0,r.useEffect)((function(){if(Array.isArray(Ae.Kc)){var e="";if(m.pathname.startsWith(d)){var t=m.pathname.substring(d.length),n=Ae.Kc.find((function(e){return t===e||t.startsWith(e+"/")}));n&&(e=n)}A.current!==e&&(v.current.delete(e),A.current=e),N(e)}}),[m.pathname,d]);var P=!!Ae.hG&&Array.isArray(Ae.Kc)&&""===R,O=(0,r.useCallback)((0,Ne.Z)((0,De.Z)().mark((function e(){var t,n,r,i,a,u,c,f,p,m;return(0,De.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!P&&!v.current.get(R)){e.next=2;break}return e.abrupt("return");case 2:return v.current.set(R,"loading"),null==(t=L.current)||t.autocomplete.destroy(),_(!0),e.next=7,Promise.all([(0,je.w)(d,R),yt()]);case 7:r=e.sent,i=r[0],a=i.wrappedIndexes,u=i.zhDictionary,c=r[1],f=function(e){var t,n=e.query,r=e.isEmpty,o=document.createElement("a"),i=new URLSearchParams,a=(0,l.I)({id:"theme.SearchBar.seeAll",message:"See all results"}),u=(0,l.I)({id:"theme.SearchBar.seeAllOutsideContext",message:"See results outside {context}"},{context:R}),c=(0,l.I)({id:"theme.SearchBar.searchInContext",message:"See all results in {context}"},{context:R});if(i.set("q",n),t=R&&r?u:R?c:a,Array.isArray(Ae.Kc)&&!r&&i.set("ctx",R),d!==s){if(!d.startsWith(s))throw new Error("Version url '"+d+"' does not start with base url '"+s+"', this is a bug of `@easyops-cn/docusaurus-search-local`, please report it.");i.set("version",d.substring(s.length))}var f=s+"search?"+i.toString();return o.href=f,o.textContent=t,o.addEventListener("click",(function(e){var t;e.ctrlKey||e.metaKey||(e.preventDefault(),null==(t=L.current)||t.autocomplete.close(),h.push(f))})),o},L.current=c(g.current,{hint:!1,autoselect:!0,openOnFocus:!0,cssClasses:{root:(0,o.Z)($e,(n={},n[Ge]="left"===Ae.pu,n)),noPrefix:!0,dropdownMenu:He,input:dt,hint:ft,suggestions:pt,suggestion:Qe,cursor:Ve,dataset:ht,empty:mt}},[{source:(0,Be.v)(a,u,Ae.qo),templates:{suggestion:gt,empty:vt,footer:function(e){var t=e.query,n=e.isEmpty;if(!n||R){var r=f({query:t,isEmpty:n}),o=document.createElement("div");return o.className=Je,o.appendChild(r),o}}}}]).on("autocomplete:selected",(function(e,t){var n,r=t.document,o=r.u,i=r.h,a=t.tokens;null==(n=g.current)||n.blur();var s=o;if(Ae.vc&&a.length>0){for(var u,l=new URLSearchParams,c=(0,Re.Z)(a);!(u=c()).done;){var d=u.value;l.append(_t,d)}s+="?"+l.toString()}i&&(s+=i),h.push(s)})).on("autocomplete:closed",(function(){var e;null==(e=g.current)||e.blur()})),v.current.set(R,"done"),_(!1),b.current&&((p=g.current).value&&(null==(m=L.current)||m.autocomplete.open()),p.focus());case 17:case"end":return e.stop()}}),e)}))),[P,R,d,s,h]);(0,r.useEffect)((function(){if(Ae.vc){var e=Pe.Z.canUseDOM?new URLSearchParams(m.search).getAll(_t):[];setTimeout((function(){var t,n=document.querySelector("article");if(n){var r=new Ae.vc(n);r.unmark(),0!==e.length&&r.mark(e),T(e.join(" ")),null==(t=L.current)||t.autocomplete.setVal(e.join(" "))}}))}}),[m.search,m.pathname]);var I=(0,r.useState)(!1),M=I[0],j=I[1],B=(0,r.useCallback)((function(){b.current=!0,O(),j(!0),null==a||a(!0)}),[a,O]),z=(0,r.useCallback)((function(){j(!1),null==a||a(!1)}),[a]),U=(0,r.useCallback)((function(){O()}),[O]),q=(0,r.useCallback)((function(e){T(e.target.value),e.target.value&&S(!0)}),[]),Z=!!Pe.Z.canUseDOM&&/mac/i.test(null!=(t=null==(n=navigator.userAgentData)?void 0:n.platform)?t:navigator.platform);(0,r.useEffect)((function(){if(Ae.AY){var e=function(e){var t;!(Z?e.metaKey:e.ctrlKey)||"k"!==e.key&&"K"!==e.key||(e.preventDefault(),null==(t=g.current)||t.focus(),B())};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}}),[Z,B]);var $=(0,r.useCallback)((function(){var e,t=new URLSearchParams(m.search);t.delete(_t);var n=t.toString(),r=m.pathname+(""!=n?"?"+n:"")+m.hash;r!=m.pathname+m.search+m.hash&&h.push(r),T(""),null==(e=L.current)||e.autocomplete.setVal("")}),[m.pathname,m.search,m.hash,h]);return r.createElement("div",{className:(0,o.Z)("navbar__search",ot,(i={},i[st]=w&&E,i[ct]=M,i)),hidden:P},r.createElement("input",{placeholder:(0,l.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),"aria-label":"Search",className:"navbar__search-input",onMouseEnter:U,onFocus:B,onBlur:z,onChange:q,ref:g,value:C}),r.createElement(bt.Z,{className:it}),Ae.AY&&Ae.t_&&(""!==C?r.createElement("button",{className:at,onClick:$},"\u2715"):Pe.Z.canUseDOM&&r.createElement("div",{className:ut},r.createElement("kbd",{className:lt},Z?"\u2318":"ctrl"),r.createElement("kbd",{className:lt},"K"))))},Et="searchBox_YB5Q";function St(e){var t=e.children,n=e.className;return r.createElement("div",{className:(0,o.Z)(n,Et)},t)}var xt=n(4606),Ct=n(2532),Tt=["docId","label","docsPluginId"];var Lt=["sidebarId","label","docsPluginId"];var At=["label","to","docsPluginId"];var Dt=["mobile","docsPluginId","dropdownActiveClassDisabled","dropdownItemsBefore","dropdownItemsAfter"],Rt=function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))};var Nt={default:pe,localeDropdown:function(e){var t=e.mobile,n=e.dropdownItemsBefore,o=e.dropdownItemsAfter,i=(0,k.Z)(e,Le),a=(0,ge.Z)().i18n,c=a.currentLocale,d=a.locales,f=a.localeConfigs,p=(0,Se.l)(),h=(0,u.TH)(),m=h.search,g=h.hash,v=d.map((function(e){var n=""+("pathname://"+p.createUrl({locale:e,fullyQualified:!1}))+m+g;return{label:f[e].label,lang:f[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===c?t?"menu__link--active":"dropdown__link--active":""}})),b=[].concat(n,v,o),y=t?(0,l.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):f[c].label;return r.createElement(Ee,(0,s.Z)({},i,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(Ce,{className:Te}),y),items:b}))},search:function(e){var t=e.mobile,n=e.className;return t?null:r.createElement(St,{className:n},r.createElement(kt,null))},dropdown:Ee,html:function(e){var t=e.value,n=e.className,i=e.mobile,a=void 0!==i&&i,s=e.isDropdownItem,u=void 0!==s&&s,l=u?"li":"div";return r.createElement(l,{className:(0,o.Z)({navbar__item:!a&&!u,"menu__list-item":a},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){var t=e.docId,n=e.label,o=e.docsPluginId,i=(0,k.Z)(e,Tt),a=(0,xt.Iw)(o).activeDoc,u=(0,Ct.vY)(t,o);return null===u?null:r.createElement(pe,(0,s.Z)({exact:!0},i,{isActive:function(){return(null==a?void 0:a.path)===u.path||!(null==a||!a.sidebar)&&a.sidebar===u.sidebar},label:null!=n?n:u.id,to:u.path}))},docSidebar:function(e){var t=e.sidebarId,n=e.label,o=e.docsPluginId,i=(0,k.Z)(e,Lt),a=(0,xt.Iw)(o).activeDoc,u=(0,Ct.oz)(t,o).link;if(!u)throw new Error('DocSidebarNavbarItem: Sidebar with ID "'+t+"\" doesn't have anything to be linked to.");return r.createElement(pe,(0,s.Z)({exact:!0},i,{isActive:function(){return(null==a?void 0:a.sidebar)===t},label:null!=n?n:u.label,to:u.path}))},docsVersion:function(e){var t=e.label,n=e.to,o=e.docsPluginId,i=(0,k.Z)(e,At),a=(0,Ct.lO)(o)[0],u=null!=t?t:a.label,l=null!=n?n:function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))}(a).path;return r.createElement(pe,(0,s.Z)({},i,{label:u,to:l}))},docsVersionDropdown:function(e){var t=e.mobile,n=e.docsPluginId,o=e.dropdownActiveClassDisabled,i=e.dropdownItemsBefore,a=e.dropdownItemsAfter,c=(0,k.Z)(e,Dt),d=(0,u.TH)(),f=d.search,p=d.hash,h=(0,xt.Iw)(n),m=(0,xt.gB)(n),g=(0,Oe.J)(n).savePreferredVersionName,v=m.map((function(e){var t,n=null!=(t=h.alternateDocVersions[e.name])?t:Rt(e);return{label:e.label,to:""+n.path+f+p,isActive:function(){return e===h.activeVersion},onClick:function(){return g(e.name)}}})),b=[].concat(i,v,a),y=(0,Ct.lO)(n)[0],w=t&&b.length>1?(0,l.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):y.label,_=t&&b.length>1?void 0:Rt(y).path;return b.length<=1?r.createElement(pe,(0,s.Z)({},c,{mobile:t,label:w,to:_,isActive:o?function(){return!1}:void 0})):r.createElement(Ee,(0,s.Z)({},c,{mobile:t,label:w,to:_,items:b,isActive:o?function(){return!1}:void 0}))}},Pt=["type"];function Ot(e){var t=e.type,n=(0,k.Z)(e,Pt),o=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),i=Nt[o];if(!i)throw new Error('No NavbarItem component found for type "'+t+'".');return r.createElement(i,n)}function It(){var e=(0,O.e)(),t=(0,w.L)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map((function(t,n){return r.createElement(Ot,(0,s.Z)({mobile:!0},t,{onClick:function(){return e.toggle()},key:n}))})))}function Ft(e){return r.createElement("button",(0,s.Z)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(l.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function Mt(){var e=0===(0,w.L)().navbar.items.length,t=U();return r.createElement(r.Fragment,null,!e&&r.createElement(Ft,{onClick:function(){return t.hide()}}),t.content)}function jt(){var e,t=(0,O.e)();return void 0===(e=t.shown)&&(e=!0),(0,r.useEffect)((function(){return document.body.style.overflow=e?"hidden":"visible",function(){document.body.style.overflow="visible"}}),[e]),t.shouldRender?r.createElement(q,{header:r.createElement(ee,null),primaryMenu:r.createElement(It,null),secondaryMenu:r.createElement(Mt,null)}):null}var Bt="navbarHideable_ZrnO",zt="navbarHidden_mY0E";function Ut(e){return r.createElement("div",(0,s.Z)({role:"presentation"},e,{className:(0,o.Z)("navbar-sidebar__backdrop",e.className)}))}function qt(e){var t=e.children,n=(0,w.L)().navbar,i=n.hideOnScroll,a=n.style,s=(0,O.e)(),u=function(e){var t=(0,r.useState)(e),n=t[0],o=t[1],i=(0,r.useRef)(!1),a=(0,r.useRef)(0),s=(0,r.useCallback)((function(e){null!==e&&(a.current=e.getBoundingClientRect().height)}),[]);return(0,I.RF)((function(t,n){var r=t.scrollY;if(e)if(r=s?o(!1):r+l0&&r.createElement(an,{links:n}),logo:o&&r.createElement(cn,{logo:o}),copyright:t&&r.createElement(dn,{copyright:t})})}var hn=r.memo(pn),mn=n(9279),gn="docusaurus.tab.",vn=r.createContext(void 0);var bn=(0,F.Qc)([Z.S,_.pl,function(e){var t=e.children,n=function(){var e=(0,r.useState)({}),t=e[0],n=e[1],o=(0,r.useCallback)((function(e,t){(0,mn.W)(""+gn+e).set(t)}),[]);(0,r.useEffect)((function(){try{var e={};(0,mn._)().forEach((function(t){if(t.startsWith(gn)){var n=t.substring(gn.length);e[n]=(0,mn.W)(t).get()}})),n(e)}catch(t){console.error(t)}}),[]);var i=(0,r.useCallback)((function(e,t){n((function(n){var r;return Object.assign({},n,((r={})[e]=t,r))})),o(e,t)}),[o]);return(0,r.useMemo)((function(){return{tabGroupChoices:t,setTabGroupChoices:i}}),[t,i])}();return r.createElement(vn.Provider,{value:n},t)},I.OC,Oe.L5,a.VC,function(e){var t=e.children;return r.createElement(M.n2,null,r.createElement(O.M,null,r.createElement(B,null,t)))}]);function yn(e){var t=e.children;return r.createElement(bn,null,t)}function wn(e){var t=e.error,n=e.tryAgain;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(l.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("p",null,t.message),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},r.createElement(l.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again when the page crashed"},"Try again"))))))}var _n="mainWrapper_bzSE";function kn(e){var t=e.children,n=e.noFooter,s=e.wrapperClassName,u=e.title,l=e.description;return(0,v.t)(),r.createElement(yn,null,r.createElement(a.d,{title:u,description:l}),r.createElement(y,null),r.createElement(P,null),r.createElement(Kt,null),r.createElement("div",{id:d,className:(0,o.Z)(g.k.wrapper.main,_n,s)},r.createElement(i.Z,{fallback:function(e){return r.createElement(wn,e)}},t)),!n&&r.createElement(hn,null))}},3696:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(9375),o=n(8933),i=n(1987),a=n(2590),s=n(1244),u=n(1109),l=n(2564),c=n(3677),d=["imageClassName","titleClassName"];function f(e){var t=e.logo,n=e.alt,r=e.imageClassName,o={light:(0,s.Z)(t.src),dark:(0,s.Z)(t.srcDark||t.src)},a=i.createElement(c.Z,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?i.createElement("div",{className:r},a):a}function p(e){var t,n=(0,u.Z)().siteConfig.title,c=(0,l.L)().navbar,p=c.title,h=c.logo,m=e.imageClassName,g=e.titleClassName,v=(0,o.Z)(e,d),b=(0,s.Z)((null==h?void 0:h.href)||"/"),y=p?"":n,w=null!=(t=null==h?void 0:h.alt)?t:y;return i.createElement(a.Z,(0,r.Z)({to:b},v,(null==h?void 0:h.target)&&{target:h.target}),h&&i.createElement(f,{logo:h,alt:w,imageClassName:m}),null!=p&&i.createElement("b",{className:g},p))}},4674:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1987),o=n(1367);function i(e){var t=e.locale,n=e.version,i=e.tag,a=t;return r.createElement(o.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),i&&r.createElement("meta",{name:"docusaurus_tag",content:i}),a&&r.createElement("meta",{name:"docsearch:language",content:a}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),i&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:i}))}},3677:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(9375),o=n(8933),i=n(1987),a=n(1892),s=n(1316),u=n(59),l={themedImage:"themedImage_GQa0","themedImage--light":"themedImage--light_Yrkz","themedImage--dark":"themedImage--dark_nmEM"},c=["sources","className","alt"];function d(e){var t=(0,s.Z)(),n=(0,u.I)().colorMode,d=e.sources,f=e.className,p=e.alt,h=(0,o.Z)(e,c),m=t?"dark"===n?["dark"]:["light"]:["light","dark"];return i.createElement(i.Fragment,null,m.map((function(e){return i.createElement("img",(0,r.Z)({key:e,src:d[e],alt:p,className:(0,a.Z)(l.themedImage,l["themedImage--"+e],f)},h))})))}},4365:function(e,t,n){"use strict";n.d(t,{u:function(){return l},z:function(){return v}});var r=n(9375),o=n(8933),i=n(1987),a=n(6153),s=["collapsed"],u=["lazy"];function l(e){var t=e.initialState,n=(0,i.useState)(null!=t&&t),r=n[0],o=n[1],a=(0,i.useCallback)((function(){o((function(e){return!e}))}),[]);return{collapsed:r,setCollapsed:o,toggleCollapsed:a}}var c={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function f(e,t){var n=t?c:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function p(e){var t=e.collapsibleRef,n=e.collapsed,r=e.animation,o=(0,i.useRef)(!1);(0,i.useEffect)((function(){var e,i=t.current;function a(){var e,t,n=i.scrollHeight,o=null!=(e=null==r?void 0:r.duration)?e:function(e){var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}(n);return{transition:"height "+o+"ms "+(null!=(t=null==r?void 0:r.easing)?t:"ease-in-out"),height:n+"px"}}function s(){var e=a();i.style.transition=e.transition,i.style.height=e.height}if(!o.current)return f(i,n),void(o.current=!0);return i.style.willChange="height",e=requestAnimationFrame((function(){n?(s(),requestAnimationFrame((function(){i.style.height=c.height,i.style.overflow=c.overflow}))):(i.style.display="block",requestAnimationFrame((function(){s()})))})),function(){return cancelAnimationFrame(e)}}),[t,n,r])}function h(e){if(!a.Z.canUseDOM)return e?c:d}function m(e){var t=e.as,n=void 0===t?"div":t,r=e.collapsed,o=e.children,a=e.animation,s=e.onCollapseTransitionEnd,u=e.className,l=e.disableSSRStyle,c=(0,i.useRef)(null);return p({collapsibleRef:c,collapsed:r,animation:a}),i.createElement(n,{ref:c,style:l?void 0:h(r),onTransitionEnd:function(e){"height"===e.propertyName&&(f(c.current,r),null==s||s(r))},className:u},o)}function g(e){var t=e.collapsed,n=(0,o.Z)(e,s),a=(0,i.useState)(!t),u=a[0],l=a[1],c=(0,i.useState)(t),d=c[0],f=c[1];return(0,i.useLayoutEffect)((function(){t||l(!0)}),[t]),(0,i.useLayoutEffect)((function(){u&&f(t)}),[u,t]),u?i.createElement(m,(0,r.Z)({},n,{collapsed:d})):null}function v(e){var t=e.lazy,n=(0,o.Z)(e,u),r=t?g:m;return i.createElement(r,n)}},9716:function(e,t,n){"use strict";n.d(t,{nT:function(){return h},pl:function(){return p}});var r=n(1987),o=n(1316),i=n(9279),a=n(2382),s=n(2564),u=(0,i.W)("docusaurus.announcement.dismiss"),l=(0,i.W)("docusaurus.announcement.id"),c=function(){return"true"===u.get()},d=function(e){return u.set(String(e))},f=r.createContext(null);function p(e){var t=e.children,n=function(){var e=(0,s.L)().announcementBar,t=(0,o.Z)(),n=(0,r.useState)((function(){return!!t&&c()})),i=n[0],a=n[1];(0,r.useEffect)((function(){a(c())}),[]);var u=(0,r.useCallback)((function(){d(!0),a(!0)}),[]);return(0,r.useEffect)((function(){if(e){var t=e.id,n=l.get();"annoucement-bar"===n&&(n="announcement-bar");var r=t!==n;l.set(t),r&&d(!1),!r&&c()||a(!1)}}),[e]),(0,r.useMemo)((function(){return{isActive:!!e&&!i,close:u}}),[e,i,u])}();return r.createElement(f.Provider,{value:n},t)}function h(){var e=(0,r.useContext)(f);if(!e)throw new a.i6("AnnouncementBarProvider");return e}},59:function(e,t,n){"use strict";n.d(t,{I:function(){return g},S:function(){return m}});var r=n(1987),o=n(6153),i=n(2382),a=n(9279),s=n(2564),u=r.createContext(void 0),l="theme",c=(0,a.W)(l),d="light",f="dark",p=function(e){return e===f?f:d};function h(){var e=(0,s.L)().colorMode,t=e.defaultMode,n=e.disableSwitch,i=e.respectPrefersColorScheme,a=(0,r.useState)(function(e){return o.Z.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e)}(t)),u=a[0],h=a[1];(0,r.useEffect)((function(){n&&c.del()}),[n]);var m=(0,r.useCallback)((function(e,n){void 0===n&&(n={});var r=n.persist,o=void 0===r||r;e?(h(e),o&&function(e){c.set(p(e))}(e)):(h(i?window.matchMedia("(prefers-color-scheme: dark)").matches?f:d:t),c.del())}),[i,t]);(0,r.useEffect)((function(){document.documentElement.setAttribute("data-theme",p(u))}),[u]),(0,r.useEffect)((function(){if(!n){var e=function(e){if(e.key===l){var t=c.get();null!==t&&m(p(t))}};return window.addEventListener("storage",e),function(){return window.removeEventListener("storage",e)}}}),[n,m]);var g=(0,r.useRef)(!1);return(0,r.useEffect)((function(){if(!n||i){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=function(){window.matchMedia("print").matches||g.current?g.current=window.matchMedia("print").matches:m(null)};return e.addListener(t),function(){return e.removeListener(t)}}}),[m,n,i]),(0,r.useMemo)((function(){return{colorMode:u,setColorMode:m,get isDarkTheme(){return u===f},setLightTheme:function(){m(d)},setDarkTheme:function(){m(f)}}}),[u,m])}function m(e){var t=e.children,n=h();return r.createElement(u.Provider,{value:n},t)}function g(){var e=(0,r.useContext)(u);if(null==e)throw new i.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},2832:function(e,t,n){"use strict";n.d(t,{J:function(){return y},L5:function(){return v}});var r=n(1987),o=n(1236),i=n(5800),a=n(2564),s=n(2532),u=n(2382),l=n(9279),c=function(e){return"docs-preferred-version-"+e},d=function(e,t,n){(0,l.W)(c(e),{persistence:t}).set(n)},f=function(e,t){return(0,l.W)(c(e),{persistence:t}).get()},p=function(e,t){(0,l.W)(c(e),{persistence:t}).del()};var h=r.createContext(null);function m(){var e=(0,o._r)(),t=(0,a.L)().docs.versionPersistence,n=(0,r.useMemo)((function(){return Object.keys(e)}),[e]),i=(0,r.useState)((function(){return function(e){return Object.fromEntries(e.map((function(e){return[e,{preferredVersionName:null}]})))}(n)})),s=i[0],u=i[1];return(0,r.useEffect)((function(){u(function(e){var t=e.pluginIds,n=e.versionPersistence,r=e.allDocsData;return Object.fromEntries(t.map((function(e){return[e,(t=e,o=f(t,n),r[t].versions.some((function(e){return e.name===o}))?{preferredVersionName:o}:(p(t,n),{preferredVersionName:null}))];var t,o})))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]),[s,(0,r.useMemo)((function(){return{savePreferredVersion:function(e,n){d(e,t,n),u((function(t){var r;return Object.assign({},t,((r={})[e]={preferredVersionName:n},r))}))}}}),[t])]}function g(e){var t=e.children,n=m();return r.createElement(h.Provider,{value:n},t)}function v(e){var t=e.children;return s.cE?r.createElement(g,null,t):r.createElement(r.Fragment,null,t)}function b(){var e=(0,r.useContext)(h);if(!e)throw new u.i6("DocsPreferredVersionContextProvider");return e}function y(e){var t;void 0===e&&(e=i.m);var n=(0,o.zh)(e),a=b(),s=a[0],u=a[1],l=s[e].preferredVersionName;return{preferredVersion:null!=(t=n.versions.find((function(e){return e.name===l})))?t:null,savePreferredVersionName:(0,r.useCallback)((function(t){u.savePreferredVersion(e,t)}),[u,e])}}},7890:function(e,t,n){"use strict";n.d(t,{V:function(){return u},b:function(){return s}});var r=n(1987),o=n(2382),i=Symbol("EmptyContext"),a=r.createContext(i);function s(e){var t=e.children,n=e.name,o=e.items,i=(0,r.useMemo)((function(){return n&&o?{name:n,items:o}:null}),[n,o]);return r.createElement(a.Provider,{value:i},t)}function u(){var e=(0,r.useContext)(a);if(e===i)throw new o.i6("DocsSidebarProvider");return e}},4773:function(e,t,n){"use strict";n.d(t,{M:function(){return f},e:function(){return p}});var r=n(1987),o=n(3799),i=n(1214),a=n(4593),s=n(2382);function u(e){!function(e){var t=(0,a.k6)(),n=(0,s.zX)(e);(0,r.useEffect)((function(){return t.block((function(e,t){return n(e,t)}))}),[t,n])}((function(t,n){if("POP"===n)return e(t,n)}))}var l=n(2564),c=r.createContext(void 0);function d(){var e,t=(e=(0,o.HY)(),0===(0,l.L)().navbar.items.length&&!e.component),n=(0,i.i)(),a=!t&&"mobile"===n,s=(0,r.useState)(!1),c=s[0],d=s[1];u((function(){if(c)return d(!1),!1}));var f=(0,r.useCallback)((function(){d((function(e){return!e}))}),[]);return(0,r.useEffect)((function(){"desktop"===n&&d(!1)}),[n]),(0,r.useMemo)((function(){return{disabled:t,shouldRender:a,toggle:f,shown:c}}),[t,a,f,c])}function f(e){var t=e.children,n=d();return r.createElement(c.Provider,{value:n},t)}function p(){var e=r.useContext(c);if(void 0===e)throw new s.i6("NavbarMobileSidebarProvider");return e}},3799:function(e,t,n){"use strict";n.d(t,{HY:function(){return s},Zo:function(){return u},n2:function(){return a}});var r=n(1987),o=n(2382),i=r.createContext(null);function a(e){var t=e.children,n=(0,r.useState)({component:null,props:null});return r.createElement(i.Provider,{value:n},t)}function s(){var e=(0,r.useContext)(i);if(!e)throw new o.i6("NavbarSecondaryMenuContentProvider");return e[0]}function u(e){var t=e.component,n=e.props,a=(0,r.useContext)(i);if(!a)throw new o.i6("NavbarSecondaryMenuContentProvider");var s=a[1],u=(0,o.Ql)(n);return(0,r.useEffect)((function(){s({component:t,props:u})}),[s,t,u]),(0,r.useEffect)((function(){return function(){return s({component:null,props:null})}}),[s]),null}},4135:function(e,t,n){"use strict";n.d(t,{h:function(){return o},t:function(){return i}});var r=n(1987),o="navigation-with-keyboard";function i(){(0,r.useEffect)((function(){function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(o),"mousedown"===e.type&&document.body.classList.remove(o)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),function(){document.body.classList.remove(o),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},1214:function(e,t,n){"use strict";n.d(t,{i:function(){return l}});var r=n(1987),o=n(6153),i="desktop",a="mobile",s="ssr";function u(){return o.Z.canUseDOM?window.innerWidth>996?i:a:s}function l(){var e=(0,r.useState)((function(){return u()})),t=e[0],n=e[1];return(0,r.useEffect)((function(){function e(){n(u())}return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),clearTimeout(undefined)}}),[]),t}},4358:function(e,t,n){"use strict";n.d(t,{k:function(){return r}});var r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",admonitionType:function(e){return"theme-admonition-"+e}},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:function(e){return"theme-doc-sidebar-item-category-level-"+e},docSidebarItemLinkLevel:function(e){return"theme-doc-sidebar-item-link-level-"+e}},blog:{}}},2532:function(e,t,n){"use strict";n.d(t,{Wl:function(){return p},_F:function(){return m},cE:function(){return f},hI:function(){return _},lO:function(){return b},vY:function(){return w},oz:function(){return y},s1:function(){return v}});var r=n(2551),o=n(1987),i=n(4593),a=n(1158),s=n(1236),u=n(2832),l=n(7890);function c(e){return Array.from(new Set(e))}var d=n(2413),f=!!s._r;function p(e){if(e.href)return e.href;for(var t,n=(0,r.Z)(e.items);!(t=n()).done;){var o=t.value;if("link"===o.type)return o.href;if("category"===o.type){var i=p(o);if(i)return i}}}var h=function(e,t){return void 0!==e&&(0,d.Mg)(e,t)};function m(e,t){return"link"===e.type?h(e.href,t):"category"===e.type&&(h(e.href,t)||function(e,t){return e.some((function(e){return m(e,t)}))}(e.items,t))}function g(e){var t=e.sidebarItems,n=e.pathname,o=e.onlyCategories,i=void 0!==o&&o,a=[];return function e(t){for(var o,s=(0,r.Z)(t);!(o=s()).done;){var u=o.value;if("category"===u.type&&((0,d.Mg)(u.href,n)||e(u.items))||"link"===u.type&&(0,d.Mg)(u.href,n))return i&&"category"!==u.type||a.unshift(u),!0}return!1}(t),a}function v(){var e,t=(0,l.V)(),n=(0,i.TH)().pathname;return!1!==(null==(e=(0,s.gA)())?void 0:e.pluginData.breadcrumbs)&&t?g({sidebarItems:t.items,pathname:n}):null}function b(e){var t=(0,s.Iw)(e).activeVersion,n=(0,u.J)(e).preferredVersion,r=(0,s.yW)(e);return(0,o.useMemo)((function(){return c([t,n,r].filter(Boolean))}),[t,n,r])}function y(e,t){var n=b(t);return(0,o.useMemo)((function(){var t=n.flatMap((function(e){return e.sidebars?Object.entries(e.sidebars):[]})),r=t.find((function(t){return t[0]===e}));if(!r)throw new Error("Can't find any sidebar with id \""+e+'" in version'+(n.length>1?"s":"")+" "+n.map((function(e){return e.name})).join(", ")+'".\n Available sidebar ids are:\n - '+Object.keys(t).join("\n- "));return r[1]}),[e,n])}function w(e,t){var n=b(t);return(0,o.useMemo)((function(){var t=n.flatMap((function(e){return e.docs})),r=t.find((function(t){return t.id===e}));if(!r){if(n.flatMap((function(e){return e.draftIds})).includes(e))return null;throw new Error("DocNavbarItem: couldn't find any doc with id \""+e+'" in version'+(n.length>1?"s":"")+" "+n.map((function(e){return e.name})).join(", ")+'".\nAvailable doc ids are:\n- '+c(t.map((function(e){return e.id}))).join("\n- "))}return r}),[e,n])}function _(e){var t=e.route,n=e.versionMetadata,r=(0,i.TH)(),o=t.routes,s=o.find((function(e){return(0,i.LX)(r.pathname,e)}));if(!s)return null;var u=s.sidebar,l=u?n.docsSidebars[u]:void 0;return{docElement:(0,a.H)(o),sidebarName:u,sidebarItems:l}}},3930:function(e,t,n){"use strict";n.d(t,{FG:function(){return f},d:function(){return c},VC:function(){return p}});var r=n(1987),o=n(1892),i=n(1367),a=n(5673);function s(){var e=r.useContext(a._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var u=n(1244),l=n(1109);function c(e){var t=e.title,n=e.description,o=e.keywords,a=e.image,s=e.children,c=function(e){var t=(0,l.Z)().siteConfig,n=t.title,r=t.titleDelimiter;return null!=e&&e.trim().length?e.trim()+" "+r+" "+n:n}(t),d=(0,u.C)().withBaseUrl,f=a?d(a,{absolute:!0}):void 0;return r.createElement(i.Z,null,t&&r.createElement("title",null,c),t&&r.createElement("meta",{property:"og:title",content:c}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),o&&r.createElement("meta",{name:"keywords",content:Array.isArray(o)?o.join(","):o}),f&&r.createElement("meta",{property:"og:image",content:f}),f&&r.createElement("meta",{name:"twitter:image",content:f}),s)}var d=r.createContext(void 0);function f(e){var t=e.className,n=e.children,a=r.useContext(d),s=(0,o.Z)(a,t);return r.createElement(d.Provider,{value:s},r.createElement(i.Z,null,r.createElement("html",{className:s})),n)}function p(e){var t=e.children,n=s(),i="plugin-"+n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,""),a="plugin-id-"+n.plugin.id;return r.createElement(f,{className:(0,o.Z)(i,a)},t)}},2382:function(e,t,n){"use strict";n.d(t,{i6:function(){return h},Qc:function(){return g},zX:function(){return f},D9:function(){return p},Ql:function(){return m}});var r=n(1938),o=n(5318);function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}var a=n(4085);function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function u(e,t,n){return u=s()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&(0,a.Z)(o,n.prototype),o},u.apply(null,arguments)}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,i(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,a.Z)(r,e)},l(e)}var c=n(1987),d=n(6153).Z.canUseDOM?c.useLayoutEffect:c.useEffect;function f(e){var t=(0,c.useRef)(e);return d((function(){t.current=e}),[e]),(0,c.useCallback)((function(){return t.current.apply(t,arguments)}),[])}function p(e){var t=(0,c.useRef)();return d((function(){t.current=e})),t.current}var h=function(e){function t(t,n){var o,i,a,s,u;return(u=e.call(this)||this).name="ReactContextError",u.message="Hook "+(null!=(o=null==(i=u.stack)||null==(a=i.split("\n")[1])||null==(s=a.match((0,r.Z)(/at (?:\w+\.)?(\w+)/,{name:1})))?void 0:s.groups.name)?o:"")+" is called outside the <"+t+">. "+(null!=n?n:""),u}return(0,o.Z)(t,e),t}(l(Error));function m(e){var t=Object.entries(e);return t.sort((function(e,t){return e[0].localeCompare(t[0])})),(0,c.useMemo)((function(){return e}),t.flat())}function g(e){return function(t){var n=t.children;return c.createElement(c.Fragment,null,e.reduceRight((function(e,t){return c.createElement(t,null,e)}),n))}}},2413:function(e,t,n){"use strict";n.d(t,{Mg:function(){return a},Ns:function(){return s}});var r=n(1987),o=n(2811),i=n(1109);function a(e,t){var n=function(e){var t;return null==(t=!e||e.endsWith("/")?e:e+"/")?void 0:t.toLowerCase()};return n(e)===n(t)}function s(){var e=(0,i.Z)().siteConfig.baseUrl;return(0,r.useMemo)((function(){return function(e){var t=e.baseUrl;function n(e){return e.path===t&&!0===e.exact}function r(e){return e.path===t&&!e.exact}return function e(t){if(0!==t.length)return t.find(n)||e(t.filter(r).flatMap((function(e){var t;return null!=(t=e.routes)?t:[]})))}(e.routes)}({routes:o.Z,baseUrl:e})}),[e])}},9693:function(e,t,n){"use strict";n.d(t,{Ct:function(){return f},OC:function(){return u},RF:function(){return d}});var r=n(1987),o=n(6153),i=n(1316),a=n(2382);var s=r.createContext(void 0);function u(e){var t,n=e.children,o=(t=(0,r.useRef)(!0),(0,r.useMemo)((function(){return{scrollEventsEnabledRef:t,enableScrollEvents:function(){t.current=!0},disableScrollEvents:function(){t.current=!1}}}),[]));return r.createElement(s.Provider,{value:o},n)}function l(){var e=(0,r.useContext)(s);if(null==e)throw new a.i6("ScrollControllerProvider");return e}var c=function(){return o.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null};function d(e,t){void 0===t&&(t=[]);var n=l().scrollEventsEnabledRef,o=(0,r.useRef)(c()),i=(0,a.zX)(e);(0,r.useEffect)((function(){var e=function(){if(n.current){var e=c();i(e,o.current),o.current=e}},t={passive:!0};return e(),window.addEventListener("scroll",e,t),function(){return window.removeEventListener("scroll",e,t)}}),[i,n].concat(t))}function f(){var e=(0,r.useRef)(null),t=(0,i.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:function(n){e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),function(){}}(n):function(e){var t=null,n=document.documentElement.scrollTop>e;return function r(){var o=document.documentElement.scrollTop;(n&&o>e||!n&&oc.length?e(o.substr(c.length),d):n.push(d),u=!0}else for(var f=c.length-1;f>s;f-=1){var p=c.substr(0,f);if(o.substr(0,f)===p){s=f;var h={missed:i.missed,term:i.term.concat({value:p,trailing:!0})};o.length>f?e(o.substr(f),h):n.push(h),u=!0;break}}}u||(o.length>0?e(o.substr(1),{missed:i.missed+1,term:i.term}):i.term.length>0&&n.push(i))}(e,{missed:0,term:[]}),n.sort((function(e,t){var n=e.missed>0?1:0,r=t.missed>0?1:0;return n!==r?n-r:e.term.length-t.term.length})).map((function(e){return e.term}))}(a,t),l=(0,r.Z)(u);!(s=l()).done;){var c=s.value,d=i.concat.apply(i,c);e(o.slice(1),d)}else{var f=i.concat({value:a});e(o.slice(1),f)}}else n.push(i)}(e,[]),n}var s=n(1473);function u(e){return l(e).concat(l(e.filter((function(e){var t=e[e.length-1];return!t.trailing&&t.maybeTyping})),!0))}function l(e,t){return e.map((function(e){return{tokens:e.map((function(e){return e.value})),term:e.map((function(e){return{value:e.value,presence:i().Query.presence.REQUIRED,wildcard:(t?e.trailing||e.maybeTyping:e.trailing)?i().Query.wildcard.TRAILING:i().Query.wildcard.NONE}}))}}))}function c(e,t,n){return function(o,l){var c=function(e,t){if(1===t.length&&["ja","jp","th"].includes(t[0]))return i()[t[0]].tokenizer(e).map((function(e){return e.toString()}));var n=/[^-\s]+/g;return t.includes("zh")&&(n=/[0-9A-Z_a-z]+|(?:[\u3400-\u4DBF\u4E00-\u9FFF\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])+/g),e.toLowerCase().match(n)||[]}(o,s.dK);if(0!==c.length){var d=function(e,t){var n=a(e,t);if(0===n.length)return[{tokens:e,term:e.map((function(e){return{value:e,presence:i().Query.presence.REQUIRED,wildcard:i().Query.wildcard.LEADING|i().Query.wildcard.TRAILING}}))}];for(var o,l=(0,r.Z)(n);!(o=l()).done;){var c=o.value;c[c.length-1].maybeTyping=!0}for(var d,f,p=[],h=(0,r.Z)(s.dK);!(d=h()).done;){var m=d.value;if("en"===m)s._k||p.unshift(i().stopWordFilter);else{var g=i()[m];g.stopWordFilter&&p.unshift(g.stopWordFilter)}}if(p.length>0){var v=function(e){return p.reduce((function(e,t){return e.filter((function(e){return t(e.value)}))}),e)};f=[];for(var b,y=[],w=(0,r.Z)(n);!(b=w()).done;){var _=b.value,k=v(_);f.push(k),k.length<_.length&&k.length>0&&y.push(k)}n.push.apply(n,y)}else f=n.slice();for(var E,S=[],x=(0,r.Z)(f);!(E=x()).done;){var C=E.value;if(C.length>2)for(var T=C.length-1;T>=0;T-=1)S.push(C.slice(0,T).concat(C.slice(T+1)))}return u(n).concat(u(S))}(c,t),f=[],p=function(){for(var t,o=h.value,i=o.term,a=o.tokens,s=function(){var o=t.value,s=o.documents,u=o.index,l=o.type;if(f.push.apply(f,u.query((function(e){for(var t,n=(0,r.Z)(i);!(t=n()).done;){var o=t.value;e.term(o.value,{wildcard:o.wildcard,presence:o.presence})}})).slice(0,n).filter((function(e){return!f.some((function(t){return t.document.i.toString()===e.ref}))})).slice(0,n-f.length).map((function(t){var n=s.find((function(e){return e.i.toString()===t.ref}));return{document:n,type:l,page:0!==l&&e[0].documents.find((function(e){return e.i===n.p})),metadata:t.matchData.metadata,tokens:a,score:t.score}}))),f.length>=n)return{v:"break|search"}},u=(0,r.Z)(e);!(t=u()).done;){var l=s();if("object"==typeof l)return l.v}};e:for(var h,m=(0,r.Z)(d);!(h=m()).done;){if("break|search"===p())break e}!function(e){e.forEach((function(e,t){e.index=t})),e.sort((function(t,n){var r=t.type>0&&t.page?e.findIndex((function(e){return e.document===t.page})):t.index,o=n.type>0&&n.page?e.findIndex((function(e){return e.document===n.page})):n.index;return-1===r&&(r=t.index),-1===o&&(o=n.index),r===o?0===t.type?-1:0===n.type?1:t.index-n.index:r-o}))}(f),function(e){e.forEach((function(t,n){n>0&&t.page&&e.some((function(e){return e.document===t.page}))&&(n/g,">").replace(/"/g,""").replace(/'/g,"'")}n.d(t,{X:function(){return r}})},1958:function(e,t,n){"use strict";function r(e,t){for(var n=[],r=0,o=Object.values(e);r=0){c>0&&s.push(i(e.substr(0,c),t)),s.push(""+(0,o.X)(e.substr(c,l.length))+"");var d=c+l.length;d"+(0,o.X)(e)+"":(0,o.X)(e):s.join("")}},3950:function(e,t,n){"use strict";n.d(t,{o:function(){return l}});var r=n(2551),o=n(3073),i=n(3754),a=/[0-9A-Z_a-z]+|(?:[\u3400-\u4DBF\u4E00-\u9FFF\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/;function s(e){for(var t=[],n=0,r=e;r.length>0;){var o=r.match(a);if(!o){t.push(r);break}o.index>0&&t.push(r.substring(0,o.index)),t.push(o[0]),n+=o.index+o[0].length,r=e.substring(n)}return t}var u=n(1473);function l(e,t,n,a){void 0===a&&(a=u.Hk);for(var l=function(e,t,n){var a=[],u=0,l=0,c=-1;for(;ul)for(var h,m=s(e.substring(l,f)).map((function(e){return{html:(0,o.X)(e),textLength:e.length}})),g=(0,r.Z)(m);!(h=g()).done;){var v=h.value;a.push(v)}-1===c&&(c=a.length),l=f+p,a.push({html:(0,i.C)(e.substring(f,l),n,!0),textLength:p})}}if(l0){var _=f.pop();g+_.textLength<=a?(h.unshift(_.html),v+=_.textLength,g+=_.textLength):(y=!0,f.length=0)}else{if(!(m.length>0))break;var k=m.shift();g+k.textLength<=a?(h.push(k.html),b+=k.textLength,g+=k.textLength):(w=!0,m.length=0)}return(y||f.length>0)&&h.unshift("\u2026"),(w||m.length>0)&&h.push("\u2026"),h.join("")}},1473:function(e,t,n){"use strict";n.d(t,{vc:function(){return o()},gQ:function(){return h},H6:function(){return c},hG:function(){return v},l9:function(){return m},dK:function(){return i},_k:function(){return a},pu:function(){return p},AY:function(){return d},t_:function(){return f},Kc:function(){return g},J:function(){return s},Hk:function(){return l},qo:function(){return u},pQ:function(){return b}});n(574);var r=n(2963),o=n.n(r),i=["en"],a=!1,s="search-index{dir}.json?_=5ca0ef2c",u=8,l=50,c=!1,d=!0,f=!0,p="right",h=void 0,m=!0,g=null,v=!1,b=!1},2811:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(1987),o=n(9375),i=n(1687),a=n.n(i),s=n(6887),u={"04e58e9c":[function(){return n.e(6907).then(n.bind(n,4341))},"@site/docs/guides/tutorials/first_task.md",4341],"06c91ef7":[function(){return n.e(3610).then(n.bind(n,9976))},"@site/docs/guides/how_to_use/worker_quality/other_methods.md",9976],"0db8f33c":[function(){return n.e(4195).then(n.bind(n,474))},"@site/docs/guides/how_to_use/providers/mturk.md",474],12241291:[function(){return n.e(7294).then(n.bind(n,5433))},"@site/docs/guides/how_to_contribute/documentation.md",5433],"130db7a8":[function(){return n.e(1169).then(n.bind(n,8581))},"@site/docs/guides/how_to_contribute/db_migrations.md",8581],17896441:[function(){return Promise.all([n.e(532),n.e(9804),n.e(7918)]).then(n.bind(n,8393))},"@theme/DocItem",8393],"180e564a":[function(){return n.e(113).then(n.bind(n,3550))},"@site/docs/guides/how_to_use/providers/prolific/prolific_api_oddities.md",3550],"1a4e3797":[function(){return Promise.all([n.e(532),n.e(7920)]).then(n.bind(n,1488))},"@theme/SearchPage",1488],"1be78505":[function(){return Promise.all([n.e(532),n.e(9514)]).then(n.bind(n,1405))},"@theme/DocPage",1405],"1e6f1f82":[function(){return n.e(115).then(n.bind(n,797))},"@site/docs/guides/how_to_use/efficiency_organization/config_faq.md",797],"1f221dc3":[function(){return n.e(1295).then(n.bind(n,38))},"@site/docs/explanations/architecture_overview.md",38],"206abefe":[function(){return n.e(8122).then(n.bind(n,4238))},"@site/docs/guides/how_to_use/task_creation/task_run.md",4238],"22624bcf":[function(){return n.e(7559).then(n.bind(n,5450))},"@site/docs/reference/overview.md",5450],"24b5f35b":[function(){return n.e(7466).then(n.bind(n,7455))},"@site/docs/guides/how_to_use/form_composer/overview.md",7455],"26d8019b":[function(){return Promise.all([n.e(9926),n.e(1395)]).then(n.bind(n,3628))},"@site/docs/guides/how_to_use/worker_quality/using_onboarding.mdx",3628],28082527:[function(){return n.e(5471).then(n.t.bind(n,2776,19))},"/home/runner/work/Mephisto/Mephisto/docs/web/.docusaurus/@easyops-cn/docusaurus-search-local/default/plugin-route-context-module-100.json",2776],"31390afa":[function(){return n.e(9397).then(n.bind(n,9668))},"@site/docs/guides/how_to_use/review_app/enabling_original_unit_preview.md",9668],"34c96258":[function(){return n.e(8876).then(n.bind(n,6193))},"@site/docs/guides/how_to_use/review_app/overview.md",6193],"38464eeb":[function(){return n.e(9).then(n.bind(n,8444))},"@site/docs/guides/how_to_use/video_annotator/configuration/form_callbacks.md",8444],"3aea748f":[function(){return n.e(743).then(n.bind(n,5738))},"@site/docs/guides/how_to_use/video_annotator/configuration/multiple_annotator_versions.md",5738],"3b040f46":[function(){return n.e(1178).then(n.t.bind(n,4469,19))},"/home/runner/work/Mephisto/Mephisto/docs/web/.docusaurus/docusaurus-plugin-content-blog/default/plugin-route-context-module-100.json",4469],"3b6e281a":[function(){return n.e(1952).then(n.bind(n,7123))},"@site/docs/guides/how_to_use/video_annotator/running.md",7123],"3b75aca0":[function(){return n.e(5655).then(n.bind(n,4960))},"@site/docs/guides/how_to_use/js_packages/main.md",4960],"3ed595b0":[function(){return n.e(1123).then(n.bind(n,8239))},"@site/docs/guides/how_to_use/worker_experience/mephisto-task-addons.md",8239],"49fa51be":[function(){return n.e(6731).then(n.bind(n,4247))},"@site/docs/guides/tutorials/workflows.md",4247],"4a5271d1":[function(){return n.e(4655).then(n.bind(n,5107))},"@site/docs/guides/how_to_use/efficiency_organization/manual_installation.md",5107],"4ac0665e":[function(){return n.e(3693).then(n.bind(n,2494))},"@site/docs/explanations/abstractions_overview.md",2494],"4c113261":[function(){return n.e(7788).then(n.bind(n,7189))},"@site/docs/explanations/architect_api.md",7189],"4d370f44":[function(){return n.e(1722).then(n.bind(n,6709))},"@site/docs/guides/how_to_use/video_annotator/configuration/config_files.md",6709],"4d8b778b":[function(){return n.e(8374).then(n.bind(n,7227))},"@site/docs/guides/tutorials/custom_react.md",7227],"591df8b9":[function(){return n.e(9705).then(n.bind(n,2296))},"@site/docs/guides/how_to_use/form_composer/configuration/insertions.md",2296],"5b207c16":[function(){return n.e(3229).then(n.bind(n,5972))},"@site/docs/guides/how_to_use/worker_experience/worker_opinion.md",5972],"5cd9c2e2":[function(){return n.e(7512).then(n.t.bind(n,5745,19))},"/home/runner/work/Mephisto/Mephisto/docs/web/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745],"5e9f5e1a":[function(){return Promise.resolve().then(n.bind(n,6809))},"@generated/docusaurus.config",6809],"5ebaccee":[function(){return n.e(657).then(n.bind(n,477))},"@site/docs/guides/how_to_use/video_annotator/configuration/video_annotator_config_command.md",477],"60eb8991":[function(){return n.e(1929).then(n.bind(n,4047))},"@site/docs/guides/how_to_use/providers/prolific/prolific_python_sdk.md",4047],"6704ba13":[function(){return n.e(8618).then(n.bind(n,9317))},"@site/docs/reference/providers.md",9317],"674ee871":[function(){return n.e(7299).then(n.bind(n,5329))},"@site/docs/guides/how_to_use/worker_quality/common_qualification_flows.md",5329],"6d438615":[function(){return n.e(4839).then(n.bind(n,2134))},"@site/docs/reference/requesters.md",2134],"7282321b":[function(){return n.e(914).then(n.bind(n,3072))},"@site/docs/guides/how_to_use/form_composer/embedding.md",3072],76067106:[function(){return n.e(5128).then(n.bind(n,6067))},"@site/docs/reference/architects.md",6067],"7b7dd0fa":[function(){return n.e(714).then(n.bind(n,445))},"@site/docs/guides/how_to_use/video_annotator/configuration/setup.md",445],"7d44495e":[function(){return n.e(2908).then(n.bind(n,3645))},"@site/docs/guides/how_to_use/video_annotator/configuration/insertions.md",3645],"7d92f30b":[function(){return n.e(9293).then(n.bind(n,3063))},"@site/docs/guides/how_to_use/form_composer/configuration/form_callbacks.md",3063],"7f5eebff":[function(){return n.e(8538).then(n.bind(n,8691))},"@site/docs/guides/how_to_use/form_composer/configuration/config_files.md",8691],"814f3328":[function(){return n.e(2535).then(n.t.bind(n,5641,19))},"~blog/default/blog-post-list-prop-default.json",5641],"835a1116":[function(){return n.e(1516).then(n.bind(n,262))},"@site/docs/guides/how_to_use/data_porter/simple_usage.md",262],"84997dac":[function(){return n.e(7318).then(n.bind(n,663))},"@site/docs/guides/how_to_use/providers/prolific/intro.md",663],"873dbec9":[function(){return n.e(7658).then(n.bind(n,5914))},"@site/docs/reference/blueprints.md",5914],"878eb1f5":[function(){return n.e(5138).then(n.bind(n,7250))},"@site/docs/guides/how_to_use/video_annotator/overview.md",7250],"87ddf927":[function(){return n.e(240).then(n.t.bind(n,3769,19))},"/home/runner/work/Mephisto/Mephisto/docs/web/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",3769],"889e764e":[function(){return n.e(5466).then(n.bind(n,6969))},"@site/docs/guides/tutorials/model_in_the_loop.md",6969],89605158:[function(){return n.e(419).then(n.bind(n,8429))},"@site/docs/guides/how_to_use/task_creation/hosting_assets.md",8429],"8a1f84e3":[function(){return n.e(2955).then(n.bind(n,7175))},"@site/docs/guides/how_to_use/js_packages/custom.md",7175],91039464:[function(){return n.e(7356).then(n.bind(n,458))},"@site/docs/guides/quickstart.md",458],"92cc9b0f":[function(){return n.e(2630).then(n.bind(n,9630))},"@site/docs/guides/how_to_contribute/known_issues.md",9630],"935f2afb":[function(){return n.e(53).then(n.t.bind(n,4612,19))},"~docs/default/version-current-metadata-prop-751.json",4612],"9431363c":[function(){return n.e(8744).then(n.bind(n,2189))},"@site/blog/2022-03-22-mephisto-1.0.md?truncated=true",2189],"99593f2f":[function(){return n.e(2303).then(n.bind(n,24))},"@site/docs/guides/tutorials/form_composer.md",24],"9e4087bc":[function(){return n.e(3608).then(n.bind(n,3935))},"@theme/BlogArchivePage",3935],a02207c1:[function(){return n.e(2671).then(n.bind(n,90))},"@site/docs/guides/how_to_use/review_app/server_api.md",90],a2c7551e:[function(){return n.e(3372).then(n.bind(n,2601))},"@site/docs/guides/how_to_contribute/frontend_development.md",2601],a3144474:[function(){return n.e(4795).then(n.bind(n,5998))},"@site/docs/guides/how_to_use/form_composer/running.md",5998],a6aa9e1f:[function(){return Promise.all([n.e(532),n.e(9804),n.e(6839),n.e(3089)]).then(n.bind(n,9706))},"@theme/BlogListPage",9706],a7976ac9:[function(){return n.e(5665).then(n.bind(n,4834))},"@site/docs/guides/how_to_use/form_composer/configuration/setup.md",4834],aa23dd48:[function(){return n.e(5108).then(n.bind(n,793))},"@site/docs/guides/how_to_use/task_creation/developing_frontends.md",793],afcbdae1:[function(){return n.e(3916).then(n.bind(n,3739))},"@site/docs/guides/how_to_use/efficiency_organization/docker.md",3739],b026c61a:[function(){return Promise.all([n.e(9926),n.e(6743)]).then(n.bind(n,352))},"@site/docs/guides/how_to_use/worker_quality/using_screen_units.mdx",352],b0f9abb1:[function(){return n.e(2945).then(n.bind(n,4468))},"@site/docs/guides/how_to_use/efficiency_organization/metrics_dashboard.md",4468],b26c62c0:[function(){return n.e(1107).then(n.bind(n,8234))},"@site/docs/guides/how_to_use/data_porter/reference.md",8234],b2b675dd:[function(){return n.e(533).then(n.t.bind(n,8017,19))},"~blog/default/blog-c06.json",8017],b2f554cd:[function(){return n.e(1477).then(n.t.bind(n,10,19))},"~blog/default/blog-archive-80c.json",10],b7aec231:[function(){return n.e(1430).then(n.bind(n,1400))},"@site/docs/guides/how_to_contribute/getting_started.md",1400],b8d65bcf:[function(){return n.e(6454).then(n.bind(n,2363))},"@site/docs/guides/how_to_use/form_composer/configuration/form_composer_config_command.md",2363],bde6ce88:[function(){return n.e(1927).then(n.bind(n,4296))},"@site/docs/guides/tutorials/review_app.md",4296],c4f5d8e4:[function(){return Promise.all([n.e(532),n.e(4193)]).then(n.bind(n,9850))},"@site/src/pages/index.js",9850],ccc49370:[function(){return Promise.all([n.e(532),n.e(9804),n.e(6839),n.e(6103)]).then(n.bind(n,6022))},"@theme/BlogPostPage",6022],d11ed460:[function(){return n.e(7175).then(n.bind(n,6283))},"@site/docs/guides/how_to_use/review_app/running.md",6283],d2b8a042:[function(){return n.e(9555).then(n.bind(n,6860))},"@site/docs/guides/how_to_use/data_porter/custom_conflict_resolver.md",6860],d4b9235d:[function(){return n.e(3548).then(n.bind(n,5060))},"@site/docs/reference/tasks.md",5060],d6b09d75:[function(){return n.e(6556).then(n.bind(n,3910))},"@site/docs/guides/how_to_use/review_app/diagram.md",3910],d6c92909:[function(){return n.e(8487).then(n.bind(n,2693))},"@site/docs/guides/how_to_use/efficiency_organization/reusing_configs.md",2693],d905b8f0:[function(){return n.e(6628).then(n.bind(n,7243))},"@site/docs/guides/how_to_use/worker_quality/using_golds.md",7243],dee53823:[function(){return n.e(4284).then(n.bind(n,6252))},"@site/docs/guides/how_to_use/providers/prolific/eligibility_requirements.md",6252],e1ddd029:[function(){return n.e(5603).then(n.bind(n,531))},"@site/docs/guides/how_to_contribute/backend_development.md",531],e771321a:[function(){return n.e(469).then(n.bind(n,5278))},"@site/blog/2022-03-22-mephisto-1.0.md",5278],eed7a257:[function(){return n.e(1936).then(n.bind(n,3675))},"@site/docs/guides/how_to_use/review_app/enabling_responses_histogram.md",3675],f5e01c1b:[function(){return n.e(6231).then(n.bind(n,8898))},"@site/docs/guides/how_to_use/video_annotator/embedding.md",8898],f6f0f47f:[function(){return n.e(9988).then(n.bind(n,5346))},"@site/docs/guides/how_to_use/form_composer/configuration/multiple_form_versions.md",5346],fa2c376f:[function(){return n.e(8299).then(n.bind(n,7427))},"@site/docs/guides/how_to_use/worker_quality/managing_worker_qualifications.md",7427],ff1b5b1d:[function(){return n.e(8440).then(n.bind(n,9133))},"@site/docs/guides/how_to_use/providers/prolific/running_study.md",9133],ffe02791:[function(){return n.e(1457).then(n.bind(n,1720))},"@site/docs/guides/tutorials/worker_controls.md",1720]};function l(e){var t=e.error,n=e.retry,o=e.pastDelay;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):o?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var c=n(6925),d=n(5673);function f(e,t){if("*"===e)return a()({loading:l,loader:function(){return n.e(7273).then(n.bind(n,7273))},modules:["@theme/NotFound"],webpack:function(){return[7273]},render:function(e,t){var n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});var i=s[e+"-"+t],f={},p=[],h=[],m=(0,c.Z)(i);return Object.entries(m).forEach((function(e){var t=e[0],n=e[1],r=u[n];r&&(f[t]=r[0],p.push(r[1]),h.push(r[2]))})),a().Map({loading:l,loader:f,modules:p,webpack:function(){return h},render:function(t,n){var a=JSON.parse(JSON.stringify(i));Object.entries(t).forEach((function(t){var n=t[0],r=t[1],o=r.default;if(!o)throw new Error("The page component at "+e+" doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.");"object"!=typeof o&&"function"!=typeof o||Object.keys(r).filter((function(e){return"default"!==e})).forEach((function(e){o[e]=r[e]}));var i=a,s=n.split(".");s.slice(0,-1).forEach((function(e){i=i[e]})),i[s[s.length-1]]=o}));var s=a.__comp;delete a.__comp;var u=a.__context;return delete a.__context,r.createElement(d.z,{value:u},r.createElement(s,(0,o.Z)({},a,n)))}})}var p=[{path:"/blog/",component:f("/blog/","f8a"),exact:!0},{path:"/blog/2022/03/22/mephisto-1.0/",component:f("/blog/2022/03/22/mephisto-1.0/","72b"),exact:!0},{path:"/blog/archive/",component:f("/blog/archive/","28a"),exact:!0},{path:"/search/",component:f("/search/","ef4"),exact:!0},{path:"/docs/",component:f("/docs/","bdf"),routes:[{path:"/docs/explanations/abstractions_overview/",component:f("/docs/explanations/abstractions_overview/","071"),exact:!0,sidebar:"explanations"},{path:"/docs/explanations/architect_api/",component:f("/docs/explanations/architect_api/","d73"),exact:!0,sidebar:"explanations"},{path:"/docs/explanations/architecture_overview/",component:f("/docs/explanations/architecture_overview/","ba8"),exact:!0,sidebar:"explanations"},{path:"/docs/guides/how_to_contribute/backend_development/",component:f("/docs/guides/how_to_contribute/backend_development/","963"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/db_migrations/",component:f("/docs/guides/how_to_contribute/db_migrations/","300"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/documentation/",component:f("/docs/guides/how_to_contribute/documentation/","4e9"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/frontend_development/",component:f("/docs/guides/how_to_contribute/frontend_development/","1e1"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/getting_started/",component:f("/docs/guides/how_to_contribute/getting_started/","819"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/known_issues/",component:f("/docs/guides/how_to_contribute/known_issues/","7fe"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/data_porter/custom_conflict_resolver/",component:f("/docs/guides/how_to_use/data_porter/custom_conflict_resolver/","09d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/data_porter/reference/",component:f("/docs/guides/how_to_use/data_porter/reference/","8e1"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/data_porter/simple_usage/",component:f("/docs/guides/how_to_use/data_porter/simple_usage/","123"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/config_faq/",component:f("/docs/guides/how_to_use/efficiency_organization/config_faq/","bca"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/docker/",component:f("/docs/guides/how_to_use/efficiency_organization/docker/","b9c"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/manual_installation/",component:f("/docs/guides/how_to_use/efficiency_organization/manual_installation/","12f"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/metrics_dashboard/",component:f("/docs/guides/how_to_use/efficiency_organization/metrics_dashboard/","0a4"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/reusing_configs/",component:f("/docs/guides/how_to_use/efficiency_organization/reusing_configs/","257"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/config_files/",component:f("/docs/guides/how_to_use/form_composer/configuration/config_files/","20d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/form_callbacks/",component:f("/docs/guides/how_to_use/form_composer/configuration/form_callbacks/","8e9"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/form_composer_config_command/",component:f("/docs/guides/how_to_use/form_composer/configuration/form_composer_config_command/","8e5"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/insertions/",component:f("/docs/guides/how_to_use/form_composer/configuration/insertions/","289"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/multiple_form_versions/",component:f("/docs/guides/how_to_use/form_composer/configuration/multiple_form_versions/","d21"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/setup/",component:f("/docs/guides/how_to_use/form_composer/configuration/setup/","18c"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/embedding/",component:f("/docs/guides/how_to_use/form_composer/embedding/","6a6"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/overview/",component:f("/docs/guides/how_to_use/form_composer/overview/","c27"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/running/",component:f("/docs/guides/how_to_use/form_composer/running/","9b5"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/js_packages/custom/",component:f("/docs/guides/how_to_use/js_packages/custom/","ea7"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/js_packages/main/",component:f("/docs/guides/how_to_use/js_packages/main/","3e7"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/mturk/",component:f("/docs/guides/how_to_use/providers/mturk/","35d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/eligibility_requirements/",component:f("/docs/guides/how_to_use/providers/prolific/eligibility_requirements/","c16"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/intro/",component:f("/docs/guides/how_to_use/providers/prolific/intro/","b77"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/prolific_api_oddities/",component:f("/docs/guides/how_to_use/providers/prolific/prolific_api_oddities/","0c5"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/prolific_python_sdk/",component:f("/docs/guides/how_to_use/providers/prolific/prolific_python_sdk/","31d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/running_study/",component:f("/docs/guides/how_to_use/providers/prolific/running_study/","286"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/diagram/",component:f("/docs/guides/how_to_use/review_app/diagram/","8ff"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/enabling_original_unit_preview/",component:f("/docs/guides/how_to_use/review_app/enabling_original_unit_preview/","3a8"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/enabling_responses_histogram/",component:f("/docs/guides/how_to_use/review_app/enabling_responses_histogram/","52b"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/overview/",component:f("/docs/guides/how_to_use/review_app/overview/","1a2"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/running/",component:f("/docs/guides/how_to_use/review_app/running/","5f5"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/server_api/",component:f("/docs/guides/how_to_use/review_app/server_api/","a76"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/task_creation/developing_frontends/",component:f("/docs/guides/how_to_use/task_creation/developing_frontends/","6db"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/task_creation/hosting_assets/",component:f("/docs/guides/how_to_use/task_creation/hosting_assets/","226"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/task_creation/task_run/",component:f("/docs/guides/how_to_use/task_creation/task_run/","fe8"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/config_files/",component:f("/docs/guides/how_to_use/video_annotator/configuration/config_files/","24d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/form_callbacks/",component:f("/docs/guides/how_to_use/video_annotator/configuration/form_callbacks/","70b"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/insertions/",component:f("/docs/guides/how_to_use/video_annotator/configuration/insertions/","f74"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/multiple_annotator_versions/",component:f("/docs/guides/how_to_use/video_annotator/configuration/multiple_annotator_versions/","481"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/setup/",component:f("/docs/guides/how_to_use/video_annotator/configuration/setup/","16f"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/video_annotator_config_command/",component:f("/docs/guides/how_to_use/video_annotator/configuration/video_annotator_config_command/","350"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/embedding/",component:f("/docs/guides/how_to_use/video_annotator/embedding/","ce9"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/overview/",component:f("/docs/guides/how_to_use/video_annotator/overview/","95d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/running/",component:f("/docs/guides/how_to_use/video_annotator/running/","228"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_experience/mephisto-task-addons/",component:f("/docs/guides/how_to_use/worker_experience/mephisto-task-addons/","ac4"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_experience/worker_opinion/",component:f("/docs/guides/how_to_use/worker_experience/worker_opinion/","021"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/common_qualification_flows/",component:f("/docs/guides/how_to_use/worker_quality/common_qualification_flows/","c27"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/managing_worker_qualifications/",component:f("/docs/guides/how_to_use/worker_quality/managing_worker_qualifications/","7ec"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/other_methods/",component:f("/docs/guides/how_to_use/worker_quality/other_methods/","f9d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/using_golds/",component:f("/docs/guides/how_to_use/worker_quality/using_golds/","b13"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/using_onboarding/",component:f("/docs/guides/how_to_use/worker_quality/using_onboarding/","67a"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/using_screen_units/",component:f("/docs/guides/how_to_use/worker_quality/using_screen_units/","624"),exact:!0,sidebar:"guides"},{path:"/docs/guides/quickstart/",component:f("/docs/guides/quickstart/","4a0"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/custom_react/",component:f("/docs/guides/tutorials/custom_react/","536"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/first_task/",component:f("/docs/guides/tutorials/first_task/","63b"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/form_composer/",component:f("/docs/guides/tutorials/form_composer/","adc"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/model_in_the_loop/",component:f("/docs/guides/tutorials/model_in_the_loop/","c58"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/review_app/",component:f("/docs/guides/tutorials/review_app/","07d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/worker_controls/",component:f("/docs/guides/tutorials/worker_controls/","184"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/workflows/",component:f("/docs/guides/tutorials/workflows/","474"),exact:!0,sidebar:"guides"},{path:"/docs/reference/architects/",component:f("/docs/reference/architects/","27f"),exact:!0,sidebar:"reference"},{path:"/docs/reference/blueprints/",component:f("/docs/reference/blueprints/","9ed"),exact:!0,sidebar:"reference"},{path:"/docs/reference/overview/",component:f("/docs/reference/overview/","c48"),exact:!0,sidebar:"reference"},{path:"/docs/reference/providers/",component:f("/docs/reference/providers/","abe"),exact:!0,sidebar:"reference"},{path:"/docs/reference/requesters/",component:f("/docs/reference/requesters/","71e"),exact:!0,sidebar:"reference"},{path:"/docs/reference/tasks/",component:f("/docs/reference/tasks/","cd8"),exact:!0,sidebar:"reference"}]},{path:"/",component:f("/","59e"),exact:!0},{path:"*",component:f("*")}]},6714:function(e,t,n){"use strict";n.r(t)},1250:function(e,t,n){"use strict";n.r(t)},7601:function(e,t){"use strict";var n=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);E+=k.value.length,k=k.next){var S=k.value;if(t.length>e.length)return;if(!(S instanceof o)){var x,C=1;if(b){if(!(x=i(_,E,e,v))||x.index>=e.length)break;var T=x.index,L=x.index+x[0].length,A=E;for(A+=k.value.length;T>=A;)A+=(k=k.next).value.length;if(E=A-=k.value.length,k.value instanceof o)continue;for(var D=k;D!==t.tail&&(Ad.reach&&(d.reach=O);var I=k.prev;if(N&&(I=u(t,I,N),E+=N.length),l(t,I,C),k=u(t,I,new o(f,g?r.tokenize(R,g):R,y,R)),P&&u(t,k,P),C>1){var F={cause:f+","+h,reach:O};a(e,t,n,k.prev,E,F),d&&F.reach>d.reach&&(d.reach=F.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function l(e,t,n){for(var r=t.next,o=0;o"+i.content+""},r}(),r=n;n.default=n,r.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^$/i;var o={"included-cdata":{pattern://i,inside:n}};o["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:o},r.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=r.variable[1].inside,a=0;a]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.c=r.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),r.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),r.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},r.languages.c.string],char:r.languages.c.char,comment:r.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:r.languages.c}}}}),r.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete r.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(r),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(r),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},o={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:o,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:o})}(r),r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(r),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function a(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return"(?:"+o+"|"+i+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:a(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:a(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:a(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:a(i),lookbehind:!0,greedy:!0},number:{pattern:a(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(r),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n",quot:'"'},u=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(r),r.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:r.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},r.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n0)){var s=f(/^\{$/,/^\}$/);if(-1===s)continue;for(var u=n;u=0&&p(l,"variable-input")}}}}function c(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],i=r.pattern.source;function a(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function s(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function u(t,n,r){var o={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",o),o.tokens=e.tokenize(o.code,o.grammar),e.hooks.run("after-tokenize",o),o.tokens}function l(t){var n={};n["interpolation-punctuation"]=o;var i=e.tokenize(t,n);if(3===i.length){var a=[1,1];a.push.apply(a,u(i[1],e.languages.javascript,"javascript")),i.splice.apply(i,a)}return new e.Token("interpolation",i,r.alias,t)}function c(t,n,r){var o=e.tokenize(t,{interpolation:{pattern:RegExp(i),lookbehind:!0}}),a=0,c={},d=u(o.map((function(e){if("string"==typeof e)return e;for(var n,o=e.content;-1!==t.indexOf(n=s(a++,r)););return c[n]=o,n})).join(""),n,r),f=Object.keys(c);return a=0,function e(t){for(var n=0;n=f.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var o=f[a],i="string"==typeof r?r:r.content,s=i.indexOf(o);if(-1!==s){++a;var u=i.substring(0,s),d=l(c[o]),p=i.substring(s+o.length),h=[];if(u&&h.push(u),h.push(d),p){var m=[p];e(m),h.push.apply(h,m)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(h)),n+=h.length-1):r.content=h}}else{var g=r.content;Array.isArray(g)?e(g):e([g])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[a("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),a("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),a("svg",/\bsvg/.source),a("markdown",/\b(?:markdown|md)/.source),a("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),a("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,o=n.length;r]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(r),function(e){function t(e,t){return RegExp(e.replace(//g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r*\.{3}(?:[^{}]|)*\})/.source;function i(e,t){return e=e.replace(//g,(function(){return n})).replace(//g,(function(){return r})).replace(//g,(function(){return o})),RegExp(e,t)}o=i(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var a=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(a).join(""):""},s=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===a(o.content[0].content[1])&&n.pop():"/>"===o.content[o.content.length-1].content||n.push({tagName:a(o.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===o.type&&"{"===o.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?n[n.length-1].openedBraces--:i=!0),(i||"string"==typeof o)&&n.length>0&&0===n[n.length-1].openedBraces){var u=a(o);r0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(u=a(t[r-1])+u,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",u,null,u)}o.content&&"string"!=typeof o.content&&s(o.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||s(e.tokens)}))}(r),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),"diff"===n&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(r),r.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},r.languages.go=r.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),r.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete r.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,i){if(n.language===r){var a=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof i&&!i(e))return e;for(var o,s=a.length;-1!==n.code.indexOf(o=t(r,s));)++s;return a[s]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,i=Object.keys(n.tokenStack);!function a(s){for(var u=0;u=i.length);u++){var l=s[u];if("string"==typeof l||l.content&&"string"==typeof l.content){var c=i[o],d=n.tokenStack[c],f="string"==typeof l?l:l.content,p=t(r,c),h=f.indexOf(p);if(h>-1){++o;var m=f.substring(0,h),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),v=f.substring(h+p.length),b=[];m&&b.push.apply(b,a([m])),b.push(g),v&&b.push.apply(b,a([v])),"string"==typeof l?s.splice.apply(s,[u,1].concat(b)):l.content=b}}else l.content&&a(l.content)}return s}(n.tokens)}}}})}(r),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(r),r.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},r.languages.webmanifest=r.languages.json,r.languages.less=r.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),r.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),r.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},r.languages.objectivec=r.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete r.languages.objectivec["class-name"],r.languages.objc=r.languages.objectivec,r.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},r.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},r.languages.python["string-interpolation"].inside.interpolation.inside.rest=r.languages.python,r.languages.py=r.languages.python,r.languages.reason=r.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),r.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete r.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(r),r.languages.scss=r.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),r.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),r.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),r.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),r.languages.scss.atrule.inside.rest=r.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(r),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(r),r.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/},t.Z=r},5619:function(e,t,n){"use strict";var r=n(1987),o=n(286);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n
'};function o(e,t,n){return en?n:e}function i(e){return 100*(-1+e)}function a(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+i(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+i(e)+"%,0)"}:{"margin-left":i(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var i=n.render(!t),l=i.querySelector(r.barSelector),c=r.speed,d=r.easing;return i.offsetWidth,s((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),u(l,a(e,c,d)),1===e?(u(i,{transition:"none",opacity:1}),i.offsetWidth,setTimeout((function(){u(i,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,a=t.querySelector(r.barSelector),s=e?"-100":i(n.status||0),l=document.querySelector(r.parent);return u(a,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&p(o),l!=document.body&&c(l,"nprogress-custom-parent"),l.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var s=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),u=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,i=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+i)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function i(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&i(e,n,r);else i(e,o[1],o[2])}}();function l(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=f(e),r=n+t;l(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);l(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(o="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=o)},4071:function(e,t,n){var r=n(7107);e.exports=p,e.exports.parse=i,e.exports.compile=function(e,t){return s(i(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,s="",c=t&&t.delimiter||"/";null!=(n=o.exec(e));){var d=n[0],f=n[1],p=n.index;if(s+=e.slice(a,p),a=p+d.length,f)s+=f[1];else{var h=e[a],m=n[2],g=n[3],v=n[4],b=n[5],y=n[6],w=n[7];s&&(r.push(s),s="");var _=null!=m&&null!=h&&h!==m,k="+"===y||"*"===y,E="?"===y||"*"===y,S=n[2]||c,x=v||b;r.push({name:g||i++,prefix:m||"",delimiter:S,optional:E,repeat:k,partial:_,asterisk:!!w,pattern:x?l(x):w?".*":"[^"+u(S)+"]+?"})}}return a
\n'}(e)).replace(/0)&&(j.current.unobserve(e),j.current.disconnect(),null!=O&&window.docusaurus.prefetch(O))}))})),j.current.observe(e))},to:O},m&&{isActive:y,activeClassName:b}))}var m=i.forwardRef(h)},158:function(e,t,n){"use strict";n.d(t,{Z:function(){return u},I:function(){return s}});var r=n(1987);function o(e,t){var n=e.split(/(\{\w+\})/).map((function(e,n){if(n%2==1){var r=null==t?void 0:t[e.slice(1,-1)];if(void 0!==r)return r}return e}));return n.some((function(e){return(0,r.isValidElement)(e)}))?n.map((function(e,t){return(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e})).filter((function(e){return""!==e})):n.join("")}var i=n(7529);function a(e){var t,n,r=e.id,o=e.message;if(void 0===r&&void 0===o)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return null!=(t=null!=(n=i[null!=r?r:o])?n:o)?t:r}function s(e,t){return o(a({message:e.message,id:e.id}),t)}function u(e){var t=e.children,n=e.id,i=e.values;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");var s=a({message:t,id:n});return r.createElement(r.Fragment,null,o(s,i))}},5800:function(e,t,n){"use strict";n.d(t,{m:function(){return r}});var r="default"},6183:function(e,t,n){"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,{Z:function(){return o},b:function(){return r}})},1244:function(e,t,n){"use strict";n.d(t,{C:function(){return i},Z:function(){return a}});var r=n(1109),o=n(6183);function i(){var e=(0,r.Z)().siteConfig,t=e.baseUrl,n=e.url;return{withBaseUrl:function(e,r){return function(e,t,n,r){var i=void 0===r?{}:r,a=i.forcePrependBaseUrl,s=void 0!==a&&a,u=i.absolute,l=void 0!==u&&u;if(!n||n.startsWith("#")||(0,o.b)(n))return n;if(s)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;var c=n.startsWith(t)?n:t+n.replace(/^\//,"");return l?e+c:c}(n,t,e,r)}}}function a(e,t){return void 0===t&&(t={}),(0,i().withBaseUrl)(e,t)}},1109:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1987),o=n(9484);function i(){return(0,r.useContext)(o._)}},6099:function(e,t,n){"use strict";n.d(t,{OD:function(){return i},eZ:function(){return a}});var r=n(1109),o=n(5800);function i(e,t){void 0===t&&(t={});var n=(0,r.Z)().globalData[e];if(!n&&t.failfast)throw new Error('Docusaurus plugin global data not found for "'+e+'" plugin.');return n}function a(e,t,n){void 0===t&&(t=o.m),void 0===n&&(n={});var r=i(e),a=null==r?void 0:r[t];if(!a&&n.failfast)throw new Error('Docusaurus plugin global data not found for "'+e+'" plugin with id "'+t+'".');return a}},1316:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1987),o=n(6160);function i(){return(0,r.useContext)(o._)}},6925:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){var t={};return function e(n,r){Object.entries(n).forEach((function(n){var o,i=n[0],a=n[1],s=r?r+"."+i:i;"object"==typeof(o=a)&&o&&Object.keys(o).length>0?e(a,s):t[s]=a}))}(e),t}},5673:function(e,t,n){"use strict";n.d(t,{_:function(){return o},z:function(){return i}});var r=n(1987),o=r.createContext(null);function i(e){var t=e.children,n=e.value,i=r.useContext(o),a=(0,r.useMemo)((function(){return function(e){var t=e.parent,n=e.value;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}var r=Object.assign({},t.data,null==n?void 0:n.data);return{plugin:t.plugin,data:r}}({parent:i,value:n})}),[i,n]);return r.createElement(o.Provider,{value:a},t)}},4606:function(e,t,n){"use strict";n.d(t,{Iw:function(){return d},gA:function(){return l},Jo:function(){return f},gB:function(){return c}});var r=n(4593),o=n(6099);var i=function(e){return e.versions.find((function(e){return e.isLast}))};function a(e,t){var n,o,a=function(e,t){var n=i(e);return[].concat(e.versions.filter((function(e){return e!==n})),[n]).find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})}))}(e,t),s=null==a?void 0:a.docs.find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})}));return{activeVersion:a,activeDoc:s,alternateDocVersions:s?(n=s.id,o={},e.versions.forEach((function(e){e.docs.forEach((function(t){t.id===n&&(o[e.name]=t)}))})),o):{}}}var s={},u=function(e){return(0,o.eZ)("docusaurus-plugin-content-docs",e,{failfast:!0})};function l(e){var t;return void 0===e&&(e={}),function(e,t,n){void 0===n&&(n={});var o=Object.entries(e).sort((function(e,t){return t[1].path.localeCompare(e[1].path)})).find((function(e){var n=e[1];return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),i=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!i&&n.failfast)throw new Error("Can't find active docs plugin for \""+t+'" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: '+Object.values(e).map((function(e){return e.path})).join(", "));return i}(null!=(t=(0,o.OD)("docusaurus-plugin-content-docs"))?t:s,(0,r.TH)().pathname,e)}function c(e){return u(e).versions}function d(e){return a(u(e),(0,r.TH)().pathname)}function f(e){return function(e,t){var n=i(e);return{latestDocSuggestion:a(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(u(e),(0,r.TH)().pathname)}},1236:function(e,t,n){"use strict";n.d(t,{Iw:function(){return f},gA:function(){return c},_r:function(){return u},zh:function(){return l},yW:function(){return d}});var r=n(4593),o=n(6099);var i=function(e){return e.versions.find((function(e){return e.isLast}))};function a(e,t){var n,o,a=function(e,t){var n=i(e);return[].concat(e.versions.filter((function(e){return e!==n})),[n]).find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})}))}(e,t),s=null==a?void 0:a.docs.find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})}));return{activeVersion:a,activeDoc:s,alternateDocVersions:s?(n=s.id,o={},e.versions.forEach((function(e){e.docs.forEach((function(t){t.id===n&&(o[e.name]=t)}))})),o):{}}}var s={},u=function(){var e;return null!=(e=(0,o.OD)("docusaurus-plugin-content-docs"))?e:s},l=function(e){return(0,o.eZ)("docusaurus-plugin-content-docs",e,{failfast:!0})};function c(e){return void 0===e&&(e={}),function(e,t,n){void 0===n&&(n={});var o=Object.entries(e).sort((function(e,t){return t[1].path.localeCompare(e[1].path)})).find((function(e){var n=e[1];return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),i=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!i&&n.failfast)throw new Error("Can't find active docs plugin for \""+t+'" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: '+Object.values(e).map((function(e){return e.path})).join(", "));return i}(u(),(0,r.TH)().pathname,e)}function d(e){var t=l(e);return i(t)}function f(e){return a(l(e),(0,r.TH)().pathname)}},1687:function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){return a=Object.assign||function(e){for(var t=1;t'):s&&c.push('');var d=c.map((function(e){return''+e+""})),f=''+(u?'':l?'':'')+"",p=[''+(0,Ze.o)(t.t,(0,Ue.m)(o,"t"),i)+""];if(!a&&!s&&Ae.H6){var h,m=r?(null!=(h=r.b)?h:[]).concat(r.t).concat(t.s&&t.s!==r.t?t.s:[]):t.b;p.push(''+(0,ze.e)(null!=m?m:[])+"")}else u||p.push(''+(0,qe.C)(r.t||(t.u.startsWith("/docs/api-reference/")?"API Reference":""),i)+"");return[].concat(d,[f,''],p,["",'']).join("")}function vt(){return''+(0,l.I)({id:"theme.SearchBar.noResultsText",message:"No results"})+""}var bt=n(9718);function yt(){return wt.apply(this,arguments)}function wt(){return(wt=(0,Ne.Z)((0,De.Z)().mark((function e(){var t,r;return(0,De.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([n.e(2149),n.e(189)]).then(n.t.bind(n,2149,23));case 2:return t=e.sent,(r=t.default).noConflict?r.noConflict():t.noConflict&&t.noConflict(),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _t="_highlight";var kt=function(e){var t,n,i,a=e.handleSearchBarToggle,s=(0,ge.Z)().siteConfig.baseUrl,c=Me(),d=s;try{var f,p=(0,Oe.J)(null!=(f=null==c?void 0:c.pluginId)?f:Ae.gQ).preferredVersion;p&&!p.isLast&&(d=p.path+"/")}catch(H){if(Ae.l9&&!(H instanceof F.i6))throw H}var h=(0,u.k6)(),m=(0,u.TH)(),g=(0,r.useRef)(null),v=(0,r.useRef)(new Map),b=(0,r.useRef)(!1),y=(0,r.useState)(!1),w=y[0],_=y[1],k=(0,r.useState)(!1),E=k[0],S=k[1],x=(0,r.useState)(""),C=x[0],T=x[1],L=(0,r.useRef)(null),A=(0,r.useRef)(""),D=(0,r.useState)(""),R=D[0],N=D[1];(0,r.useEffect)((function(){if(Array.isArray(Ae.Kc)){var e="";if(m.pathname.startsWith(d)){var t=m.pathname.substring(d.length),n=Ae.Kc.find((function(e){return t===e||t.startsWith(e+"/")}));n&&(e=n)}A.current!==e&&(v.current.delete(e),A.current=e),N(e)}}),[m.pathname,d]);var P=!!Ae.hG&&Array.isArray(Ae.Kc)&&""===R,O=(0,r.useCallback)((0,Ne.Z)((0,De.Z)().mark((function e(){var t,n,r,i,a,u,c,f,p,m;return(0,De.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!P&&!v.current.get(R)){e.next=2;break}return e.abrupt("return");case 2:return v.current.set(R,"loading"),null==(t=L.current)||t.autocomplete.destroy(),_(!0),e.next=7,Promise.all([(0,je.w)(d,R),yt()]);case 7:r=e.sent,i=r[0],a=i.wrappedIndexes,u=i.zhDictionary,c=r[1],f=function(e){var t,n=e.query,r=e.isEmpty,o=document.createElement("a"),i=new URLSearchParams,a=(0,l.I)({id:"theme.SearchBar.seeAll",message:"See all results"}),u=(0,l.I)({id:"theme.SearchBar.seeAllOutsideContext",message:"See results outside {context}"},{context:R}),c=(0,l.I)({id:"theme.SearchBar.searchInContext",message:"See all results in {context}"},{context:R});if(i.set("q",n),t=R&&r?u:R?c:a,Array.isArray(Ae.Kc)&&!r&&i.set("ctx",R),d!==s){if(!d.startsWith(s))throw new Error("Version url '"+d+"' does not start with base url '"+s+"', this is a bug of `@easyops-cn/docusaurus-search-local`, please report it.");i.set("version",d.substring(s.length))}var f=s+"search?"+i.toString();return o.href=f,o.textContent=t,o.addEventListener("click",(function(e){var t;e.ctrlKey||e.metaKey||(e.preventDefault(),null==(t=L.current)||t.autocomplete.close(),h.push(f))})),o},L.current=c(g.current,{hint:!1,autoselect:!0,openOnFocus:!0,cssClasses:{root:(0,o.Z)($e,(n={},n[Ge]="left"===Ae.pu,n)),noPrefix:!0,dropdownMenu:He,input:dt,hint:ft,suggestions:pt,suggestion:Qe,cursor:Ve,dataset:ht,empty:mt}},[{source:(0,Be.v)(a,u,Ae.qo),templates:{suggestion:gt,empty:vt,footer:function(e){var t=e.query,n=e.isEmpty;if(!n||R){var r=f({query:t,isEmpty:n}),o=document.createElement("div");return o.className=Je,o.appendChild(r),o}}}}]).on("autocomplete:selected",(function(e,t){var n,r=t.document,o=r.u,i=r.h,a=t.tokens;null==(n=g.current)||n.blur();var s=o;if(Ae.vc&&a.length>0){for(var u,l=new URLSearchParams,c=(0,Re.Z)(a);!(u=c()).done;){var d=u.value;l.append(_t,d)}s+="?"+l.toString()}i&&(s+=i),h.push(s)})).on("autocomplete:closed",(function(){var e;null==(e=g.current)||e.blur()})),v.current.set(R,"done"),_(!1),b.current&&((p=g.current).value&&(null==(m=L.current)||m.autocomplete.open()),p.focus());case 17:case"end":return e.stop()}}),e)}))),[P,R,d,s,h]);(0,r.useEffect)((function(){if(Ae.vc){var e=Pe.Z.canUseDOM?new URLSearchParams(m.search).getAll(_t):[];setTimeout((function(){var t,n=document.querySelector("article");if(n){var r=new Ae.vc(n);r.unmark(),0!==e.length&&r.mark(e),T(e.join(" ")),null==(t=L.current)||t.autocomplete.setVal(e.join(" "))}}))}}),[m.search,m.pathname]);var I=(0,r.useState)(!1),M=I[0],j=I[1],B=(0,r.useCallback)((function(){b.current=!0,O(),j(!0),null==a||a(!0)}),[a,O]),z=(0,r.useCallback)((function(){j(!1),null==a||a(!1)}),[a]),U=(0,r.useCallback)((function(){O()}),[O]),q=(0,r.useCallback)((function(e){T(e.target.value),e.target.value&&S(!0)}),[]),Z=!!Pe.Z.canUseDOM&&/mac/i.test(null!=(t=null==(n=navigator.userAgentData)?void 0:n.platform)?t:navigator.platform);(0,r.useEffect)((function(){if(Ae.AY){var e=function(e){var t;!(Z?e.metaKey:e.ctrlKey)||"k"!==e.key&&"K"!==e.key||(e.preventDefault(),null==(t=g.current)||t.focus(),B())};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}}),[Z,B]);var $=(0,r.useCallback)((function(){var e,t=new URLSearchParams(m.search);t.delete(_t);var n=t.toString(),r=m.pathname+(""!=n?"?"+n:"")+m.hash;r!=m.pathname+m.search+m.hash&&h.push(r),T(""),null==(e=L.current)||e.autocomplete.setVal("")}),[m.pathname,m.search,m.hash,h]);return r.createElement("div",{className:(0,o.Z)("navbar__search",ot,(i={},i[st]=w&&E,i[ct]=M,i)),hidden:P},r.createElement("input",{placeholder:(0,l.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),"aria-label":"Search",className:"navbar__search-input",onMouseEnter:U,onFocus:B,onBlur:z,onChange:q,ref:g,value:C}),r.createElement(bt.Z,{className:it}),Ae.AY&&Ae.t_&&(""!==C?r.createElement("button",{className:at,onClick:$},"\u2715"):Pe.Z.canUseDOM&&r.createElement("div",{className:ut},r.createElement("kbd",{className:lt},Z?"\u2318":"ctrl"),r.createElement("kbd",{className:lt},"K"))))},Et="searchBox_YB5Q";function St(e){var t=e.children,n=e.className;return r.createElement("div",{className:(0,o.Z)(n,Et)},t)}var xt=n(4606),Ct=n(2532),Tt=["docId","label","docsPluginId"];var Lt=["sidebarId","label","docsPluginId"];var At=["label","to","docsPluginId"];var Dt=["mobile","docsPluginId","dropdownActiveClassDisabled","dropdownItemsBefore","dropdownItemsAfter"],Rt=function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))};var Nt={default:pe,localeDropdown:function(e){var t=e.mobile,n=e.dropdownItemsBefore,o=e.dropdownItemsAfter,i=(0,k.Z)(e,Le),a=(0,ge.Z)().i18n,c=a.currentLocale,d=a.locales,f=a.localeConfigs,p=(0,Se.l)(),h=(0,u.TH)(),m=h.search,g=h.hash,v=d.map((function(e){var n=""+("pathname://"+p.createUrl({locale:e,fullyQualified:!1}))+m+g;return{label:f[e].label,lang:f[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===c?t?"menu__link--active":"dropdown__link--active":""}})),b=[].concat(n,v,o),y=t?(0,l.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):f[c].label;return r.createElement(Ee,(0,s.Z)({},i,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(Ce,{className:Te}),y),items:b}))},search:function(e){var t=e.mobile,n=e.className;return t?null:r.createElement(St,{className:n},r.createElement(kt,null))},dropdown:Ee,html:function(e){var t=e.value,n=e.className,i=e.mobile,a=void 0!==i&&i,s=e.isDropdownItem,u=void 0!==s&&s,l=u?"li":"div";return r.createElement(l,{className:(0,o.Z)({navbar__item:!a&&!u,"menu__list-item":a},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){var t=e.docId,n=e.label,o=e.docsPluginId,i=(0,k.Z)(e,Tt),a=(0,xt.Iw)(o).activeDoc,u=(0,Ct.vY)(t,o);return null===u?null:r.createElement(pe,(0,s.Z)({exact:!0},i,{isActive:function(){return(null==a?void 0:a.path)===u.path||!(null==a||!a.sidebar)&&a.sidebar===u.sidebar},label:null!=n?n:u.id,to:u.path}))},docSidebar:function(e){var t=e.sidebarId,n=e.label,o=e.docsPluginId,i=(0,k.Z)(e,Lt),a=(0,xt.Iw)(o).activeDoc,u=(0,Ct.oz)(t,o).link;if(!u)throw new Error('DocSidebarNavbarItem: Sidebar with ID "'+t+"\" doesn't have anything to be linked to.");return r.createElement(pe,(0,s.Z)({exact:!0},i,{isActive:function(){return(null==a?void 0:a.sidebar)===t},label:null!=n?n:u.label,to:u.path}))},docsVersion:function(e){var t=e.label,n=e.to,o=e.docsPluginId,i=(0,k.Z)(e,At),a=(0,Ct.lO)(o)[0],u=null!=t?t:a.label,l=null!=n?n:function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))}(a).path;return r.createElement(pe,(0,s.Z)({},i,{label:u,to:l}))},docsVersionDropdown:function(e){var t=e.mobile,n=e.docsPluginId,o=e.dropdownActiveClassDisabled,i=e.dropdownItemsBefore,a=e.dropdownItemsAfter,c=(0,k.Z)(e,Dt),d=(0,u.TH)(),f=d.search,p=d.hash,h=(0,xt.Iw)(n),m=(0,xt.gB)(n),g=(0,Oe.J)(n).savePreferredVersionName,v=m.map((function(e){var t,n=null!=(t=h.alternateDocVersions[e.name])?t:Rt(e);return{label:e.label,to:""+n.path+f+p,isActive:function(){return e===h.activeVersion},onClick:function(){return g(e.name)}}})),b=[].concat(i,v,a),y=(0,Ct.lO)(n)[0],w=t&&b.length>1?(0,l.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):y.label,_=t&&b.length>1?void 0:Rt(y).path;return b.length<=1?r.createElement(pe,(0,s.Z)({},c,{mobile:t,label:w,to:_,isActive:o?function(){return!1}:void 0})):r.createElement(Ee,(0,s.Z)({},c,{mobile:t,label:w,to:_,items:b,isActive:o?function(){return!1}:void 0}))}},Pt=["type"];function Ot(e){var t=e.type,n=(0,k.Z)(e,Pt),o=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),i=Nt[o];if(!i)throw new Error('No NavbarItem component found for type "'+t+'".');return r.createElement(i,n)}function It(){var e=(0,O.e)(),t=(0,w.L)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map((function(t,n){return r.createElement(Ot,(0,s.Z)({mobile:!0},t,{onClick:function(){return e.toggle()},key:n}))})))}function Ft(e){return r.createElement("button",(0,s.Z)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(l.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function Mt(){var e=0===(0,w.L)().navbar.items.length,t=U();return r.createElement(r.Fragment,null,!e&&r.createElement(Ft,{onClick:function(){return t.hide()}}),t.content)}function jt(){var e,t=(0,O.e)();return void 0===(e=t.shown)&&(e=!0),(0,r.useEffect)((function(){return document.body.style.overflow=e?"hidden":"visible",function(){document.body.style.overflow="visible"}}),[e]),t.shouldRender?r.createElement(q,{header:r.createElement(ee,null),primaryMenu:r.createElement(It,null),secondaryMenu:r.createElement(Mt,null)}):null}var Bt="navbarHideable_ZrnO",zt="navbarHidden_mY0E";function Ut(e){return r.createElement("div",(0,s.Z)({role:"presentation"},e,{className:(0,o.Z)("navbar-sidebar__backdrop",e.className)}))}function qt(e){var t=e.children,n=(0,w.L)().navbar,i=n.hideOnScroll,a=n.style,s=(0,O.e)(),u=function(e){var t=(0,r.useState)(e),n=t[0],o=t[1],i=(0,r.useRef)(!1),a=(0,r.useRef)(0),s=(0,r.useCallback)((function(e){null!==e&&(a.current=e.getBoundingClientRect().height)}),[]);return(0,I.RF)((function(t,n){var r=t.scrollY;if(e)if(r=s?o(!1):r+l0&&r.createElement(an,{links:n}),logo:o&&r.createElement(cn,{logo:o}),copyright:t&&r.createElement(dn,{copyright:t})})}var hn=r.memo(pn),mn=n(9279),gn="docusaurus.tab.",vn=r.createContext(void 0);var bn=(0,F.Qc)([Z.S,_.pl,function(e){var t=e.children,n=function(){var e=(0,r.useState)({}),t=e[0],n=e[1],o=(0,r.useCallback)((function(e,t){(0,mn.W)(""+gn+e).set(t)}),[]);(0,r.useEffect)((function(){try{var e={};(0,mn._)().forEach((function(t){if(t.startsWith(gn)){var n=t.substring(gn.length);e[n]=(0,mn.W)(t).get()}})),n(e)}catch(t){console.error(t)}}),[]);var i=(0,r.useCallback)((function(e,t){n((function(n){var r;return Object.assign({},n,((r={})[e]=t,r))})),o(e,t)}),[o]);return(0,r.useMemo)((function(){return{tabGroupChoices:t,setTabGroupChoices:i}}),[t,i])}();return r.createElement(vn.Provider,{value:n},t)},I.OC,Oe.L5,a.VC,function(e){var t=e.children;return r.createElement(M.n2,null,r.createElement(O.M,null,r.createElement(B,null,t)))}]);function yn(e){var t=e.children;return r.createElement(bn,null,t)}function wn(e){var t=e.error,n=e.tryAgain;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(l.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("p",null,t.message),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},r.createElement(l.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again when the page crashed"},"Try again"))))))}var _n="mainWrapper_bzSE";function kn(e){var t=e.children,n=e.noFooter,s=e.wrapperClassName,u=e.title,l=e.description;return(0,v.t)(),r.createElement(yn,null,r.createElement(a.d,{title:u,description:l}),r.createElement(y,null),r.createElement(P,null),r.createElement(Kt,null),r.createElement("div",{id:d,className:(0,o.Z)(g.k.wrapper.main,_n,s)},r.createElement(i.Z,{fallback:function(e){return r.createElement(wn,e)}},t)),!n&&r.createElement(hn,null))}},3696:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(9375),o=n(8933),i=n(1987),a=n(2590),s=n(1244),u=n(1109),l=n(2564),c=n(3677),d=["imageClassName","titleClassName"];function f(e){var t=e.logo,n=e.alt,r=e.imageClassName,o={light:(0,s.Z)(t.src),dark:(0,s.Z)(t.srcDark||t.src)},a=i.createElement(c.Z,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?i.createElement("div",{className:r},a):a}function p(e){var t,n=(0,u.Z)().siteConfig.title,c=(0,l.L)().navbar,p=c.title,h=c.logo,m=e.imageClassName,g=e.titleClassName,v=(0,o.Z)(e,d),b=(0,s.Z)((null==h?void 0:h.href)||"/"),y=p?"":n,w=null!=(t=null==h?void 0:h.alt)?t:y;return i.createElement(a.Z,(0,r.Z)({to:b},v,(null==h?void 0:h.target)&&{target:h.target}),h&&i.createElement(f,{logo:h,alt:w,imageClassName:m}),null!=p&&i.createElement("b",{className:g},p))}},4674:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1987),o=n(1367);function i(e){var t=e.locale,n=e.version,i=e.tag,a=t;return r.createElement(o.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),i&&r.createElement("meta",{name:"docusaurus_tag",content:i}),a&&r.createElement("meta",{name:"docsearch:language",content:a}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),i&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:i}))}},3677:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(9375),o=n(8933),i=n(1987),a=n(1892),s=n(1316),u=n(59),l={themedImage:"themedImage_GQa0","themedImage--light":"themedImage--light_Yrkz","themedImage--dark":"themedImage--dark_nmEM"},c=["sources","className","alt"];function d(e){var t=(0,s.Z)(),n=(0,u.I)().colorMode,d=e.sources,f=e.className,p=e.alt,h=(0,o.Z)(e,c),m=t?"dark"===n?["dark"]:["light"]:["light","dark"];return i.createElement(i.Fragment,null,m.map((function(e){return i.createElement("img",(0,r.Z)({key:e,src:d[e],alt:p,className:(0,a.Z)(l.themedImage,l["themedImage--"+e],f)},h))})))}},4365:function(e,t,n){"use strict";n.d(t,{u:function(){return l},z:function(){return v}});var r=n(9375),o=n(8933),i=n(1987),a=n(6153),s=["collapsed"],u=["lazy"];function l(e){var t=e.initialState,n=(0,i.useState)(null!=t&&t),r=n[0],o=n[1],a=(0,i.useCallback)((function(){o((function(e){return!e}))}),[]);return{collapsed:r,setCollapsed:o,toggleCollapsed:a}}var c={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function f(e,t){var n=t?c:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function p(e){var t=e.collapsibleRef,n=e.collapsed,r=e.animation,o=(0,i.useRef)(!1);(0,i.useEffect)((function(){var e,i=t.current;function a(){var e,t,n=i.scrollHeight,o=null!=(e=null==r?void 0:r.duration)?e:function(e){var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}(n);return{transition:"height "+o+"ms "+(null!=(t=null==r?void 0:r.easing)?t:"ease-in-out"),height:n+"px"}}function s(){var e=a();i.style.transition=e.transition,i.style.height=e.height}if(!o.current)return f(i,n),void(o.current=!0);return i.style.willChange="height",e=requestAnimationFrame((function(){n?(s(),requestAnimationFrame((function(){i.style.height=c.height,i.style.overflow=c.overflow}))):(i.style.display="block",requestAnimationFrame((function(){s()})))})),function(){return cancelAnimationFrame(e)}}),[t,n,r])}function h(e){if(!a.Z.canUseDOM)return e?c:d}function m(e){var t=e.as,n=void 0===t?"div":t,r=e.collapsed,o=e.children,a=e.animation,s=e.onCollapseTransitionEnd,u=e.className,l=e.disableSSRStyle,c=(0,i.useRef)(null);return p({collapsibleRef:c,collapsed:r,animation:a}),i.createElement(n,{ref:c,style:l?void 0:h(r),onTransitionEnd:function(e){"height"===e.propertyName&&(f(c.current,r),null==s||s(r))},className:u},o)}function g(e){var t=e.collapsed,n=(0,o.Z)(e,s),a=(0,i.useState)(!t),u=a[0],l=a[1],c=(0,i.useState)(t),d=c[0],f=c[1];return(0,i.useLayoutEffect)((function(){t||l(!0)}),[t]),(0,i.useLayoutEffect)((function(){u&&f(t)}),[u,t]),u?i.createElement(m,(0,r.Z)({},n,{collapsed:d})):null}function v(e){var t=e.lazy,n=(0,o.Z)(e,u),r=t?g:m;return i.createElement(r,n)}},9716:function(e,t,n){"use strict";n.d(t,{nT:function(){return h},pl:function(){return p}});var r=n(1987),o=n(1316),i=n(9279),a=n(2382),s=n(2564),u=(0,i.W)("docusaurus.announcement.dismiss"),l=(0,i.W)("docusaurus.announcement.id"),c=function(){return"true"===u.get()},d=function(e){return u.set(String(e))},f=r.createContext(null);function p(e){var t=e.children,n=function(){var e=(0,s.L)().announcementBar,t=(0,o.Z)(),n=(0,r.useState)((function(){return!!t&&c()})),i=n[0],a=n[1];(0,r.useEffect)((function(){a(c())}),[]);var u=(0,r.useCallback)((function(){d(!0),a(!0)}),[]);return(0,r.useEffect)((function(){if(e){var t=e.id,n=l.get();"annoucement-bar"===n&&(n="announcement-bar");var r=t!==n;l.set(t),r&&d(!1),!r&&c()||a(!1)}}),[e]),(0,r.useMemo)((function(){return{isActive:!!e&&!i,close:u}}),[e,i,u])}();return r.createElement(f.Provider,{value:n},t)}function h(){var e=(0,r.useContext)(f);if(!e)throw new a.i6("AnnouncementBarProvider");return e}},59:function(e,t,n){"use strict";n.d(t,{I:function(){return g},S:function(){return m}});var r=n(1987),o=n(6153),i=n(2382),a=n(9279),s=n(2564),u=r.createContext(void 0),l="theme",c=(0,a.W)(l),d="light",f="dark",p=function(e){return e===f?f:d};function h(){var e=(0,s.L)().colorMode,t=e.defaultMode,n=e.disableSwitch,i=e.respectPrefersColorScheme,a=(0,r.useState)(function(e){return o.Z.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e)}(t)),u=a[0],h=a[1];(0,r.useEffect)((function(){n&&c.del()}),[n]);var m=(0,r.useCallback)((function(e,n){void 0===n&&(n={});var r=n.persist,o=void 0===r||r;e?(h(e),o&&function(e){c.set(p(e))}(e)):(h(i?window.matchMedia("(prefers-color-scheme: dark)").matches?f:d:t),c.del())}),[i,t]);(0,r.useEffect)((function(){document.documentElement.setAttribute("data-theme",p(u))}),[u]),(0,r.useEffect)((function(){if(!n){var e=function(e){if(e.key===l){var t=c.get();null!==t&&m(p(t))}};return window.addEventListener("storage",e),function(){return window.removeEventListener("storage",e)}}}),[n,m]);var g=(0,r.useRef)(!1);return(0,r.useEffect)((function(){if(!n||i){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=function(){window.matchMedia("print").matches||g.current?g.current=window.matchMedia("print").matches:m(null)};return e.addListener(t),function(){return e.removeListener(t)}}}),[m,n,i]),(0,r.useMemo)((function(){return{colorMode:u,setColorMode:m,get isDarkTheme(){return u===f},setLightTheme:function(){m(d)},setDarkTheme:function(){m(f)}}}),[u,m])}function m(e){var t=e.children,n=h();return r.createElement(u.Provider,{value:n},t)}function g(){var e=(0,r.useContext)(u);if(null==e)throw new i.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},2832:function(e,t,n){"use strict";n.d(t,{J:function(){return y},L5:function(){return v}});var r=n(1987),o=n(1236),i=n(5800),a=n(2564),s=n(2532),u=n(2382),l=n(9279),c=function(e){return"docs-preferred-version-"+e},d=function(e,t,n){(0,l.W)(c(e),{persistence:t}).set(n)},f=function(e,t){return(0,l.W)(c(e),{persistence:t}).get()},p=function(e,t){(0,l.W)(c(e),{persistence:t}).del()};var h=r.createContext(null);function m(){var e=(0,o._r)(),t=(0,a.L)().docs.versionPersistence,n=(0,r.useMemo)((function(){return Object.keys(e)}),[e]),i=(0,r.useState)((function(){return function(e){return Object.fromEntries(e.map((function(e){return[e,{preferredVersionName:null}]})))}(n)})),s=i[0],u=i[1];return(0,r.useEffect)((function(){u(function(e){var t=e.pluginIds,n=e.versionPersistence,r=e.allDocsData;return Object.fromEntries(t.map((function(e){return[e,(t=e,o=f(t,n),r[t].versions.some((function(e){return e.name===o}))?{preferredVersionName:o}:(p(t,n),{preferredVersionName:null}))];var t,o})))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]),[s,(0,r.useMemo)((function(){return{savePreferredVersion:function(e,n){d(e,t,n),u((function(t){var r;return Object.assign({},t,((r={})[e]={preferredVersionName:n},r))}))}}}),[t])]}function g(e){var t=e.children,n=m();return r.createElement(h.Provider,{value:n},t)}function v(e){var t=e.children;return s.cE?r.createElement(g,null,t):r.createElement(r.Fragment,null,t)}function b(){var e=(0,r.useContext)(h);if(!e)throw new u.i6("DocsPreferredVersionContextProvider");return e}function y(e){var t;void 0===e&&(e=i.m);var n=(0,o.zh)(e),a=b(),s=a[0],u=a[1],l=s[e].preferredVersionName;return{preferredVersion:null!=(t=n.versions.find((function(e){return e.name===l})))?t:null,savePreferredVersionName:(0,r.useCallback)((function(t){u.savePreferredVersion(e,t)}),[u,e])}}},7890:function(e,t,n){"use strict";n.d(t,{V:function(){return u},b:function(){return s}});var r=n(1987),o=n(2382),i=Symbol("EmptyContext"),a=r.createContext(i);function s(e){var t=e.children,n=e.name,o=e.items,i=(0,r.useMemo)((function(){return n&&o?{name:n,items:o}:null}),[n,o]);return r.createElement(a.Provider,{value:i},t)}function u(){var e=(0,r.useContext)(a);if(e===i)throw new o.i6("DocsSidebarProvider");return e}},4773:function(e,t,n){"use strict";n.d(t,{M:function(){return f},e:function(){return p}});var r=n(1987),o=n(3799),i=n(1214),a=n(4593),s=n(2382);function u(e){!function(e){var t=(0,a.k6)(),n=(0,s.zX)(e);(0,r.useEffect)((function(){return t.block((function(e,t){return n(e,t)}))}),[t,n])}((function(t,n){if("POP"===n)return e(t,n)}))}var l=n(2564),c=r.createContext(void 0);function d(){var e,t=(e=(0,o.HY)(),0===(0,l.L)().navbar.items.length&&!e.component),n=(0,i.i)(),a=!t&&"mobile"===n,s=(0,r.useState)(!1),c=s[0],d=s[1];u((function(){if(c)return d(!1),!1}));var f=(0,r.useCallback)((function(){d((function(e){return!e}))}),[]);return(0,r.useEffect)((function(){"desktop"===n&&d(!1)}),[n]),(0,r.useMemo)((function(){return{disabled:t,shouldRender:a,toggle:f,shown:c}}),[t,a,f,c])}function f(e){var t=e.children,n=d();return r.createElement(c.Provider,{value:n},t)}function p(){var e=r.useContext(c);if(void 0===e)throw new s.i6("NavbarMobileSidebarProvider");return e}},3799:function(e,t,n){"use strict";n.d(t,{HY:function(){return s},Zo:function(){return u},n2:function(){return a}});var r=n(1987),o=n(2382),i=r.createContext(null);function a(e){var t=e.children,n=(0,r.useState)({component:null,props:null});return r.createElement(i.Provider,{value:n},t)}function s(){var e=(0,r.useContext)(i);if(!e)throw new o.i6("NavbarSecondaryMenuContentProvider");return e[0]}function u(e){var t=e.component,n=e.props,a=(0,r.useContext)(i);if(!a)throw new o.i6("NavbarSecondaryMenuContentProvider");var s=a[1],u=(0,o.Ql)(n);return(0,r.useEffect)((function(){s({component:t,props:u})}),[s,t,u]),(0,r.useEffect)((function(){return function(){return s({component:null,props:null})}}),[s]),null}},4135:function(e,t,n){"use strict";n.d(t,{h:function(){return o},t:function(){return i}});var r=n(1987),o="navigation-with-keyboard";function i(){(0,r.useEffect)((function(){function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(o),"mousedown"===e.type&&document.body.classList.remove(o)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),function(){document.body.classList.remove(o),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},1214:function(e,t,n){"use strict";n.d(t,{i:function(){return l}});var r=n(1987),o=n(6153),i="desktop",a="mobile",s="ssr";function u(){return o.Z.canUseDOM?window.innerWidth>996?i:a:s}function l(){var e=(0,r.useState)((function(){return u()})),t=e[0],n=e[1];return(0,r.useEffect)((function(){function e(){n(u())}return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),clearTimeout(undefined)}}),[]),t}},4358:function(e,t,n){"use strict";n.d(t,{k:function(){return r}});var r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",admonitionType:function(e){return"theme-admonition-"+e}},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:function(e){return"theme-doc-sidebar-item-category-level-"+e},docSidebarItemLinkLevel:function(e){return"theme-doc-sidebar-item-link-level-"+e}},blog:{}}},2532:function(e,t,n){"use strict";n.d(t,{Wl:function(){return p},_F:function(){return m},cE:function(){return f},hI:function(){return _},lO:function(){return b},vY:function(){return w},oz:function(){return y},s1:function(){return v}});var r=n(2551),o=n(1987),i=n(4593),a=n(1158),s=n(1236),u=n(2832),l=n(7890);function c(e){return Array.from(new Set(e))}var d=n(2413),f=!!s._r;function p(e){if(e.href)return e.href;for(var t,n=(0,r.Z)(e.items);!(t=n()).done;){var o=t.value;if("link"===o.type)return o.href;if("category"===o.type){var i=p(o);if(i)return i}}}var h=function(e,t){return void 0!==e&&(0,d.Mg)(e,t)};function m(e,t){return"link"===e.type?h(e.href,t):"category"===e.type&&(h(e.href,t)||function(e,t){return e.some((function(e){return m(e,t)}))}(e.items,t))}function g(e){var t=e.sidebarItems,n=e.pathname,o=e.onlyCategories,i=void 0!==o&&o,a=[];return function e(t){for(var o,s=(0,r.Z)(t);!(o=s()).done;){var u=o.value;if("category"===u.type&&((0,d.Mg)(u.href,n)||e(u.items))||"link"===u.type&&(0,d.Mg)(u.href,n))return i&&"category"!==u.type||a.unshift(u),!0}return!1}(t),a}function v(){var e,t=(0,l.V)(),n=(0,i.TH)().pathname;return!1!==(null==(e=(0,s.gA)())?void 0:e.pluginData.breadcrumbs)&&t?g({sidebarItems:t.items,pathname:n}):null}function b(e){var t=(0,s.Iw)(e).activeVersion,n=(0,u.J)(e).preferredVersion,r=(0,s.yW)(e);return(0,o.useMemo)((function(){return c([t,n,r].filter(Boolean))}),[t,n,r])}function y(e,t){var n=b(t);return(0,o.useMemo)((function(){var t=n.flatMap((function(e){return e.sidebars?Object.entries(e.sidebars):[]})),r=t.find((function(t){return t[0]===e}));if(!r)throw new Error("Can't find any sidebar with id \""+e+'" in version'+(n.length>1?"s":"")+" "+n.map((function(e){return e.name})).join(", ")+'".\n Available sidebar ids are:\n - '+Object.keys(t).join("\n- "));return r[1]}),[e,n])}function w(e,t){var n=b(t);return(0,o.useMemo)((function(){var t=n.flatMap((function(e){return e.docs})),r=t.find((function(t){return t.id===e}));if(!r){if(n.flatMap((function(e){return e.draftIds})).includes(e))return null;throw new Error("DocNavbarItem: couldn't find any doc with id \""+e+'" in version'+(n.length>1?"s":"")+" "+n.map((function(e){return e.name})).join(", ")+'".\nAvailable doc ids are:\n- '+c(t.map((function(e){return e.id}))).join("\n- "))}return r}),[e,n])}function _(e){var t=e.route,n=e.versionMetadata,r=(0,i.TH)(),o=t.routes,s=o.find((function(e){return(0,i.LX)(r.pathname,e)}));if(!s)return null;var u=s.sidebar,l=u?n.docsSidebars[u]:void 0;return{docElement:(0,a.H)(o),sidebarName:u,sidebarItems:l}}},3930:function(e,t,n){"use strict";n.d(t,{FG:function(){return f},d:function(){return c},VC:function(){return p}});var r=n(1987),o=n(1892),i=n(1367),a=n(5673);function s(){var e=r.useContext(a._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var u=n(1244),l=n(1109);function c(e){var t=e.title,n=e.description,o=e.keywords,a=e.image,s=e.children,c=function(e){var t=(0,l.Z)().siteConfig,n=t.title,r=t.titleDelimiter;return null!=e&&e.trim().length?e.trim()+" "+r+" "+n:n}(t),d=(0,u.C)().withBaseUrl,f=a?d(a,{absolute:!0}):void 0;return r.createElement(i.Z,null,t&&r.createElement("title",null,c),t&&r.createElement("meta",{property:"og:title",content:c}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),o&&r.createElement("meta",{name:"keywords",content:Array.isArray(o)?o.join(","):o}),f&&r.createElement("meta",{property:"og:image",content:f}),f&&r.createElement("meta",{name:"twitter:image",content:f}),s)}var d=r.createContext(void 0);function f(e){var t=e.className,n=e.children,a=r.useContext(d),s=(0,o.Z)(a,t);return r.createElement(d.Provider,{value:s},r.createElement(i.Z,null,r.createElement("html",{className:s})),n)}function p(e){var t=e.children,n=s(),i="plugin-"+n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,""),a="plugin-id-"+n.plugin.id;return r.createElement(f,{className:(0,o.Z)(i,a)},t)}},2382:function(e,t,n){"use strict";n.d(t,{i6:function(){return h},Qc:function(){return g},zX:function(){return f},D9:function(){return p},Ql:function(){return m}});var r=n(1938),o=n(5318);function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}var a=n(4085);function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function u(e,t,n){return u=s()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&(0,a.Z)(o,n.prototype),o},u.apply(null,arguments)}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,i(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,a.Z)(r,e)},l(e)}var c=n(1987),d=n(6153).Z.canUseDOM?c.useLayoutEffect:c.useEffect;function f(e){var t=(0,c.useRef)(e);return d((function(){t.current=e}),[e]),(0,c.useCallback)((function(){return t.current.apply(t,arguments)}),[])}function p(e){var t=(0,c.useRef)();return d((function(){t.current=e})),t.current}var h=function(e){function t(t,n){var o,i,a,s,u;return(u=e.call(this)||this).name="ReactContextError",u.message="Hook "+(null!=(o=null==(i=u.stack)||null==(a=i.split("\n")[1])||null==(s=a.match((0,r.Z)(/at (?:\w+\.)?(\w+)/,{name:1})))?void 0:s.groups.name)?o:"")+" is called outside the <"+t+">. "+(null!=n?n:""),u}return(0,o.Z)(t,e),t}(l(Error));function m(e){var t=Object.entries(e);return t.sort((function(e,t){return e[0].localeCompare(t[0])})),(0,c.useMemo)((function(){return e}),t.flat())}function g(e){return function(t){var n=t.children;return c.createElement(c.Fragment,null,e.reduceRight((function(e,t){return c.createElement(t,null,e)}),n))}}},2413:function(e,t,n){"use strict";n.d(t,{Mg:function(){return a},Ns:function(){return s}});var r=n(1987),o=n(2811),i=n(1109);function a(e,t){var n=function(e){var t;return null==(t=!e||e.endsWith("/")?e:e+"/")?void 0:t.toLowerCase()};return n(e)===n(t)}function s(){var e=(0,i.Z)().siteConfig.baseUrl;return(0,r.useMemo)((function(){return function(e){var t=e.baseUrl;function n(e){return e.path===t&&!0===e.exact}function r(e){return e.path===t&&!e.exact}return function e(t){if(0!==t.length)return t.find(n)||e(t.filter(r).flatMap((function(e){var t;return null!=(t=e.routes)?t:[]})))}(e.routes)}({routes:o.Z,baseUrl:e})}),[e])}},9693:function(e,t,n){"use strict";n.d(t,{Ct:function(){return f},OC:function(){return u},RF:function(){return d}});var r=n(1987),o=n(6153),i=n(1316),a=n(2382);var s=r.createContext(void 0);function u(e){var t,n=e.children,o=(t=(0,r.useRef)(!0),(0,r.useMemo)((function(){return{scrollEventsEnabledRef:t,enableScrollEvents:function(){t.current=!0},disableScrollEvents:function(){t.current=!1}}}),[]));return r.createElement(s.Provider,{value:o},n)}function l(){var e=(0,r.useContext)(s);if(null==e)throw new a.i6("ScrollControllerProvider");return e}var c=function(){return o.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null};function d(e,t){void 0===t&&(t=[]);var n=l().scrollEventsEnabledRef,o=(0,r.useRef)(c()),i=(0,a.zX)(e);(0,r.useEffect)((function(){var e=function(){if(n.current){var e=c();i(e,o.current),o.current=e}},t={passive:!0};return e(),window.addEventListener("scroll",e,t),function(){return window.removeEventListener("scroll",e,t)}}),[i,n].concat(t))}function f(){var e=(0,r.useRef)(null),t=(0,i.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:function(n){e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),function(){}}(n):function(e){var t=null,n=document.documentElement.scrollTop>e;return function r(){var o=document.documentElement.scrollTop;(n&&o>e||!n&&oc.length?e(o.substr(c.length),d):n.push(d),u=!0}else for(var f=c.length-1;f>s;f-=1){var p=c.substr(0,f);if(o.substr(0,f)===p){s=f;var h={missed:i.missed,term:i.term.concat({value:p,trailing:!0})};o.length>f?e(o.substr(f),h):n.push(h),u=!0;break}}}u||(o.length>0?e(o.substr(1),{missed:i.missed+1,term:i.term}):i.term.length>0&&n.push(i))}(e,{missed:0,term:[]}),n.sort((function(e,t){var n=e.missed>0?1:0,r=t.missed>0?1:0;return n!==r?n-r:e.term.length-t.term.length})).map((function(e){return e.term}))}(a,t),l=(0,r.Z)(u);!(s=l()).done;){var c=s.value,d=i.concat.apply(i,c);e(o.slice(1),d)}else{var f=i.concat({value:a});e(o.slice(1),f)}}else n.push(i)}(e,[]),n}var s=n(1473);function u(e){return l(e).concat(l(e.filter((function(e){var t=e[e.length-1];return!t.trailing&&t.maybeTyping})),!0))}function l(e,t){return e.map((function(e){return{tokens:e.map((function(e){return e.value})),term:e.map((function(e){return{value:e.value,presence:i().Query.presence.REQUIRED,wildcard:(t?e.trailing||e.maybeTyping:e.trailing)?i().Query.wildcard.TRAILING:i().Query.wildcard.NONE}}))}}))}function c(e,t,n){return function(o,l){var c=function(e,t){if(1===t.length&&["ja","jp","th"].includes(t[0]))return i()[t[0]].tokenizer(e).map((function(e){return e.toString()}));var n=/[^-\s]+/g;return t.includes("zh")&&(n=/[0-9A-Z_a-z]+|(?:[\u3400-\u4DBF\u4E00-\u9FFF\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])+/g),e.toLowerCase().match(n)||[]}(o,s.dK);if(0!==c.length){var d=function(e,t){var n=a(e,t);if(0===n.length)return[{tokens:e,term:e.map((function(e){return{value:e,presence:i().Query.presence.REQUIRED,wildcard:i().Query.wildcard.LEADING|i().Query.wildcard.TRAILING}}))}];for(var o,l=(0,r.Z)(n);!(o=l()).done;){var c=o.value;c[c.length-1].maybeTyping=!0}for(var d,f,p=[],h=(0,r.Z)(s.dK);!(d=h()).done;){var m=d.value;if("en"===m)s._k||p.unshift(i().stopWordFilter);else{var g=i()[m];g.stopWordFilter&&p.unshift(g.stopWordFilter)}}if(p.length>0){var v=function(e){return p.reduce((function(e,t){return e.filter((function(e){return t(e.value)}))}),e)};f=[];for(var b,y=[],w=(0,r.Z)(n);!(b=w()).done;){var _=b.value,k=v(_);f.push(k),k.length<_.length&&k.length>0&&y.push(k)}n.push.apply(n,y)}else f=n.slice();for(var E,S=[],x=(0,r.Z)(f);!(E=x()).done;){var C=E.value;if(C.length>2)for(var T=C.length-1;T>=0;T-=1)S.push(C.slice(0,T).concat(C.slice(T+1)))}return u(n).concat(u(S))}(c,t),f=[],p=function(){for(var t,o=h.value,i=o.term,a=o.tokens,s=function(){var o=t.value,s=o.documents,u=o.index,l=o.type;if(f.push.apply(f,u.query((function(e){for(var t,n=(0,r.Z)(i);!(t=n()).done;){var o=t.value;e.term(o.value,{wildcard:o.wildcard,presence:o.presence})}})).slice(0,n).filter((function(e){return!f.some((function(t){return t.document.i.toString()===e.ref}))})).slice(0,n-f.length).map((function(t){var n=s.find((function(e){return e.i.toString()===t.ref}));return{document:n,type:l,page:0!==l&&e[0].documents.find((function(e){return e.i===n.p})),metadata:t.matchData.metadata,tokens:a,score:t.score}}))),f.length>=n)return{v:"break|search"}},u=(0,r.Z)(e);!(t=u()).done;){var l=s();if("object"==typeof l)return l.v}};e:for(var h,m=(0,r.Z)(d);!(h=m()).done;){if("break|search"===p())break e}!function(e){e.forEach((function(e,t){e.index=t})),e.sort((function(t,n){var r=t.type>0&&t.page?e.findIndex((function(e){return e.document===t.page})):t.index,o=n.type>0&&n.page?e.findIndex((function(e){return e.document===n.page})):n.index;return-1===r&&(r=t.index),-1===o&&(o=n.index),r===o?0===t.type?-1:0===n.type?1:t.index-n.index:r-o}))}(f),function(e){e.forEach((function(t,n){n>0&&t.page&&e.some((function(e){return e.document===t.page}))&&(n/g,">").replace(/"/g,""").replace(/'/g,"'")}n.d(t,{X:function(){return r}})},1958:function(e,t,n){"use strict";function r(e,t){for(var n=[],r=0,o=Object.values(e);r=0){c>0&&s.push(i(e.substr(0,c),t)),s.push(""+(0,o.X)(e.substr(c,l.length))+"");var d=c+l.length;d"+(0,o.X)(e)+"":(0,o.X)(e):s.join("")}},3950:function(e,t,n){"use strict";n.d(t,{o:function(){return l}});var r=n(2551),o=n(3073),i=n(3754),a=/[0-9A-Z_a-z]+|(?:[\u3400-\u4DBF\u4E00-\u9FFF\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/;function s(e){for(var t=[],n=0,r=e;r.length>0;){var o=r.match(a);if(!o){t.push(r);break}o.index>0&&t.push(r.substring(0,o.index)),t.push(o[0]),n+=o.index+o[0].length,r=e.substring(n)}return t}var u=n(1473);function l(e,t,n,a){void 0===a&&(a=u.Hk);for(var l=function(e,t,n){var a=[],u=0,l=0,c=-1;for(;ul)for(var h,m=s(e.substring(l,f)).map((function(e){return{html:(0,o.X)(e),textLength:e.length}})),g=(0,r.Z)(m);!(h=g()).done;){var v=h.value;a.push(v)}-1===c&&(c=a.length),l=f+p,a.push({html:(0,i.C)(e.substring(f,l),n,!0),textLength:p})}}if(l0){var _=f.pop();g+_.textLength<=a?(h.unshift(_.html),v+=_.textLength,g+=_.textLength):(y=!0,f.length=0)}else{if(!(m.length>0))break;var k=m.shift();g+k.textLength<=a?(h.push(k.html),b+=k.textLength,g+=k.textLength):(w=!0,m.length=0)}return(y||f.length>0)&&h.unshift("\u2026"),(w||m.length>0)&&h.push("\u2026"),h.join("")}},1473:function(e,t,n){"use strict";n.d(t,{vc:function(){return o()},gQ:function(){return h},H6:function(){return c},hG:function(){return v},l9:function(){return m},dK:function(){return i},_k:function(){return a},pu:function(){return p},AY:function(){return d},t_:function(){return f},Kc:function(){return g},J:function(){return s},Hk:function(){return l},qo:function(){return u},pQ:function(){return b}});n(574);var r=n(2963),o=n.n(r),i=["en"],a=!1,s="search-index{dir}.json?_=6ef38c8b",u=8,l=50,c=!1,d=!0,f=!0,p="right",h=void 0,m=!0,g=null,v=!1,b=!1},2811:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(1987),o=n(9375),i=n(1687),a=n.n(i),s=n(6887),u={"04e58e9c":[function(){return n.e(6907).then(n.bind(n,4341))},"@site/docs/guides/tutorials/first_task.md",4341],"06c91ef7":[function(){return n.e(3610).then(n.bind(n,9976))},"@site/docs/guides/how_to_use/worker_quality/other_methods.md",9976],"0db8f33c":[function(){return n.e(4195).then(n.bind(n,474))},"@site/docs/guides/how_to_use/providers/mturk.md",474],12241291:[function(){return n.e(7294).then(n.bind(n,5433))},"@site/docs/guides/how_to_contribute/documentation.md",5433],"130db7a8":[function(){return n.e(1169).then(n.bind(n,8581))},"@site/docs/guides/how_to_contribute/db_migrations.md",8581],17896441:[function(){return Promise.all([n.e(532),n.e(9804),n.e(7918)]).then(n.bind(n,8393))},"@theme/DocItem",8393],"180e564a":[function(){return n.e(113).then(n.bind(n,3550))},"@site/docs/guides/how_to_use/providers/prolific/prolific_api_oddities.md",3550],"1a4e3797":[function(){return Promise.all([n.e(532),n.e(7920)]).then(n.bind(n,1488))},"@theme/SearchPage",1488],"1be78505":[function(){return Promise.all([n.e(532),n.e(9514)]).then(n.bind(n,1405))},"@theme/DocPage",1405],"1e6f1f82":[function(){return n.e(115).then(n.bind(n,797))},"@site/docs/guides/how_to_use/efficiency_organization/config_faq.md",797],"1f221dc3":[function(){return n.e(1295).then(n.bind(n,38))},"@site/docs/explanations/architecture_overview.md",38],"206abefe":[function(){return n.e(8122).then(n.bind(n,4238))},"@site/docs/guides/how_to_use/task_creation/task_run.md",4238],"22624bcf":[function(){return n.e(7559).then(n.bind(n,5450))},"@site/docs/reference/overview.md",5450],"24b5f35b":[function(){return n.e(7466).then(n.bind(n,7455))},"@site/docs/guides/how_to_use/form_composer/overview.md",7455],"26d8019b":[function(){return Promise.all([n.e(9926),n.e(1395)]).then(n.bind(n,3628))},"@site/docs/guides/how_to_use/worker_quality/using_onboarding.mdx",3628],28082527:[function(){return n.e(5471).then(n.t.bind(n,2776,19))},"/home/runner/work/Mephisto/Mephisto/docs/web/.docusaurus/@easyops-cn/docusaurus-search-local/default/plugin-route-context-module-100.json",2776],"31390afa":[function(){return n.e(9397).then(n.bind(n,9668))},"@site/docs/guides/how_to_use/review_app/enabling_original_unit_preview.md",9668],"34c96258":[function(){return n.e(8876).then(n.bind(n,6193))},"@site/docs/guides/how_to_use/review_app/overview.md",6193],"38464eeb":[function(){return n.e(9).then(n.bind(n,8444))},"@site/docs/guides/how_to_use/video_annotator/configuration/form_callbacks.md",8444],"3aea748f":[function(){return n.e(743).then(n.bind(n,5738))},"@site/docs/guides/how_to_use/video_annotator/configuration/multiple_annotator_versions.md",5738],"3b040f46":[function(){return n.e(1178).then(n.t.bind(n,4469,19))},"/home/runner/work/Mephisto/Mephisto/docs/web/.docusaurus/docusaurus-plugin-content-blog/default/plugin-route-context-module-100.json",4469],"3b6e281a":[function(){return n.e(1952).then(n.bind(n,7123))},"@site/docs/guides/how_to_use/video_annotator/running.md",7123],"3b75aca0":[function(){return n.e(5655).then(n.bind(n,4960))},"@site/docs/guides/how_to_use/js_packages/main.md",4960],"3ed595b0":[function(){return n.e(1123).then(n.bind(n,8239))},"@site/docs/guides/how_to_use/worker_experience/mephisto-task-addons.md",8239],"49fa51be":[function(){return n.e(6731).then(n.bind(n,4247))},"@site/docs/guides/tutorials/workflows.md",4247],"4a5271d1":[function(){return n.e(4655).then(n.bind(n,5107))},"@site/docs/guides/how_to_use/efficiency_organization/manual_installation.md",5107],"4ac0665e":[function(){return n.e(3693).then(n.bind(n,2494))},"@site/docs/explanations/abstractions_overview.md",2494],"4c113261":[function(){return n.e(7788).then(n.bind(n,7189))},"@site/docs/explanations/architect_api.md",7189],"4d370f44":[function(){return n.e(1722).then(n.bind(n,6709))},"@site/docs/guides/how_to_use/video_annotator/configuration/config_files.md",6709],"4d8b778b":[function(){return n.e(8374).then(n.bind(n,7227))},"@site/docs/guides/tutorials/custom_react.md",7227],"591df8b9":[function(){return n.e(9705).then(n.bind(n,2296))},"@site/docs/guides/how_to_use/form_composer/configuration/insertions.md",2296],"5b207c16":[function(){return n.e(3229).then(n.bind(n,5972))},"@site/docs/guides/how_to_use/worker_experience/worker_opinion.md",5972],"5cd9c2e2":[function(){return n.e(7512).then(n.t.bind(n,5745,19))},"/home/runner/work/Mephisto/Mephisto/docs/web/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745],"5e9f5e1a":[function(){return Promise.resolve().then(n.bind(n,6809))},"@generated/docusaurus.config",6809],"5ebaccee":[function(){return n.e(657).then(n.bind(n,477))},"@site/docs/guides/how_to_use/video_annotator/configuration/video_annotator_config_command.md",477],"60eb8991":[function(){return n.e(1929).then(n.bind(n,4047))},"@site/docs/guides/how_to_use/providers/prolific/prolific_python_sdk.md",4047],"6704ba13":[function(){return n.e(8618).then(n.bind(n,9317))},"@site/docs/reference/providers.md",9317],"674ee871":[function(){return n.e(7299).then(n.bind(n,5329))},"@site/docs/guides/how_to_use/worker_quality/common_qualification_flows.md",5329],"6d438615":[function(){return n.e(4839).then(n.bind(n,2134))},"@site/docs/reference/requesters.md",2134],"7282321b":[function(){return n.e(914).then(n.bind(n,3072))},"@site/docs/guides/how_to_use/form_composer/embedding.md",3072],76067106:[function(){return n.e(5128).then(n.bind(n,6067))},"@site/docs/reference/architects.md",6067],"7b7dd0fa":[function(){return n.e(714).then(n.bind(n,445))},"@site/docs/guides/how_to_use/video_annotator/configuration/setup.md",445],"7d44495e":[function(){return n.e(2908).then(n.bind(n,3645))},"@site/docs/guides/how_to_use/video_annotator/configuration/insertions.md",3645],"7d92f30b":[function(){return n.e(9293).then(n.bind(n,3063))},"@site/docs/guides/how_to_use/form_composer/configuration/form_callbacks.md",3063],"7f5eebff":[function(){return n.e(8538).then(n.bind(n,8691))},"@site/docs/guides/how_to_use/form_composer/configuration/config_files.md",8691],"814f3328":[function(){return n.e(2535).then(n.t.bind(n,5641,19))},"~blog/default/blog-post-list-prop-default.json",5641],"835a1116":[function(){return n.e(1516).then(n.bind(n,262))},"@site/docs/guides/how_to_use/data_porter/simple_usage.md",262],"84997dac":[function(){return n.e(7318).then(n.bind(n,663))},"@site/docs/guides/how_to_use/providers/prolific/intro.md",663],"873dbec9":[function(){return n.e(7658).then(n.bind(n,5914))},"@site/docs/reference/blueprints.md",5914],"878eb1f5":[function(){return n.e(5138).then(n.bind(n,7250))},"@site/docs/guides/how_to_use/video_annotator/overview.md",7250],"87ddf927":[function(){return n.e(240).then(n.t.bind(n,3769,19))},"/home/runner/work/Mephisto/Mephisto/docs/web/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",3769],"889e764e":[function(){return n.e(5466).then(n.bind(n,6969))},"@site/docs/guides/tutorials/model_in_the_loop.md",6969],89605158:[function(){return n.e(419).then(n.bind(n,8429))},"@site/docs/guides/how_to_use/task_creation/hosting_assets.md",8429],"8a1f84e3":[function(){return n.e(2955).then(n.bind(n,7175))},"@site/docs/guides/how_to_use/js_packages/custom.md",7175],91039464:[function(){return n.e(7356).then(n.bind(n,458))},"@site/docs/guides/quickstart.md",458],"92cc9b0f":[function(){return n.e(2630).then(n.bind(n,9630))},"@site/docs/guides/how_to_contribute/known_issues.md",9630],"935f2afb":[function(){return n.e(53).then(n.t.bind(n,4612,19))},"~docs/default/version-current-metadata-prop-751.json",4612],"9431363c":[function(){return n.e(8744).then(n.bind(n,2189))},"@site/blog/2022-03-22-mephisto-1.0.md?truncated=true",2189],"99593f2f":[function(){return n.e(2303).then(n.bind(n,24))},"@site/docs/guides/tutorials/form_composer.md",24],"9e4087bc":[function(){return n.e(3608).then(n.bind(n,3935))},"@theme/BlogArchivePage",3935],a02207c1:[function(){return n.e(2671).then(n.bind(n,90))},"@site/docs/guides/how_to_use/review_app/server_api.md",90],a2c7551e:[function(){return n.e(3372).then(n.bind(n,2601))},"@site/docs/guides/how_to_contribute/frontend_development.md",2601],a3144474:[function(){return n.e(4795).then(n.bind(n,5998))},"@site/docs/guides/how_to_use/form_composer/running.md",5998],a6aa9e1f:[function(){return Promise.all([n.e(532),n.e(9804),n.e(6839),n.e(3089)]).then(n.bind(n,9706))},"@theme/BlogListPage",9706],a7976ac9:[function(){return n.e(5665).then(n.bind(n,4834))},"@site/docs/guides/how_to_use/form_composer/configuration/setup.md",4834],aa23dd48:[function(){return n.e(5108).then(n.bind(n,793))},"@site/docs/guides/how_to_use/task_creation/developing_frontends.md",793],afcbdae1:[function(){return n.e(3916).then(n.bind(n,3739))},"@site/docs/guides/how_to_use/efficiency_organization/docker.md",3739],b026c61a:[function(){return Promise.all([n.e(9926),n.e(6743)]).then(n.bind(n,352))},"@site/docs/guides/how_to_use/worker_quality/using_screen_units.mdx",352],b0f9abb1:[function(){return n.e(2945).then(n.bind(n,4468))},"@site/docs/guides/how_to_use/efficiency_organization/metrics_dashboard.md",4468],b26c62c0:[function(){return n.e(1107).then(n.bind(n,8234))},"@site/docs/guides/how_to_use/data_porter/reference.md",8234],b2b675dd:[function(){return n.e(533).then(n.t.bind(n,8017,19))},"~blog/default/blog-c06.json",8017],b2f554cd:[function(){return n.e(1477).then(n.t.bind(n,10,19))},"~blog/default/blog-archive-80c.json",10],b7aec231:[function(){return n.e(1430).then(n.bind(n,1400))},"@site/docs/guides/how_to_contribute/getting_started.md",1400],b8d65bcf:[function(){return n.e(6454).then(n.bind(n,2363))},"@site/docs/guides/how_to_use/form_composer/configuration/form_composer_config_command.md",2363],bde6ce88:[function(){return n.e(1927).then(n.bind(n,4296))},"@site/docs/guides/tutorials/review_app.md",4296],c4f5d8e4:[function(){return Promise.all([n.e(532),n.e(4193)]).then(n.bind(n,9850))},"@site/src/pages/index.js",9850],ccc49370:[function(){return Promise.all([n.e(532),n.e(9804),n.e(6839),n.e(6103)]).then(n.bind(n,6022))},"@theme/BlogPostPage",6022],d11ed460:[function(){return n.e(7175).then(n.bind(n,6283))},"@site/docs/guides/how_to_use/review_app/running.md",6283],d2b8a042:[function(){return n.e(9555).then(n.bind(n,6860))},"@site/docs/guides/how_to_use/data_porter/custom_conflict_resolver.md",6860],d4b9235d:[function(){return n.e(3548).then(n.bind(n,5060))},"@site/docs/reference/tasks.md",5060],d6b09d75:[function(){return n.e(6556).then(n.bind(n,3910))},"@site/docs/guides/how_to_use/review_app/diagram.md",3910],d6c92909:[function(){return n.e(8487).then(n.bind(n,2693))},"@site/docs/guides/how_to_use/efficiency_organization/reusing_configs.md",2693],d905b8f0:[function(){return n.e(6628).then(n.bind(n,7243))},"@site/docs/guides/how_to_use/worker_quality/using_golds.md",7243],dee53823:[function(){return n.e(4284).then(n.bind(n,6252))},"@site/docs/guides/how_to_use/providers/prolific/eligibility_requirements.md",6252],e1ddd029:[function(){return n.e(5603).then(n.bind(n,531))},"@site/docs/guides/how_to_contribute/backend_development.md",531],e771321a:[function(){return n.e(469).then(n.bind(n,5278))},"@site/blog/2022-03-22-mephisto-1.0.md",5278],eed7a257:[function(){return n.e(1936).then(n.bind(n,3675))},"@site/docs/guides/how_to_use/review_app/enabling_responses_histogram.md",3675],f5e01c1b:[function(){return n.e(6231).then(n.bind(n,8898))},"@site/docs/guides/how_to_use/video_annotator/embedding.md",8898],f6f0f47f:[function(){return n.e(9988).then(n.bind(n,5346))},"@site/docs/guides/how_to_use/form_composer/configuration/multiple_form_versions.md",5346],fa2c376f:[function(){return n.e(8299).then(n.bind(n,7427))},"@site/docs/guides/how_to_use/worker_quality/managing_worker_qualifications.md",7427],ff1b5b1d:[function(){return n.e(8440).then(n.bind(n,9133))},"@site/docs/guides/how_to_use/providers/prolific/running_study.md",9133],ffe02791:[function(){return n.e(1457).then(n.bind(n,1720))},"@site/docs/guides/tutorials/worker_controls.md",1720]};function l(e){var t=e.error,n=e.retry,o=e.pastDelay;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):o?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var c=n(6925),d=n(5673);function f(e,t){if("*"===e)return a()({loading:l,loader:function(){return n.e(7273).then(n.bind(n,7273))},modules:["@theme/NotFound"],webpack:function(){return[7273]},render:function(e,t){var n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});var i=s[e+"-"+t],f={},p=[],h=[],m=(0,c.Z)(i);return Object.entries(m).forEach((function(e){var t=e[0],n=e[1],r=u[n];r&&(f[t]=r[0],p.push(r[1]),h.push(r[2]))})),a().Map({loading:l,loader:f,modules:p,webpack:function(){return h},render:function(t,n){var a=JSON.parse(JSON.stringify(i));Object.entries(t).forEach((function(t){var n=t[0],r=t[1],o=r.default;if(!o)throw new Error("The page component at "+e+" doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.");"object"!=typeof o&&"function"!=typeof o||Object.keys(r).filter((function(e){return"default"!==e})).forEach((function(e){o[e]=r[e]}));var i=a,s=n.split(".");s.slice(0,-1).forEach((function(e){i=i[e]})),i[s[s.length-1]]=o}));var s=a.__comp;delete a.__comp;var u=a.__context;return delete a.__context,r.createElement(d.z,{value:u},r.createElement(s,(0,o.Z)({},a,n)))}})}var p=[{path:"/blog/",component:f("/blog/","f8a"),exact:!0},{path:"/blog/2022/03/22/mephisto-1.0/",component:f("/blog/2022/03/22/mephisto-1.0/","72b"),exact:!0},{path:"/blog/archive/",component:f("/blog/archive/","28a"),exact:!0},{path:"/search/",component:f("/search/","ef4"),exact:!0},{path:"/docs/",component:f("/docs/","bdf"),routes:[{path:"/docs/explanations/abstractions_overview/",component:f("/docs/explanations/abstractions_overview/","071"),exact:!0,sidebar:"explanations"},{path:"/docs/explanations/architect_api/",component:f("/docs/explanations/architect_api/","d73"),exact:!0,sidebar:"explanations"},{path:"/docs/explanations/architecture_overview/",component:f("/docs/explanations/architecture_overview/","ba8"),exact:!0,sidebar:"explanations"},{path:"/docs/guides/how_to_contribute/backend_development/",component:f("/docs/guides/how_to_contribute/backend_development/","963"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/db_migrations/",component:f("/docs/guides/how_to_contribute/db_migrations/","300"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/documentation/",component:f("/docs/guides/how_to_contribute/documentation/","4e9"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/frontend_development/",component:f("/docs/guides/how_to_contribute/frontend_development/","1e1"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/getting_started/",component:f("/docs/guides/how_to_contribute/getting_started/","819"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_contribute/known_issues/",component:f("/docs/guides/how_to_contribute/known_issues/","7fe"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/data_porter/custom_conflict_resolver/",component:f("/docs/guides/how_to_use/data_porter/custom_conflict_resolver/","09d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/data_porter/reference/",component:f("/docs/guides/how_to_use/data_porter/reference/","8e1"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/data_porter/simple_usage/",component:f("/docs/guides/how_to_use/data_porter/simple_usage/","123"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/config_faq/",component:f("/docs/guides/how_to_use/efficiency_organization/config_faq/","bca"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/docker/",component:f("/docs/guides/how_to_use/efficiency_organization/docker/","b9c"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/manual_installation/",component:f("/docs/guides/how_to_use/efficiency_organization/manual_installation/","12f"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/metrics_dashboard/",component:f("/docs/guides/how_to_use/efficiency_organization/metrics_dashboard/","0a4"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/efficiency_organization/reusing_configs/",component:f("/docs/guides/how_to_use/efficiency_organization/reusing_configs/","257"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/config_files/",component:f("/docs/guides/how_to_use/form_composer/configuration/config_files/","20d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/form_callbacks/",component:f("/docs/guides/how_to_use/form_composer/configuration/form_callbacks/","8e9"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/form_composer_config_command/",component:f("/docs/guides/how_to_use/form_composer/configuration/form_composer_config_command/","8e5"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/insertions/",component:f("/docs/guides/how_to_use/form_composer/configuration/insertions/","289"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/multiple_form_versions/",component:f("/docs/guides/how_to_use/form_composer/configuration/multiple_form_versions/","d21"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/configuration/setup/",component:f("/docs/guides/how_to_use/form_composer/configuration/setup/","18c"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/embedding/",component:f("/docs/guides/how_to_use/form_composer/embedding/","6a6"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/overview/",component:f("/docs/guides/how_to_use/form_composer/overview/","c27"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/form_composer/running/",component:f("/docs/guides/how_to_use/form_composer/running/","9b5"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/js_packages/custom/",component:f("/docs/guides/how_to_use/js_packages/custom/","ea7"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/js_packages/main/",component:f("/docs/guides/how_to_use/js_packages/main/","3e7"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/mturk/",component:f("/docs/guides/how_to_use/providers/mturk/","35d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/eligibility_requirements/",component:f("/docs/guides/how_to_use/providers/prolific/eligibility_requirements/","c16"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/intro/",component:f("/docs/guides/how_to_use/providers/prolific/intro/","b77"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/prolific_api_oddities/",component:f("/docs/guides/how_to_use/providers/prolific/prolific_api_oddities/","0c5"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/prolific_python_sdk/",component:f("/docs/guides/how_to_use/providers/prolific/prolific_python_sdk/","31d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/providers/prolific/running_study/",component:f("/docs/guides/how_to_use/providers/prolific/running_study/","286"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/diagram/",component:f("/docs/guides/how_to_use/review_app/diagram/","8ff"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/enabling_original_unit_preview/",component:f("/docs/guides/how_to_use/review_app/enabling_original_unit_preview/","3a8"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/enabling_responses_histogram/",component:f("/docs/guides/how_to_use/review_app/enabling_responses_histogram/","52b"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/overview/",component:f("/docs/guides/how_to_use/review_app/overview/","1a2"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/running/",component:f("/docs/guides/how_to_use/review_app/running/","5f5"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/review_app/server_api/",component:f("/docs/guides/how_to_use/review_app/server_api/","a76"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/task_creation/developing_frontends/",component:f("/docs/guides/how_to_use/task_creation/developing_frontends/","6db"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/task_creation/hosting_assets/",component:f("/docs/guides/how_to_use/task_creation/hosting_assets/","226"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/task_creation/task_run/",component:f("/docs/guides/how_to_use/task_creation/task_run/","fe8"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/config_files/",component:f("/docs/guides/how_to_use/video_annotator/configuration/config_files/","24d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/form_callbacks/",component:f("/docs/guides/how_to_use/video_annotator/configuration/form_callbacks/","70b"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/insertions/",component:f("/docs/guides/how_to_use/video_annotator/configuration/insertions/","f74"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/multiple_annotator_versions/",component:f("/docs/guides/how_to_use/video_annotator/configuration/multiple_annotator_versions/","481"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/setup/",component:f("/docs/guides/how_to_use/video_annotator/configuration/setup/","16f"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/configuration/video_annotator_config_command/",component:f("/docs/guides/how_to_use/video_annotator/configuration/video_annotator_config_command/","350"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/embedding/",component:f("/docs/guides/how_to_use/video_annotator/embedding/","ce9"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/overview/",component:f("/docs/guides/how_to_use/video_annotator/overview/","95d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/video_annotator/running/",component:f("/docs/guides/how_to_use/video_annotator/running/","228"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_experience/mephisto-task-addons/",component:f("/docs/guides/how_to_use/worker_experience/mephisto-task-addons/","ac4"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_experience/worker_opinion/",component:f("/docs/guides/how_to_use/worker_experience/worker_opinion/","021"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/common_qualification_flows/",component:f("/docs/guides/how_to_use/worker_quality/common_qualification_flows/","c27"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/managing_worker_qualifications/",component:f("/docs/guides/how_to_use/worker_quality/managing_worker_qualifications/","7ec"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/other_methods/",component:f("/docs/guides/how_to_use/worker_quality/other_methods/","f9d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/using_golds/",component:f("/docs/guides/how_to_use/worker_quality/using_golds/","b13"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/using_onboarding/",component:f("/docs/guides/how_to_use/worker_quality/using_onboarding/","67a"),exact:!0,sidebar:"guides"},{path:"/docs/guides/how_to_use/worker_quality/using_screen_units/",component:f("/docs/guides/how_to_use/worker_quality/using_screen_units/","624"),exact:!0,sidebar:"guides"},{path:"/docs/guides/quickstart/",component:f("/docs/guides/quickstart/","4a0"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/custom_react/",component:f("/docs/guides/tutorials/custom_react/","536"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/first_task/",component:f("/docs/guides/tutorials/first_task/","63b"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/form_composer/",component:f("/docs/guides/tutorials/form_composer/","adc"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/model_in_the_loop/",component:f("/docs/guides/tutorials/model_in_the_loop/","c58"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/review_app/",component:f("/docs/guides/tutorials/review_app/","07d"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/worker_controls/",component:f("/docs/guides/tutorials/worker_controls/","184"),exact:!0,sidebar:"guides"},{path:"/docs/guides/tutorials/workflows/",component:f("/docs/guides/tutorials/workflows/","474"),exact:!0,sidebar:"guides"},{path:"/docs/reference/architects/",component:f("/docs/reference/architects/","27f"),exact:!0,sidebar:"reference"},{path:"/docs/reference/blueprints/",component:f("/docs/reference/blueprints/","9ed"),exact:!0,sidebar:"reference"},{path:"/docs/reference/overview/",component:f("/docs/reference/overview/","c48"),exact:!0,sidebar:"reference"},{path:"/docs/reference/providers/",component:f("/docs/reference/providers/","abe"),exact:!0,sidebar:"reference"},{path:"/docs/reference/requesters/",component:f("/docs/reference/requesters/","71e"),exact:!0,sidebar:"reference"},{path:"/docs/reference/tasks/",component:f("/docs/reference/tasks/","cd8"),exact:!0,sidebar:"reference"}]},{path:"/",component:f("/","59e"),exact:!0},{path:"*",component:f("*")}]},6714:function(e,t,n){"use strict";n.r(t)},1250:function(e,t,n){"use strict";n.r(t)},7601:function(e,t){"use strict";var n=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);E+=k.value.length,k=k.next){var S=k.value;if(t.length>e.length)return;if(!(S instanceof o)){var x,C=1;if(b){if(!(x=i(_,E,e,v))||x.index>=e.length)break;var T=x.index,L=x.index+x[0].length,A=E;for(A+=k.value.length;T>=A;)A+=(k=k.next).value.length;if(E=A-=k.value.length,k.value instanceof o)continue;for(var D=k;D!==t.tail&&(Ad.reach&&(d.reach=O);var I=k.prev;if(N&&(I=u(t,I,N),E+=N.length),l(t,I,C),k=u(t,I,new o(f,g?r.tokenize(R,g):R,y,R)),P&&u(t,k,P),C>1){var F={cause:f+","+h,reach:O};a(e,t,n,k.prev,E,F),d&&F.reach>d.reach&&(d.reach=F.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function l(e,t,n){for(var r=t.next,o=0;o"+i.content+""},r}(),r=n;n.default=n,r.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^$/i;var o={"included-cdata":{pattern://i,inside:n}};o["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:o},r.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=r.variable[1].inside,a=0;a]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.c=r.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),r.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),r.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},r.languages.c.string],char:r.languages.c.char,comment:r.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:r.languages.c}}}}),r.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete r.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(r),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(r),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},o={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:o,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:o})}(r),r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(r),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function a(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return"(?:"+o+"|"+i+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:a(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:a(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:a(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:a(i),lookbehind:!0,greedy:!0},number:{pattern:a(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(r),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n",quot:'"'},u=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(r),r.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:r.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},r.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n0)){var s=f(/^\{$/,/^\}$/);if(-1===s)continue;for(var u=n;u=0&&p(l,"variable-input")}}}}function c(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],i=r.pattern.source;function a(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function s(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function u(t,n,r){var o={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",o),o.tokens=e.tokenize(o.code,o.grammar),e.hooks.run("after-tokenize",o),o.tokens}function l(t){var n={};n["interpolation-punctuation"]=o;var i=e.tokenize(t,n);if(3===i.length){var a=[1,1];a.push.apply(a,u(i[1],e.languages.javascript,"javascript")),i.splice.apply(i,a)}return new e.Token("interpolation",i,r.alias,t)}function c(t,n,r){var o=e.tokenize(t,{interpolation:{pattern:RegExp(i),lookbehind:!0}}),a=0,c={},d=u(o.map((function(e){if("string"==typeof e)return e;for(var n,o=e.content;-1!==t.indexOf(n=s(a++,r)););return c[n]=o,n})).join(""),n,r),f=Object.keys(c);return a=0,function e(t){for(var n=0;n=f.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var o=f[a],i="string"==typeof r?r:r.content,s=i.indexOf(o);if(-1!==s){++a;var u=i.substring(0,s),d=l(c[o]),p=i.substring(s+o.length),h=[];if(u&&h.push(u),h.push(d),p){var m=[p];e(m),h.push.apply(h,m)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(h)),n+=h.length-1):r.content=h}}else{var g=r.content;Array.isArray(g)?e(g):e([g])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[a("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),a("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),a("svg",/\bsvg/.source),a("markdown",/\b(?:markdown|md)/.source),a("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),a("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,o=n.length;r]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(r),function(e){function t(e,t){return RegExp(e.replace(//g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r*\.{3}(?:[^{}]|)*\})/.source;function i(e,t){return e=e.replace(//g,(function(){return n})).replace(//g,(function(){return r})).replace(//g,(function(){return o})),RegExp(e,t)}o=i(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var a=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(a).join(""):""},s=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===a(o.content[0].content[1])&&n.pop():"/>"===o.content[o.content.length-1].content||n.push({tagName:a(o.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===o.type&&"{"===o.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?n[n.length-1].openedBraces--:i=!0),(i||"string"==typeof o)&&n.length>0&&0===n[n.length-1].openedBraces){var u=a(o);r0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(u=a(t[r-1])+u,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",u,null,u)}o.content&&"string"!=typeof o.content&&s(o.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||s(e.tokens)}))}(r),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),"diff"===n&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(r),r.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},r.languages.go=r.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),r.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete r.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,i){if(n.language===r){var a=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof i&&!i(e))return e;for(var o,s=a.length;-1!==n.code.indexOf(o=t(r,s));)++s;return a[s]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,i=Object.keys(n.tokenStack);!function a(s){for(var u=0;u=i.length);u++){var l=s[u];if("string"==typeof l||l.content&&"string"==typeof l.content){var c=i[o],d=n.tokenStack[c],f="string"==typeof l?l:l.content,p=t(r,c),h=f.indexOf(p);if(h>-1){++o;var m=f.substring(0,h),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),v=f.substring(h+p.length),b=[];m&&b.push.apply(b,a([m])),b.push(g),v&&b.push.apply(b,a([v])),"string"==typeof l?s.splice.apply(s,[u,1].concat(b)):l.content=b}}else l.content&&a(l.content)}return s}(n.tokens)}}}})}(r),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(r),r.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},r.languages.webmanifest=r.languages.json,r.languages.less=r.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),r.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),r.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},r.languages.objectivec=r.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete r.languages.objectivec["class-name"],r.languages.objc=r.languages.objectivec,r.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},r.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},r.languages.python["string-interpolation"].inside.interpolation.inside.rest=r.languages.python,r.languages.py=r.languages.python,r.languages.reason=r.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),r.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete r.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(r),r.languages.scss=r.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),r.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),r.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),r.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),r.languages.scss.atrule.inside.rest=r.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(r),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(r),r.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/},t.Z=r},5619:function(e,t,n){"use strict";var r=n(1987),o=n(286);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n
'};function o(e,t,n){return en?n:e}function i(e){return 100*(-1+e)}function a(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+i(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+i(e)+"%,0)"}:{"margin-left":i(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var i=n.render(!t),l=i.querySelector(r.barSelector),c=r.speed,d=r.easing;return i.offsetWidth,s((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),u(l,a(e,c,d)),1===e?(u(i,{transition:"none",opacity:1}),i.offsetWidth,setTimeout((function(){u(i,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,a=t.querySelector(r.barSelector),s=e?"-100":i(n.status||0),l=document.querySelector(r.parent);return u(a,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&p(o),l!=document.body&&c(l,"nprogress-custom-parent"),l.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var s=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),u=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,i=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+i)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function i(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&i(e,n,r);else i(e,o[1],o[2])}}();function l(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=f(e),r=n+t;l(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);l(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(o="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=o)},4071:function(e,t,n){var r=n(7107);e.exports=p,e.exports.parse=i,e.exports.compile=function(e,t){return s(i(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,s="",c=t&&t.delimiter||"/";null!=(n=o.exec(e));){var d=n[0],f=n[1],p=n.index;if(s+=e.slice(a,p),a=p+d.length,f)s+=f[1];else{var h=e[a],m=n[2],g=n[3],v=n[4],b=n[5],y=n[6],w=n[7];s&&(r.push(s),s="");var _=null!=m&&null!=h&&h!==m,k="+"===y||"*"===y,E="?"===y||"*"===y,S=n[2]||c,x=v||b;r.push({name:g||i++,prefix:m||"",delimiter:S,optional:E,repeat:k,partial:_,asterisk:!!w,pattern:x?l(x):w?".*":"[^"+u(S)+"]+?"})}}return a