diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cd690fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +__pycache__ +www/boris/me +www/boris/swarm + diff --git a/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py b/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py index 1f89c63..b3ab66d 100644 --- a/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py +++ b/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py @@ -31,7 +31,7 @@ SITE_IDENTIFIER = 'astroport' SITE_NAME = 'ASTROPORT _PROFIL_ (_LOGIN_) (_MDP_)' SITE_DESC = 'Partage ~/astroport/films (animes, series) avec ses amis https://gchange.fr (https://cesium.app ) via IPFS' -URL_MAIN = 'http://127.0.0.1:8181/ipns/_IPFSNODEID_/._IPFSNODEID_/' +URL_MAIN = 'http://127.0.0.1:8080/ipns/_IPFSNODEID_/._IPFSNODEID_/' KEY_PASTE_ID = 'PASTE_ID' SETTING_PASTE_ID = SITE_IDENTIFIER + '_id_' diff --git a/.install/.kodi/userdata/guisettings.xml b/.install/.kodi/userdata/guisettings.xml index 3890d15..a3e467c 100644 --- a/.install/.kodi/userdata/guisettings.xml +++ b/.install/.kodi/userdata/guisettings.xml @@ -226,7 +226,7 @@ false true - 8181 + 8081 false xbmc webinterface.default diff --git a/.install/astroport.desktop b/.install/astroport.desktop index 59e24a9..8293342 100755 --- a/.install/astroport.desktop +++ b/.install/astroport.desktop @@ -1,6 +1,6 @@ #!/usr/bin/env xdg-open [Desktop Entry] -Name=Astroport/Kodi +Name=Astroport Exec=/home/_USER_/.zen/astrXbian/ajouter_video.sh Icon=/home/_USER_/.zen/astrXbian/logo96.png Type=Application diff --git a/.install/ipfs_alone.sh b/.install/ipfs_alone.sh index 98f8e5b..60ac522 100755 --- a/.install/ipfs_alone.sh +++ b/.install/ipfs_alone.sh @@ -17,22 +17,19 @@ sudo true ## Error funciton err() { - echo -e "ERREUR: $1" - exit 1 + echo -e "ERREUR: $1" + exit 1 } # CHECK if daemon is already running if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]]; then - echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!" - ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers - echo "ipfs bootstrap list: " && ipfs bootstrap list - echo "Please RUN : sudo service ipfs stop" - exit 1 + ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers + echo "ipfs bootstrap list: " && ipfs bootstrap list + echo "ipfs daemon already running...!" + exit 0 fi -[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script" && exit 1 - -echo -e "Astroport IPFS Layer installation..." +echo -e "Astroport activate IPFS Layer installation..." # CHECK node IP isLAN? myIP=$(hostname -I | awk '{print $1}') @@ -40,36 +37,18 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|( MACHINE_TYPE=`uname -m` -if [ ${MACHINE_TYPE} == 'x86_64' ]; then - curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz -elif [ ${MACHINE_TYPE:0:3} == 'arm' ]; then - curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz -else - [ ! -f $MY_PATH/ipfs-update.tar.gz ] && err "Your $MACHINE_TYPE is not supported yet... Please add an issue." -fi - -echo "INSTALL ipfs-update >>>>>>>>>>>>>>>>>>>>>>>>>>" -sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err "Untar ipfs-update" -rm $MY_PATH/ipfs-update.tar.gz -cd /usr/src/ipfs-update/ -sudo ./install.sh || err "Install ipfs-update" -cd $MY_PATH - -echo "INSTALL ipfs 0.7.0 >>>>>>>>>>>>>>>>>>>>>>>>>>" -sudo ipfs-update install 0.7.0 || err "Install IPFS" - # INIT ipfs [[ $isLAN ]] && ipfs init -p lowpower \ || ipfs init -p server -## Special Xbian init.d config +## Special Xbian init.d config if [[ "$USER" == "xbian" ]]; then - sudo cp ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs - sudo chmod 755 /etc/init.d/ipfs - sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log + sudo cp ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs + sudo chmod 755 /etc/init.d/ipfs + sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log else - ## DEBIAN - echo "CREATE SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>>>>" + ## DEBIAN + echo "CREATE SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>>>>" cat > /tmp/ipfs.service < /dev/null + sudo sed -i -e 's/$domain/'"$domain"'/g' $newVHost +} + +if [[ -e $newVHost ]]; then + echo "${yellow}Le virtualhost existe déjà${reset}" + if [[ -z $(grep "ssl_certificate_key" $newVHost) ]]; then + echo "Certificat SSL non présent" + if [[ $ssl =~ ^(1|true|oui)$ ]]; then + echo "Installation du certificat SSL ..." + addSSL + sudo service nginx reload && echo "${green}Le domaine $domain à bien été créé et configuré =)${reset}" || echo "${red}Impossible de recharger nginx${reset}" + exit 0 + else + echo "${yellow}Aucune action n'a été effectué${reset}" + exit 0 + fi + else + echo "${yellow}Le SSL est déjà configuré sur le VHost${reset}" + exit 0 + fi +fi + + +create_vhost(){ + echo "${yellow}Génération du nouveau VirtualHost...${reset}" + sudo cp $tplVHost $newVHost + sudo sed -i -e 's/$_DOMAIN/'"$domain"'/g' $newVHost + sudo sed -i -e 's/$_IP/'"$ip"'/g' $newVHost + sudo sed -i -e 's/$_PORT/'"$port"'/g' $newVHost + if [[ $ssl =~ ^(1|true|oui)$ ]]; then + printf "${yellow}Configuration SSL du VHost...${reset}" + addSSL && echo "${green}OK${reset}" || echo "${red}KO${reset}" + else + echo "${yellow}Aucune configuration SSL ne sera effectué.${reset}" + fi + sudo service nginx reload && echo "${green}Le domaine $domain à bien été créé et configuré =)${reset}" || echo "${red}Impossible de recharger nginx${reset}" +} + +echo "Nous allons créer le domaine ${blue}$domain ${reset}qui sera lié au port ${blue}$port ${reset}de l'IP ${blue}$ip.${reset}" +if [[ $p2vmProvided != 1 ]]; then + read -p "${bold}Confirmez-vous cette action ?${reset} (${green}y${reset} ou ${red}n${reset}) : " yn + case $yn in + [Yy]* ) create_vhost break;; + [Nn]* ) echo "${red}Fermeture du script${reset}" && exit;; + * ) echo "Merci de sélectionner yes ou no";; + esac +else + create_vhost +fi + +## 1ere analyse +# A priori utiliser avec domain=$IPFSNODEID ip=local port=10101 ssl=no +# [[ ! $(ipfs p2p ls | grep '/x/10101') ]] && ipfs p2p listen /x/10101 /ip4/127.0.0.1/tcp/10101 +# Chaque station publie ses services/API sur un port numéroté /x/10101 relayé en 127.0.0.1/tcp/20101 +# Elle publie cette information aux bootstrap (gateway) qui prennent en charge le relai https "ipfs p2p" +# [[ ! $(ipfs p2p ls | grep '/x/10101') ]] && ipfs --timeout=5s ping -n 1 /p2p/$IPFSNODEID && ipfs p2p forward /x/10101 /ip4/127.0.0.1/tcp/20101 /p2p/$IPFSNODEID +# A l'autre boût on sort domain=tata.toto.com ip=local port=20101 ssl=yes + +## PAR défaut tous publient ~/.zen/astrXbian/www/boris sur leur port 80 / 443 (pour éxécuter l'API PHP) + +# Ca ressemble au fonctionnement du ln -s ;) +# ipfs p2p ln -s /p2p/$IPFSNODEID/tcp/10101 /ip4/127.0.0.1/tcp/20101 + +## Dédier Le canal star1 pour le flux m3u8 webcam activable. +# Utiliser les canaux stars pour publier ses ports à ceux de ses amis du niveau choisi. +# Publier en json ! + +exit 0 diff --git a/.install/nvh/ssl-bloc-redirect.txt b/.install/nvh/ssl-bloc-redirect.txt new file mode 100644 index 0000000..3dc43fb --- /dev/null +++ b/.install/nvh/ssl-bloc-redirect.txt @@ -0,0 +1,12 @@ + +server { + listen 80; + server_name $domain; + include includes/letsencrypt.conf; + + if ($host = $domain) { + return 301 https://$host$request_uri; + } + + return 404; +} diff --git a/.install/nvh/vhost.txt b/.install/nvh/vhost.txt new file mode 100644 index 0000000..2eb4b6d --- /dev/null +++ b/.install/nvh/vhost.txt @@ -0,0 +1,35 @@ +upstream $domain { + server 192.168.9.$ipvm:$port; #Production + #server 192.168.9.9; #Redirection maintenance +} + +server { + server_name $domain; + listen 80; + include includes/errors.conf; + + location / { + proxy_pass http://$domain; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header Host $http_host; + proxy_redirect off; + } + + location /ipfs { + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + } + + location /ipns { + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + } + + error_log /var/log/nginx/$domain_error.log; + access_log /var/log/nginx/$domain_access.log; + +} diff --git a/.install/nvh/vhost_php.txt b/.install/nvh/vhost_php.txt new file mode 100644 index 0000000..991bea3 --- /dev/null +++ b/.install/nvh/vhost_php.txt @@ -0,0 +1,45 @@ +upstream $domain { + server 192.168.9.$ipvm:$port; #Production + #server 192.168.9.9; #Redirection maintenance +} + +server { + server_name $domain; + listen 80; + include includes/errors.conf; + + location / { + # First attempt to serve request as file, then + # as directory, then fall back to displaying a 404. + try_files \$uri \$uri/ =404; + } + + index index.php; + + # pass PHP scripts to FastCGI server + + location ~ \.php$ { + include snippets/fastcgi-php.conf; + + # With php-fpm (or other unix sockets): + fastcgi_pass unix:/var/run/php/php-fpm.sock; # Faites le ln -s qui va bien + # With php-cgi (or other tcp sockets): + #fastcgi_pass 127.0.0.1:9000; + } + + location /ipfs { + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + } + + location /ipns { + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + } + + error_log /var/log/nginx/$domain_error.log; + access_log /var/log/nginx/$domain_access.log; + +} diff --git a/.install/templates/nginx/astrxbian.conf b/.install/templates/nginx/astrxbian.conf index 7bfba67..d650062 100644 --- a/.install/templates/nginx/astrxbian.conf +++ b/.install/templates/nginx/astrxbian.conf @@ -9,13 +9,13 @@ server { # IPFS GATEWAY PROXY location /ipfs { - proxy_pass http://127.0.0.1:8181; + proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /ipns { - proxy_pass http://127.0.0.1:8181; + proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } diff --git a/.install/templates/nginx/jukebox.conf b/.install/templates/nginx/jukebox.conf index 6203ed9..94e0ce9 100644 --- a/.install/templates/nginx/jukebox.conf +++ b/.install/templates/nginx/jukebox.conf @@ -13,7 +13,7 @@ server { index index.php index.html index.htm; location ~ \.php { try_files $uri index.php =404; - fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; + fastcgi_pass unix:/var/run/php/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include /etc/nginx/fastcgi_params; @@ -28,13 +28,13 @@ server { # IPFS GATEWAY PROXY location /ipfs { - proxy_pass http://127.0.0.1:8181; + proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /ipns { - proxy_pass http://127.0.0.1:8181; + proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } diff --git a/.install/templates/tiddlyipfs/index.html b/.install/templates/tiddlyipfs/index.html new file mode 100644 index 0000000..77097fd --- /dev/null +++ b/.install/templates/tiddlyipfs/index.html @@ -0,0 +1,18803 @@ + + + + + + + + + + + + + + + + + + + + +Mon TiddlyWiki — un carnet de notes web personnel et non linéaire + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + diff --git a/.install/templates/tiddlyone/index.html b/.install/templates/tiddlyone/index.html new file mode 100644 index 0000000..e8d7a2e --- /dev/null +++ b/.install/templates/tiddlyone/index.html @@ -0,0 +1,17047 @@ + + + + + + + + + + + + + + + + + + + + +Mon TiddlyWiki — un carnet de notes web personnel et non linéaire + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + diff --git a/.install/update_bashrc.sh b/.install/update_bashrc.sh index 5ff85de..33c7ee1 100755 --- a/.install/update_bashrc.sh +++ b/.install/update_bashrc.sh @@ -6,6 +6,8 @@ ######################################################################## # update_bashrc.sh # Add $YOU $IPFSNODEID $G1PUB to ~/.bashrc +## TODO REMOVE... Not so good idea since Astroport.One switch identities between captains + XZUID="$1" source ~/.bashrc @@ -17,10 +19,10 @@ newIPFSNODEID=$(ipfs id -f='\n') || er+=" ipfs id problem" if [[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]]; then # UPDATE - sed -i "s/YOU=$YOU/YOU=$newYOU/g" ~/.bashrc - sed -i "s/$G1PUB/$newG1PUB/g" ~/.bashrc - sed -i "s/$IPFSNODEID/$newIPFSNODEID/g" ~/.bashrc - + sed -i "s/YOU=$YOU/YOU=$newYOU/g" ~/.bashrc + sed -i "s/$G1PUB/$newG1PUB/g" ~/.bashrc + sed -i "s/$IPFSNODEID/$newIPFSNODEID/g" ~/.bashrc + if [[ $IPNSKEY == "_IPNSKEY_" ]]; then ipfs key rm xbian IPNSKEY=$(ipfs key gen xbian) @@ -28,12 +30,12 @@ if [[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]]; then fi else # CREATE - echo "### ASTROPORT IDENTITY ###" >> ~/.bashrc - echo "export YOU=$newYOU" >> ~/.bashrc - echo "export G1PUB=$newG1PUB" >> ~/.bashrc - echo "export IPFSNODEID=$newIPFSNODEID" >> ~/.bashrc - echo "export IPNSKEY=_IPNSKEY_" >> ~/.bashrc - [[ "$XZUID" != "" ]] && echo "export XZUID=$XZUID" >> ~/.bashrc + echo "### ASTROPORT IDENTITY ###" >> ~/.bashrc + echo "export YOU=$newYOU" >> ~/.bashrc + echo "export G1PUB=$newG1PUB" >> ~/.bashrc + echo "export IPFSNODEID=$newIPFSNODEID" >> ~/.bashrc + echo "export IPNSKEY=_IPNSKEY_" >> ~/.bashrc + [[ "$XZUID" != "" ]] && echo "export XZUID=$XZUID" >> ~/.bashrc fi source ~/.bashrc diff --git a/.install/youtube-dl b/.install/youtube-dl new file mode 100755 index 0000000..3417afc Binary files /dev/null and b/.install/youtube-dl differ diff --git a/.install/youtube-dl.sh b/.install/youtube-dl.sh index 36e9d3a..72352cb 100755 --- a/.install/youtube-dl.sh +++ b/.install/youtube-dl.sh @@ -1,8 +1,22 @@ #!/bin/bash ######################################################################## +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" ######## YOUTUBE-DL ########## -if [[ ! $(which youtube-dl) ]]; then - sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl || exit 1 - sudo chmod a+rx /usr/local/bin/youtube-dl - sudo chown $USER /usr/local/bin/youtube-dl +## NOW INSTALL yt-dlp AND LINK TO youtube-dl + +if [[ ! -f /usr/local/bin/yt-dlp ]]; then + sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && \ + sudo chmod a+rx /usr/local/bin/yt-dlp && sudo chown $USER /usr/local/bin/yt-dlp + + ytdl=$(which youtube-dl) # modify old + [[ -f ${ytdl} && ! -f ${ytdl}.old ]] &&\ + sudo cp ${ytdl} ${ytdl}.old && \ + sudo rm ${ytdl} + + sudo ln -s /usr/local/bin/yt-dlp /usr/local/bin/youtube-dl ## NOW youtube-dl is linked to yt-dlp (COMMANDS ARE THE SAME ?) fi + +## UPGRADE TO LATEST +ls -al /usr/local/bin/youtube-dl diff --git a/A_boostrap_nodes.txt b/A_boostrap_nodes.txt index 5a4c09a..6d0e93d 100644 --- a/A_boostrap_nodes.txt +++ b/A_boostrap_nodes.txt @@ -3,3 +3,5 @@ /ip4/51.15.166.54/tcp/4001/p2p/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN # aries.copylaradio.com (thuya83pk) = HbBJDXDrN8swxvMohMxmegYRyZ7m99jqgxwwN1gwxck2 /ip4/37.187.127.175/tcp/4001/p2p/12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx +# cancer.copylaradio.com (yan14tricot75) = GmUD53TFfEfb6NiVqYXwxMGbxpP9nKgHPgF4jex6FBvj +/ip4/185.202.238.69/udp/4001/quic/p2p/12D3KooWRaqNpB2xr8w5WGDvU9HHj9MST9Rnp1kmMGc67e6z98ef diff --git a/A_boostrap_public.txt b/A_boostrap_public.txt new file mode 100644 index 0000000..1bb5538 --- /dev/null +++ b/A_boostrap_public.txt @@ -0,0 +1,5 @@ +/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN +/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa +/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb +/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt +/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ diff --git a/DEFCON b/DEFCON index b8626c4..7ed6ff8 100644 --- a/DEFCON +++ b/DEFCON @@ -1 +1 @@ -4 +5 diff --git a/ISOconfig.sh b/ISOconfig.sh index c7e703c..1a9d3d6 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -9,7 +9,7 @@ IPFSNODEID=$(ipfs id -f='\n') isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1) [[ ! ${IPFSNODEID} ]] && echo "IPFS MUST BE INSTALLED" && exit 1 ######################################################################## -# Create secret key files +# Create STATION IPFS/G1 IDENTITY & secret key files # ~/.zen/secret.june # ~/.zen/secret.dunikey # ~/.zen/secret.ipfs & /tmp/config.ipfs @@ -23,16 +23,16 @@ rm -f /tmp/A_booting_log.txt ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo "CONNEXION OK" || exit 1 ## TEST BOOTSTRAP IP CONNECTIVITY IPTEST=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | cut -d '/' -f 3 | shuf | head -n 1) -ping -q -w 1 -c 1 $IPTEST 2>&1>/dev/null && echo "CONNEXION BOOTSTRAP OK" || echo "VERIFIER CONNEXION INTERNET" && exit 1 +ping -q -w 1 -c 1 $IPTEST 2>&1>/dev/null && echo "CONNEXION BOOTSTRAP OK" || (echo "VERIFIER CONNEXION INTERNET" && exit 1) -# GIT PULL astrXbian code -mkdir -p ~/.zen/astrXbian && cd ~/.zen/astrXbian && git pull || exit 1 +# MAJ astrXbian code +[[ -d ~/.zen/astrXbian ]] && cd ~/.zen/astrXbian && git pull || ( echo "astrXbian ERROR" && exit 1 ) # CHECK IF CONFIG ALREADY DONE !! # ~/.zen/ipfs ~/.zen/secret ~/.zen/ipfs.sync if [[ -f ~/.zen/ipfs.sync ]]; then echo "CONFIG ALREADY DONE.... logging init in /tmp/A_booting_log.txt" - source ~/.zen/ipfs.sync + source ~/.zen/ipfs.sync; echo "CAPTAIN is $CAPTAIN" # Wait for IPFS to connect SWARM sleep 20 ~/.zen/astrXbian/zen/gchange_INIT.sh >> /tmp/A_booting_log.txt @@ -47,13 +47,14 @@ fi echo "CREATING Gchange credentials" ######################################################################## salt="$(~/.zen/astrXbian/zen/tools/diceware.sh 3 | xargs)" +salto="$salt" [[ $salt == "" ]] && echo "ERROR" && exit 1 pepper="$(~/.zen/astrXbian/zen/tools/diceware.sh 3 | xargs)" XZUID=$(~/.zen/astrXbian/zen/tools/diceware.sh 1 | xargs)${RANDOM:0:2}$(~/.zen/astrXbian/zen/tools/diceware.sh 1 | xargs) -[[ "$USER" != "xbian" ]] && echo "Modifier identifiant (passphrase 1)? $salt" && read salty && [[ $salty ]] && salt="$salty" -[[ "$USER" != "xbian" ]] && echo "Modifier mot de passe (passphrase 2)? $pepper" && read peppery && [[ $peppery ]] && pepper="$peppery" -# [[ "$USER" != "xbian" ]] && echo "Modifier Pseudo? $XZUID" && read XZUIDy && [[ $XZUIDy ]] && XZUID="$XZUIDy" +[[ "$USER" != "xbian" ]] && echo "Gardez ou modifiez cet identifiant (passphrase 1)? $salt" && read salty && [[ $salty ]] && salt="$salty" +[[ "$USER" != "xbian" ]] && echo "Gardez ou modifiez cet mot de passe (passphrase 2)? $pepper" && read peppery && [[ $peppery ]] && pepper="$peppery" +[[ "$USER" != "xbian" && "$salt" != "$salto" ]] && echo "Gardez ou modifiez ce Pseudo? $XZUID" && read XZUIDy && [[ $XZUIDy ]] && XZUID="$XZUIDy" g1_salt="$salt" g1_pepper="$pepper" @@ -119,7 +120,7 @@ mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB # Give $XZUID to your (gchange friends) ######################################################################## echo "SETTING ASTRXBIAN PROFILE NAME = $XZUID" -echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid +echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player ######################################################################## echo "CREATING GCHANGE+ PROFILE" @@ -164,9 +165,9 @@ echo ".... ACTUAL SWARM PEERS ..." ipfs swarm peers ######################################################################## -echo 'UPDATING ~/.bashrc' +# echo 'UPDATING ~/.bashrc' ######################################################################## -~/.zen/astrXbian/.install/update_bashrc.sh "$XZUID" +# ~/.zen/astrXbian/.install/update_bashrc.sh "$XZUID" ## CREATE RAMDISK permanent #sudo mkdir /mnt/ramdisk @@ -215,21 +216,15 @@ if [[ $bootnode != "" ]]; then fi done -######################################################################## -echo "Synchronize GCHANGE+ with IPFS SWARM" -######################################################################## -~/.zen/astrXbian/zen/gchange_IPFS_swarm.sh -~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh - ######################################################################## echo 'Installing Astroport cron_MINUTE' ######################################################################## ~/.zen/astrXbian/zen/cron_VRFY.sh ######################################################################## -#echo "CHANGE hostname" -#myname=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) -#echo "$(hostname). Changez votre HOSTNAME ($myname)?" && read mynamey && [[ $mynamey ]] && myname="$mynamey" +#echo "CHANGE hostname" +#myname=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player) +#echo "$(hostname). Changez votre HOSTNAME ($myname)?" && read mynamey && [[ $mynamey ]] && myname="$mynamey" ######################################################################## #sudo sed -i "s/$(hostname)/$myname/g" /etc/hostname #sudo sed -i "s/$(hostname)/$myname/g" /etc/hosts @@ -246,7 +241,7 @@ sudo chattr -i /etc/resolv.conf sudo cat > /tmp/resolv.conf < Astroport/KODI vous permet de partager les vidéos que vous aimez avec les gens que vous aimez. -Le répertoire ~/astroport sert de sas de transfert de vos fichiers dans IPFS. +Le répertoire ~/astroport sert de sas de transfert de vos fichiers dans IPFS (vous pouvez en effacer les fichiers une fois importés). Votre essaim de pairs connectés se dessine selon les "étoiles" échangées sur https://gchange.fr -Chaque noeud astXbian possède une identité (paire de clef ed25519) qui correspond à son identité sur https://gchange.fr et un portefeuille sur https://cesium.app +Chaque noeud astXbian possède une identité (paire de clef ed25519) qui correspond à son identité sur https://gchange.fr et un portefeuille sur https://cesium.app Lorsqu'une identité "like/étoile" un autre compte sur Gchange, elle lui expédie le message "ipfstryme" ```~/.zen/ipfs/.${IPFSNODEID}/tryme.addr``` qui contient les adresses IP/IPFS connues (amis d'ami). -Chaque fichier placé dans ```~/.zen/ipfs``` est partagé sur la clef IPNS "self" de chacun puis collecté dans ```~/.zen/ipfs_swarm``` régulièrement. +Chaque fichier placé dans ```~/.zen/ipfs``` est partagé sur la clef IPNS "self" de chacun puis collecté dans ```~/.zen/ipfs_swarm``` régulièrement (c'est la Balise de votre Station) Chaque noeud conserve la mémoire de sa bibliothèque au travers du fichier ```~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN``` -et transmet à Kodi l'ensemble de des "film" de son swarm dans ```~/.zen/ipfs/.$IPFSNODEID/FASTRXBIAN``` (PREFIX = F), selon le format +et transmet à Kodi l'ensemble de des "film" dans ```~/.zen/ipfs/.$IPFSNODEID/FASTRXBIAN``` (PREFIX = F), selon le format ``` CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS -film;$TMDB;2013;Frequencies;;["Science fiction","Romance","Mystere"];$XZUID;480p;http://127.0.0.1:8181/ipfs/QmcXMAHbFH3gDwmxJRX7uh753oCbXAEajwQsAWFkvqbRY3/Frequencies.mp4 +film;$TMDB;2013;Frequencies;;["Science fiction","Romance","Mystere"];$XZUID;480p;http://127.0.0.1:8080/ipfs/QmcXMAHbFH3gDwmxJRX7uh753oCbXAEajwQsAWFkvqbRY3/Frequencies.mp4 # FORMAT DU FICHIER : https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films ``` * ```~/.zen/PIN``` memorise l'état des PIN du réseau -* ```~/.zen/ipfs/.${IPFSNODEID}/KEY``` attribue une clef MEDIAKEY IPNS à chaque SOURCE_ID et applique un contrat fixe ou dynamique (selon le chiffrage appliqué au Thunder Network) -* ```~/.zen/ipfs/.${IPFSNODEID}/index.html``` l'application par défaut de votre clef self est un TiddlyWiki +* ```~/.zen/ipfs/.${IPFSNODEID}/KEY``` attribue une clef MEDIAKEY IPNS à chaque SOURCE_ID et applique un contrat fixe ou dynamique (selon le chiffrage appliqué à votre Thunder Network) +* ```~/.zen/ipfs/.${IPFSNODEID}/index.html``` l'application par défaut de votre Station est [TiddlyWiki](https://tiddlywiki.com/languages/fr-FR/index.html) L'essaim se restructure toutes les minutes (code: ```cron_MINUTE.sh```) et active l'automate Astroport/BLOB. @@ -142,7 +220,7 @@ L'essaim se restructure toutes les minutes (code: ```cron_MINUTE.sh```) et activ Chaque station fabrique 5 clefs qui sont envoyées à tous ses amis en fonction des étoiles attribuées. Ces "stargate" partagés sur le même espace IPNS sont signés par chaque participant qui le modifie construisant une blockchain (sauvegarde). -En cas de conflit (quand le swarm est trop grand ou désynchronisé), une procédure envoi des messages aux 2 signatures et invite à résoudre de façon manuelle le problème. +En cas de conflit (quand le swarm est trop grand ou désynchronisé), une procédure envoi des messages aux 2 signatures et invite à résoudre de façon manuelle le problème. # Magic commands @@ -151,10 +229,10 @@ En cas de conflit (quand le swarm est trop grand ou désynchronisé), une procé ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # Obtenir la liste de tous ses amis (gchange+) -cat ~/.zen/ipfs_swarm/.12D*/G1SSB/_g1.gchange_title +cat ~/.zen/ipfs_swarm/.12D*/.player -# Noms des stations astroport de son swarm -for peer in $(ipfs swarm peers); do ipfsnodeid=${peer##*/}; echo "$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) => $(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid)"; done +# Scan des stations IPFS de son swarm +for peer in $(ipfs swarm peers); do ipfsnodeid=${peer##*/}; echo $ipfsnodeid; echo "$(ipfs --timeout=2s cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) => $(ipfs --timeout=1s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player)"; ipfs --timeout=1s ls /ipns/$ipfsnodeid/; done # Obtenir le nom des fichiers contenus dans PIN IPFS for ID in $( ls ~/.zen/PIN/ | cut -d '/' -f 6); do ipfs ls $ID; done @@ -172,12 +250,12 @@ ipfs ls /ipns/k51qzi5uqu5dk1nt1pfbtgfis4bep8pcip78w30xykhgba7y7wk0xyu8nwci5m MYCODE=$(cat ~/.zen/ipfs_swarm/.$IPFSNODEID/.mycode); for CODE in $(ls ~/.zen/ipfs_swarm/.12D*/.mycode); do - echo + echo ipfsnodeid=$(echo $CODE | cut -d '.' -f 3 | cut -d '/' -f 1 ); code=$(cat $CODE); IPNSCODE=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.mycode) - zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid); - # zuid=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) + zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player); + # zuid=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player) g1name=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title) # g1name=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) echo "---> $zuid / $g1name : $IPNSCODE" @@ -187,14 +265,14 @@ do done; # Get your ipfs swarm peers station names (XZUID) -for ipfsnodeid in $(ipfs swarm peers | grep -o '[^/]*$'); do ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid; done +for ipfsnodeid in $(ipfs swarm peers | grep -o '[^/]*$'); do ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player; done ``` # ANNEXES ## PRESENTATIONS VIDEO - + ### [Fred présente Astroport à la Ressourcerie](https://tube.p2p.legal/videos/watch/7ff4a8c9-7fb7-44ef-a1ee-bdf8ecc74cfe) ### [Première visite de Astroport/KODI](https://tube.p2p.legal/videos/watch/d74631e9-b1bd-43f4-9db7-5effca1ef46a) @@ -242,16 +320,13 @@ https://astroport.com # Surcouche logicielle P2P à Debian (Essaim IPFS/Gchange+) + Interface média center KODI / IPFS --- -# OFFRES ENMPLOIS -Deux offres d'emplois ala TroporstA (only real GNU understand) -https://forum.monnaie-libre.fr/t/offres-emplois/16903?u=qoop +# NOUS RECRUTONS -**Et oui, on peut gagner jusqu'à 3 DU en sélectionnant, traduisant, les sources du Web qui vous plaisent !!** +**Activation de la Zen Economie Astroport.** + +Pour rejoindre l'Astrocrew: Installez AstrXbian TestNET apprenez à programmer de votre automate cellulaire (BASH + multilanguage). + +Des offres d'emploi et de stage en pagaille: visitez https://www.copylaradio.com/makers -- 1 DU par compte ouvert sur https://oasis.astroport.com -- 2 DU par article autour du DIY Raspberry Pi sur https://copylaradio.com (+ 1 DU pour l'ouverture du compte) -A la clef un concours des meilleurs articles par activation de la Zen Economie sur Astroport. -Pour rejoindre l'Astrocrew installez AstrXbian TestNET en cour s de développement et devenez programmateur de cette automate cellulaire (BASH + multilanguage). -Le nouveau JEu du LOVE peut commencer. diff --git a/actions/check_my_wallet.sh b/actions/check_my_wallet.sh new file mode 100755 index 0000000..2dcc367 --- /dev/null +++ b/actions/check_my_wallet.sh @@ -0,0 +1,15 @@ +#!/bin/bash +######################################################################## +# Author: Astrocrew +# Version: 0.1 +# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) +######################################################################## +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 +MYG1PUB=$(cat /home/$YOU/.zen/ipfs/.*/G1SSB/_g1.pubkey) +MYIPFSNODEID=$(cat /home/$YOU/.zen/ipfs/.*/.ipfsnodeid) + +[[ $MYG1PUB == "" ]] && echo "$MYIPFSNODEID MISSING $MYG1PUB" && exit 1 + +echo $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $MYG1PUB) +exit 0 + diff --git a/actions/p4n.data_evolution.sh b/actions/p4n.data_evolution.sh new file mode 100755 index 0000000..20e95a5 --- /dev/null +++ b/actions/p4n.data_evolution.sh @@ -0,0 +1,49 @@ +#!/bin/bash +######################################################################## +# Author: Astrocrew +# Version: 0.1 +# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) +######################################################################## +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" +countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l) +[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0 + +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 +G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "NO ~/.zen/secret.dunikey EXIT" && exit 1 +IPFSNODEID=$(ipfs --timeout=20s id -f='\n' 2>/dev/null) && [[ "$IPFSNODEID" == "" ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1 +[ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport ] && echo 'ASTROPORT NOT READY' && exit 1 + + +###### MOVE MAP FROM SELF IPNS INDEX +if [ ! -d ~/.zen/ipfs/map ]; then + mv ~/.zen/ipfs/.$IPFSNODEID/astroport/map ~/.zen/ +else + exit 0 +fi +## TODO CREATE SPECIAL IPNS KEY FOR SHARING + +##############################################################" +## DO NOT RECORD output.pdf, bu convert to jpg and link throug index.html REDIRECT +##############################################################" + + for pdflink in $(ls ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/*/bulle.pdf); do + lid=$(echo $pdflink | cut -d '/' -f 11) + ## PDF convert and crop to JPG / ipfs add / index.html for redirect + convert -density 200 -quality 80 $pdflink /tmp/bulle.jpg + convert -crop 1260x420+55+30 /tmp/bulle.jpg /tmp/$lid.jpg + + IPFS=$(ipfs add -wq "/tmp/$lid.jpg") ## Add $lid.pdf to IPFS + IPFSREPFILEID=$(echo $IPFS | cut -d ' ' -f 2) ## Get repertory ipfs link + [[ "$IPFSREPFILEID" == "" ]] && echo "IPFS ADD TROUBLE. CONTINUE" && exit 1 + ## Create index.html with Redirect to /ipfs/$IPFSREPFILEID/$lid.jpg + echo "" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html + # mv ./output.pdf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf + rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null + echo "NOW LIEU redirect to http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$lid.jpg" + cat ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html + + done + +exit 0 diff --git a/actions/p4n.swarmscraper.sh b/actions/p4n.swarmscraper.sh new file mode 100755 index 0000000..16a28ac --- /dev/null +++ b/actions/p4n.swarmscraper.sh @@ -0,0 +1,169 @@ +#!/bin/bash +######################################################################## +# Author: Astrocrew +# Version: 0.1 +# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) +######################################################################## +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" +countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l) +[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0 + +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 +G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "NO ~/.zen/secret.dunikey EXIT" && exit 1 +IPFSNODEID=$(ipfs --timeout=20s id -f='\n' 2>/dev/null) && [[ $IPFSNODEID == "" ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1 +[ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport ] && echo 'ASTROPORT NOT READY' && exit 1 + + +## INSTALL MISSING PACKAGES +if [[ -f /etc/sudoers.d/apt ]]; then + for i in chromium nmap httrack imagemagick; do + if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + sudo apt install -y $i + fi + done +else + echo "No sudo access for apt install... Please correct situation" + echo "PUT : $USER ALL=(ALL) NOPASSWD:/usr/bin/apt INTO /etc/sudoers.d/apt (use sudo visudo)" + exit 1 +fi +##############################################################" +## Backing up europa p4n collected spots from collective intelligence ## +# SWARM is collectively PLAYing bataille navale +# Randomly get geaodata in south europe +# FOCUS on SOUTH EUROPE +# LON = -10 to 30 +# LAT = 35 to 60 +# https://fr.mapsofworld.com/lat_long/europe.html +##############################################################" +# initial first spot. +lon=0 +lat=40 +try=1 + +# Randomly choose spot from in RANGE $lat.$lon +while [[ $(ls ~/.zen/ipfs_swarm/.*/astroport/map/$lat.$lon/p4n/spot.json 2>/dev/null) ]]; do + echo "astroport/$lat.$lon geodata already swarm captured. CONTINUE" + FLOOR=-5; #-10; + CEILING=10; #30 + RANGE=$(($CEILING-$FLOOR+1)); + RESULT=$RANDOM; + let "RESULT %= $RANGE"; + lon=$(($RESULT+$FLOOR)); +#echo $lon + + FLOOR=40; #35; + CEILING=50; #60; + RANGE=$(($CEILING-$FLOOR+1)); + RESULT=$RANDOM; + let "RESULT %= $RANGE"; + lat=$(($RESULT+$FLOOR)); +#echo $lat + try=$(($try+1)); + [ $try -eq 99 ] && break ## tirages aléatoire maximum +done + +##############################################################" +## $lat.$lon GEODATA NOT SCRAPED YET ? +##############################################################" +if [ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/ ]; then +### ADD Spot randomness + # Fuzzle geoloc + one=$(echo "000$RANDOM$RANDOM$RANDOM" | cut -b1-12) + latitude="$lat.$one" + two=$(echo "000$RANDOM$RANDOM$RANDOM" | cut -b1-12) + longitude="$lon.$two" + +### SCRAPE P4N + ## curl spot.json into /astroport/map/$lat.$lon/p4n/spot.json + echo "GETTING /astroport/map/$lat.$lon/p4n/spot.json" + mkdir -p ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/ + echo "https://www.park4night.com/services/V3/getLieuxAroundMeLite.php?latitude=$latitude&longitude=$longitude" + curl -s "https://www.park4night.com/services/V3/getLieuxAroundMeLite.php?latitude=$latitude&longitude=$longitude" -o ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/spot.json + echo "SAVED ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/spot.json" + ## TODO REFRESH OLD spot.json +fi + +##############################################################" +## GEODATA. continue. Let's extract lieu pdf from my spot +##############################################################" +geosrc=$(ls ~/.zen/{ipfs,ipfs_swarm}/.*/astroport/map/$lat.$lon/p4n/spot.json 2>/dev/null) +geodata=$(echo "$geosrc" | tail -n 1) +ipfsnodeid=$(echo "$geodata" | cut -d '/' -f 6 | cut -d '.' -f 2) + +if [[ "$ipfsnodeid" != "$IPFSNODEID" ]]; then + echo "This spot.json is managed by + $geosrc" + echo "getting geodata from one of mine" + geodata=$(ls ~/.zen/ipfs/.*/astroport/map/*.*/p4n/spot.json | shuf | tail -n 1) +fi + +[[ $geodata ]] && ipfsnodeid=$(echo "$geodata" | cut -d '/' -f 6 | cut -d '.' -f 2) || exit 1 + +## SUB-SCRAPE SOME of my p4n/spot.json RANDOM "lieu" +echo "SUB-SCRAPING lieu FROM $geodata" + + loop=1 + while [ $loop -lt 21 ]; do + #{"id":"208264","latitude":"40.730727","longitude":"0.367303","hauteur_limite":"0.00","publique":"1","top_liste":"0","code":"APN","validation_admin":"1","distance":"97.341"} + # flatten json + + lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1) + ## GET RANDOM LIEU ID AND TRY MORE TO GET ( prefered APN) + lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7) + [[ "$code" != "APN" ]] && [ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1) + lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7) + [[ "$code" != "APN" ]] && [ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1) + lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7) + [[ "$code" != "APN" ]] && [ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1) + lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7) + [ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1) + lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7) + [ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1) + lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7) + + [[ "$lid" == "" ]] && echo "ERROR LIEU NO ID. CONTINUE" && loop=$(($loop+1)) && continue + + + mkdir -p /tmp/$lid && cd /tmp/$lid + echo "Downloading https://www.park4night.com/?page=lieu&id=$lid&bulle=YES" + mkdir -p ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code + echo "id,latitude,longitude,hauteur_limite,publique,top_liste,code,validation_admin,distance" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt + echo "$lieu" >> ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt + cat ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt + + # Get 1st copy bulle.pdf... Now converting to index.html redirect to $lid.jpg + [ -f ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf ] && mv ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf ./output.pdf && echo "ancien fichier bulle.pdf" + [ ! -f ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html ] && echo "running chromium... " && chromium --timeout=10000 --headless --no-sandbox --disable-gpu --print-to-pdf=output.pdf "https://www.park4night.com/?page=lieu&id=$lid&bulle=YES" 2>/dev/null + [ ! -f ./output.pdf ] && rm -Rf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid && echo "## CHROMIUM TIMEOUT, CANCEL MISSION" && loop=$(($loop+1)) && continue + + ## PDF convert and crop to JPG / ipfs add / index.html for redirect + if [ -f ./output.pdf ]; then + convert -density 200 -quality 80 ./output.pdf ./bulle.jpg + convert -crop 1260x420+55+30 ./bulle.jpg ./$lid.jpg + + IPFS=$(ipfs add -wq "./$lid.jpg") && echo "## Added $lid.pdf to IPFS: $IPFS" + IPFSREPFILEID=$(echo $IPFS | cut -d ' ' -f 2) && echo "## Repertory $IPFSREPFILEID" + [[ "$IPFSREPFILEID" == "" ]] && echo "IPFS ADD TROUBLE. CONTINUE" && rm -Rf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid && rm -Rf /tmp/$lid && loop=$(($loop+1)) && continue + ## Create index.html with Redirect to /ipfs/$IPFSREPFILEID/$lid.jpg + echo "" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html + # mv ./output.pdf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf + rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null + echo "NOW LIEU redirect to http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$lid.jpg" + rm ./$lid.jpg + rm ./bulle.jpg + fi + + cd - + sleep $((1 + RANDOM % 2)) + rm -Rf /tmp/$lid + + loop=$(($loop+1)); + done + +## CHECK SWARM GEODATA MAP +# ls -d ~/.zen/ipfs_swarm/.*/astroport/map/*/ | rev | cut -d '/' -f 2 | rev | sort +## NB OF lieu: ls -d ~/.zen/ipfs_swarm/.*/astroport/map/p4n/lieu/*/ | rev | cut -d '/' -f 2 | rev | sort | wc +# ipfs cat /ipns/$IPFSNODEID/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/spot.json | jq +exit 0 diff --git a/actions/view_counter_increment_or_allow.sh b/actions/view_counter_increment_or_allow.sh new file mode 100755 index 0000000..5095ece --- /dev/null +++ b/actions/view_counter_increment_or_allow.sh @@ -0,0 +1,78 @@ +#!/bin/bash +######################################################################## +# Author: Astrocrew +# Version: 0.1 +# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) +######################################################################## +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" +countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l) +[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0 + +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 +G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "NO ~/.zen/secret.dunikey EXIT" && exit 1 +IPFSNODEID=$(ipfs --timeout=20s id -f='\n') && [[ ! $IPFSNODEID ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1 + +MEDIAKEYIPNS="$1"&& [[ ! $MEDIAKEYIPNS ]] && echo 'NO MEDIAKEY. Enter ipns/??? value. EXIT' && exit 1 +OPENACCES="$2" && [[ ! $OPENACCES ]] && echo 'OPEN ACCES TO "$2=$G1PUB"' + +tempdir=$(mktemp -d) +cd $tempdir + +## GET CURRENT DHT PROPAGATED VERSION +ipfs --timeout=10s get --output="$tempdir" /ipns/$MEDIAKEYIPNS +[[ ! $? == 0 ]] && echo "CANNOT GET MEDIAKEY" && exit 1 + +## DO I OWN THE KEY, OR SHOUD I REQUEST IT +MEDIAKEY=$(cat ./*/.id | tail -n 1) +[[ ! $MEDIAKEY ]] && echo "MISSING MATCHING MEDIAKEY ID" && exit 1 +if [[ ! $(ipfs key list -l | grep $MEDIAKEY) ]]; then + ## SEND A MESSAGE ASKING FOR THE KEY (I am a bootstrap or http gateway) + for sharedowners in $(ls -d */ | cut -d '/' -f 1); do + ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d "$sharedowners" -t "MEDIAKEY ask for sharing contract" -m "I was wishing to increment $MEDIAKEY views, but not in your contracts yet. Please run ~/.zen/astrXbian/actions/view_counter_increment_or_allow.sh $MEDIAKEYIPNS $G1PUB to activate." + done + exit 1 +fi + +## INCREMENT COUNTER +## GO INTO $G1PUB EXCHANGE SPACE +[[ ! -d ./$G1PUB ]] && echo "MISSING RELATION WITH $G1PUB. EXIT" && exit 1 +cd $G1PUB +count=$(cat .views.counter 2>/dev/null) || count=0 +echo $((count+1)) > .views.counter + + +if [[ $OPENACCES ]]; then + echo "Creating ${OPENACCES}/.ipns.mediakey.encrypt and .ipfsid.encrypt" + ## CREATE OFFICIAL RELATION DETECTED BY autoPINfriends.sh with ~/.zen/ipfs_swarm/.12D*/KEY/*/*/${G1PUB}/.ipfsid.encrypt + mkdir -p /home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${OPENACCES}/ + key2send=$(/home/$YOU/.zen/astrXbian/zen/tools/give_me_keystore_filename.py $MEDIAKEY) + /home/$YOU/.zen/astrXbian/zen/tools/natools.py encrypt -p ${OPENACCES} -i /home/$YOU/.ipfs/keystore/$key2send -o /home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${OPENACCES}/.ipns.mediakey.encrypt + + /home/$YOU/.zen/astrXbian/zen/tools/natools.py decrypt -f pubsec -k "/home/$YOU/.zen/secret.dunikey" -i "/home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.ipfsid.encrypt" -o "./ipfsid_$MEDIAKEY.txt" + /home/$YOU/.zen/astrXbian/zen/tools/natools.py encrypt -p ${OPENACCES} -i ./ipfsid_$MEDIAKEY.txt -o /home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${OPENACCES}/.ipfsid.encrypt + ## Ask PIN to Bootstraps executed through autoPINfriends.sh + rm ./ipfsid_$MEDIAKEY.txt + + + + ## TODO COULD SEND JUNE FOR THAT? + syncronizedir="/home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}" +else + syncronizedir="$tempdir" +fi + +echo "WE ARE in $syncronizedir" +cd $syncronizedir +## PUBLISH NEW STATE +I=$(ipfs add -qrH $syncronizedir | tail -n 1) +echo "CHAIN: $I" +echo "$(date -u +%s%N | cut -b1-13)" > .timestamp +echo $I > .chain +I=$(ipfs add -qrH $syncronizedir | tail -n 1) +echo "${MEDIAKEY} NAME PUBLISHING " +# MEDIAKEY IPNS name publish +J=$(ipfs --timeout=180s name publish --quieter -k ${MEDIAKEY} /ipfs/${I}) +echo "$MEDIAKEY VIEW COUNTER UPDATED in https://tube.copylaradio.com/ipns/$J/$G1PUB/.views.counter" + diff --git a/ajouter_video.sh b/ajouter_video.sh index 2590054..7cec7cd 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -6,27 +6,50 @@ ######################################################################## # SCRIPT INTERACTIF POUR AJOUTER UN FICHIER à ASTROPORT/KODI # -# 1. CAT: film, serie, anime +# 1. CAT: film, serie # 2. TMDB: ID de la fiche sur https://www.themoviedb.org/ # 3. TITLE: Titre de la vidéo # 4. YEAR: Année de la vidéo # 5. RES: Résolution 1080p, 4K, SD, 720, HD -# 6. SAISON: Pour les séries et animes, c'est le numéro de saison. +# 6. SAISON: Pour les séries, c'est le numéro de saison. # Pour un film, le champ SAISON est utilisé pour renseigner la Saga -# 7. GENRES: Action, Aventure, Fantastique, Animation, etc (choix multiple). -# 8. GROUPES: Permet de regrouper des films. (choix multiple) -# +# 7. GENRES: Action, Aventure, Fantastique, Animation, etc (choix multiple). +# 8. GROUPES: Stocker la clef IPNS du MEDIAKEY. +# # https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films ######################################################################## MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" + +G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) ######################################################################## [[ $(which ipfs) == "" ]] && echo "ERREUR! Installez ipfs" && echo "wget https://git.p2p.legal/axiom-team/astrXbian/raw/master/.install/ipfs_alone.sh -O /tmp/ipfs_install.sh && chmod +x /tmp/ipfs_install.sh && /tmp/ipfs_install.sh" && exit 1 [[ $(which zenity) == "" ]] && echo "ERREUR! Installez zenity" && echo "sudo apt install zenity" && exit 1 [[ $(which ffmpeg) == "" ]] && echo "ERREUR! Installez ffmpeg" && echo "sudo apt install ffmpeg" && exit 1 [[ $(which xdpyinfo) == "" ]] && echo "ERREUR! Installez x11-utils" && echo "sudo apt install x11-utils" && exit 1 +# Check who is .current PLAYER +PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) +PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 ) +G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 ) +IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 ) +PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 ) +MOANS=$(cat ~/.zen/game/players/.current/.moans 2>/dev/null) || ( echo "noplayermoans" && exit 1 ) +QOOPNS=$(cat ~/.zen/game/players/.current/.qoopns 2>/dev/null) || ( echo "noplayerqoopns" && exit 1 ) + + +URL="$1" +if [ $URL ]; then + echo "URL: $URL" + REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_" + [ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Que copier depuis cette source ?" --entry-text="Video" MP3 Web) || IMPORT="Youtube" + [[ $IMPORT == "Video" ]] && IMPORT="Youtube" + CHOICE="$IMPORT" +fi + +[[ $CHOICE == "Web" ]] && CHOICE="Page" #&& CHOICE=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Cette source Web est à enregistrer comme " --entry-text="Page" WebSite) + # REMOVE GtkDialog errors for zenity shopt -s expand_aliases alias zenity='zenity 2> >(grep -v GtkDialog >&2)' @@ -39,14 +62,14 @@ large=$((width-300)) haut=$((height-200)) ######################################################################## -IPFSNODEID=$(ipfs id -f='\n') -[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) || XZUID=$(cat /etc/hostname) -[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) +[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XGUID="$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)" || XGUID="$(cat /etc/hostname)" +[[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player) -zenity --warning --width 300 --text "Ajoutez une vidéo à ASTROPORT/KODI" - -## CADRE EXCEPTION COPIE PRIVE # https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/ -if [[ ! -f ~/.zen/legal ]]; then +######################################################################## +## CADRE EXCEPTION COPIE PRIVE +# https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/ +if [[ ! -f ~/.zen/game/players/.current/legal ]]; then zenity --width ${large} --height=${haut} --text-info \ --title="Action conforme avec le Code de la propriété intellectuelle" \ --html \ @@ -56,52 +79,108 @@ zenity --width ${large} --height=${haut} --text-info \ case $? in 0) echo "AUTORISATION COPIE PRIVE ASTROPORT OK !" - echo "$G1PUB" > ~/.zen/legal - # next step - ;; + echo "$G1PUB" > ~/.zen/game/players/.current/legal + # next step + ;; 1) echo "Refus conditions" - rm -f ~/.zen/legal + rm -f ~/.zen/game/players/.current/legal exit 1 - ;; + ;; -1) echo "Erreur." exit 1 - ;; + ;; esac fi + +## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) +[[ ! $YOU ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS OFF" --text="Activer Astroport ?" --entry-text="OUI" NON) && [[ $RUN == "" || $RUN == "NON" ]] && exit 1 +[[ $YOU && ! $1 ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS ON" --text="Désactiver Astroport ? Non, vous voulez ajouter un Media?" --entry-text="OUI" NON) +## DES/ACTIVATION ASTROPORT +if [[ $RUN == "OUI" ]]; then + STRAP=$(ipfs bootstrap) + BOOT=$(zenity --entry --width 300 --title="Catégorie" --text="$STRAP Changez de Bootstrap" --entry-text="Aucun" astrXbian Public) + [[ $BOOT == "Aucun" ]] && ipfs bootstrap rm --all + [[ $BOOT == "astrXbian" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done + [[ $BOOT == "Public" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_public.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done + REP=$(~/.zen/astrXbian/zen/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP" +fi +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) +[[ $YOU == "" ]] && echo "IPFS not running" && exit 1 + +######################################################################## # CHOOSE CATEGORY (remove anime, not working!) -CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre vidéo" --entry-text="Film" Anime Serie KODI Youtube MP3) +[[ $CHOICE == "" ]] && CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre ajout" --entry-text="Film" Serie Youtube Video Astronaute) [[ $CHOICE == "" ]] && exit 1 # LOWER CARACTERS CAT=$(echo "${CHOICE}" | awk '{print tolower($0)}') -PREFIX=$(echo "${CAT}" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, S, A, Y, M ... +# UPPER CARACTERS +CHOICE=$(echo "${CAT}" | awk '{print toupper($0)}') + +PREFIX=$(echo "${CAT}" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, S, A, Y, M ... P W [[ $PREFIX == "" ]] && exit 1 +######################################################################## +######################################################################## case ${CAT} in ######################################################################## -# CASE ## YOUTUBE +# CASE ## ASTRONAUTE +# _ _ +# __ _ ___| |_ _ __ ___ _ __ __ _ _ _| |_ ___ +# / _` / __| __| '__/ _ \| '_ \ / _` | | | | __/ _ \ +# | (_| \__ \ |_| | | (_) | | | | (_| | |_| | || __/ +# \__,_|___/\__|_| \___/|_| |_|\__,_|\__,_|\__\___| +# +# ######################################################################## - youtube) + astronaute) -zenity --warning --width ${large} --text 'ATTENTION ZONE EN TRAVAUX!!! ANNULER OU PROGRAMMEZ ASTROPORT' - -YTURL=$(zenity --entry --width 300 --title "Lien ou identifiant à copier" --text "Indiquez le lien (URL) ou l'ID de la vidéo" --entry-text="") +# INSTASCAN G1PUB CAPTURE +~/.zen/Astroport.ONE/tools/instascan_login.sh "ONE" + +if [[ $CAPTAIN == $PLAYER ]]; then + zenity --warning --width 300 --text "Bienvenue $PLAYER" + +fi + + exit 0 + ;; +######################################################################## +# CASE ## YOUTUBE +# _ _ +# _ _ ___ _ _| |_ _ _| |__ ___ +#| | | |/ _ \| | | | __| | | | '_ \ / _ \ +#| |_| | (_) | |_| | |_| |_| | |_) | __/ +# \__, |\___/ \__,_|\__|\__,_|_.__/ \___| +# |___/ +######################################################################## + youtube) + +YTURL="$URL" +[[ $YTURL == "" ]] && YTURL=$(zenity --entry --width 300 --title "Lien ou identifiant à copier" --text "Indiquez le lien (URL) ou l'ID de la vidéo" --entry-text="") [[ $YTURL == "" ]] && exit 1 +REVSOURCE="$(echo "$YTURL" | awk -F/ '{print $3}' | rev)_" + # Create TEMP directory to copy $YID_$TITLE.$FILE_EXT -YTEMP="/tmp/$(date -u +%s%N | cut -b1-13)" +YTEMP="$HOME/astroport/tmp/$(date -u +%s%N | cut -b1-13)" mkdir -p ${YTEMP} # youtube-dl $YTURL echo "VIDEO $YTURL" -/usr/local/bin/youtube-dl -f '[height=720]/best' \ ---write-info-json --write-annotations \ +if [[ ! -f /usr/local/bin/youtube-dl ]]; then + sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl + sudo chmod a+rx /usr/local/bin/youtube-dl +fi +/usr/local/bin/youtube-dl -f '[height=360]/best' \ +--no-playlist --write-info-json \ --no-mtime -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" $YTURL # Get filename, extract ID, make destination dir and move copy. -YFILE=$(ls -t ${YTEMP} | head -n 1) +YFILE=$(ls -S ${YTEMP} | head -n 1) FILE_NAME="$(basename "${YFILE}")" FILE_EXT="${FILE_NAME##*.}" @@ -110,12 +189,12 @@ JSON_FILE=$(echo ${FILE_NAME} | sed "s/${FILE_EXT}/json/g") YID=$(echo "${FILE_NAME}" | cut -d "&" -f 1) YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | sed "s/[(][^)]*[)]//g" | sed -e 's/[^A-Za-z0-9._-]/_/g' | sed -e 's/__/_/g' ) # Remove YoutubeID_ and (what is in perentheses) [[ $(which detox) ]] && YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | detox --inline) -TMDB="${YID}" +MEDIAID="$REVSOURCE${YID}" TITLE="${YNAME%.*}" - +MEDIAKEY="YOUTUBE_${MEDIAID}" ## CORRECT PARAMETERS to Make Kodi compatible YASTRXBIAN FILE -GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut} \ +[ ! $2 ] && GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut} \ --text="Choisissez le(s) genre(s) d'information(s) contenue(s) dans cette vidéo \"${TITLE}\" publiée sur OASIS" \ --column="Use" \ --column="Feature" \ @@ -132,11 +211,11 @@ GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut} \ FALSE Humain \ FALSE Animal \ TRUE Eveil \ - TRUE ${AXID// /-}) + TRUE ${XZUID// /-}) || GENRES="${XZUID// /-}" # FORMAT GENRES genre1|genre2|genre3 -FILE_PATH="$HOME/astroport/youtube/$YID" +FILE_PATH="$HOME/astroport/youtube/$MEDIAID" mkdir -p ${FILE_PATH} && mv -f ${YTEMP}/* ${FILE_PATH}/ # rename FILE_NAME to YNAME (URL clean) mv "${FILE_PATH}/${FILE_NAME}" "${FILE_PATH}/${YNAME}" && FILE_NAME="${YNAME}" @@ -144,30 +223,79 @@ mv "${FILE_PATH}/${FILE_NAME}" "${FILE_PATH}/${YNAME}" && FILE_NAME="${YNAME}" jsonfile=$(ls ${FILE_PATH}/*.json) mv "${jsonfile}" "${FILE_PATH}/video.json" -GROUPES="_IPNSKEY_" # USE GROUPS TO RECORD IPNS MEDIAKEY - FILE_RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "${FILE_PATH}/${FILE_NAME}" | cut -d "x" -f 2) RES=${FILE_RES%?}0p -## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt" and video.json +## CREATE "~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt" and video.json URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri) -echo "youtube;${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${TMDB}/ajouter_video.txt +echo "youtube;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt # _IPFSREPFILEID_ is replaced later rm -Rf ${YTEMP} - ;; + ;; + +######################################################################## +# CASE ## WEB + web) + + ## wget current URL -> index.html ## TEST ## TEST httrack ?? + [[ ! $(which httrack) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de site web absent.. Lancez la commande 'sudo apt install httrack'" && exit 1 + echo "httrack --mirror $URL" + FILE_NAME="index.html" + REVSOURCE="$(echo "$URL" | rev | sha256sum | cut -d ' ' -f 1)_"; echo $REVSOURCE # URL="https://discuss.ipfs.io/t/limit-ipfs-get-command/3573/6" + MEDIAID="$REVSOURCE" # MEDIAID=1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_ + MEDIAKEY="WWW_${MEDIAID}" # MEDIAKEY=PAGE_1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_ + FILE_PATH="$HOME/astroport/web/$MEDIAID"; + mkdir -p $FILE_PATH + + wget -mpck --user-agent="" -e robots=off --wait 1 "$URL" > ${FILE_PATH}/ + + echo "web;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt + + zenity --warning --width ${large} --text "Vérifiez que la copie de votre site se trouve bien dans ${FILE_PATH}/" + + ;; + + +######################################################################## +# CASE ## PAGE + page) + + ## record one page to PDF + [[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1 + cd /tmp/ && rm -f output.pdf + chromium --headless --no-sandbox --print-to-pdf $URL + + TITLE=$(zenity --entry --width 480 --title "Titre" --text "Quel nom de fichier à donner à cette page ? " --entry-text="${URL}") + [[ $TITLE == "" ]] && exit 1 + FILE_NAME="$(echo "${TITLE}" | detox --inline).pdf" ## TODO make it better + + MEDIAID="$REVSOURCE$(echo "${TITLE}" | detox --inline)" + MEDIAKEY="PAGE_${MEDIAID}" + FILE_PATH="$HOME/astroport/page/$MEDIAID" + mkdir -p ${FILE_PATH} && mv output.pdf ${FILE_PATH}/${FILE_NAME} + + echo "page;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt + + ;; ######################################################################## # CASE ## MP3 +# _____ +# _ __ ___ _ __|___ / +#| '_ ` _ \| '_ \ |_ \ +#| | | | | | |_) |__) | +#|_| |_| |_| .__/____/ +# |_| ######################################################################## - mp3) + mp3) -zenity --warning --width ${large} --text 'ATTENTION ZONE EN TRAVAUX!!! ANNULER OU PROGRAMMEZ ASTROPORT' +zenity --warning --width 600 --text 'DEV ZONE . Please Participate https://git.p2p.legal' # Create TEMP directory -YTEMP="/tmp/$(date -u +%s%N | cut -b1-13)" +YTEMP="$HOME/astroport/tmp/$(date -u +%s%N | cut -b1-13)" mkdir -p ${YTEMP} artist=$(zenity --entry --width 400 --title "Extraction MP3 depuis Youtube" --text "Artiste recherché ou Lien Youtube" --entry-text="") @@ -178,12 +306,12 @@ length=${#artist} islink=$(echo "$artist" | grep "http") if [[ ! $islink && $length != 11 ]] then - # Ask for song name - song=$(zenity --entry --width 300 --title "Titre à chercher sur Youtube" --text "Titre recherché" --entry-text="") - [[ $song == "" ]] && exit 1 + # Ask for song name + song=$(zenity --entry --width 300 --title "Titre à chercher sur Youtube" --text "Titre recherché" --entry-text="") + [[ $song == "" ]] && exit 1 else - song=$(zenity --entry --width 300 --title "Confirmer ID" --text "Titre recherché (ou confirmer la saisie précédente)" --entry-text="$artist") - [[ "$song" == "$artist" ]] && song="" + song=$(zenity --entry --width 300 --title "Confirmer ID" --text "Titre recherché (ou confirmer la saisie précédente)" --entry-text="$artist") + [[ "$song" == "$artist" ]] && song="" fi # Download mp3 from 1st youtube search video result (--write-info-json) @@ -200,7 +328,7 @@ FILE_EXT="${FILE_NAME##*.}" YID=$(echo "${FILE_NAME}" | cut -d "&" -f 1) YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | sed "s/[(][^)]*[)]//g" | sed -e 's/[^A-Za-z0-9._-]/_/g' | sed -e 's/__/_/g') # Remove YoutubeID_ and (what is in perentheses) -[[ $(which detox) ]] && YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | detox --inline) +[[ $(which detox) ]] && YNAME="$(echo "${FILE_NAME}" | cut -d "&" -f 2- | detox --inline)" [[ ! $islink && "$song" != "" ]] && FILE_PATH="$HOME/astroport/$CAT/$artist/_o-o_" \ || FILE_PATH="$HOME/astroport/$CAT/${YID}" @@ -209,27 +337,33 @@ mkdir -p "${FILE_PATH}" && mv -f ${YTEMP}/* "${FILE_PATH}/" # Remove "&" from FILE_NAME rename to YNAME mv "${FILE_PATH}/${FILE_NAME}" "${FILE_PATH}/${YNAME}" && FILE_NAME="${YNAME}" -TMDB="${YID}" +MEDIAID="${YID}" TITLE="${YNAME%.*}" -GENRES="[\"$AXID\"]" +GENRES="[\"$XZUID\"]" GROUPES="_IPNSKEY_" # USE GROUPS TO RECORD IPNS MEDIAKEY +MEDIAKEY="MP3_$MEDIAID" rm -Rf ${YTEMP} # zenity --warning --width ${large} --text "MP3 copié" echo "~/.zen/astrXbian/zen/new_mp3_in_astroport.sh \"${FILE_PATH}/\" \"${FILE_NAME}\"" -~/.zen/astrXbian/zen/new_mp3_in_astroport.sh "${FILE_PATH}/" "${FILE_NAME}" > /tmp/${CAT}_${TMDB}.log 2>&1 +~/.zen/astrXbian/zen/new_mp3_in_astroport.sh "${FILE_PATH}/" "${FILE_NAME}" > /tmp/${CHOICE}_${MEDIAID}.log 2>&1 -cat /tmp/${CAT}_${TMDB}.log +cat /tmp/${CHOICE}_${MEDIAID}.log exit 0 - ;; + ;; ######################################################################## -# CASE ## film serie anime +# __ _ _ +# / _(_) |_ __ ___ +#| |_| | | '_ ` _ \ +#| _| | | | | | | | +#|_| |_|_|_| |_| |_| THE MOVIE DATABASE INDEX +# ######################################################################## - film | serie | anime) - + film | serie) + # SELECT FILE TO ADD TO ASTROPORT/KODI FILE=$(zenity --file-selection --title="Sélectionner le fichier à ajouter") echo "${FILE}" @@ -242,16 +376,20 @@ FILE_EXT="${FILE_NAME##*.}" FILE_TITLE="${FILE_NAME%.*}" # OPEN default browser and search TMDB -zenity --question --width 300 --text "IMPORTANT! Nous allons ouvrir le site themoviedb pour y récuperer le numéro d'identification de votre vidéo" -[ $? == 1 ] && exit 1 -xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')" +zenity --question --width 300 --text "Ouvrir https://www.themoviedb.org pou récupérer le numéro d'identification de $(echo ${FILE_TITLE} | sed 's/_/%20/g') ?" +[ $? == 0 ] && xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')" -TMDB=$(zenity --entry --title="Identification TMDB" --text="Indiquez le numéro de la fiche du film. Exemple: 301528 (à extraire du lien https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="") -[[ $TMDB == "" ]] && exit 1 -if ! [[ "$TMDB" =~ ^[0-9]+$ ]] +MEDIAID=$(zenity --entry --title="Identification TMDB" --text="Copiez le nom de la page du film. Ex: 301528-toy-story-4 pour une adresse https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="") +[[ $MEDIAID == "" ]] && exit 1 +CMED=$(echo $MEDIAID | cut -d '-' -f 1) +TMTL=$(echo $MEDIAID | cut -d '-' -f 2-) # contient la fin du nom de fichier tmdb (peut servir?) + +if ! [[ "$CMED" =~ ^[0-9]+$ ]] then zenity --warning --width ${large} --text "Vous devez renseigner un numéro! Merci de recommencer... Seules les vidéos référencées sur The Movie Database sont acceptées." && exit 1 fi +MEDIAID=$CMED +MEDIAKEY="TMDB_$MEDIAID" # VIDEO TITLE TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}") @@ -267,7 +405,7 @@ RES=${FILE_RES%?}0p # Rounding. Replace last digit with 0 #RES=$(zenity --entry --width 300 --title="Résolution" --text="Résolution de la vidéo" --entry-text="${FILE_RES}" SD HD 4K 360p 480p 720p 1080p) # VIDEO SEASON or SAGA -[[ "${CAT}" == "serie" || "${CAT}" == "anime" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saison" --text "Indiquez SAISON et EPISODE. Exemple: S02E05" --entry-text="") +[[ "${CAT}" == "serie" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saison" --text "Indiquez SAISON et EPISODE. Exemple: S02E05" --entry-text="") [[ "${CAT}" == "film" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saga" --text "Indiquez une SAGA (optionnel). Exemple: James Bond" --entry-text="") # VIDEO GENRES @@ -314,70 +452,196 @@ FILM_GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut}\ FALSE Telefilm\ FALSE Thriller\ FALSE Western\ - TRUE ${AXID// /-}) + TRUE ${XZUID// /-}) # FORMAT GENRES ["genre1","genre2"] GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]" -# VIDEO GROUP -# GROUPES=$(zenity --entry --width 300 --title "Groupe" --text "Associez la vidéo à un groupe (optionnel). Exemple: PIXAR" --entry-text="${AXID}") -GROUPES="_IPNSKEY_" # USE GROUPES TO RECORD MEDIAKEY - # DEBUG VERIFICATION # zenity --question --width ${large} --title "EMBARQUEMENT ASTROPORT! OK?"\ -# --text "${FILE_NAME} (${CAT};${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES})" +# --text "${FILE_NAME} (${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES})" # [ $? == 1 ] && echo "ANNULATION." && exit 1 -### OK MOVING FILE TO ASTROPORT #### -mkdir -p ~/astroport/${CAT}/${TMDB}/ +######################################################################## +# Screen capture is used as thumbnail +######################################################################## +if [[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]]; then + zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA" + sleep 1 + import -window root /tmp/screen.png +fi -mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${TMDB}/${TITLE}.${FILE_EXT}" && zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${TMDB}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK puis patientez quelques minutes..." +################################### +### MOVING FILE TO ~/astroport #### +################################### +mkdir -p ~/astroport/${CAT}/${MEDIAID}/ +mv /tmp/screen.png ~/astroport/${CAT}/${MEDIAID}/screen.png + +mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}" + +if [ $? == 0 ]; then + zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK, nous allons préparer son script d'ajout à Astroport..." +else + zenity --warning --width ${large} --text "Impossible de déplacer votre fichier ${FILE_PATH}/${FILE_NAME} vers ~/astroport - EXIT -" + exit 1 +fi FILE_NAME="${TITLE}.${FILE_EXT}" -## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt" + +## CREATE "~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt" URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri) -echo "${CAT};${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${TMDB}/ajouter_video.txt +echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt # _IPFSREPFILEID_ is replaced later - ;; + ;; +# _ _ +#__ _(_) __| | ___ ___ +#\ \ / / |/ _` |/ _ \/ _ \ +# \ V /| | (_| | __/ (_) | +# \_/ |_|\__,_|\___|\___/ +# TIMESTAMP INDEX + + video) + + zenity --warning --width 600 --text 'DEVELOPPEMENT. SVP. Inscrivez-vous sur https://git.p2p.legal' + + ## GENERAL MEDIAKEY for uploaded video. Title + Decription + hashtag + hashipfs + # SELECT FILE TO ADD TO ASTROPORT/KODI + FILE=$(zenity --file-selection --title="Sélectionner le fichier vidéo à ajouter") + echo "${FILE}" + [[ $FILE == "" ]] && exit 1 + + # Remove file extension to get file name => STITLE + FILE_PATH="$(dirname "${FILE}")" + FILE_NAME="$(basename "${FILE}")" + FILE_EXT="${FILE_NAME##*.}" + FILE_TITLE="${FILE_NAME%.*}" + # VIDEO TITLE + TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}") + [[ $TITLE == "" ]] && exit 1 + TITLE=$(echo "${TITLE}" | sed "s/[(][^)]*[)]//g" | sed -e 's/;/_/g' ) # Clean TITLE (NO ;) + + OUTPUT=$(zenity --forms --width ${large} --title="METADATA" --text="Ajouter des métadonnées" --separator=";" --add-entry="Sous titres" --add-entry="Hashtag(s)") + [[ $? != 0 ]] && echo "FAIL" && exit 1 + + DESCRIPTION=$(awk -F ';' '{print $1}' <<<$OUTPUT) + HASHTAG=$(awk -F ';' '{print $2}' <<<$OUTPUT) + + ## video_timestamp INDEX + MEDIAID="$(date -u +%s%N | cut -b1-13)" + mkdir -p ~/astroport/${CAT}/${MEDIAID}/ + MEDIAKEY="VIDEO_${MEDIAID}" + + ## CREATE SIMPLE JSON + jq -n --arg ts "$MEDIAID" --arg title "$TITLE" --arg desc "$DESCRIPTION" --arg htag "$HASHTAG" '{"timestamp":$ts,"ipfs":"_IPFSREPFILEID_","ipns":"_IPNSKEY_","title":$title,"desc":$desc,"htag":$htag}' > ~/astroport/${CAT}/${MEDIAID}/video.json + ## MOVE FILE TO IMPORT ZONE + mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}" + FILE_NAME="${TITLE}.${FILE_EXT}" + + ;; - kodi) - - if [[ ! -f $HOME/.local/bin/uqload_downloader ]]; then - cd /tmp - git clone https://github.com/papiche/uqload_downloader.git - cd uqload_downloader/cli - ./download_from_kodi_log.sh - [[ -f $HOME/.local/bin/uqload_downloader ]] && zenity --warning --width ${large} --text "INSTALLATION download_from_kodi_log.sh OK" - cp download_from_kodi_log.sh $HOME/.local/bin/ - else - ## CREATE NEW SHORTCUT - zenity --warning --width ${large} --text "UTILISEZ $HOME/.local/bin/download_from_kodi_log.sh en ligne de commande !!" - exit 0 - fi - - - ;; - ######################################################################## # CASE ## DEFAULT ######################################################################## - *) - - zenity --warning --width ${large} --text "Impossible d'interpréter votre commande $CAT" - exit 1 - - ;; - + *) + + zenity --warning --width ${large} --text "Impossible d'interpréter votre commande $CAT" + exit 1 + + ;; + esac +## Extract thumbnail +MIME=$(file --mime-type $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} | cut -d ' ' -f 2) + +[[ $(echo $MIME | grep video) ]] && ffmpeg -i $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} -r 1/300 -vf scale=-1:120 -vcodec png $HOME/astroport/${CAT}/${MEDIAID}/${CAT}.png +[[ ! -f /astroport/${CAT}/${MEDIAID}/${CAT}.png ]] && echo "DEFAULT THUMBNAIL NEEDED" + ######################################################################## # ADD $FILE to IPFS / ASTROPORT / KODI -echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${TMDB}/\" \"${FILE_NAME}\"" -cat ~/astroport/${CAT}/${TMDB}/ajouter_video.txt +echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\"" $3 +[[ -f ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt ]] && cat ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt +# LOG NOISE # [[ -f ~/astroport/${CAT}/${MEDIAID}/video.json ]] && cat ~/astroport/${CAT}/${MEDIAID}/video.json ######################################################################## -~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/${TMDB}/" "${FILE_NAME}" > /tmp/${CAT}_${TMDB}.log 2>&1 +## CREATION DU FICHIER ajouter_video.txt OK +######################################################################## +### AJOUT DANS IPFS ####################################################### +######################################################################## +####################################new_file_in_astroport.sh################## +######################################################################## +[[ "$CAT" == "film" || "$CAT" == "serie" ]] && CHOICE="TMDB" + +timestamp=$(date -u +%s%N | cut -b1-13) + + +## AUTO DESTRUCTIVE LATER ADD TO ASTROPORT SCRIPT +echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh +#[[ $CHOICE == "TMDB" ]] && echo "echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER.. Sinon saisissez qqch avant...\" +#reponse=\$1 +#[[ ! \$reponse ]] && read reponse +#if [[ ! \$reponse ]]; then +# ffmpeg -i \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" -vcodec libx265 -crf 28 $HOME/astroport/${MEDIAID}.mp4 +# mv \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.old\" +# mv $HOME/astroport/${MEDIAID}.mp4 \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.mp4\" +# ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\" +#else" >> ~/astroport/Add_${MEDIAKEY}_script.sh + +echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" \"$3\"" >> ~/astroport/Add_${MEDIAKEY}_script.sh + +#[[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/astroport/Add_${MEDIAKEY}_script.sh + +echo "rm -f /tmp/\${MEDIAKEY}.pass +rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS +mv ~/astroport/Add_${MEDIAKEY}_script.sh ~/astroport/Done_${FILE_NAME}.sh +" >> ~/astroport/Add_${MEDIAKEY}_script.sh + +chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh + +## DELAYED IPFS ADD TO ASTROPORT ... COULD BE MANAGED BY CRON + +# ~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/${MEDIAID}/" "${FILE_NAME}" > /tmp/${MEDIAKEY}.log 2>&1 +# [ ! $? == 0 ] && zenity --warning --width 300 --text "Désolé une erreur est survenue... Signalez ce log /tmp/${MEDIAKEY}.log sur https://git.p2p.legal/axiom-team/astrXbian" && exit 1 ######################################################################## ######################################################################## -[ $? == 0 ] && zenity --warning --width 300 --text "OK! Votre vidéo a été transférée dans Astroport (/tmp/${CAT}_${TMDB}.log)" && exit 0 \ -|| zenity --warning --width ${large} --height=${haut} --text "Désolé une erreur est survenue... LOG: cat /tmp/${CAT}_${TMDB}.log" && exit 1 +######################################################################## +######################################################################## +######################################################################## +MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY) + +#[ ! $2 ] && zenity --width=500 --height=500 --text-info \ +# --title="QR CODE MEDIA ${MEDIAKEY} (PASS=$(cat /tmp/${MEDIAKEY}.pass))" \ +# --html \ +# --url="http://127.0.0.1:8080/ipns/${IPFSNODEID}/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png" \ +# --checkbox="Je m'engage à respecter les auteurs et promet d'offrir la Monnaie Libre collectée à qui de droit." + +######################################################################## +echo "# ZENBALANCE for ${MEDIAKEY} , WALLET $MEDIAPUBKEY" +######################################################################## +FILE_BSIZE=$(du -b "$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}" | awk '{print $1}') +FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; while( $1>1024 ){ $1/=1024; s++ } printf "%.2f %s", $1, v[s] }') + +#G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $G1PUB) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1) +#if [[ $G1BALANCE -gt 0 ]]; then +# [ ! $2 ] && G1AMOUNT=$(zenity --entry --width 400 --title "VIRER DE LA MONNAIE LIBRE AU MEDIAKEY (MAX $G1BALANCE)" --text "Combien de JUNE (G1) souhaitez-vous offrir à ce MEDIA ($FILE_SIZE)" --entry-text="") +# [[ ! "$G1AMOUNT" =~ ^[0-9]+$ ]] && G1AMOUNT=0 +# ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey pay -p ${MEDIAPUBKEY} -a $G1AMOUNT -c "#ASTROPORT:${MEDIAKEY} DON" +# ZENBALANCE=$(echo "100 * $G1AMOUNT" | bc -l | cut -d '.' -f 1) +#else + ZENBALANCE=0 +#fi +######################################################################## +######################################################################## +if [ $1 ]; then + bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" + [ $? == 0 ] && echo "${MEDIAKEY} is RECORDED in ASTROPORT. GOOD." && exit 0 + +else + zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ + [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \ + && zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \ + && [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \ + && xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \ + || ( zenity --warning --width 300 --text "Désolé une erreur est survenue... cat /tmp/${MEDIAKEY}.log" && exit 1 )\ +fi +exit 0 diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 260c859..8adc0cb 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -18,16 +18,51 @@ source $HOME/.profile [[ ! $(echo $PATH | grep "$HOME/.local/bin") ]] && export PATH="$PATH:$HOME/.local/bin" [[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games" -#### INIT STATION PARAMETERS -[[ $IPFSNODEID ]] && export IPFSNODEID=$IPFSNODEID || export IPFSNODEID=$(ipfs id -f='\n') +#### CONTROL STATION IPFS DAEMON +## timeout is fixing ipfs minimum response time, before considering stuck process +IPFSNODEID=$(ipfs id --timeout=1s | jq -r .ID) +howmany=$(cat /tmp/ipfs.timeout) +if [[ ! $IPFSNODEID ]]; then + ## wait a howmany timeout before restarting ipfs + howmany=$((howmany + 1)) && echo $howmany > /tmp/ipfs.timeout + [ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && echo "IPFS NOT RUNNING" && rm /tmp/ipfs.timeout && rm /config/ipfs/repo.lock && sudo service ipfs restart && exit 1 + [ $howmany -gt 3 ] && [[ -f /etc/sudoers.d/systemctl ]] && echo "IPFS NOT RUNNING $(date)" && rm /tmp/ipfs.timeout && rm /config/ipfs/repo.lock && sudo systemctl restart ipfs + rm ~/.zen/restart.txt + exit 1 +else + echo 0 > /tmp/ipfs.timeout +fi +## CONTROL IPFS IS RUNNING OR RESTART +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) +if [[ ! ${YOU} ]]; then + + # Refresh Peering.Peers + ipfs config --json Peering.Peers '[]' + # DHT PUBSUB mode + ipfs config Pubsub.Router gossipsub + # MAXSTORAGE = 1/2 available + availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}') + diskSize="$((availableDiskSize / 2))" + ipfs config Datastore.StorageMax $diskSize + ## Activate Rapid "ipfs p2p" + ipfs config --json Experimental.Libp2pStreamMounting true + ipfs config --json Experimental.P2pHttpProxy true + # control water levels for swarm + ipfs config --json Swarm.ConnMgr.LowWater 50 + ipfs config --json Swarm.ConnMgr.HighWater 100 + + [ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && sudo service ipfs restart || sudo systemctl restart ipfs + echo "ERROR! ipfs daemon was not running. RELAUNCHING." + exit 1 +fi ######################################################################## -# CORRECT VSTREAM ASTROPORT SITE/ART REMOVED AFTER PLUGIN UPDATE +# CORRECT VSTREAM ASTROPORT SITE/ART REMOVED AFTER PLUGIN UPDATE : TODO DEBUG KODI PLUGIN !!! TODO MAKE PLAYER ROTATION [[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py ]] && [[ -f ~/.zen/astroport.py ]] && cp -f ~/.zen/astroport.py ~/.kodi/addons/plugin.video.vstream/resources/sites/ -[[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ]] && cp ~/.zen/astrXbian/.install/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ~/.kodi/addons/plugin.video.vstream/resources/art/ +[[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ]] && cp ~/.zen/astrXbian/.install/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ~/.kodi/addons/plugin.video.vstream/resources/art/ 2>/dev/null ######################################################################## -### NO IP GATEWAY : EXIT +### NO IP GATEWAY : EXIT (COULD BE Astroport.ONE Ambassy Alone !!) ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo "LAN OK" || exit 1 ######################################################################## @@ -41,10 +76,10 @@ ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo # WARNING: This script must be processing less than 1 minute, so do not charge too much this script # _ _____ ____ _ _______ ________ ____ # | | / / | / __ \/ | / / _/ | / / ____/ / / / -# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / / -# | |/ |/ / ___ |/ _, _/ /| // // /| / /_/ / /_/_/ -# |__/|__/_/ |_/_/ |_/_/ |_/___/_/ |_/\____/ (_|_) - +# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / / +# | |/ |/ / ___ |/ _, _/ /| // // /| / /_/ / /_/_/ +# |__/|__/_/ |_/_/ |_/_/ |_/___/_/ |_/\____/ (_|_) + ######################################################################## # 'figlet' was used for labeling code trunks ######################################################################## @@ -80,96 +115,167 @@ else total_old_minutes=$((10#$old_hour*60 + 10#$old_min)) total_minutes=$((10#$hour*60 + 10#$min)) runtime=$((total_minutes - total_old_minutes)) + runtime=${runtime#-} fi # RUN TIME $runtime echo "RUNTIME $runtime mn ($timebar)" + +if [[ $(($runtime % 4)) == 0 ]]; then + ## PING ALL MY FRIENDS TO ENHANCE SWARM CONNECTIVITY + echo "## FRIENDS IPFS PINGing" + for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do + [[ $g1pub ]] && latency=$(ipfs ping --timeout=1s -n 1 /p2p/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null | grep "Average" | cut -d ':' -f 2); + [[ $latency ]] && echo $latency > ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$g1pub/ping.average.txt + ## AVERAGE PING cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt + # for line in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt); do g1friend=$(echo $line | cut -d '/' -f 8); ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend); cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player; cat $line; done + done +fi ######################################################################## -# STATION CAN MODIFY DEFCON (cool 5 to 1 war) - only 5 and 4 (fail2ban) are ready to use. +## CHECK & (RE)ACTIVATE ipfs p2p tunnels +######################################################################## +# NextCloud FROM taurus TO oasis (https://taurus.copylaradio.com) +~/.zen/astrXbian/zen/ipfs_P2P_forward.sh +########## SUPPORT : OPEN OR CLOSE SSH ACCESS ################# +# [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" == "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # OPEN-SSH +# [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" != "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # CLOSE-SSH + +######################################################################## +# DEFCON +######################################################################## +# STATION CAN MODIFY DEFCON (cool 5 to 1 war) - only 5 and 4 (fail2ban) are ready to use. [[ -f ~/.zen/DEFCON ]] && export DEFCON=$(cat ~/.zen/DEFCON) || export DEFCON=$(cat ~/.zen/astrXbian/DEFCON) # ADAPT $DEFCON scenario ## DEFCON SYSTEM ACTIVATED +# _ ____ +# / | | ___| _ __ ___ _ __ +# | | |___ \ | '_ ` _ \| '_ \ +# | | ___) | | | | | | | | | | +# |_| |____/ |_| |_| |_|_| |_| +# + ######################################################################## -# SMARM SYNCRONISATION +# SMARM MAINTENANCE / 15 mn ######################################################################## -# ____ _______ __ __ -# / __ \/ ____/ | / / ____ ___ ____ ____/ /__ -# / / / / __/ | | / / / __ `__ \/ __ \/ __ / _ \ -# / /_/ / /___ | |/ / / / / / / / /_/ / /_/ / __/ -# /_____/_____/ |___/ /_/ /_/ /_/\____/\__,_/\___/ -# -# astrXbian TestNET +# astrXbian TestNET (git pull) -> desactivate in release ipfs get codeID ######################################################################## -# ACTIVATE 15-17 MN "git pull" update -if [[ $(($minute % 15)) == 0 ]]; then +# ACTIVATE 15 MN "git pull" update +if [[ $(($runtime % 15)) == 0 ]]; then + ########## DESYNCH SWARM NODE REQUESTS ################# - sleep $((1 + RANDOM % 120)) + [[ ! -d ~/.zen/Astroport.ONE ]] && cd ~/.zen && git clone https://git.p2p.legal/qo-op/Astroport.ONE.git + [[ -d ~/.zen/Astroport.ONE ]] && cd ~/.zen/Astroport.ONE && sleep $((1 + RANDOM % 12)) && git pull + +######################################################################## +# RE/LAUNCHING INSTASCAN API +instascan=$(ps auxf --sort=+utime | grep -w nc | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) +[[ $instascan ]] && killall instascan_login.sh && killall nc # && ~/.zen/Astroport.ONE/tools/instascan_login.sh & +# [[ ! $instascan ]] && ~/.zen/Astroport.ONE/tools/instascan_login.sh & + # git reset --hard - git pull + cd $MY_PATH + sleep $((1 + RANDOM % 3)) && git pull + [[ ! $? == 0 ]] && echo "GIT.P2P.LEGAL IS UNREACHABLE" # if [[ $(diff ~/.zen/astrXbian/.install/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml ~/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml) ]]; then # cp ~/.zen/astrXbian/.install/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml ~/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml # echo "MAJ Vstream settings" # fi - # CLEAN AND REMOVE BAD DIRECTORIES + ## IN CASE OF jaklis UPGRADE ACTIVATE AND REMOVE + ## cd ~/.zen/astrXbian/zen/jaklis; ./setup.sh; cd - + + # CLEAN AND REMOVE BAD DIRECTORIES should be in .$IPFSNODEID to avoid Station collision. + ## BYPASS index.html DELETION [[ -f ~/.zen/ipfs/index.html ]] && cp ~/.zen/ipfs/index.html /tmp/ipfsindex.html + [[ -d ~/.zen/ipfs/astroport ]] && rm -Rf ~/.zen/ipfs/astroport [[ -d ~/.zen/ipfs_swarm/astroport ]] && rm -Rf ~/.zen/ipfs_swarm/astroport [[ -d ~/.zen/ipfs/xbian ]] && rm -Rf ~/.zen/ipfs/xbian [[ -d ~/.zen/ipfs_swarm/xbian ]] && rm -Rf ~/.zen/ipfs_swarm/xbian [[ -d ~/.zen/ipfs/PIN ]] && rm -Rf ~/.zen/ipfs/PIN [[ -d ~/.zen/ipfs_swarm/PIN ]] && rm -Rf ~/.zen/ipfs_swarm/PIN - ## CLEANING OLD BAD FILES - rm ~/.zen/ipfs/* + ## CLEANING PARASITE BAD FILES + rm -Rf ~/.zen/ipfs/* rm ~/.zen/ipfs/.* - rm ~/.zen/ipfs_swarm/* + rm -Rf ~/.zen/ipfs_swarm/* rm ~/.zen/ipfs_swarm/.* - + + ## RESTORE index.html from /tmp/ipfsindex.html [[ -f /tmp/ipfsindex.html ]] && mv /tmp/ipfsindex.html ~/.zen/ipfs/index.html - isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1) - if [[ ! $isIPFSRunning ]]; then - [[ -f /etc/sudoers.d/systemctl && -f ~/.zen/ipfs/.$IPFSNODEID/.switch ]] && sudo systemctl restart ipfs - echo "ERROR! ipfs daemon is not running. EXIT" - exit 1 - fi - - ## (RE)ACTIVATE ipfs p2p tunnels - # NextCloud FROM taurus TO oasis (https://taurus.copylaradio.com) - $MY_PATH/zen/ipfs_P2P_forward.sh - ########## CHATON : OPEN OR CLOSE SSH ACCESS ################# - # [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" == "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # OPEN-SSH - # [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" != "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # CLOSE-SSH fi -# __ __ _____ ____ +# __ __ _____ ____ # __/ // /_/ ___/ ______ __________ ___ / __ \ # /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / / -# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ / +# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ / # /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/ gchange sync -# +# ################################################################## # TODO: IDEA make gchange/ipfs/ipns refresh speed depending on ipfs swarm size and DEFCON level ! -# SYNC GCHANGE EVERY 1 hour runtime -[[ $(($runtime % 60)) == 0 ]] && $MY_PATH/zen/gchange_INIT.sh && $MY_PATH/zen/gchange_IPFS_swarm.sh & +## SYNC GCHANGE EVERY 12 hours runtime +if [[ $(($runtime % 725)) == 0 || "$runtime" == "5" ]]; then + kill -9 $(ps auxf --sort=+utime | grep -w gchange_INIT.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING gchange_INIT.sh" + $MY_PATH/zen/gchange_INIT.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_INIT.txt +fi +# If NEW ~/.ipfs/config.new => restarting IPFS daemon (not too often as 6h) +if [[ -f ~/.ipfs/config.new && $(diff ~/.ipfs/config.new ~/.ipfs/config) && $runtime -gt 360 ]]; then + echo "onheure=$heure; onminute=$minute; ontimebar=$timebar" > /tmp/A_Station_ON + cp ~/.ipfs/config.new ~/.ipfs/config + [[ -f /etc/sudoers.d/systemctl ]] && sudo systemctl restart ipfs && exit 0 + [[ ${YOU} == "xbian" ]] && sudo service ipfs restart && exit 0 +fi -# QUICK SYNC SWARM EVERY 20 minutes +/- 1 minute -# [[ $(($runtime % 20)) == 0 ]] && $MY_PATH/zen/ipfs_SWARM_refresh.sh "quick" & +## RESHAPE IPFS FRIENDS SWARM +if [[ $(($runtime % 370)) == 0 || "$runtime" == "10" ]]; then + kill -9 $(ps auxf --sort=+utime | grep -w gchange_IPFS_swarm.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING gchange_IPFS_swarm.sh" + $MY_PATH/zen/gchange_IPFS_swarm.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_IPFS_swarm.txt +fi +# SYNC IPFS FRIENDS SWARM +if [[ $(($runtime % 26)) == 0 ]]; then + kill -9 $(ps auxf --sort=+utime | grep -w ipfs_SWARM_refresh.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING ipfs_SWARM_refresh.sh" + killall chromium + $MY_PATH/zen/ipfs_SWARM_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_SWARM_refresh.txt +fi -# ACTIVATE ~/astroport directory monitoring +################################################################## +# +# _________ ______ +# ____ ___ ____ /_ __/ | / ____/ +# /_ / / _ \/ __ \ / / / /| |/ / __ +# / /_/ __/ / / / / / / ___ / /_/ / +# /___/\___/_/ /_/ /_/ /_/ |_\____/ +# +# REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle + ### IMPORTANT !!!!!!! IMPORTANT !!!!!! Maintains MEDIAKEY alive + ################################################ +if [[ $(($runtime % 7)) == 0 ]]; then + + #### Refresh & publish MEDIAKEYs + $MY_PATH/zen/ipns_TAG_refresh.sh > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipns_TAG_refresh.txt + + ## REINIT dead swarm STATIONS + rm -f ~/.zen/A_dead_swarm.txt +fi + +## TODO ACTIVATE/DESACTIVATE LOG +######################################################################## +# ACTIVATE ~/astroport directory monitoring (xbian only) +######################################################################## ### -# _ _ -# __ _| |__ (_) __ _ _ __ -# \ \/ / '_ \| |/ _` | '_ \ +# _ _ +# __ _| |__ (_) __ _ _ __ +# \ \/ / '_ \| |/ _` | '_ \ # > <| |_) | | (_| | | | | # /_/\_\_.__/|_|\__,_|_| |_| inotifywait -# -# ON Rpi/xbian files added in ~/astroport are monitored to activate "new_file_in_astroport.sh" +# +# ON Rpi/xbian files added in ~/astroport are monitored to activate "new_file_in_astroport.sh" # Transfert ~/astroport/*/files to IPFS and make Astroport/KODI indexes in IPNS +## TEST AUTOMATIC NEW FILE IMPORT. xbian only. if [[ "$USER" == "xbian" ]]; then - [[ ! -e /home/$USER/astroport ]] && mkdir -p /home/$USER/astroport + [[ ! -e $HOME/astroport ]] && mkdir -p $HOME/astroport # VERIFY LAUNCH inotifywait ?! inotifywaitRunning=$(ps auxf --sort=+utime | grep -w inotifywait | grep -w astroport | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1) if [[ "$inotifywaitRunning" != "xbian" ]] @@ -180,64 +286,46 @@ fi ########################################################## -################################################################## -# -# _________ ______ -# ____ ___ ____ /_ __/ | / ____/ -# /_ / / _ \/ __ \ / / / /| |/ / __ -# / /_/ __/ / / / / / / ___ / /_/ / -# /___/\___/_/ /_/ /_/ /_/ |_\____/ -# -# REFRESHing MEDIAKEY ZenTAG nano DHTs => Zen File ECONOMY wallet cycle -if [[ "$timebar" == "12:12" || "$timebar" == "00:12" || $(($runtime % 720)) == 0 ]]; then - # Restarting IPFS daemon - [[ -f /etc/sudoers.d/systemctl || "$USER" == "xbian" ]] && sudo systemctl restart ipfs - - #### timebar DESYNC - sleep $((12 + RANDOM % 5)) - - #### Refresh & publish MEDIAKEYs - $MY_PATH/zen/ipns_TAG_refresh.sh - - ## REINIT dead swarm - rm -f ~/.zen/A_dead_swarm.txt -fi ################################################################## ################################################################## -# MIDNIGHT:01 : CLEANING & UPDATE +# 5 mn / 24h REBOOT & MIDNIGHT:01 : CLEANING & UPDATE ################################################################## ################################################################## -if [[ "$timebar" == "00:01" || "$runtime" == "5" || $(($runtime % 1380)) == 0 ]]; then +if [[ "$timebar" == "00:01" || "$runtime" == "30" || $(($runtime % 1380)) == 0 ]]; then echo ' # ____ ____ ____ ___ # / __ \/ __ \ _ / __ < / -# / / / / / / / (_) / / / / / -# / /_/ / /_/ / _ / /_/ / / -# \____/\____/ (_) \____/_/ -# +# / / / / / / / (_) / / / / / +# / /_/ / /_/ / _ / /_/ / / +# \____/\____/ (_) \____/_/ +# # MAINTENANCE ' - sleep $((1 + RANDOM % 15)) ### Be careful if random sleep is not activated... + sleep $((1 + RANDOM % 12)) ### Be careful if random sleep is not activated... ############################## That swarm could become an aggressive blob !! ### PEACE & LOVE software is processing... We are HyperWeb people here. # DEFCON 5 quiet behaviour so Please keep cool, take care and be zen. # GOOD BYE GOOGLE, AMAZON, FACEBOOK, APPLE, MICROSOFT. LIBRE WE ARE. #################################################################### # REFRESH & UPGRADE youtube-dl + $MY_PATH/.install/youtube-dl.sh ## LET IT A WHILE FOR ALL SWARM EXECUTE ACTION... AND REMOVE. youtube-dl --rm-cache-dir youtube-dl -U - + + ### INDEX DATA MIGRATION SCRIPTS + # $MY_PATH/actions/p4n.data_evolution.sh & + ## LET IT A WHILE FOR ALL SWARM EXECUTE ACTION... AND REMOVE. ################################################################## if [[ $dayoftheweek == 1 ]]; then # EVERY MONDAY - # _____ __ __ ___ + # _____ __ __ ___ # / ___// /_____ _________ _____ ____ / |/ /___ __ __ # \__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/ - # ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> < - # /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_| - # /____/ + # ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> < + # /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_| + # /____/ # 1/2 HDD for IPFS size - dicotomic adaptation 7th EVERY MONTH availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}') availableDiskSize="$(($availableDiskSize * 1024))" @@ -245,37 +333,53 @@ echo ' diskSize="$((availableDiskSize / 2))" ipfs config Datastore.StorageMax $diskSize echo "StorageMax = $diskSize" - + # New full test review in gchange_INIT.sh rm -f ~/.ipfs/test.disk - - # LOG ROTATE - [[ -f /tmp/astroport.log ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log - + rm -f /tmp/instascan.log + + # LOG ROTATE WEEKLY + [[ -f /tmp/astroport.log ]] && [[ ! -f ~/.zen/astroport.$weeknumber.log.tgz ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log + fi - + ################################################################## ## CHECK STARTGATE LEVEL KEYS - # _ open _ - # ___| |_ __ _ _ __ __ _ __ _| |_ ___ + # _ open _ + # ___| |_ __ _ _ __ __ _ __ _| |_ ___ #/ __| __/ _` | '__/ _` |/ _` | __/ _ \ #\__ \ || (_| | | | (_| | (_| | || __/ #|___/\__\__,_|_| \__, |\__,_|\__\___| - # |___/ + # |___/ # IPNS KEYS used to publish with star friends (creates 5 levels of streaming / file sharing) - # RESET + # RESET ipfs key rm star_1; ipfs key rm star_2; ipfs key rm star_3; ipfs key rm star_4; ipfs key rm star_5 rm -Rf ~/.zen/key/ # RENEW & SEND STARS TO FRIENDS ~/.zen/astrXbian/zen/manage_stargates.sh $MY_PATH/zen/manage_stargates.sh + + ######################################################################## + # ACTIVATE TO CONTROL SWARM STATION SAME CODE VERSION + ######################################################################## + ## myCODE is a SECURITY about code SIMILARITY + ## EACH NODE CAN CHECK IF ANOTHER HAS SAME IPFS CODE HASH + MyCODE=$(ipfs add -rq --ignore="__pycache__" ~/.zen/astrXbian/ | tail -n 1) + [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/.mycode ]] && echo $MyCODE > ~/.zen/ipfs/.${IPFSNODEID}/.mycode + [[ "$(cat ~/.zen/ipfs/.${IPFSNODEID}/.mycode)" != "$MyCODE" ]] && echo $MyCODE > ~/.zen/ipfs/.${IPFSNODEID}/.mycode + echo "MyCODE = $MyCODE CODE is ready to be published" + ######################################################################## + # MEAN CONTROL SWARM STATION HAVE SAME CODE VERSION + ######################################################################## + fi ### DISAPEAR ONE HOUR FROM IPFS SWARM ZOMBIES > 300 peers in swarm -#if [[ $(cat /tmp/ipfs_swarm_peers | wc -l) -gt 300 ]]; then +#if [[ $(cat /tmp/ipfs_swarm_peers | wc -l) -gt 300 ]]; then #if [[ "$timebar" == "04:05" ]]; then # ~/.zen/astrXbian/zen/ipfs_SWARM_renew.sh 3600 ## CUT IPFS FOR ONE HOUR ## SWITCHING ON # echo "1" > ~/.zen/ipfs/.$IPFSNODEID/.switch #fi #fi +## BETTER ACTIVATING DEFCON 3 / swarm.key MODE diff --git a/docs/Infos-utiles.md b/docs/Infos-utiles.md index 5e81a3b..fd845fc 100644 --- a/docs/Infos-utiles.md +++ b/docs/Infos-utiles.md @@ -2,7 +2,7 @@ * https://git.p2p.legal/axiom-team/astrXbian * https://oasis.astroport.com -* https://colibris-wiki.org/astroport +* https://colibris-wiki.org/astroport # Liens annexes @@ -23,7 +23,7 @@ # jaklis : commandes de messaging / like ``` -## GET ALERT MESSAGES +## GET ALERT MESSAGES ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" read -n300 -j | jq -r --arg friendKEY "$G1PUB" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ALERT")' | jq -r '.id' ## SEND MONITORING MESSAGE TO onelove @@ -32,3 +32,15 @@ ## LINKING ME PEOPLE ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' ``` + + +# EXEMPLES DE COMMANDES BALISES +``` + +## CHECK SWARM STATIONS TIMESTAMPS +for g1id in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS); do echo $g1id; [[ "$g1id" == "index.html" ]] && continue; ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1id); ts=$(ipfs --timeout=10s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.timestamp); echo $(date -ud @$ts); done +for ts in $(cat ~/.zen/ipfs_swarm/.*/.timestamp); do echo $(date -ud @$ts); done + + + +``` diff --git a/include.sh b/include.sh index 22bd7b9..c39653a 100644 --- a/include.sh +++ b/include.sh @@ -1,22 +1,79 @@ -#!/bin/sh +#!/bin/bash +[ "${DEBUG}" ] && set -x check_requirements() { + [[ ! $(which ipfs) ]] && echo "=== installez ipfs !!" && echo "https://docs.ipfs.io/install/command-line/#official-distributions" && exit 1 + echo "astrxbian installateur pour distributions debian et dérivées : linuxmint (https://www.linuxmint.com/) ou xbian (https://xbian.org) recommandées" + echo "appuyez sur entrer pour commencer."; read test; [[ "$test" != "" ]] && echo "sortie" && exit 0 ## ajouter confirmation à chaque nouvelle étape (+explications) + echo ; echo "mise à jour des dépots de votre distribution..." sudo apt-get update - sudo apt-get install git fail2ban inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel python3-dotenv mpack libssl-dev libffi-dev -y - sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack sudo -y - [[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y + + [[ "$user" != "xbian" ]] &&\ + for i in x11-utils xclip zenity handbrake*; do\ + [ $(dpkg-query -w -f='${status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ] &&\ + echo ">>> installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";\ + sudo apt install -y $i; + done + + for i in git fail2ban netcat-traditional inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel python3-dotenv mpack libssl-dev libffi-dev; do + if [ $(dpkg-query -w -f='${status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + echo ">>> installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" + sudo apt install -y $i + fi + done + + for i in build-essential qrencode jq bc file gawk yt-dlp ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox nmap httrack html2text ssmtp imagemagick ttf-mscorefonts-installer libcurl4-openssl-dev; do + if [ $(dpkg-query -w -f='${status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + echo ">>> installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" + sudo apt install -y $i + fi + done + + [[ ! $(which kodi) && "$user" != "xbian" ]] &&\ + echo ">>> installation kodi + vstream = votre videotheque ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";\ + sudo apt-get install kodi -y;\ + ${MY_PATH}/.install/kodi_uqload_downloader.sh + + echo "## INSTALLATION AstroGEEK OpenCV = 'Intelligence Amie' " sudo apt-get install python3-opencv -y - [[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake* -y - ## INSTALL PYTHON CRYPTO LAYER - echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc + + ## Correct PDF restrictions for imagemagick + echo "# Correction des droits export PDF imagemagick" + if [[ $(cat /etc/ImageMagick-6/policy.xml | grep PDF) ]]; then + cat /etc/ImageMagick-6/policy.xml | grep -Ev PDF > /tmp/policy.xml + sudo cp /tmp/policy.xml /etc/ImageMagick-6/policy.xml + fi + + echo "###########################" + echo "## INSTALL PYTHON CRYPTO LAYER " + echo "###########################" + echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc; echo ">>> PATH=$PATH" python3 -m pip install -U pip python3 -m pip install -U setuptools wheel - python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy + python3 -m pip install -U cryptography Ed25519 base58 google duniterpy pynacl pgpy + python3 -m pip install -U nicotine-plus silkaj + python3 -m pip install -U protobuf==3.19.0 + + + if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER SUR RPI + echo "Ambassade? Souhaitez vous ajouter imprimante 'brother_ql'? Saisissez OUI, sinon laissez vide et tapez sur ENTRER" + read saisie + if [[ $saisie != "" ]]; then + sudo apt install printer-driver-all cups -y + sudo pip3 install brother_ql + sudo cupsctl --remote-admin + sudo usermod -aG lpadmin pi + sudo usermod -a -G gammu pi + fi + fi + # python3 -m pip install -U silkaj + ## python -> python3 link + sudo ln -f -s /usr/bin/python3 /usr/bin/python } i_am() { - echo 'v0.4' + echo 'v0.5.0' } i_am_root() { @@ -28,34 +85,45 @@ i_am_xbian() { } i_should_install() { - [[ ! -f ~/.zen/secret.june ]] +[[ ! -f ~/.zen/secret.dunikey ]] } import_astrXbian() { + echo "=== Clonage git CODE 'astrXbian' + 'Astroport.ONE' depuis https://git.p2p.legal" mkdir -p ~/.zen cd ~/.zen + # TODO INSTALL FROM IPFS / IPNS git clone https://git.p2p.legal/axiom-team/astrXbian.git + git clone https://git.p2p.legal/qo-op/Astroport.ONE.git +} + +import_astroport() { + echo "INITIALISATIOn Astroport/KODI" + echo "Appuyez sur la touche ENTREE pour démarrer le mode Aventure" + echo "sinon interrompez ici l'installation, et activez votre Ambassade ~/.zen/Astroport.ONE/start.sh" + read + ~/.zen/Astroport.ONE/adventure.sh + # ~/.zen/astrXbian/ISOconfig.sh } import_ipfs() { + ## Scripts pour systemd ou InitV (xbian) + echo "=== Activation SYSTEM IPFS" ~/.zen/astrXbian/.install/ipfs_alone.sh } import_jaklis() { + echo "=== Configuration jaklis: Centre de communication CESIUM+ GCHANGE+" cd ~/.zen/astrXbian/zen/jaklis ./setup.sh } import_kodi() { + echo "=== IMPORT configuration ASTROPORT dans ~/.kodi" cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ } -iso_config() { - ~/.zen/astrXbian/ISOconfig.sh -} - prepare_next_boot() { - ## Rpi Xbian install. cat /etc/rc.local | grep -Ev "exit 0" > /tmp/new.rc.local ## REMOVE "exit 0" # PREPARE NEXT BOOT - Network config - NEXTBOOT - ISOConfig - NEXTBOOT - OK echo "su - xbian -c '~/.zen/astrXbian/FirstBOOT.sh'" >> /tmp/new.rc.local diff --git a/install.sh b/install.sh index 6c5b670..81f4c74 100755 --- a/install.sh +++ b/install.sh @@ -1,39 +1,38 @@ #!/bin/bash -set -x . ./include.sh ######################################################################## -# Version: 0.4 +# Version: 0.5.0 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ######################################################################## { +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" + i_am_root && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1 -# MAIN # +# MAIN # SI AUCUNE CLEF DE STATION... if i_should_install; then -# Check requirements -echo "AstrXbian installateur pour XBIAN (https://xbian.org) et ditributions DEBIAN et dérivées (https://www.linuxmint.com/)" +# Install requirements check_requirements -######################################################################## -echo "Clonage git astrXbian depuis https://git.p2p.legal" + +# Clone astrXbian and Astroport.One import_astrXbian -######################################################################## -echo "IMPORT configuration ASTROPORT dans ~/.kodi" -import_kodi - -######################################################################## -echo "Installation de IPFS https://ipfs.io" +# Init ipfs import_ipfs -######################################################################## -echo "Configuration jaklis: Centre de communication GCHANGE+" +# Copy astroport config in kodi +import_kodi + +# Jaklis setup import_jaklis ######################################################################## -echo "Sécurisation DEFCON SUDOERS FAIL2BAN" -## XBIAN fail2ban ERROR correction ## +echo "=== Sécurisation DEFCON SUDOERS FAIL2BAN" +## XBIAN fail2ban ERROR correction ## #[....] Starting authentication failure monitor: fail2ban No file(s) found for glob /var/log/auth.log i_am_xbian && sudo sed -i "s/auth.log/faillog/g" /etc/fail2ban/paths-common.conf # NODE activates fail2ban IN zen/ipfs_SWARM_refresh.sh @@ -55,7 +54,7 @@ then cd /etc/rc0.d && sudo ln -s ../init.d/ipfs K01ipfs cd /etc/rc1.d && sudo ln -s ../init.d/ipfs K01ipfs cd /etc/rc6.d && sudo ln -s ../init.d/ipfs K01ipfs - + # Disable xbian-config auto launch echo 0 > ~/.xbian-config-start @@ -66,16 +65,25 @@ fi mkdir -p ~/astroport/film mkdir -p ~/astroport/serie mkdir -p ~/astroport/anime +echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt + + +####################################################################### + +echo "## INSTALL open_with_linux.py ## +## https://darktrojan.github.io/openwith/webextension.html" +~/.zen/astrXbian/open_with_linux.py install + +echo ">>> INFO : Ajoutez l'extension 'OpenWith' à votre navigateur !! +# https://addons.mozilla.org/firefox/addon/open-with/ +# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno" if ! i_am_xbian then ## Desktop install - echo "INITIALISATIOn Astroport/KODI" - echo "Appuyez sur la touche ENTREE pour créer votre nouvelle identité" - echo "sinon interrompez ici l'installation pour copier la restauration d'une sauvegarde" - read - iso_config + import_astroport else + ## Rpi Xbian install. prepare_next_boot echo "STOP!! Redémarrer Xbian pour continuer la configuration de votre station Astroport/KODI" @@ -86,11 +94,11 @@ fi # MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ## else -echo "Installation déjà faite !! +echo "Installation existante !! ======================== Astroport/KODI (Gchange) ======================== -Connectez-vous sur https://gchange.fr avec vos identifiants +Connectez-vous sur https://gchange.fr avec vos identifiants $(cat ~/.zen/secret.june) diff --git a/install_www.sh b/install_www.sh index 449788f..e852761 100755 --- a/install_www.sh +++ b/install_www.sh @@ -1,14 +1,19 @@ #!/bin/bash echo "Installation Astroport/RompR et activation du mode JUKEBOX mp3" -if [[ "$jukebox" == "oui" ]] then - sudo apt-get install mariadb-server nginx libnginx-mod-rtmp lsof python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm -y +if [[ "$jukebox" == "oui" ]] then + sudo apt-get install mariadb-server nginx libnginx-mod-rtmp lsof python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm -y fi # Add user to be able to modify nginx directories sudo usermod -a -G "$USER" www-data sudo chmod g+rw /var/www/html -## TODO ## INSTALLER SITE PROXY NGINX QUI REDIRIGE VERS https://127.0.0.1:8181/ipns/$IPFSNODEID/.$IPFSNODEID +## TODO ## INSTALLER SITE PROXY NGINX QUI REDIRIGE VERS https://127.0.0.1:8080/ipns/$IPFSNODEID/.$IPFSNODEID # STRUCTURE DE DONNEE SITUE DANS ~/.zen/ipfs/ PUBLIEE PAR IPNS SELF +## AJOUT ADDONS NAVIGATEUR https://askubuntu.com/questions/73474/how-to-install-firefox-addon-from-command-line-in-scripts +# OpenWith # +# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno +# https://addons.mozilla.org/firefox/downloads/file/3831723/open_with-7.2.6-fx.xpi + diff --git a/ipfs4astroport.sh b/ipfs4astroport.sh new file mode 100755 index 0000000..215d8cb --- /dev/null +++ b/ipfs4astroport.sh @@ -0,0 +1,257 @@ +#!/bin/bash +######################################################################## +{ # this ensures the entire script is downloaded # +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" + +# CHECK not root user !! +if [ "$EUID" -eq 0 ] + then echo -e "DO NOT EXECUTE AS root. Choose a user for your Astroport Station (we like pi)" + exit 1 +else echo -e "OK $USER, let's go!"; +fi + +echo "Hello, + +This script (you could read and modify as it is open source software) is about to transform your computer into an astroport station. + +This process involve different upgrades to be made on your system. +1. install IPFS, the interplanetary file system (https://ipfs.io) +2. install python cryptographic libraries to run natools, your key wizard companion +3. download 'astroport' code release you have choosen. + +~/.zen directory and datastructure will emerge +~/.zen/ipfs & ~/.zen/ipfs_swarm contains all meshed media index from you and your friends. + +ASTROPORT is activated by cron every minute it maintains the connection with your friends. +It is the vessel that gives you avvess to your p2p AVATAR. +You carry and share your data around your friends through a confidence network +established through 1 to 5 'hearts' exchanged, opening 5 stargates where any can push/pull data. + +TODO +Just indicate which is the directory assigned to each star. +Then any of your friends from such star level can replicate (modify) those data with you. + +Your station is publishing its index every time it changes and every 6 hours for all MEDIAKEY from PIN station. +Following that principle add new directory into ~/.zen/ipfs and index any dataset, it will be published on your IPFS semaphore. + +Now you need to enter your password to obtain sudo access. +Please. +" +# Ask user password on start +sudo true + +## Error funciton +err() { + echo -e "ERREUR: $1" + exit 1 +} + +# CHECK if daemon is already running +if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]]; then + ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers + echo "ipfs bootstrap list: " && ipfs bootstrap list + echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!" + echo "Please RUN : sudo service ipfs stop" + exit 1 +fi + +[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script EXIT" && exit 1 + +echo -e "Check and install python curl, git and tools." + +[[ $(which pip3) ]] && python3 -m pip install -U pip && python3 -m pip install -U wheel cryptography Ed25519 base58 google protobuf duniterpy==0.62.0 termcolor python-dotenv gql==3.0.0a5 requests pybase64 || (echo "python3 pip3 is missing on your device. EXIT" && exit 1) +[[ ! $(which curl) ]] && sudo apt-get install curl -y +[[ ! $(which git) ]] && sudo apt-get install git -y + +[[ ! -d ~/.zen ]] && mkdir ~/.zen + +# CHECK node IP isLAN? +myIP=$(hostname -I | awk '{print $1}') +echo "Your IP is $myIP" +isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +[[ $isLAN ]] && echo "You are located in a LAN" || echo "You have a public IP address" +MACHINE_TYPE=`uname -m` +echo "You are running $MACHINE_TYPE CPU" + +echo "Downloading ipfs binaries" +if [ ${MACHINE_TYPE} == 'x86_64' ]; then + curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz +elif [ ${MACHINE_TYPE:0:3} == 'arm' ]; then + curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz +elif [ ${MACHINE_TYPE} == 'aarch64' ]; then + curl -s https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-arm64.tar.gz -o /tmp/ipfs_aarch64_v0.9.1.tar.gz +else + echo "Your $MACHINE_TYPE is not supported yet... Please add an issue." && exit 1 +fi + +if [ -f $MY_PATH/ipfs-update.tar.gz ]; then + echo "INSTALL ipfs-update >>>>>>>>>>>>>>>>>>>>>>>>>>" + sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err "Untar ipfs-update" + rm $MY_PATH/ipfs-update.tar.gz + cd /usr/src/ipfs-update/ + sudo ./install.sh || err "Install ipfs-update" + cd $MY_PATH + + echo "INSTALL ipfs 0.9.1 >>>>>>>>>>>>>>>>>>>>>>>>>>" + sudo ipfs-update install 0.9.1 || err "Install IPFS" + +else + ## TERRAPI4 aarch64 install ipfs_aarch64_v0.9.1 + echo "INSTALL ipfs 0.9.1 >>>>>>>>>>>>>>>>>>>>>>>>>> arm64" + sudo tar -xvzf /tmp/ipfs_aarch64_v0.9.1.tar.gz -C /usr/src/ || err "Untar ipfs_aarch64" + rm /tmp/ipfs_aarch64_v0.9.1.tar.gz + cd /usr/src/go-ipfs/ + sudo ./install.sh || err "Install ipfs_aarch64" + cd $MY_PATH + +fi + +# INIT ipfs +[[ $isLAN ]] && ipfs init -p lowpower \ +|| ipfs init -p server + +## Special Xbian init.d config + ## DEBIAN SYSTEMCTL + echo "SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>> ON" +cat > /tmp/ipfs.service <>>>>>>>>>>>>>>>>> " +# echo "Vous pouvez régler la ressouce CPU maximum (60%)?" && read cpuy + + [[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs + sudo systemctl daemon-reload + sudo systemctl enable ipfs + + +########################################### +echo "# ACTIVATE IPFS OPTIONS: #swarm0 INIT" +########################################### +### IMPORTANT !!!!!!! IMPORTANT !!!!!! +########################################### +# DHT PUBSUB mode +ipfs config Pubsub.Router gossipsub +# MAXSTORAGE = 1/2 available +availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}') +diskSize="$((availableDiskSize / 2))" +ipfs config Datastore.StorageMax $diskSize +## Activate Rapid "ipfs p2p" +ipfs config --json Experimental.Libp2pStreamMounting true +ipfs config --json Experimental.P2pHttpProxy true +ipfs config --json Swarm.ConnMgr.LowWater 50 +ipfs config --json Swarm.ConnMgr.HighWater 100 + +## Install gateway on 8181 port +ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181" + +######################################################################## +# GET IPFS KEYS & CONVERSIONS +######################################################################## +IPFSNODEID=$(ipfs config Identity.PeerID) +## TODO convert to secret.dunikey + +######################################################################## +echo "CREATION IDENTITE BALISE IPFS ~/.zen/ipfs/.${IPFSNODEID} /G1SSB" +######################################################################## +rm -Rf ~/.zen/ipfs +mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB +######################################################################## +# Give $XZUID to your (gchange friends) +######################################################################## +XZUID="$(hostname)-$RANDOM$RANDOM" +echo "SETTING .player PROFILE NAME = $XZUID" +echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player +echo 'balise /ipns/$IPFSNODEID/.$IPFSNODEID/.player' + +######################################################################## +######################################################################## +echo "Getting tryme.addr & .mycode from OASIS +-- Change oasis address to fork your Astroport Code Universe --" +######################################################################## +ipfs bootstrap rm --all + +OASIS=12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN +# aries=12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx +for bootnode in $(curl -s https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/tryme.addr) +do + ## ADD $bootnode TO BOOTSTRAP + ipfs bootstrap add $bootnode +done + +codesign=$(curl -s https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/.mycode) + +## ADD NETWORK EXPLORATION FROM LIKES +######################################################################## +echo "RESTARTING ipfs" +######################################################################## +sudo service ipfs restart +echo ".... WAIT for SWARM to connect ..." +sleep 10 + +echo ".... ACTUAL SWARM PEERS ..." +ipfs swarm peers + +echo "IPFS DONE +==================== +Station Astroport INSTALL +Activation ~/.zen/astrXbian/zen/cron_VRFY.sh +Récupération CODE /ipfs/$codesign +" + +## GETTING SAME SOURCE CODE AS OASIS +mkdir -p /home/$USER/.zen/astrXbian/ +ipfs get --output=/home/$USER/.zen/astrXbian/ /ipfs/$codesign + +## Make scripts executable +find /home/$USER/.zen/astrXbian/ -name "*.sh" -exec chmod u+x '{}' \; +find /home/$USER/.zen/astrXbian/ -name "*.py" -exec chmod u+x '{}' \; + +######################################################################## +echo "# Setting $USER SUDO permissions ON fail2ban mount umount apt-get apt systemctl" +######################################################################## +## USED FOR fail2ban-client (DEFCON) +echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/fail2ban-client" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/fail2ban-client') +## USED FOR RAMDISK (video live streaming) +echo "$USER ALL=(ALL) NOPASSWD:/bin/mount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/mount') +echo "$USER ALL=(ALL) NOPASSWD:/bin/umount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/umount') +## USED FOR SYSTEM UPGRADE +echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt-get" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt-get') +echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt') +## USED FOR "systemctl restart ipfs" +echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl') + +## TODO G1SSB CONFIG +echo "## INSTALL TiddlyWiki /ipns/${IPFSNODEID}/.${IPFSNODEID}/index.html" +[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/index.html ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlywiki/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html + + +echo "Congratulation ! You are part of the astroport interplanetary fleet. + +New. Activate your station offline storage. +Install ipfs companion : https://docs.ipfs.io/install/ipfs-companion/ +FR : https://translate.google.com/translate?sl=auto&tl=fr&u=https://docs.ipfs.io/install/ipfs-companion/ +" + +echo "FIND AND CONNECT WITH YOUR FRIENDS +https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/" +## OPEN https://translate.google.com/translate?sl=auto&tl=fr&u=https://docs.ipfs.io/install/ipfs-companion/ + +} # this ensures the entire script is downloaded # +# IPFS CONFIG documentation: https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#addressesswarm diff --git a/minetest/.gitignore b/minetest/.gitignore new file mode 100644 index 0000000..377d208 --- /dev/null +++ b/minetest/.gitignore @@ -0,0 +1 @@ +minetest.conf diff --git a/minetest/map.sqlite b/minetest/map.sqlite new file mode 100644 index 0000000..ec22e0c Binary files /dev/null and b/minetest/map.sqlite differ diff --git a/minetest/minetest-common.conf b/minetest/minetest-common.conf new file mode 100644 index 0000000..3d8f07b --- /dev/null +++ b/minetest/minetest-common.conf @@ -0,0 +1,107 @@ + + +enable_damage = false +enable_pvp = false +creative_mode = true +enable_build_where_you_stand = true + +# Controls length of day/night cycle. +# Examples: +# 72 = 20min, 360 = 4min, 1 = 24hour, 0 = day/night/whatever stays unchanged. +# type: int +time_speed = 1 + +# Name of map generator to be used when creating a new world. +# Creating a world in the main menu will override this. +# Current mapgens in a highly unstable state: +# - The optional floatlands of v7 (disabled by default). +# type: enum values: v7, valleys, carpathian, v5, flat, fractal, singlenode, v6 +# mg_name = v7 +mg_name = singlenode +# singlenode = que de l'air ; le mod "startanode" permet d'ajouter un cube au spawn + +# Player is able to fly without being affected by gravity. +# This requires the "fly" privilege on the server. +# type: bool +free_move = true + +# Fast movement (via the "special" key). +# This requires the "fast" privilege on the server. +# type: bool +fast_move = false + + +# The privileges that new users automatically get. +# See /privs in game for a full list on your server and mod configuration. +# type: string +default_privs = interact, shout, fly, fast + +# Privileges that players with basic_privs can grant +# type: string +basic_privs = interact, shout, fly, fast + +# Where the map generator stops. +# Please note: +# - Limited to 31000 (setting above has no effect) +# - The map generator works in groups of 80x80x80 nodes (5x5x5 MapBlocks). +# - Those groups have an offset of -32, -32 nodes from the origin. +# - Only groups which are within the map_generation_limit are generated +# type: int min: 0 max: 31000 +#mapgen_limit = 216 +mapgen_limit = 31000 + +# If this is set, players will always (re)spawn at the given position. +# type: string +static_spawnpoint = (0, 0, 0) + +# magpen flags +mg_flags = trees,decorations + +# mapgen v6 +mgv6_spflags = jungles,biomeblend,mudflow,snowbiomes,noflat,trees +mgv6_freq_desert = 0.05 +mgv6_freq_beach = 0.95 + +# Humidity variation for biomes. +# type: noise_params_2d +mgv6_np_humidity = { + offset = 0.5, + scale = 0.5, + spread = (2, 3, 2), + seed = 72384, + octaves = 3, + persistence = 0.50, + lacunarity = 2.0, + flags = eased +} + +# Defines tree areas and tree density. +# type: noise_params_2d +mgv6_np_trees = { + offset = 0, + scale = 1, + spread = (2, 3, 2), + seed = 2, + octaves = 4, + persistence = 0.66, + lacunarity = 2.0, + flags = eased +} + +# Defines areas with sandy beaches. +# type: noise_params_2d +mgv6_np_beach = { + offset = 0, + scale = 1, + spread = (50, 50, 50), + seed = 59420, + octaves = 3, + persistence = 0.50, + lacunarity = 2.0, + flags = eased +} + +secure.trusted_mods = wiki + + + diff --git a/minetest/recreate_world.sh b/minetest/recreate_world.sh new file mode 100755 index 0000000..0193a71 --- /dev/null +++ b/minetest/recreate_world.sh @@ -0,0 +1,259 @@ +#!/bin/sh + +MINETEST_PATH=/home/pi/.minetest +WORLD_NAME=astroport +WORLD_PATH=$MINETEST_PATH/worlds/$WORLD_NAME + +rm -rf $WORLD_PATH +mkdir $WORLD_PATH + +cp map.sqlite $WORLD_PATH/ + +echo " +gameid = minetest +auth_backend = sqlite3 +player_backend = sqlite3 +backend = sqlite3 +" > $WORLD_PATH/world.mt + +cd ~/.zen/astrXbian/minetest +cat ./minetest-common.conf > /home/pi/.minetest/worlds/astroport/minetest.conf +echo " + +server_name = Astroport "$XZUID" + +# Message of the day displayed to players connecting. +# type: string +motd = Bienvenue sur l'Astroport \""$XZUID"\". Un petit cube auto-hébergé par son heureux propriétaire. + +server_description = Astroport + +# Domain name of server, to be displayed in the serverlist. +# type: string +#server_address = astroport.com + +# Homepage of server, to be displayed in the serverlist. +# type: string +#server_url = https://astroport.com + +# Automatically report to the serverlist. +# type: bool +server_announce = false + +# Network port to listen (UDP). +# This value will be overridden when starting from the main menu. +# type: int +port = 30001 + +# The network interface that the server listens on. +# type: string +# bind_address = + + +" >> /home/pi/.minetest/worlds/astroport/minetest.conf + + + + + +######################################################################################### +# +# SystemD +# +######################################################################################### + + +MINETEST_LOG_FILE=/var/log/minetest/minetest-astroport.log + +sudo touch $MINETEST_LOG_FILE +sudo chown pi:games $MINETEST_LOG_FILE +chmod 664 $MINETEST_LOG_FILE + +echo " +[Unit] +Description=Minetest multiplayer server minetest.conf server config +Documentation=man:minetestserver(6) +After=network.target +RequiresMountsFor=/var/games/minetest-server + +[Service] +Restart=on-failure +User=pi +Group=games +ExecStart=/usr/lib/minetest/minetestserver --port 30001 --world /home/pi/.minetest/worlds/astroport --config /home/pi/.minetest/worlds/astroport/minetest.conf --logfile /var/log/minetest/minetest-astroport.log +StandardOutput=null + +[Install] +WantedBy=multi-user.target +" >> $WORLD_PATH/systemd.service + +sudo systemctl enable $WORLD_PATH/systemd.service + +sudo systemctl start astroport-minetest.service + + + + + +######################################################################################### +# +# MODS +# +######################################################################################### + + +mkdir $WORLD_PATH/worldmods + +if [ ! -d $MINETEST_PATH/mods ]; then + mkdir $MINETEST_PATH/mods +fi + +# ## mg - Experimental Mapgen for Minetest +# +# if [ ! -d $MINETEST_PATH/mods/mg-master ]; then +# +# if [ ! -f $MINETEST_PATH/mods/mg.zip ]; then +# wget https://github.com/minetest-mods/mg/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/mg.zip +# fi +# +# unzip $MINETEST_PATH/mods/mg.zip -d $MINETEST_PATH/mods +# fi +# +# cp -r $MINETEST_PATH/mods/mg-master $WORLD_PATH/worldmods + + +## startanode +# +# if [ ! -d $MINETEST_PATH/mods/startanode-master ]; then +# +# if [ ! -f $MINETEST_PATH/mods/startanode.zip ]; then +# wget https://github.com/minetest-mods/startanode/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/startanode.zip +# fi +# +# unzip $MINETEST_PATH/mods/startanode.zip -d $MINETEST_PATH/mods +# fi +# +# cp -r $MINETEST_PATH/mods/startanode-master $WORLD_PATH/worldmods + + + +## Spawnbuilder +# +# spawnBuilderLocation=`find $MINETEST_PATH/mods -type d -name spawnbuilder` +# if [ -z $spawnBuilderLocation ]; then +# +# if [ ! -f $MINETEST_PATH/mods/spawnbuilder.zip ]; then +# wget https://repo.or.cz/minetest_spawnbuilder.git/snapshot/1.1.0.zip -O $MINETEST_PATH/mods/spawnbuilder.zip +# fi +# +# unzip $MINETEST_PATH/mods/spawnbuilder.zip -d $MINETEST_PATH/mods/spawnbuilder/ +# fi +# +# mkdir $WORLD_PATH/worldmods/spawnbuilder +# cp -r $MINETEST_PATH/mods/spawnbuilder/minetest_spawnbuilder-*/* $WORLD_PATH/worldmods/spawnbuilder +# +# echo " +# #Side length of the surface area of the spawn platform +# #If the number is odd, the platform will be centered at spawn. +# #Using a width lower than 3 is not recommended. +# spawnbuilder_width (Spawn platform width) int 5 1 +# " > $WORLD_PATH/worldmods/spawnbuilder/mod.conf + + + +## Unified inventory mod + +if [ ! -d $MINETEST_PATH/mods/unified_inventory-master ]; then + + if [ ! -f $MINETEST_PATH/mods/unified_inventory.zip ]; then + wget https://github.com/minetest-mods/unified_inventory/archive/master.zip -O $MINETEST_PATH/mods/unified_inventory.zip + fi + + unzip $MINETEST_PATH/mods/unified_inventory.zip -d $MINETEST_PATH/mods +fi + +cp -r $MINETEST_PATH/mods/unified_inventory-master $WORLD_PATH/worldmods + +## Spawn mod + +if [ ! -d $MINETEST_PATH/mods/spawn_command-master ]; then + + if [ ! -f $MINETEST_PATH/mods/spawn_command.zip ]; then + wget https://github.com/minetest-mods/spawn_command/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/spawn_command.zip + fi + + unzip $MINETEST_PATH/mods/spawn_command.zip -d $MINETEST_PATH/mods +fi + +cp -r $MINETEST_PATH/mods/spawn_command-master $WORLD_PATH/worldmods + + +## Jukebok mod + +if [ ! -d $MINETEST_PATH/mods/jukebox-master ]; then + + if [ ! -f $MINETEST_PATH/mods/jukebox.zip ]; then + wget https://github.com/minetest-mods/jukebox/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/jukebox.zip + fi + + unzip $MINETEST_PATH/mods/jukebox.zip -d $MINETEST_PATH/mods +fi + +cp -r $MINETEST_PATH/mods/jukebox-master $WORLD_PATH/worldmods + +## xdecor mod + +if [ ! -d $MINETEST_PATH/mods/xdecor-master ]; then + + if [ ! -f $MINETEST_PATH/mods/xdecor.zip ]; then + wget https://github.com/minetest-mods/xdecor/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/xdecor.zip + fi + + unzip $MINETEST_PATH/mods/xdecor.zip -d $MINETEST_PATH/mods +fi + +cp -r $MINETEST_PATH/mods/xdecor-master $WORLD_PATH/worldmods + +## Display modpack + +if [ ! -d $MINETEST_PATH/mods/display_modpack-master ]; then + + if [ ! -f $MINETEST_PATH/mods/display_modpack.zip ]; then + wget https://github.com/pyrollo/display_modpack/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/display_modpack.zip + fi + + unzip $MINETEST_PATH/mods/display_modpack.zip -d $MINETEST_PATH/mods +fi + +cp -r $MINETEST_PATH/mods/display_modpack-master $WORLD_PATH/worldmods + +## Letters + + +if [ ! -d $MINETEST_PATH/mods/letters-master ]; then + + if [ ! -f $MINETEST_PATH/mods/letters.zip ]; then + wget https://github.com/minetest-mods/letters/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/letters.zip + fi + + unzip $MINETEST_PATH/mods/letters.zip -d $MINETEST_PATH/mods +fi + +cp -r $MINETEST_PATH/mods/letters-master $WORLD_PATH/worldmods + +## mydoors + + +if [ ! -d $MINETEST_PATH/mods/mydoors-master ]; then + + if [ ! -f $MINETEST_PATH/mods/mydoors.zip ]; then + wget https://github.com/minetest-mods/mydoors/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/mydoors.zip + fi + + unzip $MINETEST_PATH/mods/mydoors.zip -d $MINETEST_PATH/mods +fi + +cp -r $MINETEST_PATH/mods/mydoors-master $WORLD_PATH/worldmods + + + diff --git a/minetest/start_server.sh b/minetest/start_server.sh new file mode 100755 index 0000000..832d3bd --- /dev/null +++ b/minetest/start_server.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/lib/minetest/minetestserver --port 30001 --world /home/pi/.minetest/worlds/astroport --config /home/pi/.minetest/worlds/astroport/minetest.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..2386738 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,39 @@ +server { + + root /home/pi/.zen/astrXbian/www/boris; + listen 80 default_server; + server_name _; + + # This section can be copied into an existing default setup + location / { + allow all; + index index.php index.html index.htm; + location ~ \.php { + try_files $uri index.php =404; + fastcgi_pass unix:/run/php/php7.3-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $request_filename; + include /etc/nginx/fastcgi_params; + fastcgi_read_timeout 1800; + } + error_page 404 = /error/404.html; + try_files $uri $uri/ =404; + location ~ /albumart/* { + expires -1s; + } + } + + + location /ipfs { + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + } + + location /ipns { + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + } + +} diff --git a/open_with_linux.py b/open_with_linux.py new file mode 100755 index 0000000..fe1dbec --- /dev/null +++ b/open_with_linux.py @@ -0,0 +1,184 @@ +#!/usr/bin/env python +from __future__ import print_function + +import os +import sys +import json +import struct +import subprocess + +VERSION = '7.1b2' + +try: + sys.stdin.buffer + + # Python 3.x version + # Read a message from stdin and decode it. + def getMessage(): + rawLength = sys.stdin.buffer.read(4) + if len(rawLength) == 0: + sys.exit(0) + messageLength = struct.unpack('@I', rawLength)[0] + message = sys.stdin.buffer.read(messageLength).decode('utf-8') + return json.loads(message) + + # Send an encoded message to stdout + def sendMessage(messageContent): + encodedContent = json.dumps(messageContent).encode('utf-8') + encodedLength = struct.pack('@I', len(encodedContent)) + + sys.stdout.buffer.write(encodedLength) + sys.stdout.buffer.write(encodedContent) + sys.stdout.buffer.flush() + +except AttributeError: + # Python 2.x version (if sys.stdin.buffer is not defined) + # Read a message from stdin and decode it. + def getMessage(): + rawLength = sys.stdin.read(4) + if len(rawLength) == 0: + sys.exit(0) + messageLength = struct.unpack('@I', rawLength)[0] + message = sys.stdin.read(messageLength) + return json.loads(message) + + # Send an encoded message to stdout + def sendMessage(messageContent): + encodedContent = json.dumps(messageContent) + encodedLength = struct.pack('@I', len(encodedContent)) + + sys.stdout.write(encodedLength) + sys.stdout.write(encodedContent) + sys.stdout.flush() + + +def install(): + home_path = os.getenv('HOME') + + manifest = { + 'name': 'open_with', + 'description': 'Open With native host', + 'path': os.path.realpath(__file__), + 'type': 'stdio', + } + locations = { + 'chrome': os.path.join(home_path, '.config', 'google-chrome', 'NativeMessagingHosts'), + 'chromium': os.path.join(home_path, '.config', 'chromium', 'NativeMessagingHosts'), + 'firefox': os.path.join(home_path, '.mozilla', 'native-messaging-hosts'), + } + filename = 'open_with.json' + + for browser, location in locations.items(): + if os.path.exists(os.path.dirname(location)): + if not os.path.exists(location): + os.mkdir(location) + + browser_manifest = manifest.copy() + if browser == 'firefox': + browser_manifest['allowed_extensions'] = ['openwith@darktrojan.net'] + else: + browser_manifest['allowed_origins'] = [ + 'chrome-extension://cogjlncmljjnjpbgppagklanlcbchlno/', # Chrome + 'chrome-extension://fbmcaggceafhobjkhnaakhgfmdaadhhg/', # Opera + ] + + with open(os.path.join(location, filename), 'w') as file: + file.write( + json.dumps(browser_manifest, indent=2, separators=(',', ': '), sort_keys=True).replace(' ', '\t') + '\n' + ) + + +def _read_desktop_file(path): + with open(path, 'r') as desktop_file: + current_section = None + name = None + command = None + for line in desktop_file: + if line[0] == '[': + current_section = line[1:-2] + if current_section != 'Desktop Entry': + continue + + if line.startswith('Name='): + name = line[5:].strip() + elif line.startswith('Exec='): + command = line[5:].strip() + + return { + 'name': name, + 'command': command + } + + +def find_browsers(): + apps = [ + 'Chrome', + 'Chromium', + 'chromium-browser', + 'firefox', + 'Firefox', + 'Google Chrome', + 'google-chrome', + 'opera', + 'Opera', + 'SeaMonkey', + 'seamonkey', + ] + paths = [ + os.path.join(os.getenv('HOME'), '.local/share/applications'), + '/usr/local/share/applications', + '/usr/share/applications' + ] + suffix = '.desktop' + + results = [] + for p in paths: + for a in apps: + fp = os.path.join(p, a) + suffix + if os.path.exists(fp): + results.append(_read_desktop_file(fp)) + return results + + +def listen(): + receivedMessage = getMessage() + if receivedMessage == 'ping': + sendMessage({ + 'version': VERSION, + 'file': os.path.realpath(__file__) + }) + elif receivedMessage == 'find': + sendMessage(find_browsers()) + else: + for k, v in os.environ.items(): + if k.startswith('MOZ_'): + try: + os.unsetenv(k) + except: + os.environ[k] = '' + + devnull = open(os.devnull, 'w') + subprocess.Popen(receivedMessage, stdout=devnull, stderr=devnull) + sendMessage(None) + + +if __name__ == '__main__': + if len(sys.argv) == 2: + if sys.argv[1] == 'install': + install() + sys.exit(0) + elif sys.argv[1] == 'find_browsers': + print(find_browsers()) + sys.exit(0) + + allowed_extensions = [ + 'openwith@darktrojan.net', + 'chrome-extension://cogjlncmljjnjpbgppagklanlcbchlno/', + 'chrome-extension://fbmcaggceafhobjkhnaakhgfmdaadhhg/', + ] + for ae in allowed_extensions: + if ae in sys.argv: + listen() + sys.exit(0) + + print('Open With native helper, version %s.' % VERSION) diff --git a/search b/search new file mode 100755 index 0000000..07dc754 --- /dev/null +++ b/search @@ -0,0 +1,16 @@ +#!/bin/bash +clear +echo "------------------------------------------------------------------------------" +if [ "$1" == "" ]; then + echo " Nothing to search for!" +else + echo " Searching for "$1" recursively. Please Wait..." + echo "------------------------------------------------------------------------------" + grep -h -r --exclude=B00 -H --colour=always "$1" ./ +fi +echo "------------------------------------------------------------------------------" +if [ "$2" != "" ]; then + echo " To replace \"$1\" whith \"$2\", please run" + echo " grep -rl '$1' ./ | xargs sed -i 's/$1/$2/g'" +fi +## THIS IS A GREAT RETRO ENGINEERING AND CODING TOOLS diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index 83e181a..9776938 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -1,11 +1,11 @@ #shellcheck shell=sh Describe 'AstrXbian' - Describe 'install()' - Include ./include.sh + Describe 'install.sh' + Include ./include.sh It 'should check it applies to me' When call i_am - The output should eq 'v0.4' + The output should eq 'v0.5.0' End It 'should check I am not superuser' When call i_am_root @@ -20,14 +20,14 @@ Describe 'AstrXbian' When run check_requirements The status should be success End - It 'should import AstrXbian, but not tested' + It 'should import astrXbian, but not tested' Skip "You should implement import_astrXbian tests" When run import_astrXbian The status should be success End - It 'should import Kodi, but not tested' - Skip "You should implement import_kodi tests" - When run import_kodi + It 'should import astroport, but not tested' + Skip "You should implement import_astroport tests" + When run import_astroport The status should be success End It 'should import IPFS, but not tested' @@ -40,9 +40,9 @@ Describe 'AstrXbian' When run import_jaklis The status should be success End - It 'should create astrXbian id, but not tested' - Skip "You should implement iso_config tests" - When run iso_config + It 'should import Kodi, but not tested' + Skip "You should implement import_kodi tests" + When run import_kodi The status should be success End It 'should prepare astrXbian for first boot, but not tested' diff --git a/www/boris/ajax.php b/www/boris/ajax.php new file mode 100644 index 0000000..3af7e8e --- /dev/null +++ b/www/boris/ajax.php @@ -0,0 +1,35 @@ + diff --git a/www/boris/ajaxform.js b/www/boris/ajaxform.js new file mode 100644 index 0000000..2b0c3af --- /dev/null +++ b/www/boris/ajaxform.js @@ -0,0 +1,41 @@ +jQuery(document).ready(function () { + var host = window.location.hostname; + $('#nodename').html(host); + + $("#formphone").submit(function(e) { + e.preventDefault(); // avoid to execute the actual submit of the form. + console.log("button PHONE clicked"); + $("#phoneresultat").html("

ensuite patiente un peu... ce monde est Zen.

" + + "

Tu recevras une clef pour te libérer des services privés du vieux monde.

" + + ""); + // declare these vars + var phone = jQuery("#phone"); + var parrain = jQuery("#parrain"); + var naissance = jQuery("#naissance"); + var data = ''; + // ajax call to ajax.php + jQuery.getJSON("http://"+host+":10099/sms_loveland.php", { + phone: phone.val(), parrain: parrain.val(), naissance: naissance.val() + }, function (data) { + $("#phoneresultat").html("

Votre inscription en prise en compte...

"); + }); + }); + + $("#formlink").submit(function(e) { + e.preventDefault(); // avoid to execute the actual submit of the form. + console.log("button LINK clicked"); + $("#linkresultat").html("

Merci! nous envoyons votre message à la GUILDE

"); + // declare these vars + var link = jQuery("#link"); + var phone = jQuery("#phone"); + var data = ''; + // ajax call to ajax.php + jQuery.getJSON("ajax.php", { + link: link.val(), phone: phone.val() + }, function (data) { + $("#linkresultat").html("

Astroport vous remercie pour votre nourriture médiatique

"); + }); + }); + + +}); diff --git a/www/boris/ajouter_video_youtube.sh b/www/boris/ajouter_video_youtube.sh new file mode 100755 index 0000000..efe2ee6 --- /dev/null +++ b/www/boris/ajouter_video_youtube.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +../../ajouter_video.sh $1 1 diff --git a/www/boris/check_entrance.sh b/www/boris/check_entrance.sh new file mode 100755 index 0000000..59ef5bd --- /dev/null +++ b/www/boris/check_entrance.sh @@ -0,0 +1,13 @@ +#!/bin/bash +######################################################################## +# Author: Astrocrew +# Version: 0.1 +# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) +######################################################################## +G1KEY="$1" + +[[ $G1KEY == "" ]] && echo "PUB KEY MISSINF" && exit 1 +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 + +## CHECK IF NODE HAS SEND A PAYMENT TO $G1KEY (TODO CHECK ALL BOOTSTRAPS) +~/.zen/astrXbian/zen/jaklis/jaklis.py history -p $G1KEY | grep $G1KEY diff --git a/www/boris/conf.php b/www/boris/conf.php index f8d591c..47dc34b 100644 --- a/www/boris/conf.php +++ b/www/boris/conf.php @@ -1,20 +1,51 @@ /dev/null", $output); +if (isset($output)) { + + define('IPFS_NODE_ID', $output[0]); +} + +define('IPFS_API_PORT', 5001); +define('IPFS_HOST', '127.0.0.1'); + +define('TAGLINE', 'Bienvenue chez vous'); /* Youtube Thumbnails -maxresdefault Full resolution image matching the uploaded. This image will not always exist. -sddefault 640x480 -hqdefault 480x360 Large Preview -mqdefault 320x180 Large Preview -default 120x 90 Large Preview -0 480x360 Large Preview -1 120x 90 First small thumbnail -2 120x 90 Second small thumbnail -3 120x 90 Third small thumbnail +maxresdefault Full resolution image matching the uploaded. This image will not always exist. +sddefault 640x480 +hqdefault 480x360 Large Preview +mqdefault 320x180 Large Preview +default 120x 90 Large Preview +0 480x360 Large Preview +1 120x 90 First small thumbnail +2 120x 90 Second small thumbnail +3 120x 90 Third small thumbnail */ define('YOUTUBE_THUMB', 'https://i.ytimg.com/vi/%s/mqdefault.jpg'); +define ('MEDIAQR','https://'.$_SERVER['SERVER_NAME'].'/ipns/%s/QR.png'); + + +// TODO : dynamic finding FRIENDS xzuid with "cat /home/$YOU/.zen/ipfs_swarm/.*/.player" +$stations = [ + 'virgo', + 'onelove', + 'Rea-3E', + 'foot1060' +]; diff --git a/www/boris/crowdbunker.css b/www/boris/crowdbunker.css deleted file mode 100644 index 030c326..0000000 --- a/www/boris/crowdbunker.css +++ /dev/null @@ -1,104 +0,0 @@ -:root { - - --pink: hsl(338.5, 72.8%, 36.1%); - --canard: hsl(200.8, 100%, 9.6%); -} - -body { - - background: #121212; - color: white; - margin: 0; - padding: 0; - font-family: Roboto,sans-serif; -} - -header { - - background: var(--canard); - overflow: hidden; - margin-bottom: 2rem; - -} - -header * { - - font-size: 1.5rem; - padding: 0.5rem; - margin: 0; - color: var(--pink); - text-decoration: none; -} - -header span { - - color: white; -} - - -main { - - width: 80%; - margin: auto; -} - -#videosList { - - display: grid; - grid-gap: 1rem 1rem; - grid-auto-flow: row; - grid-template-columns: 322px 322px 322px; - - list-style: none; - margin: 0; - padding: 0; -} - -#videosList li { - - background: var(--canard); - border-color: var(--pink); - border-radius: 0.25rem; - border-width: 1px; - border-style: solid; - overflow: hidden; -} - -#videosList .video-title { - - padding: 0.5rem 1rem; -} - -.video-title, -.video-title a, -.video-title a:visited { - - color: white; - font-weight: bold; - text-decoration: none; -} - -article { - - border-radius: 0.25rem; - background: hsl(200.8, 100%, 9.6%); - width: 58.3%; - margin: auto; - overflow: hidden; - -} - -article video { - - width: 100%; - max-height: 50vh; - background: black; -} - -article .video-title { - - font-weight: bold; - padding: 1rem 1rem; - font-size: 1.25rem; - margin: 0; -} diff --git a/www/boris/crowdbunker.css b/www/boris/crowdbunker.css new file mode 120000 index 0000000..51f0257 --- /dev/null +++ b/www/boris/crowdbunker.css @@ -0,0 +1 @@ +styles/crowdbunker/style.css \ No newline at end of file diff --git a/www/boris/css/flipclock.css b/www/boris/css/flipclock.css new file mode 100644 index 0000000..c467351 --- /dev/null +++ b/www/boris/css/flipclock.css @@ -0,0 +1,424 @@ +/* Get the bourbon mixin from http://bourbon.io */ +/* Reset */ +.flip-clock-wrapper * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + -o-box-sizing: border-box; + box-sizing: border-box; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + -o-backface-visibility: hidden; + backface-visibility: hidden; +} + +.clock{ +zoom: 0.7; +-moz-transform: scale(0.7) +} + +.flip-clock-wrapper a { + cursor: pointer; + text-decoration: none; + color: #ccc; } + +.flip-clock-wrapper a:hover { + color: #fff; } + +.flip-clock-wrapper ul { + list-style: none; } + +.flip-clock-wrapper.clearfix:before, +.flip-clock-wrapper.clearfix:after { + content: " "; + display: table; } + +.flip-clock-wrapper.clearfix:after { + clear: both; } + +.flip-clock-wrapper.clearfix { + *zoom: 1; } + +/* Main */ +.flip-clock-wrapper { + font: normal 11px "Helvetica Neue", Helvetica, sans-serif; + -webkit-user-select: none; } + +.flip-clock-meridium { + background: none !important; + box-shadow: 0 0 0 !important; + font-size: 36px !important; } + +.flip-clock-meridium a { color: #313333; } + +.flip-clock-wrapper { + text-align: center; + position: relative; + width: 100%; + margin: 1em; +} + +.flip-clock-wrapper:before, +.flip-clock-wrapper:after { + content: " "; /* 1 */ + display: table; /* 2 */ +} +.flip-clock-wrapper:after { + clear: both; +} + +/* Skeleton */ +.flip-clock-wrapper ul { + position: relative; + float: left; + margin: 5px; + width: 60px; + height: 90px; + font-size: 80px; + font-weight: bold; + line-height: 87px; + border-radius: 6px; + background: #000; +} + +.flip-clock-wrapper ul li { + z-index: 1; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + line-height: 87px; + text-decoration: none !important; +} + +.flip-clock-wrapper ul li:first-child { + z-index: 2; } + +.flip-clock-wrapper ul li a { + display: block; + height: 100%; + -webkit-perspective: 200px; + -moz-perspective: 200px; + perspective: 200px; + margin: 0 !important; + overflow: visible !important; + cursor: default !important; } + +.flip-clock-wrapper ul li a div { + z-index: 1; + position: absolute; + left: 0; + width: 100%; + height: 50%; + font-size: 80px; + overflow: hidden; + outline: 1px solid transparent; } + +.flip-clock-wrapper ul li a div .shadow { + position: absolute; + width: 100%; + height: 100%; + z-index: 2; } + +.flip-clock-wrapper ul li a div.up { + -webkit-transform-origin: 50% 100%; + -moz-transform-origin: 50% 100%; + -ms-transform-origin: 50% 100%; + -o-transform-origin: 50% 100%; + transform-origin: 50% 100%; + top: 0; } + +.flip-clock-wrapper ul li a div.up:after { + content: ""; + position: absolute; + top: 44px; + left: 0; + z-index: 5; + width: 100%; + height: 3px; + background-color: #000; + background-color: rgba(0, 0, 0, 0.4); } + +.flip-clock-wrapper ul li a div.down { + -webkit-transform-origin: 50% 0; + -moz-transform-origin: 50% 0; + -ms-transform-origin: 50% 0; + -o-transform-origin: 50% 0; + transform-origin: 50% 0; + bottom: 0; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; +} + +.flip-clock-wrapper ul li a div div.inn { + position: absolute; + left: 0; + z-index: 1; + width: 100%; + height: 200%; + color: #ccc; + text-shadow: 0 1px 2px #000; + text-align: center; + background-color: #333; + border-radius: 6px; + font-size: 70px; } + +.flip-clock-wrapper ul li a div.up div.inn { + top: 0; } + +.flip-clock-wrapper ul li a div.down div.inn { + bottom: 0; } + +/* PLAY */ +.flip-clock-wrapper ul.play li.flip-clock-before { + z-index: 3; } + +.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); } + +.flip-clock-wrapper ul.play li.flip-clock-active { + -webkit-animation: asd 0.01s 0.49s linear both; + -moz-animation: asd 0.01s 0.49s linear both; + animation: asd 0.01s 0.49s linear both; + z-index: 5; } + +.flip-clock-divider { + float: left; + display: inline-block; + position: relative; + width: 20px; + height: 100px; } + +.flip-clock-divider:first-child { + width: 0; } + +.flip-clock-dot { + display: block; + background: #323434; + width: 10px; + height: 10px; + position: absolute; + border-radius: 50%; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); + left: 5px; } + +.flip-clock-divider .flip-clock-label { + position: absolute; + top: -1.5em; + right: -86px; + color: black; + text-shadow: none; } + +.flip-clock-divider.minutes .flip-clock-label { + right: -88px; } + +.flip-clock-divider.seconds .flip-clock-label { + right: -91px; } + +.flip-clock-dot.top { + top: 30px; } + +.flip-clock-dot.bottom { + bottom: 30px; } + +@-webkit-keyframes asd { + 0% { + z-index: 2; } + + 100% { + z-index: 4; } } + +@-moz-keyframes asd { + 0% { + z-index: 2; } + + 100% { + z-index: 4; } } + +@-o-keyframes asd { + 0% { + z-index: 2; } + + 100% { + z-index: 4; } } + +@keyframes asd { + 0% { + z-index: 2; } + + 100% { + z-index: 4; } } + +.flip-clock-wrapper ul.play li.flip-clock-active .down { + z-index: 2; + -webkit-animation: turn 0.5s 0.5s linear both; + -moz-animation: turn 0.5s 0.5s linear both; + animation: turn 0.5s 0.5s linear both; } + +@-webkit-keyframes turn { + 0% { + -webkit-transform: rotateX(90deg); } + + 100% { + -webkit-transform: rotateX(0deg); } } + +@-moz-keyframes turn { + 0% { + -moz-transform: rotateX(90deg); } + + 100% { + -moz-transform: rotateX(0deg); } } + +@-o-keyframes turn { + 0% { + -o-transform: rotateX(90deg); } + + 100% { + -o-transform: rotateX(0deg); } } + +@keyframes turn { + 0% { + transform: rotateX(90deg); } + + 100% { + transform: rotateX(0deg); } } + +.flip-clock-wrapper ul.play li.flip-clock-before .up { + z-index: 2; + -webkit-animation: turn2 0.5s linear both; + -moz-animation: turn2 0.5s linear both; + animation: turn2 0.5s linear both; } + +@-webkit-keyframes turn2 { + 0% { + -webkit-transform: rotateX(0deg); } + + 100% { + -webkit-transform: rotateX(-90deg); } } + +@-moz-keyframes turn2 { + 0% { + -moz-transform: rotateX(0deg); } + + 100% { + -moz-transform: rotateX(-90deg); } } + +@-o-keyframes turn2 { + 0% { + -o-transform: rotateX(0deg); } + + 100% { + -o-transform: rotateX(-90deg); } } + +@keyframes turn2 { + 0% { + transform: rotateX(0deg); } + + 100% { + transform: rotateX(-90deg); } } + +.flip-clock-wrapper ul li.flip-clock-active { + z-index: 3; } + +/* SHADOW */ +.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow { + background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black)); + background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; + background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; + -webkit-animation: show 0.5s linear both; + -moz-animation: show 0.5s linear both; + animation: show 0.5s linear both; } + +.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow { + background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black)); + background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; + background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; + -webkit-animation: hide 0.5s 0.3s linear both; + -moz-animation: hide 0.5s 0.3s linear both; + animation: hide 0.5s 0.3s linear both; } + +/*DOWN*/ +.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow { + background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1))); + background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; + background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; + -webkit-animation: show 0.5s linear both; + -moz-animation: show 0.5s linear both; + animation: show 0.5s linear both; } + +.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow { + background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1))); + background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; + background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; + -webkit-animation: hide 0.5s 0.3s linear both; + -moz-animation: hide 0.5s 0.3s linear both; + animation: hide 0.5s 0.2s linear both; } + +@-webkit-keyframes show { + 0% { + opacity: 0; } + + 100% { + opacity: 1; } } + +@-moz-keyframes show { + 0% { + opacity: 0; } + + 100% { + opacity: 1; } } + +@-o-keyframes show { + 0% { + opacity: 0; } + + 100% { + opacity: 1; } } + +@keyframes show { + 0% { + opacity: 0; } + + 100% { + opacity: 1; } } + +@-webkit-keyframes hide { + 0% { + opacity: 1; } + + 100% { + opacity: 0; } } + +@-moz-keyframes hide { + 0% { + opacity: 1; } + + 100% { + opacity: 0; } } + +@-o-keyframes hide { + 0% { + opacity: 1; } + + 100% { + opacity: 0; } } + +@keyframes hide { + 0% { + opacity: 1; } + + 100% { + opacity: 0; } } diff --git a/www/boris/css/landing-page.css b/www/boris/css/landing-page.css new file mode 100644 index 0000000..26f4551 --- /dev/null +++ b/www/boris/css/landing-page.css @@ -0,0 +1,162 @@ +body { + font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-weight: 700; +} + +header.masthead { + position: relative; + background-color: #343a40; + background: url("../img/bg-masthead.jpg") no-repeat center center; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + padding-top: 8rem; + padding-bottom: 8rem; +} + +header.masthead .overlay { + position: absolute; + background-color: #212529; + height: 100%; + width: 100%; + top: 0; + left: 0; + opacity: 0.3; +} + +header.masthead h1 { + font-size: 2rem; +} + +@media (min-width: 768px) { + header.masthead { + padding-top: 12rem; + padding-bottom: 12rem; + } + header.masthead h1 { + font-size: 3rem; + } +} + +section.map { + position: relative; + background-color: #343a40; + background: url("../img/Feedless.jpg") no-repeat center center; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + padding-top: 18rem; + padding-bottom: 18rem; +} + +section.map .overlay { + position: absolute; + background-color: #212529; + height: 100%; + width: 100%; + top: 0; + left: 0; + opacity: 0.3; +} + +section.map h1 { + font-size: 15rem; +} + +@media (min-width: 768px) { + section.map { + padding-top: 28rem; + padding-bottom: 28rem; + } + section.map h1 { + font-size: 15rem; + } +} + +.showcase .showcase-text { + padding: 3rem; +} + +.showcase .showcase-img { + min-height: 30rem; + background-size: cover; +} + +@media (min-width: 768px) { + .showcase .showcase-text { + padding: 7rem; + } +} + +.features-icons { + padding-top: 7rem; + padding-bottom: 7rem; +} + +.features-icons .features-icons-item { + max-width: 20rem; +} + +.features-icons .features-icons-item .features-icons-icon { + height: 7rem; +} + +.features-icons .features-icons-item .features-icons-icon i { + font-size: 4.5rem; +} + +.features-icons .features-icons-item:hover .features-icons-icon i { + font-size: 5rem; +} + +.testimonials { + padding-top: 7rem; + padding-bottom: 7rem; +} + +.testimonials .testimonial-item { + max-width: 18rem; +} + +.testimonials .testimonial-item img { + max-width: 12rem; + box-shadow: 0px 5px 5px 0px #adb5bd; +} + +.call-to-action { + position: relative; + background-color: #343a40; + background: url("../img/bg-masthead.jpg") no-repeat center center; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + padding-top: 7rem; + padding-bottom: 7rem; +} + +.call-to-action .overlay { + position: absolute; + background-color: #212529; + height: 100%; + width: 100%; + top: 0; + left: 0; + opacity: 0.3; +} + +footer.footer { + padding-top: 4rem; + padding-bottom: 4rem; +} diff --git a/www/boris/css/landing-page.min.css b/www/boris/css/landing-page.min.css new file mode 100644 index 0000000..53e13d4 --- /dev/null +++ b/www/boris/css/landing-page.min.css @@ -0,0 +1 @@ +body{font-family:Lato,'Helvetica Neue',Helvetica,Arial,sans-serif}h1,h2,h3,h4,h5,h6{font-family:Lato,'Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:700}header.masthead{position:relative;background-color:#343a40;background:url(../img/bg-masthead.jpg) no-repeat center center;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;padding-top:8rem;padding-bottom:8rem}header.masthead .overlay{position:absolute;background-color:#212529;height:100%;width:100%;top:0;left:0;opacity:.3}header.masthead h1{font-size:2rem}@media (min-width:768px){header.masthead{padding-top:12rem;padding-bottom:12rem}header.masthead h1{font-size:3rem}}.showcase .showcase-text{padding:3rem}.showcase .showcase-img{min-height:30rem;background-size:cover}@media (min-width:768px){.showcase .showcase-text{padding:7rem}}.features-icons{padding-top:7rem;padding-bottom:7rem}.features-icons .features-icons-item{max-width:20rem}.features-icons .features-icons-item .features-icons-icon{height:7rem}.features-icons .features-icons-item .features-icons-icon i{font-size:4.5rem}.features-icons .features-icons-item:hover .features-icons-icon i{font-size:5rem}.testimonials{padding-top:7rem;padding-bottom:7rem}.testimonials .testimonial-item{max-width:18rem}.testimonials .testimonial-item img{max-width:12rem;box-shadow:0 5px 5px 0 #adb5bd}.call-to-action{position:relative;background-color:#343a40;background:url(../img/bg-masthead.jpg) no-repeat center center;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;padding-top:7rem;padding-bottom:7rem}.call-to-action .overlay{position:absolute;background-color:#212529;height:100%;width:100%;top:0;left:0;opacity:.3}footer.footer{padding-top:4rem;padding-bottom:4rem} \ No newline at end of file diff --git a/www/boris/favicon.ico b/www/boris/favicon.ico new file mode 100644 index 0000000..e0128c6 Binary files /dev/null and b/www/boris/favicon.ico differ diff --git a/www/boris/film.php b/www/boris/film.php new file mode 100644 index 0000000..ab0d9ad --- /dev/null +++ b/www/boris/film.php @@ -0,0 +1,106 @@ + $mimeType, + 'url' => $videoURL, + 'eco' => $videoEco, + 'uri' => $videoURI, + 'mediakeyipns' => $h, + 'name' => $videoName, + 'youtubeID' => $youtubeID + ]; + } + +} + + +?> + + + Astro CLUB + + + + + +
+

+ Astroport CopyLaRadio Video CLUB Libre entre Amis +

+
+ +
+ + +
+
+ + +
+
Astroport protège votre liberté numérique. + C'est un centre d'hébergement qui partage ses données entre amis exclusivement hébergée par vos soins! +
Toute contribution y est rétribuée dans la première Monnaie Libre G1. + Utilisez vos Junes pour faire des dons à vos medias favoris pour payer leur hébergement et remercier leur auteur.

+
+ +
+ +'; + +foreach ($videosList as $video) { + + echo '
  • '; + +// $href = 'youtube_watch.php?uri='. $video['uri'] . '&name='. urlencode($video['name']) .'&mime='. $video['mime']; + + echo ' + + + '. $video['name'] . ' + + +

    + + ' . $video['name'] . ' + +

    '; + + echo '
  • '; +} + +echo ''; +?> +
    + + + diff --git a/www/boris/functions.php b/www/boris/functions.php index 578aa54..5e81a81 100644 --- a/www/boris/functions.php +++ b/www/boris/functions.php @@ -64,3 +64,179 @@ function guessTypeFromFilename ($filename) { return $type; } + +function astroport_urlencode ($str) { + + $str = str_replace('%', '%25', $str); + $str = str_replace('#', '%23', $str); + $str = str_replace('\'', '%27', $str); + $str = str_replace('"', '%22', $str); + + return $str; +} + +function quickfix_getYoutubeIdFromIpfsFileName ($name) { + + return substr($name, 0, 11); + +} + +function quickfix_getVideoNameFromIpfsFileName ($name) { + + //$name = substr($name, 12); + $name = substr($name, 0, strrpos($name, '.')); + + return $name; +} + +function formatDuration ($seconds) { + + $h = floor($seconds / 3600); + $h_r = $seconds % 3600; + $m = floor($h_r / 60); + $s = $h_r % 60; + + if ($h != 0) { + + return sprintf("%s:%s:%s", $h, str_pad($m, 2, '0', STR_PAD_LEFT), str_pad($s, 2, '0', STR_PAD_LEFT)); + + } else { + + return sprintf("%s:%s", $m, str_pad($s, 2, '0', STR_PAD_LEFT)); + + } +} + +function getVideoJson ($ipnsHash) { + + $indexHTML = @file_get_contents('http://' . HOST . '/ipns/' . $ipnsHash . '/index.html'); + + if (empty($indexHTML)) { + + return []; + + } else { + + // $indexHTML = @file_get_contents('http://' . HOST . '/ipns/' . $ipfsNodeId . '/.' . $ipfsNodeId . '/KEY/'); + + $re = '!/ipns/[^/]+/([^/]+)/!isU'; + + preg_match($re, $indexHTML, $matches); + + $ipnsHiddenHash = $matches[1]; + + $indexHTML = @file_get_contents('http://' . HOST . '/ipns/' . $ipnsHash . '/' . $ipnsHiddenHash . '/video.json'); + + if (empty($indexHTML)) { + + return []; + + } else { + + return json_decode($indexHTML); + } + } + +} + + +function getTagsListFromTagStr ($str) { + + if (substr($str, 0, 1) == "[") { + + $str = substr($str, 1); + $str = substr($str, 0, -1); + + preg_match_all('/"([^"]+)"/isU', $str, $matches, PREG_PATTERN_ORDER); + $tags = $matches[1]; + + } else { + + $tags = explode('|', $str); + } + + if ((count($tags) == 1) and empty($tags[0])) { + + return array(); + + } else { + + return $tags; + } +} + +function separateTags ($tags, $stations) { + + return [ + array_diff($tags, $stations), + array_intersect($tags, $stations) + ]; + +} + +function isStation ($tag) { + + global $stations; + + return in_array($tag, $stations); +} + +function buildRequestedURI ($uri, $params, $escapeHTML = false) { + + $URL = $uri; + $first = true; + + foreach ($params as $k => $v) { + + if ($first) { + + $URL .= '?'; + $first = false; + + } else { + + if ($escapeHTML) { + + $URL .= '&'; + + } else { + + $URL .= '&'; + } + } + + $URL .= $k . '=' . htmlspecialchars($v); + } + + return $URL; +} + +function handleVideoID ($videoID) { + + preg_match('/^((?P([a-zA-Z0-9-]+\.)?[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)_)?(?P.+)$/is', $videoID, $matches); + + $ndd = empty($matches['ndd']) ? 'www.youtube.com' : strrev($matches['ndd']); + $id = $matches['id']; + + return [ + $ndd, + $id + ]; +} + +function canReadVideoFormat ($mimeType) { + + return ($mimeType == 'video/mp4'); +} + +function in_array_column($text, $column, $array) +{ + if (!empty($array) && is_array($array)) + { + for ($i=0; $i < count($array); $i++) + { + if ($array[$i][$column]==$text || strcmp($array[$i][$column],$text)==0) return true; + } + } + return false; +} diff --git a/www/boris/g1scan.html b/www/boris/g1scan.html new file mode 100644 index 0000000..7f80ee4 --- /dev/null +++ b/www/boris/g1scan.html @@ -0,0 +1,36 @@ + + + G1 scan + + + + + + + + Fork me on GitHub +
    + +
    + +
    +
    + +
    +

    Scans

    +
    +
    + + + + diff --git a/www/boris/g1scan_fichiers/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875.png b/www/boris/g1scan_fichiers/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875.png new file mode 100644 index 0000000..1e19c21 Binary files /dev/null and b/www/boris/g1scan_fichiers/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875.png differ diff --git a/www/boris/g1scan_fichiers/adapter.js b/www/boris/g1scan_fichiers/adapter.js new file mode 100644 index 0000000..845f4e1 --- /dev/null +++ b/www/boris/g1scan_fichiers/adapter.js @@ -0,0 +1,3 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.adapter=e()}}(function(){return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var p=r[o]={exports:{}};t[o][0].call(p.exports,function(e){var r=t[o][1][e];return i(r||e)},p,p.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o-1?(r.attribute=e.substr(t+1,n-t-1),r.value=e.substr(n+1)):r.attribute=e.substr(t+1),r},n.getMid=function(e){var t=n.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},n.getDtlsParameters=function(e,t){var r=n.splitLines(e);r=r.concat(n.splitLines(t));var i=r.filter(function(e){return 0===e.indexOf("a=fingerprint:")})[0].substr(14);return{role:"auto",fingerprints:[{algorithm:i.split(" ")[0].toLowerCase(),value:i.split(" ")[1]}]}},n.writeDtlsParameters=function(e,t){var r="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),r},n.getIceParameters=function(e,t){var r=n.splitLines(e);return r=r.concat(n.splitLines(t)),{usernameFragment:r.filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:r.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)}},n.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},n.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e),i=r[0].split(" "),a=3;a0?"9":"0",r+=" UDP/TLS/RTP/SAVPF ",r+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)});var i=0;return t.codecs.forEach(function(e){e.maxptime>i&&(i=e.maxptime)}),i>0&&(r+="a=maxptime:"+i+"\r\n"),r+="a=rtcp-mux\r\n",t.headerExtensions.forEach(function(e){r+=n.writeExtmap(e)}),r},n.parseRtpEncodingParameters=function(e){var t,r=[],i=n.parseRtpParameters(e),a=-1!==i.fecMechanisms.indexOf("RED"),o=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=s.length>0&&s[0].ssrc,d=n.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.split(" ");return t.shift(),t.map(function(e){return parseInt(e,10)})});d.length>0&&d[0].length>1&&d[0][0]===c&&(t=d[0][1]),i.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{ssrc:t}};r.push(n),a&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:t,mechanism:o?"red+ulpfec":"red"},r.push(n))}}),0===r.length&&c&&r.push({ssrc:c});var p=n.matchPrefix(e,"b=");return p.length&&(0===p[0].indexOf("b=TIAS:")?p=parseInt(p[0].substr(7),10):0===p[0].indexOf("b=AS:")&&(p=parseInt(p[0].substr(5),10)),r.forEach(function(e){e.maxBitrate=p})),r},n.parseRtcpParameters=function(e){var t={},r=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];r&&(t.cname=r.value,t.ssrc=r.ssrc);var i=n.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var a=n.matchPrefix(e,"a=rtcp-mux");return t.mux=a.length>0,t},n.parseMsid=function(e){var t,r=n.matchPrefix(e,"a=msid:");if(1===r.length)return t=r[0].substr(7).split(" "),{stream:t[0],track:t[1]};var i=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return i.length>0?(t=i[0].value.split(" "),{stream:t[0],track:t[1]}):void 0},n.writeSessionBoilerplate=function(){return"v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(e,t,r,i){var a=n.writeRtpDescription(e.kind,t);if(a+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var o="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";a+="a="+o,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+o,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+o,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),a},n.getDirection=function(e,t){for(var r=n.splitLines(e),i=0;i0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof arguments[0]))return t.apply(this,[]);var o=function(e){var t={};return e.result().forEach(function(e){var r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(function(t){r[t]=e.stat(t)}),t[r.id]=r}),t},s=function(e){return new Map(Object.keys(e).map(function(t){return[t,e[t]]}))};if(arguments.length>=2){var c=function(e){a[1](s(o(e)))};return t.apply(this,[c,arguments[0]])}return new Promise(function(e,r){t.apply(i,[function(t){e(s(o(t)))},r])}).then(r,n)},i.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=RTCPeerConnection.prototype[e];RTCPeerConnection.prototype[e]=function(){var e=arguments,r=this,n=new Promise(function(n,i){t.apply(r,[e[0],n,i])});return e.length<2?n:n.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}}),i.version<52&&["createOffer","createAnswer"].forEach(function(e){var t=RTCPeerConnection.prototype[e];RTCPeerConnection.prototype[e]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var r=1===arguments.length?arguments[0]:void 0;return new Promise(function(n,i){t.apply(e,[n,i,r])})}return t.apply(this,arguments)}}),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=RTCPeerConnection.prototype[e];RTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}});var r=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}};t.exports={shimMediaStream:a.shimMediaStream,shimOnTrack:a.shimOnTrack,shimGetSendersWithDtmf:a.shimGetSendersWithDtmf,shimSourceObject:a.shimSourceObject,shimPeerConnection:a.shimPeerConnection,shimGetUserMedia:e("./getusermedia")}},{"../utils.js":11,"./getusermedia":4}],4:[function(e,t,r){"use strict";var n=e("../utils.js").log,i=e("../utils.js").browserDetails;t.exports=function(){var e=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(r){if("require"!==r&&"advanced"!==r&&"mediaSource"!==r){var n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];var a={};"number"==typeof n.ideal?(a[i("min",r)]=n.ideal,t.optional.push(a),a={},a[i("max",r)]=n.ideal,t.optional.push(a)):(a[i("",r)]=n.ideal,t.optional.push(a))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach(function(e){void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},t=function(t,r){if(t=JSON.parse(JSON.stringify(t)),t&&t.audio&&(t.audio=e(t.audio)),t&&"object"==typeof t.video){var a=t.video.facingMode;a=a&&("object"==typeof a?a:{ideal:a});var o=i.version<61;if(a&&("user"===a.exact||"environment"===a.exact||"user"===a.ideal||"environment"===a.ideal)&&(!navigator.mediaDevices.getSupportedConstraints||!navigator.mediaDevices.getSupportedConstraints().facingMode||o)){delete t.video.facingMode;var s;if("environment"===a.exact||"environment"===a.ideal?s=["back","rear"]:"user"!==a.exact&&"user"!==a.ideal||(s=["front"]),s)return navigator.mediaDevices.enumerateDevices().then(function(i){i=i.filter(function(e){return"videoinput"===e.kind});var o=i.find(function(e){return s.some(function(t){return-1!==e.label.toLowerCase().indexOf(t)})});return!o&&i.length&&-1!==s.indexOf("back")&&(o=i[i.length-1]),o&&(t.video.deviceId=a.exact?{exact:o.deviceId}:{ideal:o.deviceId}),t.video=e(t.video),n("chrome: "+JSON.stringify(t)),r(t)})}t.video=e(t.video)}return n("chrome: "+JSON.stringify(t)),r(t)},r=function(e){return{name:{PermissionDeniedError:"NotAllowedError",ConstraintNotSatisfiedError:"OverconstrainedError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},a=function(e,n,i){t(e,function(e){navigator.webkitGetUserMedia(e,n,function(e){i(r(e))})})};navigator.getUserMedia=a;var o=function(e){return new Promise(function(t,r){navigator.getUserMedia(e,t,r)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:o,enumerateDevices:function(){return new Promise(function(e){var t={audio:"audioinput",video:"videoinput"};return MediaStreamTrack.getSources(function(r){e(r.map(function(e){return{label:e.label,kind:t[e.kind],deviceId:e.id,groupId:""}}))})})},getSupportedConstraints:function(){return{deviceId:!0,echoCancellation:!0,facingMode:!0,frameRate:!0,height:!0,width:!0}}}),navigator.mediaDevices.getUserMedia){var s=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(e){return t(e,function(e){return s(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("","NotFoundError");return t},function(e){return Promise.reject(r(e))})})}}else navigator.mediaDevices.getUserMedia=function(e){return o(e)};void 0===navigator.mediaDevices.addEventListener&&(navigator.mediaDevices.addEventListener=function(){n("Dummy mediaDevices.addEventListener called.")}),void 0===navigator.mediaDevices.removeEventListener&&(navigator.mediaDevices.removeEventListener=function(){n("Dummy mediaDevices.removeEventListener called.")})}},{"../utils.js":11}],5:[function(e,t,r){"use strict";var n=e("../utils").browserDetails,i=e("./rtcpeerconnection_shim");t.exports={shimGetUserMedia:e("./getusermedia"),shimPeerConnection:function(){if(window.RTCIceGatherer&&(window.RTCIceCandidate||(window.RTCIceCandidate=function(e){return e}),window.RTCSessionDescription||(window.RTCSessionDescription=function(e){return e}),n.version<15025)){var e=Object.getOwnPropertyDescriptor(MediaStreamTrack.prototype,"enabled");Object.defineProperty(MediaStreamTrack.prototype,"enabled",{set:function(t){e.set.call(this,t);var r=new Event("enabled");r.enabled=t,this.dispatchEvent(r)}})}window.RTCPeerConnection=i(n.version)},shimReplaceTrack:function(){!window.RTCRtpSender||"replaceTrack"in RTCRtpSender.prototype||(RTCRtpSender.prototype.replaceTrack=RTCRtpSender.prototype.setTrack)}}},{"../utils":11,"./getusermedia":6,"./rtcpeerconnection_shim":7}],6:[function(e,t,r){"use strict";t.exports=function(){var e=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}},t=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(r){return t(r).catch(function(t){return Promise.reject(e(t))})}}},{}],7:[function(e,t,r){"use strict";function n(e){var t=e.filter(function(e){return"audio"===e.kind}),r=e.filter(function(e){return"video"===e.kind});for(e=[];t.length||r.length;)t.length&&e.push(t.shift()),r.length&&e.push(r.shift());return e}function i(e,t){var r=!1;return e=JSON.parse(JSON.stringify(e)),e.filter(function(e){if(e&&(e.urls||e.url)){var n=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var i="string"==typeof n;return i&&(n=[n]),n=n.filter(function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||r?0===e.indexOf("stun:")&&t>=14393:(r=!0,!0)}),delete e.url,e.urls=i?n[0]:n,!!n.length}return!1})}var a=e("sdp");t.exports=function(e){var t=function(t){var r=this,n=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){r[e]=n[e].bind(n)}),this.onicecandidate=null,this.onaddstream=null,this.ontrack=null,this.onremovestream=null,this.onsignalingstatechange=null,this.oniceconnectionstatechange=null,this.onicegatheringstatechange=null,this.onnegotiationneeded=null,this.ondatachannel=null,this.canTrickleIceCandidates=null,this.localStreams=[],this.remoteStreams=[],this.getLocalStreams=function(){return r.localStreams},this.getRemoteStreams=function(){return r.remoteStreams},this.localDescription=new RTCSessionDescription({type:"",sdp:""}),this.remoteDescription=new RTCSessionDescription({type:"",sdp:""}),this.signalingState="stable",this.iceConnectionState="new",this.iceGatheringState="new",this.iceOptions={gatherPolicy:"all",iceServers:[]},t&&t.iceTransportPolicy)switch(t.iceTransportPolicy){case"all":case"relay":this.iceOptions.gatherPolicy=t.iceTransportPolicy}this.usingBundle=t&&"max-bundle"===t.bundlePolicy,t&&t.iceServers&&(this.iceOptions.iceServers=i(t.iceServers,e)),this._config=t||{},this.transceivers=[],this._localIceCandidatesBuffer=[]};return t.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this.dispatchEvent(e),null!==this.onicegatheringstatechange&&this.onicegatheringstatechange(e)},t.prototype._emitBufferedCandidates=function(){var e=this,t=a.splitSections(e.localDescription.sdp);this._localIceCandidatesBuffer.forEach(function(r){if(r.candidate&&0!==Object.keys(r.candidate).length)t[r.candidate.sdpMLineIndex+1]+="a="+r.candidate.candidate+"\r\n";else for(var n=1;n=15025)this.localStreams.push(t);else{var r=t.clone();t.getTracks().forEach(function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",function(e){n.enabled=e.enabled})}),this.localStreams.push(r)}this._maybeFireNegotiationNeeded()},t.prototype.removeStream=function(e){var t=this.localStreams.indexOf(e);t>-1&&(this.localStreams.splice(t,1),this._maybeFireNegotiationNeeded())},t.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},t.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},t.prototype._getCommonCapabilities=function(e,t){var r={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(e,t){e=parseInt(e,10);for(var r=0;r0;t.forEach(function(e,t){var o=n.transceivers[t],s=o.iceGatherer,c=o.iceTransport,d=o.dtlsTransport,p=o.localCapabilities,u=o.remoteCapabilities;if(!a.isRejected(e)&&!o.isDatachannel){var f=a.getIceParameters(e,r),l=a.getDtlsParameters(e,r);i&&(l.role="server"),n.usingBundle&&0!==t||(c.start(s,f,i?"controlling":"controlled"),d.start(l));var m=n._getCommonCapabilities(p,u);n._transceive(o,m.codecs.length>0,!1)}})}switch(this.localDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-local-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}var o=arguments.length>1&&"function"==typeof arguments[1];if(o){var s=arguments[1];window.setTimeout(function(){s(),"new"===n.iceGatheringState&&(n.iceGatheringState="gathering",n._emitGatheringStateChange()),n._emitBufferedCandidates()},0)}var c=Promise.resolve();return c.then(function(){o||("new"===n.iceGatheringState&&(n.iceGatheringState="gathering",n._emitGatheringStateChange()),window.setTimeout(n._emitBufferedCandidates.bind(n),500))}),c},t.prototype.setRemoteDescription=function(t){var r=this,n={},i=[],o=a.splitSections(t.sdp),s=o.shift(),c=a.matchPrefix(s,"a=ice-lite").length>0,d=a.matchPrefix(s,"a=group:BUNDLE ").length>0,p=a.matchPrefix(s,"a=ice-options:")[0];switch(this.canTrickleIceCandidates=!!p&&p.substr(14).split(" ").indexOf("trickle")>=0,o.forEach(function(o,p){var u=a.splitLines(o),f=a.getKind(o),l=a.isRejected(o),m=u[0].substr(2).split(" ")[2],h=a.getDirection(o,s),v=a.parseMsid(o),g=a.getMid(o)||a.generateIdentifier();if("application"===f&&"DTLS/SCTP"===m)return void(r.transceivers[p]={mid:g,isDatachannel:!0});var w,y,C,b,T,P,S,R,E,k,x,O,D=a.parseRtpParameters(o);l||(x=a.getIceParameters(o,s),O=a.getDtlsParameters(o,s),O.role="client"),R=a.parseRtpEncodingParameters(o);var M=a.parseRtcpParameters(o),L=a.matchPrefix(o,"a=end-of-candidates",s).length>0,j=a.matchPrefix(o,"a=candidate:").map(function(e){return a.parseCandidate(e)}).filter(function(e){return"1"===e.component});if("offer"!==t.type||l)"answer"!==t.type||l||(d&&p>0&&(r._disposeIceAndDtlsTransports(p),r.transceivers[p].iceGatherer=r.transceivers[0].iceGatherer,r.transceivers[p].iceTransport=r.transceivers[0].iceTransport,r.transceivers[p].dtlsTransport=r.transceivers[0].dtlsTransport,r.transceivers[p].rtpSender&&r.transceivers[p].rtpSender.setTransport(r.transceivers[0].dtlsTransport),r.transceivers[p].rtpReceiver&&r.transceivers[p].rtpReceiver.setTransport(r.transceivers[0].dtlsTransport)),w=r.transceivers[p],y=w.iceGatherer,C=w.iceTransport,b=w.dtlsTransport,T=w.rtpSender,P=w.rtpReceiver,S=w.sendEncodingParameters,E=w.localCapabilities,r.transceivers[p].recvEncodingParameters=R,r.transceivers[p].remoteCapabilities=D,r.transceivers[p].rtcpParameters=M,(c||L)&&j.length&&C.setRemoteCandidates(j),d&&0!==p||(C.start(y,x,"controlling"),b.start(O)),r._transceive(w,"sendrecv"===h||"recvonly"===h,"sendrecv"===h||"sendonly"===h), +!P||"sendrecv"!==h&&"sendonly"!==h?delete w.rtpReceiver:(k=P.track,v?(n[v.stream]||(n[v.stream]=new MediaStream),n[v.stream].addTrack(k),i.push([k,P,n[v.stream]])):(n.default||(n.default=new MediaStream),n.default.addTrack(k),i.push([k,P,n.default]))));else{var _=d&&p>0?{iceGatherer:r.transceivers[0].iceGatherer,iceTransport:r.transceivers[0].iceTransport,dtlsTransport:r.transceivers[0].dtlsTransport}:r._createIceAndDtlsTransports(g,p);if(!L||d&&0!==p||_.iceTransport.setRemoteCandidates(j),E=RTCRtpReceiver.getCapabilities(f),e<15019&&(E.codecs=E.codecs.filter(function(e){return"rtx"!==e.name})),S=[{ssrc:1001*(2*p+2)}],"sendrecv"!==h&&"sendonly"!==h||(P=new RTCRtpReceiver(_.dtlsTransport,f),k=P.track,v?(n[v.stream]||(n[v.stream]=new MediaStream,Object.defineProperty(n[v.stream],"id",{get:function(){return v.stream}})),Object.defineProperty(k,"id",{get:function(){return v.track}}),n[v.stream].addTrack(k),i.push([k,P,n[v.stream]])):(n.default||(n.default=new MediaStream),n.default.addTrack(k),i.push([k,P,n.default]))),r.localStreams.length>0&&r.localStreams[0].getTracks().length>=p){var U;"audio"===f?U=r.localStreams[0].getAudioTracks()[0]:"video"===f&&(U=r.localStreams[0].getVideoTracks()[0]),U&&(e>=15019&&"video"===f&&(S[0].rtx={ssrc:1001*(2*p+2)+1}),T=new RTCRtpSender(U,_.dtlsTransport))}r.transceivers[p]={iceGatherer:_.iceGatherer,iceTransport:_.iceTransport,dtlsTransport:_.dtlsTransport,localCapabilities:E,remoteCapabilities:D,rtpSender:T,rtpReceiver:P,kind:f,mid:g,rtcpParameters:M,sendEncodingParameters:S,recvEncodingParameters:R},r._transceive(r.transceivers[p],!1,"sendrecv"===h||"sendonly"===h)}}),this.usingBundle=d,this.remoteDescription={type:t.type,sdp:t.sdp},t.type){case"offer":this._updateSignalingState("have-remote-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+t.type+'"')}return Object.keys(n).forEach(function(e){var t=n[e];if(t.getTracks().length){r.remoteStreams.push(t);var a=new Event("addstream");a.stream=t,r.dispatchEvent(a),null!==r.onaddstream&&window.setTimeout(function(){r.onaddstream(a)},0),i.forEach(function(e){var n=e[0],i=e[1];if(t.id===e[2].id){var a=new Event("track");a.track=n,a.receiver=i,a.streams=[t],r.dispatchEvent(a),null!==r.ontrack&&window.setTimeout(function(){r.ontrack(a)},0)}})}}),arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},t.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._updateSignalingState("closed")},t.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this.dispatchEvent(t),null!==this.onsignalingstatechange&&this.onsignalingstatechange(t)},t.prototype._maybeFireNegotiationNeeded=function(){var e=new Event("negotiationneeded");this.dispatchEvent(e),null!==this.onnegotiationneeded&&this.onnegotiationneeded(e)},t.prototype._updateConnectionState=function(){var e,t=this,r={new:0,closed:0,connecting:0,checking:0,connected:0,completed:0,failed:0};if(this.transceivers.forEach(function(e){r[e.iceTransport.state]++,r[e.dtlsTransport.state]++}),r.connected+=r.completed,e="new",r.failed>0?e="failed":r.connecting>0||r.checking>0?e="connecting":r.disconnected>0?e="disconnected":r.new>0?e="new":(r.connected>0||r.completed>0)&&(e="connected"),e!==t.iceConnectionState){t.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this.dispatchEvent(n),null!==this.oniceconnectionstatechange&&this.oniceconnectionstatechange(n)}},t.prototype.createOffer=function(){var t=this;if(this._pendingOffer)throw new Error("createOffer called while there is a pending offer.");var r;1===arguments.length&&"function"!=typeof arguments[0]?r=arguments[0]:3===arguments.length&&(r=arguments[2]);var i=[],o=0,s=0;if(this.localStreams.length&&(o=this.localStreams.reduce(function(e,t){return e+t.getAudioTracks().length},0),s=this.localStreams.reduce(function(e,t){return e+t.getVideoTracks().length},0)),r){if(r.mandatory||r.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==r.offerToReceiveAudio&&(o=!0===r.offerToReceiveAudio?1:!1===r.offerToReceiveAudio?0:r.offerToReceiveAudio),void 0!==r.offerToReceiveVideo&&(s=!0===r.offerToReceiveVideo?1:!1===r.offerToReceiveVideo?0:r.offerToReceiveVideo)}for(this.localStreams.forEach(function(e){e.getTracks().forEach(function(t){i.push({kind:t.kind,track:t,stream:e,wantReceive:"audio"===t.kind?o>0:s>0}),"audio"===t.kind?o--:"video"===t.kind&&s--})});o>0||s>0;)o>0&&(i.push({kind:"audio",wantReceive:!0}),o--),s>0&&(i.push({kind:"video",wantReceive:!0}),s--);i=n(i);var c=a.writeSessionBoilerplate(),d=[];i.forEach(function(r,n){var i=r.track,o=r.kind,s=a.generateIdentifier(),c=t.usingBundle&&n>0?{iceGatherer:d[0].iceGatherer,iceTransport:d[0].iceTransport,dtlsTransport:d[0].dtlsTransport}:t._createIceAndDtlsTransports(s,n),p=RTCRtpSender.getCapabilities(o);e<15019&&(p.codecs=p.codecs.filter(function(e){return"rtx"!==e.name})),p.codecs.forEach(function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1")});var u,f,l=[{ssrc:1001*(2*n+1)}];i&&(e>=15019&&"video"===o&&(l[0].rtx={ssrc:1001*(2*n+1)+1}),u=new RTCRtpSender(i,c.dtlsTransport)),r.wantReceive&&(f=new RTCRtpReceiver(c.dtlsTransport,o)),d[n]={iceGatherer:c.iceGatherer,iceTransport:c.iceTransport,dtlsTransport:c.dtlsTransport,localCapabilities:p,remoteCapabilities:null,rtpSender:u,rtpReceiver:f,kind:o,mid:s,sendEncodingParameters:l,recvEncodingParameters:null}}),"max-compat"!==this._config.bundlePolicy&&(c+="a=group:BUNDLE "+d.map(function(e){return e.mid}).join(" ")+"\r\n"),c+="a=ice-options:trickle\r\n",i.forEach(function(e,t){var r=d[t];c+=a.writeMediaSection(r,r.localCapabilities,"offer",e.stream),c+="a=rtcp-rsize\r\n"}),this._pendingOffer=d;var p=new RTCSessionDescription({type:"offer",sdp:c});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,p),Promise.resolve(p)},t.prototype.createAnswer=function(){var e=this,t=a.writeSessionBoilerplate();this.usingBundle&&(t+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),this.transceivers.forEach(function(r){if(r.isDatachannel)return void(t+="m=application 0 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=mid:"+r.mid+"\r\n");var n=e._getCommonCapabilities(r.localCapabilities,r.remoteCapabilities);!n.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length&&r.sendEncodingParameters[0].rtx&&delete r.sendEncodingParameters[0].rtx,t+=a.writeMediaSection(r,n,"answer",e.localStreams[0]),r.rtcpParameters&&r.rtcpParameters.reducedSize&&(t+="a=rtcp-rsize\r\n")});var r=new RTCSessionDescription({type:"answer",sdp:t});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,r),Promise.resolve(r)},t.prototype.addIceCandidate=function(e){if(e){var t=e.sdpMLineIndex;if(e.sdpMid)for(var r=0;r0?a.parseCandidate(e.candidate):{};if("tcp"===i.protocol&&(0===i.port||9===i.port))return Promise.resolve();if("1"!==i.component)return Promise.resolve();n.iceTransport.addRemoteCandidate(i);var o=a.splitSections(this.remoteDescription.sdp);o[t+1]+=(i.type?e.candidate.trim():"a=end-of-candidates")+"\r\n",this.remoteDescription.sdp=o.join("")}}else for(var s=0;s1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},t.prototype.getStats=function(){var e=[];this.transceivers.forEach(function(t){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(r){t[r]&&e.push(t[r].getStats())})});var t=arguments.length>1&&"function"==typeof arguments[1]&&arguments[1],r=function(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};return new Promise(function(n){var i=new Map;Promise.all(e).then(function(e){e.forEach(function(e){Object.keys(e).forEach(function(t){e[t].type=r(e[t]),i.set(t,e[t])})}),t&&window.setTimeout(t,0,i),n(i)})})},t}},{sdp:1}],8:[function(e,t,r){"use strict";var n=e("../utils").browserDetails,i={shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var r=new Event("track");r.track=t,r.receiver={track:t},r.streams=[e.stream],this.dispatchEvent(r)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(){if("object"==typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection)){window.RTCPeerConnection||(window.RTCPeerConnection=function(e,t){if(n.version<38&&e&&e.iceServers){for(var r=[],i=0;i=0)){this._streams.push(t);var r=new Event("addstream");r.stream=e.streams[0],this.dispatchEvent(r)}}.bind(this))}})},shimGetUserMedia:function(){navigator.getUserMedia||(navigator.webkitGetUserMedia?navigator.getUserMedia=navigator.webkitGetUserMedia.bind(navigator):navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&(navigator.getUserMedia=function(e,t,r){navigator.mediaDevices.getUserMedia(e).then(t,r)}.bind(navigator)))}};t.exports={shimOnAddStream:n.shimOnAddStream,shimGetUserMedia:n.shimGetUserMedia}},{}],11:[function(e,t,r){"use strict";var n=!0,i={disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(n=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},log:function(){if("object"==typeof window){if(n)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},extractVersion:function(e,t,r){var n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)},detectBrowser:function(){var e={};if(e.browser=null,e.version=null,"undefined"==typeof window||!window.navigator)return e.browser="Not a browser.",e;if(navigator.mozGetUserMedia)e.browser="firefox",e.version=this.extractVersion(navigator.userAgent,/Firefox\/(\d+)\./,1);else if(navigator.webkitGetUserMedia)if(window.webkitRTCPeerConnection)e.browser="chrome",e.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!navigator.userAgent.match(/Version\/(\d+).(\d+)/))return e.browser="Unsupported webkit-based browser with GUM support but no WebRTC support.",e;e.browser="safari",e.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1)}else if(navigator.mediaDevices&&navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))e.browser="edge",e.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!navigator.mediaDevices||!navigator.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1)}return e},shimCreateObjectURL:function(){if("object"==typeof window&&window.HTMLMediaElement&&"srcObject"in window.HTMLMediaElement.prototype){var e=URL.createObjectURL.bind(URL),t=URL.revokeObjectURL.bind(URL),r=new Map,n=0;URL.createObjectURL=function(t){if("getTracks"in t){var i="polyblob:"+ ++n;return r.set(i,t),console.log("URL.createObjectURL(stream) is deprecated! Use elem.srcObject = stream instead!"),i}return e(t)},URL.revokeObjectURL=function(e){t(e),r.delete(e)};var i=Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype,"src");Object.defineProperty(window.HTMLMediaElement.prototype,"src",{get:function(){return i.get.apply(this)},set:function(e){return this.srcObject=r.get(e)||null,i.set.apply(this,[e])}});var a=HTMLMediaElement.prototype.setAttribute;HTMLMediaElement.prototype.setAttribute=function(){return 2===arguments.length&&"src"===(""+arguments[0]).toLowerCase()&&(this.srcObject=r.get(arguments[1])||null),a.apply(this,arguments)}}}};t.exports={log:i.log,disableLog:i.disableLog,browserDetails:i.detectBrowser(),extractVersion:i.extractVersion,shimCreateObjectURL:i.shimCreateObjectURL,detectBrowser:i.detectBrowser.bind(i)}},{}]},{},[2])(2)}); +//# sourceMappingURL=adapter.min.js.map \ No newline at end of file diff --git a/www/boris/g1scan_fichiers/app.js b/www/boris/g1scan_fichiers/app.js new file mode 100644 index 0000000..9a49084 --- /dev/null +++ b/www/boris/g1scan_fichiers/app.js @@ -0,0 +1,36 @@ +var app = new Vue({ + el: '#app', + data: { + scanner: null, + activeCameraId: null, + cameras: [], + scans: [] + }, + mounted: function () { + var self = this; + self.scanner = new Instascan.Scanner({ video: document.getElementById('preview'), scanPeriod: 5 }); + self.scanner.addListener('scan', function (content, image) { + self.scans.unshift({ date: +(Date.now()), content: content }); + }); + Instascan.Camera.getCameras().then(function (cameras) { + self.cameras = cameras; + if (cameras.length > 0) { + self.activeCameraId = cameras[0].id; + self.scanner.start(cameras[0]); + } else { + console.error('No cameras found.'); + } + }).catch(function (e) { + console.error(e); + }); + }, + methods: { + formatName: function (name) { + return name || '(unknown)'; + }, + selectCamera: function (camera) { + this.activeCameraId = camera.id; + this.scanner.start(camera); + } + } +}); diff --git a/www/boris/g1scan_fichiers/instascan.js b/www/boris/g1scan_fichiers/instascan.js new file mode 100644 index 0000000..0881218 --- /dev/null +++ b/www/boris/g1scan_fichiers/instascan.js @@ -0,0 +1,48 @@ +!function e(i,r,n){function t(f,a){if(!r[f]){if(!i[f]){var u="function"==typeof require&&require;if(!a&&u)return u(f,!0);if(o)return o(f,!0);var s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}var l=r[f]={exports:{}};i[f][0].call(l.exports,function(e){var r=i[f][1][e];return t(r?r:e)},l,l.exports,e,i,r,n)}return r[f].exports}for(var o="function"==typeof require&&require,f=0;f2?arguments[2]:void 0,l=Math.min((void 0===s?f:t(s,f))-u,f-a),c=1;for(u0;)u in r?r[a]=r[u]:delete r[a],a+=c,u+=c;return r}},{"./_to-index":107,"./_to-length":110,"./_to-object":111}],11:[function(e,i,r){"use strict";var n=e("./_to-object"),t=e("./_to-index"),o=e("./_to-length");i.exports=function(e){for(var i=n(this),r=o(i.length),f=arguments.length,a=t(f>1?arguments[1]:void 0,r),u=f>2?arguments[2]:void 0,s=void 0===u?r:t(u,r);s>a;)i[a++]=e;return i}},{"./_to-index":107,"./_to-length":110,"./_to-object":111}],12:[function(e,i,r){var n=e("./_for-of");i.exports=function(e,i){var r=[];return n(e,!1,r.push,r,i),r}},{"./_for-of":39}],13:[function(e,i,r){var n=e("./_to-iobject"),t=e("./_to-length"),o=e("./_to-index");i.exports=function(e){return function(i,r,f){var a,u=n(i),s=t(u.length),l=o(f,s);if(e&&r!=r){for(;s>l;)if(a=u[l++],a!=a)return!0}else for(;s>l;l++)if((e||l in u)&&u[l]===r)return e||l||0;return!e&&-1}}},{"./_to-index":107,"./_to-iobject":109,"./_to-length":110}],14:[function(e,i,r){var n=e("./_ctx"),t=e("./_iobject"),o=e("./_to-object"),f=e("./_to-length"),a=e("./_array-species-create");i.exports=function(e,i){var r=1==e,u=2==e,s=3==e,l=4==e,c=6==e,d=5==e||c,b=i||a;return function(i,a,h){for(var k,_,p=o(i),v=t(p),w=n(a,h,3),m=f(v.length),g=0,y=r?b(i,m):u?b(i,0):void 0;m>g;g++)if((d||g in v)&&(k=v[g],_=w(k,g,p),e))if(r)y[g]=_;else if(_)switch(e){case 3:return!0;case 5:return k;case 6:return g;case 2:y.push(k)}else if(l)return!1;return c?-1:s||l?l:y}}},{"./_array-species-create":17,"./_ctx":27,"./_iobject":47,"./_to-length":110,"./_to-object":111}],15:[function(e,i,r){var n=e("./_a-function"),t=e("./_to-object"),o=e("./_iobject"),f=e("./_to-length");i.exports=function(e,i,r,a,u){n(i);var s=t(e),l=o(s),c=f(s.length),d=u?c-1:0,b=u?-1:1;if(r<2)for(;;){if(d in l){a=l[d],d+=b;break}if(d+=b,u?d<0:c<=d)throw TypeError("Reduce of empty array with no initial value")}for(;u?d>=0:c>d;d+=b)d in l&&(a=i(a,l[d],d,s));return a}},{"./_a-function":5,"./_iobject":47,"./_to-length":110,"./_to-object":111}],16:[function(e,i,r){var n=e("./_is-object"),t=e("./_is-array"),o=e("./_wks")("species");i.exports=function(e){var i;return t(e)&&(i=e.constructor,"function"!=typeof i||i!==Array&&!t(i.prototype)||(i=void 0),n(i)&&(i=i[o],null===i&&(i=void 0))),void 0===i?Array:i}},{"./_is-array":49,"./_is-object":51,"./_wks":119}],17:[function(e,i,r){var n=e("./_array-species-constructor");i.exports=function(e,i){return new(n(e))(i)}},{"./_array-species-constructor":16}],18:[function(e,i,r){"use strict";var n=e("./_a-function"),t=e("./_is-object"),o=e("./_invoke"),f=[].slice,a={},u=function(e,i,r){if(!(i in a)){for(var n=[],t=0;t1?arguments[1]:void 0,3);i=i?i.n:this._f;)for(r(i.v,i.k,this);i&&i.r;)i=i.p},has:function(e){return!!_(this,e)}}),b&&n(c.prototype,"size",{get:function(){return u(this[k])}}),c},def:function(e,i,r){var n,t,o=_(e,i);return o?o.v=r:(e._l=o={i:t=h(i,!0),k:i,v:r,p:n=e._l,n:void 0,r:!1},e._f||(e._f=o),n&&(n.n=o),e[k]++,"F"!==t&&(e._i[t]=o)),e},getEntry:_,setStrong:function(e,i,r){l(e,i,function(e,i){this._t=e,this._k=i,this._l=void 0},function(){for(var e=this,i=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==i?c(0,r.k):"values"==i?c(0,r.v):c(0,[r.k,r.v]):(e._t=void 0,c(1))},r?"entries":"values",!r,!0),d(i)}}},{"./_an-instance":8,"./_ctx":27,"./_defined":29,"./_descriptors":30,"./_for-of":39,"./_iter-define":55,"./_iter-step":57,"./_meta":64,"./_object-create":68,"./_object-dp":69,"./_redefine-all":88,"./_set-species":93}],22:[function(e,i,r){var n=e("./_classof"),t=e("./_array-from-iterable");i.exports=function(e){return function(){if(n(this)!=e)throw TypeError(e+"#toJSON isn't generic");return t(this)}}},{"./_array-from-iterable":12,"./_classof":19}],23:[function(e,i,r){"use strict";var n=e("./_redefine-all"),t=e("./_meta").getWeak,o=e("./_an-object"),f=e("./_is-object"),a=e("./_an-instance"),u=e("./_for-of"),s=e("./_array-methods"),l=e("./_has"),c=s(5),d=s(6),b=0,h=function(e){return e._l||(e._l=new k)},k=function(){this.a=[]},_=function(e,i){return c(e.a,function(e){return e[0]===i})};k.prototype={get:function(e){var i=_(this,e);if(i)return i[1]},has:function(e){return!!_(this,e)},set:function(e,i){var r=_(this,e);r?r[1]=i:this.a.push([e,i])},"delete":function(e){var i=d(this.a,function(i){return i[0]===e});return~i&&this.a.splice(i,1),!!~i}},i.exports={getConstructor:function(e,i,r,o){var s=e(function(e,n){a(e,s,i,"_i"),e._i=b++,e._l=void 0,void 0!=n&&u(n,r,e[o],e)});return n(s.prototype,{"delete":function(e){if(!f(e))return!1;var i=t(e);return i===!0?h(this)["delete"](e):i&&l(i,this._i)&&delete i[this._i]},has:function(e){if(!f(e))return!1;var i=t(e);return i===!0?h(this).has(e):i&&l(i,this._i)}}),s},def:function(e,i,r){var n=t(o(i),!0);return n===!0?h(e).set(i,r):n[e._i]=r,e},ufstore:h}},{"./_an-instance":8,"./_an-object":9,"./_array-methods":14,"./_for-of":39,"./_has":41,"./_is-object":51,"./_meta":64,"./_redefine-all":88}],24:[function(e,i,r){"use strict";var n=e("./_global"),t=e("./_export"),o=e("./_redefine"),f=e("./_redefine-all"),a=e("./_meta"),u=e("./_for-of"),s=e("./_an-instance"),l=e("./_is-object"),c=e("./_fails"),d=e("./_iter-detect"),b=e("./_set-to-string-tag"),h=e("./_inherit-if-required");i.exports=function(e,i,r,k,_,p){var v=n[e],w=v,m=_?"set":"add",g=w&&w.prototype,y={},E=function(e){var i=g[e];o(g,e,"delete"==e?function(e){return!(p&&!l(e))&&i.call(this,0===e?0:e)}:"has"==e?function(e){return!(p&&!l(e))&&i.call(this,0===e?0:e)}:"get"==e?function(e){return p&&!l(e)?void 0:i.call(this,0===e?0:e)}:"add"==e?function(e){return i.call(this,0===e?0:e),this}:function(e,r){return i.call(this,0===e?0:e,r),this})};if("function"==typeof w&&(p||g.forEach&&!c(function(){(new w).entries().next()}))){var S=new w,O=S[m](p?{}:-0,1)!=S,C=c(function(){S.has(1)}),A=d(function(e){new w(e)}),x=!p&&c(function(){for(var e=new w,i=5;i--;)e[m](i,i);return!e.has(-0)});A||(w=i(function(i,r){s(i,w,e);var n=h(new v,i,w);return void 0!=r&&u(r,_,n[m],n),n}),w.prototype=g,g.constructor=w),(C||x)&&(E("delete"),E("has"),_&&E("get")),(x||O)&&E(m),p&&g.clear&&delete g.clear}else w=k.getConstructor(i,e,_,m),f(w.prototype,r),a.NEED=!0;return b(w,e),y[e]=w,t(t.G+t.W+t.F*(w!=v),y),p||k.setStrong(w,e,_),w}},{"./_an-instance":8,"./_export":34,"./_fails":36,"./_for-of":39,"./_global":40,"./_inherit-if-required":45,"./_is-object":51,"./_iter-detect":56,"./_meta":64,"./_redefine":89,"./_redefine-all":88,"./_set-to-string-tag":94}],25:[function(e,i,r){var n=i.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},{}],26:[function(e,i,r){"use strict";var n=e("./_object-dp"),t=e("./_property-desc");i.exports=function(e,i,r){i in e?n.f(e,i,t(0,r)):e[i]=r}},{"./_object-dp":69,"./_property-desc":87}],27:[function(e,i,r){var n=e("./_a-function");i.exports=function(e,i,r){if(n(e),void 0===i)return e;switch(r){case 1:return function(r){return e.call(i,r)};case 2:return function(r,n){return e.call(i,r,n)};case 3:return function(r,n,t){return e.call(i,r,n,t)}}return function(){return e.apply(i,arguments)}}},{"./_a-function":5}],28:[function(e,i,r){"use strict";var n=e("./_an-object"),t=e("./_to-primitive"),o="number";i.exports=function(e){if("string"!==e&&e!==o&&"default"!==e)throw TypeError("Incorrect hint");return t(n(this),e!=o)}},{"./_an-object":9,"./_to-primitive":112}],29:[function(e,i,r){i.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},{}],30:[function(e,i,r){i.exports=!e("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":36}],31:[function(e,i,r){var n=e("./_is-object"),t=e("./_global").document,o=n(t)&&n(t.createElement);i.exports=function(e){return o?t.createElement(e):{}}},{"./_global":40,"./_is-object":51}],32:[function(e,i,r){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],33:[function(e,i,r){var n=e("./_object-keys"),t=e("./_object-gops"),o=e("./_object-pie");i.exports=function(e){var i=n(e),r=t.f;if(r)for(var f,a=r(e),u=o.f,s=0;a.length>s;)u.call(e,f=a[s++])&&i.push(f);return i}},{"./_object-gops":75,"./_object-keys":78,"./_object-pie":79}],34:[function(e,i,r){var n=e("./_global"),t=e("./_core"),o=e("./_hide"),f=e("./_redefine"),a=e("./_ctx"),u="prototype",s=function(e,i,r){var l,c,d,b,h=e&s.F,k=e&s.G,_=e&s.S,p=e&s.P,v=e&s.B,w=k?n:_?n[i]||(n[i]={}):(n[i]||{})[u],m=k?t:t[i]||(t[i]={}),g=m[u]||(m[u]={});k&&(r=i);for(l in r)c=!h&&w&&void 0!==w[l],d=(c?w:r)[l],b=v&&c?a(d,n):p&&"function"==typeof d?a(Function.call,d):d,w&&f(w,l,d,e&s.U),m[l]!=d&&o(m,l,b),p&&g[l]!=d&&(g[l]=d)};n.core=t,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,i.exports=s},{"./_core":25,"./_ctx":27,"./_global":40,"./_hide":42,"./_redefine":89}],35:[function(e,i,r){var n=e("./_wks")("match");i.exports=function(e){var i=/./;try{"/./"[e](i)}catch(r){try{return i[n]=!1,!"/./"[e](i)}catch(t){}}return!0}},{"./_wks":119}],36:[function(e,i,r){i.exports=function(e){try{return!!e()}catch(i){return!0}}},{}],37:[function(e,i,r){"use strict";var n=e("./_hide"),t=e("./_redefine"),o=e("./_fails"),f=e("./_defined"),a=e("./_wks");i.exports=function(e,i,r){var u=a(e),s=r(f,u,""[e]),l=s[0],c=s[1];o(function(){var i={};return i[u]=function(){return 7},7!=""[e](i)})&&(t(String.prototype,e,l),n(RegExp.prototype,u,2==i?function(e,i){return c.call(e,this,i)}:function(e){return c.call(e,this)}))}},{"./_defined":29,"./_fails":36,"./_hide":42,"./_redefine":89,"./_wks":119}],38:[function(e,i,r){"use strict";var n=e("./_an-object");i.exports=function(){var e=n(this),i="";return e.global&&(i+="g"),e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),e.sticky&&(i+="y"),i}},{"./_an-object":9}],39:[function(e,i,r){var n=e("./_ctx"),t=e("./_iter-call"),o=e("./_is-array-iter"),f=e("./_an-object"),a=e("./_to-length"),u=e("./core.get-iterator-method"),s={},l={},r=i.exports=function(e,i,r,c,d){var b,h,k,_,p=d?function(){return e}:u(e),v=n(r,c,i?2:1),w=0;if("function"!=typeof p)throw TypeError(e+" is not iterable!");if(o(p)){for(b=a(e.length);b>w;w++)if(_=i?v(f(h=e[w])[0],h[1]):v(e[w]),_===s||_===l)return _}else for(k=p.call(e);!(h=k.next()).done;)if(_=t(k,v,h.value,i),_===s||_===l)return _};r.BREAK=s,r.RETURN=l},{"./_an-object":9,"./_ctx":27,"./_is-array-iter":48,"./_iter-call":53,"./_to-length":110,"./core.get-iterator-method":120}],40:[function(e,i,r){var n=i.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],41:[function(e,i,r){var n={}.hasOwnProperty;i.exports=function(e,i){return n.call(e,i)}},{}],42:[function(e,i,r){var n=e("./_object-dp"),t=e("./_property-desc");i.exports=e("./_descriptors")?function(e,i,r){return n.f(e,i,t(1,r))}:function(e,i,r){return e[i]=r,e}},{"./_descriptors":30,"./_object-dp":69,"./_property-desc":87}],43:[function(e,i,r){i.exports=e("./_global").document&&document.documentElement},{"./_global":40}],44:[function(e,i,r){i.exports=!e("./_descriptors")&&!e("./_fails")(function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":30,"./_dom-create":31,"./_fails":36}],45:[function(e,i,r){var n=e("./_is-object"),t=e("./_set-proto").set;i.exports=function(e,i,r){var o,f=i.constructor;return f!==r&&"function"==typeof f&&(o=f.prototype)!==r.prototype&&n(o)&&t&&t(e,o),e}},{"./_is-object":51,"./_set-proto":92}],46:[function(e,i,r){i.exports=function(e,i,r){var n=void 0===r;switch(i.length){case 0:return n?e():e.call(r);case 1:return n?e(i[0]):e.call(r,i[0]);case 2:return n?e(i[0],i[1]):e.call(r,i[0],i[1]);case 3:return n?e(i[0],i[1],i[2]):e.call(r,i[0],i[1],i[2]);case 4:return n?e(i[0],i[1],i[2],i[3]):e.call(r,i[0],i[1],i[2],i[3])}return e.apply(r,i)}},{}],47:[function(e,i,r){var n=e("./_cof");i.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},{"./_cof":20}],48:[function(e,i,r){var n=e("./_iterators"),t=e("./_wks")("iterator"),o=Array.prototype;i.exports=function(e){return void 0!==e&&(n.Array===e||o[t]===e)}},{"./_iterators":58,"./_wks":119}],49:[function(e,i,r){var n=e("./_cof");i.exports=Array.isArray||function(e){return"Array"==n(e)}},{"./_cof":20}],50:[function(e,i,r){var n=e("./_is-object"),t=Math.floor;i.exports=function(e){return!n(e)&&isFinite(e)&&t(e)===e}},{"./_is-object":51}],51:[function(e,i,r){i.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],52:[function(e,i,r){var n=e("./_is-object"),t=e("./_cof"),o=e("./_wks")("match");i.exports=function(e){var i;return n(e)&&(void 0!==(i=e[o])?!!i:"RegExp"==t(e))}},{"./_cof":20,"./_is-object":51,"./_wks":119}],53:[function(e,i,r){var n=e("./_an-object");i.exports=function(e,i,r,t){try{return t?i(n(r)[0],r[1]):i(r)}catch(o){var f=e["return"];throw void 0!==f&&n(f.call(e)),o}}},{"./_an-object":9}],54:[function(e,i,r){"use strict";var n=e("./_object-create"),t=e("./_property-desc"),o=e("./_set-to-string-tag"),f={};e("./_hide")(f,e("./_wks")("iterator"),function(){return this}),i.exports=function(e,i,r){e.prototype=n(f,{next:t(1,r)}),o(e,i+" Iterator")}},{"./_hide":42,"./_object-create":68,"./_property-desc":87,"./_set-to-string-tag":94,"./_wks":119}],55:[function(e,i,r){"use strict";var n=e("./_library"),t=e("./_export"),o=e("./_redefine"),f=e("./_hide"),a=e("./_has"),u=e("./_iterators"),s=e("./_iter-create"),l=e("./_set-to-string-tag"),c=e("./_object-gpo"),d=e("./_wks")("iterator"),b=!([].keys&&"next"in[].keys()),h="@@iterator",k="keys",_="values",p=function(){return this};i.exports=function(e,i,r,v,w,m,g){s(r,i,v);var y,E,S,O=function(e){if(!b&&e in R)return R[e];switch(e){case k:return function(){return new r(this,e)};case _:return function(){return new r(this,e)}}return function(){return new r(this,e)}},C=i+" Iterator",A=w==_,x=!1,R=e.prototype,F=R[d]||R[h]||w&&R[w],M=F||O(w),T=w?A?O("entries"):M:void 0,P="Array"==i?R.entries||F:F;if(P&&(S=c(P.call(new e)),S!==Object.prototype&&(l(S,C,!0),n||a(S,d)||f(S,d,p))),A&&F&&F.name!==_&&(x=!0,M=function(){return F.call(this)}),n&&!g||!b&&!x&&R[d]||f(R,d,M),u[i]=M,u[C]=p,w)if(y={values:A?M:O(_),keys:m?M:O(k),entries:T},g)for(E in y)E in R||o(R,E,y[E]);else t(t.P+t.F*(b||x),i,y);return y}},{"./_export":34,"./_has":41,"./_hide":42,"./_iter-create":54,"./_iterators":58,"./_library":60,"./_object-gpo":76,"./_redefine":89,"./_set-to-string-tag":94,"./_wks":119}],56:[function(e,i,r){var n=e("./_wks")("iterator"),t=!1;try{var o=[7][n]();o["return"]=function(){t=!0},Array.from(o,function(){throw 2})}catch(f){}i.exports=function(e,i){if(!i&&!t)return!1;var r=!1;try{var o=[7],f=o[n]();f.next=function(){return{done:r=!0}},o[n]=function(){return f},e(o)}catch(a){}return r}},{"./_wks":119}],57:[function(e,i,r){i.exports=function(e,i){return{value:i,done:!!e}}},{}],58:[function(e,i,r){i.exports={}},{}],59:[function(e,i,r){var n=e("./_object-keys"),t=e("./_to-iobject");i.exports=function(e,i){for(var r,o=t(e),f=n(o),a=f.length,u=0;a>u;)if(o[r=f[u++]]===i)return r}},{"./_object-keys":78,"./_to-iobject":109}],60:[function(e,i,r){i.exports=!1},{}],61:[function(e,i,r){var n=Math.expm1;i.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||n(-2e-17)!=-2e-17?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},{}],62:[function(e,i,r){i.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},{}],63:[function(e,i,r){i.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},{}],64:[function(e,i,r){var n=e("./_uid")("meta"),t=e("./_is-object"),o=e("./_has"),f=e("./_object-dp").f,a=0,u=Object.isExtensible||function(){return!0},s=!e("./_fails")(function(){return u(Object.preventExtensions({}))}),l=function(e){f(e,n,{value:{i:"O"+ ++a,w:{}}})},c=function(e,i){if(!t(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,n)){if(!u(e))return"F";if(!i)return"E";l(e)}return e[n].i},d=function(e,i){if(!o(e,n)){if(!u(e))return!0;if(!i)return!1;l(e)}return e[n].w},b=function(e){return s&&h.NEED&&u(e)&&!o(e,n)&&l(e),e},h=i.exports={KEY:n,NEED:!1,fastKey:c,getWeak:d,onFreeze:b}},{"./_fails":36,"./_has":41,"./_is-object":51,"./_object-dp":69,"./_uid":116}],65:[function(e,i,r){var n=e("./es6.map"),t=e("./_export"),o=e("./_shared")("metadata"),f=o.store||(o.store=new(e("./es6.weak-map"))),a=function(e,i,r){var t=f.get(e);if(!t){if(!r)return;f.set(e,t=new n)}var o=t.get(i);if(!o){if(!r)return;t.set(i,o=new n)}return o},u=function(e,i,r){var n=a(i,r,!1);return void 0!==n&&n.has(e)},s=function(e,i,r){var n=a(i,r,!1);return void 0===n?void 0:n.get(e)},l=function(e,i,r,n){a(r,n,!0).set(e,i)},c=function(e,i){var r=a(e,i,!1),n=[];return r&&r.forEach(function(e,i){n.push(i)}),n},d=function(e){return void 0===e||"symbol"==typeof e?e:String(e)},b=function(e){t(t.S,"Reflect",e)};i.exports={store:f,map:a,has:u,get:s,set:l,keys:c,key:d,exp:b}},{"./_export":34,"./_shared":96,"./es6.map":151,"./es6.weak-map":257}],66:[function(e,i,r){var n=e("./_global"),t=e("./_task").set,o=n.MutationObserver||n.WebKitMutationObserver,f=n.process,a=n.Promise,u="process"==e("./_cof")(f);i.exports=function(){var e,i,r,s=function(){var n,t;for(u&&(n=f.domain)&&n.exit();e;){t=e.fn,e=e.next;try{t()}catch(o){throw e?r():i=void 0,o}}i=void 0,n&&n.enter()};if(u)r=function(){f.nextTick(s)};else if(o){var l=!0,c=document.createTextNode("");new o(s).observe(c,{characterData:!0}),r=function(){c.data=l=!l}}else if(a&&a.resolve){var d=a.resolve();r=function(){d.then(s)}}else r=function(){t.call(n,s)};return function(n){var t={fn:n,next:void 0};i&&(i.next=t),e||(e=t,r()),i=t}}},{"./_cof":20,"./_global":40,"./_task":106}],67:[function(e,i,r){"use strict";var n=e("./_object-keys"),t=e("./_object-gops"),o=e("./_object-pie"),f=e("./_to-object"),a=e("./_iobject"),u=Object.assign;i.exports=!u||e("./_fails")(function(){var e={},i={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){i[e]=e}),7!=u({},e)[r]||Object.keys(u({},i)).join("")!=n})?function(e,i){for(var r=f(e),u=arguments.length,s=1,l=t.f,c=o.f;u>s;)for(var d,b=a(arguments[s++]),h=l?n(b).concat(l(b)):n(b),k=h.length,_=0;k>_;)c.call(b,d=h[_++])&&(r[d]=b[d]);return r}:u},{"./_fails":36,"./_iobject":47,"./_object-gops":75,"./_object-keys":78,"./_object-pie":79,"./_to-object":111}],68:[function(e,i,r){var n=e("./_an-object"),t=e("./_object-dps"),o=e("./_enum-bug-keys"),f=e("./_shared-key")("IE_PROTO"),a=function(){},u="prototype",s=function(){var i,r=e("./_dom-create")("iframe"),n=o.length,t="<",f=">";for(r.style.display="none",e("./_html").appendChild(r),r.src="javascript:",i=r.contentWindow.document,i.open(),i.write(t+"script"+f+"document.F=Object"+t+"/script"+f),i.close(),s=i.F;n--;)delete s[u][o[n]];return s()};i.exports=Object.create||function(e,i){var r;return null!==e?(a[u]=n(e),r=new a,a[u]=null,r[f]=e):r=s(),void 0===i?r:t(r,i)}},{"./_an-object":9,"./_dom-create":31,"./_enum-bug-keys":32,"./_html":43,"./_object-dps":70,"./_shared-key":95}],69:[function(e,i,r){var n=e("./_an-object"),t=e("./_ie8-dom-define"),o=e("./_to-primitive"),f=Object.defineProperty;r.f=e("./_descriptors")?Object.defineProperty:function(e,i,r){if(n(e),i=o(i,!0),n(r),t)try{return f(e,i,r)}catch(a){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[i]=r.value),e}},{"./_an-object":9,"./_descriptors":30,"./_ie8-dom-define":44,"./_to-primitive":112}],70:[function(e,i,r){var n=e("./_object-dp"),t=e("./_an-object"),o=e("./_object-keys");i.exports=e("./_descriptors")?Object.defineProperties:function(e,i){t(e);for(var r,f=o(i),a=f.length,u=0;a>u;)n.f(e,r=f[u++],i[r]);return e}},{"./_an-object":9,"./_descriptors":30,"./_object-dp":69,"./_object-keys":78}],71:[function(e,i,r){i.exports=e("./_library")||!e("./_fails")(function(){var i=Math.random();__defineSetter__.call(null,i,function(){}),delete e("./_global")[i]})},{"./_fails":36,"./_global":40,"./_library":60}],72:[function(e,i,r){var n=e("./_object-pie"),t=e("./_property-desc"),o=e("./_to-iobject"),f=e("./_to-primitive"),a=e("./_has"),u=e("./_ie8-dom-define"),s=Object.getOwnPropertyDescriptor;r.f=e("./_descriptors")?s:function(e,i){if(e=o(e),i=f(i,!0),u)try{return s(e,i)}catch(r){}if(a(e,i))return t(!n.f.call(e,i),e[i])}},{"./_descriptors":30,"./_has":41,"./_ie8-dom-define":44,"./_object-pie":79,"./_property-desc":87,"./_to-iobject":109,"./_to-primitive":112}],73:[function(e,i,r){var n=e("./_to-iobject"),t=e("./_object-gopn").f,o={}.toString,f="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return t(e)}catch(i){return f.slice()}};i.exports.f=function(e){return f&&"[object Window]"==o.call(e)?a(e):t(n(e))}},{"./_object-gopn":74,"./_to-iobject":109}],74:[function(e,i,r){var n=e("./_object-keys-internal"),t=e("./_enum-bug-keys").concat("length","prototype");r.f=Object.getOwnPropertyNames||function(e){return n(e,t)}},{"./_enum-bug-keys":32,"./_object-keys-internal":77}],75:[function(e,i,r){r.f=Object.getOwnPropertySymbols},{}],76:[function(e,i,r){var n=e("./_has"),t=e("./_to-object"),o=e("./_shared-key")("IE_PROTO"),f=Object.prototype;i.exports=Object.getPrototypeOf||function(e){return e=t(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?f:null}},{"./_has":41,"./_shared-key":95,"./_to-object":111}],77:[function(e,i,r){var n=e("./_has"),t=e("./_to-iobject"),o=e("./_array-includes")(!1),f=e("./_shared-key")("IE_PROTO");i.exports=function(e,i){var r,a=t(e),u=0,s=[];for(r in a)r!=f&&n(a,r)&&s.push(r);for(;i.length>u;)n(a,r=i[u++])&&(~o(s,r)||s.push(r));return s}},{"./_array-includes":13,"./_has":41,"./_shared-key":95,"./_to-iobject":109}],78:[function(e,i,r){var n=e("./_object-keys-internal"),t=e("./_enum-bug-keys");i.exports=Object.keys||function(e){return n(e,t)}},{"./_enum-bug-keys":32,"./_object-keys-internal":77}],79:[function(e,i,r){r.f={}.propertyIsEnumerable},{}],80:[function(e,i,r){var n=e("./_export"),t=e("./_core"),o=e("./_fails");i.exports=function(e,i){var r=(t.Object||{})[e]||Object[e],f={};f[e]=i(r),n(n.S+n.F*o(function(){r(1)}),"Object",f)}},{"./_core":25,"./_export":34,"./_fails":36}],81:[function(e,i,r){var n=e("./_object-keys"),t=e("./_to-iobject"),o=e("./_object-pie").f;i.exports=function(e){return function(i){for(var r,f=t(i),a=n(f),u=a.length,s=0,l=[];u>s;)o.call(f,r=a[s++])&&l.push(e?[r,f[r]]:f[r]);return l}}},{"./_object-keys":78,"./_object-pie":79,"./_to-iobject":109}],82:[function(e,i,r){var n=e("./_object-gopn"),t=e("./_object-gops"),o=e("./_an-object"),f=e("./_global").Reflect;i.exports=f&&f.ownKeys||function(e){var i=n.f(o(e)),r=t.f;return r?i.concat(r(e)):i}},{"./_an-object":9,"./_global":40,"./_object-gopn":74,"./_object-gops":75}],83:[function(e,i,r){var n=e("./_global").parseFloat,t=e("./_string-trim").trim;i.exports=1/n(e("./_string-ws")+"-0")!==-(1/0)?function(e){var i=t(String(e),3),r=n(i);return 0===r&&"-"==i.charAt(0)?-0:r}:n},{"./_global":40,"./_string-trim":104,"./_string-ws":105}],84:[function(e,i,r){var n=e("./_global").parseInt,t=e("./_string-trim").trim,o=e("./_string-ws"),f=/^[\-+]?0[xX]/;i.exports=8!==n(o+"08")||22!==n(o+"0x16")?function(e,i){var r=t(String(e),3);return n(r,i>>>0||(f.test(r)?16:10))}:n},{"./_global":40,"./_string-trim":104,"./_string-ws":105}],85:[function(e,i,r){"use strict";var n=e("./_path"),t=e("./_invoke"),o=e("./_a-function");i.exports=function(){for(var e=o(this),i=arguments.length,r=Array(i),f=0,a=n._,u=!1;i>f;)(r[f]=arguments[f++])===a&&(u=!0);return function(){var n,o=this,f=arguments.length,s=0,l=0;if(!u&&!f)return t(e,r,o);if(n=r.slice(),u)for(;i>s;s++)n[s]===a&&(n[s]=arguments[l++]);for(;f>l;)n.push(arguments[l++]);return t(e,n,o)}}},{"./_a-function":5,"./_invoke":46,"./_path":86}],86:[function(e,i,r){i.exports=e("./_global")},{"./_global":40}],87:[function(e,i,r){i.exports=function(e,i){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:i}}},{}],88:[function(e,i,r){var n=e("./_redefine");i.exports=function(e,i,r){for(var t in i)n(e,t,i[t],r);return e}},{"./_redefine":89}],89:[function(e,i,r){var n=e("./_global"),t=e("./_hide"),o=e("./_has"),f=e("./_uid")("src"),a="toString",u=Function[a],s=(""+u).split(a);e("./_core").inspectSource=function(e){return u.call(e)},(i.exports=function(e,i,r,a){var u="function"==typeof r;u&&(o(r,"name")||t(r,"name",i)),e[i]!==r&&(u&&(o(r,f)||t(r,f,e[i]?""+e[i]:s.join(String(i)))),e===n?e[i]=r:a?e[i]?e[i]=r:t(e,i,r):(delete e[i],t(e,i,r)))})(Function.prototype,a,function(){return"function"==typeof this&&this[f]||u.call(this)})},{"./_core":25,"./_global":40,"./_has":41,"./_hide":42,"./_uid":116}],90:[function(e,i,r){i.exports=function(e,i){var r=i===Object(i)?function(e){return i[e]}:i;return function(i){return String(i).replace(e,r)}}},{}],91:[function(e,i,r){i.exports=Object.is||function(e,i){return e===i?0!==e||1/e===1/i:e!=e&&i!=i}},{}],92:[function(e,i,r){var n=e("./_is-object"),t=e("./_an-object"),o=function(e,i){if(t(e),!n(i)&&null!==i)throw TypeError(i+": can't set as prototype!")};i.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(i,r,n){try{n=e("./_ctx")(Function.call,e("./_object-gopd").f(Object.prototype,"__proto__").set,2),n(i,[]),r=!(i instanceof Array)}catch(t){r=!0}return function(e,i){return o(e,i),r?e.__proto__=i:n(e,i),e}}({},!1):void 0),check:o}},{"./_an-object":9,"./_ctx":27,"./_is-object":51,"./_object-gopd":72}],93:[function(e,i,r){"use strict";var n=e("./_global"),t=e("./_object-dp"),o=e("./_descriptors"),f=e("./_wks")("species");i.exports=function(e){var i=n[e];o&&i&&!i[f]&&t.f(i,f,{configurable:!0,get:function(){return this}})}},{"./_descriptors":30,"./_global":40,"./_object-dp":69,"./_wks":119}],94:[function(e,i,r){var n=e("./_object-dp").f,t=e("./_has"),o=e("./_wks")("toStringTag");i.exports=function(e,i,r){e&&!t(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:i})}},{"./_has":41,"./_object-dp":69,"./_wks":119}],95:[function(e,i,r){var n=e("./_shared")("keys"),t=e("./_uid");i.exports=function(e){return n[e]||(n[e]=t(e))}},{"./_shared":96,"./_uid":116}],96:[function(e,i,r){var n=e("./_global"),t="__core-js_shared__",o=n[t]||(n[t]={});i.exports=function(e){return o[e]||(o[e]={})}},{"./_global":40}],97:[function(e,i,r){var n=e("./_an-object"),t=e("./_a-function"),o=e("./_wks")("species");i.exports=function(e,i){var r,f=n(e).constructor;return void 0===f||void 0==(r=n(f)[o])?i:t(r)}},{"./_a-function":5,"./_an-object":9,"./_wks":119}],98:[function(e,i,r){var n=e("./_fails");i.exports=function(e,i){return!!e&&n(function(){i?e.call(null,function(){},1):e.call(null)})}},{"./_fails":36}],99:[function(e,i,r){var n=e("./_to-integer"),t=e("./_defined");i.exports=function(e){return function(i,r){var o,f,a=String(t(i)),u=n(r),s=a.length;return u<0||u>=s?e?"":void 0:(o=a.charCodeAt(u),o<55296||o>56319||u+1===s||(f=a.charCodeAt(u+1))<56320||f>57343?e?a.charAt(u):o:e?a.slice(u,u+2):(o-55296<<10)+(f-56320)+65536)}}},{"./_defined":29,"./_to-integer":108}],100:[function(e,i,r){var n=e("./_is-regexp"),t=e("./_defined");i.exports=function(e,i,r){if(n(i))throw TypeError("String#"+r+" doesn't accept regex!");return String(t(e))}},{"./_defined":29,"./_is-regexp":52}],101:[function(e,i,r){var n=e("./_export"),t=e("./_fails"),o=e("./_defined"),f=/"/g,a=function(e,i,r,n){var t=String(o(e)),a="<"+i;return""!==r&&(a+=" "+r+'="'+String(n).replace(f,""")+'"'),a+">"+t+""};i.exports=function(e,i){var r={};r[e]=i(a),n(n.P+n.F*t(function(){ +var i=""[e]('"');return i!==i.toLowerCase()||i.split('"').length>3}),"String",r)}},{"./_defined":29,"./_export":34,"./_fails":36}],102:[function(e,i,r){var n=e("./_to-length"),t=e("./_string-repeat"),o=e("./_defined");i.exports=function(e,i,r,f){var a=String(o(e)),u=a.length,s=void 0===r?" ":String(r),l=n(i);if(l<=u||""==s)return a;var c=l-u,d=t.call(s,Math.ceil(c/s.length));return d.length>c&&(d=d.slice(0,c)),f?d+a:a+d}},{"./_defined":29,"./_string-repeat":103,"./_to-length":110}],103:[function(e,i,r){"use strict";var n=e("./_to-integer"),t=e("./_defined");i.exports=function(e){var i=String(t(this)),r="",o=n(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(i+=i))1&o&&(r+=i);return r}},{"./_defined":29,"./_to-integer":108}],104:[function(e,i,r){var n=e("./_export"),t=e("./_defined"),o=e("./_fails"),f=e("./_string-ws"),a="["+f+"]",u="​…",s=RegExp("^"+a+a+"*"),l=RegExp(a+a+"*$"),c=function(e,i,r){var t={},a=o(function(){return!!f[e]()||u[e]()!=u}),s=t[e]=a?i(d):f[e];r&&(t[r]=s),n(n.P+n.F*a,"String",t)},d=c.trim=function(e,i){return e=String(t(e)),1&i&&(e=e.replace(s,"")),2&i&&(e=e.replace(l,"")),e};i.exports=c},{"./_defined":29,"./_export":34,"./_fails":36,"./_string-ws":105}],105:[function(e,i,r){i.exports="\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff"},{}],106:[function(e,i,r){var n,t,o,f=e("./_ctx"),a=e("./_invoke"),u=e("./_html"),s=e("./_dom-create"),l=e("./_global"),c=l.process,d=l.setImmediate,b=l.clearImmediate,h=l.MessageChannel,k=0,_={},p="onreadystatechange",v=function(){var e=+this;if(_.hasOwnProperty(e)){var i=_[e];delete _[e],i()}},w=function(e){v.call(e.data)};d&&b||(d=function(e){for(var i=[],r=1;arguments.length>r;)i.push(arguments[r++]);return _[++k]=function(){a("function"==typeof e?e:Function(e),i)},n(k),k},b=function(e){delete _[e]},"process"==e("./_cof")(c)?n=function(e){c.nextTick(f(v,e,1))}:h?(t=new h,o=t.port2,t.port1.onmessage=w,n=f(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(n=function(e){l.postMessage(e+"","*")},l.addEventListener("message",w,!1)):n=p in s("script")?function(e){u.appendChild(s("script"))[p]=function(){u.removeChild(this),v.call(e)}}:function(e){setTimeout(f(v,e,1),0)}),i.exports={set:d,clear:b}},{"./_cof":20,"./_ctx":27,"./_dom-create":31,"./_global":40,"./_html":43,"./_invoke":46}],107:[function(e,i,r){var n=e("./_to-integer"),t=Math.max,o=Math.min;i.exports=function(e,i){return e=n(e),e<0?t(e+i,0):o(e,i)}},{"./_to-integer":108}],108:[function(e,i,r){var n=Math.ceil,t=Math.floor;i.exports=function(e){return isNaN(e=+e)?0:(e>0?t:n)(e)}},{}],109:[function(e,i,r){var n=e("./_iobject"),t=e("./_defined");i.exports=function(e){return n(t(e))}},{"./_defined":29,"./_iobject":47}],110:[function(e,i,r){var n=e("./_to-integer"),t=Math.min;i.exports=function(e){return e>0?t(n(e),9007199254740991):0}},{"./_to-integer":108}],111:[function(e,i,r){var n=e("./_defined");i.exports=function(e){return Object(n(e))}},{"./_defined":29}],112:[function(e,i,r){var n=e("./_is-object");i.exports=function(e,i){if(!n(e))return e;var r,t;if(i&&"function"==typeof(r=e.toString)&&!n(t=r.call(e)))return t;if("function"==typeof(r=e.valueOf)&&!n(t=r.call(e)))return t;if(!i&&"function"==typeof(r=e.toString)&&!n(t=r.call(e)))return t;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":51}],113:[function(e,i,r){"use strict";if(e("./_descriptors")){var n=e("./_library"),t=e("./_global"),o=e("./_fails"),f=e("./_export"),a=e("./_typed"),u=e("./_typed-buffer"),s=e("./_ctx"),l=e("./_an-instance"),c=e("./_property-desc"),d=e("./_hide"),b=e("./_redefine-all"),h=e("./_to-integer"),k=e("./_to-length"),_=e("./_to-index"),p=e("./_to-primitive"),v=e("./_has"),w=e("./_same-value"),m=e("./_classof"),g=e("./_is-object"),y=e("./_to-object"),E=e("./_is-array-iter"),S=e("./_object-create"),O=e("./_object-gpo"),C=e("./_object-gopn").f,A=e("./core.get-iterator-method"),x=e("./_uid"),R=e("./_wks"),F=e("./_array-methods"),M=e("./_array-includes"),T=e("./_species-constructor"),P=e("./es6.array.iterator"),j=e("./_iterators"),L=e("./_iter-detect"),D=e("./_set-species"),N=e("./_array-fill"),I=e("./_array-copy-within"),B=e("./_object-dp"),U=e("./_object-gopd"),H=B.f,z=U.f,G=t.RangeError,V=t.TypeError,Y=t.Uint8Array,W="ArrayBuffer",q="Shared"+W,X="BYTES_PER_ELEMENT",K="prototype",J=Array[K],Z=u.ArrayBuffer,$=u.DataView,Q=F(0),ee=F(2),ie=F(3),re=F(4),ne=F(5),te=F(6),oe=M(!0),fe=M(!1),ae=P.values,ue=P.keys,se=P.entries,le=J.lastIndexOf,ce=J.reduce,de=J.reduceRight,be=J.join,he=J.sort,ke=J.slice,_e=J.toString,pe=J.toLocaleString,ve=R("iterator"),we=R("toStringTag"),me=x("typed_constructor"),ge=x("def_constructor"),ye=a.CONSTR,Ee=a.TYPED,Se=a.VIEW,Oe="Wrong length!",Ce=F(1,function(e,i){return Te(T(e,e[ge]),i)}),Ae=o(function(){return 1===new Y(new Uint16Array([1]).buffer)[0]}),xe=!!Y&&!!Y[K].set&&o(function(){new Y(1).set({})}),Re=function(e,i){if(void 0===e)throw V(Oe);var r=+e,n=k(e);if(i&&!w(r,n))throw G(Oe);return n},Fe=function(e,i){var r=h(e);if(r<0||r%i)throw G("Wrong offset!");return r},Me=function(e){if(g(e)&&Ee in e)return e;throw V(e+" is not a typed array!")},Te=function(e,i){if(!(g(e)&&me in e))throw V("It is not a typed array constructor!");return new e(i)},Pe=function(e,i){return je(T(e,e[ge]),i)},je=function(e,i){for(var r=0,n=i.length,t=Te(e,n);n>r;)t[r]=i[r++];return t},Le=function(e,i,r){H(e,i,{get:function(){return this._d[r]}})},De=function(e){var i,r,n,t,o,f,a=y(e),u=arguments.length,l=u>1?arguments[1]:void 0,c=void 0!==l,d=A(a);if(void 0!=d&&!E(d)){for(f=d.call(a),n=[],i=0;!(o=f.next()).done;i++)n.push(o.value);a=n}for(c&&u>2&&(l=s(l,arguments[2],2)),i=0,r=k(a.length),t=Te(this,r);r>i;i++)t[i]=c?l(a[i],i):a[i];return t},Ne=function(){for(var e=0,i=arguments.length,r=Te(this,i);i>e;)r[e]=arguments[e++];return r},Ie=!!Y&&o(function(){pe.call(new Y(1))}),Be=function(){return pe.apply(Ie?ke.call(Me(this)):Me(this),arguments)},Ue={copyWithin:function(e,i){return I.call(Me(this),e,i,arguments.length>2?arguments[2]:void 0)},every:function(e){return re(Me(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return N.apply(Me(this),arguments)},filter:function(e){return Pe(this,ee(Me(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return ne(Me(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return te(Me(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){Q(Me(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return fe(Me(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return oe(Me(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return be.apply(Me(this),arguments)},lastIndexOf:function(e){return le.apply(Me(this),arguments)},map:function(e){return Ce(Me(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ce.apply(Me(this),arguments)},reduceRight:function(e){return de.apply(Me(this),arguments)},reverse:function(){for(var e,i=this,r=Me(i).length,n=Math.floor(r/2),t=0;t1?arguments[1]:void 0)},sort:function(e){return he.call(Me(this),e)},subarray:function(e,i){var r=Me(this),n=r.length,t=_(e,n);return new(T(r,r[ge]))(r.buffer,r.byteOffset+t*r.BYTES_PER_ELEMENT,k((void 0===i?n:_(i,n))-t))}},He=function(e,i){return Pe(this,ke.call(Me(this),e,i))},ze=function(e){Me(this);var i=Fe(arguments[1],1),r=this.length,n=y(e),t=k(n.length),o=0;if(t+i>r)throw G(Oe);for(;o255?255:255&n),t.v[h](r*i+t.o,n,Ae)},R=function(e,i){H(e,i,{get:function(){return A(this,i)},set:function(e){return x(this,i,e)},enumerable:!0})};w?(_=r(function(e,r,n,t){l(e,_,s,"_d");var o,f,a,u,c=0,b=0;if(g(r)){if(!(r instanceof Z||(u=m(r))==W||u==q))return Ee in r?je(_,r):De.call(_,r);o=r,b=Fe(n,i);var h=r.byteLength;if(void 0===t){if(h%i)throw G(Oe);if(f=h-b,f<0)throw G(Oe)}else if(f=k(t)*i,f+b>h)throw G(Oe);a=f/i}else a=Re(r,!0),f=a*i,o=new Z(f);for(d(e,"_d",{b:o,o:b,l:f,e:a,v:new $(o)});c>1,l=23===i?R(2,-24)-R(2,-77):0,c=0,d=e<0||0===e&&1/e<0?1:0;for(e=x(e),e!=e||e===C?(t=e!=e?1:0,n=u):(n=F(M(e)/T),e*(o=R(2,-n))<1&&(n--,o*=2),e+=n+s>=1?l/o:l*R(2,1-s),e*o>=2&&(n++,o/=2),n+s>=u?(t=0,n=u):n+s>=1?(t=(e*o-1)*R(2,i),n+=s):(t=e*R(2,s-1)*R(2,i),n=0));i>=8;f[c++]=255&t,t/=256,i-=8);for(n=n<0;f[c++]=255&n,n/=256,a-=8);return f[--c]|=128*d,f},U=function(e,i,r){var n,t=8*r-i-1,o=(1<>1,a=t-7,u=r-1,s=e[u--],l=127&s;for(s>>=7;a>0;l=256*l+e[u],u--,a-=8);for(n=l&(1<<-a)-1,l>>=-a,a+=i;a>0;n=256*n+e[u],u--,a-=8);if(0===l)l=1-f;else{if(l===o)return n?NaN:s?-C:C;n+=R(2,i),l-=f}return(s?-1:1)*n*R(2,l-i)},H=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},z=function(e){return[255&e]},G=function(e){return[255&e,e>>8&255]},V=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Y=function(e){return B(e,52,8)},W=function(e){return B(e,23,4)},q=function(e,i,r){h(e[w],i,{get:function(){return this[r]}})},X=function(e,i,r,n){var t=+r,o=c(t);if(t!=o||o<0||o+i>e[N])throw O(g);var f=e[D]._b,a=o+e[I],u=f.slice(a,a+i);return n?u:u.reverse()},K=function(e,i,r,n,t,o){var f=+r,a=c(f);if(f!=a||a<0||a+i>e[N])throw O(g);for(var u=e[D]._b,s=a+e[I],l=n(+t),d=0;dee;)(Z=Q[ee++])in y||a(y,Z,A[Z]);o||($.constructor=y)}var ie=new E(new y(2)),re=E[w].setInt8;ie.setInt8(0,2147483648),ie.setInt8(1,2147483649),!ie.getInt8(0)&&ie.getInt8(1)||u(E[w],{setInt8:function(e,i){re.call(this,e,i<<24>>24)},setUint8:function(e,i){re.call(this,e,i<<24>>24)}},!0)}else y=function(e){var i=J(this,e);this._b=k.call(Array(i),0),this[N]=i},E=function(e,i,r){l(this,E,v),l(e,y,v);var n=e[N],t=c(i);if(t<0||t>n)throw O("Wrong offset!");if(r=void 0===r?n-t:d(r),t+r>n)throw O(m);this[D]=e,this[I]=t,this[N]=r},t&&(q(y,j,"_l"),q(E,P,"_b"),q(E,j,"_l"),q(E,L,"_o")),u(E[w],{getInt8:function(e){return X(this,1,e)[0]<<24>>24},getUint8:function(e){return X(this,1,e)[0]},getInt16:function(e){var i=X(this,2,e,arguments[1]);return(i[1]<<8|i[0])<<16>>16},getUint16:function(e){var i=X(this,2,e,arguments[1]);return i[1]<<8|i[0]},getInt32:function(e){return H(X(this,4,e,arguments[1]))},getUint32:function(e){return H(X(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return U(X(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return U(X(this,8,e,arguments[1]),52,8)},setInt8:function(e,i){K(this,1,e,z,i)},setUint8:function(e,i){K(this,1,e,z,i)},setInt16:function(e,i){K(this,2,e,G,i,arguments[2])},setUint16:function(e,i){K(this,2,e,G,i,arguments[2])},setInt32:function(e,i){K(this,4,e,V,i,arguments[2])},setUint32:function(e,i){K(this,4,e,V,i,arguments[2])},setFloat32:function(e,i){K(this,4,e,W,i,arguments[2])},setFloat64:function(e,i){K(this,8,e,Y,i,arguments[2])}});_(y,p),_(E,v),a(E[w],f.VIEW,!0),r[p]=y,r[v]=E},{"./_an-instance":8,"./_array-fill":11,"./_descriptors":30,"./_fails":36,"./_global":40,"./_hide":42,"./_library":60,"./_object-dp":69,"./_object-gopn":74,"./_redefine-all":88,"./_set-to-string-tag":94,"./_to-integer":108,"./_to-length":110,"./_typed":115}],115:[function(e,i,r){for(var n,t=e("./_global"),o=e("./_hide"),f=e("./_uid"),a=f("typed_array"),u=f("view"),s=!(!t.ArrayBuffer||!t.DataView),l=s,c=0,d=9,b="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");c1?arguments[1]:void 0)}}),e("./_add-to-unscopables")(o)},{"./_add-to-unscopables":7,"./_array-methods":14,"./_export":34}],127:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_array-methods")(5),o="find",f=!0;o in[]&&Array(1)[o](function(){f=!1}),n(n.P+n.F*f,"Array",{find:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),e("./_add-to-unscopables")(o)},{"./_add-to-unscopables":7,"./_array-methods":14,"./_export":34}],128:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_array-methods")(0),o=e("./_strict-method")([].forEach,!0);n(n.P+n.F*!o,"Array",{forEach:function(e){return t(this,e,arguments[1])}})},{"./_array-methods":14,"./_export":34,"./_strict-method":98}],129:[function(e,i,r){"use strict";var n=e("./_ctx"),t=e("./_export"),o=e("./_to-object"),f=e("./_iter-call"),a=e("./_is-array-iter"),u=e("./_to-length"),s=e("./_create-property"),l=e("./core.get-iterator-method");t(t.S+t.F*!e("./_iter-detect")(function(e){Array.from(e)}),"Array",{from:function(e){var i,r,t,c,d=o(e),b="function"==typeof this?this:Array,h=arguments.length,k=h>1?arguments[1]:void 0,_=void 0!==k,p=0,v=l(d);if(_&&(k=n(k,h>2?arguments[2]:void 0,2)),void 0==v||b==Array&&a(v))for(i=u(d.length),r=new b(i);i>p;p++)s(r,p,_?k(d[p],p):d[p]);else for(c=v.call(d),r=new b;!(t=c.next()).done;p++)s(r,p,_?f(c,k,[t.value,p],!0):t.value);return r.length=p,r}})},{"./_create-property":26,"./_ctx":27,"./_export":34,"./_is-array-iter":48,"./_iter-call":53,"./_iter-detect":56,"./_to-length":110,"./_to-object":111,"./core.get-iterator-method":120}],130:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_array-includes")(!1),o=[].indexOf,f=!!o&&1/[1].indexOf(1,-0)<0;n(n.P+n.F*(f||!e("./_strict-method")(o)),"Array",{indexOf:function(e){return f?o.apply(this,arguments)||0:t(this,e,arguments[1])}})},{"./_array-includes":13,"./_export":34,"./_strict-method":98}],131:[function(e,i,r){var n=e("./_export");n(n.S,"Array",{isArray:e("./_is-array")})},{"./_export":34,"./_is-array":49}],132:[function(e,i,r){"use strict";var n=e("./_add-to-unscopables"),t=e("./_iter-step"),o=e("./_iterators"),f=e("./_to-iobject");i.exports=e("./_iter-define")(Array,"Array",function(e,i){this._t=f(e),this._i=0,this._k=i},function(){var e=this._t,i=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,t(1)):"keys"==i?t(0,r):"values"==i?t(0,e[r]):t(0,[r,e[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},{"./_add-to-unscopables":7,"./_iter-define":55,"./_iter-step":57,"./_iterators":58,"./_to-iobject":109}],133:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_to-iobject"),o=[].join;n(n.P+n.F*(e("./_iobject")!=Object||!e("./_strict-method")(o)),"Array",{join:function(e){return o.call(t(this),void 0===e?",":e)}})},{"./_export":34,"./_iobject":47,"./_strict-method":98,"./_to-iobject":109}],134:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_to-iobject"),o=e("./_to-integer"),f=e("./_to-length"),a=[].lastIndexOf,u=!!a&&1/[1].lastIndexOf(1,-0)<0;n(n.P+n.F*(u||!e("./_strict-method")(a)),"Array",{lastIndexOf:function(e){if(u)return a.apply(this,arguments)||0;var i=t(this),r=f(i.length),n=r-1;for(arguments.length>1&&(n=Math.min(n,o(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in i&&i[n]===e)return n||0;return-1}})},{"./_export":34,"./_strict-method":98,"./_to-integer":108,"./_to-iobject":109,"./_to-length":110}],135:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_array-methods")(1);n(n.P+n.F*!e("./_strict-method")([].map,!0),"Array",{map:function(e){return t(this,e,arguments[1])}})},{"./_array-methods":14,"./_export":34,"./_strict-method":98}],136:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_create-property");n(n.S+n.F*e("./_fails")(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,i=arguments.length,r=new("function"==typeof this?this:Array)(i);i>e;)t(r,e,arguments[e++]);return r.length=i,r}})},{"./_create-property":26,"./_export":34,"./_fails":36}],137:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_array-reduce");n(n.P+n.F*!e("./_strict-method")([].reduceRight,!0),"Array",{reduceRight:function(e){return t(this,e,arguments.length,arguments[1],!0)}})},{"./_array-reduce":15,"./_export":34,"./_strict-method":98}],138:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_array-reduce");n(n.P+n.F*!e("./_strict-method")([].reduce,!0),"Array",{reduce:function(e){return t(this,e,arguments.length,arguments[1],!1)}})},{"./_array-reduce":15,"./_export":34,"./_strict-method":98}],139:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_html"),o=e("./_cof"),f=e("./_to-index"),a=e("./_to-length"),u=[].slice;n(n.P+n.F*e("./_fails")(function(){t&&u.call(t)}),"Array",{slice:function(e,i){var r=a(this.length),n=o(this);if(i=void 0===i?r:i,"Array"==n)return u.call(this,e,i);for(var t=f(e,r),s=f(i,r),l=a(s-t),c=Array(l),d=0;d9?e:"0"+e};n(n.P+n.F*(t(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!t(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var e=this,i=e.getUTCFullYear(),r=e.getUTCMilliseconds(),n=i<0?"-":i>9999?"+":"";return n+("00000"+Math.abs(i)).slice(n?-6:-4)+"-"+f(e.getUTCMonth()+1)+"-"+f(e.getUTCDate())+"T"+f(e.getUTCHours())+":"+f(e.getUTCMinutes())+":"+f(e.getUTCSeconds())+"."+(r>99?r:"0"+f(r))+"Z"}})},{"./_export":34,"./_fails":36}],145:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_to-object"),o=e("./_to-primitive");n(n.P+n.F*e("./_fails")(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(e){var i=t(this),r=o(i);return"number"!=typeof r||isFinite(r)?i.toISOString():null}})},{"./_export":34,"./_fails":36,"./_to-object":111,"./_to-primitive":112}],146:[function(e,i,r){var n=e("./_wks")("toPrimitive"),t=Date.prototype;n in t||e("./_hide")(t,n,e("./_date-to-primitive"))},{"./_date-to-primitive":28,"./_hide":42,"./_wks":119}],147:[function(e,i,r){var n=Date.prototype,t="Invalid Date",o="toString",f=n[o],a=n.getTime;new Date(NaN)+""!=t&&e("./_redefine")(n,o,function(){var e=a.call(this);return e===e?f.call(this):t})},{"./_redefine":89}],148:[function(e,i,r){var n=e("./_export");n(n.P,"Function",{bind:e("./_bind")})},{"./_bind":18,"./_export":34}],149:[function(e,i,r){"use strict";var n=e("./_is-object"),t=e("./_object-gpo"),o=e("./_wks")("hasInstance"),f=Function.prototype;o in f||e("./_object-dp").f(f,o,{value:function(e){if("function"!=typeof this||!n(e))return!1;if(!n(this.prototype))return e instanceof this;for(;e=t(e);)if(this.prototype===e)return!0;return!1}})},{"./_is-object":51,"./_object-dp":69,"./_object-gpo":76,"./_wks":119}],150:[function(e,i,r){var n=e("./_object-dp").f,t=e("./_property-desc"),o=e("./_has"),f=Function.prototype,a=/^\s*function ([^ (]*)/,u="name",s=Object.isExtensible||function(){return!0};u in f||e("./_descriptors")&&n(f,u,{configurable:!0,get:function(){try{var e=this,i=(""+e).match(a)[1];return o(e,u)||!s(e)||n(e,u,t(5,i)),i}catch(r){return""}}})},{"./_descriptors":30,"./_has":41,"./_object-dp":69,"./_property-desc":87}],151:[function(e,i,r){"use strict";var n=e("./_collection-strong");i.exports=e("./_collection")("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var i=n.getEntry(this,e);return i&&i.v},set:function(e,i){return n.def(this,0===e?0:e,i)}},n,!0)},{"./_collection":24,"./_collection-strong":21}],152:[function(e,i,r){var n=e("./_export"),t=e("./_math-log1p"),o=Math.sqrt,f=Math.acosh;n(n.S+n.F*!(f&&710==Math.floor(f(Number.MAX_VALUE))&&f(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:t(e-1+o(e-1)*o(e+1))}})},{"./_export":34,"./_math-log1p":62}],153:[function(e,i,r){function n(e){return isFinite(e=+e)&&0!=e?e<0?-n(-e):Math.log(e+Math.sqrt(e*e+1)):e}var t=e("./_export"),o=Math.asinh;t(t.S+t.F*!(o&&1/o(0)>0),"Math",{asinh:n})},{"./_export":34}],154:[function(e,i,r){var n=e("./_export"),t=Math.atanh;n(n.S+n.F*!(t&&1/t(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},{"./_export":34}],155:[function(e,i,r){var n=e("./_export"),t=e("./_math-sign");n(n.S,"Math",{cbrt:function(e){return t(e=+e)*Math.pow(Math.abs(e),1/3)}})},{"./_export":34,"./_math-sign":63}],156:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},{"./_export":34}],157:[function(e,i,r){var n=e("./_export"),t=Math.exp;n(n.S,"Math",{cosh:function(e){return(t(e=+e)+t(-e))/2}})},{"./_export":34}],158:[function(e,i,r){var n=e("./_export"),t=e("./_math-expm1");n(n.S+n.F*(t!=Math.expm1),"Math",{expm1:t})},{"./_export":34,"./_math-expm1":61}],159:[function(e,i,r){var n=e("./_export"),t=e("./_math-sign"),o=Math.pow,f=o(2,-52),a=o(2,-23),u=o(2,127)*(2-a),s=o(2,-126),l=function(e){return e+1/f-1/f};n(n.S,"Math",{fround:function(e){var i,r,n=Math.abs(e),o=t(e);return nu||r!=r?o*(1/0):o*r)}})},{"./_export":34,"./_math-sign":63}],160:[function(e,i,r){var n=e("./_export"),t=Math.abs;n(n.S,"Math",{hypot:function(e,i){for(var r,n,o=0,f=0,a=arguments.length,u=0;f0?(n=r/u,o+=n*n):o+=r;return u===1/0?1/0:u*Math.sqrt(o)}})},{"./_export":34}],161:[function(e,i,r){var n=e("./_export"),t=Math.imul;n(n.S+n.F*e("./_fails")(function(){return t(4294967295,5)!=-5||2!=t.length}),"Math",{imul:function(e,i){var r=65535,n=+e,t=+i,o=r&n,f=r&t;return 0|o*f+((r&n>>>16)*f+o*(r&t>>>16)<<16>>>0)}})},{"./_export":34,"./_fails":36}],162:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{log10:function(e){return Math.log(e)/Math.LN10}})},{"./_export":34}],163:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{log1p:e("./_math-log1p")})},{"./_export":34,"./_math-log1p":62}],164:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},{"./_export":34}],165:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{sign:e("./_math-sign")})},{"./_export":34,"./_math-sign":63}],166:[function(e,i,r){var n=e("./_export"),t=e("./_math-expm1"),o=Math.exp;n(n.S+n.F*e("./_fails")(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(t(e)-t(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},{"./_export":34,"./_fails":36,"./_math-expm1":61}],167:[function(e,i,r){var n=e("./_export"),t=e("./_math-expm1"),o=Math.exp;n(n.S,"Math",{tanh:function(e){var i=t(e=+e),r=t(-e);return i==1/0?1:r==1/0?-1:(i-r)/(o(e)+o(-e))}})},{"./_export":34,"./_math-expm1":61}],168:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},{"./_export":34}],169:[function(e,i,r){"use strict";var n=e("./_global"),t=e("./_has"),o=e("./_cof"),f=e("./_inherit-if-required"),a=e("./_to-primitive"),u=e("./_fails"),s=e("./_object-gopn").f,l=e("./_object-gopd").f,c=e("./_object-dp").f,d=e("./_string-trim").trim,b="Number",h=n[b],k=h,_=h.prototype,p=o(e("./_object-create")(_))==b,v="trim"in String.prototype,w=function(e){var i=a(e,!1);if("string"==typeof i&&i.length>2){i=v?i.trim():d(i,3);var r,n,t,o=i.charCodeAt(0);if(43===o||45===o){if(r=i.charCodeAt(2),88===r||120===r)return NaN}else if(48===o){switch(i.charCodeAt(1)){case 66:case 98:n=2,t=49;break;case 79:case 111:n=8,t=55;break;default:return+i}for(var f,u=i.slice(2),s=0,l=u.length;st)return NaN;return parseInt(u,n)}}return+i};if(!h(" 0o1")||!h("0b1")||h("+0x1")){h=function(e){var i=arguments.length<1?0:e,r=this;return r instanceof h&&(p?u(function(){_.valueOf.call(r)}):o(r)!=b)?f(new k(w(i)),r,h):w(i)};for(var m,g=e("./_descriptors")?s(k):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),y=0;g.length>y;y++)t(k,m=g[y])&&!t(h,m)&&c(h,m,l(k,m));h.prototype=_,_.constructor=h,e("./_redefine")(n,b,h)}},{"./_cof":20,"./_descriptors":30,"./_fails":36,"./_global":40,"./_has":41,"./_inherit-if-required":45,"./_object-create":68,"./_object-dp":69,"./_object-gopd":72,"./_object-gopn":74,"./_redefine":89,"./_string-trim":104,"./_to-primitive":112}],170:[function(e,i,r){var n=e("./_export");n(n.S,"Number",{EPSILON:Math.pow(2,-52)})},{"./_export":34}],171:[function(e,i,r){var n=e("./_export"),t=e("./_global").isFinite;n(n.S,"Number",{isFinite:function(e){return"number"==typeof e&&t(e)}})},{"./_export":34,"./_global":40}],172:[function(e,i,r){var n=e("./_export");n(n.S,"Number",{isInteger:e("./_is-integer")})},{"./_export":34,"./_is-integer":50}],173:[function(e,i,r){var n=e("./_export");n(n.S,"Number",{isNaN:function(e){return e!=e}})},{"./_export":34}],174:[function(e,i,r){var n=e("./_export"),t=e("./_is-integer"),o=Math.abs;n(n.S,"Number",{isSafeInteger:function(e){return t(e)&&o(e)<=9007199254740991}})},{"./_export":34,"./_is-integer":50}],175:[function(e,i,r){var n=e("./_export");n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{"./_export":34}],176:[function(e,i,r){var n=e("./_export");n(n.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{"./_export":34}],177:[function(e,i,r){ +var n=e("./_export"),t=e("./_parse-float");n(n.S+n.F*(Number.parseFloat!=t),"Number",{parseFloat:t})},{"./_export":34,"./_parse-float":83}],178:[function(e,i,r){var n=e("./_export"),t=e("./_parse-int");n(n.S+n.F*(Number.parseInt!=t),"Number",{parseInt:t})},{"./_export":34,"./_parse-int":84}],179:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_to-integer"),o=e("./_a-number-value"),f=e("./_string-repeat"),a=1..toFixed,u=Math.floor,s=[0,0,0,0,0,0],l="Number.toFixed: incorrect invocation!",c="0",d=function(e,i){for(var r=-1,n=i;++r<6;)n+=e*s[r],s[r]=n%1e7,n=u(n/1e7)},b=function(e){for(var i=6,r=0;--i>=0;)r+=s[i],s[i]=u(r/e),r=r%e*1e7},h=function(){for(var e=6,i="";--e>=0;)if(""!==i||0===e||0!==s[e]){var r=String(s[e]);i=""===i?r:i+f.call(c,7-r.length)+r}return i},k=function(e,i,r){return 0===i?r:i%2===1?k(e,i-1,r*e):k(e*e,i/2,r)},_=function(e){for(var i=0,r=e;r>=4096;)i+=12,r/=4096;for(;r>=2;)i+=1,r/=2;return i};n(n.P+n.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!e("./_fails")(function(){a.call({})})),"Number",{toFixed:function(e){var i,r,n,a,u=o(this,l),s=t(e),p="",v=c;if(s<0||s>20)throw RangeError(l);if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(p="-",u=-u),u>1e-21)if(i=_(u*k(2,69,1))-69,r=i<0?u*k(2,-i,1):u/k(2,i,1),r*=4503599627370496,i=52-i,i>0){for(d(0,r),n=s;n>=7;)d(1e7,0),n-=7;for(d(k(10,n,1),0),n=i-1;n>=23;)b(1<<23),n-=23;b(1<0?(a=v.length,v=p+(a<=s?"0."+f.call(c,s-a)+v:v.slice(0,a-s)+"."+v.slice(a-s))):v=p+v,v}})},{"./_a-number-value":6,"./_export":34,"./_fails":36,"./_string-repeat":103,"./_to-integer":108}],180:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_fails"),o=e("./_a-number-value"),f=1..toPrecision;n(n.P+n.F*(t(function(){return"1"!==f.call(1,void 0)})||!t(function(){f.call({})})),"Number",{toPrecision:function(e){var i=o(this,"Number#toPrecision: incorrect invocation!");return void 0===e?f.call(i):f.call(i,e)}})},{"./_a-number-value":6,"./_export":34,"./_fails":36}],181:[function(e,i,r){var n=e("./_export");n(n.S+n.F,"Object",{assign:e("./_object-assign")})},{"./_export":34,"./_object-assign":67}],182:[function(e,i,r){var n=e("./_export");n(n.S,"Object",{create:e("./_object-create")})},{"./_export":34,"./_object-create":68}],183:[function(e,i,r){var n=e("./_export");n(n.S+n.F*!e("./_descriptors"),"Object",{defineProperties:e("./_object-dps")})},{"./_descriptors":30,"./_export":34,"./_object-dps":70}],184:[function(e,i,r){var n=e("./_export");n(n.S+n.F*!e("./_descriptors"),"Object",{defineProperty:e("./_object-dp").f})},{"./_descriptors":30,"./_export":34,"./_object-dp":69}],185:[function(e,i,r){var n=e("./_is-object"),t=e("./_meta").onFreeze;e("./_object-sap")("freeze",function(e){return function(i){return e&&n(i)?e(t(i)):i}})},{"./_is-object":51,"./_meta":64,"./_object-sap":80}],186:[function(e,i,r){var n=e("./_to-iobject"),t=e("./_object-gopd").f;e("./_object-sap")("getOwnPropertyDescriptor",function(){return function(e,i){return t(n(e),i)}})},{"./_object-gopd":72,"./_object-sap":80,"./_to-iobject":109}],187:[function(e,i,r){e("./_object-sap")("getOwnPropertyNames",function(){return e("./_object-gopn-ext").f})},{"./_object-gopn-ext":73,"./_object-sap":80}],188:[function(e,i,r){var n=e("./_to-object"),t=e("./_object-gpo");e("./_object-sap")("getPrototypeOf",function(){return function(e){return t(n(e))}})},{"./_object-gpo":76,"./_object-sap":80,"./_to-object":111}],189:[function(e,i,r){var n=e("./_is-object");e("./_object-sap")("isExtensible",function(e){return function(i){return!!n(i)&&(!e||e(i))}})},{"./_is-object":51,"./_object-sap":80}],190:[function(e,i,r){var n=e("./_is-object");e("./_object-sap")("isFrozen",function(e){return function(i){return!n(i)||!!e&&e(i)}})},{"./_is-object":51,"./_object-sap":80}],191:[function(e,i,r){var n=e("./_is-object");e("./_object-sap")("isSealed",function(e){return function(i){return!n(i)||!!e&&e(i)}})},{"./_is-object":51,"./_object-sap":80}],192:[function(e,i,r){var n=e("./_export");n(n.S,"Object",{is:e("./_same-value")})},{"./_export":34,"./_same-value":91}],193:[function(e,i,r){var n=e("./_to-object"),t=e("./_object-keys");e("./_object-sap")("keys",function(){return function(e){return t(n(e))}})},{"./_object-keys":78,"./_object-sap":80,"./_to-object":111}],194:[function(e,i,r){var n=e("./_is-object"),t=e("./_meta").onFreeze;e("./_object-sap")("preventExtensions",function(e){return function(i){return e&&n(i)?e(t(i)):i}})},{"./_is-object":51,"./_meta":64,"./_object-sap":80}],195:[function(e,i,r){var n=e("./_is-object"),t=e("./_meta").onFreeze;e("./_object-sap")("seal",function(e){return function(i){return e&&n(i)?e(t(i)):i}})},{"./_is-object":51,"./_meta":64,"./_object-sap":80}],196:[function(e,i,r){var n=e("./_export");n(n.S,"Object",{setPrototypeOf:e("./_set-proto").set})},{"./_export":34,"./_set-proto":92}],197:[function(e,i,r){"use strict";var n=e("./_classof"),t={};t[e("./_wks")("toStringTag")]="z",t+""!="[object z]"&&e("./_redefine")(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},{"./_classof":19,"./_redefine":89,"./_wks":119}],198:[function(e,i,r){var n=e("./_export"),t=e("./_parse-float");n(n.G+n.F*(parseFloat!=t),{parseFloat:t})},{"./_export":34,"./_parse-float":83}],199:[function(e,i,r){var n=e("./_export"),t=e("./_parse-int");n(n.G+n.F*(parseInt!=t),{parseInt:t})},{"./_export":34,"./_parse-int":84}],200:[function(e,i,r){"use strict";var n,t,o,f=e("./_library"),a=e("./_global"),u=e("./_ctx"),s=e("./_classof"),l=e("./_export"),c=e("./_is-object"),d=e("./_a-function"),b=e("./_an-instance"),h=e("./_for-of"),k=e("./_species-constructor"),_=e("./_task").set,p=e("./_microtask")(),v="Promise",w=a.TypeError,m=a.process,g=a[v],m=a.process,y="process"==s(m),E=function(){},S=!!function(){try{var i=g.resolve(1),r=(i.constructor={})[e("./_wks")("species")]=function(e){e(E,E)};return(y||"function"==typeof PromiseRejectionEvent)&&i.then(E)instanceof r}catch(n){}}(),O=function(e,i){return e===i||e===g&&i===o},C=function(e){var i;return!(!c(e)||"function"!=typeof(i=e.then))&&i},A=function(e){return O(g,e)?new x(e):new t(e)},x=t=function(e){var i,r;this.promise=new e(function(e,n){if(void 0!==i||void 0!==r)throw w("Bad Promise constructor");i=e,r=n}),this.resolve=d(i),this.reject=d(r)},R=function(e){try{e()}catch(i){return{error:i}}},F=function(e,i){if(!e._n){e._n=!0;var r=e._c;p(function(){for(var n=e._v,t=1==e._s,o=0,f=function(i){var r,o,f=t?i.ok:i.fail,a=i.resolve,u=i.reject,s=i.domain;try{f?(t||(2==e._h&&P(e),e._h=1),f===!0?r=n:(s&&s.enter(),r=f(n),s&&s.exit()),r===i.promise?u(w("Promise-chain cycle")):(o=C(r))?o.call(r,a,u):a(r)):u(n)}catch(l){u(l)}};r.length>o;)f(r[o++]);e._c=[],e._n=!1,i&&!e._h&&M(e)})}},M=function(e){_.call(a,function(){var i,r,n,t=e._v;if(T(e)&&(i=R(function(){y?m.emit("unhandledRejection",t,e):(r=a.onunhandledrejection)?r({promise:e,reason:t}):(n=a.console)&&n.error&&n.error("Unhandled promise rejection",t)}),e._h=y||T(e)?2:1),e._a=void 0,i)throw i.error})},T=function(e){if(1==e._h)return!1;for(var i,r=e._a||e._c,n=0;r.length>n;)if(i=r[n++],i.fail||!T(i.promise))return!1;return!0},P=function(e){_.call(a,function(){var i;y?m.emit("rejectionHandled",e):(i=a.onrejectionhandled)&&i({promise:e,reason:e._v})})},j=function(e){var i=this;i._d||(i._d=!0,i=i._w||i,i._v=e,i._s=2,i._a||(i._a=i._c.slice()),F(i,!0))},L=function(e){var i,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw w("Promise can't be resolved itself");(i=C(e))?p(function(){var n={_w:r,_d:!1};try{i.call(e,u(L,n,1),u(j,n,1))}catch(t){j.call(n,t)}}):(r._v=e,r._s=1,F(r,!1))}catch(n){j.call({_w:r,_d:!1},n)}}};S||(g=function(e){b(this,g,v,"_h"),d(e),n.call(this);try{e(u(L,this,1),u(j,this,1))}catch(i){j.call(this,i)}},n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},n.prototype=e("./_redefine-all")(g.prototype,{then:function(e,i){var r=A(k(this,g));return r.ok="function"!=typeof e||e,r.fail="function"==typeof i&&i,r.domain=y?m.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&F(this,!1),r.promise},"catch":function(e){return this.then(void 0,e)}}),x=function(){var e=new n;this.promise=e,this.resolve=u(L,e,1),this.reject=u(j,e,1)}),l(l.G+l.W+l.F*!S,{Promise:g}),e("./_set-to-string-tag")(g,v),e("./_set-species")(v),o=e("./_core")[v],l(l.S+l.F*!S,v,{reject:function(e){var i=A(this),r=i.reject;return r(e),i.promise}}),l(l.S+l.F*(f||!S),v,{resolve:function(e){if(e instanceof g&&O(e.constructor,this))return e;var i=A(this),r=i.resolve;return r(e),i.promise}}),l(l.S+l.F*!(S&&e("./_iter-detect")(function(e){g.all(e)["catch"](E)})),v,{all:function(e){var i=this,r=A(i),n=r.resolve,t=r.reject,o=R(function(){var r=[],o=0,f=1;h(e,!1,function(e){var a=o++,u=!1;r.push(void 0),f++,i.resolve(e).then(function(e){u||(u=!0,r[a]=e,--f||n(r))},t)}),--f||n(r)});return o&&t(o.error),r.promise},race:function(e){var i=this,r=A(i),n=r.reject,t=R(function(){h(e,!1,function(e){i.resolve(e).then(r.resolve,n)})});return t&&n(t.error),r.promise}})},{"./_a-function":5,"./_an-instance":8,"./_classof":19,"./_core":25,"./_ctx":27,"./_export":34,"./_for-of":39,"./_global":40,"./_is-object":51,"./_iter-detect":56,"./_library":60,"./_microtask":66,"./_redefine-all":88,"./_set-species":93,"./_set-to-string-tag":94,"./_species-constructor":97,"./_task":106,"./_wks":119}],201:[function(e,i,r){var n=e("./_export"),t=e("./_a-function"),o=e("./_an-object"),f=(e("./_global").Reflect||{}).apply,a=Function.apply;n(n.S+n.F*!e("./_fails")(function(){f(function(){})}),"Reflect",{apply:function(e,i,r){var n=t(e),u=o(r);return f?f(n,i,u):a.call(n,i,u)}})},{"./_a-function":5,"./_an-object":9,"./_export":34,"./_fails":36,"./_global":40}],202:[function(e,i,r){var n=e("./_export"),t=e("./_object-create"),o=e("./_a-function"),f=e("./_an-object"),a=e("./_is-object"),u=e("./_fails"),s=e("./_bind"),l=(e("./_global").Reflect||{}).construct,c=u(function(){function e(){}return!(l(function(){},[],e)instanceof e)}),d=!u(function(){l(function(){})});n(n.S+n.F*(c||d),"Reflect",{construct:function(e,i){o(e),f(i);var r=arguments.length<3?e:o(arguments[2]);if(d&&!c)return l(e,i,r);if(e==r){switch(i.length){case 0:return new e;case 1:return new e(i[0]);case 2:return new e(i[0],i[1]);case 3:return new e(i[0],i[1],i[2]);case 4:return new e(i[0],i[1],i[2],i[3])}var n=[null];return n.push.apply(n,i),new(s.apply(e,n))}var u=r.prototype,b=t(a(u)?u:Object.prototype),h=Function.apply.call(e,b,i);return a(h)?h:b}})},{"./_a-function":5,"./_an-object":9,"./_bind":18,"./_export":34,"./_fails":36,"./_global":40,"./_is-object":51,"./_object-create":68}],203:[function(e,i,r){var n=e("./_object-dp"),t=e("./_export"),o=e("./_an-object"),f=e("./_to-primitive");t(t.S+t.F*e("./_fails")(function(){Reflect.defineProperty(n.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,i,r){o(e),i=f(i,!0),o(r);try{return n.f(e,i,r),!0}catch(t){return!1}}})},{"./_an-object":9,"./_export":34,"./_fails":36,"./_object-dp":69,"./_to-primitive":112}],204:[function(e,i,r){var n=e("./_export"),t=e("./_object-gopd").f,o=e("./_an-object");n(n.S,"Reflect",{deleteProperty:function(e,i){var r=t(o(e),i);return!(r&&!r.configurable)&&delete e[i]}})},{"./_an-object":9,"./_export":34,"./_object-gopd":72}],205:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_an-object"),o=function(e){this._t=t(e),this._i=0;var i,r=this._k=[];for(i in e)r.push(i)};e("./_iter-create")(o,"Object",function(){var e,i=this,r=i._k;do if(i._i>=r.length)return{value:void 0,done:!0};while(!((e=r[i._i++])in i._t));return{value:e,done:!1}}),n(n.S,"Reflect",{enumerate:function(e){return new o(e)}})},{"./_an-object":9,"./_export":34,"./_iter-create":54}],206:[function(e,i,r){var n=e("./_object-gopd"),t=e("./_export"),o=e("./_an-object");t(t.S,"Reflect",{getOwnPropertyDescriptor:function(e,i){return n.f(o(e),i)}})},{"./_an-object":9,"./_export":34,"./_object-gopd":72}],207:[function(e,i,r){var n=e("./_export"),t=e("./_object-gpo"),o=e("./_an-object");n(n.S,"Reflect",{getPrototypeOf:function(e){return t(o(e))}})},{"./_an-object":9,"./_export":34,"./_object-gpo":76}],208:[function(e,i,r){function n(e,i){var r,a,l=arguments.length<3?e:arguments[2];return s(e)===l?e[i]:(r=t.f(e,i))?f(r,"value")?r.value:void 0!==r.get?r.get.call(l):void 0:u(a=o(e))?n(a,i,l):void 0}var t=e("./_object-gopd"),o=e("./_object-gpo"),f=e("./_has"),a=e("./_export"),u=e("./_is-object"),s=e("./_an-object");a(a.S,"Reflect",{get:n})},{"./_an-object":9,"./_export":34,"./_has":41,"./_is-object":51,"./_object-gopd":72,"./_object-gpo":76}],209:[function(e,i,r){var n=e("./_export");n(n.S,"Reflect",{has:function(e,i){return i in e}})},{"./_export":34}],210:[function(e,i,r){var n=e("./_export"),t=e("./_an-object"),o=Object.isExtensible;n(n.S,"Reflect",{isExtensible:function(e){return t(e),!o||o(e)}})},{"./_an-object":9,"./_export":34}],211:[function(e,i,r){var n=e("./_export");n(n.S,"Reflect",{ownKeys:e("./_own-keys")})},{"./_export":34,"./_own-keys":82}],212:[function(e,i,r){var n=e("./_export"),t=e("./_an-object"),o=Object.preventExtensions;n(n.S,"Reflect",{preventExtensions:function(e){t(e);try{return o&&o(e),!0}catch(i){return!1}}})},{"./_an-object":9,"./_export":34}],213:[function(e,i,r){var n=e("./_export"),t=e("./_set-proto");t&&n(n.S,"Reflect",{setPrototypeOf:function(e,i){t.check(e,i);try{return t.set(e,i),!0}catch(r){return!1}}})},{"./_export":34,"./_set-proto":92}],214:[function(e,i,r){function n(e,i,r){var u,d,b=arguments.length<4?e:arguments[3],h=o.f(l(e),i);if(!h){if(c(d=f(e)))return n(d,i,r,b);h=s(0)}return a(h,"value")?!(h.writable===!1||!c(b))&&(u=o.f(b,i)||s(0),u.value=r,t.f(b,i,u),!0):void 0!==h.set&&(h.set.call(b,r),!0)}var t=e("./_object-dp"),o=e("./_object-gopd"),f=e("./_object-gpo"),a=e("./_has"),u=e("./_export"),s=e("./_property-desc"),l=e("./_an-object"),c=e("./_is-object");u(u.S,"Reflect",{set:n})},{"./_an-object":9,"./_export":34,"./_has":41,"./_is-object":51,"./_object-dp":69,"./_object-gopd":72,"./_object-gpo":76,"./_property-desc":87}],215:[function(e,i,r){var n=e("./_global"),t=e("./_inherit-if-required"),o=e("./_object-dp").f,f=e("./_object-gopn").f,a=e("./_is-regexp"),u=e("./_flags"),s=n.RegExp,l=s,c=s.prototype,d=/a/g,b=/a/g,h=new s(d)!==d;if(e("./_descriptors")&&(!h||e("./_fails")(function(){return b[e("./_wks")("match")]=!1,s(d)!=d||s(b)==b||"/a/i"!=s(d,"i")}))){s=function(e,i){var r=this instanceof s,n=a(e),o=void 0===i;return!r&&n&&e.constructor===s&&o?e:t(h?new l(n&&!o?e.source:e,i):l((n=e instanceof s)?e.source:e,n&&o?u.call(e):i),r?this:c,s)};for(var k=(function(e){e in s||o(s,e,{configurable:!0,get:function(){return l[e]},set:function(i){l[e]=i}})}),_=f(l),p=0;_.length>p;)k(_[p++]);c.constructor=s,s.prototype=c,e("./_redefine")(n,"RegExp",s)}e("./_set-species")("RegExp")},{"./_descriptors":30,"./_fails":36,"./_flags":38,"./_global":40,"./_inherit-if-required":45,"./_is-regexp":52,"./_object-dp":69,"./_object-gopn":74,"./_redefine":89,"./_set-species":93,"./_wks":119}],216:[function(e,i,r){e("./_descriptors")&&"g"!=/./g.flags&&e("./_object-dp").f(RegExp.prototype,"flags",{configurable:!0,get:e("./_flags")})},{"./_descriptors":30,"./_flags":38,"./_object-dp":69}],217:[function(e,i,r){e("./_fix-re-wks")("match",1,function(e,i,r){return[function(r){"use strict";var n=e(this),t=void 0==r?void 0:r[i];return void 0!==t?t.call(r,n):new RegExp(r)[i](String(n))},r]})},{"./_fix-re-wks":37}],218:[function(e,i,r){e("./_fix-re-wks")("replace",2,function(e,i,r){return[function(n,t){"use strict";var o=e(this),f=void 0==n?void 0:n[i];return void 0!==f?f.call(n,o,t):r.call(String(o),n,t)},r]})},{"./_fix-re-wks":37}],219:[function(e,i,r){e("./_fix-re-wks")("search",1,function(e,i,r){return[function(r){"use strict";var n=e(this),t=void 0==r?void 0:r[i];return void 0!==t?t.call(r,n):new RegExp(r)[i](String(n))},r]})},{"./_fix-re-wks":37}],220:[function(e,i,r){e("./_fix-re-wks")("split",2,function(i,r,n){"use strict";var t=e("./_is-regexp"),o=n,f=[].push,a="split",u="length",s="lastIndex";if("c"=="abbc"[a](/(b)*/)[1]||4!="test"[a](/(?:)/,-1)[u]||2!="ab"[a](/(?:ab)*/)[u]||4!="."[a](/(.?)(.?)/)[u]||"."[a](/()()/)[u]>1||""[a](/.?/)[u]){var l=void 0===/()??/.exec("")[1];n=function(e,i){var r=String(this);if(void 0===e&&0===i)return[];if(!t(e))return o.call(r,e,i);var n,a,c,d,b,h=[],k=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),_=0,p=void 0===i?4294967295:i>>>0,v=new RegExp(e.source,k+"g");for(l||(n=new RegExp("^"+v.source+"$(?!\\s)",k));(a=v.exec(r))&&(c=a.index+a[0][u],!(c>_&&(h.push(r.slice(_,a.index)),!l&&a[u]>1&&a[0].replace(n,function(){for(b=1;b1&&a.index=p)));)v[s]===a.index&&v[s]++;return _===r[u]?!d&&v.test("")||h.push(""):h.push(r.slice(_)),h[u]>p?h.slice(0,p):h}}else"0"[a](void 0,0)[u]&&(n=function(e,i){return void 0===e&&0===i?[]:o.call(this,e,i)});return[function(e,t){var o=i(this),f=void 0==e?void 0:e[r];return void 0!==f?f.call(e,o,t):n.call(String(o),e,t)},n]})},{"./_fix-re-wks":37,"./_is-regexp":52}],221:[function(e,i,r){"use strict";e("./es6.regexp.flags");var n=e("./_an-object"),t=e("./_flags"),o=e("./_descriptors"),f="toString",a=/./[f],u=function(i){e("./_redefine")(RegExp.prototype,f,i,!0)};e("./_fails")(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?u(function(){var e=n(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?t.call(e):void 0)}):a.name!=f&&u(function(){return a.call(this)})},{"./_an-object":9,"./_descriptors":30,"./_fails":36,"./_flags":38,"./_redefine":89,"./es6.regexp.flags":216}],222:[function(e,i,r){"use strict";var n=e("./_collection-strong");i.exports=e("./_collection")("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return n.def(this,e=0===e?0:e,e)}},n)},{"./_collection":24,"./_collection-strong":21}],223:[function(e,i,r){"use strict";e("./_string-html")("anchor",function(e){return function(i){return e(this,"a","name",i)}})},{"./_string-html":101}],224:[function(e,i,r){"use strict";e("./_string-html")("big",function(e){return function(){return e(this,"big","","")}})},{"./_string-html":101}],225:[function(e,i,r){"use strict";e("./_string-html")("blink",function(e){return function(){return e(this,"blink","","")}})},{"./_string-html":101}],226:[function(e,i,r){"use strict";e("./_string-html")("bold",function(e){return function(){return e(this,"b","","")}})},{"./_string-html":101}],227:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_string-at")(!1);n(n.P,"String",{codePointAt:function(e){return t(this,e)}})},{"./_export":34,"./_string-at":99}],228:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_to-length"),o=e("./_string-context"),f="endsWith",a=""[f];n(n.P+n.F*e("./_fails-is-regexp")(f),"String",{endsWith:function(e){var i=o(this,e,f),r=arguments.length>1?arguments[1]:void 0,n=t(i.length),u=void 0===r?n:Math.min(t(r),n),s=String(e);return a?a.call(i,s,u):i.slice(u-s.length,u)===s}})},{"./_export":34,"./_fails-is-regexp":35,"./_string-context":100,"./_to-length":110}],229:[function(e,i,r){"use strict";e("./_string-html")("fixed",function(e){return function(){return e(this,"tt","","")}})},{"./_string-html":101}],230:[function(e,i,r){"use strict";e("./_string-html")("fontcolor",function(e){return function(i){return e(this,"font","color",i)}})},{"./_string-html":101}],231:[function(e,i,r){"use strict";e("./_string-html")("fontsize",function(e){return function(i){return e(this,"font","size",i)}})},{"./_string-html":101}],232:[function(e,i,r){var n=e("./_export"),t=e("./_to-index"),o=String.fromCharCode,f=String.fromCodePoint;n(n.S+n.F*(!!f&&1!=f.length),"String",{fromCodePoint:function(e){for(var i,r=[],n=arguments.length,f=0;n>f;){if(i=+arguments[f++],t(i,1114111)!==i)throw RangeError(i+" is not a valid code point");r.push(i<65536?o(i):o(((i-=65536)>>10)+55296,i%1024+56320))}return r.join("")}})},{"./_export":34,"./_to-index":107}],233:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_string-context"),o="includes";n(n.P+n.F*e("./_fails-is-regexp")(o),"String",{includes:function(e){return!!~t(this,e,o).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},{"./_export":34,"./_fails-is-regexp":35,"./_string-context":100}],234:[function(e,i,r){"use strict";e("./_string-html")("italics",function(e){return function(){return e(this,"i","","")}})},{"./_string-html":101}],235:[function(e,i,r){"use strict";var n=e("./_string-at")(!0);e("./_iter-define")(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,i=this._t,r=this._i;return r>=i.length?{value:void 0,done:!0}:(e=n(i,r),this._i+=e.length,{value:e,done:!1})})},{"./_iter-define":55,"./_string-at":99}],236:[function(e,i,r){"use strict";e("./_string-html")("link",function(e){return function(i){return e(this,"a","href",i)}})},{"./_string-html":101}],237:[function(e,i,r){var n=e("./_export"),t=e("./_to-iobject"),o=e("./_to-length");n(n.S,"String",{raw:function(e){for(var i=t(e.raw),r=o(i.length),n=arguments.length,f=[],a=0;r>a;)f.push(String(i[a++])),a1?arguments[1]:void 0,i.length)),n=String(e);return a?a.call(i,n,r):i.slice(r,r+n.length)===n}})},{"./_export":34,"./_fails-is-regexp":35,"./_string-context":100,"./_to-length":110}],241:[function(e,i,r){"use strict";e("./_string-html")("strike",function(e){return function(){return e(this,"strike","","")}})},{"./_string-html":101}],242:[function(e,i,r){"use strict";e("./_string-html")("sub",function(e){return function(){return e(this,"sub","","")}})},{"./_string-html":101}],243:[function(e,i,r){"use strict";e("./_string-html")("sup",function(e){return function(){return e(this,"sup","","")}})},{"./_string-html":101}],244:[function(e,i,r){"use strict";e("./_string-trim")("trim",function(e){return function(){return e(this,3)}})},{"./_string-trim":104}],245:[function(e,i,r){"use strict";var n=e("./_global"),t=e("./_has"),o=e("./_descriptors"),f=e("./_export"),a=e("./_redefine"),u=e("./_meta").KEY,s=e("./_fails"),l=e("./_shared"),c=e("./_set-to-string-tag"),d=e("./_uid"),b=e("./_wks"),h=e("./_wks-ext"),k=e("./_wks-define"),_=e("./_keyof"),p=e("./_enum-keys"),v=e("./_is-array"),w=e("./_an-object"),m=e("./_to-iobject"),g=e("./_to-primitive"),y=e("./_property-desc"),E=e("./_object-create"),S=e("./_object-gopn-ext"),O=e("./_object-gopd"),C=e("./_object-dp"),A=e("./_object-keys"),x=O.f,R=C.f,F=S.f,M=n.Symbol,T=n.JSON,P=T&&T.stringify,j="prototype",L=b("_hidden"),D=b("toPrimitive"),N={}.propertyIsEnumerable,I=l("symbol-registry"),B=l("symbols"),U=l("op-symbols"),H=Object[j],z="function"==typeof M,G=n.QObject,V=!G||!G[j]||!G[j].findChild,Y=o&&s(function(){return 7!=E(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a})?function(e,i,r){var n=x(H,i);n&&delete H[i],R(e,i,r),n&&e!==H&&R(H,i,n)}:R,W=function(e){var i=B[e]=E(M[j]);return i._k=e,i},q=z&&"symbol"==typeof M.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof M},X=function(e,i,r){return e===H&&X(U,i,r),w(e),i=g(i,!0),w(r),t(B,i)?(r.enumerable?(t(e,L)&&e[L][i]&&(e[L][i]=!1),r=E(r,{enumerable:y(0,!1)})):(t(e,L)||R(e,L,y(1,{})),e[L][i]=!0),Y(e,i,r)):R(e,i,r)},K=function(e,i){w(e);for(var r,n=p(i=m(i)),t=0,o=n.length;o>t;)X(e,r=n[t++],i[r]);return e},J=function(e,i){return void 0===i?E(e):K(E(e),i)},Z=function(e){var i=N.call(this,e=g(e,!0));return!(this===H&&t(B,e)&&!t(U,e))&&(!(i||!t(this,e)||!t(B,e)||t(this,L)&&this[L][e])||i)},$=function(e,i){if(e=m(e),i=g(i,!0),e!==H||!t(B,i)||t(U,i)){var r=x(e,i);return!r||!t(B,i)||t(e,L)&&e[L][i]||(r.enumerable=!0),r}},Q=function(e){for(var i,r=F(m(e)),n=[],o=0;r.length>o;)t(B,i=r[o++])||i==L||i==u||n.push(i);return n},ee=function(e){for(var i,r=e===H,n=F(r?U:m(e)),o=[],f=0;n.length>f;)!t(B,i=n[f++])||r&&!t(H,i)||o.push(B[i]);return o};z||(M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),i=function(r){this===H&&i.call(U,r),t(this,L)&&t(this[L],e)&&(this[L][e]=!1),Y(this,e,y(1,r))};return o&&V&&Y(H,e,{configurable:!0,set:i}),W(e)},a(M[j],"toString",function(){return this._k}),O.f=$,C.f=X,e("./_object-gopn").f=S.f=Q,e("./_object-pie").f=Z,e("./_object-gops").f=ee,o&&!e("./_library")&&a(H,"propertyIsEnumerable",Z,!0),h.f=function(e){return W(b(e))}),f(f.G+f.W+f.F*!z,{Symbol:M});for(var ie="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;ie.length>re;)b(ie[re++]);for(var ie=A(b.store),re=0;ie.length>re;)k(ie[re++]);f(f.S+f.F*!z,"Symbol",{"for":function(e){return t(I,e+="")?I[e]:I[e]=M(e)},keyFor:function(e){if(q(e))return _(I,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){V=!0},useSimple:function(){V=!1}}),f(f.S+f.F*!z,"Object",{create:J,defineProperty:X,defineProperties:K,getOwnPropertyDescriptor:$,getOwnPropertyNames:Q,getOwnPropertySymbols:ee}),T&&f(f.S+f.F*(!z||s(function(){var e=M();return"[null]"!=P([e])||"{}"!=P({a:e})||"{}"!=P(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!q(e)){for(var i,r,n=[e],t=1;arguments.length>t;)n.push(arguments[t++]);return i=n[1],"function"==typeof i&&(r=i),!r&&v(i)||(i=function(e,i){if(r&&(i=r.call(this,e,i)),!q(i))return i}),n[1]=i,P.apply(T,n)}}}),M[j][D]||e("./_hide")(M[j],D,M[j].valueOf),c(M,"Symbol"),c(Math,"Math",!0),c(n.JSON,"JSON",!0)},{"./_an-object":9,"./_descriptors":30,"./_enum-keys":33,"./_export":34,"./_fails":36,"./_global":40,"./_has":41,"./_hide":42,"./_is-array":49,"./_keyof":59,"./_library":60,"./_meta":64,"./_object-create":68,"./_object-dp":69,"./_object-gopd":72,"./_object-gopn":74,"./_object-gopn-ext":73,"./_object-gops":75,"./_object-keys":78,"./_object-pie":79,"./_property-desc":87,"./_redefine":89,"./_set-to-string-tag":94,"./_shared":96,"./_to-iobject":109,"./_to-primitive":112,"./_uid":116,"./_wks":119,"./_wks-define":117,"./_wks-ext":118}],246:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_typed"),o=e("./_typed-buffer"),f=e("./_an-object"),a=e("./_to-index"),u=e("./_to-length"),s=e("./_is-object"),l=e("./_global").ArrayBuffer,c=e("./_species-constructor"),d=o.ArrayBuffer,b=o.DataView,h=t.ABV&&l.isView,k=d.prototype.slice,_=t.VIEW,p="ArrayBuffer";n(n.G+n.W+n.F*(l!==d),{ArrayBuffer:d}),n(n.S+n.F*!t.CONSTR,p,{isView:function(e){return h&&h(e)||s(e)&&_ in e}}),n(n.P+n.U+n.F*e("./_fails")(function(){return!new d(2).slice(1,void 0).byteLength}),p,{slice:function(e,i){if(void 0!==k&&void 0===i)return k.call(f(this),e);for(var r=f(this).byteLength,n=a(e,r),t=a(void 0===i?r:i,r),o=new(c(this,d))(u(t-n)),s=new b(this),l=new b(o),h=0;n0?arguments[0]:void 0)}},k={get:function(e){if(s(e)){var i=l(e);return i===!0?d(this).get(e):i?i[this._i]:void 0}},set:function(e,i){return u.def(this,e,i)}},_=i.exports=e("./_collection")("WeakMap",h,k,u,!0,!0);7!=(new _).set((Object.freeze||Object)(b),7).get(b)&&(n=u.getConstructor(h),a(n.prototype,k),f.NEED=!0,t(["delete","has","get","set"],function(e){var i=_.prototype,r=i[e];o(i,e,function(i,t){if(s(i)&&!c(i)){this._f||(this._f=new n);var o=this._f[e](i,t);return"set"==e?this:o}return r.call(this,i,t)})}))},{"./_array-methods":14,"./_collection":24,"./_collection-weak":23,"./_is-object":51,"./_meta":64,"./_object-assign":67,"./_redefine":89}],258:[function(e,i,r){"use strict";var n=e("./_collection-weak");e("./_collection")("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return n.def(this,e,!0)}},n,!1,!0)},{"./_collection":24,"./_collection-weak":23}],259:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_array-includes")(!0);n(n.P,"Array",{includes:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),e("./_add-to-unscopables")("includes")},{"./_add-to-unscopables":7,"./_array-includes":13,"./_export":34}],260:[function(e,i,r){var n=e("./_export"),t=e("./_microtask")(),o=e("./_global").process,f="process"==e("./_cof")(o);n(n.G,{asap:function(e){var i=f&&o.domain;t(i?i.bind(e):e)}})},{"./_cof":20,"./_export":34,"./_global":40,"./_microtask":66}],261:[function(e,i,r){var n=e("./_export"),t=e("./_cof");n(n.S,"Error",{isError:function(e){return"Error"===t(e)}})},{"./_cof":20,"./_export":34}],262:[function(e,i,r){var n=e("./_export");n(n.P+n.R,"Map",{toJSON:e("./_collection-to-json")("Map")})},{"./_collection-to-json":22,"./_export":34}],263:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{iaddh:function(e,i,r,n){var t=e>>>0,o=i>>>0,f=r>>>0;return o+(n>>>0)+((t&f|(t|f)&~(t+f>>>0))>>>31)|0}})},{"./_export":34}],264:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{imulh:function(e,i){var r=65535,n=+e,t=+i,o=n&r,f=t&r,a=n>>16,u=t>>16,s=(a*f>>>0)+(o*f>>>16);return a*u+(s>>16)+((o*u>>>0)+(s&r)>>16)}})},{"./_export":34}],265:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{isubh:function(e,i,r,n){var t=e>>>0,o=i>>>0,f=r>>>0;return o-(n>>>0)-((~t&f|~(t^f)&t-f>>>0)>>>31)|0}})},{"./_export":34}],266:[function(e,i,r){var n=e("./_export");n(n.S,"Math",{umulh:function(e,i){var r=65535,n=+e,t=+i,o=n&r,f=t&r,a=n>>>16,u=t>>>16,s=(a*f>>>0)+(o*f>>>16);return a*u+(s>>>16)+((o*u>>>0)+(s&r)>>>16)}})},{"./_export":34}],267:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_to-object"),o=e("./_a-function"),f=e("./_object-dp");e("./_descriptors")&&n(n.P+e("./_object-forced-pam"),"Object",{ +__defineGetter__:function(e,i){f.f(t(this),e,{get:o(i),enumerable:!0,configurable:!0})}})},{"./_a-function":5,"./_descriptors":30,"./_export":34,"./_object-dp":69,"./_object-forced-pam":71,"./_to-object":111}],268:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_to-object"),o=e("./_a-function"),f=e("./_object-dp");e("./_descriptors")&&n(n.P+e("./_object-forced-pam"),"Object",{__defineSetter__:function(e,i){f.f(t(this),e,{set:o(i),enumerable:!0,configurable:!0})}})},{"./_a-function":5,"./_descriptors":30,"./_export":34,"./_object-dp":69,"./_object-forced-pam":71,"./_to-object":111}],269:[function(e,i,r){var n=e("./_export"),t=e("./_object-to-array")(!0);n(n.S,"Object",{entries:function(e){return t(e)}})},{"./_export":34,"./_object-to-array":81}],270:[function(e,i,r){var n=e("./_export"),t=e("./_own-keys"),o=e("./_to-iobject"),f=e("./_object-gopd"),a=e("./_create-property");n(n.S,"Object",{getOwnPropertyDescriptors:function(e){for(var i,r=o(e),n=f.f,u=t(r),s={},l=0;u.length>l;)a(s,i=u[l++],n(r,i));return s}})},{"./_create-property":26,"./_export":34,"./_object-gopd":72,"./_own-keys":82,"./_to-iobject":109}],271:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_to-object"),o=e("./_to-primitive"),f=e("./_object-gpo"),a=e("./_object-gopd").f;e("./_descriptors")&&n(n.P+e("./_object-forced-pam"),"Object",{__lookupGetter__:function(e){var i,r=t(this),n=o(e,!0);do if(i=a(r,n))return i.get;while(r=f(r))}})},{"./_descriptors":30,"./_export":34,"./_object-forced-pam":71,"./_object-gopd":72,"./_object-gpo":76,"./_to-object":111,"./_to-primitive":112}],272:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_to-object"),o=e("./_to-primitive"),f=e("./_object-gpo"),a=e("./_object-gopd").f;e("./_descriptors")&&n(n.P+e("./_object-forced-pam"),"Object",{__lookupSetter__:function(e){var i,r=t(this),n=o(e,!0);do if(i=a(r,n))return i.set;while(r=f(r))}})},{"./_descriptors":30,"./_export":34,"./_object-forced-pam":71,"./_object-gopd":72,"./_object-gpo":76,"./_to-object":111,"./_to-primitive":112}],273:[function(e,i,r){var n=e("./_export"),t=e("./_object-to-array")(!1);n(n.S,"Object",{values:function(e){return t(e)}})},{"./_export":34,"./_object-to-array":81}],274:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_global"),o=e("./_core"),f=e("./_microtask")(),a=e("./_wks")("observable"),u=e("./_a-function"),s=e("./_an-object"),l=e("./_an-instance"),c=e("./_redefine-all"),d=e("./_hide"),b=e("./_for-of"),h=b.RETURN,k=function(e){return null==e?void 0:u(e)},_=function(e){var i=e._c;i&&(e._c=void 0,i())},p=function(e){return void 0===e._o},v=function(e){p(e)||(e._o=void 0,_(e))},w=function(e,i){s(e),this._c=void 0,this._o=e,e=new m(this);try{var r=i(e),n=r;null!=r&&("function"==typeof r.unsubscribe?r=function(){n.unsubscribe()}:u(r),this._c=r)}catch(t){return void e.error(t)}p(this)&&_(this)};w.prototype=c({},{unsubscribe:function(){v(this)}});var m=function(e){this._s=e};m.prototype=c({},{next:function(e){var i=this._s;if(!p(i)){var r=i._o;try{var n=k(r.next);if(n)return n.call(r,e)}catch(t){try{v(i)}finally{throw t}}}},error:function(e){var i=this._s;if(p(i))throw e;var r=i._o;i._o=void 0;try{var n=k(r.error);if(!n)throw e;e=n.call(r,e)}catch(t){try{_(i)}finally{throw t}}return _(i),e},complete:function(e){var i=this._s;if(!p(i)){var r=i._o;i._o=void 0;try{var n=k(r.complete);e=n?n.call(r,e):void 0}catch(t){try{_(i)}finally{throw t}}return _(i),e}}});var g=function(e){l(this,g,"Observable","_f")._f=u(e)};c(g.prototype,{subscribe:function(e){return new w(e,this._f)},forEach:function(e){var i=this;return new(o.Promise||t.Promise)(function(r,n){u(e);var t=i.subscribe({next:function(i){try{return e(i)}catch(r){n(r),t.unsubscribe()}},error:n,complete:r})})}}),c(g,{from:function(e){var i="function"==typeof this?this:g,r=k(s(e)[a]);if(r){var n=s(r.call(e));return n.constructor===i?n:new i(function(e){return n.subscribe(e)})}return new i(function(i){var r=!1;return f(function(){if(!r){try{if(b(e,!1,function(e){if(i.next(e),r)return h})===h)return}catch(n){if(r)throw n;return void i.error(n)}i.complete()}}),function(){r=!0}})},of:function(){for(var e=0,i=arguments.length,r=Array(i);e1?arguments[1]:void 0,!1)}})},{"./_export":34,"./_string-pad":102}],288:[function(e,i,r){"use strict";var n=e("./_export"),t=e("./_string-pad");n(n.P,"String",{padStart:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},{"./_export":34,"./_string-pad":102}],289:[function(e,i,r){"use strict";e("./_string-trim")("trimLeft",function(e){return function(){return e(this,1)}},"trimStart")},{"./_string-trim":104}],290:[function(e,i,r){"use strict";e("./_string-trim")("trimRight",function(e){return function(){return e(this,2)}},"trimEnd")},{"./_string-trim":104}],291:[function(e,i,r){e("./_wks-define")("asyncIterator")},{"./_wks-define":117}],292:[function(e,i,r){e("./_wks-define")("observable")},{"./_wks-define":117}],293:[function(e,i,r){var n=e("./_export");n(n.S,"System",{global:e("./_global")})},{"./_export":34,"./_global":40}],294:[function(e,i,r){for(var n=e("./es6.array.iterator"),t=e("./_redefine"),o=e("./_global"),f=e("./_hide"),a=e("./_iterators"),u=e("./_wks"),s=u("iterator"),l=u("toStringTag"),c=a.Array,d=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],b=0;b<5;b++){var h,k=d[b],_=o[k],p=_&&_.prototype;if(p){p[s]||f(p,s,c),p[l]||f(p,l,k),a[k]=c;for(h in n)p[h]||t(p,h,n[h],!0)}}},{"./_global":40,"./_hide":42,"./_iterators":58,"./_redefine":89,"./_wks":119,"./es6.array.iterator":132}],295:[function(e,i,r){var n=e("./_export"),t=e("./_task");n(n.G+n.B,{setImmediate:t.set,clearImmediate:t.clear})},{"./_export":34,"./_task":106}],296:[function(e,i,r){var n=e("./_global"),t=e("./_export"),o=e("./_invoke"),f=e("./_partial"),a=n.navigator,u=!!a&&/MSIE .\./.test(a.userAgent),s=function(e){return u?function(i,r){return e(o(f,[].slice.call(arguments,2),"function"==typeof i?i:Function(i)),r)}:e};t(t.G+t.B+t.F*u,{setTimeout:s(n.setTimeout),setInterval:s(n.setInterval)})},{"./_export":34,"./_global":40,"./_invoke":46,"./_partial":85}],297:[function(e,i,r){e("./modules/es6.symbol"),e("./modules/es6.object.create"),e("./modules/es6.object.define-property"),e("./modules/es6.object.define-properties"),e("./modules/es6.object.get-own-property-descriptor"),e("./modules/es6.object.get-prototype-of"),e("./modules/es6.object.keys"),e("./modules/es6.object.get-own-property-names"),e("./modules/es6.object.freeze"),e("./modules/es6.object.seal"),e("./modules/es6.object.prevent-extensions"),e("./modules/es6.object.is-frozen"),e("./modules/es6.object.is-sealed"),e("./modules/es6.object.is-extensible"),e("./modules/es6.object.assign"),e("./modules/es6.object.is"),e("./modules/es6.object.set-prototype-of"),e("./modules/es6.object.to-string"),e("./modules/es6.function.bind"),e("./modules/es6.function.name"),e("./modules/es6.function.has-instance"),e("./modules/es6.parse-int"),e("./modules/es6.parse-float"),e("./modules/es6.number.constructor"),e("./modules/es6.number.to-fixed"),e("./modules/es6.number.to-precision"),e("./modules/es6.number.epsilon"),e("./modules/es6.number.is-finite"),e("./modules/es6.number.is-integer"),e("./modules/es6.number.is-nan"),e("./modules/es6.number.is-safe-integer"),e("./modules/es6.number.max-safe-integer"),e("./modules/es6.number.min-safe-integer"),e("./modules/es6.number.parse-float"),e("./modules/es6.number.parse-int"),e("./modules/es6.math.acosh"),e("./modules/es6.math.asinh"),e("./modules/es6.math.atanh"),e("./modules/es6.math.cbrt"),e("./modules/es6.math.clz32"),e("./modules/es6.math.cosh"),e("./modules/es6.math.expm1"),e("./modules/es6.math.fround"),e("./modules/es6.math.hypot"),e("./modules/es6.math.imul"),e("./modules/es6.math.log10"),e("./modules/es6.math.log1p"),e("./modules/es6.math.log2"),e("./modules/es6.math.sign"),e("./modules/es6.math.sinh"),e("./modules/es6.math.tanh"),e("./modules/es6.math.trunc"),e("./modules/es6.string.from-code-point"),e("./modules/es6.string.raw"),e("./modules/es6.string.trim"),e("./modules/es6.string.iterator"),e("./modules/es6.string.code-point-at"),e("./modules/es6.string.ends-with"),e("./modules/es6.string.includes"),e("./modules/es6.string.repeat"),e("./modules/es6.string.starts-with"),e("./modules/es6.string.anchor"),e("./modules/es6.string.big"),e("./modules/es6.string.blink"),e("./modules/es6.string.bold"),e("./modules/es6.string.fixed"),e("./modules/es6.string.fontcolor"),e("./modules/es6.string.fontsize"),e("./modules/es6.string.italics"),e("./modules/es6.string.link"),e("./modules/es6.string.small"),e("./modules/es6.string.strike"),e("./modules/es6.string.sub"),e("./modules/es6.string.sup"),e("./modules/es6.date.now"),e("./modules/es6.date.to-json"),e("./modules/es6.date.to-iso-string"),e("./modules/es6.date.to-string"),e("./modules/es6.date.to-primitive"),e("./modules/es6.array.is-array"),e("./modules/es6.array.from"),e("./modules/es6.array.of"),e("./modules/es6.array.join"),e("./modules/es6.array.slice"),e("./modules/es6.array.sort"),e("./modules/es6.array.for-each"),e("./modules/es6.array.map"),e("./modules/es6.array.filter"),e("./modules/es6.array.some"),e("./modules/es6.array.every"),e("./modules/es6.array.reduce"),e("./modules/es6.array.reduce-right"),e("./modules/es6.array.index-of"),e("./modules/es6.array.last-index-of"),e("./modules/es6.array.copy-within"),e("./modules/es6.array.fill"),e("./modules/es6.array.find"),e("./modules/es6.array.find-index"),e("./modules/es6.array.species"),e("./modules/es6.array.iterator"),e("./modules/es6.regexp.constructor"),e("./modules/es6.regexp.to-string"),e("./modules/es6.regexp.flags"),e("./modules/es6.regexp.match"),e("./modules/es6.regexp.replace"),e("./modules/es6.regexp.search"),e("./modules/es6.regexp.split"),e("./modules/es6.promise"),e("./modules/es6.map"),e("./modules/es6.set"),e("./modules/es6.weak-map"),e("./modules/es6.weak-set"),e("./modules/es6.typed.array-buffer"),e("./modules/es6.typed.data-view"),e("./modules/es6.typed.int8-array"),e("./modules/es6.typed.uint8-array"),e("./modules/es6.typed.uint8-clamped-array"),e("./modules/es6.typed.int16-array"),e("./modules/es6.typed.uint16-array"),e("./modules/es6.typed.int32-array"),e("./modules/es6.typed.uint32-array"),e("./modules/es6.typed.float32-array"),e("./modules/es6.typed.float64-array"),e("./modules/es6.reflect.apply"),e("./modules/es6.reflect.construct"),e("./modules/es6.reflect.define-property"),e("./modules/es6.reflect.delete-property"),e("./modules/es6.reflect.enumerate"),e("./modules/es6.reflect.get"),e("./modules/es6.reflect.get-own-property-descriptor"),e("./modules/es6.reflect.get-prototype-of"),e("./modules/es6.reflect.has"),e("./modules/es6.reflect.is-extensible"),e("./modules/es6.reflect.own-keys"),e("./modules/es6.reflect.prevent-extensions"),e("./modules/es6.reflect.set"),e("./modules/es6.reflect.set-prototype-of"),e("./modules/es7.array.includes"),e("./modules/es7.string.at"),e("./modules/es7.string.pad-start"),e("./modules/es7.string.pad-end"),e("./modules/es7.string.trim-left"),e("./modules/es7.string.trim-right"),e("./modules/es7.string.match-all"),e("./modules/es7.symbol.async-iterator"),e("./modules/es7.symbol.observable"),e("./modules/es7.object.get-own-property-descriptors"),e("./modules/es7.object.values"),e("./modules/es7.object.entries"),e("./modules/es7.object.define-getter"),e("./modules/es7.object.define-setter"),e("./modules/es7.object.lookup-getter"),e("./modules/es7.object.lookup-setter"),e("./modules/es7.map.to-json"),e("./modules/es7.set.to-json"),e("./modules/es7.system.global"),e("./modules/es7.error.is-error"),e("./modules/es7.math.iaddh"),e("./modules/es7.math.isubh"),e("./modules/es7.math.imulh"),e("./modules/es7.math.umulh"),e("./modules/es7.reflect.define-metadata"),e("./modules/es7.reflect.delete-metadata"),e("./modules/es7.reflect.get-metadata"),e("./modules/es7.reflect.get-metadata-keys"),e("./modules/es7.reflect.get-own-metadata"),e("./modules/es7.reflect.get-own-metadata-keys"),e("./modules/es7.reflect.has-metadata"),e("./modules/es7.reflect.has-own-metadata"),e("./modules/es7.reflect.metadata"),e("./modules/es7.asap"),e("./modules/es7.observable"),e("./modules/web.timers"),e("./modules/web.immediate"),e("./modules/web.dom.iterable"),i.exports=e("./modules/_core")},{"./modules/_core":25,"./modules/es6.array.copy-within":122,"./modules/es6.array.every":123,"./modules/es6.array.fill":124,"./modules/es6.array.filter":125,"./modules/es6.array.find":127,"./modules/es6.array.find-index":126,"./modules/es6.array.for-each":128,"./modules/es6.array.from":129,"./modules/es6.array.index-of":130,"./modules/es6.array.is-array":131,"./modules/es6.array.iterator":132,"./modules/es6.array.join":133,"./modules/es6.array.last-index-of":134,"./modules/es6.array.map":135,"./modules/es6.array.of":136,"./modules/es6.array.reduce":138,"./modules/es6.array.reduce-right":137,"./modules/es6.array.slice":139,"./modules/es6.array.some":140,"./modules/es6.array.sort":141,"./modules/es6.array.species":142,"./modules/es6.date.now":143,"./modules/es6.date.to-iso-string":144,"./modules/es6.date.to-json":145,"./modules/es6.date.to-primitive":146,"./modules/es6.date.to-string":147,"./modules/es6.function.bind":148,"./modules/es6.function.has-instance":149,"./modules/es6.function.name":150,"./modules/es6.map":151,"./modules/es6.math.acosh":152,"./modules/es6.math.asinh":153,"./modules/es6.math.atanh":154,"./modules/es6.math.cbrt":155,"./modules/es6.math.clz32":156,"./modules/es6.math.cosh":157,"./modules/es6.math.expm1":158,"./modules/es6.math.fround":159,"./modules/es6.math.hypot":160,"./modules/es6.math.imul":161,"./modules/es6.math.log10":162,"./modules/es6.math.log1p":163,"./modules/es6.math.log2":164,"./modules/es6.math.sign":165,"./modules/es6.math.sinh":166,"./modules/es6.math.tanh":167,"./modules/es6.math.trunc":168,"./modules/es6.number.constructor":169,"./modules/es6.number.epsilon":170,"./modules/es6.number.is-finite":171,"./modules/es6.number.is-integer":172,"./modules/es6.number.is-nan":173,"./modules/es6.number.is-safe-integer":174,"./modules/es6.number.max-safe-integer":175,"./modules/es6.number.min-safe-integer":176,"./modules/es6.number.parse-float":177,"./modules/es6.number.parse-int":178,"./modules/es6.number.to-fixed":179,"./modules/es6.number.to-precision":180,"./modules/es6.object.assign":181,"./modules/es6.object.create":182,"./modules/es6.object.define-properties":183,"./modules/es6.object.define-property":184,"./modules/es6.object.freeze":185,"./modules/es6.object.get-own-property-descriptor":186,"./modules/es6.object.get-own-property-names":187,"./modules/es6.object.get-prototype-of":188,"./modules/es6.object.is":192,"./modules/es6.object.is-extensible":189,"./modules/es6.object.is-frozen":190,"./modules/es6.object.is-sealed":191,"./modules/es6.object.keys":193,"./modules/es6.object.prevent-extensions":194,"./modules/es6.object.seal":195,"./modules/es6.object.set-prototype-of":196,"./modules/es6.object.to-string":197,"./modules/es6.parse-float":198,"./modules/es6.parse-int":199,"./modules/es6.promise":200,"./modules/es6.reflect.apply":201,"./modules/es6.reflect.construct":202,"./modules/es6.reflect.define-property":203,"./modules/es6.reflect.delete-property":204,"./modules/es6.reflect.enumerate":205,"./modules/es6.reflect.get":208,"./modules/es6.reflect.get-own-property-descriptor":206,"./modules/es6.reflect.get-prototype-of":207,"./modules/es6.reflect.has":209,"./modules/es6.reflect.is-extensible":210,"./modules/es6.reflect.own-keys":211,"./modules/es6.reflect.prevent-extensions":212,"./modules/es6.reflect.set":214,"./modules/es6.reflect.set-prototype-of":213,"./modules/es6.regexp.constructor":215,"./modules/es6.regexp.flags":216,"./modules/es6.regexp.match":217,"./modules/es6.regexp.replace":218,"./modules/es6.regexp.search":219,"./modules/es6.regexp.split":220,"./modules/es6.regexp.to-string":221,"./modules/es6.set":222,"./modules/es6.string.anchor":223,"./modules/es6.string.big":224,"./modules/es6.string.blink":225,"./modules/es6.string.bold":226,"./modules/es6.string.code-point-at":227,"./modules/es6.string.ends-with":228,"./modules/es6.string.fixed":229,"./modules/es6.string.fontcolor":230,"./modules/es6.string.fontsize":231,"./modules/es6.string.from-code-point":232,"./modules/es6.string.includes":233,"./modules/es6.string.italics":234,"./modules/es6.string.iterator":235,"./modules/es6.string.link":236,"./modules/es6.string.raw":237,"./modules/es6.string.repeat":238,"./modules/es6.string.small":239,"./modules/es6.string.starts-with":240,"./modules/es6.string.strike":241,"./modules/es6.string.sub":242,"./modules/es6.string.sup":243,"./modules/es6.string.trim":244,"./modules/es6.symbol":245,"./modules/es6.typed.array-buffer":246,"./modules/es6.typed.data-view":247,"./modules/es6.typed.float32-array":248,"./modules/es6.typed.float64-array":249,"./modules/es6.typed.int16-array":250,"./modules/es6.typed.int32-array":251,"./modules/es6.typed.int8-array":252,"./modules/es6.typed.uint16-array":253,"./modules/es6.typed.uint32-array":254,"./modules/es6.typed.uint8-array":255,"./modules/es6.typed.uint8-clamped-array":256,"./modules/es6.weak-map":257,"./modules/es6.weak-set":258,"./modules/es7.array.includes":259,"./modules/es7.asap":260,"./modules/es7.error.is-error":261,"./modules/es7.map.to-json":262,"./modules/es7.math.iaddh":263,"./modules/es7.math.imulh":264,"./modules/es7.math.isubh":265,"./modules/es7.math.umulh":266,"./modules/es7.object.define-getter":267,"./modules/es7.object.define-setter":268,"./modules/es7.object.entries":269,"./modules/es7.object.get-own-property-descriptors":270,"./modules/es7.object.lookup-getter":271,"./modules/es7.object.lookup-setter":272,"./modules/es7.object.values":273,"./modules/es7.observable":274,"./modules/es7.reflect.define-metadata":275,"./modules/es7.reflect.delete-metadata":276,"./modules/es7.reflect.get-metadata":278,"./modules/es7.reflect.get-metadata-keys":277,"./modules/es7.reflect.get-own-metadata":280,"./modules/es7.reflect.get-own-metadata-keys":279,"./modules/es7.reflect.has-metadata":281,"./modules/es7.reflect.has-own-metadata":282,"./modules/es7.reflect.metadata":283,"./modules/es7.set.to-json":284,"./modules/es7.string.at":285,"./modules/es7.string.match-all":286,"./modules/es7.string.pad-end":287,"./modules/es7.string.pad-start":288,"./modules/es7.string.trim-left":289,"./modules/es7.string.trim-right":290,"./modules/es7.symbol.async-iterator":291,"./modules/es7.symbol.observable":292,"./modules/es7.system.global":293,"./modules/web.dom.iterable":294,"./modules/web.immediate":295,"./modules/web.timers":296}],298:[function(e,i,r){(function(e){!function(e){"use strict";function r(e,i,r,n){var o=i&&i.prototype instanceof t?i:t,f=Object.create(o.prototype),a=new b(n||[]);return f._invoke=s(e,r,a),f}function n(e,i,r){try{return{type:"normal",arg:e.call(i,r)}}catch(n){return{type:"throw",arg:n}}}function t(){}function o(){}function f(){}function a(e){["next","throw","return"].forEach(function(i){e[i]=function(e){return this._invoke(i,e)}})}function u(i){function r(e,t,o,f){var a=n(i[e],i,t);if("throw"!==a.type){var u=a.arg,s=u.value;return s&&"object"==typeof s&&v.call(s,"__await")?Promise.resolve(s.__await).then(function(e){r("next",e,o,f)},function(e){r("throw",e,o,f)}):Promise.resolve(s).then(function(e){u.value=e,o(u)},f)}f(a.arg)}function t(e,i){function n(){return new Promise(function(n,t){r(e,i,n,t)})}return o=o?o.then(n,n):n()}"object"==typeof e.process&&e.process.domain&&(r=e.process.domain.bind(r));var o;this._invoke=t}function s(e,i,r){var t=O;return function(o,f){if(t===A)throw new Error("Generator is already running");if(t===x){if("throw"===o)throw f;return k()}for(r.method=o,r.arg=f;;){var a=r.delegate;if(a){var u=l(a,r);if(u){if(u===R)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(t===O)throw t=x,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);t=A;var s=n(e,i,r);if("normal"===s.type){if(t=r.done?x:C,s.arg===R)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(t=x,r.method="throw",r.arg=s.arg)}}}function l(e,i){var r=e.iterator[i.method];if(r===_){if(i.delegate=null,"throw"===i.method){if(e.iterator["return"]&&(i.method="return",i.arg=_,l(e,i),"throw"===i.method))return R;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return R}var t=n(r,e.iterator,i.arg);if("throw"===t.type)return i.method="throw",i.arg=t.arg,i.delegate=null,R;var o=t.arg;return o?o.done?(i[e.resultName]=o.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=_),i.delegate=null,R):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,R)}function c(e){var i={tryLoc:e[0]};1 in e&&(i.catchLoc=e[1]),2 in e&&(i.finallyLoc=e[2],i.afterLoc=e[3]),this.tryEntries.push(i)}function d(e){var i=e.completion||{};i.type="normal",delete i.arg,e.completion=i}function b(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(c,this),this.reset(!0)}function h(e){if(e){var i=e[m];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r=0;--n){var t=this.tryEntries[n],o=t.completion;if("root"===t.tryLoc)return i("end");if(t.tryLoc<=this.prev){var f=v.call(t,"catchLoc"),a=v.call(t,"finallyLoc");if(f&&a){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&v.call(n,"finallyLoc")&&this.prev=0;--i){var r=this.tryEntries[i];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),d(r),R}},"catch":function(e){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var t=n.arg;d(r)}return t}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,r){return this.delegate={iterator:h(e),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=_),R}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],299:[function(e,i,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function t(e){return"function"==typeof e}function o(e){return"number"==typeof e}function f(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}i.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var i,r,n,o,u,s;if(this._events||(this._events={}),"error"===e&&(!this._events.error||f(this._events.error)&&!this._events.error.length)){if(i=arguments[1],i instanceof Error)throw i;var l=new Error('Uncaught, unspecified "error" event. ('+i+")");throw l.context=i,l}if(r=this._events[e],a(r))return!1;if(t(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),r.apply(this,o)}else if(f(r))for(o=Array.prototype.slice.call(arguments,1),s=r.slice(),n=s.length,u=0;u0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,i){function r(){this.removeListener(e,r),n||(n=!0,i.apply(this,arguments))}if(!t(i))throw TypeError("listener must be a function");var n=!1;return r.listener=i,this.on(e,r),this},n.prototype.removeListener=function(e,i){var r,n,o,a;if(!t(i))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],o=r.length,n=-1,r===i||t(r.listener)&&r.listener===i)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,i);else if(f(r)){for(a=o;a-- >0;)if(r[a]===i||r[a].listener&&r[a].listener===i){n=a;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,i)}return this},n.prototype.removeAllListeners=function(e){ +var i,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(i in this._events)"removeListener"!==i&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],t(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var i;return i=this._events&&this._events[e]?t(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var i=this._events[e];if(t(i))return 1;if(i)return i.length}return 0},n.listenerCount=function(e,i){return e.listenerCount(i)}},{}],300:[function(e,i,r){function n(){throw new Error("setTimeout has not been defined")}function t(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(i){try{return c.call(null,e,0)}catch(i){return c.call(this,e,0)}}}function f(e){if(d===clearTimeout)return clearTimeout(e);if((d===t||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(i){try{return d.call(null,e)}catch(i){return d.call(this,e)}}}function a(){_&&h&&(_=!1,h.length?k=h.concat(k):p=-1,k.length&&u())}function u(){if(!_){var e=o(a);_=!0;for(var i=k.length;i;){for(h=k,k=[];++p1)for(var r=1;r0||this.inTransition)throw new i.FsmError("Previous transition pending",e)}return e},can:function(e){return Boolean(this.events[e][this.current])},cannot:function(e){return!this.can(e)},hasState:function(e){return Boolean(this.states[e])},is:function(e){return e==this.current},isFinal:function(e){return e=e||this.current,o.isArray(this["final"])?o.includes(this["final"],e):this["final"]===e},isValidEvent:function(e){if(this.cannot(e.name))throw new this.factory.FsmError("Invalid event in current state",e);return e},addEvents:function(e){o.forEach(e,function(e){this.addEvent(e)}.bind(this))},addEvent:function(e){return this.events[e.name]=this.events[e.name]||{},this.factory.isConditional(e)?this.addConditionalEvent(e):void this.addBasicEvent(e)},addBasicEvent:function(e){if(o.isArray(e.to))throw new this.factory.FsmError("Ambigous transition",e);e.from=[].concat(e.from||[]),o.forEach(e.from,function(i){this.events[e.name][i]=e.to||i}.bind(this))},addConditionalEvent:function(e){var i,r=this.factory,n=r.callbackPrefix,t=r.noChoiceFound,f=r.pseudoEvent,a=r.Promise;return o.isArray(e.from)?o.forEach(e.from,function(i){this.addConditionalEvent({name:e.name,from:i,to:e.to,condition:e.condition})}.bind(this)):(i=e.from+"__"+e.name,this.pseudoStates[i]=e.from,this.addState(i),this.addEvent({name:e.name,from:e.from,to:i}),this.addEvent({name:f(i,t),from:i,to:e.from}),this.pseudoEvents[f(i,t)]=e.name,o.forEach(e.to,function(r){this.addEvent({name:f(i,r),from:i,to:r}),this.pseudoEvents[f(i,r)]=e.name}.bind(this)),void(this.callbacks[n+"entered"+i]=function(n){var u=this.target;return o.defaults(n,{args:[]}),new a(function(i){i(e.condition(n))}).then(function(a){var s;return o.isNumber(a)?s=e.to[a]:o.includes(e.to,a)&&(s=a),o.isUndefined(s)?u[f(i,t)]().then(function(){throw new r.FsmError("Choice index out of range",e)}):u[f(i,s)].apply(u,n.args)}.bind(this))}.bind(this)))},addState:function(e){var i=this.states;e=[].concat(e||[]),e.forEach(function(e){i[e]=i[e]||{noopTransition:0}})},preprocessPseudoState:function(e,i){var r=this.responses;return Object.defineProperty(i,"res",{get:function(){return r[e]},set:function(i){r[e]=i}}),delete r[e],i},preprocessPseudoEvent:function(e,i){var r=this.pseudoEvents[e],n=this.responses,t=this.pseudoStates,o={name:r,from:t[this.current],to:i.to,args:i.args};return Object.defineProperties(o,{res:{get:function(){return n[r]},set:function(e){n[r]=e}}}),o},buildEvent:function(e){var i=this.callbacks,r=this.pseudoEvents,n=this.pseudoStates,t=this.events,f=this.factory.Type,a=this.factory.callbackPrefix;return function(){function u(e){return e.res||e}function s(e){switch(this.factory.type(e)){case f.NOOP:this.states[this.current].noopTransition+=1;break;default:this.inTransition=!0}return e}function l(e){switch(this.factory.type(e)){case f.NOOP:this.states[this.current].noopTransition-=1;break;default:this.inTransition=!1,this.current=e.to,this.emit("state",this.current)}return e}function c(e){switch(this.factory.type(_)){case f.INTER:this.inTransition=!1;break;case f.NOOP:this.states[this.current].noopTransition>0&&(this.states[this.current].noopTransition-=1)}throw e}var d,b=o.toArray(arguments),h=this.current,k=this.target,_={name:e,from:h,to:t[e][h],args:b},p=r[e];return n[_.to]&&(_=this.preprocessPseudoState(e,_)),p&&(d=this.preprocessPseudoEvent(e,_)),new this.factory.Promise(function(e){e(_)}).then(this.isValidEvent.bind(this)).then(this.canTransition.bind(this)).then(i[a+"leave"+h]?i[a+"leave"+h].bind(k,_):o.identity).then(i.onleave?i.onleave.bind(k,_):o.identity).then(s.bind(this,_)).then(i[a+e]?i[a+e].bind(k,_):o.identity).then(i[a+"enter"+t[e][h]]?i[a+"enter"+t[e][h]].bind(k,p?d:_):o.identity).then(i.onenter?i.onenter.bind(k,p?d:_):o.identity).then(l.bind(this,_)).then(i[a+"entered"+t[e][h]]?i[a+"entered"+t[e][h]].bind(k,p?d:_):o.identity).then(i.onentered?i.onentered.bind(k,p?d:_):o.identity).then(u.bind(this,_))["catch"](c.bind(this))}.bind(this)},initTarget:function(e){var i;return o.isObject(e)||(e=new f),o.isFunction(e.emit)&&(this.emit=function(){return e.emit.apply(e,arguments)}),i=o.mapValues(this.events,function(e,i){return this.buildEvent(i)}.bind(this)),o.assign(e,i,{can:this.can.bind(this),cannot:this.cannot.bind(this),is:this.is.bind(this),hasState:this.hasState.bind(this),isFinal:this.isFinal.bind(this)}),Object.defineProperty(e,"current",{get:function(){return this.current}.bind(this)}),this.target=e,e}},init:function(e,i){this.factory=i.stamp;var r=this.events;return this.events={},o.forEach(r,function(e,i){o.isString(i)&&(e.name=i),this.addEvent(e),this.addState(e.from),this.addState(e.to)}.bind(this)),this.current=this.initial,this.initTarget(i.args[1])}});u=a.compose(u),i.exports=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./fsm-error":301,"es6-promise":303,events:299,lodash:304,stampit:305}],303:[function(e,i,r){(function(n,t){!function(e,n){"object"==typeof r&&"undefined"!=typeof i?i.exports=n():"function"==typeof define&&define.amd?define(n):e.ES6Promise=n()}(this,function(){"use strict";function i(e){return"function"==typeof e||"object"==typeof e&&null!==e}function r(e){return"function"==typeof e}function o(e){K=e}function f(e){J=e}function a(){return function(){return n.nextTick(d)}}function u(){return"undefined"!=typeof X?function(){X(d)}:c()}function s(){var e=0,i=new Q(d),r=document.createTextNode("");return i.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function l(){var e=new MessageChannel;return e.port1.onmessage=d,function(){return e.port2.postMessage(0)}}function c(){var e=setTimeout;return function(){return e(d,1)}}function d(){for(var e=0;e-1}function d(e,i,r){for(var n=-1,t=null==e?0:e.length;++n-1;);return r}function N(e,i){for(var r=e.length;r--&&y(i,e[r],0)>-1;);return r}function I(e,i){for(var r=e.length,n=0;r--;)e[r]===i&&++n;return n}function B(e){return"\\"+Qr[e]}function U(e,i){return null==e?re:e[i]}function H(e){return Vr.test(e)}function z(e){return Yr.test(e)}function G(e){for(var i,r=[];!(i=e.next()).done;)r.push(i.value);return r}function V(e){var i=-1,r=Array(e.size);return e.forEach(function(e,n){r[++i]=[n,e]}),r}function Y(e,i){return function(r){return e(i(r))}}function W(e,i){for(var r=-1,n=e.length,t=0,o=[];++r>>1,Be=[["ary",ye],["bind",ke],["bindKey",_e],["curry",ve],["curryRight",we],["flip",Se],["partial",me],["partialRight",ge],["rearg",Ee]],Ue="[object Arguments]",He="[object Array]",ze="[object AsyncFunction]",Ge="[object Boolean]",Ve="[object Date]",Ye="[object DOMException]",We="[object Error]",qe="[object Function]",Xe="[object GeneratorFunction]",Ke="[object Map]",Je="[object Number]",Ze="[object Null]",$e="[object Object]",Qe="[object Promise]",ei="[object Proxy]",ii="[object RegExp]",ri="[object Set]",ni="[object String]",ti="[object Symbol]",oi="[object Undefined]",fi="[object WeakMap]",ai="[object WeakSet]",ui="[object ArrayBuffer]",si="[object DataView]",li="[object Float32Array]",ci="[object Float64Array]",di="[object Int8Array]",bi="[object Int16Array]",hi="[object Int32Array]",ki="[object Uint8Array]",_i="[object Uint8ClampedArray]",pi="[object Uint16Array]",vi="[object Uint32Array]",wi=/\b__p \+= '';/g,mi=/\b(__p \+=) '' \+/g,gi=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yi=/&(?:amp|lt|gt|quot|#39);/g,Ei=/[&<>"']/g,Si=RegExp(yi.source),Oi=RegExp(Ei.source),Ci=/<%-([\s\S]+?)%>/g,Ai=/<%([\s\S]+?)%>/g,xi=/<%=([\s\S]+?)%>/g,Ri=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fi=/^\w*$/,Mi=/^\./,Ti=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pi=/[\\^$.*+?()[\]{}|]/g,ji=RegExp(Pi.source),Li=/^\s+|\s+$/g,Di=/^\s+/,Ni=/\s+$/,Ii=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bi=/\{\n\/\* \[wrapped with (.+)\] \*/,Ui=/,? & /,Hi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zi=/\\(\\)?/g,Gi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Vi=/\w*$/,Yi=/^[-+]0x[0-9a-f]+$/i,Wi=/^0b[01]+$/i,qi=/^\[object .+?Constructor\]$/,Xi=/^0o[0-7]+$/i,Ki=/^(?:0|[1-9]\d*)$/,Ji=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zi=/($^)/,$i=/['\n\r\u2028\u2029\\]/g,Qi="\\ud800-\\udfff",er="\\u0300-\\u036f",ir="\\ufe20-\\ufe2f",rr="\\u20d0-\\u20ff",nr=er+ir+rr,tr="\\u2700-\\u27bf",or="a-z\\xdf-\\xf6\\xf8-\\xff",fr="\\xac\\xb1\\xd7\\xf7",ar="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ur="\\u2000-\\u206f",sr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lr="A-Z\\xc0-\\xd6\\xd8-\\xde",cr="\\ufe0e\\ufe0f",dr=fr+ar+ur+sr,br="['’]",hr="["+Qi+"]",kr="["+dr+"]",_r="["+nr+"]",pr="\\d+",vr="["+tr+"]",wr="["+or+"]",mr="[^"+Qi+dr+pr+tr+or+lr+"]",gr="\\ud83c[\\udffb-\\udfff]",yr="(?:"+_r+"|"+gr+")",Er="[^"+Qi+"]",Sr="(?:\\ud83c[\\udde6-\\uddff]){2}",Or="[\\ud800-\\udbff][\\udc00-\\udfff]",Cr="["+lr+"]",Ar="\\u200d",xr="(?:"+wr+"|"+mr+")",Rr="(?:"+Cr+"|"+mr+")",Fr="(?:"+br+"(?:d|ll|m|re|s|t|ve))?",Mr="(?:"+br+"(?:D|LL|M|RE|S|T|VE))?",Tr=yr+"?",Pr="["+cr+"]?",jr="(?:"+Ar+"(?:"+[Er,Sr,Or].join("|")+")"+Pr+Tr+")*",Lr="\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",Dr="\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)",Nr=Pr+Tr+jr,Ir="(?:"+[vr,Sr,Or].join("|")+")"+Nr,Br="(?:"+[Er+_r+"?",_r,Sr,Or,hr].join("|")+")",Ur=RegExp(br,"g"),Hr=RegExp(_r,"g"),zr=RegExp(gr+"(?="+gr+")|"+Br+Nr,"g"),Gr=RegExp([Cr+"?"+wr+"+"+Fr+"(?="+[kr,Cr,"$"].join("|")+")",Rr+"+"+Mr+"(?="+[kr,Cr+xr,"$"].join("|")+")",Cr+"?"+xr+"+"+Fr,Cr+"+"+Mr,Dr,Lr,pr,Ir].join("|"),"g"),Vr=RegExp("["+Ar+Qi+nr+cr+"]"),Yr=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],qr=-1,Xr={};Xr[li]=Xr[ci]=Xr[di]=Xr[bi]=Xr[hi]=Xr[ki]=Xr[_i]=Xr[pi]=Xr[vi]=!0,Xr[Ue]=Xr[He]=Xr[ui]=Xr[Ge]=Xr[si]=Xr[Ve]=Xr[We]=Xr[qe]=Xr[Ke]=Xr[Je]=Xr[$e]=Xr[ii]=Xr[ri]=Xr[ni]=Xr[fi]=!1;var Kr={};Kr[Ue]=Kr[He]=Kr[ui]=Kr[si]=Kr[Ge]=Kr[Ve]=Kr[li]=Kr[ci]=Kr[di]=Kr[bi]=Kr[hi]=Kr[Ke]=Kr[Je]=Kr[$e]=Kr[ii]=Kr[ri]=Kr[ni]=Kr[ti]=Kr[ki]=Kr[_i]=Kr[pi]=Kr[vi]=!0,Kr[We]=Kr[qe]=Kr[fi]=!1;var Jr={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Zr={"&":"&","<":"<",">":">",'"':""","'":"'"},$r={"&":"&","<":"<",">":">",""":'"',"'":"'"},Qr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},en=parseFloat,rn=parseInt,nn="object"==typeof e&&e&&e.Object===Object&&e,tn="object"==typeof self&&self&&self.Object===Object&&self,on=nn||tn||Function("return this")(),fn="object"==typeof r&&r&&!r.nodeType&&r,an=fn&&"object"==typeof i&&i&&!i.nodeType&&i,un=an&&an.exports===fn,sn=un&&nn.process,ln=function(){try{return sn&&sn.binding&&sn.binding("util")}catch(e){}}(),cn=ln&&ln.isArrayBuffer,dn=ln&&ln.isDate,bn=ln&&ln.isMap,hn=ln&&ln.isRegExp,kn=ln&&ln.isSet,_n=ln&&ln.isTypedArray,pn=C("length"),vn=A(Jr),wn=A(Zr),mn=A($r),gn=function En(e){function i(e){if(lu(e)&&!gd(e)&&!(e instanceof A)){if(e instanceof v)return e;if(gl.call(e,"__wrapped__"))return af(e)}return new v(e)}function r(){}function v(e,i){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=re}function A(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=De,this.__views__=[]}function K(){var e=new A(this.__wrapped__);return e.__actions__=Ut(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ut(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ut(this.__views__),e}function Q(){if(this.__filtered__){var e=new A(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function ee(){var e=this.__wrapped__.value(),i=this.__dir__,r=gd(e),n=i<0,t=r?e.length:0,o=Fo(0,t,this.__views__),f=o.start,a=o.end,u=a-f,s=n?a:f-1,l=this.__iteratees__,c=l.length,d=0,b=Zl(u,this.__takeCount__);if(!r||!n&&t==u&&b==u)return gt(e,this.__actions__);var h=[];e:for(;u--&&d-1}function sr(e,i){var r=this.__data__,n=Mr(r,e);return n<0?(++this.size,r.push([e,i])):r[n][1]=i,this}function lr(e){var i=-1,r=null==e?0:e.length;for(this.clear();++i=i?e:i)),e}function Ir(e,i,r,n,t,o){var f,u=i&le,s=i&ce,l=i&de;if(r&&(f=t?r(e,n,t,o):r(e)),f!==re)return f;if(!su(e))return e;var c=gd(e);if(c){if(f=Po(e),!u)return Ut(e,f)}else{var d=Mc(e),b=d==qe||d==Xe;if(Ed(e))return xt(e,u);if(d==$e||d==Ue||b&&!t){if(f=s||b?{}:jo(e),!u)return s?Gt(e,jr(f,e)):zt(e,Pr(f,e))}else{if(!Kr[d])return t?e:{};f=Lo(e,d,Ir,u)}}o||(o=new wr);var h=o.get(e);if(h)return h;o.set(e,f);var k=l?s?yo:go:s?Wu:Yu,_=c?re:k(e);return a(_||e,function(n,t){_&&(t=n,n=e[t]),Fr(f,t,Ir(n,i,r,t,e,o))}),f}function Br(e){var i=Yu(e);return function(r){return zr(r,e,i)}}function zr(e,i,r){var n=r.length;if(null==e)return!n;for(e=dl(e);n--;){var t=r[n],o=i[t],f=e[t];if(f===re&&!(t in e)||!o(f))return!1}return!0}function Gr(e,i,r){if("function"!=typeof e)throw new kl(fe);return jc(function(){e.apply(re,r)},i)}function Vr(e,i,r,n){var t=-1,o=c,f=!0,a=e.length,u=[],s=i.length;if(!a)return u;r&&(i=b(i,P(r))),n?(o=d,f=!1):i.length>=te&&(o=L,f=!1,i=new _r(i));e:for(;++tt?0:t+r),n=n===re||n>t?t:Au(n),n<0&&(n+=t),n=r>n?0:xu(n);r0&&r(a)?i>1?Qr(a,i-1,r,n,t):h(t,a):n||(t[t.length]=a)}return t}function nn(e,i){return e&&gc(e,i,Yu)}function tn(e,i){return e&&yc(e,i,Yu)}function fn(e,i){return l(i,function(i){return fu(e[i])})}function an(e,i){i=Ct(i,e);for(var r=0,n=i.length;null!=e&&ri}function gn(e,i){return null!=e&&gl.call(e,i)}function Sn(e,i){return null!=e&&i in dl(e)}function On(e,i,r){ +return e>=Zl(i,r)&&e=120&&l.length>=120)?new _r(f&&l):re}l=e[0];var h=-1,k=a[0];e:for(;++h-1;)a!==e&&Ll.call(a,u,1),Ll.call(e,u,1);return e}function it(e,i){for(var r=e?i.length:0,n=r-1;r--;){var t=i[r];if(r==n||t!==o){var o=t;Io(t)?Ll.call(e,t,1):vt(e,t)}}return e}function rt(e,i){return e+Vl(ec()*(i-e+1))}function nt(e,i,r,n){for(var t=-1,o=Jl(Gl((i-e)/(r||1)),0),f=al(o);o--;)f[n?o:++t]=e,e+=r;return f}function tt(e,i){var r="";if(!e||i<1||i>Pe)return r;do i%2&&(r+=e),i=Vl(i/2),i&&(e+=e);while(i);return r}function ot(e,i){return Lc(Zo(e,i,Ls),e+"")}function ft(e){return Cr(ts(e))}function at(e,i){var r=ts(e);return nf(r,Nr(i,0,r.length))}function ut(e,i,r,n){if(!su(e))return e;i=Ct(i,e);for(var t=-1,o=i.length,f=o-1,a=e;null!=a&&++tt?0:t+i),r=r>t?t:r,r<0&&(r+=t),t=i>r?0:r-i>>>0,i>>>=0;for(var o=al(t);++n>>1,f=e[o];null!==f&&!gu(f)&&(r?f<=i:f=te){var s=i?null:Ac(e);if(s)return q(s);f=!1,t=L,u=new _r}else u=i?[]:a;e:for(;++n=n?e:lt(e,i,r)}function xt(e,i){if(i)return e.slice();var r=e.length,n=Ml?Ml(r):new e.constructor(r);return e.copy(n),n}function Rt(e){var i=new e.constructor(e.byteLength);return new Fl(i).set(new Fl(e)),i}function Ft(e,i){var r=i?Rt(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Mt(e,i,r){var t=i?r(V(e),le):V(e);return k(t,n,new e.constructor)}function Tt(e){var i=new e.constructor(e.source,Vi.exec(e));return i.lastIndex=e.lastIndex,i}function Pt(e,i,r){var n=i?r(q(e),le):q(e);return k(n,t,new e.constructor)}function jt(e){return _c?dl(_c.call(e)):{}}function Lt(e,i){var r=i?Rt(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Dt(e,i){if(e!==i){var r=e!==re,n=null===e,t=e===e,o=gu(e),f=i!==re,a=null===i,u=i===i,s=gu(i);if(!a&&!s&&!o&&e>i||o&&f&&u&&!a&&!s||n&&f&&u||!r&&u||!t)return 1;if(!n&&!o&&!s&&e=a)return u;var s=r[n];return u*("desc"==s?-1:1)}}return e.index-i.index}function It(e,i,r,n){for(var t=-1,o=e.length,f=r.length,a=-1,u=i.length,s=Jl(o-f,0),l=al(u+s),c=!n;++a1?r[t-1]:re,f=t>2?r[2]:re;for(o=e.length>3&&"function"==typeof o?(t--,o):re,f&&Bo(r[0],r[1],f)&&(o=t<3?re:o,t=1),i=dl(i);++n-1?t[o?i[f]:f]:re}}function eo(e){return mo(function(i){var r=i.length,n=r,t=v.prototype.thru;for(e&&i.reverse();n--;){var o=i[n];if("function"!=typeof o)throw new kl(fe);if(t&&!f&&"wrapper"==Eo(o))var f=new v([],(!0))}for(n=f?n:r;++n1&&v.reverse(),c&&ua))return!1;var s=o.get(e);if(s&&o.get(i))return s==i;var l=-1,c=!0,d=r&he?new _r:re;for(o.set(e,i),o.set(i,e);++l1?"& ":"")+i[n],i=i.join(r>2?", ":" "),e.replace(Ii,"{\n/* [wrapped with "+i+"] */\n")}function No(e){return gd(e)||md(e)||!!(Dl&&e&&e[Dl])}function Io(e,i){return i=null==i?Pe:i,!!i&&("number"==typeof e||Ki.test(e))&&e>-1&&e%1==0&&e0){if(++i>=Ae)return arguments[0]}else i=0;return e.apply(re,arguments)}}function nf(e,i){var r=-1,n=e.length,t=n-1;for(i=i===re?n:i;++r=this.__values__.length,i=e?re:this.__values__[this.__index__++];return{done:e,value:i}}function aa(){return this}function ua(e){for(var i,n=this;n instanceof r;){var t=af(n);t.__index__=0,t.__values__=re,i?o.__wrapped__=t:i=t;var o=t;n=n.__wrapped__}return o.__wrapped__=e,i}function sa(){var e=this.__wrapped__;if(e instanceof A){var i=e;return this.__actions__.length&&(i=new A(this)),i=i.reverse(),i.__actions__.push({func:na,args:[Pf],thisArg:re}),new v(i,this.__chain__)}return this.thru(Pf)}function la(){return gt(this.__wrapped__,this.__actions__)}function ca(e,i,r){var n=gd(e)?s:Yr;return r&&Bo(e,i,r)&&(i=re),n(e,Oo(i,3))}function da(e,i){var r=gd(e)?l:$r;return r(e,Oo(i,3))}function ba(e,i){return Qr(wa(e,i),1)}function ha(e,i){return Qr(wa(e,i),Te)}function ka(e,i,r){return r=r===re?1:Au(r),Qr(wa(e,i),r)}function _a(e,i){var r=gd(e)?a:wc;return r(e,Oo(i,3))}function pa(e,i){var r=gd(e)?u:mc;return r(e,Oo(i,3))}function va(e,i,r,n){e=Za(e)?e:ts(e),r=r&&!n?Au(r):0;var t=e.length;return r<0&&(r=Jl(t+r,0)),mu(e)?r<=t&&e.indexOf(i,r)>-1:!!t&&y(e,i,r)>-1}function wa(e,i){var r=gd(e)?b:Vn;return r(e,Oo(i,3))}function ma(e,i,r,n){return null==e?[]:(gd(i)||(i=null==i?[]:[i]),r=n?re:r,gd(r)||(r=null==r?[]:[r]),Jn(e,i,r))}function ga(e,i,r){var n=gd(e)?k:x,t=arguments.length<3;return n(e,Oo(i,4),r,t,wc)}function ya(e,i,r){var n=gd(e)?_:x,t=arguments.length<3;return n(e,Oo(i,4),r,t,mc)}function Ea(e,i){var r=gd(e)?l:$r;return r(e,Na(Oo(i,3)))}function Sa(e){var i=gd(e)?Cr:ft;return i(e)}function Oa(e,i,r){i=(r?Bo(e,i,r):i===re)?1:Au(i);var n=gd(e)?Ar:at;return n(e,i)}function Ca(e){var i=gd(e)?xr:st;return i(e)}function Aa(e){if(null==e)return 0;if(Za(e))return mu(e)?Z(e):e.length;var i=Mc(e);return i==Ke||i==ri?e.size:Hn(e).length}function xa(e,i,r){var n=gd(e)?p:ct;return r&&Bo(e,i,r)&&(i=re),n(e,Oo(i,3))}function Ra(e,i){if("function"!=typeof i)throw new kl(fe);return e=Au(e),function(){if(--e<1)return i.apply(this,arguments)}}function Fa(e,i,r){return i=r?re:i,i=e&&null==i?e.length:i,bo(e,ye,re,re,re,re,i)}function Ma(e,i){var r;if("function"!=typeof i)throw new kl(fe);return e=Au(e),function(){return--e>0&&(r=i.apply(this,arguments)),e<=1&&(i=re),r}}function Ta(e,i,r){i=r?re:i;var n=bo(e,ve,re,re,re,re,re,i);return n.placeholder=Ta.placeholder,n}function Pa(e,i,r){i=r?re:i;var n=bo(e,we,re,re,re,re,re,i);return n.placeholder=Pa.placeholder,n}function ja(e,i,r){function n(i){var r=d,n=b;return d=b=re,v=i,k=e.apply(n,r)}function t(e){return v=e,_=jc(a,i),w?n(e):k}function o(e){var r=e-p,n=e-v,t=i-r;return m?Zl(t,h-n):t}function f(e){var r=e-p,n=e-v;return p===re||r>=i||r<0||m&&n>=h}function a(){var e=sd();return f(e)?u(e):void(_=jc(a,o(e)))}function u(e){return _=re,g&&d?n(e):(d=b=re,k)}function s(){_!==re&&Cc(_),v=0,d=p=b=_=re}function l(){return _===re?k:u(sd())}function c(){var e=sd(),r=f(e);if(d=arguments,b=this,p=e,r){if(_===re)return t(p);if(m)return _=jc(a,i),n(p)}return _===re&&(_=jc(a,i)),k}var d,b,h,k,_,p,v=0,w=!1,m=!1,g=!0;if("function"!=typeof e)throw new kl(fe);return i=Ru(i)||0,su(r)&&(w=!!r.leading,m="maxWait"in r,h=m?Jl(Ru(r.maxWait)||0,i):h,g="trailing"in r?!!r.trailing:g),c.cancel=s,c.flush=l,c}function La(e){return bo(e,Se)}function Da(e,i){if("function"!=typeof e||null!=i&&"function"!=typeof i)throw new kl(fe);var r=function(){var n=arguments,t=i?i.apply(this,n):n[0],o=r.cache;if(o.has(t))return o.get(t);var f=e.apply(this,n);return r.cache=o.set(t,f)||o,f};return r.cache=new(Da.Cache||lr),r}function Na(e){if("function"!=typeof e)throw new kl(fe);return function(){var i=arguments;switch(i.length){case 0:return!e.call(this);case 1:return!e.call(this,i[0]);case 2:return!e.call(this,i[0],i[1]);case 3:return!e.call(this,i[0],i[1],i[2])}return!e.apply(this,i)}}function Ia(e){return Ma(2,e)}function Ba(e,i){if("function"!=typeof e)throw new kl(fe);return i=i===re?i:Au(i),ot(e,i)}function Ua(e,i){if("function"!=typeof e)throw new kl(fe);return i=null==i?0:Jl(Au(i),0),ot(function(r){var n=r[i],t=At(r,0,i);return n&&h(t,n),o(e,this,t)})}function Ha(e,i,r){var n=!0,t=!0;if("function"!=typeof e)throw new kl(fe);return su(r)&&(n="leading"in r?!!r.leading:n,t="trailing"in r?!!r.trailing:t),ja(e,i,{leading:n,maxWait:i,trailing:t})}function za(e){return Fa(e,1)}function Ga(e,i){return kd(Ot(i),e)}function Va(){if(!arguments.length)return[];var e=arguments[0];return gd(e)?e:[e]}function Ya(e){return Ir(e,de)}function Wa(e,i){return i="function"==typeof i?i:re,Ir(e,de,i)}function qa(e){return Ir(e,le|de)}function Xa(e,i){return i="function"==typeof i?i:re,Ir(e,le|de,i)}function Ka(e,i){return null==i||zr(e,i,Yu(i))}function Ja(e,i){return e===i||e!==e&&i!==i}function Za(e){return null!=e&&uu(e.length)&&!fu(e)}function $a(e){return lu(e)&&Za(e)}function Qa(e){return e===!0||e===!1||lu(e)&&ln(e)==Ge}function eu(e){return lu(e)&&1===e.nodeType&&!vu(e)}function iu(e){if(null==e)return!0;if(Za(e)&&(gd(e)||"string"==typeof e||"function"==typeof e.splice||Ed(e)||xd(e)||md(e)))return!e.length;var i=Mc(e);if(i==Ke||i==ri)return!e.size;if(Vo(e))return!Hn(e).length;for(var r in e)if(gl.call(e,r))return!1;return!0}function ru(e,i){return Tn(e,i)}function nu(e,i,r){r="function"==typeof r?r:re;var n=r?r(e,i):re;return n===re?Tn(e,i,re,r):!!n}function tu(e){if(!lu(e))return!1;var i=ln(e);return i==We||i==Ye||"string"==typeof e.message&&"string"==typeof e.name&&!vu(e)}function ou(e){return"number"==typeof e&&ql(e)}function fu(e){if(!su(e))return!1;var i=ln(e);return i==qe||i==Xe||i==ze||i==ei}function au(e){return"number"==typeof e&&e==Au(e)}function uu(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Pe}function su(e){var i=typeof e;return null!=e&&("object"==i||"function"==i)}function lu(e){return null!=e&&"object"==typeof e}function cu(e,i){return e===i||Ln(e,i,Ao(i))}function du(e,i,r){return r="function"==typeof r?r:re,Ln(e,i,Ao(i),r)}function bu(e){return pu(e)&&e!=+e}function hu(e){if(Tc(e))throw new sl(oe);return Dn(e)}function ku(e){return null===e}function _u(e){return null==e}function pu(e){return"number"==typeof e||lu(e)&&ln(e)==Je}function vu(e){if(!lu(e)||ln(e)!=$e)return!1;var i=Tl(e);if(null===i)return!0;var r=gl.call(i,"constructor")&&i.constructor;return"function"==typeof r&&r instanceof r&&ml.call(r)==Ol}function wu(e){return au(e)&&e>=-Pe&&e<=Pe}function mu(e){return"string"==typeof e||!gd(e)&&lu(e)&&ln(e)==ni}function gu(e){return"symbol"==typeof e||lu(e)&&ln(e)==ti}function yu(e){return e===re}function Eu(e){return lu(e)&&Mc(e)==fi}function Su(e){return lu(e)&&ln(e)==ai}function Ou(e){if(!e)return[];if(Za(e))return mu(e)?$(e):Ut(e);if(Nl&&e[Nl])return G(e[Nl]());var i=Mc(e),r=i==Ke?V:i==ri?q:ts;return r(e)}function Cu(e){if(!e)return 0===e?e:0;if(e=Ru(e),e===Te||e===-Te){var i=e<0?-1:1;return i*je}return e===e?e:0}function Au(e){var i=Cu(e),r=i%1;return i===i?r?i-r:i:0}function xu(e){return e?Nr(Au(e),0,De):0}function Ru(e){if("number"==typeof e)return e;if(gu(e))return Le;if(su(e)){var i="function"==typeof e.valueOf?e.valueOf():e;e=su(i)?i+"":i}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Li,"");var r=Wi.test(e);return r||Xi.test(e)?rn(e.slice(2),r?2:8):Yi.test(e)?Le:+e}function Fu(e){return Ht(e,Wu(e))}function Mu(e){return e?Nr(Au(e),-Pe,Pe):0===e?e:0}function Tu(e){return null==e?"":_t(e)}function Pu(e,i){var r=vc(e);return null==i?r:Pr(r,i)}function ju(e,i){return m(e,Oo(i,3),nn)}function Lu(e,i){return m(e,Oo(i,3),tn)}function Du(e,i){return null==e?e:gc(e,Oo(i,3),Wu)}function Nu(e,i){return null==e?e:yc(e,Oo(i,3),Wu)}function Iu(e,i){return e&&nn(e,Oo(i,3))}function Bu(e,i){return e&&tn(e,Oo(i,3))}function Uu(e){return null==e?[]:fn(e,Yu(e))}function Hu(e){return null==e?[]:fn(e,Wu(e))}function zu(e,i,r){var n=null==e?re:an(e,i);return n===re?r:n}function Gu(e,i){return null!=e&&To(e,i,gn)}function Vu(e,i){return null!=e&&To(e,i,Sn)}function Yu(e){return Za(e)?Or(e):Hn(e)}function Wu(e){return Za(e)?Or(e,!0):zn(e)}function qu(e,i){ +var r={};return i=Oo(i,3),nn(e,function(e,n,t){Lr(r,i(e,n,t),e)}),r}function Xu(e,i){var r={};return i=Oo(i,3),nn(e,function(e,n,t){Lr(r,n,i(e,n,t))}),r}function Ku(e,i){return Ju(e,Na(Oo(i)))}function Ju(e,i){if(null==e)return{};var r=b(yo(e),function(e){return[e]});return i=Oo(i),$n(e,r,function(e,r){return i(e,r[0])})}function Zu(e,i,r){i=Ct(i,e);var n=-1,t=i.length;for(t||(t=1,e=re);++ni){var n=e;e=i,i=n}if(r||e%1||i%1){var t=ec();return Zl(e+t*(i-e+en("1e-"+((t+"").length-1))),i)}return rt(e,i)}function ss(e){return eb(Tu(e).toLowerCase())}function ls(e){return e=Tu(e),e&&e.replace(Ji,vn).replace(Hr,"")}function cs(e,i,r){e=Tu(e),i=_t(i);var n=e.length;r=r===re?n:Nr(Au(r),0,n);var t=r;return r-=i.length,r>=0&&e.slice(r,t)==i}function ds(e){return e=Tu(e),e&&Oi.test(e)?e.replace(Ei,wn):e}function bs(e){return e=Tu(e),e&&ji.test(e)?e.replace(Pi,"\\$&"):e}function hs(e,i,r){e=Tu(e),i=Au(i);var n=i?Z(e):0;if(!i||n>=i)return e;var t=(i-n)/2;return oo(Vl(t),r)+e+oo(Gl(t),r)}function ks(e,i,r){e=Tu(e),i=Au(i);var n=i?Z(e):0;return i&&n>>0)?(e=Tu(e),e&&("string"==typeof i||null!=i&&!Cd(i))&&(i=_t(i),!i&&H(e))?At($(e),0,r):e.split(i,r)):[]}function gs(e,i,r){return e=Tu(e),r=null==r?0:Nr(Au(r),0,e.length),i=_t(i),e.slice(r,r+i.length)==i}function ys(e,r,n){var t=i.templateSettings;n&&Bo(e,r,n)&&(r=re),e=Tu(e),r=Pd({},r,t,ho);var o,f,a=Pd({},r.imports,t.imports,ho),u=Yu(a),s=j(a,u),l=0,c=r.interpolate||Zi,d="__p += '",b=bl((r.escape||Zi).source+"|"+c.source+"|"+(c===xi?Gi:Zi).source+"|"+(r.evaluate||Zi).source+"|$","g"),h="//# sourceURL="+("sourceURL"in r?r.sourceURL:"lodash.templateSources["+ ++qr+"]")+"\n";e.replace(b,function(i,r,n,t,a,u){return n||(n=t),d+=e.slice(l,u).replace($i,B),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),a&&(f=!0,d+="';\n"+a+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=u+i.length,i}),d+="';\n";var k=r.variable;k||(d="with (obj) {\n"+d+"\n}\n"),d=(f?d.replace(wi,""):d).replace(mi,"$1").replace(gi,"$1;"),d="function("+(k||"obj")+") {\n"+(k?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(f?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var _=ib(function(){return ll(u,h+"return "+d).apply(re,s)});if(_.source=d,tu(_))throw _;return _}function Es(e){return Tu(e).toLowerCase()}function Ss(e){return Tu(e).toUpperCase()}function Os(e,i,r){if(e=Tu(e),e&&(r||i===re))return e.replace(Li,"");if(!e||!(i=_t(i)))return e;var n=$(e),t=$(i),o=D(n,t),f=N(n,t)+1;return At(n,o,f).join("")}function Cs(e,i,r){if(e=Tu(e),e&&(r||i===re))return e.replace(Ni,"");if(!e||!(i=_t(i)))return e;var n=$(e),t=N(n,$(i))+1;return At(n,0,t).join("")}function As(e,i,r){if(e=Tu(e),e&&(r||i===re))return e.replace(Di,"");if(!e||!(i=_t(i)))return e;var n=$(e),t=D(n,$(i));return At(n,t).join("")}function xs(e,i){var r=Oe,n=Ce;if(su(i)){var t="separator"in i?i.separator:t;r="length"in i?Au(i.length):r,n="omission"in i?_t(i.omission):n}e=Tu(e);var o=e.length;if(H(e)){var f=$(e);o=f.length}if(r>=o)return e;var a=r-Z(n);if(a<1)return n;var u=f?At(f,0,a).join(""):e.slice(0,a);if(t===re)return u+n;if(f&&(a+=u.length-a),Cd(t)){if(e.slice(a).search(t)){var s,l=u;for(t.global||(t=bl(t.source,Tu(Vi.exec(t))+"g")),t.lastIndex=0;s=t.exec(l);)var c=s.index;u=u.slice(0,c===re?a:c)}}else if(e.indexOf(_t(t),a)!=a){var d=u.lastIndexOf(t);d>-1&&(u=u.slice(0,d))}return u+n}function Rs(e){return e=Tu(e),e&&Si.test(e)?e.replace(yi,mn):e}function Fs(e,i,r){return e=Tu(e),i=r?re:i,i===re?z(e)?ie(e):w(e):e.match(i)||[]}function Ms(e){var i=null==e?0:e.length,r=Oo();return e=i?b(e,function(e){if("function"!=typeof e[1])throw new kl(fe);return[r(e[0]),e[1]]}):[],ot(function(r){for(var n=-1;++nPe)return[];var r=De,n=Zl(e,De);i=Oo(i),e-=De;for(var t=M(n,i);++r1?e[i-1]:re;return r="function"==typeof r?(e.pop(),r):re,$f(e,r)}),ed=mo(function(e){var i=e.length,r=i?e[0]:0,n=this.__wrapped__,t=function(i){return Dr(i,e)};return!(i>1||this.__actions__.length)&&n instanceof A&&Io(r)?(n=n.slice(r,+r+(i?1:0)),n.__actions__.push({func:na,args:[t],thisArg:re}),new v(n,this.__chain__).thru(function(e){return i&&!e.length&&e.push(re),e})):this.thru(t)}),id=Vt(function(e,i,r){gl.call(e,r)?++e[r]:Lr(e,r,1)}),rd=Qt(_f),nd=Qt(pf),td=Vt(function(e,i,r){gl.call(e,r)?e[r].push(i):Lr(e,r,[i])}),od=ot(function(e,i,r){var n=-1,t="function"==typeof i,f=Za(e)?al(e.length):[];return wc(e,function(e){f[++n]=t?o(i,e,r):xn(e,i,r)}),f}),fd=Vt(function(e,i,r){Lr(e,r,i)}),ad=Vt(function(e,i,r){e[r?0:1].push(i)},function(){return[[],[]]}),ud=ot(function(e,i){if(null==e)return[];var r=i.length;return r>1&&Bo(e,i[0],i[1])?i=[]:r>2&&Bo(i[0],i[1],i[2])&&(i=[i[0]]),Jn(e,Qr(i,1),[])}),sd=Hl||function(){return on.Date.now()},ld=ot(function(e,i,r){var n=ke;if(r.length){var t=W(r,So(ld));n|=me}return bo(e,n,i,r,t)}),cd=ot(function(e,i,r){var n=ke|_e;if(r.length){var t=W(r,So(cd));n|=me}return bo(i,n,e,r,t)}),dd=ot(function(e,i){return Gr(e,1,i)}),bd=ot(function(e,i,r){return Gr(e,Ru(i)||0,r)});Da.Cache=lr;var hd=Oc(function(e,i){i=1==i.length&&gd(i[0])?b(i[0],P(Oo())):b(Qr(i,1),P(Oo()));var r=i.length;return ot(function(n){for(var t=-1,f=Zl(n.length,r);++t=i}),md=Rn(function(){return arguments}())?Rn:function(e){return lu(e)&&gl.call(e,"callee")&&!jl.call(e,"callee")},gd=al.isArray,yd=cn?P(cn):Fn,Ed=Wl||Ws,Sd=dn?P(dn):Mn,Od=bn?P(bn):jn,Cd=hn?P(hn):Nn,Ad=kn?P(kn):In,xd=_n?P(_n):Bn,Rd=uo(Gn),Fd=uo(function(e,i){return e<=i}),Md=Yt(function(e,i){if(Vo(i)||Za(i))return void Ht(i,Yu(i),e);for(var r in i)gl.call(i,r)&&Fr(e,r,i[r])}),Td=Yt(function(e,i){Ht(i,Wu(i),e)}),Pd=Yt(function(e,i,r,n){Ht(i,Wu(i),e,n)}),jd=Yt(function(e,i,r,n){Ht(i,Yu(i),e,n)}),Ld=mo(Dr),Dd=ot(function(e){return e.push(re,ho),o(Pd,re,e)}),Nd=ot(function(e){return e.push(re,ko),o(zd,re,e)}),Id=ro(function(e,i,r){e[i]=r},Ps(Ls)),Bd=ro(function(e,i,r){gl.call(e,i)?e[i].push(r):e[i]=[r]},Oo),Ud=ot(xn),Hd=Yt(function(e,i,r){qn(e,i,r)}),zd=Yt(function(e,i,r,n){qn(e,i,r,n)}),Gd=mo(function(e,i){var r={};if(null==e)return r;var n=!1;i=b(i,function(i){return i=Ct(i,e),n||(n=i.length>1),i}),Ht(e,yo(e),r),n&&(r=Ir(r,le|ce|de,_o));for(var t=i.length;t--;)vt(r,i[t]);return r}),Vd=mo(function(e,i){return null==e?{}:Zn(e,i)}),Yd=co(Yu),Wd=co(Wu),qd=Jt(function(e,i,r){return i=i.toLowerCase(),e+(r?ss(i):i)}),Xd=Jt(function(e,i,r){return e+(r?"-":"")+i.toLowerCase()}),Kd=Jt(function(e,i,r){return e+(r?" ":"")+i.toLowerCase()}),Jd=Kt("toLowerCase"),Zd=Jt(function(e,i,r){return e+(r?"_":"")+i.toLowerCase()}),$d=Jt(function(e,i,r){return e+(r?" ":"")+eb(i)}),Qd=Jt(function(e,i,r){return e+(r?" ":"")+i.toUpperCase()}),eb=Kt("toUpperCase"),ib=ot(function(e,i){try{return o(e,re,i)}catch(r){return tu(r)?r:new sl(r)}}),rb=mo(function(e,i){return a(i,function(i){i=tf(i),Lr(e,i,ld(e[i],e))}),e}),nb=eo(),tb=eo(!0),ob=ot(function(e,i){return function(r){return xn(r,e,i)}}),fb=ot(function(e,i){return function(r){return xn(e,r,i)}}),ab=to(b),ub=to(s),sb=to(p),lb=ao(),cb=ao(!0),db=no(function(e,i){return e+i},0),bb=lo("ceil"),hb=no(function(e,i){return e/i},1),kb=lo("floor"),_b=no(function(e,i){return e*i},1),pb=lo("round"),vb=no(function(e,i){return e-i},0);return i.after=Ra,i.ary=Fa,i.assign=Md,i.assignIn=Td,i.assignInWith=Pd,i.assignWith=jd,i.at=Ld,i.before=Ma,i.bind=ld,i.bindAll=rb,i.bindKey=cd,i.castArray=Va,i.chain=ia,i.chunk=uf,i.compact=sf,i.concat=lf,i.cond=Ms,i.conforms=Ts,i.constant=Ps,i.countBy=id,i.create=Pu,i.curry=Ta,i.curryRight=Pa,i.debounce=ja,i.defaults=Dd,i.defaultsDeep=Nd,i.defer=dd,i.delay=bd,i.difference=Nc,i.differenceBy=Ic,i.differenceWith=Bc,i.drop=cf,i.dropRight=df,i.dropRightWhile=bf,i.dropWhile=hf,i.fill=kf,i.filter=da,i.flatMap=ba,i.flatMapDeep=ha,i.flatMapDepth=ka,i.flatten=vf,i.flattenDeep=wf,i.flattenDepth=mf,i.flip=La,i.flow=nb,i.flowRight=tb,i.fromPairs=gf,i.functions=Uu,i.functionsIn=Hu,i.groupBy=td,i.initial=Sf,i.intersection=Uc,i.intersectionBy=Hc,i.intersectionWith=zc,i.invert=Id,i.invertBy=Bd,i.invokeMap=od,i.iteratee=Ds,i.keyBy=fd,i.keys=Yu,i.keysIn=Wu,i.map=wa,i.mapKeys=qu,i.mapValues=Xu,i.matches=Ns,i.matchesProperty=Is,i.memoize=Da,i.merge=Hd,i.mergeWith=zd,i.method=ob,i.methodOf=fb,i.mixin=Bs,i.negate=Na,i.nthArg=zs,i.omit=Gd,i.omitBy=Ku,i.once=Ia,i.orderBy=ma,i.over=ab,i.overArgs=hd,i.overEvery=ub,i.overSome=sb,i.partial=kd,i.partialRight=_d,i.partition=ad,i.pick=Vd,i.pickBy=Ju,i.property=Gs,i.propertyOf=Vs,i.pull=Gc,i.pullAll=Rf,i.pullAllBy=Ff,i.pullAllWith=Mf,i.pullAt=Vc,i.range=lb,i.rangeRight=cb,i.rearg=pd,i.reject=Ea,i.remove=Tf,i.rest=Ba,i.reverse=Pf,i.sampleSize=Oa,i.set=$u,i.setWith=Qu,i.shuffle=Ca,i.slice=jf,i.sortBy=ud,i.sortedUniq=Hf,i.sortedUniqBy=zf,i.split=ms,i.spread=Ua,i.tail=Gf,i.take=Vf,i.takeRight=Yf,i.takeRightWhile=Wf,i.takeWhile=qf,i.tap=ra,i.throttle=Ha,i.thru=na,i.toArray=Ou,i.toPairs=Yd,i.toPairsIn=Wd,i.toPath=Zs,i.toPlainObject=Fu,i.transform=es,i.unary=za,i.union=Yc,i.unionBy=Wc,i.unionWith=qc,i.uniq=Xf,i.uniqBy=Kf,i.uniqWith=Jf,i.unset=is,i.unzip=Zf,i.unzipWith=$f,i.update=rs,i.updateWith=ns,i.values=ts,i.valuesIn=os,i.without=Xc,i.words=Fs,i.wrap=Ga,i.xor=Kc,i.xorBy=Jc,i.xorWith=Zc,i.zip=$c,i.zipObject=Qf,i.zipObjectDeep=ea,i.zipWith=Qc,i.entries=Yd,i.entriesIn=Wd,i.extend=Td,i.extendWith=Pd,Bs(i,i),i.add=db,i.attempt=ib,i.camelCase=qd,i.capitalize=ss,i.ceil=bb,i.clamp=fs,i.clone=Ya,i.cloneDeep=qa,i.cloneDeepWith=Xa,i.cloneWith=Wa,i.conformsTo=Ka,i.deburr=ls,i.defaultTo=js,i.divide=hb,i.endsWith=cs,i.eq=Ja,i.escape=ds,i.escapeRegExp=bs,i.every=ca,i.find=rd,i.findIndex=_f,i.findKey=ju,i.findLast=nd,i.findLastIndex=pf,i.findLastKey=Lu,i.floor=kb,i.forEach=_a,i.forEachRight=pa,i.forIn=Du,i.forInRight=Nu,i.forOwn=Iu,i.forOwnRight=Bu,i.get=zu,i.gt=vd,i.gte=wd,i.has=Gu,i.hasIn=Vu,i.head=yf,i.identity=Ls,i.includes=va,i.indexOf=Ef,i.inRange=as,i.invoke=Ud,i.isArguments=md,i.isArray=gd,i.isArrayBuffer=yd,i.isArrayLike=Za,i.isArrayLikeObject=$a,i.isBoolean=Qa,i.isBuffer=Ed,i.isDate=Sd,i.isElement=eu,i.isEmpty=iu,i.isEqual=ru,i.isEqualWith=nu,i.isError=tu,i.isFinite=ou,i.isFunction=fu,i.isInteger=au,i.isLength=uu,i.isMap=Od,i.isMatch=cu,i.isMatchWith=du,i.isNaN=bu,i.isNative=hu,i.isNil=_u,i.isNull=ku,i.isNumber=pu,i.isObject=su,i.isObjectLike=lu,i.isPlainObject=vu,i.isRegExp=Cd,i.isSafeInteger=wu,i.isSet=Ad,i.isString=mu,i.isSymbol=gu,i.isTypedArray=xd,i.isUndefined=yu,i.isWeakMap=Eu,i.isWeakSet=Su,i.join=Of,i.kebabCase=Xd,i.last=Cf,i.lastIndexOf=Af,i.lowerCase=Kd,i.lowerFirst=Jd,i.lt=Rd,i.lte=Fd,i.max=Qs,i.maxBy=el,i.mean=il,i.meanBy=rl,i.min=nl,i.minBy=tl,i.stubArray=Ys,i.stubFalse=Ws,i.stubObject=qs,i.stubString=Xs,i.stubTrue=Ks,i.multiply=_b,i.nth=xf,i.noConflict=Us,i.noop=Hs,i.now=sd,i.pad=hs,i.padEnd=ks,i.padStart=_s,i.parseInt=ps,i.random=us,i.reduce=ga,i.reduceRight=ya,i.repeat=vs,i.replace=ws,i.result=Zu,i.round=pb,i.runInContext=En,i.sample=Sa,i.size=Aa,i.snakeCase=Zd,i.some=xa,i.sortedIndex=Lf,i.sortedIndexBy=Df,i.sortedIndexOf=Nf,i.sortedLastIndex=If,i.sortedLastIndexBy=Bf,i.sortedLastIndexOf=Uf,i.startCase=$d,i.startsWith=gs,i.subtract=vb,i.sum=ol,i.sumBy=fl,i.template=ys,i.times=Js,i.toFinite=Cu,i.toInteger=Au,i.toLength=xu,i.toLower=Es,i.toNumber=Ru,i.toSafeInteger=Mu,i.toString=Tu,i.toUpper=Ss,i.trim=Os,i.trimEnd=Cs,i.trimStart=As,i.truncate=xs,i.unescape=Rs,i.uniqueId=$s,i.upperCase=Qd,i.upperFirst=eb,i.each=_a,i.eachRight=pa,i.first=yf,Bs(i,function(){var e={};return nn(i,function(r,n){gl.call(i.prototype,n)||(e[n]=r)}),e}(),{chain:!1}),i.VERSION=ne,a(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){i[e].placeholder=i}),a(["drop","take"],function(e,i){A.prototype[e]=function(r){r=r===re?1:Jl(Au(r),0);var n=this.__filtered__&&!i?new A(this):this.clone();return n.__filtered__?n.__takeCount__=Zl(r,n.__takeCount__):n.__views__.push({size:Zl(r,De),type:e+(n.__dir__<0?"Right":"")}),n},A.prototype[e+"Right"]=function(i){return this.reverse()[e](i).reverse()}}),a(["filter","map","takeWhile"],function(e,i){var r=i+1,n=r==Re||r==Me;A.prototype[e]=function(e){var i=this.clone();return i.__iteratees__.push({iteratee:Oo(e,3),type:r}),i.__filtered__=i.__filtered__||n,i}}),a(["head","last"],function(e,i){var r="take"+(i?"Right":"");A.prototype[e]=function(){return this[r](1).value()[0]}}),a(["initial","tail"],function(e,i){var r="drop"+(i?"":"Right");A.prototype[e]=function(){return this.__filtered__?new A(this):this[r](1)}}),A.prototype.compact=function(){return this.filter(Ls)},A.prototype.find=function(e){return this.filter(e).head()},A.prototype.findLast=function(e){return this.reverse().find(e)},A.prototype.invokeMap=ot(function(e,i){return"function"==typeof e?new A(this):this.map(function(r){return xn(r,e,i)})}),A.prototype.reject=function(e){return this.filter(Na(Oo(e)))},A.prototype.slice=function(e,i){e=Au(e);var r=this;return r.__filtered__&&(e>0||i<0)?new A(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),i!==re&&(i=Au(i),r=i<0?r.dropRight(-i):r.take(i-e)),r)},A.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},A.prototype.toArray=function(){return this.take(De)},nn(A.prototype,function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),t=/^(?:head|last)$/.test(r),o=i[t?"take"+("last"==r?"Right":""):r],f=t||/^find/.test(r);o&&(i.prototype[r]=function(){var r=this.__wrapped__,a=t?[1]:arguments,u=r instanceof A,s=a[0],l=u||gd(r),c=function(e){var r=o.apply(i,h([e],a));return t&&d?r[0]:r};l&&n&&"function"==typeof s&&1!=s.length&&(u=l=!1);var d=this.__chain__,b=!!this.__actions__.length,k=f&&!d,_=u&&!b;if(!f&&l){r=_?r:new A(this);var p=e.apply(r,a);return p.__actions__.push({func:na,args:[c],thisArg:re}),new v(p,d)}return k&&_?e.apply(this,a):(p=this.thru(c),k?t?p.value()[0]:p.value():p)})}),a(["pop","push","shift","sort","splice","unshift"],function(e){var r=_l[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",t=/^(?:pop|shift)$/.test(e);i.prototype[e]=function(){var e=arguments;if(t&&!this.__chain__){var i=this.value();return r.apply(gd(i)?i:[],e)}return this[n](function(i){return r.apply(gd(i)?i:[],e)})}}),nn(A.prototype,function(e,r){var n=i[r];if(n){var t=n.name+"",o=sc[t]||(sc[t]=[]);o.push({name:r,func:n})}}),sc[io(re,_e).name]=[{name:"wrapper",func:re}],A.prototype.clone=K,A.prototype.reverse=Q,A.prototype.value=ee,i.prototype.at=ed,i.prototype.chain=ta,i.prototype.commit=oa,i.prototype.next=fa,i.prototype.plant=ua,i.prototype.reverse=sa,i.prototype.toJSON=i.prototype.valueOf=i.prototype.value=la,i.prototype.first=i.prototype.head,Nl&&(i.prototype[Nl]=aa),i},yn=gn();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(on._=yn,define(function(){return yn})):an?((an.exports=yn)._=yn,fn._=yn):on._=yn}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],305:[function(e,i,r){"use strict";function n(e,i){if(void 0===i)return e;if(E(i))return(E(e)?e:[]).concat(i);if(!f(i))return i;for(var r=o(e)?e:{},t=Object.keys(i),a=0;a0;)n[o]=arguments[o+1];var f=Object.create(e.methods||null);if(g(f,e.deepProperties),y(f,e.properties),Object.defineProperties(f,e.propertyDescriptors||{}),!e.initializers||0===e.initializers.length)return f;void 0===r&&(r={});for(var a=e.initializers,u=a.length,s=0;s0){for(var a=[],u=0;u0;)i[r]=arguments[r+1];return i.reduce(n,e)},y=Object.assign,E=Array.isArray,S=Array.prototype.concat,O=function(e){void 0===e&&(e={});var i=e.methods,r=e.properties,n=e.props,t=e.refs,f=e.initializers,s=e.init,l=e.composers,c=e.deepProperties,d=e.deepProps,b=e.propertyDescriptors,h=e.staticProperties,k=e.statics,_=e.staticDeepProperties,p=e.deepStatics,v=e.staticPropertyDescriptors,w=e.configuration,m=e.conf,E=e.deepConfiguration,S=e.deepConf,O=o(n)||o(t)||o(r)?y({},n,t,r):void 0,C=o(d)?g({},d):void 0;C=o(c)?g(C,c):C;var A=o(k)||o(h)?y({},k,h):void 0,x=o(p)?g({},p):void 0;x=o(_)?g(x,_):x;var R=o(m)||o(w)?y({},m,w):void 0,F=o(S)?g({},S):void 0;F=o(E)?g(F,E):F;var M=a(s,f),T=a(l);T&&(F=F||{},u(F,T,"composers"));var P={};return i&&(P.methods=i),O&&(P.properties=O),M&&(P.initializers=M),C&&(P.deepProperties=C),A&&(P.staticProperties=A),i&&(P.methods=i),x&&(P.staticDeepProperties=x),b&&(P.propertyDescriptors=b),v&&(P.staticPropertyDescriptors=v),R&&(P.configuration=R),F&&(P.deepConfiguration=F),P},C=p("methods",y),A=p("properties",y),x=p("deepProperties",g),R=p("staticProperties",y),F=p("staticDeepProperties",g),M=p("configuration",y),T=p("deepConfiguration",g),P=p("propertyDescriptors",y),j=p("staticPropertyDescriptors",y),L={methods:C,properties:A,refs:A,props:A,initializers:v,init:v,composers:w,deepProperties:x,deepProps:x,staticProperties:R,statics:R,staticDeepProperties:F,deepStatics:F,configuration:M,conf:M,deepConfiguration:T,deepConf:T,propertyDescriptors:P,staticPropertyDescriptors:j},D=k({staticProperties:L},{staticProperties:{create:function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return this.apply(void 0,e)},compose:m}}),N=m.bind();m.compose=N;var I=y(m,L);r.methods=C,r.properties=A,r.refs=A,r.props=A,r.initializers=v,r.init=v,r.composers=w,r.deepProperties=x,r.deepProps=x,r.staticProperties=R,r.statics=R,r.staticDeepProperties=F,r.deepStatics=F,r.configuration=M,r.conf=M,r.deepConfiguration=T,r.deepConf=T,r.propertyDescriptors=P,r.staticPropertyDescriptors=j,r.compose=N,r["default"]=I,i.exports=r["default"]},{}],306:[function(e,i,r){i.exports=e("./lib/visibility.timers.js")},{"./lib/visibility.timers.js":308}],307:[function(e,i,r){!function(e){"use strict";var r=-1,n={onVisible:function(e){var i=n.isSupported();if(!i||!n.hidden())return e(),i;var r=n.change(function(i,t){n.hidden()||(n.unbind(r),e())});return r},change:function(e){if(!n.isSupported())return!1;r+=1;var i=r;return n._callbacks[i]=e,n._listen(),i},unbind:function(e){delete n._callbacks[e]},afterPrerendering:function(e){var i=n.isSupported(),r="prerender";if(!i||r!=n.state())return e(),i;var t=n.change(function(i,o){r!=o&&(n.unbind(t),e())});return t},hidden:function(){return!(!n._doc.hidden&&!n._doc.webkitHidden)},state:function(){return n._doc.visibilityState||n._doc.webkitVisibilityState||"visible"},isSupported:function(){return!(!n._doc.visibilityState&&!n._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(e){var i=n.state();for(var r in n._callbacks)n._callbacks[r].call(n._doc,e,i)},_listen:function(){if(!n._init){var e="visibilitychange";n._doc.webkitVisibilityState&&(e="webkit"+e);var i=function(){n._change.apply(n,arguments)};n._doc.addEventListener?n._doc.addEventListener(e,i):n._doc.attachEvent(e,i),n._init=!0}}};"undefined"!=typeof i&&i.exports?i.exports=n:e.Visibility=n}(this)},{}],308:[function(e,i,r){!function(r){"use strict";var n=-1,t=function(e){return e.every=function(i,r,t){e._time(),t||(t=r,r=null),n+=1;var o=n;return e._timers[o]={visible:i,hidden:r,callback:t},e._run(o,!1),e.isSupported()&&e._listen(),o},e.stop=function(i){return!!e._timers[i]&&(e._stop(i),delete e._timers[i],!0)},e._timers={},e._time=function(){e._timed||(e._timed=!0,e._wasHidden=e.hidden(),e.change(function(){e._stopRun(),e._wasHidden=e.hidden()}))},e._run=function(i,n){var t,o=e._timers[i];if(e.hidden()){if(null===o.hidden)return;t=o.hidden}else t=o.visible;var f=function(){o.last=new Date,o.callback.call(r)};if(n){var a=new Date,u=a-o.last;t>u?o.delay=setTimeout(function(){o.id=setInterval(f,t),f()},t-u):(o.id=setInterval(f,t),f())}else o.id=setInterval(f,t)},e._stop=function(i){var r=e._timers[i];clearInterval(r.id),clearTimeout(r.delay),delete r.id,delete r.delay},e._stopRun=function(i){var r=e.hidden(),n=e._wasHidden;if(r&&!n||!r&&n)for(var t in e._timers)e._stop(t),e._run(t,!r)},e};"undefined"!=typeof i&&i.exports?i.exports=t(e("./visibility.core")):t(r.Visibility)}(window)},{"./visibility.core":307}],309:[function(e,i,r){"use strict";var n={};n.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},n.splitSections=function(e){var i=e.split("\nm=");return i.map(function(e,i){return(i>0?"m="+e:e).trim()+"\r\n"})},n.matchPrefix=function(e,i){return n.splitLines(e).filter(function(e){return 0===e.indexOf(i)})},n.parseCandidate=function(e){var i;i=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var r={foundation:i[0],component:i[1],protocol:i[2].toLowerCase(),priority:parseInt(i[3],10),ip:i[4],port:parseInt(i[5],10),type:i[7]},n=8;n-1?(r.attribute=e.substr(i+1,n-i-1),r.value=e.substr(n+1)):r.attribute=e.substr(i+1),r},n.getMid=function(e){var i=n.matchPrefix(e,"a=mid:")[0];if(i)return i.substr(6)},n.getDtlsParameters=function(e,i){var r=n.splitLines(e);r=r.concat(n.splitLines(i));var t=r.filter(function(e){return 0===e.indexOf("a=fingerprint:")})[0].substr(14),o={role:"auto",fingerprints:[{algorithm:t.split(" ")[0].toLowerCase(),value:t.split(" ")[1]}]};return o},n.writeDtlsParameters=function(e,i){var r="a=setup:"+i+"\r\n";return e.fingerprints.forEach(function(e){r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),r},n.getIceParameters=function(e,i){var r=n.splitLines(e);r=r.concat(n.splitLines(i));var t={usernameFragment:r.filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:r.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)};return t},n.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},n.parseRtpParameters=function(e){for(var i={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e),t=r[0].split(" "),o=3;o0?"9":"0",r+=" UDP/TLS/RTP/SAVPF ",r+=i.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",i.codecs.forEach(function(e){r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)});var t=0;return i.codecs.forEach(function(e){e.maxptime>t&&(t=e.maxptime)}),t>0&&(r+="a=maxptime:"+t+"\r\n"),r+="a=rtcp-mux\r\n",i.headerExtensions.forEach(function(e){r+=n.writeExtmap(e)}),r},n.parseRtpEncodingParameters=function(e){var i,r=[],t=n.parseRtpParameters(e),o=t.fecMechanisms.indexOf("RED")!==-1,f=t.fecMechanisms.indexOf("ULPFEC")!==-1,a=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),u=a.length>0&&a[0].ssrc,s=n.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var i=e.split(" ");return i.shift(),i.map(function(e){return parseInt(e,10)})});s.length>0&&s[0].length>1&&s[0][0]===u&&(i=s[0][1]),t.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:u,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{ssrc:i}};r.push(n),o&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:i,mechanism:f?"red+ulpfec":"red"},r.push(n))}}),0===r.length&&u&&r.push({ssrc:u});var l=n.matchPrefix(e,"b=");return l.length&&(0===l[0].indexOf("b=TIAS:")?l=parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")&&(l=parseInt(l[0].substr(5),10)),r.forEach(function(e){e.maxBitrate=l})),r},n.parseRtcpParameters=function(e){var i={},r=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];r&&(i.cname=r.value,i.ssrc=r.ssrc);var t=n.matchPrefix(e,"a=rtcp-rsize");i.reducedSize=t.length>0,i.compound=0===t.length;var o=n.matchPrefix(e,"a=rtcp-mux");return i.mux=o.length>0,i},n.parseMsid=function(e){var i,r=n.matchPrefix(e,"a=msid:");if(1===r.length)return i=r[0].substr(7).split(" "),{stream:i[0],track:i[1]};var t=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return t.length>0?(i=t[0].value.split(" "),{stream:i[0],track:i[1]}):void 0},n.writeSessionBoilerplate=function(){return"v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(e,i,r,t){var o=n.writeRtpDescription(e.kind,i);if(o+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",o+=e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var f="msid:"+t.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+f,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+f,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+f,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),o},n.getDirection=function(e,i){for(var r=n.splitLines(e),t=0;t0&&"function"==typeof e)return t(e,i);var f=function(e){var i={},r=e.result();return r.forEach(function(e){var r={id:e.id,timestamp:e.timestamp,type:e.type};e.names().forEach(function(i){r[i]=e.stat(i)}),i[r.id]=r}),i},a=function(e,i){var r=new Map(Object.keys(e).map(function(i){return[i,e[i]]}));return i=i||e,Object.keys(i).forEach(function(e){r[e]=i[e]}),r};if(arguments.length>=2){var u=function(e){o[1](a(f(e)))};return t.apply(this,[u,arguments[0]])}return new Promise(function(i,r){1===o.length&&"object"==typeof e?t.apply(n,[function(e){i(a(f(e)))},r]):t.apply(n,[function(e){i(a(f(e),e.result()))},r])}).then(i,r)},r},window.RTCPeerConnection.prototype=webkitRTCPeerConnection.prototype,webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return webkitRTCPeerConnection.generateCertificate}}),["createOffer","createAnswer"].forEach(function(e){var i=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var r=1===arguments.length?arguments[0]:void 0;return new Promise(function(n,t){i.apply(e,[n,t,r])})}return i.apply(this,arguments)}}),t.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var i=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=arguments,r=this,n=new Promise(function(n,t){i.apply(r,[e[0],n,t])});return e.length<2?n:n.then(function(){e[1].apply(null,[])},function(i){e.length>=3&&e[2].apply(null,[i])})}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)},["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var i=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}})},attachMediaStream:function(e,i){n("DEPRECATED, attachMediaStream will soon be removed."),t.version>=43?e.srcObject=i:"undefined"!=typeof e.src?e.src=URL.createObjectURL(i):n("Error attaching stream to element.")},reattachMediaStream:function(e,i){n("DEPRECATED, reattachMediaStream will soon be removed."),t.version>=43?e.srcObject=i.srcObject:e.src=i.src}};i.exports={shimMediaStream:o.shimMediaStream,shimOnTrack:o.shimOnTrack,shimSourceObject:o.shimSourceObject,shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:e("./getusermedia"),attachMediaStream:o.attachMediaStream,reattachMediaStream:o.reattachMediaStream}},{"../utils.js":318,"./getusermedia":312}],312:[function(e,i,r){"use strict";var n=e("../utils.js").log;i.exports=function(){var e=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var i={};return Object.keys(e).forEach(function(r){if("require"!==r&&"advanced"!==r&&"mediaSource"!==r){var n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);var t=function(e,i){return e?e+i.charAt(0).toUpperCase()+i.slice(1):"deviceId"===i?"sourceId":i};if(void 0!==n.ideal){i.optional=i.optional||[];var o={};"number"==typeof n.ideal?(o[t("min",r)]=n.ideal,i.optional.push(o),o={},o[t("max",r)]=n.ideal,i.optional.push(o)):(o[t("",r)]=n.ideal,i.optional.push(o))}void 0!==n.exact&&"number"!=typeof n.exact?(i.mandatory=i.mandatory||{},i.mandatory[t("",r)]=n.exact):["min","max"].forEach(function(e){void 0!==n[e]&&(i.mandatory=i.mandatory||{},i.mandatory[t(e,r)]=n[e])})}}),e.advanced&&(i.optional=(i.optional||[]).concat(e.advanced)),i},i=function(i,r){if(i=JSON.parse(JSON.stringify(i)),i&&i.audio&&(i.audio=e(i.audio)),i&&"object"==typeof i.video){var t=i.video.facingMode;if(t=t&&("object"==typeof t?t:{ideal:t}),t&&("user"===t.exact||"environment"===t.exact||"user"===t.ideal||"environment"===t.ideal)&&(!navigator.mediaDevices.getSupportedConstraints||!navigator.mediaDevices.getSupportedConstraints().facingMode)&&(delete i.video.facingMode,"environment"===t.exact||"environment"===t.ideal))return navigator.mediaDevices.enumerateDevices().then(function(o){o=o.filter(function(e){return"videoinput"===e.kind});var f=o.find(function(e){return e.label.toLowerCase().indexOf("back")!==-1})||o.length&&o[o.length-1];return f&&(i.video.deviceId=t.exact?{exact:f.deviceId}:{ideal:f.deviceId}),i.video=e(i.video),n("chrome: "+JSON.stringify(i)),r(i)});i.video=e(i.video)}return n("chrome: "+JSON.stringify(i)),r(i)},r=function(e){return{name:{PermissionDeniedError:"NotAllowedError",ConstraintNotSatisfiedError:"OverconstrainedError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},t=function(e,n,t){i(e,function(e){navigator.webkitGetUserMedia(e,n,function(e){t(r(e))})})};navigator.getUserMedia=t;var o=function(e){return new Promise(function(i,r){navigator.getUserMedia(e,i,r)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:o,enumerateDevices:function(){return new Promise(function(e){var i={audio:"audioinput",video:"videoinput"};return MediaStreamTrack.getSources(function(r){e(r.map(function(e){return{label:e.label,kind:i[e.kind],deviceId:e.id,groupId:""}}))})})}}),navigator.mediaDevices.getUserMedia){var f=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(e){return i(e,function(e){return f(e)["catch"](function(e){return Promise.reject(r(e))})})}}else navigator.mediaDevices.getUserMedia=function(e){return o(e)};"undefined"==typeof navigator.mediaDevices.addEventListener&&(navigator.mediaDevices.addEventListener=function(){n("Dummy mediaDevices.addEventListener called.")}),"undefined"==typeof navigator.mediaDevices.removeEventListener&&(navigator.mediaDevices.removeEventListener=function(){n("Dummy mediaDevices.removeEventListener called.")})}},{"../utils.js":318}],313:[function(e,i,r){"use strict";var n=e("sdp"),t=e("../utils").log,o={shimPeerConnection:function(){window.RTCIceGatherer&&(window.RTCIceCandidate||(window.RTCIceCandidate=function(e){return e}),window.RTCSessionDescription||(window.RTCSessionDescription=function(e){return e})),window.RTCPeerConnection=function(e){var i=this,r=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){i[e]=r[e].bind(r)}),this.onicecandidate=null,this.onaddstream=null,this.ontrack=null,this.onremovestream=null,this.onsignalingstatechange=null,this.oniceconnectionstatechange=null,this.onnegotiationneeded=null,this.ondatachannel=null,this.localStreams=[],this.remoteStreams=[],this.getLocalStreams=function(){return i.localStreams},this.getRemoteStreams=function(){return i.remoteStreams},this.localDescription=new RTCSessionDescription({type:"",sdp:""}),this.remoteDescription=new RTCSessionDescription({type:"",sdp:""}),this.signalingState="stable",this.iceConnectionState="new",this.iceGatheringState="new",this.iceOptions={gatherPolicy:"all",iceServers:[]},e&&e.iceTransportPolicy)switch(e.iceTransportPolicy){case"all":case"relay":this.iceOptions.gatherPolicy=e.iceTransportPolicy;break;case"none":throw new TypeError('iceTransportPolicy "none" not supported')}if(this.usingBundle=e&&"max-bundle"===e.bundlePolicy,e&&e.iceServers){var n=JSON.parse(JSON.stringify(e.iceServers));this.iceOptions.iceServers=n.filter(function(e){if(e&&e.urls){var i=e.urls;return"string"==typeof i&&(i=[i]),i=i.filter(function(e){return 0===e.indexOf("turn:")&&e.indexOf("transport=udp")!==-1})[0],!!i}return!1})}this.transceivers=[],this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype._emitBufferedCandidates=function(){var e=this,i=n.splitSections(e.localDescription.sdp);this._localIceCandidatesBuffer.forEach(function(r){var n=!r.candidate||0===Object.keys(r.candidate).length;if(n)for(var t=1;t-1&&(this.localStreams.splice(i,1),this._maybeFireNegotiationNeeded())},window.RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},window.RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},window.RTCPeerConnection.prototype._getCommonCapabilities=function(e,i){var r={codecs:[],headerExtensions:[],fecMechanisms:[]};return e.codecs.forEach(function(e){for(var n=0;n0;i.forEach(function(e,i){var f=t.transceivers[i],a=f.iceGatherer,u=f.iceTransport,s=f.dtlsTransport,l=f.localCapabilities,c=f.remoteCapabilities,d="0"===e.split("\n",1)[0].split(" ",2)[1];if(!d){var b=n.getIceParameters(e,r);if(o){var h=n.matchPrefix(e,"a=candidate:").map(function(e){return n.parseCandidate(e)}).filter(function(e){return"1"===e.component});h.length&&u.setRemoteCandidates(h)}var k=n.getDtlsParameters(e,r);o&&(k.role="server"),t.usingBundle&&0!==i||(u.start(a,b,o?"controlling":"controlled"),s.start(k));var _=t._getCommonCapabilities(l,c);t._transceive(f,_.codecs.length>0,!1)}})}switch(this.localDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-local-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}var f=arguments.length>1&&"function"==typeof arguments[1];if(f){var a=arguments[1];window.setTimeout(function(){a(),"new"===t.iceGatheringState&&(t.iceGatheringState="gathering"),t._emitBufferedCandidates()},0)}var u=Promise.resolve();return u.then(function(){f||("new"===t.iceGatheringState&&(t.iceGatheringState="gathering"),window.setTimeout(t._emitBufferedCandidates.bind(t),500))}),u},window.RTCPeerConnection.prototype.setRemoteDescription=function(e){var i=this,r=new MediaStream,t=[],o=n.splitSections(e.sdp),f=o.shift(),a=n.matchPrefix(f,"a=ice-lite").length>0;switch(this.usingBundle=n.matchPrefix(f,"a=group:BUNDLE ").length>0,o.forEach(function(o,u){var s,l,c,d,b,h,k,_,p,v,w,m,g=n.splitLines(o),y=g[0].substr(2).split(" "),E=y[0],S="0"===y[1],O=n.getDirection(o,f),C=n.parseRtpParameters(o);S||(w=n.getIceParameters(o,f),m=n.getDtlsParameters(o,f),m.role="client"),_=n.parseRtpEncodingParameters(o);var A=n.matchPrefix(o,"a=mid:");A=A.length?A[0].substr(6):n.generateIdentifier();var x,R=n.matchPrefix(o,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];R&&(x=R.value);var F=n.matchPrefix(o,"a=end-of-candidates").length>0,M=n.matchPrefix(o,"a=candidate:").map(function(e){return n.parseCandidate(e)}).filter(function(e){return"1"===e.component});if("offer"!==e.type||S)"answer"!==e.type||S||(s=i.transceivers[u],l=s.iceGatherer,c=s.iceTransport,d=s.dtlsTransport,b=s.rtpSender,h=s.rtpReceiver,k=s.sendEncodingParameters,p=s.localCapabilities,i.transceivers[u].recvEncodingParameters=_,i.transceivers[u].remoteCapabilities=C,i.transceivers[u].cname=x,(a||F)&&M.length&&c.setRemoteCandidates(M),i.usingBundle&&0!==u||(c.start(l,w,"controlling"),d.start(m)),i._transceive(s,"sendrecv"===O||"recvonly"===O,"sendrecv"===O||"sendonly"===O),!h||"sendrecv"!==O&&"sendonly"!==O?delete s.rtpReceiver:(v=h.track,t.push([v,h]),r.addTrack(v)));else{var T=i.usingBundle&&u>0?{iceGatherer:i.transceivers[0].iceGatherer,iceTransport:i.transceivers[0].iceTransport,dtlsTransport:i.transceivers[0].dtlsTransport}:i._createIceAndDtlsTransports(A,u);if(F&&T.iceTransport.setRemoteCandidates(M),p=RTCRtpReceiver.getCapabilities(E),k=[{ssrc:1001*(2*u+2)}],h=new RTCRtpReceiver(T.dtlsTransport,E),v=h.track,t.push([v,h]),r.addTrack(v),i.localStreams.length>0&&i.localStreams[0].getTracks().length>=u){var P=i.localStreams[0].getTracks()[u];b=new RTCRtpSender(P,T.dtlsTransport)}i.transceivers[u]={iceGatherer:T.iceGatherer,iceTransport:T.iceTransport,dtlsTransport:T.dtlsTransport,localCapabilities:p,remoteCapabilities:C,rtpSender:b,rtpReceiver:h,kind:E,mid:A,cname:x,sendEncodingParameters:k,recvEncodingParameters:_},i._transceive(i.transceivers[u],!1,"sendrecv"===O||"sendonly"===O)}}),this.remoteDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-remote-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}return r.getTracks().length&&(i.remoteStreams.push(r),window.setTimeout(function(){var e=new Event("addstream");e.stream=r,i.dispatchEvent(e),null!==i.onaddstream&&window.setTimeout(function(){i.onaddstream(e)},0),t.forEach(function(n){var t=n[0],o=n[1],f=new Event("track");f.track=t,f.receiver=o,f.streams=[r],i.dispatchEvent(e),null!==i.ontrack&&window.setTimeout(function(){i.ontrack(f)},0)})},0)),arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._updateSignalingState("closed")},window.RTCPeerConnection.prototype._updateSignalingState=function(e){this.signalingState=e;var i=new Event("signalingstatechange");this.dispatchEvent(i),null!==this.onsignalingstatechange&&this.onsignalingstatechange(i)},window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var e=new Event("negotiationneeded");this.dispatchEvent(e),null!==this.onnegotiationneeded&&this.onnegotiationneeded(e)},window.RTCPeerConnection.prototype._updateConnectionState=function(){var e,i=this,r={"new":0,closed:0,connecting:0,checking:0,connected:0,completed:0,failed:0};if(this.transceivers.forEach(function(e){r[e.iceTransport.state]++,r[e.dtlsTransport.state]++}),r.connected+=r.completed,e="new",r.failed>0?e="failed":r.connecting>0||r.checking>0?e="connecting":r.disconnected>0?e="disconnected":r["new"]>0?e="new":(r.connected>0||r.completed>0)&&(e="connected"),e!==i.iceConnectionState){i.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this.dispatchEvent(n),null!==this.oniceconnectionstatechange&&this.oniceconnectionstatechange(n)}},window.RTCPeerConnection.prototype.createOffer=function(){var e=this;if(this._pendingOffer)throw new Error("createOffer called while there is a pending offer.");var i;1===arguments.length&&"function"!=typeof arguments[0]?i=arguments[0]:3===arguments.length&&(i=arguments[2]);var r=[],t=0,o=0;if(this.localStreams.length&&(t=this.localStreams[0].getAudioTracks().length,o=this.localStreams[0].getVideoTracks().length),i){if(i.mandatory||i.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==i.offerToReceiveAudio&&(t=i.offerToReceiveAudio),void 0!==i.offerToReceiveVideo&&(o=i.offerToReceiveVideo)}for(this.localStreams.length&&this.localStreams[0].getTracks().forEach(function(e){r.push({kind:e.kind,track:e,wantReceive:"audio"===e.kind?t>0:o>0}),"audio"===e.kind?t--:"video"===e.kind&&o--});t>0||o>0;)t>0&&(r.push({kind:"audio",wantReceive:!0}),t--),o>0&&(r.push({kind:"video",wantReceive:!0}),o--);var f=n.writeSessionBoilerplate(),a=[];r.forEach(function(i,r){var t,o,f=i.track,u=i.kind,s=n.generateIdentifier(),l=e.usingBundle&&r>0?{iceGatherer:a[0].iceGatherer,iceTransport:a[0].iceTransport,dtlsTransport:a[0].dtlsTransport}:e._createIceAndDtlsTransports(s,r),c=RTCRtpSender.getCapabilities(u),d=[{ssrc:1001*(2*r+1)}];f&&(t=new RTCRtpSender(f,l.dtlsTransport)),i.wantReceive&&(o=new RTCRtpReceiver(l.dtlsTransport,u)),a[r]={iceGatherer:l.iceGatherer,iceTransport:l.iceTransport,dtlsTransport:l.dtlsTransport,localCapabilities:c,remoteCapabilities:null,rtpSender:t,rtpReceiver:o,kind:u,mid:s,sendEncodingParameters:d,recvEncodingParameters:null}}),this.usingBundle&&(f+="a=group:BUNDLE "+a.map(function(e){return e.mid}).join(" ")+"\r\n"),r.forEach(function(i,r){var t=a[r];f+=n.writeMediaSection(t,t.localCapabilities,"offer",e.localStreams[0])}),this._pendingOffer=a;var u=new RTCSessionDescription({type:"offer",sdp:f});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,u),Promise.resolve(u)},window.RTCPeerConnection.prototype.createAnswer=function(){var e=this,i=n.writeSessionBoilerplate();this.usingBundle&&(i+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),this.transceivers.forEach(function(r){var t=e._getCommonCapabilities(r.localCapabilities,r.remoteCapabilities);i+=n.writeMediaSection(r,t,"answer",e.localStreams[0])});var r=new RTCSessionDescription({type:"answer",sdp:i});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,r),Promise.resolve(r)},window.RTCPeerConnection.prototype.addIceCandidate=function(e){if(null===e)this.transceivers.forEach(function(e){e.iceTransport.addRemoteCandidate({})});else{var i=e.sdpMLineIndex;if(e.sdpMid)for(var r=0;r0?n.parseCandidate(e.candidate):{};if("tcp"===o.protocol&&0===o.port)return;if("1"!==o.component)return;"endOfCandidates"===o.type&&(o={}),t.iceTransport.addRemoteCandidate(o);var f=n.splitSections(this.remoteDescription.sdp);f[i+1]+=(o.type?e.candidate.trim():"a=end-of-candidates")+"\r\n",this.remoteDescription.sdp=f.join("")}}return arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.getStats=function(){var e=[];this.transceivers.forEach(function(i){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(r){i[r]&&e.push(i[r].getStats())})});var i=arguments.length>1&&"function"==typeof arguments[1]&&arguments[1];return new Promise(function(r){var n=new Map;Promise.all(e).then(function(e){e.forEach(function(e){Object.keys(e).forEach(function(i){n.set(i,e[i]),n[i]=e[i]})}),i&&window.setTimeout(i,0,n),r(n)})})}},attachMediaStream:function(e,i){t("DEPRECATED, attachMediaStream will soon be removed."),e.srcObject=i},reattachMediaStream:function(e,i){t("DEPRECATED, reattachMediaStream will soon be removed."),e.srcObject=i.srcObject}};i.exports={shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:e("./getusermedia"),attachMediaStream:o.attachMediaStream,reattachMediaStream:o.reattachMediaStream}},{"../utils":318,"./getusermedia":314,sdp:309}],314:[function(e,i,r){"use strict";i.exports=function(){var e=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint, +toString:function(){return this.name}}},i=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(r){return i(r)["catch"](function(i){return Promise.reject(e(i))})}}},{}],315:[function(e,i,r){"use strict";var n=e("../utils").log,t=e("../utils").browserDetails,o={shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(i){var r=new Event("track");r.track=i,r.receiver={track:i},r.streams=[e.stream],this.dispatchEvent(r)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(){if("object"==typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection)){window.RTCPeerConnection||(window.RTCPeerConnection=function(e,i){if(t.version<38&&e&&e.iceServers){for(var r=[],n=0;n=r&&parseInt(n[r],10)},detectBrowser:function(){var e={};if(e.browser=null,e.version=null,e.minVersion=null,"undefined"==typeof window||!window.navigator)return e.browser="Not a browser.",e;if(navigator.mozGetUserMedia)e.browser="firefox",e.version=this.extractVersion(navigator.userAgent,/Firefox\/([0-9]+)\./,1),e.minVersion=31;else if(navigator.webkitGetUserMedia)if(window.webkitRTCPeerConnection)e.browser="chrome",e.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/([0-9]+)\./,2),e.minVersion=38;else{if(!navigator.userAgent.match(/Version\/(\d+).(\d+)/))return e.browser="Unsupported webkit-based browser with GUM support but no WebRTC support.",e;e.browser="safari",e.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/([0-9]+)\./,1),e.minVersion=602}else{if(!navigator.mediaDevices||!navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))return e.browser="Not a supported browser.",e;e.browser="edge",e.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2),e.minVersion=10547}return e.version0&&void 0!==arguments[0]?arguments[0]:null;return regeneratorRuntime.async(function(i){for(;;)switch(i.prev=i.next){case 0:if(!this._fsm.can("start")){i.next=5;break}return i.next=3,regeneratorRuntime.awrap(this._fsm.start(e));case 3:i.next=9;break;case 5:return i.next=7,regeneratorRuntime.awrap(this._fsm.stop());case 7:return i.next=9,regeneratorRuntime.awrap(this._fsm.start(e));case 9:case"end":return i.stop()}},null,this)}},{key:"stop",value:function(){return regeneratorRuntime.async(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._fsm.can("stop")){e.next=3;break}return e.next=3,regeneratorRuntime.awrap(this._fsm.stop());case 3:case"end":return e.stop()}},null,this)}},{key:"_enableScan",value:function(e){var i;return regeneratorRuntime.async(function(r){for(;;)switch(r.prev=r.next){case 0:if(this._camera=e||this._camera,this._camera){r.next=3;break}throw new Error("Camera is not defined.");case 3:return r.next=5,regeneratorRuntime.awrap(this._camera.start());case 5:i=r.sent,this.video.srcObject=i,this._continuous&&this._scanner.start();case 8:case"end":return r.stop()}},null,this)}},{key:"_disableScan",value:function(){this.video.src="",this._scanner&&this._scanner.stop(),this._camera&&this._camera.stop()}},{key:"_configureVideo",value:function(e){if(e.video&&"VIDEO"!==e.video.tagName)throw new Error("Video must be a