redmine_apijs 6.9.6 → 6.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README +8 -7
- data/app/controllers/apijs_controller.rb +1 -1
- data/app/views/application/_browser.html.erb +1 -1
- data/app/views/attachments/_links.html.erb +1 -1
- data/app/views/settings/_apijs.html.erb +1 -1
- data/assets/javascripts/apijs-redmine.js +1 -1
- data/assets/javascripts/apijs-redmine.min.js +2 -2
- data/assets/javascripts/apijs-redmine.min.js.map +1 -1
- data/assets/javascripts/apijs.min.js +3 -3
- data/assets/javascripts/apijs.min.js.map +1 -1
- data/assets/stylesheets/apijs-print.min.css +2 -2
- data/assets/stylesheets/apijs-print.min.css.map +1 -1
- data/assets/stylesheets/apijs-redmine-rtl.min.css +1 -1
- data/assets/stylesheets/apijs-redmine-rtl.min.css.map +1 -1
- data/assets/stylesheets/apijs-redmine.css +1 -1
- data/assets/stylesheets/apijs-redmine.min.css +1 -1
- data/assets/stylesheets/apijs-redmine.min.css.map +1 -1
- data/assets/stylesheets/apijs-screen-rtl.min.css +2 -2
- data/assets/stylesheets/apijs-screen-rtl.min.css.map +1 -1
- data/assets/stylesheets/apijs-screen.min.css +2 -2
- data/assets/stylesheets/apijs-screen.min.css.map +1 -1
- data/config/routes.rb +1 -1
- data/init.rb +3 -3
- data/lib/apijs_attachment.rb +5 -3
- data/lib/apijs_files.rb +1 -1
- data/lib/image.py +1 -1
- data/lib/redmine_apijs.rb +1 -1
- data/lib/useragentparser.rb +15 -9
- data/redmine_apijs.gemspec +1 -1
- metadata +3 -6
@@ -1,8 +1,8 @@
|
|
1
1
|
/*!
|
2
|
-
* Copyright 2008-
|
3
|
-
* https://github.com/luigifab/apijs - 6.9.
|
2
|
+
* Copyright 2008-2025 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
|
3
|
+
* https://github.com/luigifab/apijs - 6.9.7
|
4
4
|
* This program is free software, you can redistribute it or modify
|
5
5
|
* it under the terms of the GNU General Public License (GPL).
|
6
6
|
*/
|
7
|
-
Array.prototype.has||(Array.prototype.has=function(t,e){if(t instanceof Array){for(e in t)if(t.hasOwnProperty(e)&&this.has(t[e]))return!0}else for(e in this)if(this.hasOwnProperty(e)&&this[e]===t)return!0;return!1}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(t,e,i){for(e=e||window,i=0;i<this.length;i++)t.call(e,this[i],i,this)});var apijs=new function(){"use strict";this.core={},this.version=696,this.config={lang:"auto",debug:!1,dialog:{closeOnClick:!1,restrictNavigation:!0,player:!0},slideshow:{ids:"slideshow",anchor:!0},upload:{tokenName:"X-CSRF-Token",tokenValue:null}},this.start=function(){var t;if(console.info("APIJS "+this.version.toString().split("").join(".")+" - hello - 1 MB/Mo = 1024 kB/ko"),document.getElementById("oldBrowser"))throw new Error("APIJS canceled, #oldBrowser detected!");(t=document.querySelector('link[href*="apijs/fontello.woff2"]'))&&t.getAttribute("href").indexOf("?a3ab5acff3")<0&&console.error("APIJS warning invalid cachekey for link:fontello.woff2?x, it must be ?a3ab5acff3"),(t=document.querySelector('script[src*="apijs.min.js?v="]'))&&t.getAttribute("src").indexOf("?v="+this.version)<0&&console.error("APIJS warning invalid cachekey for script:apijs.min.js?x, it must be ?v="+this.version),this.i18n=new this.core.i18n,this.dialog=new this.core.dialog,this.upload=new this.core.upload,this.slideshow=new this.core.slideshow,self.dispatchEvent(new CustomEvent("apijsbeforeload")),this.i18n.init(),this.slideshow.init(),document.querySelectorAll("video.apijsplayer[data-src]").forEach(function(t){apijs.startPlayer(t,t.getAttribute("data-src"))}),self.addEventListener("popstate",this.slideshow.onPopState),self.addEventListener("hashchange",this.slideshow.onPopState),this.config.debug&&(console.info("APIJS available languages: "+Object.keys(this.i18n.data).join(" ")),console.info("APIJS language loaded: "+this.config.lang),console.info("APIJS successfully started")),self.dispatchEvent(new CustomEvent("apijsload"))},this.formatNumber=function(e,t){var i,s="number"==typeof t?t:!1===t?0:2;try{i=new Intl.NumberFormat(this.config.lang,{minimumFractionDigits:s,maximumFractionDigits:s}).format(e)}catch(t){i=e.toFixed(s)}return"number"==typeof t?i:i.replace(/[.,]00$/,"")},this.startPlayer=function(t,e){return!0===this.config.dialog.player?(t.videoPlayer=new this.core.player(t,e),t.parentNode.classList.add("apijsvideoplayer"),!0):"function"==typeof this.config.dialog.player&&(this.config.dialog.player(t,e),!0)},this.toArray=function(t,e){return Array.prototype.slice.call(t,0,e)},this.openTab=function(t){t.preventDefault(),0<this.href.length&&self.open(this.href)},this.log=function(t){this.config.debug&&console.info("APIJS "+t)},this.html=function(t,e){return!0===e||0===t.indexOf("#")?document.getElementById(t.replace("#","apijs")):this.dialog.t1?this.dialog.t1.querySelector(t):null},this.requestFullscreen=function(t){document.webkitFullscreenElement?document.webkitCancelFullScreen():document.mozFullScreenElement?document.mozCancelFullScreen():document.fullscreenElement?document.cancelFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen&&t.mozRequestFullScreen()},this.serialize=function(t,i){var s=[];return i="string"==typeof i?i:"",Array.prototype.forEach.call(t.elements,function(t,e){if(t.name&&!t.disabled&&!["file","reset","submit","button"].has(t.type)&&0===t.name.indexOf(i))if("select-multiple"===t.type)for(e=0;e<t.options.length;e++)t.options[e].selected&&s.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.options[e].value));else["checkbox","radio"].has(t.type)&&!t.checked||s.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),s.join("&")}};"function"==typeof self.addEventListener&&self.addEventListener("load",apijs.start.bind(apijs)),apijs.core.i18n=function(){"use strict";this.data={cs:{103:"Zrušit",104:"Potvrzení",105:"Zavřít",106:"Předchozí",107:"Následující",108:"Vybrat soubor",132:"video stopa",133:"zvuková stopa",134:"titulky",135:"vypnuto",142:"předchozí/následující",143:"přehrát/pozastavit",144:"zpět/vpřed",145:"snížit/zvýšit hlasitost",146:"ztlumit",148:"ukončit",149:"Konec",150:"Esc"},de:{103:"Abbrechen",104:"Bestätigen",105:"Schließen",106:"Vorheriges",107:"Nächstes",108:"Datei wählen",109:"Dateien wählen",124:"Verarbeitung läuft...",132:"videospur",133:"audiospur",134:"untertitel",135:"aus",142:"vorheriges/nächstes",143:"wiedergabe/pause",144:"rückwärts/vorwärts",145:"leiser/lauter",146:"ton aus",147:"vollbild",148:"beenden",149:"Ende",150:"Esc",161:"Alle Dateien wurden akzeptiert.",162:"Akzeptiertes Dateiformat: §.",163:"Akzeptiertes Dateiformate: § und §.",164:"Maximale Größe: § MB.",167:"Unerlaubtes Format",168:"Format zu gross",169:"Leere Datei",181:"§% - § kB/s - Noch § Minuten",182:"§% - § kB/s - Noch § Minute",183:"§% - § kB/s - Noch § Sekunden",185:"§% - bis § kB/s in § Minuten",186:"§% - bis § kB/s in § Minute",187:"§% - bis § kB/s in § Sekunden",188:"§% - bis § kB/s",191:"Abbrechen",192:"Sind Sie sicher? [span]Ja[/span] - Nein",193:"Es ist ein unerwarteter Fehler aufgetreten... Bitte versuchen Sie es noch einmal.",194:"Es ist ein Fehler beim Senden.",195:"Es ist ein Fehler bei der Verarbeitung.",196:"Wir laden Sie ein es erneut zu [a §]versuchen[/a]."},el:{102:"Εντάξει",103:"Ακύρωση",105:"Κλείσιμο",106:"Προηγούμενο",107:"Επόμενο",108:"Επιλέξτε ένα αρχείο",131:"βίντεο",132:"κομμάτι βίντεο",133:"κομμάτι ήχου",134:"υπότιτλοι",135:"απενεργοποίηση",142:"προηγούμενο/επόμενο",143:"αναπαραγωγή/παύση",144:"προς τα πίσω/εμπρός",145:"μείωση/αύξηση έντασης ήχου",146:"σίγαση",147:"πλήρης οθόνη",148:"έξοδος",149:"Τέλος",150:"Esc"},en:{102:"Ok",103:"Cancel",104:"Confirm",105:"Close",106:"Previous",107:"Next",108:"Choose a file",109:"Choose one or multiple files",124:"Operation in progress...",125:"Upload in progress...",126:"Processing file in progress...",127:"Drag and drop your files here",131:"video",132:"video track",133:"audio track",134:"subtitles",135:"off",141:"first/last",142:"previous/next",143:"play/pause",144:"backward/forward",145:"decrease/increase the volume",146:"mute",147:"full screen",148:"quit",149:"End",150:"Escape",161:"All files are accepted.",162:"Accepted file format: §.",163:"Accepted file formats: § and §.",164:"Maximum size: § MB.",165:"Maximum size by file: § MB.|Total maximum size: § MB.",166:"§ MB",167:"Format not allowed",168:"Size too large",169:"File empty",181:"§% - § kB/s - § minutes left",182:"§% - § kB/s - § minute left",183:"§% - § kB/s - § seconds left",184:"§% - § kB/s",185:"§% - at § kB/s in § minutes",186:"§% - at § kB/s in § minute",187:"§% - at § kB/s in § seconds",188:"§% - at § kB/s",191:"Interrupt",192:"Are you sure? [span]Yes[/span] - No",193:"It seems that an unlikely mistake just happened... Please try again.",194:"An error occurred while sending.",195:"An error occurred while processing.",196:"We invite you to [a §]try again[/a]."},es:{102:"Aceptar",103:"Cancelar",104:"Confirmar",105:"Cerrar",106:"Anterior",107:"Siguiente",108:"Elegir un fichero",109:"Elegir uno o varios ficheros",124:"Operación en curso...",125:"Envío en progreso...",126:"Tratamiento en curso...",131:"vídeo",132:"pista de vídeo",133:"pista de audio",134:"subtítulos",135:"desactivar",142:"anterior/siguiente",143:"reproducir/pausa",144:"retroceder/avanzar",145:"bajar/subir volumen",146:"silenciar",147:"pantalla completa",148:"salir",149:"Fin",150:"Esc",161:"Se aceptan todos los archivos.",162:"Formato de archivo aceptado: §.",163:"Formatos de archivos aceptados: § y §.",164:"Tamaño máximo: § MB.",165:"Tamaño máximo por fichero: § Mo.|Tamaño máximo total: § Mo.",167:"Formato no autorizado",168:"Tamaño demasiado importante",169:"Fichero vacío",181:"§% - § kB/s - § minutos restantes",182:"§% - § kB/s - § minuto restantes",183:"§% - § kB/s - § segundos restantes",185:"§% - a § kB/s en § minutos",186:"§% - a § kB/s en § minuto",187:"§% - a § kB/s en § segundos",188:"§% - a § kB/s",191:"Interrumpir",192:"¿Está seguro(a)? [span]Sí[/span] - No",193:"Parece que un error improbable acabo de ocurrir... Por favor, inténtelo de nuevo.",194:"Se produjo un error durante el envío.",195:"Se produjo un error durante el procesamiento.",196:"Le invitamos a [a §]intentar de nuevo[/a]."},fr:{103:"Annuler",104:"Valider",105:"Fermer",106:"Précédent",107:"Suivant",108:"Choisir un fichier",109:"Choisir un ou plusieurs fichiers",124:"Opération en cours...",125:"Envoi en cours...",126:"Traitement en cours...",127:"Faites glisser et déposez vos fichiers ici",131:"vidéo",132:"piste vidéo",133:"piste audio",134:"sous-titres",141:"premier/dernier",142:"précédent/suivant",143:"lecture/pause",144:"reculer/avancer",145:"réduire/augmenter le volume",146:"couper le son",147:"plein écran",148:"quitter",149:"Fin",150:"Échap",161:"Tous les fichiers sont acceptés.",162:"Format de fichier accepté : §.",163:"Formats de fichier acceptés : § et §.",164:"Taille maximale : § Mo.",165:"Taille maximale par fichier : § Mo.|Taille maximale total : § Mo.",166:"§ Mo",167:"Format non autorisé",168:"Taille trop importante",169:"Fichier vide",181:"§% - § ko/s - § minutes restantes",182:"§% - § ko/s - § minute restante",183:"§% - § ko/s - § secondes restantes",184:"§% - § ko/s",185:"§% - à § ko/s en § minutes",186:"§% - à § ko/s en § minute",187:"§% - à § ko/s en § secondes",188:"§% - à § ko/s",191:"Interrompre",192:"Êtes-vous sûr(e) ? [span]Oui[/span] - Non",193:"Il semblerait qu'une erreur improbable vient de se produire... Veuillez réessayer.",194:"Une erreur est survenue lors de l'envoi.",195:"Une erreur est survenue lors du traitement.",196:"Nous vous invitons à [a §]réessayer[/a]."},hu:{103:"Mégsem",104:"Megerősít",105:"Bezár",106:"Előző",107:"Következő",108:"Válasszon fájlt",131:"videó",132:"videosáv",133:"hangsáv",134:"feliratok",135:"ki",142:"előző/következő",143:"lejátszás/szünet",144:"vissza/előre",145:"hangerő csökkentés/növelése",146:"némítás",147:"teljes képernyő",148:"kilépés",149:"Befejezés",150:"Esc"},it:{103:"Annulla",104:"Conferma",105:"Chiudi",106:"Precedente",107:"Successivo",108:"Scegli un file",109:"Scegli uno o più file",124:"Operazione in corso...",125:"Invio in corso...",126:"Trattamento in corso...",132:"traccia video",133:"traccia audio",134:"sottotitoli",135:"inattivo",142:"precedente/successivo",143:"riproduci/pausa",144:"indietro/avanti",145:"riduci/aumenta volume",146:"silenzio",147:"schermo intero",148:"esci",149:"Fine",150:"Esc",161:"Tutti i file sono accettati.",162:"Formato del file accettato: §.",163:"Formati accettati: § et §.",164:"Dimensione massima: § MB.",167:"Formato non autorizzato",168:"Dimensione troppo importante",169:"File vuoto",181:"§% - § kB/s - § minuti rimanenti",182:"§% - § kB/s - § minuto rimanente",183:"§% - § kB/s - § secondi rimanenti",185:"§% - a § kB/s in § minuti",186:"§% - a § kB/s in § minuto",187:"§% - a § kB/s in § secondi",188:"§% - a § kB/s",191:"Interrompere",192:"Sei sicuro? [span]Si[/span] - No",193:"Sembra che un errore inaspettato si sia verificato... Riprova.",194:"Un errore si è verificato durante l'invio.",195:"Un errore si è verificato durante il trattamento.",196:"Vi invitiamo a [a §]riprovare[/a]."},ja:{103:"キャンセル",104:"承認",105:"閉じる",106:"前へ",107:"次へ",108:"ファイルを選択する",131:"ビデオ",132:"ビデオトラック",133:"オーディオトラック",134:"字幕",135:"オフ",142:"前へ/次へ",143:"再生/一時停止",144:"戻る/進む",146:"ミュート",147:"全画面表示",148:"終了",149:"終了",150:"Esc",166:"§ Mo",184:"§% - § Ko/s",192:"よろしいですか?[span]はい[/span] - いいえ"},nl:{103:"Annuleren",104:"Bevestigen",105:"Sluiten",106:"Vorige",107:"Volgende",108:"Kies een bestand",132:"videospoor",133:"audiospoor",134:"ondertitels",135:"uit",142:"vorige/volgende",143:"afspelen/pauzeren",144:"achteruit/vooruit",145:"volume omlaag/omhoog",146:"dempen",147:"schermvullend",148:"afsluiten",150:"Esc"},pl:{103:"Anuluj",104:"Potwierdź",105:"Zamknij",106:"Poprzedni",107:"Następny",108:"Wybierz plik",131:"obraz",132:"ścieżka obrazu",133:"ścieżka dźwiękowa",134:"napisy",135:"wyłączone",142:"poprzedni/następny",143:"odtwarzaj/wstrzymaj",144:"wstecz/przodu",145:"ciszej/głośniej",146:"wycisz",147:"pełny ekran",148:"zakończ",150:"Esc"},pt:{103:"Cancelar",104:"Confirmar",105:"Fechar",106:"Anterior",107:"Seguinte",108:"Escolha um ficheiro",124:"Operação em processo...",125:"Envio em processo...",126:"Tratamento em processo...",131:"vídeo",132:"faixa de vídeo",133:"faixa de áudio",134:"legendas",135:"não",142:"anterior/seguinte",143:"reprodução/pausa",144:"recuar/avançar",145:"diminuir/aumentar volume",146:"sem som",147:"ecrã completo",148:"sair",149:"Fim",150:"Esc",161:"Todos os ficheiros foram aceites.",162:"Formato do ficheiro aceite: §.",163:"Formatos de ficheiro aceites: § e §.",164:"Tamanho máximo: § MB.",181:"§% - § kB/s - § minutos restantes",182:"§% - § kB/s - § minuto restantes",183:"§% - § kB/s - § segundos restantes",185:"§% - § kB/s em § minutos",186:"§% - § kB/s em § minuto",187:"§% - § kB/s em § segundos",188:"§% - § kB/s",192:"Tem a certeza? [span]Sim[/span] - Não",193:"Parece ter acontecido um erro imprevisto. Por favor, tente novamente.",194:"Ocorreu um erro ao enviar.",195:"Ocorreu um erro ao processar.",196:"Convidamo-lo a [a §]tentar novamente[/a]."},ptbr:{107:"Próximo",108:"Escolher um arquivo",124:"Operação em andamento...",125:"Envio em andamento...",126:"Tratamento em andamento...",132:"trilha de vídeo",133:"trilha de áudio",135:"desligado",142:"anterior/próximo",143:"reproduzir/pausar",144:"retroceder/avançar",146:"sem áudio",147:"tela inteira",148:"fechar",149:"Final"},ro:{103:"Anuleaza",104:"Confirmare",105:"Inchide",106:"Anteriorul",107:"Urmatorul",108:"Alege un fișier",132:"pistă video",133:"pistă audio",134:"subtitluri",135:"oprit",142:"anteriorul/urmatorul",143:"redare/pauză",144:"înapoi/înaintează",145:"scade/crește volumul",146:"mut",147:"pe tot ecranul",148:"ieșire",149:"Sfârșit",150:"Esc"},ru:{102:"Ок",103:"Отмена",104:"Подтвердить",105:"Закрыть",106:"Предыдущий",107:"Следующий",108:"Выберите файл",124:"Операция в процессе...",131:"видео",132:"видеодорожка",133:"аудиодорожка",134:"субтитры",135:"выключено",142:"предыдущий/следующий",143:"воспроизведение/пауза",144:"назад/вперед",145:"понизить/повысить громкость",146:"выключить звук",147:"полноэкранный режим",148:"выйти",150:"Esc",161:"Все файлы приняты.",162:"Формат файла: §.",163:"Форматы файлов: § и §.",164:"Максимальный размер: § Мб.",166:"§ Мб",181:"§% - § Кб/s - осталось § минут",182:"§% - § Кб/s - осталось § минут",183:"§% - § Кб/s - осталось § секунд",184:"§% - § Кб/s",185:"§% - § Кб/s за § минут",186:"§% - § Кб/s за § минут",187:"§% - § Кб/s за § секунд",188:"§% - § Кб/s",192:"Вы уверены? [span]Да[/span] - нет",193:"Кажется произошла не предусмотренная ошибка... Попробуйте еще раз.",194:"Возникла ошибка при отправке файла.",195:"Возникла ошибка при обработке файла."},sk:{103:"Zrušiť",104:"Potvrdiť",105:"Zavrieť",106:"Dozadu",107:"Ďalej",108:"Zvoľte si súbor",133:"zvuková stopa",134:"titulky",135:"vypnuté",142:"dozadu/ďalej",143:"prehrať/pozastaviť",144:"dozadu/dopredu",145:"znizit/zvysit hlasitost",146:"stlmiť",148:"koniec",150:"Esc"},tr:{102:"Tamam",103:"İptal",104:"Onayla",105:"Kapat",106:"Önceki",107:"Sonraki",108:"Bir dosya seçin",131:"görüntü",132:"görüntü kaydı",133:"ses kaydı",134:"altyazılar",135:"kapalı",142:"önceki/sonraki",143:"duraklatma/oynatma",144:"geri/i̇leri",145:"ses kısar/açar",146:"sesi kapatma",147:"tam ekran",148:"çıkış",149:"Son",150:"Esc",192:"Emin misiniz ? [span]Evet[/span] - Hayır"},uk:{102:"Гаразд",103:"Відмінити",104:"Підтвердити",105:"Закрити",106:"Попередній",107:"Наступний",108:"Вибрати файл",131:"відео",132:"відеодоріжка",133:"звукова доріжка",134:"субтитри",135:"вимкнено",142:"попередній/наступний",143:"відтворити/призупинити",144:"назад/вперед",145:"зменшити/збільшити гучність",146:"вимкнути звук",148:"вийти",149:"Кінець",150:"Esc",166:"§ МБ",184:"§% - § кБ/s"},zh:{102:"确定",103:"取消",104:"确认",105:"关闭",106:"上一个",107:"下一个",108:"选择文件",131:"视频",132:"视频轨道",133:"音频轨道",134:"字幕",135:"关",142:"上一个/下一个",143:"播放/暂停",144:"快退/快进",145:"音量减/增",146:"静音",147:"全屏",148:"退出",150:"Esc",192:"您确定吗?[span]是[/span] - 否"}},this.init=function(){var t=apijs.config.lang,e=document.querySelector("html");-1<t.indexOf("auto")&&"string"==typeof(t=e.getAttribute("xml:lang")||e.getAttribute("lang"))&&(t=(t=t.replace(/[-_]/g,"").toLowerCase()).slice(0,4),this.data.hasOwnProperty(t)||(t=t.slice(0,2)),this.data.hasOwnProperty(t))&&(apijs.config.lang=t),this.data.hasOwnProperty(t)||(apijs.config.lang="en")},this.translate=function(t){var e=apijs.config.lang,i=1,s="";if("string"!=typeof this.data[e][t])if(3<e.length&&"string"==typeof this.data[e.slice(0,2)][t])e=e.slice(0,2);else{if("en"===e||"string"!=typeof this.data.en[t])return t;e="en"}return 1<arguments.length?(this.data[e][t].split("§").forEach(function(t){s+=i<this.length?t+this[i++]:t},arguments),s):this.data[e][t]},this.translateNode=function(){return document.createTextNode(this.translate.apply(this,arguments))},this.changeLang=function(t){if("string"==typeof t){if(-1<t.indexOf("auto"))return apijs.config.lang="auto",this.init(),!0;if(t=t.replace(/[-_]/g,""),this.data.hasOwnProperty(t))return apijs.config.lang=t,!0}return!1}},apijs.core.select=function(){"use strict";this.init=function(){}},apijs.core.player=function(a,t){"use strict";this.video=a,this.stalled=!1,this.subload=!1,this.autoRun=function(n,t){var o;return n.removeAttribute("src"),n.removeAttribute("data-src"),n.removeAttribute("controls"),n.classList.add("apijsplayer"),n.onloadedmetadata=function(t){this.stalled=!1,this.onTimeupdate(t),this.onProgress(t),this.onVideotrack(),this.onAudiotrack()}.bind(this),n.onstalled=function(t){this.stalled=!0,this.onWaiting(t)}.bind(this),n.onplaying=this.onPlay.bind(this),n.onpause=this.onPlay.bind(this),n.onended=this.onPlay.bind(this),n.onprogress=this.onProgress.bind(this),n.ontimeupdate=this.onTimeupdate.bind(this),n.onseeking=this.onTimeupdate.bind(this),n.onseeked=this.onWaiting.bind(this),n.onwaiting=this.onWaiting.bind(this),n.onloadstart=this.onWaiting.bind(this),n.oncanplay=this.onWaiting.bind(this),n.onclick=this.actionPlay.bind(this),n.onvolumechange=this.actionVolume.bind(this),n.ondurationchange=apijs.dialog.onMediaLoad,n.onerror=apijs.dialog.onMediaLoad,n.parentNode.appendChild(this.htmlSvgPlayer()),t.indexOf("m3u")<0?n.appendChild(this.htmlSource(t)):((o=new XMLHttpRequest).open("GET",t,!0),o.onreadystatechange=function(){if(4===o.readyState)if(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijsplayer.init",xhr:o}})),!n||0<n.childNodes.length)o.abort();else if([0,200].has(o.status)){for(var t,e=0,i=0,s=0,a=o.responseText.trim().split("\n");"string"==typeof(t=a.shift());)0===t.indexOf("#APIJS#attr")?(e=t.split("|"),n.setAttribute(e[1],e[2])):0===t.indexOf("#APIJS#track|subtitles")?(e=t.split("|"),this.html(".tracks.texttrack select").appendChild(this.htmlOption(s++,e[3]+" - "+e[2])),n.appendChild(this.htmlTrack(e))):0===t.indexOf("#EXTINF")?e=t.replace(/#EXTINF:\d+,/,""):5<t.length&&"#"!==t[0]&&(this.html(".tracks.video select").appendChild(this.htmlOption(i++,"string"==typeof e?e:i)),n.appendChild(this.htmlSource(t)));this.updateSelect("video",i),"object"==typeof n.textTracks&&this.updateSelect("texttrack",n.textTracks.length||s)}else apijs.dialog.onMediaLoad({type:"error"})}.bind(this),o.send()),this},this.updateSelect=function(t,e){var i="texttrack"===t?1:0;i<e?(this.html(".tracks."+t).removeAttribute("style"),this.html(".tracks."+t+" em").textContent="("+e+")",this.html(".tracks."+t+" select").setAttribute("size",e<10?e+i:10)):(this.html(".tracks."+t).setAttribute("style","display:none;"),this.html(".tracks."+t+" select").innerHTML="")},this.html=function(t){return this.video.parentNode.querySelector(t)},this.onVideotrack=function(){var t,e=this.video.videoTracks,i=this.html(".tracks.videotrack select"),s=apijs.config.lang,a=-1;if("object"==typeof e){if(1<e.length){for(t=0;t<e.length;t++)e[t].language&&0==e[t].language.toLowerCase().replace(/[-_]/g,"").indexOf(s)&&(a=a<0?t:a),i.appendChild(this.htmlOption(t,e[t]));this.updateSelect("videotrack",e.length)}i.selectedIndex=Math.max(0,a),0<=a&&this.actionVideotrack(a)}},this.onAudiotrack=function(){var t,e=this.video.audioTracks,i=this.html(".tracks.audiotrack select"),s=apijs.config.lang,a=-1;if("object"==typeof e){if(1<e.length){for(t=0;t<e.length;t++)e[t].language&&0==e[t].language.toLowerCase().replace(/[-_]/g,"").indexOf(s)&&(a=a<0?t:a),i.appendChild(this.htmlOption(t,e[t]));this.updateSelect("audiotrack",e.length)}i.selectedIndex=Math.max(0,a),0<=a&&this.actionAudiotrack(a)}},this.onTimeupdate=function(t){var e,i,s,a=this.video.currentTime,n=this.video.duration,o="--:--";isNaN(a)||n===1/0||isNaN(n)||(o=(0<(e=Math.floor(a/3600))?e+":":"")+(i=(i=Math.floor(a%3600/60))<10?"0"+i:i)+":"+(s=(s=Math.floor(a%60))<10?"0"+s:s),o+=" / "+(0<(e=Math.floor(n/3600))?e+":":"")+(i=(i=Math.floor(n%3600/60))<10?"0"+i:i)+":"+(s=(s=Math.floor(n%60))<10?"0"+s:s),this.html("svg.bar rect").style.width=a/n*100+"%"),this.html("span.time").textContent=o,this.stalled&&!this.subload&&(this.stalled=!1,this.onWaiting(t))},this.onProgress=function(){var t,e,i=this.video,s=this.html("svg.bar"),a=i.buffered.length;if(0<a&&i.duration!==1/0&&!isNaN(i.duration))for(s.querySelectorAll(".buffer").forEach(function(t){t.remove()});0<a--;)(e=document.createElement("rect")).setAttribute("class","buffer"),99.8<(t=(i.buffered.end(a)-i.buffered.start(a))/i.duration*100)?e.setAttribute("style","left:0%; width:100%;"):e.setAttribute("style","left:"+i.buffered.start(a)/i.duration*100+"%; width:"+t+"%;"),s.appendChild(e)},this.onPlay=function(){[1,2].has(this.video.networkState)&&(this.video.paused?(this.html("span.play").textContent="",(apijs.dialog.t1?apijs.dialog:this.video.parentNode.classList).remove("playing")):(this.html("span.play").textContent="",(apijs.dialog.t1?apijs.dialog:this.video.parentNode.classList).add("playing")))},this.onWaiting=function(t){apijs.log("player:video:onWaiting:"+t.type+" stalled:"+this.stalled+"/subload:"+this.subload),apijs.dialog[["loadstart","waiting","seeking","stalled"].has(t.type)?"add":"remove"]("loading")},this.actionPlay=function(){var t=this.video;if(apijs.dialog.swipe)return!1;[1,2].has(t.networkState)&&(t.ended||t.paused?t.play():t.pause())},this.actionVolume=function(t){var e=this.video,i=this.html("svg.vol"),s=i.offsetWidth,a=0;if([1,2].has(e.networkState)){if("object"==typeof t&&!isNaN(t.clientX)){for(;a+=i.offsetLeft,i=i.offsetParent;);a=100*(t.clientX-a)/s/100,e.volume=a=a<.2?0:.92<a?1:a,e.muted=!1}this.html("svg.vol rect").style.width=e.muted?0:100*e.volume+"%"}},this.actionPosition=function(t){var e=this.video,i=this.html("svg.bar"),s=i.offsetWidth,a=0;if([1,2].has(e.networkState)&&e.duration!==1/0&&!isNaN(e.duration)&&"object"==typeof t){for(;a+=i.offsetLeft,i=i.offsetParent;);a=e.duration*(t.clientX-a)*100/s/100,e.currentTime=a=a<=1?0:a}},this.actionVideotrack=function(t){var e,i=this.video.videoTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].enabled=e==s;--a.currentTime}"object"==typeof t&&t.target.blur()},this.actionAudiotrack=function(t){var e,i=this.video.audioTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].enabled=e==s;--a.currentTime}"object"==typeof t&&t.target.blur()},this.actionTexttrack=function(t){var e,i=this.video.textTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].mode=e==s?"showing":"hidden";this.subload=!0}"object"==typeof t&&t.target.blur()},this.actionVideo=function(t){this.html("svg.bar rect").style.width="0",this.html("svg.bar").querySelectorAll(".buffer").forEach(function(t){t.remove()}),this.html("span.play").textContent="",this.updateSelect("videotrack",0),this.updateSelect("audiotrack",0),this.video.src=this.video.querySelectorAll("source")["object"==typeof t?t.target.value:t].src,"object"==typeof t&&t.target.blur()},this.actionFullscreen=function(){var t=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;this.video.parentNode.classList[t?"add":"remove"]("fullscreen")},this.htmlSvgPlayer=function(){var t,e,i,s=document.createElement("div");return s.setAttribute("class","apijsplayer noplaying"),(i=document.createElement("span")).setAttribute("class","btn play fnt"),i.appendChild(document.createTextNode("")),i.onclick=this.actionPlay.bind(this),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","svg bar"),(e=document.createElement("svg")).setAttribute("class","bar"),e.onclick=this.actionPosition.bind(this),t=document.createElement("rect"),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","time"),i.appendChild(document.createTextNode("--:--")),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","svg vol"),(e=document.createElement("svg")).setAttribute("class","vol"),e.onclick=this.actionVolume.bind(this),t=document.createElement("rect"),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks audiotrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(133)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionAudiotrack.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks videotrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(132)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionVideotrack.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks video"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(131)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionVideo.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks texttrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(134)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionTexttrack.bind(this),(t=document.createElement("option")).appendChild(apijs.i18n.translateNode(135)),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","btn full fnt"),i.appendChild(document.createTextNode("")),i.onclick=function(){apijs.dialog.t1?apijs.requestFullscreen(apijs.dialog.t1):(document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",this.actionFullscreen.bind(this)):document.fullscreenEnabled?document.addEventListener("fullscreenchange",this.actionFullscreen.bind(this)):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",this.actionFullscreen.bind(this)),apijs.requestFullscreen(this.video.parentNode))}.bind(this),s.appendChild(i),s},this.htmlTrack=function(t){var e=document.createElement("track");return e.setAttribute("kind",t[1]),e.setAttribute("label",t[2]),e.setAttribute("srclang",t[3]),e.setAttribute("src",t[4]),e.onload=function(t){apijs.log("player:track:onload "+t.target.src.slice(t.target.src.lastIndexOf("/")+1)),"showing"===t.target.track.mode&&(this.onWaiting(t),this.subload=!1)}.bind(this),e.onerror=function(t){apijs.log("player:track:onerror "+t.target.src.slice(t.target.src.lastIndexOf("/")+1)),"showing"===t.target.track.mode&&(this.onWaiting(t),this.subload=!1)}.bind(this),e},this.htmlSource=function(t){var e=document.createElement("source");return e.setAttribute("src",t),e.onerror=apijs.dialog.onMediaLoad,e},this.htmlOption=function(t,e){"object"==typeof e&&(e=""===e.label?e.language.toLowerCase():e.language.toLowerCase()+" - "+e.label);var i=document.createElement("option");return i.setAttribute("value",t),i.appendChild(document.createTextNode(e)),i},this.autoRun(a,t)},apijs.core.dialog=function(){"use strict";this.klass=[],this.height=0,this.scroll=0,this.callback=null,this.args=null,this.xhr=null,this.ft=/information|confirmation|options|upload|progress|waiting|photo|video|iframe|ajax|start|ready|end|reduce|mobile|tiny|fullscreen/g,this.ti="a,area,button,input,textarea,select,object,iframe",this.ns="http://www.w3.org/2000/svg",this.swipe=!1,this.media=null,this.t0=null,this.t1=null,this.t2=null,this.t3=null,this.a=null,this.b=null,this.c=null,this.dialogInformation=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("information",i).htmlParent().htmlContent(t,e).htmlBtnOk().show("button.confirm"):(console.error("apijs.dialog.dialogInformation invalid arguments",arguments),!1)},this.dialogConfirmation=function(t,e,i,s,a){return"string"==typeof t&&"string"==typeof e&&"function"==typeof i?(this.callback=i,this.args=s,this.init("confirmation",a).htmlParent().htmlContent(t,e).htmlBtnConfirm("button","apijs.dialog.actionConfirm();").show("button.confirm")):(console.error("apijs.dialog.dialogConfirmation invalid arguments",arguments),!1)},this.dialogFormOptions=function(t,e,i,s,a,n){return"string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"function"==typeof s?(this.callback=s,this.args=a,this.init("options",n).htmlParent(i,"apijs.dialog.actionConfirm();").htmlContent(t,e).htmlBtnConfirm("submit").show(!0)):(console.error("apijs.dialog.dialogFormOptions invalid arguments",arguments),!1)},this.dialogFormUpload=function(t,e,i,s,a,n){return"string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("upload",n).htmlParent(i,"apijs.upload.actionConfirm();","apijs.upload.actionDrag(event);").htmlContent(t,e).htmlUpload(s,"boolean"==typeof a&&a,"apijs.upload.actionChoose(this);").htmlBtnConfirm("submit").show("button.browse"):(console.error("apijs.dialog.dialogFormUpload invalid arguments",arguments),!1)},this.dialogProgress=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("progress",i).htmlParent().htmlContent(t,e).htmlSvgProgress().show():(console.error("apijs.dialog.dialogProgress invalid arguments",arguments),!1)},this.dialogWaiting=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("waiting",i).htmlParent().htmlContent(t,e).htmlSvgLoader(!1).show():(console.error("apijs.dialog.dialogWaiting invalid arguments",arguments),!1)},this.dialogPhoto=function(t,e,i,s,a){var n="string"==typeof a;return a=n?"notransition slideshow loading "+a:"notransition loading","string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("photo",a).htmlParent().htmlMedia(t,e,i,s).htmlHelp(n,!1).htmlBtnClose().htmlBtnNavigation().htmlSvgLoader().show():(console.error("apijs.dialog.dialogPhoto invalid arguments",arguments),!1)},this.dialogVideo=function(t,e,i,s,a){var n="string"==typeof a;return a=n?"notransition slideshow loading "+a:"notransition loading","string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("video",a).htmlParent().htmlMedia(t,e,i,s).htmlHelp(n,t.indexOf("iframe")<0).htmlBtnClose().htmlBtnNavigation().htmlSvgLoader().show():(console.error("apijs.dialog.dialogVideo invalid arguments",arguments),!1)},this.dialogIframe=function(t,e,i){return"string"==typeof t&&"boolean"==typeof e?this.init("iframe","string"==typeof i?i+" loading":"loading",!e).htmlParent().htmlIframe(t).htmlBtnClose(e).htmlSvgLoader(!1).show():(console.error("apijs.dialog.dialogIframe invalid arguments",arguments),!1)},this.dialogAjax=function(t,e,i,s,a){return"string"==typeof t&&"boolean"==typeof e&&"function"==typeof i?(this.callback=i,this.args=s,this.init("ajax","string"==typeof a?a+" loading":"loading",!e).htmlParent().htmlBtnClose(e).htmlSvgLoader(!1).show(),this.xhr=new XMLHttpRequest,this.xhr.open("GET",t,!0),this.xhr.onreadystatechange=function(){4===this.xhr.readyState&&"function"==typeof this.callback&&(this.callback(this.xhr,this.args),this.remove("loading"))}.bind(this),this.xhr.send(),this):(console.error("apijs.dialog.dialogAjax invalid arguments",arguments),!1)},this.update=function(){return this.has("start","ready","end")&&(this.t1&&this.t1.setAttribute("class",this.klass.join(" ")),this.t2)&&this.t2.setAttribute("class",this.klass.join(" ")),this},this.add=function(){return Array.prototype.forEach.call(arguments,function(t){"string"!=typeof t&&console.error("apijs.dialog.add argument is not a string",t),this.klass.indexOf(t)<0&&this.klass.push(t)},this),this.update()},this.remove=function(){return Array.prototype.forEach.call(arguments,function(t){"string"!=typeof t&&console.error("apijs.dialog.remove argument is not a string",t),-1<this.klass.indexOf(t)&&this.klass.splice(this.klass.indexOf(t),1)},this),this.update()},this.toggle=function(t,e){return"string"==typeof t&&"string"==typeof e||console.error("apijs.dialog.toggle argument is not a string",t,e),this.has(t)&&this.remove(t),this.has(e)||this.add(e),this.update()},this.has=function(){return this.klass.has(apijs.toArray(arguments))},this.actionClose=function(t){apijs.config.slideshow.anchor&&"function"==typeof history.pushState&&new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)&&history.pushState({},"",self.location.href.slice(0,self.location.href.indexOf("#"))),"object"==typeof t?"apijsDialog"!==t.target.getAttribute("id")||apijs.dialog.has("photo","video","progress","waiting","lock")||apijs.dialog.clear(!0):this.t1&&this.clear(!0)},this.onCloseBrowser=function(t){if(apijs.dialog.has("progress","waiting","lock"))return t.preventDefault(),t.stopPropagation(),t.m=apijs.i18n.translate(124),t.returnValue=t.m,t.m},this.onResizeBrowser=function(){var t=document.querySelector("body").clientWidth;apijs.dialog[t<=(apijs.dialog.has("photo","video")?900:460)?"add":"remove"]("mobile"),apijs.dialog[t<=300?"add":"remove"]("tiny")},this.onScrollBrowser=function(t){var e=apijs.dialog,i=t.target,s=!1;if(e.has("slideshow")&&!e.has("playing")&&!["OPTION","SELECT"].has(i.nodeName)&&["DOMMouseScroll","mousewheel","swipeleft","swiperight","swipeup","swipedown","swiped-left","swiped-right","swiped-up","swiped-down"].has(t.type))i=(new Date).getTime()/1e3,(e.scroll<1||i>e.scroll+1)&&(e.scroll=i,s=0<t.detail||t.wheelDelta<0,apijs.slideshow[["swipeleft","swipeup","swiped-left","swiped-up"].has(t.type)||s?"actionNext":"actionPrev"]());else{if("OPTION"===i.nodeName)i=i.parentNode;else if(!["TEXTAREA","SELECT"].has(i.nodeName))for(;!0!==s&&"HTML"!==i.nodeName;)i.classList.contains("scrollable")?s=!0:i=i.parentNode;if(i.scrollHeight>i.offsetHeight&&"HTML"!==i.nodeName&&((s=0<t.detail||t.wheelDelta<0)&&i.scrollTop<i.scrollHeight-i.offsetHeight-1||!s&&0<i.scrollTop))return}t.preventDefault(),t.stopPropagation()},this.onScrollIframe=function(t){for(var e,i=t.target;i.parentNode;)i=i.parentNode;((e=0<t.detail||t.wheelDelta<0)&&i.defaultView.innerHeight+i.defaultView.scrollY>=i.body.offsetHeight-1||!e&&i.defaultView.scrollY<=0)&&(t.preventDefault(),t.stopPropagation())},this.onKey=function(t){var e,i=apijs.dialog,s=i.media;i.has("progress","waiting","lock")?(t.ctrlKey&&[81,87,82,115,116].has(t.keyCode)||t.altKey&&115===t.keyCode||[27,116].has(t.keyCode))&&t.preventDefault():i.has("photo","video")&&122===t.keyCode?(t.preventDefault(),apijs.requestFullscreen(i.t1)):i.has("slideshow")?27===t.keyCode?(t.preventDefault(),i.actionClose()):35===t.keyCode?(t.preventDefault(),apijs.slideshow.actionLast()):36===t.keyCode?(t.preventDefault(),apijs.slideshow.actionFirst()):37===t.keyCode?(t.preventDefault(),apijs.slideshow.actionPrev()):39===t.keyCode&&(t.preventDefault(),apijs.slideshow.actionNext()):27===t.keyCode&&(t.preventDefault(),i.actionClose()),i.has("video")&&!i.has("videoiframe")&&([32,80].has(t.keyCode)?(t.preventDefault(),[1,2].has(s.networkState)&&(s.ended||s.paused?s.play():s.pause())):[38,33].has(t.keyCode)?(t.preventDefault(),e=38===t.keyCode?10:60,[1,2].has(s.networkState)&&s.duration!==1/0&&!isNaN(s.duration)&&(s.currentTime>e?s.currentTime-=e:s.currentTime=0)):[40,34].has(t.keyCode)?(t.preventDefault(),[1,2].has(s.networkState)&&s.duration!==1/0&&!isNaN(s.duration)&&(e=40===t.keyCode?10:60,s.currentTime<s.duration-e)&&(s.currentTime+=e)):107===t.keyCode?(t.preventDefault(),[1,2].has(s.networkState)&&(s.muted&&(s.muted=!1),s.volume<.8?s.volume+=.2:s.volume=1)):109===t.keyCode?(t.preventDefault(),[1,2].has(s.networkState)&&(s.muted&&(s.muted=!1),.21<s.volume?s.volume-=.2:s.volume=0)):77===t.keyCode&&(t.preventDefault(),[1,2].has(s.networkState))&&(s.muted=!s.muted)),![32,33,34,35,36,38,40].has(t.keyCode)||t.target&&(["INPUT","TEXTAREA","OPTION","SELECT"].has(t.target.nodeName)||t.target.classList.contains("scrollable"))||(t.preventDefault(),t.stopPropagation())},this.onFullscreen=function(t){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;t&&apijs.log("dialog:onFullscreen:"+(e?"in":"out")),apijs.dialog[e?"add":"remove"]("fullscreen")},this.onIframeLoad=function(t){t.removeAttribute("class"),apijs.dialog.remove("loading"),t.contentWindow.document.addEventListener("keydown",window.parent.apijs.dialog.onKey),t.contentWindow.addEventListener("DOMMouseScroll",window.parent.apijs.dialog.onScrollIframe,{passive:!1}),t.contentWindow.addEventListener("mousewheel",window.parent.apijs.dialog.onScrollIframe,{passive:!1}),t.contentWindow.addEventListener("touchmove",window.parent.apijs.dialog.onScrollIframe,{passive:!1})},this.onMediaLoad=function(t){var e,i=apijs.dialog,s=i.media;t&&t.target&&(e=t.target.currentSrc||t.target.src,apijs.log("dialog:onMediaLoad:"+t.type+" "+(e?e.slice(e.lastIndexOf("/")+1):""))),s&&["load","durationchange"].has(t.type)?(i.remove("loading","error"),s.style.visibility="visible",s.hasAttribute("src")||"IMG"!==s.nodeName||s.setAttribute("src",s.imageLoader.src)):s&&"error"===t.type&&(i.toggle("loading","error"),s.removeAttribute("style"),e=apijs.html(".tracks.video select"))&&t&&t.target&&0<(i=e.querySelectorAll("option")).length&&0<e.value.length&&(i[e.value].setAttribute("disabled","disabled"),e.selectedIndex+=1,"VIDEO"===t.target.nodeName)&&""!==e.value&&s.videoPlayer.actionVideo(e)},this.onSlideshowSwipe=function(t){apijs.dialog.swipe=!0,self.setTimeout(function(){apijs.dialog.swipe=!1},150),["swiperight","swipedown","swiped-right","swiped-down"].has(t.type)?apijs.slideshow.actionPrev():apijs.slideshow.actionNext()},this.actionConfirm=function(){return this.has("options")&&!0!==this.callback(!1,this.args)||(this.add("lock","loading"),this.htmlSvgLoader(!1),apijs.html("div.btns").style.visibility="hidden",apijs.html("div.bbcode").style.visibility="hidden",self.setTimeout(function(){this.t2&&"FORM"===this.t2.nodeName?this.callback(this.t2.getAttribute("action"),this.args):this.t2&&this.callback(this.args)}.bind(this),12)),!1},this.init=function(t,e,i){return i=!0===i,"string"==typeof e?e=0<(e=e.replace(this.ft,"").trim()).length?i?e+" lock":e:i?"lock":null:i&&(e="lock"),this.t0&&this.clear(!1),this.klass.push("start"),this.klass.push(t),self.matchMedia("prefers-reduced-motion:reduce").matches&&this.klass.push("reduce"),"string"==typeof e&&(this.klass=this.klass.concat(e.split(" "))),this.t0=document.createDocumentFragment(),document.addEventListener("keydown",this.onKey),self.addEventListener("beforeunload",this.onCloseBrowser),self.addEventListener("DOMMouseScroll",this.onScrollBrowser,{passive:!1}),self.addEventListener("mousewheel",this.onScrollBrowser,{passive:!1}),self.addEventListener("touchmove",this.onScrollBrowser,{passive:!1}),self.addEventListener("resize",this.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.setAttribute("tabindex","-1")}),this},this.show=function(t){this.onResizeBrowser(),this.onFullscreen(),0<this.height&&!this.has("photo","video")&&(this.t2.style.minHeight=this.height+"px");var e=apijs.html("#Dialog");return e?(this.toggle("start","ready"),this.t1=e,apijs.toArray(this.t0.firstChild.childNodes).forEach(function(t){this.t1.appendChild(t)},this),this.t1.setAttribute("class",this.t2.getAttribute("class"))):this.has("notransition")?(this.toggle("start","ready"),document.querySelector("body").appendChild(this.t0)):(document.querySelector("body").appendChild(this.t0),self.setTimeout(function(){apijs.dialog.toggle("start","ready")},12)),apijs.config.dialog.closeOnClick&&!this.has("progress","waiting","lock")&&document.addEventListener("click",this.actionClose),this.has("photo","video")?document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",this.onFullscreen):document.fullscreenEnabled?document.addEventListener("fullscreenchange",this.onFullscreen):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",this.onFullscreen):this.has("upload")&&window.addEventListener("paste",apijs.upload.actionDrag),!0===t?self.setTimeout(function(){apijs.html("input:not([readonly]),textarea:not([readonly]),select:not([disabled])").focus()},12):"string"==typeof t&&apijs.html(t).focus(),!0},this.clear=function(t){if(t&&this.xhr&&(this.callback=null,this.xhr.abort()),this.hammer&&(this.hammer.off("swiperight swipedown swipeleft swipeup",apijs.dialog.onSlideshowSwipe).destroy(),delete this.hammer),document.removeEventListener("keydown",this.onKey),self.removeEventListener("beforeunload",this.onCloseBrowser),self.removeEventListener("DOMMouseScroll",this.onScrollBrowser,{passive:!1}),self.removeEventListener("mousewheel",this.onScrollBrowser,{passive:!1}),self.removeEventListener("touchmove",this.onScrollBrowser,{passive:!1}),self.removeEventListener("resize",this.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.removeAttribute("tabindex")}),apijs.config.dialog.closeOnClick&&document.removeEventListener("click",this.actionClose),this.has("photo","video")?(this.has("video")&&!this.has("videoiframe")&&this.t2.querySelectorAll("video, source, track").forEach(function(t){for(var e in t)0===e.indexOf("on")&&(t[e]=null);t.removeAttribute("src")}),this.media.videoPlayer=null,this.media.imageLoader=null,document.webkitFullscreenEnabled?document.removeEventListener("webkitfullscreenchange",this.onFullscreen):document.fullscreenEnabled?document.removeEventListener("fullscreenchange",this.onFullscreen):document.mozFullScreenEnabled&&document.removeEventListener("mozfullscreenchange",this.onFullscreen)):(this.has("upload")&&window.removeEventListener("paste",apijs.upload.actionDrag),this.height=parseFloat(self.getComputedStyle(this.t2).height)),t)this.toggle("ready","end"),this.t1.remove();else for(;this.t1.firstChild;)this.t1.firstChild.remove();return this.klass=[],t&&(this.height=0,this.scroll=0,this.callback=null,this.args=null,this.xhr=null),this.media=null,this.t0=null,this.t1=null,this.t2=null,this.t3=null,this.a=null,this.b=null,!(this.c=null)},this.htmlParent=function(t,e,i){return this.t1=document.createElement("div"),this.t1.setAttribute("id","apijsDialog"),"string"==typeof i?(this.t1.setAttribute("ondragenter",i),this.t1.setAttribute("ondragleave",i),this.t1.setAttribute("ondragover",i),this.t1.setAttribute("ondrop",i),this.t1.setAttribute("onpaste",i),this.a=document.createElement("p"),this.a.setAttribute("class","drag"),this.a.appendChild(apijs.i18n.translateNode(127)),this.t1.appendChild(this.a)):this.t1.setAttribute("ondragstart","return false;"),"string"==typeof t?(this.t2=document.createElement("form"),this.t2.setAttribute("action",t),this.t2.setAttribute("method","post"),this.t2.setAttribute("enctype","multipart/form-data"),this.t2.setAttribute("onsubmit","return "+e)):this.t2=document.createElement("div"),this.t2.setAttribute("id","apijsBox"),this.t1.appendChild(this.t2),this.t0.appendChild(this.t1),this},this.htmlContent=function(t,e){return 0<t.length&&(this.a=document.createElement("h1"),this.a.innerHTML=t.replace(/</g,"<").replace(/>/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.t2.appendChild(this.a)),0<e.length&&(this.a=document.createElement("div"),this.a.setAttribute("class","bbcode"),"["!==e[0]&&(e="[p]"+e+"[/p]"),this.a.innerHTML=e.replace(/</g,"<").replace(/>/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.a.querySelectorAll("a.popup").forEach(function(t){t.addEventListener("click",apijs.openTab)}),this.t2.appendChild(this.a)),this},this.htmlBtnOk=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","confirm"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(102)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnConfirm=function(t,e){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type",t),this.b.setAttribute("class","confirm"),"submit"!==t&&this.b.setAttribute("onclick",e),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(104)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","cancel"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(103)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnNavigation=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","navigation noplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","prev"),this.b.setAttribute("id","apijsPrev"),this.b.setAttribute("onclick","apijs.slideshow.actionPrev();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","next"),this.b.setAttribute("id","apijsNext"),this.b.setAttribute("onclick","apijs.slideshow.actionNext();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),"function"==typeof Hammer&&(this.hammer=new Hammer(this.t2),this.hammer.get("swipe").set({direction:Hammer.DIRECTION_ALL}),this.hammer.on("swiperight swipedown swipeleft swipeup",apijs.dialog.onSlideshowSwipe)),this},this.htmlBtnClose=function(t){return!1!==t&&(this.a=document.createElement("div"),this.a.setAttribute("class","close nofullplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","close"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(105)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a)),this},this.htmlUpload=function(t,e,i){return this.a=document.createElement("div"),this.a.setAttribute("class","btns upload"),this.t3=document.createElement("input"),this.t3.setAttribute("type","file"),this.t3.setAttribute("name",e?t+"[]":t),this.t3.setAttribute("id","apijsFile"),e&&this.t3.setAttribute("multiple","multiple"),this.t3.setAttribute("onchange",i),this.a.appendChild(this.t3),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","browse"),this.b.setAttribute("onclick","this.previousSibling.click();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(e?109:108)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("div"),this.b.setAttribute("class","filenames scrollable"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgProgress=function(){return this.a=document.createElement("span"),this.a.setAttribute("class","info"),this.t2.appendChild(this.a),this.a=document.createElement("svg"),this.a.setAttribute("id","apijsProgress"),this.b=document.createElement("rect"),this.b.setAttribute("class","auto"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgLoader=function(t){return this.a=document.createElementNS(this.ns,"svg"),this.a.setAttribute("class","loader"),this.b=document.createElementNS(this.ns,"path"),!1!==t&&this.b.setAttribute("style","opacity:0;"),this.b.setAttribute("d","M75.4 126.63a11.43 11.43 0 0 1-2.1-22.65 40.9 40.9 0 0 0 30.5-30.6 11.4 11.4 0 1 1 22.27 4.87h.02a63.77 63.77 0 0 1-47.8 48.05v-.02a11.38 11.38 0 0 1-2.93.37z"),this.c=document.createElementNS(this.ns,"animateTransform"),this.c.setAttribute("attributeName","transform"),this.c.setAttribute("type","rotate"),this.c.setAttribute("from","0 64 64"),this.c.setAttribute("to","360 64 64"),this.c.setAttribute("dur","5s"),this.c.setAttribute("repeatCount","indefinite"),this.b.appendChild(this.c),this.c=document.createElementNS(this.ns,"animate"),this.c.setAttribute("attributeName","opacity"),this.c.setAttribute("to","1"),this.c.setAttribute("dur","0.01s"),this.c.setAttribute("begin","1s"),this.c.setAttribute("fill","freeze"),!1!==t&&this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlMedia=function(t,e,i,s){var a;return this.a=document.createElement("dl"),this.a.setAttribute("class","media"),this.b=document.createElement("dt"),this.has("photo")?(this.media=document.createElement("img"),this.media.setAttribute("alt",s.replace('"',""))):0<t.indexOf("iframe")?(this.media=document.createElement("iframe"),this.media.setAttribute("type","text/html"),this.media.setAttribute("scrolling","no"),this.media.setAttribute("src",t)):(this.media=document.createElement("video"),this.media.setAttribute("controls","controls"),this.media.setAttribute("preload","metadata")),this.media.setAttribute("id","apijsMedia"),this.b.appendChild(this.media),this.a.appendChild(this.b),this.b=document.createElement("dd"),this.b.setAttribute("class","nofullplaying"),"false"===e&&"false"===i||(a=t.slice(t.lastIndexOf("/")+1),this.c=document.createElement("span"),"false"!==e&&"auto"!==e&&"false"!==i?this.c.appendChild(document.createTextNode(e+" ("+i+") ")):"false"!==e&&"auto"!==e?this.c.appendChild(document.createTextNode(e+" ")):"auto"===e&&"false"!==i?this.c.appendChild(document.createTextNode(a+" ("+i+") ")):"auto"===e?this.c.appendChild(document.createTextNode(a+" ")):"false"!==i&&this.c.appendChild(document.createTextNode("("+i+") ")),this.b.appendChild(this.c)),this.b.appendChild(document.createTextNode(s)),this.a.appendChild(this.b),this.t2.appendChild(this.a),this.has("photo")?(this.media.imageLoader=new Image,this.media.imageLoader.src=t,this.media.imageLoader.onload=this.onMediaLoad,this.media.imageLoader.onerror=this.onMediaLoad):0<t.indexOf("iframe")?(this.media.onload=function(t){this.onIframeLoad(this.media),this.onMediaLoad(t)}.bind(this),this.add("videoiframe")):apijs.startPlayer(this.media,t)?this.add("apijsvideoplayer"):(this.c=document.createElement("source"),this.c.setAttribute("src",t),this.c.onerror=this.onMediaLoad,this.media.appendChild(this.c),this.media.ondurationchange=this.onMediaLoad,this.media.onerror=this.onMediaLoad,this.add("videosource")),this},this.htmlHelp=function(t,e){if(!("ontouchstart"in window&&navigator.userAgent.match(/mobi/i))){var i,s,a=[t?["start",149,141]:[],t?["left","right",142]:[],e?["topk","bottom",144]:[],e?["minus","plus",145]:[],e?["M",146]:[],e?["P",143]:[],["F11",147],[150,148]];for(this.a=document.createElement("ul"),this.a.setAttribute("class","kbd nofullscreen");i=a.shift();)if(0<i.length){for(this.b=document.createElement("li");s=i.shift();)0<i.length?(this.c=document.createElement("kbd"),["M","P","F11"].has(s)?this.c.appendChild(document.createTextNode(s)):"string"==typeof s?this.c.setAttribute("class",s):this.c.appendChild(apijs.i18n.translateNode(s)),this.b.appendChild(this.c)):this.b.appendChild(apijs.i18n.translateNode(s));this.a.appendChild(this.b)}this.t2.appendChild(this.a)}return this},this.htmlIframe=function(t){return this.a=document.createElement("iframe"),this.a.setAttribute("src",t),this.a.setAttribute("class","loading"),this.a.setAttribute("onload","apijs.dialog.onIframeLoad(this);"),this.t2.appendChild(this.a),this}},apijs.core.slideshow=function(){"use strict";this.current=null,this.init=function(){for(var t,e,i,s=apijs.config.slideshow.ids,a=0;e=apijs.html(s+"."+a,!0);a++){for(i=e.classList.contains("hoverload"),t=0;e=apijs.html(s+"."+a+"."+t,!0);t++)e.addEventListener("click",this.show),i&&e.addEventListener("mouseover",this.show);(e=apijs.html(s+"."+a+".99999",!0))&&e.addEventListener("click",this.show)}this.onPopState()},this.onPopState=function(){var t;new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)?(t=RegExp.$1.replace(/-/g,"."),apijs.html(t,!0)&&!apijs.dialog.has("slideshow")&&apijs.slideshow.show(t,!1)):apijs.slideshow.current&&apijs.dialog.actionClose()},this.show=function(t,e){var i,s,a,n=!1,o={};if("string"==typeof t)i=apijs.html(t,n=!0),o.id=t;else{for(t.preventDefault(),i=t.target;"A"!==i.nodeName;)i=i.parentNode;if("mouseover"===t.type&&i.classList.contains("current"))return!1;o.id=i.getAttribute("id")}return o.prefix=apijs.config.slideshow.ids+"."+o.id.split(".")[1],o.number=parseInt(o.id.split(".")[2],10),o.gallery=apijs.html(o.prefix+".99999",!0),99999!==o.number&&(t=apijs.html(o.prefix,!0).querySelectorAll("a[id][type]"),a=apijs.html(o.prefix,!0).querySelectorAll("dl"),(o.gallery||t.length!==a.length?(t.forEach(function(t){t.classList.remove("current")}),i):(a.forEach(function(t){t.classList.remove("current")}),i.parentNode.parentNode)).setAttribute("class","current")),o.gallery?(99999===o.number&&(n=!0,i=o.gallery.hasAttribute("class")?o.gallery.getAttribute("class"):o.prefix+".0",i=apijs.html(i,!0),o.number=parseInt(i.getAttribute("id").split(".")[2],10),o.id=o.id.replace("99999",o.number)),o.config=i.querySelector("input").getAttribute("value").split("|"),0<(t=o.config.shift()).indexOf(";")&&(s=(t=t.split(";"))[1].trim(),t=t[0].trim()),o.gallery.setAttribute("href",i.getAttribute("href")),o.gallery.querySelector("img").setAttribute("src",t),o.gallery.querySelector("img").setAttribute("srcset",s||""),o.gallery.querySelector("img").setAttribute("alt",i.querySelector("img").getAttribute("alt")),o.gallery.setAttribute("class",o.id)):(n=!0,o.config=i.querySelector("input").getAttribute("value").split("|")),o.url=i.getAttribute("href"),o.type=i.getAttribute("type").substring(0,5).replace("image","dialogPhoto").replace("video","dialogVideo").replace("audio","dialogVideo"),o.type=0===o.type.indexOf("dialog")?o.type:"dialogPhoto",o.styles=apijs.html(o.prefix,!0),o.styles=o.styles.hasAttribute("class")?o.styles.getAttribute("class").replace(/gallery|album/g,"").trim():"",n&&(apijs.dialog[o.type](o.url,o.config[0],o.config[1],o.config[2],o.styles),a=apijs.html(o.prefix,!0).querySelectorAll("a[id][type]").length-(o.gallery?2:1),apijs.slideshow.current={number:o.number,first:o.prefix+".0",prev:0<o.number?o.prefix+"."+(o.number-1):null,next:o.number<a?o.prefix+"."+(o.number+1):null,last:o.prefix+"."+a,total:a},apijs.slideshow.current.prev&&apijs.html("#Prev").removeAttribute("disabled"),apijs.slideshow.current.next&&apijs.html("#Next").removeAttribute("disabled"),apijs.config.slideshow.anchor)&&"function"==typeof history.pushState&&("boolean"!=typeof e||e)&&(t=0<(t=self.location.href).indexOf("#")?t.slice(0,t.indexOf("#")):t,t+="#"+(o.prefix+"."+(99999===o.number?0:o.number)).replace(/\./g,"-"),history.pushState({},"",t)),n},this.actionFirst=function(){return!!(this.current&&0<this.current.number&&this.current.number<=this.current.total)&&this.show(this.current.first)},this.actionPrev=function(){return!!(this.current&&this.current.prev&&0<this.current.number)&&this.show(this.current.prev)},this.actionNext=function(){return!!(this.current&&this.current.next&&this.current.number<this.current.total)&&this.show(this.current.next)},this.actionLast=function(){return!!(this.current&&0<=this.current.number&&this.current.number<this.current.total)&&this.show(this.current.last)}},apijs.core.upload=function(){"use strict";this.title=null,this.action=null,this.input=null,this.onemax=0,this.allmax=0,this.exts=null,this.callback=null,this.args=null,this.icon=null,this.start=0,this.end=0,this.sendFile=function(t,e,i,s,a,n,o,r){t=this.sendFiles(t,e,i,s,0,a,n,o,r);return t||console.error("apijs.upload.sendFile invalid arguments",arguments),t},this.sendFiles=function(t,e,i,s,a,n,o,r,l){return!0!==t&&(this.title=t,this.action=e,this.input=i,this.onemax=s,this.allmax=a,this.exts="string"==typeof n?n.split(","):["*"],this.callback=o,this.args=r,this.icon=l),"string"==typeof this.title&&"string"==typeof this.action&&"string"==typeof this.input&&"number"==typeof this.onemax&&"number"==typeof this.allmax&&"function"==typeof this.callback?(t=0<this.allmax,e="*"===this.exts.join()?apijs.i18n.translate(161):1===this.exts.length?apijs.i18n.translate(162,this.exts.join()):apijs.i18n.translate(163,this.exts.slice(0,-1).join(", "),this.exts.slice(-1)),e+="[br]"+apijs.i18n.translate(t?165:164,apijs.formatNumber(this.onemax),t?apijs.formatNumber(this.allmax):"").replace("|","[br]"),apijs.dialog.dialogFormUpload(this.title,e,this.action,this.input,t,this.icon)):(("number"!=typeof this.allmax||0<this.allmax)&&console.error("apijs.upload.sendFiles invalid arguments",arguments),!1)},this.actionDrag=function(t){var e=apijs.dialog.t3,i=!0;if("dragenter"===t.type)apijs.dialog.add("drag");else if("dragleave"===t.type)apijs.dialog.remove("drag");else if(t.dataTransfer&&t.dataTransfer.files&&0<t.dataTransfer.files.length){try{e.files=t.dataTransfer.files,apijs.upload.actionChoose(e)}catch(t){console.error(t),apijs.html(".drag").remove()}apijs.dialog.remove("drag")}else if(t.clipboardData&&t.clipboardData.files&&0<t.clipboardData.files.length)try{e.files=t.clipboardData.files,apijs.upload.actionChoose(e,!0)}catch(t){console.error(t),apijs.html(".drag").remove()}else t.clipboardData&&(i=!1);i&&(t.stopPropagation(),t.preventDefault())},this.actionChoose=function(t,s){var a=[],n=0,e=apijs.html("button.confirm");!this.exts||(apijs.toArray(t.files,0<this.allmax?999:1).forEach(function(t,e){var i=t.size/1048576,i=apijs.formatNumber(i<.01?.01:i);i=(s||0<this.allmax?'<td class="nb">'+(s?(new Date).toTimeString().substring(0,8):e+1)+"</td>":"")+'<td class="name">'+t.name+'</td><td class="size">'+apijs.i18n.translate(166,i)+"</td>","*"===this.exts.join()||this.exts.has(t.name.slice(t.name.lastIndexOf(".")+1).toLowerCase())?t.size>1048576*this.onemax?i+='<td class="err">'+apijs.i18n.translate(168)+"</td>":t.size<=0?i+='<td class="err">'+apijs.i18n.translate(169)+"</td>":i+="<td></td>":i+='<td class="err">'+apijs.i18n.translate(167)+"</td>",a.push("<tr>"+i+"</tr>"),n+=t.size/1048576},this),0<this.allmax&&n>=this.allmax&&a.push('<tr class="tt"><td></td><td></td><td class="size">'+apijs.i18n.translate(166,apijs.formatNumber(n))+'</td><td class="err">'+apijs.i18n.translate(168)+"</td></tr>"),apijs.html("div.filenames").innerHTML="<table>"+a.join("")+"</table>",apijs.html("div.filenames .err"))?e.setAttribute("disabled","disabled"):(e.removeAttribute("disabled"),e.focus())},this.actionConfirm=function(){var t,e;return 0<apijs.dialog.t3.files.length?(t=new FormData(apijs.dialog.t2),(e=new XMLHttpRequest).open("POST",this.action+(0<this.action.indexOf("?")?"&isAjax=true":"?isAjax=true"),!0),"string"==typeof apijs.config.upload.tokenValue&&(e.setRequestHeader(apijs.config.upload.tokenName,apijs.config.upload.tokenValue),t.append(apijs.config.upload.tokenName,apijs.config.upload.tokenValue)),e.onreadystatechange=function(t){4===e.readyState&&(t=e.responseText.trim(),[0,200].has(e.status)?(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijs.upload.send",xhr:e}})),apijs.log("upload:onreadystatechange status:200 message:"+t),0===t.indexOf("success-")?(this.updateTitle(),this.callback(t.slice(8),this.args)):this.onError(195,t)):(apijs.log("upload:onreadystatechange status:"+e.status+" message: "+t),this.onError(194,e.status)))}.bind(this),e.upload.onloadstart=this.onStart.bind(this),e.upload.onprogress=this.onProgress.bind(this),e.upload.onload=this.onProgress.bind(this),e.upload.onerror=this.onError.bind(this),e.send(t)):apijs.html("button.browse").focus(),!1},this.onStart=function(){this.start=this.end=Math.round((new Date).getTime()/1e3),apijs.dialog.dialogProgress(this.title,apijs.i18n.translate(125),this.icon)},this.onError=function(t,e){this.updateTitle(),"number"==typeof t?e="[p]"+apijs.i18n.translate(t)+"[/p] "+e:"string"!=typeof e&&(e="[p]"+apijs.i18n.translate(193)+"[/p]"),e+="[p]"+apijs.i18n.translate(196,'href="apijs://restart" onclick="apijs.upload.sendFile(true); return false;"')+"[/p]",apijs.dialog.dialogInformation(this.title,e,"string"==typeof this.icon?"upload error "+this.icon:"upload error")},this.onProgress=function(t){var e,i,s,a,n,o,r=Math.round((new Date).getTime()/1e3);t.lengthComputable&&"progress"===t.type&&r>=this.end+2?(this.end=r,0<(e=Math.floor(100*t.loaded/t.total))&&e<100&&(this.updateTitle(e),n=100*(r=r-this.start)/e+10,24<r&&(a=Math.round(n-r),a=10*Math.ceil(a/10),o=Math.ceil(a/60),s=Math.round(t.loaded/r/1024),r<40||n<90?(i=184,a=null):1<o?(i=181,a=o):50<a?(i=182,a=1):i=183),this.updateProgress(e,i,s,a))):"load"===t.type&&(a=Math.round((new Date).getTime()/1e3)-this.start,o=Math.ceil(a/60),0<(s=Math.round(t.loaded/a/1024))&&s!==1/0?1<o?(i=185,a=o):50<a?(i=186,a=1):20<a?i=187:(i=188,a=null):a=s=null,this.updateTitle(100),this.updateProgress(100,i,s,a))},this.updateProgress=function(t,e,i,s){var a,n,o=apijs.html("rect"),r=apijs.html("span.info");99<t?(a="100%",o.setAttribute("class","end"),o.style.width="",(n=apijs.html("p")).setAttribute("data-old",n.textContent),n.setAttribute("data-new",apijs.i18n.translate(126)),n.setAttribute("class","anim"),n.textContent=""):(o.style.width=a=t+"%",o.hasAttribute("class")&&o.removeAttribute("class")),"number"==typeof e&&"number"==typeof i&&"number"==typeof s?a=apijs.i18n.translate(e,t,apijs.formatNumber(i,!1),s):"number"==typeof e&&"number"==typeof i&&(a=apijs.i18n.translate(e,t,apijs.formatNumber(i,!1))),r.textContent=a},this.updateTitle=function(t){"number"==typeof t?document.title=/^\d{1,3}% - /.test(document.title)?t+"% - "+document.title.slice(document.title.indexOf(" - ")+3):t+"% - "+document.title:/^\d{1,3}% - /.test(document.title)&&(document.title=document.title.slice(document.title.indexOf(" - ")+3))}};
|
7
|
+
Array.prototype.has||(Array.prototype.has=function(t,e){if(t instanceof Array){for(e in t)if(t.hasOwnProperty(e)&&this.has(t[e]))return!0}else for(e in this)if(this.hasOwnProperty(e)&&this[e]===t)return!0;return!1}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(t,e,i){for(e=e||window,i=0;i<this.length;i++)t.call(e,this[i],i,this)});var apijs=new function(){this.core={},this.version=697,this.config={lang:"auto",debug:!1,dialog:{closeOnClick:!1,restrictNavigation:!0,player:!0},slideshow:{ids:"slideshow",anchor:!0},upload:{tokenName:"X-CSRF-Token",tokenValue:null}},this.start=function(){var t;if(console.info("APIJS "+this.version.toString().split("").join(".")+" - hello - 1 MB/Mo = 1024 kB/ko"),document.getElementById("oldBrowser"))throw new Error("APIJS canceled, #oldBrowser detected!");(t=document.querySelector('link[href*="apijs/fontello.woff2"]'))&&t.getAttribute("href").indexOf("?a3ab5acff3")<0&&console.error("APIJS warning invalid cachekey for link:fontello.woff2?x, it must be ?a3ab5acff3"),(t=document.querySelector('script[src*="apijs.min.js?v="]'))&&t.getAttribute("src").indexOf("?v="+this.version)<0&&console.error("APIJS warning invalid cachekey for script:apijs.min.js?x, it must be ?v="+this.version),this.i18n=new this.core.i18n,this.dialog=new this.core.dialog,this.upload=new this.core.upload,this.slideshow=new this.core.slideshow,self.dispatchEvent(new CustomEvent("apijsbeforeload")),this.i18n.init(),this.slideshow.init(),document.querySelectorAll("video.apijsplayer[data-src]").forEach(function(t){apijs.startPlayer(t,t.getAttribute("data-src"))}),self.addEventListener("popstate",this.slideshow.onPopState),self.addEventListener("hashchange",this.slideshow.onPopState),this.config.debug&&(console.info("APIJS available languages: "+Object.keys(this.i18n.data).join(" ")),console.info("APIJS language loaded: "+this.config.lang),console.info("APIJS successfully started")),self.dispatchEvent(new CustomEvent("apijsload"))},this.formatNumber=function(e,t){var i,s="number"==typeof t?t:!1===t?0:2;try{i=new Intl.NumberFormat(this.config.lang,{minimumFractionDigits:s,maximumFractionDigits:s}).format(e)}catch(t){i=e.toFixed(s)}return"number"==typeof t?i:i.replace(/[.,]00$/,"")},this.startPlayer=function(t,e){return!0===this.config.dialog.player?(t.videoPlayer=new this.core.player(t,e),t.parentNode.classList.add("apijsvideoplayer"),!0):"function"==typeof this.config.dialog.player&&(this.config.dialog.player(t,e),!0)},this.toArray=function(t,e){return Array.prototype.slice.call(t,0,e)},this.openTab=function(t){t.preventDefault(),0<this.href.length&&self.open(this.href)},this.log=function(t){this.config.debug&&console.info("APIJS "+t)},this.html=function(t,e){return!0===e||0===t.indexOf("#")?document.getElementById(t.replace("#","apijs")):this.dialog.t1?this.dialog.t1.querySelector(t):null},this.requestFullscreen=function(t){document.webkitFullscreenElement?document.webkitCancelFullScreen():document.mozFullScreenElement?document.mozCancelFullScreen():document.fullscreenElement?document.cancelFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen&&t.mozRequestFullScreen()},this.serialize=function(t,i){var s=[];return i="string"==typeof i?i:"",Array.prototype.forEach.call(t.elements,function(t,e){if(t.name&&!t.disabled&&!["file","reset","submit","button"].has(t.type)&&0===t.name.indexOf(i))if("select-multiple"===t.type)for(e=0;e<t.options.length;e++)t.options[e].selected&&s.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.options[e].value));else["checkbox","radio"].has(t.type)&&!t.checked||s.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),s.join("&")}};"function"==typeof self.addEventListener&&self.addEventListener("load",apijs.start.bind(apijs)),apijs.core.i18n=function(){this.data={cs:{103:"Zrušit",104:"Potvrzení",105:"Zavřít",106:"Předchozí",107:"Následující",108:"Vybrat soubor",132:"video stopa",133:"zvuková stopa",134:"titulky",135:"vypnuto",142:"předchozí/následující",143:"přehrát/pozastavit",144:"zpět/vpřed",145:"snížit/zvýšit hlasitost",146:"ztlumit",148:"ukončit",149:"Konec",150:"Esc"},de:{103:"Abbrechen",104:"Bestätigen",105:"Schließen",106:"Vorheriges",107:"Nächstes",108:"Datei wählen",109:"Dateien wählen",124:"Verarbeitung läuft...",132:"videospur",133:"audiospur",134:"untertitel",135:"aus",142:"vorheriges/nächstes",143:"wiedergabe/pause",144:"rückwärts/vorwärts",145:"leiser/lauter",146:"ton aus",147:"vollbild",148:"beenden",149:"Ende",150:"Esc",161:"Alle Dateien wurden akzeptiert.",162:"Akzeptiertes Dateiformat: §.",163:"Akzeptiertes Dateiformate: § und §.",164:"Maximale Größe: § MB.",167:"Unerlaubtes Format",168:"Format zu gross",169:"Leere Datei",181:"§% - § kB/s - Noch § Minuten",182:"§% - § kB/s - Noch § Minute",183:"§% - § kB/s - Noch § Sekunden",185:"§% - bis § kB/s in § Minuten",186:"§% - bis § kB/s in § Minute",187:"§% - bis § kB/s in § Sekunden",188:"§% - bis § kB/s",191:"Abbrechen",192:"Sind Sie sicher? [span]Ja[/span] - Nein",193:"Es ist ein unerwarteter Fehler aufgetreten... Bitte versuchen Sie es noch einmal.",194:"Es ist ein Fehler beim Senden.",195:"Es ist ein Fehler bei der Verarbeitung.",196:"Wir laden Sie ein es erneut zu [a §]versuchen[/a]."},el:{102:"Εντάξει",103:"Ακύρωση",105:"Κλείσιμο",106:"Προηγούμενο",107:"Επόμενο",108:"Επιλέξτε ένα αρχείο",131:"βίντεο",132:"κομμάτι βίντεο",133:"κομμάτι ήχου",134:"υπότιτλοι",135:"απενεργοποίηση",142:"προηγούμενο/επόμενο",143:"αναπαραγωγή/παύση",144:"προς τα πίσω/εμπρός",145:"μείωση/αύξηση έντασης ήχου",146:"σίγαση",147:"πλήρης οθόνη",148:"έξοδος",149:"Τέλος",150:"Esc"},en:{102:"Ok",103:"Cancel",104:"Confirm",105:"Close",106:"Previous",107:"Next",108:"Choose a file",109:"Choose one or multiple files",124:"Operation in progress...",125:"Upload in progress...",126:"Processing file in progress...",127:"Drag and drop your files here",131:"video",132:"video track",133:"audio track",134:"subtitles",135:"off",141:"first/last",142:"previous/next",143:"play/pause",144:"backward/forward",145:"decrease/increase the volume",146:"mute",147:"full screen",148:"quit",149:"End",150:"Escape",161:"All files are accepted.",162:"Accepted file format: §.",163:"Accepted file formats: § and §.",164:"Maximum size: § MB.",165:"Maximum size by file: § MB.|Total maximum size: § MB.",166:"§ MB",167:"Format not allowed",168:"Size too large",169:"File empty",181:"§% - § kB/s - § minutes left",182:"§% - § kB/s - § minute left",183:"§% - § kB/s - § seconds left",184:"§% - § kB/s",185:"§% - at § kB/s in § minutes",186:"§% - at § kB/s in § minute",187:"§% - at § kB/s in § seconds",188:"§% - at § kB/s",191:"Interrupt",192:"Are you sure? [span]Yes[/span] - No",193:"It seems that an unlikely mistake just happened... Please try again.",194:"An error occurred while sending.",195:"An error occurred while processing.",196:"We invite you to [a §]try again[/a]."},es:{102:"Aceptar",103:"Cancelar",104:"Confirmar",105:"Cerrar",106:"Anterior",107:"Siguiente",108:"Elegir un fichero",109:"Elegir uno o varios ficheros",124:"Operación en curso...",125:"Envío en progreso...",126:"Tratamiento en curso...",131:"vídeo",132:"pista de vídeo",133:"pista de audio",134:"subtítulos",135:"desactivar",142:"anterior/siguiente",143:"reproducir/pausa",144:"retroceder/avanzar",145:"bajar/subir volumen",146:"silenciar",147:"pantalla completa",148:"salir",149:"Fin",150:"Esc",161:"Se aceptan todos los archivos.",162:"Formato de archivo aceptado: §.",163:"Formatos de archivos aceptados: § y §.",164:"Tamaño máximo: § MB.",165:"Tamaño máximo por fichero: § Mo.|Tamaño máximo total: § Mo.",167:"Formato no autorizado",168:"Tamaño demasiado importante",169:"Fichero vacío",181:"§% - § kB/s - § minutos restantes",182:"§% - § kB/s - § minuto restantes",183:"§% - § kB/s - § segundos restantes",185:"§% - a § kB/s en § minutos",186:"§% - a § kB/s en § minuto",187:"§% - a § kB/s en § segundos",188:"§% - a § kB/s",191:"Interrumpir",192:"¿Está seguro(a)? [span]Sí[/span] - No",193:"Parece que un error improbable acabo de ocurrir... Por favor, inténtelo de nuevo.",194:"Se produjo un error durante el envío.",195:"Se produjo un error durante el procesamiento.",196:"Le invitamos a [a §]intentar de nuevo[/a]."},fr:{103:"Annuler",104:"Valider",105:"Fermer",106:"Précédent",107:"Suivant",108:"Choisir un fichier",109:"Choisir un ou plusieurs fichiers",124:"Opération en cours...",125:"Envoi en cours...",126:"Traitement en cours...",127:"Faites glisser et déposez vos fichiers ici",131:"vidéo",132:"piste vidéo",133:"piste audio",134:"sous-titres",141:"premier/dernier",142:"précédent/suivant",143:"lecture/pause",144:"reculer/avancer",145:"réduire/augmenter le volume",146:"couper le son",147:"plein écran",148:"quitter",149:"Fin",150:"Échap",161:"Tous les fichiers sont acceptés.",162:"Format de fichier accepté : §.",163:"Formats de fichier acceptés : § et §.",164:"Taille maximale : § Mo.",165:"Taille maximale par fichier : § Mo.|Taille maximale total : § Mo.",166:"§ Mo",167:"Format non autorisé",168:"Taille trop importante",169:"Fichier vide",181:"§% - § ko/s - § minutes restantes",182:"§% - § ko/s - § minute restante",183:"§% - § ko/s - § secondes restantes",184:"§% - § ko/s",185:"§% - à § ko/s en § minutes",186:"§% - à § ko/s en § minute",187:"§% - à § ko/s en § secondes",188:"§% - à § ko/s",191:"Interrompre",192:"Êtes-vous sûr(e) ? [span]Oui[/span] - Non",193:"Il semblerait qu'une erreur improbable vient de se produire... Veuillez réessayer.",194:"Une erreur est survenue lors de l'envoi.",195:"Une erreur est survenue lors du traitement.",196:"Nous vous invitons à [a §]réessayer[/a]."},hu:{103:"Mégsem",104:"Megerősít",105:"Bezár",106:"Előző",107:"Következő",108:"Válasszon fájlt",131:"videó",132:"videosáv",133:"hangsáv",134:"feliratok",135:"ki",142:"előző/következő",143:"lejátszás/szünet",144:"vissza/előre",145:"hangerő csökkentés/növelése",146:"némítás",147:"teljes képernyő",148:"kilépés",149:"Befejezés",150:"Esc"},it:{103:"Annulla",104:"Conferma",105:"Chiudi",106:"Precedente",107:"Successivo",108:"Scegli un file",109:"Scegli uno o più file",124:"Operazione in corso...",125:"Invio in corso...",126:"Trattamento in corso...",132:"traccia video",133:"traccia audio",134:"sottotitoli",135:"inattivo",142:"precedente/successivo",143:"riproduci/pausa",144:"indietro/avanti",145:"riduci/aumenta volume",146:"silenzio",147:"schermo intero",148:"esci",149:"Fine",150:"Esc",161:"Tutti i file sono accettati.",162:"Formato del file accettato: §.",163:"Formati accettati: § et §.",164:"Dimensione massima: § MB.",167:"Formato non autorizzato",168:"Dimensione troppo importante",169:"File vuoto",181:"§% - § kB/s - § minuti rimanenti",182:"§% - § kB/s - § minuto rimanente",183:"§% - § kB/s - § secondi rimanenti",185:"§% - a § kB/s in § minuti",186:"§% - a § kB/s in § minuto",187:"§% - a § kB/s in § secondi",188:"§% - a § kB/s",191:"Interrompere",192:"Sei sicuro? [span]Si[/span] - No",193:"Sembra che un errore inaspettato si sia verificato... Riprova.",194:"Un errore si è verificato durante l'invio.",195:"Un errore si è verificato durante il trattamento.",196:"Vi invitiamo a [a §]riprovare[/a]."},ja:{103:"キャンセル",104:"承認",105:"閉じる",106:"前へ",107:"次へ",108:"ファイルを選択する",131:"ビデオ",132:"ビデオトラック",133:"オーディオトラック",134:"字幕",135:"オフ",142:"前へ/次へ",143:"再生/一時停止",144:"戻る/進む",146:"ミュート",147:"全画面表示",148:"終了",149:"終了",150:"Esc",166:"§ Mo",184:"§% - § Ko/s",192:"よろしいですか?[span]はい[/span] - いいえ"},nl:{103:"Annuleren",104:"Bevestigen",105:"Sluiten",106:"Vorige",107:"Volgende",108:"Kies een bestand",132:"videospoor",133:"audiospoor",134:"ondertitels",135:"uit",142:"vorige/volgende",143:"afspelen/pauzeren",144:"achteruit/vooruit",145:"volume omlaag/omhoog",146:"dempen",147:"schermvullend",148:"afsluiten",150:"Esc"},pl:{103:"Anuluj",104:"Potwierdź",105:"Zamknij",106:"Poprzedni",107:"Następny",108:"Wybierz plik",131:"obraz",132:"ścieżka obrazu",133:"ścieżka dźwiękowa",134:"napisy",135:"wyłączone",142:"poprzedni/następny",143:"odtwarzaj/wstrzymaj",144:"wstecz/przodu",145:"ciszej/głośniej",146:"wycisz",147:"pełny ekran",148:"zakończ",150:"Esc"},pt:{103:"Cancelar",104:"Confirmar",105:"Fechar",106:"Anterior",107:"Seguinte",108:"Escolha um ficheiro",124:"Operação em processo...",125:"Envio em processo...",126:"Tratamento em processo...",131:"vídeo",132:"faixa de vídeo",133:"faixa de áudio",134:"legendas",135:"não",142:"anterior/seguinte",143:"reprodução/pausa",144:"recuar/avançar",145:"diminuir/aumentar volume",146:"sem som",147:"ecrã completo",148:"sair",149:"Fim",150:"Esc",161:"Todos os ficheiros foram aceites.",162:"Formato do ficheiro aceite: §.",163:"Formatos de ficheiro aceites: § e §.",164:"Tamanho máximo: § MB.",181:"§% - § kB/s - § minutos restantes",182:"§% - § kB/s - § minuto restantes",183:"§% - § kB/s - § segundos restantes",185:"§% - § kB/s em § minutos",186:"§% - § kB/s em § minuto",187:"§% - § kB/s em § segundos",188:"§% - § kB/s",192:"Tem a certeza? [span]Sim[/span] - Não",193:"Parece ter acontecido um erro imprevisto. Por favor, tente novamente.",194:"Ocorreu um erro ao enviar.",195:"Ocorreu um erro ao processar.",196:"Convidamo-lo a [a §]tentar novamente[/a]."},ptbr:{107:"Próximo",108:"Escolher um arquivo",124:"Operação em andamento...",125:"Envio em andamento...",126:"Tratamento em andamento...",132:"trilha de vídeo",133:"trilha de áudio",135:"desligado",142:"anterior/próximo",143:"reproduzir/pausar",144:"retroceder/avançar",146:"sem áudio",147:"tela inteira",148:"fechar",149:"Final"},ro:{103:"Anuleaza",104:"Confirmare",105:"Inchide",106:"Anteriorul",107:"Urmatorul",108:"Alege un fișier",132:"pistă video",133:"pistă audio",134:"subtitluri",135:"oprit",142:"anteriorul/urmatorul",143:"redare/pauză",144:"înapoi/înaintează",145:"scade/crește volumul",146:"mut",147:"pe tot ecranul",148:"ieșire",149:"Sfârșit",150:"Esc"},ru:{102:"Ок",103:"Отмена",104:"Подтвердить",105:"Закрыть",106:"Предыдущий",107:"Следующий",108:"Выберите файл",124:"Операция в процессе...",131:"видео",132:"видеодорожка",133:"аудиодорожка",134:"субтитры",135:"выключено",142:"предыдущий/следующий",143:"воспроизведение/пауза",144:"назад/вперед",145:"понизить/повысить громкость",146:"выключить звук",147:"полноэкранный режим",148:"выйти",150:"Esc",161:"Все файлы приняты.",162:"Формат файла: §.",163:"Форматы файлов: § и §.",164:"Максимальный размер: § Мб.",166:"§ Мб",181:"§% - § Кб/s - осталось § минут",182:"§% - § Кб/s - осталось § минут",183:"§% - § Кб/s - осталось § секунд",184:"§% - § Кб/s",185:"§% - § Кб/s за § минут",186:"§% - § Кб/s за § минут",187:"§% - § Кб/s за § секунд",188:"§% - § Кб/s",192:"Вы уверены? [span]Да[/span] - нет",193:"Кажется произошла не предусмотренная ошибка... Попробуйте еще раз.",194:"Возникла ошибка при отправке файла.",195:"Возникла ошибка при обработке файла."},sk:{103:"Zrušiť",104:"Potvrdiť",105:"Zavrieť",106:"Dozadu",107:"Ďalej",108:"Zvoľte si súbor",133:"zvuková stopa",134:"titulky",135:"vypnuté",142:"dozadu/ďalej",143:"prehrať/pozastaviť",144:"dozadu/dopredu",145:"znizit/zvysit hlasitost",146:"stlmiť",148:"koniec",150:"Esc"},tr:{102:"Tamam",103:"İptal",104:"Onayla",105:"Kapat",106:"Önceki",107:"Sonraki",108:"Bir dosya seçin",131:"görüntü",132:"görüntü kaydı",133:"ses kaydı",134:"altyazılar",135:"kapalı",142:"önceki/sonraki",143:"duraklatma/oynatma",144:"geri/i̇leri",145:"ses kısar/açar",146:"sesi kapatma",147:"tam ekran",148:"çıkış",149:"Son",150:"Esc",192:"Emin misiniz ? [span]Evet[/span] - Hayır"},uk:{102:"Гаразд",103:"Відмінити",104:"Підтвердити",105:"Закрити",106:"Попередній",107:"Наступний",108:"Вибрати файл",131:"відео",132:"відеодоріжка",133:"звукова доріжка",134:"субтитри",135:"вимкнено",142:"попередній/наступний",143:"відтворити/призупинити",144:"назад/вперед",145:"зменшити/збільшити гучність",146:"вимкнути звук",148:"вийти",149:"Кінець",150:"Esc",166:"§ МБ",184:"§% - § кБ/s"},zh:{102:"确定",103:"取消",104:"确认",105:"关闭",106:"上一个",107:"下一个",108:"选择文件",131:"视频",132:"视频轨道",133:"音频轨道",134:"字幕",135:"关",142:"上一个/下一个",143:"播放/暂停",144:"快退/快进",145:"音量减/增",146:"静音",147:"全屏",148:"退出",150:"Esc",192:"您确定吗?[span]是[/span] - 否"}},this.init=function(){var t=apijs.config.lang,e=document.querySelector("html");-1<t.indexOf("auto")&&"string"==typeof(t=e.getAttribute("xml:lang")||e.getAttribute("lang"))&&(t=(t=t.replace(/[-_]/g,"").toLowerCase()).slice(0,4),this.data.hasOwnProperty(t)||(t=t.slice(0,2)),this.data.hasOwnProperty(t))&&(apijs.config.lang=t),this.data.hasOwnProperty(t)||(apijs.config.lang="en")},this.translate=function(t){var e=apijs.config.lang,i=1,s="";if("string"!=typeof this.data[e][t])if(3<e.length&&"string"==typeof this.data[e.slice(0,2)][t])e=e.slice(0,2);else{if("en"===e||"string"!=typeof this.data.en[t])return t;e="en"}return 1<arguments.length?(this.data[e][t].split("§").forEach(function(t){s+=i<this.length?t+this[i++]:t},arguments),s):this.data[e][t]},this.translateNode=function(){return document.createTextNode(this.translate.apply(this,arguments))},this.changeLang=function(t){if("string"==typeof t){if(-1<t.indexOf("auto"))return apijs.config.lang="auto",this.init(),!0;if(t=t.replace(/[-_]/g,""),this.data.hasOwnProperty(t))return apijs.config.lang=t,!0}return!1}},apijs.core.select=function(){this.init=function(){}},apijs.core.player=function(a,t){this.video=a,this.stalled=!1,this.subload=!1,this.autoRun=function(n,t){var o;return n.removeAttribute("src"),n.removeAttribute("data-src"),n.removeAttribute("controls"),n.classList.add("apijsplayer"),n.onloadedmetadata=function(t){this.stalled=!1,this.onTimeupdate(t),this.onProgress(t),this.onVideotrack(),this.onAudiotrack()}.bind(this),n.onstalled=function(t){this.stalled=!0,this.onWaiting(t)}.bind(this),n.onplaying=this.onPlay.bind(this),n.onpause=this.onPlay.bind(this),n.onended=this.onPlay.bind(this),n.onprogress=this.onProgress.bind(this),n.ontimeupdate=this.onTimeupdate.bind(this),n.onseeking=this.onTimeupdate.bind(this),n.onseeked=this.onWaiting.bind(this),n.onwaiting=this.onWaiting.bind(this),n.onloadstart=this.onWaiting.bind(this),n.oncanplay=this.onWaiting.bind(this),n.onclick=this.actionPlay.bind(this),n.onvolumechange=this.actionVolume.bind(this),n.ondurationchange=apijs.dialog.onMediaLoad,n.onerror=apijs.dialog.onMediaLoad,n.parentNode.appendChild(this.htmlSvgPlayer()),t.indexOf("m3u")<0?n.appendChild(this.htmlSource(t)):((o=new XMLHttpRequest).open("GET",t,!0),o.onreadystatechange=function(){if(4===o.readyState)if(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijsplayer.init",xhr:o}})),!n||0<n.childNodes.length)o.abort();else if([0,200].has(o.status)){for(var t,e=0,i=0,s=0,a=o.responseText.trim().split("\n");"string"==typeof(t=a.shift());)0===t.indexOf("#APIJS#attr")?(e=t.split("|"),n.setAttribute(e[1],e[2])):0===t.indexOf("#APIJS#track|subtitles")?(e=t.split("|"),this.html(".tracks.texttrack select").appendChild(this.htmlOption(s++,e[3]+" - "+e[2])),n.appendChild(this.htmlTrack(e))):0===t.indexOf("#EXTINF")?e=t.replace(/#EXTINF:\d+,/,""):5<t.length&&"#"!==t[0]&&(this.html(".tracks.video select").appendChild(this.htmlOption(i++,"string"==typeof e?e:i)),n.appendChild(this.htmlSource(t)));this.updateSelect("video",i),"object"==typeof n.textTracks&&this.updateSelect("texttrack",n.textTracks.length||s)}else apijs.dialog.onMediaLoad({type:"error"})}.bind(this),o.send()),this},this.updateSelect=function(t,e){var i="texttrack"===t?1:0;i<e?(this.html(".tracks."+t).removeAttribute("style"),this.html(".tracks."+t+" em").textContent="("+e+")",this.html(".tracks."+t+" select").setAttribute("size",e<10?e+i:10)):(this.html(".tracks."+t).setAttribute("style","display:none;"),this.html(".tracks."+t+" select").innerHTML="")},this.html=function(t){return this.video.parentNode.querySelector(t)},this.onVideotrack=function(){var t,e=this.video.videoTracks,i=this.html(".tracks.videotrack select"),s=apijs.config.lang,a=-1;if("object"==typeof e){if(1<e.length){for(t=0;t<e.length;t++)e[t].language&&0==e[t].language.toLowerCase().replace(/[-_]/g,"").indexOf(s)&&(a=a<0?t:a),i.appendChild(this.htmlOption(t,e[t]));this.updateSelect("videotrack",e.length)}i.selectedIndex=Math.max(0,a),0<=a&&this.actionVideotrack(a)}},this.onAudiotrack=function(){var t,e=this.video.audioTracks,i=this.html(".tracks.audiotrack select"),s=apijs.config.lang,a=-1;if("object"==typeof e){if(1<e.length){for(t=0;t<e.length;t++)e[t].language&&0==e[t].language.toLowerCase().replace(/[-_]/g,"").indexOf(s)&&(a=a<0?t:a),i.appendChild(this.htmlOption(t,e[t]));this.updateSelect("audiotrack",e.length)}i.selectedIndex=Math.max(0,a),0<=a&&this.actionAudiotrack(a)}},this.onTimeupdate=function(t){var e,i,s,a=this.video.currentTime,n=this.video.duration,o="--:--";isNaN(a)||n===1/0||isNaN(n)||(o=(0<(e=Math.floor(a/3600))?e+":":"")+(i=(i=Math.floor(a%3600/60))<10?"0"+i:i)+":"+(s=(s=Math.floor(a%60))<10?"0"+s:s),o+=" / "+(0<(e=Math.floor(n/3600))?e+":":"")+(i=(i=Math.floor(n%3600/60))<10?"0"+i:i)+":"+(s=(s=Math.floor(n%60))<10?"0"+s:s),this.html("svg.bar rect").style.width=a/n*100+"%"),this.html("span.time").textContent=o,this.stalled&&!this.subload&&(this.stalled=!1,this.onWaiting(t))},this.onProgress=function(){var t,e,i=this.video,s=this.html("svg.bar"),a=i.buffered.length;if(0<a&&i.duration!==1/0&&!isNaN(i.duration))for(s.querySelectorAll(".buffer").forEach(function(t){t.remove()});0<a--;)(e=document.createElement("rect")).setAttribute("class","buffer"),99.8<(t=(i.buffered.end(a)-i.buffered.start(a))/i.duration*100)?e.setAttribute("style","left:0%; width:100%;"):e.setAttribute("style","left:"+i.buffered.start(a)/i.duration*100+"%; width:"+t+"%;"),s.appendChild(e)},this.onPlay=function(){[1,2].has(this.video.networkState)&&(this.video.paused?(this.html("span.play").textContent="",(apijs.dialog.t1?apijs.dialog:this.video.parentNode.classList).remove("playing")):(this.html("span.play").textContent="",(apijs.dialog.t1?apijs.dialog:this.video.parentNode.classList).add("playing")))},this.onWaiting=function(t){apijs.log("player:video:onWaiting:"+t.type+" stalled:"+this.stalled+"/subload:"+this.subload),apijs.dialog[["loadstart","waiting","seeking","stalled"].has(t.type)?"add":"remove"]("loading")},this.actionPlay=function(){var t=this.video;if(apijs.dialog.swipe)return!1;[1,2].has(t.networkState)&&(t.ended||t.paused?t.play():t.pause())},this.actionVolume=function(t){var e=this.video,i=this.html("svg.vol"),s=i.offsetWidth,a=0;if([1,2].has(e.networkState)){if("object"==typeof t&&!isNaN(t.clientX)){for(;a+=i.offsetLeft,i=i.offsetParent;);a=100*(t.clientX-a)/s/100,e.volume=a=a<.2?0:.92<a?1:a,e.muted=!1}this.html("svg.vol rect").style.width=e.muted?0:100*e.volume+"%"}},this.actionPosition=function(t){var e=this.video,i=this.html("svg.bar"),s=i.offsetWidth,a=0;if([1,2].has(e.networkState)&&e.duration!==1/0&&!isNaN(e.duration)&&"object"==typeof t){for(;a+=i.offsetLeft,i=i.offsetParent;);a=e.duration*(t.clientX-a)*100/s/100,e.currentTime=a=a<=1?0:a}},this.actionVideotrack=function(t){var e,i=this.video.videoTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].enabled=e==s;--a.currentTime}"object"==typeof t&&t.target.blur()},this.actionAudiotrack=function(t){var e,i=this.video.audioTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].enabled=e==s;--a.currentTime}"object"==typeof t&&t.target.blur()},this.actionTexttrack=function(t){var e,i=this.video.textTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].mode=e==s?"showing":"hidden";this.subload=!0}"object"==typeof t&&t.target.blur()},this.actionVideo=function(t){this.html("svg.bar rect").style.width="0",this.html("svg.bar").querySelectorAll(".buffer").forEach(function(t){t.remove()}),this.html("span.play").textContent="",this.updateSelect("videotrack",0),this.updateSelect("audiotrack",0),this.video.src=this.video.querySelectorAll("source")["object"==typeof t?t.target.value:t].src,"object"==typeof t&&t.target.blur()},this.actionFullscreen=function(){var t=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;this.video.parentNode.classList[t?"add":"remove"]("fullscreen")},this.htmlSvgPlayer=function(){var t,e,i,s=document.createElement("div");return s.setAttribute("class","apijsplayer noplaying"),(i=document.createElement("span")).setAttribute("class","btn play fnt"),i.appendChild(document.createTextNode("")),i.onclick=this.actionPlay.bind(this),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","svg bar"),(e=document.createElement("svg")).setAttribute("class","bar"),e.onclick=this.actionPosition.bind(this),t=document.createElement("rect"),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","time"),i.appendChild(document.createTextNode("--:--")),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","svg vol"),(e=document.createElement("svg")).setAttribute("class","vol"),e.onclick=this.actionVolume.bind(this),t=document.createElement("rect"),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks audiotrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(133)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionAudiotrack.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks videotrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(132)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionVideotrack.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks video"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(131)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionVideo.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks texttrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(134)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionTexttrack.bind(this),(t=document.createElement("option")).appendChild(apijs.i18n.translateNode(135)),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","btn full fnt"),i.appendChild(document.createTextNode("")),i.onclick=function(){apijs.dialog.t1?apijs.requestFullscreen(apijs.dialog.t1):(document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",this.actionFullscreen.bind(this)):document.fullscreenEnabled?document.addEventListener("fullscreenchange",this.actionFullscreen.bind(this)):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",this.actionFullscreen.bind(this)),apijs.requestFullscreen(this.video.parentNode))}.bind(this),s.appendChild(i),s},this.htmlTrack=function(t){var e=document.createElement("track");return e.setAttribute("kind",t[1]),e.setAttribute("label",t[2]),e.setAttribute("srclang",t[3]),e.setAttribute("src",t[4]),e.onload=function(t){apijs.log("player:track:onload "+t.target.src.slice(t.target.src.lastIndexOf("/")+1)),"showing"===t.target.track.mode&&(this.onWaiting(t),this.subload=!1)}.bind(this),e.onerror=function(t){apijs.log("player:track:onerror "+t.target.src.slice(t.target.src.lastIndexOf("/")+1)),"showing"===t.target.track.mode&&(this.onWaiting(t),this.subload=!1)}.bind(this),e},this.htmlSource=function(t){var e=document.createElement("source");return e.setAttribute("src",t),e.onerror=apijs.dialog.onMediaLoad,e},this.htmlOption=function(t,e){"object"==typeof e&&(e=""===e.label?e.language.toLowerCase():e.language.toLowerCase()+" - "+e.label);var i=document.createElement("option");return i.setAttribute("value",t),i.appendChild(document.createTextNode(e)),i},this.autoRun(a,t)},apijs.core.dialog=function(){this.klass=[],this.height=0,this.scroll=0,this.callback=null,this.args=null,this.xhr=null,this.ft=/information|confirmation|options|upload|progress|waiting|photo|video|iframe|ajax|start|ready|end|reduce|mobile|tiny|fullscreen/g,this.ti="a,area,button,input,textarea,select,object,iframe",this.ns="http://www.w3.org/2000/svg",this.swipe=!1,this.media=null,this.t0=null,this.t1=null,this.t2=null,this.t3=null,this.a=null,this.b=null,this.c=null,this.dialogInformation=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("information",i).htmlParent().htmlContent(t,e).htmlBtnOk().show("button.confirm"):(console.error("apijs.dialog.dialogInformation invalid arguments",arguments),!1)},this.dialogConfirmation=function(t,e,i,s,a){return"string"==typeof t&&"string"==typeof e&&"function"==typeof i?(this.callback=i,this.args=s,this.init("confirmation",a).htmlParent().htmlContent(t,e).htmlBtnConfirm("button","apijs.dialog.actionConfirm();").show("button.confirm")):(console.error("apijs.dialog.dialogConfirmation invalid arguments",arguments),!1)},this.dialogFormOptions=function(t,e,i,s,a,n){return"string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"function"==typeof s?(this.callback=s,this.args=a,this.init("options",n).htmlParent(i,"apijs.dialog.actionConfirm();").htmlContent(t,e).htmlBtnConfirm("submit").show(!0)):(console.error("apijs.dialog.dialogFormOptions invalid arguments",arguments),!1)},this.dialogFormUpload=function(t,e,i,s,a,n){return"string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("upload",n).htmlParent(i,"apijs.upload.actionConfirm();","apijs.upload.actionDrag(event);").htmlContent(t,e).htmlUpload(s,"boolean"==typeof a&&a,"apijs.upload.actionChoose(this);").htmlBtnConfirm("submit").show("button.browse"):(console.error("apijs.dialog.dialogFormUpload invalid arguments",arguments),!1)},this.dialogProgress=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("progress",i).htmlParent().htmlContent(t,e).htmlSvgProgress().show():(console.error("apijs.dialog.dialogProgress invalid arguments",arguments),!1)},this.dialogWaiting=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("waiting",i).htmlParent().htmlContent(t,e).htmlSvgLoader(!1).show():(console.error("apijs.dialog.dialogWaiting invalid arguments",arguments),!1)},this.dialogPhoto=function(t,e,i,s,a){var n="string"==typeof a;return a=n?"notransition slideshow loading "+a:"notransition loading","string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("photo",a).htmlParent().htmlMedia(t,e,i,s).htmlHelp(n,!1).htmlBtnClose().htmlBtnNavigation().htmlSvgLoader().show():(console.error("apijs.dialog.dialogPhoto invalid arguments",arguments),!1)},this.dialogVideo=function(t,e,i,s,a){var n="string"==typeof a;return a=n?"notransition slideshow loading "+a:"notransition loading","string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("video",a).htmlParent().htmlMedia(t,e,i,s).htmlHelp(n,t.indexOf("iframe")<0).htmlBtnClose().htmlBtnNavigation().htmlSvgLoader().show():(console.error("apijs.dialog.dialogVideo invalid arguments",arguments),!1)},this.dialogIframe=function(t,e,i){return"string"==typeof t&&"boolean"==typeof e?this.init("iframe","string"==typeof i?i+" loading":"loading",!e).htmlParent().htmlIframe(t).htmlBtnClose(e).htmlSvgLoader(!1).show():(console.error("apijs.dialog.dialogIframe invalid arguments",arguments),!1)},this.dialogAjax=function(t,e,i,s,a){return"string"==typeof t&&"boolean"==typeof e&&"function"==typeof i?(this.callback=i,this.args=s,this.init("ajax","string"==typeof a?a+" loading":"loading",!e).htmlParent().htmlBtnClose(e).htmlSvgLoader(!1).show(),this.xhr=new XMLHttpRequest,this.xhr.open("GET",t,!0),this.xhr.onreadystatechange=function(){4===this.xhr.readyState&&"function"==typeof this.callback&&(this.callback(this.xhr,this.args),this.remove("loading"))}.bind(this),this.xhr.send(),this):(console.error("apijs.dialog.dialogAjax invalid arguments",arguments),!1)},this.update=function(){return this.has("start","ready","end")&&(this.t1&&this.t1.setAttribute("class",this.klass.join(" ")),this.t2)&&this.t2.setAttribute("class",this.klass.join(" ")),this},this.add=function(){return Array.prototype.forEach.call(arguments,function(t){"string"!=typeof t&&console.error("apijs.dialog.add argument is not a string",t),this.klass.indexOf(t)<0&&this.klass.push(t)},this),this.update()},this.remove=function(){return Array.prototype.forEach.call(arguments,function(t){"string"!=typeof t&&console.error("apijs.dialog.remove argument is not a string",t),-1<this.klass.indexOf(t)&&this.klass.splice(this.klass.indexOf(t),1)},this),this.update()},this.toggle=function(t,e){return"string"==typeof t&&"string"==typeof e||console.error("apijs.dialog.toggle argument is not a string",t,e),this.has(t)&&this.remove(t),this.has(e)||this.add(e),this.update()},this.has=function(){return this.klass.has(apijs.toArray(arguments))},this.actionClose=function(t){apijs.config.slideshow.anchor&&"function"==typeof history.pushState&&new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)&&history.pushState({},"",self.location.href.slice(0,self.location.href.indexOf("#"))),"object"==typeof t?"apijsDialog"!==t.target.getAttribute("id")||apijs.dialog.has("photo","video","progress","waiting","lock")||apijs.dialog.clear(!0):this.t1&&this.clear(!0)},this.onCloseBrowser=function(t){if(apijs.dialog.has("progress","waiting","lock"))return t.preventDefault(),t.stopPropagation(),t.m=apijs.i18n.translate(124),t.returnValue=t.m,t.m},this.onResizeBrowser=function(){var t=document.querySelector("body").clientWidth;apijs.dialog[t<=(apijs.dialog.has("photo","video")?900:460)?"add":"remove"]("mobile"),apijs.dialog[t<=300?"add":"remove"]("tiny")},this.onScrollBrowser=function(t){var e=apijs.dialog,i=t.target,s=!1;if(e.has("slideshow")&&!e.has("playing")&&!["OPTION","SELECT"].has(i.nodeName)&&["DOMMouseScroll","mousewheel","swipeleft","swiperight","swipeup","swipedown","swiped-left","swiped-right","swiped-up","swiped-down"].has(t.type))i=(new Date).getTime()/1e3,(e.scroll<1||i>e.scroll+1)&&(e.scroll=i,s=0<t.detail||t.wheelDelta<0,apijs.slideshow[["swipeleft","swipeup","swiped-left","swiped-up"].has(t.type)||s?"actionNext":"actionPrev"]());else{if("OPTION"===i.nodeName)i=i.parentNode;else if(!["TEXTAREA","SELECT"].has(i.nodeName))for(;!0!==s&&"HTML"!==i.nodeName;)i.classList.contains("scrollable")?s=!0:i=i.parentNode;if(i.scrollHeight>i.offsetHeight&&"HTML"!==i.nodeName&&((s=0<t.detail||t.wheelDelta<0)&&i.scrollTop<i.scrollHeight-i.offsetHeight-1||!s&&0<i.scrollTop))return}t.preventDefault(),t.stopPropagation()},this.onScrollIframe=function(t){for(var e,i=t.target;i.parentNode;)i=i.parentNode;((e=0<t.detail||t.wheelDelta<0)&&i.defaultView.innerHeight+i.defaultView.scrollY>=i.body.offsetHeight-1||!e&&i.defaultView.scrollY<=0)&&(t.preventDefault(),t.stopPropagation())},this.onKey=function(t){var e,i=apijs.dialog,s=i.media;i.has("progress","waiting","lock")?(t.ctrlKey&&[81,87,82,115,116].has(t.keyCode)||t.altKey&&115===t.keyCode||[27,116].has(t.keyCode))&&t.preventDefault():i.has("photo","video")&&122===t.keyCode?(t.preventDefault(),apijs.requestFullscreen(i.t1)):i.has("slideshow")?27===t.keyCode?(t.preventDefault(),i.actionClose()):35===t.keyCode?(t.preventDefault(),apijs.slideshow.actionLast()):36===t.keyCode?(t.preventDefault(),apijs.slideshow.actionFirst()):37===t.keyCode?(t.preventDefault(),apijs.slideshow.actionPrev()):39===t.keyCode&&(t.preventDefault(),apijs.slideshow.actionNext()):27===t.keyCode&&(t.preventDefault(),i.actionClose()),i.has("video")&&!i.has("videoiframe")&&([32,80].has(t.keyCode)?(t.preventDefault(),[1,2].has(s.networkState)&&(s.ended||s.paused?s.play():s.pause())):[38,33].has(t.keyCode)?(t.preventDefault(),e=38===t.keyCode?10:60,[1,2].has(s.networkState)&&s.duration!==1/0&&!isNaN(s.duration)&&(s.currentTime>e?s.currentTime-=e:s.currentTime=0)):[40,34].has(t.keyCode)?(t.preventDefault(),[1,2].has(s.networkState)&&s.duration!==1/0&&!isNaN(s.duration)&&(e=40===t.keyCode?10:60,s.currentTime<s.duration-e)&&(s.currentTime+=e)):107===t.keyCode?(t.preventDefault(),[1,2].has(s.networkState)&&(s.muted&&(s.muted=!1),s.volume<.8?s.volume+=.2:s.volume=1)):109===t.keyCode?(t.preventDefault(),[1,2].has(s.networkState)&&(s.muted&&(s.muted=!1),.21<s.volume?s.volume-=.2:s.volume=0)):77===t.keyCode&&(t.preventDefault(),[1,2].has(s.networkState))&&(s.muted=!s.muted)),![32,33,34,35,36,38,40].has(t.keyCode)||t.target&&(["INPUT","TEXTAREA","OPTION","SELECT"].has(t.target.nodeName)||t.target.classList.contains("scrollable"))||(t.preventDefault(),t.stopPropagation())},this.onFullscreen=function(t){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;t&&apijs.log("dialog:onFullscreen:"+(e?"in":"out")),apijs.dialog[e?"add":"remove"]("fullscreen")},this.onIframeLoad=function(t){t.removeAttribute("class"),apijs.dialog.remove("loading"),t.contentWindow.document.addEventListener("keydown",window.parent.apijs.dialog.onKey),t.contentWindow.addEventListener("DOMMouseScroll",window.parent.apijs.dialog.onScrollIframe,{passive:!1}),t.contentWindow.addEventListener("mousewheel",window.parent.apijs.dialog.onScrollIframe,{passive:!1}),t.contentWindow.addEventListener("touchmove",window.parent.apijs.dialog.onScrollIframe,{passive:!1})},this.onMediaLoad=function(t){var e,i=apijs.dialog,s=i.media;t&&t.target&&(e=t.target.currentSrc||t.target.src,apijs.log("dialog:onMediaLoad:"+t.type+" "+(e?e.slice(e.lastIndexOf("/")+1):""))),s&&["load","durationchange"].has(t.type)?(i.remove("loading","error"),s.style.visibility="visible",s.hasAttribute("src")||"IMG"!==s.nodeName||s.setAttribute("src",s.imageLoader.src)):s&&"error"===t.type&&(i.toggle("loading","error"),s.removeAttribute("style"),e=apijs.html(".tracks.video select"))&&t&&t.target&&0<(i=e.querySelectorAll("option")).length&&0<e.value.length&&(i[e.value].setAttribute("disabled","disabled"),e.selectedIndex+=1,"VIDEO"===t.target.nodeName)&&""!==e.value&&s.videoPlayer.actionVideo(e)},this.onSlideshowSwipe=function(t){apijs.dialog.swipe=!0,self.setTimeout(function(){apijs.dialog.swipe=!1},150),["swiperight","swipedown","swiped-right","swiped-down"].has(t.type)?apijs.slideshow.actionPrev():apijs.slideshow.actionNext()},this.actionConfirm=function(){return this.has("options")&&!0!==this.callback(!1,this.args)||(this.add("lock","loading"),this.htmlSvgLoader(!1),apijs.html("div.btns").style.visibility="hidden",apijs.html("div.bbcode").style.visibility="hidden",self.setTimeout(function(){this.t2&&"FORM"===this.t2.nodeName?this.callback(this.t2.getAttribute("action"),this.args):this.t2&&this.callback(this.args)}.bind(this),12)),!1},this.init=function(t,e,i){return i=!0===i,"string"==typeof e?e=0<(e=e.replace(this.ft,"").trim()).length?i?e+" lock":e:i?"lock":null:i&&(e="lock"),this.t0&&this.clear(!1),this.klass.push("start"),this.klass.push(t),self.matchMedia("prefers-reduced-motion:reduce").matches&&this.klass.push("reduce"),"string"==typeof e&&(this.klass=this.klass.concat(e.split(" "))),this.t0=document.createDocumentFragment(),document.addEventListener("keydown",this.onKey),self.addEventListener("beforeunload",this.onCloseBrowser),self.addEventListener("DOMMouseScroll",this.onScrollBrowser,{passive:!1}),self.addEventListener("mousewheel",this.onScrollBrowser,{passive:!1}),self.addEventListener("touchmove",this.onScrollBrowser,{passive:!1}),self.addEventListener("resize",this.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.setAttribute("tabindex","-1")}),this},this.show=function(t){this.onResizeBrowser(),this.onFullscreen(),0<this.height&&!this.has("photo","video")&&(this.t2.style.minHeight=this.height+"px");var e=apijs.html("#Dialog");return e?(this.toggle("start","ready"),this.t1=e,apijs.toArray(this.t0.firstChild.childNodes).forEach(function(t){this.t1.appendChild(t)},this),this.t1.setAttribute("class",this.t2.getAttribute("class"))):this.has("notransition")?(this.toggle("start","ready"),document.querySelector("body").appendChild(this.t0)):(document.querySelector("body").appendChild(this.t0),self.setTimeout(function(){apijs.dialog.toggle("start","ready")},12)),apijs.config.dialog.closeOnClick&&!this.has("progress","waiting","lock")&&document.addEventListener("click",this.actionClose),this.has("photo","video")?document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",this.onFullscreen):document.fullscreenEnabled?document.addEventListener("fullscreenchange",this.onFullscreen):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",this.onFullscreen):this.has("upload")&&window.addEventListener("paste",apijs.upload.actionDrag),!0===t?self.setTimeout(function(){apijs.html("input:not([readonly]),textarea:not([readonly]),select:not([disabled])").focus()},12):"string"==typeof t&&apijs.html(t).focus(),!0},this.clear=function(t){if(t&&this.xhr&&(this.callback=null,this.xhr.abort()),this.hammer&&(this.hammer.off("swiperight swipedown swipeleft swipeup",apijs.dialog.onSlideshowSwipe).destroy(),delete this.hammer),document.removeEventListener("keydown",this.onKey),self.removeEventListener("beforeunload",this.onCloseBrowser),self.removeEventListener("DOMMouseScroll",this.onScrollBrowser,{passive:!1}),self.removeEventListener("mousewheel",this.onScrollBrowser,{passive:!1}),self.removeEventListener("touchmove",this.onScrollBrowser,{passive:!1}),self.removeEventListener("resize",this.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.removeAttribute("tabindex")}),apijs.config.dialog.closeOnClick&&document.removeEventListener("click",this.actionClose),this.has("photo","video")?(this.has("video")&&!this.has("videoiframe")&&this.t2.querySelectorAll("video, source, track").forEach(function(t){for(var e in t)0===e.indexOf("on")&&(t[e]=null);t.removeAttribute("src")}),this.media.videoPlayer=null,this.media.imageLoader=null,document.webkitFullscreenEnabled?document.removeEventListener("webkitfullscreenchange",this.onFullscreen):document.fullscreenEnabled?document.removeEventListener("fullscreenchange",this.onFullscreen):document.mozFullScreenEnabled&&document.removeEventListener("mozfullscreenchange",this.onFullscreen)):(this.has("upload")&&window.removeEventListener("paste",apijs.upload.actionDrag),this.height=parseFloat(self.getComputedStyle(this.t2).height)),t)this.toggle("ready","end"),this.t1.remove();else for(;this.t1.firstChild;)this.t1.firstChild.remove();return this.klass=[],t&&(this.height=0,this.scroll=0,this.callback=null,this.args=null,this.xhr=null),this.media=null,this.t0=null,this.t1=null,this.t2=null,this.t3=null,this.a=null,this.b=null,!(this.c=null)},this.htmlParent=function(t,e,i){return this.t1=document.createElement("div"),this.t1.setAttribute("id","apijsDialog"),"string"==typeof i?(this.t1.setAttribute("ondragenter",i),this.t1.setAttribute("ondragleave",i),this.t1.setAttribute("ondragover",i),this.t1.setAttribute("ondrop",i),this.t1.setAttribute("onpaste",i),this.a=document.createElement("p"),this.a.setAttribute("class","drag"),this.a.appendChild(apijs.i18n.translateNode(127)),this.t1.appendChild(this.a)):this.t1.setAttribute("ondragstart","return false;"),"string"==typeof t?(this.t2=document.createElement("form"),this.t2.setAttribute("action",t),this.t2.setAttribute("method","post"),this.t2.setAttribute("enctype","multipart/form-data"),this.t2.setAttribute("onsubmit","return "+e)):this.t2=document.createElement("div"),this.t2.setAttribute("id","apijsBox"),this.t1.appendChild(this.t2),this.t0.appendChild(this.t1),this},this.htmlContent=function(t,e){return 0<t.length&&(this.a=document.createElement("h1"),this.a.innerHTML=t.replace(/</g,"<").replace(/>/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.t2.appendChild(this.a)),0<e.length&&(this.a=document.createElement("div"),this.a.setAttribute("class","bbcode"),"["!==e[0]&&(e="[p]"+e+"[/p]"),this.a.innerHTML=e.replace(/</g,"<").replace(/>/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.a.querySelectorAll("a.popup").forEach(function(t){t.addEventListener("click",apijs.openTab)}),this.t2.appendChild(this.a)),this},this.htmlBtnOk=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","confirm"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(102)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnConfirm=function(t,e){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type",t),this.b.setAttribute("class","confirm"),"submit"!==t&&this.b.setAttribute("onclick",e),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(104)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","cancel"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(103)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnNavigation=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","navigation noplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","prev"),this.b.setAttribute("id","apijsPrev"),this.b.setAttribute("onclick","apijs.slideshow.actionPrev();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","next"),this.b.setAttribute("id","apijsNext"),this.b.setAttribute("onclick","apijs.slideshow.actionNext();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),"function"==typeof Hammer&&(this.hammer=new Hammer(this.t2),this.hammer.get("swipe").set({direction:Hammer.DIRECTION_ALL}),this.hammer.on("swiperight swipedown swipeleft swipeup",apijs.dialog.onSlideshowSwipe)),this},this.htmlBtnClose=function(t){return!1!==t&&(this.a=document.createElement("div"),this.a.setAttribute("class","close nofullplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","close"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(105)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a)),this},this.htmlUpload=function(t,e,i){return this.a=document.createElement("div"),this.a.setAttribute("class","btns upload"),this.t3=document.createElement("input"),this.t3.setAttribute("type","file"),this.t3.setAttribute("name",e?t+"[]":t),this.t3.setAttribute("id","apijsFile"),e&&this.t3.setAttribute("multiple","multiple"),this.t3.setAttribute("onchange",i),this.a.appendChild(this.t3),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","browse"),this.b.setAttribute("onclick","this.previousSibling.click();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(e?109:108)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("div"),this.b.setAttribute("class","filenames scrollable"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgProgress=function(){return this.a=document.createElement("span"),this.a.setAttribute("class","info"),this.t2.appendChild(this.a),this.a=document.createElement("svg"),this.a.setAttribute("id","apijsProgress"),this.b=document.createElement("rect"),this.b.setAttribute("class","auto"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgLoader=function(t){return this.a=document.createElementNS(this.ns,"svg"),this.a.setAttribute("class","loader"),this.b=document.createElementNS(this.ns,"path"),!1!==t&&this.b.setAttribute("style","opacity:0;"),this.b.setAttribute("d","M75.4 126.63a11.43 11.43 0 0 1-2.1-22.65 40.9 40.9 0 0 0 30.5-30.6 11.4 11.4 0 1 1 22.27 4.87h.02a63.77 63.77 0 0 1-47.8 48.05v-.02a11.38 11.38 0 0 1-2.93.37z"),this.c=document.createElementNS(this.ns,"animateTransform"),this.c.setAttribute("attributeName","transform"),this.c.setAttribute("type","rotate"),this.c.setAttribute("from","0 64 64"),this.c.setAttribute("to","360 64 64"),this.c.setAttribute("dur","5s"),this.c.setAttribute("repeatCount","indefinite"),this.b.appendChild(this.c),this.c=document.createElementNS(this.ns,"animate"),this.c.setAttribute("attributeName","opacity"),this.c.setAttribute("to","1"),this.c.setAttribute("dur","0.01s"),this.c.setAttribute("begin","1s"),this.c.setAttribute("fill","freeze"),!1!==t&&this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlMedia=function(t,e,i,s){var a;return this.a=document.createElement("dl"),this.a.setAttribute("class","media"),this.b=document.createElement("dt"),this.has("photo")?(this.media=document.createElement("img"),this.media.setAttribute("alt",s.replace('"',""))):0<t.indexOf("iframe")?(this.media=document.createElement("iframe"),this.media.setAttribute("type","text/html"),this.media.setAttribute("scrolling","no"),this.media.setAttribute("src",t)):(this.media=document.createElement("video"),this.media.setAttribute("controls","controls"),this.media.setAttribute("preload","metadata")),this.media.setAttribute("id","apijsMedia"),this.b.appendChild(this.media),this.a.appendChild(this.b),this.b=document.createElement("dd"),this.b.setAttribute("class","nofullplaying"),"false"===e&&"false"===i||(a=t.slice(t.lastIndexOf("/")+1),this.c=document.createElement("span"),"false"!==e&&"auto"!==e&&"false"!==i?this.c.appendChild(document.createTextNode(e+" ("+i+") ")):"false"!==e&&"auto"!==e?this.c.appendChild(document.createTextNode(e+" ")):"auto"===e&&"false"!==i?this.c.appendChild(document.createTextNode(a+" ("+i+") ")):"auto"===e?this.c.appendChild(document.createTextNode(a+" ")):"false"!==i&&this.c.appendChild(document.createTextNode("("+i+") ")),this.b.appendChild(this.c)),this.b.appendChild(document.createTextNode(s)),this.a.appendChild(this.b),this.t2.appendChild(this.a),this.has("photo")?(this.media.imageLoader=new Image,this.media.imageLoader.src=t,this.media.imageLoader.onload=this.onMediaLoad,this.media.imageLoader.onerror=this.onMediaLoad):0<t.indexOf("iframe")?(this.media.onload=function(t){this.onIframeLoad(this.media),this.onMediaLoad(t)}.bind(this),this.add("videoiframe")):apijs.startPlayer(this.media,t)?this.add("apijsvideoplayer"):(this.c=document.createElement("source"),this.c.setAttribute("src",t),this.c.onerror=this.onMediaLoad,this.media.appendChild(this.c),this.media.ondurationchange=this.onMediaLoad,this.media.onerror=this.onMediaLoad,this.add("videosource")),this},this.htmlHelp=function(t,e){if(!("ontouchstart"in window&&navigator.userAgent.match(/mobi/i))){var i,s,a=[t?["start",149,141]:[],t?["left","right",142]:[],e?["topk","bottom",144]:[],e?["minus","plus",145]:[],e?["M",146]:[],e?["P",143]:[],["F11",147],[150,148]];for(this.a=document.createElement("ul"),this.a.setAttribute("class","kbd nofullscreen");i=a.shift();)if(0<i.length){for(this.b=document.createElement("li");s=i.shift();)0<i.length?(this.c=document.createElement("kbd"),["M","P","F11"].has(s)?this.c.appendChild(document.createTextNode(s)):"string"==typeof s?this.c.setAttribute("class",s):this.c.appendChild(apijs.i18n.translateNode(s)),this.b.appendChild(this.c)):this.b.appendChild(apijs.i18n.translateNode(s));this.a.appendChild(this.b)}this.t2.appendChild(this.a)}return this},this.htmlIframe=function(t){return this.a=document.createElement("iframe"),this.a.setAttribute("src",t),this.a.setAttribute("class","loading"),this.a.setAttribute("onload","apijs.dialog.onIframeLoad(this);"),this.t2.appendChild(this.a),this}},apijs.core.slideshow=function(){this.current=null,this.init=function(){for(var t,e,i,s=apijs.config.slideshow.ids,a=0;e=apijs.html(s+"."+a,!0);a++){for(i=e.classList.contains("hoverload"),t=0;e=apijs.html(s+"."+a+"."+t,!0);t++)e.addEventListener("click",this.show),i&&e.addEventListener("mouseover",this.show);(e=apijs.html(s+"."+a+".99999",!0))&&e.addEventListener("click",this.show)}this.onPopState()},this.onPopState=function(){var t;new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)?(t=RegExp.$1.replace(/-/g,"."),apijs.html(t,!0)&&!apijs.dialog.has("slideshow")&&apijs.slideshow.show(t,!1)):apijs.slideshow.current&&apijs.dialog.actionClose()},this.show=function(t,e){var i,s,a,n=!1,o={};if("string"==typeof t)i=apijs.html(t,n=!0),o.id=t;else{for(t.preventDefault(),i=t.target;"A"!==i.nodeName;)i=i.parentNode;if("mouseover"===t.type&&i.classList.contains("current"))return!1;o.id=i.getAttribute("id")}return o.prefix=apijs.config.slideshow.ids+"."+o.id.split(".")[1],o.number=parseInt(o.id.split(".")[2],10),o.gallery=apijs.html(o.prefix+".99999",!0),99999!==o.number&&(t=apijs.html(o.prefix,!0).querySelectorAll("a[id][type]"),a=apijs.html(o.prefix,!0).querySelectorAll("dl"),(o.gallery||t.length!==a.length?(t.forEach(function(t){t.classList.remove("current")}),i):(a.forEach(function(t){t.classList.remove("current")}),i.parentNode.parentNode)).setAttribute("class","current")),o.gallery?(99999===o.number&&(n=!0,i=o.gallery.hasAttribute("class")?o.gallery.getAttribute("class"):o.prefix+".0",i=apijs.html(i,!0),o.number=parseInt(i.getAttribute("id").split(".")[2],10),o.id=o.id.replace("99999",o.number)),o.config=i.querySelector("input").getAttribute("value").split("|"),0<(t=o.config.shift()).indexOf(";")&&(s=(t=t.split(";"))[1].trim(),t=t[0].trim()),o.gallery.setAttribute("href",i.getAttribute("href")),o.gallery.querySelector("img").setAttribute("src",t),o.gallery.querySelector("img").setAttribute("srcset",s||""),o.gallery.querySelector("img").setAttribute("alt",i.querySelector("img").getAttribute("alt")),o.gallery.setAttribute("class",o.id)):(n=!0,o.config=i.querySelector("input").getAttribute("value").split("|")),o.url=i.getAttribute("href"),o.type=i.getAttribute("type").substring(0,5).replace("image","dialogPhoto").replace("video","dialogVideo").replace("audio","dialogVideo"),o.type=0===o.type.indexOf("dialog")?o.type:"dialogPhoto",o.styles=apijs.html(o.prefix,!0),o.styles=o.styles.hasAttribute("class")?o.styles.getAttribute("class").replace(/gallery|album/g,"").trim():"",n&&(apijs.dialog[o.type](o.url,o.config[0],o.config[1],o.config[2],o.styles),a=apijs.html(o.prefix,!0).querySelectorAll("a[id][type]").length-(o.gallery?2:1),apijs.slideshow.current={number:o.number,first:o.prefix+".0",prev:0<o.number?o.prefix+"."+(o.number-1):null,next:o.number<a?o.prefix+"."+(o.number+1):null,last:o.prefix+"."+a,total:a},apijs.slideshow.current.prev&&apijs.html("#Prev").removeAttribute("disabled"),apijs.slideshow.current.next&&apijs.html("#Next").removeAttribute("disabled"),apijs.config.slideshow.anchor)&&"function"==typeof history.pushState&&("boolean"!=typeof e||e)&&(t=0<(t=self.location.href).indexOf("#")?t.slice(0,t.indexOf("#")):t,t+="#"+(o.prefix+"."+(99999===o.number?0:o.number)).replace(/\./g,"-"),history.pushState({},"",t)),n},this.actionFirst=function(){return!!(this.current&&0<this.current.number&&this.current.number<=this.current.total)&&this.show(this.current.first)},this.actionPrev=function(){return!!(this.current&&this.current.prev&&0<this.current.number)&&this.show(this.current.prev)},this.actionNext=function(){return!!(this.current&&this.current.next&&this.current.number<this.current.total)&&this.show(this.current.next)},this.actionLast=function(){return!!(this.current&&0<=this.current.number&&this.current.number<this.current.total)&&this.show(this.current.last)}},apijs.core.upload=function(){this.title=null,this.action=null,this.input=null,this.onemax=0,this.allmax=0,this.exts=null,this.callback=null,this.args=null,this.icon=null,this.start=0,this.end=0,this.sendFile=function(t,e,i,s,a,n,o,r){t=this.sendFiles(t,e,i,s,0,a,n,o,r);return t||console.error("apijs.upload.sendFile invalid arguments",arguments),t},this.sendFiles=function(t,e,i,s,a,n,o,r,l){return!0!==t&&(this.title=t,this.action=e,this.input=i,this.onemax=s,this.allmax=a,this.exts="string"==typeof n?n.split(","):["*"],this.callback=o,this.args=r,this.icon=l),"string"==typeof this.title&&"string"==typeof this.action&&"string"==typeof this.input&&"number"==typeof this.onemax&&"number"==typeof this.allmax&&"function"==typeof this.callback?(t=0<this.allmax,e="*"===this.exts.join()?apijs.i18n.translate(161):1===this.exts.length?apijs.i18n.translate(162,this.exts.join()):apijs.i18n.translate(163,this.exts.slice(0,-1).join(", "),this.exts.slice(-1)),e+="[br]"+apijs.i18n.translate(t?165:164,apijs.formatNumber(this.onemax),t?apijs.formatNumber(this.allmax):"").replace("|","[br]"),apijs.dialog.dialogFormUpload(this.title,e,this.action,this.input,t,this.icon)):(("number"!=typeof this.allmax||0<this.allmax)&&console.error("apijs.upload.sendFiles invalid arguments",arguments),!1)},this.actionDrag=function(t){var e=apijs.dialog.t3,i=!0;if("dragenter"===t.type)apijs.dialog.add("drag");else if("dragleave"===t.type)apijs.dialog.remove("drag");else if(t.dataTransfer&&t.dataTransfer.files&&0<t.dataTransfer.files.length){try{e.files=t.dataTransfer.files,apijs.upload.actionChoose(e)}catch(t){console.error(t),apijs.html(".drag").remove()}apijs.dialog.remove("drag")}else if(t.clipboardData&&t.clipboardData.files&&0<t.clipboardData.files.length)try{e.files=t.clipboardData.files,apijs.upload.actionChoose(e,!0)}catch(t){console.error(t),apijs.html(".drag").remove()}else t.clipboardData&&(i=!1);i&&(t.stopPropagation(),t.preventDefault())},this.actionChoose=function(t,s){var a=[],n=0,e=apijs.html("button.confirm");!this.exts||(apijs.toArray(t.files,0<this.allmax?999:1).forEach(function(t,e){var i=t.size/1048576,i=apijs.formatNumber(i<.01?.01:i);i=(s||0<this.allmax?'<td class="nb">'+(s?(new Date).toTimeString().substring(0,8):e+1)+"</td>":"")+'<td class="name">'+t.name+'</td><td class="size">'+apijs.i18n.translate(166,i)+"</td>","*"===this.exts.join()||this.exts.has(t.name.slice(t.name.lastIndexOf(".")+1).toLowerCase())?t.size>1048576*this.onemax?i+='<td class="err">'+apijs.i18n.translate(168)+"</td>":t.size<=0?i+='<td class="err">'+apijs.i18n.translate(169)+"</td>":i+="<td></td>":i+='<td class="err">'+apijs.i18n.translate(167)+"</td>",a.push("<tr>"+i+"</tr>"),n+=t.size/1048576},this),0<this.allmax&&n>=this.allmax&&a.push('<tr class="tt"><td></td><td></td><td class="size">'+apijs.i18n.translate(166,apijs.formatNumber(n))+'</td><td class="err">'+apijs.i18n.translate(168)+"</td></tr>"),apijs.html("div.filenames").innerHTML="<table>"+a.join("")+"</table>",apijs.html("div.filenames .err"))?e.setAttribute("disabled","disabled"):(e.removeAttribute("disabled"),e.focus())},this.actionConfirm=function(){var t,e;return 0<apijs.dialog.t3.files.length?(t=new FormData(apijs.dialog.t2),(e=new XMLHttpRequest).open("POST",this.action+(0<this.action.indexOf("?")?"&isAjax=true":"?isAjax=true"),!0),"string"==typeof apijs.config.upload.tokenValue&&(e.setRequestHeader(apijs.config.upload.tokenName,apijs.config.upload.tokenValue),t.append(apijs.config.upload.tokenName,apijs.config.upload.tokenValue)),e.onreadystatechange=function(t){4===e.readyState&&(t=e.responseText.trim(),[0,200].has(e.status)?(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijs.upload.send",xhr:e}})),apijs.log("upload:onreadystatechange status:200 message:"+t),0===t.indexOf("success-")?(this.updateTitle(),this.callback(t.slice(8),this.args)):this.onError(195,t)):(apijs.log("upload:onreadystatechange status:"+e.status+" message: "+t),this.onError(194,e.status)))}.bind(this),e.upload.onloadstart=this.onStart.bind(this),e.upload.onprogress=this.onProgress.bind(this),e.upload.onload=this.onProgress.bind(this),e.upload.onerror=this.onError.bind(this),e.send(t)):apijs.html("button.browse").focus(),!1},this.onStart=function(){this.start=this.end=Math.round((new Date).getTime()/1e3),apijs.dialog.dialogProgress(this.title,apijs.i18n.translate(125),this.icon)},this.onError=function(t,e){this.updateTitle(),"number"==typeof t?e="[p]"+apijs.i18n.translate(t)+"[/p] "+e:"string"!=typeof e&&(e="[p]"+apijs.i18n.translate(193)+"[/p]"),e+="[p]"+apijs.i18n.translate(196,'href="apijs://restart" onclick="apijs.upload.sendFile(true); return false;"')+"[/p]",apijs.dialog.dialogInformation(this.title,e,"string"==typeof this.icon?"upload error "+this.icon:"upload error")},this.onProgress=function(t){var e,i,s,a,n,o,r=Math.round((new Date).getTime()/1e3);t.lengthComputable&&"progress"===t.type&&r>=this.end+2?(this.end=r,0<(e=Math.floor(100*t.loaded/t.total))&&e<100&&(this.updateTitle(e),n=100*(r=r-this.start)/e+10,24<r&&(a=Math.round(n-r),a=10*Math.ceil(a/10),o=Math.ceil(a/60),s=Math.round(t.loaded/r/1024),r<40||n<90?(i=184,a=null):1<o?(i=181,a=o):50<a?(i=182,a=1):i=183),this.updateProgress(e,i,s,a))):"load"===t.type&&(a=Math.round((new Date).getTime()/1e3)-this.start,o=Math.ceil(a/60),0<(s=Math.round(t.loaded/a/1024))&&s!==1/0?1<o?(i=185,a=o):50<a?(i=186,a=1):20<a?i=187:(i=188,a=null):a=s=null,this.updateTitle(100),this.updateProgress(100,i,s,a))},this.updateProgress=function(t,e,i,s){var a,n,o=apijs.html("rect"),r=apijs.html("span.info");99<t?(a="100%",o.setAttribute("class","end"),o.style.width="",(n=apijs.html("p")).setAttribute("data-old",n.textContent),n.setAttribute("data-new",apijs.i18n.translate(126)),n.setAttribute("class","anim"),n.textContent=""):(o.style.width=a=t+"%",o.hasAttribute("class")&&o.removeAttribute("class")),"number"==typeof e&&"number"==typeof i&&"number"==typeof s?a=apijs.i18n.translate(e,t,apijs.formatNumber(i,!1),s):"number"==typeof e&&"number"==typeof i&&(a=apijs.i18n.translate(e,t,apijs.formatNumber(i,!1))),r.textContent=a},this.updateTitle=function(t){"number"==typeof t?document.title=/^\d{1,3}% - /.test(document.title)?t+"% - "+document.title.slice(document.title.indexOf(" - ")+3):t+"% - "+document.title:/^\d{1,3}% - /.test(document.title)&&(document.title=document.title.slice(document.title.indexOf(" - ")+3))}};
|
8
8
|
//# sourceMappingURL=apijs.min.js.map
|