documentacion del articulo
This commit is contained in:
BIN
Tesis Daniel/bibli/11.++GESTION+FINANCIERA+EN+LAS+PYMES+-+21.pdf
Normal file
BIN
Tesis Daniel/bibli/11.++GESTION+FINANCIERA+EN+LAS+PYMES+-+21.pdf
Normal file
Binary file not shown.
BIN
Tesis Daniel/bibli/20210730085600655.pdf
Normal file
BIN
Tesis Daniel/bibli/20210730085600655.pdf
Normal file
Binary file not shown.
BIN
Tesis Daniel/bibli/71756752.2023.pdf
Normal file
BIN
Tesis Daniel/bibli/71756752.2023.pdf
Normal file
Binary file not shown.
25783
Tesis Daniel/bibli/Hernandez2024b.pdf
Normal file
25783
Tesis Daniel/bibli/Hernandez2024b.pdf
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Tesis Daniel/bibli/RamirezMorales_Ivan_TD_2018.pdf
Normal file
BIN
Tesis Daniel/bibli/RamirezMorales_Ivan_TD_2018.pdf
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,134 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es-ES" xml:lang="es-ES"><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Vista de Estudio del uso de técnicas de inteligencia artificial aplicadas para análisis de suelos para el sector agrícola</title>
|
||||
|
||||
|
||||
<link rel="icon" href="https://www.recimundo.com/public/journals/1/favicon_es_ES.jpg">
|
||||
<meta name="generator" content="Open Journal Systems 3.2.0.4">
|
||||
<!-- Go to www.addthis.com/dashboard to customize your tools --> <script type="text/javascript" async="" src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/js"></script><script type="text/javascript" async="" defer="defer" src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/piwik.js"></script><script async="" src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/analytics.js"></script><script async="" src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/matomo.js"></script><script type="text/javascript" src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/addthis_widget.js"></script>
|
||||
|
||||
|
||||
<!-- Matomo -->
|
||||
<script>
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="https://recimundo.matomo.cloud/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '1']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.async=true; g.src='//cdn.matomo.cloud/recimundo.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<!-- End Matomo Code -->
|
||||
|
||||
|
||||
<link rel="stylesheet" href="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
||||
|
||||
<style>
|
||||
.at4-share-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.section-reciamuc {
|
||||
width:auto;
|
||||
margin:0 auto;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.column {
|
||||
width:25%;
|
||||
margin:10px;
|
||||
flex-grow:1;
|
||||
flex-shrink:1;
|
||||
}
|
||||
|
||||
.column a {
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
.column a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
.cd-top--is-visible { // back-to-top button visible
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.cd-top--fade-out { // reduce button opacity if user keeps scrolling
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
@media only screen
|
||||
and (min-device-width : 320px)
|
||||
and (max-device-width : 480px) {
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/css.css" type="text/css"><link rel="stylesheet" href="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/css_002.css" type="text/css"><link rel="stylesheet" href="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/font-awesome.css" type="text/css"><link rel="stylesheet" href="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/styleSheet.css" type="text/css">
|
||||
<script src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/jquery.js" type="text/javascript"></script><script src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/jquery-ui.js" type="text/javascript"></script><script src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/jquery.tag-it.js" type="text/javascript"></script><script src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/popper.js" type="text/javascript"></script><script src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/util.js" type="text/javascript"></script><script src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/dropdown.js" type="text/javascript"></script><script src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/main.js" type="text/javascript"></script><script type="text/javascript">
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-158557642-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><script type="text/javascript"> var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//recimundo.matomo.cloud/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', 1]);
|
||||
_paq.push(['setDocumentTitle', "es"]);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
})();</script>
|
||||
</head>
|
||||
<body class="pkp_page_article pkp_op_view">
|
||||
|
||||
<header class="header_view">
|
||||
|
||||
<a href="https://www.recimundo.com/index.php/es/article/view/978" class="return">
|
||||
<span class="pkp_screen_reader">
|
||||
Volver a los detalles del artículo
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="https://www.recimundo.com/index.php/es/article/view/978" class="title">
|
||||
Estudio del uso de técnicas de inteligencia artificial aplicadas para análisis de suelos para el sector agrícola
|
||||
</a>
|
||||
|
||||
<a href="https://www.recimundo.com/index.php/es/article/download/978/1672/2207" class="download" download="">
|
||||
<span class="label">
|
||||
Descargar
|
||||
</span>
|
||||
<span class="pkp_screen_reader">
|
||||
Descargar PDF
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</header>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Creating iframe's src in JS instead of Smarty so that EZProxy-using sites can find our domain in $pdfUrl and do their rewrites on it.
|
||||
$(document).ready(function() {
|
||||
var urlBase = "https://www.recimundo.com/plugins/generic/hypothesis/pdf.js/viewer/web/viewer.html?file=";
|
||||
var pdfUrl = "https:\/\/www.recimundo.com\/index.php\/es\/article\/download\/978\/1672\/2207";
|
||||
$("#pdfCanvasContainer > iframe").attr("src", urlBase + encodeURIComponent(pdfUrl));
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="pdfCanvasContainer" class="galley_view">
|
||||
<iframe src="Vista%20de%20Estudio%20del%20uso%20de%20t%C3%A9cnicas%20de%20inteligencia%20artificial%20aplicadas%20para%20an%C3%A1lisis%20de%20suelos%20para%20el%20sector%20agr%C3%ADcola_files/viewer.htm" width="100%" height="100%" style="min-height: 500px;" title="PDF de Estudio del uso de técnicas de inteligencia artificial aplicadas para análisis de suelos para el sector agrícola" allowfullscreen="" webkitallowfullscreen=""></iframe>
|
||||
</div>
|
||||
<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_id=https%3A%2F%2Fwww.recimundo.com%2Findex.php%2Fes%2Farticle%2Fview%2F978&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.language=es_ES&rft.genre=article&rft.title=RECIMUNDO&rft.jtitle=RECIMUNDO&rft.atitle=Estudio+del+uso+de+t%C3%A9cnicas+de+inteligencia+artificial+aplicadas+para+an%C3%A1lisis+de+suelos+para+el+sector+agr%C3%ADcola&rft.artnum=978&rft.stitle=&rft.volume=5&rft.issue=1&rft.aulast=Bonilla+Segovia&rft.aufirst=Juan+Sebastian&rft.date=2021-01-23&rft.au=Francisco+Andr%C3%A9s+D%C3%A1vila+Rojas&rft.au=Manuel+William+Villa+Quishpe&rft_id=info%3Adoi%2F10.26820%2Frecimundo%2F5.%281%29.enero.2021.4-19&rft.pages=4-19&rft.eissn=2588-073X"></span>
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,96 @@
|
||||
(function(){/*
|
||||
|
||||
Copyright The Closure Library Authors.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
var n=this||self,p=function(a,b){a=a.split(".");var c=n;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}:c[d]=b};function q(){for(var a=r,b={},c=0;c<a.length;++c)b[a[c]]=c;return b}function u(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";a+=a.toLowerCase()+"0123456789-_";return a+"."}var r,v;
|
||||
function aa(a){function b(k){for(;d<a.length;){var m=a.charAt(d++),l=v[m];if(null!=l)return l;if(!/^[\s\xa0]*$/.test(m))throw Error("Unknown base64 encoding at char: "+m);}return k}r=r||u();v=v||q();for(var c="",d=0;;){var e=b(-1),f=b(0),h=b(64),g=b(64);if(64===g&&-1===e)return c;c+=String.fromCharCode(e<<2|f>>4);64!=h&&(c+=String.fromCharCode(f<<4&240|h>>2),64!=g&&(c+=String.fromCharCode(h<<6&192|g)))}};var w={},y=function(a){w.TAGGING=w.TAGGING||[];w.TAGGING[a]=!0};var ba=Array.isArray,ca=function(a,b){if(a&&ba(a))for(var c=0;c<a.length;c++)if(a[c]&&b(a[c]))return a[c]},z=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},A=function(a){for(var b in a)if(a.hasOwnProperty(b))return!0;return!1};var B=function(a){this.j=a};B.prototype.toString=function(){return this.j.toString()};var C=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;new B("about:invalid#zClosurez");new B("about:blank");var D=function(){this.i=""};D.prototype.toString=function(){return this.i.toString()};new D;var E=function(){this.h=""};E.prototype.toString=function(){return this.h.toString()};new E;var F=function(){this.g=n.trustedTypes&&n.trustedTypes.emptyHTML||""};F.prototype.toString=function(){return this.g.toString()};new F;var G=window,H=window.history,I=document,J=navigator,K=function(){var a={},b=G.google_tag_data;G.google_tag_data=void 0===b?a:b;return G.google_tag_data},L=function(a,b){I.addEventListener?I.addEventListener(a,b,!1):I.attachEvent&&I.attachEvent("on"+a,b)};var da=function(a){var b=M();b.pending||(b.pending=[]);ca(b.pending,function(c){return c.target.ctid===a.ctid&&c.target.isDestination===a.isDestination})||b.pending.push({target:a,onLoad:void 0})},ea=function(){this.container={};this.destination={};this.canonical={};this.pending=[]},M=function(){var a=K(),b=a.tidr;b||(b=new ea,a.tidr=b);return b};var N=/:[0-9]+$/,Q=function(a,b){b&&(b=String(b).toLowerCase());if("protocol"===b||"port"===b)a.protocol=O(a.protocol)||O(G.location.protocol);"port"===b?a.port=String(Number(a.hostname?a.port:G.location.port)||("http"===a.protocol?80:"https"===a.protocol?443:"")):"host"===b&&(a.hostname=(a.hostname||G.location.hostname).replace(N,"").toLowerCase());return P(a,b)},P=function(a,b,c){var d=O(a.protocol);b&&(b=String(b).toLowerCase());switch(b){case "url_no_fragment":c="";a&&a.href&&(c=a.href.indexOf("#"),
|
||||
c=0>c?a.href:a.href.substr(0,c));a=c;break;case "protocol":a=d;break;case "host":a=a.hostname.replace(N,"").toLowerCase();c&&(c=/^www\d*\./.exec(a))&&c[0]&&(a=a.substr(c[0].length));break;case "port":a=String(Number(a.port)||("http"===d?80:"https"===d?443:""));break;case "path":a.pathname||a.hostname||y(1);a="/"===a.pathname.substr(0,1)?a.pathname:"/"+a.pathname;a=a.split("/");0<=[].indexOf(a[a.length-1])&&(a[a.length-1]="");a=a.join("/");break;case "query":a=a.search.replace("?","");break;case "extension":a=
|
||||
a.pathname.split(".");a=1<a.length?a[a.length-1]:"";a=a.split("/")[0];break;case "fragment":a=a.hash.replace("#","");break;default:a=a&&a.href}return a},O=function(a){return a?a.replace(":","").toLowerCase():""},R=function(a){var b=I.createElement("a");a&&(b.href=a);var c=b.pathname;"/"!==c[0]&&(a||y(1),c="/"+c);a=b.hostname.replace(N,"");return{href:b.href,protocol:b.protocol,host:b.host,hostname:a,pathname:c,search:b.search,hash:b.hash,port:b.port}};var S;var U=function(){var a=fa,b=ha,c=T(),d=function(h){a(h.target||h.srcElement||{})},e=function(h){b(h.target||h.srcElement||{})};if(!c.init){L("mousedown",d);L("keyup",d);L("submit",e);var f=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){b(this);f.call(this)};c.init=!0}},ia=function(a,b,c,d,e){a={callback:a,domains:b,fragment:2===c,placement:c,forms:d,sameHost:e};T().decorators.push(a)},V=function(a,b,c){for(var d=T().decorators,e={},f=0;f<d.length;++f){var h=d[f],g;if(g=
|
||||
!c||h.forms)a:{g=h.domains;var k=a,m=!!h.sameHost;if(g&&(m||k!==I.location.hostname))for(var l=0;l<g.length;l++)if(g[l]instanceof RegExp){if(g[l].test(k)){g=!0;break a}}else if(0<=k.indexOf(g[l])||m&&0<=g[l].indexOf(k)){g=!0;break a}g=!1}g&&(g=h.placement,void 0==g&&(g=h.fragment?2:1),g===b&&z(e,h.callback()))}return e};function T(){var a=K(),b=a.gl;b&&b.decorators||(b={decorators:[]},a.gl=b);return b};var ja=/(.*?)\*(.*?)\*(.*)/,ka=/([^?#]+)(\?[^#]*)?(#.*)?/;function W(a){return new RegExp("(.*?)(^|&)"+a+"=([^&]*)&?(.*)")}
|
||||
var X=function(a){var b=[],c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(void 0!==d&&d===d&&null!==d&&"[object Object]"!==d.toString()){b.push(c);var e=b,f=e.push;d=String(d);r=r||u();v=v||q();for(var h=[],g=0;g<d.length;g+=3){var k=g+1<d.length,m=g+2<d.length,l=d.charCodeAt(g),t=k?d.charCodeAt(g+1):0,x=m?d.charCodeAt(g+2):0,ra=l>>2;l=(l&3)<<4|t>>4;t=(t&15)<<2|x>>6;x&=63;m||(x=64,k||(t=64));h.push(r[ra],r[l],r[t],r[x])}f.call(e,h.join(""))}}a=b.join("*");return["1",la(a),a].join("*")};
|
||||
function la(a,b){a=[J.userAgent,(new Date).getTimezoneOffset(),J.userLanguage||J.language,Math.floor((new Date(Date.now())).getTime()/60/1E3)-(void 0===b?0:b),a].join("*");if(!(b=S)){b=Array(256);for(var c=0;256>c;c++){for(var d=c,e=0;8>e;e++)d=d&1?d>>>1^3988292384:d>>>1;b[c]=d}}S=b;b=4294967295;for(c=0;c<a.length;c++)b=b>>>8^S[(b^a.charCodeAt(c))&255];return((b^-1)>>>0).toString(36)}
|
||||
function ma(a){return function(b){var c=R(G.location.href),d=c.search.replace("?","");a:{var e=d.split("&");for(var f=0;f<e.length;f++){var h=e[f].split("=");if("_gl"===decodeURIComponent(h[0]).replace(/\+/g," ")){e=h.slice(1).join("=");break a}}e=void 0}b.query=na(e||"")||{};e=Q(c,"fragment");f=e.match(W("_gl"));b.fragment=na(f&&f[3]||"")||{};a&&oa(c,d,e)}}function pa(a,b){if(a=W(a).exec(b)){var c=a[2],d=a[4];b=a[1];d&&(b=b+c+d)}return b}
|
||||
function oa(a,b,c){function d(f,h){f=pa("_gl",f);f.length&&(f=h+f);return f}if(H&&H.replaceState){var e=W("_gl");if(e.test(b)||e.test(c))a=Q(a,"path"),b=d(b,"?"),c=d(c,"#"),H.replaceState({},void 0,""+a+b+c)}}
|
||||
var na=function(a){try{a:{if(a){b:{for(var b=0;3>b;++b){var c=ja.exec(a);if(c){var d=c;break b}a=decodeURIComponent(a)}d=void 0}if(d&&"1"===d[1]){var e=d[2],f=d[3];b:{for(d=0;3>d;++d)if(e===la(f,d)){var h=!0;break b}h=!1}if(h){var g=f;break a}y(7)}}g=void 0}e=g;if(void 0!==e){g={};var k=e?e.split("*"):[];for(e=0;e+1<k.length;e+=2){var m=k[e],l=aa(k[e+1]);g[m]=l}y(6);return g}}catch(t){y(8)}};
|
||||
function Y(a,b,c,d){function e(k){k=pa(a,k);var m=k.charAt(k.length-1);k&&"&"!==m&&(k+="&");return k+g}d=void 0===d?!1:d;var f=ka.exec(c);if(!f)return"";c=f[1];var h=f[2]||"";f=f[3]||"";var g=a+"="+b;d?f="#"+e(f.substring(1)):h="?"+e(h.substring(1));return""+c+h+f}function qa(a,b){var c="FORM"===(a.tagName||"").toUpperCase(),d=V(b,1,c),e=V(b,2,c);b=V(b,3,c);A(d)&&(d=X(d),c?sa("_gl",d,a):Z("_gl",d,a,!1));!c&&A(e)&&(c=X(e),Z("_gl",c,a,!0));for(var f in b)b.hasOwnProperty(f)&&ta(f,b[f],a)}
|
||||
function ta(a,b,c,d){if(c.tagName){if("a"===c.tagName.toLowerCase())return Z(a,b,c,d);if("form"===c.tagName.toLowerCase())return sa(a,b,c)}if("string"==typeof c)return Y(a,b,c,d)}function Z(a,b,c,d){c.href&&(a=Y(a,b,c.href,void 0===d?!1:d),C.test(a)&&(c.href=a))}
|
||||
function sa(a,b,c){if(c&&c.action){var d=(c.method||"").toLowerCase();if("get"===d){d=c.childNodes||[];for(var e=!1,f=0;f<d.length;f++){var h=d[f];if(h.name===a){h.setAttribute("value",b);e=!0;break}}e||(d=I.createElement("input"),d.setAttribute("type","hidden"),d.setAttribute("name",a),d.setAttribute("value",b),c.appendChild(d))}else"post"===d&&(a=Y(a,b,c.action),C.test(a)&&(c.action=a))}}
|
||||
function fa(a){try{a:{for(var b=100;a&&0<b;){if(a.href&&a.nodeName.match(/^a(?:rea)?$/i)){var c=a;break a}a=a.parentNode;b--}c=null}if(c){var d=c.protocol;"http:"!==d&&"https:"!==d||qa(c,c.hostname)}}catch(e){}}function ha(a){try{if(a.action){var b=Q(R(a.action),"host");qa(a,b)}}catch(c){}};p("google_tag_data.glBridge.auto",function(a,b,c,d){U();ia(a,b,"fragment"===c?2:1,!!d,!1)});p("google_tag_data.glBridge.passthrough",function(a,b,c){U();ia(a,[P(G.location,"host",!0)],b,!!c,!0)});p("google_tag_data.glBridge.decorate",function(a,b,c){a=X(a);return ta("_gl",a,b,!!c)});p("google_tag_data.glBridge.generate",X);p("google_tag_data.glBridge.get",function(a,b){var c=ma(!!b);b=T();b.data||(b.data={query:{},fragment:{}},c(b.data));c={};if(b=b.data)z(c,b.query),a&&z(c,b.fragment);return c});
|
||||
p("google_tag_data.tcBridge.registerUa",function(a,b){a=a+"_"+b;var c=M(),d=c.destination[a];d?(d.state=2,d.containers=[],d.destinations=[b]):c.destination[a]={state:2,containers:[],destinations:[b]}});p("google_tag_data.tcBridge.setSideload",function(a,b,c){a={ctid:a+"_"+c,isDestination:!0};M().container[b]={state:1,context:{source:5,fromContainerExecution:!0},parent:a};da({ctid:b,isDestination:!1})});})(window);
|
||||
(function(){function La(a){var b=1,c;if(a)for(b=0,c=a.length-1;0<=c;c--){var d=a.charCodeAt(c);b=(b<<6&268435455)+d+(d<<14);d=b&266338304;b=0!=d?b^d>>21:b}return b};var $c=function(a){this.C=a||[]};$c.prototype.set=function(a){this.C[a]=!0};$c.prototype.get=function(a){return this.C[a]};$c.prototype.encode=function(){for(var a=[],b=0;b<this.C.length;b++)this.C[b]&&(a[Math.floor(b/6)]^=1<<b%6);for(b=0;b<a.length;b++)a[b]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(a[b]||0);return a.join("")+"~"};var ha=window.GoogleAnalyticsObject,wa;if(wa=void 0!=ha)wa=-1<(ha.constructor+"").indexOf("String");var ya;if(ya=wa){var fc=window.GoogleAnalyticsObject;ya=fc?fc.replace(/^[\s\xa0]+|[\s\xa0]+$/g,""):""}var gb=ya||"ga",jd=/^(?:utma\.)?\d+\.\d+$/,kd=/^amp-[\w.-]{22,64}$/,Ba=!1;var vd=new $c;function J(a){vd.set(a)}var Td=function(a){a=Dd(a);a=new $c(a);for(var b=vd.C.slice(),c=0;c<a.C.length;c++)b[c]=b[c]||a.C[c];return(new $c(b)).encode()},Dd=function(a){a=a.get(Gd);ka(a)||(a=[]);return a};var ea=function(a){return"function"==typeof a},ka=function(a){return"[object Array]"==Object.prototype.toString.call(Object(a))},qa=function(a){return void 0!=a&&-1<(a.constructor+"").indexOf("String")},D=function(a,b){return 0==a.indexOf(b)},sa=function(a){return a?a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,""):""},ra=function(){for(var a=O.navigator.userAgent+(M.cookie?M.cookie:"")+(M.referrer?M.referrer:""),b=a.length,c=O.history.length;0<c;)a+=c--^b++;return[hd()^La(a)&2147483647,Math.round((new Date).getTime()/
|
||||
1E3)].join(".")},ta=function(a){var b=M.createElement("img");b.width=1;b.height=1;b.src=a;return b},ua=function(){},K=function(a){if(encodeURIComponent instanceof Function)return encodeURIComponent(a);J(28);return a},L=function(a,b,c,d){try{a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent&&a.attachEvent("on"+b,c)}catch(e){J(27)}},f=/^[\w\-:/.?=&%!\[\]]+$/,Nd=/^[\w+/_-]+[=]{0,2}$/,ff=null,Id=function(a,b,c,d,e){if(!ff){ff={createScriptURL:function(ca){return ca},createHTML:function(ca){return ca}};
|
||||
try{ff=window.trustedTypes.createPolicy("google-analytics",ff)}catch(ca){}}if(a){var g=M.querySelector&&M.querySelector("script[nonce]")||null;g=g?g.nonce||g.getAttribute&&g.getAttribute("nonce")||"":"";c?(e=d="",b&&f.test(b)&&(d=' id="'+b+'"'),g&&Nd.test(g)&&(e=' nonce="'+g+'"'),f.test(a)&&M.write(ff.createHTML("<script"+d+e+' src="'+a+'">\x3c/script>'))):(c=M.createElement("script"),c.type="text/javascript",c.async=!0,c.src=ff.createScriptURL(a),d&&(c.onload=d),e&&(c.onerror=e),b&&(c.id=b),g&&c.setAttribute("nonce",
|
||||
g),a=M.getElementsByTagName("script")[0],a.parentNode.insertBefore(c,a))}},be=function(a,b){return E(M.location[b?"href":"search"],a)},E=function(a,b){return(a=a.match("(?:&|#|\\?)"+K(b).replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")+"=([^&#]*)"))&&2==a.length?a[1]:""},xa=function(){var a=""+M.location.hostname;return 0==a.indexOf("www.")?a.substring(4):a},de=function(a,b){var c=a.indexOf(b);if(5==c||6==c)if(a=a.charAt(c+b.length),"/"==a||"?"==a||""==a||":"==a)return!0;return!1},of=function(a,b){var c=
|
||||
M.referrer;if(/^(https?|android-app):\/\//i.test(c)){if(a)return c;a="//"+M.location.hostname;if(!de(c,a))return b&&(b=a.replace(/\./g,"-")+".cdn.ampproject.org",de(c,b))?void 0:c}},za=function(a,b){if(1==b.length&&null!=b[0]&&"object"===typeof b[0])return b[0];for(var c={},d=Math.min(a.length+1,b.length),e=0;e<d;e++)if("object"===typeof b[e]){for(var g in b[e])b[e].hasOwnProperty(g)&&(c[g]=b[e][g]);break}else e<a.length&&(c[a[e]]=b[e]);return c},Ee=function(a,b){for(var c=0;c<a.length;c++)if(b==
|
||||
a[c])return!0;return!1};var ee=function(){this.oa=[];this.ea={};this.m={}};ee.prototype.set=function(a,b,c){this.oa.push(a);c?this.m[":"+a]=b:this.ea[":"+a]=b};ee.prototype.get=function(a){return this.m.hasOwnProperty(":"+a)?this.m[":"+a]:this.ea[":"+a]};ee.prototype.map=function(a){for(var b=0;b<this.oa.length;b++){var c=this.oa[b],d=this.get(c);d&&a(c,d)}};var O=window,M=document,jf=document.currentScript?document.currentScript.src:"",va=function(a,b){return setTimeout(a,b)};var Qa=window,Za=document,G=function(a){var b=Qa._gaUserPrefs;if(b&&b.ioo&&b.ioo()||Za.documentElement.hasAttribute("data-google-analytics-opt-out")||a&&!0===Qa["ga-disable-"+a])return!0;try{var c=Qa.external;if(c&&c._gaUserPrefs&&"oo"==c._gaUserPrefs)return!0}catch(g){}a=[];b=String(Za.cookie).split(";");for(c=0;c<b.length;c++){var d=b[c].split("="),e=d[0].replace(/^\s*|\s*$/g,"");e&&"AMP_TOKEN"==e&&((d=d.slice(1).join("=").replace(/^\s*|\s*$/g,""))&&(d=decodeURIComponent(d)),a.push(d))}for(b=0;b<
|
||||
a.length;b++)if("$OPT_OUT"==a[b])return!0;return Za.getElementById("__gaOptOutExtension")?!0:!1};var Ca=function(a){var b=[],c=M.cookie.split(";");a=new RegExp("^\\s*"+a+"=\\s*(.*?)\\s*$");for(var d=0;d<c.length;d++){var e=c[d].match(a);e&&b.push(e[1])}return b},zc=function(a,b,c,d,e,g,ca){e=G(e)?!1:eb.test(M.location.hostname)||"/"==c&&vc.test(d)?!1:!0;if(!e)return!1;b&&1200<b.length&&(b=b.substring(0,1200));c=a+"="+b+"; path="+c+"; ";g&&(c+="expires="+(new Date((new Date).getTime()+g)).toGMTString()+"; ");d&&"none"!==d&&(c+="domain="+d+";");ca&&(c+=ca+";");d=M.cookie;M.cookie=c;if(!(d=d!=M.cookie))a:{a=
|
||||
Ca(a);for(d=0;d<a.length;d++)if(b==a[d]){d=!0;break a}d=!1}return d},Cc=function(a){return encodeURIComponent?encodeURIComponent(a).replace(/\(/g,"%28").replace(/\)/g,"%29"):a},vc=/^(www\.)?google(\.com?)?(\.[a-z]{2})?$/,eb=/(^|\.)doubleclick\.net$/i;var Oe=function(a){var b=[],c=M.cookie.split(";");a=new RegExp("^\\s*"+(a||"_gac")+"_(UA-\\d+-\\d+)=\\s*(.+?)\\s*$");for(var d=0;d<c.length;d++){var e=c[d].match(a);e&&b.push({ja:e[1],value:e[2],timestamp:Number(e[2].split(".")[1])||0})}b.sort(function(g,ca){return ca.timestamp-g.timestamp});return b};
|
||||
function df(a,b,c){b=Oe(b);var d={};if(!b||!b.length)return d;for(var e=0;e<b.length;e++){var g=b[e].value.split(".");if("1"!==g[0]||c&&3>g.length||!c&&3!==g.length)a&&(a.na=!0);else if(Number(g[1])){d[b[e].ja]?a&&(a.pa=!0):d[b[e].ja]=[];var ca={version:g[0],timestamp:1E3*Number(g[1]),qa:g[2]};c&&3<g.length&&(ca.labels=g.slice(3));d[b[e].ja].push(ca)}}return d};var Fa,Ga,fb,Ab,ja=/^https?:\/\/[^/]*cdn\.ampproject\.org\//,Ue=/^(?:www\.|m\.|amp\.)+/,Ub=[],da=function(a){if(ye(a[Kd])){if(void 0===Ab){var b;if(b=(b=De.get())&&b._ga||void 0)Ab=b,J(81)}if(void 0!==Ab)return a[Q]||(a[Q]=Ab),!1}if(a[Kd]){J(67);if(a[ac]&&"cookie"!=a[ac])return!1;if(void 0!==Ab)a[Q]||(a[Q]=Ab);else{a:{b=String(a[W]||xa());var c=String(a[Yb]||"/"),d=Ca(String(a[U]||"_ga"));b=na(d,b,c);if(!b||jd.test(b))b=!0;else if(b=Ca("AMP_TOKEN"),0==b.length)b=!0;else{if(1==b.length&&(b=decodeURIComponent(b[0]),
|
||||
"$RETRIEVING"==b||"$OPT_OUT"==b||"$ERROR"==b||"$NOT_FOUND"==b)){b=!0;break a}b=!1}}if(b&&tc(ic,String(a[Na])))return!0}}return!1},ic=function(){Z.D([ua])},tc=function(a,b){var c=Ca("AMP_TOKEN");if(1<c.length)return J(55),!1;c=decodeURIComponent(c[0]||"");if("$OPT_OUT"==c||"$ERROR"==c||G(b))return J(62),!1;if(!ja.test(M.referrer)&&"$NOT_FOUND"==c)return J(68),!1;if(void 0!==Ab)return J(56),va(function(){a(Ab)},0),!0;if(Fa)return Ub.push(a),!0;if("$RETRIEVING"==c)return J(57),va(function(){tc(a,b)},
|
||||
1E4),!0;Fa=!0;c&&"$"!=c[0]||(xc("$RETRIEVING",3E4),setTimeout(Mc,3E4),c="");return Pc(c,b)?(Ub.push(a),!0):!1},Pc=function(a,b,c){if(!window.JSON)return J(58),!1;var d=O.XMLHttpRequest;if(!d)return J(59),!1;var e=new d;if(!("withCredentials"in e))return J(60),!1;e.open("POST",(c||"https://ampcid.google.com/v1/publisher:getClientId")+"?key=AIzaSyA65lEHUEizIsNtlbNo-l2K18dT680nsaM",!0);e.withCredentials=!0;e.setRequestHeader("Content-Type","text/plain");e.onload=function(){Fa=!1;if(4==e.readyState){try{200!=
|
||||
e.status&&(J(61),Qc("","$ERROR",3E4));var g=JSON.parse(e.responseText);g.optOut?(J(63),Qc("","$OPT_OUT",31536E6)):g.clientId?Qc(g.clientId,g.securityToken,31536E6):!c&&g.alternateUrl?(Ga&&clearTimeout(Ga),Fa=!0,Pc(a,b,g.alternateUrl)):(J(64),Qc("","$NOT_FOUND",36E5))}catch(ca){J(65),Qc("","$ERROR",3E4)}e=null}};d={originScope:"AMP_ECID_GOOGLE"};a&&(d.securityToken=a);e.send(JSON.stringify(d));Ga=va(function(){J(66);Qc("","$ERROR",3E4)},1E4);return!0},Mc=function(){Fa=!1},xc=function(a,b){if(void 0===
|
||||
fb){fb="";for(var c=id(),d=0;d<c.length;d++){var e=c[d];if(zc("AMP_TOKEN",encodeURIComponent(a),"/",e,"",b)){fb=e;return}}}zc("AMP_TOKEN",encodeURIComponent(a),"/",fb,"",b)},Qc=function(a,b,c){Ga&&clearTimeout(Ga);b&&xc(b,c);Ab=a;b=Ub;Ub=[];for(c=0;c<b.length;c++)b[c](a)},ye=function(a){a:{if(ja.test(M.referrer)){var b=M.location.hostname.replace(Ue,"");b:{var c=M.referrer;c=c.replace(/^https?:\/\//,"");var d=c.replace(/^[^/]+/,"").split("/"),e=d[2];d=(d="s"==e?d[3]:e)?decodeURIComponent(d):d;if(!d){if(0==
|
||||
c.indexOf("xn--")){c="";break b}(c=c.match(/(.*)\.cdn\.ampproject\.org\/?$/))&&2==c.length&&(d=c[1].replace(/-/g,".").replace(/\.\./g,"-"))}c=d?d.replace(Ue,""):""}(d=b===c)||(c="."+c,d=b.substring(b.length-c.length,b.length)===c);if(d){b=!0;break a}else J(78)}b=!1}return b&&!1!==a};var bd=function(a){return(a?"https:":Ba||"https:"==M.location.protocol?"https:":"http:")+"//www.google-analytics.com"},Ge=function(a){switch(a){default:case 1:return"https://www.google-analytics.com/gtm/js?id=";case 2:return"https://www.googletagmanager.com/gtag/js?id="}},Da=function(a){this.name="len";this.message=a+"-8192"},ba=function(a,b,c){c=c||ua;if(2036>=b.length)wc(a,b,c);else if(8192>=b.length)x(a,b,c)||wd(a,b,c)||wc(a,b,c);else throw ge("len",b.length),new Da(b.length);},pe=function(a,b,
|
||||
c,d){d=d||ua;wd(a+"?"+b,"",d,c)},wc=function(a,b,c){var d=ta(a+"?"+b);d.onload=d.onerror=function(){d.onload=null;d.onerror=null;c()}},wd=function(a,b,c,d){var e=O.XMLHttpRequest;if(!e)return!1;var g=new e;if(!("withCredentials"in g))return!1;a=a.replace(/^http:/,"https:");g.open("POST",a,!0);g.withCredentials=!0;g.setRequestHeader("Content-Type","text/plain");g.onreadystatechange=function(){if(4==g.readyState){if(d&&"text/plain"===g.getResponseHeader("Content-Type"))try{Ea(d,g.responseText,c)}catch(ca){ge("xhr",
|
||||
"rsp"),c()}else c();g=null}};g.send(b);return!0},Ea=function(a,b,c){if(1>b.length)ge("xhr","ver","0"),c();else if(3<a.count++)ge("xhr","tmr",""+a.count),c();else{var d=b.charAt(0);if("1"===d)oc(a,b.substring(1),c);else if(a.V&&"2"===d){var e=b.substring(1).split(","),g=0;b=function(){++g===e.length&&c()};for(d=0;d<e.length;d++)oc(a,e[d],b)}else ge("xhr","ver",String(b.length)),c()}},oc=function(a,b,c){if(0===b.length)c();else{var d=b.charAt(0);switch(d){case "d":pe("https://stats.g.doubleclick.net/j/collect",
|
||||
a.U,a,c);break;case "g":wc("https://www.google.com/ads/ga-audiences",a.google,c);(b=b.substring(1))&&(/^[a-z.]{1,6}$/.test(b)?wc("https://www.google.%/ads/ga-audiences".replace("%",b),a.google,ua):ge("tld","bcc",b));break;case "G":if(a.V){a.V("G-"+b.substring(1));c();break}case "x":if(a.V){a.V();c();break}case "c":if(a.V){a.V(b.substring(1));c();break}default:ge("xhr","brc",d),c()}}},x=function(a,b,c){return O.navigator.sendBeacon?O.navigator.sendBeacon(a,b)?(c(),!0):!1:!1},ge=function(a,b,c){1<=
|
||||
100*Math.random()||G("?")||(a=["t=error","_e="+a,"_v=j101","sr=1"],b&&a.push("_f="+b),c&&a.push("_m="+K(c.substring(0,100))),a.push("aip=1"),a.push("z="+hd()),wc(bd(!0)+"/u/d",a.join("&"),ua))};var qc=function(){return O.gaData=O.gaData||{}},h=function(a){var b=qc();return b[a]=b[a]||{}};var Ha=function(){this.M=[]};Ha.prototype.add=function(a){this.M.push(a)};Ha.prototype.D=function(a){try{for(var b=0;b<this.M.length;b++){var c=a.get(this.M[b]);c&&ea(c)&&c.call(O,a)}}catch(d){}b=a.get(Ia);b!=ua&&ea(b)&&(a.set(Ia,ua,!0),setTimeout(b,10))};function Ja(a){if(100!=a.get(Ka)&&La(P(a,Q))%1E4>=100*R(a,Ka))throw"abort";}function Ma(a){if(G(P(a,Na)))throw"abort";}function Oa(){var a=M.location.protocol;if("http:"!=a&&"https:"!=a)throw"abort";}
|
||||
function pf(a){var b=!1,c=!1;if(vd.get(89)){c=!0;var d=a.get(kb),e=M.location;if(e){var g=e.pathname||"";"/"!=g.charAt(0)&&(g="/"+g);e=e.protocol+"//"+e.hostname+g+e.search;d&&0===d.indexOf(e)||(b=!0)}}!c&&vd.get(90)&&(c=!0,d=a.get(lb),e=of(!!a.get(ec),!!a.get(Kd)),d!==e&&(b=!0));!c&&vd.get(91)&&(c=!0,a.get(qf)!==M.title&&(b=!0));return c&&!b}
|
||||
function Pa(a){try{O.navigator.sendBeacon?J(42):O.XMLHttpRequest&&"withCredentials"in new O.XMLHttpRequest&&J(40)}catch(c){}a.set(ld,Td(a),!0);a.set(Ac,R(a,Ac)+1);var b=[];ue.map(function(c,d){d.F&&(c=a.get(c),void 0!=c&&c!=d.defaultValue&&("boolean"==typeof c&&(c*=1),b.push(d.F+"="+K(""+c))))});!1===a.get(xe)&&b.push("npa=1");b.push("z="+Bd());pf(a)&&J(109);a.set(Ra,b.join("&"),!0)}
|
||||
function Sa(a){var b=P(a,fa);!b&&a.get(Vd)&&(b="beacon");var c=P(a,gd),d=P(a,oe),e=c||(d||bd(!1)+"")+"/collect",g=a.Z(Ia),ca=P(a,Ra),l=P(a,Na);switch(P(a,ad)){case "d":e=c||(d||bd(!1)+"")+"/j/collect";b=a.get(qe)||void 0;pe(e,ca,b,g);break;default:b?(g=g||ua,"image"==b?wc(e,ca,g):"xhr"==b&&wd(e,ca,g)||"beacon"==b&&x(e,ca,g)||ba(e,ca,g)):ba(e,ca,g)}ca=h(l);g=ca.hitcount;ca.hitcount=g?g+1:1;ca.first_hit||(ca.first_hit=(new Date).getTime());delete h(l).pending_experiments;a.set(Ia,ua,!0);if(rf(a))if(ca=
|
||||
P(a,Na),l=sf[ca])for(ca=0;ca<l.length;++ca)(g=tf(l[ca]).q)&&30>g.length&&g.push&&g.push(uf(a));else vf[ca]=vf[ca]||[],30>vf[ca].length&&vf[ca].push(uf(a))}function Hc(a){qc().expId&&a.set(Nc,qc().expId);qc().expVar&&a.set(Oc,qc().expVar);var b=P(a,Na);if(b=h(b).pending_experiments){var c=[];for(d in b)b.hasOwnProperty(d)&&b[d]&&c.push(encodeURIComponent(d)+"."+encodeURIComponent(b[d]));var d=c.join("!")}else d=void 0;d&&((b=a.get(m))&&(d=b+"!"+d),a.set(m,d,!0))}
|
||||
function cd(){if(O.navigator&&"preview"==O.navigator.loadPurpose)throw"abort";}function yd(a){var b=O.gaDevIds||[];if(ka(b)){var c=a.get("&did");qa(c)&&0<c.length&&(b=b.concat(c.split(",")));c=[];for(var d=0;d<b.length;d++)Ee(c,b[d])||c.push(b[d]);0!=c.length&&a.set("&did",c.join(","),!0)}}function vb(a){if(!a.get(Na))throw"abort";}
|
||||
function Pe(a){try{if(!a.get(Qe)&&(a.set(Qe,!0),!a.get(">m"))){var b=void 0,c=void 0;lf(be("gtm_debug"))&&(b=2);!b&&D(M.referrer,"https://tagassistant.google.com/")&&(b=3);!b&&Ee(M.cookie.split("; "),"__TAG_ASSISTANT=x")&&(b=4);b||(c=M.documentElement.getAttribute("data-tag-assistant-present"),lf(c)&&(b=5));if(b){O["google.tagmanager.debugui2.queue"]||(O["google.tagmanager.debugui2.queue"]=[],Id("https://www.google-analytics.com/debug/bootstrap?id="+a.get(Na)+"&src=LEGACY&cond="+b));var d=M.currentScript;
|
||||
O["google.tagmanager.debugui2.queue"].push({messageType:"LEGACY_CONTAINER_STARTING",data:{id:a.get(Na),scriptSource:d&&d.src||""}})}}}catch(e){}}function lf(a){if(null==a||0===a.length)return!1;a=Number(a);var b=Date.now();return a<b+3E5&&a>b-9E5};var hd=function(){return Math.round(2147483647*Math.random())},Bd=function(){try{var a=new Uint32Array(1);O.crypto.getRandomValues(a);return a[0]&2147483647}catch(b){return hd()}};function Ta(a){var b=R(a,Ua);500<=b&&J(15);var c=P(a,Va);if("transaction"!=c&&"item"!=c){c=R(a,Wa);var d=(new Date).getTime(),e=R(a,Xa);0==e&&a.set(Xa,d);e=Math.round(2*(d-e)/1E3);0<e&&(c=Math.min(c+e,20),a.set(Xa,d));if(0>=c)throw"abort";a.set(Wa,--c)}a.set(Ua,++b)};var Ya=function(){this.data=new ee};Ya.prototype.get=function(a){var b=$a(a),c=this.data.get(a);b&&void 0==c&&(c=ea(b.defaultValue)?b.defaultValue():b.defaultValue);return b&&b.Z?b.Z(this,a,c):c};var P=function(a,b){a=a.get(b);return void 0==a?"":""+a},R=function(a,b){a=a.get(b);return void 0==a||""===a?0:Number(a)};Ya.prototype.Z=function(a){return(a=this.get(a))&&ea(a)?a:ua};
|
||||
Ya.prototype.set=function(a,b,c){if(a)if("object"===typeof a)for(var d in a)a.hasOwnProperty(d)&&ab(this,d,a[d],c);else ab(this,a,b,c)};
|
||||
var ab=function(a,b,c,d){if(void 0!=c)switch(b){case Na:wb.test(c)}var e=$a(b);e&&e.o?e.o(a,b,c,d):a.data.set(b,c,d)},gf={hitPayload:88,location:89,referrer:90,title:91,buildHitTask:93,sendHitTask:94,displayFeaturesTask:95,customTask:97,cookieName:98,cookieDomain:99,cookiePath:100,cookieExpires:101,cookieUpdate:102,cookieFlags:103,storage:104,_x_19:105,transportUrl:106,allowAdFeatures:107,sampleRate:108};
|
||||
function hf(a,b){var c=gf[a];c&&J(c);"displayFeaturesTask"===a&&void 0==b&&J(96);/.*Task$/.test(a)&&J(92)}function mf(a,b){if(a)if("object"===typeof a)for(var c in a)a.hasOwnProperty(c)&&hf(c,b);else hf(a,b)};var ue=new ee,ve=[],bb=function(a,b,c,d,e){this.name=a;this.F=b;this.Z=d;this.o=e;this.defaultValue=c};function $a(a){var b=ue.get(a);if(!b)for(var c=0;c<ve.length;c++){var d=ve[c],e=d[0].exec(a);if(e){b=d[1](e);ue.set(b.name,b);break}}return b}function yc(a){var b;ue.map(function(c,d){d.F==a&&(b=d)});return b&&b.name}function S(a,b,c,d,e){a=new bb(a,b,c,d,e);ue.set(a.name,a);return a.name}function cb(a,b){ve.push([new RegExp("^"+a+"$"),b])}function T(a,b,c){return S(a,b,c,void 0,db)}
|
||||
function db(){};var hb=T("apiVersion","v"),ib=T("clientVersion","_v");S("anonymizeIp","aip");var jb=S("adSenseId","a"),Va=S("hitType","t"),Ia=S("hitCallback"),Ra=S("hitPayload");S("nonInteraction","ni");S("currencyCode","cu");S("dataSource","ds");var Vd=S("useBeacon",void 0,!1),fa=S("transport");S("sessionControl","sc","");S("sessionGroup","sg");S("queueTime","qt");var Ac=S("_s","_s"),Ie=S("_no_slc");S("screenName","cd");var kb=S("location","dl",""),lb=S("referrer","dr"),mb=S("page","dp","");S("hostname","dh");
|
||||
var nb=S("language","ul"),ob=S("encoding","de"),qf=S("title","dt",function(){return M.title||void 0});cb("contentGroup([0-9]+)",function(a){return new bb(a[0],"cg"+a[1])});var pb=S("screenColors","sd"),qb=S("screenResolution","sr"),rb=S("viewportSize","vp"),sb=S("javaEnabled","je"),tb=S("flashVersion","fl");S("campaignId","ci");S("campaignName","cn");S("campaignSource","cs");S("campaignMedium","cm");S("campaignKeyword","ck");S("campaignContent","cc");
|
||||
var ub=S("eventCategory","ec"),xb=S("eventAction","ea"),yb=S("eventLabel","el"),zb=S("eventValue","ev"),Bb=S("socialNetwork","sn"),Cb=S("socialAction","sa"),Db=S("socialTarget","st"),Eb=S("l1","plt"),Fb=S("l2","pdt"),Gb=S("l3","dns"),Hb=S("l4","rrt"),Ib=S("l5","srt"),Jb=S("l6","tcp"),Kb=S("l7","dit"),Lb=S("l8","clt"),Ve=S("l9","_gst"),We=S("l10","_gbt"),Xe=S("l11","_cst"),Ye=S("l12","_cbt"),Mb=S("timingCategory","utc"),Nb=S("timingVar","utv"),Ob=S("timingLabel","utl"),Pb=S("timingValue","utt");
|
||||
S("appName","an");S("appVersion","av","");S("appId","aid","");S("appInstallerId","aiid","");S("exDescription","exd");S("exFatal","exf");var Nc=S("expId","xid"),Oc=S("expVar","xvar"),m=S("exp","exp"),Rc=S("_utma","_utma"),Sc=S("_utmz","_utmz"),Tc=S("_utmht","_utmht"),Ua=S("_hc",void 0,0),Xa=S("_ti",void 0,0),Wa=S("_to",void 0,20);cb("dimension([0-9]+)",function(a){return new bb(a[0],"cd"+a[1])});cb("metric([0-9]+)",function(a){return new bb(a[0],"cm"+a[1])});S("linkerParam",void 0,void 0,Bc,db);
|
||||
var Ze=T("_cd2l",void 0,!1),ld=S("usage","_u"),Gd=S("_um");S("forceSSL",void 0,void 0,function(){return Ba},function(a,b,c){J(34);Ba=!!c});var ed=S("_j1","jid"),ia=S("_j2","gjid");cb("\\&(.*)",function(a){var b=new bb(a[0],a[1]),c=yc(a[0].substring(1));c&&(b.Z=function(d){return d.get(c)},b.o=function(d,e,g,ca){d.set(c,g,ca)},b.F=void 0);return b});
|
||||
var Qb=T("_oot"),dd=S("previewTask"),Rb=S("checkProtocolTask"),md=S("validationTask"),Sb=S("checkStorageTask"),Uc=S("historyImportTask"),Tb=S("samplerTask"),Vb=S("_rlt"),Wb=S("buildHitTask"),Xb=S("sendHitTask"),Vc=S("ceTask"),zd=S("devIdTask"),Cd=S("timingTask"),Ld=S("displayFeaturesTask"),oa=S("customTask"),ze=S("fpsCrossDomainTask"),Re=T("_cta"),V=T("name"),Q=T("clientId","cid"),n=T("clientIdTime"),xd=T("storedClientId"),Ad=S("userId","uid"),Na=T("trackingId","tid"),U=T("cookieName",void 0,"_ga"),
|
||||
W=T("cookieDomain"),Yb=T("cookiePath",void 0,"/"),Zb=T("cookieExpires",void 0,63072E3),Hd=T("cookieUpdate",void 0,!0),Be=T("cookieFlags",void 0,""),$b=T("legacyCookieDomain"),Wc=T("legacyHistoryImport",void 0,!0),ac=T("storage",void 0,"cookie"),bc=T("allowLinker",void 0,!1),cc=T("allowAnchor",void 0,!0),Ka=T("sampleRate","sf",100),dc=T("siteSpeedSampleRate",void 0,1),ec=T("alwaysSendReferrer",void 0,!1),I=T("_gid","_gid"),la=T("_gcn"),Kd=T("useAmpClientId"),ce=T("_gclid"),fe=T("_gt"),he=T("_ge",void 0,
|
||||
7776E6),ie=T("_gclsrc"),je=T("storeGac",void 0,!0),oe=S("_x_19"),Ae=S("_fplc","_fplc"),F=T("_cs"),Je=T("_useUp",void 0,!1),Le=S("up","up"),Qe=S("_tac",void 0,!1),Se=T("_gbraid"),Te=T("_gbt"),bf=T("_gbe",void 0,7776E6),gd=S("transportUrl"),Md=S("_r","_r"),Od=S("_slc","_slc"),qe=S("_dp"),ad=S("_jt",void 0,"n"),Ud=S("allowAdFeatures",void 0,!0),xe=S("allowAdPersonalizationSignals",void 0,!0);
|
||||
function X(a,b,c,d){b[a]=function(){try{return d&&J(d),c.apply(this,arguments)}catch(e){throw ge("exc",a,e&&e.name),e;}}};var Ed=function(a){if("cookie"==a.get(ac))return a=Ca("FPLC"),0<a.length?a[0]:void 0},Fe=function(a){var b;if(b=P(a,oe)&&a.get(Ze))b=De.get(a.get(cc)),b=!(b&&b._fplc);b&&!Ed(a)&&a.set(Ae,"0")};var aa=function(a){var b=Math.min(R(a,dc),100);return La(P(a,Q))%100>=b?!1:!0},gc=function(a){var b={};if(Ec(b)||Fc(b)){var c=b[Eb];void 0==c||Infinity==c||isNaN(c)||(0<c?(Y(b,Gb),Y(b,Jb),Y(b,Ib),Y(b,Fb),Y(b,Hb),Y(b,Kb),Y(b,Lb),Y(b,Ve),Y(b,We),Y(b,Xe),Y(b,Ye),va(function(){a(b)},10)):L(O,"load",function(){gc(a)},!1))}},Ec=function(a){var b=O.performance||O.webkitPerformance;b=b&&b.timing;if(!b)return!1;var c=b.navigationStart;if(0==c)return!1;a[Eb]=b.loadEventStart-c;a[Gb]=b.domainLookupEnd-b.domainLookupStart;
|
||||
a[Jb]=b.connectEnd-b.connectStart;a[Ib]=b.responseStart-b.requestStart;a[Fb]=b.responseEnd-b.responseStart;a[Hb]=b.fetchStart-c;a[Kb]=b.domInteractive-c;a[Lb]=b.domContentLoadedEventStart-c;a[Ve]=N.L-c;a[We]=N.ya-c;O.google_tag_manager&&O.google_tag_manager._li&&(b=O.google_tag_manager._li,a[Xe]=b.cst,a[Ye]=b.cbt);return!0},Fc=function(a){if(O.top!=O)return!1;var b=O.external,c=b&&b.onloadT;b&&!b.isValidLoadTime&&(c=void 0);2147483648<c&&(c=void 0);0<c&&b.setPageReadyTime();if(void 0==c)return!1;
|
||||
a[Eb]=c;return!0},Y=function(a,b){var c=a[b];if(isNaN(c)||Infinity==c||0>c)a[b]=void 0},Fd=function(a){return function(b){if("pageview"==b.get(Va)&&!a.I){a.I=!0;var c=aa(b),d=0<E(P(b,kb),"gclid").length,e=0<E(P(b,kb),"wbraid").length;(c||d||e)&&gc(function(g){c&&a.send("timing",g);(d||e)&&a.send("adtiming",g)})}}};var hc=!1,mc=function(a){if("cookie"==P(a,ac)){if(a.get(Hd)||P(a,xd)!=P(a,Q)){var b=1E3*R(a,Zb);ma(a,Q,U,b);a.data.set(xd,P(a,Q))}(a.get(Hd)||uc(a)!=P(a,I))&&ma(a,I,la,864E5);if(a.get(je)){if(b=P(a,ce)){var c=Math.min(R(a,he),1E3*R(a,Zb));c=0===c?0:Math.min(c,1E3*R(a,fe)+c-(new Date).getTime());a.data.set(he,c);var d={},e=P(a,fe),g=P(a,ie),ca=kc(P(a,Yb)),l=lc(P(a,W)),k=P(a,Na),w=P(a,Be);g&&"aw.ds"!=g?d&&(d.ua=!0):(b=["1",e,Cc(b)].join("."),0<=c&&(d&&(d.ta=!0),zc("_gac_"+Cc(k),b,ca,l,k,c,w)));le(d)}}else J(75);
|
||||
a.get(je)&&(b=P(a,Se))&&(c=Math.min(R(a,bf),1E3*R(a,Zb)),c=0===c?0:Math.min(c,1E3*R(a,Te)+c-(new Date).getTime()),a.data.set(bf,c),d={},w=P(a,Te),ca=kc(P(a,Yb)),l=lc(P(a,W)),k=P(a,Na),a=P(a,Be),b=["1",w,Cc(b)].join("."),0<=c&&(d&&(d.ta=!0),zc("_gac_gb_"+Cc(k),b,ca,l,k,c,a)),ef(d))}},ma=function(a,b,c,d){var e=nd(a,b);if(e){c=P(a,c);var g=kc(P(a,Yb)),ca=lc(P(a,W)),l=P(a,Be),k=P(a,Na);if("auto"!=ca)zc(c,e,g,ca,k,d,l)&&(hc=!0);else{J(32);for(var w=id(),Ce=0;Ce<w.length;Ce++)if(ca=w[Ce],a.data.set(W,
|
||||
ca),e=nd(a,b),zc(c,e,g,ca,k,d,l)){hc=!0;return}a.data.set(W,"auto")}}},uc=function(a){var b=Ca(P(a,la));return Xd(a,b)},nc=function(a){if("cookie"==P(a,ac)&&!hc&&(mc(a),!hc))throw"abort";},Yc=function(a){if(a.get(Wc)){var b=P(a,W),c=P(a,$b)||xa(),d=Xc("__utma",c,b);d&&(J(19),a.set(Tc,(new Date).getTime(),!0),a.set(Rc,d.R),(b=Xc("__utmz",c,b))&&d.hash==b.hash&&a.set(Sc,b.R))}},nd=function(a,b){b=Cc(P(a,b));var c=lc(P(a,W)).split(".").length;a=jc(P(a,Yb));1<a&&(c+="-"+a);return b?["GA1",c,b].join("."):
|
||||
""},Xd=function(a,b){return na(b,P(a,W),P(a,Yb))},na=function(a,b,c){if(!a||1>a.length)J(12);else{for(var d=[],e=0;e<a.length;e++){var g=a[e];var ca=g.split(".");var l=ca.shift();("GA1"==l||"1"==l)&&1<ca.length?(g=ca.shift().split("-"),1==g.length&&(g[1]="1"),g[0]*=1,g[1]*=1,ca={H:g,s:ca.join(".")}):ca=kd.test(g)?{H:[0,0],s:g}:void 0;ca&&d.push(ca)}if(1==d.length)return J(13),d[0].s;if(0==d.length)J(12);else{J(14);d=Gc(d,lc(b).split(".").length,0);if(1==d.length)return d[0].s;d=Gc(d,jc(c),1);1<d.length&&
|
||||
J(41);return d[0]&&d[0].s}}},Gc=function(a,b,c){for(var d=[],e=[],g,ca=0;ca<a.length;ca++){var l=a[ca];l.H[c]==b?d.push(l):void 0==g||l.H[c]<g?(e=[l],g=l.H[c]):l.H[c]==g&&e.push(l)}return 0<d.length?d:e},lc=function(a){return 0==a.indexOf(".")?a.substr(1):a},id=function(){var a=[],b=xa().split(".");if(4==b.length){var c=b[b.length-1];if(parseInt(c,10)==c)return["none"]}for(c=b.length-2;0<=c;c--)a.push(b.slice(c).join("."));b=M.location.hostname;eb.test(b)||vc.test(b)||a.push("none");return a},kc=
|
||||
function(a){if(!a)return"/";1<a.length&&a.lastIndexOf("/")==a.length-1&&(a=a.substr(0,a.length-1));0!=a.indexOf("/")&&(a="/"+a);return a},jc=function(a){a=kc(a);return"/"==a?1:a.split("/").length},le=function(a){a.ta&&J(77);a.na&&J(74);a.pa&&J(73);a.ua&&J(69)},ef=function(a){a.ta&&J(85);a.na&&J(86);a.pa&&J(87)};function Xc(a,b,c){"none"==b&&(b="");var d=[],e=Ca(a);a="__utma"==a?6:2;for(var g=0;g<e.length;g++){var ca=(""+e[g]).split(".");ca.length>=a&&d.push({hash:ca[0],R:e[g],O:ca})}if(0!=d.length)return 1==d.length?d[0]:Zc(b,d)||Zc(c,d)||Zc(null,d)||d[0]}function Zc(a,b){if(null==a)var c=a=1;else c=La(a),a=La(D(a,".")?a.substring(1):"."+a);for(var d=0;d<b.length;d++)if(b[d].hash==c||b[d].hash==a)return b[d]};var Jc=new RegExp(/^https?:\/\/([^\/:]+)/),De=O.google_tag_data.glBridge,Kc=RegExp("(.*)([?&#])(?:_ga=[^&#]*)(?:&?)(.*)"),od=RegExp("(.*)([?&#])(?:_gac=[^&#]*)(?:&?)(.*)");function Bc(a){if(a.get(Ze))return J(35),De.generate($e(a));var b=P(a,Q),c=P(a,I)||"";b="_ga=2."+K(pa(c+b,0)+"."+c+"-"+b);(a=af(a))?(J(44),a="&_gac=1."+K([pa(a.qa,0),a.timestamp,a.qa].join("."))):a="";return b+a}
|
||||
function Ic(a,b){var c=new Date,d=O.navigator,e=d.plugins||[];a=[a,d.userAgent,c.getTimezoneOffset(),c.getYear(),c.getDate(),c.getHours(),c.getMinutes()+b];for(b=0;b<e.length;++b)a.push(e[b].description);return La(a.join("."))}function pa(a,b){var c=new Date,d=O.navigator,e=c.getHours()+Math.floor((c.getMinutes()+b)/60);return La([a,d.userAgent,d.language||"",c.getTimezoneOffset(),c.getYear(),c.getDate()+Math.floor(e/24),(24+e)%24,(60+c.getMinutes()+b)%60].join("."))}
|
||||
var Dc=function(a){J(48);this.target=a;this.T=!1};Dc.prototype.ca=function(a,b){if(a){if(this.target.get(Ze))return De.decorate($e(this.target),a,b);if(a.tagName){if("a"==a.tagName.toLowerCase()){a.href&&(a.href=qd(this,a.href,b));return}if("form"==a.tagName.toLowerCase())return rd(this,a)}if("string"==typeof a)return qd(this,a,b)}};
|
||||
var qd=function(a,b,c){var d=Kc.exec(b);d&&3<=d.length&&(b=d[1]+(d[3]?d[2]+d[3]:""));(d=od.exec(b))&&3<=d.length&&(b=d[1]+(d[3]?d[2]+d[3]:""));a=a.target.get("linkerParam");d=b.indexOf("?");var e=b.indexOf("#");b=c?b+((-1==e?"#":"&")+a):-1==e?b+((-1===d?"?":"&")+a):b.substring(0,e)+(-1===d||d>e?"?":"&")+a+b.substring(e);b=b.replace(/&+_ga=/,"&_ga=");return b=b.replace(RegExp("&+_gac="),"&_gac=")},rd=function(a,b){if(b&&b.action)if("get"==b.method.toLowerCase()){a=a.target.get("linkerParam").split("&");
|
||||
for(var c=0;c<a.length;c++){var d=a[c].split("="),e=d[1];d=d[0];for(var g=b.childNodes||[],ca=!1,l=0;l<g.length;l++)if(g[l].name==d){g[l].setAttribute("value",e);ca=!0;break}ca||(g=M.createElement("input"),g.setAttribute("type","hidden"),g.setAttribute("name",d),g.setAttribute("value",e),b.appendChild(g))}}else"post"==b.method.toLowerCase()&&(b.action=qd(a,b.action))};
|
||||
Dc.prototype.S=function(a,b,c){function d(g){try{g=g||O.event;a:{var ca=g.target||g.srcElement;for(g=100;ca&&0<g;){if(ca.href&&ca.nodeName.match(/^a(?:rea)?$/i)){var l=ca;break a}ca=ca.parentNode;g--}l={}}("http:"==l.protocol||"https:"==l.protocol)&&sd(a,l.hostname||"")&&l.href&&(l.href=qd(e,l.href,b))}catch(k){J(26)}}var e=this;this.target.get(Ze)?De.auto(function(){return $e(e.target)},a,b?"fragment":"",c):(this.T||(this.T=!0,L(M,"mousedown",d,!1),L(M,"keyup",d,!1)),c&&L(M,"submit",function(g){g=
|
||||
g||O.event;if((g=g.target||g.srcElement)&&g.action){var ca=g.action.match(Jc);ca&&sd(a,ca[1])&&rd(e,g)}}))};Dc.prototype.$=function(a){if(a){var b=this,c=b.target.get(F);void 0!==c&&De.passthrough(function(){if(c("analytics_storage"))return{};var d={};return d._ga=b.target.get(Q),d._up="1",d},1,!0)}};function sd(a,b){if(b==M.location.hostname)return!1;for(var c=0;c<a.length;c++)if(a[c]instanceof RegExp){if(a[c].test(b))return!0}else if(0<=b.indexOf(a[c]))return!0;return!1}
|
||||
function ke(a,b){return b!=Ic(a,0)&&b!=Ic(a,-1)&&b!=Ic(a,-2)&&b!=pa(a,0)&&b!=pa(a,-1)&&b!=pa(a,-2)}function $e(a){var b=af(a),c={};c._ga=a.get(Q);c._gid=a.get(I)||void 0;c._gac=b?[b.qa,b.timestamp].join("."):void 0;b=a.get(Ae);a=Ed(a);return c._fplc=b&&"0"!==b?b:a,c}function af(a){function b(e){return void 0==e||""===e?0:Number(e)}var c=a.get(ce);if(c&&a.get(je)){var d=b(a.get(fe));if(1E3*d+b(a.get(he))<=(new Date).getTime())J(76);else return{timestamp:d,qa:c}}};var p=/^(GTM|OPT)-[A-Z0-9]+$/,q=/;_gaexp=[^;]*/g,r=/;((__utma=)|([^;=]+=GAX?\d+\.))[^;]*/g,Aa=/^https?:\/\/[\w\-.]+\.google.com(:\d+)?\/optimize\/opt-launch\.html\?.*$/,nf=0,wf={},t=function(a){function b(d,e){e&&(c+="&"+d+"="+K(e))}var c=Ge(a.type)+K(a.id);"dataLayer"!=a.B&&b("l",a.B);b("cx",a.context);b("t",a.target);b("cid",a.clientId);b("cidt",a.ka);b("gac",a.la);b("aip",a.ia);a.sa&&b("_slc","1");a.sync&&b("m","sync");b("cycle",a.G);a.qa&&b("gclid",a.qa);Aa.test(M.referrer)&&b("cb",String(hd()));
|
||||
return c},He=function(a,b){var c=(new Date).getTime();O[a.B]=O[a.B]||[];wf[a.B]||(wf[a.B]=!0,c={"gtm.start":c},a.sync||(c.event="gtm.js"),O[a.B].push(c));2===a.type&&function(d,e,g){O[a.B].push(arguments)}("config",a.id,b)},Ke=function(a,b,c,d){c=c||{};var e=O.google_tag_data.tcBridge;if(p.test(b))var g=1;else{var ca=b.split("-");1<ca.length&&"GTM"!==ca[0]&&"UA"!==ca[0]&&(g=2)}if(g){ca={id:b,type:g,B:c.dataLayer||"dataLayer",G:!1};var l=void 0;a.get(">m")==b&&(ca.G=!0);switch(g){case 1:ca.ia=!!a.get("anonymizeIp");
|
||||
ca.sync=d;b=String(a.get("name"));"t0"!=b&&(ca.target=b);G(String(a.get("trackingId")))||(ca.clientId=String(a.get(Q)),ca.ka=Number(a.get(n)),b=c.palindrome?r:q,b=(b=M.cookie.replace(/^|(; +)/g,";").match(b))?b.sort().join("").substring(1):void 0,ca.la=b,ca.qa=E(P(a,kb),"gclid"));break;case 2:if(20<=nf)return;nf++;ca.context="c";l={};l=(l.is_legacy_loaded=!0,l);ca.sa=!0;e.registerUa(a.get("name"),a.get("trackingId"));e.setSideload(a.get("name"),b,a.get("trackingId"))}He(ca,l);return t(ca)}};var Jd=function(a,b){b||(b=(b=P(a,V))&&"t0"!=b?Wd.test(b)?"_gat_"+Cc(P(a,Na)):"_gat_"+Cc(b):"_gat");this.Y=b},Rd=function(a,b){var c=b.get(Wb);b.set(Wb,function(e){Pd(a,e,ed);Pd(a,e,ia);var g=c(e);Qd(a,e);return g});var d=b.get(Xb);b.set(Xb,function(e){var g=d(e);if(se(e)){J(80);var ca={U:re(e,1),google:re(e,2),count:0};pe("https://stats.g.doubleclick.net/j/collect",ca.U,ca);e.set(ed,"",!0)}return g})},Pd=function(a,b,c){!1===b.get(Ud)||b.get(c)||("1"==Ca(a.Y)[0]?b.set(c,"",!0):b.set(c,""+hd(),!0))},
|
||||
Qd=function(a,b){se(b)&&zc(a.Y,"1",P(b,Yb),P(b,W),P(b,Na),6E4,P(b,Be))},se=function(a){return!!a.get(ed)&&!1!==a.get(Ud)},Ne=function(a){return!H[P(a,Na)]&&rf(a)},re=function(a,b){var c=new ee,d=function(g){$a(g).F&&c.set($a(g).F,a.get(g))};d(hb);d(ib);d(Na);d(Q);d(ed);1==b&&(d(Ad),d(ia),d(I));!1===a.get(xe)&&c.set("npa","1");c.set($a(ld).F,Td(a));var e="";c.map(function(g,ca){e+=K(g)+"=";e+=K(""+ca)+"&"});e+="z="+hd();1==b?e="t=dc&aip=1&_r=3&"+e:2==b&&(e="t=sr&aip=1&_r=4&slf_rd=1&"+e);return e},
|
||||
Me=function(a){if(Ne(a)){var b=P(a,Na);H[b]=!0;return function(c){if(c&&!H[c]){var d=Ke(a,c);if(d){var e=0<d.indexOf("&_slc=1");H[c]=!0;sf[b]||(sf[b]=[]);e&&(sf[b].push(c),tf(c,vf[b]));Id(d)}}}}},Wd=/^gtm\d+$/;var fd=function(a,b){a=a.model;if(!a.get("dcLoaded")){var c=new $c(Dd(a));c.set(29);a.set(Gd,c.C);b=b||{};var d;b[U]&&(d=Cc(b[U]));b=new Jd(a,d);Rd(b,a);a.set("dcLoaded",!0)}};var Sd=function(a){var b="cookie"!=a.get(ac)?!1:!0;if(b){b=new Jd(a);var c=a.get("dcLoaded");c||(Pd(b,a,ed),Pd(b,a,ia),Qd(b,a));b=!c&&se(a);c=Ne(a);b&&a.set(Md,1,!0);c&&a.set(Od,1,!0);if(b||c)a.set(ad,"d",!0),J(79),a.set(qe,{U:re(a,1),google:re(a,2),V:Me(a),count:0},!0)}};var Lc=function(){var a=O.gaGlobal=O.gaGlobal||{};return a.hid=a.hid||hd()};var wb=/^(UA|YT|MO|GP)-(\d+)-(\d+)$/,pc=function(a){function b(e,g){d.model.data.set(e,g);a.hasOwnProperty(e)&&hf(e,g)}function c(e,g){d.model.data.set(e,g);d.filters.add(e)}var d=this;this.model=new Ya;this.filters=new Ha;b(V,a[V]);b(Na,sa(a[Na]));b(U,a[U]);b(W,a[W]||xa());b(Yb,a[Yb]);b(Zb,a[Zb]);b(Hd,a[Hd]);b(Be,a[Be]);b($b,a[$b]);b(Wc,a[Wc]);b(bc,a[bc]);b(cc,a[cc]);b(Ka,a[Ka]);b(dc,a[dc]);b(ec,a[ec]);b(ac,a[ac]);b(Ad,a[Ad]);b(n,a[n]);b(Kd,a[Kd]);b(je,a[je]);b(Ze,a[Ze]);b(oe,a[oe]);b(Je,a[Je]);
|
||||
b(F,a[F]);b(hb,1);b(ib,"j101");c(Re,Pe);c(Qb,Ma);c(oa,ua);c(dd,cd);c(Rb,Oa);c(md,vb);c(Sb,nc);c(Uc,Yc);c(Tb,Ja);c(Vb,Ta);c(Vc,Hc);c(zd,yd);c(Ld,Sd);c(ze,Fe);c(Wb,Pa);c(Xb,Sa);c(Cd,Fd(this));pd(this.model);td(this.model,a[Q]);this.model.set(jb,Lc())};pc.prototype.get=function(a){return this.model.get(a)};pc.prototype.set=function(a,b){this.model.set(a,b);mf(a,b)};
|
||||
pc.prototype.send=function(a){if(!(1>arguments.length)){if("string"===typeof arguments[0]){var b=arguments[0];var c=[].slice.call(arguments,1)}else b=arguments[0]&&arguments[0][Va],c=arguments;b&&(c=za(me[b]||[],c),c[Va]=b,mf(c),this.model.set(c,void 0,!0),this.filters.D(this.model),this.model.data.m={})}};pc.prototype.ma=function(a,b){var c=this;u(a,c,b)||(v(a,function(){u(a,c,b)}),y(String(c.get(V)),a,void 0,b,!0))};
|
||||
function td(a,b){var c=P(a,U);a.data.set(la,"_ga"==c?"_gid":c+"_gid");if("cookie"==P(a,ac)){hc=!1;c=Ca(P(a,U));c=Xd(a,c);if(!c){c=P(a,W);var d=P(a,$b)||xa();c=Xc("__utma",d,c);void 0!=c?(J(10),c=c.O[1]+"."+c.O[2]):c=void 0}c&&(hc=!0);if(d=c&&!a.get(Hd))if(d=c.split("."),2!=d.length)d=!1;else if(d=Number(d[1])){var e=R(a,Zb);d=d+e<(new Date).getTime()/1E3}else d=!1;d&&(c=void 0);c&&(a.data.set(xd,c),a.data.set(Q,c),(c=uc(a))&&a.data.set(I,c));a.get(je)&&(c=a.get(ce),d=a.get(ie),!c||d&&"aw.ds"!=d)&&
|
||||
(c={},d=(M?df(c):{})[P(a,Na)],le(c),d&&0!=d.length&&(c=d[0],a.data.set(fe,c.timestamp/1E3),a.data.set(ce,c.qa)));a.get(je)&&(c=a.get(Se),d={},e=(M?df(d,"_gac_gb",!0):{})[P(a,Na)],ef(d),e&&0!=e.length&&(d=e[0],e=d.qa,c&&c!==e||(d.labels&&d.labels.length&&(e+="."+d.labels.join(".")),a.data.set(Te,d.timestamp/1E3),a.data.set(Se,e))))}if(a.get(Hd)){c=be("_ga",!!a.get(cc));var g=be("_gl",!!a.get(cc));d=De.get(a.get(cc));e=d._ga;g&&0<g.indexOf("_ga*")&&!e&&J(30);if(b||!a.get(Je))g=!1;else if(g=a.get(F),
|
||||
void 0===g||g("analytics_storage"))g=!1;else{J(84);a.data.set(Le,1);if(g=d._up)if(g=Jc.exec(M.referrer)){g=g[1];var ca=M.location.hostname;g=ca===g||0<=ca.indexOf("."+g)||0<=g.indexOf("."+ca)?!0:!1}else g=!1;g=g?!0:!1}ca=d.gclid;var l=d._gac;if(c||e||ca||l)if(c&&e&&J(36),a.get(bc)||ye(a.get(Kd))||g){if(e&&(J(38),a.data.set(Q,e),d._gid&&(J(51),a.data.set(I,d._gid))),ca?(J(82),a.data.set(ce,ca),d.gclsrc&&a.data.set(ie,d.gclsrc)):l&&(e=l.split("."))&&2===e.length&&(J(37),a.data.set(ce,e[0]),a.data.set(fe,
|
||||
e[1])),(d=d._fplc)&&P(a,oe)&&(J(83),a.data.set(Ae,d)),c)b:if(d=c.indexOf("."),-1==d)J(22);else{e=c.substring(0,d);g=c.substring(d+1);d=g.indexOf(".");c=g.substring(0,d);g=g.substring(d+1);if("1"==e){if(d=g,ke(d,c)){J(23);break b}}else if("2"==e){d=g.indexOf("-");e="";0<d?(e=g.substring(0,d),d=g.substring(d+1)):d=g.substring(1);if(ke(e+d,c)){J(53);break b}e&&(J(2),a.data.set(I,e))}else{J(22);break b}J(11);a.data.set(Q,d);if(c=be("_gac",!!a.get(cc)))c=c.split("."),"1"!=c[0]||4!=c.length?J(72):ke(c[3],
|
||||
c[1])?J(71):(a.data.set(ce,c[3]),a.data.set(fe,c[2]),J(70))}}else J(21)}b&&(J(9),a.data.set(Q,K(b)));a.get(Q)||(b=(b=O.gaGlobal)&&b.from_cookie&&"cookie"!==P(a,ac)?void 0:(b=b&&b.vid)&&-1!==b.search(jd)?b:void 0,b?(J(17),a.data.set(Q,b)):(J(8),a.data.set(Q,ra())));a.get(I)||(J(3),a.data.set(I,ra()));mc(a);b=O.gaGlobal=O.gaGlobal||{};c=P(a,Q);a=c===P(a,xd);if(void 0==b.vid||a&&!b.from_cookie)b.vid=c,b.from_cookie=a}
|
||||
function pd(a){var b=O.navigator,c=O.screen,d=M.location;a.set(lb,of(!!a.get(ec),!!a.get(Kd)));if(d){var e=d.pathname||"";"/"!=e.charAt(0)&&(J(31),e="/"+e);a.set(kb,d.protocol+"//"+d.hostname+e+d.search)}c&&a.set(qb,c.width+"x"+c.height);c&&a.set(pb,c.colorDepth+"-bit");c=M.documentElement;var g=(e=M.body)&&e.clientWidth&&e.clientHeight,ca=[];c&&c.clientWidth&&c.clientHeight&&("CSS1Compat"===M.compatMode||!g)?ca=[c.clientWidth,c.clientHeight]:g&&(ca=[e.clientWidth,e.clientHeight]);c=0>=ca[0]||0>=
|
||||
ca[1]?"":ca.join("x");a.set(rb,c);c=a.set;var l;if((e=(e=O.navigator)?e.plugins:null)&&e.length)for(g=0;g<e.length&&!l;g++)ca=e[g],-1<ca.name.indexOf("Shockwave Flash")&&(l=ca.description);if(!l)try{var k=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");l=k.GetVariable("$version")}catch(w){}if(!l)try{k=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),l="WIN 6,0,21,0",k.AllowScriptAccess="always",l=k.GetVariable("$version")}catch(w){}if(!l)try{k=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),
|
||||
l=k.GetVariable("$version")}catch(w){}l&&(k=l.match(/[\d]+/g))&&3<=k.length&&(l=k[0]+"."+k[1]+" r"+k[2]);c.call(a,tb,l||void 0);a.set(ob,M.characterSet||M.charset);a.set(sb,b&&"function"===typeof b.javaEnabled&&b.javaEnabled()||!1);a.set(nb,(b&&(b.language||b.browserLanguage)||"").toLowerCase());a.data.set(ce,be("gclid",!0));a.data.set(ie,be("gclsrc",!0));a.data.set(fe,Math.round((new Date).getTime()/1E3));a.get(ce)||(a.data.set(Se,be("wbraid",!0)),a.data.set(Te,Math.round((new Date).getTime()/1E3)));
|
||||
if(d&&a.get(cc)&&(b=M.location.hash)){b=b.split(/[?&#]+/);d=[];for(l=0;l<b.length;++l)(D(b[l],"utm_id")||D(b[l],"utm_campaign")||D(b[l],"utm_source")||D(b[l],"utm_medium")||D(b[l],"utm_term")||D(b[l],"utm_content")||D(b[l],"gclid")||D(b[l],"dclid")||D(b[l],"gclsrc")||D(b[l],"wbraid"))&&d.push(b[l]);0<d.length&&(b="#"+d.join("&"),a.set(kb,a.get(kb)+b))}}var me={pageview:[mb],event:[ub,xb,yb,zb],social:[Bb,Cb,Db],timing:[Mb,Nb,Pb,Ob]};var rc=function(a){if("prerender"==M.visibilityState)return!1;a();return!0},z=function(a){if(!rc(a)){J(16);var b=!1,c=function(){if(!b&&rc(a)){b=!0;var d=M;d.removeEventListener?d.removeEventListener("visibilitychange",c,!1):d.detachEvent&&d.detachEvent("onvisibilitychange",c)}};L(M,"visibilitychange",c)}};var te=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/,sc=function(a){if(ea(a[0]))this.u=a[0];else{var b=te.exec(a[0]);null!=b&&4==b.length&&(this.da=b[1]||"t0",this.K=b[2]||"",this.methodName=b[3],this.aa=[].slice.call(a,1),this.K||(this.A="create"==this.methodName,this.i="require"==this.methodName,this.g="provide"==this.methodName,this.ba="remove"==this.methodName),this.i&&(3<=this.aa.length?(this.X=this.aa[1],this.W=this.aa[2]):this.aa[1]&&(qa(this.aa[1])?this.X=this.aa[1]:this.W=this.aa[1])));b=a[1];a=a[2];
|
||||
if(!this.methodName)throw"abort";if(this.i&&(!qa(b)||""==b))throw"abort";if(this.g&&(!qa(b)||""==b||!ea(a)))throw"abort";if(ud(this.da)||ud(this.K))throw"abort";if(this.g&&"t0"!=this.da)throw"abort";}};function ud(a){return 0<=a.indexOf(".")||0<=a.indexOf(":")};var Yd,Zd,$d,A;Yd=new ee;$d=new ee;A=new ee;Zd={ec:45,ecommerce:46,linkid:47};
|
||||
var u=function(a,b,c){b==N||b.get(V);var d=Yd.get(a);if(!ea(d))return!1;b.plugins_=b.plugins_||new ee;if(b.plugins_.get(a))return!0;b.plugins_.set(a,new d(b,c||{}));return!0},y=function(a,b,c,d,e){if(!ea(Yd.get(b))&&!$d.get(b)){Zd.hasOwnProperty(b)&&J(Zd[b]);var g=void 0;if(p.test(b)){J(52);a=N.j(a);if(!a)return!0;c=Ke(a.model,b,d,e);g=function(){Z.D(["provide",b,function(){}]);var l=O[d&&d.dataLayer||"dataLayer"];l&&l.hide&&ea(l.hide.end)&&l.hide[b]&&(l.hide.end(),l.hide.end=void 0)}}!c&&Zd.hasOwnProperty(b)?
|
||||
(J(39),c=b+".js"):J(43);if(c){var ca;d&&(ca=d[oe]);qa(ca)||(ca=void 0);a=ae(cf(c,ca));!ca||ne(a.protocol)&&B(a)||(a=ae(cf(c)));ne(a.protocol)&&B(a)&&(Id(a.url,void 0,e,void 0,g),$d.set(b,!0))}}},v=function(a,b){var c=A.get(a)||[];c.push(b);A.set(a,c)},C=function(a,b){Yd.set(a,b);b=A.get(a)||[];for(var c=0;c<b.length;c++)b[c]();A.set(a,[])},B=function(a){var b=ae(M.location.href);if(D(a.url,Ge(1))||D(a.url,Ge(2)))return!0;if(a.query||0<=a.url.indexOf("?")||0<=a.path.indexOf("://"))return!1;if(a.host==
|
||||
b.host&&a.port==b.port||jf&&(b=M.createElement("a"),b.href=jf,b=kf(b),a.host===b[0]&&a.port===b[1]))return!0;b="http:"==a.protocol?80:443;return"www.google-analytics.com"==a.host&&(a.port||b)==b&&D(a.path,"/plugins/")?!0:!1},ne=function(a){var b=M.location.protocol;return"https:"==a||a==b?!0:"http:"!=a?!1:"http:"==b},kf=function(a){var b=a.hostname||"",c=0<=b.indexOf("]");b=b.split(c?"]":":")[0].toLowerCase();c&&(b+="]");c=(a.protocol||"").toLowerCase();c=1*a.port||("http:"==c?80:"https:"==c?443:
|
||||
"");a=a.pathname||"";D(a,"/")||(a="/"+a);return[b,""+c,a]},ae=function(a){var b=M.createElement("a");b.href=M.location.href;var c=(b.protocol||"").toLowerCase(),d=kf(b),e=b.search||"",g=c+"//"+d[0]+(d[1]?":"+d[1]:"");D(a,"//")?a=c+a:D(a,"/")?a=g+a:!a||D(a,"?")?a=g+d[2]+(a||e):0>a.split("/")[0].indexOf(":")&&(a=g+d[2].substring(0,d[2].lastIndexOf("/"))+"/"+a);b.href=a;c=kf(b);return{protocol:(b.protocol||"").toLowerCase(),host:c[0],port:c[1],path:c[2],query:b.search||"",url:a||""}},cf=function(a,b){return a&&
|
||||
0<=a.indexOf("/")?a:(b||bd(!1))+"/plugins/ua/"+a};var Z={ga:function(){Z.fa=[]}};Z.ga();Z.D=function(a){var b=Z.J.apply(Z,arguments);b=Z.fa.concat(b);for(Z.fa=[];0<b.length&&!Z.v(b[0])&&!(b.shift(),0<Z.fa.length););Z.fa=Z.fa.concat(b)};Z.ra=function(a){N.q&&(300===N.q.length&&(N.q.shift(),N.qd++),N.q.push(a))};Z.J=function(a){for(var b=[],c=0;c<arguments.length;c++){var d=void 0;try{d=new sc(arguments[c]),d.g?C(d.aa[0],d.aa[1]):(d.i&&(d.ha=y(d.da,d.aa[0],d.X,d.W)),b.push(d)),Z.ra(arguments[c])}catch(e){}}return b};
|
||||
Z.v=function(a){try{if(a.u)a.u.call(O,N.j("t0"));else{var b=a.da==gb?N:N.j(a.da);if(a.A){if("t0"==a.da&&(b=N.create.apply(N,a.aa),null===b))return!0}else if(a.ba)N.remove(a.da);else if(b)if(a.i){if(a.ha&&(a.ha=y(a.da,a.aa[0],a.X,a.W)),!u(a.aa[0],b,a.W))return!0}else if(a.K){var c=a.methodName,d=a.aa,e=b.plugins_.get(a.K);e[c].apply(e,d)}else b[a.methodName].apply(b,a.aa)}}catch(g){}};var H={},sf={},vf={};function tf(a,b){var c=O.google_tag_data;c||(c=O.google_tag_data={});var d=c.slq;d||(d=c.slq={});c=d[a];c||(c={},c=d[a]=(c.q=b?b.slice():[],c));return c}function uf(a){return{allowAdFeatures:a.get(Ud),allowAdPersonalizationSignals:a.get(xe),cookieDomain:P(a,W),cookieExpires:a.get(Zb),cookieFlags:P(a,Be),cookieName:P(a,U),cookiePath:P(a,Yb),cookieUpdate:a.get(Hd),hitPayload:P(a,Ra)}}
|
||||
function rf(a){return void 0===a.get(Ie)&&void 0===a.get(fa)&&void 0===a.get(gd)&&void 0===a.get(oe)};var N=function(a){J(1);Z.D.apply(Z,[arguments])};N.h={};N.P=[];N.L=0;N.ya=0;N.answer=42;var we=[Na,W,V];N.create=function(a){var b=za(we,[].slice.call(arguments));b[V]||(b[V]="t0");var c=""+b[V];if(N.h[c])return N.h[c];if(da(b))return null;b=new pc(b);N.h[c]=b;N.P.push(b);c=qc().tracker_created;if(ea(c))try{c(b)}catch(d){}return b};N.remove=function(a){for(var b=0;b<N.P.length;b++)if(N.P[b].get(V)==a){N.P.splice(b,1);N.h[a]=null;break}};N.j=function(a){return N.h[a]};N.getAll=function(){return N.P.slice(0)};
|
||||
N.N=function(){"ga"!=gb&&J(49);var a=O[gb];if(!a||42!=a.answer){N.L=a&&a.l;N.ya=1*new Date;N.loaded=!0;var b=a&&a.q,c=ka(b);a=[];c?a=b.slice(0):J(50);N.q=c?b:[];N.q.splice(0);N.qd=0;b=O[gb]=N;X("create",b,b.create);X("remove",b,b.remove);X("getByName",b,b.j,5);X("getAll",b,b.getAll,6);b=pc.prototype;X("get",b,b.get,7);X("set",b,b.set,4);X("send",b,b.send);X("requireSync",b,b.ma);b=Ya.prototype;X("get",b,b.get);X("set",b,b.set);if("https:"!=M.location.protocol&&!Ba){a:{b=M.getElementsByTagName("script");
|
||||
for(c=0;c<b.length&&100>c;c++){var d=b[c].src;if(d&&0==d.indexOf(bd(!0)+"/analytics")){b=!0;break a}}b=!1}b&&(Ba=!0)}(O.gaplugins=O.gaplugins||{}).Linker=Dc;b=Dc.prototype;C("linker",Dc);X("decorate",b,b.ca,20);X("autoLink",b,b.S,25);X("passthrough",b,b.$,25);C("displayfeatures",fd);C("adfeatures",fd);Z.D.apply(N,a)}};var xf=N.N,yf=O[gb];yf&&yf.r?xf():z(xf);z(function(){Z.D(["provide","render",ua])});})(window);
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,64 @@
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: url(https://fonts.gstatic.com/s/lato/v24/S6u8w4BMUTPHjxsAUi-qJCY.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: url(https://fonts.gstatic.com/s/lato/v24/S6u8w4BMUTPHjxsAXC-q.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
font-style: italic;
|
||||
font-weight: 900;
|
||||
src: url(https://fonts.gstatic.com/s/lato/v24/S6u_w4BMUTPHjxsI3wi_FQft1dw.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
font-style: italic;
|
||||
font-weight: 900;
|
||||
src: url(https://fonts.gstatic.com/s/lato/v24/S6u_w4BMUTPHjxsI3wi_Gwft.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjxAwXjeu.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjx4wXg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
src: url(https://fonts.gstatic.com/s/lato/v24/S6u9w4BMUTPHh50XSwaPGR_p.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
src: url(https://fonts.gstatic.com/s/lato/v24/S6u9w4BMUTPHh50XSwiPGQ.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@ -0,0 +1,431 @@
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.0.0-beta): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Dropdown = function ($) {
|
||||
|
||||
/**
|
||||
* Check for Popper dependency
|
||||
* Popper - https://popper.js.org
|
||||
*/
|
||||
if (typeof Popper === 'undefined') {
|
||||
throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)');
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'dropdown';
|
||||
var VERSION = '4.0.0-beta';
|
||||
var DATA_KEY = 'bs.dropdown';
|
||||
var EVENT_KEY = '.' + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
||||
var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
|
||||
var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
|
||||
var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
|
||||
var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
|
||||
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
|
||||
var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + '|' + ARROW_DOWN_KEYCODE + '|' + ESCAPE_KEYCODE);
|
||||
|
||||
var Event = {
|
||||
HIDE: 'hide' + EVENT_KEY,
|
||||
HIDDEN: 'hidden' + EVENT_KEY,
|
||||
SHOW: 'show' + EVENT_KEY,
|
||||
SHOWN: 'shown' + EVENT_KEY,
|
||||
CLICK: 'click' + EVENT_KEY,
|
||||
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
|
||||
KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY,
|
||||
KEYUP_DATA_API: 'keyup' + EVENT_KEY + DATA_API_KEY
|
||||
};
|
||||
|
||||
var ClassName = {
|
||||
DISABLED: 'disabled',
|
||||
SHOW: 'show',
|
||||
DROPUP: 'dropup',
|
||||
MENURIGHT: 'dropdown-menu-right',
|
||||
MENULEFT: 'dropdown-menu-left'
|
||||
};
|
||||
|
||||
var Selector = {
|
||||
DATA_TOGGLE: '[data-toggle="dropdown"]',
|
||||
FORM_CHILD: '.dropdown form',
|
||||
MENU: '.dropdown-menu',
|
||||
NAVBAR_NAV: '.navbar-nav',
|
||||
VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled)'
|
||||
};
|
||||
|
||||
var AttachmentMap = {
|
||||
TOP: 'top-start',
|
||||
TOPEND: 'top-end',
|
||||
BOTTOM: 'bottom-start',
|
||||
BOTTOMEND: 'bottom-end'
|
||||
};
|
||||
|
||||
var Default = {
|
||||
placement: AttachmentMap.BOTTOM,
|
||||
offset: 0,
|
||||
flip: true
|
||||
};
|
||||
|
||||
var DefaultType = {
|
||||
placement: 'string',
|
||||
offset: '(number|string)',
|
||||
flip: 'boolean'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
var Dropdown = function () {
|
||||
function Dropdown(element, config) {
|
||||
_classCallCheck(this, Dropdown);
|
||||
|
||||
this._element = element;
|
||||
this._popper = null;
|
||||
this._config = this._getConfig(config);
|
||||
this._menu = this._getMenuElement();
|
||||
this._inNavbar = this._detectNavbar();
|
||||
|
||||
this._addEventListeners();
|
||||
}
|
||||
|
||||
// getters
|
||||
|
||||
// public
|
||||
|
||||
Dropdown.prototype.toggle = function toggle() {
|
||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this._element);
|
||||
var isActive = $(this._menu).hasClass(ClassName.SHOW);
|
||||
|
||||
Dropdown._clearMenus();
|
||||
|
||||
if (isActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
var relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
};
|
||||
var showEvent = $.Event(Event.SHOW, relatedTarget);
|
||||
|
||||
$(parent).trigger(showEvent);
|
||||
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var element = this._element;
|
||||
// for dropup with alignment we use the parent as popper container
|
||||
if ($(parent).hasClass(ClassName.DROPUP)) {
|
||||
if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) {
|
||||
element = parent;
|
||||
}
|
||||
}
|
||||
this._popper = new Popper(element, this._menu, this._getPopperConfig());
|
||||
|
||||
// if this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||
if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
|
||||
$('body').children().on('mouseover', null, $.noop);
|
||||
}
|
||||
|
||||
this._element.focus();
|
||||
this._element.setAttribute('aria-expanded', true);
|
||||
|
||||
$(this._menu).toggleClass(ClassName.SHOW);
|
||||
$(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget));
|
||||
};
|
||||
|
||||
Dropdown.prototype.dispose = function dispose() {
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$(this._element).off(EVENT_KEY);
|
||||
this._element = null;
|
||||
this._menu = null;
|
||||
if (this._popper !== null) {
|
||||
this._popper.destroy();
|
||||
}
|
||||
this._popper = null;
|
||||
};
|
||||
|
||||
Dropdown.prototype.update = function update() {
|
||||
this._inNavbar = this._detectNavbar();
|
||||
if (this._popper !== null) {
|
||||
this._popper.scheduleUpdate();
|
||||
}
|
||||
};
|
||||
|
||||
// private
|
||||
|
||||
Dropdown.prototype._addEventListeners = function _addEventListeners() {
|
||||
var _this = this;
|
||||
|
||||
$(this._element).on(Event.CLICK, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
_this.toggle();
|
||||
});
|
||||
};
|
||||
|
||||
Dropdown.prototype._getConfig = function _getConfig(config) {
|
||||
var elementData = $(this._element).data();
|
||||
if (elementData.placement !== undefined) {
|
||||
elementData.placement = AttachmentMap[elementData.placement.toUpperCase()];
|
||||
}
|
||||
|
||||
config = $.extend({}, this.constructor.Default, $(this._element).data(), config);
|
||||
|
||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
|
||||
return config;
|
||||
};
|
||||
|
||||
Dropdown.prototype._getMenuElement = function _getMenuElement() {
|
||||
if (!this._menu) {
|
||||
var parent = Dropdown._getParentFromElement(this._element);
|
||||
this._menu = $(parent).find(Selector.MENU)[0];
|
||||
}
|
||||
return this._menu;
|
||||
};
|
||||
|
||||
Dropdown.prototype._getPlacement = function _getPlacement() {
|
||||
var $parentDropdown = $(this._element).parent();
|
||||
var placement = this._config.placement;
|
||||
|
||||
// Handle dropup
|
||||
if ($parentDropdown.hasClass(ClassName.DROPUP) || this._config.placement === AttachmentMap.TOP) {
|
||||
placement = AttachmentMap.TOP;
|
||||
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
||||
placement = AttachmentMap.TOPEND;
|
||||
}
|
||||
} else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
||||
placement = AttachmentMap.BOTTOMEND;
|
||||
}
|
||||
return placement;
|
||||
};
|
||||
|
||||
Dropdown.prototype._detectNavbar = function _detectNavbar() {
|
||||
return $(this._element).closest('.navbar').length > 0;
|
||||
};
|
||||
|
||||
Dropdown.prototype._getPopperConfig = function _getPopperConfig() {
|
||||
var popperConfig = {
|
||||
placement: this._getPlacement(),
|
||||
modifiers: {
|
||||
offset: {
|
||||
offset: this._config.offset
|
||||
},
|
||||
flip: {
|
||||
enabled: this._config.flip
|
||||
}
|
||||
}
|
||||
|
||||
// Disable Popper.js for Dropdown in Navbar
|
||||
};if (this._inNavbar) {
|
||||
popperConfig.modifiers.applyStyle = {
|
||||
enabled: !this._inNavbar
|
||||
};
|
||||
}
|
||||
return popperConfig;
|
||||
};
|
||||
|
||||
// static
|
||||
|
||||
Dropdown._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
|
||||
|
||||
if (!data) {
|
||||
data = new Dropdown(this, _config);
|
||||
$(this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
if (data[config] === undefined) {
|
||||
throw new Error('No method named "' + config + '"');
|
||||
}
|
||||
data[config]();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Dropdown._clearMenus = function _clearMenus(event) {
|
||||
if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var toggles = $.makeArray($(Selector.DATA_TOGGLE));
|
||||
for (var i = 0; i < toggles.length; i++) {
|
||||
var parent = Dropdown._getParentFromElement(toggles[i]);
|
||||
var context = $(toggles[i]).data(DATA_KEY);
|
||||
var relatedTarget = {
|
||||
relatedTarget: toggles[i]
|
||||
};
|
||||
|
||||
if (!context) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var dropdownMenu = context._menu;
|
||||
if (!$(parent).hasClass(ClassName.SHOW)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var hideEvent = $.Event(Event.HIDE, relatedTarget);
|
||||
$(parent).trigger(hideEvent);
|
||||
if (hideEvent.isDefaultPrevented()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if this is a touch-enabled device we remove the extra
|
||||
// empty mouseover listeners we added for iOS support
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
$('body').children().off('mouseover', null, $.noop);
|
||||
}
|
||||
|
||||
toggles[i].setAttribute('aria-expanded', 'false');
|
||||
|
||||
$(dropdownMenu).removeClass(ClassName.SHOW);
|
||||
$(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
|
||||
}
|
||||
};
|
||||
|
||||
Dropdown._getParentFromElement = function _getParentFromElement(element) {
|
||||
var parent = void 0;
|
||||
var selector = Util.getSelectorFromElement(element);
|
||||
|
||||
if (selector) {
|
||||
parent = $(selector)[0];
|
||||
}
|
||||
|
||||
return parent || element.parentNode;
|
||||
};
|
||||
|
||||
Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
|
||||
if (!REGEXP_KEYDOWN.test(event.which) || /button/i.test(event.target.tagName) && event.which === SPACE_KEYCODE || /input|textarea/i.test(event.target.tagName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this);
|
||||
var isActive = $(parent).hasClass(ClassName.SHOW);
|
||||
|
||||
if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
|
||||
$(toggle).trigger('focus');
|
||||
}
|
||||
|
||||
$(this).trigger('click');
|
||||
return;
|
||||
}
|
||||
|
||||
var items = $(parent).find(Selector.VISIBLE_ITEMS).get();
|
||||
|
||||
if (!items.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var index = items.indexOf(event.target);
|
||||
|
||||
if (event.which === ARROW_UP_KEYCODE && index > 0) {
|
||||
// up
|
||||
index--;
|
||||
}
|
||||
|
||||
if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
|
||||
// down
|
||||
index++;
|
||||
}
|
||||
|
||||
if (index < 0) {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
items[index].focus();
|
||||
};
|
||||
|
||||
_createClass(Dropdown, null, [{
|
||||
key: 'VERSION',
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
key: 'Default',
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}, {
|
||||
key: 'DefaultType',
|
||||
get: function get() {
|
||||
return DefaultType;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Dropdown;
|
||||
}();
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + ' ' + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
Dropdown._jQueryInterface.call($(this), 'toggle');
|
||||
}).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Dropdown._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Dropdown;
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Dropdown._jQueryInterface;
|
||||
};
|
||||
|
||||
return Dropdown;
|
||||
}(jQuery); /* global Popper */
|
||||
//# sourceMappingURL=dropdown.js.map
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,591 @@
|
||||
/*
|
||||
* jQuery UI Tag-it!
|
||||
*
|
||||
* @version v2.0 (06/2011)
|
||||
*
|
||||
* Copyright 2011, Levy Carneiro Jr.
|
||||
* Released under the MIT license.
|
||||
* http://aehlke.github.com/tag-it/LICENSE
|
||||
*
|
||||
* Homepage:
|
||||
* http://aehlke.github.com/tag-it/
|
||||
*
|
||||
* Authors:
|
||||
* Levy Carneiro Jr.
|
||||
* Martin Rehfeld
|
||||
* Tobias Schmidt
|
||||
* Skylar Challand
|
||||
* Alex Ehlke
|
||||
*
|
||||
* Maintainer:
|
||||
* Alex Ehlke - Twitter: @aehlke
|
||||
*
|
||||
* Dependencies:
|
||||
* jQuery v1.4+
|
||||
* jQuery UI v1.8+
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
$.widget('ui.tagit', {
|
||||
options: {
|
||||
allowDuplicates : false,
|
||||
caseSensitive : true,
|
||||
fieldName : 'tags',
|
||||
placeholderText : null, // Sets `placeholder` attr on input field.
|
||||
readOnly : false, // Disables editing.
|
||||
removeConfirmation: false, // Require confirmation to remove tags.
|
||||
tagLimit : null, // Max number of tags allowed (null for unlimited).
|
||||
|
||||
// Used for autocomplete, unless you override `autocomplete.source`.
|
||||
availableTags : [],
|
||||
|
||||
// Use to override or add any options to the autocomplete widget.
|
||||
//
|
||||
// By default, autocomplete.source will map to availableTags,
|
||||
// unless overridden.
|
||||
autocomplete: {},
|
||||
|
||||
// Shows autocomplete before the user even types anything.
|
||||
showAutocompleteOnFocus: false,
|
||||
|
||||
// When enabled, quotes are unneccesary for inputting multi-word tags.
|
||||
allowSpaces: false,
|
||||
|
||||
// The below options are for using a single field instead of several
|
||||
// for our form values.
|
||||
//
|
||||
// When enabled, will use a single hidden field for the form,
|
||||
// rather than one per tag. It will delimit tags in the field
|
||||
// with singleFieldDelimiter.
|
||||
//
|
||||
// The easiest way to use singleField is to just instantiate tag-it
|
||||
// on an INPUT element, in which case singleField is automatically
|
||||
// set to true, and singleFieldNode is set to that element. This
|
||||
// way, you don't need to fiddle with these options.
|
||||
singleField: false,
|
||||
|
||||
// This is just used when preloading data from the field, and for
|
||||
// populating the field with delimited tags as the user adds them.
|
||||
singleFieldDelimiter: ',',
|
||||
|
||||
// Set this to an input DOM node to use an existing form field.
|
||||
// Any text in it will be erased on init. But it will be
|
||||
// populated with the text of tags as they are created,
|
||||
// delimited by singleFieldDelimiter.
|
||||
//
|
||||
// If this is not set, we create an input node for it,
|
||||
// with the name given in settings.fieldName.
|
||||
singleFieldNode: null,
|
||||
|
||||
// Whether to animate tag removals or not.
|
||||
animate: true,
|
||||
|
||||
// Optionally set a tabindex attribute on the input that gets
|
||||
// created for tag-it.
|
||||
tabIndex: null,
|
||||
|
||||
// Event callbacks.
|
||||
beforeTagAdded : null,
|
||||
afterTagAdded : null,
|
||||
|
||||
beforeTagRemoved : null,
|
||||
afterTagRemoved : null,
|
||||
|
||||
onTagClicked : null,
|
||||
onTagLimitExceeded : null,
|
||||
|
||||
|
||||
// DEPRECATED:
|
||||
//
|
||||
// /!\ These event callbacks are deprecated and WILL BE REMOVED at some
|
||||
// point in the future. They're here for backwards-compatibility.
|
||||
// Use the above before/after event callbacks instead.
|
||||
onTagAdded : null,
|
||||
onTagRemoved: null,
|
||||
// `autocomplete.source` is the replacement for tagSource.
|
||||
tagSource: null
|
||||
// Do not use the above deprecated options.
|
||||
},
|
||||
|
||||
_create: function() {
|
||||
// for handling static scoping inside callbacks
|
||||
var that = this;
|
||||
|
||||
// There are 2 kinds of DOM nodes this widget can be instantiated on:
|
||||
// 1. UL, OL, or some element containing either of these.
|
||||
// 2. INPUT, in which case 'singleField' is overridden to true,
|
||||
// a UL is created and the INPUT is hidden.
|
||||
if (this.element.is('input')) {
|
||||
this.tagList = $('<ul></ul>').insertAfter(this.element);
|
||||
this.options.singleField = true;
|
||||
this.options.singleFieldNode = this.element;
|
||||
this.element.addClass('tagit-hidden-field');
|
||||
} else {
|
||||
this.tagList = this.element.find('ul, ol').addBack().last();
|
||||
}
|
||||
|
||||
this.tagInput = $('<input type="text" />').addClass('ui-widget-content');
|
||||
|
||||
if (this.options.readOnly) this.tagInput.attr('disabled', 'disabled');
|
||||
|
||||
if (this.options.tabIndex) {
|
||||
this.tagInput.attr('tabindex', this.options.tabIndex);
|
||||
}
|
||||
|
||||
if (this.options.placeholderText) {
|
||||
this.tagInput.attr('placeholder', this.options.placeholderText);
|
||||
}
|
||||
|
||||
if (!this.options.autocomplete.source) {
|
||||
this.options.autocomplete.source = function(search, showChoices) {
|
||||
var filter = search.term.toLowerCase();
|
||||
var choices = $.grep(this.options.availableTags, function(element) {
|
||||
// Only match autocomplete options that begin with the search term.
|
||||
// (Case insensitive.)
|
||||
return (element.toLowerCase().indexOf(filter) === 0);
|
||||
});
|
||||
if (!this.options.allowDuplicates) {
|
||||
choices = this._subtractArray(choices, this.assignedTags());
|
||||
}
|
||||
showChoices(choices);
|
||||
};
|
||||
}
|
||||
|
||||
if (this.options.showAutocompleteOnFocus) {
|
||||
this.tagInput.focus(function(event, ui) {
|
||||
that._showAutocomplete();
|
||||
});
|
||||
|
||||
if (typeof this.options.autocomplete.minLength === 'undefined') {
|
||||
this.options.autocomplete.minLength = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Bind autocomplete.source callback functions to this context.
|
||||
if ($.isFunction(this.options.autocomplete.source)) {
|
||||
this.options.autocomplete.source = $.proxy(this.options.autocomplete.source, this);
|
||||
}
|
||||
|
||||
// DEPRECATED.
|
||||
if ($.isFunction(this.options.tagSource)) {
|
||||
this.options.tagSource = $.proxy(this.options.tagSource, this);
|
||||
}
|
||||
|
||||
this.tagList
|
||||
.addClass('tagit')
|
||||
.addClass('ui-widget ui-widget-content ui-corner-all')
|
||||
// Create the input field.
|
||||
.append($('<li class="tagit-new"></li>').append(this.tagInput))
|
||||
.click(function(e) {
|
||||
var target = $(e.target);
|
||||
if (target.hasClass('tagit-label')) {
|
||||
var tag = target.closest('.tagit-choice');
|
||||
if (!tag.hasClass('removed')) {
|
||||
that._trigger('onTagClicked', e, {tag: tag, tagLabel: that.tagLabel(tag)});
|
||||
}
|
||||
} else {
|
||||
// Sets the focus() to the input field, if the user
|
||||
// clicks anywhere inside the UL. This is needed
|
||||
// because the input field needs to be of a small size.
|
||||
that.tagInput.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Single field support.
|
||||
var addedExistingFromSingleFieldNode = false;
|
||||
if (this.options.singleField) {
|
||||
if (this.options.singleFieldNode) {
|
||||
// Add existing tags from the input field.
|
||||
var node = $(this.options.singleFieldNode);
|
||||
var tags = node.val().split(this.options.singleFieldDelimiter);
|
||||
node.val('');
|
||||
$.each(tags, function(index, tag) {
|
||||
that.createTag(tag, null, true);
|
||||
addedExistingFromSingleFieldNode = true;
|
||||
});
|
||||
} else {
|
||||
// Create our single field input after our list.
|
||||
this.options.singleFieldNode = $('<input type="hidden" style="display:none;" value="" name="' + this.options.fieldName + '" />');
|
||||
this.tagList.after(this.options.singleFieldNode);
|
||||
}
|
||||
}
|
||||
|
||||
// Add existing tags from the list, if any.
|
||||
if (!addedExistingFromSingleFieldNode) {
|
||||
this.tagList.children('li').each(function() {
|
||||
if (!$(this).hasClass('tagit-new')) {
|
||||
that.createTag($(this).text(), $(this).attr('class'), true);
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Events.
|
||||
this.tagInput
|
||||
.keydown(function(event) {
|
||||
// Backspace is not detected within a keypress, so it must use keydown.
|
||||
if (event.which == $.ui.keyCode.BACKSPACE && that.tagInput.val() === '') {
|
||||
var tag = that._lastTag();
|
||||
if (!that.options.removeConfirmation || tag.hasClass('remove')) {
|
||||
// When backspace is pressed, the last tag is deleted.
|
||||
that.removeTag(tag);
|
||||
} else if (that.options.removeConfirmation) {
|
||||
tag.addClass('remove ui-state-highlight');
|
||||
}
|
||||
} else if (that.options.removeConfirmation) {
|
||||
that._lastTag().removeClass('remove ui-state-highlight');
|
||||
}
|
||||
|
||||
// Comma/Space/Enter are all valid delimiters for new tags,
|
||||
// except when there is an open quote or if setting allowSpaces = true.
|
||||
// Tab will also create a tag, unless the tag input is empty,
|
||||
// in which case it isn't caught.
|
||||
if (
|
||||
(event.key === ',' && event.shiftKey === false) ||
|
||||
event.which === $.ui.keyCode.ENTER ||
|
||||
(
|
||||
event.which == $.ui.keyCode.TAB &&
|
||||
that.tagInput.val() !== ''
|
||||
) ||
|
||||
(
|
||||
event.which == $.ui.keyCode.SPACE &&
|
||||
that.options.allowSpaces !== true &&
|
||||
(
|
||||
$.trim(that.tagInput.val()).replace( /^s*/, '' ).charAt(0) != '"' ||
|
||||
(
|
||||
$.trim(that.tagInput.val()).charAt(0) == '"' &&
|
||||
$.trim(that.tagInput.val()).charAt($.trim(that.tagInput.val()).length - 1) == '"' &&
|
||||
$.trim(that.tagInput.val()).length - 1 !== 0
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
// Enter submits the form if there's no text in the input.
|
||||
if (!(event.which === $.ui.keyCode.ENTER && that.tagInput.val() === '')) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
// Autocomplete will create its own tag from a selection and close automatically.
|
||||
if (!(that.options.autocomplete.autoFocus && that.tagInput.data('autocomplete-open'))) {
|
||||
that.tagInput.autocomplete('close');
|
||||
that.createTag(that._cleanedInput());
|
||||
}
|
||||
}
|
||||
}).blur(function(e){
|
||||
// Create a tag when the element loses focus.
|
||||
// If autocomplete is enabled and suggestion was clicked, don't add it.
|
||||
if (!that.tagInput.data('autocomplete-open')) {
|
||||
that.createTag(that._cleanedInput());
|
||||
}
|
||||
});
|
||||
|
||||
// Autocomplete.
|
||||
if (this.options.availableTags || this.options.tagSource || this.options.autocomplete.source) {
|
||||
var autocompleteOptions = {
|
||||
select: function(event, ui) {
|
||||
that.createTag(ui.item.value);
|
||||
// Preventing the tag input to be updated with the chosen value.
|
||||
return false;
|
||||
}
|
||||
};
|
||||
$.extend(autocompleteOptions, this.options.autocomplete);
|
||||
|
||||
// tagSource is deprecated, but takes precedence here since autocomplete.source is set by default,
|
||||
// while tagSource is left null by default.
|
||||
autocompleteOptions.source = this.options.tagSource || autocompleteOptions.source;
|
||||
|
||||
this.tagInput.autocomplete(autocompleteOptions).bind('autocompleteopen.tagit', function(event, ui) {
|
||||
that.tagInput.data('autocomplete-open', true);
|
||||
}).bind('autocompleteclose.tagit', function(event, ui) {
|
||||
that.tagInput.data('autocomplete-open', false)
|
||||
});
|
||||
|
||||
this.tagInput.autocomplete('widget').addClass('tagit-autocomplete');
|
||||
}
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
$.Widget.prototype.destroy.call(this);
|
||||
|
||||
this.element.unbind('.tagit');
|
||||
this.tagList.unbind('.tagit');
|
||||
|
||||
this.tagInput.removeData('autocomplete-open');
|
||||
|
||||
this.tagList.removeClass([
|
||||
'tagit',
|
||||
'ui-widget',
|
||||
'ui-widget-content',
|
||||
'ui-corner-all',
|
||||
'tagit-hidden-field'
|
||||
].join(' '));
|
||||
|
||||
if (this.element.is('input')) {
|
||||
this.element.removeClass('tagit-hidden-field');
|
||||
this.tagList.remove();
|
||||
} else {
|
||||
this.element.children('li').each(function() {
|
||||
if ($(this).hasClass('tagit-new')) {
|
||||
$(this).remove();
|
||||
} else {
|
||||
$(this).removeClass([
|
||||
'tagit-choice',
|
||||
'ui-widget-content',
|
||||
'ui-state-default',
|
||||
'ui-state-highlight',
|
||||
'ui-corner-all',
|
||||
'remove',
|
||||
'tagit-choice-editable',
|
||||
'tagit-choice-read-only'
|
||||
].join(' '));
|
||||
|
||||
$(this).text($(this).children('.tagit-label').text());
|
||||
}
|
||||
});
|
||||
|
||||
if (this.singleFieldNode) {
|
||||
this.singleFieldNode.remove();
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_cleanedInput: function() {
|
||||
// Returns the contents of the tag input, cleaned and ready to be passed to createTag
|
||||
return $.trim(this.tagInput.val().replace(/^"(.*)"$/, '$1'));
|
||||
},
|
||||
|
||||
_lastTag: function() {
|
||||
return this.tagList.find('.tagit-choice:last:not(.removed)');
|
||||
},
|
||||
|
||||
_tags: function() {
|
||||
return this.tagList.find('.tagit-choice:not(.removed)');
|
||||
},
|
||||
|
||||
assignedTags: function() {
|
||||
// Returns an array of tag string values
|
||||
var that = this;
|
||||
var tags = [];
|
||||
if (this.options.singleField) {
|
||||
tags = $(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter);
|
||||
if (tags[0] === '') {
|
||||
tags = [];
|
||||
}
|
||||
} else {
|
||||
this._tags().each(function() {
|
||||
tags.push(that.tagLabel(this));
|
||||
});
|
||||
}
|
||||
return tags;
|
||||
},
|
||||
|
||||
_updateSingleTagsField: function(tags) {
|
||||
// Takes a list of tag string values, updates this.options.singleFieldNode.val to the tags delimited by this.options.singleFieldDelimiter
|
||||
$(this.options.singleFieldNode).val(tags.join(this.options.singleFieldDelimiter)).trigger('change');
|
||||
},
|
||||
|
||||
_subtractArray: function(a1, a2) {
|
||||
var result = [];
|
||||
for (var i = 0; i < a1.length; i++) {
|
||||
if ($.inArray(a1[i], a2) == -1) {
|
||||
result.push(a1[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
tagLabel: function(tag) {
|
||||
// Returns the tag's string label.
|
||||
if (this.options.singleField) {
|
||||
return $(tag).find('.tagit-label:first').text();
|
||||
} else {
|
||||
return $(tag).find('input:first').val();
|
||||
}
|
||||
},
|
||||
|
||||
_showAutocomplete: function() {
|
||||
this.tagInput.autocomplete('search', '');
|
||||
},
|
||||
|
||||
_findTagByLabel: function(name) {
|
||||
var that = this;
|
||||
var tag = null;
|
||||
this._tags().each(function(i) {
|
||||
if (that._formatStr(name) == that._formatStr(that.tagLabel(this))) {
|
||||
tag = $(this);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return tag;
|
||||
},
|
||||
|
||||
_isNew: function(name) {
|
||||
return !this._findTagByLabel(name);
|
||||
},
|
||||
|
||||
_formatStr: function(str) {
|
||||
if (this.options.caseSensitive) {
|
||||
return str;
|
||||
}
|
||||
return $.trim(str.toLowerCase());
|
||||
},
|
||||
|
||||
_effectExists: function(name) {
|
||||
return Boolean($.effects && ($.effects[name] || ($.effects.effect && $.effects.effect[name])));
|
||||
},
|
||||
|
||||
createTag: function(value, additionalClass, duringInitialization) {
|
||||
var that = this;
|
||||
|
||||
value = $.trim(value);
|
||||
|
||||
if(this.options.preprocessTag) {
|
||||
value = this.options.preprocessTag(value);
|
||||
}
|
||||
|
||||
if (value === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.options.allowDuplicates && !this._isNew(value)) {
|
||||
var existingTag = this._findTagByLabel(value);
|
||||
if (this._trigger('onTagExists', null, {
|
||||
existingTag: existingTag,
|
||||
duringInitialization: duringInitialization
|
||||
}) !== false) {
|
||||
if (this._effectExists('highlight')) {
|
||||
existingTag.effect('highlight');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.options.tagLimit && this._tags().length >= this.options.tagLimit) {
|
||||
this._trigger('onTagLimitExceeded', null, {duringInitialization: duringInitialization});
|
||||
return false;
|
||||
}
|
||||
|
||||
var label = $(this.options.onTagClicked ? '<a class="tagit-label"></a>' : '<span class="tagit-label"></span>').text(value);
|
||||
|
||||
// Create tag.
|
||||
var tag = $('<li></li>')
|
||||
.addClass('tagit-choice ui-widget-content ui-state-default ui-corner-all')
|
||||
.addClass(additionalClass)
|
||||
.append(label);
|
||||
|
||||
if (this.options.readOnly){
|
||||
tag.addClass('tagit-choice-read-only');
|
||||
} else {
|
||||
tag.addClass('tagit-choice-editable');
|
||||
// Button for removing the tag.
|
||||
var removeTagIcon = $('<span></span>')
|
||||
.addClass('ui-icon ui-icon-close');
|
||||
var removeTag = $('<a><span class="text-icon">\xd7</span></a>') // \xd7 is an X
|
||||
.addClass('tagit-close')
|
||||
.append(removeTagIcon)
|
||||
.click(function(e) {
|
||||
// Removes a tag when the little 'x' is clicked.
|
||||
that.removeTag(tag);
|
||||
});
|
||||
tag.append(removeTag);
|
||||
}
|
||||
|
||||
// Unless options.singleField is set, each tag has a hidden input field inline.
|
||||
if (!this.options.singleField) {
|
||||
var escapedValue = label.html();
|
||||
tag.append('<input type="hidden" value="' + escapedValue + '" name="' + this.options.fieldName + '" class="tagit-hidden-field" />');
|
||||
}
|
||||
|
||||
if (this._trigger('beforeTagAdded', null, {
|
||||
tag: tag,
|
||||
tagLabel: this.tagLabel(tag),
|
||||
duringInitialization: duringInitialization
|
||||
}) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.options.singleField) {
|
||||
var tags = this.assignedTags();
|
||||
tags.push(value);
|
||||
this._updateSingleTagsField(tags);
|
||||
}
|
||||
|
||||
// DEPRECATED.
|
||||
this._trigger('onTagAdded', null, tag);
|
||||
|
||||
this.tagInput.val('');
|
||||
|
||||
// Insert tag.
|
||||
this.tagInput.parent().before(tag);
|
||||
|
||||
this._trigger('afterTagAdded', null, {
|
||||
tag: tag,
|
||||
tagLabel: this.tagLabel(tag),
|
||||
duringInitialization: duringInitialization
|
||||
});
|
||||
|
||||
if (this.options.showAutocompleteOnFocus && !duringInitialization) {
|
||||
setTimeout(function () { that._showAutocomplete(); }, 0);
|
||||
}
|
||||
},
|
||||
|
||||
removeTag: function(tag, animate) {
|
||||
animate = typeof animate === 'undefined' ? this.options.animate : animate;
|
||||
|
||||
tag = $(tag);
|
||||
|
||||
// DEPRECATED.
|
||||
this._trigger('onTagRemoved', null, tag);
|
||||
|
||||
if (this._trigger('beforeTagRemoved', null, {tag: tag, tagLabel: this.tagLabel(tag)}) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.options.singleField) {
|
||||
var tags = this.assignedTags();
|
||||
var removedTagLabel = this.tagLabel(tag);
|
||||
tags = $.grep(tags, function(el){
|
||||
return el != removedTagLabel;
|
||||
});
|
||||
this._updateSingleTagsField(tags);
|
||||
}
|
||||
|
||||
if (animate) {
|
||||
tag.addClass('removed'); // Excludes this tag from _tags.
|
||||
var hide_args = this._effectExists('blind') ? ['blind', {direction: 'horizontal'}, 'fast'] : ['fast'];
|
||||
|
||||
var thisTag = this;
|
||||
hide_args.push(function() {
|
||||
tag.remove();
|
||||
thisTag._trigger('afterTagRemoved', null, {tag: tag, tagLabel: thisTag.tagLabel(tag)});
|
||||
});
|
||||
|
||||
tag.fadeOut('fast').hide.apply(tag, hide_args).dequeue();
|
||||
} else {
|
||||
tag.remove();
|
||||
this._trigger('afterTagRemoved', null, {tag: tag, tagLabel: this.tagLabel(tag)});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
removeTagByLabel: function(tagLabel, animate) {
|
||||
var toRemove = this._findTagByLabel(tagLabel);
|
||||
if (!toRemove) {
|
||||
throw "No such tag exists with the name '" + tagLabel + "'";
|
||||
}
|
||||
this.removeTag(toRemove, animate);
|
||||
},
|
||||
|
||||
removeAll: function() {
|
||||
// Removes all tags.
|
||||
var that = this;
|
||||
this._tags().each(function(index, tag) {
|
||||
that.removeTag(tag, false);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,225 @@
|
||||
/**
|
||||
* @file plugins/themes/default/js/main.js
|
||||
*
|
||||
* Copyright (c) 2014-2020 Simon Fraser University
|
||||
* Copyright (c) 2000-2020 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @brief Handle JavaScript functionality unique to this theme.
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
// Initialize dropdown navigation menus on large screens
|
||||
// See bootstrap dropdowns: https://getbootstrap.com/docs/4.0/components/dropdowns/
|
||||
if (typeof $.fn.dropdown !== 'undefined') {
|
||||
var $nav = $('#navigationPrimary, #navigationUser'),
|
||||
$submenus = $('ul', $nav);
|
||||
function toggleDropdowns() {
|
||||
if (window.innerWidth > 992) {
|
||||
$submenus.each(function(i) {
|
||||
var id = 'pkpDropdown' + i;
|
||||
$(this)
|
||||
.addClass('dropdown-menu')
|
||||
.attr('aria-labelledby', id);
|
||||
$(this).siblings('a')
|
||||
.attr('data-toggle', 'dropdown')
|
||||
.attr('aria-haspopup', true)
|
||||
.attr('aria-expanded', false)
|
||||
.attr('id', id)
|
||||
.attr('href', '#');
|
||||
});
|
||||
$('[data-toggle="dropdown"]').dropdown();
|
||||
|
||||
} else {
|
||||
$('[data-toggle="dropdown"]').dropdown('dispose');
|
||||
$submenus.each(function(i) {
|
||||
$(this)
|
||||
.removeClass('dropdown-menu')
|
||||
.removeAttr('aria-labelledby');
|
||||
$(this).siblings('a')
|
||||
.removeAttr('data-toggle')
|
||||
.removeAttr('aria-haspopup')
|
||||
.removeAttr('aria-expanded',)
|
||||
.removeAttr('id')
|
||||
.attr('href', '#');
|
||||
});
|
||||
}
|
||||
}
|
||||
window.onresize = toggleDropdowns;
|
||||
$().ready(function() {
|
||||
toggleDropdowns();
|
||||
});
|
||||
}
|
||||
|
||||
// Toggle nav menu on small screens
|
||||
$('.pkp_site_nav_toggle').click(function(e) {
|
||||
$('.pkp_site_nav_menu').toggleClass('pkp_site_nav_menu--isOpen');
|
||||
$('.pkp_site_nav_toggle').toggleClass('pkp_site_nav_toggle--transform');
|
||||
});
|
||||
|
||||
|
||||
// Register click handlers for the search panel
|
||||
var headerSearchPanelIsClosing = false,
|
||||
headerSearchForm = $('#headerNavigationContainer .pkp_search'),
|
||||
headerSearchPrompt = $('.headerSearchPrompt', headerSearchForm),
|
||||
headerSearchCancel = $('.headerSearchCancel', headerSearchForm),
|
||||
headerSearchInput = $('input[name="query"]', headerSearchForm);
|
||||
|
||||
// Register events
|
||||
headerSearchPrompt.on('click', triggerSearchPanel);
|
||||
headerSearchCancel.on('click', closeSearchPanel);
|
||||
headerSearchInput.on('blur', function() {
|
||||
if(!headerSearchInput.val() && headerSearchForm.hasClass('is_open')) {
|
||||
closeSearchPanel();
|
||||
}
|
||||
});
|
||||
headerSearchForm.on('submit', function() {
|
||||
if(headerSearchForm.hasClass('is_searching')) {
|
||||
return;
|
||||
}
|
||||
headerSearchForm.addClass('is_searching');
|
||||
});
|
||||
headerSearchForm.on('keyup', function(e) {
|
||||
if(headerSearchForm.hasClass('is_open') && e.keyCode == 27) {
|
||||
closeSearchPanel();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Open or submit search form
|
||||
*
|
||||
* @param Event e Optional event handler
|
||||
*/
|
||||
function triggerSearchPanel(e) {
|
||||
|
||||
if (headerSearchPanelIsClosing) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof e !== 'undefined') {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
if (headerSearchForm.hasClass('is_open')) {
|
||||
headerSearchForm.submit();
|
||||
return;
|
||||
}
|
||||
|
||||
headerSearchForm.addClass('is_open');
|
||||
setTimeout(function() {
|
||||
headerSearchForm.find('input[type="text"]').focus();
|
||||
},200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the search panel
|
||||
*
|
||||
* @param Event e Optional event handler
|
||||
*/
|
||||
function closeSearchPanel(e) {
|
||||
|
||||
if (headerSearchPanelIsClosing) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof e !== 'undefined') {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
headerSearchPanelIsClosing = true;
|
||||
headerSearchForm.removeClass('is_open');
|
||||
|
||||
setTimeout(function() {
|
||||
headerSearchPanelIsClosing = false;
|
||||
headerSearchInput.val('');
|
||||
},300)
|
||||
}
|
||||
|
||||
// Modify the Chart.js display options used by UsageStats plugin
|
||||
document.addEventListener('usageStatsChartOptions.pkp', function(e) {
|
||||
e.chartOptions.elements.line.backgroundColor = 'rgba(0, 122, 178, 0.6)';
|
||||
e.chartOptions.elements.rectangle.backgroundColor = 'rgba(0, 122, 178, 0.6)';
|
||||
});
|
||||
|
||||
// Toggle display of consent checkboxes in site-wide registration
|
||||
var $contextOptinGroup = $('#contextOptinGroup');
|
||||
if ($contextOptinGroup.length) {
|
||||
var $roles = $contextOptinGroup.find('.roles :checkbox');
|
||||
$roles.change(function() {
|
||||
var $thisRoles = $(this).closest('.roles');
|
||||
if ($thisRoles.find(':checked').length) {
|
||||
$thisRoles.siblings('.context_privacy').addClass('context_privacy_visible');
|
||||
} else {
|
||||
$thisRoles.siblings('.context_privacy').removeClass('context_privacy_visible');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize tag-it components
|
||||
//
|
||||
// The tag-it component is used during registration for the user to enter
|
||||
// their review interests. See: /templates/frontend/pages/userRegister.tpl
|
||||
if (typeof $.fn.tagit !== 'undefined') {
|
||||
$('.tag-it').each(function() {
|
||||
var autocomplete_url = $(this).data('autocomplete-url');
|
||||
$(this).tagit({
|
||||
fieldName: $(this).data('field-name'),
|
||||
allowSpaces: true,
|
||||
autocomplete: {
|
||||
source: function(request, response) {
|
||||
$.ajax({
|
||||
url: autocomplete_url,
|
||||
data: {term: request.term},
|
||||
dataType: 'json',
|
||||
success: function(jsonData) {
|
||||
if (jsonData.status == true) {
|
||||
response(jsonData.content);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Determine if the user has opted to register as a reviewer
|
||||
*
|
||||
* @see: /templates/frontend/pages/userRegister.tpl
|
||||
*/
|
||||
function isReviewerSelected() {
|
||||
var group = $('#reviewerOptinGroup').find('input');
|
||||
var is_checked = false;
|
||||
group.each(function() {
|
||||
if ($(this).is(':checked')) {
|
||||
is_checked = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return is_checked;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reveal the reviewer interests field on the registration form when a
|
||||
* user has opted to register as a reviewer
|
||||
*
|
||||
* @see: /templates/frontend/pages/userRegister.tpl
|
||||
*/
|
||||
function reviewerInterestsToggle() {
|
||||
var is_checked = isReviewerSelected();
|
||||
if (is_checked) {
|
||||
$('#reviewerInterests').addClass('is_visible');
|
||||
} else {
|
||||
$('#reviewerInterests').removeClass('is_visible');
|
||||
}
|
||||
}
|
||||
|
||||
// Update interests on page load and when the toggled is toggled
|
||||
reviewerInterestsToggle();
|
||||
$('#reviewerOptinGroup input').click(reviewerInterestsToggle);
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,59 @@
|
||||
.pkp_site_name_wrapper {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.pkp_site_name a.is_img img {
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
|
||||
div#articleCitations {
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.item.abstract {
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.item.author_bios {
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
|
||||
.pkp_navigation_primary > li > a {
|
||||
margin: 0 1em;
|
||||
padding: 10px 0 8px;
|
||||
border-bottom: 2px solid transparent;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #125f7b;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #0f3746;
|
||||
}
|
||||
|
||||
.obj_galley_link {
|
||||
display: inline-block;
|
||||
padding: 0 1em;
|
||||
background: #125f7b;
|
||||
border-radius: 3px;
|
||||
font-size: 13px;
|
||||
line-height: 28px;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border: 1px solid #ffffff;
|
||||
}
|
||||
|
||||
.obj_galley_link:hover {
|
||||
border: 1px solid #125f7b;
|
||||
color: #125f7b;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.pkp_brand_footer {
|
||||
display: none;
|
||||
}
|
||||
@ -0,0 +1,152 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.0.0-beta): util.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Util = function ($) {
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Private TransitionEnd Helpers
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var transition = false;
|
||||
|
||||
var MAX_UID = 1000000;
|
||||
|
||||
var TransitionEndEvent = {
|
||||
WebkitTransition: 'webkitTransitionEnd',
|
||||
MozTransition: 'transitionend',
|
||||
OTransition: 'oTransitionEnd otransitionend',
|
||||
transition: 'transitionend'
|
||||
|
||||
// shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||
};function toType(obj) {
|
||||
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
|
||||
}
|
||||
|
||||
function isElement(obj) {
|
||||
return (obj[0] || obj).nodeType;
|
||||
}
|
||||
|
||||
function getSpecialTransitionEndEvent() {
|
||||
return {
|
||||
bindType: transition.end,
|
||||
delegateType: transition.end,
|
||||
handle: function handle(event) {
|
||||
if ($(event.target).is(this)) {
|
||||
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function transitionEndTest() {
|
||||
if (window.QUnit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var el = document.createElement('bootstrap');
|
||||
|
||||
for (var name in TransitionEndEvent) {
|
||||
if (el.style[name] !== undefined) {
|
||||
return {
|
||||
end: TransitionEndEvent[name]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function transitionEndEmulator(duration) {
|
||||
var _this = this;
|
||||
|
||||
var called = false;
|
||||
|
||||
$(this).one(Util.TRANSITION_END, function () {
|
||||
called = true;
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
if (!called) {
|
||||
Util.triggerTransitionEnd(_this);
|
||||
}
|
||||
}, duration);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function setTransitionEndSupport() {
|
||||
transition = transitionEndTest();
|
||||
|
||||
$.fn.emulateTransitionEnd = transitionEndEmulator;
|
||||
|
||||
if (Util.supportsTransitionEnd()) {
|
||||
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Public Util Api
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Util = {
|
||||
|
||||
TRANSITION_END: 'bsTransitionEnd',
|
||||
|
||||
getUID: function getUID(prefix) {
|
||||
do {
|
||||
// eslint-disable-next-line no-bitwise
|
||||
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
|
||||
} while (document.getElementById(prefix));
|
||||
return prefix;
|
||||
},
|
||||
getSelectorFromElement: function getSelectorFromElement(element) {
|
||||
var selector = element.getAttribute('data-target');
|
||||
if (!selector || selector === '#') {
|
||||
selector = element.getAttribute('href') || '';
|
||||
}
|
||||
|
||||
try {
|
||||
var $selector = $(selector);
|
||||
return $selector.length > 0 ? selector : null;
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
reflow: function reflow(element) {
|
||||
return element.offsetHeight;
|
||||
},
|
||||
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
||||
$(element).trigger(transition.end);
|
||||
},
|
||||
supportsTransitionEnd: function supportsTransitionEnd() {
|
||||
return Boolean(transition);
|
||||
},
|
||||
typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
|
||||
for (var property in configTypes) {
|
||||
if (configTypes.hasOwnProperty(property)) {
|
||||
var expectedTypes = configTypes[property];
|
||||
var value = config[property];
|
||||
var valueType = value && isElement(value) ? 'element' : toType(value);
|
||||
|
||||
if (!new RegExp(expectedTypes).test(valueType)) {
|
||||
throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
setTransitionEndSupport();
|
||||
|
||||
return Util;
|
||||
}(jQuery);
|
||||
//# sourceMappingURL=util.js.map
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,172 @@
|
||||
!function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n;n||(n=1,function(){function e(e){var t=!0,n=!1,o=null,i={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function r(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function s(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!i[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}function a(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function l(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function c(n){
|
||||
n.metaKey||n.altKey||n.ctrlKey||(r(e.activeElement)&&a(e.activeElement),t=!0)}function d(e){t=!1}function u(e){r(e.target)&&(t||s(e.target))&&a(e.target)}function h(e){r(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(o),o=window.setTimeout((function(){n=!1}),100),l(e.target))}function f(e){"hidden"===document.visibilityState&&(n&&(t=!0),m())}function m(){document.addEventListener("mousemove",p),document.addEventListener("mousedown",p),document.addEventListener("mouseup",p),document.addEventListener("pointermove",p),document.addEventListener("pointerdown",p),document.addEventListener("pointerup",p),document.addEventListener("touchmove",p),document.addEventListener("touchstart",p),document.addEventListener("touchend",p)}function g(){document.removeEventListener("mousemove",p),document.removeEventListener("mousedown",p),document.removeEventListener("mouseup",p),document.removeEventListener("pointermove",p),
|
||||
document.removeEventListener("pointerdown",p),document.removeEventListener("pointerup",p),document.removeEventListener("touchmove",p),document.removeEventListener("touchstart",p),document.removeEventListener("touchend",p)}function p(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,g())}document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",d,!0),document.addEventListener("pointerdown",d,!0),document.addEventListener("touchstart",d,!0),document.addEventListener("visibilitychange",f,!0),m(),e.addEventListener("focus",u,!0),e.addEventListener("blur",h,!0),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready")
|
||||
}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}"undefined"!=typeof document&&e(document)}());var o,i,r,s,a,l,c,d,u,h,f,m,g={},p=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function y(e,t,n,o,s){var a={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++r:s,__i:-1,__u:0};return null==s&&null!=i.vnode&&i.vnode(a),a}function x(e){return e.children}function N(e,t){this.props=e,this.context=t}function C(e,t){if(null==t)return e.__?C(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?C(e):null}function S(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break
|
||||
}return S(e)}}function E(e){(!e.__d&&(e.__d=!0)&&s.push(e)&&!A.__r++||a!==i.debounceRendering)&&((a=i.debounceRendering)||l)(A)}function A(){var e,t,n,o,r,a,l,d;for(s.sort(c);e=s.shift();)e.__d&&(t=s.length,o=void 0,a=(r=(n=e).__v).__e,l=[],d=[],n.__P&&((o=v({},r)).__v=r.__v+1,i.vnode&&i.vnode(o),O(n.__P,o,r,n.__n,n.__P.namespaceURI,32&r.__u?[a]:null,l,null==a?C(r):a,!!(32&r.__u),d),o.__v=r.__v,o.__.__k[o.__i]=o,I(l,o,d),o.__e!=a&&S(o)),s.length>t&&s.sort(c));A.__r=0}function R(e,t,n,o,i,r,s,a,l,c,d){var u,h,f,m,_,v,w=o&&o.__k||p,N=t.length;for(l=function(e,t,n,o,i){var r,s,a,l,c,d=n.length,u=d,h=0;for(e.__k=new Array(i),r=0;r<i;r++)null!=(s=t[r])&&"boolean"!=typeof s&&"function"!=typeof s?(l=r+h,(s=e.__k[r]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?y(null,s,null,null,null):b(s)?y(x,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?y(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,-1!==(c=s.__i=P(s,n,l,u))&&(u--,
|
||||
(a=n[c])&&(a.__u|=2)),null==a||null===a.__v?(-1==c&&h--,"function"!=typeof s.type&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):e.__k[r]=null;if(u)for(r=0;r<d;r++)null!=(a=n[r])&&0==(2&a.__u)&&(a.__e==o&&(o=C(a)),F(a,a));return o}(n,t,w,l,N),u=0;u<N;u++)null!=(f=n.__k[u])&&(h=-1===f.__i?g:w[f.__i]||g,f.__i=u,v=O(e,f,h,i,r,s,a,l,c,d),m=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&H(h.ref,null,f),d.push(f.ref,f.__c||m,f)),null==_&&null!=m&&(_=m),4&f.__u||h.__k===f.__k?l=k(f,l,e):"function"==typeof f.type&&void 0!==v?l=v:m&&(l=m.nextSibling),f.__u&=-7);return n.__e=_,l}function k(e,t,n){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=k(o[i],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=C(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function P(e,t,n,o){var i,r,s=e.key,a=e.type,l=t[n];if(null===l||l&&s==l.key&&a===l.type&&0==(2&l.__u))return n;if(o>(null!=l&&0==(2&l.__u)?1:0))for(i=n-1,
|
||||
r=n+1;i>=0||r<t.length;){if(i>=0){if((l=t[i])&&0==(2&l.__u)&&s==l.key&&a===l.type)return i;i--}if(r<t.length){if((l=t[r])&&0==(2&l.__u)&&s==l.key&&a===l.type)return r;r++}}return-1}function T(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||_.test(t)?n:n+"px"}function M(e,t,n,o,i){var r;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||T(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||T(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])r=t!=(t=t.replace(d,"$1")),t=t.toLowerCase()in e||"onFocusOut"==t||"onFocusIn"==t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o?n.u=o.u:(n.u=u,e.addEventListener(t,r?f:h,r)):e.removeEventListener(t,r?f:h,r);else{
|
||||
if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function L(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=u++;else if(t.t<n.u)return;return n(i.event?i.event(t):t)}}}function O(e,t,n,o,r,s,a,l,c,d){var u,h,f,m,g,p,_,y,C,S,E,A,k,P,T,M,L,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),s=[l=t.__e=n.__e]),(u=i.__b)&&u(t);e:if("function"==typeof O)try{if(y=t.props,C="prototype"in O&&O.prototype.render,S=(u=O.contextType)&&o[u.__c],E=u?S?S.props.value:u.__:o,n.__c?_=(h=t.__c=n.__c).__=h.__E:(C?t.__c=h=new O(y,E):(t.__c=h=new N(y,E),h.constructor=O,h.render=D),S&&S.sub(h),h.props=y,h.state||(h.state={}),h.context=E,
|
||||
h.__n=o,f=h.__d=!0,h.__h=[],h._sb=[]),C&&null==h.__s&&(h.__s=h.state),C&&null!=O.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=v({},h.__s)),v(h.__s,O.getDerivedStateFromProps(y,h.__s))),m=h.props,g=h.state,h.__v=t,f)C&&null==O.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),C&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(C&&null==O.getDerivedStateFromProps&&y!==m&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,E),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,E)||t.__v==n.__v)){for(t.__v!=n.__v&&(h.props=y,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[],h.__h.length&&a.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,E),C&&null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(m,g,p)}))}if(h.context=E,h.props=y,h.__P=e,h.__e=!1,k=i.__r,P=0,C){for(h.state=h.__s,h.__d=!1,
|
||||
k&&k(t),u=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do{h.__d=!1,k&&k(t),u=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++P<25);h.state=h.__s,null!=h.getChildContext&&(o=v(v({},o),h.getChildContext())),C&&!f&&null!=h.getSnapshotBeforeUpdate&&(p=h.getSnapshotBeforeUpdate(m,g)),l=R(e,b(M=null!=u&&u.type===x&&null==u.key?u.props.children:u)?M:[M],t,n,o,r,s,a,l,c,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),_&&(h.__E=h.__=null)}catch(e){if(t.__v=null,c||null!=s)if(e.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,t.__e=l}else for(L=s.length;L--;)w(s[L]);else t.__e=n.__e,t.__k=n.__k;i.__e(e,t,n)}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=B(n.__e,t,n,o,r,s,a,c,d);return(u=i.diffed)&&u(t),128&t.__u?void 0:l}function I(e,t,n){for(var o=0;o<n.length;o++)H(n[o],n[++o],n[++o]);i.__c&&i.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){
|
||||
i.__e(e,t.__v)}}))}function B(e,t,n,r,s,a,l,c,d){var u,h,f,m,p,_,v,y=n.props,x=t.props,N=t.type;if("svg"==N?s="http://www.w3.org/2000/svg":"math"==N?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((p=a[u])&&"setAttribute"in p==!!N&&(N?p.localName==N:3==p.nodeType)){e=p,a[u]=null;break}if(null==e){if(null==N)return document.createTextNode(x);e=document.createElementNS(s,N,x.is&&x),c&&(i.__m&&i.__m(t,a),c=!1),a=null}if(null===N)y===x||c&&e.data===x||(e.data=x);else{if(a=a&&o.call(e.childNodes),y=n.props||g,!c&&null!=a)for(y={},u=0;u<e.attributes.length;u++)y[(p=e.attributes[u]).name]=p.value;for(u in y)if(p=y[u],"children"==u);else if("dangerouslySetInnerHTML"==u)f=p;else if(!(u in x)){if("value"==u&&"defaultValue"in x||"checked"==u&&"defaultChecked"in x)continue;M(e,u,null,p,s)}for(u in x)p=x[u],"children"==u?m=p:"dangerouslySetInnerHTML"==u?h=p:"value"==u?_=p:"checked"==u?v=p:c&&"function"!=typeof p||y[u]===p||M(e,u,p,y[u],s)
|
||||
;if(h)c||f&&(h.__html===f.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(f&&(e.innerHTML=""),R(e,b(m)?m:[m],t,n,r,"foreignObject"==N?"http://www.w3.org/1999/xhtml":s,a,l,a?a[0]:n.__k&&C(n,0),c,d),null!=a)for(u=a.length;u--;)w(a[u]);c||(u="value","progress"==N&&null==_?e.removeAttribute("value"):void 0!==_&&(_!==e[u]||"progress"==N&&!_||"option"==N&&_!==y[u])&&M(e,u,_,y[u],s),u="checked",void 0!==v&&v!==e[u]&&M(e,u,v,y[u],s))}return e}function H(e,t,n){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){i.__e(e,n)}}function F(e,t,n){var o,r;if(i.unmount&&i.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||H(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){i.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&F(o[r],t,n||"function"!=typeof e.type);n||w(e.__e),e.__c=e.__=e.__e=void 0}function D(e,t,n){return this.constructor(e,n)}function V(e,t,n){var r,s,a
|
||||
;t==document&&(t=document.documentElement),i.__&&i.__(e,t),r=!1?null:t.__k,s=[],a=[],O(t,e=t.__k=function(e,t,n){var i,r,s,a={};for(s in t)"key"==s?i=t[s]:"ref"==s?r=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return y(e,a,i,r,null)}(x,null,[e]),r||g,g,t.namespaceURI,r?null:t.firstChild?o.call(t.childNodes):null,s,r?r.__e:t.firstChild,false,a),I(s,e,a)}function U(e,t){var n={__c:t="__cC"+m++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=new Set,(o={})[t]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.forEach((function(e){e.__e=!0,E(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}}
|
||||
;return n.Provider.__=n.Consumer.contextType=n}o=p.slice,i={__e:function(e,t,n,o){for(var i,r,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,o||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},r=0,N.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof e&&(e=e(v({},n),this.props)),e&&v(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),E(this))},N.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),E(this))},N.prototype.render=x,s=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},A.__r=0,d=/(PointerCapture)$|Capture$/i,u=0,h=L(!1),f=L(!0),m=0;var q,$,z,W,j=0,X=[],K=i,G=K.__b,Y=K.__r,Q=K.diffed,J=K.__c,Z=K.unmount,ee=K.__;function te(e,t){K.__h&&K.__h($,e,j||t),j=0
|
||||
;var n=$.__H||($.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ne(e){return j=1,function(e,t,n){var o=te(q++,2);if(o.t=e,!o.__c&&(o.__=[pe(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=$,!$.u)){var i=function(e,t,n){if(!o.__c.__H)return!0;var i=o.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!r||r.call(this,e,t,n);var s=o.__c.props!==e;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),r&&r.call(this,e,t,n)||s};$.u=!0;var r=$.shouldComponentUpdate,s=$.componentWillUpdate;$.componentWillUpdate=function(e,t,n){if(this.__e){var o=r;r=void 0,i(e,t,n),r=o}s&&s.call(this,e,t,n)},$.shouldComponentUpdate=i}return o.__N||o.__}(pe,e)}function oe(e,t){var n=te(q++,3);!K.__s&&ge(n.__H,t)&&(n.__=e,n.i=t,$.__H.__h.push(n))}function ie(e,t){var n=te(q++,4);!K.__s&&ge(n.__H,t)&&(n.__=e,n.i=t,$.__h.push(n))}function re(e){
|
||||
return j=5,se((function(){return{current:e}}),[])}function se(e,t){var n=te(q++,7);return ge(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ae(e,t){return j=8,se((function(){return e}),t)}function le(e){var t=$.context[e.__c],n=te(q++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub($)),t.props.value):e.__}function ce(){var e=te(q++,11);if(!e.__){for(var t=$.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function de(){for(var e;e=X.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(fe),e.__H.__h.forEach(me),e.__H.__h=[]}catch(t){e.__H.__h=[],K.__e(t,e.__v)}}K.__b=function(e){$=null,G&&G(e)},K.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ee&&ee(e,t)},K.__r=function(e){Y&&Y(e),q=0;var t=($=e.__c).__H;t&&(z===$?(t.__h=[],$.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(fe),t.__h.forEach(me),t.__h=[],q=0)),z=$},K.diffed=function(e){Q&&Q(e);var t=e.__c
|
||||
;t&&t.__H&&(t.__H.__h.length&&(1!==X.push(t)&&W===K.requestAnimationFrame||((W=K.requestAnimationFrame)||he)(de)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),z=$=null},K.__c=function(e,t){t.some((function(e){try{e.__h.forEach(fe),e.__h=e.__h.filter((function(e){return!e.__||me(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],K.__e(n,e.__v)}})),J&&J(e,t)},K.unmount=function(e){Z&&Z(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{fe(e)}catch(e){t=e}})),n.__H=void 0,t&&K.__e(t,n.__v))};var ue="function"==typeof requestAnimationFrame;function he(e){var t,n=function(){clearTimeout(o),ue&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);ue&&(t=requestAnimationFrame(n))}function fe(e){var t=$,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),$=t}function me(e){var t=$;e.__c=e.__(),$=t}function ge(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function pe(e,t){return"function"==typeof t?t(e):t}function _e(e,t,n){return(t=function(e){
|
||||
var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class be{constructor(){_e(this,"_listeners",void 0),this._listeners=new Map}add(e,t,n,o){e.addEventListener(t,n,o);const i=Symbol();return this._listeners.set(i,{eventTarget:e,eventType:t,listener:n,options:o}),i}remove(e){const t=this._listeners.get(e);if(t){const{eventTarget:n,eventType:o,listener:i,options:r}=t;n.removeEventListener(o,i,r),this._listeners.delete(e)}}removeAll(){this._listeners.forEach((({eventTarget:e,eventType:t,listener:n,options:o})=>{e.removeEventListener(t,n,o)})),this._listeners.clear()}}function ve(e){e.focus()}
|
||||
function we(e,{autofocus:t=!1,loop:n=!0,horizontal:o=!0,vertical:i=!0,selector:r="a,button",containerVisible:s=!0,focusElement:a=ve}={}){const l=re(null),c=function(e){const t=re({callback:e,call:(...e)=>t.current.callback(...e)});return t.current.callback=e,t.current.call}(a);oe((()=>{if(!s)return()=>{};if(!e.current)throw new Error("Container ref not set");const a=e.current,d=()=>{const e=Array.from(a.querySelectorAll(r)).filter((e=>null!==e.offsetParent&&!function(e){return"boolean"==typeof e.disabled&&e.disabled}(e)));return document.activeElement===a&&e.unshift(a),e},u=(e=d(),t=-1,n=!1,o)=>{t<0&&(t=e.findIndex((e=>0===e.tabIndex)))<0&&(t=0);for(const[i,r]of e.entries())r.tabIndex=i===t?0:-1,i===t&&n&&(l.current=r,c(r,o))},h=d(),f=l.current?h.indexOf(l.current):0;u(h,f,t);const m=new be;m.add(a,"focusin",(e=>{if(e.target===a&&l.current)return void c(l.current);const n=d(),o=n.indexOf(e.target);o>=0&&u(n,o,t)})),m.add(a,"keydown",(e=>{const t=d();let r=t.findIndex((e=>0===e.tabIndex)),s=!1
|
||||
;o&&"ArrowLeft"===e.key||i&&"ArrowUp"===e.key?(0===r?r=n?t.length-1:r:--r,s=!0):o&&"ArrowRight"===e.key||i&&"ArrowDown"===e.key?(r===t.length-1?r=n?0:r:++r,s=!0):"Home"===e.key?(r=0,s=!0):"End"===e.key&&(r=t.length-1,s=!0),s&&(u(t,r,!0,e),e.preventDefault(),e.stopPropagation())}));const g=new MutationObserver((()=>{u()}));return g.observe(a,{subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0}),()=>{m.removeAll(),g.disconnect()}}),[t,e,c,o,n,r,i,s])}function ye(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class xe{constructor(e){ye(this,"_target",void 0),ye(this,"_value",void 0),this._target=e,this._value=null}
|
||||
get current(){return this._value}set current(e){this._value=e,this._updateTarget()}get target(){return this._target}set target(e){e!==this._target&&(this._target=e,this._updateTarget())}_updateTarget(){const e=this._value;"function"==typeof this._target?this._target(e):this._target&&(this._target.current=e)}}function Ne(e){const t=re(new xe(e));return t.current.target=e,t.current}var Ce,Se={exports:{}};var Ee,Ae=(Ce||(Ce=1,Ee=Se,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=o(e,n(i)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var r in n)e.call(n,r)&&n[r]&&(i=o(i,r));return i}function o(e,t){return t?e?e+" "+t:e+t:e}Ee.exports?(t.default=t,Ee.exports=t):window.classNames=t}()),Se.exports),Re=t(Ae);var ke=0
|
||||
;function Pe(e,t,n,o,r,s){t||(t={});var a,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?a=t[l]:c[l]=t[l];var d={type:e,props:c,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ke,__i:-1,__u:0,__source:r,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(l in a)void 0===c[l]&&(c[l]=a[l]);return i.vnode&&i.vnode(d),d}U({}),U({});var Te="/home/runner/work/frontend-shared/frontend-shared/src/components/layout/Card.tsx";function Me({children:e,classes:t,elementRef:n,active:o=!1,variant:i="raised",width:r="full",...s}){return Pe("div",{"data-component":"Card",...s,ref:n,className:Re("rounded-lg border bg-white",{"shadow hover:shadow-md":"raised"===i,"shadow-md":o&&"raised"===i},{"w-full":"full"===r,"w-auto":"auto"===r},t),children:e},void 0,0,{fileName:Te,lineNumber:40,columnNumber:5},this)}var Le="/home/runner/work/frontend-shared/frontend-shared/src/components/layout/CardContent.tsx";function Oe({children:e,classes:t,elementRef:n,size:o="md",...i}){return Pe("div",{
|
||||
"data-component":"CardContent",...i,ref:n,className:Re({"p-3 space-y-4":"md"===o,"p-2 space-y-3":"sm"===o,"p-4 space-y-6":"lg"===o},t),children:e},void 0,0,{fileName:Le,lineNumber:29,columnNumber:5},this)}var Ie="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Annotate.tsx";function Be(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"AnnotateIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:Ie,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",
|
||||
d:"M14 0a2 2 0 0 1 2 2v13a1 1 0 0 1-1.555.832l-4.262-1.757A1 1 0 0 0 9.802 14H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm-2.109 3.5h-.484l-.14.006-.122.018a.7.7 0 0 0-.2.071l-.076.054-.108.1-.097.1-1.632 1.999-.091.12-.084.129a2.6 2.6 0 0 0-.291.722l-.03.142-.027.218-.009.223v2.646l.01.086.027.08a.54.54 0 0 0 .236.236l.067.028.07.017.074.005h2.907l.074-.005.094-.025a.5.5 0 0 0 .169-.108.5.5 0 0 0 .082-.096l.029-.051.027-.081.01-.086V7.336l-.006-.073-.018-.068a.44.44 0 0 0-.124-.178.6.6 0 0 0-.103-.074l-.055-.026-.087-.024-.092-.009h-.579l-.057-.006-.054-.017a.3.3 0 0 1-.096-.07.2.2 0 0 1-.045-.078l-.004-.04.01-.043.022-.043 1.311-2.227.047-.09.037-.106a.5.5 0 0 0-.06-.394.53.53 0 0 0-.255-.22l-.084-.028-.092-.016zm-5.924 0h-.424l-.121.006-.108.018a.6.6 0 0 0-.174.071l-.067.054-.095.1-.084.1-1.429 1.999-.08.12-.096.174a2.8 2.8 0 0 0-.232.677l-.025.142-.024.218L3 7.402v2.646l.008.086.024.08a.5.5 0 0 0 .097.148q.052.055.11.088l.058.028.062.017.065.005h2.543l.065-.005.082-.025a.515.515 0 0 0 .22-.204l.025-.051.024-.081.008-.086V7.336l-.005-.073-.023-.09a.487.487 0 0 0-.191-.23l-.048-.026-.076-.024-.08-.009H5.46l-.05-.006-.047-.017a.3.3 0 0 1-.084-.07.2.2 0 0 1-.04-.078l-.003-.04.008-.043.02-.043L6.411 4.36l.04-.09.033-.106a.55.55 0 0 0-.053-.394.5.5 0 0 0-.222-.22l-.074-.028-.08-.016z"
|
||||
},void 0,0,{fileName:Ie,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:Ie,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:Ie,lineNumber:11,columnNumber:5},this)}var He="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Cancel.tsx";function Fe(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CancelIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:He,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"m12.322 5.085-.08.087-2.828 2.827 2.829 2.83a1 1 0 0 1-1.32 1.497l-.095-.083L8 9.414l-2.828 2.829c-.915.914-2.272-.388-1.494-1.328l.08-.087L6.584 8 3.757 5.172a1 1 0 0 1 1.32-1.498l.095.083L8 6.585l2.828-2.828c.886-.885 2.188.309 1.56 1.239z"},void 0,0,{fileName:He,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:He,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:He,lineNumber:11,
|
||||
columnNumber:5},this)}var De="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/CaretDown.tsx";function Ve(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CaretDownIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:De,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M3.293 5.293a1 1 0 0 1 1.32-.083l.094.083L8 8.585l3.293-3.292a1 1 0 0 1 1.32-.083l.094.083a1 1 0 0 1 .083 1.32l-.083.094-4 4a1 1 0 0 1-1.32.083l-.094-.083-4-4a1 1 0 0 1 0-1.414"},void 0,0,{fileName:De,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:De,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:De,lineNumber:11,columnNumber:5},this)}var Ue="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/CaretLeft.tsx";function qe(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",
|
||||
"aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CaretLeftIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:Ue,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M9.293 3.293a1 1 0 0 1 1.497 1.32l-.083.094L7.415 8l3.292 3.293a1 1 0 0 1 .083 1.32l-.083.094a1 1 0 0 1-1.32.083l-.094-.083-4-4a1 1 0 0 1-.083-1.32l.083-.094z"},void 0,0,{fileName:Ue,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:Ue,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:Ue,lineNumber:11,columnNumber:5},this)}var $e="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/CaretRight.tsx";function ze(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CaretRightIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:$e,lineNumber:21,columnNumber:9
|
||||
},this),Pe("path",{fill:"currentColor",d:"M5.293 3.293a1 1 0 0 1 1.32-.083l.094.083 4 4a1 1 0 0 1 .083 1.32l-.083.094-4 4a1 1 0 0 1-1.497-1.32l.083-.094L8.585 8 5.293 4.707a1 1 0 0 1-.083-1.32z"},void 0,0,{fileName:$e,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:$e,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:$e,lineNumber:11,columnNumber:5},this)}var We="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Caution.tsx";function je(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CautionIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:We,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",
|
||||
d:"M8 0c.767 0 1.432.455 1.794 1.148l5.917 11.326c.386.738.36 1.573.071 2.23-.286.651-.926 1.296-1.864 1.296H2.082c-.938 0-1.578-.645-1.864-1.295a2.6 2.6 0 0 1 .07-2.23L6.207 1.147C6.568.455 7.233 0 8 0m0 2.038-.021.036L2.06 13.4a.6.6 0 0 0-.012.5.3.3 0 0 0 .062.1H13.89a.3.3 0 0 0 .061-.1.6.6 0 0 0-.012-.5L8.02 2.074zm5.874 11.972q0 0 .01-.006-.01.007-.01.006m-11.748 0q0 .002-.01-.006z"},void 0,0,{fileName:We,lineNumber:22,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M8 5a1 1 0 0 1 1 1v3a1 1 0 0 1-2 0V6a1 1 0 0 1 1-1M9 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0"},void 0,0,{fileName:We,lineNumber:26,columnNumber:9},this)]},void 0,0,{fileName:We,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:We,lineNumber:11,columnNumber:5},this)}var Xe="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Check.tsx";function Ke(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CheckIcon",...e,children:Pe("g",{
|
||||
"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:Xe,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M12.18 2.427a1 1 0 0 1 1.705 1.04l-.066.106-7 10a1 1 0 0 1-1.606.045l-.07-.104-3-5A1 1 0 0 1 3.792 7.39l.065.097 2.207 3.677z"},void 0,0,{fileName:Xe,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:Xe,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:Xe,lineNumber:11,columnNumber:5},this)}var Ge="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Checkbox.tsx";function Ye(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CheckboxIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:Ge,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",
|
||||
d:"M0 2.5A2.5 2.5 0 0 1 2.5 0h11A2.5 2.5 0 0 1 16 2.5v11a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 13.5zM2.5 1A1.5 1.5 0 0 0 1 2.5v11A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-11A1.5 1.5 0 0 0 13.5 1z","clip-rule":"evenodd"},void 0,0,{fileName:Ge,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:Ge,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:Ge,lineNumber:11,columnNumber:5},this)}var Qe="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/CheckboxCheckedFilled.tsx";function Je(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CheckboxCheckedFilledIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:Qe,lineNumber:23,columnNumber:9},this),Pe("path",{fill:"currentColor",
|
||||
d:"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm10.18 3.636a.75.75 0 0 0-1.044.184l-4.588 6.552-1.655-2.758-.05-.072a.75.75 0 0 0-1.236.844l2.25 3.75.053.078a.75.75 0 0 0 1.204-.034l5.25-7.5.05-.08a.75.75 0 0 0-.234-.964","clip-rule":"evenodd"},void 0,0,{fileName:Qe,lineNumber:24,columnNumber:9},this)]},void 0,0,{fileName:Qe,lineNumber:22,columnNumber:7},this)},void 0,0,{fileName:Qe,lineNumber:13,columnNumber:5},this)}var Ze="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Hide.tsx";function et(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"HideIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:Ze,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",
|
||||
d:"m1.613.21.094.083 14 14a1 1 0 0 1-1.32 1.497l-.094-.083-14-14A1 1 0 0 1 1.613.21m.583 4.845a1 1 0 0 1 .292 1.384C2.165 6.935 2 7.46 2 8c0 2.123 2.628 4 6 4q.33 0 .657-.024a1 1 0 0 1 .147 1.994Q8.405 14 8 14c-4.36 0-8-2.6-8-6 0-.937.283-1.84.812-2.653a1 1 0 0 1 1.384-.292M16 8c0-3.4-3.64-6-8-6q-.405 0-.804.03a1 1 0 1 0 .147 1.994Q7.668 4 8 4c3.372 0 6 1.877 6 4 0 .539-.165 1.065-.488 1.561a1 1 0 1 0 1.676 1.092C15.718 9.84 16 8.937 16 8"},void 0,0,{fileName:Ze,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:Ze,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:Ze,lineNumber:11,columnNumber:5},this)}var tt="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Highlight.tsx";function nt(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"HighlightIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:tt,lineNumber:21,
|
||||
columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M13 1a1 1 0 0 0-1-1h-2l-.117.007a1 1 0 0 0-.75 1.493A1 1 0 0 0 9 2v6l.009.134a1 1 0 0 0 .125.365.996.996 0 0 0 .374 1.37A1 1 0 0 0 9.5 10v2l.006.114c.087.814 1.098 1.196 1.701.593l1-1 .087-.099A1 1 0 0 0 12.5 11l.001-1.134a1 1 0 0 0 .365-1.366A1 1 0 0 0 13 8V2l-.009-.134a1 1 0 0 0-.125-.365A1 1 0 0 0 13 1m0 14a1 1 0 0 0-1-1H1l-.117.007A1 1 0 0 0 1 16h11l.117-.007A1 1 0 0 0 13 15"},void 0,0,{fileName:tt,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:tt,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:tt,lineNumber:11,columnNumber:5},this)}var ot="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/MenuCollapse.tsx";function it(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","data-component":"MenuCollapseIcon",...e,children:Pe("path",{fill:"currentColor",
|
||||
d:"m8.54 4.205 6.23 5.87a.69.69 0 0 1 0 1.03l-.72.68a.8.8 0 0 1-1.09 0L8 7.135l-4.96 4.65a.8.8 0 0 1-1.09 0l-.73-.69a.69.69 0 0 1 0-1.02l6.24-5.87a.8.8 0 0 1 1.08 0"},void 0,0,{fileName:ot,lineNumber:18,columnNumber:7},this)},void 0,0,{fileName:ot,lineNumber:11,columnNumber:5},this)}var rt="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/MenuExpand.tsx";function st(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16","data-component":"MenuExpandIcon",...e,children:Pe("path",{fill:"currentColor",d:"M7.456 11.788 1.226 5.92a.695.695 0 0 1 0-1.025l.726-.684a.804.804 0 0 1 1.087-.001L8 8.861l4.961-4.65a.804.804 0 0 1 1.087.001l.727.684c.3.283.3.742 0 1.025l-6.23 5.867a.804.804 0 0 1-1.09 0z"},void 0,0,{fileName:rt,lineNumber:19,columnNumber:7},this)},void 0,0,{fileName:rt,lineNumber:11,columnNumber:5},this)}var at="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Note.tsx";function lt(e){return Pe("svg",{
|
||||
xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"NoteIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:at,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M14 0a2 2 0 0 1 1.995 1.85L16 2v7a1 1 0 0 1-.31.724l-.09.076-8 6a1 1 0 0 1-.471.192L7 16H2a2 2 0 0 1-1.995-1.85L0 14V2A2 2 0 0 1 1.85.005L2 0zm0 2H2v12h4V9a1 1 0 0 1 .883-.993L7 8h7zm-6 8h4l-4 3z"},void 0,0,{fileName:at,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:at,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:at,lineNumber:11,columnNumber:5},this)}var ct="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/PointerDown.tsx";function dt(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"9","data-component":"PointerDownIcon",...e,children:Pe("path",{stroke:"currentColor",d:"m15.5 0-7 8-8-8"},void 0,0,{fileName:ct,lineNumber:18,
|
||||
columnNumber:7},this)},void 0,0,{fileName:ct,lineNumber:11,columnNumber:5},this)}var ut="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/PointerUp.tsx";function ht(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"9","data-component":"PointerUpIcon",...e,children:Pe("path",{stroke:"currentColor",d:"m.5 9 7-8 8 8"},void 0,0,{fileName:ut,lineNumber:18,columnNumber:7},this)},void 0,0,{fileName:ut,lineNumber:11,columnNumber:5},this)}var ft="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Radio.tsx";function mt(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"RadioIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:ft,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8","clip-rule":"evenodd"},void 0,0,{
|
||||
fileName:ft,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:ft,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:ft,lineNumber:11,columnNumber:5},this)}var gt="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/RadioChecked.tsx";function pt(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"RadioCheckedIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:gt,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8","clip-rule":"evenodd"},void 0,0,{fileName:gt,lineNumber:22,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M14 8A6 6 0 1 1 2 8a6 6 0 0 1 12 0"},void 0,0,{fileName:gt,lineNumber:27,columnNumber:9},this)]},void 0,0,{fileName:gt,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:gt,lineNumber:11,columnNumber:5},this)}
|
||||
var _t="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Show.tsx";function bt(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"ShowIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:_t,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M8 2c4.36 0 8 2.6 8 6s-3.64 6-8 6-8-2.6-8-6 3.64-6 8-6m0 2C4.628 4 2 5.877 2 8s2.628 4 6 4 6-1.877 6-4-2.628-4-6-4m2 4a2 2 0 1 0-4 0 2 2 0 0 0 4 0"},void 0,0,{fileName:_t,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:_t,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:_t,lineNumber:11,columnNumber:5},this)}var vt="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Button.tsx";function wt({children:e,classes:t,elementRef:n,expanded:o,pressed:i,title:r,icon:s,size:a="md",variant:l="secondary",unstyled:c=!1,role:d,...u}){
|
||||
const h=!c,f=h&&"custom"!==l,m=h&&"custom"!==a,g={"aria-label":r};return"tab"===d?g["aria-selected"]=i:(g["aria-pressed"]=i,g["aria-expanded"]=o),Pe("button",{role:null!=d?d:"button","data-component":"Button",type:"button",...g,...u,className:Re({"focus-visible-ring transition-colors whitespace-nowrap flex items-center":h},f&&{"font-semibold rounded":!0,"text-grey-7 bg-grey-1 enabled:hover:text-grey-9 enabled:hover:bg-grey-2 aria-pressed:text-grey-9 aria-expanded:text-grey-9":"secondary"===l,"text-grey-1 bg-grey-7 enabled:hover:bg-grey-8 disabled:text-grey-4":"primary"===l},m&&{"p-2 gap-x-2":"md"===a,"p-1 gap-x-1":"xs"===a,"p-1.5 gap-x-1.5":"sm"===a,"p-2.5 gap-x-1.5":"lg"===a},t),ref:n,title:r,children:[s&&Pe(s,{className:"w-em h-em"},void 0,0,{fileName:vt,lineNumber:120,columnNumber:16},this),e]},void 0,0,{fileName:vt,lineNumber:89,columnNumber:5},this)}
|
||||
const yt=Re("input-group:border input-group:rounded-none","input-group:first:rounded-l input-group:last:rounded-r","input-group:ml-[-1px] input-group:first:ml-0","focus:z-1");var xt="/home/runner/work/frontend-shared/frontend-shared/src/components/input/IconButton.tsx";function Nt({children:e,classes:t,elementRef:n,pressed:o,expanded:i,icon:r,size:s="md",title:a,variant:l="secondary",unstyled:c=!1,...d}){const u=!c;return Pe(wt,{"data-component":"IconButton",...d,classes:Re({"focus-visible-ring transition-colors rounded whitespace-nowrap":u,"flex items-center justify-center":u},u&&yt,u&&"custom"!==l&&{"text-grey-7 bg-transparent enabled:hover:text-grey-9 aria-pressed:text-brand aria-expanded:text-brand":"secondary"===l,"text-brand bg-transparent enabled:hover:text-grey-9 disabled:text-grey-7":"primary"===l,"text-grey-7 bg-grey-2 enabled:hover:text-grey-9 enabled:hover:bg-grey-3 disabled:text-grey-5 aria-pressed:bg-grey-3 aria-expanded:bg-grey-3":"dark"===l},u&&"custom"!==s&&{
|
||||
"gap-x-2 touch:min-w-touch-minimum touch:min-h-touch-minimum":!0,"p-2":"md"===s,"p-1":"xs"===s,"p-1.5":"sm"===s,"p-2.5":"lg"===s},t),elementRef:n,title:a,pressed:o,expanded:i,unstyled:!0,children:[r&&Pe(r,{className:"w-em h-em"},void 0,0,{fileName:xt,lineNumber:84,columnNumber:16},this),e]},void 0,0,{fileName:xt,lineNumber:49,columnNumber:5},this)}var Ct="/home/runner/work/frontend-shared/frontend-shared/src/components/input/ToggleInput.tsx";function St({children:e,elementRef:t,containerRef:n,checked:o,icon:i,checkedIcon:r,disabled:s,onChange:a,id:l,type:c,containerClasses:d,...u}){const h=o?r:i;return Pe("label",{className:Re("relative flex items-center gap-x-1.5",{"cursor-pointer":!s,"opacity-70":s},d),htmlFor:l,"data-composite-component":"checkbox"===c?"Checkbox":"RadioButton",ref:n,children:[Pe("input",{...u,type:c,ref:t,className:Re("peer","absolute w-em h-em","opacity-[.00001]",{"cursor-pointer":!s}),checked:o,disabled:s,id:l,onChange:a},void 0,0,{fileName:Ct,lineNumber:66,columnNumber:7},this),Pe(h,{
|
||||
className:Re("peer-focus-visible:ring","w-em h-em")},void 0,0,{fileName:Ct,lineNumber:88,columnNumber:7},this),e]},void 0,0,{fileName:Ct,lineNumber:51,columnNumber:5},this)}var Et="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Checkbox.tsx";function At({checked:e,defaultChecked:t=!1,icon:n=Ye,checkedIcon:o=Je,onChange:i,...r}){const s="boolean"==typeof e,[a,l]=ne(t);return Pe(St,{icon:n,checkedIcon:o,type:"checkbox",checked:s?e:a,onChange:function(e){null==i||i.call(this,e),s||l(e.target.checked)},...r},void 0,0,{fileName:Et,lineNumber:65,columnNumber:5},this)}const Rt=U(null);var kt="/home/runner/work/frontend-shared/frontend-shared/src/components/input/RadioGroup.tsx";function Pt({value:e,children:t,subtitle:n,disabled:o}){const i=le(Rt);if(!i)throw new Error("RadioGroup.Radio can only be used as RadioGroup child");const{selected:r,disabled:s=o,onChange:a}=i,l=!s&&r===e;return Pe("div",{role:"radio","aria-checked":l,"aria-disabled":s,
|
||||
className:Re("focus-visible-ring rounded-lg px-3 py-2 flex-1 group",{"bg-grey-3/50":l,"hover:bg-grey-3/25":!l&&!s,"opacity-70":s,"cursor-pointer":!s}),"data-value":e,onClick:s?void 0:()=>a(e),onKeyDown:s?void 0:t=>{["Enter"," "].includes(t.key)&&(t.preventDefault(),a(e))},tabIndex:-1,children:[Pe("div",{className:"flex items-center gap-x-1.5",children:[l?Pe(pt,{},void 0,0,{fileName:kt,lineNumber:68,columnNumber:23},this):Pe(mt,{},void 0,0,{fileName:kt,lineNumber:68,columnNumber:46},this),t]},void 0,0,{fileName:kt,lineNumber:67,columnNumber:7},this),n&&Pe("div",{className:Re("pl-4 ml-1.5 mt-1 text-sm",{"text-grey-7":l,"text-grey-6 group-hover:text-grey-7":!l&&!s}),children:n},void 0,0,{fileName:kt,lineNumber:72,columnNumber:9},this)]},void 0,0,{fileName:kt,lineNumber:40,columnNumber:5},this)}Pt.displayName="RadioGroup.Radio",Object.assign((function({direction:e="horizontal",children:t,selected:n,onChange:o,disabled:i,"aria-label":r,"aria-labelledby":s,name:a}){const l=re(null);return we(l,{loop:!1,
|
||||
selector:'[role="radio"]:not([aria-disabled="true"])',focusElement:e=>{o(e.dataset.value),e.focus()}}),Pe(Rt.Provider,{value:{selected:n,disabled:i,onChange:o},children:[Pe("div",{"aria-label":r,"aria-labelledby":s,ref:l,role:"radiogroup",className:Re("w-full flex gap-1.5",{"flex-col":"vertical"===e}),children:t},void 0,0,{fileName:kt,lineNumber:134,columnNumber:7},this),a&&Pe("input",{type:"hidden","data-testid":"hidden-input",name:a,value:n,disabled:i},void 0,0,{fileName:kt,lineNumber:146,columnNumber:9},this)]},void 0,0,{fileName:kt,lineNumber:131,columnNumber:5},this)}),{Radio:Pt,displayName:"RadioGroup"});var Tt="/home/runner/work/frontend-shared/frontend-shared/src/components/feedback/Popover.tsx";const Mt=".15rem",Lt=8;function Ot(e,t,n,o,i){oe((()=>{if(!i)return()=>{};const t=e.current,o=e=>{"open"===e.oldState&&"closed"===e.newState&&n()};return t.addEventListener("toggle",o),()=>t.removeEventListener("toggle",o)}),[i,n,e]);const r=o&&!i;!function(e,t,{enabled:n=!0}={}){oe((()=>{if(!n)return()=>{}
|
||||
;const o=document.body,i=new be,r=n=>{e.current&&!n.composedPath().includes(e.current)&&t(n)};return i.add(o,"mousedown",r),i.add(o,"click",r),()=>{i.removeAll()}}),[e,n,t])}(e,(e=>{e.composedPath().includes(t.current)||n()}),{enabled:r}),function(e,t,{enabled:n=!0}={}){oe((()=>{if(!n)return()=>{};const o=document.body,i=new be;return i.add(o,"keydown",(n=>{e.includes(n.key)&&t(n)})),()=>{i.removeAll()}}),[n,t,e])}(["Escape"],n,{enabled:r})}function It({anchorElementRef:e,children:t,open:n,onClose:o,align:i="left",classes:r,variant:s="panel",restoreFocusOnClose:a=!0,onScroll:l,asNativePopover:c=HTMLElement.prototype.hasOwnProperty("popover")}){const d=re(null);return function(e,t,n,o,i){const r=ae((()=>{const n=t.current,r=e.current,s=e=>{Object.assign(n.style,e);const t=Object.keys(e);return()=>t.map((e=>n.style[e]=""))},a=window.innerHeight,{top:l,bottom:c,left:d,height:u,width:h}=r.getBoundingClientRect(),f=a-c,{height:m,width:g}=n.getBoundingClientRect(),p=f<m&&l>f;if(!o)return s(p?{bottom:"100%",
|
||||
marginBottom:Mt}:{top:"100%",marginTop:Mt});const{top:_,width:b}=document.body.getBoundingClientRect(),v=Math.abs(_),w=(i?d+h:b-d)-Lt;let y=d;return g>w?y=i?Lt:y-(g-w):i&&g>h&&(y-=g-h),s({minWidth:`${h}px`,top:p?`calc(${v+l-m}px - ${Mt})`:`calc(${v+l+u}px + ${Mt})`,left:`${Math.max(Lt,y)}px`})}),[o,e,t,i]);ie((()=>{if(!n)return()=>{};const e=t.current;o&&e.togglePopover(!0);const i=r();if(!o)return i;const s=new be;s.add(document.body,"scroll",r,{capture:!0});const a=new ResizeObserver(r);return a.observe(e),()=>{o&&(null==e||e.togglePopover(!1)),i(),s.removeAll(),a.disconnect()}}),[r,o,n,t])}(e,d,n,c,"right"===i),Ot(d,e,o,n,c),ie((()=>{const e=n?document.activeElement:null;return()=>{a&&e&&e.focus()}}),[n,a]),Pe("div",{className:Re("absolute z-5","panel"===s&&["max-h-80 overflow-y-auto overflow-x-hidden","rounded border bg-white shadow hover:shadow-md focus-within:shadow-md"],c&&["max-w-[calc(100%-16px)]","p-0 m-0"],!c&&{hidden:!n,"right-0":"right"===i,"min-w-full":!0},r),ref:d,popover:c&&"auto",onScroll:l,
|
||||
"data-testid":"popover","data-component":"Popover",children:n&&t},void 0,0,{fileName:Tt,lineNumber:302,columnNumber:5},this)}const Bt=U(null);var Ht="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Select.tsx";function Ft(e,t){return"function"==typeof e?e(t):e}function Dt({value:e,children:t,disabled:n=!1,classes:o,elementRef:i,title:r}){const s=re(null),a=re(null),l=Ne(i),c=e=>e.target===s.current||e.target===a.current,d=le(Bt);if(!d)throw new Error("Select.Option can only be used as Select or MultiSelect child");const{selectValue:u,value:h,multiple:f}=d,m=se((()=>!n&&(f?h.includes(e)||0===h.length&&void 0===e:h===e)),[h,n,f,e]),g=ae((()=>{const t={closeListbox:!0};u(f?void 0!==e?[e]:[]:e,t)}),[f,u,e]),p=ae((()=>{if(!f)return;const t={closeListbox:void 0===e};if(void 0===e)return void u([],t);const n=h.indexOf(e);if(-1===n)u([...h,e],t);else{const e=[...h];e.splice(n,1),u(e,t)}}),[h,f,u,e]);return Pe("li",{
|
||||
className:Re("w-full ring-inset outline-none rounded-none select-none","px-1 mb-1 first:mt-1 whitespace-nowrap group",{"text-grey-4":n,"cursor-pointer":!n},o),onClick:e=>{n||c(e)||g()},onKeyDown:e=>{n||(["Enter"," "].includes(e.key)&&!c(e)?(e.preventDefault(),g()):s.current&&"ArrowRight"===e.key&&(e.preventDefault(),s.current.focus()))},role:"option","aria-disabled":n,"aria-selected":m,tabIndex:m?0:-1,ref:l,title:r,children:Pe("div",{className:Re("flex justify-between items-center","w-full rounded",{"hover:bg-grey-1 group-focus-visible:ring":!n,"bg-grey-1 hover:bg-grey-2":m}),children:[Pe("div",{className:Re("py-2 pl-3",{truncate:"truncate"===d.listboxOverflow,"whitespace-normal":"wrap"===d.listboxOverflow}),children:Ft(t,{selected:m,disabled:n})},void 0,0,{fileName:Ht,lineNumber:203,columnNumber:9},this),!f&&Pe("div",{className:"px-3",children:Pe(Ke,{className:Re("text-grey-6 scale-125",{"opacity-0":!m})},void 0,0,{fileName:Ht,lineNumber:213,columnNumber:13},this)},void 0,0,{fileName:Ht,lineNumber:212,
|
||||
columnNumber:11},this),f&&Pe(At,{containerClasses:Re("self-stretch px-3","text-lg",{"text-grey-6":m,"text-grey-3 hover:text-grey-6":!m}),checked:m,checkedIcon:Je,elementRef:s,containerRef:a,onChange:p,onKeyDown:e=>{var t;"ArrowLeft"===e.key&&(e.preventDefault(),null===(t=l.current)||void 0===t||t.focus())}},void 0,0,{fileName:Ht,lineNumber:224,columnNumber:11},this)]},void 0,0,{fileName:Ht,lineNumber:193,columnNumber:7},this)},void 0,0,{fileName:Ht,lineNumber:146,columnNumber:5},this)}function Vt({buttonContent:e,value:t,onChange:n,children:o,disabled:i,elementRef:r,buttonId:s,buttonClasses:a,popoverClasses:l,containerClasses:c,onPopoverScroll:d,alignListbox:u="left",multiple:h,listboxOverflow:f="truncate","aria-label":m,"aria-labelledby":g,listboxAsPopover:p}){const _=re(null),b=re(null),[v,w]=ne(!1),y=ae((()=>w(!1)),[w]),x=ce(),N=Ne(r),C=ce(),S=ae(((e,t)=>{n(e),t.closeListbox&&y()}),[n,y]);return function(e,t,{enabled:n=!0}={}){oe((()=>{if(!n||!e.current)return()=>{};const o=new be
|
||||
;return o.add(e.current,"focusout",(n=>{const o=n;e.current&&!e.current.contains(o.relatedTarget)&&t(o)})),()=>{o.removeAll()}}),[e,n,t])}(_,y),we(b,{horizontal:!1,loop:!1,autofocus:!0,containerVisible:v,selector:'[role="option"]:not([aria-disabled="true"])'}),Pe("div",{className:Re("relative w-full border rounded",{"border-grey-5":v},yt,c),ref:_,children:[Pe("button",{id:null!=s?s:C,className:Re("focus-visible-ring transition-colors whitespace-nowrap","w-full flex items-center justify-between gap-x-2","bg-grey-0 disabled:bg-grey-1 disabled:text-grey-6","text-left","rounded-[inherit]",a),type:"button",role:"combobox",disabled:i,"aria-expanded":v,"aria-haspopup":"listbox","aria-controls":x,"aria-label":m,"aria-labelledby":g,ref:N,onClick:()=>w((e=>!e)),onKeyDown:e=>{"ArrowDown"!==e.key||v||(e.preventDefault(),w(!0))},"data-testid":"select-toggle-button",children:[Pe("div",{className:"pl-2 py-2 truncate grow",children:e},void 0,0,{fileName:Ht,lineNumber:429,columnNumber:9},this),Pe("div",{
|
||||
className:"pr-2 py-2 text-grey-6",children:v?Pe(it,{},void 0,0,{fileName:Ht,lineNumber:431,columnNumber:26},this):Pe(st,{},void 0,0,{fileName:Ht,lineNumber:431,columnNumber:49},this)},void 0,0,{fileName:Ht,lineNumber:430,columnNumber:9},this)]},void 0,0,{fileName:Ht,lineNumber:396,columnNumber:7},this),Pe(Bt.Provider,{value:{value:t,selectValue:S,multiple:h,listboxOverflow:f},children:Pe(It,{anchorElementRef:_,open:v,onClose:y,asNativePopover:p,align:u,classes:l,onScroll:d,children:Pe("ul",{role:"listbox",id:x,ref:b,"aria-multiselectable":h,"aria-labelledby":null!=s?s:C,"aria-orientation":"vertical",children:o},void 0,0,{fileName:Ht,lineNumber:453,columnNumber:11},this)},void 0,0,{fileName:Ht,lineNumber:444,columnNumber:9},this)},void 0,0,{fileName:Ht,lineNumber:435,columnNumber:7},this)]},void 0,0,{fileName:Ht,lineNumber:387,columnNumber:5},this)}Dt.displayName="Select.Option",Object.assign((function(e){return Vt({...e,multiple:!1})}),{Option:Dt,displayName:"Select"}),Object.assign((function(e){return Vt({
|
||||
...e,multiple:!0})}),{Option:Dt,displayName:"MultiSelect"}),U({}),U(null);var Ut="/home/runner/work/frontend-shared/frontend-shared/src/components/feedback/Callout.tsx";function qt({children:e,classes:t,elementRef:n,icon:o,status:i="notice",size:r="md",variant:s="outlined",unstyled:a=!1,...l}){const c=!a,d=c&&"custom"!==s,u=c&&"custom"!==r;let h=o;if(!h)switch(i){case"success":h=Ke;break;case"error":h=Fe;break;default:h=je}const f=d&&u;return Pe("div",{"data-component":"Callout",...l,ref:n,className:Re(c&&"flex items-center border",d&&{"rounded border":!0,"shadow hover:shadow-md cursor-pointer":"raised"===s,"border-yellow-notice":"notice"===i,"border-green-success":"success"===i,"border-red-error":"error"===i},d&&{"bg-yellow-notice":"notice"===i&&f,"bg-green-success":"success"===i&&f,"bg-red-error":"error"===i&&f,"bg-white":!f},t),children:[f&&Pe("div",{className:Re({"p-2":"md"===r,"p-1.5":"sm"===r,"p-3":"lg"===r}),children:Pe(h,{"data-testid":"callout-icon",className:Re("text-white",{
|
||||
"w-[1.25em] h-[1.25em]":"md"===r,"w-[0.85em] h-[0.85em]":"sm"===r,"w-[1.5em] h-[1.5em]":"lg"===r})},void 0,0,{fileName:Ut,lineNumber:95,columnNumber:11},this)},void 0,0,{fileName:Ut,lineNumber:88,columnNumber:9},this),Pe("div",{className:Re(u&&{"p-2":"md"===r,"py-1.5 px-2":"sm"===r,"p-3":"lg"===r},c&&"grow",d&&"bg-white rounded-r"),children:e},void 0,0,{fileName:Ut,lineNumber:105,columnNumber:7},this)]},void 0,0,{fileName:Ut,lineNumber:64,columnNumber:5},this)}var $t="/home/runner/work/frontend-shared/frontend-shared/src/components/feedback/ToastMessages.tsx";function zt({message:e,onDismiss:t}){return Pe(qt,{classes:Re({"sr-only":e.visuallyHidden}),status:e.type,onClick:()=>t(e.id),variant:"raised",children:e.message},void 0,0,{fileName:$t,lineNumber:55,columnNumber:5},this)}const Wt=({direction:e,onTransitionEnd:t,children:n,transitionClasses:o={}})=>{const i="out"===e,r=re(null),s=se((()=>{const{transitionIn:e="animate-fade-in",transitionOut:t="animate-fade-out"}=o;return{[e]:!i,[t]:i}}),[i,o])
|
||||
;return Pe("div",{"data-testid":"animation-container",onAnimationEnd:n=>{n.target===r.current&&(null==t||t(null!=e?e:"in"))},ref:r,className:Re("relative w-full container",s),children:n},void 0,0,{fileName:$t,lineNumber:103,columnNumber:5},void 0)};function jt({messages:e,onMessageDismiss:t,transitionClasses:n,setTimeout_:o=setTimeout}){const[i,r]=ne([]),s=re(new Map),a=ae((e=>r((t=>[...t,e]))),[]),l=ae((e=>{const t=o((()=>{a(e),s.current.delete(e)}),5e3);s.current.set(e,t)}),[a,o]),c=ae(((e,n)=>{var o;const i=null===(o=n.autoDismiss)||void 0===o||o;"in"===e&&i&&l(n.id),"out"===e&&(t(n.id),r((e=>e.filter((e=>e!==n.id)))))}),[l,t]);return ie((()=>{const e=s.current;return()=>{e.forEach((e=>clearTimeout(e)))}}),[]),Pe("ul",{"aria-live":"polite","aria-relevant":"additions",className:"w-full space-y-2","data-component":"ToastMessages",children:e.map((e=>{const t=i.includes(e.id);return Pe("li",{className:Re({"mb-2":!e.visuallyHidden}),children:Pe(Wt,{direction:t?"out":"in",onTransitionEnd:t=>c(t,e),
|
||||
transitionClasses:n,children:Pe(zt,{message:e,onDismiss:a},void 0,0,{fileName:$t,lineNumber:206,columnNumber:15},this)},void 0,0,{fileName:$t,lineNumber:201,columnNumber:13},this)},e.id,0,{fileName:$t,lineNumber:189,columnNumber:11},this)}))},void 0,0,{fileName:$t,lineNumber:180,columnNumber:5},this)}var Xt="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/Link.tsx";function Kt({children:e,classes:t,elementRef:n,underline:o="none",unstyled:i=!1,variant:r="brand",...s}){const a=!i;return Pe("a",{"data-component":"Link",rel:"noopener noreferrer",...s,className:Re(a&&{"focus-visible-ring rounded":!0,"no-underline hover:no-underline":"none"===o,"underline hover:underline":"always"===o,"no-underline hover:underline":"hover"===o},a&&"custom"!==r&&{"text-brand hover:text-brand-dark":"brand"===r,"text-color-text-light hover:text-brand":"text-light"===r,"text-color-text hover:text-brand-dark":"text"===r},t),ref:n,children:e},void 0,0,{fileName:Xt,lineNumber:37,columnNumber:5},this)}
|
||||
var Gt="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/PointerButton.tsx";function Yt({children:e,classes:t,elementRef:n,expanded:o,pressed:i,title:r,direction:s,...a}){return Pe(wt,{"data-component":"PointerButton",...a,elementRef:n,classes:Re("relative w-[26px] h-[16px]","flex items-center justify-center","bg-white rounded-[4px] border","before:absolute before:border-transparent","after:absolute after:border-transparent","text-[10px] text-color-text-light leading-none font-semibold",{"shadow-[1px_1px_1px_rgba(0,0,0,0.1)]":"down"!==s,"shadow-[1px_0px_1px_rgba(0,0,0,0.1)]":"down"===s},{"rounded-r-[4px] rounded-l-[2px]":"left"===s,"before:right-full before:top-1/2 after:right-full after:top-1/2":"left"===s,"before:mt-[-8px] before:border-8 before:border-r-[5px] before:border-r-grey-3":"left"===s,"after:mt-[-7px] after:border-[7px] after:border-r-[4px] after:border-r-white":"left"===s},{"z-1 rounded-t-px-sm rounded-b-px":"up"===s,
|
||||
"before:top-auto before:left-1/2 before:bottom-full after:top-auto after:left-1/2 after:bottom-full":"up"===s,"before:ml-[-13px] before:border-[13px] before:border-b-[6px] before:border-b-grey-3":"up"===s,"after:ml-[-12px] after:border-[12px] after:border-b-[5px] after:border-b-white":"up"===s},{"z-1 rounded-t-px rounded-b-px-sm":"down"===s,"before:top-full before:left-1/2 after:top-full after:left-1/2":"down"===s,"before:ml-[-13px] before:border-[13px] before:border-t-[6px] before:border-t-grey-3":"down"===s,"after:ml-[-12px] after:border-[12px] after:border-t-[5px] after:border-t-white":"down"===s},t),expanded:o,pressed:i,title:r,variant:"custom",size:"custom",children:e},void 0,0,{fileName:Gt,lineNumber:48,columnNumber:5},this)}function Qt(e){const t=e.toString(16);return 1===t.length?"0"+t:t}function Jt(e){const t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t).map(Qt).join("")}function Zt(e){if(null===e||"object"!=typeof e)return!1
|
||||
;for(const t of["frame1","frame2","type","requestId"])if("string"!=typeof e[t])return!1;return!0}class en extends Error{constructor(e){super(e)}}class tn{constructor({hostFrame:e,source:t,sourceId:n}){this._hostFrame=e,this._source=t,this._sourceId=n,this._listeners=new be}destroy(){this._listeners.removeAll()}async discover(e){const t=Jt(6);return new Promise(((n,o)=>{const i=()=>{this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request",requestId:t,sourceId:this._sourceId},"*")},r=setInterval(i,250),s=setTimeout((()=>{clearInterval(r),o(new en(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),a=this._listeners.add(window,"message",(i=>{const{data:l,ports:c}=i;Zt(l)&&l.requestId===t&&"request"!==l.type&&(clearInterval(r),clearTimeout(s),this._listeners.remove(a),"string"==typeof l.error?o(new en(l.error)):c.length>0?n(c[0]):o(new en(`${this._source}-${e} port request failed`)))}));i()}))}}var nn,on={exports:{}};var rn=function(){if(nn)return on.exports;function e(){}
|
||||
return nn=1,e.prototype={on:function(e,t,n){var o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var o=this;function i(){o.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),o=0,i=n.length;o<i;o++)n[o].fn.apply(n[o].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),o=n[e],i=[];if(o&&t)for(var r=0,s=o.length;r<s;r++)o[r].fn!==t&&o[r].fn._!==t&&i.push(o[r]);return i.length?n[e]=i:delete n[e],this}},on.exports=e,on.exports.TinyEmitter=e,on.exports}();let sn=null;function an(e){return e instanceof Error?{message:e.message,stack:e.stack}:{message:String(e),stack:void 0}}function ln(e,t){if(!sn)return;const n={type:"hypothesis-error",error:e instanceof Error?e:an(e),context:t};try{try{sn.postMessage(n,"*")}catch(e){if(!(e instanceof DOMException&&"DataCloneError"===e.name))throw e;n.error=an(n.error),sn.postMessage(n,"*")}}catch(e){
|
||||
console.warn("Unable to report Hypothesis error",e)}}function cn(e){sn=e}class dn{constructor(e){this._hypothesisAppsOrigin=e,this._emitter=new rn.TinyEmitter,this._handledRequests=new Set,this._sidebarHostChannel=new MessageChannel,this._sidebarConnected=!1,this._listeners=new be,this._allowedMessages=[{allowedOrigin:"*",frame1:"guest",frame2:"host",type:"request"},{allowedOrigin:"*",frame1:"guest",frame2:"sidebar",type:"request"},{allowedOrigin:this._hypothesisAppsOrigin,frame1:"sidebar",frame2:"host",type:"request"},{allowedOrigin:this._hypothesisAppsOrigin,frame1:"notebook",frame2:"sidebar",type:"request"}],this._listen()}_listen(){const e="Handling port request",t=new Set,n=n=>{t.has(n)||(t.add(n),ln(new Error(n),e))};var o,i;this._listeners.add(window,"message",(o=e=>{const{data:t,origin:o,source:i}=e;if(!i)return;if(!Zt(t)||"request"!==t.type)return;const{frame1:r,frame2:s,requestId:a,sourceId:l}=t,c=`${r}-${s}`;if(!function(e){
|
||||
return!(null===e||e instanceof MessagePort||window.ServiceWorker&&e instanceof ServiceWorker)}(i))return void n(`Ignored port request for channel ${c} from non-Window source`);if(void 0===this._allowedMessages.find((({allowedOrigin:e,...n})=>this._messageMatches({allowedMessage:n,allowedOrigin:e,data:t,origin:o}))))return void n(`Ignored invalid port request for channel ${c} from ${o}`);if(this._handledRequests.has(a))return;this._handledRequests.add(a);const d="null"===o?"*":o,u="sidebar-host"===c?this._sidebarHostChannel:new MessageChannel,h={frame1:r,frame2:s,type:"offer",requestId:a,sourceId:l};if(u===this._sidebarHostChannel){if(this._sidebarConnected)return console.warn("Ignoring second request from Hypothesis sidebar to connect to host frame"),h.error="Received duplicate port request",void i.postMessage(h,d);this._sidebarConnected=!0}i.postMessage(h,d,[u.port1]),"sidebar"===s?this._sidebarHostChannel.port2.postMessage(h,[u.port2]):"host"===s&&this._emitter.emit("frameConnected",r,u.port2)},i=e,
|
||||
(...e)=>{try{return o(...e)}catch(e){throw ln(e,i),e}}))}_messageMatches({allowedMessage:e,allowedOrigin:t,data:n,origin:o}){return("*"===t||o===t)&&function(e,t){return!!Zt(e)&&JSON.stringify(e,Object.keys(t).sort())===JSON.stringify(t,Object.keys(t).sort())}(n,e)}on(e,t){this._emitter.on(e,t)}destroy(){this._listeners.removeAll()}}const un="1.0.0",hn="frame-rpc";function fn(e,t=[],n=-1){return{protocol:hn,version:un,arguments:t,method:e,sequence:n}}function mn(e,t,n=[],o=-1){e.postMessage(fn(t,n,o))}function gn(e){const t=e.match(/\bAppleWebKit\/([0-9]+)\b/);if(!t)return!1;if(parseInt(t[1])<=537)return!1;const n=e.match(/\bVersion\/([0-9]+)\b/);if(!n)return!1;return!(parseInt(n[1])>=16)}class pn{constructor({userAgent:e=navigator.userAgent,currentWindow:t=window,forceUnloadListener:n=!1}={}){this._port=null,this._methods=new Map,this._sequence=1,this._callbacks=new Map,this._listeners=new be,"onclose"in MessagePort.prototype&&!n||this._listeners.add(t,"unload",(n=>{
|
||||
n instanceof CustomEvent||this._port&&(mn(this._port,"close"),t!==t.parent&&gn(e)&&t.parent.postMessage({type:"hypothesisPortClosed"},"*",[this._port]))})),this._pendingCalls=[],this._destroyed=!1,this._receivedCloseEvent=!1}on(e,t){if(this._port)throw new Error("Cannot add a method handler after a port is connected");this._methods.set(e,t)}connect(e){this._port=e,this._listeners.add(e,"message",(e=>this._handle(e))),this._listeners.add(e,"close",(()=>{e.dispatchEvent(new MessageEvent("message",{data:fn("close")}))})),e.start(),mn(e,"connect");for(const[e,t]of this._pendingCalls)this.call(e,...t);this._pendingCalls=[]}destroy(){this._port&&(mn(this._port,"close"),this._port.close()),this._destroyed=!0,this._listeners.removeAll()}call(e,...t){if(this._port||this._pendingCalls.push([e,t]),!this._port||this._destroyed)return;const n=this._sequence++,o=t[t.length-1];"function"==typeof o&&(this._callbacks.set(n,o),t=t.slice(0,-1)),mn(this._port,e,t,n)}_parseMessage({data:e}){
|
||||
return e&&"object"==typeof e?e.protocol!==hn||e.version!==un?null:Array.isArray(e.arguments)?e:null:null}_handle(e){const t=this._parseMessage(e),n=this._port;if(t&&n)if("method"in t){if("close"===t.method){if(this._receivedCloseEvent)return;this._receivedCloseEvent=!0}const e=this._methods.get(t.method);if(!e)return;const o=(...e)=>{const o={arguments:e,protocol:hn,response:t.sequence,version:un};n.postMessage(o)};e(...t.arguments,o)}else if("response"in t){const e=this._callbacks.get(t.response);this._callbacks.delete(t.response),e&&e(...t.arguments)}}}function _n(e){if("string"==typeof e&&"false"===e.trim().toLocaleLowerCase())return!1;const t=Number(e);return isNaN(t)?"string"==typeof e:Boolean(t)}function bn(e){for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),o=0;o<n.length;o++){var i=void 0;try{i=JSON.parse(n[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}Object.assign(t,i)}return t}function vn(e,t){
|
||||
return Object.prototype.hasOwnProperty.call(e,t)}function wn(e){return e.width<=0||e.height<=0}function yn(e,t,n,o){return Math.max(e,n)<Math.min(t,o)}function xn(e,t){return!wn(e)&&!wn(t)&&(yn(e.left,e.right,t.left,t.right)&&yn(e.top,e.bottom,t.top,t.bottom))}function Nn(e,t){return yn(e.top,e.bottom,t.top,t.bottom)}function Cn(e,t){return yn(e.left,e.right,t.left,t.right)}function Sn(e,t){if(wn(e))return t;if(wn(t))return e;const n=Math.min(e.left,t.left),o=Math.min(e.top,t.top),i=Math.max(e.right,t.right),r=Math.max(e.bottom,t.bottom);return new DOMRect(n,o,i-n,r-o)}function En(e){return new DOMPoint((e.left+e.right)/2,(e.top+e.bottom)/2)}function An(e){return e.nodeType===Node.ELEMENT_NODE}function Rn(e){return e.nodeType===Node.TEXT_NODE}const kn=["p",".para"];let Pn;function Tn(e,t=0,n=e.data.length){return Pn||(Pn=document.createRange()),Pn.setStart(e,t),Pn.setEnd(e,n),Pn.getBoundingClientRect()}function Mn(e){const t=e.getBoundingClientRect();return t.x-=e.scrollLeft,t.y-=e.scrollTop,
|
||||
t.height=Math.max(t.height,e.scrollHeight),t.width=Math.max(t.width,e.scrollWidth),t}function*Ln(e,t,n){let o=e.firstChild;for(;o;){if(An(o)){const e=xn(Mn(o),t);n(o)&&e&&(yield*Ln(o,t,n))}else Rn(o)&&xn(Tn(o),t)&&(yield o);o=o.nextSibling}}function On(e,t){let n=null;const o=e=>!function(e){switch(getComputedStyle(e).position){case"fixed":case"sticky":return!0;default:return!1}}(e);e:for(const s of Ln(e,t,o)){let e=0;for(const o of s.data.split(/\b/)){if(/\S/.test(o)){const a=e,l=e+o.length,c=Tn(s,a,l);if(r=c,!wn(i=t)&&!wn(r)&&r.left>=i.left&&r.right<=i.right&&r.top>=i.top&&r.bottom<=i.bottom){n=document.createRange(),n.setStart(s,a),n.setEnd(s,l);break e}}e+=o.length}}var i,r;return n}function In(e,t=document.documentElement,n=new DOMRect(0,0,window.innerWidth,window.innerHeight)){const o=On(t,n);if(!o)return e(),0;const i=o.getBoundingClientRect().top;e();const r=o.getBoundingClientRect().top-i;return t.scrollTop+=r,r}function Bn(e,t,n){
|
||||
const o=e.document.querySelector(`link[type="application/annotator+${n}"][rel="${t}"]`);if(!o)throw new Error(`No application/annotator+${n} (rel="${t}") link in the document`);if(!o.href)throw new Error(`application/annotator+${n} (rel="${t}") link has no href`);return o.href}function Hn(e){return"string"==typeof e?e:null}function Fn(e){const t=function(e){if(!vn(e,"hypothesisConfig"))return{};if("function"!=typeof e.hypothesisConfig){const e="https://h.readthedocs.io/projects/client/en/latest/publishers/config/#window.hypothesisConfig";return console.warn("hypothesisConfig must be a function, see: "+e),{}}return e.hypothesisConfig()}(e),n=_n(t.ignoreOtherConfiguration)?{}:bn(e.document);function o(e){return vn(t,e)?t[e]:vn(n,e)?n[e]:void 0}return{get annotations(){return Hn(n.annotations)||function(){const t=e.location.href.match(/#annotations:([A-Za-z0-9_-]+)$/);return t?t[1]:null}()},get clientUrl(){return Bn(e,"hypothesis-client","javascript")},get group(){return Hn(n.group)||function(){
|
||||
const t=e.location.href.match(/#annotations:group:([A-Za-z0-9_-]+)$/);return t?t[1]:null}()},get notebookAppUrl(){return Bn(e,"notebook","html")},get profileAppUrl(){return Bn(e,"profile","html")},get showHighlights(){return function(){const e=o("showHighlights");switch(e){case"always":case"never":case"whenSidebarOpen":return e;case!0:return"always";case!1:return"never";default:return"always"}}()},get sidebarAppUrl(){return Bn(e,"sidebar","html")},get query(){return Hn(n.query)||function(){const t=e.location.href.match(/#annotations:(query|q):(.+)$/i);if(t)try{return decodeURIComponent(t[2])}catch{}return null}()},get sideBySide(){return function(){const e=o("sideBySide");if(!function(e){return null!==e&&"object"==typeof e}(e))return{mode:"auto"};const t="mode"in e&&function(e){return"string"==typeof e&&["auto","manual"].includes(e)}(e.mode)?e.mode:"auto";return"auto"===t?{mode:t}:{mode:t,isActive:"isActive"in e&&"function"==typeof e.isActive?e.isActive:void 0}}()},hostPageSetting:o}}
|
||||
const Dn=(e,t)=>e.hostPageSetting(t),Vn={annotations:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.annotations},appType:{allowInBrowserExt:!0,defaultValue:null,getValue:Dn},branding:{defaultValue:null,allowInBrowserExt:!1,getValue:Dn},bucketContainerSelector:{defaultValue:null,allowInBrowserExt:!1,getValue:Dn},clientUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.clientUrl},contentInfoBanner:{allowInBrowserExt:!1,defaultValue:null,getValue:Dn},contentReady:{allowInBrowserExt:!0,defaultValue:null,getValue:Dn},enableExperimentalNewNoteButton:{allowInBrowserExt:!1,defaultValue:null,getValue:Dn},group:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.group},focus:{allowInBrowserExt:!1,defaultValue:null,getValue:Dn},theme:{allowInBrowserExt:!1,defaultValue:null,getValue:Dn},usernameUrl:{allowInBrowserExt:!1,defaultValue:null,getValue:Dn},onLayoutChange:{allowInBrowserExt:!1,defaultValue:null,getValue:Dn},openSidebar:{allowInBrowserExt:!0,defaultValue:!1,coerce:_n,getValue:Dn},query:{
|
||||
allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.query},requestConfigFromFrame:{allowInBrowserExt:!1,defaultValue:null,getValue:Dn},services:{allowInBrowserExt:!1,defaultValue:null,getValue:Dn},showHighlights:{allowInBrowserExt:!1,defaultValue:"always",getValue:e=>e.showHighlights},notebookAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.notebookAppUrl},profileAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.profileAppUrl},sidebarAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.sidebarAppUrl},subFrameIdentifier:{allowInBrowserExt:!0,defaultValue:null,getValue:Dn},externalContainerSelector:{allowInBrowserExt:!1,defaultValue:null,getValue:Dn},sideBySide:{allowInBrowserExt:!0,getValue:e=>e.sideBySide}};function Un(e,t=window){const n=Fn(t),o={};for(const r of function(e){const t={annotator:["clientUrl","contentInfoBanner","contentReady","subFrameIdentifier","sideBySide"],
|
||||
sidebar:["appType","annotations","branding","bucketContainerSelector","enableExperimentalNewNoteButton","externalContainerSelector","focus","group","onLayoutChange","openSidebar","query","requestConfigFromFrame","services","showHighlights","sidebarAppUrl","theme","usernameUrl"],notebook:["branding","group","notebookAppUrl","requestConfigFromFrame","services","theme","usernameUrl"],profile:["profileAppUrl"]};return"all"===e?Object.values(t).flat():t[e]}(e)){const e=Vn[r],s=void 0!==e.defaultValue,a=!((i=Bn(t,"sidebar","html")).startsWith("http://")||i.startsWith("https://"));if(!e.allowInBrowserExt&&a){s&&(o[r]=e.defaultValue);continue}const l=e.getValue(n,r);void 0!==l?o[r]=e.coerce?e.coerce(l):l:s&&(o[r]=e.defaultValue)}var i;return o}const qn={alt:1,ctrl:2,meta:4,shift:8};function $n(e,t){if(!(e instanceof KeyboardEvent))return!1;const n=t.split("+").map((e=>e.toLowerCase()));let o=0,i=null;for(const e of n){const t=qn[e];if(t)o|=t;else{if(null!==i)throw new Error("Multiple non-modifier keys specified");i=e
|
||||
}}if(!i)throw new Error(`Invalid shortcut: ${t}`);return((e.ctrlKey?qn.ctrl:0)|(e.metaKey?qn.meta:0)|(e.altKey?qn.alt:0)|(e.shiftKey?qn.shift:0))===o&&e.key.toLowerCase()===i}function zn(e,t,{rootElement:n}={}){oe((()=>{if(e)return function(e,t,{rootElement:n=document.documentElement??void 0}={}){const o=n=>{$n(n,e)&&t(n)};return n?(n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)):()=>{}}(e,t,{rootElement:n})}),[e,t,n])}const Wn=(e=window)=>e.matchMedia("(pointer: coarse)").matches;function jn({badgeCount:e}){return Pe("span",{className:Re("rounded px-1 py-0.5","bg-current"),children:Pe("span",{className:"font-bold text-color-text-inverted",children:e})})}function Xn({arrowDirection:e}){return Pe("div",{className:Re("absolute left-1/2 -translate-x-1/2 z-2","fill-white text-grey-3",{"top-0 -translate-y-full":"up"===e}),children:Pe("up"===e?ht:dt,{})})}function Kn({badgeCount:e,icon:t,label:n,onClick:o,shortcut:i}){zn(i,o);const r=i?`${n} (${i})`:n;return Pe(wt,{
|
||||
classes:Re("text-grey-7","group-hover:text-grey-5","hover:group-hover:text-grey-9"),onClick:o,title:r,size:"custom",variant:"custom",children:Pe("div",{className:Re("flex flex-col items-center gap-y-1 py-2.5 px-2","text-annotator-sm leading-none"),children:[t&&Pe(t,{className:"text-annotator-lg",title:r}),"number"==typeof e&&Pe(jn,{badgeCount:e}),Pe("span",{"data-testid":"adder-button-label",children:n})]})})}function Gn({annotationCount:e,isVisible:t}){return Pe("div",{className:"sr-only",children:[Pe("span",{"aria-live":"polite","aria-atomic":"true",role:"status","data-testid":"annotation-count-announce",children:e>0&&Pe("span",{children:[e," ",1===e?"annotation":"annotations"," for this selection."]})}),Pe("ul",{"aria-live":"polite","data-testid":"annotate-shortcuts-announce",children:t&&Pe(x,{children:[e>0&&Pe("li",{children:["Press ","'S'"," to show annotations."]}),Pe("li",{children:["Press ","'A'"," to annotate."]}),Pe("li",{children:["Press ","'H'"," to highlight."]})]})})]})}
|
||||
function Yn({arrowDirection:e,isVisible:t,onCommand:n,annotationCount:o=0}){const i=t?"a":null,r=t?"h":null,s=t?"s":null;return zn(t?"Escape":null,(()=>n("hide"))),Pe("div",{className:Re("all-initial","border border-solid border-grey-3","absolute select-none bg-white rounded shadow-intense","opacity-5",{"animate-adder-pop-up":"up"===e&&t,"animate-adder-pop-down":"down"===e&&t}),"data-component":"AdderToolbar",dir:"ltr",style:{visibility:t?"visible":"hidden"},children:[Pe("div",{className:Re("flex group"),children:[Pe(Kn,{icon:Be,onClick:()=>n("annotate"),label:"Annotate",shortcut:i}),Pe(Kn,{icon:nt,onClick:()=>n("highlight"),label:"Highlight",shortcut:r}),o>0&&Pe(x,{children:[Pe("div",{className:Re("m-1.5 border-r border-grey-4 border-solid")}),Pe(Kn,{badgeCount:o,onClick:()=>n("show"),label:"Show",shortcut:s})]})]}),Pe(Xn,{arrowDirection:e}),Pe(Gn,{annotationCount:o,isVisible:t})]})}function Qn(e){const t=e.attachShadow({mode:"open"});!function(e){
|
||||
const t=document.querySelector('link[rel="preload"][href*="/build/styles/annotator.css"]')?.href;if(!t)return;const n=document.createElement("link");n.rel="stylesheet",n.href=t,e.appendChild(n)}(t);const n=window.applyFocusVisiblePolyfill;return n&&n(t),t}class Jn{constructor(e,t){const n=`hypothesis-${e}`;this._element=document.createElement(n),this._shadowRoot=Qn(this._element),this._render=t}destroy(){V(null,this._shadowRoot),this._element.remove()}get element(){return this._element}render(){V(this._render(),this._shadowRoot)}}let Zn=function(e){return e[e.DOWN=1]="DOWN",e[e.UP=2]="UP",e}({});function eo(e){return e.toString()+"px"}class to{constructor(e,t){this._view=e.ownerDocument.defaultView,this._isVisible=!1,this._arrowDirection="up",this._annotationsForSelection=[],this._onAnnotate=t.onAnnotate,this._onHighlight=t.onHighlight,this._onShowAnnotations=t.onShowAnnotations,this._container=new Jn("adder",(()=>this._render())),e.appendChild(this._container.element),
|
||||
Object.assign(this._container.element.style,{position:"absolute",top:0,left:0}),this._container.render()}get annotationsForSelection(){return this._annotationsForSelection}set annotationsForSelection(e){this._annotationsForSelection=e,this._container.render()}hide(){this._isVisible=!1,this._container.render(),Object.assign(this._container.element.style,{top:0,left:0})}destroy(){this._container.destroy()}show(e,t){const{left:n,top:o,arrowDirection:i}=this._calculateTarget(e,t);this._showAt(n,o),this._isVisible=!0,this._arrowDirection=i===Zn.UP?"up":"down",this._container.render()}_firstChild(){return this._container.element.shadowRoot.firstChild}_width(){return this._firstChild().getBoundingClientRect().width}_height(){return this._firstChild().getBoundingClientRect().height}_calculateTarget(e,t){let n,o,i;n=t&&!Wn()?Zn.DOWN:Zn.UP;const r=Math.min(20,e.width),s=this._width(),a=Wn()?10:0,l=this._height();return i=t?e.left-s/2+r:e.left+e.width-s/2-r,
|
||||
e.top-l<0&&n===Zn.DOWN?n=Zn.UP:e.top+l>this._view.innerHeight&&(n=Zn.DOWN),o=n===Zn.UP?e.top+e.height+10+a:e.top-l-10,i=Math.max(i,0),i=Math.min(i,this._view.innerWidth-s),o=Math.max(o,0),o=Math.min(o,this._view.innerHeight-l),{top:o,left:i,arrowDirection:n}}_findZindex(e,t){if(void 0===document.elementsFromPoint)return 32768;const n=this._width(),o=this._height(),i=[...new Set([...document.elementsFromPoint(e,t),...document.elementsFromPoint(e,t+o),...document.elementsFromPoint(e+n/2,t+o/2),...document.elementsFromPoint(e+n,t),...document.elementsFromPoint(e+n,t+o)])].map((e=>+getComputedStyle(e).zIndex)).filter(Number.isInteger);return i.push(0),Math.max(...i)+1}_showAt(e,t){const n=function(e){let t=e.parentElement;for(;t.parentElement&&"static"===getComputedStyle(t).position;)t=t.parentElement;return t}(this._container.element).getBoundingClientRect(),o=this._findZindex(e,t);Object.assign(this._container.element.style,{left:eo(e-n.left),top:eo(t-n.top),zIndex:o})}_render(){return Pe(Yn,{
|
||||
isVisible:this._isVisible,arrowDirection:this._arrowDirection,onCommand:e=>{switch(e){case"annotate":this._onAnnotate(),this.hide();break;case"highlight":this._onHighlight(),this.hide();break;case"show":this._onShowAnnotations(this.annotationsForSelection);break;case"hide":this.hide()}},annotationCount:this.annotationsForSelection.length})}}var no=function(e){return e[e.Forwards=1]="Forwards",e[e.Backwards=2]="Backwards",e}(no||{});function oo(e,t,n){const o=n===no.Forwards?t:t-1;if(""!==e.charAt(o).trim())return t;let i,r;if(n===no.Backwards?(i=e.substring(0,t),r=i.trimEnd()):(i=e.substring(t),r=i.trimStart()),!r.length)return-1;const s=i.length-r.length;return n===no.Backwards?t-s:t+s}function io(e,t){const n=e.commonAncestorContainer.ownerDocument.createNodeIterator(e.commonAncestorContainer,NodeFilter.SHOW_TEXT),o=t===no.Forwards?e.startContainer:e.endContainer,i=t===no.Forwards?e.endContainer:e.startContainer;let r=n.nextNode();for(;r&&r!==o;)r=n.nextNode();t===no.Backwards&&(r=n.previousNode());let s=-1
|
||||
;const a=()=>{if(r=t===no.Forwards?n.nextNode():n.previousNode(),r){const e=r.textContent,n=t===no.Forwards?0:e.length;s=oo(e,n,t)}};for(;r&&-1===s&&r!==i;)a();if(r&&s>=0)return{node:r,offset:s};throw new RangeError("No text nodes with non-whitespace text found in range")}function ro(e){switch(e.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return e.textContent?.length??0;default:return 0}}function so(e){let t=e.previousSibling,n=0;for(;t;)n+=ro(t),t=t.previousSibling;return n}function ao(e,...t){let n=t.shift();const o=e.ownerDocument.createNodeIterator(e,NodeFilter.SHOW_TEXT),i=[];let r,s=o.nextNode(),a=0;for(;void 0!==n&&s;)r=s,a+r.data.length>n?(i.push({node:r,offset:n-a}),n=t.shift()):(s=o.nextNode(),a+=r.data.length);for(;void 0!==n&&r&&a===n;)i.push({node:r,offset:r.data.length}),n=t.shift();if(void 0!==n)throw new RangeError("Offset exceeds text length");return i}let lo=function(e){return e[e.FORWARDS=1]="FORWARDS",e[e.BACKWARDS=2]="BACKWARDS",e}({});class co{constructor(e,t){
|
||||
if(t<0)throw new Error("Offset is invalid");this.element=e,this.offset=t}relativeTo(e){if(!e.contains(this.element))throw new Error("Parent is not an ancestor of current element");let t=this.element,n=this.offset;for(;t!==e;)n+=so(t),t=t.parentElement;return new co(t,n)}resolve(e={}){try{return ao(this.element,this.offset)[0]}catch(t){if(0===this.offset&&void 0!==e.direction){const n=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);n.currentNode=this.element;const o=e.direction===lo.FORWARDS,i=o?n.nextNode():n.previousNode();if(!i)throw t;return{node:i,offset:o?0:i.data.length}}throw t}}static fromCharOffset(e,t){switch(e.nodeType){case Node.TEXT_NODE:return co.fromPoint(e,t);case Node.ELEMENT_NODE:return new co(e,t);default:throw new Error("Node is not an element or text node")}}static fromPoint(e,t){switch(e.nodeType){case Node.TEXT_NODE:{if(t<0||t>e.data.length)throw new Error("Text node offset is out of range");if(!e.parentElement)throw new Error("Text node has no parent")
|
||||
;const n=so(e)+t;return new co(e.parentElement,n)}case Node.ELEMENT_NODE:{if(t<0||t>e.childNodes.length)throw new Error("Child node offset is out of range");let n=0;for(let o=0;o<t;o++)n+=ro(e.childNodes[o]);return new co(e,n)}default:throw new Error("Point is not in an element or text node")}}}class uo{constructor(e,t){this.start=e,this.end=t}relativeTo(e){return new uo(this.start.relativeTo(e),this.end.relativeTo(e))}toRange(){let e,t;this.start.element===this.end.element&&this.start.offset<=this.end.offset?[e,t]=ao(this.start.element,this.start.offset,this.end.offset):(e=this.start.resolve({direction:lo.FORWARDS}),t=this.end.resolve({direction:lo.BACKWARDS}));const n=new Range;return n.setStart(e.node,e.offset),n.setEnd(t.node,t.offset),n}static fromRange(e){const t=co.fromPoint(e.startContainer,e.startOffset),n=co.fromPoint(e.endContainer,e.endOffset);return new uo(t,n)}static fromOffsets(e,t,n){return new uo(new co(e,t),new co(e,n))}static trimmedRange(e){return function(e){
|
||||
if(!e.toString().trim().length)throw new RangeError("Range contains no non-whitespace text");if(e.startContainer.nodeType!==Node.TEXT_NODE)throw new RangeError("Range startContainer is not a text node");if(e.endContainer.nodeType!==Node.TEXT_NODE)throw new RangeError("Range endContainer is not a text node");const t=e.cloneRange();let n=!1,o=!1;const i={start:oo(e.startContainer.textContent,e.startOffset,no.Forwards),end:oo(e.endContainer.textContent,e.endOffset,no.Backwards)};if(i.start>=0&&(t.setStart(e.startContainer,i.start),n=!0),i.end>0&&(t.setEnd(e.endContainer,i.end),o=!0),n&&o)return t;if(!n){const{node:e,offset:n}=io(t,no.Forwards);e&&n>=0&&t.setStart(e,n)}if(!o){const{node:e,offset:n}=io(t,no.Backwards);e&&n>0&&t.setEnd(e,n)}return t}(uo.fromRange(e).toRange())}}const ho=".annotator-placeholder";function fo(e){return!!e.parentElement&&null!==e.parentElement.closest(ho)}function mo(e,t){const n=new Range
|
||||
;return e.compareBoundaryPoints(Range.START_TO_START,t)<=0?n.setStart(e.startContainer,e.startOffset):n.setStart(t.startContainer,t.startOffset),e.compareBoundaryPoints(Range.END_TO_END,t)>=0?n.setEnd(e.endContainer,e.endOffset):n.setEnd(t.endContainer,t.endOffset),n}function go(e=document.getSelection()){if(!e||0===e.rangeCount)return null;let t=e.getRangeAt(0);for(let n=1;n<e.rangeCount;n++)t=mo(t,e.getRangeAt(n));return t.collapsed?null:t}function po(e){if(e.focusNode===e.anchorNode)return e.focusOffset<e.anchorOffset;return go(e).startContainer===e.focusNode}function _o(e,t){try{const n=t.nodeValue?.length??t.childNodes.length;return e.comparePoint(t,0)<=0&&e.comparePoint(t,n)>=0}catch{return!1}}function bo(e,t){const n=e.commonAncestorContainer,o=n.ownerDocument.createNodeIterator(n,NodeFilter.SHOW_ALL);let i;for(;i=o.nextNode();)_o(e,i)&&t(i)}function vo(e){const t=go(e);if(!t)return null;const n=function(e){const t=[];return bo(e,(e=>{Rn(e)&&!e.textContent.match(/^\s*$/)&&t.push(e)})),t.flatMap((t=>{
|
||||
const n=t.ownerDocument.createRange();if(n.selectNodeContents(t),t===e.startContainer&&n.setStart(t,e.startOffset),t===e.endContainer&&n.setEnd(t,e.endOffset),n.collapsed)return[];const o=Array.from(n.getClientRects());return n.detach(),o}))}(t);return 0===n.length?null:po(e)?n[0]:n[n.length-1]}const wo="http://www.w3.org/2000/svg",yo=["user-annotations","user-highlights","other-content"];function xo(e,t){const n=function(e){if(e.collapsed)return[];let t=e.commonAncestorContainer;if(t&&t.nodeType!==Node.ELEMENT_NODE&&(t=t.parentElement),!t)return[];const n=[],o=t.ownerDocument.createNodeIterator(t,NodeFilter.SHOW_TEXT);let i;for(;i=o.nextNode();){if(!_o(e,i))continue;const t=i;t===e.startContainer&&e.startOffset>0?t.splitText(e.startOffset):(t===e.endContainer&&e.endOffset<t.data.length&&t.splitText(e.endOffset),n.push(t))}return n}(e),o=n.length>0&&fo(n[0]);let i=[],r=null,s=null;n.forEach((e=>{r&&r.nextSibling===e?s.push(e):(s=[e],i.push(s)),r=e}));const a=/^\s*$/;i=i.filter((e=>{const t=e[0].parentElement
|
||||
;return 1===t?.childNodes.length&&"SPAN"===t?.tagName||e.some((e=>!a.test(e.data)))}));const l=[];return i.forEach((e=>{const n=document.createElement("hypothesis-highlight");n.className=Re("hypothesis-highlight",t);e[0].parentNode.replaceChild(n,e[0]),e.forEach((e=>n.appendChild(e))),l.push(n)})),o||function(e,t){if(0===e.length)return;const n=function(e){const t=e.closest(".page");if(!t)return null;return t.querySelector(".canvasWrapper > canvas")||null}(e[0]);if(!n||!n.parentElement)return;let o=n.parentElement.querySelector(".hypothesis-highlight-layer");if(!o){o=document.createElementNS(wo,"svg"),o.setAttribute("class","hypothesis-highlight-layer"),n.parentElement.appendChild(o),n.parentElement.style.position="relative";const e=o.style;e.position="absolute",e.left="0",e.top="0",e.width="100%",e.height="100%",e.mixBlendMode="multiply"}const i=n.getBoundingClientRect(),r=e.map((e=>{const n=e.getBoundingClientRect(),o=document.createElementNS(wo,"rect");return o.setAttribute("x",(n.left-i.left).toString()),
|
||||
o.setAttribute("y",(n.top-i.top).toString()),o.setAttribute("width",n.width.toString()),o.setAttribute("height",n.height.toString()),o.setAttribute("class",Re("hypothesis-svg-highlight",t)),e.classList.add("is-transparent"),e.svgHighlight=o,o}));o.append(...r)}(l,t),l}function No(e,t){const n=e.parentNode;t.forEach((t=>n.insertBefore(t,e))),e.remove()}function Co(e){So(e,!1);for(const t of e){if(t.parentNode){No(t,Array.from(t.childNodes))}t.svgHighlight&&t.svgHighlight.remove()}}function So(e,t){e.forEach((e=>{e.svgHighlight?function(e,t){const n=e.parentNode,o=e.getAttribute("data-focused-id");if(Boolean(o)!==t)if(t){e.setAttribute("data-focused-id",Jt(8));const t=e.cloneNode();t.setAttribute("data-is-focused","data-is-focused"),n.append(t)}else{const t=n.querySelector(`[data-focused-id="${o}"][data-is-focused]`);t?.remove(),e.removeAttribute("data-focused-id")}}(e.svgHighlight,t):e.classList.toggle("hypothesis-highlight-focused",t)}))}function Eo(e){ko(Ro(e)),function(e){for(const[t,n]of function(e){
|
||||
const t=new Map;for(const n of(e??document).getElementsByClassName("hypothesis-highlight-layer"))t.set(n,Array.from(n.querySelectorAll(".hypothesis-svg-highlight")));return t}(e)){n.every(((e,t,n)=>0===t||Po(e)>=Po(n[t-1])))||(n.sort(((e,t)=>Po(e)-Po(t))),t.replaceChildren(...n))}}(e)}const Ao=e=>"hypothesis-highlight"===e.tagName.toLowerCase();function Ro(e){let t;return t=Ao(e)?Array.from(e.children).filter(Ao):Array.from(e.getElementsByTagName("hypothesis-highlight")).filter((e=>!e.parentElement||!Ao(e.parentElement))),t}function ko(e,t="",n=0,o=0){for(const i of e){const e=yo.find((e=>i.classList.contains(e)))??"other-content",r=t&&e===t?o+1:0;i.setAttribute("data-nesting-level",`${n}`),i.setAttribute("data-cluster-level",`${r}`),i.svgHighlight&&(i.svgHighlight.setAttribute("data-nesting-level",`${n}`),i.svgHighlight.setAttribute("data-cluster-level",`${r}`)),ko(Ro(i),e,n+1,r)}}function Po(e){
|
||||
return e.getAttribute("data-is-focused")?Number.MAX_SAFE_INTEGER:parseInt(e.getAttribute("data-nesting-level")??"0",10)}function To(e){const t=[];return e.forEach((({annotation:e,highlights:n})=>{if(!n?.length)return;const{top:o,bottom:i}=function(e){const t=e.map((e=>e.getBoundingClientRect()));return t.reduce(((e,t)=>({top:Math.min(e.top,t.top),left:Math.min(e.left,t.left),bottom:Math.max(e.bottom,t.bottom),right:Math.max(e.right,t.right)})))}(n);o>=i||t.push({tag:e.$tag,top:o,bottom:i})})),t.sort(((e,t)=>e.top-t.top)),t}class Mo{constructor({contentContainer:e,hostRPC:t}){this._hostRPC=t,this._updatePending=!1,this._anchors=[],this._listeners=new be,this._listeners.add(window,"resize",(()=>this.update())),this._listeners.add(window,"scroll",(()=>this.update())),this._listeners.add(e,"scroll",(()=>this.update()),{capture:!0})}destroy(){this._listeners.removeAll()}update(e){e&&(this._anchors=e),this._updatePending||(this._updatePending=!0,requestAnimationFrame((()=>{const e=To(this._anchors)
|
||||
;this._hostRPC.call("anchorsChanged",e),this._updatePending=!1})))}}class Lo extends CustomEvent{constructor(e){super("hypothesis:layoutchange",{bubbles:!0,cancelable:!1,detail:e})}}const Oo=new Set;function Io(...e){const t=e.join();Oo.has(t)||(console.warn(...e),Oo.add(t))}Io.reset=()=>{Oo.clear()};const Bo=["styled_highlight_clusters"];class Ho extends rn.TinyEmitter{constructor(e=Bo){super(),this._flags=new Map,this._knownFlags=e}update(e){this._flags.clear();for(const[t,n]of Object.entries(e))this._flags.set(t,n);this.emit("flagsChanged")}flagEnabled(e){return this._knownFlags.includes(e)?this._flags.get(e)??!1:(Io("Looked up unknown feature",e),!1)}allFlags(){return Object.fromEntries(this._flags)}}function Fo({cluster:e,label:t,onChange:n,currentStyles:o,highlightStyles:i}){const r=o[e],s="transparent"===r;return Pe("div",{className:"space-y-2",children:[Pe("div",{className:"flex items-center gap-x-2 text-annotator-base",children:Pe("div",{className:"grow text-color-text px-2 py-1 rounded",style:{
|
||||
backgroundColor:i[r].color},children:t})}),Pe("div",{className:"flex items-center gap-x-2",children:Object.keys(i).map((t=>Pe("div",{className:"relative",children:[Pe("input",{className:Re("absolute w-6 h-6","opacity-[.00001]","cursor-pointer"),name:e,id:`hypothesis-${e}-${t}`,checked:r===t,onChange:n,type:"radio",value:t}),Pe("label",{className:"block",htmlFor:`${e}-${t}`,children:[Pe("div",{style:{backgroundColor:i[t].color},className:Re("block w-6 h-6 rounded-full flex items-center justify-center",{"border-2 border-slate-0":r!==t,"border-2 border-slate-3":r===t}),children:"transparent"===t&&Pe(et,{className:Re("w-3 h-3",{"text-slate-3":!s,"text-slate-7":s})})}),Pe("span",{className:"sr-only",children:t})]})]},`${e}-${t}`)))})]})}function Do({active:e,availableStyles:t,currentStyles:n,onStyleChange:o}){const i=ae((e=>{const t=e.target,n=t.name,i=t.value;o(n,i)}),[o]),[r,s]=ne(!1);return e?Pe(Me,{classes:"overflow-hidden",children:Pe("div",{className:"flex flex-col text-annotator-base text-color-text",
|
||||
children:[Pe(wt,{classes:"rounded-none","data-testid":"control-toggle-button",onClick:()=>s(!r),title:r?"Hide highlight settings":"Show highlight settings",children:Pe(x,r?{children:[Pe(Ve,{}),Pe("span",{children:"Highlight Appearance"})]}:{children:[Pe(ze,{}),Pe(nt,{})]})}),r&&Pe(Oe,{"data-testid":"cluster-style-controls",size:"sm",children:[Pe(Fo,{highlightStyles:t,label:"My annotations",cluster:"user-annotations",onChange:i,currentStyles:n}),Pe(Fo,{highlightStyles:t,label:"My highlights",cluster:"user-highlights",onChange:i,currentStyles:n}),Pe(Fo,{highlightStyles:t,label:"Everybody's content",cluster:"other-content",onChange:i,currentStyles:n})]})]})}):null}const Vo={transparent:{color:"transparent",secondColor:"transparent",thirdColor:"transparent"},pink:{color:"var(--hypothesis-color-pink)",secondColor:"var(--hypothesis-color-pink-1)",thirdColor:"var(--hypothesis-color-pink-2)"},orange:{color:"var(--hypothesis-color-orange)",secondColor:"var(--hypothesis-color-orange-1)",
|
||||
thirdColor:"var(--hypothesis-color-orange-2)"},yellow:{color:"var(--hypothesis-color-yellow)",secondColor:"var(--hypothesis-color-yellow-1)",thirdColor:"var(--hypothesis-color-yellow-2)"},green:{color:"var(--hypothesis-color-green)",secondColor:"var(--hypothesis-color-green-1)",thirdColor:"var(--hypothesis-color-green-2)"},purple:{color:"var(--hypothesis-color-purple)",secondColor:"var(--hypothesis-color-purple-1)",thirdColor:"var(--hypothesis-color-purple-2)"},grey:{color:"var(--hypothesis-color-grey)",secondColor:"var(--hypothesis-color-grey-1)",thirdColor:"var(--hypothesis-color-grey-2)"}},Uo={"other-content":"yellow","user-annotations":"orange","user-highlights":"purple"};class qo{constructor(e,t){this._element=e,this._features=t.features,this._container=new Jn("highlight-cluster-toolbar",(()=>this._render())),this._element.appendChild(this._container.element),Object.assign(this._container.element.style,{position:"fixed",top:`${this._element.offsetTop+4}px`,left:"4px"}),this.appliedStyles=Uo,this._init(),
|
||||
this._features.on("flagsChanged",(()=>{this._activate(this._isActive())})),this._container.render()}destroy(){clearTimeout(this._updateTimeout),this._activate(!1),this._container.destroy()}scheduleClusterUpdates(){clearTimeout(this._updateTimeout),this._updateTimeout=setTimeout((()=>this._updateClusters()),100)}_init(){for(const e of Object.keys(this.appliedStyles))this._setClusterStyles(e,this.appliedStyles[e]);this._activate(this._isActive())}_updateClusters(){this._isActive()&&Eo(this._element)}_isActive(){return this._features.flagEnabled("styled_highlight_clusters")}_activate(e){this._element.classList.toggle("hypothesis-highlights-clustered",e),this._container.render()}_setClusterStyle(e,t){document.documentElement.style.setProperty(e,t)}_setClusterStyles(e,t){const n=Vo[t];for(const t of Object.keys(n))this._setClusterStyle(`--hypothesis-${e}-${t}`,n[t])}_onChangeClusterStyle(e,t){this.appliedStyles[e]=t,this._setClusterStyles(e,t),this._container.render()}_render(){return Pe(Do,{
|
||||
active:this._isActive(),availableStyles:Vo,currentStyles:this.appliedStyles,onStyleChange:(e,t)=>this._onChangeClusterStyle(e,t)})}}function $o(e){return e.split("").reverse().join("")}function zo(e){return(e|-e)>>31&1}function Wo(e,t,n,o){let i=e.P[n],r=e.M[n];const s=o>>>31,a=t[n]|s,l=a|r,c=(a&i)+i^i|a;let d=r|~(c|i),u=i&c;const h=zo(d&e.lastRowMask[n])-zo(u&e.lastRowMask[n]);return d<<=1,u<<=1,u|=s,d|=zo(o)-s,i=u|~(l|d),r=d&l,e.P[n]=i,e.M[n]=r,h}function jo(e,t,n){if(0===t.length)return[];n=Math.min(n,t.length);const o=[],i=32,r=Math.ceil(t.length/i)-1,s={P:new Uint32Array(r+1),M:new Uint32Array(r+1),lastRowMask:new Uint32Array(r+1)};s.lastRowMask.fill(1<<31),s.lastRowMask[r]=1<<(t.length-1)%i;const a=new Uint32Array(r+1),l=new Map,c=[];for(let e=0;e<256;e++)c.push(a);for(let e=0;e<t.length;e+=1){const n=t.charCodeAt(e);if(l.has(n))continue;const o=new Uint32Array(r+1);l.set(n,o),n<c.length&&(c[n]=o);for(let e=0;e<=r;e+=1){o[e]=0;for(let r=0;r<i;r+=1){const s=e*i+r;if(s>=t.length)continue
|
||||
;t.charCodeAt(s)===n&&(o[e]|=1<<r)}}}let d=Math.max(0,Math.ceil(n/i)-1);const u=new Uint32Array(r+1);for(let e=0;e<=d;e+=1)u[e]=(e+1)*i;u[r]=t.length;for(let e=0;e<=d;e+=1)s.P[e]=-1,s.M[e]=0;for(let h=0;h<e.length;h+=1){const f=e.charCodeAt(h);let m;f<c.length?m=c[f]:(m=l.get(f),void 0===m&&(m=a));let g=0;for(let e=0;e<=d;e+=1)g=Wo(s,m,e,g),u[e]+=g;if(u[d]-g<=n&&d<r&&(1&m[d+1]||g<0)){let e;if(d+=1,s.P[d]=-1,s.M[d]=0,d===r){const n=t.length%i;e=0===n?i:n}else e=i;u[d]=u[d-1]+e-g+Wo(s,m,d,g)}else for(;d>0&&u[d]>=n+i;)d-=1;d===r&&u[d]<=n&&(u[d]<n&&o.splice(0,o.length),o.push({start:-1,end:h+1,errors:u[d]}),n=u[d])}return o}function Xo(e,t,n){return function(e,t,n){const o=$o(t);return n.map((n=>{const i=Math.max(0,n.end-t.length-n.errors);return{start:jo($o(e.slice(i,n.end)),o,n.errors).reduce(((e,t)=>n.end-t.end<e?n.end-t.end:e),n.end),end:n.end,errors:n.errors}}))}(e,t,jo(e,t,n))}function Ko(e,t,n){let o=0;const i=[];for(;-1!==o;)o=e.indexOf(t,o),-1!==o&&(i.push({start:o,end:o+t.length,errors:0}),o+=1)
|
||||
;return i.length>0?i:Xo(e,t,n)}function Go(e,t){if(0===t.length||0===e.length)return 0;return 1-Ko(e,t,t.length)[0].errors/t.length}function Yo(e,t,n={}){if(0===t.length)return null;const o=Math.min(256,t.length/2),i=Ko(e,t,o);if(0===i.length)return null;const r=o=>{const i=1-o.errors/t.length,r=n.prefix?Go(e.slice(Math.max(0,o.start-n.prefix.length),o.start),n.prefix):1,s=n.suffix?Go(e.slice(o.end,o.end+n.suffix.length),n.suffix):1;let a=1;if("number"==typeof n.hint){a=1-Math.abs(o.start-n.hint)/e.length}return(50*i+20*r+20*s+2*a)/92},s=i.map((e=>({start:e.start,end:e.end,score:r(e)})));return s.sort(((e,t)=>t.score-e.score)),s[0]}function Qo(e){const t=function(e){const t=e.nodeName.toLowerCase();return"#text"===t?"text()":t}(e),n=function(e){let t=0,n=e;for(;n;)n.nodeName===e.nodeName&&(t+=1),n=n.previousSibling;return t}(e);return`${t}[${n}]`}function Jo(e,t){let n="",o=e;for(;o!==t;){if(!o)throw new Error("Node is not a descendant of root");n=Qo(o)+"/"+n,o=o.parentNode}return n="/"+n,
|
||||
n=n.replace(/\/$/,""),n}function Zo(e,t,n){t=t.toUpperCase();let o=-1;for(let i=0;i<e.children.length;i++){const r=e.children[i];if(r.nodeName.toUpperCase()===t&&(++o,o===n))return r}return null}function ei(e,t=document.body){try{return function(e,t){if(null===e.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+\])?)+$/))throw new Error("Expression is not a simple XPath");const n=e.split("/");let o=t;n.shift();for(const e of n){let t,n;const i=e.indexOf("[");if(-1!==i){t=e.slice(0,i);const o=e.slice(i+1,e.indexOf("]"));if(n=parseInt(o)-1,n<0)return null}else t=e,n=0;const r=Zo(o,t,n);if(!r)return null;o=r}return o}(e,t)}catch{return document.evaluate("."+e,t,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}}class ti{constructor(e,t){this.root=e,this.range=t}static fromRange(e,t){return new ti(e,t)}static fromSelector(e,t){const n=ei(t.startContainer,e);if(!n)throw new Error("Failed to resolve startContainer XPath");const o=ei(t.endContainer,e);if(!o)throw new Error("Failed to resolve endContainer XPath")
|
||||
;const i=co.fromCharOffset(n,t.startOffset),r=co.fromCharOffset(o,t.endOffset),s=new uo(i,r).toRange();return new ti(e,s)}toRange(){return this.range}toSelector(){const e=uo.fromRange(this.range).toRange(),t=uo.fromRange(e),n=Jo(t.start.element,this.root),o=Jo(t.end.element,this.root);return{type:"RangeSelector",startContainer:n,startOffset:t.start.offset,endContainer:o,endOffset:t.end.offset}}}class ni{constructor(e,t,n){this.root=e,this.start=t,this.end=n}static fromRange(e,t){const n=uo.fromRange(t).relativeTo(e);return new ni(e,n.start.offset,n.end.offset)}static fromSelector(e,t){return new ni(e,t.start,t.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return uo.fromOffsets(this.root,this.start,this.end).toRange()}}class oi{constructor(e,t,n={}){this.root=e,this.exact=t,this.context=n}static fromRange(e,t){const n=e.textContent,o=uo.fromRange(t).relativeTo(e),i=o.start.offset,r=o.end.offset;return new oi(e,n.slice(i,r),{prefix:n.slice(Math.max(0,i-32),i),
|
||||
suffix:n.slice(r,Math.min(n.length,r+32))})}static fromSelector(e,t){const{prefix:n,suffix:o}=t;return new oi(e,t.exact,{prefix:n,suffix:o})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(e={}){return this.toPositionAnchor(e).toRange()}toPositionAnchor(e={}){const t=Yo(this.root.textContent,this.exact,{...this.context,hint:e.hint});if(!t)throw new Error("Quote not found");return new ni(this.root,t.start,t.end)}}function ii(e){const t=parseFloat(e);return!Number.isFinite(t)||t<0?null:t}function ri(e){return e instanceof Element?e:e.parentElement}function si(e,t=e){const n=ii(e?.getAttribute("data-time-start")??""),o=ii(t?.getAttribute("data-time-end")??"");return"number"!=typeof n||"number"!=typeof o||o<n?null:[n,o]}class ai{constructor(e,t,n){this.root=e,this.start=t,this.end=n}static fromRange(e,t){const n=ri(t.startContainer)?.closest("[data-time-start]"),o=ri(t.endContainer)?.closest("[data-time-end]"),i=si(n,o);if(!i)return null
|
||||
;const[r,s]=i;return new ai(e,r,s)}toRange(){const e=[...this.root.querySelectorAll("[data-time-start]")].map((e=>{const t=si(e);if(!t)return null;const[n,o]=t;return{element:e,start:n,end:o}})).filter((e=>null!==e));e.sort(((e,t)=>e.start-t.start));const t=function(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}(e,(e=>e.start<=this.start&&e.end>=this.start));if(-1===t)throw new Error("Start segment not found");const n=t+e.slice(t).findIndex((e=>e.start<=this.end&&e.end>=this.end));if(-1===n)throw new Error("End segment not found");const o=new Range;o.setStart(e[t].element,0);const i=e[n].element;return o.setEnd(i,i.childNodes.length),o}static fromSelector(e,t){const{start:n,end:o}=t;return new ai(e,n,o)}toSelector(){return{type:"MediaTimeSelector",start:this.start,end:this.end}}}async function li(e,t){return e.toRange(t)}function ci(e,t,n){const o=e[t];if("function"!=typeof o)throw new Error("Can only intercept functions");return e[t]=(...t)=>{const i=o.call(e,...t);return n(...t),i},()=>{
|
||||
e[t]=o}}function di(e){return e.replace(/#.*/,"")}class ui{constructor(e,t=(()=>location.href)){this._listeners=new be;let n=t();const o=(o=t())=>{di(n)!==di(o)&&(n=o,e(o))},i=function(){const e=window.navigation;return"function"==typeof Navigation&&e instanceof Navigation?e:null}();if(i)this._listeners.add(i,"navigatesuccess",(()=>o()));else{const e=[ci(window.history,"pushState",(()=>o())),ci(window.history,"replaceState",(()=>o()))];this._unpatchHistory=()=>e.forEach((e=>e())),this._listeners.add(window,"popstate",(()=>o()))}}disconnect(){this._unpatchHistory?.(),this._listeners.removeAll()}}var hi,fi;var mi=function(){if(fi)return hi;fi=1;var e="complete",t="canceled";function n(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function o(t){var i=t._scrollSettings;if(i){var r=i.maxSynchronousAlignments,s=function(e,t){
|
||||
var n,o,i,r,s,a,l,c=e.align,d=e.target.getBoundingClientRect(),u=c&&null!=c.left?c.left:.5,h=c&&null!=c.top?c.top:.5,f=c&&null!=c.leftOffset?c.leftOffset:0,m=c&&null!=c.topOffset?c.topOffset:0,g=u,p=h;if(e.isWindow(t))a=Math.min(d.width,t.innerWidth),l=Math.min(d.height,t.innerHeight),o=d.left+t.pageXOffset-t.innerWidth*g+a*g,i=d.top+t.pageYOffset-t.innerHeight*p+l*p,o-=f,i-=m,o=e.align.lockX?t.pageXOffset:o,i=e.align.lockY?t.pageYOffset:i,r=o-t.pageXOffset,s=i-t.pageYOffset;else{a=d.width,l=d.height,n=t.getBoundingClientRect();var _=d.left-(n.left-t.scrollLeft),b=d.top-(n.top-t.scrollTop);o=_+a*g-t.clientWidth*g,i=b+l*p-t.clientHeight*p,o-=f,i-=m,o=Math.max(Math.min(o,t.scrollWidth-t.clientWidth),0),i=Math.max(Math.min(i,t.scrollHeight-t.clientHeight),0),o=e.align.lockX?t.scrollLeft:o,i=e.align.lockY?t.scrollTop:i,r=o-t.scrollLeft,s=i-t.scrollTop}return{x:o,y:i,differenceX:r,differenceY:s}}(i,t),a=Date.now()-i.startTime,l=Math.min(1/i.time*a,1);if(i.endIterations>=r)return n(t,s.x,s.y),
|
||||
t._scrollSettings=null,i.end(e);var c=1-i.ease(l);if(n(t,s.x-s.differenceX*c,s.y-s.differenceY*c),a>=i.time)return i.endIterations++,i.scrollAncestor&&o(i.scrollAncestor),void o(t);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(o.bind(null,t))}}function i(e){return e.self===e}function r(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function s(){return!0}function a(e){if(e.assignedSlot)return a(e.assignedSlot);if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}return hi=function(n,l,c){if(n){"function"==typeof l&&(c=l,l=null),l||(l={}),l.time=isNaN(l.time)?1e3:l.time,l.ease=l.ease||function(e){return 1-Math.pow(1-e,e/2)},l.align=l.align||{}
|
||||
;var d=a(n),u=1,h=l.validTarget||s,f=l.isScrollable;l.debug&&(console.log("About to scroll to",n),d||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var m=[];d;)if(l.debug&&console.log("Scrolling parent node",d),h(d,u)&&(f?f(d,r):r(d))&&(u++,m.push(d)),!(d=a(d))){g(e);break}return m.reduce(((e,r,s)=>function(e,n,r,s,a){var l,c=!n._scrollSettings,d=n._scrollSettings,u=Date.now(),h={passive:!0};function f(e){n._scrollSettings=null,n.parentElement&&n.parentElement._scrollSettings&&n.parentElement._scrollSettings.end(e),r.debug&&console.log("Scrolling ended with type",e,"for",n),a(e),l&&(n.removeEventListener("touchstart",l,h),n.removeEventListener("wheel",l,h))}d&&d.end(t);var m=r.maxSynchronousAlignments;return null==m&&(m=3),n._scrollSettings={startTime:u,endIterations:0,target:e,time:r.time,ease:r.ease,align:r.align,isWindow:r.isWindow||i,maxSynchronousAlignments:m,end:f,scrollAncestor:s},"cancellable"in r&&!r.cancellable||(l=f.bind(null,t),n.addEventListener("touchstart",l,h),
|
||||
n.addEventListener("wheel",l,h)),c&&o(n),l}(n,r,l,m[s+1],g)),null)}function g(e){--u||c&&c(e)}},hi}(),gi=t(mi);function pi(e,t,n){return e+n*(t-e)}async function _i(e,t,{maxDuration:n=500}={}){const o=e.scrollTop,i=t,r=Date.now(),s=Math.min(Math.abs(i-o)/3,n);let a=0;for(;a<1;)await new Promise((e=>{requestAnimationFrame(e)})),a=Math.min(1,(Date.now()-r)/s),e.scrollTop=pi(o,i,a)}function bi(e,t=document.baseURI){return new URL(e,t).href.toString().replace(/#.*/,"")}class vi{constructor(e={}){this.document=e.document||document}uri(){let e=this._getDocumentHref();try{e=decodeURIComponent(e)}catch(e){console.error("Error decoding URI:",e)}const t=this._getLinks();for(const n of t)"canonical"===n.rel&&(e=n.href);return e}getDocumentMetadata(){const e={title:document.title,link:[],dc:this._getMetaTags("name","dc."),eprints:this._getMetaTags("name","eprints."),facebook:this._getMetaTags("property","og:"),highwire:this._getMetaTags("name","citation_"),prism:this._getMetaTags("name","prism."),
|
||||
twitter:this._getMetaTags("name","twitter:")},t=this._getFavicon();t&&(e.favicon=t),e.title=this._getTitle(e),e.link=this._getLinks(e);const n=e.link.find((e=>e.href.startsWith("urn:x-dc")));return n&&(e.documentFingerprint=n.href),e}_getMetaTags(e,t){const n={};for(const o of Array.from(this.document.querySelectorAll("meta"))){const i=o.getAttribute(e),{content:r}=o;if(i&&r){const e=i.match(RegExp(`^${t}(.+)$`,"i"));if(e){const t=e[1].toLowerCase();n[t]?n[t].push(r):n[t]=[r]}}}return n}_getTitle(e){return e.highwire.title?e.highwire.title[0]:e.eprints.title?e.eprints.title[0]:e.prism.title?e.prism.title[0]:e.facebook.title?e.facebook.title[0]:e.twitter.title?e.twitter.title[0]:e.dc.title?e.dc.title[0]:this.document.title}_getLinks(e={dc:{},highwire:{}}){const t=[{href:this._getDocumentHref()}],n=Array.from(this.document.querySelectorAll("link"));for(const e of n)if(["alternate","canonical","bookmark","shortlink"].includes(e.rel)){if("alternate"===e.rel){
|
||||
if(e.type&&e.type.match(/^application\/(rss|atom)\+xml/))continue;if(e.hreflang)continue}try{const n=this._absoluteUrl(e.href);t.push({href:n,rel:e.rel,type:e.type})}catch{}}for(const n of Object.keys(e.highwire)){const o=e.highwire[n];if("pdf_url"===n)for(const e of o)try{t.push({href:this._absoluteUrl(e),type:"application/pdf"})}catch{}if("doi"===n)for(let e of o)"doi:"!==e.slice(0,4)&&(e=`doi:${e}`),t.push({href:e})}for(const n of Object.keys(e.dc)){const o=e.dc[n];if("identifier"===n)for(const e of o)"doi:"===e.slice(0,4)&&t.push({href:e})}const o=e.dc["relation.ispartof"],i=e.dc.identifier;if(o&&i){const e=o[o.length-1],n=i[i.length-1],r="urn:x-dc:"+encodeURIComponent(e)+"/"+encodeURIComponent(n);t.push({href:r})}return t}_getFavicon(){let e=null;for(const t of Array.from(this.document.querySelectorAll("link")))if(["shortcut icon","icon"].includes(t.rel))try{e=this._absoluteUrl(t.href)}catch{}return e}_absoluteUrl(e){return bi(e,this.document.baseURI)}_getDocumentHref(){
|
||||
const{href:e}=this.document.location,t=["http:","https:","file:"],n=new URL(e).protocol;return t.includes(n)?e:this.document.baseURI&&t.includes(new URL(this.document.baseURI).protocol)?this.document.baseURI:e}}class wi extends rn.TinyEmitter{constructor({features:e,container:t=document.body,sideBySideOptions:n}){super(),this.features=e,this.container=t,this._htmlMeta=new vi,this._prevURI=this._htmlMeta.uri(),this._sideBySideEnabled=!0,this._sideBySideOptions=n??{mode:"auto"},this._sideBySideActive=!1,this._lastLayout=null,this._navObserver=new ui((()=>this._checkForURIChange())),this._metaObserver=new MutationObserver((()=>this._checkForURIChange())),this._metaObserver.observe(document.head,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["rel","href","name","content"]}),this._flagsChanged=()=>{},this.features.on("flagsChanged",this._flagsChanged)}anchor(e,t){return function(e,t,n={}){let o=null,i=null,r=null,s=null;for(const e of t)switch(e.type){case"TextPositionSelector":i=e,n.hint=i.start;break
|
||||
;case"TextQuoteSelector":r=e;break;case"RangeSelector":s=e;break;case"MediaTimeSelector":o=e}const a=e=>{if(r?.exact&&e.toString()!==r.exact)throw new Error("quote mismatch");return e};let l=Promise.reject("unable to anchor");if(s){const t=s;l=l.catch((()=>li(ti.fromSelector(e,t),n).then(a)))}if(i){const t=i;l=l.catch((()=>li(ni.fromSelector(e,t),n).then(a)))}if(r){const t=r;l=l.catch((()=>li(oi.fromSelector(e,t),n)))}if(o){const t=o;l=l.catch((()=>ai.fromSelector(e,t).toRange()))}return l}(e,t)}describe(e,t){return function(e,t){const n=[ai,ti,ni,oi],o=[];for(const i of n)try{const n=i.fromRange(e,t);n&&o.push(n.toSelector())}catch{}return o}(e,t)}_checkForURIChange(){const e=this._htmlMeta.uri();e!==this._prevURI&&(this._prevURI=e,this.emit("uriChanged",e))}getAnnotatableRange(e){try{return uo.trimmedRange(e)}catch(e){if(e instanceof RangeError)return null;throw e}}canStyleClusteredHighlights(){return!0}destroy(){this._deactivateSideBySide(),this._navObserver.disconnect(),this._metaObserver.disconnect(),
|
||||
this.features.off("flagsChanged",this._flagsChanged)}contentContainer(){return this.container}fitSideBySide(e){this._lastLayout=e;const t=window.innerWidth-e.width,n=this._sideBySideEnabled&&"auto"===this._sideBySideOptions.mode&&e.expanded&&t>=480;return n?this._activateSideBySide(e.width):this._sideBySideActive&&this._deactivateSideBySide(),this._sideBySideActive=n,this.container.classList.toggle("hypothesis-sidebyside-active",this._sideBySideActive),n}sideBySideActive(){return this._sideBySideActive}_activateSideBySide(e){const t=e+12,n=e=>parseInt(window.getComputedStyle(e).marginLeft,10);In((()=>{document.body.style.marginLeft="",document.body.style.marginRight="";const e=n(document.body);document.body.style.marginRight=`${t}px`;const o=function(e){const t=new Map,n=new Map,o=kn.join(","),i=Array.from(e.querySelectorAll(o)).map((e=>({rect:e.getBoundingClientRect(),textLength:e.textContent.length}))).filter((({rect:e})=>e.width>0&&e.height>0)).sort(((e,t)=>t.textLength-e.textLength)).slice(0,15)
|
||||
;if(i.forEach((({rect:e})=>{let o=t.get(e.left)??0;o+=1,t.set(e.left,o);let i=n.get(e.right)??0;i+=1,n.set(e.right,i)})),0===t.size||0===n.size)return null;const r=[...t.entries()].sort(((e,t)=>t[1]-e[1])),s=[...n.entries()].sort(((e,t)=>t[1]-e[1])),[a]=r[0],[l]=s[0];return{left:a,right:l}}(document.body);if(o){const i=Math.max(0,window.innerWidth-t-o.right);if(i>0){const e=Math.max(0,t-i);document.body.style.marginRight=`${e}px`}n(document.body)>e&&(document.body.style.marginLeft=`${e}px`),o.left<12&&(document.body.style.marginLeft="12px")}else document.body.style.marginLeft="",document.body.style.marginRight=""}))}_deactivateSideBySide(){In((()=>{document.body.style.marginLeft="",document.body.style.marginRight=""}))}async getMetadata(){return this._htmlMeta.getDocumentMetadata()}async uri(){return this._htmlMeta.uri()}async scrollToAnchor(e){const t=e.highlights?.[0];t&&await async function(e,{maxDuration:t=500}={}){const n=e.closest("body");n&&"BODY"!==n.tagName&&Object.defineProperty(n,"tagName",{
|
||||
value:"BODY",configurable:!0});const o=e.closest("details");o&&!o.hasAttribute("open")&&(o.open=!0),await new Promise((n=>gi(e,{time:t},n)))}(t)}}var yi,xi;var Ni=function(){if(xi)return yi;xi=1;var t=NaN,n="[object Symbol]",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l="object"==typeof e&&e&&e.Object===Object&&e,c="object"==typeof self&&self&&self.Object===Object&&self,d=l||c||Function("return this")(),u=Object.prototype.toString,h=Math.max,f=Math.min,m=function(){return d.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function p(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&u.call(e)==n}(e))return t;if(g(e)){var l="function"==typeof e.valueOf?e.valueOf():e;e=g(l)?l+"":l}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var c=r.test(e);return c||s.test(e)?a(e.slice(2),c?2:8):i.test(e)?t:+e}return yi=function(e,t,n){var o,i,r,s,a,l,c=0,d=!1,u=!1,_=!0
|
||||
;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=o,r=i;return o=i=void 0,c=t,s=e.apply(r,n)}function v(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=r}function w(){var e=m();if(v(e))return y(e);a=setTimeout(w,function(e){var n=t-(e-l);return u?f(n,r-(e-c)):n}(e))}function y(e){return a=void 0,_&&o?b(e):(o=i=void 0,s)}function x(){var e=m(),n=v(e);if(o=arguments,i=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(w,t),d?b(e):s}(l);if(u)return a=setTimeout(w,t),b(l)}return void 0===a&&(a=setTimeout(w,t)),s}return t=p(t)||0,g(n)&&(d=!!n.leading,r=(u="maxWait"in n)?h(p(n.maxWait)||0,t):r,_="trailing"in n?!!n.trailing:_),x.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=l=i=a=void 0},x.flush=function(){return void 0===a?s:y(m())},x},yi}(),Ci=t(Ni);function Si(e,t,n,o=0){let i=o;for(;i<e.length&&t>0;)n(e[i])&&--t,++i;return i}function Ei(e,t,n,o){let i=0;for(let r=n;r<o;r++)t(e[r])&&++i;return i}function Ai(e,t,n,o,i){
|
||||
const r=Ei(e,i,0,n),s=Ei(e,i,n,o);let a=Si(t,r,i);for(;a<t.length&&!i(t[a]);)++a;return[a,Si(t,s,i,a)]}const Ri={INITIAL:0,FINISHED:3},ki=new Map,Pi=new Map;function Ti(e,t){return`${e}:${t}`}function Mi(e){const t="closest"in e?e:e.parentElement;return t?.closest(".textLayer")??null}function Li(){return PDFViewerApplication.pdfViewer}async function Oi(e){const t=Li();let n=t.getPageView(e);return n&&n.pdfPage||(n=await new Promise((n=>{const o=()=>{t.eventBus?t.eventBus.off("pagesloaded",o):document.removeEventListener("pagesloaded",o),n(t.getPageView(e))};t.eventBus?t.eventBus.on("pagesloaded",o):document.addEventListener("pagesloaded",o)}))),n}function Ii(e){const t=ki.get(e);if(t)return t;const n=(async()=>{const t=await Oi(e);return(await t.pdfPage.getTextContent({normalizeWhitespace:!0})).items.map((e=>e.str)).join("")})();return ki.set(e,n),n}async function Bi(e){const t=Li();let n=0,o=0,i="";for(let r=0;r<t.pagesCount;r++)if(i=await Ii(r),n=o,o+=i.length,o>=e)return{index:r,offset:n,text:i};return{
|
||||
index:t.pagesCount-1,offset:n,text:i}}function Hi(e){switch(e){case" ":case"\f":case"\n":case"\r":case"\t":case"\v":case" ":return!0;default:return!1}}const Fi=e=>!Hi(e);function Di(e){return void 0!==e.renderingDone?e.renderingDone:!!e.div&&null!==e.div.querySelector(".endOfContent")}async function Vi(e,t,n){const[o,i]=await Promise.all([Oi(e),Ii(e)]);if(o.renderingState===Ri.FINISHED&&o.textLayer&&Di(o.textLayer)){const e=o.textLayer.textLayerDiv??o.textLayer.div;if(!e)throw new Error("Unable to find PDF.js text layer root");const r=e.textContent,[s,a]=Ai(i,r,t,n,Fi);Ui(r.slice(s,a))!==Ui(i.slice(t,n))&&Io("Text layer text does not match page text. Highlights will be mis-aligned.");const l=new co(e,s),c=new co(e,a);return new uo(l,c).toRange()}const r=function(e){let t=e.querySelector(ho);return t||(t=document.createElement("span"),t.classList.add("annotator-placeholder"),t.textContent="Loading annotations...",e.appendChild(t),t)}(o.div),s=document.createRange();return s.setStartBefore(r),s.setEndAfter(r),s
|
||||
}function Ui(e){let t="";for(let n=0;n<e.length;n++){const o=e[n];Hi(o)||(t+=o)}return t}async function qi(e,t){const n=t.find((e=>"TextQuoteSelector"===e.type));if(!n)throw new Error("No quote selector found");const o=t.find((e=>"TextPositionSelector"===e.type));if(o){try{const{index:e,offset:t,text:i}=await Bi(o.start),r=o.start-t,s=o.end-t,a=i.substring(r,s);if(n.exact!==a)throw new Error("quote mismatch");return await Vi(e,r,s)}catch{}try{const e=Ti(n.exact,o.start),t=Pi.get(e);if(t){const{pageIndex:e,anchor:n}=t;return await Vi(e,n.start,n.end)}}catch{}}return async function(e,t){const n=Li().pagesCount,o=Array(n).fill(0).map(((e,t)=>t));let i,r;if(t){const{index:e,offset:n}=await Bi(t);i=e,r=t-n,o.sort(((t,n)=>Math.abs(t-e)-Math.abs(n-e)))}const s=void 0!==e.prefix?Ui(e.prefix):void 0,a=void 0!==e.suffix?Ui(e.suffix):void 0,l=Ui(e.exact);let c;for(const e of o){const t=await Ii(e),n=Ui(t);let o;void 0!==i&&void 0!==r&&(e<i?o=n.length:e===i?[o]=Ai(t,n,r,r,Fi):o=0);const d=Yo(n,l,{prefix:s,suffix:a,hint:o
|
||||
});if(d&&(!c||d.score>c.match.score)){const[o,i]=Ai(n,t,d.start,d.end,Fi);c={page:e,match:{start:o,end:i,score:d.score}};const r=n.slice(d.start,d.end)===l,u=void 0!==s&&n.slice(Math.max(0,d.start-s.length),d.start)===s,h=void 0!==a&&n.slice(d.end,a.length)===a;if(r&&(u||h||void 0===s&&void 0===a))break}}if(c){const{page:n,match:o}=c;if(t){const i=Ti(e.exact,t);Pi.set(i,{pageIndex:n,anchor:o})}return Vi(n,o.start,o.end)}throw new Error("Quote not found")}(n,o?.start)}function $i(e){try{e=uo.fromRange(e).toRange()}catch{throw new Error("Selection does not contain text")}const t=Mi(e.startContainer),n=Mi(e.endContainer);if(!t||!n)throw new Error("Selection is outside page text");if(t!==n)throw new Error("Selecting across page breaks is not supported");return[e,t]}async function zi(e,t){const[n,o]=$i(t),i=co.fromPoint(n.startContainer,n.startOffset).relativeTo(o),r=co.fromPoint(n.endContainer,n.endOffset).relativeTo(o),s=function(e){let t=0;for(;e.previousSibling;)++t,e=e.previousSibling;return t
|
||||
}(o.parentNode),a=s+1,l=await async function(e){if(e>=Li().pagesCount)throw new Error("Invalid page index");let t=0;for(let n=0;n<e;n++)t+=(await Ii(n)).length;return t}(s),c=await Oi(s);return[{type:"TextPositionSelector",start:l+i.offset,end:l+r.offset},oi.fromRange(e,n).toSelector(),{type:"PageSelector",index:s,label:c.pageLabel??a.toString()}]}function Wi({children:e}){return Pe("div",{className:"flex flex-col",children:e})}function ji({info:e}){let t=e.item.title;return e.item.subtitle&&(t+=`: ${e.item.subtitle}`),Pe("div",{className:Re("h-10 bg-white px-4 text-slate-7 text-annotator-base border-b","grid items-center","grid-cols-[100px_minmax(0,auto)]","2xl:grid-cols-[100px_minmax(0,auto)_minmax(0,auto)] 2xl:gap-x-3"),children:[Pe("div",{"data-testid":"content-logo",children:e.logo&&Pe(Kt,{href:e.logo.link,target:"_blank","data-testid":"logo-link",underline:"none",children:Pe("img",{alt:e.logo.title,src:e.logo.logo,"data-testid":"logo-image"})})}),Pe("div",{
|
||||
className:Re("hidden","2xl:block 2xl:whitespace-nowrap 2xl:overflow-hidden 2xl:text-ellipsis","font-semibold"),"data-testid":"content-container-info",title:e.container.title,children:e.container.title}),Pe("div",{className:Re("flex justify-center items-center gap-x-2"),"data-testid":"content-item-info",children:[Pe("div",{className:Re("hidden","2xl:block 2xl:grow")}),e.links.previousItem&&Pe(x,{children:[Pe(Kt,{title:"Open previous item",href:e.links.previousItem,underline:"always",target:"_blank","data-testid":"content-previous-link",children:Pe("div",{className:"flex gap-x-1 items-center text-annotator-sm whitespace-nowrap",children:[Pe(qe,{className:"w-em h-em"}),Pe("span",{children:"Previous"})]})}),Pe("div",{className:"text-annotator-sm",children:"|"})]}),Pe("div",{className:Re("min-w-0 whitespace-nowrap overflow-hidden text-ellipsis shrink font-medium"),children:Pe(Kt,{title:t,href:e.links.currentItem,"data-testid":"content-item-link",target:"_blank",unstyled:!0,children:t})}),e.links.nextItem&&Pe(x,{
|
||||
children:[Pe("div",{className:"text-annotator-sm",children:"|"}),Pe(Kt,{title:"Open next item",href:e.links.nextItem,underline:"always",target:"_blank","data-testid":"content-next-link",children:Pe("div",{className:"flex gap gap-x-1 items-center text-annotator-sm whitespace-nowrap",children:[Pe("span",{children:"Next"}),Pe(ze,{className:"w-em h-em"})]})})]})]})]})}function Xi(){return Pe("div",{className:"bg-white",role:"alert",children:Pe("div",{className:Re("flex items-center gap-x-2","border border-yellow-notice bg-yellow-notice/10 text-annotator-base"),children:[Pe("div",{className:"bg-yellow-notice text-white p-2",children:Pe(je,{className:"text-annotator-xl"})}),Pe("div",{children:[Pe("strong",{children:"This PDF does not contain selectable text:"})," ",Pe(Kt,{target:"_blank",href:"https://web.hypothes.is/help/how-to-ocr-optimize-pdfs/",underline:"always",children:"Learn how to fix this"})," ","in order to annotate with Hypothesis."]})]})})}class Ki{constructor(e){this._loaded=function(e){
|
||||
return e.initializedPromise?e.initializedPromise:e.initialized?Promise.resolve():new Promise((t=>{const n=setInterval((()=>{e.initialized&&(clearTimeout(n),t())}),5)}))}(e).then((async()=>{const t=await async function(e){return void 0!==e.downloadComplete?e.downloadComplete:(await e.pdfDocument.getDownloadInfo(),!0)}(e);return t?e:new Promise((t=>{const n=()=>{e.eventBus?(e.eventBus.off("documentload",n),e.eventBus.off("documentloaded",n)):window.removeEventListener("documentload",n),t(e)};e.eventBus?(e.eventBus.on("documentloaded",n),e.eventBus.on("documentload",n)):window.addEventListener("documentload",n)}))}))}getUri(){return this._loaded.then((e=>{let t=Qi(e);return t||(t=Yi(Gi(e))),t}))}async getMetadata(){const e=await this._loaded,{info:t,contentDispositionFilename:n,metadata:o}=await e.pdfDocument.getMetadata(),i=Gi(e),r=Qi(e);let s;s=o?.has("dc:title")&&"Untitled"!==o.get("dc:title")?o.get("dc:title"):t?.Title?t.Title:n||(r?function(e){const t=new URL(e),n=t.pathname.split("/");return n[n.length-1]
|
||||
}(r):"");const a=[{href:Yi(i)}];return r&&a.push({href:r}),{title:s,link:a,documentFingerprint:i}}}function Gi(e){return Array.isArray(e.pdfDocument.fingerprints)?e.pdfDocument.fingerprints[0]:e.pdfDocument.fingerprint}function Yi(e){return`urn:x-pdf:${e}`}function Qi(e){if(!e.url)return null;const t=bi(e.url);return 0!==t.indexOf("file://")?t:null}function Ji(e){const t=e.highlights?.[0];return t&&fo(t)}function Zi(e){return new Promise((t=>setTimeout(t,e)))}class er{constructor(){this._pdfjsContainer=document.querySelector("#outerContainer"),this._contentInfo=null,this._noTextWarning=!1,this._container=null}setContentInfo(e){this._contentInfo=e,this._update()}showNoTextWarning(e){this._noTextWarning=e,this._update()}destroy(){this._container?.destroy()}_update(){if(!(this._noTextWarning||this._contentInfo))return this._container?.destroy(),this._container=null,void(this._pdfjsContainer.style.height="");this._container||(this._container=new Jn("banner",(()=>this._render())),
|
||||
document.body.prepend(this._container.element)),this._container.render();const e=this._container.element.getBoundingClientRect().height;this._pdfjsContainer.style.height=`calc(100% - ${e}px)`}_render(){return Pe(Wi,{children:[this._contentInfo&&Pe(ji,{info:this._contentInfo}),this._noTextWarning&&Pe(Xi,{})]})}}class tr extends rn.TinyEmitter{constructor(e,t={}){super(),this._annotator=e;const n=window,o=n.PDFViewerApplication;this._pdfViewer=o.pdfViewer,this._pdfViewer.viewer.classList.add("has-transparent-text-layer"),this._pdfContainer=o.appConfig?.appContainer??document.body,this._pdfMetadata=new Ki(o),this._observer=new MutationObserver(Ci((()=>this._update()),100)),this._observer.observe(this._pdfViewer.viewer,{attributes:!0,attributeFilter:["data-loaded"],childList:!0,subtree:!0}),this._reanchoringMaxWait=t.reanchoringMaxWait??3e3,this._banner=new er,this._checkForSelectableText(),this._sideBySideActive=!1,this._updateAnnotationLayerVisibility=()=>{const e=n.getSelection()
|
||||
;this._pdfViewer.viewer.classList.toggle("is-selecting",!e.isCollapsed)},this._listeners=new be,this._listeners.add(document,"selectionchange",this._updateAnnotationLayerVisibility),this._destroyed=!1}destroy(){this.fitSideBySide({expanded:!1,width:0,toolbarWidth:0,height:window.innerHeight}),this._listeners.removeAll(),this._pdfViewer.viewer.classList.remove("has-transparent-text-layer"),this._observer.disconnect(),this._banner.destroy(),this._destroyed=!0}uri(){return this._pdfMetadata.getUri()}getMetadata(){return this._pdfMetadata.getMetadata()}showContentInfo(e){this._banner.setContentInfo(e)}anchor(e,t){return qi(0,t)}getAnnotatableRange(e){try{const t=uo.trimmedRange(e);if(function(e){try{return $i(e),!0}catch{return!1}}(t))return t}catch(e){if(!(e instanceof RangeError))throw e}return null}canStyleClusteredHighlights(){return!0}describe(e,t){return zi(e,t)}async _checkForSelectableText(){try{await this.uri()}catch{return}if(!this._destroyed)try{const e=await async function(){const e=Li();let t=!1
|
||||
;for(let n=0;n<e.pagesCount;n++)if((await Ii(n)).trim().length>0){t=!0;break}return t}();this._banner.showNoTextWarning(!e)}catch(e){console.warn("Unable to check for text in PDF:",e)}}_update(){const e=[],t=this._pdfViewer.pagesCount;for(let e=0;e<t;e++){const t=this._pdfViewer.getPageView(e);if(t?.textLayer&&Di(t.textLayer))switch(t.renderingState){case Ri.INITIAL:t.textLayer=null;break;case Ri.FINISHED:n=t.div,n.querySelector(ho)?.remove()}}var n;for(const t of this._annotator.anchors)if(t.highlights){if(e.includes(t.annotation))continue;for(let n=0;n<t.highlights.length;n++){const o=t.highlights[n];if(!document.body.contains(o)){t.highlights.splice(n,1),delete t.range,e.push(t.annotation);break}}}e.map((e=>this._annotator.anchor(e)))}contentContainer(){return document.querySelector("#viewerContainer")}fitSideBySide(e){const t=window.innerWidth-e.width,n=e.expanded&&t>=680,o=n?e.width:e.toolbarWidth;this._pdfContainer.style.width=`calc(100% - ${o}px)`;const i=this._pdfViewer.currentScaleValue
|
||||
;return"auto"!==i&&"page-fit"!==i&&"page-width"!==i||(this._pdfViewer.currentScaleValue=i),this._pdfViewer.update(),this._sideBySideActive=n,n}sideBySideActive(){return this._sideBySideActive}async scrollToAnchor(e){const t=e.annotation,n=Ji(e),o=this._anchorOffset(e);if(null!==o&&(await _i(this.contentContainer(),o),n)){const e=await this._waitForAnnotationToBeAnchored(t,this._reanchoringMaxWait);if(!e)return;const n=this._anchorOffset(e);if(null===n)return;await _i(this.contentContainer(),n)}}async _waitForAnnotationToBeAnchored(e,t){const n=Date.now();let o;do{o=this._annotator.anchors.find((t=>t.annotation===e)),o&&!Ji(o)||(o=null,await Zi(20))}while(!o&&Date.now()-n<t);return o??null}_anchorOffset(e){if(!e.highlights)return null;return function(e,t){let n=0;for(;e!==t&&t.contains(e);)n+=e.offsetTop,e=e.offsetParent;return n}(e.highlights[0],this.contentContainer())}}function nr(e){if(!e.includes("["))return e;let t="",n=!1,o=!1;for(const i of e)n||"^"!==i?(n||"["!==i?!n&&o&&"]"===i?o=!1:o||(t+=i):o=!0,
|
||||
n=!1):n=!0;return t}function or(e){const t=nr(e),n=t.indexOf("!");return-1===n?t:t.slice(0,n)}class ir{constructor(e,t,n){this._element=e,this._onFrameAdded=t,this._onFrameRemoved=n,this._annotatableFrames=new Set,this._isDisconnected=!1,this._mutationObserver=new MutationObserver(Ci((()=>{this._discoverFrames()}),40)),this._discoverFrames(),this._mutationObserver.observe(this._element,{childList:!0,subtree:!0,attributeFilter:["enable-annotation"]})}disconnect(){this._isDisconnected=!0,this._mutationObserver.disconnect()}async _addFrame(e){this._annotatableFrames.add(e);try{if(await rr(e),this._isDisconnected)return;e.contentWindow.addEventListener("unload",(()=>{this._removeFrame(e)})),this._onFrameAdded(e)}catch{console.warn(`Unable to inject the Hypothesis client (from '${document.location.href}' into a cross-origin frame '${e.src}')`)}}_removeFrame(e){this._annotatableFrames.delete(e),this._onFrameRemoved(e)}_discoverFrames(){const e=new Set(this._element.querySelectorAll("iframe[enable-annotation]"))
|
||||
;for(const t of e)this._annotatableFrames.has(t)||this._addFrame(t);for(const t of this._annotatableFrames)e.has(t)||this._removeFrame(t)}}function rr(e){return new Promise(((t,n)=>{const o=sr(e,((e,i)=>{o(),i?t(i):n(e)}))}))}function sr(e,t,{pollInterval:n=10}={}){let o,i;const r=new WeakSet,s=()=>{clearTimeout(o),o=void 0},a=()=>{const n=e.contentDocument;if(n){if(!r.has(n)){if(r.add(n),s(),!function(e){return"about:blank"===e.contentDocument?.location.href&&e.hasAttribute("src")&&"about:blank"!==e.src}(e)){"interactive"===n.readyState||"complete"===n.readyState?t(null,n):n.addEventListener("DOMContentLoaded",(()=>t(null,n)))}e.contentDocument&&e.contentWindow?.addEventListener("unload",i)}}else{s();const n=e.isConnected?"Frame is cross-origin":"Frame is disconnected";t(new Error(n))}};let l=!1;i=()=>{s(),l||(o=setInterval(a,n))},e.addEventListener("load",a);const c=setTimeout(a,0);return()=>{l=!0,clearTimeout(c),s(),e.removeEventListener("load",a)}}class ar{constructor(e,t){this._config=t,
|
||||
this._frameObserver=new ir(e,(e=>lr(e,t)),(()=>{}))}destroy(){this._frameObserver.disconnect()}}async function lr(e,t,n){if(null!==e.contentDocument.querySelector("script.js-hypothesis-config"))return;await rr(e);const{assetRoot:o,notebookAppUrl:i,profileAppUrl:r,sidebarAppUrl:s}=bn(document),a={...t,assetRoot:o,notebookAppUrl:i,profileAppUrl:r,sidebarAppUrl:s,subFrameIdentifier:n??Jt(10)},l=document.createElement("script");l.className="js-hypothesis-config",l.setAttribute("data-remove-on-unload",""),l.type="application/json",l.innerText=JSON.stringify(a);const c=document.createElement("script");c.async=!0,c.src=t.clientUrl;const d=e.contentDocument;d.body.appendChild(l),d.body.appendChild(c)}class cr{constructor(e,t,n){if(t.length!==n.length)throw new Error("Char boxes length does not match text length");const o=e.parentNode,i=document.createElement("hypothesis-text-layer");o.insertBefore(i,e.nextSibling),o.style.position="relative",i.style.position="absolute",i.style.top="0",i.style.left="0",
|
||||
i.style.color="transparent",i.style.textAlign="left",i.style.mixBlendMode="multiply";const r="sans-serif";i.style.fontSize="16px",i.style.fontFamily=r;const s=document.createElement("canvas").getContext("2d");s.font=`16px ${r}`;const a=(e,t,n="px")=>`calc(var(--${e}-scale) * ${t}${n})`,l=function(e,t){const n=[];let o={text:"",rect:new DOMRect};const i=()=>{o.text.length>0&&(n.push(o),o={text:"",rect:new DOMRect})};for(const[n,r]of e.entries()){const e=t[n],s=/\s/.test(e);o.text.length>0&&!Nn(o.rect,r)&&i(),o.rect=Sn(o.rect,r),o.text+=s?" ":e,s&&i()}i();const r=[];let s={words:[],rect:new DOMRect};const a=()=>{s.words.length>0&&(r.push(s),s={words:[],rect:new DOMRect})};for(const e of n){const t=s.words[s.words.length-1];if(t){const n=En(t.rect),o=En(e.rect).x-n.x;(!Nn(t.rect,e.rect)||o<0)&&a()}s.words.push(e),s.rect=Sn(s.rect,e.rect)}a();const l=[];let c={lines:[],rect:new DOMRect};const d=()=>{c.lines.length>0&&(l.push(c),c={lines:[],rect:new DOMRect})};for(const e of r){const t=c.lines[c.lines.length-1]
|
||||
;if(t){const n=En(t.rect),o=En(e.rect).y-n.y;(!Cn(t.rect,e.rect)||Nn(t.rect,e.rect)||o<0||o>4*e.rect.height)&&d()}c.lines.push(e),c.rect=Sn(c.rect,e.rect)}return d(),l}(t,n);for(const e of l){const t=document.createElement("hypothesis-text-column");t.style.display="block",t.style.position="absolute",t.style.left=a("x",e.rect.left),t.style.top=a("y",e.rect.top);let n=null;for(const o of e.lines){const i=document.createElement("hypothesis-text-line");i.style.display="block",i.style.marginLeft=a("x",o.rect.left-e.rect.left),i.style.height=a("y",o.rect.height),n&&(i.style.marginTop=a("y",o.rect.top-n.rect.bottom)),n=o,i.style.whiteSpace="nowrap";let r=null;for(const e of o.words){const t=document.createElement("hypothesis-text-word");t.style.display="inline-block",t.style.transformOrigin="top left",t.textContent=e.text,r&&(t.style.marginLeft=a("x",e.rect.left-r.rect.right)),r=e,t.style.width=a("x",e.rect.width),t.style.height=a("y",e.rect.height),t.style.whiteSpace="pre"
|
||||
;const n=s.measureText(e.text),o=a("x",e.rect.width/n.width,""),l=a("y",e.rect.height/16,"");t.style.transform=`scale(${o}, ${l})`,i.append(t)}t.append(i)}i.append(t)}const c=()=>{const{width:t,height:n}=e.getBoundingClientRect();i.style.width=t+"px",i.style.height=n+"px",i.style.setProperty("--x-scale",`${t}`),i.style.setProperty("--y-scale",`${n}`)};c(),this.container=i,this._updateTextLayerSize=Ci(c,{maxWait:50}),this._listeners=new be,"undefined"!=typeof ResizeObserver&&(this._imageSizeObserver=new ResizeObserver((()=>{this._updateTextLayerSize()})),this._imageSizeObserver.observe(e)),this._listeners.add(window,"resize",this._updateTextLayerSize)}updateSync(){this._updateTextLayerSize(),this._updateTextLayerSize.flush()}destroy(){this.container.remove(),this._listeners.removeAll(),this._updateTextLayerSize.cancel(),this._imageSizeObserver?.disconnect()}}function dr(e=document){return e.querySelector("mosaic-book")}function ur(e=window){if(dr(e.document))return"container"
|
||||
;const t=e.frameElement?.ownerDocument;return t&&dr(t)?"content":null}class hr{constructor(e){const t=dr();if(!t)throw new Error("Book container element not found");const n=new WeakSet,o=t.shadowRoot,i=()=>{const t=o.querySelector("iframe");t&&!n.has(t)&&(n.add(t),sr(t,((n,o)=>{if(n)return;const i=o.body;i&&!i.querySelector("#page-content")&&lr(t,e,"vitalsource-content")})))};i(),this._frameObserver=new MutationObserver(i),this._frameObserver.observe(o,{childList:!0,subtree:!0})}destroy(){this._frameObserver.disconnect()}}function fr(){return document.querySelector("img#pbk-page")}class mr extends rn.TinyEmitter{constructor(e=document.body,t={}){super();const n=t.bookElement??dr(window.parent.document);if(!n)throw new Error("Failed to find <mosaic-book> element in container frame");this._bookElement=n;const o=new Ho;this._htmlIntegration=new wi({container:e,features:o}),this._listeners=new be;const i=["mouseup","mousedown","mouseout"];for(const e of i)this._listeners.add(document.documentElement,e,(e=>{
|
||||
e.stopPropagation()}));const r=window.frameElement;r&&function(e){if("no"!==e.getAttribute("scrolling"))return;const t=document.createElement("style");t.textContent="iframe { height: 100% !important; }",e.insertAdjacentElement("beforebegin",t);const n=()=>e.removeAttribute("scrolling");n(),new MutationObserver(n).observe(e,{attributes:!0})}(r);const s=fr(),a=window.innerPageData;if(s&&a){const e=a.glyphs.glyphs.map((e=>{const t=e.l/100,n=e.r/100,o=e.t/100,i=e.b/100;return new DOMRect(t,o,n-t,i-o)}));this._textLayer=new cr(s,e,a.words),this._textLayer.container.style.zIndex="100",this._sideBySideActive=!1}}getAnnotatableRange(e){return this._htmlIntegration.getAnnotatableRange(e)}destroy(){this._textLayer&&(this._textLayer.destroy(),this.fitSideBySide({expanded:!1,height:window.innerHeight,width:0,toolbarWidth:0})),this._listeners.removeAll(),this._htmlIntegration.destroy()}anchor(e,t){return this._htmlIntegration.anchor(e,t)}async describe(e,t){
|
||||
const n=this._htmlIntegration.describe(e,t),{cfi:o,index:i,page:r,title:s,url:a}=await this._getPageInfo({includeTitle:!0,includePageIndex:!0}),l=[{type:"EPUBContentSelector",cfi:o,url:a,title:s}];if("number"==typeof i){const e={type:"PageSelector",index:i,label:r};l.push(e)}return n.push(...l),n}contentContainer(){return this._htmlIntegration.contentContainer()}fitSideBySide(e){const t=fr();if(t&&this._textLayer){const n=t.parentElement,o=this._textLayer,i=window.innerWidth-e.width;return this._sideBySideActive=!1,In((()=>{e.expanded&&i>480?(n.style.textAlign="left",t.style.width=`${i}px`,this._sideBySideActive=!0):(n.style.textAlign="",t.style.width=""),o.updateSync()})),this._sideBySideActive}return this._htmlIntegration.fitSideBySide(e)}sideBySideActive(){return"boolean"==typeof this._sideBySideActive?this._sideBySideActive:this._htmlIntegration.sideBySideActive()}async getMetadata(){return{title:this._bookElement.getBookInfo().title,link:[]}}navigateToSegment(e){
|
||||
const t=e.target[0].selector?.find((e=>"EPUBContentSelector"===e.type));if(t?.cfi)this._bookElement.goToCfi(t.cfi);else{if(!t?.url)throw new Error("No segment information available");this._bookElement.goToURL(function(e){const t=new URL(e,document.baseURI);return t.pathname+t.search}(t.url))}}persistFrame(){return!0}async _getPageInfo({includeTitle:e=!1,includePageIndex:t=!1}={}){const[n,o,i]=await Promise.all([this._bookElement.getCurrentPage(),e?this._bookElement.getTOC():void 0,t?this._bookElement.getPages():void 0]),r=["absoluteURL","cfi"];for(const e of r)if(!(e in n))throw new Error(`Page metadata field "${e}" is missing`);let s;if(o){s=n.chapterTitle;const e=or(n.cfi),t=o.data?.find((t=>or(t.cfi)===e));t&&(s=t.title)}let a=n.index;if(void 0===a&&i){const e=i.data?.findIndex((e=>e.cfi===n.cfi));-1!==e&&(a=e)}return{cfi:n.cfi,index:a,page:n.page,title:s,url:new URL(n.absoluteURL,document.baseURI).toString()}}async _getPageRange(e){let t=[];try{const e=await this._bookElement.getPageBreaks()
|
||||
;e.ok&&e.data&&(t=e.data)}catch(e){console.error("Failed to get page breaks",e)}const n=nr(e),o=t.filter((e=>e.cfiWithoutAssertions.split("!")[0]===n));let i;if(o.length>0){i={start:o[0].label,end:o[o.length-1].label}}return i}async segmentInfo(){const{cfi:e,url:t}=await this._getPageInfo();return{cfi:e,pages:await this._getPageRange(e),url:t}}async uri(){const e=this._bookElement.getBookInfo().isbn;if(!e)throw new Error("Unable to get book ID from VitalSource");return`https://bookshelf.vitalsource.com/reader/books/${e}`}async scrollToAnchor(e){return this._htmlIntegration.scrollToAnchor(e)}}function gr(e){if(void 0!==window.PDFViewerApplication)return new tr(e);return"content"===ur()?new mr(document.body):new wi({features:e.features,sideBySideOptions:e.sideBySide})}function pr(){return Pe(qt,{classes:"fixed left-[10px] top-[10px]","data-testid":"outside-assignment-notice",status:"notice",variant:"raised",children:"You are outside the page range for this assignment. Annotations made here may not be counted."
|
||||
})}class _r{constructor(e){this._visible=!1,this._container=new Jn("notice",(()=>this._render())),e.appendChild(this._container.element)}destroy(){this._container.destroy()}setVisible(e){this._visible=e,this._container.render()}_render(){return this._visible?Pe(pr,{}):null}}class br{constructor(e,t=document){let n=!1;this._pendingCallback=null;const o=(n=10)=>{this._pendingCallback=setTimeout((()=>{e(go(t.getSelection()))}),n)},i=e=>{if("mousedown"===e.type&&(n=!0),"mouseup"===e.type&&(n=!1),n)return;this._cancelPendingCallback();const t="mouseup"===e.type?10:100;o(t)};this._document=t,this._listeners=new be,this._listeners.add(t,"selectionchange",i),this._listeners.add(t.body,"mousedown",i),this._listeners.add(t.body,"mouseup",i),o(1)}disconnect(){this._listeners.removeAll(),this._cancelPendingCallback()}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}}function vr(e,t){if(e===t)return!0;if(e.parent!==t)return!1;if(!e.frameElement)return!1
|
||||
;return e.frameElement.getBoundingClientRect().width/e.parent.innerWidth>=.8}function wr(){return function(e,t){const n=new Set,o=new Set;return bo(e,(e=>{for(;e&&!n.has(e);){n.add(e);const i=t(e);null!=i&&o.add(i),e=e.parentNode}})),[...o]}(go()??new Range,(e=>e._annotation?.$tag))}function yr(e){const t=function(e){let t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;const n=[];for(;t;)t.classList.contains("hypothesis-highlight")&&n.push(t),t=t.parentElement;return n}(e).map((e=>e._annotation)).filter((e=>void 0!==e)).map((e=>e?.$tag));return t}function xr(e){if(!e.range)return null;try{return e.range.toRange()}catch{return null}}function Nr(){document.getSelection()?.removeAllRanges()}class Cr extends CustomEvent{constructor(e){super("scrolltorange",{bubbles:!0,cancelable:!0,detail:e}),this._ready=null}get ready(){return this._ready}waitUntil(e){this._ready=e}}class Sr extends rn.TinyEmitter{constructor(e,t={},n=window){super(),this.element=e,this._contentReady=t.contentReady,this._hostFrame=n,
|
||||
this._highlightsVisible=!1,this._isAdderVisible=!1,this._informHostOnNextSelectionClear=!0,this.selectedRanges=[],this._outsideAssignmentNotice=null,this._adder=new to(this.element,{onAnnotate:()=>this.createAnnotation(),onHighlight:()=>this.createAnnotation({highlight:!0}),onShowAnnotations:e=>this.selectAnnotations(e,{focusInSidebar:!0})}),this._selectionObserver=new br((e=>{e?this._onSelection(e):this._onClearSelection()})),this.anchors=[],this._annotations=new Set,this._frameIdentifier=t.subFrameIdentifier||null,this._portFinder=new tn({hostFrame:this._hostFrame,source:"guest",sourceId:this._frameIdentifier??void 0}),this.features=new Ho,this._featureFlagsReceived=new Promise((e=>{this.features.on("flagsChanged",e)})),this.sideBySide=t.sideBySide,this._integration=gr(this),this._integration.on("uriChanged",(()=>this._sendDocumentInfo())),t.contentInfoBanner&&this._integration.showContentInfo?.(t.contentInfoBanner),
|
||||
this._integration.canStyleClusteredHighlights?.()&&(this._clusterToolbar=new qo(this._integration.contentContainer(),{features:this.features})),this._hostRPC=new pn,this._connectHost(n),this._sidebarRPC=new pn,this._sidebarLayout=null,this._connectSidebar(),this._bucketBarClient=new Mo({contentContainer:this._integration.contentContainer(),hostRPC:this._hostRPC}),this._listeners=new be,this._setupElementEvents(),this._hoveredAnnotations=new Set}_sideBySideActive(){return"manual"===this.sideBySide?.mode&&this.sideBySide.isActive?this.sideBySide.isActive():this._integration.sideBySideActive()}_setupElementEvents(){this._listeners.add(this.element,"mouseup",(e=>{const{target:t,metaKey:n,ctrlKey:o}=e,i=yr(t);if(i.length&&this._highlightsVisible){const e=n||o;this.selectAnnotations(i,{toggle:e})}})),this._listeners.add(this.element,"pointerdown",(e=>{
|
||||
this._sideBySideActive()||e.composedPath().some((e=>e instanceof Element&&e.localName.startsWith("hypothesis-")))||yr(e.target).length||vr(window,this._hostFrame)&&this._sidebarLayout?.expanded&&window.innerWidth-e.clientX<this._sidebarLayout.width||this._sidebarRPC.call("closeSidebar")})),this._listeners.add(this.element,"mouseover",(({target:e})=>{const t=yr(e);t.length&&this._highlightsVisible&&this._sidebarRPC.call("hoverAnnotations",t)})),this._listeners.add(this.element,"mouseout",(()=>{this._highlightsVisible&&this._sidebarRPC.call("hoverAnnotations",[])})),this._listeners.add(this.element,"keydown",(e=>{this._handleShortcut(e)})),this._listeners.add(window,"resize",(()=>this._repositionAdder()))}async getDocumentInfo(){const[e,t,n]=await Promise.all([this._integration.uri(),this._integration.getMetadata(),this._integration.segmentInfo?.()]);return{uri:bi(e),metadata:t,segmentInfo:n,persistent:this._integration.persistFrame?.()??!1}}async _sendDocumentInfo(){
|
||||
this._integration.waitForFeatureFlags?.()&&await this._featureFlagsReceived;const e=await this.getDocumentInfo();this._sidebarRPC.call("documentInfoChanged",e)}_repositionAdder(){if(!this._isAdderVisible)return;const e=go();e&&this._onSelection(e)}async _connectHost(e){this._hostRPC.on("clearSelection",(()=>{go()&&(this._informHostOnNextSelectionClear=!1,Nr())})),this._hostRPC.on("createAnnotation",(()=>this.createAnnotation())),this._hostRPC.on("hoverAnnotations",(e=>this._hoverAnnotations(e))),this._hostRPC.on("scrollToAnnotation",(e=>{this._scrollToAnnotation(e)})),this._hostRPC.on("selectAnnotations",((e,t)=>this.selectAnnotations(e,{toggle:t}))),this._hostRPC.on("sidebarLayoutChanged",(t=>{vr(window,e)&&this.fitSideBySide(t),this.element.dispatchEvent(new Lo({sidebarLayout:t,sideBySideActive:this._sideBySideActive()}))})),this._hostRPC.on("close",(()=>this.emit("hostDisconnected")));const t=await this._portFinder.discover("host");this._hostRPC.connect(t)}async _scrollToAnchor(e){const t=xr(e)
|
||||
;if(!t)return;const n=new Cr(t);this.element.dispatchEvent(n)&&(await n.ready,await this._integration.scrollToAnchor(e))}async _scrollToAnnotation(e){const t=this.anchors.find((t=>t.annotation.$tag===e));t?.highlights&&await this._scrollToAnchor(t)}async _connectSidebar(){this._sidebarRPC.on("featureFlagsUpdated",(e=>this.features.update(e))),this._sidebarRPC.on("hoverAnnotations",(e=>this._hoverAnnotations(e))),this._sidebarRPC.on("scrollToAnnotation",(e=>{this._scrollToAnnotation(e)})),this._sidebarRPC.on("setHighlightsVisible",(e=>{this.setHighlightsVisible(e,!1)})),this._sidebarRPC.on("deleteAnnotation",(e=>this.detach(e))),this._sidebarRPC.on("loadAnnotations",(async e=>{try{await Promise.all(e.map((e=>this.anchor(e))))}catch(e){console.warn("Failed to anchor annotations:",e)}})),this._sidebarRPC.on("showContentInfo",(e=>this._integration.showContentInfo?.(e))),this._sidebarRPC.on("setOutsideAssignmentNoticeVisible",(e=>{this._setOutsideAssignmentNoticeVisible(e)})),
|
||||
this._sidebarRPC.on("navigateToSegment",(e=>this._integration.navigateToSegment?.(e))),this._portFinder.discover("sidebar").then((e=>{this._sidebarRPC.connect(e)})),this._sendDocumentInfo()}destroy(){var e;this._portFinder.destroy(),this._hostRPC.destroy(),this._sidebarRPC.destroy(),this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.destroy(),this._bucketBarClient.destroy(),this._clusterToolbar?.destroy(),this._outsideAssignmentNotice?.destroy(),e=this.element,Co(Array.from(e.querySelectorAll("hypothesis-highlight"))),this._integration.destroy()}async anchor(e){this._contentReady&&(await this._contentReady,this._contentReady=void 0);const t=e=>{const t=xr(e);if(!t)return;const n=xo(t,e.annotation?.$cluster);n.forEach((t=>{t._annotation=e.annotation})),e.highlights=n,this._hoveredAnnotations.has(e.annotation.$tag)&&So(n,!0)};this.detach(e.$tag,!1),this._annotations.add(e.$tag),e.target||(e.target=[]);const n=await Promise.all(e.target.map((async t=>{
|
||||
if(!t.selector||!t.selector.some((e=>"TextQuoteSelector"===e.type)))return{annotation:e,target:t};let n;try{const o=await this._integration.anchor(this.element,t.selector),i=uo.fromRange(o);n={annotation:e,target:t,range:i}}catch{n={annotation:e,target:t}}return n})));if(!this._annotations.has(e.$tag))return[];for(const e of n)t(e);return e.$orphan=n.length>0&&n.every((e=>e.target.selector&&!e.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",e),n}detach(e,t=!0){this._annotations.delete(e);const n=[];for(const t of this.anchors)t.annotation.$tag!==e?n.push(t):t.highlights&&Co(t.highlights);this._updateAnchors(n,t)}_updateAnchors(e,t){this.anchors=e,this._clusterToolbar?.scheduleClusterUpdates(),t&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:e=!1}={}){const t=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(t.map((e=>this._integration.describe(o,e))))).map((e=>({
|
||||
source:n.uri,selector:e}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:e,$cluster:e?"user-highlights":"user-annotations",$tag:"a:"+Jt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Nr(),r}_hoverAnnotations(e){this._hoveredAnnotations.clear(),e.forEach((e=>this._hoveredAnnotations.add(e)));for(const t of this.anchors)if(t.highlights){const n=e.includes(t.annotation.$tag);So(t.highlights,n)}this._sidebarRPC.call("hoverAnnotations",e)}_onSelection(e){const t=this._integration.getAnnotatableRange(e);if(!t)return void this._onClearSelection();const n=document.getSelection(),o=po(n),i=vo(n);i?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=wr(),this._isAdderVisible=!0,this._adder.show(i,o)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}
|
||||
selectAnnotations(e,{toggle:t=!1,focusInSidebar:n=!1}={}){t?this._sidebarRPC.call("toggleAnnotationSelection",e):this._sidebarRPC.call("showAnnotations",e,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(e,t=!0){!function(e,t){e.classList.toggle("hypothesis-highlights-always-on",t)}(this.element,e),this._highlightsVisible=e,t&&this._hostRPC.call("highlightsVisibleChanged",e)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(e){this._sidebarLayout=e,this._integration.fitSideBySide(e)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(e){$n(e,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(e){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new _r(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function Er(e,t){const n=new URL(e),o=new URLSearchParams;return o.append("config",JSON.stringify(t)),n.hash=o.toString(),n.toString()}function Ar(e,t){const n={}
|
||||
;for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.1574.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const e=n.services[0];e.onLoginRequest&&(e.onLoginRequestProvided=!0),e.onLogoutRequest&&(e.onLogoutRequestProvided=!0),e.onSignupRequest&&(e.onSignupRequestProvided=!0),e.onProfileRequest&&(e.onProfileRequestProvided=!0),e.onHelpRequest&&(e.onHelpRequestProvided=!0)}return n}function Rr({closed:e,onClose:t,children:n,"data-testid":o,"aria-label":i}){const r=re(null);return oe((()=>{e?r.current?.close():r.current?.showModal()}),[e]),oe((()=>{const e=r.current;return e?.addEventListener("cancel",t),()=>{e?.removeEventListener("cancel",t)}}),[t]),Pe("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":o,"aria-label":i,children:n})}function kr({closed:e,children:t,...n}){return Pe("div",{...n,
|
||||
className:Re("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:e}),children:Pe("div",{className:"relative w-full h-full",children:t})})}function Pr({document_:e=document,...t}){return Pe(se((()=>function(e){return"function"==typeof e.createElement("dialog").showModal}(e)?Rr:kr),[e]),{...t})}function Tr({config:e,groupId:t}){return Pe("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:Er(e.notebookAppUrl,{...Ar(e.notebookAppUrl,e),group:t})})}function Mr({eventBus:e,config:t}){const[n,o]=ne(0),[i,r]=ne(!0),[s,a]=ne(null),l=re(""),c=re(null);oe((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),oe((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),oe((()=>{const t=e.createEmitter();return t.subscribe("openNotebook",(e=>{r(!1),o((e=>e+1)),a(e)})),c.current=t,()=>{t.destroy()}}),[e]);const d=ae((()=>{r(!0),c.current?.publish("closeNotebook")}),[])
|
||||
;return null===s?null:Pe(Pr,{closed:i,onClose:d,"data-testid":"notebook-outer","aria-label":"Hypothesis notebook",children:[Pe("div",{className:"absolute right-0 m-3",children:Pe(Nt,{title:"Close notebook",onClick:d,variant:"dark",classes:Re("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:Pe(Fe,{className:"w-4 h-4"})})}),Pe(Tr,{config:t,groupId:s},n)]})}class Lr{constructor(e,t,n){this._container=new Jn("notebook",(()=>Pe(Mr,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Or({eventBus:e,config:t}){const[n,o]=ne(!0),i=re(null);oe((()=>{const t=e.createEmitter();return t.subscribe("openProfile",(()=>{o(!1)})),i.current=t,()=>{t.destroy()}}),[e]);const r=()=>{o(!0),i.current?.publish("closeProfile")};return n?null:Pe(Pr,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[Pe("div",{className:"absolute right-0 m-3",children:Pe(Nt,{
|
||||
title:"Close profile dialog",onClick:r,variant:"dark",classes:Re("!bg-transparent enabled:hover:!bg-grey-3"),children:Pe(Fe,{className:"w-4 h-4"})})}),Pe("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:t.profileAppUrl})]})}class Ir{constructor(e,t,n){this._container=new Jn("profile",(()=>Pe(Or,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Br({above:e,below:t,buckets:n,onFocusAnnotations:o,onScrollToAnnotation:i,onSelectAnnotations:r}){const s=e.anchors.length>0,a=t.anchors.length>0,l=e=>e.anchors.map((e=>e.tag));return Pe("ul",{className:"relative",children:[s&&Pe("li",{className:"absolute right-0 pointer-events-auto mt-[-11px]",style:{top:e.position},children:Pe(Yt,{"data-testid":"up-navigation-button",direction:"up",onClick:()=>{const t=[...e.anchors].sort(((e,t)=>e.bottom-t.bottom)),n=t[t.length-1];i(n.tag)},onBlur:()=>o([]),onFocus:()=>o(l(e)),onMouseEnter:()=>o(l(e)),onMouseOut:()=>o([]),
|
||||
title:`Go up to next annotations (${e.anchors.length})`,children:e.anchors.length})}),n.map(((e,t)=>Pe("li",{className:"absolute right-0 pointer-events-auto mt-[-8px]",style:{top:e.position},children:Pe(Yt,{direction:"left",onClick:t=>r(l(e),t.metaKey||t.ctrlKey),onBlur:()=>o([]),onFocus:()=>o(l(e)),onMouseEnter:()=>o(l(e)),onMouseOut:()=>o([]),title:`Select nearby annotations (${e.anchors.length})`,children:e.anchors.length})},t))),a&&Pe("li",{className:"absolute right-0 pointer-events-auto",style:{top:t.position},children:Pe(Yt,{"data-testid":"down-navigation-button",direction:"down",onClick:()=>{const e=[...t.anchors].sort(((e,t)=>e.top-t.top)),n=e[0];i(n.tag)},onBlur:()=>o([]),onFocus:()=>o(l(t)),onMouseEnter:()=>o(l(t)),onMouseOut:()=>o([]),title:`Go up to next annotations (${t.anchors.length})`,children:t.anchors.length})})]})}class Hr{constructor(e,{onFocusAnnotations:t,onScrollToAnnotation:n,onSelectAnnotations:o}){this._positions=[],this._container=new Jn("bucket-bar",(()=>this._render())),
|
||||
Object.assign(this._container.element.style,{display:"block",flexGrow:"1",width:"100%"}),e.appendChild(this._container.element),this._onFocusAnnotations=t,this._onScrollToAnnotation=n,this._onSelectAnnotations=o,this._container.render()}destroy(){this._container.destroy()}update(e){this._positions=e,this._container.render()}_render(){const e=function(e,t){const n=[],o=[],i=[];let r=null;function s(e){const{bottom:t,top:n}=e;return{bottom:t,position:n+(t-n)/2,anchors:[e],top:n}}const a=t.getBoundingClientRect(),l=e.map((e=>({tag:e.tag,top:e.top-a.top,bottom:e.bottom-a.top})));for(const e of l){const t=(e.top+e.bottom)/2;if(t<30){n.push(e);continue}if(t>a.height-30){o.push(e);continue}if(!r){r=s(e);continue}const l=e.top>r.top&&e.bottom<r.bottom;if(e.top-r.bottom>60&&!l)i.push(r),r=s(e);else{const t=e.bottom>r.bottom?e.bottom:r.bottom,n=t-r.top;r.anchors.push(e),r.bottom=t,r.position=r.top+n/2}}return r&&i.push(r),{above:{anchors:n,position:30},below:{anchors:o,position:a.height-30},buckets:i}
|
||||
}(this._positions,this._container.element);return Pe(Br,{above:e.above,below:e.below,buckets:e.buckets,onFocusAnnotations:e=>this._onFocusAnnotations(e),onScrollToAnnotation:e=>this._onScrollToAnnotation(e),onSelectAnnotations:(e,t)=>this._onSelectAnnotations(e,t)})}}function Fr({emitter:e}){const[t,n]=ne([]),o=ae((e=>n((t=>[...t,e]))),[]),i=ae((e=>n((t=>t.filter((t=>t.id!==e))))),[]);return oe((()=>(e.subscribe("toastMessageAdded",o),e.subscribe("toastMessageDismissed",i),()=>{e.unsubscribe("toastMessageAdded",o),e.unsubscribe("toastMessageDismissed",i)})),[e,i,o]),Pe(jt,{messages:t,onMessageDismiss:i})}function Dr({icon:e,...t}){return Pe(wt,{classes:Re("justify-center rounded","w-[30px] h-[30px]","shadow border bg-white text-grey-6 hover:text-grey-9"),...t,size:"custom",variant:"custom",children:Pe(e,{})})}function Vr({highlightsVisible:e}){return Pe("div",{className:"sr-only",role:"status","data-testid":"toolbar-status",children:e?"Highlights visible":"Highlights hidden"})}
|
||||
function Ur({closeSidebar:e,createAnnotation:t,isSidebarOpen:n,sidebarContainerId:o,newAnnotationType:i,showHighlights:r,toggleHighlights:s,toggleSidebar:a,toggleSidebarRef:l,useMinimalControls:c=!1}){return Pe("div",{className:Re("absolute left-[-33px] w-[33px] z-2","text-px-base leading-none"),children:[c&&n&&Pe(wt,{classes:Re("transition-colors focus-visible-ring ring-inset","w-[27px] h-[27px] mt-[140px] ml-px-1.5","flex items-center justify-center bg-white border","text-grey-6 hover:text-grey-9 transition-colors","border-r-0","shadow-sidebar"),title:"Close annotation sidebar",onClick:e,unstyled:!0,children:Pe(Fe,{})}),!c&&Pe(x,{children:[Pe(wt,{classes:Re("transition-colors focus-visible-ring ring-inset","h-[40px] w-[33px] pl-[6px] rounded-bl","bg-white text-grey-5 hover:text-grey-9","border-l border-b"),elementRef:l,title:"Annotation sidebar",expanded:n,"aria-controls":o,onClick:a,unstyled:!0,children:Pe(n?ze:qe,{})}),Pe("div",{className:"space-y-px-1.5 mt-px-2",children:[Pe(Dr,{title:"Show highlights",
|
||||
icon:r?bt:et,pressed:r,onClick:s}),Pe(Dr,{title:"note"===i?"New page note":"New annotation",icon:"note"===i?lt:Be,onClick:t})]}),Pe(Vr,{highlightsVisible:r})]})]})}class qr{constructor(e,t){const{createAnnotation:n,setSidebarOpen:o,setHighlightsVisible:i}=t;this._container=e,this._useMinimalControls=!1,this._newAnnotationType="note",this._highlightsVisible=!1,this._sidebarOpen=!1,this._sidebarContainerId=t.sidebarContainerId,this._closeSidebar=()=>o(!1),this._toggleSidebar=()=>o(!this._sidebarOpen),this._toggleHighlights=()=>i(!this._highlightsVisible),this._createAnnotation=()=>{n(),o(!0)},this._sidebarToggleButton={current:null},this.render()}getWidth(){return this._container.firstChild.getBoundingClientRect().width}set useMinimalControls(e){this._useMinimalControls=e,this.render()}get useMinimalControls(){return this._useMinimalControls}set sidebarOpen(e){this._sidebarOpen=e,this.render()}get sidebarOpen(){return this._sidebarOpen}set newAnnotationType(e){this._newAnnotationType=e,this.render()}
|
||||
get newAnnotationType(){return this._newAnnotationType}set highlightsVisible(e){this._highlightsVisible=e,this.render()}get highlightsVisible(){return this._highlightsVisible}get sidebarToggleButton(){return this._sidebarToggleButton.current}render(){V(Pe(Ur,{closeSidebar:this._closeSidebar,createAnnotation:this._createAnnotation,newAnnotationType:this._newAnnotationType,isSidebarOpen:this._sidebarOpen,sidebarContainerId:this._sidebarContainerId,showHighlights:this._highlightsVisible,toggleHighlights:this._toggleHighlights,toggleSidebar:this._toggleSidebar,toggleSidebarRef:this._sidebarToggleButton,useMinimalControls:this.useMinimalControls}),this._container)}}class $r{constructor({target:e,threshold:t=10,onDrag:n}){e.style.touchAction="none",this._listeners=new be,this._startX=null,this._dragActive=!1,this._threshold=t,this._listeners.add(e,"pointerdown",(e=>{this._startX=e.clientX}));const o=e=>{if(null!==this._startX&&this._dragActive){const t=e.clientX-this._startX;n({type:"dragend",deltaX:t})}
|
||||
this._startX=null,this._dragActive=!1};this._listeners.add(window,"pointercancel",o),this._listeners.add(window,"pointerup",o),this._listeners.add(window,"pointermove",(e=>{if(null===this._startX)return;const t=e.clientX-this._startX;!this._dragActive&&Math.abs(t)>=this._threshold&&(this._dragActive=!0,n({type:"dragstart",deltaX:t})),this._dragActive&&n({type:"dragmove",deltaX:t})}))}destroy(){this._listeners.removeAll()}}class zr{constructor(e,t,n){if(this._emitter=t.createEmitter(),this._guestWithSelection=null,this._guestRPC=[],this._sidebarRPC=new pn,this.iframe=function(e){const t=e.sidebarAppUrl,n=Er(t,Ar(t,e)),o=document.createElement("iframe");return o.src=n,o.title="Hypothesis annotation viewer",o.className="sidebar-frame",o.allow="fullscreen; clipboard-write",o}(n),this._config=n,this.bucketBar=null,this.features=new Ho,n.externalContainerSelector)this.externalFrame=document.querySelector(n.externalContainerSelector)??e,this.externalFrame.appendChild(this.iframe);else{
|
||||
if(this.iframeContainer=document.createElement("div"),this.iframeContainer.style.display="none",this.iframeContainer.className="sidebar-container",this.iframeContainer.id="sidebar-container","clean"===n.theme)this.iframeContainer.classList.add("theme-clean");else{let e;n.bucketContainerSelector&&(e=document.querySelector(n.bucketContainerSelector),e||console.warn(`Custom bucket container "${n.bucketContainerSelector}" not found`));const t=document.createElement("div");t.setAttribute("data-testid","sidebar-edge"),t.className=Re("absolute top-0 bottom-0 w-[23px] left-[-22px]","flex flex-col pt-[110px] pr-[5px]","bg-grey-2 sidebar-collapsed:bg-black/[.08]","pointer-events-none"),this.iframeContainer.append(t),e||(e=t),this.bucketBar=new Hr(e,{onFocusAnnotations:e=>this._guestRPC.forEach((t=>t.call("hoverAnnotations",e))),onScrollToAnnotation:e=>this._guestRPC.forEach((t=>t.call("scrollToAnnotation",e))),onSelectAnnotations:(e,t)=>this._guestRPC.forEach((n=>n.call("selectAnnotations",e,t)))})}
|
||||
this.iframeContainer.appendChild(this.iframe),this._hypothesisSidebar=document.createElement("hypothesis-sidebar");const t=Qn(this._hypothesisSidebar);t.appendChild(this.iframeContainer),e.appendChild(this._hypothesisSidebar),this._messagesElement=document.createElement("div"),t.appendChild(this._messagesElement),V(Pe(Fr,{emitter:this._emitter}),this._messagesElement)}this.iframe.contentWindow&&cn(this.iframe.contentWindow),this._listeners=new be;const o=document.createElement("div");this.toolbar=new qr(o,{sidebarContainerId:this.iframeContainer?.id,createAnnotation:()=>{if(0===this._guestRPC.length)return;(this._guestWithSelection??this._guestRPC[0]).call("createAnnotation")},setSidebarOpen:e=>e?this.open():this.close(),setHighlightsVisible:e=>this.setHighlightsVisible(e)}),"clean"===n.theme?this.toolbar.useMinimalControls=!0:this.toolbar.useMinimalControls=!1,this.iframeContainer?(this.iframeContainer.prepend(o),this._toolbarWidth=this.toolbar.getWidth()):this._toolbarWidth=0,
|
||||
this._listeners.add(window,"resize",(()=>this._onResize())),this._dragResizeState={initial:null,final:null};const i=this.toolbar.sidebarToggleButton;i&&(this._dragResizeHandler=new $r({target:i,onDrag:e=>this._onDragSidebarToggleButton(e)})),this.close();const[r]=n.services||[];r&&(this.onLoginRequest=r.onLoginRequest,this.onLogoutRequest=r.onLogoutRequest,this.onSignupRequest=r.onSignupRequest,this.onProfileRequest=r.onProfileRequest,this.onHelpRequest=r.onHelpRequest),this.onLayoutChange=n.onLayoutChange,this._layoutState={expanded:!1,width:0,height:0,toolbarWidth:0},this._updateLayoutState(!1),this._setupSidebarEvents()}destroy(){this._guestRPC.forEach((e=>e.destroy())),this._sidebarRPC.destroy(),this.bucketBar?.destroy(),this._listeners.removeAll(),this._dragResizeHandler?.destroy(),this._hypothesisSidebar?(V(null,this._messagesElement),this._hypothesisSidebar.remove()):this.iframe.remove(),this._emitter.destroy(),cn(null)}onFrameConnected(e,t){switch(e){case"guest":this._connectGuest(t);break
|
||||
;case"sidebar":this._sidebarRPC.connect(t)}}_connectGuest(e){const t=new pn;t.on("textSelected",(()=>{this._guestWithSelection=t,this.toolbar.newAnnotationType="annotation",this._guestRPC.filter((e=>e!==t)).forEach((e=>e.call("clearSelection")))})),t.on("textUnselected",(()=>{this._guestWithSelection=null,this.toolbar.newAnnotationType="note",this._guestRPC.filter((e=>e!==t)).forEach((e=>e.call("clearSelection")))})),t.on("highlightsVisibleChanged",(e=>{this.setHighlightsVisible(e)}));const n=this.bucketBar;n&&t.on("anchorsChanged",(e=>{0===this._guestRPC.indexOf(t)&&n.update(e)})),t.on("close",(()=>{t.destroy(),t===this._guestWithSelection&&(this._guestWithSelection=null),this._guestRPC=this._guestRPC.filter((e=>e!==t))})),t.connect(e),this._guestRPC.push(t),t.call("sidebarLayoutChanged",this._layoutState)}_setupSidebarEvents(){var e;e=document.body,this._sidebarRPC.on("publicAnnotationCountChanged",(function(t){const n=e.querySelectorAll("[data-hypothesis-annotation-count]");Array.from(n).forEach((e=>{
|
||||
e.textContent=t.toString()}))})),function(e,t){const n=e.querySelectorAll("[data-hypothesis-trigger]");Array.from(n).forEach((e=>{e.addEventListener("click",(e=>{t(),e.stopPropagation()}))}))}(document.body,(()=>this.open())),this._sidebarRPC.on("featureFlagsUpdated",(e=>this.features.update(e))),this._sidebarRPC.on("connect",(()=>{this.iframeContainer&&(this.iframeContainer.style.display="");const e="always"===this._config.showHighlights;this.setHighlightsVisible(e),(this._config.openSidebar||this._config.annotations||this._config.query||this._config.group)&&this.open()})),this._sidebarRPC.on("showHighlights",(()=>this.setHighlightsVisible(!0))),this._sidebarRPC.on("openSidebar",(()=>this.open())),this._sidebarRPC.on("closeSidebar",(()=>this.close())),this._sidebarRPC.on("openNotebook",(e=>{this.hide(),this._emitter.publish("openNotebook",e)})),this._sidebarRPC.on("openProfile",(()=>{this.hide(),this._emitter.publish("openProfile")})),this._emitter.subscribe("closeProfile",(()=>{this.show()})),
|
||||
this._emitter.subscribe("closeNotebook",(()=>{this.show()})),this._sidebarRPC.on("toastMessageAdded",(e=>{this._emitter.publish("toastMessageAdded",e)})),this._sidebarRPC.on("toastMessageDismissed",(e=>{this._emitter.publish("toastMessageDismissed",e)}));[["loginRequested",this.onLoginRequest],["logoutRequested",this.onLogoutRequest],["signupRequested",this.onSignupRequest],["profileRequested",this.onProfileRequest],["helpRequested",this.onHelpRequest]].forEach((([e,t])=>{t&&this._sidebarRPC.on(e,(()=>t()))}))}_resetDragResizeState(){this._dragResizeState={initial:null,final:null}}_updateLayout(){this._renderFrame||(this._renderFrame=requestAnimationFrame((()=>{if(this._renderFrame=void 0,"number"==typeof this._dragResizeState.final&&this._dragResizeState.final!==this._dragResizeState.initial&&this.iframeContainer){const e=this._dragResizeState.final,t=-e;this.iframeContainer.style.marginLeft=`${e}px`,t>=280&&(this.iframeContainer.style.width=`${t}px`),this._updateLayoutState()}})))}_updateLayoutState(e){
|
||||
const t=this.iframeContainer&&this.toolbar.getWidth()||0,n=this.iframeContainer??this.externalFrame,{height:o}=n.getBoundingClientRect(),i=window.getComputedStyle(n),r=parseInt(i.width),s=parseInt(i.marginLeft);let a=t;"boolean"==typeof e?e&&(a+=r):(s<280?a-=s:a+=r,e=a>t);const l={expanded:e,width:e?a:t,height:o,toolbarWidth:t};this._layoutState=l,this.onLayoutChange?.(l),this._guestRPC.forEach((e=>e.call("sidebarLayoutChanged",l)))}_onResize(){!0===this.toolbar.sidebarOpen&&(window.innerWidth<280?this.close():this.open())}isResizing(){return null!==this._dragResizeState.initial}_onDragSidebarToggleButton(e){const t=this.iframeContainer;if(t)switch(e.type){case"dragstart":this._resetDragResizeState(),t.classList.add("sidebar-no-transition"),t.style.pointerEvents="none",this._dragResizeState.initial=parseInt(getComputedStyle(t).marginLeft);break;case"dragend":t.classList.remove("sidebar-no-transition"),t.style.pointerEvents="",
|
||||
null===this._dragResizeState.final||this._dragResizeState.final<=-280?this.open():this.close(),this._resetDragResizeState();break;case"dragmove":{if("number"!=typeof this._dragResizeState.initial)return;const t=this._dragResizeState.initial,n=e.deltaX;this._dragResizeState.final=Math.min(Math.round(t+n),0),this._updateLayout();break}}}open(){if(this._sidebarRPC.call("sidebarOpened"),this.iframeContainer){const e=this.iframeContainer.getBoundingClientRect().width;this.iframeContainer.style.marginLeft=-1*e+"px",this.iframeContainer.classList.remove("sidebar-collapsed")}this.toolbar.sidebarOpen=!0,"whenSidebarOpen"===this._config.showHighlights&&this.setHighlightsVisible(!0),this._updateLayoutState(!0)}close(){this._sidebarRPC.call("sidebarClosed"),this.iframeContainer&&(this.iframeContainer.style.marginLeft="",this.iframeContainer.classList.add("sidebar-collapsed")),this.toolbar.sidebarOpen=!1,"whenSidebarOpen"===this._config.showHighlights&&this.setHighlightsVisible(!1),this._updateLayoutState(!1)}
|
||||
setHighlightsVisible(e){this.toolbar.highlightsVisible=e,this._sidebarRPC.call("setHighlightsVisible",e)}show(){this.iframeContainer?.classList.remove("is-hidden")}hide(){this.iframeContainer?.classList.add("is-hidden")}}class Wr{constructor(e){this._emitter=e,this._subscriptions=[]}publish(e,...t){this._emitter.emit(e,...t)}subscribe(e,t){this._emitter.on(e,t),this._subscriptions.push([e,t])}unsubscribe(e,t){this._emitter.off(e,t),this._subscriptions=this._subscriptions.filter((([n,o])=>n!==e||o!==t))}destroy(){for(const[e,t]of this._subscriptions)this._emitter.off(e,t);this._subscriptions=[]}}class jr{constructor(){this._emitter=new rn.TinyEmitter}createEmitter(){return new Wr(this._emitter)}}const Xr=document.querySelector('link[type="application/annotator+html"][rel="sidebar"]');new Promise((e=>{"loading"!==document.readyState&&e(),document.addEventListener("readystatechange",(()=>e()))})).then((function(){const e=Un("annotator");let t=()=>{};const n=new Promise((e=>{t=e}))
|
||||
;Xr.addEventListener("destroy",t);const o=e.subFrameIdentifier?window.parent:window,i=[];if(o===window){if(function(){const e=document.querySelectorAll(["hypothesis-sidebar","hypothesis-notebook","hypothesis-profile"].join(","));return e.forEach((e=>e.remove())),e.length>0}())return void console.warn("Hypothesis did not load because it found an existing instance on the page.");const e=function(e=navigator.userAgent){if(!gn(e))return()=>{};const t=e=>{if("hypothesisPortClosed"===e.data?.type&&e.ports[0]){const t=e.ports[0];mn(t,"close"),t.close()}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}();i.push({destroy:e});const t=Un("sidebar"),n=new URL(t.sidebarAppUrl).origin,o=new dn(n),r=new jr,s=new zr(document.body,r,t),a=new Lr(document.body,r,Un("notebook")),l=new Ir(document.body,r,Un("profile"));o.on("frameConnected",((e,t)=>s.onFrameConnected(e,t))),i.push(o,s,a,l)}if("container"===ur()){const t=new hr(e);i.push(t)}else{
|
||||
const n=new ar(document.body,e),r=new Sr(document.body,e,o);r.on("hostDisconnected",t),i.push(n,r)}n.then((()=>{i.forEach((e=>e.destroy()));document.querySelectorAll("[data-hypothesis-asset]").forEach((e=>e.remove())),function(e=document){Array.from(e.querySelectorAll("script.js-hypothesis-config[data-remove-on-unload]")).forEach((e=>e.remove()))}()}))}))}();
|
||||
//# sourceMappingURL=annotator.bundle.js.map
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?10d4ae","styles/annotator.css":"styles/annotator.css?427463","styles/annotator.css.map":"styles/annotator.css.map?94a857","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?d92c5a","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?a3d7cb","styles/sidebar.css.map":"styles/sidebar.css.map?526530","styles/ui-playground.css":"styles/ui-playground.css?8d6c66","styles/ui-playground.css.map":"styles/ui-playground.css.map?b2e29b","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?36fd36","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?fe7697","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?f9819e","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?286e07","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?03eb8f"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var o=s.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=t,e(o),s.head.appendChild(o)}function o(s,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=o.esModule,n=void 0===r||r,i=o.forceReload,a=void 0!==i&&i,l=s.createElement("script");n&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function r(s,t,o,r){var n=s.createElement("link");n.rel=t,n.href=r,n.type="application/annotator+".concat(o),e(n),s.head.appendChild(n)}function n(s,t,o){var r=s.createElement("link");r.rel="preload",r.as=t,r.href=o,"fetch"===t&&(r.crossOrigin="anonymous"),e(r),s.head.appendChild(r)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),o=0;o<t.length;o++){var r=void 0;try{r=JSON.parse(t[o].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(e,r)}return e}(document),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1574.0/");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)o(s,i(e,a[r]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)t(s,i(e,p[l]))}(document,{assetRoot:p,manifest:s,apiUrl:l.apiUrl})}else{var c=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(c&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(c))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,h=a(d.notebookAppUrl||"https://hypothes.is/notebook"),u=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",e.sidebarAppUrl),r(s,"notebook","html",e.notebookAppUrl),r(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css")),r(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)o(s,i(e,l[a]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,d=p;c<d.length;c++)t(s,i(e,d[c]))}}(document,{assetRoot:p,manifest:s,notebookAppUrl:h,profileAppUrl:u,sidebarAppUrl:y})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,59 @@
|
||||
'use strict';
|
||||
|
||||
// Note: This file is not transpiled. For IE 11 compatibility, it must only
|
||||
// use ES5 language features.
|
||||
//
|
||||
// This script can however assume that some ES2015+ library features, eg.
|
||||
// Promises, will already have been polyfilled as PDF.js uses them.
|
||||
|
||||
// Listen for `webviewerloaded` event to configure the viewer after its files
|
||||
// have been loaded but before it is initialized.
|
||||
document.addEventListener('webviewerloaded', function(event) {
|
||||
var appOptions = window.PDFViewerApplicationOptions;
|
||||
var app = window.PDFViewerApplication;
|
||||
|
||||
// Ensure that PDF.js viewer events such as "documentloaded" are dispatched
|
||||
// to the DOM. The client relies on this.
|
||||
appOptions.set('eventBusDispatchToDOM', true);
|
||||
|
||||
// Disable preferences support, as otherwise this will result in `eventBusDispatchToDOM`
|
||||
// being overridden with the default value of `false`.
|
||||
appOptions.set('disablePreferences', true);
|
||||
|
||||
// Wait for the PDF viewer to be fully initialized and then load the Hypothesis client.
|
||||
//
|
||||
// This is required because the client currently assumes that `PDFViewerApplication`
|
||||
// is fully initialized when it loads. Note that "fully initialized" only means
|
||||
// that the PDF viewer application's components have been initialized. The
|
||||
// PDF itself will still be loading, and the client will wait for that to
|
||||
// complete before fetching annotations.
|
||||
//
|
||||
var pdfjsInitialized = new Promise(function (resolve) {
|
||||
// Poll `app.initialized` as there doesn't appear to be an event that
|
||||
// we can listen to.
|
||||
var timer = setInterval(function () {
|
||||
if (app.initialized) {
|
||||
clearTimeout(timer);
|
||||
resolve();
|
||||
}
|
||||
}, 20);
|
||||
});
|
||||
|
||||
pdfjsInitialized.then(function () {
|
||||
// Prevent PDF.js' `Promise` polyfill, if it was used, from being
|
||||
// overwritten by the one that ships with Hypothesis (both from core-js).
|
||||
//
|
||||
// See https://github.com/hypothesis/via/issues/81#issuecomment-531121534
|
||||
if (typeof Promise === 'function' && typeof PromiseRejectionEvent === 'undefined') {
|
||||
window.PromiseRejectionEvent = function FakePromiseRejectionEvent(type, options) {
|
||||
// core-js doesn't actually use this, it just tests for `typeof PromiseRejectionEvent`
|
||||
console.warn('Tried to construct fake `PromiseRejectionEvent`');
|
||||
};
|
||||
}
|
||||
|
||||
// Load the Hypothesis client.
|
||||
var embedScript = document.createElement('script');
|
||||
embedScript.src = 'https://hypothes.is/embed.js';
|
||||
document.body.appendChild(embedScript);
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,2 @@
|
||||
#viewer.is-selecting .annotationLayer{display:none}html{font-size:100%}
|
||||
/*# sourceMappingURL=pdfjs-overrides.css.map */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
BIN
Tesis Daniel/bibli/rea.2.pdf
Normal file
BIN
Tesis Daniel/bibli/rea.2.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user