1/*! shiny 1.14.0 | (c) 2012-2026 Posit Software, PBC. | License: MIT + file LICENSE */ 2"use strict";(()=>{var zr=Object.create;var Fi=Object.defineProperty;var Nr=Object.getOwnPropertyDescriptor;var Ur=Object.getOwnPropertyNames;var Fr=Object.getPrototypeOf,Qr=Object.prototype.hasOwnProperty;var Qi=n=>{throw TypeError(n)};var Jr=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var jr=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ur(e))!Qr.call(n,s)&&s!==t&&Fi(n,s,{get:()=>e[s],enumerable:!(i=Nr(e,s))||i.enumerable});return n};var $=(n,e,t)=>(t=n!=null?zr(Fr(n)):{},jr(e||!n||!n.__esModule?Fi(t,"default",{value:n,enumerable:!0}):t,n));var jn=(n,e,t)=>e.has(n)||Qi("Cannot "+t);var de=(n,e,t)=>(jn(n,e,"read from private field"),t?t.call(n):e.get(n)),Ze=(n,e,t)=>e.has(n)?Qi("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),Ji=(n,e,t,i)=>(jn(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),j=(n,e,t)=>(jn(n,e,"access private method"),t);var M=Jr((jo,ji)=>{ji.exports=window.jQuery});var Qt=$(M());var qi=!1,Xi=!1,Wi=-1;function qn(n){qi=n}function Gi(n){Xi=n}function Yi(n){Wi=n}function Ki(){return qi}function Re(){return Xi}function Zi(){return Wi}var G;function es(n){G=n}function qr(){let n=G.indexOf("MSIE ");if(Re()&&n>0)return parseInt(G.substring(n+5,G.indexOf(".",n)),10);if(G.indexOf("Trident/")>0){let t=G.indexOf("rv:");return parseInt(G.substring(t+3,G.indexOf(".",t)),10)}return-1}function ts(){/\bQt\//.test(G)?((0,Qt.default)(document.documentElement).addClass("qt"),qn(!0)):qn(!1),/\bQt/.test(G)&&/\bMacintosh/.test(G)&&(0,Qt.default)(document.documentElement).addClass("qtmac"),/\bQt\/5/.test(G)&&/Linux/.test(G)&&(0,Qt.default)(document.documentElement).addClass("qt5"),Gi(/MSIE|Trident|Edge/.test(G)),Yi(qr())}var ns=$(M());function is(){(0,ns.default)(document).on("submit","form:not([action])",function(n){n.preventDefault()})}var ss=$(M());function rs(){let n=window.history.pushState;window.history.pushState=function(...e){let t=n.apply(this,e);return(0,ss.default)(document).trigger("pushstate"),t}}var z=$(M());var ft=$(M());var Z=$(M());function ie(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function w(n,e){return Object.prototype.hasOwnProperty.call(n,e)&&n[e]!==void 0}function q(n,e){return n===void 0?e:n}function et(n){return n==null?[]:Array.isArray(n)?n:[n]}var Xn;function os(n){Xn=n}function ge(){if(typeof Xn>"u")throw"Shiny has not finish initialization yet. Please wait for the 'shiny-initialized' event.";return Xn}function pe(n,e,t){ge().setInputValue(n,e,t)}function Ae(){return ge().shinyapp}function as(n){ge().user=n}function ls(n){ge().forgetLastInputValue(n)}async function Oe(n){await ge().bindAll(n)}function Y(n,e=!1){ge().unbindAll(n,e)}function ct(n){ge().initializeInputs(n)}async function us(n,e){await Ae().bindOutput(n,e)}function cs(n,e){return Ae().unbindOutput(n,e)}function ds(){return ge().oncustommessage}var ps;function ms(){return ps}function fs(n){ps=n}function hs(){return ge().createSocket}var le=class{constructor(e,t,i){this.target=e,this.func=t,this.delayMs=i,this.timerId=null,this.args=null}normalCall(...e){this.$clearTimer(),this.args=e,this.timerId=setTimeout(()=>{this.timerId!==null&&(this.$clearTimer(),this.$invoke())},this.delayMs)}immediateCall(...e){this.$clearTimer(),this.args=e,this.$invoke()}cancel(){this.$clearTimer(),this.args=null}isPending(){return this.timerId!==null}$clearTimer(){this.timerId!==null&&(clearTimeout(this.timerId),this.timerId=null)}$invoke(){this.args&&this.args.length>0?this.func.apply(this.target,this.args):this.func.apply(this.target),this.args=null}};function tt(n,e){let t=null,i=function s(...o){t!==null&&(clearTimeout(t),t=null),t=setTimeout(()=>{t!==null&&(t=null,e.apply(s,o))},n)};return i.cancel=function(){t!==null&&(clearTimeout(t),t=null)},i}var dt=class{constructor(e,t){this.target=e,this.func=t}normalCall(...e){this.func.apply(this.target,e)}immediateCall(...e){this.func.apply(this.target,e)}};var Me=class{constructor(e,t,i){this.target=e,this.func=t,this.delayMs=i,this.timerId=null,this.args=null}normalCall(...e){this.args=e,this.timerId===null&&this.$invoke()}immediateCall(...e){this.$clearTimer(),this.args=e,this.$invoke()}isPending(){return this.args!==null}$clearTimer(){this.timerId!==null&&(clearTimeout(this.timerId),this.timerId=null)}$invoke(){this.args!==null&&(this.func.apply(this.target,this.args),this.args=null,this.timerId=setTimeout(()=>{this.timerId!==null&&(this.$clearTimer(),this.isPending()&&this.$invoke())},this.delayMs))}};var Ce,Wn=class{constructor(){Ze(this,Ce,new Set)}setSendMethod(e,t){let i=new le(null,t,0);return this.regular=function(){i.normalCall()},e.lastChanceCallback.push(()=>{de(this,Ce).forEach(s=>s.flush()),i.isPending()&&i.immediateCall()}),this.transitioned=tt(200,this.regular),i}createObserverCallback(e,t){let i=new le(null,()=>{de(this,Ce).delete(s),t()},e),s=Object.assign(()=>{de(this,Ce).add(s),i.normalCall()},{cancel:()=>{de(this,Ce).delete(s),i.cancel()},flush:()=>{de(this,Ce).delete(s),i.isPending()&&i.immediateCall()},isPending:()=>i.isPending()});return s}};Ce=new WeakMap;var se=new Wn;var ye=$(M()),Xr=/<!--(SHINY.SINGLETON\[([\w]+)\])-->([\s\S]*?)<!--\/\1-->/,Wr=/<head(?:\s[^>]*)?>([\s\S]*?)<\/head>/,Jt={};function Gn(n,e,t){let i=Kr(n);switch(Yr(i.head),Gr(i.singletons),t.toLowerCase()){case"replace":(0,ye.default)(e).html(i.html);break;case"beforebegin":(0,ye.default)(e).before(i.html);break;case"afterbegin":(0,ye.default)(e).prepend(i.html);break;case"beforeend":(0,ye.default)(e).append(i.html);break;case"afterend":(0,ye.default)(e).after(i.html);break;default:throw new Error("Unknown where position: "+t)}return i}function Gr(n){ye.default.extend(Jt,n)}function gs(n){if(typeof n=="string")Jt[n]=!0;else if(n instanceof Array)for(let e=0;e<n.length;e++)Jt[n[e]]=!0}function Yr(n){if(n.length>0){let e=(0,ye.default)("<div>"+n+"</div>").get(0),t=(0,ye.default)("head");for(;e.hasChildNodes();)t.append(e.firstChild)}}function Kr(n){let e={}
2,t,i=function(a,r,l,u){return Jt[l]||e[l]?"":(e[l]=!0,u)};for(;t=n.replace(Xr,i),n.length!==t.length;)n=t;let s=[],o=function(a,r){return s.push(r),""};for(;t=n.replace(Wr,o),n.length!==t.length;)n=t;return{html:n,head:s.join(` 3`),singletons:e}}async function re(n,e,t="replace"){t==="replace"&&Y(n);let i="",s=[];e===null?i="":typeof e=="string"?i=e:typeof e=="object"&&(i=e.html,s=e.deps||[]),await mt(i,n,s,t);let o=n;if(t==="replace")ct(n),await Oe(n);else{let a=(0,Z.default)(n).parent();if(a.length>0&&(o=a,t==="beforeBegin"||t==="afterEnd")){let r=a.parent();r.length>0&&(o=r)}ct(o),await Oe(o)}}function be(n,e,t="replace"){t==="replace"&&Y(n);let i="",s=[];e===null?i="":typeof e=="string"?i=e:typeof e=="object"&&(i=e.html,s=e.deps||[]),Yn(i,n,s,t);let o=n;if(t==="replace")return ct(n),Oe(n);{let a=(0,Z.default)(n).parent();if(a.length>0&&(o=a,t==="beforeBegin"||t==="afterEnd")){let r=a.parent();r.length>0&&(o=r)}return ct(o),Oe(o)}}async function mt(n,e,t,i="replace"){return await Ve(t),Gn(n,e,i)}function Yn(n,e,t,i="replace"){return Kn(t),Gn(n,e,i)}async function Ve(n){if(n)for(let e of n)await to(e)}function Kn(n){if(n)for(let e of n)no(e)}var pt={};function jt(n,e){pt[n]=e}function ys(n){if(!n.restyle)return!1;let e=Object.keys(pt),t=e.indexOf(n.name);return t===-1?!1:pt[e[t]]===n.version}function bs(n){let e=(0,Z.default)("head").first(),t=function(o,a){let r=new XMLHttpRequest;r.open("GET",o),r.onload=function(){let l="shiny_restyle_"+o.split("?restyle")[0].replace(/\W/g,"_"),u=e.find("style#"+l),c=(0,Z.default)("<style>").attr("id",l).html(r.responseText);e.append(c),u.remove(),s(a),se.transitioned()},r.send()},i=function(o){if(!o)return null;for(let a=0;a<document.styleSheets.length;a++){let r=document.styleSheets[a];if(typeof r.href=="string"&&r.href.indexOf(o)>-1)return r}return null},s=function(o){o&&(o.disabled=!0,Re()&&(o.cssText=""),o.ownerNode instanceof Element&&(0,Z.default)(o.ownerNode).remove())};n.map(o=>{let a=(0,Z.default)(o),r=i(a.attr("href")),l=a.attr("href")+"?restyle="+new Date().getTime();Re()?t(l,r):(a.attr("href",l),a.attr("onload",()=>{let u=(0,Z.default)("<div>").css("transition","0.1s all").css("position","absolute").css("top","-1000px").css("left","0");u.one("transitionend",()=>{u.remove(),s(r),se.transitioned()}),(0,Z.default)(document.body).append(u);let c="#"+Math.floor(Math.random()*16777215).toString(16);setTimeout(()=>u.css("color",c),10)}),e.append(o))})}function Zn(n){return n.stylesheet.map(e=>{e.rel===void 0&&(e.rel="stylesheet"),e.type===void 0&&(e.type="text/css");let t=document.createElement("link");return Object.entries(e).forEach(function([i,s]){i==="href"&&(s=encodeURI(s)),t.setAttribute(i,s||"")}),t})}function vs(n,e){let t=Zn(n);t.length!==0&&e.append(t)}function Zr(n,e){n.script.forEach(t=>{let i=document.createElement("script");Object.entries(t).forEach(function([s,o]){s==="src"&&(o=encodeURI(o)),i.setAttribute(s,o||"")}),e.append(i)})}async function eo(n){let e=[];n.script.forEach(t=>{let i=document.createElement("script");w(t,"async")||(i.async=!1),Object.entries(t).forEach(function([o,a]){o==="src"&&(a=encodeURI(a)),i.setAttribute(o,a||"")});let s=new Promise((o,a)=>{i.onload=r=>{o(null)},i.onerror=r=>{a(r)}});e.push(s),document.head.append(i)}),await Promise.allSettled(e)}function ws(n,e){n.meta.forEach(t=>{let i=document.createElement("meta");for(let[s,o]of Object.entries(t))i.setAttribute(s,o);e.append(i)})}function xs(n,e){n.attachment.forEach(t=>{let i=(0,Z.default)("<link rel='attachment'>").attr("id",n.name+"-"+t.key+"-attachment").attr("href",encodeURI(t.href));e.append(i)})}function Ts(n,e){if(n.head){let t=(0,Z.default)("<head></head>");t.html(n.head),e.append(t.children())}}async function to(n){let e=Is(n);if(ys(e))return bs(Zn(e)),!0;if(w(pt,e.name))return!1;jt(e.name,e.version);let t=(0,Z.default)("head").first();return ws(e,t),vs(e,t),await eo(e),xs(e,t),Ts(e,t),!0}function no(n){let e=Is(n);if(ys(e))return bs(Zn(e)),!0;if(w(pt,e.name))return!1;jt(e.name,e.version);let t=(0,Z.default)("head").first();return ws(e,t),vs(e,t),Zr(e,t),xs(e,t),Ts(e,t),!0}function Is(n){let e=n.src?.href,t={name:n.name,version:n.version,restyle:n.restyle,meta:[],stylesheet:[],script:[],attachment:[],head:n.head};n.meta&&(Array.isArray(n.meta)?t.meta=n.meta:t.meta=Object.entries(n.meta).map(function([s,o]){return{name:s,content:o}})),t.stylesheet=et(n.stylesheet).map(s=>(typeof s=="string"&&(s={href:s}),e&&(s.href=e+"/"+s.href),s)),t.script=et(n.script).map(s=>(typeof s=="string"&&(s={src:s}),e&&(s.src=e+"/"+s.src),s));let i=n.attachment;
3return i||(i=[]),typeof i=="string"&&(i=[i]),Array.isArray(i)?i=i.map((o,a)=>typeof o=="string"?{key:(a+1).toString(),href:o}:o):i=Object.entries(i).map(function([s,o]){return{key:s,href:o}}),t.attachment=i.map(s=>(e&&(s.href=e+"/"+s.href),s)),t}function ei(){return window.devicePixelRatio}function Ss(n){let e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return n.replace(/[&<>'"/]/g,function(t){return e[t]})}function qt(){return Math.floor(4294967296+Math.random()*64424509440).toString(16)}function ze(n){if(!(!n||!n.toLowerCase))switch(n.toLowerCase()){case"true":return!0;case"false":return!1;default:return}}function ve(n,e){let t;if("currentStyle"in n)t=n.currentStyle[e];else{let i=document?.defaultView?.getComputedStyle(n,null);i&&(t=i.getPropertyValue(e))}return t}function Xt(n){return n.offsetWidth!==0||n.offsetHeight!==0?!0:ve(n,"display")==="none"?!1:n.parentElement?Xt(n.parentElement):!0}function Es(n,e){let t=n.toString();for(;t.length<e;)t="0"+t;return t}function ni(n,e=1){if(e<1)throw"Significant digits must be at least 1.";return parseFloat(n.toPrecision(e))}function Ms(n){let e=new Date(n);return e.toString()==="Invalid Date"&&(e=new Date(n.replace(/-/g,"/"))),e}function ue(n){return n instanceof Date?n.getUTCFullYear()+"-"+Es(n.getUTCMonth()+1,2)+"-"+Es(n.getUTCDate(),2):null}function Cs(n,e){let t={};return function(){let i=n.getBoundingClientRect(),s={w:i.width,h:i.height};s.w===0&&s.h===0||s.w===t.w&&s.h===t.h||(t=s,e(s.w,s.h))}}function ii(){return ei()?Math.round(ei()*100)/100:1}function $s(n){let e=n.getBoundingClientRect(),t=n.currentCSSZoom||1;return{width:e.width/t,height:e.height/t}}function ks(n){let e=n.replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\b]/g,"\\b"),t;try{t=new Function(`with (this) { 4 try { 5 return (${n}); 6 } catch (e) { 7 console.error('Error evaluating expression: ${e}'); 8 throw e; 9 } 10 }`)}catch(i){throw console.error("Error parsing expression: "+n),i}return function(i){return t.call(i)}}function Hs(n,e){function t(i,s){let o=0,a=0,r=[];for(;o<i.length&&a<s.length;)Number(e(i[o],s[a]))<=0?r.push(i[o++]):r.push(s[a++]);for(;o<i.length;)r.push(i[o++]);for(;a<s.length;)r.push(s[a++]);return r}n=n.slice(0);for(let i=1;i<n.length;i*=2)for(let s=0;s<n.length;s+=i*2){let o=n.slice(s,s+i),a=n.slice(s+i,s+i*2),r=t(o,a),l=[s,r.length];Array.prototype.push.apply(l,r),Array.prototype.splice.apply(n,l)}return n}function E(n){return typeof n>"u"?n:n.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function ce(n,e){let t={};return Object.keys(n).forEach(i=>{t[i]=e(n[i],i,n)}),t}function Ds(n){return typeof n=="number"&&isNaN(n)}function ti(n,e){if(ft.default.type(n)==="object"&&ft.default.type(e)==="object"){let t=n,i=e;if(Object.keys(t).length!==Object.keys(i).length)return!1;for(let s in t)if(!ie(i,s)||!ti(t[s],i[s]))return!1;return!0}else if(ft.default.type(n)==="array"&&ft.default.type(e)==="array"){let t=n,i=e;if(t.length!==i.length)return!1;for(let s=0;s<t.length;s++)if(!ti(t[s],i[s]))return!1;return!0}else return n===e}function si(...n){if(n.length<2)throw new Error("equal requires at least two arguments.");for(let e=0;e<n.length-1;e++)if(!ti(n[e],n[e+1]))return!1;return!0}var Ps=function(n,e,t){function i(a){return(a+"").replace(/-/,".").replace(/(\.0)+[^.]*$/,"").split(".")}function s(a,r){let l=i(a),u=i(r),c=Math.min(l.length,u.length),d;for(let p=0;p<c;p++)if(d=parseInt(l[p],10)-parseInt(u[p],10),d!==0)return d;return l.length-u.length}let o=s(n,t);if(e==="==")return o===0;if(e===">=")return o>=0;if(e===">")return o>0;if(e==="<=")return o<=0;if(e==="<")return o<0;throw`Unknown operator: ${e}`};async function X(n,e){if(!(typeof n>"u")){if(e.length!==1)throw new Error("labelNode must be of length 1");typeof n=="string"&&(n={html:n,deps:[]}),n.html===""?e.addClass("shiny-label-null"):(await be(e,n),e.removeClass("shiny-label-null"))}}function Wt(n){let e=document.createElement("a");e.href="/";let t=document.createElement("div");
10t.style.setProperty("position","absolute","important"),t.style.setProperty("top","-1000px","important"),t.style.setProperty("left","0","important"),t.style.setProperty("width","30px","important"),t.style.setProperty("height","10px","important"),t.appendChild(e),n.appendChild(t);let i=window.getComputedStyle(e).getPropertyValue("color");return n.removeChild(t),i}function ri(){return!window.bootstrap}function Gt(){return"__SHINY_DEV_MODE__"in window?!!window.__SHINY_DEV_MODE__:!1}var nt=class{constructor(){this.bindings=[];this.bindingNames={}}register(e,t,i=0){let s={binding:e,priority:i};this.bindings.unshift(s),t&&(this.bindingNames[t]=s,e.name=t)}setPriority(e,t){let i=this.bindingNames[e];if(!i)throw"Tried to set priority on unknown binding "+e;i.priority=t||0}getPriority(e){let t=this.bindingNames[e];return t?t.priority:!1}getBindings(){return Hs(this.bindings,function(e,t){return t.priority-e.priority})}};var B=class{find(e){throw"Not implemented"}getId(e){return e.getAttribute("data-input-id")||e.id}getType(e){return null}getValue(e){throw"Not implemented"}subscribe(e,t){}unsubscribe(e){}receiveMessage(e,t){throw"Not implemented"}getState(e){throw"Not implemented"}getRatePolicy(e){return null}initialize(e){}};var $e=$(M());var Yt=class extends B{find(e){return(0,$e.default)(e).find(".action-button")}getValue(e){return(0,$e.default)(e).data("val")||0}setValue(e,t){(0,$e.default)(e).data("val",t)}getType(e){return"shiny.action"}subscribe(e,t){(0,$e.default)(e).on("click.actionButtonInputBinding",function(){let i=(0,$e.default)(this),s=i.data("val")||0;i.data("val",s+1),t(!1)})}getState(e){return{value:this.getValue(e)}}async receiveMessage(e,t){if(w(t,"icon")){let i=e.querySelector(":scope > .action-icon");i||(i=document.createElement("span"),i.className="action-icon",e.prepend(i)),await be(i,t.icon)}if(w(t,"label")){let i=e.querySelector(":scope > .action-label");i||(i=document.createElement("span"),i.className="action-label",e.appendChild(i)),await be(i,t.label)}w(t,"disabled")&&(t.disabled?e.setAttribute("disabled",""):e.removeAttribute("disabled"))}unsubscribe(e){(0,$e.default)(e).off(".actionButtonInputBinding")}};(0,$e.default)(document).on("click","a.action-button",function(n){n.preventDefault()});var Ne=$(M());var Kt=class extends B{find(e){return(0,Ne.default)(e).find('input[type="checkbox"]')}getValue(e){return e.checked}setValue(e,t){e.checked=t}subscribe(e,t){(0,Ne.default)(e).on("change.checkboxInputBinding",function(){t(!0)})}unsubscribe(e){(0,Ne.default)(e).off(".checkboxInputBinding")}getState(e){return{label:(0,Ne.default)(e).parent().find("span").text(),value:e.checked}}async receiveMessage(e,t){if(w(t,"value")&&(e.checked=t.value),w(t,"label")){let i=(0,Ne.default)(e).parent().find("span");await be(i,t.label)}(0,Ne.default)(e).trigger("change")}};var ee=$(M());function Ls(n){return(0,ee.default)(n).find('label[for="'+E(n.id)+'"]')}function io(n){let e=n.parentNode;return e.tagName==="LABEL"?(0,ee.default)(e).find("span").text().trim():null}var Zt=class extends B{find(e){return(0,ee.default)(e).find(".shiny-input-checkboxgroup")}getValue(e){let t=(0,ee.default)('input:checkbox[name="'+E(e.id)+'"]:checked'),i=new Array(t.length);for(let s=0;s<t.length;s++)i[s]=t[s].value;return i}setValue(e,t){if(t=t??[],(0,ee.default)('input:checkbox[name="'+E(e.id)+'"]').prop("checked",!1),t instanceof Array)for(let i=0;i<t.length;i++)(0,ee.default)('input:checkbox[name="'+E(e.id)+'"][value="'+E(t[i])+'"]').prop("checked",!0);else(0,ee.default)('input:checkbox[name="'+E(e.id)+'"][value="'+E(t)+'"]').prop("checked",!0)}getState(e){let t=(0,ee.default)('input:checkbox[name="'+E(e.id)+'"]'),i=new Array(t.length);for(let s=0;s<i.length;s++)i[s]={value:t[s].value,label:io(t[s])};return{label:Ls(e).text(),value:this.getValue(e),options:i}}async receiveMessage(e,t){let i=(0,ee.default)(e);w(t,"options")&&(i.find("div.shiny-options-group").remove(),i.find("label.checkbox").remove(),i.append(t.options)),w(t,"value")&&this.setValue(e,t.value),await X(t.label,Ls(e)),(0,ee.default)(e).trigger("change")}subscribe(e,t){(0,ee.default)(e).on("change.checkboxGroupInputBinding",function(){t(!1)})}unsubscribe(e){(0,ee.default)(e).off(".checkboxGroupInputBinding")}};var O=$(M());var ht=class extends B{find(e){return(0,O.default)(e).find(".shiny-date-input")}getType(e){return"shiny.date"}subscribe(e,t){(0,O.default)(e).on("changeDate.dateInputBinding change.dateInputBinding",function(){t(!1)})}unsubscribe(e){(0,O.default)(e).off(".dateInputBinding")}getRatePolicy(){return{policy:"debounce",delay:250}}setValue(e,t){throw"not implemented"}initialize(e){let t=(0,O.default)(e).find("input"),i=t.data("initial-date");i==null&&(i=this._floorDateTime(this._dateAsUTC(new Date))),this.setValue(e,i),t.data("min-date")!==void 0&&this._setMin(t[0],t.data("min-date")),t.data("max-date")!==void 0&&this._setMax(t[0],t.data("max-date"))}_getLabelNode(e){return(0,O.default)(e).find('label[for="'+E(e.id)+'"]')}_formatToString(e){let t="",i;for(i=0;i<e.parts.length;i++)t+=e.separators[i]+e.parts[i];return t+=e.separators[i],t}_setMin(e,t){if(t===null){(0,O.default)(e).bsDatepicker("setStartDate",null);return}let i=this._newDate(t);if(i===null||(t=i,isNaN(t.valueOf())))return;let s=(0,O.default)(e).bsDatepicker("getUTCDate");(0,O.default)(e).bsDatepicker("setStartDate",this._utcDateAsLocal(t)),t&&s&&t.getTime()>s.getTime()?(0,O.default)(e).bsDatepicker("clearDates"):(0,O.default)(e).bsDatepicker("setUTCDate",s)}_setMax(e,t){if(t===null){(0,O.default)(e).bsDatepicker("setEndDate",null);return}let i=this._newDate(t);if(i===null||(t=i,isNaN(t.valueOf())))return;let s=(0,O.default)(e).bsDatepicker("getUTCDate");(0,O.default)(e).bsDatepicker("setEndDate",this._utcDateAsLocal(t)),t&&s&&t.getTime()<s.getTime()?(0,O.default)(e).bsDatepicker("clearDates"):(0,O.default)(e).bsDatepicker("setUTCDate",s)}_newDate(e){if(e instanceof Date)return e;if(!e)return null;let t=Ms(e);return isNaN(t.valueOf())?null:t}_floorDateTime(e){return e=new Date(e.getTime()),e.setUTCHours(0,0,0,0),e}_dateAsUTC(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4)}_utcDateAsLocal(e){return new Date(e.getTime()+e.getTimezoneOffset()*6e4)}},en=class extends ht{getValue(e){let t=(0,O.default)(e).find("input").bsDatepicker("getUTCDate");return ue(t)}setValue(e,t){if(t===null){(0,O.default)(e).find("input").val("").bsDatepicker("update");return}let i=this._newDate(t);i!==null&&(isNaN(i.valueOf())||(0,O.default)(e).find("input").bsDatepicker("setUTCDate",i))}getState(e){let i=(0,O.default)(e).find("input"),s=i.data("datepicker").startDate,o=i.data("datepicker").endDate;s=s===-1/0?null:ue(s),o=o===1/0?null:ue(o);let a=i.data("datepicker").startViewMode;return a===2?a="decade":a===1?a="year":a===0&&(a="month"),{label:this._getLabelNode(e).text(),value:this.getValue(e),valueString:i.val(),min:s,max:o,language:i.data("datepicker").language,weekstart:i.data("datepicker").weekStart,format:this._formatToString(i.data("datepicker").format),startview:a}}async receiveMessage(e,t){let i=(0,O.default)(e).find("input");await X(t.label,this._getLabelNode(e)),w(t,"min")&&this._setMin(i[0],t.min),w(t,"max")&&this._setMax(i[0],t.max),w(t,"value")&&this.setValue(e,t.value),(0,O.default)(e).trigger("change")}};var me=$(M());function Bs(n){return(0,me.default)(n).find('label[for="'+E(n.id)+'"]')}var tn=class extends ht{find(e){return(0,me.default)(e).find(".shiny-date-range-input")}getValue(e){let t=(0,me.default)(e).find("input"),i=t.eq(0).bsDatepicker("getUTCDate"),s=t.eq(1).bsDatepicker("getUTCDate");return[ue(i),ue(s)]}setValue(e,t){if(!(t instanceof Object))return;let i=(0,me.default)(e).find("input");if(t.start!==void 0)if(t.start===null)i.eq(0).val("").bsDatepicker("update");else{let s=this._newDate(t.start);i.eq(0).bsDatepicker("setUTCDate",s)}if(t.end!==void 0)if(t.end===null)i.eq(1).val("").bsDatepicker("update");else{let s=this._newDate(t.end);i.eq(1).bsDatepicker("setUTCDate",s)}}getState(e){let i=(0,me.default)(e).find("input"),s=i.eq(0),o=i.eq(1),a=s.bsDatepicker("getStartDate"),r=s.bsDatepicker("getEndDate"),l=a===-1/0?null:ue(a),u=r===1/0?null:ue(r),c=s.data("datepicker").startView;return c===2?c="decade":c===1?c="year":c===0&&(c="month"),{label:Bs(e).text(),value:this.getValue(e),valueString:[s.val(),o.val()],min:l,max:u,weekstart:s.data("datepicker").weekStart,format:this._formatToString(s.data("datepicker").format),language:s.data("datepicker").language,startview:c}}async receiveMessage(e,t){let i=(0,me.default)(e),s=i.find("input"),o=s.eq(0),a=s.eq(1);await X(t.label,Bs(e)),w(t,"min")&&(this._setMin(o[0],t.min),this._setMin(a[0],t.min)),w(t,"max")&&(this._setMax(o[0],t.max),this._setMax(a[0],t.max)),w(t,"value")&&this.setValue(e,t.value),i.trigger("change")}initialize(e){let i=(0,me.default)(e).find("input"),s=i.eq(0),o=i.eq(1),a=s.data("initial-date"),r=o.data("initial-date");a==null&&(a=this._dateAsUTC(new Date)),r==null&&(r=this._dateAsUTC(new Date)),this.setValue(e,{start:a,end:r}),this._setMin(s[0],s.data("min-date")),this._setMin(o[0],s.data("min-date")),this._setMax(s[0],o.data("max-date")),this._setMax(o[0],o.data("max-date"))}subscribe(e,t){(0,me.default)(e).on("changeDate.dateRangeInputBinding change.dateRangeInputBinding",function(){t(!1)})}unsubscribe(e){(0,me.default)(e).off(".dateRangeInputBinding")}};var W=$(M());var fe=$(M());var oi=$(M());function _s(n,e,t,i,s,o){let a=oi.default.Event("shiny:inputchanged");return a.name=n,a.value=e,a.binding=t,a.el=i,a.inputType=s,(0,oi.default)(o).trigger(a),a}var ai=class{constructor(e,t=!0){this.fileIndex=-1;this.aborted=!1;this.completed=!1;this.files=Array.from(e),t&&this.$run()}onBegin(e,t){setTimeout(t,0)}onFile(e,t){setTimeout(t,0)}onComplete(){}onAbort(){}abort(){this.completed||this.aborted||(this.aborted=!0,this.onAbort())}$getRun(){let e=!1;return()=>{e||(e=!0,this.$run())}}$run(){if(this.aborted||this.completed)return;if(this.fileIndex<0){this.fileIndex=0,this.onBegin(this.files,this.$getRun());return}if(this.fileIndex===this.files.length){this.completed=!0,this.onComplete();return}let e=this.files[this.fileIndex++];this.onFile(e,this.$getRun())}},gt=class extends ai{constructor(e,t,i,s){super(i,!1),this.shinyapp=e,this.id=t,this.el=s,this.$run()}
10makeRequest(e,t,i,s,o){this.shinyapp.makeRequest(e,t,i,s,o)}onBegin(e,t){this.$setError(null),this.$setActive(!0),this.$setVisible(!0),this.onProgress(null,0),this.totalBytes=0,this.progressBytes=0,fe.default.each(e,(s,o)=>{this.totalBytes+=o.size});let i=fe.default.map(e,function(s){return{name:s.name,size:s.size,type:s.type}});this.makeRequest("uploadInit",[i],s=>{this.jobId=s.jobId,this.uploadUrl=s.uploadUrl,t()},s=>{this.onError(s)},void 0)}onFile(e,t){this.onProgress(e,0),fe.default.ajax(this.uploadUrl,{type:"POST",cache:!1,xhr:()=>{if(typeof fe.default.ajaxSettings.xhr!="function")throw"jQuery's XHR is not a function";let i=fe.default.ajaxSettings.xhr();return i.upload&&(i.upload.onprogress=s=>{s.lengthComputable&&this.onProgress(e,(this.progressBytes+s.loaded)/this.totalBytes)}),i},data:e,contentType:"application/octet-stream",processData:!1,success:()=>{this.progressBytes+=e.size,t()},error:(i,s,o)=>{this.onError(i.responseText||s)}})}onComplete(){let e=fe.default.map(this.files,function(i,s){return{name:i.name,size:i.size,type:i.type}}),t=_s(this.id,e,ms(),this.el,"shiny.fileupload",document);this.makeRequest("uploadEnd",[this.jobId,this.id],()=>{this.$setActive(!1),this.onProgress(null,1),this.$bar().text("Upload complete"),(0,fe.default)(t.el).val("")},i=>{this.onError(i)},void 0),this.$bar().text("Finishing upload")}onError(e){this.$setError(e||""),this.$setActive(!1)}onAbort(){this.$setVisible(!1)}onProgress(e,t){this.$bar().width(Math.round(t*100)+"%"),this.$bar().text(e?e.name:"")}$container(){return(0,fe.default)("#"+E(this.id)+"_progress.shiny-file-input-progress")}$bar(){return(0,fe.default)("#"+E(this.id)+"_progress.shiny-file-input-progress .progress-bar")}$setVisible(e){this.$container().css("visibility",e?"visible":"hidden")}$setError(e){this.$bar().toggleClass("progress-bar-danger",e!==null),e!==null&&(this.onProgress(null,1),this.$bar().text(e))}$setActive(e){this.$container().toggleClass("active",!!e)}};var nn="shiny-file-input-active",sn="shiny-file-input-over";function yt(n){return(0,W.default)(n).closest("div.input-group")}function Rs(n){let e=(0,W.default)(n),t=0;return e.on({"dragenter.draghover":i=>{t++===0&&e.trigger("draghover:enter",i)},"dragleave.draghover":i=>{--t===0&&e.trigger("draghover:leave",i),t<0&&console.error("draghover childCounter is negative somehow")},"dragover.draghover":i=>{i.preventDefault()},"drop.draghover":i=>{t=0,e.trigger("draghover:drop",i),i.preventDefault()}}),e}function As(n){return(0,W.default)(n).off(".draghover")}function so(){let n=(0,W.default)("html");Rs(n).on({"draghover:enter.draghover":()=>{yt(we).addClass(nn)},"draghover:leave.draghover":()=>{yt(we).removeClass(nn)},"draghover:drop.draghover":()=>{yt(we).removeClass(sn).removeClass(nn)}})}function ro(){let n=(0,W.default)("html");n.off(".draghover"),As(n)}function oo(n){let e=document.createElement("input");e.type="file";try{e.files=n}catch(t){return!1}return!0}function ao(n,e){let t=n.originalEvent?.dataTransfer?.files,i=(0,W.default)(e);t==null?console.log("Dropping files is not supported on this browser. (no FileList)"):oo(t)?(i.val(""),e.files=t,i.trigger("change")):(i.val(""),lo(e,t))}function Os(n,e){let t=n.closest("div.input-group").find("input[type=text]");e.length===1?t.val(e[0].name):t.val(e.length+" files")}function Vs(n){let e=n.data("currentUploader");e&&e.abort(),n.removeAttr("data-restore")}function lo(n,e){let t=(0,W.default)(n);Vs(t),Os(t,e),t.data("currentUploader",new gt(Ae(),li(n),e,n))}function uo(n){let e=(0,W.default)(n.target);Vs(e);let t=n.target.files,i=li(n.target);t.length!==0&&(Os(e,t),e.data("currentUploader",new gt(Ae(),i,t,n.target)))}var we=(0,W.default)();function li(n){return B.prototype.getId.call(this,n)||n.name}var rn=class extends B{find(e){return(0,W.default)(e).find('input[type="file"]')}getId(e){return li(e)}getValue(e){let t=(0,W.default)(e).attr("data-restore");if(t){let i=JSON.parse(t),s=(0,W.default)(e).closest("div.input-group").find("input[type=text]");i.name.length===1?s.val(i.name[0]):s.val(i.name.length+" files");let o=(0,W.default)(e).closest("div.form-group").find(".progress"),a=o.find(".progress-bar");return o.removeClass("active"),a.width("100%"),a.css("visibility","visible"),i}else return null}setValue(e,t){}getType(e){return"shiny.file"}subscribe(e,t){(0,W.default)(e).on("change.fileInputBinding",uo),we.length===0&&so(),we=we.add(e);let i=yt(e);Rs(i).on({"draghover:enter.draghover":s=>{i.addClass(sn)},"draghover:leave.draghover":s=>{i.removeClass(sn),s.stopPropagation()}
10,"draghover:drop.draghover":(s,o)=>{ao(o,e)}})}unsubscribe(e){let t=(0,W.default)(e),i=yt(e);i.removeClass(sn).removeClass(nn),As(i),t.off(".fileInputBinding"),i.off(".draghover"),we=we.not(e),we.length===0&&ro()}};var bt=$(M());var it=$(M());function zs(n){return(0,it.default)(n).parent().find('label[for="'+E(n.id)+'"]')}var Ue=class extends B{find(e){return(0,it.default)(e).find('input[type="text"], input[type="search"], input[type="url"], input[type="email"]').not('input[type="text"][id$="-selectized"]')}getId(e){return super.getId(e)||e.name}getValue(e){throw"not implemented"}setValue(e,t){throw"not implemented"}subscribe(e,t){let i=(0,it.default)(e),s=i.data("update-on")||"change";s==="change"?i.on("keyup.textInputBinding input.textInputBinding",function(){t(!0)}):s==="blur"&&(i.on("blur.textInputBinding",function(){t(!1)}),i.on("keydown.textInputBinding",function(o){o.key==="Enter"&&(i.is("textarea")&&!(o.ctrlKey||o.metaKey)||t(!1))})),i.on("change.textInputBinding",function(){s==="blur"&&i.is(":focus")||t(!1)})}unsubscribe(e){(0,it.default)(e).off(".textInputBinding")}receiveMessage(e,t){throw"not implemented"}getState(e){throw"not implemented"}getRatePolicy(e){return{policy:"debounce",delay:250}}},ke=class extends Ue{setValue(e,t){e.value=t}getValue(e){return e.value}getState(e){return{label:zs(e).text(),value:e.value,placeholder:e.placeholder}}async receiveMessage(e,t){w(t,"value")&&this.setValue(e,t.value),await X(t.label,zs(e)),w(t,"placeholder")&&(e.placeholder=t.placeholder),(0,it.default)(e).trigger("change")}};function Ns(n){return(0,bt.default)(n).parent().find('label[for="'+E(n.id)+'"]')}var on=class extends Ue{find(e){return(0,bt.default)(e).find('input[type="number"]')}getValue(e){let t=(0,bt.default)(e).val();if(typeof t=="string"&&/^\s*$/.test(t))return null;let i=Number(t);return isNaN(i)?t:i}setValue(e,t){e.value=""+t}getType(e){return"shiny.number"}async receiveMessage(e,t){w(t,"value")&&(e.value=t.value??""),w(t,"min")&&(e.min=t.min??""),w(t,"max")&&(e.max=t.max??""),w(t,"step")&&(e.step=t.step??""),await X(t.label,Ns(e)),(0,bt.default)(e).trigger("change")}getState(e){return{label:Ns(e).text(),value:this.getValue(e),min:Number(e.min),max:Number(e.max),step:Number(e.step)}}};var Us=$(M());var an=class extends ke{find(e){return(0,Us.default)(e).find('input[type="password"]')}getType(e){return"shiny.password"}};var oe=$(M());function Fs(n){return(0,oe.default)(n).parent().find('label[for="'+E(n.id)+'"]')}function co(n){let e=n.parentNode;return e.tagName==="LABEL"?(0,oe.default)(e).find("span").text().trim():null}var ln=class extends B{find(e){return(0,oe.default)(e).find(".shiny-input-radiogroup")}getValue(e){let t=(0,oe.default)('input:radio[name="'+E(e.id)+'"]:checked');return t.length===0?null:t.val()}setValue(e,t){Array.isArray(t)&&t.length===0?(0,oe.default)('input:radio[name="'+E(e.id)+'"]').prop("checked",!1):(0,oe.default)('input:radio[name="'+E(e.id)+'"][value="'+E(t)+'"]').prop("checked",!0)}getState(e){let t=(0,oe.default)('input:radio[name="'+E(e.id)+'"]'),i=new Array(t.length);for(let s=0;s<i.length;s++)i[s]={value:t[s].value,label:co(t[s])};return{label:Fs(e).text(),value:this.getValue(e),options:i}}async receiveMessage(e,t){let i=(0,oe.default)(e);w(t,"options")&&(i.find("div.shiny-options-group").remove(),i.find("label.radio").remove(),i.append(t.options)),w(t,"value")&&this.setValue(e,t.value),await X(t.label,Fs(e)),(0,oe.default)(e).trigger("change")}subscribe(e,t){(0,oe.default)(e).on("change.radioInputBinding",function(){t(!1)})}unsubscribe(e){(0,oe.default)(e).off(".radioInputBinding")}};var V=$(M());var Fe=eval;function Qs(n){let e=E(n.id);return ui(n)&&(e+="-selectized"),(0,V.default)(n).parent().parent().find('label[for="'+e+'"]')}function ui(n){return(0,V.default)(n).parent().find('script[data-for="'+E(n.id)+'"]').length>0}var un=class extends B{find(e){return(0,V.default)(e).find("select")}getType(e){let t=(0,V.default)(e);return t.hasClass("symbol")?t.attr("multiple")==="multiple"?"shiny.symbolList":"shiny.symbol":null}getId(e){return B.prototype.getId.call(this,e)||e.name}getValue(e){return ui(e)?this._selectize(e)?.getValue():(0,V.default)(e).val()}setValue(e,t){ui(e)?this._selectize(e)?.setValue(t):(0,V.default)(e).val(t)}getState(e){let t=new Array(e.length);for(let i=0;i<e.length;i++)t[i]={value:e[i].value,label:e[i].label};return{label:Qs(e),value:this.getValue(e),options:t}}async receiveMessage(e,t){let i=(0,V.default)(e);if(w(t,"options")&&(this._selectize(e)?.destroy(),i.empty().append(t.options),this._selectize(e)),w(t,"config")&&(i.parent().find('script[data-for="'+E(e.id)+'"]').replaceWith(t.config),this._selectize(e,!0)),w(t,"url")){let s=this._selectize(e);s.clear(),s.clearOptions();let o=!1;s.settings.load=function(a,r){let l=s.settings;V.default.ajax({url:t.url,data:{query:a,field:JSON.stringify([l.searchField]),value:l.valueField,conju:l.searchConjunction,maxop:l.maxOptions},type:"GET",error:function(){r()},success:function(u){V.default.each(u,function(c,d){let p=d[l.optgroupField||"optgroup"],h={};h[l.optgroupLabelField||"label"]=p,h[l.optgroupValueField||"value"]=p,s.addOptionGroup(p,h)}),r(u),o||(w(t,"value")?s.setValue(t.value):l.maxItems===1&&s.setValue(u[0].value)),o=!0}})},s.load(function(a){s.settings.load.apply(s,["",a])})}else w(t,"value")&&this.setValue(e,t.value);await X(t.label,Qs(e)),(0,V.default)(e).trigger("change")}subscribe(e,t){(0,V.default)(e).on("change.selectInputBinding",()=>{e.nonempty&&this.getValue(e)===""||t(!1)})}unsubscribe(e){(0,V.default)(e).off(".selectInputBinding")}initialize(e){this._selectize(e)}_selectize(e,t=!1){if(!V.default.fn.selectize)return;let i=(0,V.default)(e),s=i.parent().find('script[data-for="'+E(e.id)+'"]');if(s.length===0)return;let o=V.default.extend({labelField:"label",valueField:"value",searchField:["label"]},JSON.parse(s.html()));o=this._addShinyRemoveButton(o,e.hasAttribute("multiple")),typeof s.data("nonempty")<"u"?(e.nonempty=!0,o=V.default.extend(o,{onItemRemove:function(r){this.getValue()===""&&(0,V.default)("select#"+E(e.id)).empty().append((0,V.default)("<option/>",{value:r,selected:!0})).trigger("change")},onDropdownClose:function(){this.getValue()===""&&this.setValue((0,V.default)("select#"+E(e.id)).val())}})):e.nonempty=!1,s.data("eval")instanceof Array&&V.default.each(s.data("eval"),function(r,l){o[l]=Fe("("+o[l]+")")});let a=i.selectize(o)[0].selectize;if(t){let r=V.default.extend(a.settings,o);a.destroy(),a=i.selectize(r)[0].selectize}return a}_addShinyRemoveButton(e,t){let i=e.shinyRemoveButton;if(i===void 0||(i==="none"&&(i=t?"true":"false"),i==="false"))return e;let s=[];return i==="both"?s.push("remove_button","clear_button"):i==="true"&&s.push(t?"remove_button":"clear_button"),{...e,plugins:Array.from(new Set([...Array.isArray(e.plugins)?e.plugins:[],...s]))}}};var N=$(M());function cn(n){n.$cache&&n.$cache.input?n.$cache.input.trigger("change"):console.log("Couldn't force ion slider to update")}function Js(n,e,t){let i,s;return n==="date"?(i=window.strftime.utc(),s=function(o){return i(e,new Date(o))}):n==="datetime"?(t?i=window.strftime.timezone(t):i=window.strftime,s=function(o){return i(e,new Date(o))}):s=function(o){return mo(o,this.prettify_separator)},s}function po(n){return(0,N.default)(n).parent().find('label[for="'+E(n.id)+'"]')}function ci(n){return(0,N.default)(n).data("ionRangeSlider").options.type==="double"?2:1}var dn=class extends Ue{find(e){return N.default.fn.ionRangeSlider?(0,N.default)(e).find("input.js-range-slider"):(0,N.default)()}getType(e){let t=(0,N.default)(e).data("data-type");return t==="date"?"shiny.date":t==="datetime"?"shiny.datetime":null}getValue(e){let t=(0,N.default)(e),i=(0,N.default)(e).data("ionRangeSlider").result,s,o=t.data("data-type");return o==="date"?s=function(a){return ue(new Date(Number(a)))}:o==="datetime"?s=function(a){return Number(a)/1e3}:s=function(a){return Number(a)},ci(e)===2?[s(i.from),s(i.to)]:s(i.from)}setValue(e,t){let i=(0,N.default)(e),s=i.data("ionRangeSlider");i.data("immediate",!0);try{ci(e)===2&&t instanceof Array?s.update({from:t[0],to:t[1]}):s.update({from:t}),cn(s)}finally{i.data("immediate",!1)}}subscribe(e,t){(0,N.default)(e).on("change.sliderInputBinding",function(){t(!(0,N.default)(e).data("immediate")&&!(0,N.default)(e).data("animating"))})}unsubscribe(e){(0,N.default)(e).off(".sliderInputBinding")}async receiveMessage(e,t){let i=(0,N.default)(e),s=i.data("ionRangeSlider"),o={};if(w(t,"value"))if(ci(e)===2&&t.value instanceof Array)o.from=t.value[0],o.to=t.value[1];else{if(Array.isArray(t.value))throw"Slider requires two values to update with an array, but message value was "+["an empty array.","a single-value array.","an array with more than two values."][Math.min(t.value.length,2)];o.from=t.value}let a=["min","max","step"];for(let d=0;d<a.length;d++){let p=a[d];w(t,p)&&(o[p]=t[p])}await X(t.label,po(e));
10let r=["data-type","time-format","timezone"];for(let d=0;d<r.length;d++){let p=r[d];w(t,p)&&i.data(p,t[p])}let l=i.data("data-type"),u=i.data("time-format"),c=i.data("timezone");o.prettify=Js(l,u,c),i.data("immediate",!0);try{s.update(o),cn(s)}finally{i.data("immediate",!1)}}getRatePolicy(e){return{policy:"debounce",delay:250}}getState(e){}initialize(e){let t=(0,N.default)(e),i=t.data("data-type"),s=t.data("time-format"),o=t.data("timezone"),a={prettify:Js(i,s,o)};t.ionRangeSlider(a)}};function mo(n,e=",",t="."){let i=n.toString().split(".");return i[0]=i[0].replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+e),i.length===1?i[0]:i.length===2?i[0]+t+i[1]:""}(0,N.default)(document).on("click",".slider-animate-button",function(n){n.preventDefault();let e=(0,N.default)(this),t=(0,N.default)("#"+E(e.attr("data-target-id"))),i="Play",s="Pause",o=e.attr("data-loop")!==void 0&&!/^\s*false\s*$/i.test(e.attr("data-loop")),a=e.attr("data-interval");if(isNaN(a)?a=1500:a=Number(a),t.data("animTimer"))clearTimeout(t.data("animTimer")),t.removeData("animTimer"),e.attr("title",i),e.removeClass("playing"),t.removeData("animating");else{let r;if(t.hasClass("jslider")){let l=t.slider();l.canStepNext()||l.resetToStart(),r=setInterval(function(){o&&!l.canStepNext()?l.resetToStart():(l.stepNext(),!o&&!l.canStepNext()&&e.click())},a)}else{let l=t.data("ionRangeSlider"),u=function(){return l.options.type==="double"?l.result.to<l.result.max:l.result.from<l.result.max},c=function(){let p={from:l.result.min};l.options.type==="double"&&(p.to=p.from+(l.result.to-l.result.from)),l.update(p),cn(l)},d=function(){let p={from:Math.min(l.result.max,l.result.from+l.options.step)};l.options.type==="double"&&(p.to=Math.min(l.result.max,l.result.to+l.options.step)),l.update(p),cn(l)};u()||c(),r=setInterval(function(){o&&!u()?c():(d(),!o&&!u()&&e.click())},a)}t.data("animTimer",r),e.attr("title",s),e.addClass("playing"),t.data("animating",!0)}});var ae=$(M());function js(n){return n.attr("data-value")||n.text()}var pn=class extends B{find(e){return(0,ae.default)(e).find("ul.nav.shiny-tab-input")}getValue(e){let t=ri()?(0,ae.default)(e).find("li:not(.dropdown).active > a"):(0,ae.default)(e).find(".nav-link:not(.dropdown-toggle).active, .dropdown-menu .dropdown-item.active");return t.length===1?js(t):null}setValue(e,t){let i=!1;t&&(ri()?(0,ae.default)(e).find("li:not(.dropdown) > a"):(0,ae.default)(e).find(".nav-link:not(.dropdown-toggle), .dropdown-menu .dropdown-item")).each(function(){if(js((0,ae.default)(this))===t)return(0,ae.default)(this).tab("show"),i=!0,!1}),i||(0,ae.default)(e).trigger("change")}getState(e){return{value:this.getValue(e)}}receiveMessage(e,t){w(t,"value")&&this.setValue(e,t.value),(0,ae.default)(e).trigger("change")}subscribe(e,t){(0,ae.default)(e).on("change shown.bootstrapTabInputBinding shown.bs.tab.bootstrapTabInputBinding",function(){t(!1)})}unsubscribe(e){(0,ae.default)(e).off(".bootstrapTabInputBinding")}};var Xs=$(M());var qs=new IntersectionObserver(n=>{n.forEach(e=>{e.isIntersecting&&di(e.target)})}),Qe,mn=class extends ke{constructor(){super(...arguments);Ze(this,Qe,null)}find(t){return(0,Xs.default)(t).find("textarea")}initialize(t){super.initialize(t),di(t)}subscribe(t,i){super.subscribe(t,i),Ji(this,Qe,s=>di(s.target)),t.addEventListener("input",de(this,Qe)),qs.observe(t)}unsubscribe(t){super.unsubscribe(t),de(this,Qe)&&t.removeEventListener("input",de(this,Qe)),qs.unobserve(t)}};Qe=new WeakMap;function di(n){n.classList.contains("textarea-autoresize")&&n.scrollHeight!=0&&(n.style.height="auto",n.style.height=n.scrollHeight+"px")}function Ws(){let n=new nt;n.register(new ke,"shiny.textInput"),n.register(new mn,"shiny.textareaInput"),n.register(new an,"shiny.passwordInput"),n.register(new on,"shiny.numberInput"),n.register(new Kt,"shiny.checkboxInput"),n.register(new Zt,"shiny.checkboxGroupInput"),n.register(new ln,"shiny.radioInput"),n.register(new dn,"shiny.sliderInput"),n.register(new en,"shiny.dateInput"),n.register(new tn,"shiny.dateRangeInput"),n.register(new un,"shiny.selectInput"),n.register(new Yt,"shiny.actionButtonInput"),n.register(new pn,"shiny.bootstrapTabInput");let e=new rn;return n.register(e,"shiny.fileInputBinding"),{inputBindings:n,fileInputBinding:e}}var he=$(M());var Je=$(M());var U=class{find(e){throw"Not implemented"}renderValue(e,t){throw"Not implemented"}getId(e){return e.getAttribute("data-input-id")||e.id}async onValueChange(e,t){this.clearError(e),await this.renderValue(e,t)}onValueError(e,t){this.renderError(e,t)}renderError(e,t){if(this.clearError(e),t.message===""){(0,Je.default)(e).empty();return}let i="shiny-output-error";t.type!==null&&(i=i+" "+Je.default.map(et(t.type),function(s){return i+"-"+s}).join(" ")),(0,Je.default)(e).addClass(i).text(t.message)}clearError(e){(0,Je.default)(e).attr("class",function(t,i){return i.replace(/(^|\s)shiny-output-error\S*/g,"")})}showProgress(e,t){let i="recalculating";t?(0,Je.default)(e).addClass(i):(0,Je.default)(e).removeClass(i)}};var fn=class extends U{find(e){return(0,he.default)(e).find(".shiny-datatable-output")}onValueError(e,t){Y(e),this.renderError(e,t)}renderValue(e,t){let i=(0,he.default)(e).empty();if(!t||!t.colnames)return;let s=he.default.makeArray(t.colnames),o=he.default.map(s,function(d){return"<th>"+d+"</th>"}).join("");o="<thead><tr>"+o+"</tr></thead>";let a="";(t.options?.searching??!0)&&(a=he.default.map(s,function(d){return'<th><input type="text" placeholder="'+Ss(d.replace(/(<([^>]+)>)/gi,""))+'" /></th>'}).join(""),a="<tfoot>"+a+"</tfoot>");let r='<table class="table table-striped table-hover">'+o+a+"</table>";i.append(r),t.evalOptions&&he.default.each(t.evalOptions,function(d,p){t.options[p]=Fe("("+t.options[p]+")")});let l=t.options?.search?.caseInsensitive!==!1,u=(0,he.default)(e).children("table").DataTable(he.default.extend({processing:!0,serverSide:!0,order:[],orderClasses:!1,pageLength:25,ajax:{url:t.action,t
10ype:"POST",data:function(d){d.search||(d.search={}),d.search.caseInsensitive=l,d.escape=t.escape}}},t.options));if(typeof t.callback=="string"){let d=Fe("("+t.callback+")");typeof d=="function"&&d(u)}i.find("label input").first().unbind("keyup").keyup(tt(t.searchDelay,function(){u.search(this.value).draw()}));let c=i.find("tfoot input");c.length>0&&(he.default.each(u.settings()[0].aoColumns,function(d,p){p.bSearchable||c.eq(d).hide()}),c.keyup(tt(t.searchDelay,function(){u.column(c.index(this)).search(this.value).draw()}))),i.parents(".tab-content").css("overflow","visible")}};var vt=$(M());var hn=class extends U{find(e){return(0,vt.default)(e).find("a.shiny-download-link")}renderValue(e,t){e.setAttribute("href",t),!e.hasAttribute("data-shiny-disable-auto-enable")&&!e.classList.contains("shinyjs-disabled")&&(e.classList.remove("disabled"),e.removeAttribute("aria-disabled"),e.removeAttribute("tabindex"))}showProgress(e,t){}};(0,vt.default)(document).on("click.shinyDownloadLink","a.shiny-download-link",function(n){let e=n.currentTarget;if(e.classList.contains("disabled")||!e.getAttribute("href")){n.preventDefault();return}let t=vt.default.Event("shiny:filedownload");t.name=e.id,t.href=e.href,(0,vt.default)(document).trigger(t)});var Gs=$(M());var gn=class extends U{find(e){return(0,Gs.default)(e).find(".shiny-html-output")}onValueError(e,t){Y(e),this.renderError(e,t)}async renderValue(e,t){await re(e,t)}};var je=$(M());var er=$(M());var Zs=$(M());function Ys(n,e,t,i,s,o=!0){o=o||!0;let a=(s-i)/(t-e),l=(n-e)*a+i;if(o){let u=Math.max(s,i),c=Math.min(s,i);l>u?l=u:l<c&&(l=c)}return l}function Ks(n,e,t,i,s){return{scale:function(o,a){return s&&(o=Math.log(o)/Math.log(s)),Ys(o,n,e,t,i,a)},scaleInv:function(o,a){let r=Ys(o,t,i,n,e,a);return s&&(r=Math.pow(s,r)),r}}}function fo(n){let e=n,t=e.domain,i=e.range,s=e.log&&e.log.x?e.log.x:null,o=e.log&&e.log.y?e.log.y:null,a=Ks(t.left,t.right,i.left,i.right,s),r=Ks(t.bottom,t.top,i.bottom,i.top,o);function l(c,d){return ce(c,(p,h)=>{let x=h.substring(0,1);return x==="x"?a.scale(p,d):x==="y"?r.scale(p,d):null})}e.scaleDataToImg=l;function u(c,d){return ce(c,(p,h)=>{let x=h.substring(0,1);return x==="x"?a.scaleInv(p,d):x==="y"?r.scaleInv(p,d):null})}return e.scaleImgToData=u,e.clipImg=function(c){let d={x:c.x,y:c.y},p=e.range;return c.x>p.right?d.x=p.right:c.x<p.left&&(d.x=p.left),c.y>p.bottom?d.y=p.bottom:c.y<p.top&&(d.y=p.top),d},e}function pi(n){return n.map(e=>fo(e))}function ho(n){let e=n[0].getBoundingClientRect();return{x:e.width/n.outerWidth(),y:e.height/n.outerHeight()}}function mi(n){let e=n.offset(),t=ho(n),i={left:parseInt(n.css("border-left-width"))+parseInt(n.css("padding-left")),top:parseInt(n.css("border-top-width"))+parseInt(n.css("padding-top"))};return{x:e.left+t.x*i.left,y:e.top+t.y*i.top}}function go(n){let e={x:n.width()/n.outerWidth(),y:n.height()/n.outerHeight()},t=n[0].getBoundingClientRect();return{x:e.x*t.width,y:e.y*t.height}}function fi(n,e){let t=n.find("img"),i=t[0];if(e.panels.length===0){let r={top:0,left:0,right:i.naturalWidth-1,bottom:i.naturalHeight-1};e.panels[0]={domain:r,range:r,mapping:{}}}let s=e;s.dims.height=s.dims.height||i.naturalHeight,s.dims.width=s.dims.width||i.naturalWidth,s.panels=pi(e.panels),s.mouseOffsetCss=function(r){let l=mi(t);return{x:r.pageX-l.x,y:r.pageY-l.y}};function o(r){let l=s.imgToCssScalingRatio();return ce(r,(c,d)=>{let p=d.substring(0,1);return p==="x"?r[d]/l.x:p==="y"?r[d]/l.y:null})}s.scaleCssToImg=o;function a(r){let l=s.imgToCssScalingRatio();return ce(r,(c,d)=>{let p=d.substring(0,1);return p==="x"?r[d]*l.x:p==="y"?r[d]*l.y:null})}return s.scaleImgToCss=a,s.imgToCssScalingRatio=function(){let r=go(t);return{x:r.x/s.dims.width,y:r.y/s.dims.height}},s.cssToImgScalingRatio=function(){let r=s.imgToCssScalingRatio();return{x:1/r.x,y:1/r.y}},s.getPanelCss=function(r,l=0){let u=s.scaleCssToImg(r),c=u.x,d=u.y,p=s.cssToImgScalingRatio(),h={x:l*p.x,y:l*p.y},x=[],C=[],H;for(H=0;H<s.panels.length;H++){let I=s.panels[H].range;if(c<=I.right+h.x&&c>=I.left-h.x&&d<=I.bottom+h.y&&d>=I.top-h.y){x.push(s.panels[H]);let _=0,Q=0;c>I.right&&c<=I.right+h.x?_=c-I.right:c<I.left&&c>=I.left-h.x&&(_=c-I.left),d>I.bottom&&d<=I.bottom+h.y?Q=d-I.bottom:d<I.top&&d>
10=I.top-h.y&&(Q=d-I.top),C.push(Math.sqrt(Math.pow(_,2)+Math.pow(Q,2)))}}if(x.length){let I=Math.min.apply(null,C);for(H=0;H<x.length;H++)if(C[H]===I)return x[H]}return null},s.isInPanelCss=function(r,l=0){return!!s.getPanelCss(r,l)},s.mouseCoordinateSender=function(r,l=!0,u=!1){return function(c){if(c===null){pe(r,null);return}let d=s.mouseOffsetCss(c);if(!s.isInPanelCss(d)){if(u){pe(r,null);return}if(l)return;let H={coords_css:d,coords_img:s.scaleCssToImg(d)};pe(r,H,{priority:"event"});return}let p=s.getPanelCss(d),h=s.scaleCssToImg(d),x=p.scaleImgToData(h),C={x:x?.x,y:x?.y,coords_css:d,coords_img:h,img_css_ratio:s.cssToImgScalingRatio()};Zs.default.extend(C,p.panel_vars),C.mapping=p.mapping,C.domain=p.domain,C.range=p.range,C.log=p.log,pe(r,C,{priority:"event"})}},s}function st(n,e){return{xmin:Math.min(n.x,e.x),xmax:Math.max(n.x,e.x),ymin:Math.min(n.y,e.y),ymax:Math.max(n.y,e.y)}}function He(n,e,t){n instanceof Array||(n=[n]);let i=Math.max.apply(null,n),s=Math.min.apply(null,n),o=0;i>t?o=t-i:s<e&&(o=e-s);let a=[];for(let r=0;r<n.length;r++)a[r]=n[r]+o;return a}function hi(n,e,t,i){let o=n[0],a=null,r={},l=t.scaleCssToImg,u=t.scaleImgToCss;c();function c(){r.brushing=!1,r.dragging=!1,r.resizing=!1,r.down={x:NaN,y:NaN},r.up={x:NaN,y:NaN},r.resizeSides={left:!1,right:!1,top:!1,bottom:!1},r.boundsCss={xmin:NaN,xmax:NaN,ymin:NaN,ymax:NaN},r.boundsData={xmin:NaN,xmax:NaN,ymin:NaN,ymax:NaN},r.panel=null,r.changeStartBounds={xmin:NaN,xmax:NaN,ymin:NaN,ymax:NaN},a&&a.remove()}function d(){return n.find("#"+o.id+"_brush").length>0}function p(){let f=n.find("#"+o.id+"_brush");if(f.length===0)return;let g=f.data("bounds-data"),D=f.data("panel");if(!(!g||!D)){for(let k=0;k<t.panels.length;k++){let ne=t.panels[k];if(si(D.mapping,ne.mapping)&&si(D.panel_vars,ne.panel_vars)){r.panel=t.panels[k];break}}if(r.panel===null){f.remove();return}a=f,_(g),S()}}function h(){let f=_();Object.values(f).some(Ds)||(_(f),S())}function x(f){let g=r.boundsCss;return f.x<=g.xmax&&f.x>=g.xmin&&f.y<=g.ymax&&f.y>=g.ymin}function C(f){let g=H(f);return g.left||g.right||g.top||g.bottom}function H(f){let g=r.boundsCss,D={xmin:g.xmin-10,xmax:g.xmax+10,ymin:g.ymin-10,ymax:g.ymax+10},k={left:!1,right:!1,top:!1,bottom:!1};return(e.brushDirection==="xy"||e.brushDirection==="x")&&f.y<=D.ymax&&f.y>=D.ymin&&(f.x<g.xmin&&f.x>=D.xmin?k.left=!0:f.x>g.xmax&&f.x<=D.xmax&&(k.right=!0)),(e.brushDirection==="xy"||e.brushDirection==="y")&&f.x<=D.xmax&&f.x>=D.xmin&&(f.y<g.ymin&&f.y>=D.ymin?k.top=!0:f.y>g.ymax&&f.y<=D.ymax&&(k.bottom=!0)),k}function I(f){if(f===void 0)return{...r.boundsCss};let g={x:f.xmin,y:f.ymin},D={x:f.xmax,y:f.ymax},k=r.panel,ne=k.range;e.brushClip&&(g=u(k.clipImg(l(g))),D=u(k.clipImg(l(D)))),e.brushDirection==="xy"||(e.brushDirection==="x"?(g.y=u({y:ne.top}).y,D.y=u({y:ne.bottom}).y):e.brushDirection==="y"&&(g.x=u({x:ne.left}).x,D.x=u({x:ne.right}).x)),r.boundsCss={xmin:g.x,xmax:D.x,ymin:g.y,ymax:D.y};let _e=k.scaleImgToData(l(g)),K=k.scaleImgToData(l(D));r.boundsData=st(_e,K),r.boundsData=ce(r.boundsData,Ke=>ni(Ke,14)),a.data("bounds-data",r.boundsData),a.data("panel",r.panel)}function _(f){if(typeof f>"u")return{...r.boundsData};let g=u(r.panel.scaleDataToImg(f));g=ce(g,D=>ni(D,13)),I({xmin:Math.min(g.xmin,g.xmax),xmax:Math.max(g.xmin,g.xmax),ymin:Math.min(g.ymin,g.ymax),ymax:Math.max(g.ymin,g.ymax)})}function Q(){return r.panel}function b(){a&&a.remove(),a=(0,er.default)(document.createElement("div")).attr("id",o.id+"_brush").css({"background-color":e.brushFill,opacity:e.brushOpacity,"pointer-events":"none",position:"absolute"}).hide();let f="1px solid "+e.brushStroke;e.brushDirection==="xy"?a.css({border:f}):e.brushDirection==="x"?a.css({"border-left":f,"border-right":f}):e.brushDirection==="y"&&a.css({"border-top":f,"border-bottom":f}),n.append(a),a.offset({x:0,y:0}).width(0).outerHeight(0)}function S(){let f=mi(n.find("img")),g=r.boundsCss;a.offset({top:f.y+g.ymin,left:f.x+g.xmin}).outerWidth(g.xmax-g.xmin+1).outerHeight(g.ymax-g.ymin+1)}function L(f){if(f===void 0)return r.down;r.down=f}function Se(f){if(f===void 0)return r.up;r.up=f}function zt(){return r.brushing}function ut(){r.brushing=!0,b(),r.panel=t.getPanelCss(r.down,i),I(st(r.down,r.down)),S()}function Un(f){I(st(r.down,f)),a.show(),S()}function Fn(){r.brushing=!1,I(st(r.down,r.up))}function Nt(){return r.dragging}function Qn(){r.dragging=!0,r.changeStartBounds={...r.boundsCss}}function Jn(f){let g=f.x-r.down.x,D=f.y-r.down.y,k=r.changeStartBounds,ne={xmin:k.xmin+g,xmax:k.xmax+g,ymin:k.ymin+D,ymax:k.ymax+D};if(e.brushClip){let K=r.panel.range,Ke=l(ne),Ut=[Ke.xmin,Ke.xmax],Ft=[Ke.ymin,Ke.ymax];Ut=He(Ut,K.left,K.right),Ft=He(Ft,K.top,K.bottom),ne=u({xmin:Ut[0],xmax:Ut[1],ymin:Ft[0],ymax:Ft[1]})}
10I(ne),S()}function m(){r.dragging=!1}function v(){return r.resizing}function T(){r.resizing=!0,r.changeStartBounds={...r.boundsCss},r.resizeSides=H(r.down)}function P(f){let g={x:f.x-r.down.x,y:f.y-r.down.y},D=l(g),k=l(r.changeStartBounds),_e=r.panel.range;if(r.resizeSides.left){let K=He(k.xmin+D.x,_e.left,k.xmax)[0];k.xmin=K}else if(r.resizeSides.right){let K=He(k.xmax+D.x,k.xmin,_e.right)[0];k.xmax=K}if(r.resizeSides.top){let K=He(k.ymin+D.y,_e.top,k.ymax)[0];k.ymin=K}else if(r.resizeSides.bottom){let K=He(k.ymax+D.y,k.ymin,_e.bottom)[0];k.ymax=K}I(u(k)),S()}function te(){r.resizing=!1}return{reset:c,hasOldBrush:d,importOldBrush:p,isInsideBrush:x,isInResizeArea:C,whichResizeSides:H,onResize:h,boundsCss:I,boundsData:_,getPanel:Q,down:L,up:Se,isBrushing:zt,startBrushing:ut,brushTo:Un,stopBrushing:Fn,isDragging:Nt,startDragging:Qn,dragTo:Jn,stopDragging:m,isResizing:v,startResizing:T,resizeTo:P,stopResizing:te}}var tr=$(M());function gi(n,e,t){let i,s=null;function o(c,d){let p=tr.default.Event(c,{which:d.which,pageX:d.pageX,pageY:d.pageY});n.trigger(p)}function a(){s&&(o("mousedown2",s),s=null)}function r(c){s=c,i=window.setTimeout(function(){a()},t)}function l(c){if(c.which===1){if(!e){o("mousedown2",c);return}s===null?r(c):(clearTimeout(i),s&&Math.abs(s.pageX-c.pageX)>2||Math.abs(s.pageY-c.pageY)>2?(a(),r(c)):(s=null,o("dblclick2",c)))}}function u(c){c.which=1,o("dblclick2",c)}return{mousedown:l,dblclickIE8:u}}var De=$(M());var nr=$(M());function rt(n=document.documentElement){return(0,nr.default)(n).find(".shiny-image-output, .shiny-plot-output")}function yn(n,e,t){let i=t.mouseCoordinateSender(n,e);return i(null),{mousedown:function(s){s.which===1&&i(s)},onResetImg:function(){i(null)},onResize:null}}function yi(n,e,t,i,s,o){let a=o.mouseCoordinateSender(n,i,s),r;t==="throttle"?r=new Me(null,a,e):r=new le(null,a,e),r.immediateCall(null);let l;return s?l=function(){r.normalCall(null)}:l=function(){},{mousemove:function(u){r.normalCall(u)},mouseout:l,onResetImg:function(){r.immediateCall(null)},onResize:null}}function bi(n,e,t,i,s){let a=hi(e,t,i,20);e.on("shiny-internal:brushed.image_output",function(b,S){S.brushId===n&&S.outputId!==s&&(e.data("mostRecentBrush",!1),a.reset())});function r(b){e.removeClass("crosshair grabbable grabbing ns-resize ew-resize nesw-resize nwse-resize"),b&&e.addClass(b)}function l(){let b=a.boundsData();if(isNaN(b.xmin)){pe(n,null),rt(document.documentElement).trigger("shiny-internal:brushed",{brushId:n,outputId:null});return}let S=a.getPanel();De.default.extend(b,S.panel_vars),b.coords_css=a.boundsCss(),b.coords_img=i.scaleCssToImg(b.coords_css),b.img_css_ratio=i.cssToImgScalingRatio(),b.mapping=S.mapping,b.domain=S.domain,b.range=S.range,b.log=S.log,b.direction=t.brushDirection,b.brushId=n,b.outputId=s,pe(n,b),e.data("mostRecentBrush",!0),rt(document.documentElement).trigger("shiny-internal:brushed",b)}let u;t.brushDelayType==="throttle"?u=new Me(null,l,t.brushDelay):u=new le(null,l,t.brushDelay),a.hasOldBrush()||u.immediateCall();function c(b){if(a.isBrushing()||a.isDragging()||a.isResizing()||b.which!==1)return;let S=i.mouseOffsetCss(b);if(!(t.brushClip&&!i.isInPanelCss(S,20)))if(a.up({x:NaN,y:NaN}),a.down(S),a.isInResizeArea(S))a.startResizing(S),(0,De.default)(document).on("mousemove.image_brush",x).on("mouseup.image_brush",I);else if(a.isInsideBrush(S))a.startDragging(S),r("grabbing"),(0,De.default)(document).on("mousemove.image_brush",h).on("mouseup.image_brush",H);else{let L=i.getPanelCss(S,20);a.startBrushing(L.clipImg(i.scaleCssToImg(S))),(0,De.default)(document).on("mousemove.image_brush",p).on("mouseup.image_brush",C)}}function d(b){let S=i.mouseOffsetCss(b);if(!(a.isBrushing()||a.isDragging()||a.isResizing()))if(a.isInResizeArea(S)){let L=a.whichResizeSides(S);L.left&&L.top||L.right&&L.bottom?r("nwse-resize"):L.left&&L.bottom||L.right&&L.top?r("nesw-resize"):L.left||L.right?r("ew-resize"):(L.top||L.bottom)&&r("ns-resize")}else a.isInsideBrush(S)?r("grabbable"):i.isInPanelCss(S,20)?r("crosshair"):r(null)}function p(b){a.brushTo(i.mouseOffsetCss(b)),u.normalCall()}
10function h(b){a.dragTo(i.mouseOffsetCss(b)),u.normalCall()}function x(b){a.resizeTo(i.mouseOffsetCss(b)),u.normalCall()}function C(b){if(b.which===1){if((0,De.default)(document).off("mousemove.image_brush").off("mouseup.image_brush"),a.up(i.mouseOffsetCss(b)),a.stopBrushing(),r("crosshair"),a.down().x===a.up().x&&a.down().y===a.up().y){a.reset(),u.immediateCall();return}u.isPending()&&u.immediateCall()}}function H(b){b.which===1&&((0,De.default)(document).off("mousemove.image_brush").off("mouseup.image_brush"),a.up(i.mouseOffsetCss(b)),a.stopDragging(),r("grabbable"),u.isPending()&&u.immediateCall())}function I(b){b.which===1&&((0,De.default)(document).off("mousemove.image_brush").off("mouseup.image_brush"),a.up(i.mouseOffsetCss(b)),a.stopResizing(),u.isPending()&&u.immediateCall())}function _(){t.brushResetOnNew&&e.data("mostRecentBrush")&&(a.reset(),u.immediateCall())}t.brushResetOnNew||e.data("mostRecentBrush")&&(a.importOldBrush(),u.immediateCall());function Q(){a.onResize(),u.immediateCall()}return{mousedown:c,mousemove:d,onResetImg:_,onResize:Q}}function ot(n,e){e.css("-webkit-user-drag","none"),e.off("dragstart.image_output"),e.on("dragstart.image_output",function(){return!1}),n.off("selectstart.image_output"),n.on("selectstart.image_output",function(){return!1})}var vi=class extends U{find(e){return rt(e)}renderValue(e,t){let i=this.getId(e),s=(0,je.default)(e),o,a=s.find("img");if(a.length===0?(o=document.createElement("img"),s.append(o),a=(0,je.default)(o)):(o=a[0],a.trigger("reset")),!t){s.empty();return}let r={clickId:s.data("click-id"),clickClip:q(ze(s.data("click-clip")),!0),dblclickId:s.data("dblclick-id"),dblclickClip:q(ze(s.data("dblclick-clip")),!0),dblclickDelay:q(s.data("dblclick-delay"),400),hoverId:s.data("hover-id"),hoverClip:q(ze(s.data("hover-clip")),!0),hoverDelayType:q(s.data("hover-delay-type"),"debounce"),hoverDelay:q(s.data("hover-delay"),300),hoverNullOutside:q(ze(s.data("hover-null-outside")),!1),brushId:s.data("brush-id"),brushClip:q(ze(s.data("brush-clip")),!0),brushDelayType:q(s.data("brush-delay-type"),"debounce"),brushDelay:q(s.data("brush-delay"),300),brushFill:q(s.data("brush-fill"),"#666"),brushStroke:q(s.data("brush-stroke"),"#000"),brushOpacity:q(s.data("brush-opacity"),.3),brushDirection:q(s.data("brush-direction"),"xy"),brushResetOnNew:q(ze(s.data("brush-reset-on-new")),!1),coordmap:t.coordmap};r.brushFill==="auto"&&(r.brushFill=Wt(s[0])),r.brushStroke==="auto"&&(r.brushStroke=ve(s[0],"color")),je.default.each(t,function(l,u){u===null||l==="coordmap"||(l==="src"&&u===o.getAttribute("src")&&o.removeAttribute("src"),o.setAttribute(l,u))});for(let l=0;l<o.attributes.length;l++){let u=o.attributes[l];u.specified&&!ie(t,u.name)&&o.removeAttribute(u.name)}r.coordmap||(r.coordmap={panels:[],dims:{height:null,width:null}}),s.off(".image_output"),a.off(".image_output"),a.off("load.shiny_image_interaction"),a.one("load.shiny_image_interaction",function(){let l=r.coordmap=fi(s,r.coordmap),u=gi(s,r.dblclickId,r.dblclickDelay);if(s.on("mousedown.image_output",u.mousedown),Re()&&Zi()===8&&s.on("dblclick.image_output",u.dblclickIE8),r.clickId){ot(s,a);let c=yn(r.clickId,r.clickClip,l);s.on("mousedown2.image_output",c.mousedown),s.on("resize.image_output",c.onResize),a.on("reset.image_output",c.onResetImg)}if(r.dblclickId){ot(s,a);let c=yn(r.dblclickId,r.clickClip,l);s.on("dblclick2.image_output",c.mousedown),s.on("resize.image_output",c.onResize),a.on("reset.image_output",c.onResetImg)}if(r.hoverId){ot(s,a);let c=yi(r.hoverId,r.hoverDelay,r.hoverDelayType,r.hoverClip,r.hoverNullOutside,l);s.on("mousemove.image_output",c.mousemove),s.on("mouseout.image_output",c.mouseout),s.on("resize.image_output",c.onResize),a.on("reset.image_output",c.onResetImg)}if(r.brushId){ot(s,a);let c=bi(r.brushId,s,r,l,i);s.on("mousedown.image_output",c.mousedown),s.on("mousemove.image_output",c.mousemove),s.on("resize.image_output",c.onResize),a.on("reset.image_output",c.onResetImg)}(r.clickId||r.dblclickId||r.hoverId||r.brushId)&&s.addClass("crosshair"),t.error&&console.log("Error on server extracting coordmap: "+t.error)})}renderError(e,t){(0,je.default)(e).find("img").trigger("reset"),U.prototype.renderError.call(this,e,t)}clearError(e){(0,je.default)(e).contents().filter(function(){return!(this instanceof HTMLElement&&(this.tagName==="IMG"||this.id===e.id+"_brush"))}).remove(),U.prototype.clearError.call(this,e)}resize(e,t,i){(0,je.default)(e).find("img").trigger("resize")}},bn=new vi;var wi=$(M());var vn=class extends U{find(e){return(0,wi.default)(e).find(".shiny-text-output")}renderValue(e,t){(0,wi.default)(e).text(t)}};function ir(){let n=new nt;return n.register(new vn,"shiny.textOutput"),n.register(new hn,"shiny.downloadLink"),n.register(new fn,"shiny.datatableOutput"),n.register(new gn,"shiny.htmlOutput"),n.register(bn,"shiny.imageOutput"),{outputBindings:n}}var wn=globalThis,xn=wn.ShadowRoot&&(wn.ShadyCSS===void 0||wn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,xi=Symbol(),sr=new WeakMap,wt=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==xi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(xn&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=sr.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&sr.set(t,e))}return e}toString(){return this.cssText}},rr=n=>new wt(typeof n=="string"?n:n+"",void 0,xi),xt=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((i,s,o)=>i+(a=>
vendor: 12,798 bytes, lines 10-12
10{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[o+1],n[0]);return new wt(t,n,xi)},or=(n,e)=>{if(xn)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),s=wn.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},Ti=xn?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return rr(t)})(n):n;var{is:yo,defineProperty:bo,getOwnPropertyDescriptor:vo,getOwnPropertyNames:wo,getOwnPropertySymbols:xo,getPrototypeOf:To}=Object,Tn=globalThis,ar=Tn.trustedTypes,Io=ar?ar.emptyScript:"",Eo=Tn.reactiveElementPolyfillSupport,Tt=(n,e)=>n,Ii={toAttribute(n,e){switch(e){case Boolean:n=n?Io:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},ur=(n,e)=>!yo(n,e),lr={attribute:!0,type:String,converter:Ii,reflect:!1,useDefault:!1,hasChanged:ur};Symbol.metadata??=Symbol("metadata"),Tn.litPropertyMetadata??=new WeakMap;var xe=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=lr){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&bo(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){let{get:s,set:o}=vo(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:s,set(a){let r=s?.call(this);o?.call(this,a),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??lr}static _$Ei(){if(this.hasOwnProperty(Tt("elementProperties")))return;let e=To(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Tt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Tt("properties"))){let t=this.properties,i=[...wo(t),...xo(t)];for(let s of i)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let s of i)t.unshift(Ti(s))}else e!==void 0&&t.push(Ti(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return or(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){let i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute!==void 0?i.converter:Ii).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){let i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let o=i.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:Ii;this._$Em=s;let r=a.fromAttribute(t,o.type);this[s]=r??this._$Ej?.get(s)??r,this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){let s=this.constructor,o=this[e];if(i??=s.getPropertyOptions(e),!((i.hasChanged??ur)(o,t)||i.useDefault&&i.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:o},a){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),o!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[s,o]of i){let{wrapped:a}=o,r=this[s];a!==!0||this._$AL.has(s)||r===void 0||this.C(s,void 0,o,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};xe.elementStyles=[],xe.shadowRootOptions={mode:"open"},xe[Tt("elementProperties")]=new Map,xe[Tt("finalized")]=new Map,Eo?.({ReactiveElement:xe}),(Tn.reactiveElementVersions??=[]).push("2.1.1");var Hi=globalThis,In=Hi.trustedTypes,cr=In?In.createPolicy("lit-html",{createHTML:n=>n}):void 0,gr="$lit$",Pe=`lit$${Math.random().toFixed(9).slice(2)}$`,yr="?"+Pe,So=`<${yr}>`,We=document,Et=()=>We.createComment(""),St=n=>n===null||typeof n!="object"&&typeof n!="function",Di=Array.isArray,Mo=n=>Di(n)||typeof n?.[Symbol.iterator]=="function",Ei=`[ 11\f\r]`,It=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dr=/-->/g,pr=/>/g,qe=RegExp(`>|${Ei}(?:([^\\s"'>=/]+)(${Ei}*=${Ei}*(?:[^ 12\f\r"'\`<>=]|("|')|))|$)`,"g"),mr=/'/g,fr=/"/g,br=/^(?:script|style|textarea|title)$/i,Pi=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),Li=Pi(1),tc=Pi(2),nc=Pi(3),Ge=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),hr=new WeakMap,Xe=We.createTreeWalker(We,129);function vr(n,e){if(!Di(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return cr!==void 0?cr.createHTML(e):e}var Co=(n,e)=>{let t=n.length-1,i=[],s,o=e===2?"<svg>":e===3?"<math>":"",a=It;for(let r=0;r<t;r++){let l=n[r],u,c,d=-1,p=0;for(;p<l.length&&(a.lastIndex=p,c=a.exec(l),c!==null);)p=a.lastIndex,a===It?c[1]==="!--"?a=dr:c[1]!==void 0?a=pr:c[2]!==void 0?(br.test(c[2])&&(s=RegExp("</"+c[2],"g")),a=qe):c[3]!==void 0&&(a=qe):a===qe?c[0]===">"?(a=s??It,d=-1):c[1]===void 0?d=-2:(d=a.lastIndex-c[2].length,u=c[1],a=c[3]===void 0?qe:c[3]==='"'?fr:mr):a===fr||a===mr?a=qe:a===dr||a===pr?a=It:(a=qe,s=void 0);let h=a===qe&&n[r+1].startsWith("/>")?" ":"";o+=a===It?l+So:d>=0?(i.push(u),l.slice(0,d)+gr+l.slice(d)+Pe+h):l+Pe+(d===-2?r:h)}return[vr(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},Mt=class n{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,a=0,r=e.length-1,l=this.parts,[u,c]=Co(e,t);if(this.el=n.createElement(u,i),Xe.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=Xe.nextNode())!==null&&l.length<r;){if(s.nodeType===1){if(s.hasAttributes())for(let d of s.getAttributeNames())if(d.endsWith(gr)){let p=c[a++],h=s.getAttribute(d).split(Pe),x=/([.?@])?(.*)/.exec(p);l.push({type:1,index:o,name:x[2],strings:h,ctor:x[1]==="."?Mi:x[1]==="?"?Ci:x[1]==="@"?$i:lt}),s.removeAttribute(d)}else d.startsWith(Pe)&&(l.push({type:6,index:o}),s.removeAttribute(d));if(br.test(s.tagName)){let d=s.textContent.split(Pe),p=d.length-1;if(p>0){s.textContent=In?In.emptyScript:"";for(let h=0;h<p;h++)s.append(d[h],Et()),Xe.nextNode(),l.push({type:2,index:++o});s.append(d[p],Et())}}}else if(s.nodeType===8)if(s.data===yr)l.push({type:2,index:o});else{let d=-1;for(;(d=s.data.indexOf(Pe,d+1))!==-1;)l.push({type:7,index:o}),d+=Pe.length-1}o++}}static createElement(e,t){let i=We.createElement("template");return i.innerHTML=e,i}};function at(n,e,t=n,i){if(e===Ge)return e;let s=i!==void 0?t._$Co?.[i]:t._$Cl,o=St(e)?void 0:e._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),o===void 0?s=void 0:(s=new o(n),s._$AT(n,t,i)),i!==void 0?(t._$Co??=[])[i]=s:t._$Cl=s),s!==void 0&&(e=at(n,s._$AS(n,e.values),s,i)),e}var Si=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,s=(e?.creationScope??We).importNode(t,!0);Xe.currentNode=s;let o=Xe.nextNode(),a=0,r=0,l=i[0];for(;l!==void 0;){if(a===l.index){let u;l.type===2?u=new Ct(o,o.nextSibling,this,e):l.type===1?u=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(u=new ki(o,this,e)),this._$AV.push(u),l=i[++r]}a!==l?.index&&(o=Xe.nextNode(),a++)}return Xe.currentNode=We,s}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},Ct=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=at(this,e,t),St(e)?e===F||e==null||e===""?(this._$AH!==F&&this._$AR(),this._$AH=F):e!==this._$AH&&e!==Ge&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Mo(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==F&&St(this._$AH)?this._$AA.nextSibling.data=e:this.T(We.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Mt.createElement(vr(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let o=new Si(s,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=hr.get(e.strings);return t===void 0&&hr.set(e.strings,t=new Mt(e)),t}k(e){Di(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,s=0;for(let o of e)s===t.length?t.push(i=new n(this.O(Et()),this.O(Et()),this,this.options)):i=t[s],i._$AI(o),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},lt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,o){this.type=1,this._$AH=F,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=F}_$AI(e,t=this,i,s){let o=this.strings,a=!1;if(o===void 0)e=at(this,e,t,0),a=!St(e)||e!==this._$AH&&e!==Ge,a&&(this._$AH=e);else{let r=e,l,u;for(e=o[0],l=0;l<o.length-1;l++)u=at(this,r[i+l],t,l),u===Ge&&(u=this._$AH[l]),a||=!St(u)||u!==this._$AH[l],u===F?e=F:e!==F&&(e+=(u??"")+o[l+1]),this._$AH[l]=u}a&&!s&&this.j(e)}j(e){e===F?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Mi=class extends lt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===F?void 0:e}},Ci=class extends lt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==F)}},$i=class extends lt{constructor(e,t,i,s,o){super(e,t,i,s,o),this.type=5}
12_$AI(e,t=this){if((e=at(this,e,t,0)??F)===Ge)return;let i=this._$AH,s=e===F&&i!==F||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==F&&(i===F||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ki=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){at(this,e)}};var $o=Hi.litHtmlPolyfillSupport;$o?.(Mt,Ct),(Hi.litHtmlVersions??=[]).push("3.3.1");var wr=(n,e,t)=>{let i=t?.renderBefore??e,s=i._$litPart$;if(s===void 0){let o=t?.renderBefore??null;i._$litPart$=s=new Ct(e.insertBefore(Et(),o),o,void 0,t??{})}return s._$AI(n),s};var Bi=globalThis,Te=class extends xe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=wr(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ge}};Te._$litElement$=!0,Te.finalized=!0,Bi.litElementHydrateSupport?.({LitElement:Te});var ko=Bi.litElementPolyfillSupport;ko?.({LitElement:Te});(Bi.litElementVersions??=[]).push("4.2.1");var En=class extends Error{constructor({headline:e,message:t}){super(t),this.name="ShinyClientError",this.headline=e}};var xr=xt` 13 button { 14 background-color: transparent; 15 outline: none; 16 border-style: none; 17 padding: var(--space-3); 18 border-radius: var(--space-1); 19 font-size: var(--font-lg); 20 background-color: inherit; 21 display: block; 22 } 23 24 button > svg { 25 display: block; 26 } 27`,Mn=class Mn extends Te{toggleCollapsed(){this.classList.toggle("collapsed"),this.querySelector(".toggle-button")?.blur()}handleDismissAll(){this.classList.add("leaving"),this.addEventListener("animationend",()=>{this.remove()})}static createClientMessageElement({headline:e,message:t}){let i=document.createElement("shiny-error-message");return i.setAttribute("headline",e||""),i.setAttribute("message",t),i}appendConsoleMessage({headline:e,message:t}){let i=this.shadowRoot?.querySelector("slot.content");if(i){let s=a=>{let r=a.getAttribute("headline")||"",l=a.getAttribute("message")||"";return`${r}::${l}`},o=`${e}::${t}`;for(let a of i.assignedElements())if(a.tagName.toLowerCase()==="shiny-error-message"&&s(a)===o)return}this.appendChild(Mn.createClientMessageElement({headline:e,message:t}))}render(){return Li` <div class="header"> 28 <span class="title"> Shiny Client Errors </span> 29 <button 30 class="close-button" 31 @click=${this.handleDismissAll} 32 title="Dismiss all console messages and close console" 33 > 34 <svg 35 xmlns="http://www.w3.org/2000/svg" 36 fill="none"
37 viewBox="0 0 24 24" 38 stroke-width="1.5" 39 height="1em" 40 width="1em" 41 stroke="currentColor" 42 class="close-icon" 43 > 44 <path 45 stroke-linecap="round" 46 stroke-linejoin="round" 47 d="M6 18L18 6M6 6l12 12" 48 /> 49 </svg> 50 Dismiss all 51 </button> 52 <button class="toggle-button" @click=${this.toggleCollapsed}> 53 <svg 54 xmlns="http://www.w3.org/2000/svg" 55 fill="none" 56 viewBox="0 0 24 24" 57 stroke-width="1.5" 58 height="1em" 59 width="1em" 60 stroke="currentColor" 61 class="toggle-icon" 62 > 63 <path 64 class="collapse" 65 stroke-linecap="round" 66 stroke-linejoin="round" 67 d="M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25" 68 /> 69 </svg> 70 </button> 71 </div> 72 <slot class="content"></slot>`}};Mn.styles=[xt` 73 :host { 74 /* We declare hard pixel values here to avoid body font size changes 75 messing up the size of the console. This was an issue with bslib setting 76 the body font-size at 16px relative to base shiny's 14px. */ 77 --font-md: 14px; 78 --font-lg: 16px; 79 --font-xl: 18px; 80 81 /* These are all taken from open-props */ 82 --space-1: 6px; 83 --space-2: calc(var(--space-1) * 2); 84 --space-3: calc(var(--space-1) * 3); 85 --space-4: calc(var(--space-1) * 4); 86 --space-8: calc(var(--space-1) * 8); 87 88 --red-2: #ffc9c9; 89 --red-6: #fa5252; 90 --red-7: #f03e3e; 91 --red-8: #e03131; 92 --red-10: #b02525; 93 --red-11: #962020; 94 --red-12: #7d1a1a; 95 96 --gray-1: #f8f9fa; 97 --gray-2: #e9ecef; 98 --gray-3: #dee2e6; 99 --gray-4: #ced4da; 100 --gray-6: #868e96; 101 --gray-8: #6c757d; 102 103 --green-8: #51cf66; 104 105 --shadow-color: 220 3% 15%; 106 --shadow-strength: 1%; 107 --shadow-3: 108 0 -1px 3px 0 109 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 2%)), 110 0 1px 2px -5px 111 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 2%)), 112 0 2px 5px -5px 113 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 4%)), 114 0 4px 12px -5px 115 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 5%)), 116 0 12px 15px -5px 117 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%)); 118 119 --ring-shadow: 0 0 0 1px var(--gray-2); 120 121 /* How fast should the message pop in and out of the screen? */ 122 --animation-speed: 500ms; 123 124 /* Taken from open-props */ 125 --ease-3: cubic-bezier(0.25, 0, 0.3, 1); 126 --animation-slide-in-left: slide-in-left var(--animation-speed) 127 var(--ease-3); 128 129 --animation-slide-out-left: slide-out-left var(--animation-speed) 130 var(--ease-3); 131 --modal-bg-color: white; 132 133 position: fixed; 134 top: var(--space-1); 135 right: var(--space-1); 136 z-index: 1000; 137 138 display: flex; 139 flex-direction: column; 140 141 background-color: var(--modal-bg-color); 142 border-radius: var(--space-1); 143 144 animation: var(--animation-slide-in-left); 145 box-shadow: var(--shadow-3), var(--ring-shadow); 146 147 /* Dont let the error console burst out of the viewport */ 148 max-height: calc(100vh - 2 * var(--space-1)); 149 } 150 151 @keyframes slide-in-left { 152 from { 153 transform: translateX(100%); 154 } 155 } 156 @keyframes slide-out-left { 157 to { 158 transform: translateX(100%); 159 } 160 } 161 162 :host(.leaving) { 163 animation: var(--animation-slide-out-left); 164 } 165 166 .header { 167 display: flex; 168 justify-content: flex-end; 169 align-items: flex-start; 170 gap: var(--space-2); 171 } 172 173 .title { 174 font-size: var(--font-xl); 175 margin-right: auto; 176 padding: var(--space-3); 177 line-height: 1; 178 font-weight: 600; 179 color: var(--red-12); 180 } 181 182 ${xr} 183 184 button:hover { 185 background-color: var(--gray-2); 186 } 187 188 .toggle-button { 189 width: fit-content; 190 border: none; 191 aspect-ratio: 1; 192 border-color: var(--gray-4); 193 } 194 195 .close-button { 196 display: flex; 197 align-items: center; 198 color: var(--red-11); 199 } 200 201 .close-button > svg { 202 margin-right: 3px; 203 } 204 205 .toggle-button:focus { 206 outline: 1px solid black; 207 } 208 209 .toggle-icon { 210 transition: transform var(--animation-speed) ease-in-out; 211 } 212 213 :host(.collapsed) .toggle-icon { 214 transform: scaleX(-1) scaleY(-1); 215 } 216 217 :host(.collapsed) .close-button { 218 display: none; 219 } 220 221 .content { 222 display: block; 223 padding-inline: var(--space-4); 224 padding-block-start: 0; 225 padding-block-end: var(--space-4); 226 max-height: 100%; 227 overflow: auto; 228 } 229 230 :host(.collapsed) .content { 231 display: none; 232 } 233 `];var _i=Mn;customElements.define("shiny-error-console",_i);var $t=class extends Te{constructor(){super(...arguments);this.headline="";this.message=""}async copyErrorToClipboard(){await navigator.clipboard.writeText(this.message),this.classList.add("copy-success"),setTimeout(()=>{this.classList.remove("copy-success")},1e3)}render(){return Li` 234 <div class="container"> 235 <div class="decoration-container"> 236 <div class="vertical-line"></div> 237 <div class="dot"></div> 238 </div> 239 <div class="contents"> 240 <h3>${this.headline}</h3> 241 <pre class="error-message">${this.message}</pre> 242 </div> 243 244 <div class="actions"> 245 <button 246 class="copy-button" 247 @click=${this.copyErrorToClipboard} 248 title="Copy error to clipboard" 249 > 250 <div class="copy-button-inner"> 251 <svg 252 class="front" 253 xmlns="http://www.w3.org/2000/svg" 254 fill="none"
255 viewBox="0 0 24 24" 256 stroke-width="1.5" 257 stroke="currentColor" 258 height="1em" 259 width="1em" 260 > 261 <path 262 stroke-linecap="round" 263 stroke-linejoin="round" 264 d="M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184" 265 /> 266 </svg> 267 268 <svg 269 class="back" 270 xmlns="http://www.w3.org/2000/svg" 271 fill="none" 272 viewBox="0 0 24 24" 273 stroke-width="1.5" 274 stroke="currentColor" 275 height="1em" 276 width="1em" 277 > 278 <path 279 stroke-linecap="round" 280 stroke-linejoin="round" 281 d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" 282 /> 283 </svg> 284 </div> 285 </button> 286 </div> 287 </div> 288 `}};$t.properties={headline:{},message:{}},$t.styles=[xt` 289 :host { 290 color: var(--red-11); 291 display: block; 292 font-size: var(--font-md); 293 294 position: relative; 295 --icon-size: var(--font-lg) /* Reset box sizing */ 296 box-sizing: border-box; 297 } 298 299 .container { 300 display: flex; 301 gap: var(--space-2); 302 } 303 304 .contents { 305 width: 40ch; 306 display: flex; 307 flex-direction: column; 308 gap: var(--space-1); 309 padding-block-start: 0; 310 padding-block-end: var(--space-3); 311 overflow: auto; 312 } 313 314 :host(:last-of-type) .contents { 315 padding-block-end: var(--space-1); 316 } 317 318 .contents > h3 { 319 font-size: 1em; 320 font-weight: 500; 321 color: var(--red-12); 322 } 323 324 .contents > * { 325 margin-block: 0; 326 } 327 328 .error-message { 329 font-family: "Courier New", Courier, monospace; 330 white-space: pre-wrap; 331 } 332 333 .decoration-container { 334 flex-shrink: 0; 335 position: relative; 336 337 --line-w: 2px; 338 --dot-size: 11px; 339 } 340 341 :host(:hover) .decoration-container { 342 --scale: 1.25; 343 } 344 345 .vertical-line { 346 margin-inline: auto; 347 width: var(--line-w); 348 height: 100%; 349 350 background-color: var(--red-10); 351 } 352 353 :host(:first-of-type) .vertical-line { 354 height: calc(100% - var(--dot-size)); 355 margin-top: var(--dot-size); 356 } 357 358 .dot { 359 position: absolute; 360 width: var(--dot-size); 361 height: var(--dot-size); 362 top: calc(-1px + var(--dot-size) / 2); 363 left: calc(50% - var(--dot-size) / 2); 364 border-radius: 100%; 365 transform: scale(var(--scale, 1)); 366 367 color: var(--red-6); 368 background-color: var(--red-10); 369 } 370 371 .actions { 372 transform: scaleX(0); 373 transition: transform calc(var(--animation-speed) / 2) ease-in-out; 374 display: flex; 375 justify-content: center; 376 flex-direction: column; 377 } 378 379 /* Delay transition on mouseout so the buttons don't jump away if the user 380 overshoots them with their mouse */ 381 :host(:not(:hover)) .actions { 382 transition-delay: 0.15s; 383 } 384 385 :host(:hover) .actions { 386 transform: scaleX(1); 387 } 388 389 ${xr} 390 391 .copy-button { 392 padding: 0; 393 width: var(--space-8); 394 height: var(--space-8); 395 position: relative; 396 --pad: var(--space-2); 397 } 398 399 .copy-button-inner { 400 position: relative; 401 width: 100%; 402 height: 100%; 403 border-radius: inherit; 404 transition: transform 0.5s; 405 transform-style: preserve-3d; 406 } 407 408 /* Animate flipping to the other side when the .copy-success class is 409 added to the host */ 410 :host(.copy-success) .copy-button-inner { 411 transform: rotateY(180deg); 412 } 413 414 /* Position the front and back side */ 415 .copy-button .front, 416 .copy-button .back { 417 --side: calc(100% - 2 * var(--pad)); 418 position: absolute; 419 inset: var(--pad); 420 height: var(--side); 421 width: var(--side); 422 -webkit-backface-visibility: hidden; /* Safari */ 423 backface-visibility: hidden; 424 } 425 426 .copy-button:hover .copy-button-inner { 427 background-color: var(--gray-2); 428 } 429 430 /* Style the back side */ 431 .copy-button .back { 432 --pad: var(--space-1); 433 color: var(--green-8); 434 transform: rotateY(180deg); 435 } 436 `];customElements.define("shiny-error-message",$t);function Tr({headline:n="",message:e,status:t="warning"}){let i=`[shiny] ${n}${n?" - ":""}${e}`;switch(t){case"error":console.error(i);break;case"warning":console.warn(i);break;default:console.log(i);break}if(!Gt())return;let s=document.querySelector("shiny-error-console");s||(s=document.createElement("shiny-error-console"),document.body.appendChild(s)),s.appendConsoleMessage({headline:n,message:e})}function Cn(n){let e=null,t="Error on client while running Shiny app";typeof n=="string"?e=n:n instanceof En?(e=n.message,t=n.headline):n instanceof Error?e=n.message:e="Unknown error",Tr({headline:t,message:e,status:"error"})}var Sn=class extends CustomEvent{constructor(e){super("shiny:client-message",{detail:e,bubbles:!0,cancelable:!0})}};window.addEventListener("shiny:client-message",n=>{if(!(n instanceof CustomEvent))throw new Error("[shiny] shiny:client-message expected a CustomEvent");let{headline:e,message:t,status:i}=n.detail;if(!t)throw new Error("[shiny] shiny:client-message expected a `message` property in `event.detail`.");Tr({headline:e,message:t,status:i})});function $n(n){pe(n,null),bn.find(document.documentElement).trigger("shiny-internal:brushed",{brushId:n,outputId:null})}var kt=class{constructor(e){this.pendingData={};this.reentrant=!1;this.sendIsEnqueued=!1;this.lastChanceCallback=[];this.shinyapp=e}setInput(e,t,i){this.pendingData[e]=t,this.reentrant||(i.priority==="event"?this._sendNow():this.sendIsEnqueued||this.shinyapp.taskQueue.enqueue(()=>{this.sendIsEnqueued=!1,this._sendNow()}))}_sendNow(){this.reentrant&&console.trace("Unexpected reentrancy in InputBatchSender!"),this.reentrant=!0;try{this.lastChanceCallback.forEach(t=>t());let e=this.pendingData;this.pendingData={},this.shinyapp.sendInput(e)}finally{this.reentrant=!1}}};var Ht=class{constructor(e){this.pendingInput={};this.target=e}setInput(e,t,i){/^\./.test(e)?this.target.setInput(e,t,i):this.pendingInput[e]={value:t,opts:i}}submit(){for(let e in this.pendingInput)if(w(this.pendingInput,e)){let{value:t,opts:i}=this.pendingInput[e];this.target.setInput(e,t,i)}}};var Ri=$(M());function Le(n){let e=n.split(":");return{name:e[0],inputType:e.length>1?e[1]:""}}var Dt=class{constructor(e){this.target=e}setInput(e,t,i){let s=Ri.default.Event("shiny:inputchanged"),o=Le(e);if(s.name=o.name,s.inputType=o.inputType,s.value=t,s.binding=i.binding||null,s.el=i.el||null,s.priority=i.priority,(0,Ri.default)(i.el||window.document).trigger(s),!s.isDefaultPrevented()){let a=s.name;s.inputType!==""&&(a+=":"+s.inputType),this.target.setInput(a,s.value,{priority:i.priority})}}};var Pt=class{constructor(e,t={}){this.lastSentValues={};this.target=e,this.reset(t)}setInput(e,t,i){let{name:s,inputType:o}=Le(e),a=JSON.stringify(t);i.priority!=="event"&&this.lastSentValues[s]&&this.lastSentValues[s].jsonValue===a&&this.lastSentValues[s].inputType===o||(this.lastSentValues[s]={jsonValue:a,inputType:o},this.target.setInput(e,t,i))}reset(e={}){let t={};for(let i in e)if(w(e,i)){let{name:s,inputType:o}=Le(i);t[s]={jsonValue:JSON.stringify(e[i]),inputType:o}}this.lastSentValues=t}forget(e){delete this.lastSentValues[e]}};var Lt=class{constructor(e){this.inputRatePolicies={};this.target=e}setInput(e,t,i){let{name:s}=Le(e);this._ensureInit(s),i.priority!=="deferred"?this.inputRatePolicies[s].immediateCall(e,t,i):this.inputRatePolicies[s].normalCall(e,t,i)}setRatePolicy(e,t,i){let{name:s}=Le(e);t==="direct"?this.inputRatePolicies[s]=new dt(this,this._doSetInput):t==="debounce"?this.inputRatePolicies[s]=new le(this,this._doSetInput,i):t==="throttle"&&(this.inputRatePolicies[s]=new Me(this,this._doSetInput,i))}_ensureInit(e){e in this.inputRatePolicies||this.setRatePolicy(e,"direct")}_doSetInput(e,t,i){this.target.setInput(e,t,i)}};function Ai(n){let e={priority:"immediate",...n};switch(e.priority){case"deferred":case"immediate":case"event":break;default:throw new Error("Unexpected input value mode: '"+e.priority+"'")}return e}var Bt=class{constructor(e){this.target=e}setInput(e,t,i={}){if(!e)throw"Can't set input with empty name.";let s=Ai(i);this.target.setInput(e,t,s)}};function Ho(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}function Ir(){let{promise:n,resolve:e}=Ho(),t=!1;return{promise:n,resolve(i){t=!0,e(i)},then:n.then.bind(n),catch:n.catch.bind(n),finally:n.finally.bind(n),[Symbol.toStringTag]:"InitStatus",resolved(){return t}}}var J=$(M());var kn=class{constructor(e,t){this.el=e,this.binding=t,t.resize&&(this.onResize=Cs(e,function(i,s){t.resize(e,i,s)}))}getId(){return this.binding.getId(this.el)}async onValueChange(e){await this.binding.onValueChange(this.el,e)}onValueError(e){this.binding.onValueError(this.el,e)}showProgress(e){this.binding.showProgress(this.el,e)}onResize(){}};function Er(n){return!!(n&&n.jquery)}function Do(n,e,t,i){let s=e.getId(t);if(s){let o=e.getValue(t),a=e.getType(t);a&&(s=s+":"+a);let r=Po(i);n.setInput(s,o,{priority:r,binding:e,el:t})}}function Po(n){return n===!1||n===void 0?"immediate":n===!0?"deferred":typeof n=="object"&&"priority"in n?n.priority:n}var _t=(()=>{let n=new Map;function e(s){if(!Er(s)&&!(s instanceof HTMLElement))return;let o=new Map,a=new Set;if(n.forEach((C,H)=>{let I={input:0,output:0};
436C.forEach(_=>I[_]+=1),!(I.input+I.output<2)&&(o.set(H,I),I.input>1&&a.add("input"),I.output>1&&a.add("output"),I.input>=1&&I.output>=1&&a.add("shared"))}),o.size===0)return;let r=Array.from(o.entries()).map(([C,H])=>{let I=[Sr(H.input,"input"),Sr(H.output,"output")].filter(_=>_!=="").join(" and ");return`- "${C}": ${I}`}).join(` 437`),l="Duplicate",u="input/output";a.has("input")&&a.has("output")||(a.has("input")?u="input":a.has("output")?u="output":a.has("shared")&&(l="Shared"));let c=o.size==1?"ID was":"IDs were",d=`${l} ${u} ${c} found`,p=`The following ${c} used for more than one ${a.has("shared")?"input/output":u}: 438${r}`,h=new Sn({headline:d,message:p});((Er(s)?s.get(0):s)||window).dispatchEvent(h)}function t(s,o){let a=n.get(s);a?a.push(o):n.set(s,[o])}function i(s,o){let a=n.get(s);if(a){let r=a.indexOf(o);r>-1&&a.splice(r,1)}a?.length===0&&n.delete(s)}return{addBinding:t,removeBinding:i,checkValidity:e}})();function Sr(n,e){return n===0?"":n===1?`${n} ${e}`:`${n} ${e}s`}function Lo(n,e=document.documentElement){let{inputs:t,inputsRate:i,inputBindings:s}=n,o=s.getBindings(),a={};for(let r=0;r<o.length;r++){let l=o[r].binding,u=l.find(e)||[];for(let c=0;c<u.length;c++){let d=u[c];if(d.hasAttribute("data-shiny-no-bind-input"))continue;let p=l.getId(d);if(!p||(0,J.default)(d).hasClass("shiny-bound-input"))continue;let h=l.getType(d),x=h?p+":"+h:p;a[x]={value:l.getValue(d),opts:{immediate:!0,binding:l,el:d}};let C=function(){let I=l,_=d;return function(Q){Do(t,I,_,Q)}}();l.subscribe(d,C),(0,J.default)(d).data("shiny-input-binding",l),(0,J.default)(d).addClass("shiny-bound-input");let H=l.getRatePolicy(d);H!==null&&i.setRatePolicy(x,H.policy,H.delay),_t.addBinding(p,"input"),(0,J.default)(d).trigger({type:"shiny:bound",binding:l,bindingType:"input"})}}return a}async function Bo({outputBindings:n,outputIsRecalculating:e},t=document.documentElement){let i=(0,J.default)(t),s=n.getBindings();for(let o=0;o<s.length;o++){let a=s[o].binding,r=a.find(i)||[];for(let l=0;l<r.length;l++){let u=r[l],c=a.getId(u);if(!c||!J.default.contains(document.documentElement,u))continue;let d=(0,J.default)(u);if(d.hasClass("shiny-bound-output"))continue;let p=new kn(u,a);await us(c,p),d.data("shiny-output-binding",p),d.addClass("shiny-bound-output"),d.attr("aria-live")||d.attr("aria-live","polite"),e(c)&&p.showProgress(!0),_t.addBinding(c,"output"),d.trigger({type:"shiny:bound",binding:a,bindingType:"output"})}}setTimeout(()=>se.regular(),0)}function _o(n=document.documentElement,e=!1){let t=(0,J.default)(n).find(".shiny-bound-input").toArray();e&&(0,J.default)(n).hasClass("shiny-bound-input")&&t.push(n);for(let i=0;i<t.length;i++){let s=t[i],o=(0,J.default)(s).data("shiny-input-binding");if(!o)continue;let a=o.getId(s);(0,J.default)(s).removeClass("shiny-bound-input"),_t.removeBinding(a,"input"),o.unsubscribe(s),(0,J.default)(s).trigger({type:"shiny:unbound",binding:o,bindingType:"input"})}}function Ro(n=document.documentElement,e=!1){let t=(0,J.default)(n).find(".shiny-bound-output").toArray();e&&(0,J.default)(n).hasClass("shiny-bound-output")&&t.push(n);for(let i=0;i<t.length;i++){let s=(0,J.default)(t[i]),o=s.data("shiny-output-binding");if(!o)continue;let a=o.binding.getId(t[i]);cs(a,o),_t.removeBinding(a,"output"),s.removeClass("shiny-bound-output"),s.removeData("shiny-output-binding");for(let r of["shiny-resize-observer","shiny-intersection-observer","shiny-mutate-observer"]){let l=s.data(r);l&&(l.disconnect(),s.removeData(r)),s.data(r+"-callback")?.cancel?.(),s.removeData(r+"-callback")}s.trigger({type:"shiny:unbound",binding:o.binding,bindingType:"output"})}setTimeout(()=>se.regular(),0)}async function Oi(n,e){await Bo(n,e);let t=Lo(n,e);return _t.checkValidity(e),t}function Mr(n,e=!1){_o(n,e),Ro(n,e)}async function Cr(n,e){let t=await Oi(n,e),i=n.inputs;J.default.each(t,function(s,o){i.setInput(s,o.value,o.opts)}),n.initDeferredIframes()}var Be=$(M());async function Hn({html:n="",deps:e=[]}={}){await Ve(e),(0,Be.default)(".modal-backdrop").remove();let t=(0,Be.default)("#shiny-modal-wrapper");t.length===0&&(t=(0,Be.default)('<div id="shiny-modal-wrapper"></div>'),(0,Be.default)(document.body).append(t),t.on("hidden.bs.modal",function(i){i.target===(0,Be.default)("#shiny-modal")[0]&&(Y(t),t.remove())}
438)),t.on("keydown.shinymodal",function(i){(0,Be.default)("#shiny-modal").data("keyboard")!==!1&&i.keyCode===27&&(i.stopPropagation(),i.preventDefault())}),await re(t,{html:n})}function Dn(){let n=(0,Be.default)("#shiny-modal-wrapper");n.off("keydown.shinymodal");let e=n.find(".modal");e.length>0?(e.on("shown.bs.modal",()=>e.modal("hide")),e.modal("hide")):(Y(n),n.remove())}var Rt=$(M());var Ao=250;async function Ie({html:n="",action:e="",deps:t=[],duration:i=5e3,id:s=null,closeButton:o=!0,type:a=null}={}){s||(s=qt()),await Ve(t),Vo();let r=At(s);r?.length===0&&(r=zo(s));let l=r,u=`<div class="shiny-notification-content-text">${n}</div><div class="shiny-notification-content-action">${e}</div>`,c=l.find(".shiny-notification-content");await re(c,{html:u});let d=l?.attr("class");if(d){let h=d.split(/\s+/).filter(x=>x.match(/^shiny-notification-/)).join(" ");l.removeClass(h)}a&&a!=="default"&&l.addClass("shiny-notification-"+a);let p=l.find(".shiny-notification-close");return o&&p.length===0?l.append('<div class="shiny-notification-close">×</div>'):!o&&p.length!==0&&p.remove(),i?No(s,i):$r(s),s}function Ee(n){At(n)?.fadeOut(Ao,function(){Y(this),(0,Rt.default)(this).remove(),Oo().length===0&&Ot().remove()})}function At(n){return n?Ot().find("#shiny-notification-"+E(n)):null}function Oo(){return Ot().find(".shiny-notification").map(function(){return this.id.replace(/shiny-notification-/,"")}).get()}function Ot(){return(0,Rt.default)("#shiny-notification-panel")}function Vo(){let n=Ot();return n.length>0||(0,Rt.default)(document.body).append('<div id="shiny-notification-panel">'),n}function zo(n){let e=At(n);return e?.length===0&&(e=(0,Rt.default)(`<div id="shiny-notification-${n}" class="shiny-notification"><div class="shiny-notification-close">×</div><div class="shiny-notification-content"></div></div>`),e.find(".shiny-notification-close").on("click",t=>{t.preventDefault(),t.stopPropagation(),Ee(n)}),Ot().append(e)),e}function No(n,e){$r(n);let t=setTimeout(function(){Ee(n)},e);At(n)?.data("removalCallback",t)}function $r(n){let t=At(n)?.data("removalCallback");t&&clearTimeout(t)}var Vi=$(M());function kr(n){let e=(0,Vi.default)("#shiny-reconnect-time");if(e.length===0)return;let t=Math.floor((n-new Date().getTime())/1e3);t>0?e.text(" in "+t+"s"):e.text("..."),setTimeout(function(){kr(n)},1e3)}async function Pn(n){let e=new Date().getTime()+n;if((0,Vi.default)("#shiny-reconnect-text").length>0)return;await Ie({id:"reconnect",html:'<span id="shiny-reconnect-text">Attempting to reconnect</span><span id="shiny-reconnect-time"></span>',action:'<a id="shiny-reconnect-now" href="#" onclick="Shiny.shinyapp.reconnect();">Try now</a>',duration:null,closeButton:!1,type:"warning"}),kr(e)}function Ln(){Ee("reconnect")}var y=$(M());var Bn=class{constructor(){this.$promises=[];this.$resolvers=[]}_add(){let e=new Promise(t=>{this.$resolvers.push(t)});this.$promises.push(e)}enqueue(e){this.$resolvers.length||this._add(),this.$resolvers.shift()(e)}async dequeue(){return this.$promises.length||this._add(),this.$promises.shift()}isEmpty(){return!this.$promises.length}isBlocked(){return!!this.$resolvers.length}get length(){return this.$promises.length-this.$resolvers.length}};var R,Hr,Dr,Pr,zi,Vt,Ye,_n=class{constructor(){Ze(this,R);this.outputStates=new Map;this.changedOutputs=new Map}takeChanges(){let e=this.changedOutputs;return this.changedOutputs=new Map,e}isRecalculating(e){let t=j(this,R,Vt).call(this,e);return["initial","running","idle","persistent","invalidated"].includes(t)}updateStateFromMessage(e){Uo(e)&&j(this,R,Hr).call(this,e),Fo(e)&&j(this,R,Dr).call(this,e),Qo(e)&&j(this,R,Pr).call(this,e)}};R=new WeakSet,Hr=function(e){let{name:t,status:i}=e.recalculating,s=j(this,R,Vt).call(this,t);if(i==="recalculating")switch(s){case"initial":case"invalidated":j(this,R,Ye).call(this,t,"running");break;default:throw new Error(`Shiny server sent a message that the output '${t}' is recalculating, 439 but the output is in an unexpected state of: '${s}'.`)}if(i==="recalculated")switch(s){case"running":j(this,R,Ye).call(this,t,"idle");break;default:throw new Error(`Shiny server sent a message that the output '${t}' has been recalculated, 440 but the output is in an unexpected state of: '${s}'.`)}},Dr=function(e){for(let t in e.values)j(this,R,zi).call(this,t,"value");for(let t in e.errors)j(this,R,zi).call(this,t,"error");for(let[t,i]of this.outputStates)switch(i){case"idle":j(this,R,Ye).call(this,t,"cancel");break;case"value":case"error":case"cancel":case"persistent":case"invali
440dated":break;default:throw new Error(`Shiny server sent a flush message, and after processing the values and errors, 441 the output '${t}' has an unexpected ending state of: '${i}'.`)}},Pr=function(e){let{id:t,persistent:i}=e.progress.message,s=j(this,R,Vt).call(this,t);if(i)switch(s){case"running":j(this,R,Ye).call(this,t,"persistent");break;default:throw new Error(`Shiny server has sent a 'persistent progress' message for ${t}, 442 but the output is in an unexpected state of: ${s}`)}else switch(s){case"value":case"error":case"cancel":case"persistent":case"idle":j(this,R,Ye).call(this,t,"invalidated");break;default:throw new Error(`Shiny server has sent a progress message for ${t}, 443 but the output is in an unexpected state of: ${s}`)}},zi=function(e,t){let i=j(this,R,Vt).call(this,e);switch(i){case"idle":j(this,R,Ye).call(this,e,t);break;default:throw new Error(`Shiny server has sent a ${t} for the output '${e}', 444 but the output is in an unexpected state of: '${i}'.`)}},Vt=function(e){return this.outputStates.get(e)??"initial"},Ye=function(e,t){let i=this.isRecalculating(e);this.outputStates.set(e,t);let s=this.isRecalculating(e);i!==s&&this.changedOutputs.set(e,s)};function Uo(n){return n.recalculating!==void 0}function Fo(n){let e=n;return e.values!==void 0&&e.errors!==void 0}function Qo(n){let e=n;return e.progress!==void 0&&e.progress.type==="binding"}var Lr=[],Ui={},Rn=[],An={},Ni="shiny-conditional--shown";function A(n,e){if(Ui[n])throw'handler for message of type "'+n+'" already added.';if(typeof e!="function")throw"handler must be a function.";if(e.length!==1)throw"handler must be a function that takes one argument.";Lr.push(n),Ui[n]=e}function Br(n,e){if(An[n]){let t=Rn.indexOf(n);t!==-1&&(Rn.splice(t,1),delete An[n])}if(typeof e!="function")throw"handler must be a function.";if(e.length!==1)throw"handler must be a function that takes one argument.";Rn.push(n),An[n]=e}var On=class{constructor(){this.$socket=null;this.taskQueue=new Bn;this.config=null;this.$inputValues={};this.$initialInput=null;this.$bindings={};this.$outputProgress=new _n;this.$values={};this.$errors={};this.$conditionals={};this.$pendingMessages=[];this.$activeRequests={};this.$nextRequestId=0;this.$allowReconnect=!1;this.scheduledReconnect=void 0;this.reconnectDelay=function(){let e=0,t=[1500,1500,2500,2500,5500,5500,10500];return{next:function(){let i=e;return i>=t.length&&(i=t.length-1),e++,t[i]},reset:function(){e=0}}}();this.progressHandlers={binding:function(e){let t=e.id,i=this.$bindings[t];i&&(0,y.default)(i.el).trigger({type:"shiny:outputinvalidated",binding:i,name:t}),this._updateProgress()},open:async function(e){if(e.style==="notification")await Ie({html:`<div id="shiny-progress-${e.id}" class="shiny-progress-notification"><div class="progress active" style="display: none;"><div class="progress-bar"></div></div><div class="progress-text"><span class="progress-message">message</span> <span class="progress-detail"></span></div></div>`,id:e.id,duration:null});else if(e.style==="old"){let t=(0,y.default)(".shiny-progress-container");t.length===0&&(t=(0,y.default)('<div class="shiny-progress-container"></div>'),(0,y.default)(document.body).append(t));let i=(0,y.default)(".shiny-progress.open").length,s=(0,y.default)('<div class="shiny-progress open"><div class="progress active"><div class="progress-bar bar"></div></div><div class="progress-text"><span class="progress-message">message</span><span class="progress-detail"></span></div></div>');s.attr("id",e.id),t.append(s);let o=s.find(".progress");if(o){o.css("top",i*o.height()+"px");let a=s.find(".progress-text");a.css("top",3*o.height()+i*a.outerHeight()+"px"),s.hide()}}},update:function(e){if(e.style==="notification"){let t=(0,y.default)("#shiny-progress-"+e.id);if(t.length===0)return;typeof e.message<"u"&&t.find(".progress-message").text(e.message),typeof e.detail<"u"&&t.find(".progress-detail").text(e.detail),typeof e.value<"u"&&e.value!==null&&(t.find(".progress").show(),t.find(".progress-bar").width(e.value*100+"%"))}else if(e.style==="old"){let t=(0,y.default)("#"+e.id+".shiny-progress");typeof e.message<"u"&&t.find(".progress-message").text(e.message),typeof e.detail<"u"&&t.find(".progress-detail").text(e.detail),typeof e.value<"u"&&e.value!==null&&(t.find(".progress").show(),t.find(".bar").width(e.value*100+"%")),t.fadeIn()}},close:function(e){if(e.style==="notification")Ee(e.id);else if(e.style==="old"){let t=(0,y.default)("#"+e.id+".shiny-progress");t.removeClass("open"),t.fadeOut({complete:function(){t.remove(),(0,y.default)(".shiny-progress").length===0&&(0,y.default)(".shiny-progress-container").remove()}})}}};this._init()}connect(e){if(this.$socket)throw"Connect was already called on this application object";this.$socket=this.createSocket(),this.$initialInput=e,y.default.extend(this.$inputValues,e),this.$updateConditionals()}isConnected(){return!!this.$socket}reconnect(){if(clearTimeout(this.scheduledReconnect),this.isConnected())throw"Attempted to reconnect, but already connected.";this.$socket=this.createSocket(),this.$initialInput=y.default.extend({},this.$inputValues),this.$updateConditionals()}createSocket(){let t=(hs()||(()=>{let s="ws:";window.location.protocol==="https:"&&(s="wss:");let o=window.location.pathname;/^([$#!&-;=?-[\]_a-z~]|%[0-9a-fA-F]{2})+$/.test(o)||(o=encodeURI(o),Ki()&&(o=encodeURI(o))),/\/$/.test(o)||(o+="/"),o+="websocket/";let a=new WebSocket(s+"//"+window.location.host+o);return a.binaryType="arraybuffer",a}))(),i=!1;return t.onopen=()=>{for(i=!0,(0,y.default)(document).trigger({type:"shiny:connected",socket:t}),this.onConnected(),t.send(JSON.stringify({method:"init",data:this.$initialInput}));this.$pendingMessages.length;){let s=this.$pendingMessages.shift();t.send(s)}this.startActionQueueLoop()},t.onmessage=s=>{this.taskQueue.enqueue(async()=>await this.dispatchMessage(s.data))},t.onclose=s=>{let o=s.code===1012;i&&((0,y.default)(document).trigger({type:"shiny:disconnected",socket:t}),this.$notifyDisconnected()),this.onDisconnected(o),this.$removeSocket()},t}async startActionQueueLoop(){for(;;)try{await(await this.taskQueue.dequeue())()}catch(e){Cn(e),console.error(e)}}sendInput(e){let t=JSON.stringify({method:"update",data:e});this.$sendMsg(t),y.default.extend(this.$inputValues,e),this.$updateConditionals()}$notifyDisconnected(){window.parent&&window.parent.postMessage("disconnected","*")}$removeSocket(){this.$socket=null}$scheduleReconnect(e){this.scheduledReconnect=window.setTimeout(()=>{this.reconnect()},e)}onDisconnected(e=!1){if((0,y.default)("#shiny-disconnected-overlay").length===0&&(0,y.default)(document.body).append('<div id="shiny-disconnected-overlay"></div>'),(0,y.default)("#shiny-disconnected-overlay").toggleClass("reloading",e),this.$allowReconnect===!0&&this.$socket.allowReconnect===!0||this.$allowReconnect==="force"){let t=this.reconnectDelay.next();Pn(t),this.$scheduleReconnect(t)}}onConnected(){(0,y.default)("#shiny-disconnected-overlay").remove(),Ln(),this.reconnectDelay.reset()}
444makeRequest(e,t,i,s,o){let a=this.$nextRequestId;for(;this.$activeRequests[a];)a=(a+1)%1e9;this.$nextRequestId=a+1,this.$activeRequests[a]={onSuccess:i,onError:s};let r=JSON.stringify({method:e,args:t,tag:a});if(o){let l=function(p){let h=new ArrayBuffer(4);return new DataView(h).setUint32(0,p,!0),h},u=[];u.push(l(16908802));let c=new Blob([r]);u.push(l(c.size)),u.push(c);for(let p=0;p<o.length;p++){let h=o[p];u.push(l(h.byteLength||h.size||0)),u.push(h)}r=new Blob(u)}this.$sendMsg(r)}$sendMsg(e){this.$socket&&this.$socket.readyState?this.$socket.send(e):this.$pendingMessages.push(e)}receiveError(e,t){if(this.$errors[e]===t)return;this.$errors[e]=t,delete this.$values[e];let i=this.$bindings[e],s=y.default.Event("shiny:error");s.name=e,s.error=t,s.binding=i,(0,y.default)(i?i.el:document).trigger(s),!s.isDefaultPrevented()&&i&&i.onValueError&&i.onValueError(s.error)}async receiveOutput(e,t){let i=this.$bindings[e],s=y.default.Event("shiny:value");if(s.name=e,s.value=t,s.binding=i,this.$values[e]===t){(0,y.default)(i?i.el:document).trigger(s);return}return this.$values[e]=t,delete this.$errors[e],(0,y.default)(i?i.el:document).trigger(s),!s.isDefaultPrevented()&&i&&await i.onValueChange(s.value),t}async bindOutput(e,t){if(!e)throw new Error("Can't bind an element with no ID");return this.$bindings[e]=t,this.$values[e]!==void 0?await t.onValueChange(this.$values[e]):this.$errors[e]!==void 0&&t.onValueError(this.$errors[e]),t}unbindOutput(e,t){return this.$bindings[e]===t?(delete this.$bindings[e],!0):!1}_narrowScopeComponent(e,t){return Object.keys(e).filter(i=>i.indexOf(t)===0).map(i=>({[i.substring(t.length)]:e[i]})).reduce((i,s)=>y.default.extend(i,s),{})}_narrowScope(e,t){return t?{input:this._narrowScopeComponent(e.input,t),output:this._narrowScopeComponent(e.output,t)}:e}$updateConditionals(){(0,y.default)(document).trigger({type:"shiny:conditional"});let e={};for(let s in this.$inputValues)if(ie(this.$inputValues,s)){let o=s.replace(/:.*/,"");e[o]=this.$inputValues[s]}let t={input:e,output:this.$values},i=(0,y.default)(document).find("[data-display-if]");for(let s=0;s<i.length;s++){let o=(0,y.default)(i[s]),a=o.data("data-display-if-func");if(!a){let d=o.attr("data-display-if");a=ks(d),o.data("data-display-if-func",a)}let r=o.attr("data-ns-prefix"),l=this._narrowScope(t,r),u=!!a(l),c=o.hasClass(Ni);u!==c&&(u?(o.trigger("show"),o.addClass(Ni),o.trigger("shown")):(o.trigger("hide"),o.removeClass(Ni),o.trigger("hidden")))}}async dispatchMessage(e){let t={};if(typeof e=="string")t=JSON.parse(e);else{let s=new DataView(e,0,1).getUint8(0),o=new DataView(e,1,s),a=[];for(let l=0;l<s;l++)a.push(String.fromCharCode(o.getUint8(l)));let r=a.join("");e=e.slice(s+1),t.custom={},t.custom[r]=e}let i=y.default.Event("shiny:message");i.message=t,(0,y.default)(document).trigger(i),!i.isDefaultPrevented()&&(this.$outputProgress.updateStateFromMessage(i.message),await this._sendMessagesToHandlers(i.message,Ui,Lr),this.$updateConditionals())}async _sendMessagesToHandlers(e,t,i){for(let s=0;s<i.length;s++){let o=i[s];ie(e,o)&&await t[o].call(this,e[o])}}_updateProgress(){let e=this.$outputProgress.takeChanges();for(let[t,i]of e.entries())ie(this.$bindings,t)&&this.$bindings[t].showProgress(i)}_init(){A("values",async r=>{this._updateProgress();for(let l in r)ie(r,l)&&await this.receiveOutput(l,r[l])}),A("errors",r=>{for(let l in r)ie(r,l)&&this.receiveError(l,r[l])}),A("inputMessages",async r=>{for(let l=0;l<r.length;l++){let u=(0,y.default)(".shiny-bound-input#"+E(r[l].id)),c=u.data("shiny-input-binding");if(u.length>0){u.attr("aria-live")||u.attr("aria-live","polite");let d=u[0],p=y.default.Event("shiny:updateinput");if(p.message=r[l].message,p.binding=c,(0,y.default)(d).trigger(p),!p.isDefaultPrevented())try{await c.receiveMessage(d,p.message)}catch(h){console.error("[shiny] Error in inputBinding.receiveMessage()",{error:h,binding:c,message:p.message})}}}}),A("javascript",r=>{Fe(r)}),A("console",r=>{for(let l=0;l<r.length;l++)console.log&&console.log(r[l])}),A("progress",async r=>{if(r.type&&r.message){let l=await this.progressHandlers[r.type];l&&l.call(this,r.message)}}),A("notification",async r=>{if(r.type==="show")await Ie(r.message);else if(r.type==="remove")Ee(r.message);else throw"Unkown notification type: "+r.type}),A("modal",async r=>{if(r.type==="show")await Hn(r.message);else if(r.type==="remove")Dn();else throw"Unkown modal type: "+r.type}),A("response",r=>{let l=r.tag,u=this.$activeRequests[l];u&&(delete this.$activeRequests[l],"value"in r?u.onSuccess(r.value):u.onError(r.error))}),A("allowReconnect",r=>{switch(r){case!0:case!1:case"force":this.$allowReconnect=r;break;default:throw"Invalid value for allowReconnect: "+r}}),A("custom",async r=>{let l=ds();l&&await l(r),await this._sendMessagesToHandlers(r,An,Rn)}),A("config",r=>{this.config={workerId:r.workerId,sessionId:r.sessionId},r.user&&as(r.user),(0,y.default)(document).trigger("shiny:sessioninitialized")}),A("busy",r=>{r==="busy"?((0,y.default)(document.documentElement).addClass("shiny-busy"),(0,y.default)(document).trigger("shiny:busy")):r==="idle"&&((0,y.default)(document.documentElement).removeClass("shiny-busy"),(0,y.default)(document).trigger("shiny:idle"))}),A("recalculating",r=>{if(ie(r,"name")&&ie(r,"status")){let l=this.$bindings[r.name];
444l?(0,y.default)(l.el).trigger("shiny:"+r.status):(0,y.default)().trigger("shiny:"+r.status)}}),A("reload",r=>{window.location.reload()}),A("shiny-insert-ui",async r=>{let l=(0,y.default)(r.selector);if(l.length===0)console.warn('The selector you chose ("'+r.selector+'") could not be found in the DOM.'),await mt(r.content.html,(0,y.default)([]),r.content.deps);else for(let u of l)if(await re(u,r.content,r.where),r.multiple===!1)break}),A("shiny-remove-ui",r=>{(0,y.default)(r.selector).each(function(u,c){return Y(c,!0),(0,y.default)(c).remove(),r.multiple===!1?!1:void 0})}),A("frozen",r=>{for(let l=0;l<r.ids.length;l++)ls(r.ids[l])});function e(r){let l=(0,y.default)("#"+E(r));if(l.length===0)throw"There is no tabsetPanel (or navbarPage or navlistPanel) with id equal to '"+r+"'";return l}function t(r){let l=r.attr("data-tabsetid");return(0,y.default)("div.tab-content[data-tabsetid='"+E(l)+"']")}function i(r,l,u){let c="[data-value='"+E(u)+"']",d=r.find("a"+c),p=d.parent();if(p.length===0)throw"There is no tabPanel (or navbarMenu) with value (or menuName) equal to '"+u+"'";let h=[],x=[];if(d.attr("data-toggle")==="dropdown"){let C=d.find("+ ul.dropdown-menu"),H=C.attr("data-tabsetid");C.find("a[data-toggle='tab']").parent("li").each(function(b,S){h.push((0,y.default)(S))});let _="div.tab-pane[id^='tab-"+E(H)+"']";l.find(_).each(function(b,S){x.push((0,y.default)(S))})}else x.push(l.find("div"+c));return{$liTag:p,$liTags:h,$divTags:x}}A("shiny-insert-tab",async r=>{let l=e(r.inputId),u=l,c=t(u),d=l.attr("data-tabsetid"),p=(0,y.default)("<div>");await re(p,r.liTag,"afterBegin");let h=(0,y.default)(p).find("> li"),x=h.find("> a"),C=null;r.target!==null&&(C=i(u,c,r.target).$liTag);let H=Q();if(H!==null){if(x.attr("data-toggle")==="dropdown")throw"Cannot insert a navbarMenu inside another one";u=H.$tabset,d=H.id,h.removeClass("nav-item").find(".nav-link").removeClass("nav-link").addClass("dropdown-item")}let I="";if(x.attr("data-toggle")==="tab"){let b=_(u,d),S="tab-"+d+"-"+b;h.find("> a").attr("href","#"+S),I=S}r.position==="before"?C?C.before(h):u.prepend(h):r.position==="after"&&(C?C.after(h):u.append(h)),await Oe(C?.parent()||u),await re(c[0],r.divTag,"beforeEnd"),I&&c.find('[id="tab-tsid-id"]').attr("id",I),r.select&&h.find("a").tab("show");function _(b,S){let L=[0];return b.find("> li").each(function(){let Se=(0,y.default)(this).find("> a[data-toggle='tab']");if(Se.length>0){let ut=Se.attr("href").replace(/.*(?=#[^\s]+$)/,"").replace("#tab-"+S+"-","");L.push(Number(ut))}}),Math.max.apply(null,L)+1}function Q(){if(r.menuName!==null){let b=(0,y.default)("a.dropdown-toggle[data-value='"+E(r.menuName)+"']");if(b.length===0)throw"There is no navbarMenu with menuName equal to '"+r.menuName+"'";let S=b.find("+ ul.dropdown-menu"),L=S.attr("data-tabsetid");return{$tabset:S,id:L}}else if(r.target!==null&&C!==null){let b=C.parent("ul");if(b.hasClass("dropdown-menu")){let S=b.attr("data-tabsetid");return{$tabset:b,id:S}}}return null}});function s(r){let l=r.data("shiny-input-binding");if(!l.getValue(r)){let u=o(r),c=y.default.Event("shiny:updateinput");c.binding=l,r.trigger(c),l.setValue(r[0],u)}}function o(r){return r.find("li:visible a[data-toggle='tab']").first().attr("data-value")||null}function a(r,l,u=!1){y.default.each(r,function(c,d){c==="$liTag"?l(d):c==="$divTags"?y.default.each(d,function(p,h){l(h)}):u&&c==="$liTags"&&y.default.each(d,function(p,h){l(h)})})}A("shiny-remove-tab",r=>{let l=e(r.inputId),u=t(l),c=i(l,u,r.target);a(c,d),s(l);function d(p){Y(p,!0),p.remove()}}),A("shiny-change-tab-visibility",r=>{let l=e(r.inputId),u=t(l),c=i(l,u,r.target);a(c,d,!0),s(l);function d(p){r.type==="show"?p.css("display",""):r.type==="hide"&&(p.hide(),p.removeClass("active"))}}),A("updateQueryString",r=>{if(r.mode==="replace"){window.history.replaceState(null,null,r.queryString);return}let l=null;if(r.queryString.charAt(0)==="#")l="hash";else if(r.queryString.charAt(0)==="?")l="query";else throw"The 'query' string must start with either '?' (to update the query string) or with '#' (to update the hash).";let u=window.location.pathname,c=window.location.search,d=window.location.hash,p=u;l==="query"?p+=r.queryString:p+=c+r.queryString,window.history.pushState(null,null,p),r.queryString.indexOf("#")!==-1&&(l="hash"),window.location.hash!==d&&(l="hash"),l==="hash"&&(0,y.default)(document).trigger("hashchange")}),A("resetBrush",r=>{$n(r.brushId)})}getTestSnapshotBaseUrl({fullUrl:e=!0}={}){let t=window.location,i="";return e&&(i=t.origin+t.pathname.replace(/\/[^/]*$/,"")),i+="/session/"+encodeURIComponent(this.config.sessionId)+"/dataobj/shinytest?w="+encodeURIComponent(this.config.workerId)+"&nonce="+qt(),i}};var Vn=class{constructor(){this.version="1.14.0";let{inputBindings:e,fileInputBinding:t}=Ws(),{outputBindings:i}=ir();fs(t),this.$escape=E,this.compareVersion=Ps,this.inputBindings=e,this.InputBinding=B,this.outputBindings=i,this.OutputBinding=U,this.resetBrush=$n,this.notifications={show:Ie,remove:Ee},this.modal={show:Hn,remove:Dn},this.addCustomMessageHandler=Br,this.showReconnectDialog=Pn,this.hideReconnectDialog=Ln,this.renderDependenciesAsync=Ve,this.renderDependencies=Kn,this.renderContentAsync=re,this.renderContent=be,this.renderHtmlAsync=mt,this.renderHtml=Yn,this.initializedPromise=Ir(),(0,z.default)(()=>{setTimeout(async()=>{try{await this.initialize()}catch(s){throw Cn(s),s}},1)})}inDevMode(){return Gt()}async initialize(){os(this),this.shinyapp=new On;let e=this.shinyapp;this.progressHandlers=e.progressHandlers;let t=new kt(e),i=new Pt(t),s=new Dt(i),o=new Lt(s),a=new Ht(s),r;document.querySelector(".shiny-submit-button")?(r=a,document.querySelectorAll(".shiny-submit-button").forEach(function(m){m.addEventListener("click",function(v){v.preventDefault(),a.submit()})})):r=o;let l=new Bt(r);this.setInputValue=this.onInputChange=function(m,v,T={}){let P=Ai(T);l.setInput(m,v,P)},this.forgetLastInputValue=function(m){i.forget(m)};let u=this.inputBindings,c=this.outputBindings,d=()=>
444({inputs:l,inputsRate:o,inputBindings:u,outputBindings:c,initDeferredIframes:_r,outputIsRecalculating:m=>this.shinyapp?.$outputProgress.isRecalculating(m)??!1});this.bindAll=async function(m){await Cr(d(),m)},this.unbindAll=function(m,v=!1){Mr(m,v)};function p(m=document.documentElement){let v=u.getBindings();for(let T=0;T<v.length;T++){let P=v[T].binding,te=P.find(m);if(te)for(let f=0;f<te.length;f++){let g=(0,z.default)(te[f]);g.data("_shiny_initialized")||(g.data("_shiny_initialized",!0),P.initialize(te[f]))}}}this.initializeInputs=p;function h(m){let T=(0,z.default)(m).data("shiny-output-binding");return T?T.getId():null}p(document.documentElement);let x=ce(await Oi(d(),document.documentElement),m=>m.value);function C(m,v,T=!1){T?x[m]=v:l.setInput(m,v)}function H(m,v=!1){let T=h(m);if(!T)return;let P=$s(m);(P.width!==0||P.height!==0)&&(C(".clientdata_output_"+T+"_width",P.width,v),C(".clientdata_output_"+T+"_height",P.height,v))}function I(m){let v=(0,z.default)(m),T=v.data("shiny-output-binding");T&&(v.trigger({type:"shiny:visualchange",visible:Xt(m),binding:T}),T.onResize())}function _(m,v=!1){if(m.classList.contains("shiny-output-error"))return;function T(f){if(!f)return null;let g=ve(f,"background-color");if(!g)return g;let D=g.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);if(g==="transparent"||D&&parseFloat(D[4])===0){let k=ve(f,"background-image");return k&&k!=="none"?null:T(f.parentElement)}return g}function P(f){let g=ve(f,"font-family"),D=ve(f,"font-size");return{families:g?.replace(/"/g,"").split(", "),size:D}}let te=h(m);te&&(C(".clientdata_output_"+te+"_bg",T(m),v),C(".clientdata_output_"+te+"_fg",ve(m,"color"),v),C(".clientdata_output_"+te+"_accent",Wt(m),v),C(".clientdata_output_"+te+"_font",P(m),v))}let Q=new Set;function b(m,v=!1){let T=h(m);if(!T)return;let P=!Xt(m);P?Q.delete(T):Q.add(T),C(".clientdata_output_"+T+"_hidden",P,v)}function S(m){return m.classList.contains("shiny-image-output")||m.classList.contains("shiny-plot-output")||m.classList.contains("shiny-report-size")}function L(m){return m.classList.contains("shiny-image-output")||m.classList.contains("shiny-plot-output")||m.classList.contains("shiny-report-theme")}function Se(m,v=!1){v||I(m),b(m,v),S(m)&&H(m,v),L(m)&&_(m,v)}function zt(m=!1){(0,z.default)(".shiny-bound-output").each(function(){let v=this;L(v)&&_(v,m)})}function ut(){let m=se.createObserverCallback(100,()=>zt());(0,z.default)(window).resize(function(){m()}),(0,z.default)(document).on("shiny:themechange",function(){m()})}function Un(m){if(!m.classList.contains("shiny-html-output"))return m;let v=m.parentElement;for(;v;){if(!v.classList.contains("shiny-html-output"))return v;if(v===document.documentElement)break;v=v.parentElement}return m}function Fn(m){let v=(0,z.default)(m);if(!v.data("shiny-resize-observer")){let T=se.createObserverCallback(100,()=>Se(m)),P=new ResizeObserver(()=>T());P.observe(m),v.data("shiny-resize-observer-callback",T),v.data("shiny-resize-observer",P)}if(!v.data("shiny-intersection-observer")){let T=se.createObserverCallback(100,()=>Se(m)),P=new IntersectionObserver(()=>T());P.observe(Un(m)),v.data("shiny-intersection-observer-callback",T),v.data("shiny-intersection-observer",P)}if(L(m)&&!v.data("shiny-mutate-observer")){let T=se.createObserverCallback(100,()=>{L(m)&&_(m)}),P=new MutationObserver(()=>T());P.observe(m,{attributes:!0,attributeFilter:["style","class"]}),v.data("shiny-mutate-observer",P),v.data("shiny-mutate-observer-callback",T)}}function Nt(m=!1){let v=new Set;(0,z.default)(".shiny-bound-output").each(function(){let T=this,P=h(T);P&&v.add(P),Fn(T),Se(T,m)}),Q.forEach(T=>{v.has(T)||(Q.delete(T),C(".clientdata_output_"+T+"_hidden",!0,m))})}Nt(!0),se.setSendMethod(t,Nt),ut(),x[".clientdata_pixelratio"]=ii(),(0,z.default)(window).resize(function(){l.setInput(".clientdata_pixelratio",ii())}),x[".clientdata_url_protocol"]=window.location.protocol,x[".clientdata_url_hostname"]=window.location.hostname,x[".clientdata_url_port"]=window.location.port,x[".clientdata_url_pathname"]=window.location.pathname,x[".clientdata_url_search"]=window.location.search,(0,z.default)(window).on("pushstate",function(m){l.setInput(".clientdata_url_search",window.location.search)}),(0,z.default)(window).on("popstate",function(m){l.setInput(".clientdata_url_search",window.location.search)}),x[".clientdata_url_hash_initial"]=window.location.hash,x[".clientdata_url_hash"]=window.location.hash,(0,z.default)(window).on("hashchange",function(m){l.setInput(".clientdata_url_hash",window.location.hash)});let Qn=x[".clientdata_singletons"]=(0,z.default)('script[type="application/shiny-singletons"]').text();gs(Qn.split(/,/));let Jn=(0,z.default)('script[type="application/html-dependencies"]').text();z.default.each(Jn.split(/;/),function(m,v){let T=/\s*^(.+)\[(.+)\]\s*$/.exec(v);T&&jt(T[1],T[2])}),i.reset(x),e.connect(x),(0,z.default)(document).one("shiny:connected",()=>{_r()}),(0,z.default)(document).one("shiny:sessioninitialized",()=>{this.initializedPromise.resolve()})}};function _r(){!window.Shiny||!window.Shiny.shinyapp||!window.Shiny.shinyapp.isConnected()||(0,z.default)(".shiny-frame-deferred").each(function(n,e){let t=(0,z.default)(e);t.removeClass("shiny-frame-deferred"),t.attr("src",t.attr("data-deferred-src")),t.attr("data-deferred-src",null)})}function Rr(){return window.navigator.userAgent}var Nn=$(M());function zn(){return Ae().config}function Ar(){(0,Nn.default)(document).on("keydown",function(n){if(n.which!==114||!n.ctrlKey&&!n.metaKey||n.shiftKey||n.altKey)return;let e="reactlog?w="+window.escape(zn().workerId)+"&s="+window.escape(zn().sessionId);window.open(e),n.preventDefault()}),(0,Nn.default)(document).on("keydown",function(n){if(!(n.which===115&&(n.ctrlKey||n.metaKey)&&!n.shiftKey&&!n.altKey||n.which===114&&(n.ctrlKey||n.metaKey)&&n.shiftKey&&!n.altKey))return;let e="reactlog/mark?w="+window.escape(zn().workerId)+"&s="+window.escape(zn().sessionId);Nn.default.get(e,function(t){if(t!=="marked")return;Ie({html:'<span id="shiny-reactlog-mark-text">Marked time point in reactlog</span>',closeButton:!0})}).fail(function(){window.open(e)}),n.preventDefault()})}var Or;function Vr(){if(window.Shiny)throw new Error("Trying to create window.Shiny, but it already exists!");Or=window.Shiny=new Vn,es(Rr()),ts(),rs(),is(),Ar()}Vr();})(); 445/*! Bundled license information: 446 447@lit/reactive-element/css-tag.js: 448 (** 449 * @license 450 * Copyright 2019 Google LLC 451 * SPDX-License-Identifier: BSD-3-Clause 452 *) 453 454@lit/reactive-element/reactive-element.js: 455lit-html/lit-html.js: 456lit-element/lit-element.js: 457 (** 458 * @license 459 * Copyright 2017 Google LLC 460 * SPDX-License-Identifier: BSD-3-Clause 461 *) 462 463lit-html/is-server.js: 464 (** 465 * @license 466 * Copyright 2022 Google LLC 467 * SPDX-License-Identifier: BSD-3-Clause 468 *) 469*/ 470//# sourceMappingURL=shiny.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.