diff --git a/42653471084.devtools b/42653471084.devtools new file mode 100644 index 0000000..d724311 --- /dev/null +++ b/42653471084.devtools @@ -0,0 +1,1797 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fixing issue #2543 · microsoft/ApplicationInsights-JS@eb09574 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ Skip to content + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + +
+
+
+ + + +
+
+
+
+ + +
+ +
+ +
+ + +
+ +
+ +
+
+

+ + Fixing issue #2543 + + #39 + +

+
+ +
+ + + + +
+ +
+
+
+ + + +
+
+
+

+ Fixing issue #2543 +

+

+ +
+ +
+ + + Fixing issue #2543 #39 + +

+ +
+
+ +
+
+ +
+ +
+ + + +
+
+ +
+
+
+ + +
+
+
+ + + + + +
+
+ + + + +
+
+
+ +
+ +
+ +
+
+
+
+ +
+

The logs for this run have expired and are no longer available.

+
+
+ +
+ +
+
+ + + +
+
+
+
+ + +
+ + +
+ +
+ + + +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + +
+
+
+ + + diff --git a/6488-de87864e6818.js b/6488-de87864e6818.js new file mode 100644 index 0000000..63eb410 --- /dev/null +++ b/6488-de87864e6818.js @@ -0,0 +1,3 @@ +"use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([[6488],{24212:(e,t,o)=>{o.d(t,{q:()=>r});var n="";function r(e){return e.split(` +`).reduce(function(e,t){var o,r,d,p=function(e){var t=i.exec(e);if(!t)return null;var o=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),l=a.exec(t[2]);return r&&null!=l&&(t[2]=l[1],t[3]=l[2],t[4]=l[3]),{file:o?null:t[2],methodName:t[1]||n,arguments:o?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}(t)||((o=l.exec(t))?{file:o[2],methodName:o[1]||n,arguments:[],lineNumber:+o[3],column:o[4]?+o[4]:null}:null)||function(e){var t=c.exec(e);if(!t)return null;var o=t[3]&&t[3].indexOf(" > eval")>-1,r=s.exec(t[3]);return o&&null!=r&&(t[3]=r[1],t[4]=r[2],t[5]=null),{file:t[3],methodName:t[1]||n,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}(t)||((r=u.exec(t))?{file:r[2],methodName:r[1]||n,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null)||((d=m.exec(t))?{file:d[3],methodName:d[1]||n,arguments:[],lineNumber:+d[4],column:d[5]?+d[5]:null}:null);return p&&e.push(p),e},[])}var i=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,s=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,m=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i},77065:(e,t,o)=>{o.d(t,{Bb:()=>V,TT:()=>q});var n={};o.r(n),o.d(n,{ClipboardItem:()=>clipboarditem_ClipboardItem,apply:()=>p,isPolyfilled:()=>d,isSupported:()=>u});var r={};o.r(r),o.d(r,{apply:()=>v,checkVisibility:()=>h,isPolyfilled:()=>f,isSupported:()=>b});var i={};o.r(i),o.d(i,{apply:()=>k,clipboardRead:()=>y,clipboardWrite:()=>g,isPolyfilled:()=>E,isSupported:()=>w});var a={};o.r(a),o.d(a,{apply:()=>S,isPolyfilled:()=>I,isSupported:()=>C,withResolvers:()=>T});var l={};o.r(l),o.d(l,{apply:()=>O,cancelIdleCallback:()=>A,isPolyfilled:()=>j,isSupported:()=>x,requestIdleCallback:()=>P});var c={};o.r(c),o.d(c,{apply:()=>L,isPolyfilled:()=>R,isSupported:()=>N});let s=new WeakMap,m=new WeakMap;let clipboarditem_ClipboardItem=class clipboarditem_ClipboardItem{constructor(e,t={}){if(0===Object.keys(e).length)throw TypeError("Empty dictionary argument");s.set(this,e),m.set(this,t.presentationStyle||"unspecified")}get presentationStyle(){return m.get(this)||"unspecified"}get types(){return Object.freeze(Object.keys(s.get(this)||{}))}async getType(e){let t=s.get(this);if(t&&e in t){let o=await t[e];return"string"==typeof o?new Blob([o],{type:e}):o}throw new DOMException("Failed to execute 'getType' on 'ClipboardItem': The type was not found","NotFoundError")}};function u(){try{return new globalThis.ClipboardItem({"text/plain":Promise.resolve("")}),!0}catch{return!1}}function d(){return globalThis.ClipboardItem===clipboarditem_ClipboardItem}function p(){u()||(globalThis.ClipboardItem=clipboarditem_ClipboardItem)}function h({checkOpacity:e=!1,checkVisibilityCSS:t=!1}={}){if(!this.isConnected)return!1;let o=getComputedStyle(this);if("contents"===o.getPropertyValue("display")||t&&"visible"!==o.getPropertyValue("visibility"))return!1;let n=this;for(;n;){let t=n===this?o:getComputedStyle(n);if("none"===t.getPropertyValue("display")||e&&"0"===t.getPropertyValue("opacity")||n!==this&&"hidden"===t.getPropertyValue("content-visibility"))return!1;n=!n.parentElement&&n.getRootNode()instanceof ShadowRoot?n.getRootNode().host:n.parentElement}return!0}function b(){return"checkVisibility"in Element.prototype&&"function"==typeof Element.prototype.checkVisibility}function f(){return Element.prototype.checkVisibility===h}function v(){b()||(Element.prototype.checkVisibility=h)}async function g(e){if(0===e.length)return;let t=e[0],o=await t.getType(t.types.includes("text/plain")?"text/plain":t.types[0]);return navigator.clipboard.writeText("string"==typeof o?o:await o.text())}async function y(){return[new ClipboardItem({"text/plain":navigator.clipboard.readText()})]}function w(){return"clipboard"in navigator&&"function"==typeof navigator.clipboard.read&&"function"==typeof navigator.clipboard.write}function E(){return"clipboard"in navigator&&(navigator.clipboard.write===g||navigator.clipboard.read===y)}function k(){"clipboard"in navigator&&!w()&&(navigator.clipboard.write=g,navigator.clipboard.read=y)}function T(){let e={};return e.promise=new Promise((t,o)=>{e.resolve=t,e.reject=o}),e}function C(){return"withResolvers"in Promise&&"function"==typeof Promise.withResolvers}function I(){return"withResolvers"in Promise&&Promise.withResolvers===T}function S(){C()||Object.assign(Promise,{withResolvers:T})}function P(e,t={}){let o=Date.now(),n=t.timeout||0,r=Object.defineProperty({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-o))},"didTimeout",{get:()=>Date.now()-o>n});return window.setTimeout(()=>{e(r)})}function A(e){clearTimeout(e)}function x(){return"function"==typeof globalThis.requestIdleCallback}function j(){return globalThis.requestIdleCallback===P&&globalThis.cancelIdleCallback===A}function O(){x()||(globalThis.requestIdleCallback=P,globalThis.cancelIdleCallback=A)}var M=o(913);function N(){return"undefined"!=typeof HTMLButtonElement&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function R(){return!/native code/i.test((globalThis.CommandEvent||{}).toString())}function L(){var e,t;let o,n;function r(e,t,o=!0){Object.defineProperty(e,t,{...Object.getOwnPropertyDescriptor(e,t),enumerable:o})}function i(e){return e&&"function"==typeof e.getRootNode?e.getRootNode():e&&e.parentNode?i(e.parentNode):e}document.addEventListener("invoke",e=>{"invoke"==e.type&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0),document.addEventListener("command",e=>{"command"==e.type&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0);let a=globalThis.ShadowRoot||function(){},l=new WeakMap,c=new WeakMap;let CommandEvent=class CommandEvent extends Event{constructor(e,t={}){super(e,t);const{source:o,command:n}=t;if(null!=o&&!(o instanceof Element))throw TypeError("source must be an element");l.set(this,o||null),c.set(this,void 0!==n?String(n):"")}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!l.has(this))throw TypeError("illegal invocation");let e=l.get(this);if(!(e instanceof Element))return null;let t=i(e);return t!==i(this.target||document)?t.host:e}get command(){if(!c.has(this))throw TypeError("illegal invocation");return c.get(this)}get action(){throw Error("CommandEvent#action was renamed to CommandEvent#command")}get invoker(){throw Error("CommandEvent#invoker was renamed to CommandEvent#source")}};r(CommandEvent.prototype,"source"),r(CommandEvent.prototype,"command");let InvokeEvent=class InvokeEvent extends Event{constructor(){throw Error("InvokeEvent has been deprecated, it has been renamed to `CommandEvent`")}};let s=new WeakMap,m=new WeakMap;function u(e){for(let t of e)t.oncommand=Function("event",t.getAttribute("oncommand"))}Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return d.takeRecords(),m.get(this)||null},set(e){let t=m.get(this)||null;t&&this.removeEventListener("command",t),m.set(this,"object"==typeof e||"function"==typeof e?e:null),"function"==typeof e&&this.addEventListener("command",e)}}});let d=new MutationObserver(e=>{for(let t of e){let{target:e}=t;"childList"===t.type?u(e.querySelectorAll("[oncommand]")):u([e])}});function p(e){if(e.defaultPrevented||"click"!==e.type)return;let t=e.target.closest("button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]");if(t&&(console.warn("Elements with `invoketarget` or `invokeaction` are deprecated and should be renamed to use `commandfor` and `command` respectively"),t.matches("input")))throw Error("Input elements no longer support `commandfor`");let o=e.target.closest("button[commandfor], button[command]");if(!o)return;if(this.form&&"button"!==this.getAttribute("type"))throw e.preventDefault(),Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(o.hasAttribute("command")!==o.hasAttribute("commandfor")){let e=o.hasAttribute("command")?"command":"commandfor",t=o.hasAttribute("command")?"commandfor":"command";throw Error(`Element with ${e} attribute must also have a ${t} attribute to function.`)}if("show-popover"!==o.command&&"hide-popover"!==o.command&&"toggle-popover"!==o.command&&"show-modal"!==o.command&&"close"!==o.command&&!o.command.startsWith("--"))return void console.warn(`"${o.command}" is not a valid command value. Custom commands must begin with --`);let n=o.commandForElement;if(!n)return;let r=new CommandEvent("command",{command:o.command,source:o,cancelable:!0});if(n.dispatchEvent(r),r.defaultPrevented)return;let i=r.command.toLowerCase();if(n.popover){let e=!n.matches(":popover-open");e&&("toggle-popover"===i||"show-popover"===i)?n.showPopover({source:o}):e||"hide-popover"!==i||n.hidePopover()}else if("dialog"===n.localName){let e=!n.hasAttribute("open");e&&"show-modal"===i?n.showModal():e||"close"!==i||n.close()}}function h(e){e.addEventListener("click",p,!0)}d.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),u(document.querySelectorAll("[oncommand]")),Object.defineProperties((globalThis.HTMLButtonElement||function(){}).prototype,{commandForElement:{enumerable:!0,configurable:!0,set(e){if(this.hasAttribute("invokeaction"))throw TypeError("Element has deprecated `invokeaction` attribute, replace with `command`");if(this.hasAttribute("invoketarget"))throw TypeError("Element has deprecated `invoketarget` attribute, replace with `commandfor`");if(null===e)this.removeAttribute("commandfor"),s.delete(this);else if(e instanceof Element){this.setAttribute("commandfor","");let t=i(e);i(this)===t||t===this.ownerDocument?s.set(this,e):s.delete(this)}else throw TypeError("commandForElement must be an element or null")},get(){if("button"!==this.localName)return null;if(this.hasAttribute("invokeaction")||this.hasAttribute("invoketarget"))return console.warn("Element has deprecated `invoketarget` or `invokeaction` attribute, use `commandfor` and `command` instead"),null;if(this.disabled)return null;if(this.form&&"button"!==this.getAttribute("type"))return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;let e=s.get(this);if(e)if(e.isConnected)return e;else return s.delete(this),null;let t=i(this),o=this.getAttribute("commandfor");return(t instanceof Document||t instanceof a)&&o&&t.getElementById(o)||null}},command:{enumerable:!0,configurable:!0,get(){let e=this.getAttribute("command")||"";if(e.startsWith("--"))return e;let t=e.toLowerCase();switch(t){case"show-modal":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return t}return""},set(e){this.setAttribute("command",e)}},invokeAction:{enumerable:!1,configurable:!0,get(){throw Error("invokeAction is deprecated. It has been renamed to command")},set(e){throw Error("invokeAction is deprecated. It has been renamed to command")}},invokeTargetElement:{enumerable:!1,configurable:!0,get(){throw Error("invokeTargetElement is deprecated. It has been renamed to command")},set(e){throw Error("invokeTargetElement is deprecated. It has been renamed to command")}}}),e=globalThis.HTMLElement||function(){},t=e=>{h(e),d.observe(e,{attributeFilter:["oncommand"]}),u(e.querySelectorAll("[oncommand]"))},o=e.prototype.attachShadow,e.prototype.attachShadow=function(e){let n=o.call(this,e);return t(n),n},n=e.prototype.attachInternals,e.prototype.attachInternals=function(){let e=n.call(this);return e.shadowRoot&&t(e.shadowRoot),e},h(document),Object.defineProperty(window,"CommandEvent",{value:CommandEvent,configurable:!0,writable:!0}),Object.defineProperty(window,"InvokeEvent",{value:InvokeEvent,configurable:!0,writable:!0})}let F=!1;try{F=!1===document.body.matches(":modal")}catch{F=!1}let D="object"==typeof globalThis&&"fromEntries"in Object&&"flatMap"in Array.prototype&&"trimEnd"in String.prototype&&"allSettled"in Promise&&"matchAll"in String.prototype&&"replaceAll"in String.prototype&&"any"in Promise&&"at"in String.prototype&&"at"in Array.prototype&&"hasOwn"in Object&&"abort"in AbortSignal&&"timeout"in AbortSignal&&"function"==typeof queueMicrotask&&"function"==typeof HTMLDialogElement&&F&&"function"==typeof AggregateError&&"function"==typeof BroadcastChannel&&"randomUUID"in crypto&&"replaceChildren"in Element.prototype&&"requestSubmit"in HTMLFormElement.prototype&&!0,_={clipboardItem:n,elementCheckVisibility:r,navigatorClipboard:i,requestIdleCallback:l,withResolvers:a,popover:M,commandAndCommandFor:c};function q(){return D&&Object.values(_).every(e=>e.isSupported())}function V(){for(let e of Object.values(_))e.isSupported()||e.apply()}}}]); +//# sourceMappingURL=6488-cf47b8fa3801.js.map \ No newline at end of file diff --git a/66721-c03c0d8e4fbe.js b/66721-c03c0d8e4fbe.js new file mode 100644 index 0000000..3fc06b7 --- /dev/null +++ b/66721-c03c0d8e4fbe.js @@ -0,0 +1,22 @@ +(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([[66721],{5497:(e,t,n)=>{"use strict";function r(e,t){var n,r,i,l=(void 0===t?{}:t).viewportMarginBottom,a=void 0===l?100:l,o=null,s=!1;function u(t){if(n!==t.clientX||r!==t.clientY){var l=e.style.height;i&&i!==l&&(s=!0,e.style.maxHeight="",e.removeEventListener("mousemove",u)),i=l}n=t.clientX,r=t.clientY}var c=e.ownerDocument,d=c.documentElement;function h(){if(!s&&e.value!==o&&(!(e.offsetWidth<=0)||!(e.offsetHeight<=0))){var t=function(){for(var t=0,n=e;n!==c.body&&null!==n;)t+=n.offsetTop||0,n=n.offsetParent;var r=t-c.defaultView.pageYOffset,i=d.clientHeight-(r+e.offsetHeight);return{top:r,bottom:i}}(),n=t.top,r=t.bottom;if(!(n<0)&&!(r<0)){var l=getComputedStyle(e),u=Math.ceil(parseFloat(l.borderTopWidth)),h=Math.ceil(parseFloat(l.borderBottomWidth)),f="border-box"===l.boxSizing,p=parseFloat(l.height)+r;e.style.maxHeight=p-(rr})},8507:(e,t,n)=>{let r=n(15659);e.exports=function(e){let t=function(e){let t=function(){let e={},t=Object.keys(r);for(let n=t.length,r=0;r{let r=n(15659),i=n(8507),l={};Object.keys(r).forEach(e=>{l[e]={},Object.defineProperty(l[e],"channels",{value:r[e].channels}),Object.defineProperty(l[e],"labels",{value:r[e].labels});let t=i(e);Object.keys(t).forEach(n=>{let r,i,a=t[n];l[e][n]=(r=function(...e){let t=e[0];if(null==t)return t;t.length>1&&(e=t);let n=a(e);if("object"==typeof n)for(let e=n.length,t=0;t1&&(e=t),a(e))},"conversion"in a&&(i.conversion=a.conversion),i)})}),e.exports=l},15659:(e,t,n)=>{let r=n(51031),i={};for(let e of Object.keys(r))i[r[e]]=e;let l={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(let t of(e.exports=l,Object.keys(l))){if(!("channels"in l[t]))throw Error("missing channels property: "+t);if(!("labels"in l[t]))throw Error("missing channel labels property: "+t);if(l[t].labels.length!==l[t].channels)throw Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=l[t];delete l[t].channels,delete l[t].labels,Object.defineProperty(l[t],"channels",{value:e}),Object.defineProperty(l[t],"labels",{value:n})}l.rgb.hsl=function(e){let t,n=e[0]/255,r=e[1]/255,i=e[2]/255,l=Math.min(n,r,i),a=Math.max(n,r,i),o=a-l;a===l?t=0:n===a?t=(r-i)/o:r===a?t=2+(i-n)/o:i===a&&(t=4+(n-r)/o),(t=Math.min(60*t,360))<0&&(t+=360);let s=(l+a)/2;return[t,100*(a===l?0:s<=.5?o/(a+l):o/(2-a-l)),100*s]},l.rgb.hsv=function(e){let t,n,r,i,l,a=e[0]/255,o=e[1]/255,s=e[2]/255,u=Math.max(a,o,s),c=u-Math.min(a,o,s),d=function(e){return(u-e)/6/c+.5};return 0===c?(i=0,l=0):(l=c/u,t=d(a),n=d(o),r=d(s),a===u?i=r-n:o===u?i=1/3+t-r:s===u&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*l,100*u]},l.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2];return[l.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(n,r))*100,100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},l.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},l.rgb.keyword=function(e){let t,n=i[e];if(n)return n;let l=1/0;for(let n of Object.keys(r)){let i=r[n],a=(e[0]-i[0])**2+(e[1]-i[1])**2+(e[2]-i[2])**2;a.04045?((t+.055)/1.055)**2.4:t/12.92)+.3576*(n=n>.04045?((n+.055)/1.055)**2.4:n/12.92)+.1805*(r=r>.04045?((r+.055)/1.055)**2.4:r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},l.rgb.lab=function(e){let t=l.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,[116*(r=r>.008856?r**(1/3):7.787*r+16/116)-16,500*((n=n>.008856?n**(1/3):7.787*n+16/116)-r),200*(r-(i=i>.008856?i**(1/3):7.787*i+16/116))]},l.hsl.rgb=function(e){let t,n,r,i=e[0]/360,l=e[1]/100,a=e[2]/100;if(0===l)return[r=255*a,r,r];t=a<.5?a*(1+l):a+l-a*l;let o=2*a-t,s=[0,0,0];for(let e=0;e<3;e++)(n=i+-(1/3*(e-1)))<0&&n++,n>1&&n--,r=6*n<1?o+(t-o)*6*n:2*n<1?t:3*n<2?o+(t-o)*(2/3-n)*6:o,s[e]=255*r;return s},l.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,l=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=l<=1?l:2-l;let a=(r+n)/2;return[t,100*(0===r?2*i/(l+i):2*n/(r+n)),100*a]},l.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,l=t-Math.floor(t),a=255*r*(1-n),o=255*r*(1-n*l),s=255*r*(1-n*(1-l));switch(r*=255,i){case 0:return[r,s,a];case 1:return[o,r,a];case 2:return[a,r,s];case 3:return[a,o,r];case 4:return[s,a,r];case 5:return[r,a,o]}},l.hsv.hsl=function(e){let t,n,r=e[0],i=e[1]/100,l=e[2]/100,a=Math.max(l,.01);n=(2-i)*l;let o=(2-i)*a;return[r,100*(t=(t=i*a/(o<=1?o:2-o))||0),100*(n/=2)]},l.hwb.rgb=function(e){let t,n,r,i,l=e[0]/360,a=e[1]/100,o=e[2]/100,s=a+o;s>1&&(a/=s,o/=s);let u=Math.floor(6*l),c=1-o;t=6*l-u,(1&u)!=0&&(t=1-t);let d=a+t*(c-a);switch(u){default:case 6:case 0:n=c,r=d,i=a;break;case 1:n=d,r=c,i=a;break;case 2:n=a,r=c,i=d;break;case 3:n=a,r=d,i=c;break;case 4:n=d,r=a,i=c;break;case 5:n=c,r=a,i=d}return[255*n,255*r,255*i]},l.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},l.xyz.rgb=function(e){let t,n,r,i=e[0]/100,l=e[1]/100,a=e[2]/100;return t=(t=3.2406*i+-1.5372*l+-.4986*a)>.0031308?1.055*t**(1/2.4)-.055:12.92*t,n=(n=-.9689*i+1.8758*l+.0415*a)>.0031308?1.055*n**(1/2.4)-.055:12.92*n,r=(r=.0557*i+-.204*l+1.057*a)>.0031308?1.055*r**(1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},l.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,[116*(n=n>.008856?n**(1/3):7.787*n+16/116)-16,500*((t=t>.008856?t**(1/3):7.787*t+16/116)-n),200*(n-(r=r>.008856?r**(1/3):7.787*r+16/116))]},l.lab.xyz=function(e){let t,n,r,i=e[0],l=e[1],a=e[2];t=l/500+(n=(i+16)/116),r=n-a/200;let o=n**3,s=t**3,u=r**3;return n=(o>.008856?o:(n-16/116)/7.787)*100,[t=(s>.008856?s:(t-16/116)/7.787)*95.047,n,r=(u>.008856?u:(r-16/116)/7.787)*108.883]},l.lab.lch=function(e){let t,n=e[0],r=e[1],i=e[2];return(t=360*Math.atan2(i,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+i*i),t]},l.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},l.rgb.ansi16=function(e,t=null){let[n,r,i]=e,a=null===t?l.rgb.hsv(e)[2]:t;if(0===(a=Math.round(a/50)))return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===a&&(o+=60),o},l.hsv.ansi16=function(e){return l.rgb.ansi16(l.hsv.rgb(e),e[2])},l.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},l.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];let n=(~~(e>50)+1)*.5;return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},l.ansi256.rgb=function(e){let t;if(e>=232){let t=(e-232)*10+8;return[t,t,t]}return[Math.floor((e-=16)/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},l.rgb.hex=function(e){let t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},l.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));let r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},l.rgb.hcg=function(e){let t,n=e[0]/255,r=e[1]/255,i=e[2]/255,l=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),o=l-a;return t=o<1?a/(1-o):0,[360*((o<=0?0:l===n?(r-i)/o%6:l===r?2+(i-n)/o:4+(n-r)/o)/6%1),100*o,100*t]},l.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},l.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},l.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];let i=[0,0,0],l=t%1*6,a=l%1,o=1-a,s=0;switch(Math.floor(l)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=o,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=o,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=o}return s=(1-n)*r,[(n*i[0]+s)*255,(n*i[1]+s)*255,(n*i[2]+s)*255]},l.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},l.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},l.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},l.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},l.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},l.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},l.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},l.gray.hsl=function(e){return[0,0,e[0]]},l.gray.hsv=l.gray.hsl,l.gray.hwb=function(e){return[0,100,e[0]]},l.gray.cmyk=function(e){return[0,0,0,e[0]]},l.gray.lab=function(e){return[e[0],0,0]},l.gray.hex=function(e){let t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},l.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},15955:(e,t,n)=>{"use strict";function r(e){let t=!1,n=null;function r(e,t,n,i=!1){t instanceof HTMLInputElement&&(t.indeterminate=i,t.checked!==n&&(t.checked=n,setTimeout(()=>{let n=new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{relatedTarget:e}});t.dispatchEvent(n)})))}function i(i){let l=i.target;l instanceof Element&&(l.hasAttribute("data-check-all")?function(t){if(t instanceof CustomEvent&&t.detail){let{relatedTarget:e}=t.detail;if(e&&e.hasAttribute("data-check-all-item"))return}let i=t.target;if(i instanceof HTMLInputElement){for(let t of(n=null,e.querySelectorAll("[data-check-all-item]")))r(i,t,i.checked);i.indeterminate=!1,a()}}(i):l.hasAttribute("data-check-all-item")&&function(i){if(i instanceof CustomEvent&&i.detail){let{relatedTarget:e}=i.detail;if(e&&(e.hasAttribute("data-check-all")||e.hasAttribute("data-check-all-item")))return}let l=i.target;if(!(l instanceof HTMLInputElement))return;let o=Array.from(e.querySelectorAll("[data-check-all-item]"));if(t&&n){let[e,t]=[o.indexOf(n),o.indexOf(l)].sort();for(let n of o.slice(e,+t+1||9e9))r(l,n,l.checked)}t=!1,n=l;let s=e.querySelector("[data-check-all]");if(s){let e=o.length,t=o.filter(e=>e instanceof HTMLInputElement&&e.checked).length;r(l,s,t===e,e>t&&t>0)}a()}(i))}function l(e){e.target instanceof Element&&(e.target instanceof HTMLLabelElement&&e.target.control||e.target).hasAttribute("data-check-all-item")&&(t=e.shiftKey)}function a(){let t=e.querySelector("[data-check-all-count]");t&&(t.textContent=e.querySelectorAll("[data-check-all-item]:checked").length.toString())}return e.addEventListener("mousedown",l),e.addEventListener("change",i),{unsubscribe:()=>{e.removeEventListener("mousedown",l),e.removeEventListener("change",i)}}}n.d(t,{A:()=>r})},16213:(e,t,n)=>{"use strict";n.d(t,{_:()=>i});var r=n(53482);function i(e,t){(0,r._)(e,t),t.add(e)}},18679:(e,t,n)=>{"use strict";n.d(t,{s:()=>AnalyticsClient});let r=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","scid"];var i=n(36301);let AnalyticsClient=class AnalyticsClient{constructor(e){this.options=e}get collectorUrl(){return this.options.collectorUrl}get clientId(){return this.options.clientId?this.options.clientId:(0,i.y)()}createEvent(e){return{page:location.href,title:document.title,context:{...this.options.baseContext,...function(){let e={};try{for(let[t,n]of new URLSearchParams(window.location.search)){let i=t.toLowerCase();r.includes(i)&&(e[i]=n)}return e}catch(e){return{}}}(),...e}}}sendPageView(e){let t=this.createEvent(e);this.send({page_views:[t]})}sendEvent(e,t){let n={...this.createEvent(t),type:e};this.send({events:[n]})}send({page_views:e,events:t}){let n=JSON.stringify({client_id:this.clientId,page_views:e,events:t,request_context:{referrer:function(){let e;try{e=window.top.document.referrer}catch(t){if(window.parent)try{e=window.parent.document.referrer}catch(e){}}return""===e&&(e=document.referrer),e}(),user_agent:navigator.userAgent,screen_resolution:function(){try{return`${screen.width}x${screen.height}`}catch(e){return"unknown"}}(),browser_resolution:function(){let e=0,t=0;try{return"number"==typeof window.innerWidth?(t=window.innerWidth,e=window.innerHeight):null!=document.documentElement&&null!=document.documentElement.clientWidth?(t=document.documentElement.clientWidth,e=document.documentElement.clientHeight):null!=document.body&&null!=document.body.clientWidth&&(t=document.body.clientWidth,e=document.body.clientHeight),`${t}x${e}`}catch(e){return"unknown"}}(),browser_languages:navigator.languages?navigator.languages.join(","):navigator.language||"",pixel_ratio:window.devicePixelRatio,timestamp:Date.now(),tz_seconds:-60*new Date().getTimezoneOffset()}});try{if(navigator.sendBeacon)return void navigator.sendBeacon(this.collectorUrl,n)}catch{}fetch(this.collectorUrl,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:n,keepalive:!1})}}},31143:(e,t,n)=>{"use strict";n.d(t,{qy:()=>x,XX:()=>v,_3:()=>L});let r=new Map;function i(e){if(r.has(e))return r.get(e);let t=e.length,n=0,i=0,l=0,a=[];for(let r=0;rn&&(a.push(Object.freeze({type:"string",start:n,end:i,value:e.slice(n,i)})),n=i),a.push(Object.freeze({type:"part",start:i,end:r+2,value:e.slice(n+2,r).trim()})),r+=1,n=r+1)}return n"string"==typeof e?e:e.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};let o=new WeakMap;let NodeTemplatePart=class NodeTemplatePart{constructor(e,t){this.expression=t,o.set(this,[e]),e.textContent=""}get value(){return o.get(this).map(e=>e.textContent).join("")}set value(e){this.replace(e)}get previousSibling(){return o.get(this)[0].previousSibling}get nextSibling(){return o.get(this)[o.get(this).length-1].nextSibling}replace(...e){let t=e.map(e=>"string"==typeof e?new Text(e):e);for(let e of(t.length||t.push(new Text("")),o.get(this)[0].before(...t),o.get(this)))e.remove();o.set(this,t)}};function s(e){return{processCallback(t,n,r){var i;if("object"==typeof r&&r){for(let t of n)if(t.expression in r){let n=null!=(i=r[t.expression])?i:"";e(t,n)}}}}}function u(e,t){e.value=String(t)}function c(e,t){return"boolean"==typeof t&&e instanceof AttributeTemplatePart&&"boolean"==typeof e.element[e.attributeName]&&(e.booleanValue=t,!0)}let d=s(u);s((e,t)=>{c(e,t)||u(e,t)});let h=new WeakMap,f=new WeakMap;let TemplateInstance=class TemplateInstance extends DocumentFragment{constructor(e,t,n=d){var r,l;super(),Object.getPrototypeOf(this)!==TemplateInstance.prototype&&Object.setPrototypeOf(this,TemplateInstance.prototype),this.appendChild(e.content.cloneNode(!0)),f.set(this,Array.from(function*(e){let t,n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1);for(;t=n.nextNode();)if(t instanceof Element&&t.hasAttributes())for(let e=0;ee+t+(n{let n=e(...t);return b.add(n),n}}let T=new WeakMap;let EventHandler=class EventHandler{constructor(e,t){this.element=e,this.type=t,this.element.addEventListener(this.type,this),T.get(this.element).set(this.type,this)}set(e){"function"==typeof e?this.handleEvent=e.bind(this.element):"object"==typeof e&&"function"==typeof e.handleEvent?this.handleEvent=e.handleEvent.bind(e):(this.element.removeEventListener(this.type,this),T.get(this.element).delete(this.type))}static for(e){T.has(e.element)||T.set(e.element,new Map);let t=e.attributeName.slice(2),n=T.get(e.element);return n.has(t)?n.get(t):new EventHandler(e.element,t)}};function w(e,t){b.has(t)&&(t(e),1)||c(e,t)||e instanceof AttributeTemplatePart&&e.attributeName.startsWith("on")&&(EventHandler.for(e).set(t),e.element.removeAttributeNS(e.attributeNamespace,e.attributeName),1)||t instanceof TemplateResult&&e instanceof NodeTemplatePart&&(t.renderInto(e),1)||t instanceof DocumentFragment&&e instanceof NodeTemplatePart&&(t.childNodes.length&&e.replace(...t.childNodes),1)||function(e,t){if(!("object"==typeof t&&Symbol.iterator in t))return!1;if(!(e instanceof NodeTemplatePart))return e.value=Array.from(t).join(" "),!0;{let n=[];for(let e of t)if(e instanceof TemplateResult){let t=document.createDocumentFragment();e.renderInto(t),n.push(...t.childNodes)}else e instanceof DocumentFragment?n.push(...e.childNodes):n.push(String(e));return n.length&&e.replace(...n),!0}}(e,t)||u(e,t)}let E=s(w);function x(e,...t){return new TemplateResult(e,t,E)}let k=new WeakMap;y((...e)=>t=>{k.has(t)||k.set(t,{i:e.length});let n=k.get(t);for(let r=0;r{rt=>{var n,r;if(!(t instanceof NodeTemplatePart))return;let i=document.createElement("template");i.innerHTML=null!=(r=null==(n=TemplateResult.cspTrustedTypesPolicy)?void 0:n.createHTML(e))?r:e;let l=document.importNode(i.content,!0);t.replace(...l.childNodes)})},44358:(e,t,n)=>{"use strict";function r(e,t){var n,r,i;let l=e.value.slice(0,null!=(n=e.selectionStart)?n:void 0),a=e.value.slice(null!=(r=e.selectionEnd)?r:void 0),o=!0;e.contentEditable="true";try{o=document.execCommand("insertText",!1,t)}catch(e){o=!1}if(e.contentEditable="false",o&&!e.value.slice(0,null!=(i=e.selectionStart)?i:void 0).endsWith(t)&&(o=!1),!o){try{document.execCommand("ms-beginUndoUnit")}catch(e){}e.value=l+t+a;try{document.execCommand("ms-endUndoUnit")}catch(e){}e.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0}))}}n.d(t,{B1:()=>I});let i=new WeakMap;function l(e){let{currentTarget:t}=e,n="KeyV"===e.code&&(e.ctrlKey||e.metaKey)&&e.shiftKey;(n||n&&e.altKey)&&i.set(t,!0)}function a(e){let{currentTarget:t}=e;i.delete(t)}function o(e){var t;return null!=(t=i.get(e))&&t}function s(e){e.addEventListener("paste",u)}function u(e){var t;let n,i=e.clipboardData,{currentTarget:l}=e;if(o(l)||!i||!i.types.includes("text/html"))return;let a=e.currentTarget;if(!(a instanceof HTMLTextAreaElement)||0!==(n=(t=a).selectionStart||0)&&"@"===t.value.substring(n-1,n))return;let s=i.getData("text/plain"),u=i.getData("text/html"),d=u.replace(/\u00A0/g," ").replace(/\uC2A0/g," ");if(!u||!(s=s.trim()))return;let h=new DOMParser().parseFromString(d,"text/html"),f=function(e,t){let n=t.firstChild(),r=e,i=0,l=0;for(;n&&l<1e4;){var a;l++;let e=c(n)?(n.textContent||"").replace(/[\t\n\r ]+/g," "):(null==n?void 0:n.wholeText)||"";if(!(a=e)||(null==a?void 0:a.trim().length)===0){n=t.nextNode();continue}if(!c(n)){i+=e.replace(/[\t\n\r ]+/g," ").trimStart().length,n=t.nextNode();continue}let o=r.indexOf(e,i);if(o>=0){let t=function(e,t){var n,r,i;let l=e.href||"";return function(e){var t;return(null==(t=e.textContent)?void 0:t.slice(0,1))==="@"&&"user"===e.getAttribute("data-hovercard-type")}(e)||function(e){var t;return(null==(t=e.textContent)?void 0:t.slice(0,1))==="@"&&"team"===e.getAttribute("data-hovercard-type")}(e)?t:(n=e).className.indexOf("commit-link")>=0||n.getAttribute("data-hovercard-type")&&"user"!==n.getAttribute("data-hovercard-type")||(r=l,i=t,r="/"===r.slice(-1)?r.slice(0,-1):r,i="/"===i.slice(-1)?i.slice(0,-1):i,r.toLowerCase()===i.toLowerCase())?l:`[${t}](${l})`}(n,e);r=r.slice(0,o)+t+r.slice(o+e.length),i=o+t.length}n=t.nextNode()}return 1e4===l?e:r}(s,h.createTreeWalker(h.body,NodeFilter.SHOW_ALL,e=>e.parentNode&&c(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT));f!==s&&(e.stopPropagation(),e.preventDefault(),r(a,f))}function c(e){var t;return(null==(t=e.tagName)?void 0:t.toLowerCase())==="a"&&e.hasAttribute("href")}function d(e){e.addEventListener("dragover",f),e.addEventListener("drop",h),e.addEventListener("paste",p)}function h(e){let t=e.dataTransfer;if(!t||Array.from(t.types).indexOf("Files")>=0||!g(t))return;let n=v(t);if(!n.some(y))return;e.stopPropagation(),e.preventDefault();let i=e.currentTarget;i instanceof HTMLTextAreaElement&&r(i,n.map(m).join(""))}function f(e){let t=e.dataTransfer;t&&(t.dropEffect="link")}function p(e){let{currentTarget:t}=e;if(o(t))return;let n=e.clipboardData;if(!n||!g(n))return;let i=v(n);if(!i.some(y))return;e.stopPropagation(),e.preventDefault();let l=e.currentTarget;l instanceof HTMLTextAreaElement&&r(l,i.map(m).join(""))}function m(e){return y(e)?` +![](${e}) +`:e}function g(e){return Array.from(e.types).indexOf("text/uri-list")>=0}function v(e){return(e.getData("text/uri-list")||"").split(`\r +`)}let b=/\.(gif|png|jpe?g)$/i;function y(e){return b.test(e)}let T=new WeakMap;function w(e,t){var n;T.set(e,(null==(n=null==t?void 0:t.defaultPlainTextPaste)?void 0:n.urlLinks)===!0),e.addEventListener("paste",E)}function E(e){var t,n,i,l;let a,{currentTarget:s}=e,u=null!=(t=T.get(s))&&t,c=o(s);if(!u&&c||u&&!c)return;let d=e.clipboardData;if(!d||!Array.from(d.types).includes("text/plain"))return;let h=e.currentTarget;if(!(h instanceof HTMLTextAreaElement))return;let f=d.getData("text/plain");if(!f||!x(f)||(a=(n=h).selectionStart||0)>1&&"]("===n.value.substring(a-2,a))return;let p=h.value.substring(h.selectionStart,h.selectionEnd);!p.length||x(p.trim())||(e.stopPropagation(),e.preventDefault(),r(h,(i=p,l=f.trim(),`[${i}](${l})`)))}function x(e){try{let t=new URL(e);return k(t.href).trim()===k(e).trim()}catch(e){return!1}}function k(e){return e.endsWith("/")?e.slice(0,e.length-1):e}function L(e){e.addEventListener("dragover",M),e.addEventListener("drop",S),e.addEventListener("paste",C)}function S(e){let t=e.dataTransfer;if(!t||Array.from(t.types).indexOf("Files")>=0)return;let n=O(t);if(!n)return;e.stopPropagation(),e.preventDefault();let i=e.currentTarget;i instanceof HTMLTextAreaElement&&r(i,n)}function M(e){let t=e.dataTransfer;t&&(t.dropEffect="copy")}function C(e){let{currentTarget:t}=e;if(o(t)||!e.clipboardData)return;let n=O(e.clipboardData);if(!n)return;e.stopPropagation(),e.preventDefault();let i=e.currentTarget;i instanceof HTMLTextAreaElement&&r(i,n)}function A(e){return(e.textContent||"").trim().replace(/\|/g,"\\|").replace(/\n/g," ")||"\xa0"}function O(e){if(-1===Array.from(e.types).indexOf("text/html"))return;let t=e.getData("text/html");if(!/");if(!n||!r)return;let i=t.substring(r+8),l=new DOMParser().parseFromString(t,"text/html").querySelector("table");if(!(l=!l||l.closest("[data-paste-markdown-skip]")?null:l))return;let a=function(e){let t=Array.from(e.querySelectorAll("tr")),n=t.shift();if(!n)return"";let r=Array.from(n.querySelectorAll("td, th")).map(A),i=r.map(()=>"--"),l=`${r.join(" | ")} +${i.join(" | ")} +`,a=t.map(e=>Array.from(e.querySelectorAll("td")).map(A).join(" | ")).join(` +`);return` +${l}${a} + +`}(l);if(a)return[n,a,i].join("").replace(//,"")}function P(e){e.addEventListener("paste",H)}function H(e){let{currentTarget:t}=e;if(o(t))return;let n=e.clipboardData;if(!n||!(Array.from(n.types).indexOf("text/x-gfm")>=0))return;let i=e.currentTarget;if(!(i instanceof HTMLTextAreaElement))return;let l=n.getData("text/x-gfm");l&&(e.stopPropagation(),e.preventDefault(),r(i,l))}function I(e,t){for(let n of(e.addEventListener("keydown",l),[L,d,w,P,s]))n(e,t);return e.addEventListener("paste",a),{unsubscribe:()=>{e.removeEventListener("keydown",l),e.removeEventListener("paste",a),e.removeEventListener("dragover",M),e.removeEventListener("drop",S),e.removeEventListener("paste",C),e.removeEventListener("paste",u),e.removeEventListener("dragover",f),e.removeEventListener("drop",h),e.removeEventListener("paste",p),e.removeEventListener("paste",E),e.removeEventListener("paste",H)}}}},50515:(e,t,n)=>{"use strict";n.d(t,{JC:()=>b,KK:()=>SequenceTracker,Vy:()=>a,ai:()=>v,rd:()=>c});let Leaf=class Leaf{constructor(e){this.children=[],this.parent=e}delete(e){let t=this.children.indexOf(e);return -1!==t&&(this.children=this.children.slice(0,t).concat(this.children.slice(t+1)),0===this.children.length&&this.parent.delete(this),!0)}add(e){return this.children.push(e),this}};let RadixTrie=class RadixTrie{constructor(e){this.parent=null,this.children={},this.parent=e||null}get(e){return this.children[e]}insert(e){let t=this;for(let n=0;n","\xbf":"?"},i={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+","[":"{","]":"}","\\":"|",";":":","'":'"',",":"<",".":">","/":"?",q:"Q",w:"W",e:"E",r:"R",t:"T",y:"Y",u:"U",i:"I",o:"O",p:"P",a:"A",s:"S",d:"D",f:"F",g:"G",h:"H",j:"J",k:"K",l:"L",z:"Z",x:"X",c:"C",v:"V",b:"B",n:"N",m:"M"},l={" ":"Space","+":"Plus"};function a(e,t=navigator.platform){var n,s,c;let{ctrlKey:d,altKey:h,metaKey:f,shiftKey:p,key:m}=e,g=[];for(let[e,t]of[d,h,f,p].entries())t&&g.push(o[e]);if(!o.includes(m)){let e=g.includes("Alt")&&u.test(t)&&null!=(n=r[m])?n:m,a=g.includes("Shift")&&u.test(t)&&null!=(s=i[e])?s:e,o=null!=(c=l[a])?c:a;g.push(o)}return g.join("+")}let o=["Control","Alt","Meta","Shift"];function s(e,t){let n,r,i;{var l,a,o,s=(l=e,a=t,r="undefined"==typeof window?void 0:window,i=u.test(null!=(o=null!=a?a:null==r?void 0:r.navigator.platform)?o:"")?"Meta":"Control",n=l.replace("Mod",i));let c=s.split("+").pop(),d=[];for(let e of["Control","Alt","Meta","Shift"])s.includes(e)&&d.push(e);return c&&d.push(c),d.join("+")}}let u=/Mac|iPod|iPhone|iPad/i;let SequenceTracker=class SequenceTracker{constructor({onReset:e}={}){this._path=[],this.timer=null,this.onReset=e}get path(){return this._path}get sequence(){return this._path.join(" ")}registerKeypress(e){this._path=[...this._path,a(e)],this.startTimer()}reset(){var e;this.killTimer(),this._path=[],null==(e=this.onReset)||e.call(this)}killTimer(){null!=this.timer&&window.clearTimeout(this.timer),this.timer=null}startTimer(){this.killTimer(),this.timer=window.setTimeout(()=>this.reset(),SequenceTracker.CHORD_TIMEOUT)}};function c(e){return e.split(" ").map(e=>s(e)).join(" ")}function d(e){if(!(e instanceof HTMLElement))return!1;let t=e.nodeName.toLowerCase(),n=(e.getAttribute("type")||"").toLowerCase();return"select"===t||"textarea"===t||"input"===t&&"submit"!==n&&"reset"!==n&&"checkbox"!==n&&"radio"!==n&&"file"!==n||e.isContentEditable}SequenceTracker.CHORD_TIMEOUT=1500;let h=new RadixTrie,f=new WeakMap,p=h,m=new SequenceTracker({onReset(){p=h}});function g(e){if(e.defaultPrevented||!(e.target instanceof Node))return;if(d(e.target)){let t=e.target;if(!t.id||!t.ownerDocument.querySelector(`[data-hotkey-scope="${t.id}"]`))return}let t=p.get(a(e));if(!t)return void m.reset();if(m.registerKeypress(e),p=t,t instanceof Leaf){let r,i=e.target,l=!1,a=d(i);for(let e=t.children.length-1;e>=0;e-=1){let n=(r=t.children[e]).getAttribute("data-hotkey-scope");if(!a&&!n||a&&i.id===n){l=!0;break}}if(r&&l){var n;let t;n=r,t=new CustomEvent("hotkey-fire",{cancelable:!0,detail:{path:m.path}}),n.dispatchEvent(t)&&(d(n)?n.focus():n.click()),e.preventDefault()}m.reset()}}function v(e,t){0===Object.keys(h.children).length&&document.addEventListener("keydown",g);let n=(function(e){let t=[],n=[""],r=!1;for(let i=0;ie.map(e=>s(e)).filter(e=>""!==e)).filter(e=>e.length>0)})(t||e.getAttribute("data-hotkey")||"").map(t=>h.insert(t).add(e));f.set(e,n)}function b(e){let t=f.get(e);if(t&&t.length)for(let n of t)n&&n.delete(e);0===Object.keys(h.children).length&&document.removeEventListener("keydown",g)}},51031:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},55150:(e,t,n)=>{"use strict";n.d(t,{Bu:()=>u,YV:()=>o,o:()=>s});let r=null;function i(e){return e instanceof HTMLSelectElement||(a(e)?e.checked!==e.defaultChecked:e.value!==e.defaultValue)}function l(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement}function a(e){return e instanceof HTMLInputElement&&/checkbox|radio/.test(e.type)}function o(e,t){var n,a,o,s,u,c;let d,h=null!=(n=null==t?void 0:t.scope)?n:document,f=null!=(a=null==t?void 0:t.selector)?a:".js-session-resumable",p=null!=(o=null==t?void 0:t.fields)?o:h.querySelectorAll(f),m=null!=(s=null==t?void 0:t.keyPrefix)?s:"session-resume:",g=null!=(u=null==t?void 0:t.storageFilter)?u:i;try{d=null!=(c=null==t?void 0:t.storage)?c:sessionStorage}catch(e){return}let v=`${m}${e}`,b=[];for(let e of p)l(e)&&b.push(e);let y=b.filter(e=>!!e.id&&g(e)&&e.form!==r).map(e=>e instanceof HTMLSelectElement?[e.id,Array.from(e.selectedOptions).map(e=>e.value)]:[e.id,e.value]);if(y.length)try{let e=d.getItem(v);if(null!==e){let t=JSON.parse(e).filter(function(e){return!y.some(t=>t[0]===e[0])});y=y.concat(t)}d.setItem(v,JSON.stringify(y))}catch(e){}}function s(e,t){var n,r;let i,o,s=null!=(n=null==t?void 0:t.keyPrefix)?n:"session-resume:";try{i=null!=(r=null==t?void 0:t.storage)?r:sessionStorage}catch(e){return}let u=`${s}${e}`;try{o=i.getItem(u)}catch(e){}if(!o)return;let c=[],d=[];for(let[e,t]of JSON.parse(o)){let n=new CustomEvent("session:resume",{bubbles:!0,cancelable:!0,detail:{targetId:e,targetValue:t}});if(document.dispatchEvent(n)){let n=document.getElementById(e);if(l(n))if(n instanceof HTMLSelectElement){for(let e of n.options)e.selected=t.includes(e.value);c.push(n)}else a(n)?(n.checked=!n.defaultChecked,c.push(n)):n.value===n.defaultValue&&(n.value=t,c.push(n));else d.push([e,t])}}if(0===d.length)try{i.removeItem(u)}catch(e){}else i.setItem(u,JSON.stringify(d));setTimeout(function(){for(let e of c)e.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0}))},0)}function u(e){r=e.target,setTimeout(function(){e.defaultPrevented&&(r=null)},0)}},57226:(e,t,n)=>{"use strict";n.d(t,{Ck:()=>C,fK:()=>L,zB:()=>x});let r=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart{if("loading"===document.readyState)return"loading";{let t=r();if(t){if(e{let t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},a=new WeakMap;function o(e,t){return a.get(e)||a.set(e,new t),a.get(e)}let s=-1,u=e=>{addEventListener("pageshow",t=>{t.persisted&&(s=t.timeStamp,e(t))},!0)},c=(e,t,n,r)=>{let i,l;return a=>{let o;t.value>=0&&(a||r)&&((l=t.value-(i??0))||void 0===i)&&(i=t.value,t.delta=l,o=t.value,t.rating=o>n[1]?"poor":o>n[0]?"needs-improvement":"good",e(t))}},d=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},h=()=>{let e=r();return e?.activationStart??0},f=(e,t=-1)=>{let n=r(),i="navigate";return s>=0?i="back-forward-cache":n&&(document.prerendering||h()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(0x82f79cd8fff*Math.random())+1e12}`,navigationType:i}},p=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},m=e=>{let t=!1;return()=>{t||(e(),t=!0)}},g=-1,v=new Set,b=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,y=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of v)e();isFinite(g)||(g="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",y,!0))}},T=()=>{if(g<0){let e=h();g=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??b(),addEventListener("visibilitychange",y,!0),addEventListener("prerenderingchange",y,!0),u(()=>{setTimeout(()=>{g=b()})})}return{get firstHiddenTime(){return g},onHidden(e){v.add(e)}}},w=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},E=[1800,3e3],x=(e,t={})=>{((e,t={})=>{w(()=>{let n=T(),r,i=f("FCP"),l=p("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(l.disconnect(),t.startTime{r=c(e,i=f("FCP"),E,t.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})})(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:i(s)};if(e.entries.length){let n=r(),l=e.entries.at(-1);if(n){let r=n.activationStart||0,a=Math.max(0,n.responseStart-r);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:i(e.entries[0].startTime),navigationEntry:n,fcpEntry:l}}}return Object.assign(e,{attribution:t})})(t))},t)};let N=class N{m;u(e){this.m?.(e)}};let k=[2500,4e3],L=(e,t={})=>{let n=o(t=Object.assign({},t),N),i=new WeakMap;n.m=e=>{let n=e.element;if(n){let r=t.generateTarget?.(n)??(e=>{let t="";try{for(;9!==e?.nodeType;){let n=e,r=n.id?"#"+n.id:[l(n),...Array.from(n.classList).sort()].join(".");if(t.length+r.length>99)return t||r;if(t=t?r+">"+t:r,n.id)break;e=n.parentNode}}catch{}return t})(n);i.set(e,r)}},((e,t={})=>{w(()=>{let n=T(),r,i=f("LCP"),l=o(t,N),a=e=>{for(let a of(t.reportAllChanges||(e=e.slice(-1)),e))l.u(a),a.startTime{a(s.takeRecords()),s.disconnect(),r(!0)}),l=e=>{var t;let r;e.isTrusted&&(t=n,r=globalThis.requestIdleCallback||setTimeout,"hidden"===document.visibilityState?t():(addEventListener("visibilitychange",t=m(t),{once:!0,capture:!0}),r(()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})),removeEventListener(e.type,l,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,l,{capture:!0});u(n=>{r=c(e,i=f("LCP"),k,t.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(t=>{e((e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){let n=r();if(n){let r=n.activationStart||0,l=e.entries.at(-1),a=l.url&&performance.getEntriesByType("resource").filter(e=>e.name===l.url)[0],o=Math.max(0,n.responseStart-r),s=Math.max(o,a?(a.requestStart||a.startTime)-r:0),u=Math.min(e.value,Math.max(s,a?a.responseEnd-r:0));t={target:i.get(l),timeToFirstByte:o,resourceLoadDelay:s-o,resourceLoadDuration:u-s,elementRenderDelay:e.value-u,navigationEntry:n,lcpEntry:l},l.url&&(t.url=l.url),a&&(t.lcpResourceEntry=a)}}return Object.assign(e,{attribution:t})})(t))},t)},S=[800,1800],M=e=>{document.prerendering?w(()=>M(e)):"complete"!==document.readyState?addEventListener("load",()=>M(e),!0):setTimeout(e)},C=(e,t={})=>{((e,t={})=>{let n=f("TTFB"),i=c(e,n,S,t.reportAllChanges);M(()=>{let l=r();l&&(n.value=Math.max(l.responseStart-h(),0),n.entries=[l],i(!0),u(()=>{(i=c(e,n=f("TTFB",0),S,t.reportAllChanges))(!0)}))})})(t=>{e((e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){let n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),l=Math.max(n.domainLookupStart-r,0),a=Math.max(n.connectStart-r,0),o=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:l-i,dnsDuration:a-l,connectionDuration:o-a,requestDuration:e.value-o,navigationEntry:n}}return Object.assign(e,{attribution:t})})(t))},t)}},66661:(e,t,n)=>{"use strict";function r(e){let t=e.parentNode;if(null===t||!(t instanceof HTMLElement))throw Error();let n=0;t instanceof HTMLOListElement&&1!==t.start&&(n=t.start-1);let r=t.children;for(let t=0;tQuote,g:()=>MarkdownQuote});let i=0;function l(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">")}let a={INPUT:e=>e instanceof HTMLInputElement&&e.checked?"[x] ":"[ ] ",CODE(e){let t=e.textContent||"";return e.parentNode&&"PRE"===e.parentNode.nodeName?(e.textContent=`\`\`\` +${t.replace(/\n+$/,"")} +\`\`\` + +`,e):t.indexOf("`")>=0?`\`\` ${t} \`\``:`\`${t}\``},P(e){let t=document.createElement("p");return t.textContent=(e.textContent||"").replace(/<(\/?)(pre|strong|weak|em)>/g,"\\<$1$2\\>"),t},STRONG:e=>`**${e.textContent||""}**`,EM:e=>`_${e.textContent||""}_`,DEL:e=>`~${e.textContent||""}~`,BLOCKQUOTE(e){let t=(e.textContent||"").trim().replace(/^/gm,"> "),n=document.createElement("pre");return n.textContent=`${t} + +`,n},A(e){let t=e.textContent||"",n=e.getAttribute("href");return/^https?:/.test(t)&&t===n?t:n?`[${t}](${n})`:t},IMG(e){let t=e.getAttribute("alt")||"",n=e.getAttribute("src");if(!n)throw Error();let r=e.hasAttribute("width")?` width="${l(e.getAttribute("width")||"")}"`:"",i=e.hasAttribute("height")?` height="${l(e.getAttribute("height")||"")}"`:"";return r||i?`${l(t)}`:`![${t}](${n})`},LI(e){let t,n,l=e.parentNode;if(!l)throw Error();let a="";if(t=e.childNodes[0],n=e.childNodes[1],!t||!(e.childNodes.length<3)||"OL"!==t.nodeName&&"UL"!==t.nodeName||n&&(n.nodeType!==Node.TEXT_NODE||(n.textContent||"").trim()))if("OL"===l.nodeName)if(i>0&&!l.previousSibling){let t=r(e)+i+1;a=`${t}\\. `}else a=`${r(e)+1}. `;else a="* ";let o=a.replace(/\S/g," "),s=(e.textContent||"").trim().replace(/^/gm,o),u=document.createElement("pre");return u.textContent=s.replace(o,a),u},OL(e){let t=document.createElement("li");return t.appendChild(document.createElement("br")),e.append(t),e},H1(e){let t=parseInt(e.nodeName.slice(1));return e.prepend(`${Array(t+1).join("#")} `),e},UL:e=>e};a.UL=a.OL;for(let e=2;e<=6;++e)a[`H${e}`]=a.H1;let Quote=class Quote{constructor(){this.selection=window.getSelection(),this.processSelectionText=e=>e}closest(e){let t=this.range.startContainer,n=t instanceof Element?t:t.parentElement;return n?n.closest(e):null}get active(){var e;return((null==(e=this.selection)?void 0:e.rangeCount)||0)>0}get range(){var e;return(null==(e=this.selection)?void 0:e.rangeCount)?this.selection.getRangeAt(0):new Range}set range(e){var t,n;null==(t=this.selection)||t.removeAllRanges(),null==(n=this.selection)||n.addRange(e)}set processSelectionTextFn(e){this.processSelectionText=e}get selectionText(){var e;return this.processSelectionText((null==(e=this.selection)?void 0:e.toString().trim())||"")}get quotedText(){return`> ${this.selectionText.replace(/\n/g,` +> `)} + +`}select(e){this.selection&&(this.selection.removeAllRanges(),this.selection.selectAllChildren(e))}insert(e){e.value?e.value=`${e.value} + +${this.quotedText}`:e.value=this.quotedText,e.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1})),e.focus(),e.selectionStart=e.value.length,e.scrollTop=e.scrollHeight}};let MarkdownQuote=class MarkdownQuote extends Quote{constructor(e="",t){super(),this.scopeSelector=e,this.callback=t}get selectionText(){var e,t;if(!this.selection)return"";let n=function(e,t){let n=e.startContainer;if(!n||!n.parentNode||!(n.parentNode instanceof HTMLElement))throw Error("the range must start within an HTMLElement");let l=n.parentNode,a=e.cloneContents();if(t){let e=a.querySelector(t);e&&(a=document.createDocumentFragment()).appendChild(e)}i=0;let o=l.closest("li");if(l.closest("pre")){let e=document.createElement("pre");e.appendChild(a),(a=document.createDocumentFragment()).appendChild(e)}else if(o&&o.parentNode&&("OL"===o.parentNode.nodeName&&(i=r(o)),!a.querySelector("li"))){let e=document.createElement("li");if(!o.parentNode)throw Error();let t=document.createElement(o.parentNode.nodeName);e.appendChild(a),t.appendChild(e),(a=document.createDocumentFragment()).appendChild(t)}return a}(this.range,null!=(e=this.scopeSelector)?e:"");null==(t=this.callback)||t.call(this,n);let l=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.nodeName in a&&!function(e){if(e instanceof HTMLAnchorElement&&1===e.childNodes.length){let t=e.childNodes[0];if(t instanceof HTMLImageElement)return t.src===e.href}return!1}(e)&&("IMG"===e.nodeName||null!=e.firstChild||"INPUT"===e.nodeName&&e instanceof HTMLInputElement&&"checkbox"===e.type)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}),o=[],s=l.nextNode();for(;s;)s instanceof HTMLElement&&o.push(s),s=l.nextNode();for(let e of(o.reverse(),o))e.replaceWith(a[e.nodeName](e));let u=document.body;if(!u)return"";let c=document.createElement("div");c.appendChild(n),c.style.cssText="position:absolute;left:-9999px;",u.appendChild(c);let d="";try{let e=document.createRange();e.selectNodeContents(c),this.selection.removeAllRanges(),this.selection.addRange(e),d=this.selection.toString(),this.selection.removeAllRanges(),e.detach()}finally{u.removeChild(c)}return this.processSelectionText(d.trim())}}},70837:(e,t,n)=>{"use strict";function r(e="ha"){let t,n={};for(let r of Array.from(document.head.querySelectorAll(`meta[name^="${e}-"]`))){let{name:i,content:l}=r,a=i.replace(`${e}-`,"").replace(/-/g,"_");"url"===a?t=l:n[a]=l}if(!t)throw Error(`AnalyticsClient ${e}-url meta tag not found`);return{collectorUrl:t,...Object.keys(n).length>0?{baseContext:n}:{}}}n.d(t,{O:()=>r})},77783:(e,t,n)=>{"use strict";let r;function i(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function l(e,t){let n;return(r,l)=>(()=>{if(n)return n;let r=indexedDB.open(e);return r.onupgradeneeded=()=>r.result.createObjectStore(t),(n=i(r)).then(e=>{e.onclose=()=>n=void 0},()=>{}),n})().then(e=>l(e.transaction(t,r).objectStore(t)))}function a(){return r||(r=l("keyval-store","keyval")),r}function o(e,t=a()){return t("readonly",t=>i(t.get(e)))}function s(e,t,n=a()){return n("readwrite",n=>(n.put(t,e),i(n.transaction)))}function u(e,t=a()){return t("readwrite",t=>(t.delete(e),i(t.transaction)))}function c(e=a()){return e("readwrite",e=>(e.clear(),i(e.transaction)))}function d(e=a()){return e("readonly",t=>{if(t.getAll&&t.getAllKeys)return Promise.all([i(t.getAllKeys()),i(t.getAll())]).then(([e,t])=>e.map((e,n)=>[e,t[n]]));let n=[];return e("readonly",e=>{var t;return(t=e=>n.push([e.key,e.value]),e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},i(e.transaction)).then(()=>n)})})}n.d(t,{IU:()=>c,Jt:()=>o,hZ:()=>s,jO:()=>d,y$:()=>l,yH:()=>u})},78134:(e,t,n)=>{"use strict";n.d(t,{i4:()=>TemplateInstance,xr:()=>d});let r=new Map;function i(e){if(r.has(e))return r.get(e);let t=e.length,n=0,i=0,l=0,a=[];for(let r=0;rn&&(a.push(Object.freeze({type:"string",start:n,end:i,value:e.slice(n,i)})),n=i),a.push(Object.freeze({type:"part",start:i,end:r+2,value:e.slice(n+2,r).trim()})),r+=1,n=r+1)}return n"string"==typeof e?e:e.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};let o=new WeakMap;let NodeTemplatePart=class NodeTemplatePart{constructor(e,t){this.expression=t,o.set(this,[e]),e.textContent=""}get value(){return o.get(this).map(e=>e.textContent).join("")}set value(e){this.replace(e)}get previousSibling(){return o.get(this)[0].previousSibling}get nextSibling(){return o.get(this)[o.get(this).length-1].nextSibling}replace(...e){var t,n;let r=e.map(e=>"string"==typeof e?new Text(e):e);r.length||r.push(new Text(""));let i=o.get(this)[0];for(let e of r)null==(t=i.parentNode)||t.insertBefore(e,i);for(let e of o.get(this))null==(n=e.parentNode)||n.removeChild(e);o.set(this,r)}};let InnerTemplatePart=class InnerTemplatePart extends NodeTemplatePart{constructor(e){var t;super(e,null!=(t=e.getAttribute("expression"))?t:""),this.template=e}get directive(){var e;return null!=(e=this.template.getAttribute("directive"))?e:""}};function s(e){return{processCallback(t,n,r){var i;if("object"==typeof r&&r){for(let t of n)if(t.expression in r){let n=null!=(i=r[t.expression])?i:"";e(t,n,r)}}}}}function u(e,t){e.value=t instanceof Node?t:String(t)}let c=s(u),d=s((e,t)=>{"boolean"==typeof t&&e instanceof AttributeTemplatePart&&"boolean"==typeof e.element[e.attributeName]&&(e.booleanValue=t,1)||u(e,t)}),h=new WeakMap,f=new WeakMap;let TemplateInstance=class TemplateInstance extends(globalThis.DocumentFragment||EventTarget){constructor(e,t,n=c){var r,l;super(),Object.getPrototypeOf(this)!==TemplateInstance.prototype&&Object.setPrototypeOf(this,TemplateInstance.prototype),this.appendChild(e.content.cloneNode(!0)),f.set(this,Array.from(function* e(t){let n,r=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);for(;n=r.nextNode();)if(n instanceof HTMLTemplateElement)if(n.hasAttribute("directive"))yield new InnerTemplatePart(n);else for(let t of e(n.content))yield t;else if(n instanceof Element&&n.hasAttributes())for(let e=0;e{"use strict";function r(e,t,n){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return n}n.d(t,{_:()=>r})},95493:(e,t,n)=>{"use strict";function r(e,t){return i(function(e){if(e.activeElement!==e.body)return e.activeElement;var t=e.querySelectorAll(":hover"),n=t.length;if(n)return t[n-1]}(e),t)}function i(e,t){var n=e;if(!n)return Promise.resolve(t());var r=n.ownerDocument.documentElement,i=function(e){for(var t=[];e;){var n=e.getBoundingClientRect(),r=n.top,i=n.left;t.push({element:e,top:r,left:i}),e=e.parentElement}return t}(n);return Promise.resolve(t()).then(function(e){var t=function(e){for(var t=0;tr,_H:()=>i})},95754:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let r=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],i="undefined"!=typeof window&&null!=window.mozInnerScreenX;function l(e,t,n){let l=n&&n.debug||!1;if(l){let e=document.querySelector("#input-textarea-caret-position-mirror-div");e&&e.parentNode.removeChild(e)}let a=document.createElement("div");a.id="input-textarea-caret-position-mirror-div",document.body.appendChild(a);let o=a.style,s=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,u="INPUT"===e.nodeName;for(let t of(o.whiteSpace="pre-wrap",u||(o.wordWrap="break-word"),o.position="absolute",l||(o.visibility="hidden"),r))if(u&&"lineHeight"===t)if("border-box"===s.boxSizing){let e=parseInt(s.height),t=parseInt(s.paddingTop)+parseInt(s.paddingBottom)+parseInt(s.borderTopWidth)+parseInt(s.borderBottomWidth),n=t+parseInt(s.lineHeight);e>n?o.lineHeight=`${e-t}px`:e===n?o.lineHeight=s.lineHeight:o.lineHeight=0}else o.lineHeight=s.height;else if(u||"width"!==t||"border-box"!==s.boxSizing)o[t]=s[t];else{let n=parseFloat(s.borderLeftWidth)+parseFloat(s.borderRightWidth),r=i?parseFloat(s[t])-n:e.clientWidth+n;o[t]=`${r}px`}i?e.scrollHeight>parseInt(s.height)&&(o.overflowY="scroll"):o.overflow="hidden",a.textContent=e.value.substring(0,t),u&&(a.textContent=a.textContent.replace(/\s/g,"\xa0"));let c=document.createElement("span");c.textContent=e.value.substring(t)||".",a.appendChild(c);let d={top:c.offsetTop+parseInt(s.borderTopWidth),left:c.offsetLeft+parseInt(s.borderLeftWidth),height:parseInt(s.lineHeight)};return l?c.style.backgroundColor="#aaa":document.body.removeChild(a),d}}}]); +//# sourceMappingURL=66721-cd654e33abbf.js.map \ No newline at end of file diff --git a/913-ca2305638c53.js b/913-ca2305638c53.js new file mode 100644 index 0000000..9fa5838 --- /dev/null +++ b/913-ca2305638c53.js @@ -0,0 +1,64 @@ +"use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([[913],{913:(e,t,o)=>{o.r(t),o.d(t,{apply:()=>N,injectStyles:()=>C,isPolyfilled:()=>D,isSupported:()=>H});var n=class extends Event{oldState;newState;constructor(e,{oldState:t="",newState:o="",...n}={}){super(e,n),this.oldState=String(t||""),this.newState=String(o||"")}},r=new WeakMap;function i(e,t,o){r.set(e,setTimeout(()=>{r.has(e)&&e.dispatchEvent(new n("toggle",{cancelable:!1,oldState:t,newState:o}))},0))}var l=globalThis.ShadowRoot||function(){},a=globalThis.HTMLDialogElement||function(){},p=new WeakMap,u=new WeakMap,s=new WeakMap;function c(e){return s.get(e)||"hidden"}var f=new WeakMap;function d(e,t){return!("auto"!==e.popover&&"manual"!==e.popover||!e.isConnected||t&&"showing"!==c(e)||!t&&"hidden"!==c(e)||e instanceof a&&e.hasAttribute("open"))&&document.fullscreenElement!==e}function h(e){return e?Array.from(u.get(e.ownerDocument)||[]).indexOf(e)+1:0}function g(e){let t=u.get(e);for(let e of t||[])if(e.isConnected)return e;else t.delete(e);return null}function m(e){return"function"==typeof e.getRootNode?e.getRootNode():e.parentNode?m(e.parentNode):e}function v(e){for(;e;){if(e instanceof HTMLElement&&"auto"===e.popover&&"showing"===s.get(e))return e;if((e=e instanceof Element&&e.assignedSlot||e.parentElement||m(e))instanceof l&&(e=e.host),e instanceof Document)return}}var w=new WeakMap;function b(e){if(!d(e,!1))return;let t=e.ownerDocument;if(!e.dispatchEvent(new n("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!d(e,!1))return;let o=!1;if("auto"===e.popover){let o=e.getAttribute("popover");if(T(function(e){let t=new Map,o=0;for(let n of u.get(e.ownerDocument)||[])t.set(n,o),o+=1;t.set(e,o),o+=1;let n=null;return!function(e){let o=v(e);if(null===o)return;let r=t.get(o);(null===n||t.get(n)h(o)?t:o);if(i&&"pointerdown"===e.type)S.set(r,i);else if("pointerup"===e.type){let e=S.get(r)===i;S.delete(r),e&&T(i||r,!1,!0)}}var L=new WeakMap;function A(e,t=!1){if(!e)return;L.has(e)||L.set(e,e.getAttribute("aria-expanded"));let o=e.popoverTargetElement;if(o instanceof HTMLElement&&"auto"===o.popover)e.setAttribute("aria-expanded",String(t));else{let t=L.get(e);t?e.setAttribute("aria-expanded",t):e.removeAttribute("aria-expanded")}}var k=globalThis.ShadowRoot||function(){};function H(){return"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype}function D(){return!!(document.body?.showPopover&&!/native code/i.test(document.body.showPopover.toString()))}function x(e,t,o){let n=e[t];Object.defineProperty(e,t,{value(e){return n.call(this,o(e))}})}var P=/(^|[^\\]):popover-open\b/g,R=null;function C(e){let t,o=(t="function"==typeof globalThis.CSSLayerBlockRule,` +${t?"@layer popover-polyfill {":""} + :where([popover]) { + position: fixed; + z-index: 2147483647; + inset: 0; + padding: 0.25em; + width: fit-content; + height: fit-content; + border-width: initial; + border-color: initial; + border-image: initial; + border-style: solid; + background-color: canvas; + color: canvastext; + overflow: auto; + margin: auto; + } + + :where([popover]:not(.\\:popover-open)) { + display: none; + } + + :where(dialog[popover].\\:popover-open) { + display: block; + } + + :where(dialog[popover][open]) { + display: revert; + } + + :where([anchor].\\:popover-open) { + inset: auto; + } + + :where([anchor]:popover-open) { + inset: auto; + } + + @supports not (background-color: canvas) { + :where([popover]) { + background-color: white; + color: black; + } + } + + @supports (width: -moz-fit-content) { + :where([popover]) { + width: -moz-fit-content; + height: -moz-fit-content; + } + } + + @supports not (inset: 0) { + :where([popover]) { + top: 0; + left: 0; + right: 0; + bottom: 0; + } + } +${t?"}":""} +`);if(null===R)try{(R=new CSSStyleSheet).replaceSync(o)}catch{R=!1}if(!1===R){let t=document.createElement("style");t.textContent=o,e instanceof Document?e.head.prepend(t):e.prepend(t)}else e.adoptedStyleSheets=[R,...e.adoptedStyleSheets]}function N(){var e;if("undefined"==typeof window)return;function t(e){return e?.includes(":popover-open")&&(e=e.replace(P,"$1.\\:popover-open")),e}window.ToggleEvent=window.ToggleEvent||n,x(Document.prototype,"querySelector",t),x(Document.prototype,"querySelectorAll",t),x(Element.prototype,"querySelector",t),x(Element.prototype,"querySelectorAll",t),x(Element.prototype,"matches",t),x(Element.prototype,"closest",t),x(DocumentFragment.prototype,"querySelectorAll",t),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let e=(this.getAttribute("popover")||"").toLowerCase();return""===e||"auto"==e?"auto":"manual"},set(e){null===e?this.removeAttribute("popover"):this.setAttribute("popover",e)}},showPopover:{enumerable:!0,configurable:!0,value(){b(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){y(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(e){"showing"===s.get(this)&&void 0===e||!1===e?y(this,!0,!0):(void 0===e||!0===e)&&b(this)}}});let o=Element.prototype.attachShadow;o&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let t=o.call(this,e);return C(t),t}}});let r=HTMLElement.prototype.attachInternals;r&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=r.call(this);return e.shadowRoot&&C(e.shadowRoot),e}}});let i=new WeakMap;function l(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(null===e)this.removeAttribute("popovertarget"),i.delete(this);else if(e instanceof Element)this.setAttribute("popovertarget",""),i.set(this,e);else throw TypeError("popoverTargetElement must be an element or null")},get(){if("button"!==this.localName&&"input"!==this.localName||"input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type||this.disabled||this.form&&"submit"===this.type)return null;let e=i.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return i.delete(this),null;let t=m(this),o=this.getAttribute("popovertarget");return(t instanceof Document||t instanceof k)&&o&&t.getElementById(o)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===e||"hide"===e?e:"toggle"},set(e){this.setAttribute("popovertargetaction",e)}}})}l(HTMLButtonElement),l(HTMLInputElement);(e=document).addEventListener("click",e=>{let t=e.composedPath(),o=t[0];if(!(o instanceof Element)||o?.shadowRoot)return;let n=m(o);if(!(n instanceof k||n instanceof Document))return;let r=t.find(e=>e.matches?.("[popovertargetaction],[popovertarget]"));if(r){!function(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let o=c(t);"show"===e.popoverTargetAction&&"showing"===o||("hide"!==e.popoverTargetAction||"hidden"!==o)&&("showing"===o?y(t,!0,!0):d(t,!1)&&(f.set(t,e),b(t)))}(r),e.preventDefault();return}}),e.addEventListener("keydown",e=>{let t=e.key,o=e.target;!e.defaultPrevented&&o&&("Escape"===t||"Esc"===t)&&T(o.ownerDocument,!0,!0)}),e.addEventListener("pointerdown",M),e.addEventListener("pointerup",M),C(document)}}}]); +//# sourceMappingURL=913-6ad5fae424fd.js.map \ No newline at end of file diff --git a/AgentsIcon.tsx b/AgentsIcon.tsx new file mode 100644 index 0000000..df74548 --- /dev/null +++ b/AgentsIcon.tsx @@ -0,0 +1,39 @@ +import type {Icon} from '@primer/octicons-react' + +export const AgentsIcon16: Icon = props => { + return ( + + ) +} + +export const AgentsIcon32: Icon = props => { + return ( + + ) +} diff --git a/AnalyticsProvider.tsx b/AnalyticsProvider.tsx new file mode 100644 index 0000000..0e357ef --- /dev/null +++ b/AnalyticsProvider.tsx @@ -0,0 +1,10 @@ +import {useMemo} from 'react' +import type {PropsWithChildren} from 'react' +import {AnalyticsContext, type AnalyticsProviderProps} from './context' + +export function AnalyticsProvider({children, appName, category, metadata}: PropsWithChildren) { + const value = useMemo(() => ({appName, category, metadata}), [appName, category, metadata]) + return {children} +} + +try{ AnalyticsProvider.displayName ||= 'AnalyticsProvider' } catch {} \ No newline at end of file diff --git a/AuthorSettingsContext.tsx b/AuthorSettingsContext.tsx new file mode 100644 index 0000000..48ed6f5 --- /dev/null +++ b/AuthorSettingsContext.tsx @@ -0,0 +1,34 @@ +import {merge} from '@primer/styled-react' +import type React from 'react' +import {createContext, use} from 'react' + +export type AuthorSettings = { + fontWeight: 'normal' | 'semibold' | 'bold' + fontColor: 'fg.default' | 'fg.muted' + includeTooltip: boolean + avatarSize: 16 | 20 | undefined +} + +const defaultSettings: AuthorSettings = { + fontWeight: 'bold' as const, + fontColor: 'fg.default' as const, + includeTooltip: false, + avatarSize: undefined, // defaults to primer component default +} + +const AuthorSettingsContext = createContext(defaultSettings) + +export function AuthorSettingsProvider({ + authorSettings, + children, +}: React.PropsWithChildren<{authorSettings: Partial | undefined}>) { + const authorSettingsOrDefault = merge(defaultSettings, authorSettings ?? {}) + return {children} +} + +export function useAuthorSettings() { + return use(AuthorSettingsContext) || defaultSettings +} + +try{ AuthorSettingsContext.displayName ||= 'AuthorSettingsContext' } catch {} +try{ AuthorSettingsProvider.displayName ||= 'AuthorSettingsProvider' } catch {} \ No newline at end of file diff --git a/AuthorTooltip.tsx b/AuthorTooltip.tsx new file mode 100644 index 0000000..87781b7 --- /dev/null +++ b/AuthorTooltip.tsx @@ -0,0 +1,20 @@ +import {Tooltip} from '@primer/react/next' +import type {PropsWithChildren} from 'react' +import type {Author} from '../commit-attribution-types' + +type AuthorTooltipProps = { + author: Author + renderTooltip?: boolean +} + +export function AuthorTooltip({renderTooltip, author, children}: PropsWithChildren) { + if (renderTooltip === false) return <>{children} + + return ( + + {children} + + ) +} + +try{ AuthorTooltip.displayName ||= 'AuthorTooltip' } catch {} \ No newline at end of file diff --git a/Blankslate-f5a9755a.css b/Blankslate-f5a9755a.css new file mode 100644 index 0000000..986c128 --- /dev/null +++ b/Blankslate-f5a9755a.css @@ -0,0 +1,2 @@ +@layer primer-react { .prc-Blankslate-Container-Vr9Ce{container:blankslate/inline-size}.prc-Blankslate-Blankslate-Eihy3{display:grid;justify-items:center;padding:var(--blankslate-padding)}.prc-Blankslate-Blankslate-Eihy3:where([data-border]){border:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));border-radius:var(--borderRadius-medium,.375rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-narrow]){margin:0 auto;max-width:485px}.prc-Blankslate-Blankslate-Eihy3:where([data-size=medium]){--blankslate-heading-text:var(--text-title-shorthand-medium,600 1.25rem/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-heading-margin-block:0 var(--base-size-4,0.25rem);--blankslate-description-text:var(--text-body-shorthand-large,400 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-padding:var(--base-size-32,2rem);--blankslate-action-margin-block-end:var(--base-size-16,1rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=medium][data-spacious]){--blankslate-padding:var(--base-size-80,5rem) var(--base-size-40,2.5rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=small]){--blankslate-heading-text:var(--text-title-shorthand-small,600 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-heading-margin-block:0 var(--base-size-4,0.25rem);--blankslate-description-text:var(--text-body-shorthand-medium,400 0.875rem/1.42857 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-padding:var(--base-size-32,2rem) var(--base-size-20,1.25rem);--blankslate-action-margin-block-end:var(--base-size-12,0.75rem);--blankslate-visual-size:var(--base-size-24,1.5rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=small][data-spacious]){--blankslate-padding:var(--base-size-44,2.75rem) var(--base-size-28,1.75rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=large]){--blankslate-heading-text:var(--text-title-shorthand-large,600 2rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-heading-margin-block:var(--base-size-8,0.5rem) var(--base-size-4,0.25rem);--blankslate-description-text:var(--text-body-shorthand-large,400 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-description-margin-block:0 var(--base-size-8,0.5rem);--blankslate-padding:var(--base-size-32,2rem);--blankslate-action-margin-block-end:var(--base-size-16,1rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=large][data-spacious]){--blankslate-padding:var(--base-size-80,5rem) var(--base-size-40,2.5rem)}.prc-Blankslate-Description-nqiRV,.prc-Blankslate-Heading-tVZsq{margin:0;text-align:center}.prc-Blankslate-Heading-tVZsq{font:var(--blankslate-heading-text);margin-block:var(--blankslate-heading-margin-block)}.prc-Blankslate-Description-nqiRV{font:var(--blankslate-description-text);margin-block:var(--blankslate-description-margin-block)}.prc-Blankslate-Description-nqiRV,.prc-Blankslate-Visual-10aPl{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-Blankslate-Visual-10aPl{display:inline-flex;margin-block-end:var(--base-size-8,.5rem);max-width:var(--blankslate-visual-size)}.prc-Blankslate-Visual-10aPl svg{width:100%}.prc-Blankslate-Action-RsgHG{font:var(--blankslate-description-text);margin-block-start:var(--base-size-16,1rem)}.prc-Blankslate-Action-RsgHG:where(:last-of-type){margin-block-end:var(--blankslate-action-margin-block-end)}@container blankslate (max-width: 34rem){.prc-Blankslate-Blankslate-Eihy3{--blankslate-padding:var(--base-size-20,1.25rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-spacious=true]){--blankslate-padding:var(--base-size-44,2.75rem) var(--base-size-28,1.75rem)}.prc-Blankslate-Blankslate-Eihy3{--blankslate-heading-text:var(--text-title-shorthand-small,600 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-description-text:var(--text-body-shorthand-medium,400 0.875rem/1.42857 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji")}.prc-Blankslate-Visual-10aPl{color:var(--fgColor-muted,var(--color-fg-muted));margin-bottom:var(--base-size-8,.5rem);max-width:var(--base-size-24,1.5rem)}.prc-Blankslate-Action-RsgHG{margin-top:var(--base-size-8,.5rem)}.prc-Blankslate-Action-RsgHG:first-of-type{margin-top:var(--base-size-16,1rem)}.prc-Blankslate-Action-RsgHG:last-of-type{margin-bottom:calc(var(--base-size-8,.5rem)/2)}} +/*# sourceMappingURL=Blankslate-f5a9755a.css.map */ } \ No newline at end of file diff --git a/CommitAttribution.tsx b/CommitAttribution.tsx new file mode 100644 index 0000000..c3080ad --- /dev/null +++ b/CommitAttribution.tsx @@ -0,0 +1,196 @@ +import {Fragment, type PropsWithChildren} from 'react' + +import type {Author} from './commit-attribution-types' +import {AuthorsDialog} from './components/AuthorsDialog' +import {CommitAuthorStack} from './components/CommitAuthorStack' +import {AuthorLink} from './components/AuthorLink' +import {OrgLink} from './components/OrgLink' +import type {RepositoryNWO} from '@github-ui/current-repository' +import {AuthorAvatar} from './components/AuthorAvatar' +import {AuthorSettingsProvider, type AuthorSettings} from './contexts/AuthorSettingsContext' + +import {RepoPushIcon} from '@primer/octicons-react' +import styles from './CommitAttribution.module.css' +import {clsx} from 'clsx' + +export interface CommitAttributionProps { + authors: Author[] + committer?: Author + committerAttribution?: boolean + onBehalfOf?: Author + includeVerbs: boolean + repo: RepositoryNWO + authorSettings?: Partial + textVariant?: 'default' | 'muted' +} + +function SingleAuthor({author, repo}: {author: Author; repo: RepositoryNWO}) { + return +} + +function AuthorByline({ + author, + committer, + committerAttribution, + onBehalfOf, + repo, +}: { + author: Author + committer?: Author + committerAttribution?: boolean + onBehalfOf?: Author + repo: RepositoryNWO +}) { + const authors = [author] + if (committer && committerAttribution) { + authors.push(committer) + } + + return ( + <> + + + + ) +} + +function TwoAuthors({authors, onBehalfOf, repo}: {authors: Author[]; onBehalfOf?: Author; repo: RepositoryNWO}) { + return ( + <> + + {authors.map((author, index) => ( + // eslint-disable-next-line @eslint-react/no-array-index-key + + + {index !== authors.length - 1 && and} + + ))} + + ) +} + +function MultipleAuthors({authors, onBehalfOf, repo}: {authors: Author[]; onBehalfOf?: Author; repo: RepositoryNWO}) { + return ( + <> + + + + ) +} + +export function CommitAttribution({ + authors, + committer, + committerAttribution, + onBehalfOf, + repo, + children, + includeVerbs = true, + authorSettings, + textVariant = 'default', +}: PropsWithChildren) { + const singleAuthor = authors.length === 1 && !committerAttribution && !onBehalfOf + const authorAndCommitter = authors.length === 1 && (committerAttribution || onBehalfOf) + const inlineAuthorNames = authors.length === 2 && !committerAttribution + const multipleAuthors = !singleAuthor && !authorAndCommitter && !inlineAuthorNames + const firstAuthor = authors[0] + const verbClass = includeVerbs ? 'pl-1' : '' + + return ( +
+ + {singleAuthor && firstAuthor && } + {authorAndCommitter && firstAuthor && ( + + )} + {inlineAuthorNames && } + {multipleAuthors && } + + + + {onBehalfOf && ( + <> + on behalf of + + + )} + + {children} + +
+ ) +} + +function AuthoredOrCommitted({ + committer, + committerAttribution, + includeVerbs, + repo, + verbClass, +}: { + committer: Author | undefined + committerAttribution: boolean + includeVerbs: boolean + repo: RepositoryNWO + verbClass: string +}) { + if (committer && committer.isGitHub) { + return {includeVerbs && 'authored'} + } else if (!committerAttribution) { + return {includeVerbs && 'committed'} + } else { + return ( + <> + {includeVerbs ? 'authored and' : 'and'} + + {includeVerbs && 'committed'} + + ) + } +} + +export interface PushAttributionProps { + pusher?: Author + repo: RepositoryNWO + textVariant?: 'default' | 'muted' +} + +export function PushAttribution({ + pusher, + repo, + children, + textVariant = 'default', +}: PropsWithChildren) { + if (!pusher) return null + + return ( +
+ + + + + pushed + {children} +
+ ) +} + +try{ SingleAuthor.displayName ||= 'SingleAuthor' } catch {} +try{ AuthorByline.displayName ||= 'AuthorByline' } catch {} +try{ TwoAuthors.displayName ||= 'TwoAuthors' } catch {} +try{ MultipleAuthors.displayName ||= 'MultipleAuthors' } catch {} +try{ CommitAttribution.displayName ||= 'CommitAttribution' } catch {} +try{ AuthoredOrCommitted.displayName ||= 'AuthoredOrCommitted' } catch {} +try{ PushAttribution.displayName ||= 'PushAttribution' } catch {} \ No newline at end of file diff --git a/CommitAuthorStack.tsx b/CommitAuthorStack.tsx new file mode 100644 index 0000000..c6dc25f --- /dev/null +++ b/CommitAuthorStack.tsx @@ -0,0 +1,47 @@ +import {AvatarStack} from '@primer/react' +import {GitHubAvatar} from '@github-ui/github-avatar' +import {userHovercardPath, orgHovercardPath} from '@github-ui/paths' +import type {Author} from '../commit-attribution-types' +import {isBotOrApp} from '../utils' +import {useAuthorSettings} from '../contexts/AuthorSettingsContext' + +type CommitAuthorStackProps = { + authors: Author[] + onBehalfOf?: Author +} + +const maxAvatarCount = 5 + +export function CommitAuthorStack({authors, onBehalfOf}: CommitAuthorStackProps) { + const authorSettings = useAuthorSettings() + + return ( + + {authors.slice(0, maxAvatarCount).map((author, index) => ( + + ))} + {onBehalfOf && ( + + )} + + ) +} + +try{ CommitAuthorStack.displayName ||= 'CommitAuthorStack' } catch {} \ No newline at end of file diff --git a/Document.rtf b/Document.rtf new file mode 100644 index 0000000..6412f83 --- /dev/null +++ b/Document.rtf @@ -0,0 +1,6 @@ +{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang4105{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fnil\fcharset1 Cambria Math;}{\f2\fnil Calibri;}} +{\colortbl ;\red0\green0\blue255;} +{\*\generator Riched20 10.0.26100}{\*\mmathPr\mmathFont1\mwrapIndent1440 }\viewkind4\uc1 +\pard\sa200\sl276\slmult1\f0\fs22\lang9 https://wpewebkit.org/wpt-status/<"line1"> <"line2"><html prefix="og: {{\field{\*\fldinst{HYPERLINK https://ogp.me/ns# }}{\fldrslt{https://ogp.me/ns#\ul0\cf0}}}}\f0\fs22 " lang="en"> <"line3"> <"line4"> <head> <"line5"> <"line6"> <meta charset="utf-8"> <"line7"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <"line8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <"line9"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <"line10"> <meta name="author" content=""> <"line11"> <"line12"> <title>WPE Specification Supporttitle> <"line13"> <link rel="canonical" href="https://wpewebkit.org/wpt-status/"> <"line14"> <link rel="alternate" type="application/rss+xml" title="WPE WebKit Blog" href="https://wpewebkit.org/blog.xml"> <"line15"> <link rel="alternate" type="application/rss+xml" title="WPE WebKit Posts" href="https://wpewebkit.org/feed.xml"> <"line16"> <link rel="alternate" type="application/rss+xml" title="WPE WebKit Security Advisories" href="https://wpewebkit.org/security.xml"> <"line17"> <meta property="og:url" content="https://wpewebkit.org/wpt-status/"> <"line18"> <meta property="og:title" content="WPE Specification Support"> <"line19"> <meta property="og:image" content="https://wpewebkit.org/assets/twitter_Profile_WhiteBg_400px.png"> <"line20"> <meta property="og:image:secure_url" content="https://wpewebkit.org/assets/twitter_Profile_WhiteBg_400px.png"> <"line21"> <meta property="og:image:alt" content="WPE logo"> <"line22"> <meta property="og:image:type" content="image/png"> <"line23"> <meta property="og:image:width" content="400"> <"line24"> <meta property="og:image:height" content="400"> <"line25"> <meta property="og:type" content="article"> <"line26"> <meta property="article:published_time" content="2025-12-19T15:45:15.557Z"> <"line27"> <meta property="article:tag" content="devs"> <"line28"> <meta name="twitter:card" content="summary"> <"line29"> <meta name="twitter:site" content="@WPEWebKit"> <"line30"> <"line31"> <"line32"> <link rel="stylesheet" href="/css/v2.css"> <"line33"> <"line34"> <"line35"> <link rel="stylesheet" href="/vendor/font-awesome/css/font-awesome.min.css"> <"line36"> <link rel="stylesheet" href="/css/fonts.css"> <"line37"> <"line38"> <"line39"> <link rel="stylesheet" href="/css/prism.css"> <"line40"> <"line41"> <"line42"> <link rel="stylesheet" href="/css/stylish-portfolio.css"> <"line43"> <script type="text/javascript"> <"line44"> window.addEventListener('load',function() \{document.querySelector('nav.global>div>.burger').addEventListener('click',menutog)\}); <"line45"> function menutog(e) \{ <"line46"> document.querySelector('nav.global>div>ul').classList.toggle('off'); <"line47"> e.preventDefault(); <"line48"> \} <"line49"> script> <"line50"> <"line51"> <script type="text/javascript"> <"line52"> var _paq = window._paq = window._paq || []; <"line53"> /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ <"line54"> _paq.push(['trackPageView']); <"line55"> _paq.push(['enableLinkTracking']); <"line56"> (function() \{ <"line57"> var u="//stats.igalia.com/"; <"line58"> _paq.push(['setTrackerUrl', u+'matomo.php']); <"line59"> _paq.push(['setSiteId', '6']); <"line60"> var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; <"line61"> g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); <"line62"> \})(); <"line63"> script> <"line64"> <"line65">head> <"line66"> <"line67"> <"line68"> <body id="page-top" class="subpage"> <"line69"> <"line70"> <nav class="global"> <"line71">\tab <div> <"line72">\tab <a class="igalia logo home" href="/"><img src="/assets/img/logo-blue.svg" alt="WPE">a> <"line73">\tab <ul class="wpt-status off"><li> <"line74">\tab <a class="nav-link" href="/">Homea> <"line75">\tab li><li> <"line76">\tab <a class="nav-link" href="/about/">Learn && Discovera> <"line77">\tab li><li> <"line78">\tab <a class="nav-link" href="/blog/">Bloga> <"line79">\tab li><li> <"line80">\tab <a class="nav-link" href="/developers/">Developersa> <"line81">\tab li><li> <"line82">\tab <a class="btn cta" href="/about/get-wpe.html">Get WPEa> <"line83">\tab li>ul> <"line84">\tab <a href="#" class="burger">Menua> <"line85">\tab div> <"line86">nav> <"line87"> <"line88"> <"line89"> <main> <"line90"> <"line91"><style> <"line92">body \{ <"line93"> font-family: sans-serif; <"line94">\} <"line95"> <"line96">h1 \{ <"line97"> margin-block-end: 0; <"line98">\} <"line99"> <"line100">#stickyheader \{ <"line101"> position: sticky; <"line102"> top: 4.5em; <"line103"> display: flex; <"line104"> flex-wrap: nowrap; <"line105"> justify-content: space-between; <"line106"> align-items: baseline; <"line107"> gap: 0 2em; <"line108"> padding-block: 1em; <"line109"> z-index: 1; <"line110"> background: #FFF; <"line111"> white-space: nowrap; <"line112"> overflow: hidden; <"line113"> text-overflow: ellipsis; <"line114">\} <"line115"> <"line116">#stickyheader>label \{ <"line117"> line-height: 1.6; <"line118">\} <"line119"> <"line120">#stickyheader+p \{ <"line121"> margin-block-start: 0em; <"line122">\} <"line123"> <"line124">#version-select \{ <"line125"> margin-inline: 0.67em 0; <"line126">\} <"line127"> <"line128">#results-table \{ <"line129"> border-collapse: collapse; <"line130"> width: 100%; <"line131"> margin-block: 1.25em 1em; <"line132"> table-layout: fixed; <"line133">\} <"line134"> <"line135">#results-table :is(th, td) \{ <"line136"> border: 1px solid #ccc; <"line137"> padding-inline: 0.5em; <"line138"> padding-block: 0.5em 0.4em; <"line139"> text-align: left; <"line140">\} <"line141"> <"line142">#results-table thead th \{ <"line143"> background-color: #f4f4f4; <"line144"> background-repeat: no-repeat; <"line145"> background-position: 0 0, 100% 100%; <"line146"> background-size: 100% 1px; <"line147"> background-image: linear-gradient(90deg, #0003, #0003), linear-gradient(90deg, #0005, #0005); <"line148">\} <"line149"> <"line150">#results-table thead \{ <"line151"> position: sticky; <"line152"> top: 7.5em; <"line153"> z-index: 1; <"line154">\} <"line155"> <"line156">#results-table tbody a[href] \{ <"line157"> text-decoration-color: color-mix(in hsl, currentColor 60%, transparent); <"line158"> text-underline-offset: 0.15em; <"line159">\} <"line160"> <"line161">#results-table tbody td.barred \{ <"line162"> background-image: linear-gradient(90deg, hsl(calc(var(--dataHue) * 1.2) 70% 90%) 0, hsl(calc(var(--dataHue) * 1.2) 70% 70%) 100%); <"line163"> background-size: var(--dataPct) 100%; <"line164"> background-repeat: no-repeat; <"line165"> text-shadow: <"line166"> 0 0 0.25em hsl(0, 0%, 93.7%), <"line167"> 0 0 0.25em hsl(0, 0%, 93.7%), <"line168"> 0 0 0.25em hsl(0, 0%, 93.7%), <"line169"> 0 0 0.25em hsl(0, 0%, 93.7%), <"line170"> 0 0 0.25em hsl(0, 0%, 93.7%), <"line171"> 0 0 0.15em hsl(0, 0%, 93.7%), <"line172"> 0 0 0.15em hsl(0, 0%, 93.7%), <"line173"> 0 0 0.15em hsl(0, 0%, 93.7%), <"line174"> 0 0 0.15em hsl(0, 0%, 93.7%), <"line175"> 0 0 0.15em hsl(0, 0%, 93.7%); <"line176">\} <"line177"> <"line178">#results-table tbody td small \{ <"line179"> margin-inline: 0.33ch 0; <"line180">\} <"line181"> <"line182">#results-table tbody td \{ <"line183"> word-break: break-word; <"line184">\} <"line185"> <"line186">#support-combo-filter \{ <"line187"> display: grid; <"line188"> grid-template-columns: 1fr 1fr; <"line189"> gap: 0.5em 1em; <"line190"> background: inherit; <"line191">\} <"line192"> <"line193">#support-combo-filter legend \{ <"line194"> grid-column: span 2; <"line195">\} <"line196"> <"line197">details \{ <"line198"> padding-block-end: 1px; <"line199">\} <"line200"> <"line201">fieldset.smaller \{ <"line202"> font-size: 0.85em; <"line203"> padding: 0.5em 1em; <"line204"> margin: 0.5em 0; <"line205"> border: 1px solid #ccc; <"line206">\} <"line207"> <"line208">fieldset.smaller label \{ <"line209"> margin: 0.2em 0; <"line210"> display: block; <"line211">\} <"line212"> <"line213">.help-text \{ <"line214"> font-size: 0.8em; <"line215"> color: #666; <"line216"> margin-left: 1.5em; <"line217"> margin-top: 0.2em; <"line218">\} <"line219"> <"line220"> <"line221">#controls \{ <"line222"> display: flex; <"line223"> align-items: center; <"line224"> gap: 0.5rem; <"line225"> flex-wrap: nowrap; <"line226"> flex-shrink: 0; <"line227">\} <"line228"> <"line229">.source-tab \{ <"line230"> display: inline-flex; <"line231"> border: 1px solid #ccc; <"line232"> border-radius: 6px; <"line233"> overflow: hidden; <"line234"> box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); <"line235">\} <"line236"> <"line237">.toggle-btn \{ <"line238"> appearance: none; <"line239"> border: none; <"line240"> background: #f5f5f5; <"line241"> padding: 0.25em 0.6em; <"line242"> font-size: 0.9em; <"line243"> cursor: pointer; <"line244"> color: #333; <"line245"> transition: background 0.2s, color 0.2s; <"line246">\} <"line247"> <"line248">.toggle-btn:hover \{ <"line249"> background: #eaeaea; <"line250">\} <"line251"> <"line252">.toggle-btn.active \{ <"line253"> background: #0066cc; <"line254"> color: white; <"line255">\} <"line256"> <"line257">#controls label, <"line258">#controls span \{ <"line259"> white-space: nowrap; <"line260">\} <"line261"> <"line262">[id="info-run"] \{ <"line263"> flex: 0 1 auto; <"line264"> min-width: 0; <"line265"> font-family: monospace; <"line266"> background-color: #f5f5f5; <"line267"> color: #333; <"line268"> padding: 0.3em 0.6em; <"line269"> border: 1px solid #ccc; <"line270"> border-radius: 4px; <"line271"> display: inline-block; <"line272"> white-space: nowrap; <"line273"> font-size: 0.9em; <"line274"> overflow: hidden; <"line275"> text-overflow: ellipsis; <"line276"> text-align: right; <"line277">\} <"line278"> <"line279">.tight-label \{ <"line280"> margin-right: -0.5em; /* pulls WPE closer to the select */ <"line281">\} <"line282"> <"line283">.filter-input-notfound \{ <"line284"> background-color: #62293c; <"line285"> color: white; <"line286">\} <"line287"> <"line288">style> <"line289"> <"line290"><div id="header"> <"line291"> <h1>WPE Web Support Statush1> <"line292"> <p>Change the result source, the WPE version or advanced options. The view will update live and provide a stable, sharable URL.p> <"line293">div> <"line294"> <"line295"><div id="stickyheader"> <"line296"> <div id="controls"> <"line297"> <span title="Result source">&&#x1F4CA;span> <"line298"> <label>Source <"line299"> <select id="viewType" aria-controls="results-table"> <"line300"> <option selected data-view="BCD">BCDoption> <"line301"> <option data-view="WPT">WPToption> <"line302"> select> <"line303"> label> <"line304">&&nbsp; <"line305"> <label for="version-select"> <"line306"> <span class="tight-label">&&#x2699;Versionspan> <"line307"> <select id="version-select">select> <"line308"> label> <"line309"> div> <"line310"> <"line311"> <div id="info-run"> <"line312"> Results from <"line313"> <strong><a id="meta-run-link" href="" target="_blank">a>strong> <"line314"> (Date: <strong><span id="meta-run-date">span>strong>) <"line315"> div> <"line316"> <"line317">div> <"line318"> <"line319"><details id="advanced-options"> <"line320"><summary>Advanced optionssummary> <"line321"><div id="support-combo-filter"> <"line322"> <label class="wpt-advanced-option"> <"line323"> <input type="checkbox" id="show-unknown">Show not yet named or linked <"line324"> <div class="help-text">Include results for WPT dirs we haven't yet linked to their specification.div> <"line325"> label> <"line326"> <label class="wpt-advanced-option"> <"line327"> <input type="checkbox" id="show-wpt-details">Show WPT directories and test counts <"line328"> <div class="help-text">Show columns with WPT dirs info along with test and subtest counts.div> <"line329"> label> <"line330"> <label class="wpt-advanced-option"> <"line331"> <input type="checkbox" id="show-interoperable">Include specs with low support but high interoperability <"line332"> <div class="help-text">Include results with \f1\u8805?\f0 70% pass rate in at least two major Web engines, even if WPE scores &&lt;30%div> <"line333"> label> <"line334"> <label class="bcd-advanced-option"> <"line335"> <input type="checkbox" id="show-bcd-supported-in">Show supported-in column <"line336"> <div class="help-text">Show column with info about where a feature is supported.div> <"line337"> label> <"line338"> <label class="bcd-advanced-option">&&nbsp;&&nbsp;&&nbsp;&&nbsp;&&nbsp;Show features supported in <"line339"> <select id="bcd-support-selector" title="Show features supported in"> <"line340"> <option value="Any" selected>Anyoption> <"line341"> <option value="ServiceWorker">ServiceWorkeroption> <"line342"> <option value="SharedWorker">SharedWorkeroption> <"line343"> <option value="Window">Windowoption> <"line344"> <option value="Worker">Workeroption> <"line345"> <option value="WebAssembly">WebAssemblyoption> <"line346"> select> <"line347"> <div class="help-text">Filter the features shown by where those are supported.div> <"line348"> label> <"line349">div> <"line350">details> <"line351"> <"line352"><details id="explanation-text" open> <"line353"> <summary>Explanationsummary> <"line354"> <"line355"><section id="wpt-explanation-panel"> <"line356"><p> <"line357">This data is automatically obtained by running <a href="https://web-platform-tests.org" target="_blank">Web Platform Tests (WPT)a> with WPE. <"line358"> It shows all Web specifications supported or partially supported by WPE <"line359"> <i>(\f1\u8805?\f0 30% WPT pass rate)i>. <"line360">p> <"line361"><p> <"line362">The numbers given below are necessarily a crude measure of support: it's <"line363"> possible to have what looks like a poor score while supporting the main <"line364"> body of a specification and missing a number of tiny edge cases, for <"line365"> example. That said, in general, a specification with a score above 70% <"line366"> can be considered supported; any score between 30% and 70% can be <"line367"> considered partially supported; and any score below 30% indicates <"line368"> limited or almost no support. <"line369">p> <"line370"><p> <"line371">If a score drop over time is observed, then the most likely cause is either <"line372"> flaky tests that fail intermittently, or the addition of new tests in WPT, <"line373"> often reflecting new specification features, rather than a removal of <"line374"> capabilities from WPE WebKit. <"line375">p> <"line376"><p> <"line377">For an alternative view that includes a more detailed list of supported <"line378"> Web APIs, JavaScript features and CSS properties, check the <a href="#" id="bcd-view-link">BCD test resultsa>. <"line379">p> <"line380">Notes: <"line381"><ul> <"line382"><li>These results were obtained using a WPE build with experimental features enabled. <"line383"> Because feature availability can vary by build configuration, certain features shown here may not be present in other WPE builds.li> <"line384"><li>Detailed results of the automated WPT tests for WPE are available at <"line385"> <a id="wpt-link" href="https://wpt.fyi/results/?product=wpewebkit" target="_blank">wpt.fyia>li> <"line386"><li>JavaScript specifications are barely covered here. <"line387"> To explore those, see the results for <i>JavaScriptCorei> at <"line388"> <a href="https://test262.fyi/#|jsc" target="_blank">test262.fyia>li> <"line389">ul> <"line390">section> <"line391"> <"line392"><section id="bcd-explanation-panel" hidden> <"line393"><p> <"line394">This data is automatically obtained by running <a href="https://mdn-bcd-collector.gooborg.com/" target="_blank">mdn-bcd-collectora> tests with WPE. <"line395">It presents Browser Compatibility Data (BCD) for different WPE versions, covering Web technologies, such as Web APIs, JavaScript features, CSS properties and more. <"line396">p> <"line397"><p> <"line398">The list below shows features available in the selected WPE version. It indicates only the presence of each feature, not the level of support. For an alternative view that includes specifications and support scores, refer to <a href="#" id="wpt-view-link">the WPT test resultsa>. <"line399">p> <"line400">Notes: <"line401"><ul> <"line402"><li>These results were obtained using a WPE build with experimental features enabled. <"line403"> Because feature availability can vary by build configuration, certain features shown here may not be present in other WPE builds.li> <"line404">ul> <"line405">section> <"line406"> <"line407">details> <"line408"> <"line409"><table id="results-table" aria-describedby="info-run"> <"line410"> <thead>thead> <"line411"> <tbody>tbody> <"line412">table> <"line413"> <"line414"><script> <"line415">// The json data on wpewebkit.org/wptreport-distilled-data is automatically updated <"line416">// by a cronjob on the server running wptreport-distiller <"line417">// IMPORTANT: WPTReportDistilledBaseURL should be either empty '' or end in slash '/' <"line418">const WPTReportDistilledBaseURL = '{{\field{\*\fldinst{HYPERLINK https://wpewebkit.org/wptreport-distilled-data/ }}{\fldrslt{https://wpewebkit.org/wptreport-distilled-data/\ul0\cf0}}}}\f0\fs22 ' <"line419">const versionsFile = 'versions_available.json' <"line420">const viewType = document.getElementById('viewType'); <"line421">const versionSelect = document.getElementById('version-select'); <"line422">const detailsWPTCheckbox = document.getElementById('show-wpt-details'); <"line423">const unknownCheckbox = document.getElementById('show-unknown'); <"line424">const BCDSupportSelector = document.getElementById('bcd-support-selector'); <"line425">const showBCDSupportColumn = document.getElementById('show-bcd-supported-in'); <"line426">const interoperableCheckbox = document.getElementById('show-interoperable'); <"line427">const tableHead = document.querySelector('#results-table thead'); <"line428">const tableBody = document.querySelector('#results-table tbody'); <"line429">const metaRunDate = document.getElementById('meta-run-date'); <"line430">const metaRunLink = document.getElementById('meta-run-link'); <"line431">const detailsExplanation = document.getElementById("explanation-text"); <"line432">const detailsAdvancedOptions = document.getElementById("advanced-options"); <"line433">const explanationsPanelWPT = document.getElementById('wpt-explanation-panel'); <"line434">const explanationsPanelBCD = document.getElementById('bcd-explanation-panel'); <"line435">const jsonCache = Object.create(null); <"line436">let tableSourceResults; <"line437">let paramsURL; <"line438">let tableSearch; <"line439">let tableCounter; <"line440">let tableRows; <"line441"> <"line442">function clearTable() \{ <"line443"> tableSearch = null; <"line444"> tableCounter = null; <"line445"> tableRows = null; <"line446"> tableHead.innerHTML = ''; <"line447"> tableBody.innerHTML = ''; <"line448">\} <"line449"> <"line450">function refreshURLWithParams(queryStringName, queryStringValue, queryStringDefault) \{ <"line451"> if (queryStringValue === queryStringDefault) <"line452"> paramsURL.delete(queryStringName); <"line453"> else <"line454"> paramsURL.set(queryStringName, queryStringValue); <"line455"> // Update URL without reloading <"line456"> const queryStringFull = paramsURL.toString(); <"line457"> if (queryStringFull) <"line458"> history.pushState(null, '', `$\{window.location.pathname\}?$\{queryStringFull\}`); <"line459"> else <"line460"> history.pushState(null, '', `$\{window.location.pathname\}`); <"line461">\} <"line462"> <"line463">unknownCheckbox.addEventListener('change', (e) => \{ <"line464"> clearTable(); <"line465"> renderTableWPT(); <"line466"> refreshURLWithParams('wu', unknownCheckbox.checked? 1 : 0, 0); <"line467">\}); <"line468">detailsWPTCheckbox.addEventListener('change', (e) => \{ <"line469"> clearTable(); <"line470"> renderTableWPT(); <"line471"> refreshURLWithParams('wd', detailsWPTCheckbox.checked? 1 : 0, 0); <"line472">\}); <"line473">interoperableCheckbox.addEventListener('change', (e) => \{ <"line474"> clearTable(); <"line475"> renderTableWPT(); <"line476"> refreshURLWithParams('wi', interoperableCheckbox.checked? 1 : 0, 0); <"line477">\}); <"line478">BCDSupportSelector.addEventListener('change', (e) => \{ <"line479"> clearTable(); <"line480"> renderTableBCD(); <"line481"> refreshURLWithParams('bs', BCDSupportSelector.value); <"line482">\}); <"line483">showBCDSupportColumn.addEventListener('change', (e) => \{ <"line484"> clearTable(); <"line485"> renderTableBCD(); <"line486"> refreshURLWithParams('bc', showBCDSupportColumn.checked? 1 : 0, 0); <"line487">\}); <"line488">versionSelect.addEventListener('change', (e) => \{ <"line489"> clearTable(); <"line490"> loadData(); <"line491"> refreshURLWithParams('ver', versionSelect.value); <"line492">\}); <"line493"> <"line494">document.getElementById('bcd-view-link').addEventListener('click', function(event) \{ <"line495"> event.preventDefault(); <"line496"> document.querySelector('option[data-view="BCD"]').selected = true; <"line497"> viewType.dispatchEvent(new Event('change')); <"line498">\}); <"line499"> <"line500">document.getElementById('wpt-view-link').addEventListener('click', function(event) \{ <"line501"> event.preventDefault(); <"line502"> document.querySelector('option[data-view="WPT"]').selected = true; <"line503"> viewType.dispatchEvent(new Event('change')); <"line504">\}); <"line505"> <"line506"> <"line507">function getViewName() \{ <"line508"> return viewType[viewType.selectedIndex].dataset.view <"line509">\} <"line510"> <"line511">function updateView() \{ <"line512"> tableSourceResults = getViewName() <"line513"> clearTable(); <"line514"> updateTableSourceResultsView(); <"line515"> refreshURLWithParams('src', tableSourceResults); <"line516">\} <"line517"> <"line518">viewType.onchange = updateView <"line519"> <"line520">detailsExplanation.addEventListener('toggle', () => \{ <"line521"> refreshURLWithParams('de', detailsExplanation.open? 1 : 0, 1); <"line522">\}); <"line523">detailsAdvancedOptions.addEventListener('toggle', () => \{ <"line524"> refreshURLWithParams('da', detailsAdvancedOptions.open? 1 : 0, 0); <"line525">\}); <"line526"> <"line527">// update things also when the back button is pressed <"line528">window.addEventListener('popstate', () => \{ loadAndRenderView(false); \}); <"line529"> <"line530"> <"line531">function toggleExplanationSection() \{ <"line532"> explanationsPanelWPT.hidden = (tableSourceResults !== 'WPT'); <"line533"> explanationsPanelBCD.hidden = (tableSourceResults !== 'BCD'); <"line534">\} <"line535"> <"line536"> <"line537">function updateAdvancedOptions() \{ <"line538"> if (tableSourceResults === "WPT") \{ <"line539"> document.querySelectorAll('.wpt-advanced-option').forEach(el => el.style.removeProperty("display")); <"line540"> document.querySelectorAll('.bcd-advanced-option').forEach(el => el.style.display = 'none'); <"line541"> \} else \{ <"line542"> document.querySelectorAll('.bcd-advanced-option').forEach(el => el.style.removeProperty("display")); <"line543"> document.querySelectorAll('.wpt-advanced-option').forEach(el => el.style.display = 'none') <"line544"> \} <"line545">\} <"line546"> <"line547">function maybeUpdateCheckboxDefValue(checkBoxObject, queryStringName) \{ <"line548"> const valueFromQS = paramsURL.get(queryStringName); <"line549"> checkBoxObject.checked = valueFromQS === '1'; <"line550"> <"line551">\} <"line552"> <"line553">function maybeUpdateSelectDefValue(selectObject, queryStringName) \{ <"line554"> const valueFromQS = paramsURL.get(queryStringName); <"line555"> if (valueFromQS) \{ <"line556"> const optionExists = Array.from(selectObject.options).some(opt => opt.value === valueFromQS); <"line557"> if (optionExists) <"line558"> selectObject.value = valueFromQS; <"line559"> \} else \{ <"line560"> // if no value passed, default to select the first option <"line561"> selectObject.selectedIndex = 0; <"line562"> \} <"line563">\} <"line564"> <"line565">function maybeUpdateDetailsOpenValue(detailsObject, queryStringName, defValue) \{ <"line566"> const valueFromQS = paramsURL.get(queryStringName); <"line567"> detailsObject.open = valueFromQS? valueFromQS === '1' : defValue; <"line568">\} <"line569"> <"line570"> <"line571">function updateOptionsDefaultValues() \{ <"line572"> maybeUpdateCheckboxDefValue(unknownCheckbox, 'wu'); <"line573"> maybeUpdateCheckboxDefValue(detailsWPTCheckbox, 'wd'); <"line574"> maybeUpdateCheckboxDefValue(interoperableCheckbox, 'wi'); <"line575"> maybeUpdateCheckboxDefValue(showBCDSupportColumn, 'bc'); <"line576"> maybeUpdateSelectDefValue(BCDSupportSelector, 'bs'); <"line577"> maybeUpdateDetailsOpenValue(detailsExplanation, 'de', true); <"line578"> maybeUpdateDetailsOpenValue(detailsAdvancedOptions, 'da', false); <"line579"> tableSourceResults = paramsURL.get('src') === 'BCD' ? 'BCD' : 'WPT'; // default view <"line580"> document.querySelector(`option[data-view="$\{tableSourceResults\}"]`).selected = true; <"line581">\} <"line582"> <"line583"> <"line584">// Preloading all the jsons makes the UI much faster when changing views and needs <5MB of RAM <"line585">async function lazyPreloadAllJsons() \{ <"line586"> const shouldAvoidPreload = (navigator.connection &&&& (navigator.connection.saveData || ['slow-2g', '2g', '3g'].includes(navigator.connection.effectiveType))); <"line587"> if (shouldAvoidPreload) <"line588"> return; <"line589"> // preload them in per-version-sets instead all at the same time to minimize network load <"line590"> for (const v of versionsAvailable.versions) \{ <"line591"> const fileList = [v.bcd_results, v.wpt_interoperability, v.wpt_results, v.wpt_specs]; <"line592"> const uniqueJsonURLs = [...new Set(fileList.filter(Boolean).map(filename => WPTReportDistilledBaseURL + filename))]; <"line593"> await jsonFetchCache(uniqueJsonURLs); <"line594"> \} <"line595">\} <"line596"> <"line597">async function loadAndRenderView(firstLoad) \{ <"line598"> clearTable(); <"line599"> paramsURL = new URLSearchParams(window.location.search); <"line600"> updateOptionsDefaultValues(); <"line601"> if (firstLoad) <"line602"> await loadVersionsAvailable(); <"line603"> maybeUpdateSelectDefValue(versionSelect, 'ver'); <"line604"> await updateTableSourceResultsView(); <"line605"> if (firstLoad) \{ <"line606"> if ('requestIdleCallback' in window) \{ <"line607"> requestIdleCallback(() => lazyPreloadAllJsons()); <"line608"> \} else \{ <"line609"> if (document.readyState === 'complete') <"line610"> lazyPreloadAllJsons(); <"line611"> else <"line612"> window.addEventListener('load', () => lazyPreloadAllJsons()); <"line613"> \} <"line614"> \} <"line615">\} <"line616"> <"line617"> <"line618">async function updateTableSourceResultsView() \{ <"line619"> toggleExplanationSection(); <"line620"> updateAdvancedOptions(); <"line621"> return await loadData(); <"line622">\} <"line623"> <"line624">let versionsAvailable = null; <"line625">let specsData = null; <"line626">let resultsData = null; <"line627">let productVersionQueryString = null; <"line628"> <"line629">async function loadVersionsAvailable() \{ <"line630"> [versionsAvailable] = await jsonFetchCache([WPTReportDistilledBaseURL + versionsFile]) <"line631"> const defVersion = versionSelect.value || versionsAvailable.metadata.default_version; <"line632"> versionSelect.innerHTML = ""; <"line633"> if (versionsAvailable &&&& versionsAvailable.versions) \{ <"line634"> versionsAvailable.versions.forEach(v => \{ <"line635"> const option = document.createElement('option'); <"line636"> option.value = v.version; <"line637"> option.textContent = v.version; <"line638"> versionSelect.appendChild(option); <"line639"> \}); <"line640"> const existsVersion = Array.from(versionSelect.options).some(opt => opt.value === defVersion); <"line641"> if (existsVersion) <"line642"> versionSelect.value = defVersion; <"line643"> \} else \{ <"line644"> const option = document.createElement('option'); <"line645"> option.disabled = true; <"line646"> option.textContent = "Error loading versions"; <"line647"> versionSelect.appendChild(option); <"line648"> \} <"line649">\} <"line650"> <"line651">async function loadData() \{ <"line652"> if (!versionsAvailable) <"line653"> return; <"line654"> if (tableSourceResults === "WPT") <"line655"> return await loadWPTData(); <"line656"> return await loadBCDData(); <"line657">\} <"line658"> <"line659"> <"line660">function updateRunInfo(resultsData, version) \{ <"line661"> let browserVersion; <"line662"> browserVersion = version === "nightly" ? (resultsData.metadata.browser_version || version) : (resultsData.metadata.browser_version?.split('.').slice(0, 2).join('.') || version); <"line663"> if (tableSourceResults === "WPT") \{ <"line664"> // We can't pass the version for the nightlies until {{\field{\*\fldinst{HYPERLINK https://github.com/web-platform-tests/wpt.fyi/pull/4398 }}{\fldrslt{https://github.com/web-platform-tests/wpt.fyi/pull/4398\ul0\cf0}}}}\f0\fs22 gets fixed <"line665"> // But it should work fine anyway because is not expected to find more than one nightly/experimental run per WPT commit <"line666"> productVersionQueryString = version === "nightly" ? `sha=$\{resultsData.metadata.wpt_version\}&&label=experimental&&product=wpewebkit` : `sha=$\{resultsData.metadata.wpt_version\}&&label=stable&&product=wpewebkit-$\{resultsData.metadata.browser_version\}`; <"line667"> document.getElementById('wpt-link').href = `https://wpt.fyi/results/?$\{productVersionQueryString\}`; <"line668"> // short to 7 chars because its the same short-sha length used on wpt.fyi <"line669"> const wptShaShort = resultsData.metadata.wpt_version.slice(0, 7) || '\f2\emdash '; <"line670"> metaRunLink.textContent = `test run using WPT $\{wptShaShort\} and WPE $\{browserVersion\}`; <"line671"> metaRunLink.href = `https://wpt.fyi/results/?$\{productVersionQueryString\}`; <"line672"> \} else \{ <"line673"> metaRunLink.textContent = `test run using BCD v$\{resultsData.metadata.mdn_bcd_collector_version\} and WPE $\{browserVersion\}`; <"line674"> metaRunLink.href = `https://mdn-bcd-collector.gooborg.com/changelog`; <"line675"> \} <"line676"> metaRunDate.textContent = new Date(resultsData.metadata.testrun_timestamp_end * 1000).toISOString().slice(0, 10) || '\emdash '; <"line677">\} <"line678"> <"line679"> <"line680">async function jsonFetchCache(urls) \{ <"line681"> const results = await Promise.all(urls.map(async (url) =\f0\lang1033 >\f2 \{ <"line682"> const cached = jsonCache[url]; <"line683"> if (cached) <"line684"> return cached; <"line685"> const fetchPromise = fetch(url) <"line686"> .then(res =\f0\lang1033 >\f2 \{ <"line687"> if (!res.ok) <"line688"> throw new Error(`Failed to fetch $\{url\}: $\{res.status\}`); <"line689"> return res.json(); <"line690"> \}) <"line691"> .catch(err =\f0\lang1033 >\f2 \{ <"line692"> delete jsonCache[url]; // allow retry <"line693"> throw err; <"line694"> \}); <"line695"> jsonCache[url] = fetchPromise; <"line696"> const data = await fetchPromise; <"line697"> jsonCache[url] = data; <"line698"> return data; <"line699"> \})); <"line700"> return results; <"line701">\} <"line702"> <"line703"> <"line704">async function loadBCDData() \{ <"line705"> const version = versionSelect.value; <"line706"> const selected = versionsAvailable.versions.find(v =\f0\lang1033 >\f2 v.version === version); <"line707"> const currentResultsUrl = WPTReportDistilledBaseURL + selected.bcd_results; <"line708"> [resultsData] = await jsonFetchCache([currentResultsUrl]); <"line709"> updateRunInfo(resultsData, version); <"line710"> renderTableBCD(); <"line711">\} <"line712"> <"line713">async function loadWPTData() \{ <"line714"> const version = versionSelect.value; <"line715"> const selected = versionsAvailable.versions.find(v =\f0\lang1033 >\f2 v.version === version); <"line716"> const currentSpecUrl = WPTReportDistilledBaseURL + selected.wpt_specs; <"line717"> const currentResultsUrl = WPTReportDistilledBaseURL + selected.wpt_results; <"line718"> const currentResultsEnginesUrl = WPTReportDistilledBaseURL + selected.wpt_interoperability; <"line719"> [specsData, resultsData, resultsEnginesData] = await jsonFetchCache([currentSpecUrl, currentResultsUrl, currentResultsEnginesUrl]) <"line720"> updateRunInfo(resultsData, version); <"line721"> renderTableWPT(); <"line722">\} <"line723"> <"line724"> <"line725">function calculatePercentage(pass, total) \{ <"line726"> return total \f0\lang1033 >\f2 0 ? Math.round(1000 * pass / total) / 10 : 0; <"line727">\} <"line728"> <"line729">function getSubtestsMaintests(testStr) \{ <"line730"> const [subtestsStr, maintestsStr] = testStr.split(':'); <"line731"> const [subtestPass, subtestTotal] = subtestsStr.split('/'); <"line732"> const [maintestsPass, maintestsTotal] = maintestsStr.split('/'); <"line733"> return [ <"line734"> parseInt(subtestPass, 10), <"line735"> parseInt(subtestTotal, 10), <"line736"> parseFloat(maintestsPass), <"line737"> parseInt(maintestsTotal, 10) <"line738"> ]; <"line739">\} <"line740"> <"line741"> <"line742">function runSearchFilter() \{ <"line743"> if (!tableSearch) <"line744"> return; <"line745"> const inputFilter = tableSearch.value.trim(); <"line746"> if (!inputFilter) \{ <"line747"> for (const row of tableRows) \{ <"line748"> const firstCell = row.cells[0]; <"line749"> if (!firstCell) <"line750"> continue; <"line751"> firstCell.querySelectorAll('mark').forEach(m =\f0\lang1033 >\f2 <"line752"> m.replaceWith(document.createTextNode(m.textContent)) <"line753"> ); <"line754"> row.hidden = false; <"line755"> \} <"line756"> tableSearch.classList.remove('filter-input-notfound'); <"line757"> tableCounter.textContent = ` ($\{tableRows.length\})`; <"line758"> return; <"line759"> \} <"line760"> // sort by substring length, so with "he" and "hello" in "hello word" it matches "hello". <"line761"> const filterWords = [...new Set(inputFilter.toLowerCase().split(/\\s+/).filter(Boolean))].sort((a, b) =\f0\lang1033 >\f2 b.length - a.length); <"line762"> const regexPattern = filterWords.map(w =\f0\lang1033 >\f2 w.replace(/[.*+?^$\{\}()|[\\]\\\\]/g, '{{\field{\*\fldinst{HYPERLINK "\\\\\\\\$&&')).join('|"}}{\fldrslt{\\\\$&&')).join('|\ul0\cf0}}}}\f2\fs22 '); <"line763"> const regex = new RegExp(regexPattern, 'gi'); <"line764"> let visibleRows = 0; <"line765"> for (const row of tableRows) \{ <"line766"> const firstCell = row.cells[0]; <"line767"> if (!firstCell) <"line768"> continue; <"line769"> const originalText = firstCell.textContent; <"line770"> const originalTextLower = originalText.toLowerCase(); <"line771"> const allFilterWordsMatch = filterWords.every(w =\f0\lang1033 >\f2 originalTextLower.includes(w)); <"line772"> if (!allFilterWordsMatch) \{ <"line773"> row.hidden = true; <"line774"> continue; <"line775"> \} <"line776"> visibleRows++; <"line777"> row.hidden = false; <"line778"> const targetElement = firstCell.querySelector('a') || firstCell; <"line779"> targetElement.innerHTML = originalText.replace(regex, '\f0\lang1033 <\f2 mark\f0\lang1033 >\f2 $&&\f0\lang1033 <\f2 /mark\f0\lang1033 >\f2 '); <"line780"> \} <"line781"> tableSearch.classList.toggle("filter-input-notfound", !visibleRows); <"line782"> tableCounter.textContent = ` ($\{visibleRows\})`; <"line783">\} <"line784"> <"line785"> <"line786">function createThWithSearch(thText) \{ <"line787"> const th = document.createElement("th"); <"line788"> const thWrapper = document.createElement("div"); <"line789"> thWrapper.style.display = "flex"; <"line790"> thWrapper.style.justifyContent = "space-between"; <"line791"> thWrapper.style.alignItems = "center"; <"line792"> thWrapper.style.width = "100%"; <"line793"> <"line794"> const labelWrapper = document.createElement("span"); <"line795"> const label = document.createElement("span"); <"line796"> label.id = "th-search-text-content"; <"line797"> label.textContent = thText; <"line798"> tableCounter = document.createElement("span"); <"line799"> tableCounter.id = "th-search-counter"; <"line800"> tableCounter.textContent = '(0)'; <"line801"> labelWrapper.appendChild(label); <"line802"> labelWrapper.appendChild(tableCounter); <"line803"> <"line804"> tableSearch = document.createElement("input"); <"line805"> tableSearch.type = "text"; <"line806"> tableSearch.id = "tableSearch"; <"line807"> tableSearch.placeholder = "Filter..."; <"line808"> tableSearch.style.maxWidth = "15ch"; <"line809"> <"line810"> let searchTimeout; <"line811"> tableSearch.addEventListener("input", function () \{ <"line812"> clearTimeout(searchTimeout); <"line813"> searchTimeout = setTimeout(runSearchFilter, 250); <"line814"> \}); <"line815"> <"line816"> thWrapper.appendChild(labelWrapper); <"line817"> thWrapper.appendChild(tableSearch); <"line818"> th.appendChild(thWrapper); <"line819"> return th; <"line820">\} <"line821"> <"line822"> <"line823">function renderTableBCD() \{ <"line824"> let total_specs = 0; <"line825"> const headRow = document.createElement('tr'); <"line826"> const thSearch = createThWithSearch('Features'); <"line827"> headRow.appendChild(thSearch); <"line828"> const showSupportColumn = showBCDSupportColumn.checked; <"line829"> if (showSupportColumn) \{ <"line830"> const thSupport = document.createElement('th'); <"line831"> thSupport.textContent = 'Supported in'; <"line832"> headRow.appendChild(thSupport); <"line833"> \} <"line834"> tableHead.appendChild(headRow); <"line835"> <"line836"> const selectorValue = BCDSupportSelector.value; <"line837"> const isAnySelector = selectorValue === "Any"; <"line838"> <"line839"> // Process test results <"line840"> for (const testName in resultsData.results) \{ <"line841"> const \{ link: linkUrl, pass: passList = [] \} = resultsData.results[testName]; <"line842"> if (isAnySelector || passList.includes(selectorValue)) \{ <"line843"> const row = document.createElement('tr'); <"line844"> const tdSpec = document.createElement('td'); <"line845"> if (linkUrl) \{ <"line846"> const a = document.createElement('a'); <"line847"> a.href = linkUrl; <"line848"> a.target = '_blank'; <"line849"> a.textContent = testName; <"line850"> tdSpec.appendChild(a); <"line851"> \} else \{ <"line852"> tdSpec.textContent = testName; <"line853"> \} <"line854"> row.appendChild(tdSpec); <"line855"> if (showSupportColumn) \{ <"line856"> const tdSupport = document.createElement('td'); <"line857"> tdSupport.textContent = passList.sort().join(', '); <"line858"> row.appendChild(tdSupport); <"line859"> \} <"line860"> <"line861"> tableBody.appendChild(row); <"line862"> total_specs++; <"line863"> \} <"line864"> \} <"line865"> document.getElementById('th-search-text-content').textContent = 'Features'; <"line866"> tableCounter.textContent = ` ($\{total_specs\})`; <"line867"> tableRows = document.querySelectorAll("#results-table tbody tr"); <"line868">\} // end renderTableBCD() <"line869"> <"line870"> <"line871">function renderTableWPT() \{ <"line872"> const showDetailsWPT = detailsWPTCheckbox.checked; <"line873"> const showUnknown = unknownCheckbox.checked; <"line874"> const showInteroperable = interoperableCheckbox.checked; <"line875"> let total_specs = 0; <"line876"> <"line877"> const headers = []; <"line878"> const headRow = document.createElement('tr'); <"line879"> const thSearch = createThWithSearch('Specifications'); <"line880"> headRow.appendChild(thSearch); <"line881"> headers.push('Passrate% (subtests)'); <"line882"> if (showDetailsWPT) \{ <"line883"> headers.push('Subtest counts'); <"line884"> headers.push('WPT Directory'); <"line885"> \} <"line886"> headers.forEach(h =\f0\lang1033 >\f2 \{ <"line887"> const th = document.createElement('th'); <"line888"> th.textContent = h; <"line889"> headRow.appendChild(th); <"line890"> \}); <"line891"> tableHead.appendChild(headRow); <"line892"> <"line893"> // start for-loop drawing the rows <"line894"> for (const [dir, value] of Object.entries(resultsData.results)) \{ <"line895"> <"line896"> const [subTestsPass, subTestsTotal, mainTestsPass, mainTestsTotal] = getSubtestsMaintests(value); <"line897"> let percent = calculatePercentage(subTestsPass, subTestsTotal); <"line898"> let spec = specsData.specs.find(s =\f0\lang1033 >\f2 s.dirw === dir); <"line899"> let specText = spec ? spec.text : undefined; <"line900"> let specLink = spec ? spec.link : undefined; <"line901"> <"line902"> if (!showUnknown &&&& !specText) <"line903"> continue; <"line904"> <"line905"> // calculate interoperable specs and skip non-interoperable unless the selected browser supports them <"line906"> let engines; <"line907"> let enginePassrateList; <"line908"> <"line909"> engines = resultsEnginesData.results_engines || \{\}; <"line910"> enginePassrateList = Object.entries(engines).map(([engine, engineResults]) =\f0\lang1033 >\f2 \{ <"line911"> const str = engineResults[dir]; <"line912"> if (!str) return null; <"line913"> const [engineSubTestsPass, engineSubTestsTotal, engineMainTestsPass, engineMainTestsTotal] = getSubtestsMaintests(str); <"line914"> const rate = calculatePercentage(engineSubTestsPass, engineSubTestsTotal); <"line915"> // console.log(`ENGINE: $\{engine\}, DIR: $\{dir\}, STRING: $\{str\}, RATE: $\{rate\}`); <"line916"> return \{ <"line917"> engine, <"line918"> rate <"line919"> \}; <"line920"> \}).filter(r =\f0\lang1033 >\f2 r !== null); <"line921"> <"line922"> // for clarity only render specs supported or interoperable <"line923"> const numberSupportedEngines = enginePassrateList.filter(r =\f0\lang1033 >\f2 r.rate \f0\lang1033 >\f2 = 70).length; <"line924"> if (enginePassrateList.length === 3) \{ <"line925"> if (numberSupportedEngines \f0\lang1033 <\f2 2) \{ <"line926"> // non-interoperable: render only if browser supports it <"line927"> if (percent \f0\lang1033 <\f2 30) \{ <"line928"> // console.log(`SKIP non-interoperable: $\{specText\}`); <"line929"> continue; <"line930"> \} <"line931"> \} else \{ <"line932"> // interoperable: render if browser supports it, or if showInteroperable button checked <"line933"> if (percent \f0\lang1033 <\f2 30 &&&& !showInteroperable) \{ <"line934"> // console.log(`SKIP interoperable: $\{specText\}`); <"line935"> continue; <"line936"> \} <"line937"> \} <"line938"> \} else if (enginePassrateList.length === 0) \{ <"line939"> console.log(`WARNING: We have no data of web-engines pass-rate for spec $\{dir\}. Likely new spec. Ignoring it`) <"line940"> continue; <"line941"> \} else \{ <"line942"> console.error(`ERROR: Number of engines is not 3 but $\{enginePassrateList.length\} for spec $\{dir\}!!!`); <"line943"> throw new Error("Number of Web engines is not 3!!!"); <"line944"> \} <"line945"> <"line946"> const row = document.createElement('tr'); <"line947"> const tdSpec = document.createElement('td'); <"line948"> if (specText) \{ <"line949"> const a = document.createElement('a'); <"line950"> a.href = specLink; <"line951"> a.target = '_blank'; <"line952"> a.textContent = specText; <"line953"> tdSpec.appendChild(a); <"line954"> \} else \{ <"line955"> tdSpec.textContent = dir; <"line956"> \} <"line957"> row.appendChild(tdSpec); <"line958"> const tdRate = document.createElement('td'); <"line959"> tdRate.textContent = new Intl.NumberFormat(navigator.language).format(percent) + '%' <"line960"> if (!showDetailsWPT) \{ <"line961"> let smallnote = document.createElement('small'); <"line962"> smallnote.textContent = ` (of $\{new Intl.NumberFormat(navigator.language).format(subTestsTotal)\})`; <"line963"> tdRate.appendChild(smallnote); <"line964"> \} <"line965"> tdRate.classList.add('barred'); <"line966"> tdRate.style.setProperty('--dataPct', percent + '%'); <"line967"> tdRate.style.setProperty('--dataHue', percent + 'deg'); <"line968"> row.appendChild(tdRate); <"line969"> <"line970"> if (showDetailsWPT) \{ <"line971"> const tdInfo = document.createElement('td'); <"line972"> tdInfo.textContent = `$\{subTestsPass\}/$\{subTestsTotal\} pass ($\{mainTestsTotal\} tests)`; <"line973"> row.appendChild(tdInfo); <"line974"> const tdDir = document.createElement('td'); <"line975"> let testLink = document.createElement('a'); <"line976"> testLink.href = `https://wpt.fyi/results/$\{dir\}?$\{productVersionQueryString\}`; <"line977"> testLink.target = '_blank'; <"line978"> testLink.textContent = dir; <"line979"> tdDir.appendChild(testLink); <"line980"> row.appendChild(tdDir); <"line981"> \} <"line982"> <"line983"> tableBody.appendChild(row); <"line984"> total_specs += 1; <"line985"> \} // end for-loop drawing the rows <"line986"> <"line987"> tableHead.querySelectorAll('th')[1].textContent = showDetailsWPT? 'Passrate%' : 'Passrate% (subtests)'; <"line988"> document.getElementById('th-search-text-content').textContent = 'Specifications'; <"line989"> tableCounter.textContent = ` ($\{total_specs\})`; <"line990"> tableRows = document.querySelectorAll("#results-table tbody tr"); <"line991">\} // end renderTable() <"line992"> <"line993">loadAndRenderView(true); <"line994">\f0\lang1033 <\f2 /script\f0\lang1033 >\f2 <"line995"> <"line996"> \f0\lang1033 <\f2 div class="survey"\f0\lang1033 >\f2 <"line997"> \f0\lang1033 <\f2 p\f0\lang1033 >\f2 <"line998"> If you\rquote re using WPE WebKit, or are considering doing so, \f0\lang1033 <\f2 strong\f0\lang1033 >\f2 \f0\lang1033 <\f2 a href="https://docs.google.com/forms/d/e/1FAIpQLSchPgMGzuVc9ry5bdxF2uFnW2q3FcrSSqxJdOM4Fd2BD4s7dg/viewform?usp=pp_url&&amp;entry.1179679285=WPEWebKit.org+website"\f0\lang1033 >\f2 please take our brief user survey\f0\lang1033 <\f2 /a\f0\lang1033 >\f2 \f0\lang1033 <\f2 /strong\f0\lang1033 >\f2 . Your input will help us make WPE WebKit better for you! <"line999"> \f0\lang1033 <\f2 /p\f0\lang1033 >\f2 <"line1000"> \f0\lang1033 <\f2 /div\f0\lang1033 >\f2 <"line1001"> \f0\lang1033 <\f2 style\f0\lang1033 >\f2 <"line1002"> .survey \{ <"line1003"> position: relative; <"line1004"> padding-block: 2em 3em; <"line1005"> margin-block: 3em 0; <"line1006"> --bgrad: linear-gradient(180deg,#00C6 0.25em,#00B4 20%,40%,#00B2); <"line1007"> background: var(--bgrad); <"line1008"> border-image: var(--bgrad) 1; <"line1009"> border-image-outset: 0 50vmax; <"line1010"> border-image-width: 0 50vmax; <"line1011"> font-size: 1.25em; <"line1012"> \} <"line1013"> .survey::before \{ <"line1014"> content: url(/assets/img/survey.svg); <"line1015"> position: absolute; <"line1016"> top: -1.5em; <"line1017"> left: 0; <"line1018"> right: 0; <"line1019"> margin-inline: auto; <"line1020"> height: 3em; <"line1021"> width: auto; <"line1022"> aspect-ratio: 1/1; <"line1023"> filter: drop-shadow(0.25em 0.33em 0.33em #0006); <"line1024"> \} <"line1025"> .survey p \{ <"line1026"> padding-inline: 1em; <"line1027"> \} <"line1028"> \f0\lang1033 <\f2 /style\f0\lang1033 >\f2 <"line1029"> <"line1030"> \f0\lang1033 <\f2 /main\f0\lang1033 >\f2 <"line1031"> <"line1032"> \f0\lang1033 <\f2 dialog id="splash"\f0\lang1033 >\f2 <"line1033">\f0\lang1033 <\f2 p\f0\lang1033 >\f2 If you\rquote re using WPE WebKit, or are considering doing so, \f0\lang1033 <\f2 strong\f0\lang1033 >\f2 please take our brief user survey!\f0\lang1033 <\f2 /strong\f0\lang1033 >\f2 Your input will help us make WPE WebKit better for you.\f0\lang1033 <\f2 /p\f0\lang1033 >\f2 <"line1034">\f0\lang1033 <\f2 div\f0\lang1033 >\f2 <"line1035">\f0\lang1033 <\f2 button is="dis-misser" id="dismiss-Y"\f0\lang1033 >\f2 Yes\f0\lang1033 <\f2 /button\f0\lang1033 >\f2 <"line1036">\f0\lang1033 <\f2 button is="dis-misser" id="dismiss-L"\f0\lang1033 >\f2 Ask again later\f0\lang1033 <\f2 /button\f0\lang1033 >\f2 <"line1037">\f0\lang1033 <\f2 button is="dis-misser" id="dismiss-N"\f0\lang1033 >\f2 No\f0\lang1033 <\f2 /button\f0\lang1033 >\f2 <"line1038">\f0\lang1033 <\f2 /div\f0\lang1033 >\f2 <"line1039">\f0\lang1033 <\f2 /dialog\f0\lang1033 >\f2 <"line1040">\f0\lang1033 <\f2 style\f0\lang1033 >\f2 <"line1041">#splash \{max-width: 50%; border-radius: 1em; padding-inline: 2em; outline: 50vmax solid #141316D0; background: #EEE;\} <"line1042">#splash p \{font-size: 1.25em; color: inherit;\} <"line1043">#splash img \{max-width: 60vw; max-height: 50vh; aspect-ratio: 1.88/1;\} <"line1044">@media (max-width: 600px) \{ <"line1045">\tab #splash img \{object-fit: contain; object-position: 100% 100%;\} <"line1046">\} <"line1047">#splash div \{margin-block: 1em 1.5em; text-align: center; display: flex; gap: 1em; justify-content: center;\} <"line1048">#splash button \{font-size: 1.33em; border-radius: 1em; padding-inline: 0.75em; padding-block: 0.2em; border: 0; background: #888; color: #EEE; cursor: pointer;\} <"line1049">#splash button:focus \{outline: 0.25em solid black;\} <"line1050">#splash button#dismiss-Y \{background: hsl(205deg 84.8% 50%);\} <"line1051">#splash button#dismiss-L \{background: hsl(102.5deg 15.2% 50%);\} <"line1052">#splash button#dismiss-N \{background: hsl(0deg 84.8% 50%);\} <"line1053">\f0\lang1033 <\f2 /style\f0\lang1033 >\f2 <"line1054">\f0\lang1033 <\f2 footer class="global"\f0\lang1033 >\f2 <"line1055">\tab \f0\lang1033 <\f2 b\f0\lang1033 >\f2 \f0\lang1033 <\f2 /b\f0\lang1033 >\f2 <"line1056">\tab \f0\lang1033 <\f2 div\f0\lang1033 >\f2 <"line1057">\tab \f0\lang1033 <\f2 a href="/" class="igalia logo home"\f0\lang1033 >\f2 \f0\lang1033 <\f2 img src="/assets/img/logo-white.svg" alt="WPE"\f0\lang1033 >\f2 \f0\lang1033 <\f2 /a\f0\lang1033 >\f2 <"line1058">\tab \f0\lang1033 <\f2 ul\f0\lang1033 >\f2 <"line1059">\tab \f0\lang1033 <\f2 li\f0\lang1033 >\f2 Connect on \f0\lang1033 <\f2 a rel="me" href="https://floss.social/@WPEWebKit"\f0\lang1033 >\f2 Mastodon\f0\lang1033 <\f2 /a\f0\lang1033 >\f2 , \f0\lang1033 <\f2 a href="https://bsky.app/profile/wpewebkit.org"\f0\lang1033 >\f2 Bluesky\f0\lang1033 <\f2 /a\f0\lang1033 >\f2 \f0\lang1033 <\f2 /li\f0\lang1033 >\f2 <"line1060">\tab \f0\lang1033 <\f2 li\f0\lang1033 >\f2 mailing list: \f0\lang1033 <\f2 a href="https://lists.webkit.org/mailman3/lists/webkit-wpe.lists.webkit.org/"\f0\lang1033 >\f2 webkit-wpe\f0\lang1033 <\f2 /a\f0\lang1033 >\f2 \f0\lang1033 <\f2 /li\f0\lang1033 >\f2 <"line1061">\tab \f0\lang1033 <\f2 li\f0\lang1033 >\f2 OFTC: \f0\lang1033 <\f2 a href="https://webchat.oftc.net/?channels=wpe"\f0\lang1033 >\f2 #wpe\f0\lang1033 <\f2 /a\f0\lang1033 >\f2 \f0\lang1033 <\f2 /li\f0\lang1033 >\f2 <"line1062">\tab \f0\lang1033 <\f2 li\f0\lang1033 >\f2 Matrix: \f0\lang1033 <\f2 a href="https://matrix.to/#/#wpe:matrix.org"\f0\lang1033 >\f2 #wpe:matrix.org\f0\lang1033 <\f2 /a\f0\lang1033 >\f2 \f0\lang1033 <\f2 /li\f0\lang1033 >\f2 <"line1063">\tab \f0\lang1033 <\f2 /ul\f0\lang1033 >\f2 <"line1064">\tab \f0\lang1033 <\f2 ul\f0\lang1033 >\f2 <"line1065">\tab \f0\lang1033 <\f2 li\f0\lang1033 >\f2 Copyright &&copy; 2018-2025 The WPE WebKit Team.\f0\lang1033 <\f2 /li\f0\lang1033 >\f2 <"line1066">\tab \f0\lang1033 <\f2 li\f0\lang1033 >\f2 Hosting kindly provided by \f0\lang1033 <\f2 a href="https://www.igalia.com"\f0\lang1033 >\f2 Igalia\f0\lang1033 <\f2 /a\f0\lang1033 >\f2 .\f0\lang1033 <\f2 /li\f0\lang1033 >\f2 <"line1067">\tab \f0\lang1033 <\f2 li\f0\lang1033 >\f2 \f0\lang1033 <\f2 a href="/sitemap/"\f0\lang1033 >\f2 Site map\f0\lang1033 <\f2 /a\f0\lang1033 >\f2 .\f0\lang1033 <\f2 /li\f0\lang1033 >\f2 <"line1068">\tab \f0\lang1033 <\f2 /ul\f0\lang1033 >\f2 <"line1069">\tab \f0\lang1033 <\f2 /div\f0\lang1033 >\f2 <"line1070">\f0\lang1033 <\f2 /footer\f0\lang1033 >\f2 <"line1071">\f0\lang1033 <\f2 script\f0\lang1033 >\f2 <"line1072">let storedInfo = \{\}; <"line1073">const flagName = 'survey-splash'; <"line1074"> <"line1075">function startup(flagName) \{ <"line1076">\tab if (!flagName) \{ <"line1077">\tab console.error('Missing flagName'); <"line1078">\tab return; <"line1079">\tab\} <"line1080">\tab if (storageAvailable("localStorage")) \{ <"line1081">\tab let currentTime = Date.now(); <"line1082">\tab let timeOut = 1; <"line1083">\tab timeOut *= 86400 * 1000; <"line1084">\tab let localStore = localStorage.getItem(flagName); <"line1085">\tab if (!localStore) \{ <"line1086">\tab storedInfo = \{ <"line1087">\tab 'status': null, <"line1088">\tab 'datetime': currentTime, <"line1089">\tab 'pageloads' : 0 <"line1090">\tab\} <"line1091">\tab\} else \{ <"line1092">\tab storedInfo = JSON.parse(localStore); <"line1093">\tab\} <"line1094">\tab storedInfo.pageloads++; <"line1095">\tab localStorage.setItem(flagName, JSON.stringify(storedInfo)); <"line1096"> <"line1097">\tab if (storedInfo.pageloads \f0\lang1033 <\f2 11) return; <"line1098">\tab if (storedInfo.status == "Y" || storedInfo.status == "N") return; <"line1099">\tab if (storedInfo.status &&&& currentTime - storedInfo.datetime \f0\lang1033 <\f2 timeOut) return; <"line1100"> <"line1101">\tab splash.showModal(); <"line1102">\tab storedInfo.datetime = currentTime; <"line1103">\tab\} <"line1104">\} <"line1105"> <"line1106">function storageAvailable(type) \{ <"line1107">\tab // {{\field{\*\fldinst{HYPERLINK https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API }}{\fldrslt{https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API\ul0\cf0}}}}\f2\fs22 <"line1108"> let storage; <"line1109"> try \{ <"line1110"> storage = window[type]; <"line1111"> const x = "__storage_test__"; <"line1112"> storage.setItem(x, x); <"line1113"> storage.removeItem(x); <"line1114"> return true; <"line1115"> \} catch (e) \{ <"line1116"> return ( <"line1117"> e instanceof DOMException &&&& <"line1118"> // everything except Firefox <"line1119"> (e.code === 22 || <"line1120"> // Firefox <"line1121"> e.code === 1014 || <"line1122"> // test name field too, because code might not be present <"line1123"> // everything except Firefox <"line1124"> e.name === "QuotaExceededError" || <"line1125"> // Firefox <"line1126"> e.name === "NS_ERROR_DOM_QUOTA_REACHED") &&&& <"line1127"> // acknowledge QuotaExceededError only if there's something already stored <"line1128"> storage &&&& <"line1129"> storage.length !== 0 <"line1130"> ); <"line1131"> \} <"line1132">\} <"line1133"> <"line1134">function surveyRedirect() \{ <"line1135">\tab let surveyURL = "{{\field{\*\fldinst{HYPERLINK https://docs.google.com/forms/d/e/1FAIpQLSchPgMGzuVc9ry5bdxF2uFnW2q3FcrSSqxJdOM4Fd2BD4s7dg/viewform?usp=pp_url&&entry.1179679285=WPEWebKit.org+website }}{\fldrslt{https://docs.google.com/forms/d/e/1FAIpQLSchPgMGzuVc9ry5bdxF2uFnW2q3FcrSSqxJdOM4Fd2BD4s7dg/viewform?usp=pp_url&&entry.1179679285=WPEWebKit.org+website\ul0\cf0}}}}\f2\fs22 "; <"line1136">\tab if (surveyURL) window.location = surveyURL; <"line1137">\} <"line1138"> <"line1139">document.querySelectorAll('button[is="dis-misser"]').forEach(el =\f0\lang1033 >\f2 \{ <"line1140">\tab el.addEventListener("click", () =\f0\lang1033 >\f2 \{ <"line1141">\tab splash.close(); <"line1142">\tab storedInfo.status = el.getAttribute('id').replace('dismiss-',''); <"line1143">\tab console.log(storedInfo); <"line1144">\tab localStorage.setItem(flagName, JSON.stringify(storedInfo)); <"line1145">\tab if (storedInfo.status == "Y") surveyRedirect(); <"line1146">\tab\}); <"line1147">\}); <"line1148"> <"line1149">window.onload = startup(flagName); <"line1150">\f0\lang1033 <\f2 /script\f0\lang1033 >\f2 <"line1151"> <"line1152"> <"line1153"> \f0\lang1033 <\f2 /body\f0\lang1033 >\f2 <"line1154">\f0\lang1033 <\f2 /html\f0\lang1033 >\f2 <"line1155">\f0\lang9\par +} + \ No newline at end of file diff --git a/Document.txt b/Document.txt new file mode 100644 index 0000000..b8a52ad --- /dev/null +++ b/Document.txt @@ -0,0 +1,25643 @@ +https://pr-preview.s3.amazonaws.com/w3c/performance-timeline/204/925ae5e...e1b67dc.html#dom-performanceobserver-takerecords + + + + + + + + + + + +Performance Timeline + + + + + + + + + + + + + +
+

+ +

+

+Performance +Timeline +Level +2 + +

+

+ +W3C +Editor's +Draft + + +

+
+ +More +details +about +this +document + +
+
+This +version: +
+ +https://w3c.github.io/performance-timeline/ + +
+
+Latest +published +version: +
+ +https://www.w3.org/TR/performance-timeline/ + +
+
+Latest +editor's +draft: +
+ +https://w3c.github.io/performance-timeline/ + +
+
+History: +
+ +https://www.w3.org/standards/history/performance-timeline +
+ +Commit +history + +
+
+Test +suite: +
+ +https://github.com/web-platform-tests/wpt/tree/master/performance-timeline + +
+
+Editor: +
+ +Nicols +Pea +Moreno + +( + +Google + +) +
+
+Former +editors: +
+ +Ilya +Grigorik + +( + +Google + +) +
+ +( + +Microsoft +Corp. + +) +(Until +November +2014) +
+ +Zhiheng +Wang + +( + +Google + +) +(Until +July +2013) +
+
+Feedback: +
+ +GitHub +w3c/performance-timeline + +( + +pull +requests +, + +new +issue +, + +open +issues + +) +
+
+
+ +
+
+
+

+Abstract +

+

+This +specification +extends +the +High +Resolution +Time +specification +[ + + +HR-TIME-3 + + +] +by +providing +methods +to +store +and +retrieve +high +resolution +performance +metric +data. +

+
+
+

+Status +of +This +Document +

+
+ +This +is +a +preview + +

+Do +not +attempt +to +implement +this +version +of +the +specification. +Do +not +reference +this +version +as +authoritative +in +any +way. +Instead, +see + +https://w3c.github.io/performance-timeline/ + +for +the +Editor's +draft. +

+
+

+ +This +section +describes +the +status +of +this +document +at +the +time +of +its +publication. +A +list +of +current + +W3C + +publications +and +the +latest +revision +of +this +technical +report +can +be +found +in +the + + +W3C + +technical +reports +index + +at +https://www.w3.org/TR/. + +

+

+This + +Performance +Timeline +Level +2 + +specification + +replaces +the +first +version +of +[ + + +PERFORMANCE-TIMELINE + + +] +and +includes: +

+ +

+This +document +was +published +by +the + +Web +Performance +Working +Group + +as +an +Editor's +Draft. +

+Publication +as +an +Editor's +Draft +does +not +imply +endorsement +by + +W3C + +and +its +Members. +

+This +is +a +draft +document +and +may +be +updated, +replaced +or +obsoleted +by +other +documents +at +any +time. +It +is +inappropriate +to +cite +this +document +as +other +than +work +in +progress. +

+This +document +was +produced +by +a +group +operating +under +the + + +W3C + +Patent +Policy +. + +W3C + +maintains +a + +public +list +of +any +patent +disclosures + +made +in +connection +with +the +deliverables +of +the +group; +that +page +also +includes +instructions +for +disclosing +a +patent. +An +individual +who +has +actual +knowledge +of +a +patent +which +the +individual +believes +contains + +Essential +Claim(s) + +must +disclose +the +information +in +accordance +with + +section +6 +of +the + +W3C + +Patent +Policy +. +

+This +document +is +governed +by +the + +2 +November +2021 + +W3C + +Process +Document +. +

+ +
+
+

+ +1. + +Introduction +

+ + +
+

+ +This +section +is +non-normative. + +

+

+Accurately +measuring +performance +characteristics +of +web +applications +is +an +important +aspect +of +making +web +applications +faster. +This +specification +defines +the +necessary + +Performance +Timeline + +primitives +that +enable +web +developers +to +access, +instrument, +and +retrieve +various +performance +metrics +from +the +full +lifecycle +of +a +web +application. +

+

+[ + + +NAVIGATION-TIMING-2 + + +], +[ + + +RESOURCE-TIMING-2 + + +], +and +[ + + +USER-TIMING-2 + + +] +are +examples +of +specifications +that +define +timing +information +related +to +the +navigation +of +the +document, +resources +on +the +page, +and +developer +scripts, +respectively. +Together +these +and +other +performance +interfaces +define +performance +metrics +that +describe +the + +Performance +Timeline + +of +a +web +application. +For +example, +the +following +script +shows +how +a +developer +can +access +the + +Performance +Timeline + +to +obtain +performance +metrics +related +to +the +navigation +of +the +document, +resources +on +the +page, +and +developer +scripts: +

+
+
<!doctype html>
+<html>
+<head></head>
+<body onload="init()">
+  <img id="image0" src="https://www.w3.org/Icons/w3c_main.png" />
+  <script>
+    function init() {
+      // see [[USER-TIMING-2]]
+      performance.mark("startWork");
+      doWork(); // Some developer code
+      performance.mark("endWork");
+      measurePerf();
+    }
+    function measurePerf() {
+      performance
+        .getEntries()
+        .map(entry => JSON.stringify(entry, null, 2))
+        .forEach(json => console.log(json));
+    }
+  </script>
+  </body>
+
+</
+
+html
+
+>
+
+
+
+
+

+Alternatively, +the +developer +can +observe +the + +Performance +Timeline + +and +be +notified +of +new +performance +metrics +and, +optionally, +previously +buffered +performance +metrics +of +specified +type, +via +the + + +PerformanceObserver + + +interface. +

+

+The + + +PerformanceObserver + + +interface +was +added +in +Performance +Timeline +Level +2 + +and +is +designed +to +address +limitations +of +the +buffer-based +approach +shown +in +the +first +example. +By +using +the +PerformanceObserver +interface, +the +application +can: +

+
    +
  • +Avoid +polling +the +timeline +to +detect +new +metrics +
  • +
  • +Eliminate +costly +deduplication +logic +to +identify +new +metrics +
  • +
  • +Eliminate +race +conditions +with +other +consumers +that +may +want +to +manipulate +the +buffer +
  • +
+

+The +developer +is +encouraged +to +use + + +PerformanceObserver + + +where +possible. +Further, +new +performance +API's +and +metrics +may +only +be +available +through +the + + +PerformanceObserver + + +interface. +The +observer +works +by +specifying +a +callback +in +the +constructor +and +specifying +the +performance +entries +it's +interested +in +via +the + + +observe() + + +method. +The +user +agent +chooses +when +to +execute +the +callback, +which +receives +performance +entries +that +have +been +queued. +

+

+There +are +special +considerations +regarding +initial +page +load +when +using +the + + +PerformanceObserver + + +interface: +a +registration +must +be +active +to +receive +events +but +the +registration +script +may +not +be +available +or +may +not +be +desired +in +the +critical +path. +To +address +this, +user +agents +buffer +some +number +of +events +while +the +page +is +being +constructed, +and +these +buffered +events +can +be +accessed +via +the + + +buffered + + +flag +when +registering +the +observer. +When +this +flag +is +set, +the +user +agent +retrieves +and +dispatches +events +that +it +has +buffered, +for +the +specified +entry +type, +and +delivers +them +in +the +first +callback +after +the + + +observe() + + +call +occurs. +

+
+
+ +Note + +
+

+The +number +of +buffered +events +is +determined +by +the +specification +that +defines +the +metric +and +buffering +is +intended +to +used +for +first-N +events +only; +buffering +is +not +unbounded +or +continuous. +

+
+
<!doctype html>
+<html>
+<head></head>
+<body>
+<img id="image0" src="https://www.w3.org/Icons/w3c_main.png" />
+<script>
+// Know when the entry types we would like to use are not supported.
+function detectSupport(entryTypes) {
+  for (const entryType of entryTypes) {
+    if (!PerformanceObserver.supportedEntryTypes.includes(entryType)) {
+      // Indicate to client-side analytics that |entryType| is not supported.
+    }
+  }
+}
+detectSupport(["resource", "mark", "measure"]);
+const userTimingObserver = new PerformanceObserver(list => {
+  list
+    .getEntries()
+    // Get the values we are interested in
+    .map(({ name, entryType, startTime, duration }) => {
+      const obj = {
+        "Duration": duration,
+        "Entry Type": entryType,
+        "Name": name,
+        "Start Time": startTime,
+      };
+      return JSON.stringify(obj, null, 2);
+    })
+    // Display them to the console.
+    .forEach(console.log);
+  // Disconnect after processing the events.
+  userTimingObserver.disconnect();
+});
+// Subscribe to new events for User-Timing.
+userTimingObserver.observe({entryTypes: ["mark", "measure"]});
+const resourceObserver = new PerformanceObserver(list => {
+  list
+    .getEntries()
+    // Get the values we are interested in
+    .map(({ name, startTime, fetchStart, responseStart, responseEnd }) => {
+      const obj = {
+        "Name": name,
+        "Start Time": startTime,
+        "Fetch Start": fetchStart,
+        "Response Start": responseStart,
+        "Response End": responseEnd,
+      };
+      return JSON.stringify(obj, null, 2);
+    })
+    // Display them to the console.
+    .forEach(console.log);
+  // Disconnect after processing the events.
+  resourceObserver.disconnect();
+});
+// Retrieve buffered events and subscribe to newer events for Resource Timing.
+resourceObserver.observe({type: "resource", buffered: true});
+</script>
+</body>
+
+</
+
+html
+
+>
+
+
+
+
+
+
+
+

+ +2. + +Conformance +

+ + +
+

+As +well +as +sections +marked +as +non-normative, +all +authoring +guidelines, +diagrams, +examples, +and +notes +in +this +specification +are +non-normative. +Everything +else +in +this +specification +is +normative. +

+The +key +words + +MUST +, + +MUST +NOT +, +and + +SHOULD + +in +this +document +are +to +be +interpreted +as +described +in + +BCP +14 + +[ + + +RFC2119 + + +] +[ + + +RFC8174 + + +] +when, +and +only +when, +they +appear +in +all +capitals, +as +shown +here. +

+

+Conformance +requirements +phrased +as +algorithms +or +specific +steps +may +be +implemented +in +any +manner, +so +long +as +the +end +result +is +equivalent. +(In +particular, +the +algorithms +defined +in +this +specification +are +intended +to +be +easy +to +follow, +and +not +intended +to +be +performant). +

+
+
+
+

+ +3. + + +Performance +Timeline + +

+ + +
+

+Each + +global +object + +has: +

+
    +
  • +a + +performance +observer +task +queued +flag + +
  • +
  • +a + +list +of + +registered +performance +observer + +objects + +that +is +initially +empty +
  • +
  • +a + +performance +entry +buffer +map + + +map +, + +keyed + +on +a + +DOMString +, +representing +the +entry +type +to +which +the +buffer +belongs. +The + +map + +'s + +value + +is +the +following +tuple: +
      +
    • +A + +performance +entry +buffer + +to +store + + +PerformanceEntry + + +objects, +that +is +initially +empty. +
    • +
    • +An +integer + +maxBufferSize +, +initialized +to +the + +registry + +value +for +this +entry +type. +
    • +
    • +A + +boolean + + +availableFromTimeline +, +initialized +to +the + +registry + +value +for +this +entry +type. +
    • +
    • +An +integer + +dropped +entries +count + +that +is +initially +0. +
    • +
    +
  • +
+

+In +order +to +get +the + +relevant +performance +entry +tuple +, +given + +entryType + +and + +globalObject + +as +input, +run +the +following +steps: +

+
    +
  1. +Let + +map + +be +the + +performance +entry +buffer +map + +associated +with + +globalObject +. +
  2. +
  3. +Return +the +result +of + +getting +the +value +of +an +entry + +from + +map +, +given + +entryType + +as +the + +key +. +
  4. +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Chrome + +6+ +
+Chrome +Android + +? +
+Edge + +12+ +
+Edge +Mobile + +? +
+Firefox + +7+ +
+Firefox +Android + +? +
+Opera + +? +
+Opera +Android + +? +
+Safari + +8+ +
+Safari +iOS + +9+ +
+Samsung +Internet + +? +
+WebView +Android + +37+ +
+ + +
+
+

+ +3.1 + +Extensions +to +the + + +Performance + + +interface +

+ + +
+

+This +extends +the + + +Performance + + +interface +from +[ + + +HR-TIME-3 + + +] +and +hosts +performance +related +attributes +and +methods +used +to +retrieve +the +performance +metric +data +from +the + +Performance +Timeline +. +

+
WebIDLpartial interface Performance {
+  PerformanceEntryList getEntries ();
+  PerformanceEntryList getEntriesByType (DOMString type);
+  PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
+};
+typedef
+
+
+sequence
+
+<
+
+
+PerformanceEntry
+
+
+>
+
+
+
+PerformanceEntryList
+
+
+;
+
+
+
+

+The + + +PerformanceEntryList + + +represents +a +sequence +of + + +PerformanceEntry + +, +providing +developers +with +all +the +convenience +methods +found +on +JavaScript +arrays. +

+ +
+
+

+ +3.1.1 + + + +getEntries() + + +method +

+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by +the + +filter +buffer +map +by +name +and +type + +algorithm +with + +name + +and + +type + +set +to + +null +. +

+
+ +
+
+

+ +3.1.2 + + + +getEntriesByType() + + +method +

+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +map +by +name +and +type + +algorithm +with + +name + +set +to + +null +, +and + +type + +set +to +the +method's +input + +type + +parameter. +

+
+ +
+
+

+ +3.1.3 + + + +getEntriesByName() + + +method +

+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +map +by +name +and +type + +algorithm +with + +name + +set +to +the +method +input + +name + +parameter, +and + +type + +set +to + +null + +if +optional + +entryType + +is +omitted, +or +set +to +the +method's +input + +type + +parameter +otherwise. +

+
+
+ + +
+
+

+ +4. + +The + + +PerformanceEntry + + +interface +

+ + +
+

+The + + +PerformanceEntry + + +interface +hosts +the +performance +data +of +various +metrics. +

+
WebIDL[Exposed=(Window,Worker)]
+interface PerformanceEntry {
+  readonly    attribute DOMString           name;
+  readonly    attribute DOMString           entryType;
+  readonly    attribute DOMHighResTimeStamp startTime;
+  readonly    attribute DOMHighResTimeStamp duration;
+  [Default] object toJSON();
+};
+
+
+
+
+
+ + +name + + +
+
+This +attribute + +MUST + +return +an +identifier +for +this + + +PerformanceEntry + + +object. +This +identifier +does +not +have +to +be +unique. +
+
+ + +entryType + + +
+
+This +attribute + +MUST + +return +the +type +of +the +interface +represented +by +this + + +PerformanceEntry + + +object. +
+
+ +Note + +
+

+All + +entryType + +values +are +defined +in +the +relevant + +registry +. +Examples +include: + +"mark" + +and + +"measure" + +[ + + +USER-TIMING-2 + + +], + +"navigation" + +[ + + +NAVIGATION-TIMING-2 + + +], + +"resource" + +[ + + +RESOURCE-TIMING-2 + + +], +and + +"longtask" +. +

+
+
+ + +startTime + + +
+
+This +attribute + +MUST + +return +the +time +value +of +the +first +recorded +timestamp +of +this +performance +metric. +If +the +startTime +concept +doesn't +apply, +a +performance +metric +may +choose +to +return +a + +startTime + +of + +0 +. +
+
+ + +duration + + +
+
+This +attribute + +MUST + +return +the +time +value +of +the +duration +of +the +entire +event +being +recorded +by +this + + +PerformanceEntry + +. +Typically, +this +would +be +the +time +difference +between +the +last +recorded +timestamp +and +the +first +recorded +timestamp +of +this + + +PerformanceEntry + +. +If +the +duration +concept +doesn't +apply, +a +performance +metric +may +choose +to +return +a + +duration + +of + +0 +. +
+
+

+When + + +toJSON + + +is +called, +run +[ + + +WebIDL + + +]'s + +default +toJSON +steps +. +

+
+ +
+
+

+ +5. + +The + + +PerformanceObserver + + +interface +

+ + +
+

+The + + +PerformanceObserver + + +interface +can +be +used +to +observe +the + +Performance +Timeline + +to +be +notified +of +new +performance +metrics +as +they +are +recorded, +and +optionally +buffered +performance +metrics. +

+

+Each + + +PerformanceObserver + + +has +these +associated +concepts: +

+
    +
  • +A + + +PerformanceObserverCallback + + + +observer +callback + +set +on +creation. +
  • +
  • +A + + +PerformanceEntryList + + +object +called +the + +observer +buffer + +that +is +initially +empty. +
  • +
  • +A + +DOMString + + +observer +type + +which +is +initially + +"undefined" +. +
  • +
  • +A +boolean + +requires +dropped +entries + +which +is +initially +set +to +false. +
  • +
+

+The + +PerformanceObserver(callback) + +constructor +must +create +a +new + + +PerformanceObserver + + +object +with +its + +observer +callback + +set +to + +callback + +and +then +return +it. +

+

+A + +registered +performance +observer + +is +a + +struct + +consisting +of +an + +observer + +member +(a + + +PerformanceObserver + + +object) +and +an + +options +list + +member +(a +list +of + + +PerformanceObserverInit + + +dictionaries). +

+
WebIDLcallback PerformanceObserverCallback = undefined (PerformanceObserverEntryList entries,
+                                             PerformanceObserver observer,
+                                             optional PerformanceObserverCallbackOptions options = {});
+[Exposed=(Window,Worker)]
+interface PerformanceObserver {
+  constructor(PerformanceObserverCallback callback);
+  undefined observe (optional PerformanceObserverInit options = {});
+  undefined disconnect ();
+  PerformanceEntryList takeRecords();
+  [SameObject] static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
+};
+
+
+
+
+
+ +Note + +
+

+To +keep +the +performance +overhead +to +minimum +the +application +ought +to +only +subscribe +to +event +types +that +it +is +interested +in, +and +disconnect +the +observer +once +it +no +longer +needs +to +observe +the +performance +data. +Filtering +by +name +is +not +supported, +as +it +would +implicitly +require +a +subscription +for +all +event +types + +this +is +possible, +but +discouraged, +as +it +will +generate +a +significant +volume +of +events. +

+
+
+

+ +5.1 + + + +PerformanceObserverCallbackOptions + + +dictionary +

+ + +
+> +
WebIDLdictionary PerformanceObserverCallbackOptions {
+  unsigned long long droppedEntriesCount;
+};
+
+
+
+
+
+ + +droppedEntriesCount + + +
+
+An +integer +representing +the +dropped +entries +count +for +the +entry +types +that +the +observer +is +observing +when +the + + +PerformanceObserver + + +'s + +requires +dropped +entries + +is +set. +
+
+
+ +
+
+

+ +5.2 + + + +observe() + + +method +

+ + +
+

+The + + +observe() + + +method +instructs +the +user +agent +to +register +the +observer +and +must +run +these +steps: +

+
    +
  1. +Let + +relevantGlobal + +be + +this + +'s + +relevant +global +object +. +
  2. +
  3. +If + +options + +'s + + +entryTypes + + +and + + +type + + +members +are +both +omitted, +then + +throw + +a +" + + +TypeError + + +". +
  4. +
  5. +If + +options + +'s + + +entryTypes + + +is +present +and +any +other +member +is +also +present, +then + +throw + +a +" + + +TypeError + + +". +
  6. +
  7. +Update +or +check + +this + +'s + +observer +type + +by +running +these +steps: +
      +
    1. +If + +this + +'s + +observer +type + +is + +"undefined" +: +
        +
      1. +If + +options + +'s + + +entryTypes + + +member +is +present, +then +set + +this + +'s + +observer +type + +to + +"multiple" +. +
      2. +
      3. +If + +options + +'s + + +type + + +member +is +present, +then +set + +this + +'s + +observer +type + +to + +"single" +. +
      4. +
      +
    2. +
    3. +If + +this + +'s + +observer +type + +is + +"single" + +and + +options + +'s + + +entryTypes + + +member +is +present, +then + +throw + +an +" + + +InvalidModificationError + + +". +
    4. +
    5. +If + +this + +'s + +observer +type + +is + +"multiple" + +and + +options + +'s + + +type + + +member +is +present, +then + +throw + +an +" + + +InvalidModificationError + + +". +
    6. +
    +
  8. +
  9. +Set + +this + +'s + +requires +dropped +entries + +to +true. +
  10. +
  11. +If + +this + +'s + +observer +type + +is + +"multiple" +, +run +the +following +steps: +
      +
    1. +Let + +entry +types + +be + +options + +'s + + +entryTypes + + +sequence. +
    2. +
    3. +Remove +all +types +from + +entry +types + +that +are +not +contained +in + +relevantGlobal + +'s + +frozen +array +of +supported +entry +types +. +The +user +agent + +SHOULD + +notify +developers +if + +entry +types + +is +modified. +For +example, +a +console +warning +listing +removed +types +might +be +appropriate. +
    4. +
    5. +If +the +resulting + +entry +types + +sequence +is +an +empty +sequence, +abort +these +steps. +The +user +agent + +SHOULD + +notify +developers +when +the +steps +are +aborted +to +notify +that +registration +has +been +aborted. +For +example, +a +console +warning +might +be +appropriate. +
    6. +
    7. +If +the + +list +of +registered +performance +observer +objects + +of + +relevantGlobal + +contains +a + +registered +performance +observer + +whose + +observer + +is + +this +, +replace +its + +options +list + +with +a +list +containing + +options + +as +its +only +item. +
    8. +
    9. +Otherwise, +create +and +append +a + +registered +performance +observer + +object +to +the + +list +of +registered +performance +observer +objects + +of + +relevantGlobal +, +with + +observer + +set +to + +this + +and + +options +list + +set +to +a +list +containing + +options + +as +its +only +item. +
    10. +
    +
  12. +
  13. +Otherwise, +run +the +following +steps: +
      +
    1. +Assert +that + +this + +'s + +observer +type + +is + +"single" +. +
    2. +
    3. +If + +options + +'s + + +type + + +is +not +contained +in +the + +relevantGlobal + +'s + +frozen +array +of +supported +entry +types +, +abort +these +steps. +The +user +agent + +SHOULD + +notify +developers +when +this +happens, +for +instance +via +a +console +warning. +
    4. +
    5. +If +the + +list +of +registered +performance +observer +objects + +of + +relevantGlobal + +contains +a + +registered +performance +observer + + +obs + +whose + +observer + +is + +this +: +
        +
      1. +If + +obs + +'s + +options +list + +contains +a + + +PerformanceObserverInit + + +item + +currentOptions + +whose + + +type + + +is +equal +to + +options + +'s + + +type + +, +replace + +currentOptions + +with + +options + +in + +obs + +'s + +options +list +. +
      2. +
      3. +Otherwise, +append + +options + +to + +obs + +'s + +options +list +. +
      4. +
      +
    6. +
    7. +Otherwise, +create +and +append +a + +registered +performance +observer + +object +to +the + +list +of +registered +performance +observer +objects + +of + +relevantGlobal +, +with + +observer + +set +to +the + +this + +and + +options +list + +set +to +a +list +containing + +options + +as +its +only +item. +
    8. +
    9. +If + +options + +'s + + +buffered + + +flag +is +set: +
        +
      1. +Let + +tuple + +be +the + +relevant +performance +entry +tuple + +of + +options + +'s + + +type + + +and + +relevantGlobal +. +
      2. +
      3. +

        +For +each + +entry + +in + +tuple + +'s + +performance +entry +buffer +: +

        +
          +
        1. +If + +should +add +entry + +with + +entry + +and + +options + +as +parameters +returns +true, + +append + + +entry + +to +the + +observer +buffer +. +
        2. +
        +
      4. +
      5. + +Queue +the +PerformanceObserver +task + +with + +relevantGlobal + +as +input. +
      6. +
      +
    10. +
    +
  14. +
+
+
+ +Note + +
+

+A + + +PerformanceObserver + + +object +needs +to +always +call + + +observe() + + +with + +options + +'s + + +entryTypes + + +set +OR +always +call + + +observe() + + +with + +options + +'s + + +type + + +set. +If +one + + +PerformanceObserver + + +calls + + +observe() + + +with + + +entryTypes + + +and +also +calls +observe +with + + +type + +, +then +an +exception +is +thrown. +This +is +meant +to +avoid +confusion +with +how +calls +would +stack. +When +using + + +entryTypes + +, +no +other +parameters +in + + +PerformanceObserverInit + + +can +be +used. +In +addition, +multiple + + +observe() + + +calls +will +override +for +backwards +compatibility +and +because +a +single +call +should +suffice +in +this +case. +On +the +other +hand, +when +using + + +type + +, +calls +will +stack +because +a +single +call +can +only +specify +one +type. +Calling + + +observe() + + +with +a +repeated + + +type + + +will +also +override. +

+
+
+

+ +5.2.1 + + + +PerformanceObserverInit + + +dictionary +

+ + +
+
WebIDLdictionary PerformanceObserverInit {
+  sequence<DOMString> entryTypes;
+  DOMString type;
+  boolean buffered;
+};
+
+
+
+
+
+ + +entryTypes + + +
+
+A +list +of +entry +types +to +be +observed. +If +present, +the +list + +MUST +NOT + +be +empty +and +all +other +members + +MUST +NOT + +be +present. +Types +not +recognized +by +the +user +agent + +MUST + +be +ignored. +
+
+
+
+ + +type + + +
+
+A +single +entry +type +to +be +observed. +A +type +that +is +not +recognized +by +the +user +agent + +MUST + +be +ignored. +Other +members +may +be +present. +
+
+
+
+ + +buffered + + +
+
+A +flag +to +indicate +whether +buffered +entries +should +be +queued +into +observer's +buffer. +
+
+
+ +
+
+

+ +5.2.2 + + + +PerformanceObserverEntryList + + +interface +

+ + +
+
WebIDL[Exposed=(Window,Worker)]
+interface PerformanceObserverEntryList {
+  PerformanceEntryList getEntries();
+  PerformanceEntryList getEntriesByType (DOMString type);
+  PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
+};
+
+
+
+

+Each + + +PerformanceObserverEntryList + + +object +has +an +associated + +entry +list +, +which +consists +of +a + + +PerformanceEntryList + + +and +is +initialized +upon +construction. +

+ +
+
+
+ +5.2.2.1 + + + +getEntries() + + +method +
+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +by +name +and +type + +algorithm +with + +this + +'s + +entry +list +, + +name + +and + +type + +set +to + +null +. +

+
+ +
+
+
+ +5.2.2.2 + + + +getEntriesByType() + + +method +
+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +by +name +and +type + +algorithm +with + +this + +'s + +entry +list +, + +name + +set +to + +null +, +and + +type + +set +to +the +method's +input + +type + +parameter. +

+
+ +
+
+
+ +5.2.2.3 + + + +getEntriesByName() + + +method +
+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +by +name +and +type + +algorithm +with + +this + +'s + +entry +list +, + +name + +set +to +the +method +input + +name + +parameter, +and + +type + +set +to + +null + +if +optional + +entryType + +is +omitted, +or +set +to +the +method's +input + +type + +parameter +otherwise. +

+
+
+
+ +
+
+

+ +5.3 + + + +takeRecords() + + +method +

+ + +
+

+The + + +takeRecords() + + +method +must +return +a +copy +of + +this + +'s + +observer +buffer +, +and +also +empty + +this + +'s + +observer +buffer +. +

+
+ +
+
+

+ +5.4 + + + +disconnect() + + +method +

+ + +
+

+The + + +disconnect() + + +method +must +do +the +following: +

+
    +
  1. +Remove + +this + +from +the + +list +of +registered +performance +observer +objects + +of + +relevant +global +object +. +
  2. +
  3. +Empty + +this + +'s + +observer +buffer +. +
  4. +
  5. +Empty + +this + +'s + +options +list +. +
  6. +
+
+ +
+
+

+ +5.5 + + + +supportedEntryTypes + + +attribute +

+ + +
+

+Each + +global +object + +has +an +associated + +frozen +array +of +supported +entry +types +, +which +is +initialized +to +the + +FrozenArray + + +created + +from +the +sequence +of +strings +among +the + +registry + +that +are +supported +for +the +global +object, +in +alphabetical +order. +

+

+When + + +supportedEntryTypes + + +'s +attribute +getter +is +called, +run +the +following +steps: +

+
    +
  1. +Let + +globalObject + +be +the + +environment +settings +object's +global +object +. +
  2. +
  3. +Return + +globalObject + +'s + +frozen +array +of +supported +entry +types +. +
  4. +
+
+
+ +Note + +
+

+This +attribute +allows +web +developers +to +easily +know +which +entry +types +are +supported +by +the +user +agent. +

+
+
+
+
+

+ +6. + +Processing +

+ + +
+
+
+

+ +6.1 + +Queue +a + +PerformanceEntry + +

+ + +
+

+To + +queue +a +PerformanceEntry + +( + +newEntry + +), +run +these +steps: +

+
    +
  1. +Let + +interested +observers + +be +an +initially +empty +set +of + + +PerformanceObserver + + +objects. +
  2. +
  3. +Let + +entryType + +be + +newEntry + +s + + +entryType + + +value. +
  4. +
  5. +Let + +relevantGlobal + +be + +newEntry + +'s + +relevant +global +object +. +
  6. +
  7. +For +each + +registered +performance +observer + + +regObs + +in + +relevantGlobal + +'s + +list +of +registered +performance +observer +objects +: +
      +
    1. +

      +If + +regObs + +'s + +options +list + +contains +a + + +PerformanceObserverInit + + + +options + +whose + + +entryTypes + + +member +includes + +entryType + +or +whose + + +type + + +member +equals +to + +entryType +: +

      +
        +
      1. +If + +should +add +entry + +with + +newEntry + +and + +options + +returns +true, +append + +regObs + +'s + +observer + +to + +interested +observers +. +
      2. +
      +
    2. +
    +
  8. +
  9. +For +each + +observer + +in + +interested +observers +: +
      +
    1. +Append + +newEntry + +to + +observer + +'s + +observer +buffer +. +
    2. +
    +
  10. +
  11. +Let + +tuple + +be +the + +relevant +performance +entry +tuple + +of + +entryType + +and + +relevantGlobal +. +
  12. +
  13. +Let + +isBufferFull + +be +the +return +value +of +the + +determine +if +a +performance +entry +buffer +is +full + +algorithm +with + +tuple + +as +input. +
  14. +
  15. +Let + +shouldAdd + +be +the +result +of + +should +add +entry + +with + +newEntry + +as +input. +
  16. +
  17. +If + +isBufferFull + +is +false +and + +shouldAdd + +is +true, + +append + + +newEntry + +to + +tuple + +'s + +performance +entry +buffer +. +
  18. +
  19. + +Queue +the +PerformanceObserver +task + +with + +relevantGlobal + +as +input. +
  20. +
+
+
+
+

+ +6.2 + +Queue +the +PerformanceObserver +task +

+ + +
+

+When +asked +to + +queue +the +PerformanceObserver +task +, +given + +relevantGlobal + +as +input, +run +the +following +steps: +

+
    +
  1. +If + +relevantGlobal + +'s + +performance +observer +task +queued +flag + +is +set, +terminate +these +steps. +
  2. +
  3. +Set + +relevantGlobal + +'s + +performance +observer +task +queued +flag +. +
  4. +
  5. + +Queue +a +task + +that +consists +of +running +the +following +substeps. +The + +task +source + +for +the +queued +task +is +the + +performance +timeline +task +source +. +
      +
    1. +Unset + +performance +observer +task +queued +flag + +of + +relevantGlobal +. +
    2. +
    3. +Let + +notifyList + +be +a +copy +of + +relevantGlobal + +'s + +list +of +registered +performance +observer +objects +. +
    4. +
    5. +For +each + +registered +performance +observer + +object + +registeredObserver + +in + +notifyList +, +run +these +steps: +
        +
      1. +Let + +po + +be + +registeredObserver + +'s + +observer +. +
      2. +
      3. +Let + +entries + +be +a +copy +of + +po + +s + +observer +buffer +. +
      4. +
      5. +If + +entries + +is +empty, +return. +
      6. +
      7. +Empty + +po + +s + +observer +buffer +. +
      8. +
      9. +Let + +observerEntryList + +be +a +new + + +PerformanceObserverEntryList + +, +with +its + +entry +list + +set +to + +entries +. +
      10. +
      11. +Let + +droppedEntriesCount + +be +null. +
      12. +
      13. +If + +po + +'s + +requires +dropped +entries + +is +set, +perform +the +following +steps: +
          +
        1. +Set + +droppedEntriesCount + +to +0. +
        2. +
        3. +For +each + + +PerformanceObserverInit + + + +item + +in + +registeredObserver + +'s + +options +list +: +
            +
          1. +For +each + +DOMString + + +entryType + +that +appears +either +as + +item + +'s + + +type + + +or +in + +item + +'s + + +entryTypes + +: +
              +
            1. +Let + +map + +be + +relevantGlobal + +'s + +performance +entry +buffer +map +. +
            2. +
            3. +Let + +tuple + +be +the +result +of + +getting +the +value +of +entry + +on + +map + +given + +entryType + +as + +key +. +
            4. +
            5. +Increase + +droppedEntriesCount + +by + +tuple + +'s + +dropped +entries +count +. +
            6. +
            +
          2. +
          +
        4. +
        5. +Set + +po + +'s + +requires +dropped +entries + +to +false. +
        6. +
        +
      14. +
      15. +Let + +callbackOptions + +be +a + + +PerformanceObserverCallbackOptions + + +with +its + + +droppedEntriesCount + + +set +to + +droppedEntriesCount + +if + +droppedEntriesCount + +is +not +null, +otherwise +unset. +
      16. +
      17. +Call + +po + +s + +observer +callback + +with + +observerEntryList + +as +the +first +argument, +with + +po + +as +the +second +argument +and +as + +callback +this +value +, +and +with + +callbackOptions + +as +the +third +argument. +If +this + +throws + +an +exception, + +report +the +exception +. +
      18. +
      +
    6. +
    +
  6. +
+

+The + +performance +timeline + + +task +queue + +is +a +low +priority +queue +that, +if +possible, +should +be +processed +by +the +user +agent +during +idle +periods +to +minimize +impact +of +performance +monitoring +code. +

+
+
+
+

+ +6.3 + +Filter +buffer +map +by +name +and +type +

+ + +
+

+When +asked +to +run +the + +filter +buffer +map +by +name +and +type + +algorithm +with +optional + +name + +and + +type +, +run +the +following +steps: +

+
    +
  1. +Let + +result + +be +an +initially +empty + +list +. +
  2. +
  3. +Let + +map + +be +the + +performance +entry +buffer +map + +associated +with +the + +relevant +global +object + +of + +this +. +
  4. +
  5. +Let + +tuple +list + +be +an +empty + +list +. +
  6. +
  7. +If + +type + +is +not +null, +append +the +result +of + +getting +the +value +of +entry + +on + +map + +given + +type + +as + +key + +to + +tuple +list +. +Otherwise, +assign +the +result +of + +get +the +values + +on + +map + +to + +tuple +list +. +
  8. +
  9. +For +each + +tuple + +in + +tuple +list +, +run +the +following +steps: +
      +
    1. +Let + +buffer + +be + +tuple + +'s + +performance +entry +buffer +. +
    2. +
    3. +If + +tuple + +'s + +availableFromTimeline + +is +false, +continue +to +the +next + +tuple +. +
    4. +
    5. +Let + +entries + +be +the +result +of +running + +filter +buffer +by +name +and +type + +with + +buffer +, + +name + +and + +type + +as +inputs. +
    6. +
    7. +For +each + +entry + +in + +entries +, + +append + + +entry + +to + +result +. +
    8. +
    +
  10. +
  11. +Sort + +results + +'s +entries +in +chronological +order +with +respect +to + + +startTime + + +
  12. +
  13. +Return + +result +. +
  14. +
+
+
+
+

+ +6.4 + +Filter +buffer +by +name +and +type +

+ + +
+

+When +asked +to +run +the + +filter +buffer +by +name +and +type + +algorithm, +with + +buffer +, + +name +, +and + +type + +as +inputs, +run +the +following +steps: +

+
    +
  1. +Let + +result + +be +an +initially +empty + +list +. +
  2. +
  3. +For +each + + +PerformanceEntry + + + +entry + +in + +buffer +, +run +the +following +steps: +
      +
    1. +If + +type + +is +not +null +and +if + +type + +is +not + +identical +to + + +entry + +'s + +entryType + +attribute, +continue +to +next + +entry +. +
    2. +
    3. +If + +name + +is +not +null +and +if + +name + +is +not + +identical +to + + +entry + +'s + +name + +attribute, +continue +to +next + +entry +. +
    4. +
    5. + +append + + +entry + +to + +result +. +
    6. +
    +
  4. +
  5. +Sort + +results + +'s +entries +in +chronological +order +with +respect +to + + +startTime + + +
  6. +
  7. +Return + +result +. +
  8. +
+
+
+
+

+ +6.5 + +Determine +if +a +performance +entry +buffer +is +full +

+ + +
+

+To + +determine +if +a +performance +entry +buffer +is +full +, +with + +tuple + +as +input, +run +the +following +steps: +

+
    +
  1. +Let + +num +current +entries + +be +the +size +of + +tuple + +'s + +performance +entry +buffer +. +
  2. +
  3. +If + +num +current +entries + +is +less +than + +tuples + +'s + +maxBufferSize +, +return +false. +
  4. +
  5. +Increase + +tuple + +'s + +dropped +entries +count + +by +1. +
  6. +
  7. +Return +true. +
  8. +
+
+
+
+
+

+ +7. + +Privacy +Considerations +

+ + +
+

+This +specification +extends +the + + +Performance + + +interface +defined +by +[ + + +HR-TIME-3 + + +] +and +provides +methods +to +queue +and +retrieve +entries +from +the + +performance +timeline +. +Please +refer +to +[ + + +HR-TIME-3 + + +] +for +privacy +considerations +of +exposing +high-resoluting +timing +information. +Each +new +specification +introducing +new +performance +entries +should +have +its +own +privacy +considerations +as +well. +

+
+
+
+

+ +8. + +Security +Considerations +

+ + +
+

+This +specification +extends +the + + +Performance + + +interface +defined +by +[ + + +HR-TIME-3 + + +] +and +provides +methods +to +queue +and +retrieve +entries +from +the + +performance +timeline +. +Please +refer +to +[ + + +HR-TIME-3 + + +] +for +security +considerations +of +exposing +high-resoluting +timing +information. +Each +new +specification +introducing +new +performance +entries +should +have +its +own +security +considerations +as +well. +

+
+
+
+

+ +9. + +Dependencies +

+ + +
+

+The +[ + + +INFRA + + +] +specification +defines +the +following: + + +key + +, + + +getting +the +value +of +an +entry + +. +

+
+

A. IDL Index

WebIDLpartial interface Performance {
+  PerformanceEntryList getEntries ();
+  PerformanceEntryList getEntriesByType (DOMString type);
+  PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
+};
+typedef sequence<PerformanceEntry> PerformanceEntryList;
+[Exposed=(Window,Worker)]
+interface PerformanceEntry {
+  readonly    attribute DOMString           name;
+  readonly    attribute DOMString           entryType;
+  readonly    attribute DOMHighResTimeStamp startTime;
+  readonly    attribute DOMHighResTimeStamp duration;
+  [Default] object toJSON();
+};
+callback PerformanceObserverCallback = undefined (PerformanceObserverEntryList entries,
+                                             PerformanceObserver observer,
+                                             optional PerformanceObserverCallbackOptions options = {});
+[Exposed=(Window,Worker)]
+interface PerformanceObserver {
+  constructor(PerformanceObserverCallback callback);
+  undefined observe (optional PerformanceObserverInit options = {});
+  undefined disconnect ();
+  PerformanceEntryList takeRecords();
+  [SameObject] static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
+};
+dictionary PerformanceObserverCallbackOptions {
+  unsigned long long droppedEntriesCount;
+};
+dictionary PerformanceObserverInit {
+  sequence<DOMString> entryTypes;
+  DOMString type;
+  boolean buffered;
+};
+[Exposed=(Window,Worker)]
+interface PerformanceObserverEntryList {
+  PerformanceEntryList getEntries();
+  PerformanceEntryList getEntriesByType (DOMString type);
+  PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
+};
+
+
+
+
+
+
+

+ +B. + +Acknowledgments +

+ + +
+

+Thanks +to +Arvind +Jain, +Boris +Zbarsky, +Jatinder +Mann, +Nat +Duca, +Philippe +Le +Hegaret, +Ryosuke +Niwa, +Shubhie +Panicker, +Todd +Reifsteck, +Yoav +Weiss, +and +Zhiheng +Wang, +for +their +contributions +to +this +work. +

+
+
+
+

+ +C. + +References +

+ + +
+
+
+

+ +C.1 + +Normative +references +

+ + +
+
+
+[HR-TIME-3] +
+ + +High +Resolution +Time + +. +Yoav +Weiss. +W3C. +20 +September +2022. +W3C +Working +Draft. +URL: + +https://www.w3.org/TR/hr-time-3/ + +
+[HTML] +
+ + +HTML +Standard + +. +Anne +van +Kesteren; +Domenic +Denicola; +Ian +Hickson; +Philip +Jgenstedt; +Simon +Pieters. +WHATWG. +Living +Standard. +URL: + +https://html.spec.whatwg.org/multipage/ + +
+[INFRA] +
+ + +Infra +Standard + +. +Anne +van +Kesteren; +Domenic +Denicola. +WHATWG. +Living +Standard. +URL: + +https://infra.spec.whatwg.org/ + +
+[RFC2119] +
+ + +Key +words +for +use +in +RFCs +to +Indicate +Requirement +Levels + +. +S. +Bradner. +IETF. +March +1997. +Best +Current +Practice. +URL: + +https://www.rfc-editor.org/rfc/rfc2119 + +
+[RFC8174] +
+ + +Ambiguity +of +Uppercase +vs +Lowercase +in +RFC +2119 +Key +Words + +. +B. +Leiba. +IETF. +May +2017. +Best +Current +Practice. +URL: + +https://www.rfc-editor.org/rfc/rfc8174 + +
+[WebIDL] +
+ + +Web +IDL +Standard + +. +Edgar +Chen; +Timothy +Gu. +WHATWG. +Living +Standard. +URL: + +https://webidl.spec.whatwg.org/ + +
+
+
+
+

+ +C.2 + +Informative +references +

+ + +
+
+
+[NAVIGATION-TIMING-2] +
+ + +Navigation +Timing +Level +2 + +. +Yoav +Weiss; +Noam +Rosenthal. +W3C. +7 +September +2022. +W3C +Working +Draft. +URL: + +https://www.w3.org/TR/navigation-timing-2/ + +
+[PERFORMANCE-TIMELINE] +
+ + +Performance +Timeline + +. +Nicolas +Pena +Moreno. +W3C. +2 +December +2021. +W3C +Candidate +Recommendation. +URL: + +https://www.w3.org/TR/performance-timeline/ + +
+[RESOURCE-TIMING-2] +
+ + +Resource +Timing +Level +2 + +. +Yoav +Weiss; +Noam +Rosenthal. +W3C. +29 +September +2022. +W3C +Working +Draft. +URL: + +https://www.w3.org/TR/resource-timing-2/ + +
+[USER-TIMING-2] +
+ + +User +Timing +Level +2 + +. +Ilya +Grigorik. +W3C. +26 +February +2019. +W3C +Recommendation. +URL: + +https://www.w3.org/TR/user-timing-2/ + +
+[WORKERS] +
+ + +Web +Workers + +. +Ian +Hickson. +W3C. +28 +January +2021. +W3C +Working +Group +Note. +URL: + +https://www.w3.org/TR/workers/ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Performance Timeline + + + + + + + + + + + + + +
+

+ +

+

+Performance +Timeline +Level +2 + +

+

+ +W3C +Editor's +Draft + + +

+
+ +More +details +about +this +document + +
+
+This +version: +
+ +https://w3c.github.io/performance-timeline/ + +
+
+Latest +published +version: +
+ +https://www.w3.org/TR/performance-timeline/ + +
+
+Latest +editor's +draft: +
+ +https://w3c.github.io/performance-timeline/ + +
+
+History: +
+ +https://www.w3.org/standards/history/performance-timeline +
+ +Commit +history + +
+
+Test +suite: +
+ +https://github.com/web-platform-tests/wpt/tree/master/performance-timeline + +
+
+Editor: +
+ +Nicols +Pea +Moreno + +( + +Google + +) +
+
+Former +editors: +
+ +Ilya +Grigorik + +( + +Google + +) +
+ +( + +Microsoft +Corp. + +) +(Until +November +2014) +
+ +Zhiheng +Wang + +( + +Google + +) +(Until +July +2013) +
+
+Feedback: +
+ +GitHub +w3c/performance-timeline + +( + +pull +requests +, + +new +issue +, + +open +issues + +) +
+
+
+ +
+
+
+

+Abstract +

+

+This +specification +extends +the +High +Resolution +Time +specification +[ + + +HR-TIME-3 + + +] +by +providing +methods +to +store +and +retrieve +high +resolution +performance +metric +data. +

+
+
+

+Status +of +This +Document +

+
+ +This +is +a +preview + +

+Do +not +attempt +to +implement +this +version +of +the +specification. +Do +not +reference +this +version +as +authoritative +in +any +way. +Instead, +see + +https://w3c.github.io/performance-timeline/ + +for +the +Editor's +draft. +

+
+

+ +This +section +describes +the +status +of +this +document +at +the +time +of +its +publication. +A +list +of +current + +W3C + +publications +and +the +latest +revision +of +this +technical +report +can +be +found +in +the + + +W3C + +technical +reports +index + +at +https://www.w3.org/TR/. + +

+

+This + +Performance +Timeline +Level +2 + +specification + +replaces +the +first +version +of +[ + + +PERFORMANCE-TIMELINE + + +] +and +includes: +

+ +

+This +document +was +published +by +the + +Web +Performance +Working +Group + +as +an +Editor's +Draft. +

+Publication +as +an +Editor's +Draft +does +not +imply +endorsement +by + +W3C + +and +its +Members. +

+This +is +a +draft +document +and +may +be +updated, +replaced +or +obsoleted +by +other +documents +at +any +time. +It +is +inappropriate +to +cite +this +document +as +other +than +work +in +progress. +

+This +document +was +produced +by +a +group +operating +under +the + + +W3C + +Patent +Policy +. + +W3C + +maintains +a + +public +list +of +any +patent +disclosures + +made +in +connection +with +the +deliverables +of +the +group; +that +page +also +includes +instructions +for +disclosing +a +patent. +An +individual +who +has +actual +knowledge +of +a +patent +which +the +individual +believes +contains + +Essential +Claim(s) + +must +disclose +the +information +in +accordance +with + +section +6 +of +the + +W3C + +Patent +Policy +. +

+This +document +is +governed +by +the + +2 +November +2021 + +W3C + +Process +Document +. +

+ +
+
+

+ +1. + +Introduction +

+ + +
+

+ +This +section +is +non-normative. + +

+

+Accurately +measuring +performance +characteristics +of +web +applications +is +an +important +aspect +of +making +web +applications +faster. +This +specification +defines +the +necessary + +Performance +Timeline + +primitives +that +enable +web +developers +to +access, +instrument, +and +retrieve +various +performance +metrics +from +the +full +lifecycle +of +a +web +application. +

+

+[ + + +NAVIGATION-TIMING-2 + + +], +[ + + +RESOURCE-TIMING-2 + + +], +and +[ + + +USER-TIMING-2 + + +] +are +examples +of +specifications +that +define +timing +information +related +to +the +navigation +of +the +document, +resources +on +the +page, +and +developer +scripts, +respectively. +Together +these +and +other +performance +interfaces +define +performance +metrics +that +describe +the + +Performance +Timeline + +of +a +web +application. +For +example, +the +following +script +shows +how +a +developer +can +access +the + +Performance +Timeline + +to +obtain +performance +metrics +related +to +the +navigation +of +the +document, +resources +on +the +page, +and +developer +scripts: +

+
+
<!doctype html>
+<html>
+<head></head>
+<body onload="init()">
+  <img id="image0" src="https://www.w3.org/Icons/w3c_main.png" />
+  <script>
+    function init() {
+      // see [[USER-TIMING-2]]
+      performance.mark("startWork");
+      doWork(); // Some developer code
+      performance.mark("endWork");
+      measurePerf();
+    }
+    function measurePerf() {
+      performance
+        .getEntries()
+        .map(entry => JSON.stringify(entry, null, 2))
+        .forEach(json => console.log(json));
+    }
+  </script>
+  </body>
+
+</
+
+html
+
+>
+
+
+
+
+

+Alternatively, +the +developer +can +observe +the + +Performance +Timeline + +and +be +notified +of +new +performance +metrics +and, +optionally, +previously +buffered +performance +metrics +of +specified +type, +via +the + + +PerformanceObserver + + +interface. +

+

+The + + +PerformanceObserver + + +interface +was +added +in +Performance +Timeline +Level +2 + +and +is +designed +to +address +limitations +of +the +buffer-based +approach +shown +in +the +first +example. +By +using +the +PerformanceObserver +interface, +the +application +can: +

+
    +
  • +Avoid +polling +the +timeline +to +detect +new +metrics +
  • +
  • +Eliminate +costly +deduplication +logic +to +identify +new +metrics +
  • +
  • +Eliminate +race +conditions +with +other +consumers +that +may +want +to +manipulate +the +buffer +
  • +
+

+The +developer +is +encouraged +to +use + + +PerformanceObserver + + +where +possible. +Further, +new +performance +API's +and +metrics +may +only +be +available +through +the + + +PerformanceObserver + + +interface. +The +observer +works +by +specifying +a +callback +in +the +constructor +and +specifying +the +performance +entries +it's +interested +in +via +the + + +observe() + + +method. +The +user +agent +chooses +when +to +execute +the +callback, +which +receives +performance +entries +that +have +been +queued. +

+

+There +are +special +considerations +regarding +initial +page +load +when +using +the + + +PerformanceObserver + + +interface: +a +registration +must +be +active +to +receive +events +but +the +registration +script +may +not +be +available +or +may +not +be +desired +in +the +critical +path. +To +address +this, +user +agents +buffer +some +number +of +events +while +the +page +is +being +constructed, +and +these +buffered +events +can +be +accessed +via +the + + +buffered + + +flag +when +registering +the +observer. +When +this +flag +is +set, +the +user +agent +retrieves +and +dispatches +events +that +it +has +buffered, +for +the +specified +entry +type, +and +delivers +them +in +the +first +callback +after +the + + +observe() + + +call +occurs. +

+
+
+ +Note + +
+

+The +number +of +buffered +events +is +determined +by +the +specification +that +defines +the +metric +and +buffering +is +intended +to +used +for +first-N +events +only; +buffering +is +not +unbounded +or +continuous. +

+
+
<!doctype html>
+<html>
+<head></head>
+<body>
+<img id="image0" src="https://www.w3.org/Icons/w3c_main.png" />
+<script>
+// Know when the entry types we would like to use are not supported.
+function detectSupport(entryTypes) {
+  for (const entryType of entryTypes) {
+    if (!PerformanceObserver.supportedEntryTypes.includes(entryType)) {
+      // Indicate to client-side analytics that |entryType| is not supported.
+    }
+  }
+}
+detectSupport(["resource", "mark", "measure"]);
+const userTimingObserver = new PerformanceObserver(list => {
+  list
+    .getEntries()
+    // Get the values we are interested in
+    .map(({ name, entryType, startTime, duration }) => {
+      const obj = {
+        "Duration": duration,
+        "Entry Type": entryType,
+        "Name": name,
+        "Start Time": startTime,
+      };
+      return JSON.stringify(obj, null, 2);
+    })
+    // Display them to the console.
+    .forEach(console.log);
+  // Disconnect after processing the events.
+  userTimingObserver.disconnect();
+});
+// Subscribe to new events for User-Timing.
+userTimingObserver.observe({entryTypes: ["mark", "measure"]});
+const resourceObserver = new PerformanceObserver(list => {
+  list
+    .getEntries()
+    // Get the values we are interested in
+    .map(({ name, startTime, fetchStart, responseStart, responseEnd }) => {
+      const obj = {
+        "Name": name,
+        "Start Time": startTime,
+        "Fetch Start": fetchStart,
+        "Response Start": responseStart,
+        "Response End": responseEnd,
+      };
+      return JSON.stringify(obj, null, 2);
+    })
+    // Display them to the console.
+    .forEach(console.log);
+  // Disconnect after processing the events.
+  resourceObserver.disconnect();
+});
+// Retrieve buffered events and subscribe to newer events for Resource Timing.
+resourceObserver.observe({type: "resource", buffered: true});
+</script>
+</body>
+
+</
+
+html
+
+>
+
+
+
+
+
+
+
+

+ +2. + +Conformance +

+ + +
+

+As +well +as +sections +marked +as +non-normative, +all +authoring +guidelines, +diagrams, +examples, +and +notes +in +this +specification +are +non-normative. +Everything +else +in +this +specification +is +normative. +

+The +key +words + +MUST +, + +MUST +NOT +, +and + +SHOULD + +in +this +document +are +to +be +interpreted +as +described +in + +BCP +14 + +[ + + +RFC2119 + + +] +[ + + +RFC8174 + + +] +when, +and +only +when, +they +appear +in +all +capitals, +as +shown +here. +

+

+Conformance +requirements +phrased +as +algorithms +or +specific +steps +may +be +implemented +in +any +manner, +so +long +as +the +end +result +is +equivalent. +(In +particular, +the +algorithms +defined +in +this +specification +are +intended +to +be +easy +to +follow, +and +not +intended +to +be +performant). +

+
+
+
+

+ +3. + + +Performance +Timeline + +

+ + +
+

+Each + +global +object + +has: +

+
    +
  • +a + +performance +observer +task +queued +flag + +
  • +
  • +a + +list +of + +registered +performance +observer + +objects + +that +is +initially +empty +
  • +
  • +a + +performance +entry +buffer +map + + +map +, + +keyed + +on +a + +DOMString +, +representing +the +entry +type +to +which +the +buffer +belongs. +The + +map + +'s + +value + +is +the +following +tuple: +
      +
    • +A + +performance +entry +buffer + +to +store + + +PerformanceEntry + + +objects, +that +is +initially +empty. +
    • +
    • +An +integer + +maxBufferSize +, +initialized +to +the + +registry + +value +for +this +entry +type. +
    • +
    • +A + +boolean + + +availableFromTimeline +, +initialized +to +the + +registry + +value +for +this +entry +type. +
    • +
    • +An +integer + +dropped +entries +count + +that +is +initially +0. +
    • +
    +
  • +
+

+In +order +to +get +the + +relevant +performance +entry +tuple +, +given + +entryType + +and + +globalObject + +as +input, +run +the +following +steps: +

+
    +
  1. +Let + +map + +be +the + +performance +entry +buffer +map + +associated +with + +globalObject +. +
  2. +
  3. +Return +the +result +of + +getting +the +value +of +an +entry + +from + +map +, +given + +entryType + +as +the + +key +. +
  4. +
+ +
+
+

+ +3.1 + +Extensions +to +the + + +Performance + + +interface +

+ + +
+

+This +extends +the + + +Performance + + +interface +from +[ + + +HR-TIME-3 + + +] +and +hosts +performance +related +attributes +and +methods +used +to +retrieve +the +performance +metric +data +from +the + +Performance +Timeline +. +

+
WebIDLpartial interface Performance {
+  PerformanceEntryList getEntries ();
+  PerformanceEntryList getEntriesByType (DOMString type);
+  PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
+};
+typedef
+
+
+sequence
+
+<
+
+
+PerformanceEntry
+
+
+>
+
+
+
+PerformanceEntryList
+
+
+;
+
+
+
+

+The + + +PerformanceEntryList + + +represents +a +sequence +of + + +PerformanceEntry + +, +providing +developers +with +all +the +convenience +methods +found +on +JavaScript +arrays. +

+ +
+
+

+ +3.1.1 + + + +getEntries() + + +method +

+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by +the + +filter +buffer +map +by +name +and +type + +algorithm +with + +name + +and + +type + +set +to + +null +. +

+
+ +
+
+

+ +3.1.2 + + + +getEntriesByType() + + +method +

+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +map +by +name +and +type + +algorithm +with + +name + +set +to + +null +, +and + +type + +set +to +the +method's +input + +type + +parameter. +

+
+ +
+
+

+ +3.1.3 + + + +getEntriesByName() + + +method +

+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +map +by +name +and +type + +algorithm +with + +name + +set +to +the +method +input + +name + +parameter, +and + +type + +set +to + +null + +if +optional + +entryType + +is +omitted, +or +set +to +the +method's +input + +type + +parameter +otherwise. +

+
+
+
+ +
+
+

+ +4. + +The + + +PerformanceEntry + + +interface +

+ + +
+

+The + + +PerformanceEntry + + +interface +hosts +the +performance +data +of +various +metrics. +

+
WebIDL[Exposed=(Window,Worker)]
+interface PerformanceEntry {
+  readonly    attribute DOMString           name;
+  readonly    attribute DOMString           entryType;
+  readonly    attribute DOMHighResTimeStamp startTime;
+  readonly    attribute DOMHighResTimeStamp duration;
+  [Default] object toJSON();
+};
+
+
+
+
+
+ + +name + + +
+
+This +attribute + +MUST + +return +an +identifier +for +this + + +PerformanceEntry + + +object. +This +identifier +does +not +have +to +be +unique. +
+
+ + +entryType + + +
+
+This +attribute + +MUST + +return +the +type +of +the +interface +represented +by +this + + +PerformanceEntry + + +object. +
+
+ +Note + +
+

+All + +entryType + +values +are +defined +in +the +relevant + +registry +. +Examples +include: + +"mark" + +and + +"measure" + +[ + + +USER-TIMING-2 + + +], + +"navigation" + +[ + + +NAVIGATION-TIMING-2 + + +], + +"resource" + +[ + + +RESOURCE-TIMING-2 + + +], +and + +"longtask" +. +

+
+
+ + +startTime + + +
+
+This +attribute + +MUST + +return +the +time +value +of +the +first +recorded +timestamp +of +this +performance +metric. +If +the +startTime +concept +doesn't +apply, +a +performance +metric +may +choose +to +return +a + +startTime + +of + +0 +. +
+
+ + +duration + + +
+
+This +attribute + +MUST + +return +the +time +value +of +the +duration +of +the +entire +event +being +recorded +by +this + + +PerformanceEntry + +. +Typically, +this +would +be +the +time +difference +between +the +last +recorded +timestamp +and +the +first +recorded +timestamp +of +this + + +PerformanceEntry + +. +If +the +duration +concept +doesn't +apply, +a +performance +metric +may +choose +to +return +a + +duration + +of + +0 +. +
+
+

+When + + +toJSON + + +is +called, +run +[ + + +WebIDL + + +]'s + +default +toJSON +steps +. +

+
+ +
+
+

+ +5. + +The + + +PerformanceObserver + + +interface +

+ + +
+

+The + + +PerformanceObserver + + +interface +can +be +used +to +observe +the + +Performance +Timeline + +to +be +notified +of +new +performance +metrics +as +they +are +recorded, +and +optionally +buffered +performance +metrics. +

+

+Each + + +PerformanceObserver + + +has +these +associated +concepts: +

+
    +
  • +A + + +PerformanceObserverCallback + + + +observer +callback + +set +on +creation. +
  • +
  • +A + + +PerformanceEntryList + + +object +called +the + +observer +buffer + +that +is +initially +empty. +
  • +
  • +A + +DOMString + + +observer +type + +which +is +initially + +"undefined" +. +
  • +
  • +A +boolean + +requires +dropped +entries + +which +is +initially +set +to +false. +
  • +
+

+The + +PerformanceObserver(callback) + +constructor +must +create +a +new + + +PerformanceObserver + + +object +with +its + +observer +callback + +set +to + +callback + +and +then +return +it. +

+

+A + +registered +performance +observer + +is +a + +struct + +consisting +of +an + +observer + +member +(a + + +PerformanceObserver + + +object) +and +an + +options +list + +member +(a +list +of + + +PerformanceObserverInit + + +dictionaries). +

+
WebIDLcallback PerformanceObserverCallback = undefined (PerformanceObserverEntryList entries,
+                                             PerformanceObserver observer,
+                                             optional PerformanceObserverCallbackOptions options = {});
+[Exposed=(Window,Worker)]
+interface PerformanceObserver {
+  constructor(PerformanceObserverCallback callback);
+  undefined observe (optional PerformanceObserverInit options = {});
+  undefined disconnect ();
+  PerformanceEntryList takeRecords();
+  [SameObject] static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
+};
+
+
+
+
+
+ +Note + +
+

+To +keep +the +performance +overhead +to +minimum +the +application +ought +to +only +subscribe +to +event +types +that +it +is +interested +in, +and +disconnect +the +observer +once +it +no +longer +needs +to +observe +the +performance +data. +Filtering +by +name +is +not +supported, +as +it +would +implicitly +require +a +subscription +for +all +event +types + +this +is +possible, +but +discouraged, +as +it +will +generate +a +significant +volume +of +events. +

+
+
+

+ +5.1 + + + +PerformanceObserverCallbackOptions + + +dictionary +

+ + +
+> +
WebIDLdictionary PerformanceObserverCallbackOptions {
+  unsigned long long droppedEntriesCount;
+};
+
+
+
+
+
+ + +droppedEntriesCount + + +
+
+An +integer +representing +the +dropped +entries +count +for +the +entry +types +that +the +observer +is +observing +when +the + + +PerformanceObserver + + +'s + +requires +dropped +entries + +is +set. +
+
+
+ +
+
+

+ +5.2 + + + +observe() + + +method +

+ + +
+

+The + + +observe() + + +method +instructs +the +user +agent +to +register +the +observer +and +must +run +these +steps: +

+
    +
  1. +Let + +relevantGlobal + +be + +this + +'s + +relevant +global +object +. +
  2. +
  3. +If + +options + +'s + + +entryTypes + + +and + + +type + + +members +are +both +omitted, +then + +throw + +a +" + + +TypeError + + +". +
  4. +
  5. +If + +options + +'s + + +entryTypes + + +is +present +and +any +other +member +is +also +present, +then + +throw + +a +" + + +TypeError + + +". +
  6. +
  7. +Update +or +check + +this + +'s + +observer +type + +by +running +these +steps: +
      +
    1. +If + +this + +'s + +observer +type + +is + +"undefined" +: +
        +
      1. +If + +options + +'s + + +entryTypes + + +member +is +present, +then +set + +this + +'s + +observer +type + +to + +"multiple" +. +
      2. +
      3. +If + +options + +'s + + +type + + +member +is +present, +then +set + +this + +'s + +observer +type + +to + +"single" +. +
      4. +
      +
    2. +
    3. +If + +this + +'s + +observer +type + +is + +"single" + +and + +options + +'s + + +entryTypes + + +member +is +present, +then + +throw + +an +" + + +InvalidModificationError + + +". +
    4. +
    5. +If + +this + +'s + +observer +type + +is + +"multiple" + +and + +options + +'s + + +type + + +member +is +present, +then + +throw + +an +" + + +InvalidModificationError + + +". +
    6. +
    +
  8. +
  9. +Set + +this + +'s + +requires +dropped +entries + +to +true. +
  10. +
  11. +If + +this + +'s + +observer +type + +is + +"multiple" +, +run +the +following +steps: +
      +
    1. +Let + +entry +types + +be + +options + +'s + + +entryTypes + + +sequence. +
    2. +
    3. +Remove +all +types +from + +entry +types + +that +are +not +contained +in + +relevantGlobal + +'s + +frozen +array +of +supported +entry +types +. +The +user +agent + +SHOULD + +notify +developers +if + +entry +types + +is +modified. +For +example, +a +console +warning +listing +removed +types +might +be +appropriate. +
    4. +
    5. +If +the +resulting + +entry +types + +sequence +is +an +empty +sequence, +abort +these +steps. +The +user +agent + +SHOULD + +notify +developers +when +the +steps +are +aborted +to +notify +that +registration +has +been +aborted. +For +example, +a +console +warning +might +be +appropriate. +
    6. +
    7. +If +the + +list +of +registered +performance +observer +objects + +of + +relevantGlobal + +contains +a + +registered +performance +observer + +whose + +observer + +is + +this +, +replace +its + +options +list + +with +a +list +containing + +options + +as +its +only +item. +
    8. +
    9. +Otherwise, +create +and +append +a + +registered +performance +observer + +object +to +the + +list +of +registered +performance +observer +objects + +of + +relevantGlobal +, +with + +observer + +set +to + +this + +and + +options +list + +set +to +a +list +containing + +options + +as +its +only +item. +
    10. +
    +
  12. +
  13. +Otherwise, +run +the +following +steps: +
      +
    1. +Assert +that + +this + +'s + +observer +type + +is + +"single" +. +
    2. +
    3. +If + +options + +'s + + +type + + +is +not +contained +in +the + +relevantGlobal + +'s + +frozen +array +of +supported +entry +types +, +abort +these +steps. +The +user +agent + +SHOULD + +notify +developers +when +this +happens, +for +instance +via +a +console +warning. +
    4. +
    5. +If +the + +list +of +registered +performance +observer +objects + +of + +relevantGlobal + +contains +a + +registered +performance +observer + + +obs + +whose + +observer + +is + +this +: +
        +
      1. +If + +obs + +'s + +options +list + +contains +a + + +PerformanceObserverInit + + +item + +currentOptions + +whose + + +type + + +is +equal +to + +options + +'s + + +type + +, +replace + +currentOptions + +with + +options + +in + +obs + +'s + +options +list +. +
      2. +
      3. +Otherwise, +append + +options + +to + +obs + +'s + +options +list +. +
      4. +
      +
    6. +
    7. +Otherwise, +create +and +append +a + +registered +performance +observer + +object +to +the + +list +of +registered +performance +observer +objects + +of + +relevantGlobal +, +with + +observer + +set +to +the + +this + +and + +options +list + +set +to +a +list +containing + +options + +as +its +only +item. +
    8. +
    9. +If + +options + +'s + + +buffered + + +flag +is +set: +
        +
      1. +Let + +tuple + +be +the + +relevant +performance +entry +tuple + +of + +options + +'s + + +type + + +and + +relevantGlobal +. +
      2. +
      3. +

        +For +each + +entry + +in + +tuple + +'s + +performance +entry +buffer +: +

        +
          +
        1. +If + +should +add +entry + +with + +entry + +and + +options + +as +parameters +returns +true, + +append + + +entry + +to +the + +observer +buffer +. +
        2. +
        +
      4. +
      5. + +Queue +the +PerformanceObserver +task + +with + +relevantGlobal + +as +input. +
      6. +
      +
    10. +
    +
  14. +
+
+
+ +Note + +
+

+A + + +PerformanceObserver + + +object +needs +to +always +call + + +observe() + + +with + +options + +'s + + +entryTypes + + +set +OR +always +call + + +observe() + + +with + +options + +'s + + +type + + +set. +If +one + + +PerformanceObserver + + +calls + + +observe() + + +with + + +entryTypes + + +and +also +calls +observe +with + + +type + +, +then +an +exception +is +thrown. +This +is +meant +to +avoid +confusion +with +how +calls +would +stack. +When +using + + +entryTypes + +, +no +other +parameters +in + + +PerformanceObserverInit + + +can +be +used. +In +addition, +multiple + + +observe() + + +calls +will +override +for +backwards +compatibility +and +because +a +single +call +should +suffice +in +this +case. +On +the +other +hand, +when +using + + +type + +, +calls +will +stack +because +a +single +call +can +only +specify +one +type. +Calling + + +observe() + + +with +a +repeated + + +type + + +will +also +override. +

+
+
+

+ +5.2.1 + + + +PerformanceObserverInit + + +dictionary +

+ + +
+
WebIDLdictionary PerformanceObserverInit {
+  sequence<DOMString> entryTypes;
+  DOMString type;
+  boolean buffered;
+};
+
+
+
+
+
+ + +entryTypes + + +
+
+A +list +of +entry +types +to +be +observed. +If +present, +the +list + +MUST +NOT + +be +empty +and +all +other +members + +MUST +NOT + +be +present. +Types +not +recognized +by +the +user +agent + +MUST + +be +ignored. +
+
+
+
+ + +type + + +
+
+A +single +entry +type +to +be +observed. +A +type +that +is +not +recognized +by +the +user +agent + +MUST + +be +ignored. +Other +members +may +be +present. +
+
+
+
+ + +buffered + + +
+
+A +flag +to +indicate +whether +buffered +entries +should +be +queued +into +observer's +buffer. +
+
+
+ +
+
+

+ +5.2.2 + + + +PerformanceObserverEntryList + + +interface +

+ + +
+
WebIDL[Exposed=(Window,Worker)]
+interface PerformanceObserverEntryList {
+  PerformanceEntryList getEntries();
+  PerformanceEntryList getEntriesByType (DOMString type);
+  PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
+};
+
+
+
+

+Each + + +PerformanceObserverEntryList + + +object +has +an +associated + +entry +list +, +which +consists +of +a + + +PerformanceEntryList + + +and +is +initialized +upon +construction. +

+ +
+
+
+ +5.2.2.1 + + + +getEntries() + + +method +
+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +by +name +and +type + +algorithm +with + +this + +'s + +entry +list +, + +name + +and + +type + +set +to + +null +. +

+
+ +
+
+
+ +5.2.2.2 + + + +getEntriesByType() + + +method +
+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +by +name +and +type + +algorithm +with + +this + +'s + +entry +list +, + +name + +set +to + +null +, +and + +type + +set +to +the +method's +input + +type + +parameter. +

+
+ +
+
+
+ +5.2.2.3 + + + +getEntriesByName() + + +method +
+ + +
+

+Returns +a + + +PerformanceEntryList + + +object +returned +by + +filter +buffer +by +name +and +type + +algorithm +with + +this + +'s + +entry +list +, + +name + +set +to +the +method +input + +name + +parameter, +and + +type + +set +to + +null + +if +optional + +entryType + +is +omitted, +or +set +to +the +method's +input + +type + +parameter +otherwise. +

+
+
+
+ +
+
+

+ +5.3 + + + +takeRecords() + + +method +

+ + +
+

+The + + +takeRecords() + + +method +must +return +a +copy +of + +this + +'s + +observer +buffer +, +and +also +empty + +this + +'s + +observer +buffer +. +

+
+ +
+
+

+ +5.4 + + + +disconnect() + + +method +

+ + +
+

+The + + +disconnect() + + +method +must +do +the +following: +

+
    +
  1. +Remove + +this + +from +the + +list +of +registered +performance +observer +objects + +of + +relevant +global +object +. +
  2. +
  3. +Empty + +this + +'s + +observer +buffer +. +
  4. +
  5. +Empty + +this + +'s + +options +list +. +
  6. +
+
+ +
+
+

+ +5.5 + + + +supportedEntryTypes + + +attribute +

+ + +
+

+Each + +global +object + +has +an +associated + +frozen +array +of +supported +entry +types +, +which +is +initialized +to +the + +FrozenArray + + +created + +from +the +sequence +of +strings +among +the + +registry + +that +are +supported +for +the +global +object, +in +alphabetical +order. +

+

+When + + +supportedEntryTypes + + +'s +attribute +getter +is +called, +run +the +following +steps: +

+
    +
  1. +Let + +globalObject + +be +the + +environment +settings +object's +global +object +. +
  2. +
  3. +Return + +globalObject + +'s + +frozen +array +of +supported +entry +types +. +
  4. +
+
+
+ +Note + +
+

+This +attribute +allows +web +developers +to +easily +know +which +entry +types +are +supported +by +the +user +agent. +

+
+
+
+
+

+ +6. + +Processing +

+ + +
+
+
+

+ +6.1 + +Queue +a + +PerformanceEntry + +

+ + +
+

+To + +queue +a +PerformanceEntry + +( + +newEntry + +), +run +these +steps: +

+
    +
  1. +Let + +interested +observers + +be +an +initially +empty +set +of + + +PerformanceObserver + + +objects. +
  2. +
  3. +Let + +entryType + +be + +newEntry + +s + + +entryType + + +value. +
  4. +
  5. +Let + +relevantGlobal + +be + +newEntry + +'s + +relevant +global +object +. +
  6. +
  7. +For +each + +registered +performance +observer + + +regObs + +in + +relevantGlobal + +'s + +list +of +registered +performance +observer +objects +: +
      +
    1. +

      +If + +regObs + +'s + +options +list + +contains +a + + +PerformanceObserverInit + + + +options + +whose + + +entryTypes + + +member +includes + +entryType + +or +whose + + +type + + +member +equals +to + +entryType +: +

      +
        +
      1. +If + +should +add +entry + +with + +newEntry + +and + +options + +returns +true, +append + +regObs + +'s + +observer + +to + +interested +observers +. +
      2. +
      +
    2. +
    +
  8. +
  9. +For +each + +observer + +in + +interested +observers +: +
      +
    1. +Append + +newEntry + +to + +observer + +'s + +observer +buffer +. +
    2. +
    +
  10. +
  11. +Let + +tuple + +be +the + +relevant +performance +entry +tuple + +of + +entryType + +and + +relevantGlobal +. +
  12. +
  13. +Let + +isBufferFull + +be +the +return +value +of +the + +determine +if +a +performance +entry +buffer +is +full + +algorithm +with + +tuple + +as +input. +
  14. +
  15. +Let + +shouldAdd + +be +the +result +of + +should +add +entry + +with + +newEntry + +as +input. +
  16. +
  17. +If + +isBufferFull + +is +false +and + +shouldAdd + +is +true, + +append + + +newEntry + +to + +tuple + +'s + +performance +entry +buffer +. +
  18. +
  19. + +Queue +the +PerformanceObserver +task + +with + +relevantGlobal + +as +input. +
  20. +
+
+
+
+

+ +6.2 + +Queue +the +PerformanceObserver +task +

+ + +
+

+When +asked +to + +queue +the +PerformanceObserver +task +, +given + +relevantGlobal + +as +input, +run +the +following +steps: +

+
    +
  1. +If + +relevantGlobal + +'s + +performance +observer +task +queued +flag + +is +set, +terminate +these +steps. +
  2. +
  3. +Set + +relevantGlobal + +'s + +performance +observer +task +queued +flag +. +
  4. +
  5. + +Queue +a +task + +that +consists +of +running +the +following +substeps. +The + +task +source + +for +the +queued +task +is +the + +performance +timeline +task +source +. +
      +
    1. +Unset + +performance +observer +task +queued +flag + +of + +relevantGlobal +. +
    2. +
    3. +Let + +notifyList + +be +a +copy +of + +relevantGlobal + +'s + +list +of +registered +performance +observer +objects +. +
    4. +
    5. +For +each + +registered +performance +observer + +object + +registeredObserver + +in + +notifyList +, +run +these +steps: +
        +
      1. +Let + +po + +be + +registeredObserver + +'s + +observer +. +
      2. +
      3. +Let + +entries + +be +a +copy +of + +po + +s + +observer +buffer +. +
      4. +
      5. +If + +entries + +is +empty, +return. +
      6. +
      7. +Empty + +po + +s + +observer +buffer +. +
      8. +
      9. +Let + +observerEntryList + +be +a +new + + +PerformanceObserverEntryList + +, +with +its + +entry +list + +set +to + +entries +. +
      10. +
      11. +Let + +droppedEntriesCount + +be +null. +
      12. +
      13. +If + +po + +'s + +requires +dropped +entries + +is +set, +perform +the +following +steps: +
          +
        1. +Set + +droppedEntriesCount + +to +0. +
        2. +
        3. +For +each + + +PerformanceObserverInit + + + +item + +in + +registeredObserver + +'s + +options +list +: +
            +
          1. +For +each + +DOMString + + +entryType + +that +appears +either +as + +item + +'s + + +type + + +or +in + +item + +'s + + +entryTypes + +: +
              +
            1. +Let + +map + +be + +relevantGlobal + +'s + +performance +entry +buffer +map +. +
            2. +
            3. +Let + +tuple + +be +the +result +of + +getting +the +value +of +entry + +on + +map + +given + +entryType + +as + +key +. +
            4. +
            5. +Increase + +droppedEntriesCount + +by + +tuple + +'s + +dropped +entries +count +. +
            6. +
            +
          2. +
          +
        4. +
        5. +Set + +po + +'s + +requires +dropped +entries + +to +false. +
        6. +
        +
      14. +
      15. +Let + +callbackOptions + +be +a + + +PerformanceObserverCallbackOptions + + +with +its + + +droppedEntriesCount + + +set +to + +droppedEntriesCount + +if + +droppedEntriesCount + +is +not +null, +otherwise +unset. +
      16. +
      17. +Call + +po + +s + +observer +callback + +with + +observerEntryList + +as +the +first +argument, +with + +po + +as +the +second +argument +and +as + +callback +this +value +, +and +with + +callbackOptions + +as +the +third +argument. +If +this + +throws + +an +exception, + +report +the +exception +. +
      18. +
      +
    6. +
    +
  6. +
+

+The + +performance +timeline + + +task +queue + +is +a +low +priority +queue +that, +if +possible, +should +be +processed +by +the +user +agent +during +idle +periods +to +minimize +impact +of +performance +monitoring +code. +

+
+
+
+

+ +6.3 + +Filter +buffer +map +by +name +and +type +

+ + +
+

+When +asked +to +run +the + +filter +buffer +map +by +name +and +type + +algorithm +with +optional + +name + +and + +type +, +run +the +following +steps: +

+
    +
  1. +Let + +result + +be +an +initially +empty + +list +. +
  2. +
  3. +Let + +map + +be +the + +performance +entry +buffer +map + +associated +with +the + +relevant +global +object + +of + +this +. +
  4. +
  5. +Let + +tuple +list + +be +an +empty + +list +. +
  6. +
  7. +If + +type + +is +not +null, +append +the +result +of + +getting +the +value +of +entry + +on + +map + +given + +type + +as + +key + +to + +tuple +list +. +Otherwise, +assign +the +result +of + +get +the +values + +on + +map + +to + +tuple +list +. +
  8. +
  9. +For +each + +tuple + +in + +tuple +list +, +run +the +following +steps: +
      +
    1. +Let + +buffer + +be + +tuple + +'s + +performance +entry +buffer +. +
    2. +
    3. +If + +tuple + +'s + +availableFromTimeline + +is +false, +continue +to +the +next + +tuple +. +
    4. +
    5. +Let + +entries + +be +the +result +of +running + +filter +buffer +by +name +and +type + +with + +buffer +, + +name + +and + +type + +as +inputs. +
    6. +
    7. +For +each + +entry + +in + +entries +, + +append + + +entry + +to + +result +. +
    8. +
    +
  10. +
  11. +Sort + +results + +'s +entries +in +chronological +order +with +respect +to + + +startTime + + +
  12. +
  13. +Return + +result +. +
  14. +
+
+
+
+

+ +6.4 + +Filter +buffer +by +name +and +type +

+ + +
+

+When +asked +to +run +the + +filter +buffer +by +name +and +type + +algorithm, +with + +buffer +, + +name +, +and + +type + +as +inputs, +run +the +following +steps: +

+
    +
  1. +Let + +result + +be +an +initially +empty + +list +. +
  2. +
  3. +For +each + + +PerformanceEntry + + + +entry + +in + +buffer +, +run +the +following +steps: +
      +
    1. +If + +type + +is +not +null +and +if + +type + +is +not + +identical +to + + +entry + +'s + +entryType + +attribute, +continue +to +next + +entry +. +
    2. +
    3. +If + +name + +is +not +null +and +if + +name + +is +not + +identical +to + + +entry + +'s + +name + +attribute, +continue +to +next + +entry +. +
    4. +
    5. + +append + + +entry + +to + +result +. +
    6. +
    +
  4. +
  5. +Sort + +results + +'s +entries +in +chronological +order +with +respect +to + + +startTime + + +
  6. +
  7. +Return + +result +. +
  8. +
+
+
+
+

+ +6.5 + +Determine +if +a +performance +entry +buffer +is +full +

+ + +
+

+To + +determine +if +a +performance +entry +buffer +is +full +, +with + +tuple + +as +input, +run +the +following +steps: +

+
    +
  1. +Let + +num +current +entries + +be +the +size +of + +tuple + +'s + +performance +entry +buffer +. +
  2. +
  3. +If + +num +current +entries + +is +less +than + +tuples + +'s + +maxBufferSize +, +return +false. +
  4. +
  5. +Increase + +tuple + +'s + +dropped +entries +count + +by +1. +
  6. +
  7. +Return +true. +
  8. +
+
+
+
+
+

+ +7. + +Privacy +Considerations +

+ + +
+

+This +specification +extends +the + + +Performance + + +interface +defined +by +[ + + +HR-TIME-3 + + +] +and +provides +methods +to +queue +and +retrieve +entries +from +the + +performance +timeline +. +Please +refer +to +[ + + +HR-TIME-3 + + +] +for +privacy +considerations +of +exposing +high-resoluting +timing +information. +Each +new +specification +introducing +new +performance +entries +should +have +its +own +privacy +considerations +as +well. +

+
+
+
+

+ +8. + +Security +Considerations +

+ + +
+

+This +specification +extends +the + + +Performance + + +interface +defined +by +[ + + +HR-TIME-3 + + +] +and +provides +methods +to +queue +and +retrieve +entries +from +the + +performance +timeline +. +Please +refer +to +[ + + +HR-TIME-3 + + +] +for +security +considerations +of +exposing +high-resoluting +timing +information. +Each +new +specification +introducing +new +performance +entries +should +have +its +own +security +considerations +as +well. +

+
+
+
+

+ +9. + +Dependencies +

+ + +
+

+The +[ + + +INFRA + + +] +specification +defines +the +following: + + +key + +, + + +getting +the +value +of +an +entry + +. +

+
+

A. IDL Index

WebIDLpartial interface Performance {
+  PerformanceEntryList getEntries ();
+  PerformanceEntryList getEntriesByType (DOMString type);
+  PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
+};
+typedef sequence<PerformanceEntry> PerformanceEntryList;
+[Exposed=(Window,Worker)]
+interface PerformanceEntry {
+  readonly    attribute DOMString           name;
+  readonly    attribute DOMString           entryType;
+  readonly    attribute DOMHighResTimeStamp startTime;
+  readonly    attribute DOMHighResTimeStamp duration;
+  [Default] object toJSON();
+};
+callback PerformanceObserverCallback = undefined (PerformanceObserverEntryList entries,
+                                             PerformanceObserver observer,
+                                             optional PerformanceObserverCallbackOptions options = {});
+[Exposed=(Window,Worker)]
+interface PerformanceObserver {
+  constructor(PerformanceObserverCallback callback);
+  undefined observe (optional PerformanceObserverInit options = {});
+  undefined disconnect ();
+  PerformanceEntryList takeRecords();
+  [SameObject] static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
+};
+dictionary PerformanceObserverCallbackOptions {
+  unsigned long long droppedEntriesCount;
+};
+dictionary PerformanceObserverInit {
+  sequence<DOMString> entryTypes;
+  DOMString type;
+  boolean buffered;
+};
+[Exposed=(Window,Worker)]
+interface PerformanceObserverEntryList {
+  PerformanceEntryList getEntries();
+  PerformanceEntryList getEntriesByType (DOMString type);
+  PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
+};
+
+
+
+
+
+
+

+ +B. + +Acknowledgments +

+ + +
+

+Thanks +to +Arvind +Jain, +Boris +Zbarsky, +Jatinder +Mann, +Nat +Duca, +Philippe +Le +Hegaret, +Ryosuke +Niwa, +Shubhie +Panicker, +Todd +Reifsteck, +Yoav +Weiss, +and +Zhiheng +Wang, +for +their +contributions +to +this +work. +

+
+
+
+

+ +C. + +References +

+ + +
+
+
+

+ +C.1 + +Normative +references +

+ + +
+
+
+[HR-TIME-3] +
+ + +High +Resolution +Time + +. +Yoav +Weiss. +W3C. +20 +September +2022. +W3C +Working +Draft. +URL: + +https://www.w3.org/TR/hr-time-3/ + +
+[HTML] +
+ + +HTML +Standard + +. +Anne +van +Kesteren; +Domenic +Denicola; +Ian +Hickson; +Philip +Jgenstedt; +Simon +Pieters. +WHATWG. +Living +Standard. +URL: + +https://html.spec.whatwg.org/multipage/ + +
+[INFRA] +
+ + +Infra +Standard + +. +Anne +van +Kesteren; +Domenic +Denicola. +WHATWG. +Living +Standard. +URL: + +https://infra.spec.whatwg.org/ + +
+[RFC2119] +
+ + +Key +words +for +use +in +RFCs +to +Indicate +Requirement +Levels + +. +S. +Bradner. +IETF. +March +1997. +Best +Current +Practice. +URL: + +https://www.rfc-editor.org/rfc/rfc2119 + +
+[RFC8174] +
+ + +Ambiguity +of +Uppercase +vs +Lowercase +in +RFC +2119 +Key +Words + +. +B. +Leiba. +IETF. +May +2017. +Best +Current +Practice. +URL: + +https://www.rfc-editor.org/rfc/rfc8174 + +
+[WebIDL] +
+ + +Web +IDL +Standard + +. +Edgar +Chen; +Timothy +Gu. +WHATWG. +Living +Standard. +URL: + +https://webidl.spec.whatwg.org/ + +
+
+
+
+

+ +C.2 + +Informative +references +

+ + +
+
+
+[NAVIGATION-TIMING-2] +
+ + +Navigation +Timing +Level +2 + +. +Yoav +Weiss; +Noam +Rosenthal. +W3C. +7 +September +2022. +W3C +Working +Draft. +URL: + +https://www.w3.org/TR/navigation-timing-2/ + +
+[PERFORMANCE-TIMELINE] +
+ + +Performance +Timeline + +. +Nicolas +Pena +Moreno. +W3C. +2 +December +2021. +W3C +Candidate +Recommendation. +URL: + +https://www.w3.org/TR/performance-timeline/ + +
+[RESOURCE-TIMING-2] +
+ + +Resource +Timing +Level +2 + +. +Yoav +Weiss; +Noam +Rosenthal. +W3C. +29 +September +2022. +W3C +Working +Draft. +URL: + +https://www.w3.org/TR/resource-timing-2/ + +
+[USER-TIMING-2] +
+ + +User +Timing +Level +2 + +. +Ilya +Grigorik. +W3C. +26 +February +2019. +W3C +Recommendation. +URL: + +https://www.w3.org/TR/user-timing-2/ + +
+[WORKERS] +
+ + +Web +Workers + +. +Ian +Hickson. +W3C. +28 +January +2021. +W3C +Working +Group +Note. +URL: + +https://www.w3.org/TR/workers/ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +https://pr-preview.s3.amazonaws.com/w3c/performance-timeline/204/925ae5e...e1b67dc.html#dom-performanceobserver-takerecords + +/* +*** IMPORTANT *** +Update main.js and main.js.gz with Makefile when making modifications + */ + +var enquire = { + config : { + imgs : "/2008/site/images/" + }, + + init : function() { + var c = enquire; + appliedMedia = false; + var styleTag = document.getElementsByTagName('style')[0]; + document.addEventListener("DOMContentLoaded", function() { + document.body.classList.add("w3c_javascript"); + + var ua = window.navigator.userAgent; + var msie = ua.indexOf("MSIE "); + if (msie > 0) { + Array.prototype.forEach.call(document.querySelector("style"), function (el) { + el.setAttribute("media", "screen"); + }); + var ieversion = parseInt(ua.substring(msie + 5, ua.indexOf(".", msie))); + if (ieversion <= 6) { + var stylesheet = document.createElement("link"); + stylesheet.setAttribute("rel", "stylesheet"); + stylesheet.setAttribute("href", "/2008/site/css/IE6.css'"); + document.head.appendChild(stylesheet); + } + } + + var header = document.createElement("p"); + header.style.marginLeft = "2.4%"; + header.style.paddingLeft = "10px"; + header.style.color = "#666"; + header.style.backgroundColor = "#eee"; + header.style.fontStyle = "italic"; + header.style.fontSize = "1.2em"; + header.innerText = "Leading the web to its full potential"; + document.querySelector("#w3c_nav div.w3c_sec_nav").appendChild(header); + detectAppliedMedia(); + }); + + // + function switchDisplayMode(media) { + // and disable the selected icon + if (media === 'handheld') { + document.body.classList.add("w3c_handheld"); + document.body.classList.remove("w3c_print"); + document.body.classList.remove("w3c_screen"); + } else if (media === 'print') { + document.body.classList.add("w3c_print"); + document.body.classList.remove("w3c_handheld"); + document.body.classList.remove("w3c_screen"); + } else { + document.body.classList.add("w3c_screen"); + document.body.classList.remove("w3c_handheld"); + document.body.classList.remove("w3c_print"); + } + // Adjusting expand/togglable sections + c.tree.init("expand_section", media); + c.toggableInclude.init(media); + } + + function detectAppliedMedia() { + // Detecting which media is being applied by looking up a specific style + var style = window.getComputedStyle(document.querySelector("#w3c_mast h1 a img")); + if (style.display === 'none') { + if (!appliedMedia || appliedMedia!='screen') { + switchDisplayMode("screen"); + appliedMedia = "screen"; + } + } else { + if (!appliedMedia || appliedMedia!='handheld') { + switchDisplayMode("handheld"); + appliedMedia = "handheld"; + } + } + } + }, + + /* + Expandable/collapsible list + */ + tree : { + init : function(sClass, media) { + /* for dynamic changes, don't change classes use style with class on body*/ + var c = enquire; + var t = c.tree; + Array.prototype.forEach.call(document.querySelectorAll(".hierarchy ." + sClass), function(el) { + var parents = Array.prototype.filter.call(t.parents(el), function (e) { + return (e.tagName === "DIV" || e.tagName === "LI") && e.classList.contains("expand_block"); + }); + /* Attach click handlers to each .expand_section elementexcept when expanded and not in print, mobile mode */ + if ((media!='print') && (media!='handheld')) { + if (el.classList.contains("closed") && parents) { + Array.prototype.forEach.call(parents, function (p) { + p.classList.add("closed"); + }); + } + if (!el.querySelector("img")) { + var isClosed = Array.prototype.some.call(parents, function(p) { + return p.classList.contains("closed"); + }); + var icon = document.createElement("img"); + icon.setAttribute("width", "9"); + icon.setAttribute("height", "9"); + + if (isClosed) { + icon.setAttribute("src", "/2008/site/images/ico-plus"); + icon.setAttribute("alt", "Expand"); + } else { + icon.setAttribute("src", "/2008/site/images/ico-minus"); + icon.setAttribute("alt", "Collapse"); + } + el.insertBefore(icon, el.firstChild); + var wrapper = document.createElement("a"); + wrapper.setAttribute("href", "#"); + el.appendChild(wrapper); + while (el.firstChild !== wrapper) { + wrapper.appendChild(el.firstChild); + } + } + + el.addEventListener("click", function(event) { + var target = el.querySelector("a[href]").getAttribute("href"); + var hash = target.substring(target.indexOf('#')); + if (hash !== "#") { + window.location.hash = hash; + } + event.preventDefault(); + t.toggle(el); + var isClosed = Array.prototype.some.call(parents, function(p) { + return p.classList.contains("closed"); + }); + var icon = el.querySelector("img"); + if (isClosed) { + icon.setAttribute("src", "/2008/site/images/ico-plus"); + icon.setAttribute("alt", "Expand"); + } else { + icon.setAttribute("src", "/2008/site/images/ico-minus"); + icon.setAttribute("alt", "Collapse"); + } + }); + } else { + // removes all the inner markup + el.textContent = el.innerText; + } + }); + }, + + parents: function(e) { + var result = []; + for (var p = e && e.parentElement; p; p = p.parentElement) { + result.push(p); + } + return result; + }, + + toggle : function(el) { + var t = enquire.tree; + var parents = Array.prototype.filter.call(t.parents(el), function (e) { + return (e.tagName === "DIV" || e.tagName === "LI") && e.classList.contains("expand_block"); + }); + Array.prototype.forEach.call(parents, function (p) { + p.classList.toggle("closed"); + }); + } + }, + /* + UI to toggle visibility of content in a page + */ + toggableInclude : { + init: function(media) { + var toggle = document.querySelector("#w3c_toggle_include"); + var c = enquire; + if ((media!='print') && (media!='handheld') && toggle) { + var startopen = toggle.classList.contains('default_open') || window.location.hash == '#w3c_all'; + if (!document.querySelector("#w3c_toggle_include_show")) { + var div = document.createElement('div'); + div.innerHTML = "
"; + document.querySelector("#w3c_toggle_include").insertAdjacentElement('afterend', div); + } + document.querySelector("#w3c_toggle_include_hide").addEventListener("change", function() { + var elements = document.querySelectorAll("p.expand_description, div.expand_description, ul.expand_description"); + Array.prototype.forEach.call(elements, function(e) { + e.parentElement.classList.add("closed"); + }); + var img = document.querySelectorAll(".expand_section img"); + Array.prototype.forEach.call(img, function(i) { + i.setAttribute("src", "/2008/site/images/ico-plus"); + i.setAttribute("alt", "Expand"); + }); + if (window.location.hash == '#w3c_all') { + window.location.hash = ''; + } + }); + document.querySelector("#w3c_toggle_include_show").addEventListener("change", function() { + var elements = document.querySelectorAll("p.expand_description, div.expand_description, ul.expand_description"); + Array.prototype.forEach.call(elements, function(e) { + e.parentElement.classList.remove("closed"); + }); + var img = document.querySelectorAll(".expand_section img"); + Array.prototype.forEach.call(img, function(i) { + i.setAttribute("src", "/2008/site/images/ico-minus"); + i.setAttribute("alt", "Collapse"); + }); + if (window.location.hash == '#w3c_all') { + window.location.hash = ''; + } + }); + if (!startopen) { + document.querySelector("#w3c_toggle_include_hide").dispatchEvent(new Event("change")); + } else { + document.querySelector("#w3c_toggle_include_show").dispatchEvent(new Event("change")); + } + } else { + var t = enquire.tree; + var toggleForm = document.querySelector("#w3c_toggle_include"); + var f = document.querySelector("#w3c_toggle_include_show"); + var forms = Array.prototype.filter.call(t.parents(f), function(e) { + return e.tagName === "FORM" && Array.prototype.some.call(e.parentNode.children, function (c) { return c === toggleForm; }) && e !== toggleForm; + }); + Array.prototype.forEach.call(forms, function (f) { + f.remove(); + }); + } + } + } +}; + +enquire.init(); \ No newline at end of file diff --git a/OrgLink.tsx b/OrgLink.tsx new file mode 100644 index 0000000..3c9248e --- /dev/null +++ b/OrgLink.tsx @@ -0,0 +1,28 @@ +import {clsx} from 'clsx' +import {Link} from '@primer/react' +import {orgHovercardPath} from '@github-ui/paths' +import type {Author} from '../commit-attribution-types' +import styles from './OrgLink.module.css' + +/** + * Renders the author of a commit. + */ +export function OrgLink({org, className}: {org: Author; className?: string}) { + if (!org) return null + + return ( +
+ + {org.login!} + +
+ ) +} + +try{ OrgLink.displayName ||= 'OrgLink' } catch {} \ No newline at end of file diff --git a/Overlay-43cda449.css b/Overlay-43cda449.css new file mode 100644 index 0000000..50daf83 --- /dev/null +++ b/Overlay-43cda449.css @@ -0,0 +1,2 @@ +@layer primer-react { @keyframes prc-Overlay-overlay-appear-JpFey{0%{opacity:0}to{opacity:1}}.prc-Overlay-Overlay-jfs-T{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);bottom:var(--bottom,auto);box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));height:auto;left:var(--left,auto);max-height:100vh;max-width:calc(100vw - 2rem);min-width:192px;overflow:hidden;position:absolute;right:var(--right,auto);top:var(--top,auto);width:auto}.prc-Overlay-Overlay-jfs-T:focus{outline:none}@media (forced-colors:active){.prc-Overlay-Overlay-jfs-T{outline:1px solid transparent}}.prc-Overlay-Overlay-jfs-T:where([data-reflow-container=true]){max-width:calc(100vw - 2rem)}.prc-Overlay-Overlay-jfs-T:where([data-overflow-auto]){overflow:auto}.prc-Overlay-Overlay-jfs-T:where([data-overflow-hidden]){overflow:hidden}.prc-Overlay-Overlay-jfs-T:where([data-overflow-scroll]){overflow:scroll}.prc-Overlay-Overlay-jfs-T:where([data-overflow-visible]){overflow:visible}.prc-Overlay-Overlay-jfs-T:where([data-height-xsmall]){height:192px}.prc-Overlay-Overlay-jfs-T:where([data-height-small]){height:256px}.prc-Overlay-Overlay-jfs-T:where([data-height-medium]){height:320px}.prc-Overlay-Overlay-jfs-T:where([data-height-large]){height:432px}.prc-Overlay-Overlay-jfs-T:where([data-height-xlarge]){height:600px}.prc-Overlay-Overlay-jfs-T:where([data-height-auto]),.prc-Overlay-Overlay-jfs-T:where([data-height-initial]){height:auto}.prc-Overlay-Overlay-jfs-T:where([data-height-fit-content]){height:-moz-fit-content;height:fit-content}.prc-Overlay-Overlay-jfs-T:where([data-max-height-xsmall]){max-height:192px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-small]){max-height:256px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-medium]){max-height:320px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-large]){max-height:432px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-xlarge]){max-height:600px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-fit-content]){max-height:-moz-fit-content;max-height:fit-content}.prc-Overlay-Overlay-jfs-T:where([data-width-small]){width:256px}.prc-Overlay-Overlay-jfs-T:where([data-width-medium]){width:320px}.prc-Overlay-Overlay-jfs-T:where([data-width-large]){width:480px}.prc-Overlay-Overlay-jfs-T:where([data-width-xlarge]){width:640px}.prc-Overlay-Overlay-jfs-T:where([data-width-xxlarge]){width:960px}.prc-Overlay-Overlay-jfs-T:where([data-width-auto]){width:auto}.prc-Overlay-Overlay-jfs-T:where([data-max-width-small]){max-width:256px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-medium]){max-width:320px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-large]){max-width:480px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-xlarge]){max-width:640px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-xxlarge]){max-width:960px}.prc-Overlay-Overlay-jfs-T:where([data-visibility-visible]){visibility:visible}.prc-Overlay-Overlay-jfs-T:where([data-visibility-hidden]){visibility:hidden}@media screen and (max-width:calc(48rem - 0.02px)){.prc-Overlay-Overlay-jfs-T:where([data-responsive=fullscreen]){border-radius:unset;height:100vh;left:0;margin:0;max-height:none;max-width:none;position:fixed;top:0;width:100vw}}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-variant=fullscreen]){height:100dvh}}@media (prefers-reduced-motion:no-preference){.prc-Overlay-Overlay-jfs-T{animation:prc-Overlay-overlay-appear-JpFey .2s cubic-bezier(.33,1,.68,1)}} +/*# sourceMappingURL=Overlay-43cda449.css.map */ } \ No newline at end of file diff --git a/aboutaddons.html b/aboutaddons.html new file mode 100644 index 0000000..d37bf54 --- /dev/null +++ b/aboutaddons.html @@ -0,0 +1,876 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aclient-env.ts b/aclient-env.ts new file mode 100644 index 0000000..aac1701 --- /dev/null +++ b/aclient-env.ts @@ -0,0 +1,80 @@ +export interface ClientEnvironment { + readonly locale: string + readonly featureFlags: string[] + readonly login?: string + readonly copilotApiOverrideUrl: string | null +} + +let env: ClientEnvironment | undefined + +let getServerEnv: (() => ClientEnvironment | undefined) | null = null + +export function getEnv() { + const serverEnv = getServerEnv ? getServerEnv() : undefined + const targetEnv = serverEnv ?? env + + if (!targetEnv) { + throw new Error( + 'Client env was requested before it was loaded. This likely means you are attempting to use client env at the module level in SSR, which is not supported. Please move your client env usage into a function.', + ) + } + + return targetEnv +} + +export function getLocale() { + return getEnv().locale ?? 'en-US' +} + +export function isLoggedIn() { + return !!getEnv().login +} + +export function getCurrentUserLogin() { + return getEnv().login +} + +function loadEnv() { + if (typeof document !== 'undefined') { + const envTag = document.getElementById('client-env') + if (envTag) { + try { + env = JSON.parse(envTag.textContent || '') + } catch (error) { + // eslint-disable-next-line no-console + console.error('Error parsing client-env', error) + } + } + } +} + +// Automatically load the env on initial page load +loadEnv() + +// This is a special helper method for setting the env in the SSR environment only +export function setClientEnvForSsr(clientEnv: ClientEnvironment | undefined) { + env = clientEnv +} + +export function setServerEnvGetter(getter: () => ClientEnvironment | undefined) { + getServerEnv = getter +} + +// This env object is used as a default for tests only and is not included in production builds +export const clientEnvForTests: ClientEnvironment = { + locale: 'en', + featureFlags: ['test_flag'], + copilotApiOverrideUrl: 'http://copilot-api.test', +} + +export function _resetForTests({loadNewEnv, forceUndefined}: {loadNewEnv: boolean; forceUndefined?: boolean}) { + // forget the current env + env = forceUndefined ? undefined : clientEnvForTests + // Note: we don't reset getServerEnv here because it's set once at module load time + // by client-env.server.ts and should persist across test resets + + if (loadNewEnv) { + // load the latest env + loadEnv() + } +} diff --git a/agentutils.ts b/agentutils.ts new file mode 100644 index 0000000..5e3820f --- /dev/null +++ b/agentutils.ts @@ -0,0 +1,12 @@ +import type {Author} from './commit-attribution-types' + +export function isBotOrApp(author: Author) { + const isApp = author.path?.startsWith('/apps/') ?? false + + // Copilot SWE agent should be rendered as circular, not square + if (isApp && author.login?.toLowerCase() === 'copilot-swe-agent') { + return false + } + + return isApp +} diff --git a/alive.ts b/alive.ts new file mode 100644 index 0000000..50bfc77 --- /dev/null +++ b/alive.ts @@ -0,0 +1,236 @@ +import type {AliveEvent, AliveSessionOptions, MetadataUpdate, Notifier, Subscription} from '@github/alive-client' +import {PresenceMetadataSet, SubscriptionSet, isPresenceChannel} from '@github/alive-client' +import {AliveSession} from './session' +import {debounce} from '@github/mini-throttle' +import {ready} from '@github-ui/document-ready' +import safeStorage from '@github-ui/safe-storage' +import {isSafari} from '@braintree/browser-detection' + +export interface Dispatchable { + dispatchEvent: (e: Event) => unknown +} + +function isSharedWorkerSupported(): boolean { + // There is currently a bug in safari that causes shared workers to stop working after a while + // see https://github.com/github/web-systems/issues/965 + if (isSafari()) return false + return 'SharedWorker' in window && safeStorage('localStorage').getItem('bypassSharedWorker') !== 'true' +} + +export function workerSrc(): string | null { + const url = document.head.querySelector(`link[rel=shared-web-socket-src]`)?.getAttribute('href') + + // ensure we have a valid URL, otherwise don't use the worker + if (!url || !url.startsWith('/')) { + return null + } + + return url +} + +function socketUrl(): string | null { + return document.head.querySelector('link[rel=shared-web-socket]')?.href ?? null +} + +function socketRefreshUrl(): string | null { + return ( + document.head.querySelector('link[rel=shared-web-socket]')?.getAttribute('data-refresh-url') ?? + null + ) +} + +function sessionIdentifier(): string | null { + return ( + document.head.querySelector('link[rel=shared-web-socket]')?.getAttribute('data-session-id') ?? null + ) +} + +/** + * dispatches events of type: 'socket:message' | 'socket:presence' + */ +function notify(subscribers: Iterable, {channel, type, data}: AliveEvent) { + for (const el of subscribers) { + el.dispatchEvent( + new CustomEvent(`socket:${type}`, { + bubbles: false, + cancelable: false, + detail: {name: channel, data}, + }), + ) + } +} + +class AliveSessionProxy { + #worker: SharedWorker + #subscriptions = new SubscriptionSet() + #presenceMetadata = new PresenceMetadataSet() + #notify: Notifier + + constructor( + src: string, + url: string, + refreshUrl: string, + sessionId: string, + notifier: Notifier, + options: AliveSessionOptions, + ) { + this.#notify = notifier + // eslint-disable-next-line ssr-friendly/no-dom-globals-in-constructor + this.#worker = new SharedWorker(`${src}?module=true`, { + name: `github-socket-worker-v3-${sessionId}`, + type: 'module', + }) + this.#worker.port.onmessage = ({data}) => this.#receive(data) + this.#worker.port.postMessage({connect: {url, refreshUrl, options}}) + } + + subscribe(subs: Array>) { + const added = this.#subscriptions.add(...subs) + if (added.length) { + this.#worker.port.postMessage({subscribe: added}) + } + + // We may be adding a subscription to a presence channel which is already subscribed. + // In this case, we need to explicitly ask the SharedWorker to send us the presence data. + const addedChannels = new Set(added.map(topic => topic.name)) + const redundantPresenceChannels = subs.reduce((redundantChannels, subscription) => { + const channel = subscription.topic.name + + if (isPresenceChannel(channel) && !addedChannels.has(channel)) { + redundantChannels.add(channel) + } + + return redundantChannels + }, new Set()) + + if (redundantPresenceChannels.size) { + this.#worker.port.postMessage({requestPresence: Array.from(redundantPresenceChannels)}) + } + } + + unsubscribeAll(...subscribers: Dispatchable[]) { + const removed = this.#subscriptions.drain(...subscribers) + if (removed.length) { + this.#worker.port.postMessage({unsubscribe: removed}) + } + + const updatedPresenceChannels = this.#presenceMetadata.removeSubscribers(subscribers) + this.sendPresenceMetadataUpdate(updatedPresenceChannels) + } + + updatePresenceMetadata(metadataUpdates: Array>) { + const updatedChannels = new Set() + + for (const update of metadataUpdates) { + // update the local metadata for this specific element + this.#presenceMetadata.setMetadata(update) + updatedChannels.add(update.channelName) + } + + // Send the full local metadata for these channels to the SharedWorker + this.sendPresenceMetadataUpdate(updatedChannels) + } + + sendPresenceMetadataUpdate(channelNames: Set) { + if (!channelNames.size) { + return + } + + const updatesForSharedWorker: Array, 'subscriber'>> = [] + + for (const channelName of channelNames) { + // get all metadata for this channel (from all elements) to send to the SharedWorker + updatesForSharedWorker.push({ + channelName, + metadata: this.#presenceMetadata.getChannelMetadata(channelName), + }) + } + + // Send the full metadata updates to the SharedWorker + this.#worker.port.postMessage({updatePresenceMetadata: updatesForSharedWorker}) + } + + online() { + this.#worker.port.postMessage({online: true}) + } + + offline() { + this.#worker.port.postMessage({online: false}) + } + + hangup() { + this.#worker.port.postMessage({hangup: true}) + } + + #notifyPresenceDebouncedByChannel = new Map>() + #receive(event: AliveEvent) { + const {channel} = event + + if (event.type === 'presence') { + // There are times when we get a flood of messages from the SharedWorker, such as a tab that has been idle for a long time and then comes back to the foreground. + // Since each presence message for a channel contains the full list of users, we can debounce the events and only notify subscribers with the last one + let debouncedNotify = this.#notifyPresenceDebouncedByChannel.get(channel) + if (!debouncedNotify) { + debouncedNotify = debounce((subscribers, debouncedEvent) => { + this.#notify(subscribers, debouncedEvent) + this.#notifyPresenceDebouncedByChannel.delete(channel) + }, 100) + this.#notifyPresenceDebouncedByChannel.set(channel, debouncedNotify) + } + + debouncedNotify(this.#subscriptions.subscribers(channel), event) + return + } + + // For non-presence messages, we can send them through immediately since they may contain different messages/data + this.#notify(this.#subscriptions.subscribers(channel), event) + } +} + +async function connect() { + const src = workerSrc() + if (!src) return + + const url = socketUrl() + if (!url) return + + const refreshUrl = socketRefreshUrl() + if (!refreshUrl) return + + const sessionId = sessionIdentifier() + if (!sessionId) return + + const createSession = () => { + const options: AliveSessionOptions = {} + + if (isSharedWorkerSupported()) { + try { + return new AliveSessionProxy(src, url, refreshUrl, sessionId, notify, options) + } catch { + // ignore errors. CSP will some times block SharedWorker creation. Fall back to standard AliveSession. + } + } + + return new AliveSession(url, refreshUrl, false, notify, options) + } + const session = createSession() + + window.addEventListener('online', () => session.online()) + window.addEventListener('offline', () => session.offline()) + window.addEventListener('pagehide', () => { + if ('hangup' in session) session.hangup() + }) + + return session +} + +async function connectWhenReady() { + await ready + return connect() +} + +let sessionPromise: undefined | ReturnType + +export function getSession() { + return (sessionPromise ||= connectWhenReady()) +} diff --git a/analytics-overrides.ts b/analytics-overrides.ts new file mode 100644 index 0000000..0cff533 --- /dev/null +++ b/analytics-overrides.ts @@ -0,0 +1,40 @@ +function queryLast(selector: string): T | undefined { + const list = document.querySelectorAll(selector) + if (list.length > 0) { + return list[list.length - 1] + } +} + +function pagePathname() { + const locationOverride = queryLast('meta[name=analytics-location]') + if (locationOverride) { + return locationOverride.content + } else { + return window.location.pathname + } +} + +function pageQuery() { + const stripParams = queryLast('meta[name=analytics-location-query-strip]') + let search = '' + + if (!stripParams) { + search = window.location.search + } + + const extraParams = queryLast('meta[name=analytics-location-params]') + if (extraParams) { + search += (search ? '&' : '?') + extraParams.content + } + + for (const meta of document.querySelectorAll('meta[name=analytics-param-rename]')) { + const names = meta.content.split(':', 2) + search = search.replace(new RegExp(`(^|[?&])${names[0]}($|=)`, 'g'), `$1${names[1]}$2`) + } + + return search +} + +export function requestUri() { + return `${window.location.protocol}//${window.location.host}${pagePathname() + pageQuery()}` +} diff --git a/apiinsights b/apiinsights new file mode 100644 index 0000000..b527393 --- /dev/null +++ b/apiinsights @@ -0,0 +1,91 @@ +// TODO: do not export those constants and instead provide functions to push and read data +export const TraceDataKey = 'GraphQLTraces' +export const TraceDataRefreshCallbackKey = 'GraphQLTracingRefresh' + +export const disabledClusters = getDisabledClusters() + +export function runsOnClient() { + return typeof window !== 'undefined' +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function reportTraceData(json: any) { + if (!runsOnClient()) return + if (!isTracingEnabled()) return + if (!json) return + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const rootWindowContent = window as {[key: string]: any} | undefined + + if (rootWindowContent && !rootWindowContent[TraceDataKey]) { + rootWindowContent[TraceDataKey] = [] + } + + if (rootWindowContent && json['__trace']) { + rootWindowContent[TraceDataKey].push(json['__trace']) + if (typeof rootWindowContent[TraceDataRefreshCallbackKey] === 'function') { + rootWindowContent[TraceDataRefreshCallbackKey]() + } + } +} + +export function isTracingEnabled() { + if (!runsOnClient()) return false + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const rootWindowContent = window as {[key: string]: any} | undefined + + return ( + new URLSearchParams(window.location.search).get('_tracing') === 'true' || + (rootWindowContent && rootWindowContent[TraceDataKey] !== undefined) + ) +} + +function clustersDisabled() { + return disabledClusters.length > 0 +} + +export function getInsightsUrl(url: string) { + if (!runsOnClient()) return url + if (!isTracingEnabled() && !clustersDisabled()) return url + + const urlObject = new URL(url, window.location.origin) + + if (isTracingEnabled()) { + urlObject.searchParams.set('_tracing', 'true') + } + + if (clustersDisabled()) { + urlObject.searchParams.set('disable_clusters', disabledClusters.join(',')) + } + + return urlObject.pathname + urlObject.search +} + +function getDisabledClusters() { + if (!runsOnClient()) return [] + + return decodeURIComponent(new URLSearchParams(window.location.search).get('disable_clusters') || '') + .split(',') + .filter(c => c !== '') +} + +export function isClusterDisabled(cluster: string) { + return disabledClusters.indexOf(cluster) > -1 +} + +export function toggleClusterState(cluster: string) { + if (!runsOnClient()) return + const index = disabledClusters.indexOf(cluster) + + if (index > -1) { + disabledClusters.splice(index, 1) + } else { + disabledClusters.push(cluster) + } + + const params = new URLSearchParams(window.location.search) + params.set('disable_clusters', disabledClusters.join(',')) + + window.location.search = params.toString() +} diff --git a/app-uuid.ts b/app-uuid.ts new file mode 100644 index 0000000..ac40a9d --- /dev/null +++ b/app-uuid.ts @@ -0,0 +1,38 @@ +import {currentState, updateCurrentState} from '@github-ui/history' +import {ssrSafeWindow} from '@github-ui/ssr-utils' + +// Use this mock interface to avoid importing ReactAppElement or ProjectsV2 here. +interface AppWithUuid extends Element { + uuid: string +} + +export const generateAppId = () => { + const historyAppId = currentState().appId + // When first loading an app, generate a new uuid to identify it + if (!historyAppId || historyAppId === 'rails') { + return crypto.randomUUID() + } + + // If the app is being restored from History, keep its uuid + return historyAppId +} + +export const registerAppId = (uuid: string) => { + updateCurrentState({appId: uuid}) +} + +export const currentAppId = () => { + const currentApp = + document.querySelector('react-app') || document.querySelector('projects-v2') + + return currentApp?.uuid || 'rails' +} + +// when the hash changes, we want to propagate the appId from the current state +ssrSafeWindow?.addEventListener( + 'hashchange', + () => { + updateCurrentState({appId: currentAppId()}) + }, + true, +) diff --git a/arianotify-polyfill.js b/arianotify-polyfill.js new file mode 100644 index 0000000..48db582 --- /dev/null +++ b/arianotify-polyfill.js @@ -0,0 +1,196 @@ +// @ts-check + +if (!("ariaNotify" in Element.prototype) || !("ariaNotify" in Document.prototype)) { + /** @type {string} */ + let uniqueId = `${Date.now()}`; + try { + uniqueId = crypto.randomUUID(); + } catch { } + + /** + * A unique symbol to prevent unauthorized access to the 'live-region' element. + * @type {Symbol} + */ + const passkey = Symbol(); + + /** @type {string} */ + const liveRegionCustomElementName = `live-region-${uniqueId}`; + + /** + * @param {number} ms + * @returns {Promise} + */ + function sleep(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); + } + + class Message { + /** @type {Element} */ + element; + + /** @type {string} */ + message; + + /** @type {"high" | "normal"} */ + priority = "normal"; + + /** + * @param {object} message + * @param {Element} message.element + * @param {string} message.message + * @param {"high" | "normal"} message.priority + */ + constructor({ element, message, priority = "normal" }) { + this.element = element; + this.message = message; + this.priority = priority; + } + + /** + * Whether this message can be announced. + * @returns {boolean} + */ + #canAnnounce() { + return ( + this.element.isConnected && + // Elements within inert containers should not be announced. + !this.element.closest("[inert]") && + // If there is a modal element on the page, everything outside of it is implicitly inert. + // This can be checked by seeing if the element is within the modal, if the modal is present. + (this.element.ownerDocument + .querySelector(":modal") + ?.contains(this.element) ?? + true) + ); + } + + /** @returns {Promise} */ + async announce() { + // Skip an unannounceable message. + if (!this.#canAnnounce()) { + return; + } + + // Get root element + let root = /** @type {Element} */ ( + this.element.closest("dialog") || this.element.closest("[role='dialog']") || this.element.getRootNode() + ); + if (!root || root instanceof Document) root = document.body; + + // Get 'live-region', if it already exists + /** @type {LiveRegionCustomElement | null} */ + let liveRegion = root.querySelector(liveRegionCustomElementName); + + // Create (or recreate) 'live-region', if it doesn’t exist + if (!liveRegion) { + liveRegion = /** @type {LiveRegionCustomElement} */ ( + document.createElement(liveRegionCustomElementName) + ); + root.append(liveRegion); + } + + await sleep(250); + liveRegion.handleMessage(passkey, this.message); + } + } + + const queue = new (class MessageQueue { + /** @type {Message[]} */ + #queue = []; + + /** @type {Message | undefined | null} */ + #currentMessage; + + /** + * Add the given message to the queue. + * @param {Message} message + * @returns {void} + */ + enqueue(message) { + const { priority } = message; + + if (priority === "high") { + // Insert after the last high-priority message, or at the beginning + // @ts-ignore: ts(2550) + const lastHighPriorityMessage = this.#queue.findLastIndex( + (message) => message.priority === "high" + ); + this.#queue.splice(lastHighPriorityMessage + 1, 0, message); + } else { + // Insert at the end + this.#queue.push(message); + } + + if (!this.#currentMessage) { + this.#processNext(); + } + } + + async #processNext() { + this.#currentMessage = this.#queue.shift(); + if (!this.#currentMessage) return; + await this.#currentMessage.announce(); + this.#processNext(); + } + })(); + + class LiveRegionCustomElement extends HTMLElement { + #shadowRoot = this.attachShadow({ mode: "closed" }); + + connectedCallback() { + this.ariaLive = "polite"; + this.ariaAtomic = "true"; + this.style.marginLeft = "-1px"; + this.style.marginTop = "-1px"; + this.style.position = "absolute"; + this.style.width = "1px"; + this.style.height = "1px"; + this.style.overflow = "hidden"; + this.style.clipPath = "rect(0 0 0 0)"; + this.style.overflowWrap = "normal"; + } + + /** + * @param {Symbol | null} key + * @param {string} message + */ + handleMessage(key = null, message = "") { + if (passkey !== key) return; + // This is a hack due to the way the aria live API works. A screen reader + // will not read a live region again if the text is the same. Adding a + // space character tells the browser that the live region has updated, + // which will cause it to read again, but with no audible difference. + if (this.#shadowRoot.textContent == message) message += "\u00A0"; + this.#shadowRoot.textContent = message; + } + } + customElements.define(liveRegionCustomElementName, LiveRegionCustomElement); + + if (!("ariaNotify" in Element.prototype)) { + /** + * @param {string} message + * @param {object} options + * @param {"high" | "normal"} [options.priority] + */ + Element.prototype["ariaNotify"] = function ( + message, + { priority = "normal" } = {} + ) { + queue.enqueue(new Message({ element: this, message, priority })); + }; + } + + if (!("ariaNotify" in Document.prototype)) { + /** + * @param {string} message + * @param {object} options + * @param {"high" | "normal"} [options.priority] + */ + Document.prototype["ariaNotify"] = function ( + message, + { priority = "normal" } = {} + ) { + queue.enqueue(new Message({ element: this.documentElement, message, priority })); + }; + } +} diff --git a/blob-anchor.ts b/blob-anchor.ts new file mode 100644 index 0000000..b34c586 --- /dev/null +++ b/blob-anchor.ts @@ -0,0 +1,271 @@ +export interface BlobOffset { + // Line number + // Lines start at 1. + line: number + + // Optional column number. + // Like lines, columns are 1-indexed. + column: number | null +} + +export interface BlobRange { + // Starting offset of range. + start: BlobOffset + + // End offset of range. + // End offset may be the same as the start. This indicates a collapsed range. + // Should always be initialized to a value that is equal or greater than the + // start range such the range is always in ascending order. Reversed ranges + // have undefined behavior. + end: BlobOffset +} + +// Inverse of `formatBlobRange`. +// +// Examples +// +// parseBlobRange("#L3") +// // => {start: {line: 3}} +// +// parseBlobRange("L3-L5") +// // => {start: {line: 3}, end: {line: 5}} +// +// parseBlobRange("") +// // => null +export function parseBlobRange(str: string): BlobRange | undefined { + const lines = str.match(/#?(?:L)(\d+)((?:C)(\d+))?/g) + if (!lines) { + return + } else if (lines.length === 1) { + const offset = parseBlobOffset(lines[0]) + if (!offset) return + return Object.freeze({start: offset, end: offset}) + } else if (lines.length === 2) { + const startOffset = parseBlobOffset(lines[0]) + const endOffset = parseBlobOffset(lines[1]) + if (!startOffset || !endOffset) return + + return ascendingBlobRange( + Object.freeze({ + start: startOffset, + end: endOffset, + }), + ) + } else { + return + } +} + +// Inverse of `parseBlobRange`. +// +// Examples +// +// formatBlobRange({start: {line: 3}}) +// // => "L3" +// +// formatBlobRange({start: {line: 3}, end: {line: 5}}) +// // => "L3-L5" +// +// formatBlobRange({start: {line: 3, column: 1}, end: {line: 5, column: 5}}) +// // => "L3C1-L5C5" +// +// formatBlobRange({start: {line: 3, column: 1}, end: {line: 5,}}) +// // => "L3C1-L5" +export function formatBlobRange(blobRange: BlobRange): string { + const {start, end} = ascendingBlobRange(blobRange) + + if (start.column != null && end.column != null) { + return `L${start.line}C${start.column}-L${end.line}C${end.column}` + } else if (start.column != null) { + return `L${start.line}C${start.column}-L${end.line}` + } else if (end.column != null) { + return `L${start.line}-L${end.line}C${end.column}` + } else if (start.line === end.line) { + return `L${start.line}` + } else { + return `L${start.line}-L${end.line}` + } +} + +// Returns a String containing the file prefix with trailing dash. +// +// Examples +// +// parseAnchorPrefix("#file-zshrc-L3") +// // => "file-zshrc-" +// +// parseAnchorPrefix("file-zshrc-L3-L5") +// // => "file-zshrc-" +// +// parseAnchorPrefix("") +// // => "" +function parseAnchorPrefix(str: string): string { + const match = str.length < 5000 && str.match(/(file-.+?-)L\d+?/i) + return match && match[1] ? match[1] : '' +} + +export type AnchorInfo = { + blobRange: BlobRange + anchorPrefix: string +} + +// Examples +// +// parseFileAnchor("#file-zshrc-L3") +// // => { blobRange: {start: {line: 3}}, anchorPrefix: "file-zshrc-" } +// +// parseFileAnchor("file-zshrc-L3-L5") +// // => { blobRange: {start: {line: 3}, end: {line: 5}}, anchorPrefix: "file-zshrc-" } +// +// parseFileAnchor("") +// // => { blobRange: null, anchorPrefix: undefined } +export function parseFileAnchor(str: string): AnchorInfo { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const blobRange = parseBlobRange(str)! + const anchorPrefix = parseAnchorPrefix(str) + return {blobRange, anchorPrefix} +} + +// Formats line number range pair as an anchor String. +// +// Examples +// +// formatBlobRangeAnchor({blobRange: {start: {line: 3}}, anchorPrefix: ""}) +// // => "#L3" +// +// formatBlobRangeAnchor({blobRange: {start: {line: 3}}, anchorPrefix: "file-zshrc-"}) +// // => "#file-zshrc-L3" +// +// formatBlobRangeAnchor({blobRange: {start: {line: 3}, end: {line: 5}}, anchorPrefix: ""}) +// // => "#L3-L5" +// +// formatBlobRangeAnchor({blobRange: {start: {line: 3, column: 1}, end: {line: 5, column: 5}}, anchorPrefix: ""}) +// // => "#L3C1-L5C5" +// +// formatBlobRangeAnchor({blobRange: {start: {line: 3}, end: {line: 5}}, anchorPrefix: "file-zshrc-"}) +// // => "#file-zshrc-L3-L5" +// +// formatBlobRangeAnchor({blobRange: null, anchorPrefix: ""}) +// // => "#" +// +// formatBlobRangeAnchor({blobRange: null, anchorPrefix: "file-zshrc-"}) +// // => "#" +export function formatBlobRangeAnchor({anchorPrefix, blobRange}: AnchorInfo): string { + if (!blobRange) return '#' + return `#${anchorPrefix}${formatBlobRange(blobRange)}` +} + +function parseBlobOffset(str?: string): BlobOffset | null { + if (!str) return null + + const lineMatch = str.match(/L(\d+)/) + const columnMatch = str.match(/C(\d+)/) + if (lineMatch && lineMatch[1]) { + return Object.freeze({ + line: parseInt(lineMatch[1]), + column: columnMatch && columnMatch[1] ? parseInt(columnMatch[1]) : null, + }) + } else { + return null + } +} + +export function DOMRangeFromBlob( + blobRange: BlobRange, + getLineElement: (line: number) => Node | null, +): Range | undefined { + const [startContainer, _startOffset] = findRangeOffset(blobRange.start, true, getLineElement) + const [endContainer, _endOffset] = findRangeOffset(blobRange.end, false, getLineElement) + if (!startContainer || !endContainer) return + + // Treat -1 as full line selection + let startOffset = _startOffset + let endOffset = _endOffset + if (startOffset === -1) startOffset = 0 + if (endOffset === -1) endOffset = endContainer.childNodes.length + if (!startContainer.ownerDocument) throw new Error(`DOMRange needs to be inside document`) + + const range = startContainer.ownerDocument.createRange() + range.setStart(startContainer, startOffset) + range.setEnd(endContainer, endOffset) + return range +} + +function findRangeOffset( + offset: BlobOffset, + lookAhead: boolean, + getLineElement: (n: number) => Node | null, +): [Node | null, number] { + const error: [null, number] = [null, 0] + + const lineElement = getLineElement(offset.line) + if (!lineElement) return error + + if (offset.column == null) { + return [lineElement, -1] + } + + let column = offset.column - 1 + + const textNodes = getAllTextNodes(lineElement) + for (let i = 0; i < textNodes.length; i++) { + const textNode = textNodes[i] || null + + // TODO: length might be buggy with emoji + const nextC = column - (textNode?.textContent || '').length + + if (nextC === 0) { + const nextTextNode = textNodes[i + 1] + if (lookAhead && nextTextNode) { + return [nextTextNode, 0] + } else { + return [textNode, column] + } + } else if (nextC < 0) { + return [textNode, column] + } + + column = nextC + } + + return error +} + +// Get a flat list of text nodes in depth first order. +function getAllTextNodes(el: Node): Node[] { + if (el.nodeType === Node.TEXT_NODE) { + return [el] + } + if (!el.childNodes || !el.childNodes.length) return [] + let list: Node[] = [] + for (const node of el.childNodes) { + list = list.concat(getAllTextNodes(node)) + } + return list +} + +// Sorts range start and end offsets to be in ascending order. +function ascendingBlobRange(range: BlobRange): BlobRange { + const offsets: [BlobOffset, BlobOffset] = [range.start, range.end] + offsets.sort(compareBlobOffsets) + + if (offsets[0] === range.start && offsets[1] === range.end) { + return range + } else { + return Object.freeze({ + start: offsets[0], + end: offsets[1], + }) + } +} + +// Compare line offsets. May be used with Array.sort +function compareBlobOffsets(a: BlobOffset, b: BlobOffset): number { + if (a.line === b.line && a.column === b.column) { + return 0 + } else if (a.line === b.line && typeof a.column === 'number' && typeof b.column === 'number') { + return a.column - b.column + } else { + return a.line - b.line + } +} diff --git a/bootstrap b/bootstrap new file mode 100644 index 0000000..92490d3 --- /dev/null +++ b/bootstrap @@ -0,0 +1,30 @@ +// The module cache +var __webpack_module_cache__ = {}; + +// The require function +function __webpack_require__(moduleId) { + // Check if module is in cache + var cachedModule = __webpack_module_cache__[moduleId]; + if (cachedModule !== undefined) { + return cachedModule.exports; + } + // Create a new module (and put it into the cache) + var module = __webpack_module_cache__[moduleId] = { + id: moduleId, + loaded: false, + exports: {} + }; + + // Execute the module function + __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); + + // Flag the module as loaded + module.loaded = true; + + // Return the exports of the module + return module.exports; +} + +// expose the modules object (__webpack_modules__) +__webpack_require__.m = __webpack_modules__; + diff --git a/bootstrap.js b/bootstrap.js new file mode 100644 index 0000000..92490d3 --- /dev/null +++ b/bootstrap.js @@ -0,0 +1,30 @@ +// The module cache +var __webpack_module_cache__ = {}; + +// The require function +function __webpack_require__(moduleId) { + // Check if module is in cache + var cachedModule = __webpack_module_cache__[moduleId]; + if (cachedModule !== undefined) { + return cachedModule.exports; + } + // Create a new module (and put it into the cache) + var module = __webpack_module_cache__[moduleId] = { + id: moduleId, + loaded: false, + exports: {} + }; + + // Execute the module function + __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); + + // Flag the module as loaded + module.loaded = true; + + // Return the exports of the module + return module.exports; +} + +// expose the modules object (__webpack_modules__) +__webpack_require__.m = __webpack_modules__; + diff --git a/bsindex.js b/bsindex.js new file mode 100644 index 0000000..c96f5f6 --- /dev/null +++ b/bsindex.js @@ -0,0 +1,66 @@ +import * as clipboardItem from './clipboarditem.js'; +import * as elementCheckVisibility from './element-checkvisibility.js'; +import * as navigatorClipboard from './navigator-clipboard.js'; +import * as withResolvers from './promise-withResolvers.js'; +import * as requestIdleCallback from './requestidlecallback.js'; +import * as popover from '@oddbird/popover-polyfill/fn'; +import * as commandAndCommandFor from 'invokers-polyfill/fn'; +let supportsModalPseudo = false; +try { + // This will error in older browsers + supportsModalPseudo = document.body.matches(':modal') === false; +} +catch { + supportsModalPseudo = false; +} +export const baseSupport = typeof globalThis === 'object' && + // ES2019 + 'fromEntries' in Object && + 'flatMap' in Array.prototype && + 'trimEnd' in String.prototype && + // ES2020 + 'allSettled' in Promise && + 'matchAll' in String.prototype && + // ES2021 + 'replaceAll' in String.prototype && + 'any' in Promise && + // ES2022 + 'at' in String.prototype && + 'at' in Array.prototype && + 'hasOwn' in Object && + // ESNext + 'abort' in AbortSignal && + 'timeout' in AbortSignal && + // DOM / HTML and other specs + typeof queueMicrotask === 'function' && + typeof HTMLDialogElement === 'function' && + supportsModalPseudo && + typeof AggregateError === 'function' && + typeof BroadcastChannel === 'function' && + 'randomUUID' in crypto && + 'replaceChildren' in Element.prototype && + 'requestSubmit' in HTMLFormElement.prototype && + // 'requestIdleCallback' in window && // Polyfilled + true; +export const polyfills = { + clipboardItem, + elementCheckVisibility, + navigatorClipboard, + requestIdleCallback, + withResolvers, + popover, + commandAndCommandFor, +}; +export function isSupported() { + return baseSupport && Object.values(polyfills).every(polyfill => polyfill.isSupported()); +} +export function isPolyfilled() { + return Object.values(polyfills).every(polyfill => polyfill.isPolyfilled()); +} +export function apply() { + for (const polyfill of Object.values(polyfills)) { + if (!polyfill.isSupported()) + polyfill.apply(); + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/catalystbind.js b/catalystbind.js new file mode 100644 index 0000000..73de8c0 --- /dev/null +++ b/catalystbind.js @@ -0,0 +1,101 @@ +const controllers = new WeakSet(); +/* + * Bind `[data-action]` elements from the DOM to their actions. + * + */ +export function bind(controller) { + controllers.add(controller); + if (controller.shadowRoot) + bindShadow(controller.shadowRoot); + bindElements(controller); + listenForBind(controller.ownerDocument); +} +export function bindShadow(root) { + bindElements(root); + listenForBind(root); +} +const observers = new WeakMap(); +/** + * Set up observer that will make sure any actions that are dynamically + * injected into `el` will be bound to it's controller. + * + * This returns a Subscription object which you can call `unsubscribe()` on to + * stop further live updates. + */ +export function listenForBind(el = document) { + if (observers.has(el)) + return observers.get(el); + let closed = false; + const observer = new MutationObserver(mutations => { + for (const mutation of mutations) { + if (mutation.type === 'attributes' && mutation.target instanceof Element) { + bindActions(mutation.target); + } + else if (mutation.type === 'childList' && mutation.addedNodes.length) { + for (const node of mutation.addedNodes) { + if (node instanceof Element) { + bindElements(node); + } + } + } + } + }); + observer.observe(el, { childList: true, subtree: true, attributeFilter: ['data-action'] }); + const subscription = { + get closed() { + return closed; + }, + unsubscribe() { + closed = true; + observers.delete(el); + observer.disconnect(); + } + }; + observers.set(el, subscription); + return subscription; +} +function bindElements(root) { + for (const el of root.querySelectorAll('[data-action]')) { + bindActions(el); + } + // Also bind the controller to itself + if (root instanceof Element && root.hasAttribute('data-action')) { + bindActions(root); + } +} +// Bind a single function to all events to avoid anonymous closure performance penalty. +function handleEvent(event) { + const el = event.currentTarget; + for (const binding of bindings(el)) { + if (event.type === binding.type) { + const controller = el.closest(binding.tag); + if (controllers.has(controller) && typeof controller[binding.method] === 'function') { + controller[binding.method](event); + } + const root = el.getRootNode(); + if (root instanceof ShadowRoot && controllers.has(root.host) && root.host.matches(binding.tag)) { + const shadowController = root.host; + if (typeof shadowController[binding.method] === 'function') { + shadowController[binding.method](event); + } + } + } + } +} +function* bindings(el) { + for (const action of (el.getAttribute('data-action') || '').trim().split(/\s+/)) { + const eventSep = action.lastIndexOf(':'); + const methodSep = Math.max(0, action.lastIndexOf('#')) || action.length; + yield { + type: action.slice(0, eventSep), + tag: action.slice(eventSep + 1, methodSep), + method: action.slice(methodSep + 1) || 'handleEvent' + } || 'handleEvent'; + } +} +function bindActions(el) { + for (const binding of bindings(el)) { + el.addEventListener(binding.type, handleEvent); + } +} +//# sourceMappingURL=bind.js.map \ No newline at end of file diff --git a/catalystcore.js b/catalystcore.js new file mode 100644 index 0000000..8d57656 --- /dev/null +++ b/catalystcore.js @@ -0,0 +1,76 @@ +import { register } from './register.js'; +import { bind, bindShadow } from './bind.js'; +import { autoShadowRoot } from './auto-shadow-root.js'; +import { defineObservedAttributes, initializeAttrs } from './attr.js'; +import { observe } from './lazy-define.js'; +const symbol = Symbol.for('catalyst'); +export class CatalystDelegate { + constructor(classObject) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const delegate = this; + const connectedCallback = classObject.prototype.connectedCallback; + classObject.prototype.connectedCallback = function () { + delegate.connectedCallback(this, connectedCallback); + }; + const disconnectedCallback = classObject.prototype.disconnectedCallback; + classObject.prototype.disconnectedCallback = function () { + delegate.disconnectedCallback(this, disconnectedCallback); + }; + const attributeChangedCallback = classObject.prototype.attributeChangedCallback; + classObject.prototype.attributeChangedCallback = function (name, oldValue, newValue) { + delegate.attributeChangedCallback(this, name, oldValue, newValue, attributeChangedCallback); + }; + let observedAttributes = classObject.observedAttributes || []; + Object.defineProperty(classObject, 'observedAttributes', { + configurable: true, + get() { + return delegate.observedAttributes(this, observedAttributes); + }, + set(attributes) { + observedAttributes = attributes; + } + }); + defineObservedAttributes(classObject); + register(classObject); + } + observedAttributes(instance, observedAttributes) { + return observedAttributes; + } + connectedCallback(instance, connectedCallback) { + instance.toggleAttribute('data-catalyst', true); + customElements.upgrade(instance); + autoShadowRoot(instance); + initializeAttrs(instance); + bind(instance); + connectedCallback?.call(instance); + if (instance.shadowRoot) { + bindShadow(instance.shadowRoot); + observe(instance.shadowRoot); + } + } + disconnectedCallback(element, disconnectedCallback) { + disconnectedCallback?.call(element); + } + attributeChangedCallback(instance, name, oldValue, newValue, attributeChangedCallback) { + initializeAttrs(instance); + if (name !== 'data-catalyst' && attributeChangedCallback) { + attributeChangedCallback.call(instance, name, oldValue, newValue); + } + } +} +export function meta(proto, name) { + if (!Object.prototype.hasOwnProperty.call(proto, symbol)) { + const parent = proto[symbol]; + const map = (proto[symbol] = new Map()); + if (parent) { + for (const [key, value] of parent) { + map.set(key, new Set(value)); + } + } + } + const map = proto[symbol]; + if (!map.has(name)) + map.set(name, new Set()); + return map.get(name); +} +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/catalystfindtarget.js b/catalystfindtarget.js new file mode 100644 index 0000000..a3911a0 --- /dev/null +++ b/catalystfindtarget.js @@ -0,0 +1,41 @@ +/** + * findTarget will run `querySelectorAll` against the given controller, plus + * its shadowRoot, returning any the first child that: + * + * - Matches the selector of `[data-target~="tag.name"]` where tag is the + * tagName of the given HTMLElement, and `name` is the given `name` argument. + * + * - Closest ascendant of the element, that matches the tagname of the + * controller, is the specific instance of the controller itself - in other + * words it is not nested in other controllers of the same type. + * + */ +export function findTarget(controller, name) { + const tag = controller.tagName.toLowerCase(); + if (controller.shadowRoot) { + for (const el of controller.shadowRoot.querySelectorAll(`[data-target~="${tag}.${name}"]`)) { + if (!el.closest(tag)) + return el; + } + } + for (const el of controller.querySelectorAll(`[data-target~="${tag}.${name}"]`)) { + if (el.closest(tag) === controller) + return el; + } +} +export function findTargets(controller, name) { + const tag = controller.tagName.toLowerCase(); + const targets = []; + if (controller.shadowRoot) { + for (const el of controller.shadowRoot.querySelectorAll(`[data-targets~="${tag}.${name}"]`)) { + if (!el.closest(tag)) + targets.push(el); + } + } + for (const el of controller.querySelectorAll(`[data-targets~="${tag}.${name}"]`)) { + if (el.closest(tag) === controller) + targets.push(el); + } + return targets; +} +//# sourceMappingURL=findtarget.js.map \ No newline at end of file diff --git a/catalystlazy-define.js b/catalystlazy-define.js new file mode 100644 index 0000000..b7860ff --- /dev/null +++ b/catalystlazy-define.js @@ -0,0 +1,91 @@ +const dynamicElements = new Map(); +const ready = new Promise(resolve => { + if (document.readyState !== 'loading') { + resolve(); + } + else { + document.addEventListener('readystatechange', () => resolve(), { once: true }); + } +}); +const firstInteraction = new Promise(resolve => { + const controller = new AbortController(); + controller.signal.addEventListener('abort', () => resolve()); + const listenerOptions = { once: true, passive: true, signal: controller.signal }; + const handler = () => controller.abort(); + document.addEventListener('mousedown', handler, listenerOptions); + // eslint-disable-next-line github/require-passive-events + document.addEventListener('touchstart', handler, listenerOptions); + document.addEventListener('keydown', handler, listenerOptions); + document.addEventListener('pointerdown', handler, listenerOptions); +}); +const visible = (tagName) => new Promise(resolve => { + const observer = new IntersectionObserver(entries => { + for (const entry of entries) { + if (entry.isIntersecting) { + resolve(); + observer.disconnect(); + return; + } + } + }, { + // Currently the threshold is set to 256px from the bottom of the viewport + // with a threshold of 0.1. This means the element will not load until about + // 2 keyboard-down-arrow presses away from being visible in the viewport, + // giving us some time to fetch it before the contents are made visible + rootMargin: '0px 0px 256px 0px', + threshold: 0.01 + }); + for (const el of document.querySelectorAll(tagName)) { + observer.observe(el); + } +}); +const strategies = { + ready: () => ready, + firstInteraction: () => firstInteraction, + visible +}; +const timers = new WeakMap(); +function scan(element) { + cancelAnimationFrame(timers.get(element) || 0); + timers.set(element, requestAnimationFrame(() => { + for (const tagName of dynamicElements.keys()) { + const child = element instanceof Element && element.matches(tagName) ? element : element.querySelector(tagName); + if (customElements.get(tagName) || child) { + const strategyName = (child?.getAttribute('data-load-on') || 'ready'); + const strategy = strategyName in strategies ? strategies[strategyName] : strategies.ready; + // eslint-disable-next-line github/no-then + for (const cb of dynamicElements.get(tagName) || []) + strategy(tagName).then(cb); + dynamicElements.delete(tagName); + timers.delete(element); + } + } + })); +} +let elementLoader; +export function lazyDefine(tagNameOrObj, singleCallback) { + if (typeof tagNameOrObj === 'string' && singleCallback) { + tagNameOrObj = { [tagNameOrObj]: singleCallback }; + } + for (const [tagName, callback] of Object.entries(tagNameOrObj)) { + if (!dynamicElements.has(tagName)) + dynamicElements.set(tagName, new Set()); + dynamicElements.get(tagName).add(callback); + } + observe(document); +} +export function observe(target) { + elementLoader || (elementLoader = new MutationObserver(mutations => { + if (!dynamicElements.size) + return; + for (const mutation of mutations) { + for (const node of mutation.addedNodes) { + if (node instanceof Element) + scan(node); + } + } + })); + scan(target); + elementLoader.observe(target, { subtree: true, childList: true }); +} +//# sourceMappingURL=lazy-define.js.map \ No newline at end of file diff --git a/catalystregister.js b/catalystregister.js new file mode 100644 index 0000000..8a26592 --- /dev/null +++ b/catalystregister.js @@ -0,0 +1,25 @@ +import { dasherize } from './dasherize.js'; +/** + * Register the controller as a custom element. + * + * The classname is converted to a approriate tag name. + * + * Example: HelloController => hello-controller + */ +export function register(classObject) { + const name = dasherize(classObject.name).replace(/-element$/, ''); + try { + window.customElements.define(name, classObject); + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + window[classObject.name] = customElements.get(name); + } + catch (e) { + // The only reason for window.customElements.define to throw a `NotSupportedError` + // is if the element has already been defined. + if (!(e instanceof DOMException && e.name === 'NotSupportedError')) + throw e; + } + return classObject; +} +//# sourceMappingURL=register.js.map \ No newline at end of file diff --git a/catalysttarget.js b/catalysttarget.js new file mode 100644 index 0000000..41a532e --- /dev/null +++ b/catalysttarget.js @@ -0,0 +1,35 @@ +import { findTarget, findTargets } from './findtarget.js'; +import { meta } from './core.js'; +/** + * Target is a decorator which - when assigned to a property field on the + * class - will override that class field, turning it into a Getter which + * returns a call to `findTarget(this, key)` where `key` is the name of the + * property field. In other words, `@target foo` becomes a getter for + * `findTarget(this, 'foo')`. + */ +export function target(proto, key) { + meta(proto, 'target').add(key); + Object.defineProperty(proto, key, { + configurable: true, + get() { + return findTarget(this, key); + } + }); +} +/** + * Targets is a decorator which - when assigned to a property field on the + * class - will override that class field, turning it into a Getter which + * returns a call to `findTargets(this, key)` where `key` is the name of the + * property field. In other words, `@targets foo` becomes a getter for + * `findTargets(this, 'foo')`. + */ +export function targets(proto, key) { + meta(proto, 'targets').add(key); + Object.defineProperty(proto, key, { + configurable: true, + get() { + return findTargets(this, key); + } + }); +} +//# sourceMappingURL=target.js.map \ No newline at end of file diff --git a/check-allindex.js b/check-allindex.js new file mode 100644 index 0000000..32972a8 --- /dev/null +++ b/check-allindex.js @@ -0,0 +1,101 @@ +export default function subscribe(container) { + let shiftKey = false; + let lastCheckbox = null; + container.addEventListener('mousedown', onMouseDown); + container.addEventListener('change', onChange); + function setChecked(target, input, checked, indeterminate = false) { + if (!(input instanceof HTMLInputElement)) + return; + input.indeterminate = indeterminate; + if (input.checked !== checked) { + input.checked = checked; + setTimeout(() => { + const event = new CustomEvent('change', { + bubbles: true, + cancelable: false, + detail: { relatedTarget: target } + }); + input.dispatchEvent(event); + }); + } + } + function onChange(event) { + const target = event.target; + if (!(target instanceof Element)) + return; + if (target.hasAttribute('data-check-all')) { + onCheckAll(event); + } + else if (target.hasAttribute('data-check-all-item')) { + onCheckAllItem(event); + } + } + function onCheckAll(event) { + if (event instanceof CustomEvent && event.detail) { + const { relatedTarget } = event.detail; + if (relatedTarget && relatedTarget.hasAttribute('data-check-all-item')) { + return; + } + } + const target = event.target; + if (!(target instanceof HTMLInputElement)) + return; + lastCheckbox = null; + for (const input of container.querySelectorAll('[data-check-all-item]')) { + setChecked(target, input, target.checked); + } + target.indeterminate = false; + updateCount(); + } + function onMouseDown(event) { + if (!(event.target instanceof Element)) + return; + const target = event.target instanceof HTMLLabelElement ? event.target.control || event.target : event.target; + if (target.hasAttribute('data-check-all-item')) { + shiftKey = event.shiftKey; + } + } + function onCheckAllItem(event) { + if (event instanceof CustomEvent && event.detail) { + const { relatedTarget } = event.detail; + if (relatedTarget && + (relatedTarget.hasAttribute('data-check-all') || relatedTarget.hasAttribute('data-check-all-item'))) { + return; + } + } + const target = event.target; + if (!(target instanceof HTMLInputElement)) + return; + const itemCheckboxes = Array.from(container.querySelectorAll('[data-check-all-item]')); + if (shiftKey && lastCheckbox) { + const [start, end] = [itemCheckboxes.indexOf(lastCheckbox), itemCheckboxes.indexOf(target)].sort(); + for (const input of itemCheckboxes.slice(start, +end + 1 || 9e9)) { + setChecked(target, input, target.checked); + } + } + shiftKey = false; + lastCheckbox = target; + const allCheckbox = container.querySelector('[data-check-all]'); + if (allCheckbox) { + const total = itemCheckboxes.length; + const count = itemCheckboxes.filter(checkbox => checkbox instanceof HTMLInputElement && checkbox.checked).length; + const checked = count === total; + const indeterminate = total > count && count > 0; + setChecked(target, allCheckbox, checked, indeterminate); + } + updateCount(); + } + function updateCount() { + const countContainer = container.querySelector('[data-check-all-count]'); + if (countContainer) { + const count = container.querySelectorAll('[data-check-all-item]:checked').length; + countContainer.textContent = count.toString(); + } + } + return { + unsubscribe: () => { + container.removeEventListener('mousedown', onMouseDown); + container.removeEventListener('change', onChange); + } + }; +} diff --git a/checkboxcheckallindex.js b/checkboxcheckallindex.js new file mode 100644 index 0000000..32972a8 --- /dev/null +++ b/checkboxcheckallindex.js @@ -0,0 +1,101 @@ +export default function subscribe(container) { + let shiftKey = false; + let lastCheckbox = null; + container.addEventListener('mousedown', onMouseDown); + container.addEventListener('change', onChange); + function setChecked(target, input, checked, indeterminate = false) { + if (!(input instanceof HTMLInputElement)) + return; + input.indeterminate = indeterminate; + if (input.checked !== checked) { + input.checked = checked; + setTimeout(() => { + const event = new CustomEvent('change', { + bubbles: true, + cancelable: false, + detail: { relatedTarget: target } + }); + input.dispatchEvent(event); + }); + } + } + function onChange(event) { + const target = event.target; + if (!(target instanceof Element)) + return; + if (target.hasAttribute('data-check-all')) { + onCheckAll(event); + } + else if (target.hasAttribute('data-check-all-item')) { + onCheckAllItem(event); + } + } + function onCheckAll(event) { + if (event instanceof CustomEvent && event.detail) { + const { relatedTarget } = event.detail; + if (relatedTarget && relatedTarget.hasAttribute('data-check-all-item')) { + return; + } + } + const target = event.target; + if (!(target instanceof HTMLInputElement)) + return; + lastCheckbox = null; + for (const input of container.querySelectorAll('[data-check-all-item]')) { + setChecked(target, input, target.checked); + } + target.indeterminate = false; + updateCount(); + } + function onMouseDown(event) { + if (!(event.target instanceof Element)) + return; + const target = event.target instanceof HTMLLabelElement ? event.target.control || event.target : event.target; + if (target.hasAttribute('data-check-all-item')) { + shiftKey = event.shiftKey; + } + } + function onCheckAllItem(event) { + if (event instanceof CustomEvent && event.detail) { + const { relatedTarget } = event.detail; + if (relatedTarget && + (relatedTarget.hasAttribute('data-check-all') || relatedTarget.hasAttribute('data-check-all-item'))) { + return; + } + } + const target = event.target; + if (!(target instanceof HTMLInputElement)) + return; + const itemCheckboxes = Array.from(container.querySelectorAll('[data-check-all-item]')); + if (shiftKey && lastCheckbox) { + const [start, end] = [itemCheckboxes.indexOf(lastCheckbox), itemCheckboxes.indexOf(target)].sort(); + for (const input of itemCheckboxes.slice(start, +end + 1 || 9e9)) { + setChecked(target, input, target.checked); + } + } + shiftKey = false; + lastCheckbox = target; + const allCheckbox = container.querySelector('[data-check-all]'); + if (allCheckbox) { + const total = itemCheckboxes.length; + const count = itemCheckboxes.filter(checkbox => checkbox instanceof HTMLInputElement && checkbox.checked).length; + const checked = count === total; + const indeterminate = total > count && count > 0; + setChecked(target, allCheckbox, checked, indeterminate); + } + updateCount(); + } + function updateCount() { + const countContainer = container.querySelector('[data-check-all-count]'); + if (countContainer) { + const count = container.querySelectorAll('[data-check-all-item]:checked').length; + countContainer.textContent = count.toString(); + } + } + return { + unsubscribe: () => { + container.removeEventListener('mousedown', onMouseDown); + container.removeEventListener('change', onChange); + } + }; +} diff --git a/chromestatus.com_static_dist_components.js_v=c21e03b.pdf b/chromestatus.com_static_dist_components.js_v=c21e03b.pdf new file mode 100644 index 0000000..30a4a90 Binary files /dev/null and b/chromestatus.com_static_dist_components.js_v=c21e03b.pdf differ diff --git a/chunk-EPOLDU6W.mjs b/chunk-EPOLDU6W.mjs new file mode 100644 index 0000000..f34ce5d --- /dev/null +++ b/chunk-EPOLDU6W.mjs @@ -0,0 +1,10994 @@ +/** + * react-router v7.12.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); + +// lib/router/history.ts +var Action = /* @__PURE__ */ ((Action2) => { + Action2["Pop"] = "POP"; + Action2["Push"] = "PUSH"; + Action2["Replace"] = "REPLACE"; + return Action2; +})(Action || {}); +var PopStateEventType = "popstate"; +function createMemoryHistory(options = {}) { + let { initialEntries = ["/"], initialIndex, v5Compat = false } = options; + let entries; + entries = initialEntries.map( + (entry, index2) => createMemoryLocation( + entry, + typeof entry === "string" ? null : entry.state, + index2 === 0 ? "default" : void 0 + ) + ); + let index = clampIndex( + initialIndex == null ? entries.length - 1 : initialIndex + ); + let action = "POP" /* Pop */; + let listener = null; + function clampIndex(n) { + return Math.min(Math.max(n, 0), entries.length - 1); + } + function getCurrentLocation() { + return entries[index]; + } + function createMemoryLocation(to, state = null, key) { + let location = createLocation( + entries ? getCurrentLocation().pathname : "/", + to, + state, + key + ); + warning( + location.pathname.charAt(0) === "/", + `relative pathnames are not supported in memory history: ${JSON.stringify( + to + )}` + ); + return location; + } + function createHref2(to) { + return typeof to === "string" ? to : createPath(to); + } + let history = { + get index() { + return index; + }, + get action() { + return action; + }, + get location() { + return getCurrentLocation(); + }, + createHref: createHref2, + createURL(to) { + return new URL(createHref2(to), "http://localhost"); + }, + encodeLocation(to) { + let path = typeof to === "string" ? parsePath(to) : to; + return { + pathname: path.pathname || "", + search: path.search || "", + hash: path.hash || "" + }; + }, + push(to, state) { + action = "PUSH" /* Push */; + let nextLocation = createMemoryLocation(to, state); + index += 1; + entries.splice(index, entries.length, nextLocation); + if (v5Compat && listener) { + listener({ action, location: nextLocation, delta: 1 }); + } + }, + replace(to, state) { + action = "REPLACE" /* Replace */; + let nextLocation = createMemoryLocation(to, state); + entries[index] = nextLocation; + if (v5Compat && listener) { + listener({ action, location: nextLocation, delta: 0 }); + } + }, + go(delta) { + action = "POP" /* Pop */; + let nextIndex = clampIndex(index + delta); + let nextLocation = entries[nextIndex]; + index = nextIndex; + if (listener) { + listener({ action, location: nextLocation, delta }); + } + }, + listen(fn) { + listener = fn; + return () => { + listener = null; + }; + } + }; + return history; +} +function createBrowserHistory(options = {}) { + function createBrowserLocation(window2, globalHistory) { + let { pathname, search, hash } = window2.location; + return createLocation( + "", + { pathname, search, hash }, + // state defaults to `null` because `window.history.state` does + globalHistory.state && globalHistory.state.usr || null, + globalHistory.state && globalHistory.state.key || "default" + ); + } + function createBrowserHref(window2, to) { + return typeof to === "string" ? to : createPath(to); + } + return getUrlBasedHistory( + createBrowserLocation, + createBrowserHref, + null, + options + ); +} +function createHashHistory(options = {}) { + function createHashLocation(window2, globalHistory) { + let { + pathname = "/", + search = "", + hash = "" + } = parsePath(window2.location.hash.substring(1)); + if (!pathname.startsWith("/") && !pathname.startsWith(".")) { + pathname = "/" + pathname; + } + return createLocation( + "", + { pathname, search, hash }, + // state defaults to `null` because `window.history.state` does + globalHistory.state && globalHistory.state.usr || null, + globalHistory.state && globalHistory.state.key || "default" + ); + } + function createHashHref(window2, to) { + let base = window2.document.querySelector("base"); + let href = ""; + if (base && base.getAttribute("href")) { + let url = window2.location.href; + let hashIndex = url.indexOf("#"); + href = hashIndex === -1 ? url : url.slice(0, hashIndex); + } + return href + "#" + (typeof to === "string" ? to : createPath(to)); + } + function validateHashLocation(location, to) { + warning( + location.pathname.charAt(0) === "/", + `relative pathnames are not supported in hash history.push(${JSON.stringify( + to + )})` + ); + } + return getUrlBasedHistory( + createHashLocation, + createHashHref, + validateHashLocation, + options + ); +} +function invariant(value, message) { + if (value === false || value === null || typeof value === "undefined") { + throw new Error(message); + } +} +function warning(cond, message) { + if (!cond) { + if (typeof console !== "undefined") console.warn(message); + try { + throw new Error(message); + } catch (e) { + } + } +} +function createKey() { + return Math.random().toString(36).substring(2, 10); +} +function getHistoryState(location, index) { + return { + usr: location.state, + key: location.key, + idx: index + }; +} +function createLocation(current, to, state = null, key) { + let location = { + pathname: typeof current === "string" ? current : current.pathname, + search: "", + hash: "", + ...typeof to === "string" ? parsePath(to) : to, + state, + // TODO: This could be cleaned up. push/replace should probably just take + // full Locations now and avoid the need to run through this flow at all + // But that's a pretty big refactor to the current test suite so going to + // keep as is for the time being and just let any incoming keys take precedence + key: to && to.key || key || createKey() + }; + return location; +} +function createPath({ + pathname = "/", + search = "", + hash = "" +}) { + if (search && search !== "?") + pathname += search.charAt(0) === "?" ? search : "?" + search; + if (hash && hash !== "#") + pathname += hash.charAt(0) === "#" ? hash : "#" + hash; + return pathname; +} +function parsePath(path) { + let parsedPath = {}; + if (path) { + let hashIndex = path.indexOf("#"); + if (hashIndex >= 0) { + parsedPath.hash = path.substring(hashIndex); + path = path.substring(0, hashIndex); + } + let searchIndex = path.indexOf("?"); + if (searchIndex >= 0) { + parsedPath.search = path.substring(searchIndex); + path = path.substring(0, searchIndex); + } + if (path) { + parsedPath.pathname = path; + } + } + return parsedPath; +} +function getUrlBasedHistory(getLocation, createHref2, validateLocation, options = {}) { + let { window: window2 = document.defaultView, v5Compat = false } = options; + let globalHistory = window2.history; + let action = "POP" /* Pop */; + let listener = null; + let index = getIndex(); + if (index == null) { + index = 0; + globalHistory.replaceState({ ...globalHistory.state, idx: index }, ""); + } + function getIndex() { + let state = globalHistory.state || { idx: null }; + return state.idx; + } + function handlePop() { + action = "POP" /* Pop */; + let nextIndex = getIndex(); + let delta = nextIndex == null ? null : nextIndex - index; + index = nextIndex; + if (listener) { + listener({ action, location: history.location, delta }); + } + } + function push(to, state) { + action = "PUSH" /* Push */; + let location = createLocation(history.location, to, state); + if (validateLocation) validateLocation(location, to); + index = getIndex() + 1; + let historyState = getHistoryState(location, index); + let url = history.createHref(location); + try { + globalHistory.pushState(historyState, "", url); + } catch (error) { + if (error instanceof DOMException && error.name === "DataCloneError") { + throw error; + } + window2.location.assign(url); + } + if (v5Compat && listener) { + listener({ action, location: history.location, delta: 1 }); + } + } + function replace2(to, state) { + action = "REPLACE" /* Replace */; + let location = createLocation(history.location, to, state); + if (validateLocation) validateLocation(location, to); + index = getIndex(); + let historyState = getHistoryState(location, index); + let url = history.createHref(location); + globalHistory.replaceState(historyState, "", url); + if (v5Compat && listener) { + listener({ action, location: history.location, delta: 0 }); + } + } + function createURL(to) { + return createBrowserURLImpl(to); + } + let history = { + get action() { + return action; + }, + get location() { + return getLocation(window2, globalHistory); + }, + listen(fn) { + if (listener) { + throw new Error("A history only accepts one active listener"); + } + window2.addEventListener(PopStateEventType, handlePop); + listener = fn; + return () => { + window2.removeEventListener(PopStateEventType, handlePop); + listener = null; + }; + }, + createHref(to) { + return createHref2(window2, to); + }, + createURL, + encodeLocation(to) { + let url = createURL(to); + return { + pathname: url.pathname, + search: url.search, + hash: url.hash + }; + }, + push, + replace: replace2, + go(n) { + return globalHistory.go(n); + } + }; + return history; +} +function createBrowserURLImpl(to, isAbsolute = false) { + let base = "http://localhost"; + if (typeof window !== "undefined") { + base = window.location.origin !== "null" ? window.location.origin : window.location.href; + } + invariant(base, "No window.location.(origin|href) available to create URL"); + let href = typeof to === "string" ? to : createPath(to); + href = href.replace(/ $/, "%20"); + if (!isAbsolute && href.startsWith("//")) { + href = base + href; + } + return new URL(href, base); +} + +// lib/router/utils.ts +function createContext(defaultValue) { + return { defaultValue }; +} +var _map; +var RouterContextProvider = class { + /** + * Create a new `RouterContextProvider` instance + * @param init An optional initial context map to populate the provider with + */ + constructor(init) { + __privateAdd(this, _map, /* @__PURE__ */ new Map()); + if (init) { + for (let [context, value] of init) { + this.set(context, value); + } + } + } + /** + * Access a value from the context. If no value has been set for the context, + * it will return the context's `defaultValue` if provided, or throw an error + * if no `defaultValue` was set. + * @param context The context to get the value for + * @returns The value for the context, or the context's `defaultValue` if no + * value was set + */ + get(context) { + if (__privateGet(this, _map).has(context)) { + return __privateGet(this, _map).get(context); + } + if (context.defaultValue !== void 0) { + return context.defaultValue; + } + throw new Error("No value found for context"); + } + /** + * Set a value for the context. If the context already has a value set, this + * will overwrite it. + * + * @param context The context to set the value for + * @param value The value to set for the context + * @returns {void} + */ + set(context, value) { + __privateGet(this, _map).set(context, value); + } +}; +_map = new WeakMap(); +var unsupportedLazyRouteObjectKeys = /* @__PURE__ */ new Set([ + "lazy", + "caseSensitive", + "path", + "id", + "index", + "children" +]); +function isUnsupportedLazyRouteObjectKey(key) { + return unsupportedLazyRouteObjectKeys.has( + key + ); +} +var unsupportedLazyRouteFunctionKeys = /* @__PURE__ */ new Set([ + "lazy", + "caseSensitive", + "path", + "id", + "index", + "middleware", + "children" +]); +function isUnsupportedLazyRouteFunctionKey(key) { + return unsupportedLazyRouteFunctionKeys.has( + key + ); +} +function isIndexRoute(route) { + return route.index === true; +} +function convertRoutesToDataRoutes(routes, mapRouteProperties2, parentPath = [], manifest = {}, allowInPlaceMutations = false) { + return routes.map((route, index) => { + let treePath = [...parentPath, String(index)]; + let id = typeof route.id === "string" ? route.id : treePath.join("-"); + invariant( + route.index !== true || !route.children, + `Cannot specify children on an index route` + ); + invariant( + allowInPlaceMutations || !manifest[id], + `Found a route id collision on id "${id}". Route id's must be globally unique within Data Router usages` + ); + if (isIndexRoute(route)) { + let indexRoute = { + ...route, + id + }; + manifest[id] = mergeRouteUpdates( + indexRoute, + mapRouteProperties2(indexRoute) + ); + return indexRoute; + } else { + let pathOrLayoutRoute = { + ...route, + id, + children: void 0 + }; + manifest[id] = mergeRouteUpdates( + pathOrLayoutRoute, + mapRouteProperties2(pathOrLayoutRoute) + ); + if (route.children) { + pathOrLayoutRoute.children = convertRoutesToDataRoutes( + route.children, + mapRouteProperties2, + treePath, + manifest, + allowInPlaceMutations + ); + } + return pathOrLayoutRoute; + } + }); +} +function mergeRouteUpdates(route, updates) { + return Object.assign(route, { + ...updates, + ...typeof updates.lazy === "object" && updates.lazy != null ? { + lazy: { + ...route.lazy, + ...updates.lazy + } + } : {} + }); +} +function matchRoutes(routes, locationArg, basename = "/") { + return matchRoutesImpl(routes, locationArg, basename, false); +} +function matchRoutesImpl(routes, locationArg, basename, allowPartial) { + let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; + let pathname = stripBasename(location.pathname || "/", basename); + if (pathname == null) { + return null; + } + let branches = flattenRoutes(routes); + rankRouteBranches(branches); + let matches = null; + for (let i = 0; matches == null && i < branches.length; ++i) { + let decoded = decodePath(pathname); + matches = matchRouteBranch( + branches[i], + decoded, + allowPartial + ); + } + return matches; +} +function convertRouteMatchToUiMatch(match, loaderData) { + let { route, pathname, params } = match; + return { + id: route.id, + pathname, + params, + data: loaderData[route.id], + loaderData: loaderData[route.id], + handle: route.handle + }; +} +function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "", _hasParentOptionalSegments = false) { + let flattenRoute = (route, index, hasParentOptionalSegments = _hasParentOptionalSegments, relativePath) => { + let meta = { + relativePath: relativePath === void 0 ? route.path || "" : relativePath, + caseSensitive: route.caseSensitive === true, + childrenIndex: index, + route + }; + if (meta.relativePath.startsWith("/")) { + if (!meta.relativePath.startsWith(parentPath) && hasParentOptionalSegments) { + return; + } + invariant( + meta.relativePath.startsWith(parentPath), + `Absolute route path "${meta.relativePath}" nested under path "${parentPath}" is not valid. An absolute child route path must start with the combined path of all its parent routes.` + ); + meta.relativePath = meta.relativePath.slice(parentPath.length); + } + let path = joinPaths([parentPath, meta.relativePath]); + let routesMeta = parentsMeta.concat(meta); + if (route.children && route.children.length > 0) { + invariant( + // Our types know better, but runtime JS may not! + // @ts-expect-error + route.index !== true, + `Index routes must not have child routes. Please remove all child routes from route path "${path}".` + ); + flattenRoutes( + route.children, + branches, + routesMeta, + path, + hasParentOptionalSegments + ); + } + if (route.path == null && !route.index) { + return; + } + branches.push({ + path, + score: computeScore(path, route.index), + routesMeta + }); + }; + routes.forEach((route, index) => { + if (route.path === "" || !route.path?.includes("?")) { + flattenRoute(route, index); + } else { + for (let exploded of explodeOptionalSegments(route.path)) { + flattenRoute(route, index, true, exploded); + } + } + }); + return branches; +} +function explodeOptionalSegments(path) { + let segments = path.split("/"); + if (segments.length === 0) return []; + let [first, ...rest] = segments; + let isOptional = first.endsWith("?"); + let required = first.replace(/\?$/, ""); + if (rest.length === 0) { + return isOptional ? [required, ""] : [required]; + } + let restExploded = explodeOptionalSegments(rest.join("/")); + let result = []; + result.push( + ...restExploded.map( + (subpath) => subpath === "" ? required : [required, subpath].join("/") + ) + ); + if (isOptional) { + result.push(...restExploded); + } + return result.map( + (exploded) => path.startsWith("/") && exploded === "" ? "/" : exploded + ); +} +function rankRouteBranches(branches) { + branches.sort( + (a, b) => a.score !== b.score ? b.score - a.score : compareIndexes( + a.routesMeta.map((meta) => meta.childrenIndex), + b.routesMeta.map((meta) => meta.childrenIndex) + ) + ); +} +var paramRe = /^:[\w-]+$/; +var dynamicSegmentValue = 3; +var indexRouteValue = 2; +var emptySegmentValue = 1; +var staticSegmentValue = 10; +var splatPenalty = -2; +var isSplat = (s) => s === "*"; +function computeScore(path, index) { + let segments = path.split("/"); + let initialScore = segments.length; + if (segments.some(isSplat)) { + initialScore += splatPenalty; + } + if (index) { + initialScore += indexRouteValue; + } + return segments.filter((s) => !isSplat(s)).reduce( + (score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), + initialScore + ); +} +function compareIndexes(a, b) { + let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]); + return siblings ? ( + // If two routes are siblings, we should try to match the earlier sibling + // first. This allows people to have fine-grained control over the matching + // behavior by simply putting routes with identical paths in the order they + // want them tried. + a[a.length - 1] - b[b.length - 1] + ) : ( + // Otherwise, it doesn't really make sense to rank non-siblings by index, + // so they sort equally. + 0 + ); +} +function matchRouteBranch(branch, pathname, allowPartial = false) { + let { routesMeta } = branch; + let matchedParams = {}; + let matchedPathname = "/"; + let matches = []; + for (let i = 0; i < routesMeta.length; ++i) { + let meta = routesMeta[i]; + let end = i === routesMeta.length - 1; + let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/"; + let match = matchPath( + { path: meta.relativePath, caseSensitive: meta.caseSensitive, end }, + remainingPathname + ); + let route = meta.route; + if (!match && end && allowPartial && !routesMeta[routesMeta.length - 1].route.index) { + match = matchPath( + { + path: meta.relativePath, + caseSensitive: meta.caseSensitive, + end: false + }, + remainingPathname + ); + } + if (!match) { + return null; + } + Object.assign(matchedParams, match.params); + matches.push({ + // TODO: Can this as be avoided? + params: matchedParams, + pathname: joinPaths([matchedPathname, match.pathname]), + pathnameBase: normalizePathname( + joinPaths([matchedPathname, match.pathnameBase]) + ), + route + }); + if (match.pathnameBase !== "/") { + matchedPathname = joinPaths([matchedPathname, match.pathnameBase]); + } + } + return matches; +} +function generatePath(originalPath, params = {}) { + let path = originalPath; + if (path.endsWith("*") && path !== "*" && !path.endsWith("/*")) { + warning( + false, + `Route path "${path}" will be treated as if it were "${path.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${path.replace(/\*$/, "/*")}".` + ); + path = path.replace(/\*$/, "/*"); + } + const prefix = path.startsWith("/") ? "/" : ""; + const stringify2 = (p) => p == null ? "" : typeof p === "string" ? p : String(p); + const segments = path.split(/\/+/).map((segment, index, array) => { + const isLastSegment = index === array.length - 1; + if (isLastSegment && segment === "*") { + const star = "*"; + return stringify2(params[star]); + } + const keyMatch = segment.match(/^:([\w-]+)(\??)(.*)/); + if (keyMatch) { + const [, key, optional, suffix] = keyMatch; + let param = params[key]; + invariant(optional === "?" || param != null, `Missing ":${key}" param`); + return encodeURIComponent(stringify2(param)) + suffix; + } + return segment.replace(/\?$/g, ""); + }).filter((segment) => !!segment); + return prefix + segments.join("/"); +} +function matchPath(pattern, pathname) { + if (typeof pattern === "string") { + pattern = { path: pattern, caseSensitive: false, end: true }; + } + let [matcher, compiledParams] = compilePath( + pattern.path, + pattern.caseSensitive, + pattern.end + ); + let match = pathname.match(matcher); + if (!match) return null; + let matchedPathname = match[0]; + let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1"); + let captureGroups = match.slice(1); + let params = compiledParams.reduce( + (memo2, { paramName, isOptional }, index) => { + if (paramName === "*") { + let splatValue = captureGroups[index] || ""; + pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1"); + } + const value = captureGroups[index]; + if (isOptional && !value) { + memo2[paramName] = void 0; + } else { + memo2[paramName] = (value || "").replace(/%2F/g, "/"); + } + return memo2; + }, + {} + ); + return { + params, + pathname: matchedPathname, + pathnameBase, + pattern + }; +} +function compilePath(path, caseSensitive = false, end = true) { + warning( + path === "*" || !path.endsWith("*") || path.endsWith("/*"), + `Route path "${path}" will be treated as if it were "${path.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${path.replace(/\*$/, "/*")}".` + ); + let params = []; + let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace( + /\/:([\w-]+)(\?)?/g, + (_, paramName, isOptional) => { + params.push({ paramName, isOptional: isOptional != null }); + return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)"; + } + ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2"); + if (path.endsWith("*")) { + params.push({ paramName: "*" }); + regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$"; + } else if (end) { + regexpSource += "\\/*$"; + } else if (path !== "" && path !== "/") { + regexpSource += "(?:(?=\\/|$))"; + } else { + } + let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i"); + return [matcher, params]; +} +function decodePath(value) { + try { + return value.split("/").map((v) => decodeURIComponent(v).replace(/\//g, "%2F")).join("/"); + } catch (error) { + warning( + false, + `The URL path "${value}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${error}).` + ); + return value; + } +} +function stripBasename(pathname, basename) { + if (basename === "/") return pathname; + if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) { + return null; + } + let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length; + let nextChar = pathname.charAt(startIndex); + if (nextChar && nextChar !== "/") { + return null; + } + return pathname.slice(startIndex) || "/"; +} +function prependBasename({ + basename, + pathname +}) { + return pathname === "/" ? basename : joinPaths([basename, pathname]); +} +var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i; +var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url); +function resolvePath(to, fromPathname = "/") { + let { + pathname: toPathname, + search = "", + hash = "" + } = typeof to === "string" ? parsePath(to) : to; + let pathname; + if (toPathname) { + if (isAbsoluteUrl(toPathname)) { + pathname = toPathname; + } else { + if (toPathname.includes("//")) { + let oldPathname = toPathname; + toPathname = toPathname.replace(/\/\/+/g, "/"); + warning( + false, + `Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}` + ); + } + if (toPathname.startsWith("/")) { + pathname = resolvePathname(toPathname.substring(1), "/"); + } else { + pathname = resolvePathname(toPathname, fromPathname); + } + } + } else { + pathname = fromPathname; + } + return { + pathname, + search: normalizeSearch(search), + hash: normalizeHash(hash) + }; +} +function resolvePathname(relativePath, fromPathname) { + let segments = fromPathname.replace(/\/+$/, "").split("/"); + let relativeSegments = relativePath.split("/"); + relativeSegments.forEach((segment) => { + if (segment === "..") { + if (segments.length > 1) segments.pop(); + } else if (segment !== ".") { + segments.push(segment); + } + }); + return segments.length > 1 ? segments.join("/") : "/"; +} +function getInvalidPathError(char, field, dest, path) { + return `Cannot include a '${char}' character in a manually specified \`to.${field}\` field [${JSON.stringify( + path + )}]. Please separate it out to the \`to.${dest}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`; +} +function getPathContributingMatches(matches) { + return matches.filter( + (match, index) => index === 0 || match.route.path && match.route.path.length > 0 + ); +} +function getResolveToMatches(matches) { + let pathMatches = getPathContributingMatches(matches); + return pathMatches.map( + (match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase + ); +} +function resolveTo(toArg, routePathnames, locationPathname, isPathRelative = false) { + let to; + if (typeof toArg === "string") { + to = parsePath(toArg); + } else { + to = { ...toArg }; + invariant( + !to.pathname || !to.pathname.includes("?"), + getInvalidPathError("?", "pathname", "search", to) + ); + invariant( + !to.pathname || !to.pathname.includes("#"), + getInvalidPathError("#", "pathname", "hash", to) + ); + invariant( + !to.search || !to.search.includes("#"), + getInvalidPathError("#", "search", "hash", to) + ); + } + let isEmptyPath = toArg === "" || to.pathname === ""; + let toPathname = isEmptyPath ? "/" : to.pathname; + let from; + if (toPathname == null) { + from = locationPathname; + } else { + let routePathnameIndex = routePathnames.length - 1; + if (!isPathRelative && toPathname.startsWith("..")) { + let toSegments = toPathname.split("/"); + while (toSegments[0] === "..") { + toSegments.shift(); + routePathnameIndex -= 1; + } + to.pathname = toSegments.join("/"); + } + from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/"; + } + let path = resolvePath(to, from); + let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"); + let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/"); + if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) { + path.pathname += "/"; + } + return path; +} +var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/"); +var normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/"); +var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search; +var normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash; +var DataWithResponseInit = class { + constructor(data2, init) { + this.type = "DataWithResponseInit"; + this.data = data2; + this.init = init || null; + } +}; +function data(data2, init) { + return new DataWithResponseInit( + data2, + typeof init === "number" ? { status: init } : init + ); +} +var redirect = (url, init = 302) => { + let responseInit = init; + if (typeof responseInit === "number") { + responseInit = { status: responseInit }; + } else if (typeof responseInit.status === "undefined") { + responseInit.status = 302; + } + let headers = new Headers(responseInit.headers); + headers.set("Location", url); + return new Response(null, { ...responseInit, headers }); +}; +var redirectDocument = (url, init) => { + let response = redirect(url, init); + response.headers.set("X-Remix-Reload-Document", "true"); + return response; +}; +var replace = (url, init) => { + let response = redirect(url, init); + response.headers.set("X-Remix-Replace", "true"); + return response; +}; +var ErrorResponseImpl = class { + constructor(status, statusText, data2, internal = false) { + this.status = status; + this.statusText = statusText || ""; + this.internal = internal; + if (data2 instanceof Error) { + this.data = data2.toString(); + this.error = data2; + } else { + this.data = data2; + } + } +}; +function isRouteErrorResponse(error) { + return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error; +} +function getRoutePattern(matches) { + return matches.map((m) => m.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/"; +} +var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"; +function parseToInfo(_to, basename) { + let to = _to; + if (typeof to !== "string" || !ABSOLUTE_URL_REGEX.test(to)) { + return { + absoluteURL: void 0, + isExternal: false, + to + }; + } + let absoluteURL = to; + let isExternal = false; + if (isBrowser) { + try { + let currentUrl = new URL(window.location.href); + let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to); + let path = stripBasename(targetUrl.pathname, basename); + if (targetUrl.origin === currentUrl.origin && path != null) { + to = path + targetUrl.search + targetUrl.hash; + } else { + isExternal = true; + } + } catch (e) { + warning( + false, + ` contains an invalid URL which will probably break when clicked - please update to a valid URL path.` + ); + } + } + return { + absoluteURL, + isExternal, + to + }; +} + +// lib/router/instrumentation.ts +var UninstrumentedSymbol = Symbol("Uninstrumented"); +function getRouteInstrumentationUpdates(fns, route) { + let aggregated = { + lazy: [], + "lazy.loader": [], + "lazy.action": [], + "lazy.middleware": [], + middleware: [], + loader: [], + action: [] + }; + fns.forEach( + (fn) => fn({ + id: route.id, + index: route.index, + path: route.path, + instrument(i) { + let keys = Object.keys(aggregated); + for (let key of keys) { + if (i[key]) { + aggregated[key].push(i[key]); + } + } + } + }) + ); + let updates = {}; + if (typeof route.lazy === "function" && aggregated.lazy.length > 0) { + let instrumented = wrapImpl(aggregated.lazy, route.lazy, () => void 0); + if (instrumented) { + updates.lazy = instrumented; + } + } + if (typeof route.lazy === "object") { + let lazyObject = route.lazy; + ["middleware", "loader", "action"].forEach((key) => { + let lazyFn = lazyObject[key]; + let instrumentations = aggregated[`lazy.${key}`]; + if (typeof lazyFn === "function" && instrumentations.length > 0) { + let instrumented = wrapImpl(instrumentations, lazyFn, () => void 0); + if (instrumented) { + updates.lazy = Object.assign(updates.lazy || {}, { + [key]: instrumented + }); + } + } + }); + } + ["loader", "action"].forEach((key) => { + let handler = route[key]; + if (typeof handler === "function" && aggregated[key].length > 0) { + let original = handler[UninstrumentedSymbol] ?? handler; + let instrumented = wrapImpl( + aggregated[key], + original, + (...args) => getHandlerInfo(args[0]) + ); + if (instrumented) { + if (key === "loader" && original.hydrate === true) { + instrumented.hydrate = true; + } + instrumented[UninstrumentedSymbol] = original; + updates[key] = instrumented; + } + } + }); + if (route.middleware && route.middleware.length > 0 && aggregated.middleware.length > 0) { + updates.middleware = route.middleware.map((middleware) => { + let original = middleware[UninstrumentedSymbol] ?? middleware; + let instrumented = wrapImpl( + aggregated.middleware, + original, + (...args) => getHandlerInfo(args[0]) + ); + if (instrumented) { + instrumented[UninstrumentedSymbol] = original; + return instrumented; + } + return middleware; + }); + } + return updates; +} +function instrumentClientSideRouter(router, fns) { + let aggregated = { + navigate: [], + fetch: [] + }; + fns.forEach( + (fn) => fn({ + instrument(i) { + let keys = Object.keys(i); + for (let key of keys) { + if (i[key]) { + aggregated[key].push(i[key]); + } + } + } + }) + ); + if (aggregated.navigate.length > 0) { + let navigate = router.navigate[UninstrumentedSymbol] ?? router.navigate; + let instrumentedNavigate = wrapImpl( + aggregated.navigate, + navigate, + (...args) => { + let [to, opts] = args; + return { + to: typeof to === "number" || typeof to === "string" ? to : to ? createPath(to) : ".", + ...getRouterInfo(router, opts ?? {}) + }; + } + ); + if (instrumentedNavigate) { + instrumentedNavigate[UninstrumentedSymbol] = navigate; + router.navigate = instrumentedNavigate; + } + } + if (aggregated.fetch.length > 0) { + let fetch2 = router.fetch[UninstrumentedSymbol] ?? router.fetch; + let instrumentedFetch = wrapImpl(aggregated.fetch, fetch2, (...args) => { + let [key, , href, opts] = args; + return { + href: href ?? ".", + fetcherKey: key, + ...getRouterInfo(router, opts ?? {}) + }; + }); + if (instrumentedFetch) { + instrumentedFetch[UninstrumentedSymbol] = fetch2; + router.fetch = instrumentedFetch; + } + } + return router; +} +function instrumentHandler(handler, fns) { + let aggregated = { + request: [] + }; + fns.forEach( + (fn) => fn({ + instrument(i) { + let keys = Object.keys(i); + for (let key of keys) { + if (i[key]) { + aggregated[key].push(i[key]); + } + } + } + }) + ); + let instrumentedHandler = handler; + if (aggregated.request.length > 0) { + instrumentedHandler = wrapImpl(aggregated.request, handler, (...args) => { + let [request, context] = args; + return { + request: getReadonlyRequest(request), + context: context != null ? getReadonlyContext(context) : context + }; + }); + } + return instrumentedHandler; +} +function wrapImpl(impls, handler, getInfo) { + if (impls.length === 0) { + return null; + } + return async (...args) => { + let result = await recurseRight( + impls, + getInfo(...args), + () => handler(...args), + impls.length - 1 + ); + if (result.type === "error") { + throw result.value; + } + return result.value; + }; +} +async function recurseRight(impls, info, handler, index) { + let impl = impls[index]; + let result; + if (!impl) { + try { + let value = await handler(); + result = { type: "success", value }; + } catch (e) { + result = { type: "error", value: e }; + } + } else { + let handlerPromise = void 0; + let callHandler = async () => { + if (handlerPromise) { + console.error("You cannot call instrumented handlers more than once"); + } else { + handlerPromise = recurseRight(impls, info, handler, index - 1); + } + result = await handlerPromise; + invariant(result, "Expected a result"); + if (result.type === "error" && result.value instanceof Error) { + return { status: "error", error: result.value }; + } + return { status: "success", error: void 0 }; + }; + try { + await impl(callHandler, info); + } catch (e) { + console.error("An instrumentation function threw an error:", e); + } + if (!handlerPromise) { + await callHandler(); + } + await handlerPromise; + } + if (result) { + return result; + } + return { + type: "error", + value: new Error("No result assigned in instrumentation chain.") + }; +} +function getHandlerInfo(args) { + let { request, context, params, unstable_pattern } = args; + return { + request: getReadonlyRequest(request), + params: { ...params }, + unstable_pattern, + context: getReadonlyContext(context) + }; +} +function getRouterInfo(router, opts) { + return { + currentUrl: createPath(router.state.location), + ..."formMethod" in opts ? { formMethod: opts.formMethod } : {}, + ..."formEncType" in opts ? { formEncType: opts.formEncType } : {}, + ..."formData" in opts ? { formData: opts.formData } : {}, + ..."body" in opts ? { body: opts.body } : {} + }; +} +function getReadonlyRequest(request) { + return { + method: request.method, + url: request.url, + headers: { + get: (...args) => request.headers.get(...args) + } + }; +} +function getReadonlyContext(context) { + if (isPlainObject(context)) { + let frozen = { ...context }; + Object.freeze(frozen); + return frozen; + } else { + return { + get: (ctx) => context.get(ctx) + }; + } +} +var objectProtoNames = Object.getOwnPropertyNames(Object.prototype).sort().join("\0"); +function isPlainObject(thing) { + if (thing === null || typeof thing !== "object") { + return false; + } + const proto = Object.getPrototypeOf(thing); + return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames; +} + +// lib/router/router.ts +var validMutationMethodsArr = [ + "POST", + "PUT", + "PATCH", + "DELETE" +]; +var validMutationMethods = new Set( + validMutationMethodsArr +); +var validRequestMethodsArr = [ + "GET", + ...validMutationMethodsArr +]; +var validRequestMethods = new Set(validRequestMethodsArr); +var redirectStatusCodes = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]); +var redirectPreserveMethodStatusCodes = /* @__PURE__ */ new Set([307, 308]); +var IDLE_NAVIGATION = { + state: "idle", + location: void 0, + formMethod: void 0, + formAction: void 0, + formEncType: void 0, + formData: void 0, + json: void 0, + text: void 0 +}; +var IDLE_FETCHER = { + state: "idle", + data: void 0, + formMethod: void 0, + formAction: void 0, + formEncType: void 0, + formData: void 0, + json: void 0, + text: void 0 +}; +var IDLE_BLOCKER = { + state: "unblocked", + proceed: void 0, + reset: void 0, + location: void 0 +}; +var defaultMapRouteProperties = (route) => ({ + hasErrorBoundary: Boolean(route.hasErrorBoundary) +}); +var TRANSITIONS_STORAGE_KEY = "remix-router-transitions"; +var ResetLoaderDataSymbol = Symbol("ResetLoaderData"); +function createRouter(init) { + const routerWindow = init.window ? init.window : typeof window !== "undefined" ? window : void 0; + const isBrowser3 = typeof routerWindow !== "undefined" && typeof routerWindow.document !== "undefined" && typeof routerWindow.document.createElement !== "undefined"; + invariant( + init.routes.length > 0, + "You must provide a non-empty routes array to createRouter" + ); + let hydrationRouteProperties2 = init.hydrationRouteProperties || []; + let _mapRouteProperties = init.mapRouteProperties || defaultMapRouteProperties; + let mapRouteProperties2 = _mapRouteProperties; + if (init.unstable_instrumentations) { + let instrumentations = init.unstable_instrumentations; + mapRouteProperties2 = (route) => { + return { + ..._mapRouteProperties(route), + ...getRouteInstrumentationUpdates( + instrumentations.map((i) => i.route).filter(Boolean), + route + ) + }; + }; + } + let manifest = {}; + let dataRoutes = convertRoutesToDataRoutes( + init.routes, + mapRouteProperties2, + void 0, + manifest + ); + let inFlightDataRoutes; + let basename = init.basename || "/"; + if (!basename.startsWith("/")) { + basename = `/${basename}`; + } + let dataStrategyImpl = init.dataStrategy || defaultDataStrategyWithMiddleware; + let future = { + ...init.future + }; + let unlistenHistory = null; + let subscribers = /* @__PURE__ */ new Set(); + let savedScrollPositions2 = null; + let getScrollRestorationKey2 = null; + let getScrollPosition = null; + let initialScrollRestored = init.hydrationData != null; + let initialMatches = matchRoutes(dataRoutes, init.history.location, basename); + let initialMatchesIsFOW = false; + let initialErrors = null; + let initialized; + if (initialMatches == null && !init.patchRoutesOnNavigation) { + let error = getInternalRouterError(404, { + pathname: init.history.location.pathname + }); + let { matches, route } = getShortCircuitMatches(dataRoutes); + initialized = true; + initialMatches = matches; + initialErrors = { [route.id]: error }; + } else { + if (initialMatches && !init.hydrationData) { + let fogOfWar = checkFogOfWar( + initialMatches, + dataRoutes, + init.history.location.pathname + ); + if (fogOfWar.active) { + initialMatches = null; + } + } + if (!initialMatches) { + initialized = false; + initialMatches = []; + let fogOfWar = checkFogOfWar( + null, + dataRoutes, + init.history.location.pathname + ); + if (fogOfWar.active && fogOfWar.matches) { + initialMatchesIsFOW = true; + initialMatches = fogOfWar.matches; + } + } else if (initialMatches.some((m) => m.route.lazy)) { + initialized = false; + } else if (!initialMatches.some((m) => routeHasLoaderOrMiddleware(m.route))) { + initialized = true; + } else { + let loaderData = init.hydrationData ? init.hydrationData.loaderData : null; + let errors = init.hydrationData ? init.hydrationData.errors : null; + if (errors) { + let idx = initialMatches.findIndex( + (m) => errors[m.route.id] !== void 0 + ); + initialized = initialMatches.slice(0, idx + 1).every( + (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors) + ); + } else { + initialized = initialMatches.every( + (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors) + ); + } + } + } + let router; + let state = { + historyAction: init.history.action, + location: init.history.location, + matches: initialMatches, + initialized, + navigation: IDLE_NAVIGATION, + // Don't restore on initial updateState() if we were SSR'd + restoreScrollPosition: init.hydrationData != null ? false : null, + preventScrollReset: false, + revalidation: "idle", + loaderData: init.hydrationData && init.hydrationData.loaderData || {}, + actionData: init.hydrationData && init.hydrationData.actionData || null, + errors: init.hydrationData && init.hydrationData.errors || initialErrors, + fetchers: /* @__PURE__ */ new Map(), + blockers: /* @__PURE__ */ new Map() + }; + let pendingAction = "POP" /* Pop */; + let pendingPopstateNavigationDfd = null; + let pendingPreventScrollReset = false; + let pendingNavigationController; + let pendingViewTransitionEnabled = false; + let appliedViewTransitions = /* @__PURE__ */ new Map(); + let removePageHideEventListener = null; + let isUninterruptedRevalidation = false; + let isRevalidationRequired = false; + let cancelledFetcherLoads = /* @__PURE__ */ new Set(); + let fetchControllers = /* @__PURE__ */ new Map(); + let incrementingLoadId = 0; + let pendingNavigationLoadId = -1; + let fetchReloadIds = /* @__PURE__ */ new Map(); + let fetchRedirectIds = /* @__PURE__ */ new Set(); + let fetchLoadMatches = /* @__PURE__ */ new Map(); + let activeFetchers = /* @__PURE__ */ new Map(); + let fetchersQueuedForDeletion = /* @__PURE__ */ new Set(); + let blockerFunctions = /* @__PURE__ */ new Map(); + let unblockBlockerHistoryUpdate = void 0; + let pendingRevalidationDfd = null; + function initialize() { + unlistenHistory = init.history.listen( + ({ action: historyAction, location, delta }) => { + if (unblockBlockerHistoryUpdate) { + unblockBlockerHistoryUpdate(); + unblockBlockerHistoryUpdate = void 0; + return; + } + warning( + blockerFunctions.size === 0 || delta != null, + "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL." + ); + let blockerKey = shouldBlockNavigation({ + currentLocation: state.location, + nextLocation: location, + historyAction + }); + if (blockerKey && delta != null) { + let nextHistoryUpdatePromise = new Promise((resolve) => { + unblockBlockerHistoryUpdate = resolve; + }); + init.history.go(delta * -1); + updateBlocker(blockerKey, { + state: "blocked", + location, + proceed() { + updateBlocker(blockerKey, { + state: "proceeding", + proceed: void 0, + reset: void 0, + location + }); + nextHistoryUpdatePromise.then(() => init.history.go(delta)); + }, + reset() { + let blockers = new Map(state.blockers); + blockers.set(blockerKey, IDLE_BLOCKER); + updateState({ blockers }); + } + }); + pendingPopstateNavigationDfd?.resolve(); + pendingPopstateNavigationDfd = null; + return; + } + return startNavigation(historyAction, location); + } + ); + if (isBrowser3) { + restoreAppliedTransitions(routerWindow, appliedViewTransitions); + let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions); + routerWindow.addEventListener("pagehide", _saveAppliedTransitions); + removePageHideEventListener = () => routerWindow.removeEventListener("pagehide", _saveAppliedTransitions); + } + if (!state.initialized) { + startNavigation("POP" /* Pop */, state.location, { + initialHydration: true + }); + } + return router; + } + function dispose() { + if (unlistenHistory) { + unlistenHistory(); + } + if (removePageHideEventListener) { + removePageHideEventListener(); + } + subscribers.clear(); + pendingNavigationController && pendingNavigationController.abort(); + state.fetchers.forEach((_, key) => deleteFetcher(key)); + state.blockers.forEach((_, key) => deleteBlocker(key)); + } + function subscribe(fn) { + subscribers.add(fn); + return () => subscribers.delete(fn); + } + function updateState(newState, opts = {}) { + if (newState.matches) { + newState.matches = newState.matches.map((m) => { + let route = manifest[m.route.id]; + let matchRoute = m.route; + if (matchRoute.element !== route.element || matchRoute.errorElement !== route.errorElement || matchRoute.hydrateFallbackElement !== route.hydrateFallbackElement) { + return { + ...m, + route + }; + } + return m; + }); + } + state = { + ...state, + ...newState + }; + let unmountedFetchers = []; + let mountedFetchers = []; + state.fetchers.forEach((fetcher, key) => { + if (fetcher.state === "idle") { + if (fetchersQueuedForDeletion.has(key)) { + unmountedFetchers.push(key); + } else { + mountedFetchers.push(key); + } + } + }); + fetchersQueuedForDeletion.forEach((key) => { + if (!state.fetchers.has(key) && !fetchControllers.has(key)) { + unmountedFetchers.push(key); + } + }); + [...subscribers].forEach( + (subscriber) => subscriber(state, { + deletedFetchers: unmountedFetchers, + newErrors: newState.errors ?? null, + viewTransitionOpts: opts.viewTransitionOpts, + flushSync: opts.flushSync === true + }) + ); + unmountedFetchers.forEach((key) => deleteFetcher(key)); + mountedFetchers.forEach((key) => state.fetchers.delete(key)); + } + function completeNavigation(location, newState, { flushSync } = {}) { + let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && location.state?._isRedirect !== true; + let actionData; + if (newState.actionData) { + if (Object.keys(newState.actionData).length > 0) { + actionData = newState.actionData; + } else { + actionData = null; + } + } else if (isActionReload) { + actionData = state.actionData; + } else { + actionData = null; + } + let loaderData = newState.loaderData ? mergeLoaderData( + state.loaderData, + newState.loaderData, + newState.matches || [], + newState.errors + ) : state.loaderData; + let blockers = state.blockers; + if (blockers.size > 0) { + blockers = new Map(blockers); + blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER)); + } + let restoreScrollPosition = isUninterruptedRevalidation ? false : getSavedScrollPosition(location, newState.matches || state.matches); + let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && location.state?._isRedirect !== true; + if (inFlightDataRoutes) { + dataRoutes = inFlightDataRoutes; + inFlightDataRoutes = void 0; + } + if (isUninterruptedRevalidation) { + } else if (pendingAction === "POP" /* Pop */) { + } else if (pendingAction === "PUSH" /* Push */) { + init.history.push(location, location.state); + } else if (pendingAction === "REPLACE" /* Replace */) { + init.history.replace(location, location.state); + } + let viewTransitionOpts; + if (pendingAction === "POP" /* Pop */) { + let priorPaths = appliedViewTransitions.get(state.location.pathname); + if (priorPaths && priorPaths.has(location.pathname)) { + viewTransitionOpts = { + currentLocation: state.location, + nextLocation: location + }; + } else if (appliedViewTransitions.has(location.pathname)) { + viewTransitionOpts = { + currentLocation: location, + nextLocation: state.location + }; + } + } else if (pendingViewTransitionEnabled) { + let toPaths = appliedViewTransitions.get(state.location.pathname); + if (toPaths) { + toPaths.add(location.pathname); + } else { + toPaths = /* @__PURE__ */ new Set([location.pathname]); + appliedViewTransitions.set(state.location.pathname, toPaths); + } + viewTransitionOpts = { + currentLocation: state.location, + nextLocation: location + }; + } + updateState( + { + ...newState, + // matches, errors, fetchers go through as-is + actionData, + loaderData, + historyAction: pendingAction, + location, + initialized: true, + navigation: IDLE_NAVIGATION, + revalidation: "idle", + restoreScrollPosition, + preventScrollReset, + blockers + }, + { + viewTransitionOpts, + flushSync: flushSync === true + } + ); + pendingAction = "POP" /* Pop */; + pendingPreventScrollReset = false; + pendingViewTransitionEnabled = false; + isUninterruptedRevalidation = false; + isRevalidationRequired = false; + pendingPopstateNavigationDfd?.resolve(); + pendingPopstateNavigationDfd = null; + pendingRevalidationDfd?.resolve(); + pendingRevalidationDfd = null; + } + async function navigate(to, opts) { + pendingPopstateNavigationDfd?.resolve(); + pendingPopstateNavigationDfd = null; + if (typeof to === "number") { + if (!pendingPopstateNavigationDfd) { + pendingPopstateNavigationDfd = createDeferred(); + } + let promise = pendingPopstateNavigationDfd.promise; + init.history.go(to); + return promise; + } + let normalizedPath = normalizeTo( + state.location, + state.matches, + basename, + to, + opts?.fromRouteId, + opts?.relative + ); + let { path, submission, error } = normalizeNavigateOptions( + false, + normalizedPath, + opts + ); + let currentLocation = state.location; + let nextLocation = createLocation(state.location, path, opts && opts.state); + nextLocation = { + ...nextLocation, + ...init.history.encodeLocation(nextLocation) + }; + let userReplace = opts && opts.replace != null ? opts.replace : void 0; + let historyAction = "PUSH" /* Push */; + if (userReplace === true) { + historyAction = "REPLACE" /* Replace */; + } else if (userReplace === false) { + } else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) { + historyAction = "REPLACE" /* Replace */; + } + let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : void 0; + let flushSync = (opts && opts.flushSync) === true; + let blockerKey = shouldBlockNavigation({ + currentLocation, + nextLocation, + historyAction + }); + if (blockerKey) { + updateBlocker(blockerKey, { + state: "blocked", + location: nextLocation, + proceed() { + updateBlocker(blockerKey, { + state: "proceeding", + proceed: void 0, + reset: void 0, + location: nextLocation + }); + navigate(to, opts); + }, + reset() { + let blockers = new Map(state.blockers); + blockers.set(blockerKey, IDLE_BLOCKER); + updateState({ blockers }); + } + }); + return; + } + await startNavigation(historyAction, nextLocation, { + submission, + // Send through the formData serialization error if we have one so we can + // render at the right error boundary after we match routes + pendingError: error, + preventScrollReset, + replace: opts && opts.replace, + enableViewTransition: opts && opts.viewTransition, + flushSync, + callSiteDefaultShouldRevalidate: opts && opts.unstable_defaultShouldRevalidate + }); + } + function revalidate() { + if (!pendingRevalidationDfd) { + pendingRevalidationDfd = createDeferred(); + } + interruptActiveLoads(); + updateState({ revalidation: "loading" }); + let promise = pendingRevalidationDfd.promise; + if (state.navigation.state === "submitting") { + return promise; + } + if (state.navigation.state === "idle") { + startNavigation(state.historyAction, state.location, { + startUninterruptedRevalidation: true + }); + return promise; + } + startNavigation( + pendingAction || state.historyAction, + state.navigation.location, + { + overrideNavigation: state.navigation, + // Proxy through any rending view transition + enableViewTransition: pendingViewTransitionEnabled === true + } + ); + return promise; + } + async function startNavigation(historyAction, location, opts) { + pendingNavigationController && pendingNavigationController.abort(); + pendingNavigationController = null; + pendingAction = historyAction; + isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; + saveScrollPosition(state.location, state.matches); + pendingPreventScrollReset = (opts && opts.preventScrollReset) === true; + pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true; + let routesToUse = inFlightDataRoutes || dataRoutes; + let loadingNavigation = opts && opts.overrideNavigation; + let matches = opts?.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ? ( + // `matchRoutes()` has already been called if we're in here via `router.initialize()` + state.matches + ) : matchRoutes(routesToUse, location, basename); + let flushSync = (opts && opts.flushSync) === true; + if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) { + completeNavigation(location, { matches }, { flushSync }); + return; + } + let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname); + if (fogOfWar.active && fogOfWar.matches) { + matches = fogOfWar.matches; + } + if (!matches) { + let { error, notFoundMatches, route } = handleNavigational404( + location.pathname + ); + completeNavigation( + location, + { + matches: notFoundMatches, + loaderData: {}, + errors: { + [route.id]: error + } + }, + { flushSync } + ); + return; + } + pendingNavigationController = new AbortController(); + let request = createClientSideRequest( + init.history, + location, + pendingNavigationController.signal, + opts && opts.submission + ); + let scopedContext = init.getContext ? await init.getContext() : new RouterContextProvider(); + let pendingActionResult; + if (opts && opts.pendingError) { + pendingActionResult = [ + findNearestBoundary(matches).route.id, + { type: "error" /* error */, error: opts.pendingError } + ]; + } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) { + let actionResult = await handleAction( + request, + location, + opts.submission, + matches, + scopedContext, + fogOfWar.active, + opts && opts.initialHydration === true, + { replace: opts.replace, flushSync } + ); + if (actionResult.shortCircuited) { + return; + } + if (actionResult.pendingActionResult) { + let [routeId, result] = actionResult.pendingActionResult; + if (isErrorResult(result) && isRouteErrorResponse(result.error) && result.error.status === 404) { + pendingNavigationController = null; + completeNavigation(location, { + matches: actionResult.matches, + loaderData: {}, + errors: { + [routeId]: result.error + } + }); + return; + } + } + matches = actionResult.matches || matches; + pendingActionResult = actionResult.pendingActionResult; + loadingNavigation = getLoadingNavigation(location, opts.submission); + flushSync = false; + fogOfWar.active = false; + request = createClientSideRequest( + init.history, + request.url, + request.signal + ); + } + let { + shortCircuited, + matches: updatedMatches, + loaderData, + errors + } = await handleLoaders( + request, + location, + matches, + scopedContext, + fogOfWar.active, + loadingNavigation, + opts && opts.submission, + opts && opts.fetcherSubmission, + opts && opts.replace, + opts && opts.initialHydration === true, + flushSync, + pendingActionResult, + opts && opts.callSiteDefaultShouldRevalidate + ); + if (shortCircuited) { + return; + } + pendingNavigationController = null; + completeNavigation(location, { + matches: updatedMatches || matches, + ...getActionDataForCommit(pendingActionResult), + loaderData, + errors + }); + } + async function handleAction(request, location, submission, matches, scopedContext, isFogOfWar, initialHydration, opts = {}) { + interruptActiveLoads(); + let navigation = getSubmittingNavigation(location, submission); + updateState({ navigation }, { flushSync: opts.flushSync === true }); + if (isFogOfWar) { + let discoverResult = await discoverRoutes( + matches, + location.pathname, + request.signal + ); + if (discoverResult.type === "aborted") { + return { shortCircuited: true }; + } else if (discoverResult.type === "error") { + if (discoverResult.partialMatches.length === 0) { + let { matches: matches2, route } = getShortCircuitMatches(dataRoutes); + return { + matches: matches2, + pendingActionResult: [ + route.id, + { + type: "error" /* error */, + error: discoverResult.error + } + ] + }; + } + let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id; + return { + matches: discoverResult.partialMatches, + pendingActionResult: [ + boundaryId, + { + type: "error" /* error */, + error: discoverResult.error + } + ] + }; + } else if (!discoverResult.matches) { + let { notFoundMatches, error, route } = handleNavigational404( + location.pathname + ); + return { + matches: notFoundMatches, + pendingActionResult: [ + route.id, + { + type: "error" /* error */, + error + } + ] + }; + } else { + matches = discoverResult.matches; + } + } + let result; + let actionMatch = getTargetMatch(matches, location); + if (!actionMatch.route.action && !actionMatch.route.lazy) { + result = { + type: "error" /* error */, + error: getInternalRouterError(405, { + method: request.method, + pathname: location.pathname, + routeId: actionMatch.route.id + }) + }; + } else { + let dsMatches = getTargetedDataStrategyMatches( + mapRouteProperties2, + manifest, + request, + matches, + actionMatch, + initialHydration ? [] : hydrationRouteProperties2, + scopedContext + ); + let results = await callDataStrategy( + request, + dsMatches, + scopedContext, + null + ); + result = results[actionMatch.route.id]; + if (!result) { + for (let match of matches) { + if (results[match.route.id]) { + result = results[match.route.id]; + break; + } + } + } + if (request.signal.aborted) { + return { shortCircuited: true }; + } + } + if (isRedirectResult(result)) { + let replace2; + if (opts && opts.replace != null) { + replace2 = opts.replace; + } else { + let location2 = normalizeRedirectLocation( + result.response.headers.get("Location"), + new URL(request.url), + basename, + init.history + ); + replace2 = location2 === state.location.pathname + state.location.search; + } + await startRedirectNavigation(request, result, true, { + submission, + replace: replace2 + }); + return { shortCircuited: true }; + } + if (isErrorResult(result)) { + let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); + if ((opts && opts.replace) !== true) { + pendingAction = "PUSH" /* Push */; + } + return { + matches, + pendingActionResult: [ + boundaryMatch.route.id, + result, + actionMatch.route.id + ] + }; + } + return { + matches, + pendingActionResult: [actionMatch.route.id, result] + }; + } + async function handleLoaders(request, location, matches, scopedContext, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace2, initialHydration, flushSync, pendingActionResult, callSiteDefaultShouldRevalidate) { + let loadingNavigation = overrideNavigation || getLoadingNavigation(location, submission); + let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation); + let shouldUpdateNavigationState = !isUninterruptedRevalidation && !initialHydration; + if (isFogOfWar) { + if (shouldUpdateNavigationState) { + let actionData = getUpdatedActionData(pendingActionResult); + updateState( + { + navigation: loadingNavigation, + ...actionData !== void 0 ? { actionData } : {} + }, + { + flushSync + } + ); + } + let discoverResult = await discoverRoutes( + matches, + location.pathname, + request.signal + ); + if (discoverResult.type === "aborted") { + return { shortCircuited: true }; + } else if (discoverResult.type === "error") { + if (discoverResult.partialMatches.length === 0) { + let { matches: matches2, route } = getShortCircuitMatches(dataRoutes); + return { + matches: matches2, + loaderData: {}, + errors: { + [route.id]: discoverResult.error + } + }; + } + let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id; + return { + matches: discoverResult.partialMatches, + loaderData: {}, + errors: { + [boundaryId]: discoverResult.error + } + }; + } else if (!discoverResult.matches) { + let { error, notFoundMatches, route } = handleNavigational404( + location.pathname + ); + return { + matches: notFoundMatches, + loaderData: {}, + errors: { + [route.id]: error + } + }; + } else { + matches = discoverResult.matches; + } + } + let routesToUse = inFlightDataRoutes || dataRoutes; + let { dsMatches, revalidatingFetchers } = getMatchesToLoad( + request, + scopedContext, + mapRouteProperties2, + manifest, + init.history, + state, + matches, + activeSubmission, + location, + initialHydration ? [] : hydrationRouteProperties2, + initialHydration === true, + isRevalidationRequired, + cancelledFetcherLoads, + fetchersQueuedForDeletion, + fetchLoadMatches, + fetchRedirectIds, + routesToUse, + basename, + init.patchRoutesOnNavigation != null, + pendingActionResult, + callSiteDefaultShouldRevalidate + ); + pendingNavigationLoadId = ++incrementingLoadId; + if (!init.dataStrategy && !dsMatches.some((m) => m.shouldLoad) && !dsMatches.some( + (m) => m.route.middleware && m.route.middleware.length > 0 + ) && revalidatingFetchers.length === 0) { + let updatedFetchers2 = markFetchRedirectsDone(); + completeNavigation( + location, + { + matches, + loaderData: {}, + // Commit pending error if we're short circuiting + errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? { [pendingActionResult[0]]: pendingActionResult[1].error } : null, + ...getActionDataForCommit(pendingActionResult), + ...updatedFetchers2 ? { fetchers: new Map(state.fetchers) } : {} + }, + { flushSync } + ); + return { shortCircuited: true }; + } + if (shouldUpdateNavigationState) { + let updates = {}; + if (!isFogOfWar) { + updates.navigation = loadingNavigation; + let actionData = getUpdatedActionData(pendingActionResult); + if (actionData !== void 0) { + updates.actionData = actionData; + } + } + if (revalidatingFetchers.length > 0) { + updates.fetchers = getUpdatedRevalidatingFetchers(revalidatingFetchers); + } + updateState(updates, { flushSync }); + } + revalidatingFetchers.forEach((rf) => { + abortFetcher(rf.key); + if (rf.controller) { + fetchControllers.set(rf.key, rf.controller); + } + }); + let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((f) => abortFetcher(f.key)); + if (pendingNavigationController) { + pendingNavigationController.signal.addEventListener( + "abort", + abortPendingFetchRevalidations + ); + } + let { loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData( + dsMatches, + revalidatingFetchers, + request, + scopedContext + ); + if (request.signal.aborted) { + return { shortCircuited: true }; + } + if (pendingNavigationController) { + pendingNavigationController.signal.removeEventListener( + "abort", + abortPendingFetchRevalidations + ); + } + revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key)); + let redirect2 = findRedirect(loaderResults); + if (redirect2) { + await startRedirectNavigation(request, redirect2.result, true, { + replace: replace2 + }); + return { shortCircuited: true }; + } + redirect2 = findRedirect(fetcherResults); + if (redirect2) { + fetchRedirectIds.add(redirect2.key); + await startRedirectNavigation(request, redirect2.result, true, { + replace: replace2 + }); + return { shortCircuited: true }; + } + let { loaderData, errors } = processLoaderData( + state, + matches, + loaderResults, + pendingActionResult, + revalidatingFetchers, + fetcherResults + ); + if (initialHydration && state.errors) { + errors = { ...state.errors, ...errors }; + } + let updatedFetchers = markFetchRedirectsDone(); + let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId); + let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0; + return { + matches, + loaderData, + errors, + ...shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {} + }; + } + function getUpdatedActionData(pendingActionResult) { + if (pendingActionResult && !isErrorResult(pendingActionResult[1])) { + return { + [pendingActionResult[0]]: pendingActionResult[1].data + }; + } else if (state.actionData) { + if (Object.keys(state.actionData).length === 0) { + return null; + } else { + return state.actionData; + } + } + } + function getUpdatedRevalidatingFetchers(revalidatingFetchers) { + revalidatingFetchers.forEach((rf) => { + let fetcher = state.fetchers.get(rf.key); + let revalidatingFetcher = getLoadingFetcher( + void 0, + fetcher ? fetcher.data : void 0 + ); + state.fetchers.set(rf.key, revalidatingFetcher); + }); + return new Map(state.fetchers); + } + async function fetch2(key, routeId, href, opts) { + abortFetcher(key); + let flushSync = (opts && opts.flushSync) === true; + let routesToUse = inFlightDataRoutes || dataRoutes; + let normalizedPath = normalizeTo( + state.location, + state.matches, + basename, + href, + routeId, + opts?.relative + ); + let matches = matchRoutes(routesToUse, normalizedPath, basename); + let fogOfWar = checkFogOfWar(matches, routesToUse, normalizedPath); + if (fogOfWar.active && fogOfWar.matches) { + matches = fogOfWar.matches; + } + if (!matches) { + setFetcherError( + key, + routeId, + getInternalRouterError(404, { pathname: normalizedPath }), + { flushSync } + ); + return; + } + let { path, submission, error } = normalizeNavigateOptions( + true, + normalizedPath, + opts + ); + if (error) { + setFetcherError(key, routeId, error, { flushSync }); + return; + } + let scopedContext = init.getContext ? await init.getContext() : new RouterContextProvider(); + let preventScrollReset = (opts && opts.preventScrollReset) === true; + if (submission && isMutationMethod(submission.formMethod)) { + await handleFetcherAction( + key, + routeId, + path, + matches, + scopedContext, + fogOfWar.active, + flushSync, + preventScrollReset, + submission, + opts && opts.unstable_defaultShouldRevalidate + ); + return; + } + fetchLoadMatches.set(key, { routeId, path }); + await handleFetcherLoader( + key, + routeId, + path, + matches, + scopedContext, + fogOfWar.active, + flushSync, + preventScrollReset, + submission + ); + } + async function handleFetcherAction(key, routeId, path, requestMatches, scopedContext, isFogOfWar, flushSync, preventScrollReset, submission, callSiteDefaultShouldRevalidate) { + interruptActiveLoads(); + fetchLoadMatches.delete(key); + let existingFetcher = state.fetchers.get(key); + updateFetcherState(key, getSubmittingFetcher(submission, existingFetcher), { + flushSync + }); + let abortController = new AbortController(); + let fetchRequest = createClientSideRequest( + init.history, + path, + abortController.signal, + submission + ); + if (isFogOfWar) { + let discoverResult = await discoverRoutes( + requestMatches, + new URL(fetchRequest.url).pathname, + fetchRequest.signal, + key + ); + if (discoverResult.type === "aborted") { + return; + } else if (discoverResult.type === "error") { + setFetcherError(key, routeId, discoverResult.error, { flushSync }); + return; + } else if (!discoverResult.matches) { + setFetcherError( + key, + routeId, + getInternalRouterError(404, { pathname: path }), + { flushSync } + ); + return; + } else { + requestMatches = discoverResult.matches; + } + } + let match = getTargetMatch(requestMatches, path); + if (!match.route.action && !match.route.lazy) { + let error = getInternalRouterError(405, { + method: submission.formMethod, + pathname: path, + routeId + }); + setFetcherError(key, routeId, error, { flushSync }); + return; + } + fetchControllers.set(key, abortController); + let originatingLoadId = incrementingLoadId; + let fetchMatches = getTargetedDataStrategyMatches( + mapRouteProperties2, + manifest, + fetchRequest, + requestMatches, + match, + hydrationRouteProperties2, + scopedContext + ); + let actionResults = await callDataStrategy( + fetchRequest, + fetchMatches, + scopedContext, + key + ); + let actionResult = actionResults[match.route.id]; + if (!actionResult) { + for (let match2 of fetchMatches) { + if (actionResults[match2.route.id]) { + actionResult = actionResults[match2.route.id]; + break; + } + } + } + if (fetchRequest.signal.aborted) { + if (fetchControllers.get(key) === abortController) { + fetchControllers.delete(key); + } + return; + } + if (fetchersQueuedForDeletion.has(key)) { + if (isRedirectResult(actionResult) || isErrorResult(actionResult)) { + updateFetcherState(key, getDoneFetcher(void 0)); + return; + } + } else { + if (isRedirectResult(actionResult)) { + fetchControllers.delete(key); + if (pendingNavigationLoadId > originatingLoadId) { + updateFetcherState(key, getDoneFetcher(void 0)); + return; + } else { + fetchRedirectIds.add(key); + updateFetcherState(key, getLoadingFetcher(submission)); + return startRedirectNavigation(fetchRequest, actionResult, false, { + fetcherSubmission: submission, + preventScrollReset + }); + } + } + if (isErrorResult(actionResult)) { + setFetcherError(key, routeId, actionResult.error); + return; + } + } + let nextLocation = state.navigation.location || state.location; + let revalidationRequest = createClientSideRequest( + init.history, + nextLocation, + abortController.signal + ); + let routesToUse = inFlightDataRoutes || dataRoutes; + let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches; + invariant(matches, "Didn't find any matches after fetcher action"); + let loadId = ++incrementingLoadId; + fetchReloadIds.set(key, loadId); + let loadFetcher = getLoadingFetcher(submission, actionResult.data); + state.fetchers.set(key, loadFetcher); + let { dsMatches, revalidatingFetchers } = getMatchesToLoad( + revalidationRequest, + scopedContext, + mapRouteProperties2, + manifest, + init.history, + state, + matches, + submission, + nextLocation, + hydrationRouteProperties2, + false, + isRevalidationRequired, + cancelledFetcherLoads, + fetchersQueuedForDeletion, + fetchLoadMatches, + fetchRedirectIds, + routesToUse, + basename, + init.patchRoutesOnNavigation != null, + [match.route.id, actionResult], + callSiteDefaultShouldRevalidate + ); + revalidatingFetchers.filter((rf) => rf.key !== key).forEach((rf) => { + let staleKey = rf.key; + let existingFetcher2 = state.fetchers.get(staleKey); + let revalidatingFetcher = getLoadingFetcher( + void 0, + existingFetcher2 ? existingFetcher2.data : void 0 + ); + state.fetchers.set(staleKey, revalidatingFetcher); + abortFetcher(staleKey); + if (rf.controller) { + fetchControllers.set(staleKey, rf.controller); + } + }); + updateState({ fetchers: new Map(state.fetchers) }); + let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((rf) => abortFetcher(rf.key)); + abortController.signal.addEventListener( + "abort", + abortPendingFetchRevalidations + ); + let { loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData( + dsMatches, + revalidatingFetchers, + revalidationRequest, + scopedContext + ); + if (abortController.signal.aborted) { + return; + } + abortController.signal.removeEventListener( + "abort", + abortPendingFetchRevalidations + ); + fetchReloadIds.delete(key); + fetchControllers.delete(key); + revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key)); + if (state.fetchers.has(key)) { + let doneFetcher = getDoneFetcher(actionResult.data); + state.fetchers.set(key, doneFetcher); + } + let redirect2 = findRedirect(loaderResults); + if (redirect2) { + return startRedirectNavigation( + revalidationRequest, + redirect2.result, + false, + { preventScrollReset } + ); + } + redirect2 = findRedirect(fetcherResults); + if (redirect2) { + fetchRedirectIds.add(redirect2.key); + return startRedirectNavigation( + revalidationRequest, + redirect2.result, + false, + { preventScrollReset } + ); + } + let { loaderData, errors } = processLoaderData( + state, + matches, + loaderResults, + void 0, + revalidatingFetchers, + fetcherResults + ); + abortStaleFetchLoads(loadId); + if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) { + invariant(pendingAction, "Expected pending action"); + pendingNavigationController && pendingNavigationController.abort(); + completeNavigation(state.navigation.location, { + matches, + loaderData, + errors, + fetchers: new Map(state.fetchers) + }); + } else { + updateState({ + errors, + loaderData: mergeLoaderData( + state.loaderData, + loaderData, + matches, + errors + ), + fetchers: new Map(state.fetchers) + }); + isRevalidationRequired = false; + } + } + async function handleFetcherLoader(key, routeId, path, matches, scopedContext, isFogOfWar, flushSync, preventScrollReset, submission) { + let existingFetcher = state.fetchers.get(key); + updateFetcherState( + key, + getLoadingFetcher( + submission, + existingFetcher ? existingFetcher.data : void 0 + ), + { flushSync } + ); + let abortController = new AbortController(); + let fetchRequest = createClientSideRequest( + init.history, + path, + abortController.signal + ); + if (isFogOfWar) { + let discoverResult = await discoverRoutes( + matches, + new URL(fetchRequest.url).pathname, + fetchRequest.signal, + key + ); + if (discoverResult.type === "aborted") { + return; + } else if (discoverResult.type === "error") { + setFetcherError(key, routeId, discoverResult.error, { flushSync }); + return; + } else if (!discoverResult.matches) { + setFetcherError( + key, + routeId, + getInternalRouterError(404, { pathname: path }), + { flushSync } + ); + return; + } else { + matches = discoverResult.matches; + } + } + let match = getTargetMatch(matches, path); + fetchControllers.set(key, abortController); + let originatingLoadId = incrementingLoadId; + let dsMatches = getTargetedDataStrategyMatches( + mapRouteProperties2, + manifest, + fetchRequest, + matches, + match, + hydrationRouteProperties2, + scopedContext + ); + let results = await callDataStrategy( + fetchRequest, + dsMatches, + scopedContext, + key + ); + let result = results[match.route.id]; + if (fetchControllers.get(key) === abortController) { + fetchControllers.delete(key); + } + if (fetchRequest.signal.aborted) { + return; + } + if (fetchersQueuedForDeletion.has(key)) { + updateFetcherState(key, getDoneFetcher(void 0)); + return; + } + if (isRedirectResult(result)) { + if (pendingNavigationLoadId > originatingLoadId) { + updateFetcherState(key, getDoneFetcher(void 0)); + return; + } else { + fetchRedirectIds.add(key); + await startRedirectNavigation(fetchRequest, result, false, { + preventScrollReset + }); + return; + } + } + if (isErrorResult(result)) { + setFetcherError(key, routeId, result.error); + return; + } + updateFetcherState(key, getDoneFetcher(result.data)); + } + async function startRedirectNavigation(request, redirect2, isNavigation, { + submission, + fetcherSubmission, + preventScrollReset, + replace: replace2 + } = {}) { + if (!isNavigation) { + pendingPopstateNavigationDfd?.resolve(); + pendingPopstateNavigationDfd = null; + } + if (redirect2.response.headers.has("X-Remix-Revalidate")) { + isRevalidationRequired = true; + } + let location = redirect2.response.headers.get("Location"); + invariant(location, "Expected a Location header on the redirect Response"); + location = normalizeRedirectLocation( + location, + new URL(request.url), + basename, + init.history + ); + let redirectLocation = createLocation(state.location, location, { + _isRedirect: true + }); + if (isBrowser3) { + let isDocumentReload = false; + if (redirect2.response.headers.has("X-Remix-Reload-Document")) { + isDocumentReload = true; + } else if (isAbsoluteUrl(location)) { + const url = createBrowserURLImpl(location, true); + isDocumentReload = // Hard reload if it's an absolute URL to a new origin + url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename + stripBasename(url.pathname, basename) == null; + } + if (isDocumentReload) { + if (replace2) { + routerWindow.location.replace(location); + } else { + routerWindow.location.assign(location); + } + return; + } + } + pendingNavigationController = null; + let redirectNavigationType = replace2 === true || redirect2.response.headers.has("X-Remix-Replace") ? "REPLACE" /* Replace */ : "PUSH" /* Push */; + let { formMethod, formAction, formEncType } = state.navigation; + if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) { + submission = getSubmissionFromNavigation(state.navigation); + } + let activeSubmission = submission || fetcherSubmission; + if (redirectPreserveMethodStatusCodes.has(redirect2.response.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) { + await startNavigation(redirectNavigationType, redirectLocation, { + submission: { + ...activeSubmission, + formAction: location + }, + // Preserve these flags across redirects + preventScrollReset: preventScrollReset || pendingPreventScrollReset, + enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0 + }); + } else { + let overrideNavigation = getLoadingNavigation( + redirectLocation, + submission + ); + await startNavigation(redirectNavigationType, redirectLocation, { + overrideNavigation, + // Send fetcher submissions through for shouldRevalidate + fetcherSubmission, + // Preserve these flags across redirects + preventScrollReset: preventScrollReset || pendingPreventScrollReset, + enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0 + }); + } + } + async function callDataStrategy(request, matches, scopedContext, fetcherKey) { + let results; + let dataResults = {}; + try { + results = await callDataStrategyImpl( + dataStrategyImpl, + request, + matches, + fetcherKey, + scopedContext, + false + ); + } catch (e) { + matches.filter((m) => m.shouldLoad).forEach((m) => { + dataResults[m.route.id] = { + type: "error" /* error */, + error: e + }; + }); + return dataResults; + } + if (request.signal.aborted) { + return dataResults; + } + if (!isMutationMethod(request.method)) { + for (let match of matches) { + if (results[match.route.id]?.type === "error" /* error */) { + break; + } + if (!results.hasOwnProperty(match.route.id) && !state.loaderData.hasOwnProperty(match.route.id) && (!state.errors || !state.errors.hasOwnProperty(match.route.id)) && match.shouldCallHandler()) { + results[match.route.id] = { + type: "error" /* error */, + result: new Error( + `No result returned from dataStrategy for route ${match.route.id}` + ) + }; + } + } + } + for (let [routeId, result] of Object.entries(results)) { + if (isRedirectDataStrategyResult(result)) { + let response = result.result; + dataResults[routeId] = { + type: "redirect" /* redirect */, + response: normalizeRelativeRoutingRedirectResponse( + response, + request, + routeId, + matches, + basename + ) + }; + } else { + dataResults[routeId] = await convertDataStrategyResultToDataResult(result); + } + } + return dataResults; + } + async function callLoadersAndMaybeResolveData(matches, fetchersToLoad, request, scopedContext) { + let loaderResultsPromise = callDataStrategy( + request, + matches, + scopedContext, + null + ); + let fetcherResultsPromise = Promise.all( + fetchersToLoad.map(async (f) => { + if (f.matches && f.match && f.request && f.controller) { + let results = await callDataStrategy( + f.request, + f.matches, + scopedContext, + f.key + ); + let result = results[f.match.route.id]; + return { [f.key]: result }; + } else { + return Promise.resolve({ + [f.key]: { + type: "error" /* error */, + error: getInternalRouterError(404, { + pathname: f.path + }) + } + }); + } + }) + ); + let loaderResults = await loaderResultsPromise; + let fetcherResults = (await fetcherResultsPromise).reduce( + (acc, r) => Object.assign(acc, r), + {} + ); + return { + loaderResults, + fetcherResults + }; + } + function interruptActiveLoads() { + isRevalidationRequired = true; + fetchLoadMatches.forEach((_, key) => { + if (fetchControllers.has(key)) { + cancelledFetcherLoads.add(key); + } + abortFetcher(key); + }); + } + function updateFetcherState(key, fetcher, opts = {}) { + state.fetchers.set(key, fetcher); + updateState( + { fetchers: new Map(state.fetchers) }, + { flushSync: (opts && opts.flushSync) === true } + ); + } + function setFetcherError(key, routeId, error, opts = {}) { + let boundaryMatch = findNearestBoundary(state.matches, routeId); + deleteFetcher(key); + updateState( + { + errors: { + [boundaryMatch.route.id]: error + }, + fetchers: new Map(state.fetchers) + }, + { flushSync: (opts && opts.flushSync) === true } + ); + } + function getFetcher(key) { + activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1); + if (fetchersQueuedForDeletion.has(key)) { + fetchersQueuedForDeletion.delete(key); + } + return state.fetchers.get(key) || IDLE_FETCHER; + } + function resetFetcher(key, opts) { + abortFetcher(key, opts?.reason); + updateFetcherState(key, getDoneFetcher(null)); + } + function deleteFetcher(key) { + let fetcher = state.fetchers.get(key); + if (fetchControllers.has(key) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))) { + abortFetcher(key); + } + fetchLoadMatches.delete(key); + fetchReloadIds.delete(key); + fetchRedirectIds.delete(key); + fetchersQueuedForDeletion.delete(key); + cancelledFetcherLoads.delete(key); + state.fetchers.delete(key); + } + function queueFetcherForDeletion(key) { + let count = (activeFetchers.get(key) || 0) - 1; + if (count <= 0) { + activeFetchers.delete(key); + fetchersQueuedForDeletion.add(key); + } else { + activeFetchers.set(key, count); + } + updateState({ fetchers: new Map(state.fetchers) }); + } + function abortFetcher(key, reason) { + let controller = fetchControllers.get(key); + if (controller) { + controller.abort(reason); + fetchControllers.delete(key); + } + } + function markFetchersDone(keys) { + for (let key of keys) { + let fetcher = getFetcher(key); + let doneFetcher = getDoneFetcher(fetcher.data); + state.fetchers.set(key, doneFetcher); + } + } + function markFetchRedirectsDone() { + let doneKeys = []; + let updatedFetchers = false; + for (let key of fetchRedirectIds) { + let fetcher = state.fetchers.get(key); + invariant(fetcher, `Expected fetcher: ${key}`); + if (fetcher.state === "loading") { + fetchRedirectIds.delete(key); + doneKeys.push(key); + updatedFetchers = true; + } + } + markFetchersDone(doneKeys); + return updatedFetchers; + } + function abortStaleFetchLoads(landedId) { + let yeetedKeys = []; + for (let [key, id] of fetchReloadIds) { + if (id < landedId) { + let fetcher = state.fetchers.get(key); + invariant(fetcher, `Expected fetcher: ${key}`); + if (fetcher.state === "loading") { + abortFetcher(key); + fetchReloadIds.delete(key); + yeetedKeys.push(key); + } + } + } + markFetchersDone(yeetedKeys); + return yeetedKeys.length > 0; + } + function getBlocker(key, fn) { + let blocker = state.blockers.get(key) || IDLE_BLOCKER; + if (blockerFunctions.get(key) !== fn) { + blockerFunctions.set(key, fn); + } + return blocker; + } + function deleteBlocker(key) { + state.blockers.delete(key); + blockerFunctions.delete(key); + } + function updateBlocker(key, newBlocker) { + let blocker = state.blockers.get(key) || IDLE_BLOCKER; + invariant( + blocker.state === "unblocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "proceeding" || blocker.state === "blocked" && newBlocker.state === "unblocked" || blocker.state === "proceeding" && newBlocker.state === "unblocked", + `Invalid blocker state transition: ${blocker.state} -> ${newBlocker.state}` + ); + let blockers = new Map(state.blockers); + blockers.set(key, newBlocker); + updateState({ blockers }); + } + function shouldBlockNavigation({ + currentLocation, + nextLocation, + historyAction + }) { + if (blockerFunctions.size === 0) { + return; + } + if (blockerFunctions.size > 1) { + warning(false, "A router only supports one blocker at a time"); + } + let entries = Array.from(blockerFunctions.entries()); + let [blockerKey, blockerFunction] = entries[entries.length - 1]; + let blocker = state.blockers.get(blockerKey); + if (blocker && blocker.state === "proceeding") { + return; + } + if (blockerFunction({ currentLocation, nextLocation, historyAction })) { + return blockerKey; + } + } + function handleNavigational404(pathname) { + let error = getInternalRouterError(404, { pathname }); + let routesToUse = inFlightDataRoutes || dataRoutes; + let { matches, route } = getShortCircuitMatches(routesToUse); + return { notFoundMatches: matches, route, error }; + } + function enableScrollRestoration(positions, getPosition, getKey) { + savedScrollPositions2 = positions; + getScrollPosition = getPosition; + getScrollRestorationKey2 = getKey || null; + if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) { + initialScrollRestored = true; + let y = getSavedScrollPosition(state.location, state.matches); + if (y != null) { + updateState({ restoreScrollPosition: y }); + } + } + return () => { + savedScrollPositions2 = null; + getScrollPosition = null; + getScrollRestorationKey2 = null; + }; + } + function getScrollKey(location, matches) { + if (getScrollRestorationKey2) { + let key = getScrollRestorationKey2( + location, + matches.map((m) => convertRouteMatchToUiMatch(m, state.loaderData)) + ); + return key || location.key; + } + return location.key; + } + function saveScrollPosition(location, matches) { + if (savedScrollPositions2 && getScrollPosition) { + let key = getScrollKey(location, matches); + savedScrollPositions2[key] = getScrollPosition(); + } + } + function getSavedScrollPosition(location, matches) { + if (savedScrollPositions2) { + let key = getScrollKey(location, matches); + let y = savedScrollPositions2[key]; + if (typeof y === "number") { + return y; + } + } + return null; + } + function checkFogOfWar(matches, routesToUse, pathname) { + if (init.patchRoutesOnNavigation) { + if (!matches) { + let fogMatches = matchRoutesImpl( + routesToUse, + pathname, + basename, + true + ); + return { active: true, matches: fogMatches || [] }; + } else { + if (Object.keys(matches[0].params).length > 0) { + let partialMatches = matchRoutesImpl( + routesToUse, + pathname, + basename, + true + ); + return { active: true, matches: partialMatches }; + } + } + } + return { active: false, matches: null }; + } + async function discoverRoutes(matches, pathname, signal, fetcherKey) { + if (!init.patchRoutesOnNavigation) { + return { type: "success", matches }; + } + let partialMatches = matches; + while (true) { + let isNonHMR = inFlightDataRoutes == null; + let routesToUse = inFlightDataRoutes || dataRoutes; + let localManifest = manifest; + try { + await init.patchRoutesOnNavigation({ + signal, + path: pathname, + matches: partialMatches, + fetcherKey, + patch: (routeId, children) => { + if (signal.aborted) return; + patchRoutesImpl( + routeId, + children, + routesToUse, + localManifest, + mapRouteProperties2, + false + ); + } + }); + } catch (e) { + return { type: "error", error: e, partialMatches }; + } finally { + if (isNonHMR && !signal.aborted) { + dataRoutes = [...dataRoutes]; + } + } + if (signal.aborted) { + return { type: "aborted" }; + } + let newMatches = matchRoutes(routesToUse, pathname, basename); + let newPartialMatches = null; + if (newMatches) { + if (Object.keys(newMatches[0].params).length === 0) { + return { type: "success", matches: newMatches }; + } else { + newPartialMatches = matchRoutesImpl( + routesToUse, + pathname, + basename, + true + ); + let matchedDeeper = newPartialMatches && partialMatches.length < newPartialMatches.length && compareMatches( + partialMatches, + newPartialMatches.slice(0, partialMatches.length) + ); + if (!matchedDeeper) { + return { type: "success", matches: newMatches }; + } + } + } + if (!newPartialMatches) { + newPartialMatches = matchRoutesImpl( + routesToUse, + pathname, + basename, + true + ); + } + if (!newPartialMatches || compareMatches(partialMatches, newPartialMatches)) { + return { type: "success", matches: null }; + } + partialMatches = newPartialMatches; + } + } + function compareMatches(a, b) { + return a.length === b.length && a.every((m, i) => m.route.id === b[i].route.id); + } + function _internalSetRoutes(newRoutes) { + manifest = {}; + inFlightDataRoutes = convertRoutesToDataRoutes( + newRoutes, + mapRouteProperties2, + void 0, + manifest + ); + } + function patchRoutes(routeId, children, unstable_allowElementMutations = false) { + let isNonHMR = inFlightDataRoutes == null; + let routesToUse = inFlightDataRoutes || dataRoutes; + patchRoutesImpl( + routeId, + children, + routesToUse, + manifest, + mapRouteProperties2, + unstable_allowElementMutations + ); + if (isNonHMR) { + dataRoutes = [...dataRoutes]; + updateState({}); + } + } + router = { + get basename() { + return basename; + }, + get future() { + return future; + }, + get state() { + return state; + }, + get routes() { + return dataRoutes; + }, + get window() { + return routerWindow; + }, + initialize, + subscribe, + enableScrollRestoration, + navigate, + fetch: fetch2, + revalidate, + // Passthrough to history-aware createHref used by useHref so we get proper + // hash-aware URLs in DOM paths + createHref: (to) => init.history.createHref(to), + encodeLocation: (to) => init.history.encodeLocation(to), + getFetcher, + resetFetcher, + deleteFetcher: queueFetcherForDeletion, + dispose, + getBlocker, + deleteBlocker, + patchRoutes, + _internalFetchControllers: fetchControllers, + // TODO: Remove setRoutes, it's temporary to avoid dealing with + // updating the tree while validating the update algorithm. + _internalSetRoutes, + _internalSetStateDoNotUseOrYouWillBreakYourApp(newState) { + updateState(newState); + } + }; + if (init.unstable_instrumentations) { + router = instrumentClientSideRouter( + router, + init.unstable_instrumentations.map((i) => i.router).filter(Boolean) + ); + } + return router; +} +function createStaticHandler(routes, opts) { + invariant( + routes.length > 0, + "You must provide a non-empty routes array to createStaticHandler" + ); + let manifest = {}; + let basename = (opts ? opts.basename : null) || "/"; + let _mapRouteProperties = opts?.mapRouteProperties || defaultMapRouteProperties; + let mapRouteProperties2 = _mapRouteProperties; + if (opts?.unstable_instrumentations) { + let instrumentations = opts.unstable_instrumentations; + mapRouteProperties2 = (route) => { + return { + ..._mapRouteProperties(route), + ...getRouteInstrumentationUpdates( + instrumentations.map((i) => i.route).filter(Boolean), + route + ) + }; + }; + } + let dataRoutes = convertRoutesToDataRoutes( + routes, + mapRouteProperties2, + void 0, + manifest + ); + async function query(request, { + requestContext, + filterMatchesToLoad, + skipLoaderErrorBubbling, + skipRevalidation, + dataStrategy, + generateMiddlewareResponse + } = {}) { + let url = new URL(request.url); + let method = request.method; + let location = createLocation("", createPath(url), null, "default"); + let matches = matchRoutes(dataRoutes, location, basename); + requestContext = requestContext != null ? requestContext : new RouterContextProvider(); + if (!isValidMethod(method) && method !== "HEAD") { + let error = getInternalRouterError(405, { method }); + let { matches: methodNotAllowedMatches, route } = getShortCircuitMatches(dataRoutes); + let staticContext = { + basename, + location, + matches: methodNotAllowedMatches, + loaderData: {}, + actionData: null, + errors: { + [route.id]: error + }, + statusCode: error.status, + loaderHeaders: {}, + actionHeaders: {} + }; + return generateMiddlewareResponse ? generateMiddlewareResponse(() => Promise.resolve(staticContext)) : staticContext; + } else if (!matches) { + let error = getInternalRouterError(404, { pathname: location.pathname }); + let { matches: notFoundMatches, route } = getShortCircuitMatches(dataRoutes); + let staticContext = { + basename, + location, + matches: notFoundMatches, + loaderData: {}, + actionData: null, + errors: { + [route.id]: error + }, + statusCode: error.status, + loaderHeaders: {}, + actionHeaders: {} + }; + return generateMiddlewareResponse ? generateMiddlewareResponse(() => Promise.resolve(staticContext)) : staticContext; + } + if (generateMiddlewareResponse) { + invariant( + requestContext instanceof RouterContextProvider, + "When using middleware in `staticHandler.query()`, any provided `requestContext` must be an instance of `RouterContextProvider`" + ); + try { + await loadLazyMiddlewareForMatches( + matches, + manifest, + mapRouteProperties2 + ); + let renderedStaticContext; + let response = await runServerMiddlewarePipeline( + { + request, + unstable_pattern: getRoutePattern(matches), + matches, + params: matches[0].params, + // If we're calling middleware then it must be enabled so we can cast + // this to the proper type knowing it's not an `AppLoadContext` + context: requestContext + }, + async () => { + let res = await generateMiddlewareResponse( + async (revalidationRequest, opts2 = {}) => { + let result2 = await queryImpl( + revalidationRequest, + location, + matches, + requestContext, + dataStrategy || null, + skipLoaderErrorBubbling === true, + null, + "filterMatchesToLoad" in opts2 ? opts2.filterMatchesToLoad ?? null : filterMatchesToLoad ?? null, + skipRevalidation === true + ); + if (isResponse(result2)) { + return result2; + } + renderedStaticContext = { location, basename, ...result2 }; + return renderedStaticContext; + } + ); + return res; + }, + async (error, routeId) => { + if (isRedirectResponse(error)) { + return error; + } + if (isResponse(error)) { + try { + error = new ErrorResponseImpl( + error.status, + error.statusText, + await parseResponseBody(error) + ); + } catch (e) { + error = e; + } + } + if (isDataWithResponseInit(error)) { + error = dataWithResponseInitToErrorResponse(error); + } + if (renderedStaticContext) { + if (routeId in renderedStaticContext.loaderData) { + renderedStaticContext.loaderData[routeId] = void 0; + } + let staticContext = getStaticContextFromError( + dataRoutes, + renderedStaticContext, + error, + skipLoaderErrorBubbling ? routeId : findNearestBoundary(matches, routeId).route.id + ); + return generateMiddlewareResponse( + () => Promise.resolve(staticContext) + ); + } else { + let boundaryRouteId = skipLoaderErrorBubbling ? routeId : findNearestBoundary( + matches, + matches.find( + (m) => m.route.id === routeId || m.route.loader + )?.route.id || routeId + ).route.id; + let staticContext = { + matches, + location, + basename, + loaderData: {}, + actionData: null, + errors: { + [boundaryRouteId]: error + }, + statusCode: isRouteErrorResponse(error) ? error.status : 500, + actionHeaders: {}, + loaderHeaders: {} + }; + return generateMiddlewareResponse( + () => Promise.resolve(staticContext) + ); + } + } + ); + invariant(isResponse(response), "Expected a response in query()"); + return response; + } catch (e) { + if (isResponse(e)) { + return e; + } + throw e; + } + } + let result = await queryImpl( + request, + location, + matches, + requestContext, + dataStrategy || null, + skipLoaderErrorBubbling === true, + null, + filterMatchesToLoad || null, + skipRevalidation === true + ); + if (isResponse(result)) { + return result; + } + return { location, basename, ...result }; + } + async function queryRoute(request, { + routeId, + requestContext, + dataStrategy, + generateMiddlewareResponse + } = {}) { + let url = new URL(request.url); + let method = request.method; + let location = createLocation("", createPath(url), null, "default"); + let matches = matchRoutes(dataRoutes, location, basename); + requestContext = requestContext != null ? requestContext : new RouterContextProvider(); + if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") { + throw getInternalRouterError(405, { method }); + } else if (!matches) { + throw getInternalRouterError(404, { pathname: location.pathname }); + } + let match = routeId ? matches.find((m) => m.route.id === routeId) : getTargetMatch(matches, location); + if (routeId && !match) { + throw getInternalRouterError(403, { + pathname: location.pathname, + routeId + }); + } else if (!match) { + throw getInternalRouterError(404, { pathname: location.pathname }); + } + if (generateMiddlewareResponse) { + invariant( + requestContext instanceof RouterContextProvider, + "When using middleware in `staticHandler.queryRoute()`, any provided `requestContext` must be an instance of `RouterContextProvider`" + ); + await loadLazyMiddlewareForMatches(matches, manifest, mapRouteProperties2); + let response = await runServerMiddlewarePipeline( + { + request, + unstable_pattern: getRoutePattern(matches), + matches, + params: matches[0].params, + // If we're calling middleware then it must be enabled so we can cast + // this to the proper type knowing it's not an `AppLoadContext` + context: requestContext + }, + async () => { + let res = await generateMiddlewareResponse( + async (innerRequest) => { + let result2 = await queryImpl( + innerRequest, + location, + matches, + requestContext, + dataStrategy || null, + false, + match, + null, + false + ); + let processed = handleQueryResult(result2); + return isResponse(processed) ? processed : typeof processed === "string" ? new Response(processed) : Response.json(processed); + } + ); + return res; + }, + (error) => { + if (isDataWithResponseInit(error)) { + return Promise.resolve(dataWithResponseInitToResponse(error)); + } + if (isResponse(error)) { + return Promise.resolve(error); + } + throw error; + } + ); + return response; + } + let result = await queryImpl( + request, + location, + matches, + requestContext, + dataStrategy || null, + false, + match, + null, + false + ); + return handleQueryResult(result); + function handleQueryResult(result2) { + if (isResponse(result2)) { + return result2; + } + let error = result2.errors ? Object.values(result2.errors)[0] : void 0; + if (error !== void 0) { + throw error; + } + if (result2.actionData) { + return Object.values(result2.actionData)[0]; + } + if (result2.loaderData) { + return Object.values(result2.loaderData)[0]; + } + return void 0; + } + } + async function queryImpl(request, location, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, filterMatchesToLoad, skipRevalidation) { + invariant( + request.signal, + "query()/queryRoute() requests must contain an AbortController signal" + ); + try { + if (isMutationMethod(request.method)) { + let result2 = await submit( + request, + matches, + routeMatch || getTargetMatch(matches, location), + requestContext, + dataStrategy, + skipLoaderErrorBubbling, + routeMatch != null, + filterMatchesToLoad, + skipRevalidation + ); + return result2; + } + let result = await loadRouteData( + request, + matches, + requestContext, + dataStrategy, + skipLoaderErrorBubbling, + routeMatch, + filterMatchesToLoad + ); + return isResponse(result) ? result : { + ...result, + actionData: null, + actionHeaders: {} + }; + } catch (e) { + if (isDataStrategyResult(e) && isResponse(e.result)) { + if (e.type === "error" /* error */) { + throw e.result; + } + return e.result; + } + if (isRedirectResponse(e)) { + return e; + } + throw e; + } + } + async function submit(request, matches, actionMatch, requestContext, dataStrategy, skipLoaderErrorBubbling, isRouteRequest, filterMatchesToLoad, skipRevalidation) { + let result; + if (!actionMatch.route.action && !actionMatch.route.lazy) { + let error = getInternalRouterError(405, { + method: request.method, + pathname: new URL(request.url).pathname, + routeId: actionMatch.route.id + }); + if (isRouteRequest) { + throw error; + } + result = { + type: "error" /* error */, + error + }; + } else { + let dsMatches = getTargetedDataStrategyMatches( + mapRouteProperties2, + manifest, + request, + matches, + actionMatch, + [], + requestContext + ); + let results = await callDataStrategy( + request, + dsMatches, + isRouteRequest, + requestContext, + dataStrategy + ); + result = results[actionMatch.route.id]; + if (request.signal.aborted) { + throwStaticHandlerAbortedError(request, isRouteRequest); + } + } + if (isRedirectResult(result)) { + throw new Response(null, { + status: result.response.status, + headers: { + Location: result.response.headers.get("Location") + } + }); + } + if (isRouteRequest) { + if (isErrorResult(result)) { + throw result.error; + } + return { + matches: [actionMatch], + loaderData: {}, + actionData: { [actionMatch.route.id]: result.data }, + errors: null, + // Note: statusCode + headers are unused here since queryRoute will + // return the raw Response or value + statusCode: 200, + loaderHeaders: {}, + actionHeaders: {} + }; + } + if (skipRevalidation) { + if (isErrorResult(result)) { + let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id); + return { + statusCode: isRouteErrorResponse(result.error) ? result.error.status : result.statusCode != null ? result.statusCode : 500, + actionData: null, + actionHeaders: { + ...result.headers ? { [actionMatch.route.id]: result.headers } : {} + }, + matches, + loaderData: {}, + errors: { + [boundaryMatch.route.id]: result.error + }, + loaderHeaders: {} + }; + } else { + return { + actionData: { + [actionMatch.route.id]: result.data + }, + actionHeaders: result.headers ? { [actionMatch.route.id]: result.headers } : {}, + matches, + loaderData: {}, + errors: null, + statusCode: result.statusCode || 200, + loaderHeaders: {} + }; + } + } + let loaderRequest = new Request(request.url, { + headers: request.headers, + redirect: request.redirect, + signal: request.signal + }); + if (isErrorResult(result)) { + let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id); + let handlerContext2 = await loadRouteData( + loaderRequest, + matches, + requestContext, + dataStrategy, + skipLoaderErrorBubbling, + null, + filterMatchesToLoad, + [boundaryMatch.route.id, result] + ); + return { + ...handlerContext2, + statusCode: isRouteErrorResponse(result.error) ? result.error.status : result.statusCode != null ? result.statusCode : 500, + actionData: null, + actionHeaders: { + ...result.headers ? { [actionMatch.route.id]: result.headers } : {} + } + }; + } + let handlerContext = await loadRouteData( + loaderRequest, + matches, + requestContext, + dataStrategy, + skipLoaderErrorBubbling, + null, + filterMatchesToLoad + ); + return { + ...handlerContext, + actionData: { + [actionMatch.route.id]: result.data + }, + // action status codes take precedence over loader status codes + ...result.statusCode ? { statusCode: result.statusCode } : {}, + actionHeaders: result.headers ? { [actionMatch.route.id]: result.headers } : {} + }; + } + async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, filterMatchesToLoad, pendingActionResult) { + let isRouteRequest = routeMatch != null; + if (isRouteRequest && !routeMatch?.route.loader && !routeMatch?.route.lazy) { + throw getInternalRouterError(400, { + method: request.method, + pathname: new URL(request.url).pathname, + routeId: routeMatch?.route.id + }); + } + let dsMatches; + if (routeMatch) { + dsMatches = getTargetedDataStrategyMatches( + mapRouteProperties2, + manifest, + request, + matches, + routeMatch, + [], + requestContext + ); + } else { + let maxIdx = pendingActionResult && isErrorResult(pendingActionResult[1]) ? ( + // Up to but not including the boundary + matches.findIndex((m) => m.route.id === pendingActionResult[0]) - 1 + ) : void 0; + let pattern = getRoutePattern(matches); + dsMatches = matches.map((match, index) => { + if (maxIdx != null && index > maxIdx) { + return getDataStrategyMatch( + mapRouteProperties2, + manifest, + request, + pattern, + match, + [], + requestContext, + false + ); + } + return getDataStrategyMatch( + mapRouteProperties2, + manifest, + request, + pattern, + match, + [], + requestContext, + (match.route.loader || match.route.lazy) != null && (!filterMatchesToLoad || filterMatchesToLoad(match)) + ); + }); + } + if (!dataStrategy && !dsMatches.some((m) => m.shouldLoad)) { + return { + matches, + loaderData: {}, + errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? { + [pendingActionResult[0]]: pendingActionResult[1].error + } : null, + statusCode: 200, + loaderHeaders: {} + }; + } + let results = await callDataStrategy( + request, + dsMatches, + isRouteRequest, + requestContext, + dataStrategy + ); + if (request.signal.aborted) { + throwStaticHandlerAbortedError(request, isRouteRequest); + } + let handlerContext = processRouteLoaderData( + matches, + results, + pendingActionResult, + true, + skipLoaderErrorBubbling + ); + return { + ...handlerContext, + matches + }; + } + async function callDataStrategy(request, matches, isRouteRequest, requestContext, dataStrategy) { + let results = await callDataStrategyImpl( + dataStrategy || defaultDataStrategy, + request, + matches, + null, + requestContext, + true + ); + let dataResults = {}; + await Promise.all( + matches.map(async (match) => { + if (!(match.route.id in results)) { + return; + } + let result = results[match.route.id]; + if (isRedirectDataStrategyResult(result)) { + let response = result.result; + throw normalizeRelativeRoutingRedirectResponse( + response, + request, + match.route.id, + matches, + basename + ); + } + if (isRouteRequest) { + if (isResponse(result.result)) { + throw result; + } else if (isDataWithResponseInit(result.result)) { + throw dataWithResponseInitToResponse(result.result); + } + } + dataResults[match.route.id] = await convertDataStrategyResultToDataResult(result); + }) + ); + return dataResults; + } + return { + dataRoutes, + query, + queryRoute + }; +} +function getStaticContextFromError(routes, handlerContext, error, boundaryId) { + let errorBoundaryId = boundaryId || handlerContext._deepestRenderedBoundaryId || routes[0].id; + return { + ...handlerContext, + statusCode: isRouteErrorResponse(error) ? error.status : 500, + errors: { + [errorBoundaryId]: error + } + }; +} +function throwStaticHandlerAbortedError(request, isRouteRequest) { + if (request.signal.reason !== void 0) { + throw request.signal.reason; + } + let method = isRouteRequest ? "queryRoute" : "query"; + throw new Error( + `${method}() call aborted without an \`AbortSignal.reason\`: ${request.method} ${request.url}` + ); +} +function isSubmissionNavigation(opts) { + return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== void 0); +} +function normalizeTo(location, matches, basename, to, fromRouteId, relative) { + let contextualMatches; + let activeRouteMatch; + if (fromRouteId) { + contextualMatches = []; + for (let match of matches) { + contextualMatches.push(match); + if (match.route.id === fromRouteId) { + activeRouteMatch = match; + break; + } + } + } else { + contextualMatches = matches; + activeRouteMatch = matches[matches.length - 1]; + } + let path = resolveTo( + to ? to : ".", + getResolveToMatches(contextualMatches), + stripBasename(location.pathname, basename) || location.pathname, + relative === "path" + ); + if (to == null) { + path.search = location.search; + path.hash = location.hash; + } + if ((to == null || to === "" || to === ".") && activeRouteMatch) { + let nakedIndex = hasNakedIndexQuery(path.search); + if (activeRouteMatch.route.index && !nakedIndex) { + path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index"; + } else if (!activeRouteMatch.route.index && nakedIndex) { + let params = new URLSearchParams(path.search); + let indexValues = params.getAll("index"); + params.delete("index"); + indexValues.filter((v) => v).forEach((v) => params.append("index", v)); + let qs = params.toString(); + path.search = qs ? `?${qs}` : ""; + } + } + if (basename !== "/") { + path.pathname = prependBasename({ basename, pathname: path.pathname }); + } + return createPath(path); +} +function normalizeNavigateOptions(isFetcher, path, opts) { + if (!opts || !isSubmissionNavigation(opts)) { + return { path }; + } + if (opts.formMethod && !isValidMethod(opts.formMethod)) { + return { + path, + error: getInternalRouterError(405, { method: opts.formMethod }) + }; + } + let getInvalidBodyError = () => ({ + path, + error: getInternalRouterError(400, { type: "invalid-body" }) + }); + let rawFormMethod = opts.formMethod || "get"; + let formMethod = rawFormMethod.toUpperCase(); + let formAction = stripHashFromPath(path); + if (opts.body !== void 0) { + if (opts.formEncType === "text/plain") { + if (!isMutationMethod(formMethod)) { + return getInvalidBodyError(); + } + let text = typeof opts.body === "string" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ? ( + // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data + Array.from(opts.body.entries()).reduce( + (acc, [name, value]) => `${acc}${name}=${value} +`, + "" + ) + ) : String(opts.body); + return { + path, + submission: { + formMethod, + formAction, + formEncType: opts.formEncType, + formData: void 0, + json: void 0, + text + } + }; + } else if (opts.formEncType === "application/json") { + if (!isMutationMethod(formMethod)) { + return getInvalidBodyError(); + } + try { + let json = typeof opts.body === "string" ? JSON.parse(opts.body) : opts.body; + return { + path, + submission: { + formMethod, + formAction, + formEncType: opts.formEncType, + formData: void 0, + json, + text: void 0 + } + }; + } catch (e) { + return getInvalidBodyError(); + } + } + } + invariant( + typeof FormData === "function", + "FormData is not available in this environment" + ); + let searchParams; + let formData; + if (opts.formData) { + searchParams = convertFormDataToSearchParams(opts.formData); + formData = opts.formData; + } else if (opts.body instanceof FormData) { + searchParams = convertFormDataToSearchParams(opts.body); + formData = opts.body; + } else if (opts.body instanceof URLSearchParams) { + searchParams = opts.body; + formData = convertSearchParamsToFormData(searchParams); + } else if (opts.body == null) { + searchParams = new URLSearchParams(); + formData = new FormData(); + } else { + try { + searchParams = new URLSearchParams(opts.body); + formData = convertSearchParamsToFormData(searchParams); + } catch (e) { + return getInvalidBodyError(); + } + } + let submission = { + formMethod, + formAction, + formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded", + formData, + json: void 0, + text: void 0 + }; + if (isMutationMethod(submission.formMethod)) { + return { path, submission }; + } + let parsedPath = parsePath(path); + if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) { + searchParams.append("index", ""); + } + parsedPath.search = `?${searchParams}`; + return { path: createPath(parsedPath), submission }; +} +function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest, history, state, matches, submission, location, lazyRoutePropertiesToSkip, initialHydration, isRevalidationRequired, cancelledFetcherLoads, fetchersQueuedForDeletion, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, hasPatchRoutesOnNavigation, pendingActionResult, callSiteDefaultShouldRevalidate) { + let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : void 0; + let currentUrl = history.createURL(state.location); + let nextUrl = history.createURL(location); + let maxIdx; + if (initialHydration && state.errors) { + let boundaryId = Object.keys(state.errors)[0]; + maxIdx = matches.findIndex((m) => m.route.id === boundaryId); + } else if (pendingActionResult && isErrorResult(pendingActionResult[1])) { + let boundaryId = pendingActionResult[0]; + maxIdx = matches.findIndex((m) => m.route.id === boundaryId) - 1; + } + let actionStatus = pendingActionResult ? pendingActionResult[1].statusCode : void 0; + let shouldSkipRevalidation = actionStatus && actionStatus >= 400; + let baseShouldRevalidateArgs = { + currentUrl, + currentParams: state.matches[0]?.params || {}, + nextUrl, + nextParams: matches[0].params, + ...submission, + actionResult, + actionStatus + }; + let pattern = getRoutePattern(matches); + let dsMatches = matches.map((match, index) => { + let { route } = match; + let forceShouldLoad = null; + if (maxIdx != null && index > maxIdx) { + forceShouldLoad = false; + } else if (route.lazy) { + forceShouldLoad = true; + } else if (!routeHasLoaderOrMiddleware(route)) { + forceShouldLoad = false; + } else if (initialHydration) { + forceShouldLoad = shouldLoadRouteOnHydration( + route, + state.loaderData, + state.errors + ); + } else if (isNewLoader(state.loaderData, state.matches[index], match)) { + forceShouldLoad = true; + } + if (forceShouldLoad !== null) { + return getDataStrategyMatch( + mapRouteProperties2, + manifest, + request, + pattern, + match, + lazyRoutePropertiesToSkip, + scopedContext, + forceShouldLoad + ); + } + let defaultShouldRevalidate = false; + if (typeof callSiteDefaultShouldRevalidate === "boolean") { + defaultShouldRevalidate = callSiteDefaultShouldRevalidate; + } else if (shouldSkipRevalidation) { + defaultShouldRevalidate = false; + } else if (isRevalidationRequired) { + defaultShouldRevalidate = true; + } else if (currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search) { + defaultShouldRevalidate = true; + } else if (currentUrl.search !== nextUrl.search) { + defaultShouldRevalidate = true; + } else if (isNewRouteInstance(state.matches[index], match)) { + defaultShouldRevalidate = true; + } + let shouldRevalidateArgs = { + ...baseShouldRevalidateArgs, + defaultShouldRevalidate + }; + let shouldLoad = shouldRevalidateLoader(match, shouldRevalidateArgs); + return getDataStrategyMatch( + mapRouteProperties2, + manifest, + request, + pattern, + match, + lazyRoutePropertiesToSkip, + scopedContext, + shouldLoad, + shouldRevalidateArgs, + callSiteDefaultShouldRevalidate + ); + }); + let revalidatingFetchers = []; + fetchLoadMatches.forEach((f, key) => { + if (initialHydration || !matches.some((m) => m.route.id === f.routeId) || fetchersQueuedForDeletion.has(key)) { + return; + } + let fetcher = state.fetchers.get(key); + let isMidInitialLoad = fetcher && fetcher.state !== "idle" && fetcher.data === void 0; + let fetcherMatches = matchRoutes(routesToUse, f.path, basename); + if (!fetcherMatches) { + if (hasPatchRoutesOnNavigation && isMidInitialLoad) { + return; + } + revalidatingFetchers.push({ + key, + routeId: f.routeId, + path: f.path, + matches: null, + match: null, + request: null, + controller: null + }); + return; + } + if (fetchRedirectIds.has(key)) { + return; + } + let fetcherMatch = getTargetMatch(fetcherMatches, f.path); + let fetchController = new AbortController(); + let fetchRequest = createClientSideRequest( + history, + f.path, + fetchController.signal + ); + let fetcherDsMatches = null; + if (cancelledFetcherLoads.has(key)) { + cancelledFetcherLoads.delete(key); + fetcherDsMatches = getTargetedDataStrategyMatches( + mapRouteProperties2, + manifest, + fetchRequest, + fetcherMatches, + fetcherMatch, + lazyRoutePropertiesToSkip, + scopedContext + ); + } else if (isMidInitialLoad) { + if (isRevalidationRequired) { + fetcherDsMatches = getTargetedDataStrategyMatches( + mapRouteProperties2, + manifest, + fetchRequest, + fetcherMatches, + fetcherMatch, + lazyRoutePropertiesToSkip, + scopedContext + ); + } + } else { + let defaultShouldRevalidate; + if (typeof callSiteDefaultShouldRevalidate === "boolean") { + defaultShouldRevalidate = callSiteDefaultShouldRevalidate; + } else if (shouldSkipRevalidation) { + defaultShouldRevalidate = false; + } else { + defaultShouldRevalidate = isRevalidationRequired; + } + let shouldRevalidateArgs = { + ...baseShouldRevalidateArgs, + defaultShouldRevalidate + }; + if (shouldRevalidateLoader(fetcherMatch, shouldRevalidateArgs)) { + fetcherDsMatches = getTargetedDataStrategyMatches( + mapRouteProperties2, + manifest, + fetchRequest, + fetcherMatches, + fetcherMatch, + lazyRoutePropertiesToSkip, + scopedContext, + shouldRevalidateArgs + ); + } + } + if (fetcherDsMatches) { + revalidatingFetchers.push({ + key, + routeId: f.routeId, + path: f.path, + matches: fetcherDsMatches, + match: fetcherMatch, + request: fetchRequest, + controller: fetchController + }); + } + }); + return { dsMatches, revalidatingFetchers }; +} +function routeHasLoaderOrMiddleware(route) { + return route.loader != null || route.middleware != null && route.middleware.length > 0; +} +function shouldLoadRouteOnHydration(route, loaderData, errors) { + if (route.lazy) { + return true; + } + if (!routeHasLoaderOrMiddleware(route)) { + return false; + } + let hasData = loaderData != null && route.id in loaderData; + let hasError = errors != null && errors[route.id] !== void 0; + if (!hasData && hasError) { + return false; + } + if (typeof route.loader === "function" && route.loader.hydrate === true) { + return true; + } + return !hasData && !hasError; +} +function isNewLoader(currentLoaderData, currentMatch, match) { + let isNew = ( + // [a] -> [a, b] + !currentMatch || // [a, b] -> [a, c] + match.route.id !== currentMatch.route.id + ); + let isMissingData = !currentLoaderData.hasOwnProperty(match.route.id); + return isNew || isMissingData; +} +function isNewRouteInstance(currentMatch, match) { + let currentPath = currentMatch.route.path; + return ( + // param change for this match, /users/123 -> /users/456 + currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path + // e.g. /files/images/avatar.jpg -> files/finances.xls + currentPath != null && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"] + ); +} +function shouldRevalidateLoader(loaderMatch, arg) { + if (loaderMatch.route.shouldRevalidate) { + let routeChoice = loaderMatch.route.shouldRevalidate(arg); + if (typeof routeChoice === "boolean") { + return routeChoice; + } + } + return arg.defaultShouldRevalidate; +} +function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties2, allowElementMutations) { + let childrenToPatch; + if (routeId) { + let route = manifest[routeId]; + invariant( + route, + `No route found to patch children into: routeId = ${routeId}` + ); + if (!route.children) { + route.children = []; + } + childrenToPatch = route.children; + } else { + childrenToPatch = routesToUse; + } + let uniqueChildren = []; + let existingChildren = []; + children.forEach((newRoute) => { + let existingRoute = childrenToPatch.find( + (existingRoute2) => isSameRoute(newRoute, existingRoute2) + ); + if (existingRoute) { + existingChildren.push({ existingRoute, newRoute }); + } else { + uniqueChildren.push(newRoute); + } + }); + if (uniqueChildren.length > 0) { + let newRoutes = convertRoutesToDataRoutes( + uniqueChildren, + mapRouteProperties2, + [routeId || "_", "patch", String(childrenToPatch?.length || "0")], + manifest + ); + childrenToPatch.push(...newRoutes); + } + if (allowElementMutations && existingChildren.length > 0) { + for (let i = 0; i < existingChildren.length; i++) { + let { existingRoute, newRoute } = existingChildren[i]; + let existingRouteTyped = existingRoute; + let [newRouteTyped] = convertRoutesToDataRoutes( + [newRoute], + mapRouteProperties2, + [], + // Doesn't matter for mutated routes since they already have an id + {}, + // Don't touch the manifest here since we're updating in place + true + ); + Object.assign(existingRouteTyped, { + element: newRouteTyped.element ? newRouteTyped.element : existingRouteTyped.element, + errorElement: newRouteTyped.errorElement ? newRouteTyped.errorElement : existingRouteTyped.errorElement, + hydrateFallbackElement: newRouteTyped.hydrateFallbackElement ? newRouteTyped.hydrateFallbackElement : existingRouteTyped.hydrateFallbackElement + }); + } + } +} +function isSameRoute(newRoute, existingRoute) { + if ("id" in newRoute && "id" in existingRoute && newRoute.id === existingRoute.id) { + return true; + } + if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) { + return false; + } + if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) { + return true; + } + return newRoute.children.every( + (aChild, i) => existingRoute.children?.some((bChild) => isSameRoute(aChild, bChild)) + ); +} +var lazyRoutePropertyCache = /* @__PURE__ */ new WeakMap(); +var loadLazyRouteProperty = ({ + key, + route, + manifest, + mapRouteProperties: mapRouteProperties2 +}) => { + let routeToUpdate = manifest[route.id]; + invariant(routeToUpdate, "No route found in manifest"); + if (!routeToUpdate.lazy || typeof routeToUpdate.lazy !== "object") { + return; + } + let lazyFn = routeToUpdate.lazy[key]; + if (!lazyFn) { + return; + } + let cache = lazyRoutePropertyCache.get(routeToUpdate); + if (!cache) { + cache = {}; + lazyRoutePropertyCache.set(routeToUpdate, cache); + } + let cachedPromise = cache[key]; + if (cachedPromise) { + return cachedPromise; + } + let propertyPromise = (async () => { + let isUnsupported = isUnsupportedLazyRouteObjectKey(key); + let staticRouteValue = routeToUpdate[key]; + let isStaticallyDefined = staticRouteValue !== void 0 && key !== "hasErrorBoundary"; + if (isUnsupported) { + warning( + !isUnsupported, + "Route property " + key + " is not a supported lazy route property. This property will be ignored." + ); + cache[key] = Promise.resolve(); + } else if (isStaticallyDefined) { + warning( + false, + `Route "${routeToUpdate.id}" has a static property "${key}" defined. The lazy property will be ignored.` + ); + } else { + let value = await lazyFn(); + if (value != null) { + Object.assign(routeToUpdate, { [key]: value }); + Object.assign(routeToUpdate, mapRouteProperties2(routeToUpdate)); + } + } + if (typeof routeToUpdate.lazy === "object") { + routeToUpdate.lazy[key] = void 0; + if (Object.values(routeToUpdate.lazy).every((value) => value === void 0)) { + routeToUpdate.lazy = void 0; + } + } + })(); + cache[key] = propertyPromise; + return propertyPromise; +}; +var lazyRouteFunctionCache = /* @__PURE__ */ new WeakMap(); +function loadLazyRoute(route, type, manifest, mapRouteProperties2, lazyRoutePropertiesToSkip) { + let routeToUpdate = manifest[route.id]; + invariant(routeToUpdate, "No route found in manifest"); + if (!route.lazy) { + return { + lazyRoutePromise: void 0, + lazyHandlerPromise: void 0 + }; + } + if (typeof route.lazy === "function") { + let cachedPromise = lazyRouteFunctionCache.get(routeToUpdate); + if (cachedPromise) { + return { + lazyRoutePromise: cachedPromise, + lazyHandlerPromise: cachedPromise + }; + } + let lazyRoutePromise2 = (async () => { + invariant( + typeof route.lazy === "function", + "No lazy route function found" + ); + let lazyRoute = await route.lazy(); + let routeUpdates = {}; + for (let lazyRouteProperty in lazyRoute) { + let lazyValue = lazyRoute[lazyRouteProperty]; + if (lazyValue === void 0) { + continue; + } + let isUnsupported = isUnsupportedLazyRouteFunctionKey(lazyRouteProperty); + let staticRouteValue = routeToUpdate[lazyRouteProperty]; + let isStaticallyDefined = staticRouteValue !== void 0 && // This property isn't static since it should always be updated based + // on the route updates + lazyRouteProperty !== "hasErrorBoundary"; + if (isUnsupported) { + warning( + !isUnsupported, + "Route property " + lazyRouteProperty + " is not a supported property to be returned from a lazy route function. This property will be ignored." + ); + } else if (isStaticallyDefined) { + warning( + !isStaticallyDefined, + `Route "${routeToUpdate.id}" has a static property "${lazyRouteProperty}" defined but its lazy function is also returning a value for this property. The lazy route property "${lazyRouteProperty}" will be ignored.` + ); + } else { + routeUpdates[lazyRouteProperty] = lazyValue; + } + } + Object.assign(routeToUpdate, routeUpdates); + Object.assign(routeToUpdate, { + // To keep things framework agnostic, we use the provided `mapRouteProperties` + // function to set the framework-aware properties (`element`/`hasErrorBoundary`) + // since the logic will differ between frameworks. + ...mapRouteProperties2(routeToUpdate), + lazy: void 0 + }); + })(); + lazyRouteFunctionCache.set(routeToUpdate, lazyRoutePromise2); + lazyRoutePromise2.catch(() => { + }); + return { + lazyRoutePromise: lazyRoutePromise2, + lazyHandlerPromise: lazyRoutePromise2 + }; + } + let lazyKeys = Object.keys(route.lazy); + let lazyPropertyPromises = []; + let lazyHandlerPromise = void 0; + for (let key of lazyKeys) { + if (lazyRoutePropertiesToSkip && lazyRoutePropertiesToSkip.includes(key)) { + continue; + } + let promise = loadLazyRouteProperty({ + key, + route, + manifest, + mapRouteProperties: mapRouteProperties2 + }); + if (promise) { + lazyPropertyPromises.push(promise); + if (key === type) { + lazyHandlerPromise = promise; + } + } + } + let lazyRoutePromise = lazyPropertyPromises.length > 0 ? Promise.all(lazyPropertyPromises).then(() => { + }) : void 0; + lazyRoutePromise?.catch(() => { + }); + lazyHandlerPromise?.catch(() => { + }); + return { + lazyRoutePromise, + lazyHandlerPromise + }; +} +function isNonNullable(value) { + return value !== void 0; +} +function loadLazyMiddlewareForMatches(matches, manifest, mapRouteProperties2) { + let promises = matches.map(({ route }) => { + if (typeof route.lazy !== "object" || !route.lazy.middleware) { + return void 0; + } + return loadLazyRouteProperty({ + key: "middleware", + route, + manifest, + mapRouteProperties: mapRouteProperties2 + }); + }).filter(isNonNullable); + return promises.length > 0 ? Promise.all(promises) : void 0; +} +async function defaultDataStrategy(args) { + let matchesToLoad = args.matches.filter((m) => m.shouldLoad); + let keyedResults = {}; + let results = await Promise.all(matchesToLoad.map((m) => m.resolve())); + results.forEach((result, i) => { + keyedResults[matchesToLoad[i].route.id] = result; + }); + return keyedResults; +} +async function defaultDataStrategyWithMiddleware(args) { + if (!args.matches.some((m) => m.route.middleware)) { + return defaultDataStrategy(args); + } + return runClientMiddlewarePipeline(args, () => defaultDataStrategy(args)); +} +function runServerMiddlewarePipeline(args, handler, errorHandler) { + return runMiddlewarePipeline( + args, + handler, + processResult, + isResponse, + errorHandler + ); + function processResult(result) { + return isDataWithResponseInit(result) ? dataWithResponseInitToResponse(result) : result; + } +} +function runClientMiddlewarePipeline(args, handler) { + return runMiddlewarePipeline( + args, + handler, + (r) => { + if (isRedirectResponse(r)) { + throw r; + } + return r; + }, + isDataStrategyResults, + errorHandler + ); + function errorHandler(error, routeId, nextResult) { + if (nextResult) { + return Promise.resolve( + Object.assign(nextResult.value, { + [routeId]: { type: "error", result: error } + }) + ); + } else { + let { matches } = args; + let maxBoundaryIdx = Math.min( + // Throwing route + Math.max( + matches.findIndex((m) => m.route.id === routeId), + 0 + ), + // or the shallowest route that needs to load data + Math.max( + matches.findIndex((m) => m.shouldCallHandler()), + 0 + ) + ); + let boundaryRouteId = findNearestBoundary( + matches, + matches[maxBoundaryIdx].route.id + ).route.id; + return Promise.resolve({ + [boundaryRouteId]: { type: "error", result: error } + }); + } + } +} +async function runMiddlewarePipeline(args, handler, processResult, isResult, errorHandler) { + let { matches, request, params, context, unstable_pattern } = args; + let tuples = matches.flatMap( + (m) => m.route.middleware ? m.route.middleware.map((fn) => [m.route.id, fn]) : [] + ); + let result = await callRouteMiddleware( + { + request, + params, + context, + unstable_pattern + }, + tuples, + handler, + processResult, + isResult, + errorHandler + ); + return result; +} +async function callRouteMiddleware(args, middlewares, handler, processResult, isResult, errorHandler, idx = 0) { + let { request } = args; + if (request.signal.aborted) { + throw request.signal.reason ?? new Error(`Request aborted: ${request.method} ${request.url}`); + } + let tuple = middlewares[idx]; + if (!tuple) { + let result = await handler(); + return result; + } + let [routeId, middleware] = tuple; + let nextResult; + let next = async () => { + if (nextResult) { + throw new Error("You may only call `next()` once per middleware"); + } + try { + let result = await callRouteMiddleware( + args, + middlewares, + handler, + processResult, + isResult, + errorHandler, + idx + 1 + ); + nextResult = { value: result }; + return nextResult.value; + } catch (error) { + nextResult = { value: await errorHandler(error, routeId, nextResult) }; + return nextResult.value; + } + }; + try { + let value = await middleware(args, next); + let result = value != null ? processResult(value) : void 0; + if (isResult(result)) { + return result; + } else if (nextResult) { + return result ?? nextResult.value; + } else { + nextResult = { value: await next() }; + return nextResult.value; + } + } catch (error) { + let response = await errorHandler(error, routeId, nextResult); + return response; + } +} +function getDataStrategyMatchLazyPromises(mapRouteProperties2, manifest, request, match, lazyRoutePropertiesToSkip) { + let lazyMiddlewarePromise = loadLazyRouteProperty({ + key: "middleware", + route: match.route, + manifest, + mapRouteProperties: mapRouteProperties2 + }); + let lazyRoutePromises = loadLazyRoute( + match.route, + isMutationMethod(request.method) ? "action" : "loader", + manifest, + mapRouteProperties2, + lazyRoutePropertiesToSkip + ); + return { + middleware: lazyMiddlewarePromise, + route: lazyRoutePromises.lazyRoutePromise, + handler: lazyRoutePromises.lazyHandlerPromise + }; +} +function getDataStrategyMatch(mapRouteProperties2, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null, callSiteDefaultShouldRevalidate) { + let isUsingNewApi = false; + let _lazyPromises = getDataStrategyMatchLazyPromises( + mapRouteProperties2, + manifest, + request, + match, + lazyRoutePropertiesToSkip + ); + return { + ...match, + _lazyPromises, + shouldLoad, + shouldRevalidateArgs, + shouldCallHandler(defaultShouldRevalidate) { + isUsingNewApi = true; + if (!shouldRevalidateArgs) { + return shouldLoad; + } + if (typeof callSiteDefaultShouldRevalidate === "boolean") { + return shouldRevalidateLoader(match, { + ...shouldRevalidateArgs, + defaultShouldRevalidate: callSiteDefaultShouldRevalidate + }); + } + if (typeof defaultShouldRevalidate === "boolean") { + return shouldRevalidateLoader(match, { + ...shouldRevalidateArgs, + defaultShouldRevalidate + }); + } + return shouldRevalidateLoader(match, shouldRevalidateArgs); + }, + resolve(handlerOverride) { + let { lazy, loader, middleware } = match.route; + let callHandler = isUsingNewApi || shouldLoad || handlerOverride && !isMutationMethod(request.method) && (lazy || loader); + let isMiddlewareOnlyRoute = middleware && middleware.length > 0 && !loader && !lazy; + if (callHandler && (isMutationMethod(request.method) || !isMiddlewareOnlyRoute)) { + return callLoaderOrAction({ + request, + unstable_pattern, + match, + lazyHandlerPromise: _lazyPromises?.handler, + lazyRoutePromise: _lazyPromises?.route, + handlerOverride, + scopedContext + }); + } + return Promise.resolve({ type: "data" /* data */, result: void 0 }); + } + }; +} +function getTargetedDataStrategyMatches(mapRouteProperties2, manifest, request, matches, targetMatch, lazyRoutePropertiesToSkip, scopedContext, shouldRevalidateArgs = null) { + return matches.map((match) => { + if (match.route.id !== targetMatch.route.id) { + return { + ...match, + shouldLoad: false, + shouldRevalidateArgs, + shouldCallHandler: () => false, + _lazyPromises: getDataStrategyMatchLazyPromises( + mapRouteProperties2, + manifest, + request, + match, + lazyRoutePropertiesToSkip + ), + resolve: () => Promise.resolve({ type: "data", result: void 0 }) + }; + } + return getDataStrategyMatch( + mapRouteProperties2, + manifest, + request, + getRoutePattern(matches), + match, + lazyRoutePropertiesToSkip, + scopedContext, + true, + shouldRevalidateArgs + ); + }); +} +async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherKey, scopedContext, isStaticHandler) { + if (matches.some((m) => m._lazyPromises?.middleware)) { + await Promise.all(matches.map((m) => m._lazyPromises?.middleware)); + } + let dataStrategyArgs = { + request, + unstable_pattern: getRoutePattern(matches), + params: matches[0].params, + context: scopedContext, + matches + }; + let runClientMiddleware = isStaticHandler ? () => { + throw new Error( + "You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`" + ); + } : (cb) => { + let typedDataStrategyArgs = dataStrategyArgs; + return runClientMiddlewarePipeline(typedDataStrategyArgs, () => { + return cb({ + ...typedDataStrategyArgs, + fetcherKey, + runClientMiddleware: () => { + throw new Error( + "Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler" + ); + } + }); + }); + }; + let results = await dataStrategyImpl({ + ...dataStrategyArgs, + fetcherKey, + runClientMiddleware + }); + try { + await Promise.all( + matches.flatMap((m) => [ + m._lazyPromises?.handler, + m._lazyPromises?.route + ]) + ); + } catch (e) { + } + return results; +} +async function callLoaderOrAction({ + request, + unstable_pattern, + match, + lazyHandlerPromise, + lazyRoutePromise, + handlerOverride, + scopedContext +}) { + let result; + let onReject; + let isAction = isMutationMethod(request.method); + let type = isAction ? "action" : "loader"; + let runHandler = (handler) => { + let reject; + let abortPromise = new Promise((_, r) => reject = r); + onReject = () => reject(); + request.signal.addEventListener("abort", onReject); + let actualHandler = (ctx) => { + if (typeof handler !== "function") { + return Promise.reject( + new Error( + `You cannot call the handler for a route which defines a boolean "${type}" [routeId: ${match.route.id}]` + ) + ); + } + return handler( + { + request, + unstable_pattern, + params: match.params, + context: scopedContext + }, + ...ctx !== void 0 ? [ctx] : [] + ); + }; + let handlerPromise = (async () => { + try { + let val = await (handlerOverride ? handlerOverride((ctx) => actualHandler(ctx)) : actualHandler()); + return { type: "data", result: val }; + } catch (e) { + return { type: "error", result: e }; + } + })(); + return Promise.race([handlerPromise, abortPromise]); + }; + try { + let handler = isAction ? match.route.action : match.route.loader; + if (lazyHandlerPromise || lazyRoutePromise) { + if (handler) { + let handlerError; + let [value] = await Promise.all([ + // If the handler throws, don't let it immediately bubble out, + // since we need to let the lazy() execution finish so we know if this + // route has a boundary that can handle the error + runHandler(handler).catch((e) => { + handlerError = e; + }), + // Ensure all lazy route promises are resolved before continuing + lazyHandlerPromise, + lazyRoutePromise + ]); + if (handlerError !== void 0) { + throw handlerError; + } + result = value; + } else { + await lazyHandlerPromise; + let handler2 = isAction ? match.route.action : match.route.loader; + if (handler2) { + [result] = await Promise.all([runHandler(handler2), lazyRoutePromise]); + } else if (type === "action") { + let url = new URL(request.url); + let pathname = url.pathname + url.search; + throw getInternalRouterError(405, { + method: request.method, + pathname, + routeId: match.route.id + }); + } else { + return { type: "data" /* data */, result: void 0 }; + } + } + } else if (!handler) { + let url = new URL(request.url); + let pathname = url.pathname + url.search; + throw getInternalRouterError(404, { + pathname + }); + } else { + result = await runHandler(handler); + } + } catch (e) { + return { type: "error" /* error */, result: e }; + } finally { + if (onReject) { + request.signal.removeEventListener("abort", onReject); + } + } + return result; +} +async function parseResponseBody(response) { + let contentType = response.headers.get("Content-Type"); + if (contentType && /\bapplication\/json\b/.test(contentType)) { + return response.body == null ? null : response.json(); + } + return response.text(); +} +async function convertDataStrategyResultToDataResult(dataStrategyResult) { + let { result, type } = dataStrategyResult; + if (isResponse(result)) { + let data2; + try { + data2 = await parseResponseBody(result); + } catch (e) { + return { type: "error" /* error */, error: e }; + } + if (type === "error" /* error */) { + return { + type: "error" /* error */, + error: new ErrorResponseImpl(result.status, result.statusText, data2), + statusCode: result.status, + headers: result.headers + }; + } + return { + type: "data" /* data */, + data: data2, + statusCode: result.status, + headers: result.headers + }; + } + if (type === "error" /* error */) { + if (isDataWithResponseInit(result)) { + if (result.data instanceof Error) { + return { + type: "error" /* error */, + error: result.data, + statusCode: result.init?.status, + headers: result.init?.headers ? new Headers(result.init.headers) : void 0 + }; + } + return { + type: "error" /* error */, + error: dataWithResponseInitToErrorResponse(result), + statusCode: isRouteErrorResponse(result) ? result.status : void 0, + headers: result.init?.headers ? new Headers(result.init.headers) : void 0 + }; + } + return { + type: "error" /* error */, + error: result, + statusCode: isRouteErrorResponse(result) ? result.status : void 0 + }; + } + if (isDataWithResponseInit(result)) { + return { + type: "data" /* data */, + data: result.data, + statusCode: result.init?.status, + headers: result.init?.headers ? new Headers(result.init.headers) : void 0 + }; + } + return { type: "data" /* data */, data: result }; +} +function normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename) { + let location = response.headers.get("Location"); + invariant( + location, + "Redirects returned/thrown from loaders/actions must have a Location header" + ); + if (!isAbsoluteUrl(location)) { + let trimmedMatches = matches.slice( + 0, + matches.findIndex((m) => m.route.id === routeId) + 1 + ); + location = normalizeTo( + new URL(request.url), + trimmedMatches, + basename, + location + ); + response.headers.set("Location", location); + } + return response; +} +function normalizeRedirectLocation(location, currentUrl, basename, historyInstance) { + let invalidProtocols = [ + "about:", + "blob:", + "chrome:", + "chrome-untrusted:", + "content:", + "data:", + "devtools:", + "file:", + "filesystem:", + // eslint-disable-next-line no-script-url + "javascript:" + ]; + if (isAbsoluteUrl(location)) { + let normalizedLocation = location; + let url = normalizedLocation.startsWith("//") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation); + if (invalidProtocols.includes(url.protocol)) { + throw new Error("Invalid redirect location"); + } + let isSameBasename = stripBasename(url.pathname, basename) != null; + if (url.origin === currentUrl.origin && isSameBasename) { + return url.pathname + url.search + url.hash; + } + } + try { + let url = historyInstance.createURL(location); + if (invalidProtocols.includes(url.protocol)) { + throw new Error("Invalid redirect location"); + } + } catch (e) { + } + return location; +} +function createClientSideRequest(history, location, signal, submission) { + let url = history.createURL(stripHashFromPath(location)).toString(); + let init = { signal }; + if (submission && isMutationMethod(submission.formMethod)) { + let { formMethod, formEncType } = submission; + init.method = formMethod.toUpperCase(); + if (formEncType === "application/json") { + init.headers = new Headers({ "Content-Type": formEncType }); + init.body = JSON.stringify(submission.json); + } else if (formEncType === "text/plain") { + init.body = submission.text; + } else if (formEncType === "application/x-www-form-urlencoded" && submission.formData) { + init.body = convertFormDataToSearchParams(submission.formData); + } else { + init.body = submission.formData; + } + } + return new Request(url, init); +} +function convertFormDataToSearchParams(formData) { + let searchParams = new URLSearchParams(); + for (let [key, value] of formData.entries()) { + searchParams.append(key, typeof value === "string" ? value : value.name); + } + return searchParams; +} +function convertSearchParamsToFormData(searchParams) { + let formData = new FormData(); + for (let [key, value] of searchParams.entries()) { + formData.append(key, value); + } + return formData; +} +function processRouteLoaderData(matches, results, pendingActionResult, isStaticHandler = false, skipLoaderErrorBubbling = false) { + let loaderData = {}; + let errors = null; + let statusCode; + let foundError = false; + let loaderHeaders = {}; + let pendingError = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : void 0; + matches.forEach((match) => { + if (!(match.route.id in results)) { + return; + } + let id = match.route.id; + let result = results[id]; + invariant( + !isRedirectResult(result), + "Cannot handle redirect results in processLoaderData" + ); + if (isErrorResult(result)) { + let error = result.error; + if (pendingError !== void 0) { + error = pendingError; + pendingError = void 0; + } + errors = errors || {}; + if (skipLoaderErrorBubbling) { + errors[id] = error; + } else { + let boundaryMatch = findNearestBoundary(matches, id); + if (errors[boundaryMatch.route.id] == null) { + errors[boundaryMatch.route.id] = error; + } + } + if (!isStaticHandler) { + loaderData[id] = ResetLoaderDataSymbol; + } + if (!foundError) { + foundError = true; + statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500; + } + if (result.headers) { + loaderHeaders[id] = result.headers; + } + } else { + loaderData[id] = result.data; + if (result.statusCode && result.statusCode !== 200 && !foundError) { + statusCode = result.statusCode; + } + if (result.headers) { + loaderHeaders[id] = result.headers; + } + } + }); + if (pendingError !== void 0 && pendingActionResult) { + errors = { [pendingActionResult[0]]: pendingError }; + if (pendingActionResult[2]) { + loaderData[pendingActionResult[2]] = void 0; + } + } + return { + loaderData, + errors, + statusCode: statusCode || 200, + loaderHeaders + }; +} +function processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults) { + let { loaderData, errors } = processRouteLoaderData( + matches, + results, + pendingActionResult + ); + revalidatingFetchers.filter((f) => !f.matches || f.matches.some((m) => m.shouldLoad)).forEach((rf) => { + let { key, match, controller } = rf; + if (controller && controller.signal.aborted) { + return; + } + let result = fetcherResults[key]; + invariant(result, "Did not find corresponding fetcher result"); + if (isErrorResult(result)) { + let boundaryMatch = findNearestBoundary(state.matches, match?.route.id); + if (!(errors && errors[boundaryMatch.route.id])) { + errors = { + ...errors, + [boundaryMatch.route.id]: result.error + }; + } + state.fetchers.delete(key); + } else if (isRedirectResult(result)) { + invariant(false, "Unhandled fetcher revalidation redirect"); + } else { + let doneFetcher = getDoneFetcher(result.data); + state.fetchers.set(key, doneFetcher); + } + }); + return { loaderData, errors }; +} +function mergeLoaderData(loaderData, newLoaderData, matches, errors) { + let mergedLoaderData = Object.entries(newLoaderData).filter(([, v]) => v !== ResetLoaderDataSymbol).reduce((merged, [k, v]) => { + merged[k] = v; + return merged; + }, {}); + for (let match of matches) { + let id = match.route.id; + if (!newLoaderData.hasOwnProperty(id) && loaderData.hasOwnProperty(id) && match.route.loader) { + mergedLoaderData[id] = loaderData[id]; + } + if (errors && errors.hasOwnProperty(id)) { + break; + } + } + return mergedLoaderData; +} +function getActionDataForCommit(pendingActionResult) { + if (!pendingActionResult) { + return {}; + } + return isErrorResult(pendingActionResult[1]) ? { + // Clear out prior actionData on errors + actionData: {} + } : { + actionData: { + [pendingActionResult[0]]: pendingActionResult[1].data + } + }; +} +function findNearestBoundary(matches, routeId) { + let eligibleMatches = routeId ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1) : [...matches]; + return eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) || matches[0]; +} +function getShortCircuitMatches(routes) { + let route = routes.length === 1 ? routes[0] : routes.find((r) => r.index || !r.path || r.path === "/") || { + id: `__shim-error-route__` + }; + return { + matches: [ + { + params: {}, + pathname: "", + pathnameBase: "", + route + } + ], + route + }; +} +function getInternalRouterError(status, { + pathname, + routeId, + method, + type, + message +} = {}) { + let statusText = "Unknown Server Error"; + let errorMessage = "Unknown @remix-run/router error"; + if (status === 400) { + statusText = "Bad Request"; + if (method && pathname && routeId) { + errorMessage = `You made a ${method} request to "${pathname}" but did not provide a \`loader\` for route "${routeId}", so there is no way to handle the request.`; + } else if (type === "invalid-body") { + errorMessage = "Unable to encode submission body"; + } + } else if (status === 403) { + statusText = "Forbidden"; + errorMessage = `Route "${routeId}" does not match URL "${pathname}"`; + } else if (status === 404) { + statusText = "Not Found"; + errorMessage = `No route matches URL "${pathname}"`; + } else if (status === 405) { + statusText = "Method Not Allowed"; + if (method && pathname && routeId) { + errorMessage = `You made a ${method.toUpperCase()} request to "${pathname}" but did not provide an \`action\` for route "${routeId}", so there is no way to handle the request.`; + } else if (method) { + errorMessage = `Invalid request method "${method.toUpperCase()}"`; + } + } + return new ErrorResponseImpl( + status || 500, + statusText, + new Error(errorMessage), + true + ); +} +function findRedirect(results) { + let entries = Object.entries(results); + for (let i = entries.length - 1; i >= 0; i--) { + let [key, result] = entries[i]; + if (isRedirectResult(result)) { + return { key, result }; + } + } +} +function stripHashFromPath(path) { + let parsedPath = typeof path === "string" ? parsePath(path) : path; + return createPath({ ...parsedPath, hash: "" }); +} +function isHashChangeOnly(a, b) { + if (a.pathname !== b.pathname || a.search !== b.search) { + return false; + } + if (a.hash === "") { + return b.hash !== ""; + } else if (a.hash === b.hash) { + return true; + } else if (b.hash !== "") { + return true; + } + return false; +} +function dataWithResponseInitToResponse(data2) { + return Response.json(data2.data, data2.init ?? void 0); +} +function dataWithResponseInitToErrorResponse(data2) { + return new ErrorResponseImpl( + data2.init?.status ?? 500, + data2.init?.statusText ?? "Internal Server Error", + data2.data + ); +} +function isDataStrategyResults(result) { + return result != null && typeof result === "object" && Object.entries(result).every( + ([key, value]) => typeof key === "string" && isDataStrategyResult(value) + ); +} +function isDataStrategyResult(result) { + return result != null && typeof result === "object" && "type" in result && "result" in result && (result.type === "data" /* data */ || result.type === "error" /* error */); +} +function isRedirectDataStrategyResult(result) { + return isResponse(result.result) && redirectStatusCodes.has(result.result.status); +} +function isErrorResult(result) { + return result.type === "error" /* error */; +} +function isRedirectResult(result) { + return (result && result.type) === "redirect" /* redirect */; +} +function isDataWithResponseInit(value) { + return typeof value === "object" && value != null && "type" in value && "data" in value && "init" in value && value.type === "DataWithResponseInit"; +} +function isResponse(value) { + return value != null && typeof value.status === "number" && typeof value.statusText === "string" && typeof value.headers === "object" && typeof value.body !== "undefined"; +} +function isRedirectStatusCode(statusCode) { + return redirectStatusCodes.has(statusCode); +} +function isRedirectResponse(result) { + return isResponse(result) && isRedirectStatusCode(result.status) && result.headers.has("Location"); +} +function isValidMethod(method) { + return validRequestMethods.has(method.toUpperCase()); +} +function isMutationMethod(method) { + return validMutationMethods.has(method.toUpperCase()); +} +function hasNakedIndexQuery(search) { + return new URLSearchParams(search).getAll("index").some((v) => v === ""); +} +function getTargetMatch(matches, location) { + let search = typeof location === "string" ? parsePath(location).search : location.search; + if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) { + return matches[matches.length - 1]; + } + let pathMatches = getPathContributingMatches(matches); + return pathMatches[pathMatches.length - 1]; +} +function getSubmissionFromNavigation(navigation) { + let { formMethod, formAction, formEncType, text, formData, json } = navigation; + if (!formMethod || !formAction || !formEncType) { + return; + } + if (text != null) { + return { + formMethod, + formAction, + formEncType, + formData: void 0, + json: void 0, + text + }; + } else if (formData != null) { + return { + formMethod, + formAction, + formEncType, + formData, + json: void 0, + text: void 0 + }; + } else if (json !== void 0) { + return { + formMethod, + formAction, + formEncType, + formData: void 0, + json, + text: void 0 + }; + } +} +function getLoadingNavigation(location, submission) { + if (submission) { + let navigation = { + state: "loading", + location, + formMethod: submission.formMethod, + formAction: submission.formAction, + formEncType: submission.formEncType, + formData: submission.formData, + json: submission.json, + text: submission.text + }; + return navigation; + } else { + let navigation = { + state: "loading", + location, + formMethod: void 0, + formAction: void 0, + formEncType: void 0, + formData: void 0, + json: void 0, + text: void 0 + }; + return navigation; + } +} +function getSubmittingNavigation(location, submission) { + let navigation = { + state: "submitting", + location, + formMethod: submission.formMethod, + formAction: submission.formAction, + formEncType: submission.formEncType, + formData: submission.formData, + json: submission.json, + text: submission.text + }; + return navigation; +} +function getLoadingFetcher(submission, data2) { + if (submission) { + let fetcher = { + state: "loading", + formMethod: submission.formMethod, + formAction: submission.formAction, + formEncType: submission.formEncType, + formData: submission.formData, + json: submission.json, + text: submission.text, + data: data2 + }; + return fetcher; + } else { + let fetcher = { + state: "loading", + formMethod: void 0, + formAction: void 0, + formEncType: void 0, + formData: void 0, + json: void 0, + text: void 0, + data: data2 + }; + return fetcher; + } +} +function getSubmittingFetcher(submission, existingFetcher) { + let fetcher = { + state: "submitting", + formMethod: submission.formMethod, + formAction: submission.formAction, + formEncType: submission.formEncType, + formData: submission.formData, + json: submission.json, + text: submission.text, + data: existingFetcher ? existingFetcher.data : void 0 + }; + return fetcher; +} +function getDoneFetcher(data2) { + let fetcher = { + state: "idle", + formMethod: void 0, + formAction: void 0, + formEncType: void 0, + formData: void 0, + json: void 0, + text: void 0, + data: data2 + }; + return fetcher; +} +function restoreAppliedTransitions(_window, transitions) { + try { + let sessionPositions = _window.sessionStorage.getItem( + TRANSITIONS_STORAGE_KEY + ); + if (sessionPositions) { + let json = JSON.parse(sessionPositions); + for (let [k, v] of Object.entries(json || {})) { + if (v && Array.isArray(v)) { + transitions.set(k, new Set(v || [])); + } + } + } + } catch (e) { + } +} +function persistAppliedTransitions(_window, transitions) { + if (transitions.size > 0) { + let json = {}; + for (let [k, v] of transitions) { + json[k] = [...v]; + } + try { + _window.sessionStorage.setItem( + TRANSITIONS_STORAGE_KEY, + JSON.stringify(json) + ); + } catch (error) { + warning( + false, + `Failed to save applied view transitions in sessionStorage (${error}).` + ); + } + } +} +function createDeferred() { + let resolve; + let reject; + let promise = new Promise((res, rej) => { + resolve = async (val) => { + res(val); + try { + await promise; + } catch (e) { + } + }; + reject = async (error) => { + rej(error); + try { + await promise; + } catch (e) { + } + }; + }); + return { + promise, + //@ts-ignore + resolve, + //@ts-ignore + reject + }; +} + +// lib/context.ts +import * as React from "react"; +var DataRouterContext = React.createContext(null); +DataRouterContext.displayName = "DataRouter"; +var DataRouterStateContext = React.createContext(null); +DataRouterStateContext.displayName = "DataRouterState"; +var RSCRouterContext = React.createContext(false); +function useIsRSCRouterContext() { + return React.useContext(RSCRouterContext); +} +var ViewTransitionContext = React.createContext({ + isTransitioning: false +}); +ViewTransitionContext.displayName = "ViewTransition"; +var FetchersContext = React.createContext( + /* @__PURE__ */ new Map() +); +FetchersContext.displayName = "Fetchers"; +var AwaitContext = React.createContext(null); +AwaitContext.displayName = "Await"; +var AwaitContextProvider = (props) => React.createElement(AwaitContext.Provider, props); +var NavigationContext = React.createContext( + null +); +NavigationContext.displayName = "Navigation"; +var LocationContext = React.createContext( + null +); +LocationContext.displayName = "Location"; +var RouteContext = React.createContext({ + outlet: null, + matches: [], + isDataRoute: false +}); +RouteContext.displayName = "Route"; +var RouteErrorContext = React.createContext(null); +RouteErrorContext.displayName = "RouteError"; +var ENABLE_DEV_WARNINGS = true; + +// lib/hooks.tsx +import * as React2 from "react"; + +// lib/errors.ts +var ERROR_DIGEST_BASE = "REACT_ROUTER_ERROR"; +var ERROR_DIGEST_REDIRECT = "REDIRECT"; +var ERROR_DIGEST_ROUTE_ERROR_RESPONSE = "ROUTE_ERROR_RESPONSE"; +function decodeRedirectErrorDigest(digest) { + if (digest.startsWith(`${ERROR_DIGEST_BASE}:${ERROR_DIGEST_REDIRECT}:{`)) { + try { + let parsed = JSON.parse(digest.slice(28)); + if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string" && typeof parsed.location === "string" && typeof parsed.reloadDocument === "boolean" && typeof parsed.replace === "boolean") { + return parsed; + } + } catch { + } + } +} +function decodeRouteErrorResponseDigest(digest) { + if (digest.startsWith( + `${ERROR_DIGEST_BASE}:${ERROR_DIGEST_ROUTE_ERROR_RESPONSE}:{` + )) { + try { + let parsed = JSON.parse(digest.slice(40)); + if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string") { + return new ErrorResponseImpl( + parsed.status, + parsed.statusText, + parsed.data + ); + } + } catch { + } + } +} + +// lib/hooks.tsx +function useHref(to, { relative } = {}) { + invariant( + useInRouterContext(), + // TODO: This error is probably because they somehow have 2 versions of the + // router loaded. We can help them understand how to avoid that. + `useHref() may be used only in the context of a component.` + ); + let { basename, navigator } = React2.useContext(NavigationContext); + let { hash, pathname, search } = useResolvedPath(to, { relative }); + let joinedPathname = pathname; + if (basename !== "/") { + joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]); + } + return navigator.createHref({ pathname: joinedPathname, search, hash }); +} +function useInRouterContext() { + return React2.useContext(LocationContext) != null; +} +function useLocation() { + invariant( + useInRouterContext(), + // TODO: This error is probably because they somehow have 2 versions of the + // router loaded. We can help them understand how to avoid that. + `useLocation() may be used only in the context of a component.` + ); + return React2.useContext(LocationContext).location; +} +function useNavigationType() { + return React2.useContext(LocationContext).navigationType; +} +function useMatch(pattern) { + invariant( + useInRouterContext(), + // TODO: This error is probably because they somehow have 2 versions of the + // router loaded. We can help them understand how to avoid that. + `useMatch() may be used only in the context of a component.` + ); + let { pathname } = useLocation(); + return React2.useMemo( + () => matchPath(pattern, decodePath(pathname)), + [pathname, pattern] + ); +} +var navigateEffectWarning = `You should call navigate() in a React.useEffect(), not when your component is first rendered.`; +function useIsomorphicLayoutEffect(cb) { + let isStatic = React2.useContext(NavigationContext).static; + if (!isStatic) { + React2.useLayoutEffect(cb); + } +} +function useNavigate() { + let { isDataRoute } = React2.useContext(RouteContext); + return isDataRoute ? useNavigateStable() : useNavigateUnstable(); +} +function useNavigateUnstable() { + invariant( + useInRouterContext(), + // TODO: This error is probably because they somehow have 2 versions of the + // router loaded. We can help them understand how to avoid that. + `useNavigate() may be used only in the context of a component.` + ); + let dataRouterContext = React2.useContext(DataRouterContext); + let { basename, navigator } = React2.useContext(NavigationContext); + let { matches } = React2.useContext(RouteContext); + let { pathname: locationPathname } = useLocation(); + let routePathnamesJson = JSON.stringify(getResolveToMatches(matches)); + let activeRef = React2.useRef(false); + useIsomorphicLayoutEffect(() => { + activeRef.current = true; + }); + let navigate = React2.useCallback( + (to, options = {}) => { + warning(activeRef.current, navigateEffectWarning); + if (!activeRef.current) return; + if (typeof to === "number") { + navigator.go(to); + return; + } + let path = resolveTo( + to, + JSON.parse(routePathnamesJson), + locationPathname, + options.relative === "path" + ); + if (dataRouterContext == null && basename !== "/") { + path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]); + } + (!!options.replace ? navigator.replace : navigator.push)( + path, + options.state, + options + ); + }, + [ + basename, + navigator, + routePathnamesJson, + locationPathname, + dataRouterContext + ] + ); + return navigate; +} +var OutletContext = React2.createContext(null); +function useOutletContext() { + return React2.useContext(OutletContext); +} +function useOutlet(context) { + let outlet = React2.useContext(RouteContext).outlet; + return React2.useMemo( + () => outlet && /* @__PURE__ */ React2.createElement(OutletContext.Provider, { value: context }, outlet), + [outlet, context] + ); +} +function useParams() { + let { matches } = React2.useContext(RouteContext); + let routeMatch = matches[matches.length - 1]; + return routeMatch ? routeMatch.params : {}; +} +function useResolvedPath(to, { relative } = {}) { + let { matches } = React2.useContext(RouteContext); + let { pathname: locationPathname } = useLocation(); + let routePathnamesJson = JSON.stringify(getResolveToMatches(matches)); + return React2.useMemo( + () => resolveTo( + to, + JSON.parse(routePathnamesJson), + locationPathname, + relative === "path" + ), + [to, routePathnamesJson, locationPathname, relative] + ); +} +function useRoutes(routes, locationArg) { + return useRoutesImpl(routes, locationArg); +} +function useRoutesImpl(routes, locationArg, dataRouterState, onError, future) { + invariant( + useInRouterContext(), + // TODO: This error is probably because they somehow have 2 versions of the + // router loaded. We can help them understand how to avoid that. + `useRoutes() may be used only in the context of a component.` + ); + let { navigator } = React2.useContext(NavigationContext); + let { matches: parentMatches } = React2.useContext(RouteContext); + let routeMatch = parentMatches[parentMatches.length - 1]; + let parentParams = routeMatch ? routeMatch.params : {}; + let parentPathname = routeMatch ? routeMatch.pathname : "/"; + let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/"; + let parentRoute = routeMatch && routeMatch.route; + if (ENABLE_DEV_WARNINGS) { + let parentPath = parentRoute && parentRoute.path || ""; + warningOnce( + parentPathname, + !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"), + `You rendered descendant (or called \`useRoutes()\`) at "${parentPathname}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .` + ); + } + let locationFromContext = useLocation(); + let location; + if (locationArg) { + let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; + invariant( + parentPathnameBase === "/" || parsedLocationArg.pathname?.startsWith(parentPathnameBase), + `When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${parentPathnameBase}" but pathname "${parsedLocationArg.pathname}" was given in the \`location\` prop.` + ); + location = parsedLocationArg; + } else { + location = locationFromContext; + } + let pathname = location.pathname || "/"; + let remainingPathname = pathname; + if (parentPathnameBase !== "/") { + let parentSegments = parentPathnameBase.replace(/^\//, "").split("/"); + let segments = pathname.replace(/^\//, "").split("/"); + remainingPathname = "/" + segments.slice(parentSegments.length).join("/"); + } + let matches = matchRoutes(routes, { pathname: remainingPathname }); + if (ENABLE_DEV_WARNINGS) { + warning( + parentRoute || matches != null, + `No routes matched location "${location.pathname}${location.search}${location.hash}" ` + ); + warning( + matches == null || matches[matches.length - 1].route.element !== void 0 || matches[matches.length - 1].route.Component !== void 0 || matches[matches.length - 1].route.lazy !== void 0, + `Matched leaf route at location "${location.pathname}${location.search}${location.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.` + ); + } + let renderedMatches = _renderMatches( + matches && matches.map( + (match) => Object.assign({}, match, { + params: Object.assign({}, parentParams, match.params), + pathname: joinPaths([ + parentPathnameBase, + // Re-encode pathnames that were decoded inside matchRoutes. + // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses + // `new URL()` internally and we need to prevent it from treating + // them as separators + navigator.encodeLocation ? navigator.encodeLocation( + match.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23") + ).pathname : match.pathname + ]), + pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([ + parentPathnameBase, + // Re-encode pathnames that were decoded inside matchRoutes + // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses + // `new URL()` internally and we need to prevent it from treating + // them as separators + navigator.encodeLocation ? navigator.encodeLocation( + match.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23") + ).pathname : match.pathnameBase + ]) + }) + ), + parentMatches, + dataRouterState, + onError, + future + ); + if (locationArg && renderedMatches) { + return /* @__PURE__ */ React2.createElement( + LocationContext.Provider, + { + value: { + location: { + pathname: "/", + search: "", + hash: "", + state: null, + key: "default", + ...location + }, + navigationType: "POP" /* Pop */ + } + }, + renderedMatches + ); + } + return renderedMatches; +} +function DefaultErrorComponent() { + let error = useRouteError(); + let message = isRouteErrorResponse(error) ? `${error.status} ${error.statusText}` : error instanceof Error ? error.message : JSON.stringify(error); + let stack = error instanceof Error ? error.stack : null; + let lightgrey = "rgba(200,200,200, 0.5)"; + let preStyles = { padding: "0.5rem", backgroundColor: lightgrey }; + let codeStyles = { padding: "2px 4px", backgroundColor: lightgrey }; + let devInfo = null; + if (ENABLE_DEV_WARNINGS) { + console.error( + "Error handled by React Router default ErrorBoundary:", + error + ); + devInfo = /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("p", null, "\u{1F4BF} Hey developer \u{1F44B}"), /* @__PURE__ */ React2.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ React2.createElement("code", { style: codeStyles }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ React2.createElement("code", { style: codeStyles }, "errorElement"), " prop on your route.")); + } + return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ React2.createElement("h3", { style: { fontStyle: "italic" } }, message), stack ? /* @__PURE__ */ React2.createElement("pre", { style: preStyles }, stack) : null, devInfo); +} +var defaultErrorElement = /* @__PURE__ */ React2.createElement(DefaultErrorComponent, null); +var RenderErrorBoundary = class extends React2.Component { + constructor(props) { + super(props); + this.state = { + location: props.location, + revalidation: props.revalidation, + error: props.error + }; + } + static getDerivedStateFromError(error) { + return { error }; + } + static getDerivedStateFromProps(props, state) { + if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") { + return { + error: props.error, + location: props.location, + revalidation: props.revalidation + }; + } + return { + error: props.error !== void 0 ? props.error : state.error, + location: state.location, + revalidation: props.revalidation || state.revalidation + }; + } + componentDidCatch(error, errorInfo) { + if (this.props.onError) { + this.props.onError(error, errorInfo); + } else { + console.error( + "React Router caught the following error during render", + error + ); + } + } + render() { + let error = this.state.error; + if (this.context && typeof error === "object" && error && "digest" in error && typeof error.digest === "string") { + const decoded = decodeRouteErrorResponseDigest(error.digest); + if (decoded) error = decoded; + } + let result = error !== void 0 ? /* @__PURE__ */ React2.createElement(RouteContext.Provider, { value: this.props.routeContext }, /* @__PURE__ */ React2.createElement( + RouteErrorContext.Provider, + { + value: error, + children: this.props.component + } + )) : this.props.children; + if (this.context) { + return /* @__PURE__ */ React2.createElement(RSCErrorHandler, { error }, result); + } + return result; + } +}; +RenderErrorBoundary.contextType = RSCRouterContext; +var errorRedirectHandledMap = /* @__PURE__ */ new WeakMap(); +function RSCErrorHandler({ + children, + error +}) { + let { basename } = React2.useContext(NavigationContext); + if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") { + let redirect2 = decodeRedirectErrorDigest(error.digest); + if (redirect2) { + let existingRedirect = errorRedirectHandledMap.get(error); + if (existingRedirect) throw existingRedirect; + let parsed = parseToInfo(redirect2.location, basename); + if (isBrowser && !errorRedirectHandledMap.get(error)) { + if (parsed.isExternal || redirect2.reloadDocument) { + window.location.href = parsed.absoluteURL || parsed.to; + } else { + const redirectPromise = Promise.resolve().then( + () => window.__reactRouterDataRouter.navigate(parsed.to, { + replace: redirect2.replace + }) + ); + errorRedirectHandledMap.set(error, redirectPromise); + throw redirectPromise; + } + } + return /* @__PURE__ */ React2.createElement( + "meta", + { + httpEquiv: "refresh", + content: `0;url=${parsed.absoluteURL || parsed.to}` + } + ); + } + } + return children; +} +function RenderedRoute({ routeContext, match, children }) { + let dataRouterContext = React2.useContext(DataRouterContext); + if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) { + dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id; + } + return /* @__PURE__ */ React2.createElement(RouteContext.Provider, { value: routeContext }, children); +} +function _renderMatches(matches, parentMatches = [], dataRouterState = null, onErrorHandler = null, future = null) { + if (matches == null) { + if (!dataRouterState) { + return null; + } + if (dataRouterState.errors) { + matches = dataRouterState.matches; + } else if (parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) { + matches = dataRouterState.matches; + } else { + return null; + } + } + let renderedMatches = matches; + let errors = dataRouterState?.errors; + if (errors != null) { + let errorIndex = renderedMatches.findIndex( + (m) => m.route.id && errors?.[m.route.id] !== void 0 + ); + invariant( + errorIndex >= 0, + `Could not find a matching route for errors on route IDs: ${Object.keys( + errors + ).join(",")}` + ); + renderedMatches = renderedMatches.slice( + 0, + Math.min(renderedMatches.length, errorIndex + 1) + ); + } + let renderFallback = false; + let fallbackIndex = -1; + if (dataRouterState) { + for (let i = 0; i < renderedMatches.length; i++) { + let match = renderedMatches[i]; + if (match.route.HydrateFallback || match.route.hydrateFallbackElement) { + fallbackIndex = i; + } + if (match.route.id) { + let { loaderData, errors: errors2 } = dataRouterState; + let needsToRunLoader = match.route.loader && !loaderData.hasOwnProperty(match.route.id) && (!errors2 || errors2[match.route.id] === void 0); + if (match.route.lazy || needsToRunLoader) { + renderFallback = true; + if (fallbackIndex >= 0) { + renderedMatches = renderedMatches.slice(0, fallbackIndex + 1); + } else { + renderedMatches = [renderedMatches[0]]; + } + break; + } + } + } + } + let onError = dataRouterState && onErrorHandler ? (error, errorInfo) => { + onErrorHandler(error, { + location: dataRouterState.location, + params: dataRouterState.matches?.[0]?.params ?? {}, + unstable_pattern: getRoutePattern(dataRouterState.matches), + errorInfo + }); + } : void 0; + return renderedMatches.reduceRight( + (outlet, match, index) => { + let error; + let shouldRenderHydrateFallback = false; + let errorElement = null; + let hydrateFallbackElement = null; + if (dataRouterState) { + error = errors && match.route.id ? errors[match.route.id] : void 0; + errorElement = match.route.errorElement || defaultErrorElement; + if (renderFallback) { + if (fallbackIndex < 0 && index === 0) { + warningOnce( + "route-fallback", + false, + "No `HydrateFallback` element provided to render during initial hydration" + ); + shouldRenderHydrateFallback = true; + hydrateFallbackElement = null; + } else if (fallbackIndex === index) { + shouldRenderHydrateFallback = true; + hydrateFallbackElement = match.route.hydrateFallbackElement || null; + } + } + } + let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1)); + let getChildren = () => { + let children; + if (error) { + children = errorElement; + } else if (shouldRenderHydrateFallback) { + children = hydrateFallbackElement; + } else if (match.route.Component) { + children = /* @__PURE__ */ React2.createElement(match.route.Component, null); + } else if (match.route.element) { + children = match.route.element; + } else { + children = outlet; + } + return /* @__PURE__ */ React2.createElement( + RenderedRoute, + { + match, + routeContext: { + outlet, + matches: matches2, + isDataRoute: dataRouterState != null + }, + children + } + ); + }; + return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /* @__PURE__ */ React2.createElement( + RenderErrorBoundary, + { + location: dataRouterState.location, + revalidation: dataRouterState.revalidation, + component: errorElement, + error, + children: getChildren(), + routeContext: { outlet: null, matches: matches2, isDataRoute: true }, + onError + } + ) : getChildren(); + }, + null + ); +} +function getDataRouterConsoleError(hookName) { + return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`; +} +function useDataRouterContext(hookName) { + let ctx = React2.useContext(DataRouterContext); + invariant(ctx, getDataRouterConsoleError(hookName)); + return ctx; +} +function useDataRouterState(hookName) { + let state = React2.useContext(DataRouterStateContext); + invariant(state, getDataRouterConsoleError(hookName)); + return state; +} +function useRouteContext(hookName) { + let route = React2.useContext(RouteContext); + invariant(route, getDataRouterConsoleError(hookName)); + return route; +} +function useCurrentRouteId(hookName) { + let route = useRouteContext(hookName); + let thisRoute = route.matches[route.matches.length - 1]; + invariant( + thisRoute.route.id, + `${hookName} can only be used on routes that contain a unique "id"` + ); + return thisRoute.route.id; +} +function useRouteId() { + return useCurrentRouteId("useRouteId" /* UseRouteId */); +} +function useNavigation() { + let state = useDataRouterState("useNavigation" /* UseNavigation */); + return state.navigation; +} +function useRevalidator() { + let dataRouterContext = useDataRouterContext("useRevalidator" /* UseRevalidator */); + let state = useDataRouterState("useRevalidator" /* UseRevalidator */); + let revalidate = React2.useCallback(async () => { + await dataRouterContext.router.revalidate(); + }, [dataRouterContext.router]); + return React2.useMemo( + () => ({ revalidate, state: state.revalidation }), + [revalidate, state.revalidation] + ); +} +function useMatches() { + let { matches, loaderData } = useDataRouterState( + "useMatches" /* UseMatches */ + ); + return React2.useMemo( + () => matches.map((m) => convertRouteMatchToUiMatch(m, loaderData)), + [matches, loaderData] + ); +} +function useLoaderData() { + let state = useDataRouterState("useLoaderData" /* UseLoaderData */); + let routeId = useCurrentRouteId("useLoaderData" /* UseLoaderData */); + return state.loaderData[routeId]; +} +function useRouteLoaderData(routeId) { + let state = useDataRouterState("useRouteLoaderData" /* UseRouteLoaderData */); + return state.loaderData[routeId]; +} +function useActionData() { + let state = useDataRouterState("useActionData" /* UseActionData */); + let routeId = useCurrentRouteId("useLoaderData" /* UseLoaderData */); + return state.actionData ? state.actionData[routeId] : void 0; +} +function useRouteError() { + let error = React2.useContext(RouteErrorContext); + let state = useDataRouterState("useRouteError" /* UseRouteError */); + let routeId = useCurrentRouteId("useRouteError" /* UseRouteError */); + if (error !== void 0) { + return error; + } + return state.errors?.[routeId]; +} +function useAsyncValue() { + let value = React2.useContext(AwaitContext); + return value?._data; +} +function useAsyncError() { + let value = React2.useContext(AwaitContext); + return value?._error; +} +var blockerId = 0; +function useBlocker(shouldBlock) { + let { router, basename } = useDataRouterContext("useBlocker" /* UseBlocker */); + let state = useDataRouterState("useBlocker" /* UseBlocker */); + let [blockerKey, setBlockerKey] = React2.useState(""); + let blockerFunction = React2.useCallback( + (arg) => { + if (typeof shouldBlock !== "function") { + return !!shouldBlock; + } + if (basename === "/") { + return shouldBlock(arg); + } + let { currentLocation, nextLocation, historyAction } = arg; + return shouldBlock({ + currentLocation: { + ...currentLocation, + pathname: stripBasename(currentLocation.pathname, basename) || currentLocation.pathname + }, + nextLocation: { + ...nextLocation, + pathname: stripBasename(nextLocation.pathname, basename) || nextLocation.pathname + }, + historyAction + }); + }, + [basename, shouldBlock] + ); + React2.useEffect(() => { + let key = String(++blockerId); + setBlockerKey(key); + return () => router.deleteBlocker(key); + }, [router]); + React2.useEffect(() => { + if (blockerKey !== "") { + router.getBlocker(blockerKey, blockerFunction); + } + }, [router, blockerKey, blockerFunction]); + return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : IDLE_BLOCKER; +} +function useNavigateStable() { + let { router } = useDataRouterContext("useNavigate" /* UseNavigateStable */); + let id = useCurrentRouteId("useNavigate" /* UseNavigateStable */); + let activeRef = React2.useRef(false); + useIsomorphicLayoutEffect(() => { + activeRef.current = true; + }); + let navigate = React2.useCallback( + async (to, options = {}) => { + warning(activeRef.current, navigateEffectWarning); + if (!activeRef.current) return; + if (typeof to === "number") { + await router.navigate(to); + } else { + await router.navigate(to, { fromRouteId: id, ...options }); + } + }, + [router, id] + ); + return navigate; +} +var alreadyWarned = {}; +function warningOnce(key, cond, message) { + if (!cond && !alreadyWarned[key]) { + alreadyWarned[key] = true; + warning(false, message); + } +} +function useRoute(...args) { + const currentRouteId = useCurrentRouteId( + "useRoute" /* UseRoute */ + ); + const id = args[0] ?? currentRouteId; + const state = useDataRouterState("useRoute" /* UseRoute */); + const route = state.matches.find(({ route: route2 }) => route2.id === id); + if (route === void 0) return void 0; + return { + handle: route.route.handle, + loaderData: state.loaderData[id], + actionData: state.actionData?.[id] + }; +} + +// lib/components.tsx +import * as React3 from "react"; + +// lib/server-runtime/warnings.ts +var alreadyWarned2 = {}; +function warnOnce(condition, message) { + if (!condition && !alreadyWarned2[message]) { + alreadyWarned2[message] = true; + console.warn(message); + } +} + +// lib/components.tsx +var USE_OPTIMISTIC = "useOptimistic"; +var useOptimisticImpl = React3[USE_OPTIMISTIC]; +var stableUseOptimisticSetter = () => void 0; +function useOptimisticSafe(val) { + if (useOptimisticImpl) { + return useOptimisticImpl(val); + } else { + return [val, stableUseOptimisticSetter]; + } +} +function mapRouteProperties(route) { + let updates = { + // Note: this check also occurs in createRoutesFromChildren so update + // there if you change this -- please and thank you! + hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null + }; + if (route.Component) { + if (ENABLE_DEV_WARNINGS) { + if (route.element) { + warning( + false, + "You should not include both `Component` and `element` on your route - `Component` will be used." + ); + } + } + Object.assign(updates, { + element: React3.createElement(route.Component), + Component: void 0 + }); + } + if (route.HydrateFallback) { + if (ENABLE_DEV_WARNINGS) { + if (route.hydrateFallbackElement) { + warning( + false, + "You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used." + ); + } + } + Object.assign(updates, { + hydrateFallbackElement: React3.createElement(route.HydrateFallback), + HydrateFallback: void 0 + }); + } + if (route.ErrorBoundary) { + if (ENABLE_DEV_WARNINGS) { + if (route.errorElement) { + warning( + false, + "You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used." + ); + } + } + Object.assign(updates, { + errorElement: React3.createElement(route.ErrorBoundary), + ErrorBoundary: void 0 + }); + } + return updates; +} +var hydrationRouteProperties = [ + "HydrateFallback", + "hydrateFallbackElement" +]; +function createMemoryRouter(routes, opts) { + return createRouter({ + basename: opts?.basename, + getContext: opts?.getContext, + future: opts?.future, + history: createMemoryHistory({ + initialEntries: opts?.initialEntries, + initialIndex: opts?.initialIndex + }), + hydrationData: opts?.hydrationData, + routes, + hydrationRouteProperties, + mapRouteProperties, + dataStrategy: opts?.dataStrategy, + patchRoutesOnNavigation: opts?.patchRoutesOnNavigation, + unstable_instrumentations: opts?.unstable_instrumentations + }).initialize(); +} +var Deferred = class { + constructor() { + this.status = "pending"; + this.promise = new Promise((resolve, reject) => { + this.resolve = (value) => { + if (this.status === "pending") { + this.status = "resolved"; + resolve(value); + } + }; + this.reject = (reason) => { + if (this.status === "pending") { + this.status = "rejected"; + reject(reason); + } + }; + }); + } +}; +function RouterProvider({ + router, + flushSync: reactDomFlushSyncImpl, + onError, + unstable_useTransitions +}) { + let unstable_rsc = useIsRSCRouterContext(); + unstable_useTransitions = unstable_rsc || unstable_useTransitions; + let [_state, setStateImpl] = React3.useState(router.state); + let [state, setOptimisticState] = useOptimisticSafe(_state); + let [pendingState, setPendingState] = React3.useState(); + let [vtContext, setVtContext] = React3.useState({ + isTransitioning: false + }); + let [renderDfd, setRenderDfd] = React3.useState(); + let [transition, setTransition] = React3.useState(); + let [interruption, setInterruption] = React3.useState(); + let fetcherData = React3.useRef(/* @__PURE__ */ new Map()); + let setState = React3.useCallback( + (newState, { deletedFetchers, newErrors, flushSync, viewTransitionOpts }) => { + if (newErrors && onError) { + Object.values(newErrors).forEach( + (error) => onError(error, { + location: newState.location, + params: newState.matches[0]?.params ?? {}, + unstable_pattern: getRoutePattern(newState.matches) + }) + ); + } + newState.fetchers.forEach((fetcher, key) => { + if (fetcher.data !== void 0) { + fetcherData.current.set(key, fetcher.data); + } + }); + deletedFetchers.forEach((key) => fetcherData.current.delete(key)); + warnOnce( + flushSync === false || reactDomFlushSyncImpl != null, + 'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.' + ); + let isViewTransitionAvailable = router.window != null && router.window.document != null && typeof router.window.document.startViewTransition === "function"; + warnOnce( + viewTransitionOpts == null || isViewTransitionAvailable, + "You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available." + ); + if (!viewTransitionOpts || !isViewTransitionAvailable) { + if (reactDomFlushSyncImpl && flushSync) { + reactDomFlushSyncImpl(() => setStateImpl(newState)); + } else if (unstable_useTransitions === false) { + setStateImpl(newState); + } else { + React3.startTransition(() => { + if (unstable_useTransitions === true) { + setOptimisticState((s) => getOptimisticRouterState(s, newState)); + } + setStateImpl(newState); + }); + } + return; + } + if (reactDomFlushSyncImpl && flushSync) { + reactDomFlushSyncImpl(() => { + if (transition) { + renderDfd?.resolve(); + transition.skipTransition(); + } + setVtContext({ + isTransitioning: true, + flushSync: true, + currentLocation: viewTransitionOpts.currentLocation, + nextLocation: viewTransitionOpts.nextLocation + }); + }); + let t = router.window.document.startViewTransition(() => { + reactDomFlushSyncImpl(() => setStateImpl(newState)); + }); + t.finished.finally(() => { + reactDomFlushSyncImpl(() => { + setRenderDfd(void 0); + setTransition(void 0); + setPendingState(void 0); + setVtContext({ isTransitioning: false }); + }); + }); + reactDomFlushSyncImpl(() => setTransition(t)); + return; + } + if (transition) { + renderDfd?.resolve(); + transition.skipTransition(); + setInterruption({ + state: newState, + currentLocation: viewTransitionOpts.currentLocation, + nextLocation: viewTransitionOpts.nextLocation + }); + } else { + setPendingState(newState); + setVtContext({ + isTransitioning: true, + flushSync: false, + currentLocation: viewTransitionOpts.currentLocation, + nextLocation: viewTransitionOpts.nextLocation + }); + } + }, + [ + router.window, + reactDomFlushSyncImpl, + transition, + renderDfd, + unstable_useTransitions, + setOptimisticState, + onError + ] + ); + React3.useLayoutEffect(() => router.subscribe(setState), [router, setState]); + React3.useEffect(() => { + if (vtContext.isTransitioning && !vtContext.flushSync) { + setRenderDfd(new Deferred()); + } + }, [vtContext]); + React3.useEffect(() => { + if (renderDfd && pendingState && router.window) { + let newState = pendingState; + let renderPromise = renderDfd.promise; + let transition2 = router.window.document.startViewTransition(async () => { + if (unstable_useTransitions === false) { + setStateImpl(newState); + } else { + React3.startTransition(() => { + if (unstable_useTransitions === true) { + setOptimisticState((s) => getOptimisticRouterState(s, newState)); + } + setStateImpl(newState); + }); + } + await renderPromise; + }); + transition2.finished.finally(() => { + setRenderDfd(void 0); + setTransition(void 0); + setPendingState(void 0); + setVtContext({ isTransitioning: false }); + }); + setTransition(transition2); + } + }, [ + pendingState, + renderDfd, + router.window, + unstable_useTransitions, + setOptimisticState + ]); + React3.useEffect(() => { + if (renderDfd && pendingState && state.location.key === pendingState.location.key) { + renderDfd.resolve(); + } + }, [renderDfd, transition, state.location, pendingState]); + React3.useEffect(() => { + if (!vtContext.isTransitioning && interruption) { + setPendingState(interruption.state); + setVtContext({ + isTransitioning: true, + flushSync: false, + currentLocation: interruption.currentLocation, + nextLocation: interruption.nextLocation + }); + setInterruption(void 0); + } + }, [vtContext.isTransitioning, interruption]); + let navigator = React3.useMemo(() => { + return { + createHref: router.createHref, + encodeLocation: router.encodeLocation, + go: (n) => router.navigate(n), + push: (to, state2, opts) => router.navigate(to, { + state: state2, + preventScrollReset: opts?.preventScrollReset + }), + replace: (to, state2, opts) => router.navigate(to, { + replace: true, + state: state2, + preventScrollReset: opts?.preventScrollReset + }) + }; + }, [router]); + let basename = router.basename || "/"; + let dataRouterContext = React3.useMemo( + () => ({ + router, + navigator, + static: false, + basename, + onError + }), + [router, navigator, basename, onError] + ); + return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React3.createElement(DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React3.createElement(FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React3.createElement(ViewTransitionContext.Provider, { value: vtContext }, /* @__PURE__ */ React3.createElement( + Router, + { + basename, + location: state.location, + navigationType: state.historyAction, + navigator, + unstable_useTransitions + }, + /* @__PURE__ */ React3.createElement( + MemoizedDataRoutes, + { + routes: router.routes, + future: router.future, + state, + onError + } + ) + ))))), null); +} +function getOptimisticRouterState(currentState, newState) { + return { + // Don't surface "current location specific" stuff mid-navigation + // (historyAction, location, matches, loaderData, errors, initialized, + // restoreScroll, preventScrollReset, blockers, etc.) + ...currentState, + // Only surface "pending/in-flight stuff" + // (navigation, revalidation, actionData, fetchers, ) + navigation: newState.navigation.state !== "idle" ? newState.navigation : currentState.navigation, + revalidation: newState.revalidation !== "idle" ? newState.revalidation : currentState.revalidation, + actionData: newState.navigation.state !== "submitting" ? newState.actionData : currentState.actionData, + fetchers: newState.fetchers + }; +} +var MemoizedDataRoutes = React3.memo(DataRoutes); +function DataRoutes({ + routes, + future, + state, + onError +}) { + return useRoutesImpl(routes, void 0, state, onError, future); +} +function MemoryRouter({ + basename, + children, + initialEntries, + initialIndex, + unstable_useTransitions +}) { + let historyRef = React3.useRef(); + if (historyRef.current == null) { + historyRef.current = createMemoryHistory({ + initialEntries, + initialIndex, + v5Compat: true + }); + } + let history = historyRef.current; + let [state, setStateImpl] = React3.useState({ + action: history.action, + location: history.location + }); + let setState = React3.useCallback( + (newState) => { + if (unstable_useTransitions === false) { + setStateImpl(newState); + } else { + React3.startTransition(() => setStateImpl(newState)); + } + }, + [unstable_useTransitions] + ); + React3.useLayoutEffect(() => history.listen(setState), [history, setState]); + return /* @__PURE__ */ React3.createElement( + Router, + { + basename, + children, + location: state.location, + navigationType: state.action, + navigator: history, + unstable_useTransitions + } + ); +} +function Navigate({ + to, + replace: replace2, + state, + relative +}) { + invariant( + useInRouterContext(), + // TODO: This error is probably because they somehow have 2 versions of + // the router loaded. We can help them understand how to avoid that. + ` may be used only in the context of a component.` + ); + let { static: isStatic } = React3.useContext(NavigationContext); + warning( + !isStatic, + ` must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.` + ); + let { matches } = React3.useContext(RouteContext); + let { pathname: locationPathname } = useLocation(); + let navigate = useNavigate(); + let path = resolveTo( + to, + getResolveToMatches(matches), + locationPathname, + relative === "path" + ); + let jsonPath = JSON.stringify(path); + React3.useEffect(() => { + navigate(JSON.parse(jsonPath), { replace: replace2, state, relative }); + }, [navigate, jsonPath, relative, replace2, state]); + return null; +} +function Outlet(props) { + return useOutlet(props.context); +} +function Route(props) { + invariant( + false, + `A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .` + ); +} +function Router({ + basename: basenameProp = "/", + children = null, + location: locationProp, + navigationType = "POP" /* Pop */, + navigator, + static: staticProp = false, + unstable_useTransitions +}) { + invariant( + !useInRouterContext(), + `You cannot render a inside another . You should never have more than one in your app.` + ); + let basename = basenameProp.replace(/^\/*/, "/"); + let navigationContext = React3.useMemo( + () => ({ + basename, + navigator, + static: staticProp, + unstable_useTransitions, + future: {} + }), + [basename, navigator, staticProp, unstable_useTransitions] + ); + if (typeof locationProp === "string") { + locationProp = parsePath(locationProp); + } + let { + pathname = "/", + search = "", + hash = "", + state = null, + key = "default" + } = locationProp; + let locationContext = React3.useMemo(() => { + let trailingPathname = stripBasename(pathname, basename); + if (trailingPathname == null) { + return null; + } + return { + location: { + pathname: trailingPathname, + search, + hash, + state, + key + }, + navigationType + }; + }, [basename, pathname, search, hash, state, key, navigationType]); + warning( + locationContext != null, + ` is not able to match the URL "${pathname}${search}${hash}" because it does not start with the basename, so the won't render anything.` + ); + if (locationContext == null) { + return null; + } + return /* @__PURE__ */ React3.createElement(NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ React3.createElement(LocationContext.Provider, { children, value: locationContext })); +} +function Routes({ + children, + location +}) { + return useRoutes(createRoutesFromChildren(children), location); +} +function Await({ + children, + errorElement, + resolve +}) { + let dataRouterContext = React3.useContext(DataRouterContext); + let dataRouterStateContext = React3.useContext(DataRouterStateContext); + let onError = React3.useCallback( + (error, errorInfo) => { + if (dataRouterContext && dataRouterContext.onError && dataRouterStateContext) { + dataRouterContext.onError(error, { + location: dataRouterStateContext.location, + params: dataRouterStateContext.matches[0]?.params || {}, + unstable_pattern: getRoutePattern(dataRouterStateContext.matches), + errorInfo + }); + } + }, + [dataRouterContext, dataRouterStateContext] + ); + return /* @__PURE__ */ React3.createElement( + AwaitErrorBoundary, + { + resolve, + errorElement, + onError + }, + /* @__PURE__ */ React3.createElement(ResolveAwait, null, children) + ); +} +var AwaitErrorBoundary = class extends React3.Component { + constructor(props) { + super(props); + this.state = { error: null }; + } + static getDerivedStateFromError(error) { + return { error }; + } + componentDidCatch(error, errorInfo) { + if (this.props.onError) { + this.props.onError(error, errorInfo); + } else { + console.error( + " caught the following error during render", + error, + errorInfo + ); + } + } + render() { + let { children, errorElement, resolve } = this.props; + let promise = null; + let status = 0 /* pending */; + if (!(resolve instanceof Promise)) { + status = 1 /* success */; + promise = Promise.resolve(); + Object.defineProperty(promise, "_tracked", { get: () => true }); + Object.defineProperty(promise, "_data", { get: () => resolve }); + } else if (this.state.error) { + status = 2 /* error */; + let renderError = this.state.error; + promise = Promise.reject().catch(() => { + }); + Object.defineProperty(promise, "_tracked", { get: () => true }); + Object.defineProperty(promise, "_error", { get: () => renderError }); + } else if (resolve._tracked) { + promise = resolve; + status = "_error" in promise ? 2 /* error */ : "_data" in promise ? 1 /* success */ : 0 /* pending */; + } else { + status = 0 /* pending */; + Object.defineProperty(resolve, "_tracked", { get: () => true }); + promise = resolve.then( + (data2) => Object.defineProperty(resolve, "_data", { get: () => data2 }), + (error) => { + this.props.onError?.(error); + Object.defineProperty(resolve, "_error", { get: () => error }); + } + ); + } + if (status === 2 /* error */ && !errorElement) { + throw promise._error; + } + if (status === 2 /* error */) { + return /* @__PURE__ */ React3.createElement(AwaitContext.Provider, { value: promise, children: errorElement }); + } + if (status === 1 /* success */) { + return /* @__PURE__ */ React3.createElement(AwaitContext.Provider, { value: promise, children }); + } + throw promise; + } +}; +function ResolveAwait({ + children +}) { + let data2 = useAsyncValue(); + let toRender = typeof children === "function" ? children(data2) : children; + return /* @__PURE__ */ React3.createElement(React3.Fragment, null, toRender); +} +function createRoutesFromChildren(children, parentPath = []) { + let routes = []; + React3.Children.forEach(children, (element, index) => { + if (!React3.isValidElement(element)) { + return; + } + let treePath = [...parentPath, index]; + if (element.type === React3.Fragment) { + routes.push.apply( + routes, + createRoutesFromChildren(element.props.children, treePath) + ); + return; + } + invariant( + element.type === Route, + `[${typeof element.type === "string" ? element.type : element.type.name}] is not a component. All component children of must be a or ` + ); + invariant( + !element.props.index || !element.props.children, + "An index route cannot have child routes." + ); + let route = { + id: element.props.id || treePath.join("-"), + caseSensitive: element.props.caseSensitive, + element: element.props.element, + Component: element.props.Component, + index: element.props.index, + path: element.props.path, + middleware: element.props.middleware, + loader: element.props.loader, + action: element.props.action, + hydrateFallbackElement: element.props.hydrateFallbackElement, + HydrateFallback: element.props.HydrateFallback, + errorElement: element.props.errorElement, + ErrorBoundary: element.props.ErrorBoundary, + hasErrorBoundary: element.props.hasErrorBoundary === true || element.props.ErrorBoundary != null || element.props.errorElement != null, + shouldRevalidate: element.props.shouldRevalidate, + handle: element.props.handle, + lazy: element.props.lazy + }; + if (element.props.children) { + route.children = createRoutesFromChildren( + element.props.children, + treePath + ); + } + routes.push(route); + }); + return routes; +} +var createRoutesFromElements = createRoutesFromChildren; +function renderMatches(matches) { + return _renderMatches(matches); +} +function useRouteComponentProps() { + return { + params: useParams(), + loaderData: useLoaderData(), + actionData: useActionData(), + matches: useMatches() + }; +} +function WithComponentProps({ + children +}) { + const props = useRouteComponentProps(); + return React3.cloneElement(children, props); +} +function withComponentProps(Component4) { + return function WithComponentProps2() { + const props = useRouteComponentProps(); + return React3.createElement(Component4, props); + }; +} +function useHydrateFallbackProps() { + return { + params: useParams(), + loaderData: useLoaderData(), + actionData: useActionData() + }; +} +function WithHydrateFallbackProps({ + children +}) { + const props = useHydrateFallbackProps(); + return React3.cloneElement(children, props); +} +function withHydrateFallbackProps(HydrateFallback) { + return function WithHydrateFallbackProps2() { + const props = useHydrateFallbackProps(); + return React3.createElement(HydrateFallback, props); + }; +} +function useErrorBoundaryProps() { + return { + params: useParams(), + loaderData: useLoaderData(), + actionData: useActionData(), + error: useRouteError() + }; +} +function WithErrorBoundaryProps({ + children +}) { + const props = useErrorBoundaryProps(); + return React3.cloneElement(children, props); +} +function withErrorBoundaryProps(ErrorBoundary) { + return function WithErrorBoundaryProps2() { + const props = useErrorBoundaryProps(); + return React3.createElement(ErrorBoundary, props); + }; +} + +// lib/dom/dom.ts +var defaultMethod = "get"; +var defaultEncType = "application/x-www-form-urlencoded"; +function isHtmlElement(object) { + return typeof HTMLElement !== "undefined" && object instanceof HTMLElement; +} +function isButtonElement(object) { + return isHtmlElement(object) && object.tagName.toLowerCase() === "button"; +} +function isFormElement(object) { + return isHtmlElement(object) && object.tagName.toLowerCase() === "form"; +} +function isInputElement(object) { + return isHtmlElement(object) && object.tagName.toLowerCase() === "input"; +} +function isModifiedEvent(event) { + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); +} +function shouldProcessLinkClick(event, target) { + return event.button === 0 && // Ignore everything but left clicks + (!target || target === "_self") && // Let browser handle "target=_blank" etc. + !isModifiedEvent(event); +} +function createSearchParams(init = "") { + return new URLSearchParams( + typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo2, key) => { + let value = init[key]; + return memo2.concat( + Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]] + ); + }, []) + ); +} +function getSearchParamsForLocation(locationSearch, defaultSearchParams) { + let searchParams = createSearchParams(locationSearch); + if (defaultSearchParams) { + defaultSearchParams.forEach((_, key) => { + if (!searchParams.has(key)) { + defaultSearchParams.getAll(key).forEach((value) => { + searchParams.append(key, value); + }); + } + }); + } + return searchParams; +} +var _formDataSupportsSubmitter = null; +function isFormDataSubmitterSupported() { + if (_formDataSupportsSubmitter === null) { + try { + new FormData( + document.createElement("form"), + // @ts-expect-error if FormData supports the submitter parameter, this will throw + 0 + ); + _formDataSupportsSubmitter = false; + } catch (e) { + _formDataSupportsSubmitter = true; + } + } + return _formDataSupportsSubmitter; +} +var supportedFormEncTypes = /* @__PURE__ */ new Set([ + "application/x-www-form-urlencoded", + "multipart/form-data", + "text/plain" +]); +function getFormEncType(encType) { + if (encType != null && !supportedFormEncTypes.has(encType)) { + warning( + false, + `"${encType}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${defaultEncType}"` + ); + return null; + } + return encType; +} +function getFormSubmissionInfo(target, basename) { + let method; + let action; + let encType; + let formData; + let body; + if (isFormElement(target)) { + let attr = target.getAttribute("action"); + action = attr ? stripBasename(attr, basename) : null; + method = target.getAttribute("method") || defaultMethod; + encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType; + formData = new FormData(target); + } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) { + let form = target.form; + if (form == null) { + throw new Error( + `Cannot submit a ' + + ''; + return ( + "
" + aside + + '
' + + '
' + + '
' + + '
' + ); + } + + /** + * Cover Page + * @returns {String} Cover page + */ + function cover() { + var SL = ', 100%, 85%'; + var bgc = + 'linear-gradient(to left bottom, ' + + "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 0%," + + "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 100%)"; + + return ( + "
" + + '
' + + '
' + + '
' + ); + } + + /** + * Render tree + * @param {Array} toc Array of TOC section links + * @param {String} tpl TPL list + * @return {String} Rendered tree + */ + function tree(toc, tpl) { + if ( tpl === void 0 ) tpl = '
    {inner}
'; + + if (!toc || !toc.length) { + return ''; + } + + var innerHTML = ''; + toc.forEach(function (node) { + var title = node.title.replace(/(<([^>]+)>)/g, ''); + innerHTML += "
  • " + (node.title) + "
  • "; + if (node.children) { + innerHTML += tree(node.children, tpl); + } + }); + return tpl.replace('{inner}', innerHTML); + } + + function helper(className, content) { + return ("

    " + (content.slice(5).trim()) + "

    "); + } + + function theme(color) { + return (""); + } + + /** + * Gen toc tree + * @link https://github.com/killercup/grock/blob/5280ae63e16c5739e9233d9009bc235ed7d79a50/styles/solarized/assets/js/behavior.coffee#L54-L81 + * @param {Array} toc List of TOC elements + * @param {Number} maxLevel Deep level + * @return {Array} Headlines + */ + function genTree(toc, maxLevel) { + var headlines = []; + var last = {}; + + toc.forEach(function (headline) { + var level = headline.level || 1; + var len = level - 1; + + if (level > maxLevel) { + return; + } + + if (last[len]) { + last[len].children = (last[len].children || []).concat(headline); + } else { + headlines.push(headline); + } + + last[level] = headline; + }); + + return headlines; + } + + var cache$1 = {}; + var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g; + + function lower(string) { + return string.toLowerCase(); + } + + function slugify(str) { + if (typeof str !== 'string') { + return ''; + } + + var slug = str + .trim() + .replace(/[A-Z]+/g, lower) + .replace(/<[^>]+>/g, '') + .replace(re, '') + .replace(/\s/g, '-') + .replace(/-+/g, '-') + .replace(/^(\d)/, '_$1'); + var count = cache$1[slug]; + + count = hasOwn.call(cache$1, slug) ? count + 1 : 0; + cache$1[slug] = count; + + if (count) { + slug = slug + '-' + count; + } + + return slug; + } + + slugify.clear = function () { + cache$1 = {}; + }; + + /* eslint-disable */ + + // ============================================================================= + // DO NOT EDIT: This file is auto-generated by an /build/emoji.js + // ============================================================================= + + var emojiData = { + "baseURL": "https://github.githubassets.com/images/icons/emoji/", + "data": { + "100": "unicode/1f4af.png?v8", + "1234": "unicode/1f522.png?v8", + "+1": "unicode/1f44d.png?v8", + "-1": "unicode/1f44e.png?v8", + "1st_place_medal": "unicode/1f947.png?v8", + "2nd_place_medal": "unicode/1f948.png?v8", + "3rd_place_medal": "unicode/1f949.png?v8", + "8ball": "unicode/1f3b1.png?v8", + "a": "unicode/1f170.png?v8", + "ab": "unicode/1f18e.png?v8", + "abacus": "unicode/1f9ee.png?v8", + "abc": "unicode/1f524.png?v8", + "abcd": "unicode/1f521.png?v8", + "accept": "unicode/1f251.png?v8", + "accessibility": "accessibility.png?v8", + "accordion": "unicode/1fa97.png?v8", + "adhesive_bandage": "unicode/1fa79.png?v8", + "adult": "unicode/1f9d1.png?v8", + "aerial_tramway": "unicode/1f6a1.png?v8", + "afghanistan": "unicode/1f1e6-1f1eb.png?v8", + "airplane": "unicode/2708.png?v8", + "aland_islands": "unicode/1f1e6-1f1fd.png?v8", + "alarm_clock": "unicode/23f0.png?v8", + "albania": "unicode/1f1e6-1f1f1.png?v8", + "alembic": "unicode/2697.png?v8", + "algeria": "unicode/1f1e9-1f1ff.png?v8", + "alien": "unicode/1f47d.png?v8", + "ambulance": "unicode/1f691.png?v8", + "american_samoa": "unicode/1f1e6-1f1f8.png?v8", + "amphora": "unicode/1f3fa.png?v8", + "anatomical_heart": "unicode/1fac0.png?v8", + "anchor": "unicode/2693.png?v8", + "andorra": "unicode/1f1e6-1f1e9.png?v8", + "angel": "unicode/1f47c.png?v8", + "anger": "unicode/1f4a2.png?v8", + "angola": "unicode/1f1e6-1f1f4.png?v8", + "angry": "unicode/1f620.png?v8", + "anguilla": "unicode/1f1e6-1f1ee.png?v8", + "anguished": "unicode/1f627.png?v8", + "ant": "unicode/1f41c.png?v8", + "antarctica": "unicode/1f1e6-1f1f6.png?v8", + "antigua_barbuda": "unicode/1f1e6-1f1ec.png?v8", + "apple": "unicode/1f34e.png?v8", + "aquarius": "unicode/2652.png?v8", + "argentina": "unicode/1f1e6-1f1f7.png?v8", + "aries": "unicode/2648.png?v8", + "armenia": "unicode/1f1e6-1f1f2.png?v8", + "arrow_backward": "unicode/25c0.png?v8", + "arrow_double_down": "unicode/23ec.png?v8", + "arrow_double_up": "unicode/23eb.png?v8", + "arrow_down": "unicode/2b07.png?v8", + "arrow_down_small": "unicode/1f53d.png?v8", + "arrow_forward": "unicode/25b6.png?v8", + "arrow_heading_down": "unicode/2935.png?v8", + "arrow_heading_up": "unicode/2934.png?v8", + "arrow_left": "unicode/2b05.png?v8", + "arrow_lower_left": "unicode/2199.png?v8", + "arrow_lower_right": "unicode/2198.png?v8", + "arrow_right": "unicode/27a1.png?v8", + "arrow_right_hook": "unicode/21aa.png?v8", + "arrow_up": "unicode/2b06.png?v8", + "arrow_up_down": "unicode/2195.png?v8", + "arrow_up_small": "unicode/1f53c.png?v8", + "arrow_upper_left": "unicode/2196.png?v8", + "arrow_upper_right": "unicode/2197.png?v8", + "arrows_clockwise": "unicode/1f503.png?v8", + "arrows_counterclockwise": "unicode/1f504.png?v8", + "art": "unicode/1f3a8.png?v8", + "articulated_lorry": "unicode/1f69b.png?v8", + "artificial_satellite": "unicode/1f6f0.png?v8", + "artist": "unicode/1f9d1-1f3a8.png?v8", + "aruba": "unicode/1f1e6-1f1fc.png?v8", + "ascension_island": "unicode/1f1e6-1f1e8.png?v8", + "asterisk": "unicode/002a-20e3.png?v8", + "astonished": "unicode/1f632.png?v8", + "astronaut": "unicode/1f9d1-1f680.png?v8", + "athletic_shoe": "unicode/1f45f.png?v8", + "atm": "unicode/1f3e7.png?v8", + "atom": "atom.png?v8", + "atom_symbol": "unicode/269b.png?v8", + "australia": "unicode/1f1e6-1f1fa.png?v8", + "austria": "unicode/1f1e6-1f1f9.png?v8", + "auto_rickshaw": "unicode/1f6fa.png?v8", + "avocado": "unicode/1f951.png?v8", + "axe": "unicode/1fa93.png?v8", + "azerbaijan": "unicode/1f1e6-1f1ff.png?v8", + "b": "unicode/1f171.png?v8", + "baby": "unicode/1f476.png?v8", + "baby_bottle": "unicode/1f37c.png?v8", + "baby_chick": "unicode/1f424.png?v8", + "baby_symbol": "unicode/1f6bc.png?v8", + "back": "unicode/1f519.png?v8", + "bacon": "unicode/1f953.png?v8", + "badger": "unicode/1f9a1.png?v8", + "badminton": "unicode/1f3f8.png?v8", + "bagel": "unicode/1f96f.png?v8", + "baggage_claim": "unicode/1f6c4.png?v8", + "baguette_bread": "unicode/1f956.png?v8", + "bahamas": "unicode/1f1e7-1f1f8.png?v8", + "bahrain": "unicode/1f1e7-1f1ed.png?v8", + "balance_scale": "unicode/2696.png?v8", + "bald_man": "unicode/1f468-1f9b2.png?v8", + "bald_woman": "unicode/1f469-1f9b2.png?v8", + "ballet_shoes": "unicode/1fa70.png?v8", + "balloon": "unicode/1f388.png?v8", + "ballot_box": "unicode/1f5f3.png?v8", + "ballot_box_with_check": "unicode/2611.png?v8", + "bamboo": "unicode/1f38d.png?v8", + "banana": "unicode/1f34c.png?v8", + "bangbang": "unicode/203c.png?v8", + "bangladesh": "unicode/1f1e7-1f1e9.png?v8", + "banjo": "unicode/1fa95.png?v8", + "bank": "unicode/1f3e6.png?v8", + "bar_chart": "unicode/1f4ca.png?v8", + "barbados": "unicode/1f1e7-1f1e7.png?v8", + "barber": "unicode/1f488.png?v8", + "baseball": "unicode/26be.png?v8", + "basecamp": "basecamp.png?v8", + "basecampy": "basecampy.png?v8", + "basket": "unicode/1f9fa.png?v8", + "basketball": "unicode/1f3c0.png?v8", + "basketball_man": "unicode/26f9-2642.png?v8", + "basketball_woman": "unicode/26f9-2640.png?v8", + "bat": "unicode/1f987.png?v8", + "bath": "unicode/1f6c0.png?v8", + "bathtub": "unicode/1f6c1.png?v8", + "battery": "unicode/1f50b.png?v8", + "beach_umbrella": "unicode/1f3d6.png?v8", + "bear": "unicode/1f43b.png?v8", + "bearded_person": "unicode/1f9d4.png?v8", + "beaver": "unicode/1f9ab.png?v8", + "bed": "unicode/1f6cf.png?v8", + "bee": "unicode/1f41d.png?v8", + "beer": "unicode/1f37a.png?v8", + "beers": "unicode/1f37b.png?v8", + "beetle": "unicode/1fab2.png?v8", + "beginner": "unicode/1f530.png?v8", + "belarus": "unicode/1f1e7-1f1fe.png?v8", + "belgium": "unicode/1f1e7-1f1ea.png?v8", + "belize": "unicode/1f1e7-1f1ff.png?v8", + "bell": "unicode/1f514.png?v8", + "bell_pepper": "unicode/1fad1.png?v8", + "bellhop_bell": "unicode/1f6ce.png?v8", + "benin": "unicode/1f1e7-1f1ef.png?v8", + "bento": "unicode/1f371.png?v8", + "bermuda": "unicode/1f1e7-1f1f2.png?v8", + "beverage_box": "unicode/1f9c3.png?v8", + "bhutan": "unicode/1f1e7-1f1f9.png?v8", + "bicyclist": "unicode/1f6b4.png?v8", + "bike": "unicode/1f6b2.png?v8", + "biking_man": "unicode/1f6b4-2642.png?v8", + "biking_woman": "unicode/1f6b4-2640.png?v8", + "bikini": "unicode/1f459.png?v8", + "billed_cap": "unicode/1f9e2.png?v8", + "biohazard": "unicode/2623.png?v8", + "bird": "unicode/1f426.png?v8", + "birthday": "unicode/1f382.png?v8", + "bison": "unicode/1f9ac.png?v8", + "black_cat": "unicode/1f408-2b1b.png?v8", + "black_circle": "unicode/26ab.png?v8", + "black_flag": "unicode/1f3f4.png?v8", + "black_heart": "unicode/1f5a4.png?v8", + "black_joker": "unicode/1f0cf.png?v8", + "black_large_square": "unicode/2b1b.png?v8", + "black_medium_small_square": "unicode/25fe.png?v8", + "black_medium_square": "unicode/25fc.png?v8", + "black_nib": "unicode/2712.png?v8", + "black_small_square": "unicode/25aa.png?v8", + "black_square_button": "unicode/1f532.png?v8", + "blond_haired_man": "unicode/1f471-2642.png?v8", + "blond_haired_person": "unicode/1f471.png?v8", + "blond_haired_woman": "unicode/1f471-2640.png?v8", + "blonde_woman": "unicode/1f471-2640.png?v8", + "blossom": "unicode/1f33c.png?v8", + "blowfish": "unicode/1f421.png?v8", + "blue_book": "unicode/1f4d8.png?v8", + "blue_car": "unicode/1f699.png?v8", + "blue_heart": "unicode/1f499.png?v8", + "blue_square": "unicode/1f7e6.png?v8", + "blueberries": "unicode/1fad0.png?v8", + "blush": "unicode/1f60a.png?v8", + "boar": "unicode/1f417.png?v8", + "boat": "unicode/26f5.png?v8", + "bolivia": "unicode/1f1e7-1f1f4.png?v8", + "bomb": "unicode/1f4a3.png?v8", + "bone": "unicode/1f9b4.png?v8", + "book": "unicode/1f4d6.png?v8", + "bookmark": "unicode/1f516.png?v8", + "bookmark_tabs": "unicode/1f4d1.png?v8", + "books": "unicode/1f4da.png?v8", + "boom": "unicode/1f4a5.png?v8", + "boomerang": "unicode/1fa83.png?v8", + "boot": "unicode/1f462.png?v8", + "bosnia_herzegovina": "unicode/1f1e7-1f1e6.png?v8", + "botswana": "unicode/1f1e7-1f1fc.png?v8", + "bouncing_ball_man": "unicode/26f9-2642.png?v8", + "bouncing_ball_person": "unicode/26f9.png?v8", + "bouncing_ball_woman": "unicode/26f9-2640.png?v8", + "bouquet": "unicode/1f490.png?v8", + "bouvet_island": "unicode/1f1e7-1f1fb.png?v8", + "bow": "unicode/1f647.png?v8", + "bow_and_arrow": "unicode/1f3f9.png?v8", + "bowing_man": "unicode/1f647-2642.png?v8", + "bowing_woman": "unicode/1f647-2640.png?v8", + "bowl_with_spoon": "unicode/1f963.png?v8", + "bowling": "unicode/1f3b3.png?v8", + "bowtie": "bowtie.png?v8", + "boxing_glove": "unicode/1f94a.png?v8", + "boy": "unicode/1f466.png?v8", + "brain": "unicode/1f9e0.png?v8", + "brazil": "unicode/1f1e7-1f1f7.png?v8", + "bread": "unicode/1f35e.png?v8", + "breast_feeding": "unicode/1f931.png?v8", + "bricks": "unicode/1f9f1.png?v8", + "bride_with_veil": "unicode/1f470-2640.png?v8", + "bridge_at_night": "unicode/1f309.png?v8", + "briefcase": "unicode/1f4bc.png?v8", + "british_indian_ocean_territory": "unicode/1f1ee-1f1f4.png?v8", + "british_virgin_islands": "unicode/1f1fb-1f1ec.png?v8", + "broccoli": "unicode/1f966.png?v8", + "broken_heart": "unicode/1f494.png?v8", + "broom": "unicode/1f9f9.png?v8", + "brown_circle": "unicode/1f7e4.png?v8", + "brown_heart": "unicode/1f90e.png?v8", + "brown_square": "unicode/1f7eb.png?v8", + "brunei": "unicode/1f1e7-1f1f3.png?v8", + "bubble_tea": "unicode/1f9cb.png?v8", + "bucket": "unicode/1faa3.png?v8", + "bug": "unicode/1f41b.png?v8", + "building_construction": "unicode/1f3d7.png?v8", + "bulb": "unicode/1f4a1.png?v8", + "bulgaria": "unicode/1f1e7-1f1ec.png?v8", + "bullettrain_front": "unicode/1f685.png?v8", + "bullettrain_side": "unicode/1f684.png?v8", + "burkina_faso": "unicode/1f1e7-1f1eb.png?v8", + "burrito": "unicode/1f32f.png?v8", + "burundi": "unicode/1f1e7-1f1ee.png?v8", + "bus": "unicode/1f68c.png?v8", + "business_suit_levitating": "unicode/1f574.png?v8", + "busstop": "unicode/1f68f.png?v8", + "bust_in_silhouette": "unicode/1f464.png?v8", + "busts_in_silhouette": "unicode/1f465.png?v8", + "butter": "unicode/1f9c8.png?v8", + "butterfly": "unicode/1f98b.png?v8", + "cactus": "unicode/1f335.png?v8", + "cake": "unicode/1f370.png?v8", + "calendar": "unicode/1f4c6.png?v8", + "call_me_hand": "unicode/1f919.png?v8", + "calling": "unicode/1f4f2.png?v8", + "cambodia": "unicode/1f1f0-1f1ed.png?v8", + "camel": "unicode/1f42b.png?v8", + "camera": "unicode/1f4f7.png?v8", + "camera_flash": "unicode/1f4f8.png?v8", + "cameroon": "unicode/1f1e8-1f1f2.png?v8", + "camping": "unicode/1f3d5.png?v8", + "canada": "unicode/1f1e8-1f1e6.png?v8", + "canary_islands": "unicode/1f1ee-1f1e8.png?v8", + "cancer": "unicode/264b.png?v8", + "candle": "unicode/1f56f.png?v8", + "candy": "unicode/1f36c.png?v8", + "canned_food": "unicode/1f96b.png?v8", + "canoe": "unicode/1f6f6.png?v8", + "cape_verde": "unicode/1f1e8-1f1fb.png?v8", + "capital_abcd": "unicode/1f520.png?v8", + "capricorn": "unicode/2651.png?v8", + "car": "unicode/1f697.png?v8", + "card_file_box": "unicode/1f5c3.png?v8", + "card_index": "unicode/1f4c7.png?v8", + "card_index_dividers": "unicode/1f5c2.png?v8", + "caribbean_netherlands": "unicode/1f1e7-1f1f6.png?v8", + "carousel_horse": "unicode/1f3a0.png?v8", + "carpentry_saw": "unicode/1fa9a.png?v8", + "carrot": "unicode/1f955.png?v8", + "cartwheeling": "unicode/1f938.png?v8", + "cat": "unicode/1f431.png?v8", + "cat2": "unicode/1f408.png?v8", + "cayman_islands": "unicode/1f1f0-1f1fe.png?v8", + "cd": "unicode/1f4bf.png?v8", + "central_african_republic": "unicode/1f1e8-1f1eb.png?v8", + "ceuta_melilla": "unicode/1f1ea-1f1e6.png?v8", + "chad": "unicode/1f1f9-1f1e9.png?v8", + "chains": "unicode/26d3.png?v8", + "chair": "unicode/1fa91.png?v8", + "champagne": "unicode/1f37e.png?v8", + "chart": "unicode/1f4b9.png?v8", + "chart_with_downwards_trend": "unicode/1f4c9.png?v8", + "chart_with_upwards_trend": "unicode/1f4c8.png?v8", + "checkered_flag": "unicode/1f3c1.png?v8", + "cheese": "unicode/1f9c0.png?v8", + "cherries": "unicode/1f352.png?v8", + "cherry_blossom": "unicode/1f338.png?v8", + "chess_pawn": "unicode/265f.png?v8", + "chestnut": "unicode/1f330.png?v8", + "chicken": "unicode/1f414.png?v8", + "child": "unicode/1f9d2.png?v8", + "children_crossing": "unicode/1f6b8.png?v8", + "chile": "unicode/1f1e8-1f1f1.png?v8", + "chipmunk": "unicode/1f43f.png?v8", + "chocolate_bar": "unicode/1f36b.png?v8", + "chopsticks": "unicode/1f962.png?v8", + "christmas_island": "unicode/1f1e8-1f1fd.png?v8", + "christmas_tree": "unicode/1f384.png?v8", + "church": "unicode/26ea.png?v8", + "cinema": "unicode/1f3a6.png?v8", + "circus_tent": "unicode/1f3aa.png?v8", + "city_sunrise": "unicode/1f307.png?v8", + "city_sunset": "unicode/1f306.png?v8", + "cityscape": "unicode/1f3d9.png?v8", + "cl": "unicode/1f191.png?v8", + "clamp": "unicode/1f5dc.png?v8", + "clap": "unicode/1f44f.png?v8", + "clapper": "unicode/1f3ac.png?v8", + "classical_building": "unicode/1f3db.png?v8", + "climbing": "unicode/1f9d7.png?v8", + "climbing_man": "unicode/1f9d7-2642.png?v8", + "climbing_woman": "unicode/1f9d7-2640.png?v8", + "clinking_glasses": "unicode/1f942.png?v8", + "clipboard": "unicode/1f4cb.png?v8", + "clipperton_island": "unicode/1f1e8-1f1f5.png?v8", + "clock1": "unicode/1f550.png?v8", + "clock10": "unicode/1f559.png?v8", + "clock1030": "unicode/1f565.png?v8", + "clock11": "unicode/1f55a.png?v8", + "clock1130": "unicode/1f566.png?v8", + "clock12": "unicode/1f55b.png?v8", + "clock1230": "unicode/1f567.png?v8", + "clock130": "unicode/1f55c.png?v8", + "clock2": "unicode/1f551.png?v8", + "clock230": "unicode/1f55d.png?v8", + "clock3": "unicode/1f552.png?v8", + "clock330": "unicode/1f55e.png?v8", + "clock4": "unicode/1f553.png?v8", + "clock430": "unicode/1f55f.png?v8", + "clock5": "unicode/1f554.png?v8", + "clock530": "unicode/1f560.png?v8", + "clock6": "unicode/1f555.png?v8", + "clock630": "unicode/1f561.png?v8", + "clock7": "unicode/1f556.png?v8", + "clock730": "unicode/1f562.png?v8", + "clock8": "unicode/1f557.png?v8", + "clock830": "unicode/1f563.png?v8", + "clock9": "unicode/1f558.png?v8", + "clock930": "unicode/1f564.png?v8", + "closed_book": "unicode/1f4d5.png?v8", + "closed_lock_with_key": "unicode/1f510.png?v8", + "closed_umbrella": "unicode/1f302.png?v8", + "cloud": "unicode/2601.png?v8", + "cloud_with_lightning": "unicode/1f329.png?v8", + "cloud_with_lightning_and_rain": "unicode/26c8.png?v8", + "cloud_with_rain": "unicode/1f327.png?v8", + "cloud_with_snow": "unicode/1f328.png?v8", + "clown_face": "unicode/1f921.png?v8", + "clubs": "unicode/2663.png?v8", + "cn": "unicode/1f1e8-1f1f3.png?v8", + "coat": "unicode/1f9e5.png?v8", + "cockroach": "unicode/1fab3.png?v8", + "cocktail": "unicode/1f378.png?v8", + "coconut": "unicode/1f965.png?v8", + "cocos_islands": "unicode/1f1e8-1f1e8.png?v8", + "coffee": "unicode/2615.png?v8", + "coffin": "unicode/26b0.png?v8", + "coin": "unicode/1fa99.png?v8", + "cold_face": "unicode/1f976.png?v8", + "cold_sweat": "unicode/1f630.png?v8", + "collision": "unicode/1f4a5.png?v8", + "colombia": "unicode/1f1e8-1f1f4.png?v8", + "comet": "unicode/2604.png?v8", + "comoros": "unicode/1f1f0-1f1f2.png?v8", + "compass": "unicode/1f9ed.png?v8", + "computer": "unicode/1f4bb.png?v8", + "computer_mouse": "unicode/1f5b1.png?v8", + "confetti_ball": "unicode/1f38a.png?v8", + "confounded": "unicode/1f616.png?v8", + "confused": "unicode/1f615.png?v8", + "congo_brazzaville": "unicode/1f1e8-1f1ec.png?v8", + "congo_kinshasa": "unicode/1f1e8-1f1e9.png?v8", + "congratulations": "unicode/3297.png?v8", + "construction": "unicode/1f6a7.png?v8", + "construction_worker": "unicode/1f477.png?v8", + "construction_worker_man": "unicode/1f477-2642.png?v8", + "construction_worker_woman": "unicode/1f477-2640.png?v8", + "control_knobs": "unicode/1f39b.png?v8", + "convenience_store": "unicode/1f3ea.png?v8", + "cook": "unicode/1f9d1-1f373.png?v8", + "cook_islands": "unicode/1f1e8-1f1f0.png?v8", + "cookie": "unicode/1f36a.png?v8", + "cool": "unicode/1f192.png?v8", + "cop": "unicode/1f46e.png?v8", + "copyright": "unicode/00a9.png?v8", + "corn": "unicode/1f33d.png?v8", + "costa_rica": "unicode/1f1e8-1f1f7.png?v8", + "cote_divoire": "unicode/1f1e8-1f1ee.png?v8", + "couch_and_lamp": "unicode/1f6cb.png?v8", + "couple": "unicode/1f46b.png?v8", + "couple_with_heart": "unicode/1f491.png?v8", + "couple_with_heart_man_man": "unicode/1f468-2764-1f468.png?v8", + "couple_with_heart_woman_man": "unicode/1f469-2764-1f468.png?v8", + "couple_with_heart_woman_woman": "unicode/1f469-2764-1f469.png?v8", + "couplekiss": "unicode/1f48f.png?v8", + "couplekiss_man_man": "unicode/1f468-2764-1f48b-1f468.png?v8", + "couplekiss_man_woman": "unicode/1f469-2764-1f48b-1f468.png?v8", + "couplekiss_woman_woman": "unicode/1f469-2764-1f48b-1f469.png?v8", + "cow": "unicode/1f42e.png?v8", + "cow2": "unicode/1f404.png?v8", + "cowboy_hat_face": "unicode/1f920.png?v8", + "crab": "unicode/1f980.png?v8", + "crayon": "unicode/1f58d.png?v8", + "credit_card": "unicode/1f4b3.png?v8", + "crescent_moon": "unicode/1f319.png?v8", + "cricket": "unicode/1f997.png?v8", + "cricket_game": "unicode/1f3cf.png?v8", + "croatia": "unicode/1f1ed-1f1f7.png?v8", + "crocodile": "unicode/1f40a.png?v8", + "croissant": "unicode/1f950.png?v8", + "crossed_fingers": "unicode/1f91e.png?v8", + "crossed_flags": "unicode/1f38c.png?v8", + "crossed_swords": "unicode/2694.png?v8", + "crown": "unicode/1f451.png?v8", + "cry": "unicode/1f622.png?v8", + "crying_cat_face": "unicode/1f63f.png?v8", + "crystal_ball": "unicode/1f52e.png?v8", + "cuba": "unicode/1f1e8-1f1fa.png?v8", + "cucumber": "unicode/1f952.png?v8", + "cup_with_straw": "unicode/1f964.png?v8", + "cupcake": "unicode/1f9c1.png?v8", + "cupid": "unicode/1f498.png?v8", + "curacao": "unicode/1f1e8-1f1fc.png?v8", + "curling_stone": "unicode/1f94c.png?v8", + "curly_haired_man": "unicode/1f468-1f9b1.png?v8", + "curly_haired_woman": "unicode/1f469-1f9b1.png?v8", + "curly_loop": "unicode/27b0.png?v8", + "currency_exchange": "unicode/1f4b1.png?v8", + "curry": "unicode/1f35b.png?v8", + "cursing_face": "unicode/1f92c.png?v8", + "custard": "unicode/1f36e.png?v8", + "customs": "unicode/1f6c3.png?v8", + "cut_of_meat": "unicode/1f969.png?v8", + "cyclone": "unicode/1f300.png?v8", + "cyprus": "unicode/1f1e8-1f1fe.png?v8", + "czech_republic": "unicode/1f1e8-1f1ff.png?v8", + "dagger": "unicode/1f5e1.png?v8", + "dancer": "unicode/1f483.png?v8", + "dancers": "unicode/1f46f.png?v8", + "dancing_men": "unicode/1f46f-2642.png?v8", + "dancing_women": "unicode/1f46f-2640.png?v8", + "dango": "unicode/1f361.png?v8", + "dark_sunglasses": "unicode/1f576.png?v8", + "dart": "unicode/1f3af.png?v8", + "dash": "unicode/1f4a8.png?v8", + "date": "unicode/1f4c5.png?v8", + "de": "unicode/1f1e9-1f1ea.png?v8", + "deaf_man": "unicode/1f9cf-2642.png?v8", + "deaf_person": "unicode/1f9cf.png?v8", + "deaf_woman": "unicode/1f9cf-2640.png?v8", + "deciduous_tree": "unicode/1f333.png?v8", + "deer": "unicode/1f98c.png?v8", + "denmark": "unicode/1f1e9-1f1f0.png?v8", + "department_store": "unicode/1f3ec.png?v8", + "dependabot": "dependabot.png?v8", + "derelict_house": "unicode/1f3da.png?v8", + "desert": "unicode/1f3dc.png?v8", + "desert_island": "unicode/1f3dd.png?v8", + "desktop_computer": "unicode/1f5a5.png?v8", + "detective": "unicode/1f575.png?v8", + "diamond_shape_with_a_dot_inside": "unicode/1f4a0.png?v8", + "diamonds": "unicode/2666.png?v8", + "diego_garcia": "unicode/1f1e9-1f1ec.png?v8", + "disappointed": "unicode/1f61e.png?v8", + "disappointed_relieved": "unicode/1f625.png?v8", + "disguised_face": "unicode/1f978.png?v8", + "diving_mask": "unicode/1f93f.png?v8", + "diya_lamp": "unicode/1fa94.png?v8", + "dizzy": "unicode/1f4ab.png?v8", + "dizzy_face": "unicode/1f635.png?v8", + "djibouti": "unicode/1f1e9-1f1ef.png?v8", + "dna": "unicode/1f9ec.png?v8", + "do_not_litter": "unicode/1f6af.png?v8", + "dodo": "unicode/1f9a4.png?v8", + "dog": "unicode/1f436.png?v8", + "dog2": "unicode/1f415.png?v8", + "dollar": "unicode/1f4b5.png?v8", + "dolls": "unicode/1f38e.png?v8", + "dolphin": "unicode/1f42c.png?v8", + "dominica": "unicode/1f1e9-1f1f2.png?v8", + "dominican_republic": "unicode/1f1e9-1f1f4.png?v8", + "door": "unicode/1f6aa.png?v8", + "doughnut": "unicode/1f369.png?v8", + "dove": "unicode/1f54a.png?v8", + "dragon": "unicode/1f409.png?v8", + "dragon_face": "unicode/1f432.png?v8", + "dress": "unicode/1f457.png?v8", + "dromedary_camel": "unicode/1f42a.png?v8", + "drooling_face": "unicode/1f924.png?v8", + "drop_of_blood": "unicode/1fa78.png?v8", + "droplet": "unicode/1f4a7.png?v8", + "drum": "unicode/1f941.png?v8", + "duck": "unicode/1f986.png?v8", + "dumpling": "unicode/1f95f.png?v8", + "dvd": "unicode/1f4c0.png?v8", + "e-mail": "unicode/1f4e7.png?v8", + "eagle": "unicode/1f985.png?v8", + "ear": "unicode/1f442.png?v8", + "ear_of_rice": "unicode/1f33e.png?v8", + "ear_with_hearing_aid": "unicode/1f9bb.png?v8", + "earth_africa": "unicode/1f30d.png?v8", + "earth_americas": "unicode/1f30e.png?v8", + "earth_asia": "unicode/1f30f.png?v8", + "ecuador": "unicode/1f1ea-1f1e8.png?v8", + "egg": "unicode/1f95a.png?v8", + "eggplant": "unicode/1f346.png?v8", + "egypt": "unicode/1f1ea-1f1ec.png?v8", + "eight": "unicode/0038-20e3.png?v8", + "eight_pointed_black_star": "unicode/2734.png?v8", + "eight_spoked_asterisk": "unicode/2733.png?v8", + "eject_button": "unicode/23cf.png?v8", + "el_salvador": "unicode/1f1f8-1f1fb.png?v8", + "electric_plug": "unicode/1f50c.png?v8", + "electron": "electron.png?v8", + "elephant": "unicode/1f418.png?v8", + "elevator": "unicode/1f6d7.png?v8", + "elf": "unicode/1f9dd.png?v8", + "elf_man": "unicode/1f9dd-2642.png?v8", + "elf_woman": "unicode/1f9dd-2640.png?v8", + "email": "unicode/1f4e7.png?v8", + "end": "unicode/1f51a.png?v8", + "england": "unicode/1f3f4-e0067-e0062-e0065-e006e-e0067-e007f.png?v8", + "envelope": "unicode/2709.png?v8", + "envelope_with_arrow": "unicode/1f4e9.png?v8", + "equatorial_guinea": "unicode/1f1ec-1f1f6.png?v8", + "eritrea": "unicode/1f1ea-1f1f7.png?v8", + "es": "unicode/1f1ea-1f1f8.png?v8", + "estonia": "unicode/1f1ea-1f1ea.png?v8", + "ethiopia": "unicode/1f1ea-1f1f9.png?v8", + "eu": "unicode/1f1ea-1f1fa.png?v8", + "euro": "unicode/1f4b6.png?v8", + "european_castle": "unicode/1f3f0.png?v8", + "european_post_office": "unicode/1f3e4.png?v8", + "european_union": "unicode/1f1ea-1f1fa.png?v8", + "evergreen_tree": "unicode/1f332.png?v8", + "exclamation": "unicode/2757.png?v8", + "exploding_head": "unicode/1f92f.png?v8", + "expressionless": "unicode/1f611.png?v8", + "eye": "unicode/1f441.png?v8", + "eye_speech_bubble": "unicode/1f441-1f5e8.png?v8", + "eyeglasses": "unicode/1f453.png?v8", + "eyes": "unicode/1f440.png?v8", + "face_exhaling": "unicode/1f62e-1f4a8.png?v8", + "face_in_clouds": "unicode/1f636-1f32b.png?v8", + "face_with_head_bandage": "unicode/1f915.png?v8", + "face_with_spiral_eyes": "unicode/1f635-1f4ab.png?v8", + "face_with_thermometer": "unicode/1f912.png?v8", + "facepalm": "unicode/1f926.png?v8", + "facepunch": "unicode/1f44a.png?v8", + "factory": "unicode/1f3ed.png?v8", + "factory_worker": "unicode/1f9d1-1f3ed.png?v8", + "fairy": "unicode/1f9da.png?v8", + "fairy_man": "unicode/1f9da-2642.png?v8", + "fairy_woman": "unicode/1f9da-2640.png?v8", + "falafel": "unicode/1f9c6.png?v8", + "falkland_islands": "unicode/1f1eb-1f1f0.png?v8", + "fallen_leaf": "unicode/1f342.png?v8", + "family": "unicode/1f46a.png?v8", + "family_man_boy": "unicode/1f468-1f466.png?v8", + "family_man_boy_boy": "unicode/1f468-1f466-1f466.png?v8", + "family_man_girl": "unicode/1f468-1f467.png?v8", + "family_man_girl_boy": "unicode/1f468-1f467-1f466.png?v8", + "family_man_girl_girl": "unicode/1f468-1f467-1f467.png?v8", + "family_man_man_boy": "unicode/1f468-1f468-1f466.png?v8", + "family_man_man_boy_boy": "unicode/1f468-1f468-1f466-1f466.png?v8", + "family_man_man_girl": "unicode/1f468-1f468-1f467.png?v8", + "family_man_man_girl_boy": "unicode/1f468-1f468-1f467-1f466.png?v8", + "family_man_man_girl_girl": "unicode/1f468-1f468-1f467-1f467.png?v8", + "family_man_woman_boy": "unicode/1f468-1f469-1f466.png?v8", + "family_man_woman_boy_boy": "unicode/1f468-1f469-1f466-1f466.png?v8", + "family_man_woman_girl": "unicode/1f468-1f469-1f467.png?v8", + "family_man_woman_girl_boy": "unicode/1f468-1f469-1f467-1f466.png?v8", + "family_man_woman_girl_girl": "unicode/1f468-1f469-1f467-1f467.png?v8", + "family_woman_boy": "unicode/1f469-1f466.png?v8", + "family_woman_boy_boy": "unicode/1f469-1f466-1f466.png?v8", + "family_woman_girl": "unicode/1f469-1f467.png?v8", + "family_woman_girl_boy": "unicode/1f469-1f467-1f466.png?v8", + "family_woman_girl_girl": "unicode/1f469-1f467-1f467.png?v8", + "family_woman_woman_boy": "unicode/1f469-1f469-1f466.png?v8", + "family_woman_woman_boy_boy": "unicode/1f469-1f469-1f466-1f466.png?v8", + "family_woman_woman_girl": "unicode/1f469-1f469-1f467.png?v8", + "family_woman_woman_girl_boy": "unicode/1f469-1f469-1f467-1f466.png?v8", + "family_woman_woman_girl_girl": "unicode/1f469-1f469-1f467-1f467.png?v8", + "farmer": "unicode/1f9d1-1f33e.png?v8", + "faroe_islands": "unicode/1f1eb-1f1f4.png?v8", + "fast_forward": "unicode/23e9.png?v8", + "fax": "unicode/1f4e0.png?v8", + "fearful": "unicode/1f628.png?v8", + "feather": "unicode/1fab6.png?v8", + "feelsgood": "feelsgood.png?v8", + "feet": "unicode/1f43e.png?v8", + "female_detective": "unicode/1f575-2640.png?v8", + "female_sign": "unicode/2640.png?v8", + "ferris_wheel": "unicode/1f3a1.png?v8", + "ferry": "unicode/26f4.png?v8", + "field_hockey": "unicode/1f3d1.png?v8", + "fiji": "unicode/1f1eb-1f1ef.png?v8", + "file_cabinet": "unicode/1f5c4.png?v8", + "file_folder": "unicode/1f4c1.png?v8", + "film_projector": "unicode/1f4fd.png?v8", + "film_strip": "unicode/1f39e.png?v8", + "finland": "unicode/1f1eb-1f1ee.png?v8", + "finnadie": "finnadie.png?v8", + "fire": "unicode/1f525.png?v8", + "fire_engine": "unicode/1f692.png?v8", + "fire_extinguisher": "unicode/1f9ef.png?v8", + "firecracker": "unicode/1f9e8.png?v8", + "firefighter": "unicode/1f9d1-1f692.png?v8", + "fireworks": "unicode/1f386.png?v8", + "first_quarter_moon": "unicode/1f313.png?v8", + "first_quarter_moon_with_face": "unicode/1f31b.png?v8", + "fish": "unicode/1f41f.png?v8", + "fish_cake": "unicode/1f365.png?v8", + "fishing_pole_and_fish": "unicode/1f3a3.png?v8", + "fishsticks": "fishsticks.png?v8", + "fist": "unicode/270a.png?v8", + "fist_left": "unicode/1f91b.png?v8", + "fist_oncoming": "unicode/1f44a.png?v8", + "fist_raised": "unicode/270a.png?v8", + "fist_right": "unicode/1f91c.png?v8", + "five": "unicode/0035-20e3.png?v8", + "flags": "unicode/1f38f.png?v8", + "flamingo": "unicode/1f9a9.png?v8", + "flashlight": "unicode/1f526.png?v8", + "flat_shoe": "unicode/1f97f.png?v8", + "flatbread": "unicode/1fad3.png?v8", + "fleur_de_lis": "unicode/269c.png?v8", + "flight_arrival": "unicode/1f6ec.png?v8", + "flight_departure": "unicode/1f6eb.png?v8", + "flipper": "unicode/1f42c.png?v8", + "floppy_disk": "unicode/1f4be.png?v8", + "flower_playing_cards": "unicode/1f3b4.png?v8", + "flushed": "unicode/1f633.png?v8", + "fly": "unicode/1fab0.png?v8", + "flying_disc": "unicode/1f94f.png?v8", + "flying_saucer": "unicode/1f6f8.png?v8", + "fog": "unicode/1f32b.png?v8", + "foggy": "unicode/1f301.png?v8", + "fondue": "unicode/1fad5.png?v8", + "foot": "unicode/1f9b6.png?v8", + "football": "unicode/1f3c8.png?v8", + "footprints": "unicode/1f463.png?v8", + "fork_and_knife": "unicode/1f374.png?v8", + "fortune_cookie": "unicode/1f960.png?v8", + "fountain": "unicode/26f2.png?v8", + "fountain_pen": "unicode/1f58b.png?v8", + "four": "unicode/0034-20e3.png?v8", + "four_leaf_clover": "unicode/1f340.png?v8", + "fox_face": "unicode/1f98a.png?v8", + "fr": "unicode/1f1eb-1f1f7.png?v8", + "framed_picture": "unicode/1f5bc.png?v8", + "free": "unicode/1f193.png?v8", + "french_guiana": "unicode/1f1ec-1f1eb.png?v8", + "french_polynesia": "unicode/1f1f5-1f1eb.png?v8", + "french_southern_territories": "unicode/1f1f9-1f1eb.png?v8", + "fried_egg": "unicode/1f373.png?v8", + "fried_shrimp": "unicode/1f364.png?v8", + "fries": "unicode/1f35f.png?v8", + "frog": "unicode/1f438.png?v8", + "frowning": "unicode/1f626.png?v8", + "frowning_face": "unicode/2639.png?v8", + "frowning_man": "unicode/1f64d-2642.png?v8", + "frowning_person": "unicode/1f64d.png?v8", + "frowning_woman": "unicode/1f64d-2640.png?v8", + "fu": "unicode/1f595.png?v8", + "fuelpump": "unicode/26fd.png?v8", + "full_moon": "unicode/1f315.png?v8", + "full_moon_with_face": "unicode/1f31d.png?v8", + "funeral_urn": "unicode/26b1.png?v8", + "gabon": "unicode/1f1ec-1f1e6.png?v8", + "gambia": "unicode/1f1ec-1f1f2.png?v8", + "game_die": "unicode/1f3b2.png?v8", + "garlic": "unicode/1f9c4.png?v8", + "gb": "unicode/1f1ec-1f1e7.png?v8", + "gear": "unicode/2699.png?v8", + "gem": "unicode/1f48e.png?v8", + "gemini": "unicode/264a.png?v8", + "genie": "unicode/1f9de.png?v8", + "genie_man": "unicode/1f9de-2642.png?v8", + "genie_woman": "unicode/1f9de-2640.png?v8", + "georgia": "unicode/1f1ec-1f1ea.png?v8", + "ghana": "unicode/1f1ec-1f1ed.png?v8", + "ghost": "unicode/1f47b.png?v8", + "gibraltar": "unicode/1f1ec-1f1ee.png?v8", + "gift": "unicode/1f381.png?v8", + "gift_heart": "unicode/1f49d.png?v8", + "giraffe": "unicode/1f992.png?v8", + "girl": "unicode/1f467.png?v8", + "globe_with_meridians": "unicode/1f310.png?v8", + "gloves": "unicode/1f9e4.png?v8", + "goal_net": "unicode/1f945.png?v8", + "goat": "unicode/1f410.png?v8", + "goberserk": "goberserk.png?v8", + "godmode": "godmode.png?v8", + "goggles": "unicode/1f97d.png?v8", + "golf": "unicode/26f3.png?v8", + "golfing": "unicode/1f3cc.png?v8", + "golfing_man": "unicode/1f3cc-2642.png?v8", + "golfing_woman": "unicode/1f3cc-2640.png?v8", + "gorilla": "unicode/1f98d.png?v8", + "grapes": "unicode/1f347.png?v8", + "greece": "unicode/1f1ec-1f1f7.png?v8", + "green_apple": "unicode/1f34f.png?v8", + "green_book": "unicode/1f4d7.png?v8", + "green_circle": "unicode/1f7e2.png?v8", + "green_heart": "unicode/1f49a.png?v8", + "green_salad": "unicode/1f957.png?v8", + "green_square": "unicode/1f7e9.png?v8", + "greenland": "unicode/1f1ec-1f1f1.png?v8", + "grenada": "unicode/1f1ec-1f1e9.png?v8", + "grey_exclamation": "unicode/2755.png?v8", + "grey_question": "unicode/2754.png?v8", + "grimacing": "unicode/1f62c.png?v8", + "grin": "unicode/1f601.png?v8", + "grinning": "unicode/1f600.png?v8", + "guadeloupe": "unicode/1f1ec-1f1f5.png?v8", + "guam": "unicode/1f1ec-1f1fa.png?v8", + "guard": "unicode/1f482.png?v8", + "guardsman": "unicode/1f482-2642.png?v8", + "guardswoman": "unicode/1f482-2640.png?v8", + "guatemala": "unicode/1f1ec-1f1f9.png?v8", + "guernsey": "unicode/1f1ec-1f1ec.png?v8", + "guide_dog": "unicode/1f9ae.png?v8", + "guinea": "unicode/1f1ec-1f1f3.png?v8", + "guinea_bissau": "unicode/1f1ec-1f1fc.png?v8", + "guitar": "unicode/1f3b8.png?v8", + "gun": "unicode/1f52b.png?v8", + "guyana": "unicode/1f1ec-1f1fe.png?v8", + "haircut": "unicode/1f487.png?v8", + "haircut_man": "unicode/1f487-2642.png?v8", + "haircut_woman": "unicode/1f487-2640.png?v8", + "haiti": "unicode/1f1ed-1f1f9.png?v8", + "hamburger": "unicode/1f354.png?v8", + "hammer": "unicode/1f528.png?v8", + "hammer_and_pick": "unicode/2692.png?v8", + "hammer_and_wrench": "unicode/1f6e0.png?v8", + "hamster": "unicode/1f439.png?v8", + "hand": "unicode/270b.png?v8", + "hand_over_mouth": "unicode/1f92d.png?v8", + "handbag": "unicode/1f45c.png?v8", + "handball_person": "unicode/1f93e.png?v8", + "handshake": "unicode/1f91d.png?v8", + "hankey": "unicode/1f4a9.png?v8", + "hash": "unicode/0023-20e3.png?v8", + "hatched_chick": "unicode/1f425.png?v8", + "hatching_chick": "unicode/1f423.png?v8", + "headphones": "unicode/1f3a7.png?v8", + "headstone": "unicode/1faa6.png?v8", + "health_worker": "unicode/1f9d1-2695.png?v8", + "hear_no_evil": "unicode/1f649.png?v8", + "heard_mcdonald_islands": "unicode/1f1ed-1f1f2.png?v8", + "heart": "unicode/2764.png?v8", + "heart_decoration": "unicode/1f49f.png?v8", + "heart_eyes": "unicode/1f60d.png?v8", + "heart_eyes_cat": "unicode/1f63b.png?v8", + "heart_on_fire": "unicode/2764-1f525.png?v8", + "heartbeat": "unicode/1f493.png?v8", + "heartpulse": "unicode/1f497.png?v8", + "hearts": "unicode/2665.png?v8", + "heavy_check_mark": "unicode/2714.png?v8", + "heavy_division_sign": "unicode/2797.png?v8", + "heavy_dollar_sign": "unicode/1f4b2.png?v8", + "heavy_exclamation_mark": "unicode/2757.png?v8", + "heavy_heart_exclamation": "unicode/2763.png?v8", + "heavy_minus_sign": "unicode/2796.png?v8", + "heavy_multiplication_x": "unicode/2716.png?v8", + "heavy_plus_sign": "unicode/2795.png?v8", + "hedgehog": "unicode/1f994.png?v8", + "helicopter": "unicode/1f681.png?v8", + "herb": "unicode/1f33f.png?v8", + "hibiscus": "unicode/1f33a.png?v8", + "high_brightness": "unicode/1f506.png?v8", + "high_heel": "unicode/1f460.png?v8", + "hiking_boot": "unicode/1f97e.png?v8", + "hindu_temple": "unicode/1f6d5.png?v8", + "hippopotamus": "unicode/1f99b.png?v8", + "hocho": "unicode/1f52a.png?v8", + "hole": "unicode/1f573.png?v8", + "honduras": "unicode/1f1ed-1f1f3.png?v8", + "honey_pot": "unicode/1f36f.png?v8", + "honeybee": "unicode/1f41d.png?v8", + "hong_kong": "unicode/1f1ed-1f1f0.png?v8", + "hook": "unicode/1fa9d.png?v8", + "horse": "unicode/1f434.png?v8", + "horse_racing": "unicode/1f3c7.png?v8", + "hospital": "unicode/1f3e5.png?v8", + "hot_face": "unicode/1f975.png?v8", + "hot_pepper": "unicode/1f336.png?v8", + "hotdog": "unicode/1f32d.png?v8", + "hotel": "unicode/1f3e8.png?v8", + "hotsprings": "unicode/2668.png?v8", + "hourglass": "unicode/231b.png?v8", + "hourglass_flowing_sand": "unicode/23f3.png?v8", + "house": "unicode/1f3e0.png?v8", + "house_with_garden": "unicode/1f3e1.png?v8", + "houses": "unicode/1f3d8.png?v8", + "hugs": "unicode/1f917.png?v8", + "hungary": "unicode/1f1ed-1f1fa.png?v8", + "hurtrealbad": "hurtrealbad.png?v8", + "hushed": "unicode/1f62f.png?v8", + "hut": "unicode/1f6d6.png?v8", + "ice_cream": "unicode/1f368.png?v8", + "ice_cube": "unicode/1f9ca.png?v8", + "ice_hockey": "unicode/1f3d2.png?v8", + "ice_skate": "unicode/26f8.png?v8", + "icecream": "unicode/1f366.png?v8", + "iceland": "unicode/1f1ee-1f1f8.png?v8", + "id": "unicode/1f194.png?v8", + "ideograph_advantage": "unicode/1f250.png?v8", + "imp": "unicode/1f47f.png?v8", + "inbox_tray": "unicode/1f4e5.png?v8", + "incoming_envelope": "unicode/1f4e8.png?v8", + "india": "unicode/1f1ee-1f1f3.png?v8", + "indonesia": "unicode/1f1ee-1f1e9.png?v8", + "infinity": "unicode/267e.png?v8", + "information_desk_person": "unicode/1f481.png?v8", + "information_source": "unicode/2139.png?v8", + "innocent": "unicode/1f607.png?v8", + "interrobang": "unicode/2049.png?v8", + "iphone": "unicode/1f4f1.png?v8", + "iran": "unicode/1f1ee-1f1f7.png?v8", + "iraq": "unicode/1f1ee-1f1f6.png?v8", + "ireland": "unicode/1f1ee-1f1ea.png?v8", + "isle_of_man": "unicode/1f1ee-1f1f2.png?v8", + "israel": "unicode/1f1ee-1f1f1.png?v8", + "it": "unicode/1f1ee-1f1f9.png?v8", + "izakaya_lantern": "unicode/1f3ee.png?v8", + "jack_o_lantern": "unicode/1f383.png?v8", + "jamaica": "unicode/1f1ef-1f1f2.png?v8", + "japan": "unicode/1f5fe.png?v8", + "japanese_castle": "unicode/1f3ef.png?v8", + "japanese_goblin": "unicode/1f47a.png?v8", + "japanese_ogre": "unicode/1f479.png?v8", + "jeans": "unicode/1f456.png?v8", + "jersey": "unicode/1f1ef-1f1ea.png?v8", + "jigsaw": "unicode/1f9e9.png?v8", + "jordan": "unicode/1f1ef-1f1f4.png?v8", + "joy": "unicode/1f602.png?v8", + "joy_cat": "unicode/1f639.png?v8", + "joystick": "unicode/1f579.png?v8", + "jp": "unicode/1f1ef-1f1f5.png?v8", + "judge": "unicode/1f9d1-2696.png?v8", + "juggling_person": "unicode/1f939.png?v8", + "kaaba": "unicode/1f54b.png?v8", + "kangaroo": "unicode/1f998.png?v8", + "kazakhstan": "unicode/1f1f0-1f1ff.png?v8", + "kenya": "unicode/1f1f0-1f1ea.png?v8", + "key": "unicode/1f511.png?v8", + "keyboard": "unicode/2328.png?v8", + "keycap_ten": "unicode/1f51f.png?v8", + "kick_scooter": "unicode/1f6f4.png?v8", + "kimono": "unicode/1f458.png?v8", + "kiribati": "unicode/1f1f0-1f1ee.png?v8", + "kiss": "unicode/1f48b.png?v8", + "kissing": "unicode/1f617.png?v8", + "kissing_cat": "unicode/1f63d.png?v8", + "kissing_closed_eyes": "unicode/1f61a.png?v8", + "kissing_heart": "unicode/1f618.png?v8", + "kissing_smiling_eyes": "unicode/1f619.png?v8", + "kite": "unicode/1fa81.png?v8", + "kiwi_fruit": "unicode/1f95d.png?v8", + "kneeling_man": "unicode/1f9ce-2642.png?v8", + "kneeling_person": "unicode/1f9ce.png?v8", + "kneeling_woman": "unicode/1f9ce-2640.png?v8", + "knife": "unicode/1f52a.png?v8", + "knot": "unicode/1faa2.png?v8", + "koala": "unicode/1f428.png?v8", + "koko": "unicode/1f201.png?v8", + "kosovo": "unicode/1f1fd-1f1f0.png?v8", + "kr": "unicode/1f1f0-1f1f7.png?v8", + "kuwait": "unicode/1f1f0-1f1fc.png?v8", + "kyrgyzstan": "unicode/1f1f0-1f1ec.png?v8", + "lab_coat": "unicode/1f97c.png?v8", + "label": "unicode/1f3f7.png?v8", + "lacrosse": "unicode/1f94d.png?v8", + "ladder": "unicode/1fa9c.png?v8", + "lady_beetle": "unicode/1f41e.png?v8", + "lantern": "unicode/1f3ee.png?v8", + "laos": "unicode/1f1f1-1f1e6.png?v8", + "large_blue_circle": "unicode/1f535.png?v8", + "large_blue_diamond": "unicode/1f537.png?v8", + "large_orange_diamond": "unicode/1f536.png?v8", + "last_quarter_moon": "unicode/1f317.png?v8", + "last_quarter_moon_with_face": "unicode/1f31c.png?v8", + "latin_cross": "unicode/271d.png?v8", + "latvia": "unicode/1f1f1-1f1fb.png?v8", + "laughing": "unicode/1f606.png?v8", + "leafy_green": "unicode/1f96c.png?v8", + "leaves": "unicode/1f343.png?v8", + "lebanon": "unicode/1f1f1-1f1e7.png?v8", + "ledger": "unicode/1f4d2.png?v8", + "left_luggage": "unicode/1f6c5.png?v8", + "left_right_arrow": "unicode/2194.png?v8", + "left_speech_bubble": "unicode/1f5e8.png?v8", + "leftwards_arrow_with_hook": "unicode/21a9.png?v8", + "leg": "unicode/1f9b5.png?v8", + "lemon": "unicode/1f34b.png?v8", + "leo": "unicode/264c.png?v8", + "leopard": "unicode/1f406.png?v8", + "lesotho": "unicode/1f1f1-1f1f8.png?v8", + "level_slider": "unicode/1f39a.png?v8", + "liberia": "unicode/1f1f1-1f1f7.png?v8", + "libra": "unicode/264e.png?v8", + "libya": "unicode/1f1f1-1f1fe.png?v8", + "liechtenstein": "unicode/1f1f1-1f1ee.png?v8", + "light_rail": "unicode/1f688.png?v8", + "link": "unicode/1f517.png?v8", + "lion": "unicode/1f981.png?v8", + "lips": "unicode/1f444.png?v8", + "lipstick": "unicode/1f484.png?v8", + "lithuania": "unicode/1f1f1-1f1f9.png?v8", + "lizard": "unicode/1f98e.png?v8", + "llama": "unicode/1f999.png?v8", + "lobster": "unicode/1f99e.png?v8", + "lock": "unicode/1f512.png?v8", + "lock_with_ink_pen": "unicode/1f50f.png?v8", + "lollipop": "unicode/1f36d.png?v8", + "long_drum": "unicode/1fa98.png?v8", + "loop": "unicode/27bf.png?v8", + "lotion_bottle": "unicode/1f9f4.png?v8", + "lotus_position": "unicode/1f9d8.png?v8", + "lotus_position_man": "unicode/1f9d8-2642.png?v8", + "lotus_position_woman": "unicode/1f9d8-2640.png?v8", + "loud_sound": "unicode/1f50a.png?v8", + "loudspeaker": "unicode/1f4e2.png?v8", + "love_hotel": "unicode/1f3e9.png?v8", + "love_letter": "unicode/1f48c.png?v8", + "love_you_gesture": "unicode/1f91f.png?v8", + "low_brightness": "unicode/1f505.png?v8", + "luggage": "unicode/1f9f3.png?v8", + "lungs": "unicode/1fac1.png?v8", + "luxembourg": "unicode/1f1f1-1f1fa.png?v8", + "lying_face": "unicode/1f925.png?v8", + "m": "unicode/24c2.png?v8", + "macau": "unicode/1f1f2-1f1f4.png?v8", + "macedonia": "unicode/1f1f2-1f1f0.png?v8", + "madagascar": "unicode/1f1f2-1f1ec.png?v8", + "mag": "unicode/1f50d.png?v8", + "mag_right": "unicode/1f50e.png?v8", + "mage": "unicode/1f9d9.png?v8", + "mage_man": "unicode/1f9d9-2642.png?v8", + "mage_woman": "unicode/1f9d9-2640.png?v8", + "magic_wand": "unicode/1fa84.png?v8", + "magnet": "unicode/1f9f2.png?v8", + "mahjong": "unicode/1f004.png?v8", + "mailbox": "unicode/1f4eb.png?v8", + "mailbox_closed": "unicode/1f4ea.png?v8", + "mailbox_with_mail": "unicode/1f4ec.png?v8", + "mailbox_with_no_mail": "unicode/1f4ed.png?v8", + "malawi": "unicode/1f1f2-1f1fc.png?v8", + "malaysia": "unicode/1f1f2-1f1fe.png?v8", + "maldives": "unicode/1f1f2-1f1fb.png?v8", + "male_detective": "unicode/1f575-2642.png?v8", + "male_sign": "unicode/2642.png?v8", + "mali": "unicode/1f1f2-1f1f1.png?v8", + "malta": "unicode/1f1f2-1f1f9.png?v8", + "mammoth": "unicode/1f9a3.png?v8", + "man": "unicode/1f468.png?v8", + "man_artist": "unicode/1f468-1f3a8.png?v8", + "man_astronaut": "unicode/1f468-1f680.png?v8", + "man_beard": "unicode/1f9d4-2642.png?v8", + "man_cartwheeling": "unicode/1f938-2642.png?v8", + "man_cook": "unicode/1f468-1f373.png?v8", + "man_dancing": "unicode/1f57a.png?v8", + "man_facepalming": "unicode/1f926-2642.png?v8", + "man_factory_worker": "unicode/1f468-1f3ed.png?v8", + "man_farmer": "unicode/1f468-1f33e.png?v8", + "man_feeding_baby": "unicode/1f468-1f37c.png?v8", + "man_firefighter": "unicode/1f468-1f692.png?v8", + "man_health_worker": "unicode/1f468-2695.png?v8", + "man_in_manual_wheelchair": "unicode/1f468-1f9bd.png?v8", + "man_in_motorized_wheelchair": "unicode/1f468-1f9bc.png?v8", + "man_in_tuxedo": "unicode/1f935-2642.png?v8", + "man_judge": "unicode/1f468-2696.png?v8", + "man_juggling": "unicode/1f939-2642.png?v8", + "man_mechanic": "unicode/1f468-1f527.png?v8", + "man_office_worker": "unicode/1f468-1f4bc.png?v8", + "man_pilot": "unicode/1f468-2708.png?v8", + "man_playing_handball": "unicode/1f93e-2642.png?v8", + "man_playing_water_polo": "unicode/1f93d-2642.png?v8", + "man_scientist": "unicode/1f468-1f52c.png?v8", + "man_shrugging": "unicode/1f937-2642.png?v8", + "man_singer": "unicode/1f468-1f3a4.png?v8", + "man_student": "unicode/1f468-1f393.png?v8", + "man_teacher": "unicode/1f468-1f3eb.png?v8", + "man_technologist": "unicode/1f468-1f4bb.png?v8", + "man_with_gua_pi_mao": "unicode/1f472.png?v8", + "man_with_probing_cane": "unicode/1f468-1f9af.png?v8", + "man_with_turban": "unicode/1f473-2642.png?v8", + "man_with_veil": "unicode/1f470-2642.png?v8", + "mandarin": "unicode/1f34a.png?v8", + "mango": "unicode/1f96d.png?v8", + "mans_shoe": "unicode/1f45e.png?v8", + "mantelpiece_clock": "unicode/1f570.png?v8", + "manual_wheelchair": "unicode/1f9bd.png?v8", + "maple_leaf": "unicode/1f341.png?v8", + "marshall_islands": "unicode/1f1f2-1f1ed.png?v8", + "martial_arts_uniform": "unicode/1f94b.png?v8", + "martinique": "unicode/1f1f2-1f1f6.png?v8", + "mask": "unicode/1f637.png?v8", + "massage": "unicode/1f486.png?v8", + "massage_man": "unicode/1f486-2642.png?v8", + "massage_woman": "unicode/1f486-2640.png?v8", + "mate": "unicode/1f9c9.png?v8", + "mauritania": "unicode/1f1f2-1f1f7.png?v8", + "mauritius": "unicode/1f1f2-1f1fa.png?v8", + "mayotte": "unicode/1f1fe-1f1f9.png?v8", + "meat_on_bone": "unicode/1f356.png?v8", + "mechanic": "unicode/1f9d1-1f527.png?v8", + "mechanical_arm": "unicode/1f9be.png?v8", + "mechanical_leg": "unicode/1f9bf.png?v8", + "medal_military": "unicode/1f396.png?v8", + "medal_sports": "unicode/1f3c5.png?v8", + "medical_symbol": "unicode/2695.png?v8", + "mega": "unicode/1f4e3.png?v8", + "melon": "unicode/1f348.png?v8", + "memo": "unicode/1f4dd.png?v8", + "men_wrestling": "unicode/1f93c-2642.png?v8", + "mending_heart": "unicode/2764-1fa79.png?v8", + "menorah": "unicode/1f54e.png?v8", + "mens": "unicode/1f6b9.png?v8", + "mermaid": "unicode/1f9dc-2640.png?v8", + "merman": "unicode/1f9dc-2642.png?v8", + "merperson": "unicode/1f9dc.png?v8", + "metal": "unicode/1f918.png?v8", + "metro": "unicode/1f687.png?v8", + "mexico": "unicode/1f1f2-1f1fd.png?v8", + "microbe": "unicode/1f9a0.png?v8", + "micronesia": "unicode/1f1eb-1f1f2.png?v8", + "microphone": "unicode/1f3a4.png?v8", + "microscope": "unicode/1f52c.png?v8", + "middle_finger": "unicode/1f595.png?v8", + "military_helmet": "unicode/1fa96.png?v8", + "milk_glass": "unicode/1f95b.png?v8", + "milky_way": "unicode/1f30c.png?v8", + "minibus": "unicode/1f690.png?v8", + "minidisc": "unicode/1f4bd.png?v8", + "mirror": "unicode/1fa9e.png?v8", + "mobile_phone_off": "unicode/1f4f4.png?v8", + "moldova": "unicode/1f1f2-1f1e9.png?v8", + "monaco": "unicode/1f1f2-1f1e8.png?v8", + "money_mouth_face": "unicode/1f911.png?v8", + "money_with_wings": "unicode/1f4b8.png?v8", + "moneybag": "unicode/1f4b0.png?v8", + "mongolia": "unicode/1f1f2-1f1f3.png?v8", + "monkey": "unicode/1f412.png?v8", + "monkey_face": "unicode/1f435.png?v8", + "monocle_face": "unicode/1f9d0.png?v8", + "monorail": "unicode/1f69d.png?v8", + "montenegro": "unicode/1f1f2-1f1ea.png?v8", + "montserrat": "unicode/1f1f2-1f1f8.png?v8", + "moon": "unicode/1f314.png?v8", + "moon_cake": "unicode/1f96e.png?v8", + "morocco": "unicode/1f1f2-1f1e6.png?v8", + "mortar_board": "unicode/1f393.png?v8", + "mosque": "unicode/1f54c.png?v8", + "mosquito": "unicode/1f99f.png?v8", + "motor_boat": "unicode/1f6e5.png?v8", + "motor_scooter": "unicode/1f6f5.png?v8", + "motorcycle": "unicode/1f3cd.png?v8", + "motorized_wheelchair": "unicode/1f9bc.png?v8", + "motorway": "unicode/1f6e3.png?v8", + "mount_fuji": "unicode/1f5fb.png?v8", + "mountain": "unicode/26f0.png?v8", + "mountain_bicyclist": "unicode/1f6b5.png?v8", + "mountain_biking_man": "unicode/1f6b5-2642.png?v8", + "mountain_biking_woman": "unicode/1f6b5-2640.png?v8", + "mountain_cableway": "unicode/1f6a0.png?v8", + "mountain_railway": "unicode/1f69e.png?v8", + "mountain_snow": "unicode/1f3d4.png?v8", + "mouse": "unicode/1f42d.png?v8", + "mouse2": "unicode/1f401.png?v8", + "mouse_trap": "unicode/1faa4.png?v8", + "movie_camera": "unicode/1f3a5.png?v8", + "moyai": "unicode/1f5ff.png?v8", + "mozambique": "unicode/1f1f2-1f1ff.png?v8", + "mrs_claus": "unicode/1f936.png?v8", + "muscle": "unicode/1f4aa.png?v8", + "mushroom": "unicode/1f344.png?v8", + "musical_keyboard": "unicode/1f3b9.png?v8", + "musical_note": "unicode/1f3b5.png?v8", + "musical_score": "unicode/1f3bc.png?v8", + "mute": "unicode/1f507.png?v8", + "mx_claus": "unicode/1f9d1-1f384.png?v8", + "myanmar": "unicode/1f1f2-1f1f2.png?v8", + "nail_care": "unicode/1f485.png?v8", + "name_badge": "unicode/1f4db.png?v8", + "namibia": "unicode/1f1f3-1f1e6.png?v8", + "national_park": "unicode/1f3de.png?v8", + "nauru": "unicode/1f1f3-1f1f7.png?v8", + "nauseated_face": "unicode/1f922.png?v8", + "nazar_amulet": "unicode/1f9ff.png?v8", + "neckbeard": "neckbeard.png?v8", + "necktie": "unicode/1f454.png?v8", + "negative_squared_cross_mark": "unicode/274e.png?v8", + "nepal": "unicode/1f1f3-1f1f5.png?v8", + "nerd_face": "unicode/1f913.png?v8", + "nesting_dolls": "unicode/1fa86.png?v8", + "netherlands": "unicode/1f1f3-1f1f1.png?v8", + "neutral_face": "unicode/1f610.png?v8", + "new": "unicode/1f195.png?v8", + "new_caledonia": "unicode/1f1f3-1f1e8.png?v8", + "new_moon": "unicode/1f311.png?v8", + "new_moon_with_face": "unicode/1f31a.png?v8", + "new_zealand": "unicode/1f1f3-1f1ff.png?v8", + "newspaper": "unicode/1f4f0.png?v8", + "newspaper_roll": "unicode/1f5de.png?v8", + "next_track_button": "unicode/23ed.png?v8", + "ng": "unicode/1f196.png?v8", + "ng_man": "unicode/1f645-2642.png?v8", + "ng_woman": "unicode/1f645-2640.png?v8", + "nicaragua": "unicode/1f1f3-1f1ee.png?v8", + "niger": "unicode/1f1f3-1f1ea.png?v8", + "nigeria": "unicode/1f1f3-1f1ec.png?v8", + "night_with_stars": "unicode/1f303.png?v8", + "nine": "unicode/0039-20e3.png?v8", + "ninja": "unicode/1f977.png?v8", + "niue": "unicode/1f1f3-1f1fa.png?v8", + "no_bell": "unicode/1f515.png?v8", + "no_bicycles": "unicode/1f6b3.png?v8", + "no_entry": "unicode/26d4.png?v8", + "no_entry_sign": "unicode/1f6ab.png?v8", + "no_good": "unicode/1f645.png?v8", + "no_good_man": "unicode/1f645-2642.png?v8", + "no_good_woman": "unicode/1f645-2640.png?v8", + "no_mobile_phones": "unicode/1f4f5.png?v8", + "no_mouth": "unicode/1f636.png?v8", + "no_pedestrians": "unicode/1f6b7.png?v8", + "no_smoking": "unicode/1f6ad.png?v8", + "non-potable_water": "unicode/1f6b1.png?v8", + "norfolk_island": "unicode/1f1f3-1f1eb.png?v8", + "north_korea": "unicode/1f1f0-1f1f5.png?v8", + "northern_mariana_islands": "unicode/1f1f2-1f1f5.png?v8", + "norway": "unicode/1f1f3-1f1f4.png?v8", + "nose": "unicode/1f443.png?v8", + "notebook": "unicode/1f4d3.png?v8", + "notebook_with_decorative_cover": "unicode/1f4d4.png?v8", + "notes": "unicode/1f3b6.png?v8", + "nut_and_bolt": "unicode/1f529.png?v8", + "o": "unicode/2b55.png?v8", + "o2": "unicode/1f17e.png?v8", + "ocean": "unicode/1f30a.png?v8", + "octocat": "octocat.png?v8", + "octopus": "unicode/1f419.png?v8", + "oden": "unicode/1f362.png?v8", + "office": "unicode/1f3e2.png?v8", + "office_worker": "unicode/1f9d1-1f4bc.png?v8", + "oil_drum": "unicode/1f6e2.png?v8", + "ok": "unicode/1f197.png?v8", + "ok_hand": "unicode/1f44c.png?v8", + "ok_man": "unicode/1f646-2642.png?v8", + "ok_person": "unicode/1f646.png?v8", + "ok_woman": "unicode/1f646-2640.png?v8", + "old_key": "unicode/1f5dd.png?v8", + "older_adult": "unicode/1f9d3.png?v8", + "older_man": "unicode/1f474.png?v8", + "older_woman": "unicode/1f475.png?v8", + "olive": "unicode/1fad2.png?v8", + "om": "unicode/1f549.png?v8", + "oman": "unicode/1f1f4-1f1f2.png?v8", + "on": "unicode/1f51b.png?v8", + "oncoming_automobile": "unicode/1f698.png?v8", + "oncoming_bus": "unicode/1f68d.png?v8", + "oncoming_police_car": "unicode/1f694.png?v8", + "oncoming_taxi": "unicode/1f696.png?v8", + "one": "unicode/0031-20e3.png?v8", + "one_piece_swimsuit": "unicode/1fa71.png?v8", + "onion": "unicode/1f9c5.png?v8", + "open_book": "unicode/1f4d6.png?v8", + "open_file_folder": "unicode/1f4c2.png?v8", + "open_hands": "unicode/1f450.png?v8", + "open_mouth": "unicode/1f62e.png?v8", + "open_umbrella": "unicode/2602.png?v8", + "ophiuchus": "unicode/26ce.png?v8", + "orange": "unicode/1f34a.png?v8", + "orange_book": "unicode/1f4d9.png?v8", + "orange_circle": "unicode/1f7e0.png?v8", + "orange_heart": "unicode/1f9e1.png?v8", + "orange_square": "unicode/1f7e7.png?v8", + "orangutan": "unicode/1f9a7.png?v8", + "orthodox_cross": "unicode/2626.png?v8", + "otter": "unicode/1f9a6.png?v8", + "outbox_tray": "unicode/1f4e4.png?v8", + "owl": "unicode/1f989.png?v8", + "ox": "unicode/1f402.png?v8", + "oyster": "unicode/1f9aa.png?v8", + "package": "unicode/1f4e6.png?v8", + "page_facing_up": "unicode/1f4c4.png?v8", + "page_with_curl": "unicode/1f4c3.png?v8", + "pager": "unicode/1f4df.png?v8", + "paintbrush": "unicode/1f58c.png?v8", + "pakistan": "unicode/1f1f5-1f1f0.png?v8", + "palau": "unicode/1f1f5-1f1fc.png?v8", + "palestinian_territories": "unicode/1f1f5-1f1f8.png?v8", + "palm_tree": "unicode/1f334.png?v8", + "palms_up_together": "unicode/1f932.png?v8", + "panama": "unicode/1f1f5-1f1e6.png?v8", + "pancakes": "unicode/1f95e.png?v8", + "panda_face": "unicode/1f43c.png?v8", + "paperclip": "unicode/1f4ce.png?v8", + "paperclips": "unicode/1f587.png?v8", + "papua_new_guinea": "unicode/1f1f5-1f1ec.png?v8", + "parachute": "unicode/1fa82.png?v8", + "paraguay": "unicode/1f1f5-1f1fe.png?v8", + "parasol_on_ground": "unicode/26f1.png?v8", + "parking": "unicode/1f17f.png?v8", + "parrot": "unicode/1f99c.png?v8", + "part_alternation_mark": "unicode/303d.png?v8", + "partly_sunny": "unicode/26c5.png?v8", + "partying_face": "unicode/1f973.png?v8", + "passenger_ship": "unicode/1f6f3.png?v8", + "passport_control": "unicode/1f6c2.png?v8", + "pause_button": "unicode/23f8.png?v8", + "paw_prints": "unicode/1f43e.png?v8", + "peace_symbol": "unicode/262e.png?v8", + "peach": "unicode/1f351.png?v8", + "peacock": "unicode/1f99a.png?v8", + "peanuts": "unicode/1f95c.png?v8", + "pear": "unicode/1f350.png?v8", + "pen": "unicode/1f58a.png?v8", + "pencil": "unicode/1f4dd.png?v8", + "pencil2": "unicode/270f.png?v8", + "penguin": "unicode/1f427.png?v8", + "pensive": "unicode/1f614.png?v8", + "people_holding_hands": "unicode/1f9d1-1f91d-1f9d1.png?v8", + "people_hugging": "unicode/1fac2.png?v8", + "performing_arts": "unicode/1f3ad.png?v8", + "persevere": "unicode/1f623.png?v8", + "person_bald": "unicode/1f9d1-1f9b2.png?v8", + "person_curly_hair": "unicode/1f9d1-1f9b1.png?v8", + "person_feeding_baby": "unicode/1f9d1-1f37c.png?v8", + "person_fencing": "unicode/1f93a.png?v8", + "person_in_manual_wheelchair": "unicode/1f9d1-1f9bd.png?v8", + "person_in_motorized_wheelchair": "unicode/1f9d1-1f9bc.png?v8", + "person_in_tuxedo": "unicode/1f935.png?v8", + "person_red_hair": "unicode/1f9d1-1f9b0.png?v8", + "person_white_hair": "unicode/1f9d1-1f9b3.png?v8", + "person_with_probing_cane": "unicode/1f9d1-1f9af.png?v8", + "person_with_turban": "unicode/1f473.png?v8", + "person_with_veil": "unicode/1f470.png?v8", + "peru": "unicode/1f1f5-1f1ea.png?v8", + "petri_dish": "unicode/1f9eb.png?v8", + "philippines": "unicode/1f1f5-1f1ed.png?v8", + "phone": "unicode/260e.png?v8", + "pick": "unicode/26cf.png?v8", + "pickup_truck": "unicode/1f6fb.png?v8", + "pie": "unicode/1f967.png?v8", + "pig": "unicode/1f437.png?v8", + "pig2": "unicode/1f416.png?v8", + "pig_nose": "unicode/1f43d.png?v8", + "pill": "unicode/1f48a.png?v8", + "pilot": "unicode/1f9d1-2708.png?v8", + "pinata": "unicode/1fa85.png?v8", + "pinched_fingers": "unicode/1f90c.png?v8", + "pinching_hand": "unicode/1f90f.png?v8", + "pineapple": "unicode/1f34d.png?v8", + "ping_pong": "unicode/1f3d3.png?v8", + "pirate_flag": "unicode/1f3f4-2620.png?v8", + "pisces": "unicode/2653.png?v8", + "pitcairn_islands": "unicode/1f1f5-1f1f3.png?v8", + "pizza": "unicode/1f355.png?v8", + "placard": "unicode/1faa7.png?v8", + "place_of_worship": "unicode/1f6d0.png?v8", + "plate_with_cutlery": "unicode/1f37d.png?v8", + "play_or_pause_button": "unicode/23ef.png?v8", + "pleading_face": "unicode/1f97a.png?v8", + "plunger": "unicode/1faa0.png?v8", + "point_down": "unicode/1f447.png?v8", + "point_left": "unicode/1f448.png?v8", + "point_right": "unicode/1f449.png?v8", + "point_up": "unicode/261d.png?v8", + "point_up_2": "unicode/1f446.png?v8", + "poland": "unicode/1f1f5-1f1f1.png?v8", + "polar_bear": "unicode/1f43b-2744.png?v8", + "police_car": "unicode/1f693.png?v8", + "police_officer": "unicode/1f46e.png?v8", + "policeman": "unicode/1f46e-2642.png?v8", + "policewoman": "unicode/1f46e-2640.png?v8", + "poodle": "unicode/1f429.png?v8", + "poop": "unicode/1f4a9.png?v8", + "popcorn": "unicode/1f37f.png?v8", + "portugal": "unicode/1f1f5-1f1f9.png?v8", + "post_office": "unicode/1f3e3.png?v8", + "postal_horn": "unicode/1f4ef.png?v8", + "postbox": "unicode/1f4ee.png?v8", + "potable_water": "unicode/1f6b0.png?v8", + "potato": "unicode/1f954.png?v8", + "potted_plant": "unicode/1fab4.png?v8", + "pouch": "unicode/1f45d.png?v8", + "poultry_leg": "unicode/1f357.png?v8", + "pound": "unicode/1f4b7.png?v8", + "pout": "unicode/1f621.png?v8", + "pouting_cat": "unicode/1f63e.png?v8", + "pouting_face": "unicode/1f64e.png?v8", + "pouting_man": "unicode/1f64e-2642.png?v8", + "pouting_woman": "unicode/1f64e-2640.png?v8", + "pray": "unicode/1f64f.png?v8", + "prayer_beads": "unicode/1f4ff.png?v8", + "pregnant_woman": "unicode/1f930.png?v8", + "pretzel": "unicode/1f968.png?v8", + "previous_track_button": "unicode/23ee.png?v8", + "prince": "unicode/1f934.png?v8", + "princess": "unicode/1f478.png?v8", + "printer": "unicode/1f5a8.png?v8", + "probing_cane": "unicode/1f9af.png?v8", + "puerto_rico": "unicode/1f1f5-1f1f7.png?v8", + "punch": "unicode/1f44a.png?v8", + "purple_circle": "unicode/1f7e3.png?v8", + "purple_heart": "unicode/1f49c.png?v8", + "purple_square": "unicode/1f7ea.png?v8", + "purse": "unicode/1f45b.png?v8", + "pushpin": "unicode/1f4cc.png?v8", + "put_litter_in_its_place": "unicode/1f6ae.png?v8", + "qatar": "unicode/1f1f6-1f1e6.png?v8", + "question": "unicode/2753.png?v8", + "rabbit": "unicode/1f430.png?v8", + "rabbit2": "unicode/1f407.png?v8", + "raccoon": "unicode/1f99d.png?v8", + "racehorse": "unicode/1f40e.png?v8", + "racing_car": "unicode/1f3ce.png?v8", + "radio": "unicode/1f4fb.png?v8", + "radio_button": "unicode/1f518.png?v8", + "radioactive": "unicode/2622.png?v8", + "rage": "unicode/1f621.png?v8", + "rage1": "rage1.png?v8", + "rage2": "rage2.png?v8", + "rage3": "rage3.png?v8", + "rage4": "rage4.png?v8", + "railway_car": "unicode/1f683.png?v8", + "railway_track": "unicode/1f6e4.png?v8", + "rainbow": "unicode/1f308.png?v8", + "rainbow_flag": "unicode/1f3f3-1f308.png?v8", + "raised_back_of_hand": "unicode/1f91a.png?v8", + "raised_eyebrow": "unicode/1f928.png?v8", + "raised_hand": "unicode/270b.png?v8", + "raised_hand_with_fingers_splayed": "unicode/1f590.png?v8", + "raised_hands": "unicode/1f64c.png?v8", + "raising_hand": "unicode/1f64b.png?v8", + "raising_hand_man": "unicode/1f64b-2642.png?v8", + "raising_hand_woman": "unicode/1f64b-2640.png?v8", + "ram": "unicode/1f40f.png?v8", + "ramen": "unicode/1f35c.png?v8", + "rat": "unicode/1f400.png?v8", + "razor": "unicode/1fa92.png?v8", + "receipt": "unicode/1f9fe.png?v8", + "record_button": "unicode/23fa.png?v8", + "recycle": "unicode/267b.png?v8", + "red_car": "unicode/1f697.png?v8", + "red_circle": "unicode/1f534.png?v8", + "red_envelope": "unicode/1f9e7.png?v8", + "red_haired_man": "unicode/1f468-1f9b0.png?v8", + "red_haired_woman": "unicode/1f469-1f9b0.png?v8", + "red_square": "unicode/1f7e5.png?v8", + "registered": "unicode/00ae.png?v8", + "relaxed": "unicode/263a.png?v8", + "relieved": "unicode/1f60c.png?v8", + "reminder_ribbon": "unicode/1f397.png?v8", + "repeat": "unicode/1f501.png?v8", + "repeat_one": "unicode/1f502.png?v8", + "rescue_worker_helmet": "unicode/26d1.png?v8", + "restroom": "unicode/1f6bb.png?v8", + "reunion": "unicode/1f1f7-1f1ea.png?v8", + "revolving_hearts": "unicode/1f49e.png?v8", + "rewind": "unicode/23ea.png?v8", + "rhinoceros": "unicode/1f98f.png?v8", + "ribbon": "unicode/1f380.png?v8", + "rice": "unicode/1f35a.png?v8", + "rice_ball": "unicode/1f359.png?v8", + "rice_cracker": "unicode/1f358.png?v8", + "rice_scene": "unicode/1f391.png?v8", + "right_anger_bubble": "unicode/1f5ef.png?v8", + "ring": "unicode/1f48d.png?v8", + "ringed_planet": "unicode/1fa90.png?v8", + "robot": "unicode/1f916.png?v8", + "rock": "unicode/1faa8.png?v8", + "rocket": "unicode/1f680.png?v8", + "rofl": "unicode/1f923.png?v8", + "roll_eyes": "unicode/1f644.png?v8", + "roll_of_paper": "unicode/1f9fb.png?v8", + "roller_coaster": "unicode/1f3a2.png?v8", + "roller_skate": "unicode/1f6fc.png?v8", + "romania": "unicode/1f1f7-1f1f4.png?v8", + "rooster": "unicode/1f413.png?v8", + "rose": "unicode/1f339.png?v8", + "rosette": "unicode/1f3f5.png?v8", + "rotating_light": "unicode/1f6a8.png?v8", + "round_pushpin": "unicode/1f4cd.png?v8", + "rowboat": "unicode/1f6a3.png?v8", + "rowing_man": "unicode/1f6a3-2642.png?v8", + "rowing_woman": "unicode/1f6a3-2640.png?v8", + "ru": "unicode/1f1f7-1f1fa.png?v8", + "rugby_football": "unicode/1f3c9.png?v8", + "runner": "unicode/1f3c3.png?v8", + "running": "unicode/1f3c3.png?v8", + "running_man": "unicode/1f3c3-2642.png?v8", + "running_shirt_with_sash": "unicode/1f3bd.png?v8", + "running_woman": "unicode/1f3c3-2640.png?v8", + "rwanda": "unicode/1f1f7-1f1fc.png?v8", + "sa": "unicode/1f202.png?v8", + "safety_pin": "unicode/1f9f7.png?v8", + "safety_vest": "unicode/1f9ba.png?v8", + "sagittarius": "unicode/2650.png?v8", + "sailboat": "unicode/26f5.png?v8", + "sake": "unicode/1f376.png?v8", + "salt": "unicode/1f9c2.png?v8", + "samoa": "unicode/1f1fc-1f1f8.png?v8", + "san_marino": "unicode/1f1f8-1f1f2.png?v8", + "sandal": "unicode/1f461.png?v8", + "sandwich": "unicode/1f96a.png?v8", + "santa": "unicode/1f385.png?v8", + "sao_tome_principe": "unicode/1f1f8-1f1f9.png?v8", + "sari": "unicode/1f97b.png?v8", + "sassy_man": "unicode/1f481-2642.png?v8", + "sassy_woman": "unicode/1f481-2640.png?v8", + "satellite": "unicode/1f4e1.png?v8", + "satisfied": "unicode/1f606.png?v8", + "saudi_arabia": "unicode/1f1f8-1f1e6.png?v8", + "sauna_man": "unicode/1f9d6-2642.png?v8", + "sauna_person": "unicode/1f9d6.png?v8", + "sauna_woman": "unicode/1f9d6-2640.png?v8", + "sauropod": "unicode/1f995.png?v8", + "saxophone": "unicode/1f3b7.png?v8", + "scarf": "unicode/1f9e3.png?v8", + "school": "unicode/1f3eb.png?v8", + "school_satchel": "unicode/1f392.png?v8", + "scientist": "unicode/1f9d1-1f52c.png?v8", + "scissors": "unicode/2702.png?v8", + "scorpion": "unicode/1f982.png?v8", + "scorpius": "unicode/264f.png?v8", + "scotland": "unicode/1f3f4-e0067-e0062-e0073-e0063-e0074-e007f.png?v8", + "scream": "unicode/1f631.png?v8", + "scream_cat": "unicode/1f640.png?v8", + "screwdriver": "unicode/1fa9b.png?v8", + "scroll": "unicode/1f4dc.png?v8", + "seal": "unicode/1f9ad.png?v8", + "seat": "unicode/1f4ba.png?v8", + "secret": "unicode/3299.png?v8", + "see_no_evil": "unicode/1f648.png?v8", + "seedling": "unicode/1f331.png?v8", + "selfie": "unicode/1f933.png?v8", + "senegal": "unicode/1f1f8-1f1f3.png?v8", + "serbia": "unicode/1f1f7-1f1f8.png?v8", + "service_dog": "unicode/1f415-1f9ba.png?v8", + "seven": "unicode/0037-20e3.png?v8", + "sewing_needle": "unicode/1faa1.png?v8", + "seychelles": "unicode/1f1f8-1f1e8.png?v8", + "shallow_pan_of_food": "unicode/1f958.png?v8", + "shamrock": "unicode/2618.png?v8", + "shark": "unicode/1f988.png?v8", + "shaved_ice": "unicode/1f367.png?v8", + "sheep": "unicode/1f411.png?v8", + "shell": "unicode/1f41a.png?v8", + "shield": "unicode/1f6e1.png?v8", + "shinto_shrine": "unicode/26e9.png?v8", + "ship": "unicode/1f6a2.png?v8", + "shipit": "shipit.png?v8", + "shirt": "unicode/1f455.png?v8", + "shit": "unicode/1f4a9.png?v8", + "shoe": "unicode/1f45e.png?v8", + "shopping": "unicode/1f6cd.png?v8", + "shopping_cart": "unicode/1f6d2.png?v8", + "shorts": "unicode/1fa73.png?v8", + "shower": "unicode/1f6bf.png?v8", + "shrimp": "unicode/1f990.png?v8", + "shrug": "unicode/1f937.png?v8", + "shushing_face": "unicode/1f92b.png?v8", + "sierra_leone": "unicode/1f1f8-1f1f1.png?v8", + "signal_strength": "unicode/1f4f6.png?v8", + "singapore": "unicode/1f1f8-1f1ec.png?v8", + "singer": "unicode/1f9d1-1f3a4.png?v8", + "sint_maarten": "unicode/1f1f8-1f1fd.png?v8", + "six": "unicode/0036-20e3.png?v8", + "six_pointed_star": "unicode/1f52f.png?v8", + "skateboard": "unicode/1f6f9.png?v8", + "ski": "unicode/1f3bf.png?v8", + "skier": "unicode/26f7.png?v8", + "skull": "unicode/1f480.png?v8", + "skull_and_crossbones": "unicode/2620.png?v8", + "skunk": "unicode/1f9a8.png?v8", + "sled": "unicode/1f6f7.png?v8", + "sleeping": "unicode/1f634.png?v8", + "sleeping_bed": "unicode/1f6cc.png?v8", + "sleepy": "unicode/1f62a.png?v8", + "slightly_frowning_face": "unicode/1f641.png?v8", + "slightly_smiling_face": "unicode/1f642.png?v8", + "slot_machine": "unicode/1f3b0.png?v8", + "sloth": "unicode/1f9a5.png?v8", + "slovakia": "unicode/1f1f8-1f1f0.png?v8", + "slovenia": "unicode/1f1f8-1f1ee.png?v8", + "small_airplane": "unicode/1f6e9.png?v8", + "small_blue_diamond": "unicode/1f539.png?v8", + "small_orange_diamond": "unicode/1f538.png?v8", + "small_red_triangle": "unicode/1f53a.png?v8", + "small_red_triangle_down": "unicode/1f53b.png?v8", + "smile": "unicode/1f604.png?v8", + "smile_cat": "unicode/1f638.png?v8", + "smiley": "unicode/1f603.png?v8", + "smiley_cat": "unicode/1f63a.png?v8", + "smiling_face_with_tear": "unicode/1f972.png?v8", + "smiling_face_with_three_hearts": "unicode/1f970.png?v8", + "smiling_imp": "unicode/1f608.png?v8", + "smirk": "unicode/1f60f.png?v8", + "smirk_cat": "unicode/1f63c.png?v8", + "smoking": "unicode/1f6ac.png?v8", + "snail": "unicode/1f40c.png?v8", + "snake": "unicode/1f40d.png?v8", + "sneezing_face": "unicode/1f927.png?v8", + "snowboarder": "unicode/1f3c2.png?v8", + "snowflake": "unicode/2744.png?v8", + "snowman": "unicode/26c4.png?v8", + "snowman_with_snow": "unicode/2603.png?v8", + "soap": "unicode/1f9fc.png?v8", + "sob": "unicode/1f62d.png?v8", + "soccer": "unicode/26bd.png?v8", + "socks": "unicode/1f9e6.png?v8", + "softball": "unicode/1f94e.png?v8", + "solomon_islands": "unicode/1f1f8-1f1e7.png?v8", + "somalia": "unicode/1f1f8-1f1f4.png?v8", + "soon": "unicode/1f51c.png?v8", + "sos": "unicode/1f198.png?v8", + "sound": "unicode/1f509.png?v8", + "south_africa": "unicode/1f1ff-1f1e6.png?v8", + "south_georgia_south_sandwich_islands": "unicode/1f1ec-1f1f8.png?v8", + "south_sudan": "unicode/1f1f8-1f1f8.png?v8", + "space_invader": "unicode/1f47e.png?v8", + "spades": "unicode/2660.png?v8", + "spaghetti": "unicode/1f35d.png?v8", + "sparkle": "unicode/2747.png?v8", + "sparkler": "unicode/1f387.png?v8", + "sparkles": "unicode/2728.png?v8", + "sparkling_heart": "unicode/1f496.png?v8", + "speak_no_evil": "unicode/1f64a.png?v8", + "speaker": "unicode/1f508.png?v8", + "speaking_head": "unicode/1f5e3.png?v8", + "speech_balloon": "unicode/1f4ac.png?v8", + "speedboat": "unicode/1f6a4.png?v8", + "spider": "unicode/1f577.png?v8", + "spider_web": "unicode/1f578.png?v8", + "spiral_calendar": "unicode/1f5d3.png?v8", + "spiral_notepad": "unicode/1f5d2.png?v8", + "sponge": "unicode/1f9fd.png?v8", + "spoon": "unicode/1f944.png?v8", + "squid": "unicode/1f991.png?v8", + "sri_lanka": "unicode/1f1f1-1f1f0.png?v8", + "st_barthelemy": "unicode/1f1e7-1f1f1.png?v8", + "st_helena": "unicode/1f1f8-1f1ed.png?v8", + "st_kitts_nevis": "unicode/1f1f0-1f1f3.png?v8", + "st_lucia": "unicode/1f1f1-1f1e8.png?v8", + "st_martin": "unicode/1f1f2-1f1eb.png?v8", + "st_pierre_miquelon": "unicode/1f1f5-1f1f2.png?v8", + "st_vincent_grenadines": "unicode/1f1fb-1f1e8.png?v8", + "stadium": "unicode/1f3df.png?v8", + "standing_man": "unicode/1f9cd-2642.png?v8", + "standing_person": "unicode/1f9cd.png?v8", + "standing_woman": "unicode/1f9cd-2640.png?v8", + "star": "unicode/2b50.png?v8", + "star2": "unicode/1f31f.png?v8", + "star_and_crescent": "unicode/262a.png?v8", + "star_of_david": "unicode/2721.png?v8", + "star_struck": "unicode/1f929.png?v8", + "stars": "unicode/1f320.png?v8", + "station": "unicode/1f689.png?v8", + "statue_of_liberty": "unicode/1f5fd.png?v8", + "steam_locomotive": "unicode/1f682.png?v8", + "stethoscope": "unicode/1fa7a.png?v8", + "stew": "unicode/1f372.png?v8", + "stop_button": "unicode/23f9.png?v8", + "stop_sign": "unicode/1f6d1.png?v8", + "stopwatch": "unicode/23f1.png?v8", + "straight_ruler": "unicode/1f4cf.png?v8", + "strawberry": "unicode/1f353.png?v8", + "stuck_out_tongue": "unicode/1f61b.png?v8", + "stuck_out_tongue_closed_eyes": "unicode/1f61d.png?v8", + "stuck_out_tongue_winking_eye": "unicode/1f61c.png?v8", + "student": "unicode/1f9d1-1f393.png?v8", + "studio_microphone": "unicode/1f399.png?v8", + "stuffed_flatbread": "unicode/1f959.png?v8", + "sudan": "unicode/1f1f8-1f1e9.png?v8", + "sun_behind_large_cloud": "unicode/1f325.png?v8", + "sun_behind_rain_cloud": "unicode/1f326.png?v8", + "sun_behind_small_cloud": "unicode/1f324.png?v8", + "sun_with_face": "unicode/1f31e.png?v8", + "sunflower": "unicode/1f33b.png?v8", + "sunglasses": "unicode/1f60e.png?v8", + "sunny": "unicode/2600.png?v8", + "sunrise": "unicode/1f305.png?v8", + "sunrise_over_mountains": "unicode/1f304.png?v8", + "superhero": "unicode/1f9b8.png?v8", + "superhero_man": "unicode/1f9b8-2642.png?v8", + "superhero_woman": "unicode/1f9b8-2640.png?v8", + "supervillain": "unicode/1f9b9.png?v8", + "supervillain_man": "unicode/1f9b9-2642.png?v8", + "supervillain_woman": "unicode/1f9b9-2640.png?v8", + "surfer": "unicode/1f3c4.png?v8", + "surfing_man": "unicode/1f3c4-2642.png?v8", + "surfing_woman": "unicode/1f3c4-2640.png?v8", + "suriname": "unicode/1f1f8-1f1f7.png?v8", + "sushi": "unicode/1f363.png?v8", + "suspect": "suspect.png?v8", + "suspension_railway": "unicode/1f69f.png?v8", + "svalbard_jan_mayen": "unicode/1f1f8-1f1ef.png?v8", + "swan": "unicode/1f9a2.png?v8", + "swaziland": "unicode/1f1f8-1f1ff.png?v8", + "sweat": "unicode/1f613.png?v8", + "sweat_drops": "unicode/1f4a6.png?v8", + "sweat_smile": "unicode/1f605.png?v8", + "sweden": "unicode/1f1f8-1f1ea.png?v8", + "sweet_potato": "unicode/1f360.png?v8", + "swim_brief": "unicode/1fa72.png?v8", + "swimmer": "unicode/1f3ca.png?v8", + "swimming_man": "unicode/1f3ca-2642.png?v8", + "swimming_woman": "unicode/1f3ca-2640.png?v8", + "switzerland": "unicode/1f1e8-1f1ed.png?v8", + "symbols": "unicode/1f523.png?v8", + "synagogue": "unicode/1f54d.png?v8", + "syria": "unicode/1f1f8-1f1fe.png?v8", + "syringe": "unicode/1f489.png?v8", + "t-rex": "unicode/1f996.png?v8", + "taco": "unicode/1f32e.png?v8", + "tada": "unicode/1f389.png?v8", + "taiwan": "unicode/1f1f9-1f1fc.png?v8", + "tajikistan": "unicode/1f1f9-1f1ef.png?v8", + "takeout_box": "unicode/1f961.png?v8", + "tamale": "unicode/1fad4.png?v8", + "tanabata_tree": "unicode/1f38b.png?v8", + "tangerine": "unicode/1f34a.png?v8", + "tanzania": "unicode/1f1f9-1f1ff.png?v8", + "taurus": "unicode/2649.png?v8", + "taxi": "unicode/1f695.png?v8", + "tea": "unicode/1f375.png?v8", + "teacher": "unicode/1f9d1-1f3eb.png?v8", + "teapot": "unicode/1fad6.png?v8", + "technologist": "unicode/1f9d1-1f4bb.png?v8", + "teddy_bear": "unicode/1f9f8.png?v8", + "telephone": "unicode/260e.png?v8", + "telephone_receiver": "unicode/1f4de.png?v8", + "telescope": "unicode/1f52d.png?v8", + "tennis": "unicode/1f3be.png?v8", + "tent": "unicode/26fa.png?v8", + "test_tube": "unicode/1f9ea.png?v8", + "thailand": "unicode/1f1f9-1f1ed.png?v8", + "thermometer": "unicode/1f321.png?v8", + "thinking": "unicode/1f914.png?v8", + "thong_sandal": "unicode/1fa74.png?v8", + "thought_balloon": "unicode/1f4ad.png?v8", + "thread": "unicode/1f9f5.png?v8", + "three": "unicode/0033-20e3.png?v8", + "thumbsdown": "unicode/1f44e.png?v8", + "thumbsup": "unicode/1f44d.png?v8", + "ticket": "unicode/1f3ab.png?v8", + "tickets": "unicode/1f39f.png?v8", + "tiger": "unicode/1f42f.png?v8", + "tiger2": "unicode/1f405.png?v8", + "timer_clock": "unicode/23f2.png?v8", + "timor_leste": "unicode/1f1f9-1f1f1.png?v8", + "tipping_hand_man": "unicode/1f481-2642.png?v8", + "tipping_hand_person": "unicode/1f481.png?v8", + "tipping_hand_woman": "unicode/1f481-2640.png?v8", + "tired_face": "unicode/1f62b.png?v8", + "tm": "unicode/2122.png?v8", + "togo": "unicode/1f1f9-1f1ec.png?v8", + "toilet": "unicode/1f6bd.png?v8", + "tokelau": "unicode/1f1f9-1f1f0.png?v8", + "tokyo_tower": "unicode/1f5fc.png?v8", + "tomato": "unicode/1f345.png?v8", + "tonga": "unicode/1f1f9-1f1f4.png?v8", + "tongue": "unicode/1f445.png?v8", + "toolbox": "unicode/1f9f0.png?v8", + "tooth": "unicode/1f9b7.png?v8", + "toothbrush": "unicode/1faa5.png?v8", + "top": "unicode/1f51d.png?v8", + "tophat": "unicode/1f3a9.png?v8", + "tornado": "unicode/1f32a.png?v8", + "tr": "unicode/1f1f9-1f1f7.png?v8", + "trackball": "unicode/1f5b2.png?v8", + "tractor": "unicode/1f69c.png?v8", + "traffic_light": "unicode/1f6a5.png?v8", + "train": "unicode/1f68b.png?v8", + "train2": "unicode/1f686.png?v8", + "tram": "unicode/1f68a.png?v8", + "transgender_flag": "unicode/1f3f3-26a7.png?v8", + "transgender_symbol": "unicode/26a7.png?v8", + "triangular_flag_on_post": "unicode/1f6a9.png?v8", + "triangular_ruler": "unicode/1f4d0.png?v8", + "trident": "unicode/1f531.png?v8", + "trinidad_tobago": "unicode/1f1f9-1f1f9.png?v8", + "tristan_da_cunha": "unicode/1f1f9-1f1e6.png?v8", + "triumph": "unicode/1f624.png?v8", + "trolleybus": "unicode/1f68e.png?v8", + "trollface": "trollface.png?v8", + "trophy": "unicode/1f3c6.png?v8", + "tropical_drink": "unicode/1f379.png?v8", + "tropical_fish": "unicode/1f420.png?v8", + "truck": "unicode/1f69a.png?v8", + "trumpet": "unicode/1f3ba.png?v8", + "tshirt": "unicode/1f455.png?v8", + "tulip": "unicode/1f337.png?v8", + "tumbler_glass": "unicode/1f943.png?v8", + "tunisia": "unicode/1f1f9-1f1f3.png?v8", + "turkey": "unicode/1f983.png?v8", + "turkmenistan": "unicode/1f1f9-1f1f2.png?v8", + "turks_caicos_islands": "unicode/1f1f9-1f1e8.png?v8", + "turtle": "unicode/1f422.png?v8", + "tuvalu": "unicode/1f1f9-1f1fb.png?v8", + "tv": "unicode/1f4fa.png?v8", + "twisted_rightwards_arrows": "unicode/1f500.png?v8", + "two": "unicode/0032-20e3.png?v8", + "two_hearts": "unicode/1f495.png?v8", + "two_men_holding_hands": "unicode/1f46c.png?v8", + "two_women_holding_hands": "unicode/1f46d.png?v8", + "u5272": "unicode/1f239.png?v8", + "u5408": "unicode/1f234.png?v8", + "u55b6": "unicode/1f23a.png?v8", + "u6307": "unicode/1f22f.png?v8", + "u6708": "unicode/1f237.png?v8", + "u6709": "unicode/1f236.png?v8", + "u6e80": "unicode/1f235.png?v8", + "u7121": "unicode/1f21a.png?v8", + "u7533": "unicode/1f238.png?v8", + "u7981": "unicode/1f232.png?v8", + "u7a7a": "unicode/1f233.png?v8", + "uganda": "unicode/1f1fa-1f1ec.png?v8", + "uk": "unicode/1f1ec-1f1e7.png?v8", + "ukraine": "unicode/1f1fa-1f1e6.png?v8", + "umbrella": "unicode/2614.png?v8", + "unamused": "unicode/1f612.png?v8", + "underage": "unicode/1f51e.png?v8", + "unicorn": "unicode/1f984.png?v8", + "united_arab_emirates": "unicode/1f1e6-1f1ea.png?v8", + "united_nations": "unicode/1f1fa-1f1f3.png?v8", + "unlock": "unicode/1f513.png?v8", + "up": "unicode/1f199.png?v8", + "upside_down_face": "unicode/1f643.png?v8", + "uruguay": "unicode/1f1fa-1f1fe.png?v8", + "us": "unicode/1f1fa-1f1f8.png?v8", + "us_outlying_islands": "unicode/1f1fa-1f1f2.png?v8", + "us_virgin_islands": "unicode/1f1fb-1f1ee.png?v8", + "uzbekistan": "unicode/1f1fa-1f1ff.png?v8", + "v": "unicode/270c.png?v8", + "vampire": "unicode/1f9db.png?v8", + "vampire_man": "unicode/1f9db-2642.png?v8", + "vampire_woman": "unicode/1f9db-2640.png?v8", + "vanuatu": "unicode/1f1fb-1f1fa.png?v8", + "vatican_city": "unicode/1f1fb-1f1e6.png?v8", + "venezuela": "unicode/1f1fb-1f1ea.png?v8", + "vertical_traffic_light": "unicode/1f6a6.png?v8", + "vhs": "unicode/1f4fc.png?v8", + "vibration_mode": "unicode/1f4f3.png?v8", + "video_camera": "unicode/1f4f9.png?v8", + "video_game": "unicode/1f3ae.png?v8", + "vietnam": "unicode/1f1fb-1f1f3.png?v8", + "violin": "unicode/1f3bb.png?v8", + "virgo": "unicode/264d.png?v8", + "volcano": "unicode/1f30b.png?v8", + "volleyball": "unicode/1f3d0.png?v8", + "vomiting_face": "unicode/1f92e.png?v8", + "vs": "unicode/1f19a.png?v8", + "vulcan_salute": "unicode/1f596.png?v8", + "waffle": "unicode/1f9c7.png?v8", + "wales": "unicode/1f3f4-e0067-e0062-e0077-e006c-e0073-e007f.png?v8", + "walking": "unicode/1f6b6.png?v8", + "walking_man": "unicode/1f6b6-2642.png?v8", + "walking_woman": "unicode/1f6b6-2640.png?v8", + "wallis_futuna": "unicode/1f1fc-1f1eb.png?v8", + "waning_crescent_moon": "unicode/1f318.png?v8", + "waning_gibbous_moon": "unicode/1f316.png?v8", + "warning": "unicode/26a0.png?v8", + "wastebasket": "unicode/1f5d1.png?v8", + "watch": "unicode/231a.png?v8", + "water_buffalo": "unicode/1f403.png?v8", + "water_polo": "unicode/1f93d.png?v8", + "watermelon": "unicode/1f349.png?v8", + "wave": "unicode/1f44b.png?v8", + "wavy_dash": "unicode/3030.png?v8", + "waxing_crescent_moon": "unicode/1f312.png?v8", + "waxing_gibbous_moon": "unicode/1f314.png?v8", + "wc": "unicode/1f6be.png?v8", + "weary": "unicode/1f629.png?v8", + "wedding": "unicode/1f492.png?v8", + "weight_lifting": "unicode/1f3cb.png?v8", + "weight_lifting_man": "unicode/1f3cb-2642.png?v8", + "weight_lifting_woman": "unicode/1f3cb-2640.png?v8", + "western_sahara": "unicode/1f1ea-1f1ed.png?v8", + "whale": "unicode/1f433.png?v8", + "whale2": "unicode/1f40b.png?v8", + "wheel_of_dharma": "unicode/2638.png?v8", + "wheelchair": "unicode/267f.png?v8", + "white_check_mark": "unicode/2705.png?v8", + "white_circle": "unicode/26aa.png?v8", + "white_flag": "unicode/1f3f3.png?v8", + "white_flower": "unicode/1f4ae.png?v8", + "white_haired_man": "unicode/1f468-1f9b3.png?v8", + "white_haired_woman": "unicode/1f469-1f9b3.png?v8", + "white_heart": "unicode/1f90d.png?v8", + "white_large_square": "unicode/2b1c.png?v8", + "white_medium_small_square": "unicode/25fd.png?v8", + "white_medium_square": "unicode/25fb.png?v8", + "white_small_square": "unicode/25ab.png?v8", + "white_square_button": "unicode/1f533.png?v8", + "wilted_flower": "unicode/1f940.png?v8", + "wind_chime": "unicode/1f390.png?v8", + "wind_face": "unicode/1f32c.png?v8", + "window": "unicode/1fa9f.png?v8", + "wine_glass": "unicode/1f377.png?v8", + "wink": "unicode/1f609.png?v8", + "wolf": "unicode/1f43a.png?v8", + "woman": "unicode/1f469.png?v8", + "woman_artist": "unicode/1f469-1f3a8.png?v8", + "woman_astronaut": "unicode/1f469-1f680.png?v8", + "woman_beard": "unicode/1f9d4-2640.png?v8", + "woman_cartwheeling": "unicode/1f938-2640.png?v8", + "woman_cook": "unicode/1f469-1f373.png?v8", + "woman_dancing": "unicode/1f483.png?v8", + "woman_facepalming": "unicode/1f926-2640.png?v8", + "woman_factory_worker": "unicode/1f469-1f3ed.png?v8", + "woman_farmer": "unicode/1f469-1f33e.png?v8", + "woman_feeding_baby": "unicode/1f469-1f37c.png?v8", + "woman_firefighter": "unicode/1f469-1f692.png?v8", + "woman_health_worker": "unicode/1f469-2695.png?v8", + "woman_in_manual_wheelchair": "unicode/1f469-1f9bd.png?v8", + "woman_in_motorized_wheelchair": "unicode/1f469-1f9bc.png?v8", + "woman_in_tuxedo": "unicode/1f935-2640.png?v8", + "woman_judge": "unicode/1f469-2696.png?v8", + "woman_juggling": "unicode/1f939-2640.png?v8", + "woman_mechanic": "unicode/1f469-1f527.png?v8", + "woman_office_worker": "unicode/1f469-1f4bc.png?v8", + "woman_pilot": "unicode/1f469-2708.png?v8", + "woman_playing_handball": "unicode/1f93e-2640.png?v8", + "woman_playing_water_polo": "unicode/1f93d-2640.png?v8", + "woman_scientist": "unicode/1f469-1f52c.png?v8", + "woman_shrugging": "unicode/1f937-2640.png?v8", + "woman_singer": "unicode/1f469-1f3a4.png?v8", + "woman_student": "unicode/1f469-1f393.png?v8", + "woman_teacher": "unicode/1f469-1f3eb.png?v8", + "woman_technologist": "unicode/1f469-1f4bb.png?v8", + "woman_with_headscarf": "unicode/1f9d5.png?v8", + "woman_with_probing_cane": "unicode/1f469-1f9af.png?v8", + "woman_with_turban": "unicode/1f473-2640.png?v8", + "woman_with_veil": "unicode/1f470-2640.png?v8", + "womans_clothes": "unicode/1f45a.png?v8", + "womans_hat": "unicode/1f452.png?v8", + "women_wrestling": "unicode/1f93c-2640.png?v8", + "womens": "unicode/1f6ba.png?v8", + "wood": "unicode/1fab5.png?v8", + "woozy_face": "unicode/1f974.png?v8", + "world_map": "unicode/1f5fa.png?v8", + "worm": "unicode/1fab1.png?v8", + "worried": "unicode/1f61f.png?v8", + "wrench": "unicode/1f527.png?v8", + "wrestling": "unicode/1f93c.png?v8", + "writing_hand": "unicode/270d.png?v8", + "x": "unicode/274c.png?v8", + "yarn": "unicode/1f9f6.png?v8", + "yawning_face": "unicode/1f971.png?v8", + "yellow_circle": "unicode/1f7e1.png?v8", + "yellow_heart": "unicode/1f49b.png?v8", + "yellow_square": "unicode/1f7e8.png?v8", + "yemen": "unicode/1f1fe-1f1ea.png?v8", + "yen": "unicode/1f4b4.png?v8", + "yin_yang": "unicode/262f.png?v8", + "yo_yo": "unicode/1fa80.png?v8", + "yum": "unicode/1f60b.png?v8", + "zambia": "unicode/1f1ff-1f1f2.png?v8", + "zany_face": "unicode/1f92a.png?v8", + "zap": "unicode/26a1.png?v8", + "zebra": "unicode/1f993.png?v8", + "zero": "unicode/0030-20e3.png?v8", + "zimbabwe": "unicode/1f1ff-1f1fc.png?v8", + "zipper_mouth_face": "unicode/1f910.png?v8", + "zombie": "unicode/1f9df.png?v8", + "zombie_man": "unicode/1f9df-2642.png?v8", + "zombie_woman": "unicode/1f9df-2640.png?v8", + "zzz": "unicode/1f4a4.png?v8" + } + }; + + function replaceEmojiShorthand(m, $1, useNativeEmoji) { + var emojiMatch = emojiData.data[$1]; + + var result = m; + + if (emojiMatch) { + if (useNativeEmoji && /unicode/.test(emojiMatch)) { + var emojiUnicode = emojiMatch + .replace('unicode/', '') + .replace(/\.png.*/, '') + .split('-') + .map(function (u) { return ("&#x" + u + ";"); }) + // Separate multi-character emoji with zero width joiner sequence (ZWJ) + // Hat tip: https://about.gitlab.com/blog/2018/05/30/journey-in-native-unicode-emoji/#emoji-made-up-of-multiple-characters + .join('‍') + .concat('︎'); + result = "" + emojiUnicode + ""; + } else { + result = "\"""; + } + } + + return result; + } + + function emojify(text, useNativeEmoji) { + return ( + text + // Mark colons in tags + .replace( + /<(code|pre|script|template)[^>]*?>[\s\S]+?<\/(code|pre|script|template)>/g, + function (m) { return m.replace(/:/g, '__colon__'); } + ) + // Mark colons in comments + .replace(//g, function (m) { return m.replace(/:/g, '__colon__'); }) + // Mark colons in URIs + .replace(/([a-z]{2,}:)?\/\/[^\s'">)]+/gi, function (m) { return m.replace(/:/g, '__colon__'); } + ) + // Replace emoji shorthand codes + .replace(/:([a-z0-9_\-+]+?):/g, function (m, $1) { return replaceEmojiShorthand(m, $1, useNativeEmoji); } + ) + // Restore colons in tags and comments + .replace(/__colon__/g, ':') + ); + } + + /** + * Converts a colon formatted string to a object with properties. + * + * This is process a provided string and look for any tokens in the format + * of `:name[=value]` and then convert it to a object and return. + * An example of this is ':include :type=code :fragment=demo' is taken and + * then converted to: + * + * ``` + * { + * include: '', + * type: 'code', + * fragment: 'demo' + * } + * ``` + * + * @param {string} str The string to parse. + * + * @return {object} The original string and parsed object, { str, config }. + */ + function getAndRemoveConfig(str) { + if ( str === void 0 ) str = ''; + + var config = {}; + + if (str) { + str = str + .replace(/^('|")/, '') + .replace(/('|")$/, '') + .replace(/(?:^|\s):([\w-]+:?)=?([\w-%]+)?/g, function (m, key, value) { + if (key.indexOf(':') === -1) { + config[key] = (value && value.replace(/"/g, '')) || true; + return ''; + } + + return m; + }) + .trim(); + } + + return { str: str, config: config }; + } + + /** + * Remove the tag from sidebar when the header with link, details see issue 1069 + * @param {string} str The string to deal with. + * + * @return {string} str The string after delete the element. + */ + function removeAtag(str) { + if ( str === void 0 ) str = ''; + + return str.replace(/(<\/?a.*?>)/gi, ''); + } + + var imageCompiler = function (ref) { + var renderer = ref.renderer; + var contentBase = ref.contentBase; + var router = ref.router; + + return (renderer.image = function (href, title, text) { + var url = href; + var attrs = []; + + var ref = getAndRemoveConfig(title); + var str = ref.str; + var config = ref.config; + title = str; + + if (config['no-zoom']) { + attrs.push('data-no-zoom'); + } + + if (title) { + attrs.push(("title=\"" + title + "\"")); + } + + if (config.size) { + var ref$1 = config.size.split('x'); + var width = ref$1[0]; + var height = ref$1[1]; + if (height) { + attrs.push(("width=\"" + width + "\" height=\"" + height + "\"")); + } else { + attrs.push(("width=\"" + width + "\"")); + } + } + + if (config.class) { + attrs.push(("class=\"" + (config.class) + "\"")); + } + + if (config.id) { + attrs.push(("id=\"" + (config.id) + "\"")); + } + + if (!isAbsolutePath(href)) { + url = getPath(contentBase, getParentPath(router.getCurrentPath()), href); + } + + if (attrs.length > 0) { + return ("\"""); + } + + return ("\"""); + }); + }; + + var prism = createCommonjsModule(function (module) { + /* ********************************************** + Begin prism-core.js + ********************************************** */ + + /// + + var _self = (typeof window !== 'undefined') + ? window // if in browser + : ( + (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) + ? self // if in worker + : {} // if in node js + ); + + /** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */ + var Prism = (function (_self) { + + // Private helper vars + var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i; + var uniqueId = 0; + + // The grammar object for plaintext + var plainTextGrammar = {}; + + + var _ = { + /** + * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the + * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load + * additional languages or plugins yourself. + * + * By setting this value to `true`, Prism will not automatically highlight all code elements on the page. + * + * You obviously have to change this value before the automatic highlighting started. To do this, you can add an + * empty Prism object into the global scope before loading the Prism script like this: + * + * ```js + * window.Prism = window.Prism || {}; + * Prism.manual = true; + * // add a new + + + + \ No newline at end of file diff --git a/maybe_tampered/```JavaScript.txt b/maybe_tampered/```JavaScript.txt new file mode 100644 index 0000000..32c11b1 --- /dev/null +++ b/maybe_tampered/```JavaScript.txt @@ -0,0 +1,16 @@ +```JavaScript + +const settings = { +console: console, +that: this +} + +class InitLogs { + constructor() { + const inject = this.settings; + Object.assign(this, inject, Window); +this.inject = settings; +} + +} +``` \ No newline at end of file diff --git a/maybe_tampered/eventemitter3/README.md b/maybe_tampered/eventemitter3/README.md new file mode 100644 index 0000000..aba7e18 --- /dev/null +++ b/maybe_tampered/eventemitter3/README.md @@ -0,0 +1,94 @@ +# EventEmitter3 + +[![Version npm](https://img.shields.io/npm/v/eventemitter3.svg?style=flat-square)](https://www.npmjs.com/package/eventemitter3)[![Build Status](https://img.shields.io/travis/primus/eventemitter3/master.svg?style=flat-square)](https://travis-ci.org/primus/eventemitter3)[![Dependencies](https://img.shields.io/david/primus/eventemitter3.svg?style=flat-square)](https://david-dm.org/primus/eventemitter3)[![Coverage Status](https://img.shields.io/coveralls/primus/eventemitter3/master.svg?style=flat-square)](https://coveralls.io/r/primus/eventemitter3?branch=master)[![IRC channel](https://img.shields.io/badge/IRC-irc.freenode.net%23primus-00a8ff.svg?style=flat-square)](https://webchat.freenode.net/?channels=primus) + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/eventemitter3.svg)](https://saucelabs.com/u/eventemitter3) + +EventEmitter3 is a high performance EventEmitter. It has been micro-optimized +for various of code paths making this, one of, if not the fastest EventEmitter +available for Node.js and browsers. The module is API compatible with the +EventEmitter that ships by default with Node.js but there are some slight +differences: + +- Domain support has been removed. +- We do not `throw` an error when you emit an `error` event and nobody is + listening. +- The `newListener` and `removeListener` events have been removed as they + are useful only in some uncommon use-cases. +- The `setMaxListeners`, `getMaxListeners`, `prependListener` and + `prependOnceListener` methods are not available. +- Support for custom context for events so there is no need to use `fn.bind`. +- The `removeListener` method removes all matching listeners, not only the + first. + +It's a drop in replacement for existing EventEmitters, but just faster. Free +performance, who wouldn't want that? The EventEmitter is written in EcmaScript 3 +so it will work in the oldest browsers and node versions that you need to +support. + +## Installation + +```bash +$ npm install --save eventemitter3 +``` + +## CDN + +Recommended CDN: + +```text +https://unpkg.com/eventemitter3@latest/umd/eventemitter3.min.js +``` + +## Usage + +After installation the only thing you need to do is require the module: + +```js +var EventEmitter = require('eventemitter3'); +``` + +And you're ready to create your own EventEmitter instances. For the API +documentation, please follow the official Node.js documentation: + +http://nodejs.org/api/events.html + +### Contextual emits + +We've upgraded the API of the `EventEmitter.on`, `EventEmitter.once` and +`EventEmitter.removeListener` to accept an extra argument which is the `context` +or `this` value that should be set for the emitted events. This means you no +longer have the overhead of an event that required `fn.bind` in order to get a +custom `this` value. + +```js +var EE = new EventEmitter() + , context = { foo: 'bar' }; + +function emitted() { + console.log(this === context); // true +} + +EE.once('event-name', emitted, context); +EE.on('another-event', emitted, context); +EE.removeListener('another-event', emitted, context); +``` + +### Tests and benchmarks + +This module is well tested. You can run: + +- `npm test` to run the tests under Node.js. +- `npm run test-browser` to run the tests in real browsers via Sauce Labs. + +We also have a set of benchmarks to compare EventEmitter3 with some available +alternatives. To run the benchmarks run `npm run benchmark`. + +Tests and benchmarks are not included in the npm package. If you want to play +with them you have to clone the GitHub repository. +Note that you will have to run an additional `npm i` in the benchmarks folder +before `npm run benchmark`. + +## License + +[MIT](LICENSE) diff --git a/maybe_tampered/eventemitter3/index.js b/maybe_tampered/eventemitter3/index.js new file mode 100644 index 0000000..6ea485c --- /dev/null +++ b/maybe_tampered/eventemitter3/index.js @@ -0,0 +1,336 @@ +'use strict'; + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} diff --git a/maybe_tampered/eventemitter3/index.txt b/maybe_tampered/eventemitter3/index.txt new file mode 100644 index 0000000..118f68b --- /dev/null +++ b/maybe_tampered/eventemitter3/index.txt @@ -0,0 +1,134 @@ +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + */ +declare class EventEmitter< + EventTypes extends EventEmitter.ValidEventTypes = string | symbol, + Context extends any = any +> { + static prefixed: string | boolean; + + /** + * Return an array listing the events for which the emitter has registered + * listeners. + */ + eventNames(): Array>; + + /** + * Return the listeners registered for a given event. + */ + listeners>( + event: T + ): Array>; + + /** + * Return the number of listeners listening to a given event. + */ + listenerCount(event: EventEmitter.EventNames): number; + + /** + * Calls each of the listeners registered for a given event. + */ + emit>( + event: T, + ...args: EventEmitter.EventArgs + ): boolean; + + /** + * Add a listener for a given event. + */ + on>( + event: T, + fn: EventEmitter.EventListener, + context?: Context + ): this; + addListener>( + event: T, + fn: EventEmitter.EventListener, + context?: Context + ): this; + + /** + * Add a one-time listener for a given event. + */ + once>( + event: T, + fn: EventEmitter.EventListener, + context?: Context + ): this; + + /** + * Remove the listeners of a given event. + */ + removeListener>( + event: T, + fn?: EventEmitter.EventListener, + context?: Context, + once?: boolean + ): this; + off>( + event: T, + fn?: EventEmitter.EventListener, + context?: Context, + once?: boolean + ): this; + + /** + * Remove all listeners, or those of the specified event. + */ + removeAllListeners(event?: EventEmitter.EventNames): this; +} + +declare namespace EventEmitter { + export interface ListenerFn { + (...args: Args): void; + } + + export interface EventEmitterStatic { + new < + EventTypes extends ValidEventTypes = string | symbol, + Context = any + >(): EventEmitter; + } + + /** + * `object` should be in either of the following forms: + * ``` + * interface EventTypes { + * 'event-with-parameters': any[] + * 'event-with-example-handler': (...args: any[]) => void + * } + * ``` + */ + export type ValidEventTypes = string | symbol | object; + + export type EventNames = T extends string | symbol + ? T + : keyof T; + + export type ArgumentMap = { + [K in keyof T]: T[K] extends (...args: any[]) => void + ? Parameters + : T[K] extends any[] + ? T[K] + : any[]; + }; + + export type EventListener< + T extends ValidEventTypes, + K extends EventNames + > = T extends string | symbol + ? (...args: any[]) => void + : ( + ...args: ArgumentMap>[Extract] + ) => void; + + export type EventArgs< + T extends ValidEventTypes, + K extends EventNames + > = Parameters>; + + export const EventEmitter: EventEmitterStatic; +} + +export = EventEmitter; diff --git a/maybe_tampered/eventemitter3/package.json b/maybe_tampered/eventemitter3/package.json new file mode 100644 index 0000000..3c575b4 --- /dev/null +++ b/maybe_tampered/eventemitter3/package.json @@ -0,0 +1,56 @@ +{ + "name": "eventemitter3", + "version": "4.0.7", + "description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.", + "main": "index.js", + "typings": "index.d.ts", + "scripts": { + "browserify": "rm -rf umd && mkdir umd && browserify index.js -s EventEmitter3 -o umd/eventemitter3.js", + "minify": "uglifyjs umd/eventemitter3.js --source-map -cm -o umd/eventemitter3.min.js", + "benchmark": "find benchmarks/run -name '*.js' -exec benchmarks/start.sh {} \\;", + "test": "nyc --reporter=html --reporter=text mocha test/test.js", + "prepublishOnly": "npm run browserify && npm run minify", + "test-browser": "node test/browser.js" + }, + "files": [ + "index.js", + "index.d.ts", + "umd" + ], + "repository": { + "type": "git", + "url": "git://github.com/primus/eventemitter3.git" + }, + "keywords": [ + "EventEmitter", + "EventEmitter2", + "EventEmitter3", + "Events", + "addEventListener", + "addListener", + "emit", + "emits", + "emitter", + "event", + "once", + "pub/sub", + "publish", + "reactor", + "subscribe" + ], + "author": "Arnout Kazemier", + "license": "MIT", + "bugs": { + "url": "https://github.com/primus/eventemitter3/issues" + }, + "devDependencies": { + "assume": "^2.2.0", + "browserify": "^16.5.0", + "mocha": "^8.0.1", + "nyc": "^15.1.0", + "pre-commit": "^1.2.0", + "sauce-browsers": "^2.0.0", + "sauce-test": "^1.3.3", + "uglify-js": "^3.9.0" + } +} diff --git a/maybe_tampered/eventemitter3/umd/eventemitter.js b/maybe_tampered/eventemitter3/umd/eventemitter.js new file mode 100644 index 0000000..2c5bed1 --- /dev/null +++ b/maybe_tampered/eventemitter3/umd/eventemitter.js @@ -0,0 +1,1268 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { + Certificate, + ECNamedCurves, + ECPublicKey, + RSAPublicKey, +} from "./vendor/pkijs.js"; +import { hexToIpv6Repr, b64ToPEM } from "./components/utils.mjs"; + +const getTimeZone = () => { + let timeZone = new Date().toString().match(/\(([A-Za-z\s].*)\)/); + if (timeZone === null) { + // America/Chicago + timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; + } else if (timeZone.length > 1) { + timeZone = timeZone[1]; // Central Daylight Time + } else { + timeZone = "Local Time"; // not sure if this is right, but let's go with it for now + } + return timeZone; +}; + +const getPublicKeyInfo = x509 => { + let publicKey = x509.subjectPublicKeyInfo.parsedKey; + if (publicKey instanceof RSAPublicKey) { + let modulusJSON = publicKey.modulus.toJSON(); + let modulusHex = modulusJSON.valueBlock.valueHex; + return { + e: publicKey.publicExponent.toJSON().valueBlock.valueDec, + kty: "RSA", + n: hashify(modulusHex), + keysize: modulusHex.length * 4, // key size in bits + }; + } + if (publicKey instanceof ECPublicKey) { + let x = hashify(publicKey.x); + let y = hashify(publicKey.y); + let curve = ECNamedCurves.find(publicKey.namedCurve); + let keysize = curve ? curve.size * 8 : undefined; + return { + kty: "Elliptic Curve", + keysize, + x, // x coordinate + y, // y coordinate + xy: `04:${x}:${y}`, // 04 (uncompressed) public key + }; + } + return { kty: "Unknown" }; +}; + +const getX509Ext = (extensions, v) => { + for (var extension in extensions) { + if (extensions[extension].extnID === v) { + return extensions[extension].toJSON().parsedValue; + } + } + return undefined; +}; + +const getKeyUsages = (x509, criticalExtensions) => { + let keyUsages = { + critical: criticalExtensions.includes("2.5.29.15"), + purposes: [], + }; + + let keyUsagesExt = getX509Ext(x509.extensions, "2.5.29.15"); + if (keyUsagesExt !== undefined) { + // zero pad or truncate the hex value to 4 digits + let keyUsagesHex = keyUsagesExt.valueBlock.valueHex + .slice(0, 4) + .padEnd(4, "0"); + + let keyUsagesInt = parseInt(keyUsagesHex, 16); + + // Clear any unused bits (accounting for padding or truncation above). + let unusedBits = keyUsagesExt.valueBlock.unusedBits; + if (keyUsagesExt.valueBlock.valueHex.length == 2) { + unusedBits += 8; + } else if (keyUsagesExt.valueBlock.valueHex.length > 4) { + unusedBits = 0; + } + keyUsagesInt &= ~((1 << unusedBits) - 1); + + // iterate through the bit string + strings.keyUsages.forEach(usage => { + if (keyUsagesInt & 0x8000) { + keyUsages.purposes.push(usage); + } + + keyUsagesInt = keyUsagesInt << 1; + }); + } + + return keyUsages; +}; + +const parseSubsidiary = distinguishedNames => { + const subsidiary = { + cn: "", + dn: [], + entries: [], + }; + + distinguishedNames.forEach(dn => { + const distinguishedName = strings.names[dn.type]; + const value = dn.value.valueBlock.value; + + if (distinguishedName === undefined) { + subsidiary.dn.push(`OID.${dn.type}=${value}`); + subsidiary.entries.push([`OID.${dn.type}`, value]); + } else if (distinguishedName.short === undefined) { + subsidiary.dn.push(`OID.${dn.type}=${value}`); + subsidiary.entries.push([distinguishedName.long, value]); + } else { + subsidiary.dn.push(`${distinguishedName.short}=${value}`); + subsidiary.entries.push([distinguishedName.long, value]); + + // add the common name for tab display + if (distinguishedName.short === "cn") { + subsidiary.cn = value; + } + } + }); + + // turn path into a string + subsidiary.dn = subsidiary.dn.join(", "); + + return subsidiary; +}; + +const getSubjectAltNames = (x509, criticalExtensions) => { + let san = getX509Ext(x509.extensions, "2.5.29.17"); + if (san && san.hasOwnProperty("altNames")) { + san = Object.keys(san.altNames).map(index => { + const type = san.altNames[index].type; + + switch (type) { + case 4: // directory + return [ + strings.san[type], + parseSubsidiary(san.altNames[index].value.typesAndValues).dn, + ]; + case 7: { + // ip address + let address = san.altNames[index].value.valueBlock.valueHex; + + if (address.length === 8) { + // ipv4 + return [ + strings.san[type], + address + .match(/.{1,2}/g) + .map(x => parseInt(x, 16)) + .join("."), + ]; + } else if (address.length === 32) { + // ipv6 + return [strings.san[type], hexToIpv6Repr(address)]; + } + return [strings.san[type], "Unknown IP address"]; + } + default: + return [strings.san[type], san.altNames[index].value]; + } + }); + } else { + san = []; + } + san = { + altNames: san, + critical: criticalExtensions.includes("2.5.29.17"), + }; + return san; +}; + +const getBasicConstraints = (x509, criticalExtensions) => { + let basicConstraints; + const basicConstraintsExt = getX509Ext(x509.extensions, "2.5.29.19"); + if (basicConstraintsExt) { + basicConstraints = { + cA: basicConstraintsExt.cA !== undefined && basicConstraintsExt.cA, + critical: criticalExtensions.includes("2.5.29.19"), + }; + } + return basicConstraints; +}; + +const getEKeyUsages = (x509, criticalExtensions) => { + let eKeyUsages = getX509Ext(x509.extensions, "2.5.29.37"); + if (eKeyUsages) { + eKeyUsages = { + critical: criticalExtensions.includes("2.5.29.37"), + purposes: eKeyUsages.keyPurposes.map(x => strings.eKU[x] || x), + }; + } + return eKeyUsages; +}; + +const getSubjectKeyID = (x509, criticalExtensions) => { + let sKID = getX509Ext(x509.extensions, "2.5.29.14"); + if (sKID) { + sKID = { + critical: criticalExtensions.includes("2.5.29.14"), + id: hashify(sKID.valueBlock.valueHex), + }; + } + return sKID; +}; + +const getAuthorityKeyID = (x509, criticalExtensions) => { + let aKID = getX509Ext(x509.extensions, "2.5.29.35"); + if (!aKID || !aKID.keyIdentifier) { + return null; + } + aKID = { + critical: criticalExtensions.includes("2.5.29.35"), + id: hashify(aKID.keyIdentifier.valueBlock.valueHex), + }; + return aKID; +}; + +const getCRLPoints = (x509, criticalExtensions) => { + let crlPoints = getX509Ext(x509.extensions, "2.5.29.31"); + if (crlPoints) { + crlPoints = { + critical: criticalExtensions.includes("2.5.29.31"), + points: crlPoints.distributionPoints.map( + x => x.distributionPoint[0].value + ), + }; + } + return crlPoints; +}; + +const getOcspStaple = (x509, criticalExtensions) => { + let ocspStaple = getX509Ext(x509.extensions, "1.3.6.1.5.5.7.1.24"); + if (ocspStaple && ocspStaple.valueBeforeDecode === "3003020105") { + ocspStaple = { + critical: criticalExtensions.includes("1.3.6.1.5.5.7.1.24"), + required: true, + }; + } else { + ocspStaple = { + critical: criticalExtensions.includes("1.3.6.1.5.5.7.1.24"), + required: false, + }; + } + return ocspStaple; +}; + +const getAuthorityInfoAccess = (x509, criticalExtensions) => { + let aia = getX509Ext(x509.extensions, "1.3.6.1.5.5.7.1.1"); + if (aia) { + aia = aia.accessDescriptions.map(x => { + return { + location: x.accessLocation.value, + method: strings.aia[x.accessMethod], + }; + }); + } + + aia = { + descriptions: aia, + critical: criticalExtensions.includes("1.3.6.1.5.5.7.1.1"), + }; + return aia; +}; + +const getSCTs = (x509, criticalExtensions) => { + let scts = getX509Ext(x509.extensions, "1.3.6.1.4.1.11129.2.4.2"); + if (scts) { + scts = Object.keys(scts.timestamps).map(x => { + let logId = scts.timestamps[x].logID.toLowerCase(); + let sctsTimestamp = scts.timestamps[x].timestamp; + return { + logId: hashify(logId), + name: ctLogNames.hasOwnProperty(logId) ? ctLogNames[logId] : undefined, + signatureAlgorithm: `${scts.timestamps[x].hashAlgorithm.replace( + "sha", + "SHA-" + )} ${scts.timestamps[x].signatureAlgorithm.toUpperCase()}`, + timestamp: `${sctsTimestamp.toLocaleString()} (${getTimeZone()})`, + timestampUTC: sctsTimestamp.toUTCString(), + version: scts.timestamps[x].version + 1, + }; + }); + } else { + scts = []; + } + + scts = { + critical: criticalExtensions.includes("1.3.6.1.4.1.11129.2.4.2"), + timestamps: scts, + }; + return scts; +}; + +const getCertificatePolicies = (x509, criticalExtensions) => { + let cp = getX509Ext(x509.extensions, "2.5.29.32"); + if (cp && cp.hasOwnProperty("certificatePolicies")) { + cp = cp.certificatePolicies.map(x => { + let id = x.policyIdentifier; + let certName = strings.cps.hasOwnProperty(id) + ? strings.cps[id].name + : undefined; + let qualifiers = undefined; + let value = strings.cps.hasOwnProperty(id) + ? strings.cps[id].value + : undefined; + + // ansi organization identifiers + if (id.startsWith("2.16.840.")) { + value = id; + id = "2.16.840"; + certName = strings.cps["2.16.840"].name; + } + + // statement identifiers + if (id.startsWith("1.3.6.1.4.1")) { + value = id; + id = "1.3.6.1.4.1"; + certName = strings.cps["1.3.6.1.4.1"].name; + } + + if (x.hasOwnProperty("policyQualifiers")) { + qualifiers = x.policyQualifiers.map(qualifier => { + let qualifierId = qualifier.policyQualifierId; + let qualifierName = strings.cps.hasOwnProperty(qualifierId) + ? strings.cps[qualifierId].name + : undefined; + let qualifierValue = qualifier.qualifier.valueBlock.value; + + // sometimes they are multiple qualifier subblocks, and for now we'll + // only return the first one because it's getting really messy at this point + if (Array.isArray(qualifierValue) && qualifierValue.length === 1) { + qualifierValue = qualifierValue[0].valueBlock.value; + } else if ( + Array.isArray(qualifierValue) && + qualifierValue.length > 1 + ) { + qualifierValue = "(currently unsupported)"; + } + + return { + qualifierId, + qualifierName, + qualifierValue, + }; + }); + } + + return { + id, + name: certName, + qualifiers, + value, + }; + }); + } + + cp = { + critical: criticalExtensions.includes("2.5.29.32"), + policies: cp, + }; + return cp; +}; + +const getMicrosoftCryptographicExtensions = (x509, criticalExtensions) => { + // now let's parse the Microsoft cryptographic extensions + let msCrypto = { + caVersion: getX509Ext(x509.extensions, "1.3.6.1.4.1.311.21.1"), + certificatePolicies: getX509Ext(x509.extensions, "1.3.6.1.4.1.311.21.10"), + certificateTemplate: getX509Ext(x509.extensions, "1.3.6.1.4.1.311.21.7"), + certificateType: getX509Ext(x509.extensions, "1.3.6.1.4.1.311.20.2"), + previousHash: getX509Ext(x509.extensions, "1.3.6.1.4.1.311.21.2"), + }; + + if ( + msCrypto.caVersion && + Number.isInteger(msCrypto.caVersion.keyIndex) && + Number.isInteger(msCrypto.caVersion.certificateIndex) + ) { + msCrypto.caVersion = { + critical: criticalExtensions.includes("1.3.6.1.4.1.311.21.1"), + caRenewals: msCrypto.caVersion.certificateIndex, + keyReuses: + msCrypto.caVersion.certificateIndex - msCrypto.caVersion.keyIndex, + }; + } + + if (msCrypto.certificatePolicies) { + msCrypto.certificatePolicies = { + critical: criticalExtensions.includes("1.3.6.1.4.1.311.21.10"), + purposes: msCrypto.certificatePolicies.certificatePolicies.map( + x => strings.eKU[x.policyIdentifier] || x.policyIdentifier + ), + }; + } + + if (msCrypto.certificateTemplate) { + msCrypto.certificateTemplate = { + critical: criticalExtensions.includes("1.3.6.1.4.1.311.21.7"), + id: msCrypto.certificateTemplate.extnID, + major: msCrypto.certificateTemplate.templateMajorVersion, + minor: msCrypto.certificateTemplate.templateMinorVersion, + }; + } + + if (msCrypto.certificateType) { + msCrypto.certificateType = { + critical: criticalExtensions.includes("1.3.6.1.4.1.311.20.2"), + type: + strings.microsoftCertificateTypes[ + msCrypto.certificateType.valueBlock.value + ] || "Unknown", + }; + } + + if (msCrypto.previousHash) { + msCrypto.previousHash = { + critical: criticalExtensions.includes("1.3.6.1.4.1.311.21.2"), + previousHash: hashify(msCrypto.previousHash.valueBlock.valueHex), + }; + } + + msCrypto.exists = !!( + msCrypto.caVersion || + msCrypto.certificatePolicies || + msCrypto.certificateTemplate || + msCrypto.certificateType || + msCrypto.previousHash + ); + + return msCrypto; +}; + +export const parse = async certificate => { + // certificate could be an array of BER or an array of buffers + const supportedExtensions = [ + "1.3.6.1.4.1.311.20.2", // microsoft certificate type + "1.3.6.1.4.1.311.21.2", // microsoft certificate previous hash + "1.3.6.1.4.1.311.21.7", // microsoft certificate template + "1.3.6.1.4.1.311.21.1", // microsoft certification authority renewal + "1.3.6.1.4.1.311.21.10", // microsoft certificate policies + "1.3.6.1.4.1.11129.2.4.2", // embedded scts + "1.3.6.1.5.5.7.1.1", // authority info access + "1.3.6.1.5.5.7.1.24", // ocsp stapling + "1.3.101.77", // ct redaction - deprecated and not displayed + "2.5.29.14", // subject key identifier + "2.5.29.15", // key usages + "2.5.29.17", // subject alt names + "2.5.29.19", // basic constraints + "2.5.29.31", // crl points + "2.5.29.32", // certificate policies + "2.5.29.35", // authority key identifier + "2.5.29.37", // extended key usage + ]; + + let timeZone = getTimeZone(); + + // parse the certificate + let x509 = Certificate.fromBER(certificate); + + // convert the cert to PEM + const certPEM = b64ToPEM( + btoa(String.fromCharCode.apply(null, new Uint8Array(certificate))) + ); + + // get which extensions are critical + const criticalExtensions = []; + if (x509.extensions) { + x509.extensions.forEach(ext => { + if (ext.hasOwnProperty("critical") && ext.critical === true) { + criticalExtensions.push(ext.extnID); + } + }); + } + const spki = getPublicKeyInfo(x509); + const keyUsages = getKeyUsages(x509, criticalExtensions); + const san = getSubjectAltNames(x509, criticalExtensions); + const basicConstraints = getBasicConstraints(x509, criticalExtensions); + const eKeyUsages = getEKeyUsages(x509, criticalExtensions); + const sKID = getSubjectKeyID(x509, criticalExtensions); + const aKID = getAuthorityKeyID(x509, criticalExtensions); + const crlPoints = getCRLPoints(x509, criticalExtensions); + const ocspStaple = getOcspStaple(x509, criticalExtensions); + const aia = getAuthorityInfoAccess(x509, criticalExtensions); + const scts = getSCTs(x509, criticalExtensions); + const cp = getCertificatePolicies(x509, criticalExtensions); + const msCrypto = getMicrosoftCryptographicExtensions( + x509, + criticalExtensions + ); + + // determine which extensions weren't supported + let unsupportedExtensions = []; + if (x509.extensions) { + x509.extensions.forEach(ext => { + if (!supportedExtensions.includes(ext.extnID)) { + unsupportedExtensions.push(ext.extnID); + } + }); + } + + // the output shell + return { + ext: { + aia, + aKID, + basicConstraints, + crlPoints, + cp, + eKeyUsages, + keyUsages, + msCrypto, + ocspStaple, + scts, + sKID, + san, + }, + files: { + der: undefined, // TODO: implement! + pem: encodeURI(certPEM), + }, + fingerprint: { + sha1: await hash("SHA-1", certificate), + sha256: await hash("SHA-256", certificate), + }, + issuer: parseSubsidiary(x509.issuer.typesAndValues), + notBefore: `${x509.notBefore.value.toLocaleString()} (${timeZone})`, + notBeforeUTC: x509.notBefore.value.toUTCString(), + notAfter: `${x509.notAfter.value.toLocaleString()} (${timeZone})`, + notAfterUTC: x509.notAfter.value.toUTCString(), + subject: parseSubsidiary(x509.subject.typesAndValues), + serialNumber: hashify(getObjPath(x509, "serialNumber.valueBlock.valueHex")), + signature: { + name: strings.signature[getObjPath(x509, "signature.algorithmId")], + type: getObjPath(x509, "signature.algorithmId"), + }, + subjectPublicKeyInfo: spki, + unsupportedExtensions, + version: (x509.version + 1).toString(), + }; +}; + +const ctLogNames = { + "9606c02c690033aa1d145f59c6e2648d0549f0df96aab8db915a70d8ecf390a5": + "Akamai CT", + "39376f545f7b4607f59742d768cd5d2437bf3473b6534a4834bcf72e681c83c9": + "Alpha CT", + a577ac9ced7548dd8f025b67a241089df86e0f476ec203c2ecbedb185f282638: "CNNIC CT", + cdb5179b7fc1c046feea31136a3f8f002e6182faf8896fecc8b2f5b5ab604900: "Certly.IO", + "1fbc36e002ede97f40199e86b3573b8a4217d80187746ad0da03a06054d20df4": + "Cloudflare “Nimbus2017”", + db74afeecb29ecb1feca3e716d2ce5b9aabb36f7847183c75d9d4f37b61fbf64: + "Cloudflare “Nimbus2018”", + "747eda8331ad331091219cce254f4270c2bffd5e422008c6373579e6107bcc56": + "Cloudflare “Nimbus2019”", + "5ea773f9df56c0e7b536487dd049e0327a919a0c84a112128418759681714558": + "Cloudflare “Nimbus2020”", + "4494652eb0eeceafc44007d8a8fe28c0dae682bed8cb31b53fd33396b5b681a8": + "Cloudflare “Nimbus2021”", + "41c8cab1df22464a10c6a13a0942875e4e318b1b03ebeb4bc768f090629606f6": + "Cloudflare “Nimbus2022”", + "7a328c54d8b72db620ea38e0521ee98416703213854d3bd22bc13a57a352eb52": + "Cloudflare “Nimbus2023”", + "6ff141b5647e4222f7ef052cefae7c21fd608e27d2af5a6e9f4b8a37d6633ee5": + "DigiCert Nessie2018", + fe446108b1d01ab78a62ccfeab6ab2b2babff3abdad80a4d8b30df2d0008830c: + "DigiCert Nessie2019", + c652a0ec48ceb3fcab170992c43a87413309e80065a26252401ba3362a17c565: + "DigiCert Nessie2020", + eec095ee8d72640f92e3c3b91bc712a3696a097b4b6a1a1438e647b2cbedc5f9: + "DigiCert Nessie2021", + "51a3b0f5fd01799c566db837788f0ca47acc1b27cbf79e88429a0dfed48b05e5": + "DigiCert Nessie2022", + b3737707e18450f86386d605a9dc11094a792db1670c0b87dcf0030e7936a59a: + "DigiCert Nessie2023", + "5614069a2fd7c2ecd3f5e1bd44b23ec74676b9bc99115cc0ef949855d689d0dd": + "DigiCert Server", + "8775bfe7597cf88c43995fbdf36eff568d475636ff4ab560c1b4eaff5ea0830f": + "DigiCert Server 2", + c1164ae0a772d2d4392dc80ac10770d4f0c49bde991a4840c1fa075164f63360: + "DigiCert Yeti2018", + e2694bae26e8e94009e8861bb63b83d43ee7fe7488fba48f2893019dddf1dbfe: + "DigiCert Yeti2019", + f095a459f200d18240102d2f93888ead4bfe1d47e399e1d034a6b0a8aa8eb273: + "DigiCert Yeti2020", + "5cdc4392fee6ab4544b15e9ad456e61037fbd5fa47dca17394b25ee6f6c70eca": + "DigiCert Yeti2021", + "2245450759552456963fa12ff1f76d86e0232663adc04b7f5dc6835c6ee20f02": + "DigiCert Yeti2022", + "35cf191bbfb16c57bf0fad4c6d42cbbbb627202651ea3fe12aefa803c33bd64c": + "DigiCert Yeti2023", + "717ea7420975be84a2723553f1777c26dd51af4e102144094d9019b462fb6668": "GDCA 1", + "14308d90ccd030135005c01ca526d81e84e87624e39b6248e08f724aea3bb42a": "GDCA 2", + c9cf890a21109c666cc17a3ed065c930d0e0135a9feba85af14210b8072421aa: + "GDCA CT #1", + "924a30f909336ff435d6993a10ac75a2c641728e7fc2d659ae6188ffad40ce01": + "GDCA CT #2", + fad4c97cc49ee2f8ac85c5ea5cea09d0220dbbf4e49c6b50662ff868f86b8c28: + "Google “Argon2017”", + a4501269055a15545e6211ab37bc103f62ae5576a45e4b1714453e1b22106a25: + "Google “Argon2018”", + "63f2dbcde83bcc2ccf0b728427576b33a48d61778fbd75a638b1c768544bd88d": + "Google “Argon2019”", + b21e05cc8ba2cd8a204e8766f92bb98a2520676bdafa70e7b249532def8b905e: + "Google “Argon2020”", + f65c942fd1773022145418083094568ee34d131933bfdf0c2f200bcc4ef164e3: + "Google “Argon2021”", + "2979bef09e393921f056739f63a577e5be577d9c600af8f94d5d265c255dc784": + "Google “Argon2022”", + "68f698f81f6482be3a8ceeb9281d4cfc71515d6793d444d10a67acbb4f4ffbc4": + "Google “Aviator”", + c3bf03a7e1ca8841c607bae3ff4270fca5ec45b186ebbe4e2cf3fc778630f5f6: + "Google “Crucible”", + "1d024b8eb1498b344dfd87ea3efc0996f7506f235d1d497061a4773c439c25fb": + "Google “Daedalus”", + "293c519654c83965baaa50fc5807d4b76fbf587a2972dca4c30cf4e54547f478": + "Google “Icarus”", + a4b90990b418581487bb13a2cc67700a3c359804f91bdfb8e377cd0ec80ddc10: + "Google “Pilot”", + ee4bbdb775ce60bae142691fabe19e66a30f7e5fb072d88300c47b897aa8fdcb: + "Google “Rocketeer”", + bbd9dfbc1f8a71b593942397aa927b473857950aab52e81a909664368e1ed185: + "Google “Skydiver”", + "52eb4b225ec896974850675f23e43bc1d021e3214ce52ecd5fa87c203cdfca03": + "Google “Solera2018”", + "0b760e9a8b9a682f88985b15e947501a56446bba8830785c3842994386450c00": + "Google “Solera2019”", + "1fc72ce5a1b799f400c359bff96ca3913548e8644220610952e9ba1774f7bac7": + "Google “Solera2020”", + a3c99845e80ab7ce00157b3742df0207dd272b2b602ecf98ee2c12db9c5ae7e7: + "Google “Solera2021”", + "697aafca1a6b536fae21205046debad7e0eaea13d2432e6e9d8fb379f2b9aaf3": + "Google “Solera2022”", + a899d8780c9290aaf462f31880ccfbd52451e970d0fbf591ef75b0d99b645681: + "Google “Submariner”", + b0cc83e5a5f97d6baf7c09cc284904872ac7e88b132c6350b7c6fd26e16c6c77: + "Google “Testtube”", + b10cd559a6d67846811f7df9a51532739ac48d703bea0323da5d38755bc0ad4e: + "Google “Xenon2018”", + "084114980071532c16190460bcfc47fdc2653afa292c72b37ff863ae29ccc9f0": + "Google “Xenon2019”", + "07b75c1be57d68fff1b0c61d2315c7bae6577c5794b76aeebc613a1a69d3a21c": + "Google “Xenon2020”", + "7d3ef2f88fff88556824c2c0ca9e5289792bc50e78097f2e6a9768997e22f0d7": + "Google “Xenon2021”", + "46a555eb75fa912030b5a28969f4f37d112c4174befd49b885abf2fc70fe6d47": + "Google “Xenon2022”", + "7461b4a09cfb3d41d75159575b2e7649a445a8d27709b0cc564a6482b7eb41a3": "Izenpe", + "8941449c70742e06b9fc9ce7b116ba0024aa36d59af44f0204404f00f7ea8566": + "Izenpe “Argi”", + "296afa2d568bca0d2ea844956ae9721fc35fa355ecda99693aafd458a71aefdd": + "Let“s Encrypt ”Clicky”", + "537b69a3564335a9c04904e39593b2c298eb8d7a6e83023635c627248cd6b440": + "Nordu “flimsy”", + aae70b7f3cb8d566c86c2f16979c9f445f69ab0eb4535589b2f77a030104f3cd: + "Nordu “plausible”", + e0127629e90496564e3d0147984498aa48f8adb16600eb7902a1ef9909906273: + "PuChuangSiDa CT", + cf55e28923497c340d5206d05353aeb25834b52f1f8dc9526809f212efdd7ca6: + "SHECA CT 1", + "32dc59c2d4c41968d56e14bc61ac8f0e45db39faf3c155aa4252f5001fa0c623": + "SHECA CT 2", + db76fdadac65e7d09508886e2159bd8b90352f5fead3e3dc5e22eb350acc7b98: + "Sectigo (Comodo) “Dodo” CT", + "6f5376ac31f03119d89900a45115ff77151c11d902c10029068db2089a37d913": + "Sectigo (Comodo) “Mammoth” CT", + "5581d4c2169036014aea0b9b573c53f0c0e43878702508172fa3aa1d0713d30c": + "Sectigo (Comodo) “Sabre” CT", + "34bb6ad6c3df9c03eea8a499ff7891486c9d5e5cac92d01f7bfd1bce19db48ef": + "StartCom", + ddeb1d2b7a0d4fa6208b81ad8168707e2e8e9d01d55c888d3d11c4cdb6ecbecc: "Symantec", + a7ce4a4e6207e0addee5fdaa4b1f86768767b5d002a55d47310e7e670a95eab2: + "Symantec Deneb", + "15970488d7b997a05beb52512adee8d2e8b4a3165264121a9fabfbd5f85ad93f": + "Symantec “Sirius”", + bc78e1dfc5f63c684649334da10fa15f0979692009c081b4f3f6917f3ed9b8a5: + "Symantec “Vega”", + b0b784bc81c0ddc47544e883f05985bb9077d134d8ab88b2b2e533980b8e508b: + "Up In The Air “Behind the Sofa”", + ac3b9aed7fa9674757159e6d7d575672f9d98100941e9bdeffeca1313b75782d: "Venafi", + "03019df3fd85a69a8ebd1facc6da9ba73e469774fe77f579fc5a08b8328c1d6b": + "Venafi Gen2 CT", + "41b2dc2e89e63ce4af1ba7bb29bf68c6dee6f9f1cc047e30dffae3b3ba259263": "WoSign", + "63d0006026dde10bb0601f452446965ee2b6ea2cd4fbc95ac866a550af9075b7": + "WoSign 2", + "9e4ff73dc3ce220b69217c899e468076abf8d78636d5ccfc85a31a75628ba88b": + "WoSign CT #1", + "659b3350f43b12cc5ea5ab4ec765d3fde6c88243777778e72003f9eb2b8c3129": + "Let's Encrypt Oak 2019", + e712f2b0377e1a62fb8ec90c6184f1ea7b37cb561d11265bf3e0f34bf241546e: + "Let's Encrypt Oak 2020", + "9420bc1e8ed58d6c88731f828b222c0dd1da4d5e6c4f943d61db4e2f584da2c2": + "Let's Encrypt Oak 2021", + dfa55eab68824f1f6cadeeb85f4e3e5aeacda212a46a5e8e3b12c020445c2a73: + "Let's Encrypt Oak 2022", + b73efb24df9c4dba75f239c5ba58f46c5dfc42cf7a9f35c49e1d098125edb499: + "Let's Encrypt Oak 2023", + "849f5f7f58d2bf7b54ecbd74611cea45c49c98f1d6481bc6f69e8c174f24f3cf": + "Let's Encrypt Testflume 2019", + c63f2218c37d56a6aa06b596da8e53d4d7156d1e9bac8e44d2202de64d69d9dc: + "Let's Encrypt Testflume 2020", + "03edf1da9776b6f38c341e39ed9d707a7570369cf9844f327fe9e14138361b60": + "Let's Encrypt Testflume 2021", + "2327efda352510dbc019ef491ae3ff1cc5a479bce37878360ee318cffb64f8c8": + "Let's Encrypt Testflume 2022", + "5534b7ab5a6ac3a7cbeba65487b2a2d71b48f650fa17c5197c97a0cb2076f3c6": + "Let's Encrypt Testflume 2023", +}; + +const strings = { + ux: { + upload: "Upload Certificate", + }, + + names: { + // Directory Pilot Attributes + "0.9.2342.19200300.100.1.1": { + short: "uid", + long: "User ID", + }, + "0.9.2342.19200300.100.1.25": { + short: "dc", + long: "Domain Component", + }, + + // PKCS-9 + "1.2.840.113549.1.9.1": { + short: "e", + long: "Email Address", + }, + + // Incorporated Locations + "1.3.6.1.4.1.311.60.2.1.1": { + short: undefined, + long: "Inc. Locality", + }, + "1.3.6.1.4.1.311.60.2.1.2": { + short: undefined, + long: "Inc. State / Province", + }, + "1.3.6.1.4.1.311.60.2.1.3": { + short: undefined, + long: "Inc. Country", + }, + + // microsoft cryptographic extensions + "1.3.6.1.4.1.311.21.7": { + name: { + short: "Certificate Template", + long: "Microsoft Certificate Template", + }, + }, + "1.3.6.1.4.1.311.21.10": { + name: { + short: "Certificate Policies", + long: "Microsoft Certificate Policies", + }, + }, + + // certificate extensions + "1.3.6.1.4.1.11129.2.4.2": { + name: { + short: "Embedded SCTs", + long: "Embedded Signed Certificate Timestamps", + }, + }, + "1.3.6.1.5.5.7.1.1": { + name: { + short: undefined, + long: "Authority Information Access", + }, + }, + "1.3.6.1.5.5.7.1.24": { + name: { + short: "OCSP Stapling", + long: "Online Certificate Status Protocol Stapling", + }, + }, + + // X.500 attribute types + "2.5.4.1": { + short: undefined, + long: "Aliased Entry", + }, + "2.5.4.2": { + short: undefined, + long: "Knowledge Information", + }, + "2.5.4.3": { + short: "cn", + long: "Common Name", + }, + "2.5.4.4": { + short: "sn", + long: "Surname", + }, + "2.5.4.5": { + short: "serialNumber", + long: "Serial Number", + }, + "2.5.4.6": { + short: "c", + long: "Country", + }, + "2.5.4.7": { + short: "l", + long: "Locality", + }, + "2.5.4.8": { + short: "s", + long: "State / Province", + }, + "2.5.4.9": { + short: "street", + long: "Stress Address", + }, + "2.5.4.10": { + short: "o", + long: "Organization", + }, + "2.5.4.11": { + short: "ou", + long: "Organizational Unit", + }, + "2.5.4.12": { + short: "t", + long: "Title", + }, + "2.5.4.13": { + short: "description", + long: "Description", + }, + "2.5.4.14": { + short: undefined, + long: "Search Guide", + }, + "2.5.4.15": { + short: undefined, + long: "Business Category", + }, + "2.5.4.16": { + short: undefined, + long: "Postal Address", + }, + "2.5.4.17": { + short: "postalCode", + long: "Postal Code", + }, + "2.5.4.18": { + short: "POBox", + long: "PO Box", + }, + "2.5.4.19": { + short: undefined, + long: "Physical Delivery Office Name", + }, + "2.5.4.20": { + short: "phone", + long: "Phone Number", + }, + "2.5.4.21": { + short: undefined, + long: "Telex Number", + }, + "2.5.4.22": { + short: undefined, + long: "Teletex Terminal Identifier", + }, + "2.5.4.23": { + short: undefined, + long: "Fax Number", + }, + "2.5.4.24": { + short: undefined, + long: "X.121 Address", + }, + "2.5.4.25": { + short: undefined, + long: "International ISDN Number", + }, + "2.5.4.26": { + short: undefined, + long: "Registered Address", + }, + "2.5.4.27": { + short: undefined, + long: "Destination Indicator", + }, + "2.5.4.28": { + short: undefined, + long: "Preferred Delivery Method", + }, + "2.5.4.29": { + short: undefined, + long: "Presentation Address", + }, + "2.5.4.30": { + short: undefined, + long: "Supported Application Context", + }, + "2.5.4.31": { + short: undefined, + long: "Member", + }, + "2.5.4.32": { + short: undefined, + long: "Owner", + }, + "2.5.4.33": { + short: undefined, + long: "Role Occupant", + }, + "2.5.4.34": { + short: undefined, + long: "See Also", + }, + "2.5.4.35": { + short: undefined, + long: "User Password", + }, + "2.5.4.36": { + short: undefined, + long: "User Certificate", + }, + "2.5.4.37": { + short: undefined, + long: "CA Certificate", + }, + "2.5.4.38": { + short: undefined, + long: "Authority Revocation List", + }, + "2.5.4.39": { + short: undefined, + long: "Certificate Revocation List", + }, + "2.5.4.40": { + short: undefined, + long: "Cross-certificate Pair", + }, + "2.5.4.41": { + short: undefined, + long: "Name", + }, + "2.5.4.42": { + short: "g", + long: "Given Name", + }, + "2.5.4.43": { + short: "i", + long: "Initials", + }, + "2.5.4.44": { + short: undefined, + long: "Generation Qualifier", + }, + "2.5.4.45": { + short: undefined, + long: "Unique Identifier", + }, + "2.5.4.46": { + short: undefined, + long: "DN Qualifier", + }, + "2.5.4.47": { + short: undefined, + long: "Enhanced Search Guide", + }, + "2.5.4.48": { + short: undefined, + long: "Protocol Information", + }, + "2.5.4.49": { + short: "dn", + long: "Distinguished Name", + }, + "2.5.4.50": { + short: undefined, + long: "Unique Member", + }, + "2.5.4.51": { + short: undefined, + long: "House Identifier", + }, + "2.5.4.52": { + short: undefined, + long: "Supported Algorithms", + }, + "2.5.4.53": { + short: undefined, + long: "Delta Revocation List", + }, + "2.5.4.58": { + short: undefined, + long: "Attribute Certificate Attribute", // huh + }, + "2.5.4.65": { + short: undefined, + long: "Pseudonym", + }, + + // extensions + "2.5.29.14": { + name: { + short: "Subject Key ID", + long: "Subject Key Identifier", + }, + }, + "2.5.29.15": { + name: { + short: undefined, + long: "Key Usages", + }, + }, + "2.5.29.17": { + name: { + short: "Subject Alt Names", + long: "Subject Alternative Names", + }, + }, + "2.5.29.19": { + name: { + short: undefined, + long: "Basic Constraints", + }, + }, + "2.5.29.31": { + name: { + short: "CRL Endpoints", + long: "Certificate Revocation List Endpoints", + }, + }, + "2.5.29.32": { + name: { + short: undefined, + long: "Certificate Policies", + }, + }, + "2.5.29.35": { + name: { + short: "Authority Key ID", + long: "Authority Key Identifier", + }, + }, + "2.5.29.37": { + name: { + short: undefined, + long: "Extended Key Usages", + }, + }, + }, + + keyUsages: [ + "Digital Signature", + "Non-Repudiation", + "Key Encipherment", + "Data Encipherment", + "Key Agreement", + "Certificate Signing", + "CRL Signing", + "Encipher Only", + "Decipher Only", + ], + + san: [ + "Other Name", + "RFC 822 Name", + "DNS Name", + "X.400 Address", + "Directory Name", + "EDI Party Name", + "URI", + "IP Address", + "Registered ID", + ], + + eKU: { + "1.3.6.1.4.1.311.10.3.1": "Certificate Trust List (CTL) Signing", + "1.3.6.1.4.1.311.10.3.2": "Timestamp Signing", + "1.3.6.1.4.1.311.10.3.4": "EFS Encryption", + "1.3.6.1.4.1.311.10.3.4.1": "EFS Recovery", + "1.3.6.1.4.1.311.10.3.5": + "Windows Hardware Quality Labs (WHQL) Cryptography", + "1.3.6.1.4.1.311.10.3.7": "Windows NT 5 Cryptography", + "1.3.6.1.4.1.311.10.3.8": "Windows NT Embedded Cryptography", + "1.3.6.1.4.1.311.10.3.10": "Qualified Subordination", + "1.3.6.1.4.1.311.10.3.11": "Escrowed Key Recovery", + "1.3.6.1.4.1.311.10.3.12": "Document Signing", + "1.3.6.1.4.1.311.10.5.1": "Digital Rights Management", + "1.3.6.1.4.1.311.10.6.1": "Key Pack Licenses", + "1.3.6.1.4.1.311.10.6.2": "License Server", + "1.3.6.1.4.1.311.20.2.1": "Enrollment Agent", + "1.3.6.1.4.1.311.20.2.2": "Smartcard Login", + "1.3.6.1.4.1.311.21.5": "Certificate Authority Private Key Archival", + "1.3.6.1.4.1.311.21.6": "Key Recovery Agent", + "1.3.6.1.4.1.311.21.19": "Directory Service Email Replication", + "1.3.6.1.5.5.7.3.1": "Server Authentication", + "1.3.6.1.5.5.7.3.2": "Client Authentication", + "1.3.6.1.5.5.7.3.3": "Code Signing", + "1.3.6.1.5.5.7.3.4": "E-mail Protection", + "1.3.6.1.5.5.7.3.5": "IPsec End System", + "1.3.6.1.5.5.7.3.6": "IPsec Tunnel", + "1.3.6.1.5.5.7.3.7": "IPSec User", + "1.3.6.1.5.5.7.3.8": "Timestamping", + "1.3.6.1.5.5.7.3.9": "OCSP Signing", + "1.3.6.1.5.5.8.2.2": "Internet Key Exchange (IKE)", + }, + + signature: { + "1.2.840.113549.1.1.4": "MD5 with RSA Encryption", + "1.2.840.113549.1.1.5": "SHA-1 with RSA Encryption", + "1.2.840.113549.1.1.11": "SHA-256 with RSA Encryption", + "1.2.840.113549.1.1.12": "SHA-384 with RSA Encryption", + "1.2.840.113549.1.1.13": "SHA-512 with RSA Encryption", + "1.2.840.10040.4.3": "DSA with SHA-1", + "2.16.840.1.101.3.4.3.2": "DSA with SHA-256", + "1.2.840.10045.4.1": "ECDSA with SHA-1", + "1.2.840.10045.4.3.2": "ECDSA with SHA-256", + "1.2.840.10045.4.3.3": "ECDSA with SHA-384", + "1.2.840.10045.4.3.4": "ECDSA with SHA-512", + }, + + aia: { + "1.3.6.1.5.5.7.48.1": "Online Certificate Status Protocol (OCSP)", + "1.3.6.1.5.5.7.48.2": "CA Issuers", + }, + + // this includes qualifiers as well + cps: { + "1.3.6.1.4.1": { + name: "Statement Identifier", + value: undefined, + }, + "1.3.6.1.5.5.7.2.1": { + name: "Practices Statement", + value: undefined, + }, + "1.3.6.1.5.5.7.2.2": { + name: "User Notice", + value: undefined, + }, + "2.16.840": { + name: "ANSI Organizational Identifier", + value: undefined, + }, + "2.23.140.1.1": { + name: "Certificate Type", + value: "Extended Validation", + }, + "2.23.140.1.2.1": { + name: "Certificate Type", + value: "Domain Validation", + }, + "2.23.140.1.2.2": { + name: "Certificate Type", + value: "Organization Validation", + }, + "2.23.140.1.2.3": { + name: "Certificate Type", + value: "Individual Validation", + }, + "2.23.140.1.3": { + name: "Certificate Type", + value: "Extended Validation (Code Signing)", + }, + "2.23.140.1.31": { + name: "Certificate Type", + value: ".onion Extended Validation", + }, + "2.23.140.2.1": { + name: "Certificate Type", + value: "Test Certificate", + }, + }, + + microsoftCertificateTypes: { + Administrator: "Administrator", + CA: "Root Certification Authority", + CAExchange: "CA Exchange", + CEPEncryption: "CEP Encryption", + CertificateRequestAgent: "Certificate Request Agent", + ClientAuth: "Authenticated Session", + CodeSigning: "Code Signing", + CrossCA: "Cross Certification Authority", + CTLSigning: "Trust List Signing", + DirectoryEmailReplication: "Directory Email Replication", + DomainController: "Domain Controller", + DomainControllerAuthentication: "Domain Controller Authentication", + EFS: "Basic EFS", + EFSRecovery: "EFS Recovery Agent", + EnrollmentAgent: "Enrollment Agent", + EnrollmentAgentOffline: "Exchange Enrollment Agent (Offline request)", + ExchangeUser: "Exchange User", + ExchangeUserSignature: "Exchange Signature Only", + IPSECIntermediateOffline: "IPSec (Offline request)", + IPSECIntermediateOnline: "IPSEC", + KerberosAuthentication: "Kerberos Authentication", + KeyRecoveryAgent: "Key Recovery Agent", + Machine: "Computer", + MachineEnrollmentAgent: "Enrollment Agent (Computer)", + OCSPResponseSigning: "OCSP Response Signing", + OfflineRouter: "Router (Offline request)", + RASAndIASServer: "RAS and IAS Server", + SmartcardLogon: "Smartcard Logon", + SmartcardUser: "Smartcard User", + SubCA: "Subordinate Certification Authority", + User: "User", + UserSignature: "User Signature Only", + WebServer: "Web Server", + Workstation: "Workstation Authentication", + }, +}; + +function stringToArrayBuffer(string) { + let result = new Uint8Array(string.length); + for (let i = 0; i < string.length; i++) { + result[i] = string.charCodeAt(i); + } + return result; +} + +// this particular prototype override makes it easy to chain down complex objects +const getObjPath = (obj, path) => { + path = path.split("."); + for (let i = 0, len = path.length; i < len; i++) { + if (Array.isArray(obj[path[i]])) { + obj = obj[path[i]][path[i + 1]]; + i++; + } else { + obj = obj[path[i]]; + } + } + return obj; +}; + +const arrayBufferToHex = arrayBuffer => { + const array = Array.from(new Uint8Array(arrayBuffer)); + + return array + .map(b => ("00" + b.toString(16)).slice(-2)) + .join(":") + .toUpperCase(); +}; + +const hash = async (algo, buffer) => { + const hashBuffer = await crypto.subtle.digest(algo, buffer); + return arrayBufferToHex(hashBuffer); +}; + +const hashify = rawHash => { + if (typeof rawHash === "string") { + return rawHash.match(/.{2}/g).join(":").toUpperCase(); + } + if (rawHash instanceof ArrayBuffer) { + return arrayBufferToHex(rawHash); + } + return rawHash.join(":").toUpperCase(); +}; + +export const pemToDER = pem => { + return stringToArrayBuffer(atob(pem)); +}; diff --git a/maybe_tampered/eventemitter3/umd/eventemitter3.js b/maybe_tampered/eventemitter3/umd/eventemitter3.js new file mode 100644 index 0000000..888fcb8 --- /dev/null +++ b/maybe_tampered/eventemitter3/umd/eventemitter3.js @@ -0,0 +1,340 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.EventEmitter3 = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i { + // This property needs to remain unminified. + if (value['_$cssResult$'] === true) { + return value.cssText; + } + else if (typeof value === 'number') { + return value; + } + else { + throw new Error(`Value passed to 'css' function must be a 'css' function result: ` + + `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` + + `to ensure page security.`); + } +}; +/** + * Wrap a value for interpolation in a {@linkcode css} tagged template literal. + * + * This is unsafe because untrusted CSS text can be used to phone home + * or exfiltrate data to an attacker controlled site. Take care to only use + * this with trusted input. + */ +const unsafeCSS = (value) => new CSSResult(typeof value === 'string' ? value : String(value), undefined, constructionToken); +/** + * A template literal tag which can be used with LitElement's + * {@linkcode LitElement.styles} property to set element styles. + * + * For security reasons, only literal string values and number may be used in + * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS} + * may be used inside an expression. + */ +const css = (strings, ...values) => { + const cssText = strings.length === 1 + ? strings[0] + : values.reduce((acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1], strings[0]); + return new CSSResult(cssText, strings, constructionToken); +}; +/** + * Applies the given styles to a `shadowRoot`. When Shadow DOM is + * available but `adoptedStyleSheets` is not, styles are appended to the + * `shadowRoot` to [mimic spec behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets). + * Note, when shimming is used, any styles that are subsequently placed into + * the shadowRoot should be placed *before* any shimmed adopted styles. This + * will match spec behavior that gives adopted sheets precedence over styles in + * shadowRoot. + */ +const adoptStyles = (renderRoot, styles) => { + if (supportsAdoptingStyleSheets) { + renderRoot.adoptedStyleSheets = styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet); + } + else { + styles.forEach((s) => { + const style = document.createElement('style'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const nonce = global$2['litNonce']; + if (nonce !== undefined) { + style.setAttribute('nonce', nonce); + } + style.textContent = s.cssText; + renderRoot.appendChild(style); + }); + } +}; +const cssResultFromStyleSheet = (sheet) => { + let cssText = ''; + for (const rule of sheet.cssRules) { + cssText += rule.cssText; + } + return unsafeCSS(cssText); +}; +const getCompatibleStyle = supportsAdoptingStyleSheets || + (NODE_MODE$1 ) + ? (s) => s + : (s) => s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s; + +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +var _d$1; +var _e; +const global$1 = window; +const trustedTypes$1 = global$1 + .trustedTypes; +// Temporary workaround for https://crbug.com/993268 +// Currently, any attribute starting with "on" is considered to be a +// TrustedScript source. Such boolean attributes must be set to the equivalent +// trusted emptyScript value. +const emptyStringForBooleanAttribute$1 = trustedTypes$1 + ? trustedTypes$1.emptyScript + : ''; +const polyfillSupport$2 = global$1.reactiveElementPolyfillSupport; +/* + * When using Closure Compiler, JSCompiler_renameProperty(property, object) is + * replaced at compile time by the munged name for object[property]. We cannot + * alias this function, so we have to use a small shim that has the same + * behavior when not compiling. + */ +/*@__INLINE__*/ +const JSCompiler_renameProperty = (prop, _obj) => prop; +const defaultConverter = { + toAttribute(value, type) { + switch (type) { + case Boolean: + value = value ? emptyStringForBooleanAttribute$1 : null; + break; + case Object: + case Array: + // if the value is `null` or `undefined` pass this through + // to allow removing/no change behavior. + value = value == null ? value : JSON.stringify(value); + break; + } + return value; + }, + fromAttribute(value, type) { + let fromValue = value; + switch (type) { + case Boolean: + fromValue = value !== null; + break; + case Number: + fromValue = value === null ? null : Number(value); + break; + case Object: + case Array: + // Do *not* generate exception when invalid JSON is set as elements + // don't normally complain on being mis-configured. + // TODO(sorvell): Do generate exception in *dev mode*. + try { + // Assert to adhere to Bazel's "must type assert JSON parse" rule. + fromValue = JSON.parse(value); + } + catch (e) { + fromValue = null; + } + break; + } + return fromValue; + }, +}; +/** + * Change function that returns true if `value` is different from `oldValue`. + * This method is used as the default for a property's `hasChanged` function. + */ +const notEqual = (value, old) => { + // This ensures (old==NaN, value==NaN) always returns false + return old !== value && (old === old || value === value); +}; +const defaultPropertyDeclaration = { + attribute: true, + type: String, + converter: defaultConverter, + reflect: false, + hasChanged: notEqual, +}; +/** + * The Closure JS Compiler doesn't currently have good support for static + * property semantics where "this" is dynamic (e.g. + * https://github.com/google/closure-compiler/issues/3177 and others) so we use + * this hack to bypass any rewriting by the compiler. + */ +const finalized = 'finalized'; +/** + * Base element class which manages element properties and attributes. When + * properties change, the `update` method is asynchronously called. This method + * should be supplied by subclassers to render updates as desired. + * @noInheritDoc + */ +class ReactiveElement extends HTMLElement { + constructor() { + super(); + this.__instanceProperties = new Map(); + /** + * True if there is a pending update as a result of calling `requestUpdate()`. + * Should only be read. + * @category updates + */ + this.isUpdatePending = false; + /** + * Is set to `true` after the first update. The element code cannot assume + * that `renderRoot` exists before the element `hasUpdated`. + * @category updates + */ + this.hasUpdated = false; + /** + * Name of currently reflecting property + */ + this.__reflectingProperty = null; + this._initialize(); + } + /** + * Adds an initializer function to the class that is called during instance + * construction. + * + * This is useful for code that runs against a `ReactiveElement` + * subclass, such as a decorator, that needs to do work for each + * instance, such as setting up a `ReactiveController`. + * + * ```ts + * const myDecorator = (target: typeof ReactiveElement, key: string) => { + * target.addInitializer((instance: ReactiveElement) => { + * // This is run during construction of the element + * new MyController(instance); + * }); + * } + * ``` + * + * Decorating a field will then cause each instance to run an initializer + * that adds a controller: + * + * ```ts + * class MyElement extends LitElement { + * @myDecorator foo; + * } + * ``` + * + * Initializers are stored per-constructor. Adding an initializer to a + * subclass does not add it to a superclass. Since initializers are run in + * constructors, initializers will run in order of the class hierarchy, + * starting with superclasses and progressing to the instance's class. + * + * @nocollapse + */ + static addInitializer(initializer) { + var _a; + this.finalize(); + ((_a = this._initializers) !== null && _a !== void 0 ? _a : (this._initializers = [])).push(initializer); + } + /** + * Returns a list of attributes corresponding to the registered properties. + * @nocollapse + * @category attributes + */ + static get observedAttributes() { + // note: piggy backing on this to ensure we're finalized. + this.finalize(); + const attributes = []; + // Use forEach so this works even if for/of loops are compiled to for loops + // expecting arrays + this.elementProperties.forEach((v, p) => { + const attr = this.__attributeNameForProperty(p, v); + if (attr !== undefined) { + this.__attributeToPropertyMap.set(attr, p); + attributes.push(attr); + } + }); + return attributes; + } + /** + * Creates a property accessor on the element prototype if one does not exist + * and stores a {@linkcode PropertyDeclaration} for the property with the + * given options. The property setter calls the property's `hasChanged` + * property option or uses a strict identity check to determine whether or not + * to request an update. + * + * This method may be overridden to customize properties; however, + * when doing so, it's important to call `super.createProperty` to ensure + * the property is setup correctly. This method calls + * `getPropertyDescriptor` internally to get a descriptor to install. + * To customize what properties do when they are get or set, override + * `getPropertyDescriptor`. To customize the options for a property, + * implement `createProperty` like this: + * + * ```ts + * static createProperty(name, options) { + * options = Object.assign(options, {myOption: true}); + * super.createProperty(name, options); + * } + * ``` + * + * @nocollapse + * @category properties + */ + static createProperty(name, options = defaultPropertyDeclaration) { + // if this is a state property, force the attribute to false. + if (options.state) { + // Cast as any since this is readonly. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + options.attribute = false; + } + // Note, since this can be called by the `@property` decorator which + // is called before `finalize`, we ensure finalization has been kicked off. + this.finalize(); + this.elementProperties.set(name, options); + // Do not generate an accessor if the prototype already has one, since + // it would be lost otherwise and that would never be the user's intention; + // Instead, we expect users to call `requestUpdate` themselves from + // user-defined accessors. Note that if the super has an accessor we will + // still overwrite it + if (!options.noAccessor && !this.prototype.hasOwnProperty(name)) { + const key = typeof name === 'symbol' ? Symbol() : `__${name}`; + const descriptor = this.getPropertyDescriptor(name, key, options); + if (descriptor !== undefined) { + Object.defineProperty(this.prototype, name, descriptor); + } + } + } + /** + * Returns a property descriptor to be defined on the given named property. + * If no descriptor is returned, the property will not become an accessor. + * For example, + * + * ```ts + * class MyElement extends LitElement { + * static getPropertyDescriptor(name, key, options) { + * const defaultDescriptor = + * super.getPropertyDescriptor(name, key, options); + * const setter = defaultDescriptor.set; + * return { + * get: defaultDescriptor.get, + * set(value) { + * setter.call(this, value); + * // custom action. + * }, + * configurable: true, + * enumerable: true + * } + * } + * } + * ``` + * + * @nocollapse + * @category properties + */ + static getPropertyDescriptor(name, key, options) { + return { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get() { + return this[key]; + }, + set(value) { + const oldValue = this[name]; + this[key] = value; + this.requestUpdate(name, oldValue, options); + }, + configurable: true, + enumerable: true, + }; + } + /** + * Returns the property options associated with the given property. + * These options are defined with a `PropertyDeclaration` via the `properties` + * object or the `@property` decorator and are registered in + * `createProperty(...)`. + * + * Note, this method should be considered "final" and not overridden. To + * customize the options for a given property, override + * {@linkcode createProperty}. + * + * @nocollapse + * @final + * @category properties + */ + static getPropertyOptions(name) { + return this.elementProperties.get(name) || defaultPropertyDeclaration; + } + /** + * Creates property accessors for registered properties, sets up element + * styling, and ensures any superclasses are also finalized. Returns true if + * the element was finalized. + * @nocollapse + */ + static finalize() { + if (this.hasOwnProperty(finalized)) { + return false; + } + this[finalized] = true; + // finalize any superclasses + const superCtor = Object.getPrototypeOf(this); + superCtor.finalize(); + // Create own set of initializers for this class if any exist on the + // superclass and copy them down. Note, for a small perf boost, avoid + // creating initializers unless needed. + if (superCtor._initializers !== undefined) { + this._initializers = [...superCtor._initializers]; + } + this.elementProperties = new Map(superCtor.elementProperties); + // initialize Map populated in observedAttributes + this.__attributeToPropertyMap = new Map(); + // make any properties + // Note, only process "own" properties since this element will inherit + // any properties defined on the superClass, and finalization ensures + // the entire prototype chain is finalized. + if (this.hasOwnProperty(JSCompiler_renameProperty('properties'))) { + const props = this.properties; + // support symbols in properties (IE11 does not support this) + const propKeys = [ + ...Object.getOwnPropertyNames(props), + ...Object.getOwnPropertySymbols(props), + ]; + // This for/of is ok because propKeys is an array + for (const p of propKeys) { + // note, use of `any` is due to TypeScript lack of support for symbol in + // index types + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.createProperty(p, props[p]); + } + } + this.elementStyles = this.finalizeStyles(this.styles); + return true; + } + /** + * Takes the styles the user supplied via the `static styles` property and + * returns the array of styles to apply to the element. + * Override this method to integrate into a style management system. + * + * Styles are deduplicated preserving the _last_ instance in the list. This + * is a performance optimization to avoid duplicated styles that can occur + * especially when composing via subclassing. The last item is kept to try + * to preserve the cascade order with the assumption that it's most important + * that last added styles override previous styles. + * + * @nocollapse + * @category styles + */ + static finalizeStyles(styles) { + const elementStyles = []; + if (Array.isArray(styles)) { + // Dedupe the flattened array in reverse order to preserve the last items. + // Casting to Array works around TS error that + // appears to come from trying to flatten a type CSSResultArray. + const set = new Set(styles.flat(Infinity).reverse()); + // Then preserve original order by adding the set items in reverse order. + for (const s of set) { + elementStyles.unshift(getCompatibleStyle(s)); + } + } + else if (styles !== undefined) { + elementStyles.push(getCompatibleStyle(styles)); + } + return elementStyles; + } + /** + * Returns the property name for the given attribute `name`. + * @nocollapse + */ + static __attributeNameForProperty(name, options) { + const attribute = options.attribute; + return attribute === false + ? undefined + : typeof attribute === 'string' + ? attribute + : typeof name === 'string' + ? name.toLowerCase() + : undefined; + } + /** + * Internal only override point for customizing work done when elements + * are constructed. + * + * @internal + */ + _initialize() { + var _a; + this.__updatePromise = new Promise((res) => (this.enableUpdating = res)); + this._$changedProperties = new Map(); + this.__saveInstanceProperties(); + // ensures first update will be caught by an early access of + // `updateComplete` + this.requestUpdate(); + (_a = this.constructor._initializers) === null || _a === void 0 ? void 0 : _a.forEach((i) => i(this)); + } + /** + * Registers a `ReactiveController` to participate in the element's reactive + * update cycle. The element automatically calls into any registered + * controllers during its lifecycle callbacks. + * + * If the element is connected when `addController()` is called, the + * controller's `hostConnected()` callback will be immediately called. + * @category controllers + */ + addController(controller) { + var _a, _b; + ((_a = this.__controllers) !== null && _a !== void 0 ? _a : (this.__controllers = [])).push(controller); + // If a controller is added after the element has been connected, + // call hostConnected. Note, re-using existence of `renderRoot` here + // (which is set in connectedCallback) to avoid the need to track a + // first connected state. + if (this.renderRoot !== undefined && this.isConnected) { + (_b = controller.hostConnected) === null || _b === void 0 ? void 0 : _b.call(controller); + } + } + /** + * Removes a `ReactiveController` from the element. + * @category controllers + */ + removeController(controller) { + var _a; + // Note, if the indexOf is -1, the >>> will flip the sign which makes the + // splice do nothing. + (_a = this.__controllers) === null || _a === void 0 ? void 0 : _a.splice(this.__controllers.indexOf(controller) >>> 0, 1); + } + /** + * Fixes any properties set on the instance before upgrade time. + * Otherwise these would shadow the accessor and break these properties. + * The properties are stored in a Map which is played back after the + * constructor runs. Note, on very old versions of Safari (<=9) or Chrome + * (<=41), properties created for native platform properties like (`id` or + * `name`) may not have default values set in the element constructor. On + * these browsers native properties appear on instances and therefore their + * default value will overwrite any element default (e.g. if the element sets + * this.id = 'id' in the constructor, the 'id' will become '' since this is + * the native platform default). + */ + __saveInstanceProperties() { + // Use forEach so this works even if for/of loops are compiled to for loops + // expecting arrays + this.constructor.elementProperties.forEach((_v, p) => { + if (this.hasOwnProperty(p)) { + this.__instanceProperties.set(p, this[p]); + delete this[p]; + } + }); + } + /** + * Returns the node into which the element should render and by default + * creates and returns an open shadowRoot. Implement to customize where the + * element's DOM is rendered. For example, to render into the element's + * childNodes, return `this`. + * + * @return Returns a node into which to render. + * @category rendering + */ + createRenderRoot() { + var _a; + const renderRoot = (_a = this.shadowRoot) !== null && _a !== void 0 ? _a : this.attachShadow(this.constructor.shadowRootOptions); + adoptStyles(renderRoot, this.constructor.elementStyles); + return renderRoot; + } + /** + * On first connection, creates the element's renderRoot, sets up + * element styling, and enables updating. + * @category lifecycle + */ + connectedCallback() { + var _a; + // create renderRoot before first update. + if (this.renderRoot === undefined) { + this.renderRoot = this.createRenderRoot(); + } + this.enableUpdating(true); + (_a = this.__controllers) === null || _a === void 0 ? void 0 : _a.forEach((c) => { var _a; return (_a = c.hostConnected) === null || _a === void 0 ? void 0 : _a.call(c); }); + } + /** + * Note, this method should be considered final and not overridden. It is + * overridden on the element instance with a function that triggers the first + * update. + * @category updates + */ + enableUpdating(_requestedUpdate) { } + /** + * Allows for `super.disconnectedCallback()` in extensions while + * reserving the possibility of making non-breaking feature additions + * when disconnecting at some point in the future. + * @category lifecycle + */ + disconnectedCallback() { + var _a; + (_a = this.__controllers) === null || _a === void 0 ? void 0 : _a.forEach((c) => { var _a; return (_a = c.hostDisconnected) === null || _a === void 0 ? void 0 : _a.call(c); }); + } + /** + * Synchronizes property values when attributes change. + * + * Specifically, when an attribute is set, the corresponding property is set. + * You should rarely need to implement this callback. If this method is + * overridden, `super.attributeChangedCallback(name, _old, value)` must be + * called. + * + * See [using the lifecycle callbacks](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks) + * on MDN for more information about the `attributeChangedCallback`. + * @category attributes + */ + attributeChangedCallback(name, _old, value) { + this._$attributeToProperty(name, value); + } + __propertyToAttribute(name, value, options = defaultPropertyDeclaration) { + var _a; + const attr = this.constructor.__attributeNameForProperty(name, options); + if (attr !== undefined && options.reflect === true) { + const converter = ((_a = options.converter) === null || _a === void 0 ? void 0 : _a.toAttribute) !== + undefined + ? options.converter + : defaultConverter; + const attrValue = converter.toAttribute(value, options.type); + // Track if the property is being reflected to avoid + // setting the property again via `attributeChangedCallback`. Note: + // 1. this takes advantage of the fact that the callback is synchronous. + // 2. will behave incorrectly if multiple attributes are in the reaction + // stack at time of calling. However, since we process attributes + // in `update` this should not be possible (or an extreme corner case + // that we'd like to discover). + // mark state reflecting + this.__reflectingProperty = name; + if (attrValue == null) { + this.removeAttribute(attr); + } + else { + this.setAttribute(attr, attrValue); + } + // mark state not reflecting + this.__reflectingProperty = null; + } + } + /** @internal */ + _$attributeToProperty(name, value) { + var _a; + const ctor = this.constructor; + // Note, hint this as an `AttributeMap` so closure clearly understands + // the type; it has issues with tracking types through statics + const propName = ctor.__attributeToPropertyMap.get(name); + // Use tracking info to avoid reflecting a property value to an attribute + // if it was just set because the attribute changed. + if (propName !== undefined && this.__reflectingProperty !== propName) { + const options = ctor.getPropertyOptions(propName); + const converter = typeof options.converter === 'function' + ? { fromAttribute: options.converter } + : ((_a = options.converter) === null || _a === void 0 ? void 0 : _a.fromAttribute) !== undefined + ? options.converter + : defaultConverter; + // mark state reflecting + this.__reflectingProperty = propName; + this[propName] = converter.fromAttribute(value, options.type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ); + // mark state not reflecting + this.__reflectingProperty = null; + } + } + /** + * Requests an update which is processed asynchronously. This should be called + * when an element should update based on some state not triggered by setting + * a reactive property. In this case, pass no arguments. It should also be + * called when manually implementing a property setter. In this case, pass the + * property `name` and `oldValue` to ensure that any configured property + * options are honored. + * + * @param name name of requesting property + * @param oldValue old value of requesting property + * @param options property options to use instead of the previously + * configured options + * @category updates + */ + requestUpdate(name, oldValue, options) { + let shouldRequestUpdate = true; + // If we have a property key, perform property update steps. + if (name !== undefined) { + options = + options || + this.constructor.getPropertyOptions(name); + const hasChanged = options.hasChanged || notEqual; + if (hasChanged(this[name], oldValue)) { + if (!this._$changedProperties.has(name)) { + this._$changedProperties.set(name, oldValue); + } + // Add to reflecting properties set. + // Note, it's important that every change has a chance to add the + // property to `_reflectingProperties`. This ensures setting + // attribute + property reflects correctly. + if (options.reflect === true && this.__reflectingProperty !== name) { + if (this.__reflectingProperties === undefined) { + this.__reflectingProperties = new Map(); + } + this.__reflectingProperties.set(name, options); + } + } + else { + // Abort the request if the property should not be considered changed. + shouldRequestUpdate = false; + } + } + if (!this.isUpdatePending && shouldRequestUpdate) { + this.__updatePromise = this.__enqueueUpdate(); + } + // Note, since this no longer returns a promise, in dev mode we return a + // thenable which warns if it's called. + return undefined; + } + /** + * Sets up the element to asynchronously update. + */ + async __enqueueUpdate() { + this.isUpdatePending = true; + try { + // Ensure any previous update has resolved before updating. + // This `await` also ensures that property changes are batched. + await this.__updatePromise; + } + catch (e) { + // Refire any previous errors async so they do not disrupt the update + // cycle. Errors are refired so developers have a chance to observe + // them, and this can be done by implementing + // `window.onunhandledrejection`. + Promise.reject(e); + } + const result = this.scheduleUpdate(); + // If `scheduleUpdate` returns a Promise, we await it. This is done to + // enable coordinating updates with a scheduler. Note, the result is + // checked to avoid delaying an additional microtask unless we need to. + if (result != null) { + await result; + } + return !this.isUpdatePending; + } + /** + * Schedules an element update. You can override this method to change the + * timing of updates by returning a Promise. The update will await the + * returned Promise, and you should resolve the Promise to allow the update + * to proceed. If this method is overridden, `super.scheduleUpdate()` + * must be called. + * + * For instance, to schedule updates to occur just before the next frame: + * + * ```ts + * override protected async scheduleUpdate(): Promise { + * await new Promise((resolve) => requestAnimationFrame(() => resolve())); + * super.scheduleUpdate(); + * } + * ``` + * @category updates + */ + scheduleUpdate() { + return this.performUpdate(); + } + /** + * Performs an element update. Note, if an exception is thrown during the + * update, `firstUpdated` and `updated` will not be called. + * + * Call `performUpdate()` to immediately process a pending update. This should + * generally not be needed, but it can be done in rare cases when you need to + * update synchronously. + * + * Note: To ensure `performUpdate()` synchronously completes a pending update, + * it should not be overridden. In LitElement 2.x it was suggested to override + * `performUpdate()` to also customizing update scheduling. Instead, you should now + * override `scheduleUpdate()`. For backwards compatibility with LitElement 2.x, + * scheduling updates via `performUpdate()` continues to work, but will make + * also calling `performUpdate()` to synchronously process updates difficult. + * + * @category updates + */ + performUpdate() { + var _b; + // Abort any update if one is not pending when this is called. + // This can happen if `performUpdate` is called early to "flush" + // the update. + if (!this.isUpdatePending) { + return; + } + // create renderRoot before first update. + if (!this.hasUpdated) ; + // Mixin instance properties once, if they exist. + if (this.__instanceProperties) { + // Use forEach so this works even if for/of loops are compiled to for loops + // expecting arrays + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.__instanceProperties.forEach((v, p) => (this[p] = v)); + this.__instanceProperties = undefined; + } + let shouldUpdate = false; + const changedProperties = this._$changedProperties; + try { + shouldUpdate = this.shouldUpdate(changedProperties); + if (shouldUpdate) { + this.willUpdate(changedProperties); + (_b = this.__controllers) === null || _b === void 0 ? void 0 : _b.forEach((c) => { var _a; return (_a = c.hostUpdate) === null || _a === void 0 ? void 0 : _a.call(c); }); + this.update(changedProperties); + } + else { + this.__markUpdated(); + } + } + catch (e) { + // Prevent `firstUpdated` and `updated` from running when there's an + // update exception. + shouldUpdate = false; + // Ensure element can accept additional updates after an exception. + this.__markUpdated(); + throw e; + } + // The update is no longer considered pending and further updates are now allowed. + if (shouldUpdate) { + this._$didUpdate(changedProperties); + } + } + /** + * Invoked before `update()` to compute values needed during the update. + * + * Implement `willUpdate` to compute property values that depend on other + * properties and are used in the rest of the update process. + * + * ```ts + * willUpdate(changedProperties) { + * // only need to check changed properties for an expensive computation. + * if (changedProperties.has('firstName') || changedProperties.has('lastName')) { + * this.sha = computeSHA(`${this.firstName} ${this.lastName}`); + * } + * } + * + * render() { + * return html`SHA: ${this.sha}`; + * } + * ``` + * + * @category updates + */ + willUpdate(_changedProperties) { } + // Note, this is an override point for polyfill-support. + // @internal + _$didUpdate(changedProperties) { + var _a; + (_a = this.__controllers) === null || _a === void 0 ? void 0 : _a.forEach((c) => { var _a; return (_a = c.hostUpdated) === null || _a === void 0 ? void 0 : _a.call(c); }); + if (!this.hasUpdated) { + this.hasUpdated = true; + this.firstUpdated(changedProperties); + } + this.updated(changedProperties); + } + __markUpdated() { + this._$changedProperties = new Map(); + this.isUpdatePending = false; + } + /** + * Returns a Promise that resolves when the element has completed updating. + * The Promise value is a boolean that is `true` if the element completed the + * update without triggering another update. The Promise result is `false` if + * a property was set inside `updated()`. If the Promise is rejected, an + * exception was thrown during the update. + * + * To await additional asynchronous work, override the `getUpdateComplete` + * method. For example, it is sometimes useful to await a rendered element + * before fulfilling this Promise. To do this, first await + * `super.getUpdateComplete()`, then any subsequent state. + * + * @return A promise of a boolean that resolves to true if the update completed + * without triggering another update. + * @category updates + */ + get updateComplete() { + return this.getUpdateComplete(); + } + /** + * Override point for the `updateComplete` promise. + * + * It is not safe to override the `updateComplete` getter directly due to a + * limitation in TypeScript which means it is not possible to call a + * superclass getter (e.g. `super.updateComplete.then(...)`) when the target + * language is ES5 (https://github.com/microsoft/TypeScript/issues/338). + * This method should be overridden instead. For example: + * + * ```ts + * class MyElement extends LitElement { + * override async getUpdateComplete() { + * const result = await super.getUpdateComplete(); + * await this._myChild.updateComplete; + * return result; + * } + * } + * ``` + * + * @return A promise of a boolean that resolves to true if the update completed + * without triggering another update. + * @category updates + */ + getUpdateComplete() { + return this.__updatePromise; + } + /** + * Controls whether or not `update()` should be called when the element requests + * an update. By default, this method always returns `true`, but this can be + * customized to control when to update. + * + * @param _changedProperties Map of changed properties with old values + * @category updates + */ + shouldUpdate(_changedProperties) { + return true; + } + /** + * Updates the element. This method reflects property values to attributes. + * It can be overridden to render and keep updated element DOM. + * Setting properties inside this method will *not* trigger + * another update. + * + * @param _changedProperties Map of changed properties with old values + * @category updates + */ + update(_changedProperties) { + if (this.__reflectingProperties !== undefined) { + // Use forEach so this works even if for/of loops are compiled to for + // loops expecting arrays + this.__reflectingProperties.forEach((v, k) => this.__propertyToAttribute(k, this[k], v)); + this.__reflectingProperties = undefined; + } + this.__markUpdated(); + } + /** + * Invoked whenever the element is updated. Implement to perform + * post-updating tasks via DOM APIs, for example, focusing an element. + * + * Setting properties inside this method will trigger the element to update + * again after this update cycle completes. + * + * @param _changedProperties Map of changed properties with old values + * @category updates + */ + updated(_changedProperties) { } + /** + * Invoked when the element is first updated. Implement to perform one time + * work on the element after update. + * + * ```ts + * firstUpdated() { + * this.renderRoot.getElementById('my-text-area').focus(); + * } + * ``` + * + * Setting properties inside this method will trigger the element to update + * again after this update cycle completes. + * + * @param _changedProperties Map of changed properties with old values + * @category updates + */ + firstUpdated(_changedProperties) { } +} +_e = finalized; +/** + * Marks class as having finished creating properties. + */ +ReactiveElement[_e] = true; +/** + * Memoized list of all element properties, including any superclass properties. + * Created lazily on user subclasses when finalizing the class. + * @nocollapse + * @category properties + */ +ReactiveElement.elementProperties = new Map(); +/** + * Memoized list of all element styles. + * Created lazily on user subclasses when finalizing the class. + * @nocollapse + * @category styles + */ +ReactiveElement.elementStyles = []; +/** + * Options used when calling `attachShadow`. Set this property to customize + * the options for the shadowRoot; for example, to create a closed + * shadowRoot: `{mode: 'closed'}`. + * + * Note, these options are used in `createRenderRoot`. If this method + * is customized, options should be respected if possible. + * @nocollapse + * @category rendering + */ +ReactiveElement.shadowRootOptions = { mode: 'open' }; +// Apply polyfills if available +polyfillSupport$2 === null || polyfillSupport$2 === void 0 ? void 0 : polyfillSupport$2({ ReactiveElement }); +// IMPORTANT: do not change the property name or the assignment expression. +// This line will be used in regexes to search for ReactiveElement usage. +((_d$1 = global$1.reactiveElementVersions) !== null && _d$1 !== void 0 ? _d$1 : (global$1.reactiveElementVersions = [])).push('1.5.0'); + +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +var _d; +// Use window for browser builds because IE11 doesn't have globalThis. +const global = window; +const __moz_domParser = new DOMParser(); +const wrap$1 = (node) => node; +const trustedTypes = global.trustedTypes; +/** + * Our TrustedTypePolicy for HTML which is declared using the html template + * tag function. + * + * That HTML is a developer-authored constant, and is parsed with innerHTML + * before any untrusted expressions have been mixed in. Therefor it is + * considered safe by construction. + */ +const policy = trustedTypes + ? trustedTypes.createPolicy('lit-html', { + createHTML: (s) => s, + }) + : undefined; +// Added to an attribute name to mark the attribute as bound so we can find +// it easily. +const boundAttributeSuffix = '$lit$'; +// This marker is used in many syntactic positions in HTML, so it must be +// a valid element name and attribute name. We don't support dynamic names (yet) +// but this at least ensures that the parse tree is closer to the template +// intention. +const marker = `lit$${String(Math.random()).slice(9)}$`; +// String used to tell if a comment is a marker comment +const markerMatch = '?' + marker; +// Text used to insert a comment marker node. We use processing instruction +// syntax because it's slightly smaller, but parses as a comment node. +const nodeMarker = `<${markerMatch}>`; +const d = document; +// Creates a dynamic marker. We never have to search for these in the DOM. +const createMarker$1 = (v = '') => d.createComment(v); +const isPrimitive$1 = (value) => value === null || (typeof value != 'object' && typeof value != 'function'); +const isArray = Array.isArray; +const isIterable = (value) => isArray(value) || + // eslint-disable-next-line @typescript-eslint/no-explicit-any + typeof (value === null || value === void 0 ? void 0 : value[Symbol.iterator]) === 'function'; +const SPACE_CHAR = `[ \t\n\f\r]`; +const ATTR_VALUE_CHAR = `[^ \t\n\f\r"'\`<>=]`; +const NAME_CHAR = `[^\\s"'>=/]`; +// These regexes represent the five parsing states that we care about in the +// Template's HTML scanner. They match the *end* of the state they're named +// after. +// Depending on the match, we transition to a new state. If there's no match, +// we stay in the same state. +// Note that the regexes are stateful. We utilize lastIndex and sync it +// across the multiple regexes used. In addition to the five regexes below +// we also dynamically create a regex to find the matching end tags for raw +// text elements. +/** + * End of text is: `<` followed by: + * (comment start) or (tag) or (dynamic tag binding) + */ +const textEndRegex = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; +const COMMENT_START = 1; +const TAG_NAME = 2; +const DYNAMIC_TAG_NAME = 3; +const commentEndRegex = /-->/g; +/** + * Comments not started with /g; +/** + * Comments not started with ", j + 3); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedComment); + return; + } + this.onComment(s.substring(j + 3, q)); + j = q + 3; + } else if (s.substring(j + 1, j + 8) === "[CDATA[") { + q = s.indexOf("]]>", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedCdat); + return; + } + this.onCdata(s.substring(j + 8, q)); + j = q + 3; + } else if (s.substring(j + 1, j + 8) === "DOCTYPE") { + const q2 = s.indexOf("[", j + 8); + let complexDoctype = false; + q = s.indexOf(">", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration); + return; + } + if (q2 > 0 && q > q2) { + q = s.indexOf("]>", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration); + return; + } + complexDoctype = true; + } + const doctypeContent = s.substring(j + 8, q + (complexDoctype ? 1 : 0)); + this.onDoctype(doctypeContent); + j = q + (complexDoctype ? 2 : 1); + } else { + this.onError(XMLParserErrorCode.MalformedElement); + return; + } + break; + default: + const content = this._parseContent(s, j); + if (content === null) { + this.onError(XMLParserErrorCode.MalformedElement); + return; + } + let isClosed = false; + if (s.substring(j + content.parsed, j + content.parsed + 2) === "/>") { + isClosed = true; + } else if (s.substring(j + content.parsed, j + content.parsed + 1) !== ">") { + this.onError(XMLParserErrorCode.UnterminatedElement); + return; + } + this.onBeginElement(content.name, content.attributes, isClosed); + j += content.parsed + (isClosed ? 2 : 1); + break; + } + } else { + while (j < s.length && s[j] !== "<") { + j++; + } + const text = s.substring(i, j); + this.onText(this._resolveEntities(text)); + } + i = j; + } + } + onResolveEntity(name) { + return `&${name};`; + } + onPi(name, value) {} + onComment(text) {} + onCdata(text) {} + onDoctype(doctypeContent) {} + onText(text) {} + onBeginElement(name, attributes, isEmpty) {} + onEndElement(name) {} + onError(code) {} +} +class SimpleDOMNode { + constructor(nodeName, nodeValue) { + this.nodeName = nodeName; + this.nodeValue = nodeValue; + Object.defineProperty(this, "parentNode", { + value: null, + writable: true + }); + } + get firstChild() { + return this.childNodes?.[0]; + } + get nextSibling() { + const childNodes = this.parentNode.childNodes; + if (!childNodes) { + return undefined; + } + const index = childNodes.indexOf(this); + if (index === -1) { + return undefined; + } + return childNodes[index + 1]; + } + get textContent() { + if (!this.childNodes) { + return this.nodeValue || ""; + } + return this.childNodes.map(child => child.textContent).join(""); + } + get children() { + return this.childNodes || []; + } + hasChildNodes() { + return this.childNodes?.length > 0; + } + searchNode(paths, pos) { + if (pos >= paths.length) { + return this; + } + const component = paths[pos]; + if (component.name.startsWith("#") && pos < paths.length - 1) { + return this.searchNode(paths, pos + 1); + } + const stack = []; + let node = this; + while (true) { + if (component.name === node.nodeName) { + if (component.pos === 0) { + const res = node.searchNode(paths, pos + 1); + if (res !== null) { + return res; + } + } else if (stack.length === 0) { + return null; + } else { + const [parent] = stack.pop(); + let siblingPos = 0; + for (const child of parent.childNodes) { + if (component.name === child.nodeName) { + if (siblingPos === component.pos) { + return child.searchNode(paths, pos + 1); + } + siblingPos++; + } + } + return node.searchNode(paths, pos + 1); + } + } + if (node.childNodes?.length > 0) { + stack.push([node, 0]); + node = node.childNodes[0]; + } else if (stack.length === 0) { + return null; + } else { + while (stack.length !== 0) { + const [parent, currentPos] = stack.pop(); + const newPos = currentPos + 1; + if (newPos < parent.childNodes.length) { + stack.push([parent, newPos]); + node = parent.childNodes[newPos]; + break; + } + } + if (stack.length === 0) { + return null; + } + } + } + } + dump(buffer) { + if (this.nodeName === "#text") { + buffer.push(encodeToXmlString(this.nodeValue)); + return; + } + buffer.push(`<${this.nodeName}`); + if (this.attributes) { + for (const attribute of this.attributes) { + buffer.push(` ${attribute.name}="${encodeToXmlString(attribute.value)}"`); + } + } + if (this.hasChildNodes()) { + buffer.push(">"); + for (const child of this.childNodes) { + child.dump(buffer); + } + buffer.push(``); + } else if (this.nodeValue) { + buffer.push(`>${encodeToXmlString(this.nodeValue)}`); + } else { + buffer.push("/>"); + } + } +} +class SimpleXMLParser extends XMLParserBase { + constructor({ + hasAttributes = false, + lowerCaseName = false + }) { + super(); + this._currentFragment = null; + this._stack = null; + this._errorCode = XMLParserErrorCode.NoError; + this._hasAttributes = hasAttributes; + this._lowerCaseName = lowerCaseName; + } + parseFromString(data) { + this._currentFragment = []; + this._stack = []; + this._errorCode = XMLParserErrorCode.NoError; + this.parseXml(data); + if (this._errorCode !== XMLParserErrorCode.NoError) { + return undefined; + } + const [documentElement] = this._currentFragment; + if (!documentElement) { + return undefined; + } + return { + documentElement + }; + } + onText(text) { + if (isWhitespaceString(text)) { + return; + } + const node = new SimpleDOMNode("#text", text); + this._currentFragment.push(node); + } + onCdata(text) { + const node = new SimpleDOMNode("#text", text); + this._currentFragment.push(node); + } + onBeginElement(name, attributes, isEmpty) { + if (this._lowerCaseName) { + name = name.toLowerCase(); + } + const node = new SimpleDOMNode(name); + node.childNodes = []; + if (this._hasAttributes) { + node.attributes = attributes; + } + this._currentFragment.push(node); + if (isEmpty) { + return; + } + this._stack.push(this._currentFragment); + this._currentFragment = node.childNodes; + } + onEndElement(name) { + this._currentFragment = this._stack.pop() || []; + const lastElement = this._currentFragment.at(-1); + if (!lastElement) { + return null; + } + for (const childNode of lastElement.childNodes) { + childNode.parentNode = lastElement; + } + return lastElement; + } + onError(code) { + this._errorCode = code; + } +} + +;// ./src/core/metadata_parser.js + +class MetadataParser { + constructor(data) { + data = this._repair(data); + const parser = new SimpleXMLParser({ + lowerCaseName: true + }); + const xmlDocument = parser.parseFromString(data); + this._metadataMap = new Map(); + this._data = data; + if (xmlDocument) { + this._parse(xmlDocument); + } + } + _repair(data) { + return data.replace(/^[^<]+/, "").replaceAll(/>\\376\\377([^<]+)/g, function (all, codes) { + const bytes = codes.replaceAll(/\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) { + return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1); + }).replaceAll(/&(amp|apos|gt|lt|quot);/g, function (str, name) { + switch (name) { + case "amp": + return "&"; + case "apos": + return "'"; + case "gt": + return ">"; + case "lt": + return "<"; + case "quot": + return '"'; + } + throw new Error(`_repair: ${name} isn't defined.`); + }); + const charBuf = [">"]; + for (let i = 0, ii = bytes.length; i < ii; i += 2) { + const code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1); + if (code >= 32 && code < 127 && code !== 60 && code !== 62 && code !== 38) { + charBuf.push(String.fromCharCode(code)); + } else { + charBuf.push("&#x" + (0x10000 + code).toString(16).substring(1) + ";"); + } + } + return charBuf.join(""); + }); + } + _getSequence(entry) { + const name = entry.nodeName; + if (name !== "rdf:bag" && name !== "rdf:seq" && name !== "rdf:alt") { + return null; + } + return entry.childNodes.filter(node => node.nodeName === "rdf:li"); + } + _parseArray(entry) { + if (!entry.hasChildNodes()) { + return; + } + const [seqNode] = entry.childNodes; + const sequence = this._getSequence(seqNode) || []; + this._metadataMap.set(entry.nodeName, sequence.map(node => node.textContent.trim())); + } + _parse(xmlDocument) { + let rdf = xmlDocument.documentElement; + if (rdf.nodeName !== "rdf:rdf") { + rdf = rdf.firstChild; + while (rdf && rdf.nodeName !== "rdf:rdf") { + rdf = rdf.nextSibling; + } + } + if (!rdf || rdf.nodeName !== "rdf:rdf" || !rdf.hasChildNodes()) { + return; + } + for (const desc of rdf.childNodes) { + if (desc.nodeName !== "rdf:description") { + continue; + } + for (const entry of desc.childNodes) { + const name = entry.nodeName; + switch (name) { + case "#text": + continue; + case "dc:creator": + case "dc:subject": + this._parseArray(entry); + continue; + } + this._metadataMap.set(name, entry.textContent.trim()); + } + } + } + get serializable() { + return { + parsedData: this._metadataMap, + rawData: this._data + }; + } +} + +;// ./src/core/struct_tree.js + + + + + +const MAX_DEPTH = 40; +const StructElementType = { + PAGE_CONTENT: 1, + STREAM_CONTENT: 2, + OBJECT: 3, + ANNOTATION: 4, + ELEMENT: 5 +}; +class StructTreeRoot { + constructor(xref, rootDict, rootRef) { + this.xref = xref; + this.dict = rootDict; + this.ref = rootRef instanceof Ref ? rootRef : null; + this.roleMap = new Map(); + this.structParentIds = null; + this.kidRefToPosition = undefined; + this.parentTree = null; + } + getKidPosition(kidRef) { + if (this.kidRefToPosition === undefined) { + const obj = this.dict.get("K"); + if (Array.isArray(obj)) { + const map = this.kidRefToPosition = new Map(); + for (let i = 0, ii = obj.length; i < ii; i++) { + const ref = obj[i]; + if (ref) { + map.set(ref.toString(), i); + } + } + } else if (obj instanceof Dict) { + this.kidRefToPosition = new Map([[obj.objId, 0]]); + } else if (!obj) { + this.kidRefToPosition = new Map(); + } else { + this.kidRefToPosition = null; + } + } + return this.kidRefToPosition ? this.kidRefToPosition.get(kidRef) ?? NaN : -1; + } + init() { + this.readRoleMap(); + const parentTree = this.dict.get("ParentTree"); + if (!parentTree) { + return; + } + this.parentTree = new NumberTree(parentTree, this.xref); + } + #addIdToPage(pageRef, id, type) { + if (!(pageRef instanceof Ref) || id < 0) { + return; + } + this.structParentIds ||= new RefSetCache(); + let ids = this.structParentIds.get(pageRef); + if (!ids) { + ids = []; + this.structParentIds.put(pageRef, ids); + } + ids.push([id, type]); + } + addAnnotationIdToPage(pageRef, id) { + this.#addIdToPage(pageRef, id, StructElementType.ANNOTATION); + } + readRoleMap() { + const roleMapDict = this.dict.get("RoleMap"); + if (!(roleMapDict instanceof Dict)) { + return; + } + for (const [key, value] of roleMapDict) { + if (value instanceof Name) { + this.roleMap.set(key, value.name); + } + } + } + static async canCreateStructureTree({ + catalogRef, + pdfManager, + newAnnotationsByPage + }) { + if (!(catalogRef instanceof Ref)) { + warn("Cannot save the struct tree: no catalog reference."); + return false; + } + let nextKey = 0; + let hasNothingToUpdate = true; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const { + ref: pageRef + } = await pdfManager.getPage(pageIndex); + if (!(pageRef instanceof Ref)) { + warn(`Cannot save the struct tree: page ${pageIndex} has no ref.`); + hasNothingToUpdate = true; + break; + } + for (const element of elements) { + if (element.accessibilityData?.type) { + element.parentTreeId = nextKey++; + hasNothingToUpdate = false; + } + } + } + if (hasNothingToUpdate) { + for (const elements of newAnnotationsByPage.values()) { + for (const element of elements) { + delete element.parentTreeId; + } + } + return false; + } + return true; + } + static async createStructureTree({ + newAnnotationsByPage, + xref, + catalogRef, + pdfManager, + changes + }) { + const root = await pdfManager.ensureCatalog("cloneDict"); + const cache = new RefSetCache(); + cache.put(catalogRef, root); + const structTreeRootRef = xref.getNewTemporaryRef(); + root.set("StructTreeRoot", structTreeRootRef); + const structTreeRoot = new Dict(xref); + structTreeRoot.set("Type", Name.get("StructTreeRoot")); + const parentTreeRef = xref.getNewTemporaryRef(); + structTreeRoot.set("ParentTree", parentTreeRef); + const kids = []; + structTreeRoot.set("K", kids); + cache.put(structTreeRootRef, structTreeRoot); + const parentTree = new Dict(xref); + const nums = []; + parentTree.set("Nums", nums); + const nextKey = await this.#writeKids({ + newAnnotationsByPage, + structTreeRootRef, + structTreeRoot: null, + kids, + nums, + xref, + pdfManager, + changes, + cache + }); + structTreeRoot.set("ParentTreeNextKey", nextKey); + cache.put(parentTreeRef, parentTree); + for (const [ref, obj] of cache.items()) { + changes.put(ref, { + data: obj + }); + } + } + async canUpdateStructTree({ + pdfManager, + newAnnotationsByPage + }) { + if (!this.ref) { + warn("Cannot update the struct tree: no root reference."); + return false; + } + let nextKey = this.dict.get("ParentTreeNextKey"); + if (!Number.isInteger(nextKey) || nextKey < 0) { + warn("Cannot update the struct tree: invalid next key."); + return false; + } + const parentTree = this.dict.get("ParentTree"); + if (!(parentTree instanceof Dict)) { + warn("Cannot update the struct tree: ParentTree isn't a dict."); + return false; + } + const nums = parentTree.get("Nums"); + if (!Array.isArray(nums)) { + warn("Cannot update the struct tree: nums isn't an array."); + return false; + } + const numberTree = new NumberTree(parentTree, this.xref); + for (const pageIndex of newAnnotationsByPage.keys()) { + const { + pageDict + } = await pdfManager.getPage(pageIndex); + if (!pageDict.has("StructParents")) { + continue; + } + const id = pageDict.get("StructParents"); + if (!Number.isInteger(id) || !Array.isArray(numberTree.get(id))) { + warn(`Cannot save the struct tree: page ${pageIndex} has a wrong id.`); + return false; + } + } + let hasNothingToUpdate = true; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const { + pageDict + } = await pdfManager.getPage(pageIndex); + StructTreeRoot.#collectParents({ + elements, + xref: this.xref, + pageDict, + numberTree + }); + for (const element of elements) { + if (element.accessibilityData?.type) { + if (!(element.accessibilityData.structParent >= 0)) { + element.parentTreeId = nextKey++; + } + hasNothingToUpdate = false; + } + } + } + if (hasNothingToUpdate) { + for (const elements of newAnnotationsByPage.values()) { + for (const element of elements) { + delete element.parentTreeId; + delete element.structTreeParent; + } + } + return false; + } + return true; + } + async updateStructureTree({ + newAnnotationsByPage, + pdfManager, + changes + }) { + const { + ref: structTreeRootRef, + xref + } = this; + const structTreeRoot = this.dict.clone(); + const cache = new RefSetCache(); + cache.put(structTreeRootRef, structTreeRoot); + let parentTreeRef = structTreeRoot.getRaw("ParentTree"); + let parentTree; + if (parentTreeRef instanceof Ref) { + parentTree = xref.fetch(parentTreeRef); + } else { + parentTree = parentTreeRef; + parentTreeRef = xref.getNewTemporaryRef(); + structTreeRoot.set("ParentTree", parentTreeRef); + } + parentTree = parentTree.clone(); + cache.put(parentTreeRef, parentTree); + let nums = parentTree.getRaw("Nums"); + let numsRef = null; + if (nums instanceof Ref) { + numsRef = nums; + nums = xref.fetch(numsRef); + } + nums = nums.slice(); + if (!numsRef) { + parentTree.set("Nums", nums); + } + const newNextKey = await StructTreeRoot.#writeKids({ + newAnnotationsByPage, + structTreeRootRef, + structTreeRoot: this, + kids: null, + nums, + xref, + pdfManager, + changes, + cache + }); + if (newNextKey === -1) { + return; + } + structTreeRoot.set("ParentTreeNextKey", newNextKey); + if (numsRef) { + cache.put(numsRef, nums); + } + for (const [ref, obj] of cache.items()) { + changes.put(ref, { + data: obj + }); + } + } + static async #writeKids({ + newAnnotationsByPage, + structTreeRootRef, + structTreeRoot, + kids, + nums, + xref, + pdfManager, + changes, + cache + }) { + const objr = Name.get("OBJR"); + let nextKey = -1; + let structTreePageObjs; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const page = await pdfManager.getPage(pageIndex); + const { + ref: pageRef + } = page; + const isPageRef = pageRef instanceof Ref; + for (const { + accessibilityData, + ref, + parentTreeId, + structTreeParent + } of elements) { + if (!accessibilityData?.type) { + continue; + } + const { + structParent + } = accessibilityData; + if (structTreeRoot && Number.isInteger(structParent) && structParent >= 0) { + let objs = (structTreePageObjs ||= new Map()).get(pageIndex); + if (objs === undefined) { + const structTreePage = new StructTreePage(structTreeRoot, page.pageDict); + objs = structTreePage.collectObjects(pageRef); + structTreePageObjs.set(pageIndex, objs); + } + const objRef = objs?.get(structParent); + if (objRef) { + const tagDict = xref.fetch(objRef).clone(); + StructTreeRoot.#writeProperties(tagDict, accessibilityData); + changes.put(objRef, { + data: tagDict + }); + continue; + } + } + nextKey = Math.max(nextKey, parentTreeId); + const tagRef = xref.getNewTemporaryRef(); + const tagDict = new Dict(xref); + StructTreeRoot.#writeProperties(tagDict, accessibilityData); + await this.#updateParentTag({ + structTreeParent, + tagDict, + newTagRef: tagRef, + structTreeRootRef, + fallbackKids: kids, + xref, + cache + }); + const objDict = new Dict(xref); + tagDict.set("K", objDict); + objDict.set("Type", objr); + if (isPageRef) { + objDict.set("Pg", pageRef); + } + objDict.set("Obj", ref); + cache.put(tagRef, tagDict); + nums.push(parentTreeId, tagRef); + } + } + return nextKey + 1; + } + static #writeProperties(tagDict, { + type, + title, + lang, + alt, + expanded, + actualText + }) { + tagDict.set("S", Name.get(type)); + if (title) { + tagDict.set("T", stringToAsciiOrUTF16BE(title)); + } + if (lang) { + tagDict.set("Lang", stringToAsciiOrUTF16BE(lang)); + } + if (alt) { + tagDict.set("Alt", stringToAsciiOrUTF16BE(alt)); + } + if (expanded) { + tagDict.set("E", stringToAsciiOrUTF16BE(expanded)); + } + if (actualText) { + tagDict.set("ActualText", stringToAsciiOrUTF16BE(actualText)); + } + } + static #collectParents({ + elements, + xref, + pageDict, + numberTree + }) { + const idToElements = new Map(); + for (const element of elements) { + if (element.structTreeParentId) { + const id = parseInt(element.structTreeParentId.split("_mc")[1], 10); + let elems = idToElements.get(id); + if (!elems) { + elems = []; + idToElements.set(id, elems); + } + elems.push(element); + } + } + const id = pageDict.get("StructParents"); + if (!Number.isInteger(id)) { + return; + } + const parentArray = numberTree.get(id); + const updateElement = (kid, pageKid, kidRef) => { + const elems = idToElements.get(kid); + if (elems) { + const parentRef = pageKid.getRaw("P"); + const parentDict = xref.fetchIfRef(parentRef); + if (parentRef instanceof Ref && parentDict instanceof Dict) { + const params = { + ref: kidRef, + dict: pageKid + }; + for (const element of elems) { + element.structTreeParent = params; + } + } + return true; + } + return false; + }; + for (const kidRef of parentArray) { + if (!(kidRef instanceof Ref)) { + continue; + } + const pageKid = xref.fetch(kidRef); + const k = pageKid.get("K"); + if (Number.isInteger(k)) { + updateElement(k, pageKid, kidRef); + continue; + } + if (!Array.isArray(k)) { + continue; + } + for (let kid of k) { + kid = xref.fetchIfRef(kid); + if (Number.isInteger(kid) && updateElement(kid, pageKid, kidRef)) { + break; + } + if (!(kid instanceof Dict)) { + continue; + } + if (!isName(kid.get("Type"), "MCR")) { + break; + } + const mcid = kid.get("MCID"); + if (Number.isInteger(mcid) && updateElement(mcid, pageKid, kidRef)) { + break; + } + } + } + } + static async #updateParentTag({ + structTreeParent, + tagDict, + newTagRef, + structTreeRootRef, + fallbackKids, + xref, + cache + }) { + let ref = null; + let parentRef; + if (structTreeParent) { + ({ + ref + } = structTreeParent); + parentRef = structTreeParent.dict.getRaw("P") || structTreeRootRef; + } else { + parentRef = structTreeRootRef; + } + tagDict.set("P", parentRef); + const parentDict = xref.fetchIfRef(parentRef); + if (!parentDict) { + fallbackKids.push(newTagRef); + return; + } + let cachedParentDict = cache.get(parentRef); + if (!cachedParentDict) { + cachedParentDict = parentDict.clone(); + cache.put(parentRef, cachedParentDict); + } + const parentKidsRaw = cachedParentDict.getRaw("K"); + let cachedParentKids = parentKidsRaw instanceof Ref ? cache.get(parentKidsRaw) : null; + if (!cachedParentKids) { + cachedParentKids = xref.fetchIfRef(parentKidsRaw); + cachedParentKids = Array.isArray(cachedParentKids) ? cachedParentKids.slice() : [parentKidsRaw]; + const parentKidsRef = xref.getNewTemporaryRef(); + cachedParentDict.set("K", parentKidsRef); + cache.put(parentKidsRef, cachedParentKids); + } + const index = cachedParentKids.indexOf(ref); + cachedParentKids.splice(index >= 0 ? index + 1 : cachedParentKids.length, 0, newTagRef); + } +} +class StructElementNode { + constructor(tree, dict) { + this.tree = tree; + this.xref = tree.xref; + this.dict = dict; + this.kids = []; + this.parseKids(); + } + get role() { + const nameObj = this.dict.get("S"); + const name = nameObj instanceof Name ? nameObj.name : ""; + const { + root + } = this.tree; + return root.roleMap.get(name) ?? name; + } + get mathML() { + let AFs = this.dict.get("AF") || []; + if (!Array.isArray(AFs)) { + AFs = [AFs]; + } + for (let af of AFs) { + af = this.xref.fetchIfRef(af); + if (!(af instanceof Dict)) { + continue; + } + if (!isName(af.get("Type"), "Filespec")) { + continue; + } + if (!isName(af.get("AFRelationship"), "Supplement")) { + continue; + } + const ef = af.get("EF"); + if (!(ef instanceof Dict)) { + continue; + } + const fileStream = ef.get("UF") || ef.get("F"); + if (!(fileStream instanceof BaseStream)) { + continue; + } + if (!isName(fileStream.dict.get("Type"), "EmbeddedFile")) { + continue; + } + if (!isName(fileStream.dict.get("Subtype"), "application/mathml+xml")) { + continue; + } + return stringToUTF8String(fileStream.getString()); + } + const A = this.dict.get("A"); + if (A instanceof Dict) { + const O = A.get("O"); + if (isName(O, "MSFT_Office")) { + const mathml = A.get("MSFT_MathML"); + return mathml ? stringToPDFString(mathml) : null; + } + } + return null; + } + parseKids() { + let pageObjId = null; + const objRef = this.dict.getRaw("Pg"); + if (objRef instanceof Ref) { + pageObjId = objRef.toString(); + } + const kids = this.dict.get("K"); + if (Array.isArray(kids)) { + for (const kid of kids) { + const element = this.parseKid(pageObjId, this.xref.fetchIfRef(kid)); + if (element) { + this.kids.push(element); + } + } + } else { + const element = this.parseKid(pageObjId, kids); + if (element) { + this.kids.push(element); + } + } + } + parseKid(pageObjId, kid) { + if (Number.isInteger(kid)) { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + return new StructElement({ + type: StructElementType.PAGE_CONTENT, + mcid: kid, + pageObjId + }); + } + if (!(kid instanceof Dict)) { + return null; + } + const pageRef = kid.getRaw("Pg"); + if (pageRef instanceof Ref) { + pageObjId = pageRef.toString(); + } + const type = kid.get("Type") instanceof Name ? kid.get("Type").name : null; + if (type === "MCR") { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + const kidRef = kid.getRaw("Stm"); + return new StructElement({ + type: StructElementType.STREAM_CONTENT, + refObjId: kidRef instanceof Ref ? kidRef.toString() : null, + pageObjId, + mcid: kid.get("MCID") + }); + } + if (type === "OBJR") { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + const kidRef = kid.getRaw("Obj"); + return new StructElement({ + type: StructElementType.OBJECT, + refObjId: kidRef instanceof Ref ? kidRef.toString() : null, + pageObjId + }); + } + return new StructElement({ + type: StructElementType.ELEMENT, + dict: kid + }); + } +} +class StructElement { + constructor({ + type, + dict = null, + mcid = null, + pageObjId = null, + refObjId = null + }) { + this.type = type; + this.dict = dict; + this.mcid = mcid; + this.pageObjId = pageObjId; + this.refObjId = refObjId; + this.parentNode = null; + } +} +class StructTreePage { + constructor(structTreeRoot, pageDict) { + this.root = structTreeRoot; + this.xref = structTreeRoot?.xref ?? null; + this.rootDict = structTreeRoot?.dict ?? null; + this.pageDict = pageDict; + this.nodes = []; + } + collectObjects(pageRef) { + if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) { + return null; + } + const parentTree = this.rootDict.get("ParentTree"); + if (!parentTree) { + return null; + } + const ids = this.root.structParentIds?.get(pageRef); + if (!ids) { + return null; + } + const map = new Map(); + const numberTree = new NumberTree(parentTree, this.xref); + for (const [elemId] of ids) { + const obj = numberTree.getRaw(elemId); + if (obj instanceof Ref) { + map.set(elemId, obj); + } + } + return map; + } + parse(pageRef) { + if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) { + return; + } + const { + parentTree + } = this.root; + if (!parentTree) { + return; + } + const id = this.pageDict.get("StructParents"); + const ids = this.root.structParentIds?.get(pageRef); + if (!Number.isInteger(id) && !ids) { + return; + } + const map = new Map(); + if (Number.isInteger(id)) { + const parentArray = parentTree.get(id); + if (Array.isArray(parentArray)) { + for (const ref of parentArray) { + if (ref instanceof Ref) { + this.addNode(this.xref.fetch(ref), map); + } + } + } + } + if (!ids) { + return; + } + for (const [elemId, type] of ids) { + const obj = parentTree.get(elemId); + if (obj) { + const elem = this.addNode(this.xref.fetchIfRef(obj), map); + if (elem?.kids?.length === 1 && elem.kids[0].type === StructElementType.OBJECT) { + elem.kids[0].type = type; + } + } + } + } + addNode(dict, map, level = 0) { + if (level > MAX_DEPTH) { + warn("StructTree MAX_DEPTH reached."); + return null; + } + if (!(dict instanceof Dict)) { + return null; + } + if (map.has(dict)) { + return map.get(dict); + } + const element = new StructElementNode(this, dict); + map.set(dict, element); + switch (element.role) { + case "L": + case "LBody": + case "LI": + case "Table": + case "THead": + case "TBody": + case "TFoot": + case "TR": + { + for (const kid of element.kids) { + if (kid.type === StructElementType.ELEMENT) { + this.addNode(kid.dict, map, level - 1); + } + } + } + } + const parent = dict.get("P"); + if (!(parent instanceof Dict) || isName(parent.get("Type"), "StructTreeRoot")) { + if (!this.addTopLevelNode(dict, element)) { + map.delete(dict); + } + return element; + } + const parentNode = this.addNode(parent, map, level + 1); + if (!parentNode) { + return element; + } + let save = false; + for (const kid of parentNode.kids) { + if (kid.type === StructElementType.ELEMENT && kid.dict === dict) { + kid.parentNode = element; + save = true; + } + } + if (!save) { + map.delete(dict); + } + return element; + } + addTopLevelNode(dict, element) { + const index = this.root.getKidPosition(dict.objId); + if (isNaN(index)) { + return false; + } + if (index !== -1) { + this.nodes[index] = element; + } + return true; + } + get serializable() { + function nodeToSerializable(node, parent, level = 0) { + if (level > MAX_DEPTH) { + warn("StructTree too deep to be fully serialized."); + return; + } + const obj = Object.create(null); + obj.role = node.role; + obj.children = []; + parent.children.push(obj); + let alt = node.dict.get("Alt"); + if (typeof alt !== "string") { + alt = node.dict.get("ActualText"); + } + if (typeof alt === "string") { + obj.alt = stringToPDFString(alt); + } + if (obj.role === "Formula") { + const { + mathML + } = node; + if (mathML) { + obj.mathML = mathML; + } + } + const a = node.dict.get("A"); + if (a instanceof Dict) { + const bbox = lookupNormalRect(a.getArray("BBox"), null); + if (bbox) { + obj.bbox = bbox; + } else { + const width = a.get("Width"); + const height = a.get("Height"); + if (typeof width === "number" && width > 0 && typeof height === "number" && height > 0) { + obj.bbox = [0, 0, width, height]; + } + } + } + const lang = node.dict.get("Lang"); + if (typeof lang === "string") { + obj.lang = stringToPDFString(lang); + } + for (const kid of node.kids) { + const kidElement = kid.type === StructElementType.ELEMENT ? kid.parentNode : null; + if (kidElement) { + nodeToSerializable(kidElement, obj, level + 1); + continue; + } else if (kid.type === StructElementType.PAGE_CONTENT || kid.type === StructElementType.STREAM_CONTENT) { + obj.children.push({ + type: "content", + id: `p${kid.pageObjId}_mc${kid.mcid}` + }); + } else if (kid.type === StructElementType.OBJECT) { + obj.children.push({ + type: "object", + id: kid.refObjId + }); + } else if (kid.type === StructElementType.ANNOTATION) { + obj.children.push({ + type: "annotation", + id: `${AnnotationPrefix}${kid.refObjId}` + }); + } + } + } + const root = Object.create(null); + root.children = []; + root.role = "Root"; + for (const child of this.nodes) { + if (!child) { + continue; + } + nodeToSerializable(child, root); + } + return root; + } +} + +;// ./src/core/catalog.js + + + + + + + + + + + +const isRef = v => v instanceof Ref; +const isValidExplicitDest = _isValidExplicitDest.bind(null, isRef, isName); +function fetchDest(dest) { + if (dest instanceof Dict) { + dest = dest.get("D"); + } + return isValidExplicitDest(dest) ? dest : null; +} +function fetchRemoteDest(action) { + let dest = action.get("D"); + if (dest) { + if (dest instanceof Name) { + dest = dest.name; + } + if (typeof dest === "string") { + return stringToPDFString(dest, true); + } else if (isValidExplicitDest(dest)) { + return JSON.stringify(dest); + } + } + return null; +} +class Catalog { + #actualNumPages = null; + #catDict = null; + builtInCMapCache = new Map(); + fontCache = new RefSetCache(); + globalColorSpaceCache = new GlobalColorSpaceCache(); + globalImageCache = new GlobalImageCache(); + nonBlendModesSet = new RefSet(); + pageDictCache = new RefSetCache(); + pageIndexCache = new RefSetCache(); + pageKidsCountCache = new RefSetCache(); + standardFontDataCache = new Map(); + systemFontCache = new Map(); + constructor(pdfManager, xref) { + this.pdfManager = pdfManager; + this.xref = xref; + this.#catDict = xref.getCatalogObj(); + if (!(this.#catDict instanceof Dict)) { + throw new FormatError("Catalog object is not a dictionary."); + } + this.toplevelPagesDict; + } + cloneDict() { + return this.#catDict.clone(); + } + get version() { + const version = this.#catDict.get("Version"); + if (version instanceof Name) { + if (PDF_VERSION_REGEXP.test(version.name)) { + return shadow(this, "version", version.name); + } + warn(`Invalid PDF catalog version: ${version.name}`); + } + return shadow(this, "version", null); + } + get lang() { + const lang = this.#catDict.get("Lang"); + return shadow(this, "lang", lang && typeof lang === "string" ? stringToPDFString(lang) : null); + } + get needsRendering() { + const needsRendering = this.#catDict.get("NeedsRendering"); + return shadow(this, "needsRendering", typeof needsRendering === "boolean" ? needsRendering : false); + } + get collection() { + let collection = null; + try { + const obj = this.#catDict.get("Collection"); + if (obj instanceof Dict && obj.size > 0) { + collection = obj; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info("Cannot fetch Collection entry; assuming no collection is present."); + } + return shadow(this, "collection", collection); + } + get acroForm() { + let acroForm = null; + try { + const obj = this.#catDict.get("AcroForm"); + if (obj instanceof Dict && obj.size > 0) { + acroForm = obj; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info("Cannot fetch AcroForm entry; assuming no forms are present."); + } + return shadow(this, "acroForm", acroForm); + } + get acroFormRef() { + const value = this.#catDict.getRaw("AcroForm"); + return shadow(this, "acroFormRef", value instanceof Ref ? value : null); + } + get metadata() { + const streamRef = this.#catDict.getRaw("Metadata"); + if (!(streamRef instanceof Ref)) { + return shadow(this, "metadata", null); + } + let metadata = null; + try { + const stream = this.xref.fetch(streamRef, !this.xref.encrypt?.encryptMetadata); + if (stream instanceof BaseStream && stream.dict instanceof Dict) { + const type = stream.dict.get("Type"); + const subtype = stream.dict.get("Subtype"); + if (isName(type, "Metadata") && isName(subtype, "XML")) { + const data = stringToUTF8String(stream.getString()); + if (data) { + metadata = new MetadataParser(data).serializable; + } + } + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info(`Skipping invalid Metadata: "${ex}".`); + } + return shadow(this, "metadata", metadata); + } + get markInfo() { + let markInfo = null; + try { + markInfo = this.#readMarkInfo(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read mark info."); + } + return shadow(this, "markInfo", markInfo); + } + #readMarkInfo() { + const obj = this.#catDict.get("MarkInfo"); + if (!(obj instanceof Dict)) { + return null; + } + const markInfo = { + Marked: false, + UserProperties: false, + Suspects: false + }; + for (const key in markInfo) { + const value = obj.get(key); + if (typeof value === "boolean") { + markInfo[key] = value; + } + } + return markInfo; + } + get hasStructTree() { + return this.#catDict.has("StructTreeRoot"); + } + get structTreeRoot() { + let structTree = null; + try { + structTree = this.#readStructTreeRoot(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable read to structTreeRoot info."); + } + return shadow(this, "structTreeRoot", structTree); + } + #readStructTreeRoot() { + const rawObj = this.#catDict.getRaw("StructTreeRoot"); + const obj = this.xref.fetchIfRef(rawObj); + if (!(obj instanceof Dict)) { + return null; + } + const root = new StructTreeRoot(this.xref, obj, rawObj); + root.init(); + return root; + } + get toplevelPagesDict() { + const pagesObj = this.#catDict.get("Pages"); + if (!(pagesObj instanceof Dict)) { + throw new FormatError("Invalid top-level pages dictionary."); + } + return shadow(this, "toplevelPagesDict", pagesObj); + } + get documentOutline() { + let obj = null; + try { + obj = this.#readDocumentOutline(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read document outline."); + } + return shadow(this, "documentOutline", obj); + } + #readDocumentOutline() { + let obj = this.#catDict.get("Outlines"); + if (!(obj instanceof Dict)) { + return null; + } + obj = obj.getRaw("First"); + if (!(obj instanceof Ref)) { + return null; + } + const root = { + items: [] + }; + const queue = [{ + obj, + parent: root + }]; + const processed = new RefSet(); + processed.put(obj); + const xref = this.xref, + blackColor = new Uint8ClampedArray(3); + while (queue.length > 0) { + const i = queue.shift(); + const outlineDict = xref.fetchIfRef(i.obj); + if (outlineDict === null) { + continue; + } + if (!outlineDict.has("Title")) { + warn("Invalid outline item encountered."); + } + const data = { + url: null, + dest: null, + action: null + }; + Catalog.parseDestDictionary({ + destDict: outlineDict, + resultObj: data, + docBaseUrl: this.baseUrl, + docAttachments: this.attachments + }); + const title = outlineDict.get("Title"); + const flags = outlineDict.get("F") || 0; + const color = outlineDict.getArray("C"); + const count = outlineDict.get("Count"); + let rgbColor = blackColor; + if (isNumberArray(color, 3) && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { + rgbColor = ColorSpaceUtils.rgb.getRgb(color, 0); + } + const outlineItem = { + action: data.action, + attachment: data.attachment, + dest: data.dest, + url: data.url, + unsafeUrl: data.unsafeUrl, + newWindow: data.newWindow, + setOCGState: data.setOCGState, + title: typeof title === "string" ? stringToPDFString(title) : "", + color: rgbColor, + count: Number.isInteger(count) ? count : undefined, + bold: !!(flags & 2), + italic: !!(flags & 1), + items: [] + }; + i.parent.items.push(outlineItem); + obj = outlineDict.getRaw("First"); + if (obj instanceof Ref && !processed.has(obj)) { + queue.push({ + obj, + parent: outlineItem + }); + processed.put(obj); + } + obj = outlineDict.getRaw("Next"); + if (obj instanceof Ref && !processed.has(obj)) { + queue.push({ + obj, + parent: i.parent + }); + processed.put(obj); + } + } + return root.items.length > 0 ? root.items : null; + } + get permissions() { + let permissions = null; + try { + permissions = this.#readPermissions(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read permissions."); + } + return shadow(this, "permissions", permissions); + } + #readPermissions() { + const encrypt = this.xref.trailer.get("Encrypt"); + if (!(encrypt instanceof Dict)) { + return null; + } + let flags = encrypt.get("P"); + if (typeof flags !== "number") { + return null; + } + flags += 2 ** 32; + const permissions = []; + for (const key in PermissionFlag) { + const value = PermissionFlag[key]; + if (flags & value) { + permissions.push(value); + } + } + return permissions; + } + get optionalContentConfig() { + let config = null; + try { + const properties = this.#catDict.get("OCProperties"); + if (!properties) { + return shadow(this, "optionalContentConfig", null); + } + const defaultConfig = properties.get("D"); + if (!defaultConfig) { + return shadow(this, "optionalContentConfig", null); + } + const groupsData = properties.get("OCGs"); + if (!Array.isArray(groupsData)) { + return shadow(this, "optionalContentConfig", null); + } + const groupRefCache = new RefSetCache(); + for (const groupRef of groupsData) { + if (!(groupRef instanceof Ref) || groupRefCache.has(groupRef)) { + continue; + } + groupRefCache.put(groupRef, this.#readOptionalContentGroup(groupRef)); + } + config = this.#readOptionalContentConfig(defaultConfig, groupRefCache); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Unable to read optional content config: ${ex}`); + } + return shadow(this, "optionalContentConfig", config); + } + #readOptionalContentGroup(groupRef) { + const group = this.xref.fetch(groupRef); + const obj = { + id: groupRef.toString(), + name: null, + intent: null, + usage: { + print: null, + view: null + }, + rbGroups: [] + }; + const name = group.get("Name"); + if (typeof name === "string") { + obj.name = stringToPDFString(name); + } + let intent = group.getArray("Intent"); + if (!Array.isArray(intent)) { + intent = [intent]; + } + if (intent.every(i => i instanceof Name)) { + obj.intent = intent.map(i => i.name); + } + const usage = group.get("Usage"); + if (!(usage instanceof Dict)) { + return obj; + } + const usageObj = obj.usage; + const print = usage.get("Print"); + if (print instanceof Dict) { + const printState = print.get("PrintState"); + if (printState instanceof Name) { + switch (printState.name) { + case "ON": + case "OFF": + usageObj.print = { + printState: printState.name + }; + } + } + } + const view = usage.get("View"); + if (view instanceof Dict) { + const viewState = view.get("ViewState"); + if (viewState instanceof Name) { + switch (viewState.name) { + case "ON": + case "OFF": + usageObj.view = { + viewState: viewState.name + }; + } + } + } + return obj; + } + #readOptionalContentConfig(config, groupRefCache) { + function parseOnOff(refs) { + const onParsed = []; + if (Array.isArray(refs)) { + for (const value of refs) { + if (value instanceof Ref && groupRefCache.has(value)) { + onParsed.push(value.toString()); + } + } + } + return onParsed; + } + function parseOrder(refs, nestedLevels = 0) { + if (!Array.isArray(refs)) { + return null; + } + const order = []; + for (const value of refs) { + if (value instanceof Ref && groupRefCache.has(value)) { + parsedOrderRefs.put(value); + order.push(value.toString()); + continue; + } + const nestedOrder = parseNestedOrder(value, nestedLevels); + if (nestedOrder) { + order.push(nestedOrder); + } + } + if (nestedLevels > 0) { + return order; + } + const hiddenGroups = []; + for (const [groupRef] of groupRefCache.items()) { + if (parsedOrderRefs.has(groupRef)) { + continue; + } + hiddenGroups.push(groupRef.toString()); + } + if (hiddenGroups.length) { + order.push({ + name: null, + order: hiddenGroups + }); + } + return order; + } + function parseNestedOrder(ref, nestedLevels) { + if (++nestedLevels > MAX_NESTED_LEVELS) { + warn("parseNestedOrder - reached MAX_NESTED_LEVELS."); + return null; + } + const value = xref.fetchIfRef(ref); + if (!Array.isArray(value)) { + return null; + } + const nestedName = xref.fetchIfRef(value[0]); + if (typeof nestedName !== "string") { + return null; + } + const nestedOrder = parseOrder(value.slice(1), nestedLevels); + if (!nestedOrder?.length) { + return null; + } + return { + name: stringToPDFString(nestedName), + order: nestedOrder + }; + } + function parseRBGroups(rbGroups) { + if (!Array.isArray(rbGroups)) { + return; + } + for (const value of rbGroups) { + const rbGroup = xref.fetchIfRef(value); + if (!Array.isArray(rbGroup) || !rbGroup.length) { + continue; + } + const parsedRbGroup = new Set(); + for (const ref of rbGroup) { + if (ref instanceof Ref && groupRefCache.has(ref) && !parsedRbGroup.has(ref.toString())) { + parsedRbGroup.add(ref.toString()); + groupRefCache.get(ref).rbGroups.push(parsedRbGroup); + } + } + } + } + const xref = this.xref, + parsedOrderRefs = new RefSet(), + MAX_NESTED_LEVELS = 10; + parseRBGroups(config.get("RBGroups")); + return { + name: typeof config.get("Name") === "string" ? stringToPDFString(config.get("Name")) : null, + creator: typeof config.get("Creator") === "string" ? stringToPDFString(config.get("Creator")) : null, + baseState: config.get("BaseState") instanceof Name ? config.get("BaseState").name : null, + on: parseOnOff(config.get("ON")), + off: parseOnOff(config.get("OFF")), + order: parseOrder(config.get("Order")), + groups: [...groupRefCache] + }; + } + setActualNumPages(num = null) { + this.#actualNumPages = num; + } + get hasActualNumPages() { + return this.#actualNumPages !== null; + } + get _pagesCount() { + const obj = this.toplevelPagesDict.get("Count"); + if (!Number.isInteger(obj)) { + throw new FormatError("Page count in top-level pages dictionary is not an integer."); + } + return shadow(this, "_pagesCount", obj); + } + get numPages() { + return this.#actualNumPages ?? this._pagesCount; + } + get destinations() { + const rawDests = this.#readDests(), + dests = Object.create(null); + for (const obj of rawDests) { + if (obj instanceof NameTree) { + for (const [key, value] of obj.getAll()) { + const dest = fetchDest(value); + if (dest) { + dests[stringToPDFString(key, true)] = dest; + } + } + } else if (obj instanceof Dict) { + for (const [key, value] of obj) { + const dest = fetchDest(value); + if (dest) { + dests[stringToPDFString(key, true)] ||= dest; + } + } + } + } + return shadow(this, "destinations", dests); + } + getDestination(id) { + if (this.hasOwnProperty("destinations")) { + return this.destinations[id] ?? null; + } + const rawDests = this.#readDests(); + for (const obj of rawDests) { + if (obj instanceof NameTree || obj instanceof Dict) { + const dest = fetchDest(obj.get(id)); + if (dest) { + return dest; + } + } + } + if (rawDests.length) { + const dest = this.destinations[id]; + if (dest) { + return dest; + } + } + return null; + } + #readDests() { + const obj = this.#catDict.get("Names"); + const rawDests = []; + if (obj?.has("Dests")) { + rawDests.push(new NameTree(obj.getRaw("Dests"), this.xref)); + } + if (this.#catDict.has("Dests")) { + rawDests.push(this.#catDict.get("Dests")); + } + return rawDests; + } + get rawPageLabels() { + const obj = this.#catDict.getRaw("PageLabels"); + if (!obj) { + return null; + } + const numberTree = new NumberTree(obj, this.xref); + return numberTree.getAll(); + } + get pageLabels() { + let obj = null; + try { + obj = this.#readPageLabels(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read page labels."); + } + return shadow(this, "pageLabels", obj); + } + #readPageLabels() { + const nums = this.rawPageLabels; + if (!nums) { + return null; + } + const pageLabels = new Array(this.numPages); + let style = null, + prefix = ""; + let currentLabel = "", + currentIndex = 1; + for (let i = 0, ii = this.numPages; i < ii; i++) { + const labelDict = nums.get(i); + if (labelDict !== undefined) { + if (!(labelDict instanceof Dict)) { + throw new FormatError("PageLabel is not a dictionary."); + } + if (labelDict.has("Type") && !isName(labelDict.get("Type"), "PageLabel")) { + throw new FormatError("Invalid type in PageLabel dictionary."); + } + if (labelDict.has("S")) { + const s = labelDict.get("S"); + if (!(s instanceof Name)) { + throw new FormatError("Invalid style in PageLabel dictionary."); + } + style = s.name; + } else { + style = null; + } + if (labelDict.has("P")) { + const p = labelDict.get("P"); + if (typeof p !== "string") { + throw new FormatError("Invalid prefix in PageLabel dictionary."); + } + prefix = stringToPDFString(p); + } else { + prefix = ""; + } + if (labelDict.has("St")) { + const st = labelDict.get("St"); + if (!(Number.isInteger(st) && st >= 1)) { + throw new FormatError("Invalid start in PageLabel dictionary."); + } + currentIndex = st; + } else { + currentIndex = 1; + } + } + switch (style) { + case "D": + currentLabel = currentIndex; + break; + case "R": + case "r": + currentLabel = toRomanNumerals(currentIndex, style === "r"); + break; + case "A": + case "a": + const LIMIT = 26; + const A_UPPER_CASE = 0x41, + A_LOWER_CASE = 0x61; + const baseCharCode = style === "a" ? A_LOWER_CASE : A_UPPER_CASE; + const letterIndex = currentIndex - 1; + const character = String.fromCharCode(baseCharCode + letterIndex % LIMIT); + currentLabel = character.repeat(Math.floor(letterIndex / LIMIT) + 1); + break; + default: + if (style) { + throw new FormatError(`Invalid style "${style}" in PageLabel dictionary.`); + } + currentLabel = ""; + } + pageLabels[i] = prefix + currentLabel; + currentIndex++; + } + return pageLabels; + } + get pageLayout() { + const obj = this.#catDict.get("PageLayout"); + let pageLayout = ""; + if (obj instanceof Name) { + switch (obj.name) { + case "SinglePage": + case "OneColumn": + case "TwoColumnLeft": + case "TwoColumnRight": + case "TwoPageLeft": + case "TwoPageRight": + pageLayout = obj.name; + } + } + return shadow(this, "pageLayout", pageLayout); + } + get pageMode() { + const obj = this.#catDict.get("PageMode"); + let pageMode = "UseNone"; + if (obj instanceof Name) { + switch (obj.name) { + case "UseNone": + case "UseOutlines": + case "UseThumbs": + case "FullScreen": + case "UseOC": + case "UseAttachments": + pageMode = obj.name; + } + } + return shadow(this, "pageMode", pageMode); + } + get viewerPreferences() { + const obj = this.#catDict.get("ViewerPreferences"); + if (!(obj instanceof Dict)) { + return shadow(this, "viewerPreferences", null); + } + let prefs = null; + for (const [key, value] of obj) { + let prefValue; + switch (key) { + case "HideToolbar": + case "HideMenubar": + case "HideWindowUI": + case "FitWindow": + case "CenterWindow": + case "DisplayDocTitle": + case "PickTrayByPDFSize": + if (typeof value === "boolean") { + prefValue = value; + } + break; + case "NonFullScreenPageMode": + if (value instanceof Name) { + switch (value.name) { + case "UseNone": + case "UseOutlines": + case "UseThumbs": + case "UseOC": + prefValue = value.name; + break; + default: + prefValue = "UseNone"; + } + } + break; + case "Direction": + if (value instanceof Name) { + switch (value.name) { + case "L2R": + case "R2L": + prefValue = value.name; + break; + default: + prefValue = "L2R"; + } + } + break; + case "ViewArea": + case "ViewClip": + case "PrintArea": + case "PrintClip": + if (value instanceof Name) { + switch (value.name) { + case "MediaBox": + case "CropBox": + case "BleedBox": + case "TrimBox": + case "ArtBox": + prefValue = value.name; + break; + default: + prefValue = "CropBox"; + } + } + break; + case "PrintScaling": + if (value instanceof Name) { + switch (value.name) { + case "None": + case "AppDefault": + prefValue = value.name; + break; + default: + prefValue = "AppDefault"; + } + } + break; + case "Duplex": + if (value instanceof Name) { + switch (value.name) { + case "Simplex": + case "DuplexFlipShortEdge": + case "DuplexFlipLongEdge": + prefValue = value.name; + break; + default: + prefValue = "None"; + } + } + break; + case "PrintPageRange": + if (Array.isArray(value) && value.length % 2 === 0) { + const isValid = value.every((page, i, arr) => Number.isInteger(page) && page > 0 && (i === 0 || page >= arr[i - 1]) && page <= this.numPages); + if (isValid) { + prefValue = value; + } + } + break; + case "NumCopies": + if (Number.isInteger(value) && value > 0) { + prefValue = value; + } + break; + default: + warn(`Ignoring non-standard key in ViewerPreferences: ${key}.`); + continue; + } + if (prefValue === undefined) { + warn(`Bad value, for key "${key}", in ViewerPreferences: ${value}.`); + continue; + } + prefs ??= Object.create(null); + prefs[key] = prefValue; + } + return shadow(this, "viewerPreferences", prefs); + } + get openAction() { + const obj = this.#catDict.get("OpenAction"); + const openAction = Object.create(null); + if (obj instanceof Dict) { + const destDict = new Dict(this.xref); + destDict.set("A", obj); + const resultObj = { + url: null, + dest: null, + action: null + }; + Catalog.parseDestDictionary({ + destDict, + resultObj + }); + if (Array.isArray(resultObj.dest)) { + openAction.dest = resultObj.dest; + } else if (resultObj.action) { + openAction.action = resultObj.action; + } + } else if (isValidExplicitDest(obj)) { + openAction.dest = obj; + } + return shadow(this, "openAction", objectSize(openAction) > 0 ? openAction : null); + } + get attachments() { + const obj = this.#catDict.get("Names"); + let attachments = null; + if (obj instanceof Dict && obj.has("EmbeddedFiles")) { + const nameTree = new NameTree(obj.getRaw("EmbeddedFiles"), this.xref); + for (const [key, value] of nameTree.getAll()) { + const fs = new FileSpec(value, this.xref); + attachments ??= Object.create(null); + attachments[stringToPDFString(key, true)] = fs.serializable; + } + } + return shadow(this, "attachments", attachments); + } + get xfaImages() { + const obj = this.#catDict.get("Names"); + let xfaImages = null; + if (obj instanceof Dict && obj.has("XFAImages")) { + const nameTree = new NameTree(obj.getRaw("XFAImages"), this.xref); + for (const [key, value] of nameTree.getAll()) { + if (value instanceof BaseStream) { + xfaImages ??= new Map(); + xfaImages.set(stringToPDFString(key, true), value.getBytes()); + } + } + } + return shadow(this, "xfaImages", xfaImages); + } + #collectJavaScript() { + const obj = this.#catDict.get("Names"); + let javaScript = null; + function appendIfJavaScriptDict(name, jsDict) { + if (!(jsDict instanceof Dict)) { + return; + } + if (!isName(jsDict.get("S"), "JavaScript")) { + return; + } + let js = jsDict.get("JS"); + if (js instanceof BaseStream) { + js = js.getString(); + } else if (typeof js !== "string") { + return; + } + js = stringToPDFString(js, true).replaceAll("\x00", ""); + if (js) { + (javaScript ||= new Map()).set(name, js); + } + } + if (obj instanceof Dict && obj.has("JavaScript")) { + const nameTree = new NameTree(obj.getRaw("JavaScript"), this.xref); + for (const [key, value] of nameTree.getAll()) { + appendIfJavaScriptDict(stringToPDFString(key, true), value); + } + } + const openAction = this.#catDict.get("OpenAction"); + if (openAction) { + appendIfJavaScriptDict("OpenAction", openAction); + } + return javaScript; + } + get jsActions() { + const javaScript = this.#collectJavaScript(); + let actions = collectActions(this.xref, this.#catDict, DocumentActionEventType); + if (javaScript) { + actions ||= Object.create(null); + for (const [key, val] of javaScript) { + if (key in actions) { + actions[key].push(val); + } else { + actions[key] = [val]; + } + } + } + return shadow(this, "jsActions", actions); + } + async cleanup(manuallyTriggered = false) { + clearGlobalCaches(); + this.globalColorSpaceCache.clear(); + this.globalImageCache.clear(manuallyTriggered); + this.pageKidsCountCache.clear(); + this.pageIndexCache.clear(); + this.pageDictCache.clear(); + this.nonBlendModesSet.clear(); + for (const { + dict + } of await Promise.all(this.fontCache)) { + delete dict.cacheKey; + } + this.fontCache.clear(); + this.builtInCMapCache.clear(); + this.standardFontDataCache.clear(); + this.systemFontCache.clear(); + } + async getPageDict(pageIndex) { + const nodesToVisit = [this.toplevelPagesDict]; + const visitedNodes = new RefSet(); + const pagesRef = this.#catDict.getRaw("Pages"); + if (pagesRef instanceof Ref) { + visitedNodes.put(pagesRef); + } + const xref = this.xref, + pageKidsCountCache = this.pageKidsCountCache, + pageIndexCache = this.pageIndexCache, + pageDictCache = this.pageDictCache; + let currentPageIndex = 0; + while (nodesToVisit.length) { + const currentNode = nodesToVisit.pop(); + if (currentNode instanceof Ref) { + const count = pageKidsCountCache.get(currentNode); + if (count >= 0 && currentPageIndex + count <= pageIndex) { + currentPageIndex += count; + continue; + } + if (visitedNodes.has(currentNode)) { + throw new FormatError("Pages tree contains circular reference."); + } + visitedNodes.put(currentNode); + const obj = await (pageDictCache.get(currentNode) || xref.fetchAsync(currentNode)); + if (obj instanceof Dict) { + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !obj.has("Kids")) { + if (!pageKidsCountCache.has(currentNode)) { + pageKidsCountCache.put(currentNode, 1); + } + if (!pageIndexCache.has(currentNode)) { + pageIndexCache.put(currentNode, currentPageIndex); + } + if (currentPageIndex === pageIndex) { + return [obj, currentNode]; + } + currentPageIndex++; + continue; + } + } + nodesToVisit.push(obj); + continue; + } + if (!(currentNode instanceof Dict)) { + throw new FormatError("Page dictionary kid reference points to wrong type of object."); + } + const { + objId + } = currentNode; + let count = currentNode.getRaw("Count"); + if (count instanceof Ref) { + count = await xref.fetchAsync(count); + } + if (Number.isInteger(count) && count >= 0) { + if (objId && !pageKidsCountCache.has(objId)) { + pageKidsCountCache.put(objId, count); + } + if (currentPageIndex + count <= pageIndex) { + currentPageIndex += count; + continue; + } + } + let kids = currentNode.getRaw("Kids"); + if (kids instanceof Ref) { + kids = await xref.fetchAsync(kids); + } + if (!Array.isArray(kids)) { + let type = currentNode.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !currentNode.has("Kids")) { + if (currentPageIndex === pageIndex) { + return [currentNode, null]; + } + currentPageIndex++; + continue; + } + throw new FormatError("Page dictionary kids object is not an array."); + } + for (let last = kids.length - 1; last >= 0; last--) { + const lastKid = kids[last]; + nodesToVisit.push(lastKid); + if (currentNode === this.toplevelPagesDict && lastKid instanceof Ref && !pageDictCache.has(lastKid)) { + pageDictCache.put(lastKid, xref.fetchAsync(lastKid)); + } + } + } + throw new Error(`Page index ${pageIndex} not found.`); + } + async getAllPageDicts(recoveryMode = false) { + const { + ignoreErrors + } = this.pdfManager.evaluatorOptions; + const queue = [{ + currentNode: this.toplevelPagesDict, + posInKids: 0 + }]; + const visitedNodes = new RefSet(); + const pagesRef = this.#catDict.getRaw("Pages"); + if (pagesRef instanceof Ref) { + visitedNodes.put(pagesRef); + } + const map = new Map(), + xref = this.xref, + pageIndexCache = this.pageIndexCache; + let pageIndex = 0; + function addPageDict(pageDict, pageRef) { + if (pageRef && !pageIndexCache.has(pageRef)) { + pageIndexCache.put(pageRef, pageIndex); + } + map.set(pageIndex++, [pageDict, pageRef]); + } + function addPageError(error) { + if (error instanceof XRefEntryException && !recoveryMode) { + throw error; + } + if (recoveryMode && ignoreErrors && pageIndex === 0) { + warn(`getAllPageDicts - Skipping invalid first page: "${error}".`); + error = Dict.empty; + } + map.set(pageIndex++, [error, null]); + } + while (queue.length > 0) { + const queueItem = queue.at(-1); + const { + currentNode, + posInKids + } = queueItem; + let kids = currentNode.getRaw("Kids"); + if (kids instanceof Ref) { + try { + kids = await xref.fetchAsync(kids); + } catch (ex) { + addPageError(ex); + break; + } + } + if (!Array.isArray(kids)) { + addPageError(new FormatError("Page dictionary kids object is not an array.")); + break; + } + if (posInKids >= kids.length) { + queue.pop(); + continue; + } + const kidObj = kids[posInKids]; + let obj; + if (kidObj instanceof Ref) { + if (visitedNodes.has(kidObj)) { + addPageError(new FormatError("Pages tree contains circular reference.")); + break; + } + visitedNodes.put(kidObj); + try { + obj = await xref.fetchAsync(kidObj); + } catch (ex) { + addPageError(ex); + break; + } + } else { + obj = kidObj; + } + if (!(obj instanceof Dict)) { + addPageError(new FormatError("Page dictionary kid reference points to wrong type of object.")); + break; + } + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + try { + type = await xref.fetchAsync(type); + } catch (ex) { + addPageError(ex); + break; + } + } + if (isName(type, "Page") || !obj.has("Kids")) { + addPageDict(obj, kidObj instanceof Ref ? kidObj : null); + } else { + queue.push({ + currentNode: obj, + posInKids: 0 + }); + } + queueItem.posInKids++; + } + return map; + } + getPageIndex(pageRef) { + const cachedPageIndex = this.pageIndexCache.get(pageRef); + if (cachedPageIndex !== undefined) { + return Promise.resolve(cachedPageIndex); + } + const xref = this.xref; + function pagesBeforeRef(kidRef) { + let total = 0, + parentRef; + return xref.fetchAsync(kidRef).then(function (node) { + if (isRefsEqual(kidRef, pageRef) && !isDict(node, "Page") && !(node instanceof Dict && !node.has("Type") && node.has("Contents"))) { + throw new FormatError("The reference does not point to a /Page dictionary."); + } + if (!node) { + return null; + } + if (!(node instanceof Dict)) { + throw new FormatError("Node must be a dictionary."); + } + parentRef = node.getRaw("Parent"); + return node.getAsync("Parent"); + }).then(function (parent) { + if (!parent) { + return null; + } + if (!(parent instanceof Dict)) { + throw new FormatError("Parent must be a dictionary."); + } + return parent.getAsync("Kids"); + }).then(function (kids) { + if (!kids) { + return null; + } + const kidPromises = []; + let found = false; + for (const kid of kids) { + if (!(kid instanceof Ref)) { + throw new FormatError("Kid must be a reference."); + } + if (isRefsEqual(kid, kidRef)) { + found = true; + break; + } + kidPromises.push(xref.fetchAsync(kid).then(function (obj) { + if (!(obj instanceof Dict)) { + throw new FormatError("Kid node must be a dictionary."); + } + if (obj.has("Count")) { + total += obj.get("Count"); + } else { + total++; + } + })); + } + if (!found) { + throw new FormatError("Kid reference not found in parent's kids."); + } + return Promise.all(kidPromises).then(() => [total, parentRef]); + }); + } + let total = 0; + const next = ref => pagesBeforeRef(ref).then(args => { + if (!args) { + this.pageIndexCache.put(pageRef, total); + return total; + } + const [count, parentRef] = args; + total += count; + return next(parentRef); + }); + return next(pageRef); + } + get baseUrl() { + const uri = this.#catDict.get("URI"); + if (uri instanceof Dict) { + const base = uri.get("Base"); + if (typeof base === "string") { + const absoluteUrl = createValidAbsoluteUrl(base, null, { + tryConvertEncoding: true + }); + if (absoluteUrl) { + return shadow(this, "baseUrl", absoluteUrl.href); + } + } + } + return shadow(this, "baseUrl", this.pdfManager.docBaseUrl); + } + static parseDestDictionary({ + destDict, + resultObj, + docBaseUrl = null, + docAttachments = null + }) { + if (!(destDict instanceof Dict)) { + warn("parseDestDictionary: `destDict` must be a dictionary."); + return; + } + let action = destDict.get("A"), + url, + dest; + if (!(action instanceof Dict)) { + if (destDict.has("Dest")) { + action = destDict.get("Dest"); + } else { + action = destDict.get("AA"); + if (action instanceof Dict) { + if (action.has("D")) { + action = action.get("D"); + } else if (action.has("U")) { + action = action.get("U"); + } + } + } + } + if (action instanceof Dict) { + const actionType = action.get("S"); + if (!(actionType instanceof Name)) { + warn("parseDestDictionary: Invalid type in Action dictionary."); + return; + } + const actionName = actionType.name; + switch (actionName) { + case "ResetForm": + const flags = action.get("Flags"); + const include = ((typeof flags === "number" ? flags : 0) & 1) === 0; + const fields = []; + const refs = []; + for (const obj of action.get("Fields") || []) { + if (obj instanceof Ref) { + refs.push(obj.toString()); + } else if (typeof obj === "string") { + fields.push(stringToPDFString(obj)); + } + } + resultObj.resetForm = { + fields, + refs, + include + }; + break; + case "URI": + url = action.get("URI"); + if (url instanceof Name) { + url = "/" + url.name; + } + break; + case "GoTo": + dest = action.get("D"); + break; + case "Launch": + case "GoToR": + const urlDict = action.get("F"); + if (urlDict instanceof Dict) { + const fs = new FileSpec(urlDict, null, true); + const { + rawFilename + } = fs.serializable; + url = rawFilename; + } else if (typeof urlDict === "string") { + url = urlDict; + } + const remoteDest = fetchRemoteDest(action); + if (remoteDest && typeof url === "string") { + url = url.split("#", 1)[0] + "#" + remoteDest; + } + const newWindow = action.get("NewWindow"); + if (typeof newWindow === "boolean") { + resultObj.newWindow = newWindow; + } + break; + case "GoToE": + const target = action.get("T"); + let attachment; + if (docAttachments && target instanceof Dict) { + const relationship = target.get("R"); + const name = target.get("N"); + if (isName(relationship, "C") && typeof name === "string") { + attachment = docAttachments[stringToPDFString(name, true)]; + } + } + if (attachment) { + resultObj.attachment = attachment; + const attachmentDest = fetchRemoteDest(action); + if (attachmentDest) { + resultObj.attachmentDest = attachmentDest; + } + } else { + warn(`parseDestDictionary - unimplemented "GoToE" action.`); + } + break; + case "Named": + const namedAction = action.get("N"); + if (namedAction instanceof Name) { + resultObj.action = namedAction.name; + } + break; + case "SetOCGState": + const state = action.get("State"); + const preserveRB = action.get("PreserveRB"); + if (!Array.isArray(state) || state.length === 0) { + break; + } + const stateArr = []; + for (const elem of state) { + if (elem instanceof Name) { + switch (elem.name) { + case "ON": + case "OFF": + case "Toggle": + stateArr.push(elem.name); + break; + } + } else if (elem instanceof Ref) { + stateArr.push(elem.toString()); + } + } + if (stateArr.length !== state.length) { + break; + } + resultObj.setOCGState = { + state: stateArr, + preserveRB: typeof preserveRB === "boolean" ? preserveRB : true + }; + break; + case "JavaScript": + const jsAction = action.get("JS"); + let js; + if (jsAction instanceof BaseStream) { + js = jsAction.getString(); + } else if (typeof jsAction === "string") { + js = jsAction; + } + const jsURL = js && recoverJsURL(stringToPDFString(js, true)); + if (jsURL) { + url = jsURL.url; + resultObj.newWindow = jsURL.newWindow; + break; + } + default: + if (actionName === "JavaScript" || actionName === "SubmitForm") { + break; + } + warn(`parseDestDictionary - unsupported action: "${actionName}".`); + break; + } + } else if (destDict.has("Dest")) { + dest = destDict.get("Dest"); + } + if (typeof url === "string") { + const absoluteUrl = createValidAbsoluteUrl(url, docBaseUrl, { + addDefaultProtocol: true, + tryConvertEncoding: true + }); + if (absoluteUrl) { + resultObj.url = absoluteUrl.href; + } + resultObj.unsafeUrl = url; + } + if (dest) { + if (dest instanceof Name) { + dest = dest.name; + } + if (typeof dest === "string") { + resultObj.dest = stringToPDFString(dest, true); + } else if (isValidExplicitDest(dest)) { + resultObj.dest = dest; + } + } + } +} + +;// ./src/core/object_loader.js + + + + +function mayHaveChildren(value) { + return value instanceof Ref || value instanceof Dict || value instanceof BaseStream || Array.isArray(value); +} +function addChildren(node, nodesToVisit) { + if (node instanceof Dict) { + node = node.getRawValues(); + } else if (node instanceof BaseStream) { + node = node.dict.getRawValues(); + } else if (!Array.isArray(node)) { + return; + } + for (const rawValue of node) { + if (mayHaveChildren(rawValue)) { + nodesToVisit.push(rawValue); + } + } +} +class ObjectLoader { + refSet = new RefSet(); + constructor(dict, keys, xref) { + this.dict = dict; + this.keys = keys; + this.xref = xref; + } + async load() { + const { + keys, + dict + } = this; + const nodesToVisit = []; + for (const key of keys) { + const rawValue = dict.getRaw(key); + if (rawValue !== undefined) { + nodesToVisit.push(rawValue); + } + } + await this.#walk(nodesToVisit); + this.refSet = null; + } + async #walk(nodesToVisit) { + const nodesToRevisit = []; + const pendingRequests = []; + while (nodesToVisit.length) { + let currentNode = nodesToVisit.pop(); + if (currentNode instanceof Ref) { + if (this.refSet.has(currentNode)) { + continue; + } + try { + this.refSet.put(currentNode); + currentNode = this.xref.fetch(currentNode); + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + warn(`ObjectLoader.#walk - requesting all data: "${ex}".`); + await this.xref.stream.manager.requestAllChunks(); + return; + } + nodesToRevisit.push(currentNode); + pendingRequests.push({ + begin: ex.begin, + end: ex.end + }); + } + } + if (currentNode instanceof BaseStream) { + const baseStreams = currentNode.getBaseStreams(); + if (baseStreams) { + let foundMissingData = false; + for (const stream of baseStreams) { + if (stream.isDataLoaded) { + continue; + } + foundMissingData = true; + pendingRequests.push({ + begin: stream.start, + end: stream.end + }); + } + if (foundMissingData) { + nodesToRevisit.push(currentNode); + } + } + } + addChildren(currentNode, nodesToVisit); + } + if (pendingRequests.length) { + await this.xref.stream.manager.requestRanges(pendingRequests); + for (const node of nodesToRevisit) { + if (node instanceof Ref) { + this.refSet.remove(node); + } + } + await this.#walk(nodesToRevisit); + } + } + static async load(obj, keys, xref) { + if (xref.stream.isDataLoaded) { + return; + } + const objLoader = new ObjectLoader(obj, keys, xref); + await objLoader.load(); + } +} + +;// ./src/core/xfa/symbol_utils.js +const $acceptWhitespace = Symbol(); +const $addHTML = Symbol(); +const $appendChild = Symbol(); +const $childrenToHTML = Symbol(); +const $clean = Symbol(); +const $cleanPage = Symbol(); +const $cleanup = Symbol(); +const $clone = Symbol(); +const $consumed = Symbol(); +const $content = Symbol("content"); +const $data = Symbol("data"); +const $dump = Symbol(); +const $extra = Symbol("extra"); +const $finalize = Symbol(); +const $flushHTML = Symbol(); +const $getAttributeIt = Symbol(); +const $getAttributes = Symbol(); +const $getAvailableSpace = Symbol(); +const $getChildrenByClass = Symbol(); +const $getChildrenByName = Symbol(); +const $getChildrenByNameIt = Symbol(); +const $getDataValue = Symbol(); +const $getExtra = Symbol(); +const $getRealChildrenByNameIt = Symbol(); +const $getChildren = Symbol(); +const $getContainedChildren = Symbol(); +const $getNextPage = Symbol(); +const $getSubformParent = Symbol(); +const $getParent = Symbol(); +const $getTemplateRoot = Symbol(); +const $globalData = Symbol(); +const $hasSettableValue = Symbol(); +const $ids = Symbol(); +const $indexOf = Symbol(); +const $insertAt = Symbol(); +const $isCDATAXml = Symbol(); +const $isBindable = Symbol(); +const $isDataValue = Symbol(); +const $isDescendent = Symbol(); +const $isNsAgnostic = Symbol(); +const $isSplittable = Symbol(); +const $isThereMoreWidth = Symbol(); +const $isTransparent = Symbol(); +const $isUsable = Symbol(); +const $lastAttribute = Symbol(); +const $namespaceId = Symbol("namespaceId"); +const $nodeName = Symbol("nodeName"); +const $nsAttributes = Symbol(); +const $onChild = Symbol(); +const $onChildCheck = Symbol(); +const $onText = Symbol(); +const $pushGlyphs = Symbol(); +const $popPara = Symbol(); +const $pushPara = Symbol(); +const $removeChild = Symbol(); +const $root = Symbol("root"); +const $resolvePrototypes = Symbol(); +const $searchNode = Symbol(); +const $setId = Symbol(); +const $setSetAttributes = Symbol(); +const $setValue = Symbol(); +const $tabIndex = Symbol(); +const $text = Symbol(); +const $toPages = Symbol(); +const $toHTML = Symbol(); +const $toString = Symbol(); +const $toStyle = Symbol(); +const $uid = Symbol("uid"); + +;// ./src/core/xfa/namespaces.js +const $buildXFAObject = Symbol(); +const NamespaceIds = { + config: { + id: 0, + check: ns => ns.startsWith("http://www.xfa.org/schema/xci/") + }, + connectionSet: { + id: 1, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/") + }, + datasets: { + id: 2, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-data/") + }, + form: { + id: 3, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-form/") + }, + localeSet: { + id: 4, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/") + }, + pdf: { + id: 5, + check: ns => ns === "http://ns.adobe.com/xdp/pdf/" + }, + signature: { + id: 6, + check: ns => ns === "http://www.w3.org/2000/09/xmldsig#" + }, + sourceSet: { + id: 7, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-source-set/") + }, + stylesheet: { + id: 8, + check: ns => ns === "http://www.w3.org/1999/XSL/Transform" + }, + template: { + id: 9, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-template/") + }, + xdc: { + id: 10, + check: ns => ns.startsWith("http://www.xfa.org/schema/xdc/") + }, + xdp: { + id: 11, + check: ns => ns === "http://ns.adobe.com/xdp/" + }, + xfdf: { + id: 12, + check: ns => ns === "http://ns.adobe.com/xfdf/" + }, + xhtml: { + id: 13, + check: ns => ns === "http://www.w3.org/1999/xhtml" + }, + xmpmeta: { + id: 14, + check: ns => ns === "http://ns.adobe.com/xmpmeta/" + } +}; + +;// ./src/core/xfa/utils.js + +const dimConverters = { + pt: x => x, + cm: x => x / 2.54 * 72, + mm: x => x / (10 * 2.54) * 72, + in: x => x * 72, + px: x => x +}; +const measurementPattern = /([+-]?\d+\.?\d*)(.*)/; +function stripQuotes(str) { + if (str.startsWith("'") || str.startsWith('"')) { + return str.slice(1, -1); + } + return str; +} +function getInteger({ + data, + defaultValue, + validate +}) { + if (!data) { + return defaultValue; + } + data = data.trim(); + const n = parseInt(data, 10); + if (!isNaN(n) && validate(n)) { + return n; + } + return defaultValue; +} +function getFloat({ + data, + defaultValue, + validate +}) { + if (!data) { + return defaultValue; + } + data = data.trim(); + const n = parseFloat(data); + if (!isNaN(n) && validate(n)) { + return n; + } + return defaultValue; +} +function getKeyword({ + data, + defaultValue, + validate +}) { + if (!data) { + return defaultValue; + } + data = data.trim(); + if (validate(data)) { + return data; + } + return defaultValue; +} +function getStringOption(data, options) { + return getKeyword({ + data, + defaultValue: options[0], + validate: k => options.includes(k) + }); +} +function getMeasurement(str, def = "0") { + def ||= "0"; + if (!str) { + return getMeasurement(def); + } + const match = str.trim().match(measurementPattern); + if (!match) { + return getMeasurement(def); + } + const [, valueStr, unit] = match; + const value = parseFloat(valueStr); + if (isNaN(value)) { + return getMeasurement(def); + } + if (value === 0) { + return 0; + } + const conv = dimConverters[unit]; + if (conv) { + return conv(value); + } + return value; +} +function getRatio(data) { + if (!data) { + return { + num: 1, + den: 1 + }; + } + const ratio = data.split(":", 2).map(x => parseFloat(x.trim())).filter(x => !isNaN(x)); + if (ratio.length === 1) { + ratio.push(1); + } + if (ratio.length === 0) { + return { + num: 1, + den: 1 + }; + } + const [num, den] = ratio; + return { + num, + den + }; +} +function getRelevant(data) { + if (!data) { + return []; + } + return data.trim().split(/\s+/).map(e => ({ + excluded: e[0] === "-", + viewname: e.substring(1) + })); +} +function getColor(data, def = [0, 0, 0]) { + let [r, g, b] = def; + if (!data) { + return { + r, + g, + b + }; + } + const color = data.split(",", 3).map(c => MathClamp(parseInt(c.trim(), 10), 0, 255)).map(c => isNaN(c) ? 0 : c); + if (color.length < 3) { + return { + r, + g, + b + }; + } + [r, g, b] = color; + return { + r, + g, + b + }; +} +function getBBox(data) { + const def = -1; + if (!data) { + return { + x: def, + y: def, + width: def, + height: def + }; + } + const bbox = data.split(",", 4).map(m => getMeasurement(m.trim(), "-1")); + if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) { + return { + x: def, + y: def, + width: def, + height: def + }; + } + const [x, y, width, height] = bbox; + return { + x, + y, + width, + height + }; +} +class HTMLResult { + static get FAILURE() { + return shadow(this, "FAILURE", new HTMLResult(false, null, null, null)); + } + static get EMPTY() { + return shadow(this, "EMPTY", new HTMLResult(true, null, null, null)); + } + constructor(success, html, bbox, breakNode) { + this.success = success; + this.html = html; + this.bbox = bbox; + this.breakNode = breakNode; + } + isBreak() { + return !!this.breakNode; + } + static breakNode(node) { + return new HTMLResult(false, null, null, node); + } + static success(html, bbox = null) { + return new HTMLResult(true, html, bbox, null); + } +} + +;// ./src/core/xfa/fonts.js + + + +class FontFinder { + constructor(pdfFonts) { + this.fonts = new Map(); + this.cache = new Map(); + this.warned = new Set(); + this.defaultFont = null; + this.add(pdfFonts); + } + add(pdfFonts, reallyMissingFonts = null) { + for (const pdfFont of pdfFonts) { + this.addPdfFont(pdfFont); + } + for (const pdfFont of this.fonts.values()) { + if (!pdfFont.regular) { + pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic; + } + } + if (!reallyMissingFonts || reallyMissingFonts.size === 0) { + return; + } + const myriad = this.fonts.get("PdfJS-Fallback-PdfJS-XFA"); + for (const missing of reallyMissingFonts) { + this.fonts.set(missing, myriad); + } + } + addPdfFont(pdfFont) { + const cssFontInfo = pdfFont.cssFontInfo; + const name = cssFontInfo.fontFamily; + let font = this.fonts.get(name); + if (!font) { + font = Object.create(null); + this.fonts.set(name, font); + if (!this.defaultFont) { + this.defaultFont = font; + } + } + let property = ""; + const fontWeight = parseFloat(cssFontInfo.fontWeight); + if (parseFloat(cssFontInfo.italicAngle) !== 0) { + property = fontWeight >= 700 ? "bolditalic" : "italic"; + } else if (fontWeight >= 700) { + property = "bold"; + } + if (!property) { + if (pdfFont.name.includes("Bold") || pdfFont.psName?.includes("Bold")) { + property = "bold"; + } + if (pdfFont.name.includes("Italic") || pdfFont.name.endsWith("It") || pdfFont.psName?.includes("Italic") || pdfFont.psName?.endsWith("It")) { + property += "italic"; + } + } + if (!property) { + property = "regular"; + } + font[property] = pdfFont; + } + getDefault() { + return this.defaultFont; + } + find(fontName, mustWarn = true) { + let font = this.fonts.get(fontName) || this.cache.get(fontName); + if (font) { + return font; + } + const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi; + let name = fontName.replaceAll(pattern, ""); + font = this.fonts.get(name); + if (font) { + this.cache.set(fontName, font); + return font; + } + name = name.toLowerCase(); + const maybe = []; + for (const [family, pdfFont] of this.fonts.entries()) { + if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + if (maybe.length === 0) { + for (const [, pdfFont] of this.fonts.entries()) { + if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length === 0) { + name = name.replaceAll(/psmt|mt/gi, ""); + for (const [family, pdfFont] of this.fonts.entries()) { + if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length === 0) { + for (const pdfFont of this.fonts.values()) { + if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length >= 1) { + if (maybe.length !== 1 && mustWarn) { + warn(`XFA - Too many choices to guess the correct font: ${fontName}`); + } + this.cache.set(fontName, maybe[0]); + return maybe[0]; + } + if (mustWarn && !this.warned.has(fontName)) { + this.warned.add(fontName); + warn(`XFA - Cannot find the font: ${fontName}`); + } + return null; + } +} +function selectFont(xfaFont, typeface) { + if (xfaFont.posture === "italic") { + if (xfaFont.weight === "bold") { + return typeface.bolditalic; + } + return typeface.italic; + } else if (xfaFont.weight === "bold") { + return typeface.bold; + } + return typeface.regular; +} +function fonts_getMetrics(xfaFont, real = false) { + let pdfFont = null; + if (xfaFont) { + const name = stripQuotes(xfaFont.typeface); + const typeface = xfaFont[$globalData].fontFinder.find(name); + pdfFont = selectFont(xfaFont, typeface); + } + if (!pdfFont) { + return { + lineHeight: 12, + lineGap: 2, + lineNoGap: 10 + }; + } + const size = xfaFont.size || 10; + const lineHeight = pdfFont.lineHeight ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight) : 1.2; + const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; + return { + lineHeight: lineHeight * size, + lineGap: lineGap * size, + lineNoGap: Math.max(1, lineHeight - lineGap) * size + }; +} + +;// ./src/core/xfa/text.js + +const WIDTH_FACTOR = 1.02; +class text_FontInfo { + constructor(xfaFont, margin, lineHeight, fontFinder) { + this.lineHeight = lineHeight; + this.paraMargin = margin || { + top: 0, + bottom: 0, + left: 0, + right: 0 + }; + if (!xfaFont) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + return; + } + this.xfaFont = { + typeface: xfaFont.typeface, + posture: xfaFont.posture, + weight: xfaFont.weight, + size: xfaFont.size, + letterSpacing: xfaFont.letterSpacing + }; + const typeface = fontFinder.find(xfaFont.typeface); + if (!typeface) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + return; + } + this.pdfFont = selectFont(xfaFont, typeface); + if (!this.pdfFont) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + } + } + defaultFont(fontFinder) { + const font = fontFinder.find("Helvetica", false) || fontFinder.find("Myriad Pro", false) || fontFinder.find("Arial", false) || fontFinder.getDefault(); + if (font?.regular) { + const pdfFont = font.regular; + const info = pdfFont.cssFontInfo; + const xfaFont = { + typeface: info.fontFamily, + posture: "normal", + weight: "normal", + size: 10, + letterSpacing: 0 + }; + return [pdfFont, xfaFont]; + } + const xfaFont = { + typeface: "Courier", + posture: "normal", + weight: "normal", + size: 10, + letterSpacing: 0 + }; + return [null, xfaFont]; + } +} +class FontSelector { + constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder) { + this.fontFinder = fontFinder; + this.stack = [new text_FontInfo(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder)]; + } + pushData(xfaFont, margin, lineHeight) { + const lastFont = this.stack.at(-1); + for (const name of ["typeface", "posture", "weight", "size", "letterSpacing"]) { + if (!xfaFont[name]) { + xfaFont[name] = lastFont.xfaFont[name]; + } + } + for (const name of ["top", "bottom", "left", "right"]) { + if (isNaN(margin[name])) { + margin[name] = lastFont.paraMargin[name]; + } + } + const fontInfo = new text_FontInfo(xfaFont, margin, lineHeight || lastFont.lineHeight, this.fontFinder); + if (!fontInfo.pdfFont) { + fontInfo.pdfFont = lastFont.pdfFont; + } + this.stack.push(fontInfo); + } + popFont() { + this.stack.pop(); + } + topFont() { + return this.stack.at(-1); + } +} +class TextMeasure { + constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts) { + this.glyphs = []; + this.fontSelector = new FontSelector(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts); + this.extraHeight = 0; + } + pushData(xfaFont, margin, lineHeight) { + this.fontSelector.pushData(xfaFont, margin, lineHeight); + } + popFont(xfaFont) { + return this.fontSelector.popFont(); + } + addPara() { + const lastFont = this.fontSelector.topFont(); + this.extraHeight += lastFont.paraMargin.top + lastFont.paraMargin.bottom; + } + addString(str) { + if (!str) { + return; + } + const lastFont = this.fontSelector.topFont(); + const fontSize = lastFont.xfaFont.size; + if (lastFont.pdfFont) { + const letterSpacing = lastFont.xfaFont.letterSpacing; + const pdfFont = lastFont.pdfFont; + const fontLineHeight = pdfFont.lineHeight || 1.2; + const lineHeight = lastFont.lineHeight || Math.max(1.2, fontLineHeight) * fontSize; + const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; + const noGap = fontLineHeight - lineGap; + const firstLineHeight = Math.max(1, noGap) * fontSize; + const scale = fontSize / 1000; + const fallbackWidth = pdfFont.defaultWidth || pdfFont.charsToGlyphs(" ")[0].width; + for (const line of str.split(/[\u2029\n]/)) { + const encodedLine = pdfFont.encodeString(line).join(""); + const glyphs = pdfFont.charsToGlyphs(encodedLine); + for (const glyph of glyphs) { + const width = glyph.width || fallbackWidth; + this.glyphs.push([width * scale + letterSpacing, lineHeight, firstLineHeight, glyph.unicode, false]); + } + this.glyphs.push([0, 0, 0, "\n", true]); + } + this.glyphs.pop(); + return; + } + for (const line of str.split(/[\u2029\n]/)) { + for (const char of line.split("")) { + this.glyphs.push([fontSize, 1.2 * fontSize, fontSize, char, false]); + } + this.glyphs.push([0, 0, 0, "\n", true]); + } + this.glyphs.pop(); + } + compute(maxWidth) { + let lastSpacePos = -1, + lastSpaceWidth = 0, + width = 0, + height = 0, + currentLineWidth = 0, + currentLineHeight = 0; + let isBroken = false; + let isFirstLine = true; + for (let i = 0, ii = this.glyphs.length; i < ii; i++) { + const [glyphWidth, lineHeight, firstLineHeight, char, isEOL] = this.glyphs[i]; + const isSpace = char === " "; + const glyphHeight = isFirstLine ? firstLineHeight : lineHeight; + if (isEOL) { + width = Math.max(width, currentLineWidth); + currentLineWidth = 0; + height += currentLineHeight; + currentLineHeight = glyphHeight; + lastSpacePos = -1; + lastSpaceWidth = 0; + isFirstLine = false; + continue; + } + if (isSpace) { + if (currentLineWidth + glyphWidth > maxWidth) { + width = Math.max(width, currentLineWidth); + currentLineWidth = 0; + height += currentLineHeight; + currentLineHeight = glyphHeight; + lastSpacePos = -1; + lastSpaceWidth = 0; + isBroken = true; + isFirstLine = false; + } else { + currentLineHeight = Math.max(glyphHeight, currentLineHeight); + lastSpaceWidth = currentLineWidth; + currentLineWidth += glyphWidth; + lastSpacePos = i; + } + continue; + } + if (currentLineWidth + glyphWidth > maxWidth) { + height += currentLineHeight; + currentLineHeight = glyphHeight; + if (lastSpacePos !== -1) { + i = lastSpacePos; + width = Math.max(width, lastSpaceWidth); + currentLineWidth = 0; + lastSpacePos = -1; + lastSpaceWidth = 0; + } else { + width = Math.max(width, currentLineWidth); + currentLineWidth = glyphWidth; + } + isBroken = true; + isFirstLine = false; + continue; + } + currentLineWidth += glyphWidth; + currentLineHeight = Math.max(glyphHeight, currentLineHeight); + } + width = Math.max(width, currentLineWidth); + height += currentLineHeight + this.extraHeight; + return { + width: WIDTH_FACTOR * width, + height, + isBroken + }; + } +} + +;// ./src/core/xfa/som.js + + +const namePattern = /^[^.[]+/; +const indexPattern = /^[^\]]+/; +const operators = { + dot: 0, + dotDot: 1, + dotHash: 2, + dotBracket: 3, + dotParen: 4 +}; +const shortcuts = new Map([["$data", (root, current) => root.datasets ? root.datasets.data : root], ["$record", (root, current) => (root.datasets ? root.datasets.data : root)[$getChildren]()[0]], ["$template", (root, current) => root.template], ["$connectionSet", (root, current) => root.connectionSet], ["$form", (root, current) => root.form], ["$layout", (root, current) => root.layout], ["$host", (root, current) => root.host], ["$dataWindow", (root, current) => root.dataWindow], ["$event", (root, current) => root.event], ["!", (root, current) => root.datasets], ["$xfa", (root, current) => root], ["xfa", (root, current) => root], ["$", (root, current) => current]]); +const somCache = new WeakMap(); +function parseIndex(index) { + index = index.trim(); + if (index === "*") { + return Infinity; + } + return parseInt(index, 10) || 0; +} +function parseExpression(expr, dotDotAllowed, noExpr = true) { + let match = expr.match(namePattern); + if (!match) { + return null; + } + let [name] = match; + const parsed = [{ + name, + cacheName: "." + name, + index: 0, + js: null, + formCalc: null, + operator: operators.dot + }]; + let pos = name.length; + while (pos < expr.length) { + const spos = pos; + const char = expr.charAt(pos++); + if (char === "[") { + match = expr.slice(pos).match(indexPattern); + if (!match) { + warn("XFA - Invalid index in SOM expression"); + return null; + } + parsed.at(-1).index = parseIndex(match[0]); + pos += match[0].length + 1; + continue; + } + let operator; + switch (expr.charAt(pos)) { + case ".": + if (!dotDotAllowed) { + return null; + } + pos++; + operator = operators.dotDot; + break; + case "#": + pos++; + operator = operators.dotHash; + break; + case "[": + if (noExpr) { + warn("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."); + return null; + } + operator = operators.dotBracket; + break; + case "(": + if (noExpr) { + warn("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."); + return null; + } + operator = operators.dotParen; + break; + default: + operator = operators.dot; + break; + } + match = expr.slice(pos).match(namePattern); + if (!match) { + break; + } + [name] = match; + pos += name.length; + parsed.push({ + name, + cacheName: expr.slice(spos, pos), + operator, + index: 0, + js: null, + formCalc: null + }); + } + return parsed; +} +function searchNode(root, container, expr, dotDotAllowed = true, useCache = true) { + const parsed = parseExpression(expr, dotDotAllowed); + if (!parsed) { + return null; + } + const fn = shortcuts.get(parsed[0].name); + let i = 0; + let isQualified; + if (fn) { + isQualified = true; + root = [fn(root, container)]; + i = 1; + } else { + isQualified = container === null; + root = [container || root]; + } + for (let ii = parsed.length; i < ii; i++) { + const { + name, + cacheName, + operator, + index + } = parsed[i]; + const nodes = []; + for (const node of root) { + if (!node.isXFAObject) { + continue; + } + let children, cached; + if (useCache) { + cached = somCache.get(node); + if (!cached) { + cached = new Map(); + somCache.set(node, cached); + } + children = cached.get(cacheName); + } + if (!children) { + switch (operator) { + case operators.dot: + children = node[$getChildrenByName](name, false); + break; + case operators.dotDot: + children = node[$getChildrenByName](name, true); + break; + case operators.dotHash: + children = node[$getChildrenByClass](name); + children = children.isXFAObjectArray ? children.children : [children]; + break; + default: + break; + } + if (useCache) { + cached.set(cacheName, children); + } + } + if (children.length > 0) { + nodes.push(children); + } + } + if (nodes.length === 0 && !isQualified && i === 0) { + const parent = container[$getParent](); + container = parent; + if (!container) { + return null; + } + i = -1; + root = [container]; + continue; + } + root = isFinite(index) ? nodes.filter(node => index < node.length).map(node => node[index]) : nodes.flat(); + } + if (root.length === 0) { + return null; + } + return root; +} +function createDataNode(root, container, expr) { + const parsed = parseExpression(expr); + if (!parsed) { + return null; + } + if (parsed.some(x => x.operator === operators.dotDot)) { + return null; + } + const fn = shortcuts.get(parsed[0].name); + let i = 0; + if (fn) { + root = fn(root, container); + i = 1; + } else { + root = container || root; + } + for (let ii = parsed.length; i < ii; i++) { + const { + name, + operator, + index + } = parsed[i]; + if (!isFinite(index)) { + parsed[i].index = 0; + return root.createNodes(parsed.slice(i)); + } + let children; + switch (operator) { + case operators.dot: + children = root[$getChildrenByName](name, false); + break; + case operators.dotDot: + children = root[$getChildrenByName](name, true); + break; + case operators.dotHash: + children = root[$getChildrenByClass](name); + children = children.isXFAObjectArray ? children.children : [children]; + break; + default: + break; + } + if (children.length === 0) { + return root.createNodes(parsed.slice(i)); + } + if (index < children.length) { + const child = children[index]; + if (!child.isXFAObject) { + warn(`XFA - Cannot create a node.`); + return null; + } + root = child; + } else { + parsed[i].index = index - children.length; + return root.createNodes(parsed.slice(i)); + } + } + return null; +} + +;// ./src/core/xfa/xfa_object.js + + + + + + +const _applyPrototype = Symbol(); +const _attributes = Symbol(); +const _attributeNames = Symbol(); +const _children = Symbol("_children"); +const _cloneAttribute = Symbol(); +const _dataValue = Symbol(); +const _defaultValue = Symbol(); +const _filteredChildrenGenerator = Symbol(); +const _getPrototype = Symbol(); +const _getUnsetAttributes = Symbol(); +const _hasChildren = Symbol(); +const _max = Symbol(); +const _options = Symbol(); +const _parent = Symbol("parent"); +const _resolvePrototypesHelper = Symbol(); +const _setAttributes = Symbol(); +const _validator = Symbol(); +let uid = 0; +const NS_DATASETS = NamespaceIds.datasets.id; +class XFAObject { + constructor(nsId, name, hasChildren = false) { + this[$namespaceId] = nsId; + this[$nodeName] = name; + this[_hasChildren] = hasChildren; + this[_parent] = null; + this[_children] = []; + this[$uid] = `${name}${uid++}`; + this[$globalData] = null; + } + get isXFAObject() { + return true; + } + get isXFAObjectArray() { + return false; + } + createNodes(path) { + let root = this, + node = null; + for (const { + name, + index + } of path) { + for (let i = 0, ii = isFinite(index) ? index : 0; i <= ii; i++) { + const nsId = root[$namespaceId] === NS_DATASETS ? -1 : root[$namespaceId]; + node = new XmlObject(nsId, name); + root[$appendChild](node); + } + root = node; + } + return node; + } + [$onChild](child) { + if (!this[_hasChildren] || !this[$onChildCheck](child)) { + return false; + } + const name = child[$nodeName]; + const node = this[name]; + if (node instanceof XFAObjectArray) { + if (node.push(child)) { + this[$appendChild](child); + return true; + } + } else { + if (node !== null) { + this[$removeChild](node); + } + this[name] = child; + this[$appendChild](child); + return true; + } + let id = ""; + if (this.id) { + id = ` (id: ${this.id})`; + } else if (this.name) { + id = ` (name: ${this.name} ${this.h.value})`; + } + warn(`XFA - node "${this[$nodeName]}"${id} has already enough "${name}"!`); + return false; + } + [$onChildCheck](child) { + return this.hasOwnProperty(child[$nodeName]) && child[$namespaceId] === this[$namespaceId]; + } + [$isNsAgnostic]() { + return false; + } + [$acceptWhitespace]() { + return false; + } + [$isCDATAXml]() { + return false; + } + [$isBindable]() { + return false; + } + [$popPara]() { + if (this.para) { + this[$getTemplateRoot]()[$extra].paraStack.pop(); + } + } + [$pushPara]() { + this[$getTemplateRoot]()[$extra].paraStack.push(this.para); + } + [$setId](ids) { + if (this.id && this[$namespaceId] === NamespaceIds.template.id) { + ids.set(this.id, this); + } + } + [$getTemplateRoot]() { + return this[$globalData].template; + } + [$isSplittable]() { + return false; + } + [$isThereMoreWidth]() { + return false; + } + [$appendChild](child) { + child[_parent] = this; + this[_children].push(child); + if (!child[$globalData] && this[$globalData]) { + child[$globalData] = this[$globalData]; + } + } + [$removeChild](child) { + const i = this[_children].indexOf(child); + this[_children].splice(i, 1); + } + [$hasSettableValue]() { + return this.hasOwnProperty("value"); + } + [$setValue](_) {} + [$onText](_) {} + [$finalize]() {} + [$clean](builder) { + delete this[_hasChildren]; + if (this[$cleanup]) { + builder.clean(this[$cleanup]); + delete this[$cleanup]; + } + } + [$indexOf](child) { + return this[_children].indexOf(child); + } + [$insertAt](i, child) { + child[_parent] = this; + this[_children].splice(i, 0, child); + if (!child[$globalData] && this[$globalData]) { + child[$globalData] = this[$globalData]; + } + } + [$isTransparent]() { + return !this.name; + } + [$lastAttribute]() { + return ""; + } + [$text]() { + if (this[_children].length === 0) { + return this[$content]; + } + return this[_children].map(c => c[$text]()).join(""); + } + get [_attributeNames]() { + const proto = Object.getPrototypeOf(this); + if (!proto._attributes) { + const attributes = proto._attributes = new Set(); + for (const name of Object.getOwnPropertyNames(this)) { + if (this[name] === null || this[name] instanceof XFAObject || this[name] instanceof XFAObjectArray) { + break; + } + attributes.add(name); + } + } + return shadow(this, _attributeNames, proto._attributes); + } + [$isDescendent](parent) { + let node = this; + while (node) { + if (node === parent) { + return true; + } + node = node[$getParent](); + } + return false; + } + [$getParent]() { + return this[_parent]; + } + [$getSubformParent]() { + return this[$getParent](); + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[name]; + } + [$dump]() { + const dumped = Object.create(null); + if (this[$content]) { + dumped.$content = this[$content]; + } + for (const name of Object.getOwnPropertyNames(this)) { + const value = this[name]; + if (value === null) { + continue; + } + if (value instanceof XFAObject) { + dumped[name] = value[$dump](); + } else if (value instanceof XFAObjectArray) { + if (!value.isEmpty()) { + dumped[name] = value.dump(); + } + } else { + dumped[name] = value; + } + } + return dumped; + } + [$toStyle]() { + return null; + } + [$toHTML]() { + return HTMLResult.EMPTY; + } + *[$getContainedChildren]() { + for (const node of this[$getChildren]()) { + yield node; + } + } + *[_filteredChildrenGenerator](filter, include) { + for (const node of this[$getContainedChildren]()) { + if (!filter || include === filter.has(node[$nodeName])) { + const availableSpace = this[$getAvailableSpace](); + const res = node[$toHTML](availableSpace); + if (!res.success) { + this[$extra].failingNode = node; + } + yield res; + } + } + } + [$flushHTML]() { + return null; + } + [$addHTML](html, bbox) { + this[$extra].children.push(html); + } + [$getAvailableSpace]() {} + [$childrenToHTML]({ + filter = null, + include = true + }) { + if (!this[$extra].generator) { + this[$extra].generator = this[_filteredChildrenGenerator](filter, include); + } else { + const availableSpace = this[$getAvailableSpace](); + const res = this[$extra].failingNode[$toHTML](availableSpace); + if (!res.success) { + return res; + } + if (res.html) { + this[$addHTML](res.html, res.bbox); + } + delete this[$extra].failingNode; + } + while (true) { + const gen = this[$extra].generator.next(); + if (gen.done) { + break; + } + const res = gen.value; + if (!res.success) { + return res; + } + if (res.html) { + this[$addHTML](res.html, res.bbox); + } + } + this[$extra].generator = null; + return HTMLResult.EMPTY; + } + [$setSetAttributes](attributes) { + this[_setAttributes] = new Set(Object.keys(attributes)); + } + [_getUnsetAttributes](protoAttributes) { + const allAttr = this[_attributeNames]; + const setAttr = this[_setAttributes]; + return [...protoAttributes].filter(x => allAttr.has(x) && !setAttr.has(x)); + } + [$resolvePrototypes](ids, ancestors = new Set()) { + for (const child of this[_children]) { + child[_resolvePrototypesHelper](ids, ancestors); + } + } + [_resolvePrototypesHelper](ids, ancestors) { + const proto = this[_getPrototype](ids, ancestors); + if (proto) { + this[_applyPrototype](proto, ids, ancestors); + } else { + this[$resolvePrototypes](ids, ancestors); + } + } + [_getPrototype](ids, ancestors) { + const { + use, + usehref + } = this; + if (!use && !usehref) { + return null; + } + let proto = null; + let somExpression = null; + let id = null; + let ref = use; + if (usehref) { + ref = usehref; + if (usehref.startsWith("#som(") && usehref.endsWith(")")) { + somExpression = usehref.slice("#som(".length, -1); + } else if (usehref.startsWith(".#som(") && usehref.endsWith(")")) { + somExpression = usehref.slice(".#som(".length, -1); + } else if (usehref.startsWith("#")) { + id = usehref.slice(1); + } else if (usehref.startsWith(".#")) { + id = usehref.slice(2); + } + } else if (use.startsWith("#")) { + id = use.slice(1); + } else { + somExpression = use; + } + this.use = this.usehref = ""; + if (id) { + proto = ids.get(id); + } else { + proto = searchNode(ids.get($root), this, somExpression, true, false); + if (proto) { + proto = proto[0]; + } + } + if (!proto) { + warn(`XFA - Invalid prototype reference: ${ref}.`); + return null; + } + if (proto[$nodeName] !== this[$nodeName]) { + warn(`XFA - Incompatible prototype: ${proto[$nodeName]} !== ${this[$nodeName]}.`); + return null; + } + if (ancestors.has(proto)) { + warn(`XFA - Cycle detected in prototypes use.`); + return null; + } + ancestors.add(proto); + const protoProto = proto[_getPrototype](ids, ancestors); + if (protoProto) { + proto[_applyPrototype](protoProto, ids, ancestors); + } + proto[$resolvePrototypes](ids, ancestors); + ancestors.delete(proto); + return proto; + } + [_applyPrototype](proto, ids, ancestors) { + if (ancestors.has(proto)) { + warn(`XFA - Cycle detected in prototypes use.`); + return; + } + if (!this[$content] && proto[$content]) { + this[$content] = proto[$content]; + } + const newAncestors = new Set(ancestors); + newAncestors.add(proto); + for (const unsetAttrName of this[_getUnsetAttributes](proto[_setAttributes])) { + this[unsetAttrName] = proto[unsetAttrName]; + if (this[_setAttributes]) { + this[_setAttributes].add(unsetAttrName); + } + } + for (const name of Object.getOwnPropertyNames(this)) { + if (this[_attributeNames].has(name)) { + continue; + } + const value = this[name]; + const protoValue = proto[name]; + if (value instanceof XFAObjectArray) { + for (const child of value[_children]) { + child[_resolvePrototypesHelper](ids, ancestors); + } + for (let i = value[_children].length, ii = protoValue[_children].length; i < ii; i++) { + const child = proto[_children][i][$clone](); + if (value.push(child)) { + child[_parent] = this; + this[_children].push(child); + child[_resolvePrototypesHelper](ids, ancestors); + } else { + break; + } + } + continue; + } + if (value !== null) { + value[$resolvePrototypes](ids, ancestors); + if (protoValue) { + value[_applyPrototype](protoValue, ids, ancestors); + } + continue; + } + if (protoValue !== null) { + const child = protoValue[$clone](); + child[_parent] = this; + this[name] = child; + this[_children].push(child); + child[_resolvePrototypesHelper](ids, ancestors); + } + } + } + static [_cloneAttribute](obj) { + if (Array.isArray(obj)) { + return obj.map(x => XFAObject[_cloneAttribute](x)); + } + if (typeof obj === "object" && obj !== null) { + return Object.assign({}, obj); + } + return obj; + } + [$clone]() { + const clone = Object.create(Object.getPrototypeOf(this)); + for (const $symbol of Object.getOwnPropertySymbols(this)) { + try { + clone[$symbol] = this[$symbol]; + } catch { + shadow(clone, $symbol, this[$symbol]); + } + } + clone[$uid] = `${clone[$nodeName]}${uid++}`; + clone[_children] = []; + for (const name of Object.getOwnPropertyNames(this)) { + if (this[_attributeNames].has(name)) { + clone[name] = XFAObject[_cloneAttribute](this[name]); + continue; + } + const value = this[name]; + clone[name] = value instanceof XFAObjectArray ? new XFAObjectArray(value[_max]) : null; + } + for (const child of this[_children]) { + const name = child[$nodeName]; + const clonedChild = child[$clone](); + clone[_children].push(clonedChild); + clonedChild[_parent] = clone; + if (clone[name] === null) { + clone[name] = clonedChild; + } else { + clone[name][_children].push(clonedChild); + } + } + return clone; + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[_children].filter(c => c[$nodeName] === name); + } + [$getChildrenByClass](name) { + return this[name]; + } + [$getChildrenByName](name, allTransparent, first = true) { + return Array.from(this[$getChildrenByNameIt](name, allTransparent, first)); + } + *[$getChildrenByNameIt](name, allTransparent, first = true) { + if (name === "parent") { + yield this[_parent]; + return; + } + for (const child of this[_children]) { + if (child[$nodeName] === name) { + yield child; + } + if (child.name === name) { + yield child; + } + if (allTransparent || child[$isTransparent]()) { + yield* child[$getChildrenByNameIt](name, allTransparent, false); + } + } + if (first && this[_attributeNames].has(name)) { + yield new XFAAttribute(this, name, this[name]); + } + } +} +class XFAObjectArray { + constructor(max = Infinity) { + this[_max] = max; + this[_children] = []; + } + get isXFAObject() { + return false; + } + get isXFAObjectArray() { + return true; + } + push(child) { + const len = this[_children].length; + if (len <= this[_max]) { + this[_children].push(child); + return true; + } + warn(`XFA - node "${child[$nodeName]}" accepts no more than ${this[_max]} children`); + return false; + } + isEmpty() { + return this[_children].length === 0; + } + dump() { + return this[_children].length === 1 ? this[_children][0][$dump]() : this[_children].map(x => x[$dump]()); + } + [$clone]() { + const clone = new XFAObjectArray(this[_max]); + clone[_children] = this[_children].map(c => c[$clone]()); + return clone; + } + get children() { + return this[_children]; + } + clear() { + this[_children].length = 0; + } +} +class XFAAttribute { + constructor(node, name, value) { + this[_parent] = node; + this[$nodeName] = name; + this[$content] = value; + this[$consumed] = false; + this[$uid] = `attribute${uid++}`; + } + [$getParent]() { + return this[_parent]; + } + [$isDataValue]() { + return true; + } + [$getDataValue]() { + return this[$content].trim(); + } + [$setValue](value) { + value = value.value || ""; + this[$content] = value.toString(); + } + [$text]() { + return this[$content]; + } + [$isDescendent](parent) { + return this[_parent] === parent || this[_parent][$isDescendent](parent); + } +} +class XmlObject extends XFAObject { + constructor(nsId, name, attributes = {}) { + super(nsId, name); + this[$content] = ""; + this[_dataValue] = null; + if (name !== "#text") { + const map = new Map(); + this[_attributes] = map; + for (const [attrName, value] of Object.entries(attributes)) { + map.set(attrName, new XFAAttribute(this, attrName, value)); + } + if (attributes.hasOwnProperty($nsAttributes)) { + const dataNode = attributes[$nsAttributes].xfa.dataNode; + if (dataNode !== undefined) { + if (dataNode === "dataGroup") { + this[_dataValue] = false; + } else if (dataNode === "dataValue") { + this[_dataValue] = true; + } + } + } + } + this[$consumed] = false; + } + [$toString](buf) { + const tagName = this[$nodeName]; + if (tagName === "#text") { + buf.push(encodeToXmlString(this[$content])); + return; + } + const utf8TagName = utf8StringToString(tagName); + const prefix = this[$namespaceId] === NS_DATASETS ? "xfa:" : ""; + buf.push(`<${prefix}${utf8TagName}`); + for (const [name, value] of this[_attributes].entries()) { + const utf8Name = utf8StringToString(name); + buf.push(` ${utf8Name}="${encodeToXmlString(value[$content])}"`); + } + if (this[_dataValue] !== null) { + if (this[_dataValue]) { + buf.push(` xfa:dataNode="dataValue"`); + } else { + buf.push(` xfa:dataNode="dataGroup"`); + } + } + if (!this[$content] && this[_children].length === 0) { + buf.push("/>"); + return; + } + buf.push(">"); + if (this[$content]) { + if (typeof this[$content] === "string") { + buf.push(encodeToXmlString(this[$content])); + } else { + this[$content][$toString](buf); + } + } else { + for (const child of this[_children]) { + child[$toString](buf); + } + } + buf.push(``); + } + [$onChild](child) { + if (this[$content]) { + const node = new XmlObject(this[$namespaceId], "#text"); + this[$appendChild](node); + node[$content] = this[$content]; + this[$content] = ""; + } + this[$appendChild](child); + return true; + } + [$onText](str) { + this[$content] += str; + } + [$finalize]() { + if (this[$content] && this[_children].length > 0) { + const node = new XmlObject(this[$namespaceId], "#text"); + this[$appendChild](node); + node[$content] = this[$content]; + delete this[$content]; + } + } + [$toHTML]() { + if (this[$nodeName] === "#text") { + return HTMLResult.success({ + name: "#text", + value: this[$content] + }); + } + return HTMLResult.EMPTY; + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[_children].filter(c => c[$nodeName] === name); + } + [$getAttributes]() { + return this[_attributes]; + } + [$getChildrenByClass](name) { + const value = this[_attributes].get(name); + if (value !== undefined) { + return value; + } + return this[$getChildren](name); + } + *[$getChildrenByNameIt](name, allTransparent) { + const value = this[_attributes].get(name); + if (value) { + yield value; + } + for (const child of this[_children]) { + if (child[$nodeName] === name) { + yield child; + } + if (allTransparent) { + yield* child[$getChildrenByNameIt](name, allTransparent); + } + } + } + *[$getAttributeIt](name, skipConsumed) { + const value = this[_attributes].get(name); + if (value && (!skipConsumed || !value[$consumed])) { + yield value; + } + for (const child of this[_children]) { + yield* child[$getAttributeIt](name, skipConsumed); + } + } + *[$getRealChildrenByNameIt](name, allTransparent, skipConsumed) { + for (const child of this[_children]) { + if (child[$nodeName] === name && (!skipConsumed || !child[$consumed])) { + yield child; + } + if (allTransparent) { + yield* child[$getRealChildrenByNameIt](name, allTransparent, skipConsumed); + } + } + } + [$isDataValue]() { + if (this[_dataValue] === null) { + return this[_children].length === 0 || this[_children][0][$namespaceId] === NamespaceIds.xhtml.id; + } + return this[_dataValue]; + } + [$getDataValue]() { + if (this[_dataValue] === null) { + if (this[_children].length === 0) { + return this[$content].trim(); + } + if (this[_children][0][$namespaceId] === NamespaceIds.xhtml.id) { + return this[_children][0][$text]().trim(); + } + return null; + } + return this[$content].trim(); + } + [$setValue](value) { + value = value.value || ""; + this[$content] = value.toString(); + } + [$dump](hasNS = false) { + const dumped = Object.create(null); + if (hasNS) { + dumped.$ns = this[$namespaceId]; + } + if (this[$content]) { + dumped.$content = this[$content]; + } + dumped.$name = this[$nodeName]; + dumped.children = []; + for (const child of this[_children]) { + dumped.children.push(child[$dump](hasNS)); + } + dumped.attributes = Object.create(null); + for (const [name, value] of this[_attributes]) { + dumped.attributes[name] = value[$content]; + } + return dumped; + } +} +class ContentObject extends XFAObject { + constructor(nsId, name) { + super(nsId, name); + this[$content] = ""; + } + [$onText](text) { + this[$content] += text; + } + [$finalize]() {} +} +class OptionObject extends ContentObject { + constructor(nsId, name, options) { + super(nsId, name); + this[_options] = options; + } + [$finalize]() { + this[$content] = getKeyword({ + data: this[$content], + defaultValue: this[_options][0], + validate: k => this[_options].includes(k) + }); + } + [$clean](builder) { + super[$clean](builder); + delete this[_options]; + } +} +class StringObject extends ContentObject { + [$finalize]() { + this[$content] = this[$content].trim(); + } +} +class IntegerObject extends ContentObject { + constructor(nsId, name, defaultValue, validator) { + super(nsId, name); + this[_defaultValue] = defaultValue; + this[_validator] = validator; + } + [$finalize]() { + this[$content] = getInteger({ + data: this[$content], + defaultValue: this[_defaultValue], + validate: this[_validator] + }); + } + [$clean](builder) { + super[$clean](builder); + delete this[_defaultValue]; + delete this[_validator]; + } +} +class Option01 extends IntegerObject { + constructor(nsId, name) { + super(nsId, name, 0, n => n === 1); + } +} +class Option10 extends IntegerObject { + constructor(nsId, name) { + super(nsId, name, 1, n => n === 0); + } +} + +;// ./src/core/xfa/html_utils.js + + + + + + +function measureToString(m) { + if (typeof m === "string") { + return "0px"; + } + return Number.isInteger(m) ? `${m}px` : `${m.toFixed(2)}px`; +} +const converters = { + anchorType(node, style) { + const parent = node[$getSubformParent](); + if (!parent || parent.layout && parent.layout !== "position") { + return; + } + if (!("transform" in style)) { + style.transform = ""; + } + switch (node.anchorType) { + case "bottomCenter": + style.transform += "translate(-50%, -100%)"; + break; + case "bottomLeft": + style.transform += "translate(0,-100%)"; + break; + case "bottomRight": + style.transform += "translate(-100%,-100%)"; + break; + case "middleCenter": + style.transform += "translate(-50%,-50%)"; + break; + case "middleLeft": + style.transform += "translate(0,-50%)"; + break; + case "middleRight": + style.transform += "translate(-100%,-50%)"; + break; + case "topCenter": + style.transform += "translate(-50%,0)"; + break; + case "topRight": + style.transform += "translate(-100%,0)"; + break; + } + }, + dimensions(node, style) { + const parent = node[$getSubformParent](); + let width = node.w; + const height = node.h; + if (parent.layout?.includes("row")) { + const extra = parent[$extra]; + const colSpan = node.colSpan; + let w; + if (colSpan === -1) { + w = Math.sumPrecise(extra.columnWidths.slice(extra.currentColumn)); + extra.currentColumn = 0; + } else { + w = Math.sumPrecise(extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan)); + extra.currentColumn = (extra.currentColumn + node.colSpan) % extra.columnWidths.length; + } + if (!isNaN(w)) { + width = node.w = w; + } + } + style.width = width !== "" ? measureToString(width) : "auto"; + style.height = height !== "" ? measureToString(height) : "auto"; + }, + position(node, style) { + const parent = node[$getSubformParent](); + if (parent?.layout && parent.layout !== "position") { + return; + } + style.position = "absolute"; + style.left = measureToString(node.x); + style.top = measureToString(node.y); + }, + rotate(node, style) { + if (node.rotate) { + if (!("transform" in style)) { + style.transform = ""; + } + style.transform += `rotate(-${node.rotate}deg)`; + style.transformOrigin = "top left"; + } + }, + presence(node, style) { + switch (node.presence) { + case "invisible": + style.visibility = "hidden"; + break; + case "hidden": + case "inactive": + style.display = "none"; + break; + } + }, + hAlign(node, style) { + if (node[$nodeName] === "para") { + switch (node.hAlign) { + case "justifyAll": + style.textAlign = "justify-all"; + break; + case "radix": + style.textAlign = "left"; + break; + default: + style.textAlign = node.hAlign; + } + } else { + switch (node.hAlign) { + case "left": + style.alignSelf = "start"; + break; + case "center": + style.alignSelf = "center"; + break; + case "right": + style.alignSelf = "end"; + break; + } + } + }, + margin(node, style) { + if (node.margin) { + style.margin = node.margin[$toStyle]().margin; + } + } +}; +function setMinMaxDimensions(node, style) { + const parent = node[$getSubformParent](); + if (parent.layout === "position") { + if (node.minW > 0) { + style.minWidth = measureToString(node.minW); + } + if (node.maxW > 0) { + style.maxWidth = measureToString(node.maxW); + } + if (node.minH > 0) { + style.minHeight = measureToString(node.minH); + } + if (node.maxH > 0) { + style.maxHeight = measureToString(node.maxH); + } + } +} +function layoutText(text, xfaFont, margin, lineHeight, fontFinder, width) { + const measure = new TextMeasure(xfaFont, margin, lineHeight, fontFinder); + if (typeof text === "string") { + measure.addString(text); + } else { + text[$pushGlyphs](measure); + } + return measure.compute(width); +} +function layoutNode(node, availableSpace) { + let height = null; + let width = null; + let isBroken = false; + if ((!node.w || !node.h) && node.value) { + let marginH = 0; + let marginV = 0; + if (node.margin) { + marginH = node.margin.leftInset + node.margin.rightInset; + marginV = node.margin.topInset + node.margin.bottomInset; + } + let lineHeight = null; + let margin = null; + if (node.para) { + margin = Object.create(null); + lineHeight = node.para.lineHeight === "" ? null : node.para.lineHeight; + margin.top = node.para.spaceAbove === "" ? 0 : node.para.spaceAbove; + margin.bottom = node.para.spaceBelow === "" ? 0 : node.para.spaceBelow; + margin.left = node.para.marginLeft === "" ? 0 : node.para.marginLeft; + margin.right = node.para.marginRight === "" ? 0 : node.para.marginRight; + } + let font = node.font; + if (!font) { + const root = node[$getTemplateRoot](); + let parent = node[$getParent](); + while (parent && parent !== root) { + if (parent.font) { + font = parent.font; + break; + } + parent = parent[$getParent](); + } + } + const maxWidth = (node.w || availableSpace.width) - marginH; + const fontFinder = node[$globalData].fontFinder; + if (node.value.exData && node.value.exData[$content] && node.value.exData.contentType === "text/html") { + const res = layoutText(node.value.exData[$content], font, margin, lineHeight, fontFinder, maxWidth); + width = res.width; + height = res.height; + isBroken = res.isBroken; + } else { + const text = node.value[$text](); + if (text) { + const res = layoutText(text, font, margin, lineHeight, fontFinder, maxWidth); + width = res.width; + height = res.height; + isBroken = res.isBroken; + } + } + if (width !== null && !node.w) { + width += marginH; + } + if (height !== null && !node.h) { + height += marginV; + } + } + return { + w: width, + h: height, + isBroken + }; +} +function computeBbox(node, html, availableSpace) { + let bbox; + if (node.w !== "" && node.h !== "") { + bbox = [node.x, node.y, node.w, node.h]; + } else { + if (!availableSpace) { + return null; + } + let width = node.w; + if (width === "") { + if (node.maxW === 0) { + const parent = node[$getSubformParent](); + width = parent.layout === "position" && parent.w !== "" ? 0 : node.minW; + } else { + width = Math.min(node.maxW, availableSpace.width); + } + html.attributes.style.width = measureToString(width); + } + let height = node.h; + if (height === "") { + if (node.maxH === 0) { + const parent = node[$getSubformParent](); + height = parent.layout === "position" && parent.h !== "" ? 0 : node.minH; + } else { + height = Math.min(node.maxH, availableSpace.height); + } + html.attributes.style.height = measureToString(height); + } + bbox = [node.x, node.y, width, height]; + } + return bbox; +} +function fixDimensions(node) { + const parent = node[$getSubformParent](); + if (parent.layout?.includes("row")) { + const extra = parent[$extra]; + const colSpan = node.colSpan; + let width; + if (colSpan === -1) { + width = Math.sumPrecise(extra.columnWidths.slice(extra.currentColumn)); + } else { + width = Math.sumPrecise(extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan)); + } + if (!isNaN(width)) { + node.w = width; + } + } + if (parent.layout && parent.layout !== "position") { + node.x = node.y = 0; + } + if (node.layout === "table") { + if (node.w === "" && Array.isArray(node.columnWidths)) { + node.w = Math.sumPrecise(node.columnWidths); + } + } +} +function layoutClass(node) { + switch (node.layout) { + case "position": + return "xfaPosition"; + case "lr-tb": + return "xfaLrTb"; + case "rl-row": + return "xfaRlRow"; + case "rl-tb": + return "xfaRlTb"; + case "row": + return "xfaRow"; + case "table": + return "xfaTable"; + case "tb": + return "xfaTb"; + default: + return "xfaPosition"; + } +} +function toStyle(node, ...names) { + const style = Object.create(null); + for (const name of names) { + const value = node[name]; + if (value === null) { + continue; + } + if (converters.hasOwnProperty(name)) { + converters[name](node, style); + continue; + } + if (value instanceof XFAObject) { + const newStyle = value[$toStyle](); + if (newStyle) { + Object.assign(style, newStyle); + } else { + warn(`(DEBUG) - XFA - style for ${name} not implemented yet`); + } + } + } + return style; +} +function createWrapper(node, html) { + const { + attributes + } = html; + const { + style + } = attributes; + const wrapper = { + name: "div", + attributes: { + class: ["xfaWrapper"], + style: Object.create(null) + }, + children: [] + }; + attributes.class.push("xfaWrapped"); + if (node.border) { + const { + widths, + insets + } = node.border[$extra]; + let width, height; + let top = insets[0]; + let left = insets[3]; + const insetsH = insets[0] + insets[2]; + const insetsW = insets[1] + insets[3]; + switch (node.border.hand) { + case "even": + top -= widths[0] / 2; + left -= widths[3] / 2; + width = `calc(100% + ${(widths[1] + widths[3]) / 2 - insetsW}px)`; + height = `calc(100% + ${(widths[0] + widths[2]) / 2 - insetsH}px)`; + break; + case "left": + top -= widths[0]; + left -= widths[3]; + width = `calc(100% + ${widths[1] + widths[3] - insetsW}px)`; + height = `calc(100% + ${widths[0] + widths[2] - insetsH}px)`; + break; + case "right": + width = insetsW ? `calc(100% - ${insetsW}px)` : "100%"; + height = insetsH ? `calc(100% - ${insetsH}px)` : "100%"; + break; + } + const classNames = ["xfaBorder"]; + if (isPrintOnly(node.border)) { + classNames.push("xfaPrintOnly"); + } + const border = { + name: "div", + attributes: { + class: classNames, + style: { + top: `${top}px`, + left: `${left}px`, + width, + height + } + }, + children: [] + }; + for (const key of ["border", "borderWidth", "borderColor", "borderRadius", "borderStyle"]) { + if (style[key] !== undefined) { + border.attributes.style[key] = style[key]; + delete style[key]; + } + } + wrapper.children.push(border, html); + } else { + wrapper.children.push(html); + } + for (const key of ["background", "backgroundClip", "top", "left", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "transform", "transformOrigin", "visibility"]) { + if (style[key] !== undefined) { + wrapper.attributes.style[key] = style[key]; + delete style[key]; + } + } + wrapper.attributes.style.position = style.position === "absolute" ? "absolute" : "relative"; + delete style.position; + if (style.alignSelf) { + wrapper.attributes.style.alignSelf = style.alignSelf; + delete style.alignSelf; + } + return wrapper; +} +function fixTextIndent(styles) { + const indent = getMeasurement(styles.textIndent, "0px"); + if (indent >= 0) { + return; + } + const align = styles.textAlign === "right" ? "right" : "left"; + const name = "padding" + (align === "left" ? "Left" : "Right"); + const padding = getMeasurement(styles[name], "0px"); + styles[name] = `${padding - indent}px`; +} +function setAccess(node, classNames) { + switch (node.access) { + case "nonInteractive": + classNames.push("xfaNonInteractive"); + break; + case "readOnly": + classNames.push("xfaReadOnly"); + break; + case "protected": + classNames.push("xfaDisabled"); + break; + } +} +function isPrintOnly(node) { + return node.relevant.length > 0 && !node.relevant[0].excluded && node.relevant[0].viewname === "print"; +} +function getCurrentPara(node) { + const stack = node[$getTemplateRoot]()[$extra].paraStack; + return stack.length ? stack.at(-1) : null; +} +function setPara(node, nodeStyle, value) { + if (value.attributes.class?.includes("xfaRich")) { + if (nodeStyle) { + if (node.h === "") { + nodeStyle.height = "auto"; + } + if (node.w === "") { + nodeStyle.width = "auto"; + } + } + const para = getCurrentPara(node); + if (para) { + const valueStyle = value.attributes.style; + valueStyle.display = "flex"; + valueStyle.flexDirection = "column"; + switch (para.vAlign) { + case "top": + valueStyle.justifyContent = "start"; + break; + case "bottom": + valueStyle.justifyContent = "end"; + break; + case "middle": + valueStyle.justifyContent = "center"; + break; + } + const paraStyle = para[$toStyle](); + for (const [key, val] of Object.entries(paraStyle)) { + if (!(key in valueStyle)) { + valueStyle[key] = val; + } + } + } + } +} +function setFontFamily(xfaFont, node, fontFinder, style) { + if (!fontFinder) { + delete style.fontFamily; + return; + } + const name = stripQuotes(xfaFont.typeface); + style.fontFamily = `"${name}"`; + const typeface = fontFinder.find(name); + if (typeface) { + const { + fontFamily + } = typeface.regular.cssFontInfo; + if (fontFamily !== name) { + style.fontFamily = `"${fontFamily}"`; + } + const para = getCurrentPara(node); + if (para && para.lineHeight !== "") { + return; + } + if (style.lineHeight) { + return; + } + const pdfFont = selectFont(xfaFont, typeface); + if (pdfFont) { + style.lineHeight = Math.max(1.2, pdfFont.lineHeight); + } + } +} +function fixURL(str) { + const absoluteUrl = createValidAbsoluteUrl(str, null, { + addDefaultProtocol: true, + tryConvertEncoding: true + }); + return absoluteUrl ? absoluteUrl.href : null; +} + +;// ./src/core/xfa/layout.js + + + +function createLine(node, children) { + return { + name: "div", + attributes: { + class: [node.layout === "lr-tb" ? "xfaLr" : "xfaRl"] + }, + children + }; +} +function flushHTML(node) { + if (!node[$extra]) { + return null; + } + const attributes = node[$extra].attributes; + const html = { + name: "div", + attributes, + children: node[$extra].children + }; + if (node[$extra].failingNode) { + const htmlFromFailing = node[$extra].failingNode[$flushHTML](); + if (htmlFromFailing) { + if (node.layout.endsWith("-tb")) { + html.children.push(createLine(node, [htmlFromFailing])); + } else { + html.children.push(htmlFromFailing); + } + } + } + if (html.children.length === 0) { + return null; + } + return html; +} +function addHTML(node, html, bbox) { + const extra = node[$extra]; + const availableSpace = extra.availableSpace; + const [x, y, w, h] = bbox; + switch (node.layout) { + case "position": + { + extra.width = Math.max(extra.width, x + w); + extra.height = Math.max(extra.height, y + h); + extra.children.push(html); + break; + } + case "lr-tb": + case "rl-tb": + if (!extra.line || extra.attempt === 1) { + extra.line = createLine(node, []); + extra.children.push(extra.line); + extra.numberInLine = 0; + } + extra.numberInLine += 1; + extra.line.children.push(html); + if (extra.attempt === 0) { + extra.currentWidth += w; + extra.height = Math.max(extra.height, extra.prevHeight + h); + } else { + extra.currentWidth = w; + extra.prevHeight = extra.height; + extra.height += h; + extra.attempt = 0; + } + extra.width = Math.max(extra.width, extra.currentWidth); + break; + case "rl-row": + case "row": + { + extra.children.push(html); + extra.width += w; + extra.height = Math.max(extra.height, h); + const height = measureToString(extra.height); + for (const child of extra.children) { + child.attributes.style.height = height; + } + break; + } + case "table": + { + extra.width = MathClamp(w, extra.width, availableSpace.width); + extra.height += h; + extra.children.push(html); + break; + } + case "tb": + { + extra.width = MathClamp(w, extra.width, availableSpace.width); + extra.height += h; + extra.children.push(html); + break; + } + } +} +function getAvailableSpace(node) { + const availableSpace = node[$extra].availableSpace; + const marginV = node.margin ? node.margin.topInset + node.margin.bottomInset : 0; + const marginH = node.margin ? node.margin.leftInset + node.margin.rightInset : 0; + switch (node.layout) { + case "lr-tb": + case "rl-tb": + if (node[$extra].attempt === 0) { + return { + width: availableSpace.width - marginH - node[$extra].currentWidth, + height: availableSpace.height - marginV - node[$extra].prevHeight + }; + } + return { + width: availableSpace.width - marginH, + height: availableSpace.height - marginV - node[$extra].height + }; + case "rl-row": + case "row": + const width = Math.sumPrecise(node[$extra].columnWidths.slice(node[$extra].currentColumn)); + return { + width, + height: availableSpace.height - marginH + }; + case "table": + case "tb": + return { + width: availableSpace.width - marginH, + height: availableSpace.height - marginV - node[$extra].height + }; + case "position": + default: + return availableSpace; + } +} +function getTransformedBBox(node) { + let w = node.w === "" ? NaN : node.w; + let h = node.h === "" ? NaN : node.h; + let [centerX, centerY] = [0, 0]; + switch (node.anchorType || "") { + case "bottomCenter": + [centerX, centerY] = [w / 2, h]; + break; + case "bottomLeft": + [centerX, centerY] = [0, h]; + break; + case "bottomRight": + [centerX, centerY] = [w, h]; + break; + case "middleCenter": + [centerX, centerY] = [w / 2, h / 2]; + break; + case "middleLeft": + [centerX, centerY] = [0, h / 2]; + break; + case "middleRight": + [centerX, centerY] = [w, h / 2]; + break; + case "topCenter": + [centerX, centerY] = [w / 2, 0]; + break; + case "topRight": + [centerX, centerY] = [w, 0]; + break; + } + let x, y; + switch (node.rotate || 0) { + case 0: + [x, y] = [-centerX, -centerY]; + break; + case 90: + [x, y] = [-centerY, centerX]; + [w, h] = [h, -w]; + break; + case 180: + [x, y] = [centerX, centerY]; + [w, h] = [-w, -h]; + break; + case 270: + [x, y] = [centerY, -centerX]; + [w, h] = [-h, w]; + break; + } + return [node.x + x + Math.min(0, w), node.y + y + Math.min(0, h), Math.abs(w), Math.abs(h)]; +} +function checkDimensions(node, space) { + if (node[$getTemplateRoot]()[$extra].firstUnsplittable === null) { + return true; + } + if (node.w === 0 || node.h === 0) { + return true; + } + const ERROR = 2; + const parent = node[$getSubformParent](); + const attempt = parent[$extra]?.attempt || 0; + const [, y, w, h] = getTransformedBBox(node); + switch (parent.layout) { + case "lr-tb": + case "rl-tb": + if (attempt === 0) { + if (!node[$getTemplateRoot]()[$extra].noLayoutFailure) { + if (node.h !== "" && Math.round(h - space.height) > ERROR) { + return false; + } + if (node.w !== "") { + if (Math.round(w - space.width) <= ERROR) { + return true; + } + if (parent[$extra].numberInLine === 0) { + return space.height > ERROR; + } + return false; + } + return space.width > ERROR; + } + if (node.w !== "") { + return Math.round(w - space.width) <= ERROR; + } + return space.width > ERROR; + } + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "" && Math.round(h - space.height) > ERROR) { + return false; + } + if (node.w === "" || Math.round(w - space.width) <= ERROR) { + return space.height > ERROR; + } + if (parent[$isThereMoreWidth]()) { + return false; + } + return space.height > ERROR; + case "table": + case "tb": + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "" && !node[$isSplittable]()) { + return Math.round(h - space.height) <= ERROR; + } + if (node.w === "" || Math.round(w - space.width) <= ERROR) { + return space.height > ERROR; + } + if (parent[$isThereMoreWidth]()) { + return false; + } + return space.height > ERROR; + case "position": + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h === "" || Math.round(h + y - space.height) <= ERROR) { + return true; + } + const area = node[$getTemplateRoot]()[$extra].currentContentArea; + return h + y > area.h; + case "rl-row": + case "row": + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "") { + return Math.round(h - space.height) <= ERROR; + } + return true; + default: + return true; + } +} + +;// ./src/core/xfa/template.js + + + + + + + + + + +const TEMPLATE_NS_ID = NamespaceIds.template.id; +const SVG_NS = "http://www.w3.org/2000/svg"; +const MAX_ATTEMPTS_FOR_LRTB_LAYOUT = 2; +const MAX_EMPTY_PAGES = 3; +const DEFAULT_TAB_INDEX = 5000; +const HEADING_PATTERN = /^H(\d+)$/; +const MIMES = new Set(["image/gif", "image/jpeg", "image/jpg", "image/pjpeg", "image/png", "image/apng", "image/x-png", "image/bmp", "image/x-ms-bmp", "image/tiff", "image/tif", "application/octet-stream"]); +const IMAGES_HEADERS = [[[0x42, 0x4d], "image/bmp"], [[0xff, 0xd8, 0xff], "image/jpeg"], [[0x49, 0x49, 0x2a, 0x00], "image/tiff"], [[0x4d, 0x4d, 0x00, 0x2a], "image/tiff"], [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61], "image/gif"], [[0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], "image/png"]]; +function getBorderDims(node) { + if (!node || !node.border) { + return { + w: 0, + h: 0 + }; + } + const borderExtra = node.border[$getExtra](); + if (!borderExtra) { + return { + w: 0, + h: 0 + }; + } + return { + w: borderExtra.widths[0] + borderExtra.widths[2] + borderExtra.insets[0] + borderExtra.insets[2], + h: borderExtra.widths[1] + borderExtra.widths[3] + borderExtra.insets[1] + borderExtra.insets[3] + }; +} +function hasMargin(node) { + return node.margin && (node.margin.topInset || node.margin.rightInset || node.margin.bottomInset || node.margin.leftInset); +} +function _setValue(templateNode, value) { + if (!templateNode.value) { + const nodeValue = new Value({}); + templateNode[$appendChild](nodeValue); + templateNode.value = nodeValue; + } + templateNode.value[$setValue](value); +} +function* getContainedChildren(node) { + for (const child of node[$getChildren]()) { + if (child instanceof SubformSet) { + yield* child[$getContainedChildren](); + continue; + } + yield child; + } +} +function isRequired(node) { + return node.validate?.nullTest === "error"; +} +function setTabIndex(node) { + while (node) { + if (!node.traversal) { + node[$tabIndex] = node[$getParent]()[$tabIndex]; + return; + } + if (node[$tabIndex]) { + return; + } + let next = null; + for (const child of node.traversal[$getChildren]()) { + if (child.operation === "next") { + next = child; + break; + } + } + if (!next || !next.ref) { + node[$tabIndex] = node[$getParent]()[$tabIndex]; + return; + } + const root = node[$getTemplateRoot](); + node[$tabIndex] = ++root[$tabIndex]; + const ref = root[$searchNode](next.ref, node); + if (!ref) { + return; + } + node = ref[0]; + } +} +function applyAssist(obj, attributes) { + const assist = obj.assist; + if (assist) { + const assistTitle = assist[$toHTML](); + if (assistTitle) { + attributes.title = assistTitle; + } + const role = assist.role; + const match = role.match(HEADING_PATTERN); + if (match) { + const ariaRole = "heading"; + const ariaLevel = match[1]; + attributes.role = ariaRole; + attributes["aria-level"] = ariaLevel; + } + } + if (obj.layout === "table") { + attributes.role = "table"; + } else if (obj.layout === "row") { + attributes.role = "row"; + } else { + const parent = obj[$getParent](); + if (parent.layout === "row") { + attributes.role = parent.assist?.role === "TH" ? "columnheader" : "cell"; + } + } +} +function ariaLabel(obj) { + if (!obj.assist) { + return null; + } + const assist = obj.assist; + if (assist.speak && assist.speak[$content] !== "") { + return assist.speak[$content]; + } + if (assist.toolTip) { + return assist.toolTip[$content]; + } + return null; +} +function valueToHtml(value) { + return HTMLResult.success({ + name: "div", + attributes: { + class: ["xfaRich"], + style: Object.create(null) + }, + children: [{ + name: "span", + attributes: { + style: Object.create(null) + }, + value + }] + }); +} +function setFirstUnsplittable(node) { + const root = node[$getTemplateRoot](); + if (root[$extra].firstUnsplittable === null) { + root[$extra].firstUnsplittable = node; + root[$extra].noLayoutFailure = true; + } +} +function unsetFirstUnsplittable(node) { + const root = node[$getTemplateRoot](); + if (root[$extra].firstUnsplittable === node) { + root[$extra].noLayoutFailure = false; + } +} +function handleBreak(node) { + if (node[$extra]) { + return false; + } + node[$extra] = Object.create(null); + if (node.targetType === "auto") { + return false; + } + const root = node[$getTemplateRoot](); + let target = null; + if (node.target) { + target = root[$searchNode](node.target, node[$getParent]()); + if (!target) { + return false; + } + target = target[0]; + } + const { + currentPageArea, + currentContentArea + } = root[$extra]; + if (node.targetType === "pageArea") { + if (!(target instanceof PageArea)) { + target = null; + } + if (node.startNew) { + node[$extra].target = target || currentPageArea; + return true; + } else if (target && target !== currentPageArea) { + node[$extra].target = target; + return true; + } + return false; + } + if (!(target instanceof ContentArea)) { + target = null; + } + const pageArea = target && target[$getParent](); + let index; + let nextPageArea = pageArea; + if (node.startNew) { + if (target) { + const contentAreas = pageArea.contentArea.children; + const indexForCurrent = contentAreas.indexOf(currentContentArea); + const indexForTarget = contentAreas.indexOf(target); + if (indexForCurrent !== -1 && indexForCurrent < indexForTarget) { + nextPageArea = null; + } + index = indexForTarget - 1; + } else { + index = currentPageArea.contentArea.children.indexOf(currentContentArea); + } + } else if (target && target !== currentContentArea) { + const contentAreas = pageArea.contentArea.children; + index = contentAreas.indexOf(target) - 1; + nextPageArea = pageArea === currentPageArea ? null : pageArea; + } else { + return false; + } + node[$extra].target = nextPageArea; + node[$extra].index = index; + return true; +} +function handleOverflow(node, extraNode, space) { + const root = node[$getTemplateRoot](); + const saved = root[$extra].noLayoutFailure; + const savedMethod = extraNode[$getSubformParent]; + extraNode[$getSubformParent] = () => node; + root[$extra].noLayoutFailure = true; + const res = extraNode[$toHTML](space); + node[$addHTML](res.html, res.bbox); + root[$extra].noLayoutFailure = saved; + extraNode[$getSubformParent] = savedMethod; +} +class AppearanceFilter extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "appearanceFilter"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Arc extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "arc", true); + this.circular = getInteger({ + data: attributes.circular, + defaultValue: 0, + validate: x => x === 1 + }); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.startAngle = getFloat({ + data: attributes.startAngle, + defaultValue: 0, + validate: x => true + }); + this.sweepAngle = getFloat({ + data: attributes.sweepAngle, + defaultValue: 360, + validate: x => true + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.edge = null; + this.fill = null; + } + [$toHTML]() { + const edge = this.edge || new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } else { + style.fill = "transparent"; + } + style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0); + style.stroke = edgeStyle.color; + let arc; + const attributes = { + xmlns: SVG_NS, + style: { + width: "100%", + height: "100%", + overflow: "visible" + } + }; + if (this.sweepAngle === 360) { + arc = { + name: "ellipse", + attributes: { + xmlns: SVG_NS, + cx: "50%", + cy: "50%", + rx: "50%", + ry: "50%", + style + } + }; + } else { + const startAngle = this.startAngle * Math.PI / 180; + const sweepAngle = this.sweepAngle * Math.PI / 180; + const largeArc = this.sweepAngle > 180 ? 1 : 0; + const [x1, y1, x2, y2] = [50 * (1 + Math.cos(startAngle)), 50 * (1 - Math.sin(startAngle)), 50 * (1 + Math.cos(startAngle + sweepAngle)), 50 * (1 - Math.sin(startAngle + sweepAngle))]; + arc = { + name: "path", + attributes: { + xmlns: SVG_NS, + d: `M ${x1} ${y1} A 50 50 0 ${largeArc} 0 ${x2} ${y2}`, + vectorEffect: "non-scaling-stroke", + style + } + }; + Object.assign(attributes, { + viewBox: "0 0 100 100", + preserveAspectRatio: "none" + }); + } + const svg = { + name: "svg", + children: [arc], + attributes + }; + const parent = this[$getParent]()[$getParent](); + if (hasMargin(parent)) { + return HTMLResult.success({ + name: "div", + attributes: { + style: { + display: "inline", + width: "100%", + height: "100%" + } + }, + children: [svg] + }); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); + } +} +class Area extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "area", true); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.desc = null; + this.extras = null; + this.area = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + } + *[$getContainedChildren]() { + yield* getContainedChildren(this); + } + [$isTransparent]() { + return true; + } + [$isBindable]() { + return true; + } + [$addHTML](html, bbox) { + const [x, y, w, h] = bbox; + this[$extra].width = Math.max(this[$extra].width, x + w); + this[$extra].height = Math.max(this[$extra].height, y + h); + this[$extra].children.push(html); + } + [$getAvailableSpace]() { + return this[$extra].availableSpace; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "position"); + const attributes = { + style, + id: this[$uid], + class: ["xfaArea"] + }; + if (isPrintOnly(this)) { + attributes.class.push("xfaPrintOnly"); + } + if (this.name) { + attributes.xfaName = this.name; + } + const children = []; + this[$extra] = { + children, + width: 0, + height: 0, + availableSpace + }; + const result = this[$childrenToHTML]({ + filter: new Set(["area", "draw", "field", "exclGroup", "subform", "subformSet"]), + include: true + }); + if (!result.success) { + if (result.isBreak()) { + return result; + } + delete this[$extra]; + return HTMLResult.FAILURE; + } + style.width = measureToString(this[$extra].width); + style.height = measureToString(this[$extra].height); + const html = { + name: "div", + attributes, + children + }; + const bbox = [this.x, this.y, this[$extra].width, this[$extra].height]; + delete this[$extra]; + return HTMLResult.success(html, bbox); + } +} +class Assist extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "assist", true); + this.id = attributes.id || ""; + this.role = attributes.role || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.speak = null; + this.toolTip = null; + } + [$toHTML]() { + return this.toolTip?.[$content] || null; + } +} +class Barcode extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "barcode", true); + this.charEncoding = getKeyword({ + data: attributes.charEncoding ? attributes.charEncoding.toLowerCase() : "", + defaultValue: "", + validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/) + }); + this.checksum = getStringOption(attributes.checksum, ["none", "1mod10", "1mod10_1mod11", "2mod10", "auto"]); + this.dataColumnCount = getInteger({ + data: attributes.dataColumnCount, + defaultValue: -1, + validate: x => x >= 0 + }); + this.dataLength = getInteger({ + data: attributes.dataLength, + defaultValue: -1, + validate: x => x >= 0 + }); + this.dataPrep = getStringOption(attributes.dataPrep, ["none", "flateCompress"]); + this.dataRowCount = getInteger({ + data: attributes.dataRowCount, + defaultValue: -1, + validate: x => x >= 0 + }); + this.endChar = attributes.endChar || ""; + this.errorCorrectionLevel = getInteger({ + data: attributes.errorCorrectionLevel, + defaultValue: -1, + validate: x => x >= 0 && x <= 8 + }); + this.id = attributes.id || ""; + this.moduleHeight = getMeasurement(attributes.moduleHeight, "5mm"); + this.moduleWidth = getMeasurement(attributes.moduleWidth, "0.25mm"); + this.printCheckDigit = getInteger({ + data: attributes.printCheckDigit, + defaultValue: 0, + validate: x => x === 1 + }); + this.rowColumnRatio = getRatio(attributes.rowColumnRatio); + this.startChar = attributes.startChar || ""; + this.textLocation = getStringOption(attributes.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]); + this.truncate = getInteger({ + data: attributes.truncate, + defaultValue: 0, + validate: x => x === 1 + }); + this.type = getStringOption(attributes.type ? attributes.type.toLowerCase() : "", ["aztec", "codabar", "code2of5industrial", "code2of5interleaved", "code2of5matrix", "code2of5standard", "code3of9", "code3of9extended", "code11", "code49", "code93", "code128", "code128a", "code128b", "code128c", "code128sscc", "datamatrix", "ean8", "ean8add2", "ean8add5", "ean13", "ean13add2", "ean13add5", "ean13pwcd", "fim", "logmars", "maxicode", "msi", "pdf417", "pdf417macro", "plessey", "postauscust2", "postauscust3", "postausreplypaid", "postausstandard", "postukrm4scc", "postusdpbc", "postusimb", "postusstandard", "postus5zip", "qrcode", "rfid", "rss14", "rss14expanded", "rss14limited", "rss14stacked", "rss14stackedomni", "rss14truncated", "telepen", "ucc128", "ucc128random", "ucc128sscc", "upca", "upcaadd2", "upcaadd5", "upcapwcd", "upce", "upceadd2", "upceadd5", "upcean2", "upcean5", "upsmaxicode"]); + this.upsMode = getStringOption(attributes.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.wideNarrowRatio = getRatio(attributes.wideNarrowRatio); + this.encrypt = null; + this.extras = null; + } +} +class Bind extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "bind", true); + this.match = getStringOption(attributes.match, ["once", "dataRef", "global", "none"]); + this.ref = attributes.ref || ""; + this.picture = null; + } +} +class BindItems extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "bindItems"); + this.connection = attributes.connection || ""; + this.labelRef = attributes.labelRef || ""; + this.ref = attributes.ref || ""; + this.valueRef = attributes.valueRef || ""; + } +} +class Bookend extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "bookend"); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class BooleanElement extends Option01 { + constructor(attributes) { + super(TEMPLATE_NS_ID, "boolean"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] === 1 ? "1" : "0"); + } +} +class Border extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "border", true); + this.break = getStringOption(attributes.break, ["close", "open"]); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.corner = new XFAObjectArray(4); + this.edge = new XFAObjectArray(4); + this.extras = null; + this.fill = null; + this.margin = null; + } + [$getExtra]() { + if (!this[$extra]) { + const edges = this.edge.children.slice(); + if (edges.length < 4) { + const defaultEdge = edges.at(-1) || new Edge({}); + for (let i = edges.length; i < 4; i++) { + edges.push(defaultEdge); + } + } + const widths = edges.map(edge => edge.thickness); + const insets = [0, 0, 0, 0]; + if (this.margin) { + insets[0] = this.margin.topInset; + insets[1] = this.margin.rightInset; + insets[2] = this.margin.bottomInset; + insets[3] = this.margin.leftInset; + } + this[$extra] = { + widths, + insets, + edges + }; + } + return this[$extra]; + } + [$toStyle]() { + const { + edges + } = this[$getExtra](); + const edgeStyles = edges.map(node => { + const style = node[$toStyle](); + style.color ||= "#000000"; + return style; + }); + const style = Object.create(null); + if (this.margin) { + Object.assign(style, this.margin[$toStyle]()); + } + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } + if (this.corner.children.some(node => node.radius !== 0)) { + const cornerStyles = this.corner.children.map(node => node[$toStyle]()); + if (cornerStyles.length === 2 || cornerStyles.length === 3) { + const last = cornerStyles.at(-1); + for (let i = cornerStyles.length; i < 4; i++) { + cornerStyles.push(last); + } + } + style.borderRadius = cornerStyles.map(s => s.radius).join(" "); + } + switch (this.presence) { + case "invisible": + case "hidden": + style.borderStyle = ""; + break; + case "inactive": + style.borderStyle = "none"; + break; + default: + style.borderStyle = edgeStyles.map(s => s.style).join(" "); + break; + } + style.borderWidth = edgeStyles.map(s => s.width).join(" "); + style.borderColor = edgeStyles.map(s => s.color).join(" "); + return style; + } +} +class Break extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "break", true); + this.after = getStringOption(attributes.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]); + this.afterTarget = attributes.afterTarget || ""; + this.before = getStringOption(attributes.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]); + this.beforeTarget = attributes.beforeTarget || ""; + this.bookendLeader = attributes.bookendLeader || ""; + this.bookendTrailer = attributes.bookendTrailer || ""; + this.id = attributes.id || ""; + this.overflowLeader = attributes.overflowLeader || ""; + this.overflowTarget = attributes.overflowTarget || ""; + this.overflowTrailer = attributes.overflowTrailer || ""; + this.startNew = getInteger({ + data: attributes.startNew, + defaultValue: 0, + validate: x => x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } +} +class BreakAfter extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "breakAfter", true); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.startNew = getInteger({ + data: attributes.startNew, + defaultValue: 0, + validate: x => x === 1 + }); + this.target = attributes.target || ""; + this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]); + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.script = null; + } +} +class BreakBefore extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "breakBefore", true); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.startNew = getInteger({ + data: attributes.startNew, + defaultValue: 0, + validate: x => x === 1 + }); + this.target = attributes.target || ""; + this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]); + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.script = null; + } + [$toHTML](availableSpace) { + this[$extra] = {}; + return HTMLResult.FAILURE; + } +} +class Button extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "button", true); + this.highlight = getStringOption(attributes.highlight, ["inverted", "none", "outline", "push"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$toHTML](availableSpace) { + const parent = this[$getParent](); + const grandpa = parent[$getParent](); + const htmlButton = { + name: "button", + attributes: { + id: this[$uid], + class: ["xfaButton"], + style: {} + }, + children: [] + }; + for (const event of grandpa.event.children) { + if (event.activity !== "click" || !event.script) { + continue; + } + const jsURL = recoverJsURL(event.script[$content]); + if (!jsURL) { + continue; + } + const href = fixURL(jsURL.url); + if (!href) { + continue; + } + htmlButton.children.push({ + name: "a", + attributes: { + id: "link" + this[$uid], + href, + newWindow: jsURL.newWindow, + class: ["xfaLink"], + style: {} + }, + children: [] + }); + } + return HTMLResult.success(htmlButton); + } +} +class Calculate extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "calculate", true); + this.id = attributes.id || ""; + this.override = getStringOption(attributes.override, ["disabled", "error", "ignore", "warning"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.message = null; + this.script = null; + } +} +class Caption extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "caption", true); + this.id = attributes.id || ""; + this.placement = getStringOption(attributes.placement, ["left", "bottom", "inline", "right", "top"]); + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.reserve = Math.ceil(getMeasurement(attributes.reserve)); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.font = null; + this.margin = null; + this.para = null; + this.value = null; + } + [$setValue](value) { + _setValue(this, value); + } + [$getExtra](availableSpace) { + if (!this[$extra]) { + let { + width, + height + } = availableSpace; + switch (this.placement) { + case "left": + case "right": + case "inline": + width = this.reserve <= 0 ? width : this.reserve; + break; + case "top": + case "bottom": + height = this.reserve <= 0 ? height : this.reserve; + break; + } + this[$extra] = layoutNode(this, { + width, + height + }); + } + return this[$extra]; + } + [$toHTML](availableSpace) { + if (!this.value) { + return HTMLResult.EMPTY; + } + this[$pushPara](); + const value = this.value[$toHTML](availableSpace).html; + if (!value) { + this[$popPara](); + return HTMLResult.EMPTY; + } + const savedReserve = this.reserve; + if (this.reserve <= 0) { + const { + w, + h + } = this[$getExtra](availableSpace); + switch (this.placement) { + case "left": + case "right": + case "inline": + this.reserve = w; + break; + case "top": + case "bottom": + this.reserve = h; + break; + } + } + const children = []; + if (typeof value === "string") { + children.push({ + name: "#text", + value + }); + } else { + children.push(value); + } + const style = toStyle(this, "font", "margin", "visibility"); + switch (this.placement) { + case "left": + case "right": + if (this.reserve > 0) { + style.width = measureToString(this.reserve); + } + break; + case "top": + case "bottom": + if (this.reserve > 0) { + style.height = measureToString(this.reserve); + } + break; + } + setPara(this, null, value); + this[$popPara](); + this.reserve = savedReserve; + return HTMLResult.success({ + name: "div", + attributes: { + style, + class: ["xfaCaption"] + }, + children + }); + } +} +class Certificate extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "certificate"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Certificates extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "certificates", true); + this.credentialServerPolicy = getStringOption(attributes.credentialServerPolicy, ["optional", "required"]); + this.id = attributes.id || ""; + this.url = attributes.url || ""; + this.urlPolicy = attributes.urlPolicy || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.encryption = null; + this.issuers = null; + this.keyUsage = null; + this.oids = null; + this.signing = null; + this.subjectDNs = null; + } +} +class CheckButton extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "checkButton", true); + this.id = attributes.id || ""; + this.mark = getStringOption(attributes.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]); + this.shape = getStringOption(attributes.shape, ["square", "round"]); + this.size = getMeasurement(attributes.size, "10pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "margin"); + const size = measureToString(this.size); + style.width = style.height = size; + let type; + let className; + let groupId; + const field = this[$getParent]()[$getParent](); + const items = field.items.children.length && field.items.children[0][$toHTML]().html || []; + const exportedValue = { + on: (items[0] !== undefined ? items[0] : "on").toString(), + off: (items[1] !== undefined ? items[1] : "off").toString() + }; + const value = field.value?.[$text]() || "off"; + const checked = value === exportedValue.on || undefined; + const container = field[$getSubformParent](); + const fieldId = field[$uid]; + let dataId; + if (container instanceof ExclGroup) { + groupId = container[$uid]; + type = "radio"; + className = "xfaRadio"; + dataId = container[$data]?.[$uid] || container[$uid]; + } else { + type = "checkbox"; + className = "xfaCheckbox"; + dataId = field[$data]?.[$uid] || field[$uid]; + } + const input = { + name: "input", + attributes: { + class: [className], + style, + fieldId, + dataId, + type, + checked, + xfaOn: exportedValue.on, + xfaOff: exportedValue.off, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + if (groupId) { + input.attributes.name = groupId; + } + if (isRequired(field)) { + input.attributes["aria-required"] = true; + input.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [input] + }); + } +} +class ChoiceList extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "choiceList", true); + this.commitOn = getStringOption(attributes.commitOn, ["select", "exit"]); + this.id = attributes.id || ""; + this.open = getStringOption(attributes.open, ["userControl", "always", "multiSelect", "onEntry"]); + this.textEntry = getInteger({ + data: attributes.textEntry, + defaultValue: 0, + validate: x => x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "margin"); + const ui = this[$getParent](); + const field = ui[$getParent](); + const fontSize = field.font?.size || 10; + const optionStyle = { + fontSize: `calc(${fontSize}px * var(--total-scale-factor))` + }; + const children = []; + if (field.items.children.length > 0) { + const items = field.items; + let displayedIndex = 0; + let saveIndex = 0; + if (items.children.length === 2) { + displayedIndex = items.children[0].save; + saveIndex = 1 - displayedIndex; + } + const displayed = items.children[displayedIndex][$toHTML]().html; + const values = items.children[saveIndex][$toHTML]().html; + let selected = false; + const value = field.value?.[$text]() || ""; + for (let i = 0, ii = displayed.length; i < ii; i++) { + const option = { + name: "option", + attributes: { + value: values[i] || displayed[i], + style: optionStyle + }, + value: displayed[i] + }; + if (values[i] === value) { + option.attributes.selected = selected = true; + } + children.push(option); + } + if (!selected) { + children.splice(0, 0, { + name: "option", + attributes: { + hidden: true, + selected: true + }, + value: " " + }); + } + } + const selectAttributes = { + class: ["xfaSelect"], + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + style, + "aria-label": ariaLabel(field), + "aria-required": false + }; + if (isRequired(field)) { + selectAttributes["aria-required"] = true; + selectAttributes.required = true; + } + if (this.open === "multiSelect") { + selectAttributes.multiple = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [{ + name: "select", + children, + attributes: selectAttributes + }] + }); + } +} +class Color extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "color", true); + this.cSpace = getStringOption(attributes.cSpace, ["SRGB"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.value = attributes.value ? getColor(attributes.value) : ""; + this.extras = null; + } + [$hasSettableValue]() { + return false; + } + [$toStyle]() { + return this.value ? Util.makeHexColor(this.value.r, this.value.g, this.value.b) : null; + } +} +class Comb extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "comb"); + this.id = attributes.id || ""; + this.numberOfCells = getInteger({ + data: attributes.numberOfCells, + defaultValue: 0, + validate: x => x >= 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Connect extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "connect", true); + this.connection = attributes.connection || ""; + this.id = attributes.id || ""; + this.ref = attributes.ref || ""; + this.usage = getStringOption(attributes.usage, ["exportAndImport", "exportOnly", "importOnly"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.picture = null; + } +} +class ContentArea extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "contentArea", true); + this.h = getMeasurement(attributes.h); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = getMeasurement(attributes.w); + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.desc = null; + this.extras = null; + } + [$toHTML](availableSpace) { + const left = measureToString(this.x); + const top = measureToString(this.y); + const style = { + left, + top, + width: measureToString(this.w), + height: measureToString(this.h) + }; + const classNames = ["xfaContentarea"]; + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + return HTMLResult.success({ + name: "div", + children: [], + attributes: { + style, + class: classNames, + id: this[$uid] + } + }); + } +} +class Corner extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "corner", true); + this.id = attributes.id || ""; + this.inverted = getInteger({ + data: attributes.inverted, + defaultValue: 0, + validate: x => x === 1 + }); + this.join = getStringOption(attributes.join, ["square", "round"]); + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.radius = getMeasurement(attributes.radius); + this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]); + this.thickness = getMeasurement(attributes.thickness, "0.5pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle]() { + const style = toStyle(this, "visibility"); + style.radius = measureToString(this.join === "square" ? 0 : this.radius); + return style; + } +} +class DateElement extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "date"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); + } +} +class DateTime extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "dateTime"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); + } +} +class DateTimeEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "dateTimeEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.picker = getStringOption(attributes.picker, ["host", "none"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.comb = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + const field = this[$getParent]()[$getParent](); + const html = { + name: "input", + attributes: { + type: "text", + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [html] + }); + } +} +class Decimal extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "decimal"); + this.fracDigits = getInteger({ + data: attributes.fracDigits, + defaultValue: 2, + validate: x => true + }); + this.id = attributes.id || ""; + this.leadDigits = getInteger({ + data: attributes.leadDigits, + defaultValue: -1, + validate: x => true + }); + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const number = parseFloat(this[$content].trim()); + this[$content] = isNaN(number) ? null : number; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); + } +} +class DefaultUi extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "defaultUi", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } +} +class Desc extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "desc", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } +} +class DigestMethod extends OptionObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class DigestMethods extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "digestMethods", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.digestMethod = new XFAObjectArray(); + } +} +class Draw extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "draw", true); + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.rotate = getInteger({ + data: attributes.rotate, + defaultValue: 0, + validate: x => x % 90 === 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.border = null; + this.caption = null; + this.desc = null; + this.extras = null; + this.font = null; + this.keep = null; + this.margin = null; + this.para = null; + this.traversal = null; + this.ui = null; + this.value = null; + this.setProperty = new XFAObjectArray(); + } + [$setValue](value) { + _setValue(this, value); + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (this.presence === "hidden" || this.presence === "inactive") { + return HTMLResult.EMPTY; + } + fixDimensions(this); + this[$pushPara](); + const savedW = this.w; + const savedH = this.h; + const { + w, + h, + isBroken + } = layoutNode(this, availableSpace); + if (w && this.w === "") { + if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { + this[$popPara](); + return HTMLResult.FAILURE; + } + this.w = w; + } + if (h && this.h === "") { + this.h = h; + } + setFirstUnsplittable(this); + if (!checkDimensions(this, availableSpace)) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.FAILURE; + } + unsetFirstUnsplittable(this); + const style = toStyle(this, "font", "hAlign", "dimensions", "position", "presence", "rotate", "anchorType", "border", "margin"); + setMinMaxDimensions(this, style); + if (style.margin) { + style.padding = style.margin; + delete style.margin; + } + const classNames = ["xfaDraw"]; + if (this.font) { + classNames.push("xfaFont"); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + const attributes = { + style, + id: this[$uid], + class: classNames + }; + if (this.name) { + attributes.xfaName = this.name; + } + const html = { + name: "div", + attributes, + children: [] + }; + applyAssist(this, attributes); + const bbox = computeBbox(this, html, availableSpace); + const value = this.value ? this.value[$toHTML](availableSpace).html : null; + if (value === null) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.success(createWrapper(this, html), bbox); + } + html.children.push(value); + setPara(this, style, value); + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.success(createWrapper(this, html), bbox); + } +} +class Edge extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "edge", true); + this.cap = getStringOption(attributes.cap, ["square", "butt", "round"]); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]); + this.thickness = getMeasurement(attributes.thickness, "0.5pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle]() { + const style = toStyle(this, "visibility"); + Object.assign(style, { + linecap: this.cap, + width: measureToString(this.thickness), + color: this.color ? this.color[$toStyle]() : "#000000", + style: "" + }); + if (this.presence !== "visible") { + style.style = "none"; + } else { + switch (this.stroke) { + case "solid": + style.style = "solid"; + break; + case "dashDot": + style.style = "dashed"; + break; + case "dashDotDot": + style.style = "dashed"; + break; + case "dashed": + style.style = "dashed"; + break; + case "dotted": + style.style = "dotted"; + break; + case "embossed": + style.style = "ridge"; + break; + case "etched": + style.style = "groove"; + break; + case "lowered": + style.style = "inset"; + break; + case "raised": + style.style = "outset"; + break; + } + } + return style; + } +} +class Encoding extends OptionObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encoding", ["adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Encodings extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encodings", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.encoding = new XFAObjectArray(); + } +} +class Encrypt extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encrypt", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = null; + } +} +class EncryptData extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptData", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, ["encrypt", "decrypt"]); + this.target = attributes.target || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.filter = null; + this.manifest = null; + } +} +class Encryption extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryption", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = new XFAObjectArray(); + } +} +class EncryptionMethod extends OptionObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptionMethod", ["", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class EncryptionMethods extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptionMethods", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.encryptionMethod = new XFAObjectArray(); + } +} +class Event extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "event", true); + this.activity = getStringOption(attributes.activity, ["click", "change", "docClose", "docReady", "enter", "exit", "full", "indexChange", "initialize", "mouseDown", "mouseEnter", "mouseExit", "mouseUp", "postExecute", "postOpen", "postPrint", "postSave", "postSign", "postSubmit", "preExecute", "preOpen", "prePrint", "preSave", "preSign", "preSubmit", "ready", "validationState"]); + this.id = attributes.id || ""; + this.listen = getStringOption(attributes.listen, ["refOnly", "refAndDescendents"]); + this.name = attributes.name || ""; + this.ref = attributes.ref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.encryptData = null; + this.execute = null; + this.script = null; + this.signData = null; + this.submit = null; + } +} +class ExData extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "exData"); + this.contentType = attributes.contentType || ""; + this.href = attributes.href || ""; + this.id = attributes.id || ""; + this.maxLength = getInteger({ + data: attributes.maxLength, + defaultValue: -1, + validate: x => x >= -1 + }); + this.name = attributes.name || ""; + this.rid = attributes.rid || ""; + this.transferEncoding = getStringOption(attributes.transferEncoding, ["none", "base64", "package"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$isCDATAXml]() { + return this.contentType === "text/html"; + } + [$onChild](child) { + if (this.contentType === "text/html" && child[$namespaceId] === NamespaceIds.xhtml.id) { + this[$content] = child; + return true; + } + if (this.contentType === "text/xml") { + this[$content] = child; + return true; + } + return false; + } + [$toHTML](availableSpace) { + if (this.contentType !== "text/html" || !this[$content]) { + return HTMLResult.EMPTY; + } + return this[$content][$toHTML](availableSpace); + } +} +class ExObject extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "exObject", true); + this.archive = attributes.archive || ""; + this.classId = attributes.classId || ""; + this.codeBase = attributes.codeBase || ""; + this.codeType = attributes.codeType || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } +} +class ExclGroup extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "exclGroup", true); + this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); + this.accessKey = attributes.accessKey || ""; + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]); + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.bind = null; + this.border = null; + this.calculate = null; + this.caption = null; + this.desc = null; + this.extras = null; + this.margin = null; + this.para = null; + this.traversal = null; + this.validate = null; + this.connect = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + } + [$isBindable]() { + return true; + } + [$hasSettableValue]() { + return true; + } + [$setValue](value) { + for (const field of this.field.children) { + if (!field.value) { + const nodeValue = new Value({}); + field[$appendChild](nodeValue); + field.value = nodeValue; + } + field.value[$setValue](value); + } + } + [$isThereMoreWidth]() { + return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth](); + } + [$isSplittable]() { + const parent = this[$getSubformParent](); + if (!parent[$isSplittable]()) { + return false; + } + if (this[$extra]._isSplittable !== undefined) { + return this[$extra]._isSplittable; + } + if (this.layout === "position" || this.layout.includes("row")) { + this[$extra]._isSplittable = false; + return false; + } + if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { + return false; + } + this[$extra]._isSplittable = true; + return true; + } + [$flushHTML]() { + return flushHTML(this); + } + [$addHTML](html, bbox) { + addHTML(this, html, bbox); + } + [$getAvailableSpace]() { + return getAvailableSpace(this); + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) { + return HTMLResult.EMPTY; + } + fixDimensions(this); + const children = []; + const attributes = { + id: this[$uid], + class: [] + }; + setAccess(this, attributes.class); + this[$extra] ||= Object.create(null); + Object.assign(this[$extra], { + children, + attributes, + attempt: 0, + line: null, + numberInLine: 0, + availableSpace: { + width: Math.min(this.w || Infinity, availableSpace.width), + height: Math.min(this.h || Infinity, availableSpace.height) + }, + width: 0, + height: 0, + prevHeight: 0, + currentWidth: 0 + }); + const isSplittable = this[$isSplittable](); + if (!isSplittable) { + setFirstUnsplittable(this); + } + if (!checkDimensions(this, availableSpace)) { + return HTMLResult.FAILURE; + } + const filter = new Set(["field"]); + if (this.layout.includes("row")) { + const columnWidths = this[$getSubformParent]().columnWidths; + if (Array.isArray(columnWidths) && columnWidths.length > 0) { + this[$extra].columnWidths = columnWidths; + this[$extra].currentColumn = 0; + } + } + const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"); + const classNames = ["xfaExclgroup"]; + const cl = layoutClass(this); + if (cl) { + classNames.push(cl); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + attributes.style = style; + attributes.class = classNames; + if (this.name) { + attributes.xfaName = this.name; + } + this[$pushPara](); + const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; + const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; + for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { + if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { + this[$extra].numberInLine = 0; + } + const result = this[$childrenToHTML]({ + filter, + include: true + }); + if (result.success) { + break; + } + if (result.isBreak()) { + this[$popPara](); + return result; + } + if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !this[$getTemplateRoot]()[$extra].noLayoutFailure) { + this[$extra].attempt = maxRun; + break; + } + } + this[$popPara](); + if (!isSplittable) { + unsetFirstUnsplittable(this); + } + if (this[$extra].attempt === maxRun) { + if (!isSplittable) { + delete this[$extra]; + } + return HTMLResult.FAILURE; + } + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + const width = Math.max(this[$extra].width + marginH, this.w || 0); + const height = Math.max(this[$extra].height + marginV, this.h || 0); + const bbox = [this.x, this.y, width, height]; + if (this.w === "") { + style.width = measureToString(width); + } + if (this.h === "") { + style.height = measureToString(height); + } + const html = { + name: "div", + attributes, + children + }; + applyAssist(this, attributes); + delete this[$extra]; + return HTMLResult.success(createWrapper(this, html), bbox); + } +} +class Execute extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "execute"); + this.connection = attributes.connection || ""; + this.executeType = getStringOption(attributes.executeType, ["import", "remerge"]); + this.id = attributes.id || ""; + this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Extras extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "extras", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.extras = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } +} +class Field extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "field", true); + this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); + this.accessKey = attributes.accessKey || ""; + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.rotate = getInteger({ + data: attributes.rotate, + defaultValue: 0, + validate: x => x % 90 === 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.bind = null; + this.border = null; + this.calculate = null; + this.caption = null; + this.desc = null; + this.extras = null; + this.font = null; + this.format = null; + this.items = new XFAObjectArray(2); + this.keep = null; + this.margin = null; + this.para = null; + this.traversal = null; + this.ui = null; + this.validate = null; + this.value = null; + this.bindItems = new XFAObjectArray(); + this.connect = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + } + [$isBindable]() { + return true; + } + [$setValue](value) { + _setValue(this, value); + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (!this.ui) { + this.ui = new Ui({}); + this.ui[$globalData] = this[$globalData]; + this[$appendChild](this.ui); + let node; + switch (this.items.children.length) { + case 0: + node = new TextEdit({}); + this.ui.textEdit = node; + break; + case 1: + node = new CheckButton({}); + this.ui.checkButton = node; + break; + case 2: + node = new ChoiceList({}); + this.ui.choiceList = node; + break; + } + this.ui[$appendChild](node); + } + if (!this.ui || this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) { + return HTMLResult.EMPTY; + } + if (this.caption) { + delete this.caption[$extra]; + } + this[$pushPara](); + const caption = this.caption ? this.caption[$toHTML](availableSpace).html : null; + const savedW = this.w; + const savedH = this.h; + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + let borderDims = null; + if (this.w === "" || this.h === "") { + let width = null; + let height = null; + let uiW = 0; + let uiH = 0; + if (this.ui.checkButton) { + uiW = uiH = this.ui.checkButton.size; + } else { + const { + w, + h + } = layoutNode(this, availableSpace); + if (w !== null) { + uiW = w; + uiH = h; + } else { + uiH = fonts_getMetrics(this.font, true).lineNoGap; + } + } + borderDims = getBorderDims(this.ui[$getExtra]()); + uiW += borderDims.w; + uiH += borderDims.h; + if (this.caption) { + const { + w, + h, + isBroken + } = this.caption[$getExtra](availableSpace); + if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { + this[$popPara](); + return HTMLResult.FAILURE; + } + width = w; + height = h; + switch (this.caption.placement) { + case "left": + case "right": + case "inline": + width += uiW; + break; + case "top": + case "bottom": + height += uiH; + break; + } + } else { + width = uiW; + height = uiH; + } + if (width && this.w === "") { + width += marginH; + this.w = Math.min(this.maxW <= 0 ? Infinity : this.maxW, this.minW + 1 < width ? width : this.minW); + } + if (height && this.h === "") { + height += marginV; + this.h = Math.min(this.maxH <= 0 ? Infinity : this.maxH, this.minH + 1 < height ? height : this.minH); + } + } + this[$popPara](); + fixDimensions(this); + setFirstUnsplittable(this); + if (!checkDimensions(this, availableSpace)) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.FAILURE; + } + unsetFirstUnsplittable(this); + const style = toStyle(this, "font", "dimensions", "position", "rotate", "anchorType", "presence", "margin", "hAlign"); + setMinMaxDimensions(this, style); + const classNames = ["xfaField"]; + if (this.font) { + classNames.push("xfaFont"); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + const attributes = { + style, + id: this[$uid], + class: classNames + }; + if (style.margin) { + style.padding = style.margin; + delete style.margin; + } + setAccess(this, classNames); + if (this.name) { + attributes.xfaName = this.name; + } + const children = []; + const html = { + name: "div", + attributes, + children + }; + applyAssist(this, attributes); + const borderStyle = this.border ? this.border[$toStyle]() : null; + const bbox = computeBbox(this, html, availableSpace); + const ui = this.ui[$toHTML]().html; + if (!ui) { + Object.assign(style, borderStyle); + return HTMLResult.success(createWrapper(this, html), bbox); + } + if (this[$tabIndex]) { + if (ui.children?.[0]) { + ui.children[0].attributes.tabindex = this[$tabIndex]; + } else { + ui.attributes.tabindex = this[$tabIndex]; + } + } + ui.attributes.style ||= Object.create(null); + let aElement = null; + if (this.ui.button) { + if (ui.children.length === 1) { + [aElement] = ui.children.splice(0, 1); + } + Object.assign(ui.attributes.style, borderStyle); + } else { + Object.assign(style, borderStyle); + } + children.push(ui); + if (this.value) { + if (this.ui.imageEdit) { + ui.children.push(this.value[$toHTML]().html); + } else if (!this.ui.button) { + let value = ""; + if (this.value.exData) { + value = this.value.exData[$text](); + } else if (this.value.text) { + value = this.value.text[$getExtra](); + } else { + const htmlValue = this.value[$toHTML]().html; + if (htmlValue !== null) { + value = htmlValue.children[0].value; + } + } + if (this.ui.textEdit && this.value.text?.maxChars) { + ui.children[0].attributes.maxLength = this.value.text.maxChars; + } + if (value) { + if (this.ui.numericEdit) { + value = parseFloat(value); + value = isNaN(value) ? "" : value.toString(); + } + if (ui.children[0].name === "textarea") { + ui.children[0].attributes.textContent = value; + } else { + ui.children[0].attributes.value = value; + } + } + } + } + if (!this.ui.imageEdit && ui.children?.[0] && this.h) { + borderDims = borderDims || getBorderDims(this.ui[$getExtra]()); + let captionHeight = 0; + if (this.caption && ["top", "bottom"].includes(this.caption.placement)) { + captionHeight = this.caption.reserve; + if (captionHeight <= 0) { + captionHeight = this.caption[$getExtra](availableSpace).h; + } + const inputHeight = this.h - captionHeight - marginV - borderDims.h; + ui.children[0].attributes.style.height = measureToString(inputHeight); + } else { + ui.children[0].attributes.style.height = "100%"; + } + } + if (aElement) { + ui.children.push(aElement); + } + if (!caption) { + if (ui.attributes.class) { + ui.attributes.class.push("xfaLeft"); + } + this.w = savedW; + this.h = savedH; + return HTMLResult.success(createWrapper(this, html), bbox); + } + if (this.ui.button) { + if (style.padding) { + delete style.padding; + } + if (caption.name === "div") { + caption.name = "span"; + } + ui.children.push(caption); + return HTMLResult.success(html, bbox); + } else if (this.ui.checkButton) { + caption.attributes.class[0] = "xfaCaptionForCheckButton"; + } + ui.attributes.class ||= []; + ui.children.splice(0, 0, caption); + switch (this.caption.placement) { + case "left": + ui.attributes.class.push("xfaLeft"); + break; + case "right": + ui.attributes.class.push("xfaRight"); + break; + case "top": + ui.attributes.class.push("xfaTop"); + break; + case "bottom": + ui.attributes.class.push("xfaBottom"); + break; + case "inline": + ui.attributes.class.push("xfaLeft"); + break; + } + this.w = savedW; + this.h = savedH; + return HTMLResult.success(createWrapper(this, html), bbox); + } +} +class Fill extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "fill", true); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + this.linear = null; + this.pattern = null; + this.radial = null; + this.solid = null; + this.stipple = null; + } + [$toStyle]() { + const parent = this[$getParent](); + const grandpa = parent[$getParent](); + const ggrandpa = grandpa[$getParent](); + const style = Object.create(null); + let propName = "color"; + let altPropName = propName; + if (parent instanceof Border) { + propName = "background-color"; + altPropName = "background"; + if (ggrandpa instanceof Ui) { + style.backgroundColor = "white"; + } + } + if (parent instanceof Rectangle || parent instanceof Arc) { + propName = altPropName = "fill"; + style.fill = "white"; + } + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "extras" || name === "color") { + continue; + } + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + const color = obj[$toStyle](this.color); + if (color) { + style[color.startsWith("#") ? propName : altPropName] = color; + } + return style; + } + if (this.color?.value) { + const color = this.color[$toStyle](); + style[color.startsWith("#") ? propName : altPropName] = color; + } + return style; + } +} +class Filter extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "filter", true); + this.addRevocationInfo = getStringOption(attributes.addRevocationInfo, ["", "required", "optional", "none"]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.version = getInteger({ + data: this.version, + defaultValue: 5, + validate: x => x >= 1 && x <= 5 + }); + this.appearanceFilter = null; + this.certificates = null; + this.digestMethods = null; + this.encodings = null; + this.encryptionMethods = null; + this.handler = null; + this.lockDocument = null; + this.mdp = null; + this.reasons = null; + this.timeStamp = null; + } +} +class Float extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "float"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const number = parseFloat(this[$content].trim()); + this[$content] = isNaN(number) ? null : number; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); + } +} +class template_Font extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "font", true); + this.baselineShift = getMeasurement(attributes.baselineShift); + this.fontHorizontalScale = getFloat({ + data: attributes.fontHorizontalScale, + defaultValue: 100, + validate: x => x >= 0 + }); + this.fontVerticalScale = getFloat({ + data: attributes.fontVerticalScale, + defaultValue: 100, + validate: x => x >= 0 + }); + this.id = attributes.id || ""; + this.kerningMode = getStringOption(attributes.kerningMode, ["none", "pair"]); + this.letterSpacing = getMeasurement(attributes.letterSpacing, "0"); + this.lineThrough = getInteger({ + data: attributes.lineThrough, + defaultValue: 0, + validate: x => x === 1 || x === 2 + }); + this.lineThroughPeriod = getStringOption(attributes.lineThroughPeriod, ["all", "word"]); + this.overline = getInteger({ + data: attributes.overline, + defaultValue: 0, + validate: x => x === 1 || x === 2 + }); + this.overlinePeriod = getStringOption(attributes.overlinePeriod, ["all", "word"]); + this.posture = getStringOption(attributes.posture, ["normal", "italic"]); + this.size = getMeasurement(attributes.size, "10pt"); + this.typeface = attributes.typeface || "Courier"; + this.underline = getInteger({ + data: attributes.underline, + defaultValue: 0, + validate: x => x === 1 || x === 2 + }); + this.underlinePeriod = getStringOption(attributes.underlinePeriod, ["all", "word"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.weight = getStringOption(attributes.weight, ["normal", "bold"]); + this.extras = null; + this.fill = null; + } + [$clean](builder) { + super[$clean](builder); + this[$globalData].usedTypefaces.add(this.typeface); + } + [$toStyle]() { + const style = toStyle(this, "fill"); + const color = style.color; + if (color) { + if (color === "#000000") { + delete style.color; + } else if (!color.startsWith("#")) { + style.background = color; + style.backgroundClip = "text"; + style.color = "transparent"; + } + } + if (this.baselineShift) { + style.verticalAlign = measureToString(this.baselineShift); + } + style.fontKerning = this.kerningMode === "none" ? "none" : "normal"; + style.letterSpacing = measureToString(this.letterSpacing); + if (this.lineThrough !== 0) { + style.textDecoration = "line-through"; + if (this.lineThrough === 2) { + style.textDecorationStyle = "double"; + } + } + if (this.overline !== 0) { + style.textDecoration = "overline"; + if (this.overline === 2) { + style.textDecorationStyle = "double"; + } + } + style.fontStyle = this.posture; + style.fontSize = measureToString(0.99 * this.size); + setFontFamily(this, this, this[$globalData].fontFinder, style); + if (this.underline !== 0) { + style.textDecoration = "underline"; + if (this.underline === 2) { + style.textDecorationStyle = "double"; + } + } + style.fontWeight = this.weight; + return style; + } +} +class Format extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "format", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.picture = null; + } +} +class Handler extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "handler"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Hyphenation extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "hyphenation"); + this.excludeAllCaps = getInteger({ + data: attributes.excludeAllCaps, + defaultValue: 0, + validate: x => x === 1 + }); + this.excludeInitialCap = getInteger({ + data: attributes.excludeInitialCap, + defaultValue: 0, + validate: x => x === 1 + }); + this.hyphenate = getInteger({ + data: attributes.hyphenate, + defaultValue: 0, + validate: x => x === 1 + }); + this.id = attributes.id || ""; + this.pushCharacterCount = getInteger({ + data: attributes.pushCharacterCount, + defaultValue: 3, + validate: x => x >= 0 + }); + this.remainCharacterCount = getInteger({ + data: attributes.remainCharacterCount, + defaultValue: 3, + validate: x => x >= 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.wordCharacterCount = getInteger({ + data: attributes.wordCharacterCount, + defaultValue: 7, + validate: x => x >= 0 + }); + } +} +class Image extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "image"); + this.aspect = getStringOption(attributes.aspect, ["fit", "actual", "height", "none", "width"]); + this.contentType = attributes.contentType || ""; + this.href = attributes.href || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.transferEncoding = getStringOption(attributes.transferEncoding, ["base64", "none", "package"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$toHTML]() { + if (this.contentType && !MIMES.has(this.contentType.toLowerCase())) { + return HTMLResult.EMPTY; + } + let buffer = this[$globalData].images?.get(this.href); + if (!buffer && (this.href || !this[$content])) { + return HTMLResult.EMPTY; + } + if (!buffer && this.transferEncoding === "base64") { + buffer = fromBase64Util(this[$content]); + } + if (!buffer) { + return HTMLResult.EMPTY; + } + if (!this.contentType) { + for (const [header, type] of IMAGES_HEADERS) { + if (buffer.length > header.length && header.every((x, i) => x === buffer[i])) { + this.contentType = type; + break; + } + } + if (!this.contentType) { + return HTMLResult.EMPTY; + } + } + const blob = new Blob([buffer], { + type: this.contentType + }); + let style; + switch (this.aspect) { + case "fit": + case "actual": + break; + case "height": + style = { + height: "100%", + objectFit: "fill" + }; + break; + case "none": + style = { + width: "100%", + height: "100%", + objectFit: "fill" + }; + break; + case "width": + style = { + width: "100%", + objectFit: "fill" + }; + break; + } + const parent = this[$getParent](); + return HTMLResult.success({ + name: "img", + attributes: { + class: ["xfaImage"], + style, + src: URL.createObjectURL(blob), + alt: parent ? ariaLabel(parent[$getParent]()) : null + } + }); + } +} +class ImageEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "imageEdit", true); + this.data = getStringOption(attributes.data, ["link", "embed"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + if (this.data === "embed") { + return HTMLResult.success({ + name: "div", + children: [], + attributes: {} + }); + } + return HTMLResult.EMPTY; + } +} +class Integer extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "integer"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const number = parseInt(this[$content].trim(), 10); + this[$content] = isNaN(number) ? null : number; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); + } +} +class Issuers extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "issuers", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = new XFAObjectArray(); + } +} +class Items extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "items", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.ref = attributes.ref || ""; + this.save = getInteger({ + data: attributes.save, + defaultValue: 0, + validate: x => x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } + [$toHTML]() { + const output = []; + for (const child of this[$getChildren]()) { + output.push(child[$text]()); + } + return HTMLResult.success(output); + } +} +class Keep extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "keep", true); + this.id = attributes.id || ""; + const options = ["none", "contentArea", "pageArea"]; + this.intact = getStringOption(attributes.intact, options); + this.next = getStringOption(attributes.next, options); + this.previous = getStringOption(attributes.previous, options); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } +} +class KeyUsage extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "keyUsage"); + const options = ["", "yes", "no"]; + this.crlSign = getStringOption(attributes.crlSign, options); + this.dataEncipherment = getStringOption(attributes.dataEncipherment, options); + this.decipherOnly = getStringOption(attributes.decipherOnly, options); + this.digitalSignature = getStringOption(attributes.digitalSignature, options); + this.encipherOnly = getStringOption(attributes.encipherOnly, options); + this.id = attributes.id || ""; + this.keyAgreement = getStringOption(attributes.keyAgreement, options); + this.keyCertSign = getStringOption(attributes.keyCertSign, options); + this.keyEncipherment = getStringOption(attributes.keyEncipherment, options); + this.nonRepudiation = getStringOption(attributes.nonRepudiation, options); + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Line extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "line", true); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.slope = getStringOption(attributes.slope, ["\\", "/"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.edge = null; + } + [$toHTML]() { + const parent = this[$getParent]()[$getParent](); + const edge = this.edge || new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + const thickness = edge.presence === "visible" ? edge.thickness : 0; + style.strokeWidth = measureToString(thickness); + style.stroke = edgeStyle.color; + let x1, y1, x2, y2; + let width = "100%"; + let height = "100%"; + if (parent.w <= thickness) { + [x1, y1, x2, y2] = ["50%", 0, "50%", "100%"]; + width = style.strokeWidth; + } else if (parent.h <= thickness) { + [x1, y1, x2, y2] = [0, "50%", "100%", "50%"]; + height = style.strokeWidth; + } else if (this.slope === "\\") { + [x1, y1, x2, y2] = [0, 0, "100%", "100%"]; + } else { + [x1, y1, x2, y2] = [0, "100%", "100%", 0]; + } + const line = { + name: "line", + attributes: { + xmlns: SVG_NS, + x1, + y1, + x2, + y2, + style + } + }; + const svg = { + name: "svg", + children: [line], + attributes: { + xmlns: SVG_NS, + width, + height, + style: { + overflow: "visible" + } + } + }; + if (hasMargin(parent)) { + return HTMLResult.success({ + name: "div", + attributes: { + style: { + display: "inline", + width: "100%", + height: "100%" + } + }, + children: [svg] + }); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); + } +} +class Linear extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "linear", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["toRight", "toBottom", "toLeft", "toTop"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const transf = this.type.replace(/([RBLT])/, " $1").toLowerCase(); + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + return `linear-gradient(${transf}, ${startColor}, ${endColor})`; + } +} +class LockDocument extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "lockDocument"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + this[$content] = getStringOption(this[$content], ["auto", "0", "1"]); + } +} +class Manifest extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "manifest", true); + this.action = getStringOption(attributes.action, ["include", "all", "exclude"]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.ref = new XFAObjectArray(); + } +} +class Margin extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "margin", true); + this.bottomInset = getMeasurement(attributes.bottomInset, "0"); + this.id = attributes.id || ""; + this.leftInset = getMeasurement(attributes.leftInset, "0"); + this.rightInset = getMeasurement(attributes.rightInset, "0"); + this.topInset = getMeasurement(attributes.topInset, "0"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$toStyle]() { + return { + margin: measureToString(this.topInset) + " " + measureToString(this.rightInset) + " " + measureToString(this.bottomInset) + " " + measureToString(this.leftInset) + }; + } +} +class Mdp extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "mdp"); + this.id = attributes.id || ""; + this.permissions = getInteger({ + data: attributes.permissions, + defaultValue: 2, + validate: x => x === 1 || x === 3 + }); + this.signatureType = getStringOption(attributes.signatureType, ["filler", "author"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Medium extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "medium"); + this.id = attributes.id || ""; + this.imagingBBox = getBBox(attributes.imagingBBox); + this.long = getMeasurement(attributes.long); + this.orientation = getStringOption(attributes.orientation, ["portrait", "landscape"]); + this.short = getMeasurement(attributes.short); + this.stock = attributes.stock || ""; + this.trayIn = getStringOption(attributes.trayIn, ["auto", "delegate", "pageFront"]); + this.trayOut = getStringOption(attributes.trayOut, ["auto", "delegate"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Message extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "message", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.text = new XFAObjectArray(); + } +} +class NumericEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "numericEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.comb = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + const field = this[$getParent]()[$getParent](); + const html = { + name: "input", + attributes: { + type: "text", + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [html] + }); + } +} +class Occur extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "occur", true); + this.id = attributes.id || ""; + this.initial = attributes.initial !== "" ? getInteger({ + data: attributes.initial, + defaultValue: "", + validate: x => true + }) : ""; + this.max = attributes.max !== "" ? getInteger({ + data: attributes.max, + defaultValue: -1, + validate: x => true + }) : ""; + this.min = attributes.min !== "" ? getInteger({ + data: attributes.min, + defaultValue: 1, + validate: x => true + }) : ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$clean]() { + const parent = this[$getParent](); + const originalMin = this.min; + if (this.min === "") { + this.min = parent instanceof PageArea || parent instanceof PageSet ? 0 : 1; + } + if (this.max === "") { + if (originalMin === "") { + this.max = parent instanceof PageArea || parent instanceof PageSet ? -1 : 1; + } else { + this.max = this.min; + } + } + if (this.max !== -1 && this.max < this.min) { + this.max = this.min; + } + if (this.initial === "") { + this.initial = parent instanceof Template ? 1 : this.min; + } + } +} +class Oid extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "oid"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Oids extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "oids", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.oid = new XFAObjectArray(); + } +} +class Overflow extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "overflow"); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.target = attributes.target || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$getExtra]() { + if (!this[$extra]) { + const parent = this[$getParent](); + const root = this[$getTemplateRoot](); + const target = root[$searchNode](this.target, parent); + const leader = root[$searchNode](this.leader, parent); + const trailer = root[$searchNode](this.trailer, parent); + this[$extra] = { + target: target?.[0] || null, + leader: leader?.[0] || null, + trailer: trailer?.[0] || null, + addLeader: false, + addTrailer: false + }; + } + return this[$extra]; + } +} +class PageArea extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "pageArea", true); + this.blankOrNotBlank = getStringOption(attributes.blankOrNotBlank, ["any", "blank", "notBlank"]); + this.id = attributes.id || ""; + this.initialNumber = getInteger({ + data: attributes.initialNumber, + defaultValue: 1, + validate: x => true + }); + this.name = attributes.name || ""; + this.numbered = getInteger({ + data: attributes.numbered, + defaultValue: 1, + validate: x => true + }); + this.oddOrEven = getStringOption(attributes.oddOrEven, ["any", "even", "odd"]); + this.pagePosition = getStringOption(attributes.pagePosition, ["any", "first", "last", "only", "rest"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.desc = null; + this.extras = null; + this.medium = null; + this.occur = null; + this.area = new XFAObjectArray(); + this.contentArea = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + } + [$isUsable]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 0 + }; + return true; + } + return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max; + } + [$cleanPage]() { + delete this[$extra]; + } + [$getNextPage]() { + this[$extra] ||= { + numberOfUse: 0 + }; + const parent = this[$getParent](); + if (parent.relation === "orderedOccurrence") { + if (this[$isUsable]()) { + this[$extra].numberOfUse += 1; + return this; + } + } + return parent[$getNextPage](); + } + [$getAvailableSpace]() { + return this[$extra].space || { + width: 0, + height: 0 + }; + } + [$toHTML]() { + this[$extra] ||= { + numberOfUse: 1 + }; + const children = []; + this[$extra].children = children; + const style = Object.create(null); + if (this.medium && this.medium.short && this.medium.long) { + style.width = measureToString(this.medium.short); + style.height = measureToString(this.medium.long); + this[$extra].space = { + width: this.medium.short, + height: this.medium.long + }; + if (this.medium.orientation === "landscape") { + const x = style.width; + style.width = style.height; + style.height = x; + this[$extra].space = { + width: this.medium.long, + height: this.medium.short + }; + } + } else { + warn("XFA - No medium specified in pageArea: please file a bug."); + } + this[$childrenToHTML]({ + filter: new Set(["area", "draw", "field", "subform"]), + include: true + }); + this[$childrenToHTML]({ + filter: new Set(["contentArea"]), + include: true + }); + return HTMLResult.success({ + name: "div", + children, + attributes: { + class: ["xfaPage"], + id: this[$uid], + style, + xfaName: this.name + } + }); + } +} +class PageSet extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "pageSet", true); + this.duplexImposition = getStringOption(attributes.duplexImposition, ["longEdge", "shortEdge"]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relation = getStringOption(attributes.relation, ["orderedOccurrence", "duplexPaginated", "simplexPaginated"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.occur = null; + this.pageArea = new XFAObjectArray(); + this.pageSet = new XFAObjectArray(); + } + [$cleanPage]() { + for (const page of this.pageArea.children) { + page[$cleanPage](); + } + for (const page of this.pageSet.children) { + page[$cleanPage](); + } + } + [$isUsable]() { + return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max; + } + [$getNextPage]() { + this[$extra] ||= { + numberOfUse: 1, + pageIndex: -1, + pageSetIndex: -1 + }; + if (this.relation === "orderedOccurrence") { + if (this[$extra].pageIndex + 1 < this.pageArea.children.length) { + this[$extra].pageIndex += 1; + const pageArea = this.pageArea.children[this[$extra].pageIndex]; + return pageArea[$getNextPage](); + } + if (this[$extra].pageSetIndex + 1 < this.pageSet.children.length) { + this[$extra].pageSetIndex += 1; + return this.pageSet.children[this[$extra].pageSetIndex][$getNextPage](); + } + if (this[$isUsable]()) { + this[$extra].numberOfUse += 1; + this[$extra].pageIndex = -1; + this[$extra].pageSetIndex = -1; + return this[$getNextPage](); + } + const parent = this[$getParent](); + if (parent instanceof PageSet) { + return parent[$getNextPage](); + } + this[$cleanPage](); + return this[$getNextPage](); + } + const pageNumber = this[$getTemplateRoot]()[$extra].pageNumber; + const parity = pageNumber % 2 === 0 ? "even" : "odd"; + const position = pageNumber === 0 ? "first" : "rest"; + let page = this.pageArea.children.find(p => p.oddOrEven === parity && p.pagePosition === position); + if (page) { + return page; + } + page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === position); + if (page) { + return page; + } + page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === "any"); + if (page) { + return page; + } + return this.pageArea.children[0]; + } +} +class Para extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "para", true); + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.lineHeight = attributes.lineHeight ? getMeasurement(attributes.lineHeight, "0pt") : ""; + this.marginLeft = attributes.marginLeft ? getMeasurement(attributes.marginLeft, "0pt") : ""; + this.marginRight = attributes.marginRight ? getMeasurement(attributes.marginRight, "0pt") : ""; + this.orphans = getInteger({ + data: attributes.orphans, + defaultValue: 0, + validate: x => x >= 0 + }); + this.preserve = attributes.preserve || ""; + this.radixOffset = attributes.radixOffset ? getMeasurement(attributes.radixOffset, "0pt") : ""; + this.spaceAbove = attributes.spaceAbove ? getMeasurement(attributes.spaceAbove, "0pt") : ""; + this.spaceBelow = attributes.spaceBelow ? getMeasurement(attributes.spaceBelow, "0pt") : ""; + this.tabDefault = attributes.tabDefault ? getMeasurement(this.tabDefault) : ""; + this.tabStops = (attributes.tabStops || "").trim().split(/\s+/).map((x, i) => i % 2 === 1 ? getMeasurement(x) : x); + this.textIndent = attributes.textIndent ? getMeasurement(attributes.textIndent, "0pt") : ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.vAlign = getStringOption(attributes.vAlign, ["top", "bottom", "middle"]); + this.widows = getInteger({ + data: attributes.widows, + defaultValue: 0, + validate: x => x >= 0 + }); + this.hyphenation = null; + } + [$toStyle]() { + const style = toStyle(this, "hAlign"); + if (this.marginLeft !== "") { + style.paddingLeft = measureToString(this.marginLeft); + } + if (this.marginRight !== "") { + style.paddingRight = measureToString(this.marginRight); + } + if (this.spaceAbove !== "") { + style.paddingTop = measureToString(this.spaceAbove); + } + if (this.spaceBelow !== "") { + style.paddingBottom = measureToString(this.spaceBelow); + } + if (this.textIndent !== "") { + style.textIndent = measureToString(this.textIndent); + fixTextIndent(style); + } + if (this.lineHeight > 0) { + style.lineHeight = measureToString(this.lineHeight); + } + if (this.tabDefault !== "") { + style.tabSize = measureToString(this.tabDefault); + } + if (this.tabStops.length > 0) {} + if (this.hyphenatation) { + Object.assign(style, this.hyphenatation[$toStyle]()); + } + return style; + } +} +class PasswordEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "passwordEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.passwordChar = attributes.passwordChar || "*"; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } +} +class template_Pattern extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "pattern", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["crossHatch", "crossDiagonal", "diagonalLeft", "diagonalRight", "horizontal", "vertical"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + const width = 5; + const cmd = "repeating-linear-gradient"; + const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width}px`; + switch (this.type) { + case "crossHatch": + return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`; + case "crossDiagonal": + return `${cmd}(45deg,${colors}) ${cmd}(-45deg,${colors})`; + case "diagonalLeft": + return `${cmd}(45deg,${colors})`; + case "diagonalRight": + return `${cmd}(-45deg,${colors})`; + case "horizontal": + return `${cmd}(to top,${colors})`; + case "vertical": + return `${cmd}(to right,${colors})`; + } + return ""; + } +} +class Picture extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "picture"); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Proto extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "proto", true); + this.appearanceFilter = new XFAObjectArray(); + this.arc = new XFAObjectArray(); + this.area = new XFAObjectArray(); + this.assist = new XFAObjectArray(); + this.barcode = new XFAObjectArray(); + this.bindItems = new XFAObjectArray(); + this.bookend = new XFAObjectArray(); + this.boolean = new XFAObjectArray(); + this.border = new XFAObjectArray(); + this.break = new XFAObjectArray(); + this.breakAfter = new XFAObjectArray(); + this.breakBefore = new XFAObjectArray(); + this.button = new XFAObjectArray(); + this.calculate = new XFAObjectArray(); + this.caption = new XFAObjectArray(); + this.certificate = new XFAObjectArray(); + this.certificates = new XFAObjectArray(); + this.checkButton = new XFAObjectArray(); + this.choiceList = new XFAObjectArray(); + this.color = new XFAObjectArray(); + this.comb = new XFAObjectArray(); + this.connect = new XFAObjectArray(); + this.contentArea = new XFAObjectArray(); + this.corner = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.dateTimeEdit = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.defaultUi = new XFAObjectArray(); + this.desc = new XFAObjectArray(); + this.digestMethod = new XFAObjectArray(); + this.digestMethods = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.edge = new XFAObjectArray(); + this.encoding = new XFAObjectArray(); + this.encodings = new XFAObjectArray(); + this.encrypt = new XFAObjectArray(); + this.encryptData = new XFAObjectArray(); + this.encryption = new XFAObjectArray(); + this.encryptionMethod = new XFAObjectArray(); + this.encryptionMethods = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.execute = new XFAObjectArray(); + this.extras = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.fill = new XFAObjectArray(); + this.filter = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.font = new XFAObjectArray(); + this.format = new XFAObjectArray(); + this.handler = new XFAObjectArray(); + this.hyphenation = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.imageEdit = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.issuers = new XFAObjectArray(); + this.items = new XFAObjectArray(); + this.keep = new XFAObjectArray(); + this.keyUsage = new XFAObjectArray(); + this.line = new XFAObjectArray(); + this.linear = new XFAObjectArray(); + this.lockDocument = new XFAObjectArray(); + this.manifest = new XFAObjectArray(); + this.margin = new XFAObjectArray(); + this.mdp = new XFAObjectArray(); + this.medium = new XFAObjectArray(); + this.message = new XFAObjectArray(); + this.numericEdit = new XFAObjectArray(); + this.occur = new XFAObjectArray(); + this.oid = new XFAObjectArray(); + this.oids = new XFAObjectArray(); + this.overflow = new XFAObjectArray(); + this.pageArea = new XFAObjectArray(); + this.pageSet = new XFAObjectArray(); + this.para = new XFAObjectArray(); + this.passwordEdit = new XFAObjectArray(); + this.pattern = new XFAObjectArray(); + this.picture = new XFAObjectArray(); + this.radial = new XFAObjectArray(); + this.reason = new XFAObjectArray(); + this.reasons = new XFAObjectArray(); + this.rectangle = new XFAObjectArray(); + this.ref = new XFAObjectArray(); + this.script = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + this.signData = new XFAObjectArray(); + this.signature = new XFAObjectArray(); + this.signing = new XFAObjectArray(); + this.solid = new XFAObjectArray(); + this.speak = new XFAObjectArray(); + this.stipple = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + this.subjectDN = new XFAObjectArray(); + this.subjectDNs = new XFAObjectArray(); + this.submit = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.textEdit = new XFAObjectArray(); + this.time = new XFAObjectArray(); + this.timeStamp = new XFAObjectArray(); + this.toolTip = new XFAObjectArray(); + this.traversal = new XFAObjectArray(); + this.traverse = new XFAObjectArray(); + this.ui = new XFAObjectArray(); + this.validate = new XFAObjectArray(); + this.value = new XFAObjectArray(); + this.variables = new XFAObjectArray(); + } +} +class Radial extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "radial", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["toEdge", "toCenter"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + const colors = this.type === "toEdge" ? `${startColor},${endColor}` : `${endColor},${startColor}`; + return `radial-gradient(circle at center, ${colors})`; + } +} +class Reason extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "reason"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Reasons extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "reasons", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.reason = new XFAObjectArray(); + } +} +class Rectangle extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "rectangle", true); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.corner = new XFAObjectArray(4); + this.edge = new XFAObjectArray(4); + this.fill = null; + } + [$toHTML]() { + const edge = this.edge.children.length ? this.edge.children[0] : new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } else { + style.fill = "transparent"; + } + style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0); + style.stroke = edgeStyle.color; + const corner = this.corner.children.length ? this.corner.children[0] : new Corner({}); + const cornerStyle = corner[$toStyle](); + const rect = { + name: "rect", + attributes: { + xmlns: SVG_NS, + width: "100%", + height: "100%", + x: 0, + y: 0, + rx: cornerStyle.radius, + ry: cornerStyle.radius, + style + } + }; + const svg = { + name: "svg", + children: [rect], + attributes: { + xmlns: SVG_NS, + style: { + overflow: "visible" + }, + width: "100%", + height: "100%" + } + }; + const parent = this[$getParent]()[$getParent](); + if (hasMargin(parent)) { + return HTMLResult.success({ + name: "div", + attributes: { + style: { + display: "inline", + width: "100%", + height: "100%" + } + }, + children: [svg] + }); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); + } +} +class RefElement extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "ref"); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Script extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "script"); + this.binding = attributes.binding || ""; + this.contentType = attributes.contentType || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class SetProperty extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "setProperty"); + this.connection = attributes.connection || ""; + this.ref = attributes.ref || ""; + this.target = attributes.target || ""; + } +} +class SignData extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "signData", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, ["sign", "clear", "verify"]); + this.ref = attributes.ref || ""; + this.target = attributes.target || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.filter = null; + this.manifest = null; + } +} +class Signature extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "signature", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["PDF1.3", "PDF1.6"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.filter = null; + this.manifest = null; + this.margin = null; + } +} +class Signing extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "signing", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = new XFAObjectArray(); + } +} +class Solid extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "solid", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$toStyle](startColor) { + return startColor ? startColor[$toStyle]() : "#FFFFFF"; + } +} +class Speak extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "speak"); + this.disable = getInteger({ + data: attributes.disable, + defaultValue: 0, + validate: x => x === 1 + }); + this.id = attributes.id || ""; + this.priority = getStringOption(attributes.priority, ["custom", "caption", "name", "toolTip"]); + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Stipple extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "stipple", true); + this.id = attributes.id || ""; + this.rate = getInteger({ + data: attributes.rate, + defaultValue: 50, + validate: x => x >= 0 && x <= 100 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](bgColor) { + const alpha = this.rate / 100; + return Util.makeHexColor(Math.round(bgColor.value.r * (1 - alpha) + this.value.r * alpha), Math.round(bgColor.value.g * (1 - alpha) + this.value.g * alpha), Math.round(bgColor.value.b * (1 - alpha) + this.value.b * alpha)); + } +} +class Subform extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subform", true); + this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); + this.allowMacro = getInteger({ + data: attributes.allowMacro, + defaultValue: 0, + validate: x => x === 1 + }); + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.columnWidths = (attributes.columnWidths || "").trim().split(/\s+/).map(x => x === "-1" ? -1 : getMeasurement(x)); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]); + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.mergeMode = getStringOption(attributes.mergeMode, ["consumeData", "matchTemplate"]); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.restoreState = getStringOption(attributes.restoreState, ["manual", "auto"]); + this.scope = getStringOption(attributes.scope, ["name", "none"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.bind = null; + this.bookend = null; + this.border = null; + this.break = null; + this.calculate = null; + this.desc = null; + this.extras = null; + this.keep = null; + this.margin = null; + this.occur = null; + this.overflow = null; + this.pageSet = null; + this.para = null; + this.traversal = null; + this.validate = null; + this.variables = null; + this.area = new XFAObjectArray(); + this.breakAfter = new XFAObjectArray(); + this.breakBefore = new XFAObjectArray(); + this.connect = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.proto = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + } + [$getSubformParent]() { + const parent = this[$getParent](); + if (parent instanceof SubformSet) { + return parent[$getSubformParent](); + } + return parent; + } + [$isBindable]() { + return true; + } + [$isThereMoreWidth]() { + return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth](); + } + *[$getContainedChildren]() { + yield* getContainedChildren(this); + } + [$flushHTML]() { + return flushHTML(this); + } + [$addHTML](html, bbox) { + addHTML(this, html, bbox); + } + [$getAvailableSpace]() { + return getAvailableSpace(this); + } + [$isSplittable]() { + const parent = this[$getSubformParent](); + if (!parent[$isSplittable]()) { + return false; + } + if (this[$extra]._isSplittable !== undefined) { + return this[$extra]._isSplittable; + } + if (this.layout === "position" || this.layout.includes("row")) { + this[$extra]._isSplittable = false; + return false; + } + if (this.keep && this.keep.intact !== "none") { + this[$extra]._isSplittable = false; + return false; + } + if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { + return false; + } + this[$extra]._isSplittable = true; + return true; + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (this.break) { + if (this.break.after !== "auto" || this.break.afterTarget !== "") { + const node = new BreakAfter({ + targetType: this.break.after, + target: this.break.afterTarget, + startNew: this.break.startNew.toString() + }); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.breakAfter.push(node); + } + if (this.break.before !== "auto" || this.break.beforeTarget !== "") { + const node = new BreakBefore({ + targetType: this.break.before, + target: this.break.beforeTarget, + startNew: this.break.startNew.toString() + }); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.breakBefore.push(node); + } + if (this.break.overflowTarget !== "") { + const node = new Overflow({ + target: this.break.overflowTarget, + leader: this.break.overflowLeader, + trailer: this.break.overflowTrailer + }); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.overflow.push(node); + } + this[$removeChild](this.break); + this.break = null; + } + if (this.presence === "hidden" || this.presence === "inactive") { + return HTMLResult.EMPTY; + } + if (this.breakBefore.children.length > 1 || this.breakAfter.children.length > 1) { + warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug."); + } + if (this.breakBefore.children.length >= 1) { + const breakBefore = this.breakBefore.children[0]; + if (handleBreak(breakBefore)) { + return HTMLResult.breakNode(breakBefore); + } + } + if (this[$extra]?.afterBreakAfter) { + return HTMLResult.EMPTY; + } + fixDimensions(this); + const children = []; + const attributes = { + id: this[$uid], + class: [] + }; + setAccess(this, attributes.class); + this[$extra] ||= Object.create(null); + Object.assign(this[$extra], { + children, + line: null, + attributes, + attempt: 0, + numberInLine: 0, + availableSpace: { + width: Math.min(this.w || Infinity, availableSpace.width), + height: Math.min(this.h || Infinity, availableSpace.height) + }, + width: 0, + height: 0, + prevHeight: 0, + currentWidth: 0 + }); + const root = this[$getTemplateRoot](); + const savedNoLayoutFailure = root[$extra].noLayoutFailure; + const isSplittable = this[$isSplittable](); + if (!isSplittable) { + setFirstUnsplittable(this); + } + if (!checkDimensions(this, availableSpace)) { + return HTMLResult.FAILURE; + } + const filter = new Set(["area", "draw", "exclGroup", "field", "subform", "subformSet"]); + if (this.layout.includes("row")) { + const columnWidths = this[$getSubformParent]().columnWidths; + if (Array.isArray(columnWidths) && columnWidths.length > 0) { + this[$extra].columnWidths = columnWidths; + this[$extra].currentColumn = 0; + } + } + const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"); + const classNames = ["xfaSubform"]; + const cl = layoutClass(this); + if (cl) { + classNames.push(cl); + } + attributes.style = style; + attributes.class = classNames; + if (this.name) { + attributes.xfaName = this.name; + } + if (this.overflow) { + const overflowExtra = this.overflow[$getExtra](); + if (overflowExtra.addLeader) { + overflowExtra.addLeader = false; + handleOverflow(this, overflowExtra.leader, availableSpace); + } + } + this[$pushPara](); + const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; + const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; + for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { + if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { + this[$extra].numberInLine = 0; + } + const result = this[$childrenToHTML]({ + filter, + include: true + }); + if (result.success) { + break; + } + if (result.isBreak()) { + this[$popPara](); + return result; + } + if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !root[$extra].noLayoutFailure) { + this[$extra].attempt = maxRun; + break; + } + } + this[$popPara](); + if (!isSplittable) { + unsetFirstUnsplittable(this); + } + root[$extra].noLayoutFailure = savedNoLayoutFailure; + if (this[$extra].attempt === maxRun) { + if (this.overflow) { + this[$getTemplateRoot]()[$extra].overflowNode = this.overflow; + } + if (!isSplittable) { + delete this[$extra]; + } + return HTMLResult.FAILURE; + } + if (this.overflow) { + const overflowExtra = this.overflow[$getExtra](); + if (overflowExtra.addTrailer) { + overflowExtra.addTrailer = false; + handleOverflow(this, overflowExtra.trailer, availableSpace); + } + } + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + const width = Math.max(this[$extra].width + marginH, this.w || 0); + const height = Math.max(this[$extra].height + marginV, this.h || 0); + const bbox = [this.x, this.y, width, height]; + if (this.w === "") { + style.width = measureToString(width); + } + if (this.h === "") { + style.height = measureToString(height); + } + if ((style.width === "0px" || style.height === "0px") && children.length === 0) { + return HTMLResult.EMPTY; + } + const html = { + name: "div", + attributes, + children + }; + applyAssist(this, attributes); + const result = HTMLResult.success(createWrapper(this, html), bbox); + if (this.breakAfter.children.length >= 1) { + const breakAfter = this.breakAfter.children[0]; + if (handleBreak(breakAfter)) { + this[$extra].afterBreakAfter = result; + return HTMLResult.breakNode(breakAfter); + } + } + delete this[$extra]; + return result; + } +} +class SubformSet extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subformSet", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relation = getStringOption(attributes.relation, ["ordered", "choice", "unordered"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.bookend = null; + this.break = null; + this.desc = null; + this.extras = null; + this.occur = null; + this.overflow = null; + this.breakAfter = new XFAObjectArray(); + this.breakBefore = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + } + *[$getContainedChildren]() { + yield* getContainedChildren(this); + } + [$getSubformParent]() { + let parent = this[$getParent](); + while (!(parent instanceof Subform)) { + parent = parent[$getParent](); + } + return parent; + } + [$isBindable]() { + return true; + } +} +class SubjectDN extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subjectDN"); + this.delimiter = attributes.delimiter || ","; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + this[$content] = new Map(this[$content].split(this.delimiter).map(kv => { + kv = kv.split("=", 2); + kv[0] = kv[0].trim(); + return kv; + })); + } +} +class SubjectDNs extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subjectDNs", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.subjectDN = new XFAObjectArray(); + } +} +class Submit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "submit", true); + this.embedPDF = getInteger({ + data: attributes.embedPDF, + defaultValue: 0, + validate: x => x === 1 + }); + this.format = getStringOption(attributes.format, ["xdp", "formdata", "pdf", "urlencoded", "xfd", "xml"]); + this.id = attributes.id || ""; + this.target = attributes.target || ""; + this.textEncoding = getKeyword({ + data: attributes.textEncoding ? attributes.textEncoding.toLowerCase() : "", + defaultValue: "", + validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/) + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.xdpContent = attributes.xdpContent || ""; + this.encrypt = null; + this.encryptData = new XFAObjectArray(); + this.signData = new XFAObjectArray(); + } +} +class Template extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "template", true); + this.baseProfile = getStringOption(attributes.baseProfile, ["full", "interactiveForms"]); + this.extras = null; + this.subform = new XFAObjectArray(); + } + [$finalize]() { + if (this.subform.children.length === 0) { + warn("XFA - No subforms in template node."); + } + if (this.subform.children.length >= 2) { + warn("XFA - Several subforms in template node: please file a bug."); + } + this[$tabIndex] = DEFAULT_TAB_INDEX; + } + [$isSplittable]() { + return true; + } + [$searchNode](expr, container) { + if (expr.startsWith("#")) { + return [this[$ids].get(expr.slice(1))]; + } + return searchNode(this, container, expr, true, true); + } + *[$toPages]() { + if (!this.subform.children.length) { + return HTMLResult.success({ + name: "div", + children: [] + }); + } + this[$extra] = { + overflowNode: null, + firstUnsplittable: null, + currentContentArea: null, + currentPageArea: null, + noLayoutFailure: false, + pageNumber: 1, + pagePosition: "first", + oddOrEven: "odd", + blankOrNotBlank: "nonBlank", + paraStack: [] + }; + const root = this.subform.children[0]; + root.pageSet[$cleanPage](); + const pageAreas = root.pageSet.pageArea.children; + const mainHtml = { + name: "div", + children: [] + }; + let pageArea = null; + let breakBefore = null; + let breakBeforeTarget = null; + if (root.breakBefore.children.length >= 1) { + breakBefore = root.breakBefore.children[0]; + breakBeforeTarget = breakBefore.target; + } else if (root.subform.children.length >= 1 && root.subform.children[0].breakBefore.children.length >= 1) { + breakBefore = root.subform.children[0].breakBefore.children[0]; + breakBeforeTarget = breakBefore.target; + } else if (root.break?.beforeTarget) { + breakBefore = root.break; + breakBeforeTarget = breakBefore.beforeTarget; + } else if (root.subform.children.length >= 1 && root.subform.children[0].break?.beforeTarget) { + breakBefore = root.subform.children[0].break; + breakBeforeTarget = breakBefore.beforeTarget; + } + if (breakBefore) { + const target = this[$searchNode](breakBeforeTarget, breakBefore[$getParent]()); + if (target instanceof PageArea) { + pageArea = target; + breakBefore[$extra] = {}; + } + } + pageArea ||= pageAreas[0]; + pageArea[$extra] = { + numberOfUse: 1 + }; + const pageAreaParent = pageArea[$getParent](); + pageAreaParent[$extra] = { + numberOfUse: 1, + pageIndex: pageAreaParent.pageArea.children.indexOf(pageArea), + pageSetIndex: 0 + }; + let targetPageArea; + let leader = null; + let trailer = null; + let hasSomething = true; + let hasSomethingCounter = 0; + let startIndex = 0; + while (true) { + if (!hasSomething) { + mainHtml.children.pop(); + if (++hasSomethingCounter === MAX_EMPTY_PAGES) { + warn("XFA - Something goes wrong: please file a bug."); + return mainHtml; + } + } else { + hasSomethingCounter = 0; + } + targetPageArea = null; + this[$extra].currentPageArea = pageArea; + const page = pageArea[$toHTML]().html; + mainHtml.children.push(page); + if (leader) { + this[$extra].noLayoutFailure = true; + page.children.push(leader[$toHTML](pageArea[$extra].space).html); + leader = null; + } + if (trailer) { + this[$extra].noLayoutFailure = true; + page.children.push(trailer[$toHTML](pageArea[$extra].space).html); + trailer = null; + } + const contentAreas = pageArea.contentArea.children; + const htmlContentAreas = page.children.filter(node => node.attributes.class.includes("xfaContentarea")); + hasSomething = false; + this[$extra].firstUnsplittable = null; + this[$extra].noLayoutFailure = false; + const flush = index => { + const html = root[$flushHTML](); + if (html) { + hasSomething ||= html.children?.length > 0; + htmlContentAreas[index].children.push(html); + } + }; + for (let i = startIndex, ii = contentAreas.length; i < ii; i++) { + const contentArea = this[$extra].currentContentArea = contentAreas[i]; + const space = { + width: contentArea.w, + height: contentArea.h + }; + startIndex = 0; + if (leader) { + htmlContentAreas[i].children.push(leader[$toHTML](space).html); + leader = null; + } + if (trailer) { + htmlContentAreas[i].children.push(trailer[$toHTML](space).html); + trailer = null; + } + const html = root[$toHTML](space); + if (html.success) { + if (html.html) { + hasSomething ||= html.html.children?.length > 0; + htmlContentAreas[i].children.push(html.html); + } else if (!hasSomething && mainHtml.children.length > 1) { + mainHtml.children.pop(); + } + return mainHtml; + } + if (html.isBreak()) { + const node = html.breakNode; + flush(i); + if (node.targetType === "auto") { + continue; + } + if (node.leader) { + leader = this[$searchNode](node.leader, node[$getParent]()); + leader = leader ? leader[0] : null; + } + if (node.trailer) { + trailer = this[$searchNode](node.trailer, node[$getParent]()); + trailer = trailer ? trailer[0] : null; + } + if (node.targetType === "pageArea") { + targetPageArea = node[$extra].target; + i = Infinity; + } else if (!node[$extra].target) { + i = node[$extra].index; + } else { + targetPageArea = node[$extra].target; + startIndex = node[$extra].index + 1; + i = Infinity; + } + continue; + } + if (this[$extra].overflowNode) { + const node = this[$extra].overflowNode; + this[$extra].overflowNode = null; + const overflowExtra = node[$getExtra](); + const target = overflowExtra.target; + overflowExtra.addLeader = overflowExtra.leader !== null; + overflowExtra.addTrailer = overflowExtra.trailer !== null; + flush(i); + const currentIndex = i; + i = Infinity; + if (target instanceof PageArea) { + targetPageArea = target; + } else if (target instanceof ContentArea) { + const index = contentAreas.indexOf(target); + if (index !== -1) { + if (index > currentIndex) { + i = index - 1; + } else { + startIndex = index; + } + } else { + targetPageArea = target[$getParent](); + startIndex = targetPageArea.contentArea.children.indexOf(target); + } + } + continue; + } + flush(i); + } + this[$extra].pageNumber += 1; + if (targetPageArea) { + if (targetPageArea[$isUsable]()) { + targetPageArea[$extra].numberOfUse += 1; + } else { + targetPageArea = null; + } + } + pageArea = targetPageArea || pageArea[$getNextPage](); + yield null; + } + } +} +class Text extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "text"); + this.id = attributes.id || ""; + this.maxChars = getInteger({ + data: attributes.maxChars, + defaultValue: 0, + validate: x => x >= 0 + }); + this.name = attributes.name || ""; + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$acceptWhitespace]() { + return true; + } + [$onChild](child) { + if (child[$namespaceId] === NamespaceIds.xhtml.id) { + this[$content] = child; + return true; + } + warn(`XFA - Invalid content in Text: ${child[$nodeName]}.`); + return false; + } + [$onText](str) { + if (this[$content] instanceof XFAObject) { + return; + } + super[$onText](str); + } + [$finalize]() { + if (typeof this[$content] === "string") { + this[$content] = this[$content].replaceAll("\r\n", "\n"); + } + } + [$getExtra]() { + if (typeof this[$content] === "string") { + return this[$content].split(/[\u2029\u2028\n]/).filter(line => !!line).join("\n"); + } + return this[$content][$text](); + } + [$toHTML](availableSpace) { + if (typeof this[$content] === "string") { + const html = valueToHtml(this[$content]).html; + if (this[$content].includes("\u2029")) { + html.name = "div"; + html.children = []; + this[$content].split("\u2029").map(para => para.split(/[\u2028\n]/).flatMap(line => [{ + name: "span", + value: line + }, { + name: "br" + }])).forEach(lines => { + html.children.push({ + name: "p", + children: lines + }); + }); + } else if (/[\u2028\n]/.test(this[$content])) { + html.name = "div"; + html.children = []; + this[$content].split(/[\u2028\n]/).forEach(line => { + html.children.push({ + name: "span", + value: line + }, { + name: "br" + }); + }); + } + return HTMLResult.success(html); + } + return this[$content][$toHTML](availableSpace); + } +} +class TextEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "textEdit", true); + this.allowRichText = getInteger({ + data: attributes.allowRichText, + defaultValue: 0, + validate: x => x === 1 + }); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.multiLine = getInteger({ + data: attributes.multiLine, + defaultValue: "", + validate: x => x === 0 || x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.vScrollPolicy = getStringOption(attributes.vScrollPolicy, ["auto", "off", "on"]); + this.border = null; + this.comb = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + let html; + const field = this[$getParent]()[$getParent](); + if (this.multiLine === "") { + this.multiLine = field instanceof Draw ? 1 : 0; + } + if (this.multiLine === 1) { + html = { + name: "textarea", + attributes: { + dataId: field[$data]?.[$uid] || field[$uid], + fieldId: field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + } else { + html = { + name: "input", + attributes: { + type: "text", + dataId: field[$data]?.[$uid] || field[$uid], + fieldId: field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + } + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [html] + }); + } +} +class Time extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "time"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); + } +} +class TimeStamp extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "timeStamp"); + this.id = attributes.id || ""; + this.server = attributes.server || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class ToolTip extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "toolTip"); + this.id = attributes.id || ""; + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Traversal extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "traversal", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.traverse = new XFAObjectArray(); + } +} +class Traverse extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "traverse", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, ["next", "back", "down", "first", "left", "right", "up"]); + this.ref = attributes.ref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.script = null; + } + get name() { + return this.operation; + } + [$isTransparent]() { + return false; + } +} +class Ui extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "ui", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.picture = null; + this.barcode = null; + this.button = null; + this.checkButton = null; + this.choiceList = null; + this.dateTimeEdit = null; + this.defaultUi = null; + this.imageEdit = null; + this.numericEdit = null; + this.passwordEdit = null; + this.signature = null; + this.textEdit = null; + } + [$getExtra]() { + if (this[$extra] === undefined) { + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "extras" || name === "picture") { + continue; + } + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + this[$extra] = obj; + return obj; + } + this[$extra] = null; + } + return this[$extra]; + } + [$toHTML](availableSpace) { + const obj = this[$getExtra](); + if (obj) { + return obj[$toHTML](availableSpace); + } + return HTMLResult.EMPTY; + } +} +class Validate extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "validate", true); + this.formatTest = getStringOption(attributes.formatTest, ["warning", "disabled", "error"]); + this.id = attributes.id || ""; + this.nullTest = getStringOption(attributes.nullTest, ["disabled", "error", "warning"]); + this.scriptTest = getStringOption(attributes.scriptTest, ["error", "disabled", "warning"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.message = null; + this.picture = null; + this.script = null; + } +} +class Value extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "value", true); + this.id = attributes.id || ""; + this.override = getInteger({ + data: attributes.override, + defaultValue: 0, + validate: x => x === 1 + }); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.arc = null; + this.boolean = null; + this.date = null; + this.dateTime = null; + this.decimal = null; + this.exData = null; + this.float = null; + this.image = null; + this.integer = null; + this.line = null; + this.rectangle = null; + this.text = null; + this.time = null; + } + [$setValue](value) { + const parent = this[$getParent](); + if (parent instanceof Field) { + if (parent.ui?.imageEdit) { + if (!this.image) { + this.image = new Image({}); + this[$appendChild](this.image); + } + this.image[$content] = value[$content]; + return; + } + } + const valueName = value[$nodeName]; + if (this[valueName] !== null) { + this[valueName][$content] = value[$content]; + return; + } + for (const name of Object.getOwnPropertyNames(this)) { + const obj = this[name]; + if (obj instanceof XFAObject) { + this[name] = null; + this[$removeChild](obj); + } + } + this[value[$nodeName]] = value; + this[$appendChild](value); + } + [$text]() { + if (this.exData) { + if (typeof this.exData[$content] === "string") { + return this.exData[$content].trim(); + } + return this.exData[$content][$text]().trim(); + } + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "image") { + continue; + } + const obj = this[name]; + if (obj instanceof XFAObject) { + return (obj[$content] || "").toString().trim(); + } + } + return null; + } + [$toHTML](availableSpace) { + for (const name of Object.getOwnPropertyNames(this)) { + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + return obj[$toHTML](availableSpace); + } + return HTMLResult.EMPTY; + } +} +class Variables extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "variables", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.manifest = new XFAObjectArray(); + this.script = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } + [$isTransparent]() { + return true; + } +} +class TemplateNamespace { + static [$buildXFAObject](name, attributes) { + if (TemplateNamespace.hasOwnProperty(name)) { + const node = TemplateNamespace[name](attributes); + node[$setSetAttributes](attributes); + return node; + } + return undefined; + } + static appearanceFilter(attrs) { + return new AppearanceFilter(attrs); + } + static arc(attrs) { + return new Arc(attrs); + } + static area(attrs) { + return new Area(attrs); + } + static assist(attrs) { + return new Assist(attrs); + } + static barcode(attrs) { + return new Barcode(attrs); + } + static bind(attrs) { + return new Bind(attrs); + } + static bindItems(attrs) { + return new BindItems(attrs); + } + static bookend(attrs) { + return new Bookend(attrs); + } + static boolean(attrs) { + return new BooleanElement(attrs); + } + static border(attrs) { + return new Border(attrs); + } + static break(attrs) { + return new Break(attrs); + } + static breakAfter(attrs) { + return new BreakAfter(attrs); + } + static breakBefore(attrs) { + return new BreakBefore(attrs); + } + static button(attrs) { + return new Button(attrs); + } + static calculate(attrs) { + return new Calculate(attrs); + } + static caption(attrs) { + return new Caption(attrs); + } + static certificate(attrs) { + return new Certificate(attrs); + } + static certificates(attrs) { + return new Certificates(attrs); + } + static checkButton(attrs) { + return new CheckButton(attrs); + } + static choiceList(attrs) { + return new ChoiceList(attrs); + } + static color(attrs) { + return new Color(attrs); + } + static comb(attrs) { + return new Comb(attrs); + } + static connect(attrs) { + return new Connect(attrs); + } + static contentArea(attrs) { + return new ContentArea(attrs); + } + static corner(attrs) { + return new Corner(attrs); + } + static date(attrs) { + return new DateElement(attrs); + } + static dateTime(attrs) { + return new DateTime(attrs); + } + static dateTimeEdit(attrs) { + return new DateTimeEdit(attrs); + } + static decimal(attrs) { + return new Decimal(attrs); + } + static defaultUi(attrs) { + return new DefaultUi(attrs); + } + static desc(attrs) { + return new Desc(attrs); + } + static digestMethod(attrs) { + return new DigestMethod(attrs); + } + static digestMethods(attrs) { + return new DigestMethods(attrs); + } + static draw(attrs) { + return new Draw(attrs); + } + static edge(attrs) { + return new Edge(attrs); + } + static encoding(attrs) { + return new Encoding(attrs); + } + static encodings(attrs) { + return new Encodings(attrs); + } + static encrypt(attrs) { + return new Encrypt(attrs); + } + static encryptData(attrs) { + return new EncryptData(attrs); + } + static encryption(attrs) { + return new Encryption(attrs); + } + static encryptionMethod(attrs) { + return new EncryptionMethod(attrs); + } + static encryptionMethods(attrs) { + return new EncryptionMethods(attrs); + } + static event(attrs) { + return new Event(attrs); + } + static exData(attrs) { + return new ExData(attrs); + } + static exObject(attrs) { + return new ExObject(attrs); + } + static exclGroup(attrs) { + return new ExclGroup(attrs); + } + static execute(attrs) { + return new Execute(attrs); + } + static extras(attrs) { + return new Extras(attrs); + } + static field(attrs) { + return new Field(attrs); + } + static fill(attrs) { + return new Fill(attrs); + } + static filter(attrs) { + return new Filter(attrs); + } + static float(attrs) { + return new Float(attrs); + } + static font(attrs) { + return new template_Font(attrs); + } + static format(attrs) { + return new Format(attrs); + } + static handler(attrs) { + return new Handler(attrs); + } + static hyphenation(attrs) { + return new Hyphenation(attrs); + } + static image(attrs) { + return new Image(attrs); + } + static imageEdit(attrs) { + return new ImageEdit(attrs); + } + static integer(attrs) { + return new Integer(attrs); + } + static issuers(attrs) { + return new Issuers(attrs); + } + static items(attrs) { + return new Items(attrs); + } + static keep(attrs) { + return new Keep(attrs); + } + static keyUsage(attrs) { + return new KeyUsage(attrs); + } + static line(attrs) { + return new Line(attrs); + } + static linear(attrs) { + return new Linear(attrs); + } + static lockDocument(attrs) { + return new LockDocument(attrs); + } + static manifest(attrs) { + return new Manifest(attrs); + } + static margin(attrs) { + return new Margin(attrs); + } + static mdp(attrs) { + return new Mdp(attrs); + } + static medium(attrs) { + return new Medium(attrs); + } + static message(attrs) { + return new Message(attrs); + } + static numericEdit(attrs) { + return new NumericEdit(attrs); + } + static occur(attrs) { + return new Occur(attrs); + } + static oid(attrs) { + return new Oid(attrs); + } + static oids(attrs) { + return new Oids(attrs); + } + static overflow(attrs) { + return new Overflow(attrs); + } + static pageArea(attrs) { + return new PageArea(attrs); + } + static pageSet(attrs) { + return new PageSet(attrs); + } + static para(attrs) { + return new Para(attrs); + } + static passwordEdit(attrs) { + return new PasswordEdit(attrs); + } + static pattern(attrs) { + return new template_Pattern(attrs); + } + static picture(attrs) { + return new Picture(attrs); + } + static proto(attrs) { + return new Proto(attrs); + } + static radial(attrs) { + return new Radial(attrs); + } + static reason(attrs) { + return new Reason(attrs); + } + static reasons(attrs) { + return new Reasons(attrs); + } + static rectangle(attrs) { + return new Rectangle(attrs); + } + static ref(attrs) { + return new RefElement(attrs); + } + static script(attrs) { + return new Script(attrs); + } + static setProperty(attrs) { + return new SetProperty(attrs); + } + static signData(attrs) { + return new SignData(attrs); + } + static signature(attrs) { + return new Signature(attrs); + } + static signing(attrs) { + return new Signing(attrs); + } + static solid(attrs) { + return new Solid(attrs); + } + static speak(attrs) { + return new Speak(attrs); + } + static stipple(attrs) { + return new Stipple(attrs); + } + static subform(attrs) { + return new Subform(attrs); + } + static subformSet(attrs) { + return new SubformSet(attrs); + } + static subjectDN(attrs) { + return new SubjectDN(attrs); + } + static subjectDNs(attrs) { + return new SubjectDNs(attrs); + } + static submit(attrs) { + return new Submit(attrs); + } + static template(attrs) { + return new Template(attrs); + } + static text(attrs) { + return new Text(attrs); + } + static textEdit(attrs) { + return new TextEdit(attrs); + } + static time(attrs) { + return new Time(attrs); + } + static timeStamp(attrs) { + return new TimeStamp(attrs); + } + static toolTip(attrs) { + return new ToolTip(attrs); + } + static traversal(attrs) { + return new Traversal(attrs); + } + static traverse(attrs) { + return new Traverse(attrs); + } + static ui(attrs) { + return new Ui(attrs); + } + static validate(attrs) { + return new Validate(attrs); + } + static value(attrs) { + return new Value(attrs); + } + static variables(attrs) { + return new Variables(attrs); + } +} + +;// ./src/core/xfa/bind.js + + + + + + +const bind_NS_DATASETS = NamespaceIds.datasets.id; +function createText(content) { + const node = new Text({}); + node[$content] = content; + return node; +} +class Binder { + constructor(root) { + this.root = root; + this.datasets = root.datasets; + this.data = root.datasets?.data || new XmlObject(NamespaceIds.datasets.id, "data"); + this.emptyMerge = this.data[$getChildren]().length === 0; + this.root.form = this.form = root.template[$clone](); + } + _isConsumeData() { + return !this.emptyMerge && this._mergeMode; + } + _isMatchTemplate() { + return !this._isConsumeData(); + } + bind() { + this._bindElement(this.form, this.data); + return this.form; + } + getData() { + return this.data; + } + _bindValue(formNode, data, picture) { + formNode[$data] = data; + if (formNode[$hasSettableValue]()) { + if (data[$isDataValue]()) { + const value = data[$getDataValue](); + formNode[$setValue](createText(value)); + } else if (formNode instanceof Field && formNode.ui?.choiceList?.open === "multiSelect") { + const value = data[$getChildren]().map(child => child[$content].trim()).join("\n"); + formNode[$setValue](createText(value)); + } else if (this._isConsumeData()) { + warn(`XFA - Nodes haven't the same type.`); + } + } else if (!data[$isDataValue]() || this._isMatchTemplate()) { + this._bindElement(formNode, data); + } else { + warn(`XFA - Nodes haven't the same type.`); + } + } + _findDataByNameToConsume(name, isValue, dataNode, global) { + if (!name) { + return null; + } + let generator, match; + for (let i = 0; i < 3; i++) { + generator = dataNode[$getRealChildrenByNameIt](name, false, true); + while (true) { + match = generator.next().value; + if (!match) { + break; + } + if (isValue === match[$isDataValue]()) { + return match; + } + } + if (dataNode[$namespaceId] === NamespaceIds.datasets.id && dataNode[$nodeName] === "data") { + break; + } + dataNode = dataNode[$getParent](); + } + if (!global) { + return null; + } + generator = this.data[$getRealChildrenByNameIt](name, true, false); + match = generator.next().value; + if (match) { + return match; + } + generator = this.data[$getAttributeIt](name, true); + match = generator.next().value; + if (match?.[$isDataValue]()) { + return match; + } + return null; + } + _setProperties(formNode, dataNode) { + if (!formNode.hasOwnProperty("setProperty")) { + return; + } + for (const { + ref, + target, + connection + } of formNode.setProperty.children) { + if (connection) { + continue; + } + if (!ref) { + continue; + } + const nodes = searchNode(this.root, dataNode, ref, false, false); + if (!nodes) { + warn(`XFA - Invalid reference: ${ref}.`); + continue; + } + const [node] = nodes; + if (!node[$isDescendent](this.data)) { + warn(`XFA - Invalid node: must be a data node.`); + continue; + } + const targetNodes = searchNode(this.root, formNode, target, false, false); + if (!targetNodes) { + warn(`XFA - Invalid target: ${target}.`); + continue; + } + const [targetNode] = targetNodes; + if (!targetNode[$isDescendent](formNode)) { + warn(`XFA - Invalid target: must be a property or subproperty.`); + continue; + } + const targetParent = targetNode[$getParent](); + if (targetNode instanceof SetProperty || targetParent instanceof SetProperty) { + warn(`XFA - Invalid target: cannot be a setProperty or one of its properties.`); + continue; + } + if (targetNode instanceof BindItems || targetParent instanceof BindItems) { + warn(`XFA - Invalid target: cannot be a bindItems or one of its properties.`); + continue; + } + const content = node[$text](); + const name = targetNode[$nodeName]; + if (targetNode instanceof XFAAttribute) { + const attrs = Object.create(null); + attrs[name] = content; + const obj = Reflect.construct(Object.getPrototypeOf(targetParent).constructor, [attrs]); + targetParent[name] = obj[name]; + continue; + } + if (!targetNode.hasOwnProperty($content)) { + warn(`XFA - Invalid node to use in setProperty`); + continue; + } + targetNode[$data] = node; + targetNode[$content] = content; + targetNode[$finalize](); + } + } + _bindItems(formNode, dataNode) { + if (!formNode.hasOwnProperty("items") || !formNode.hasOwnProperty("bindItems") || formNode.bindItems.isEmpty()) { + return; + } + for (const item of formNode.items.children) { + formNode[$removeChild](item); + } + formNode.items.clear(); + const labels = new Items({}); + const values = new Items({}); + formNode[$appendChild](labels); + formNode.items.push(labels); + formNode[$appendChild](values); + formNode.items.push(values); + for (const { + ref, + labelRef, + valueRef, + connection + } of formNode.bindItems.children) { + if (connection) { + continue; + } + if (!ref) { + continue; + } + const nodes = searchNode(this.root, dataNode, ref, false, false); + if (!nodes) { + warn(`XFA - Invalid reference: ${ref}.`); + continue; + } + for (const node of nodes) { + if (!node[$isDescendent](this.datasets)) { + warn(`XFA - Invalid ref (${ref}): must be a datasets child.`); + continue; + } + const labelNodes = searchNode(this.root, node, labelRef, true, false); + if (!labelNodes) { + warn(`XFA - Invalid label: ${labelRef}.`); + continue; + } + const [labelNode] = labelNodes; + if (!labelNode[$isDescendent](this.datasets)) { + warn(`XFA - Invalid label: must be a datasets child.`); + continue; + } + const valueNodes = searchNode(this.root, node, valueRef, true, false); + if (!valueNodes) { + warn(`XFA - Invalid value: ${valueRef}.`); + continue; + } + const [valueNode] = valueNodes; + if (!valueNode[$isDescendent](this.datasets)) { + warn(`XFA - Invalid value: must be a datasets child.`); + continue; + } + const label = createText(labelNode[$text]()); + const value = createText(valueNode[$text]()); + labels[$appendChild](label); + labels.text.push(label); + values[$appendChild](value); + values.text.push(value); + } + } + } + _bindOccurrences(formNode, matches, picture) { + let baseClone; + if (matches.length > 1) { + baseClone = formNode[$clone](); + baseClone[$removeChild](baseClone.occur); + baseClone.occur = null; + } + this._bindValue(formNode, matches[0], picture); + this._setProperties(formNode, matches[0]); + this._bindItems(formNode, matches[0]); + if (matches.length === 1) { + return; + } + const parent = formNode[$getParent](); + const name = formNode[$nodeName]; + const pos = parent[$indexOf](formNode); + for (let i = 1, ii = matches.length; i < ii; i++) { + const match = matches[i]; + const clone = baseClone[$clone](); + parent[name].push(clone); + parent[$insertAt](pos + i, clone); + this._bindValue(clone, match, picture); + this._setProperties(clone, match); + this._bindItems(clone, match); + } + } + _createOccurrences(formNode) { + if (!this.emptyMerge) { + return; + } + const { + occur + } = formNode; + if (!occur || occur.initial <= 1) { + return; + } + const parent = formNode[$getParent](); + const name = formNode[$nodeName]; + if (!(parent[name] instanceof XFAObjectArray)) { + return; + } + let currentNumber; + if (formNode.name) { + currentNumber = parent[name].children.filter(e => e.name === formNode.name).length; + } else { + currentNumber = parent[name].children.length; + } + const pos = parent[$indexOf](formNode) + 1; + const ii = occur.initial - currentNumber; + if (ii) { + const nodeClone = formNode[$clone](); + nodeClone[$removeChild](nodeClone.occur); + nodeClone.occur = null; + parent[name].push(nodeClone); + parent[$insertAt](pos, nodeClone); + for (let i = 1; i < ii; i++) { + const clone = nodeClone[$clone](); + parent[name].push(clone); + parent[$insertAt](pos + i, clone); + } + } + } + _getOccurInfo(formNode) { + const { + name, + occur + } = formNode; + if (!occur || !name) { + return [1, 1]; + } + const max = occur.max === -1 ? Infinity : occur.max; + return [occur.min, max]; + } + _setAndBind(formNode, dataNode) { + this._setProperties(formNode, dataNode); + this._bindItems(formNode, dataNode); + this._bindElement(formNode, dataNode); + } + _bindElement(formNode, dataNode) { + const uselessNodes = []; + this._createOccurrences(formNode); + for (const child of formNode[$getChildren]()) { + if (child[$data]) { + continue; + } + if (this._mergeMode === undefined && child[$nodeName] === "subform") { + this._mergeMode = child.mergeMode === "consumeData"; + const dataChildren = dataNode[$getChildren](); + if (dataChildren.length > 0) { + this._bindOccurrences(child, [dataChildren[0]], null); + } else if (this.emptyMerge) { + const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId]; + const dataChild = child[$data] = new XmlObject(nsId, child.name || "root"); + dataNode[$appendChild](dataChild); + this._bindElement(child, dataChild); + } + continue; + } + if (!child[$isBindable]()) { + continue; + } + let global = false; + let picture = null; + let ref = null; + let match = null; + if (child.bind) { + switch (child.bind.match) { + case "none": + this._setAndBind(child, dataNode); + continue; + case "global": + global = true; + break; + case "dataRef": + if (!child.bind.ref) { + warn(`XFA - ref is empty in node ${child[$nodeName]}.`); + this._setAndBind(child, dataNode); + continue; + } + ref = child.bind.ref; + break; + default: + break; + } + if (child.bind.picture) { + picture = child.bind.picture[$content]; + } + } + const [min, max] = this._getOccurInfo(child); + if (ref) { + match = searchNode(this.root, dataNode, ref, true, false); + if (match === null) { + match = createDataNode(this.data, dataNode, ref); + if (!match) { + continue; + } + if (this._isConsumeData()) { + match[$consumed] = true; + } + this._setAndBind(child, match); + continue; + } else { + if (this._isConsumeData()) { + match = match.filter(node => !node[$consumed]); + } + if (match.length > max) { + match = match.slice(0, max); + } else if (match.length === 0) { + match = null; + } + if (match && this._isConsumeData()) { + match.forEach(node => { + node[$consumed] = true; + }); + } + } + } else { + if (!child.name) { + this._setAndBind(child, dataNode); + continue; + } + if (this._isConsumeData()) { + const matches = []; + while (matches.length < max) { + const found = this._findDataByNameToConsume(child.name, child[$hasSettableValue](), dataNode, global); + if (!found) { + break; + } + found[$consumed] = true; + matches.push(found); + } + match = matches.length > 0 ? matches : null; + } else { + match = dataNode[$getRealChildrenByNameIt](child.name, false, this.emptyMerge).next().value; + if (!match) { + if (min === 0) { + uselessNodes.push(child); + continue; + } + const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId]; + match = child[$data] = new XmlObject(nsId, child.name); + if (this.emptyMerge) { + match[$consumed] = true; + } + dataNode[$appendChild](match); + this._setAndBind(child, match); + continue; + } + if (this.emptyMerge) { + match[$consumed] = true; + } + match = [match]; + } + } + if (match) { + this._bindOccurrences(child, match, picture); + } else if (min > 0) { + this._setAndBind(child, dataNode); + } else { + uselessNodes.push(child); + } + } + uselessNodes.forEach(node => node[$getParent]()[$removeChild](node)); + } +} + +;// ./src/core/xfa/data.js + +class DataHandler { + constructor(root, data) { + this.data = data; + this.dataset = root.datasets || null; + } + serialize(storage) { + const stack = [[-1, this.data[$getChildren]()]]; + while (stack.length > 0) { + const last = stack.at(-1); + const [i, children] = last; + if (i + 1 === children.length) { + stack.pop(); + continue; + } + const child = children[++last[0]]; + const storageEntry = storage.get(child[$uid]); + if (storageEntry) { + child[$setValue](storageEntry); + } else { + const attributes = child[$getAttributes](); + for (const value of attributes.values()) { + const entry = storage.get(value[$uid]); + if (entry) { + value[$setValue](entry); + break; + } + } + } + const nodes = child[$getChildren](); + if (nodes.length > 0) { + stack.push([-1, nodes]); + } + } + const buf = [``]; + if (this.dataset) { + for (const child of this.dataset[$getChildren]()) { + if (child[$nodeName] !== "data") { + child[$toString](buf); + } + } + } + this.data[$toString](buf); + buf.push(""); + return buf.join(""); + } +} + +;// ./src/core/xfa/config.js + + + + + +const CONFIG_NS_ID = NamespaceIds.config.id; +class Acrobat extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "acrobat", true); + this.acrobat7 = null; + this.autoSave = null; + this.common = null; + this.validate = null; + this.validateApprovalSignatures = null; + this.submitUrl = new XFAObjectArray(); + } +} +class Acrobat7 extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "acrobat7", true); + this.dynamicRender = null; + } +} +class ADBE_JSConsole extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]); + } +} +class ADBE_JSDebugger extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]); + } +} +class AddSilentPrint extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "addSilentPrint"); + } +} +class AddViewerPreferences extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "addViewerPreferences"); + } +} +class AdjustData extends Option10 { + constructor(attributes) { + super(CONFIG_NS_ID, "adjustData"); + } +} +class AdobeExtensionLevel extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "adobeExtensionLevel", 0, n => n >= 1 && n <= 8); + } +} +class Agent extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "agent", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.common = new XFAObjectArray(); + } +} +class AlwaysEmbed extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "alwaysEmbed"); + } +} +class Amd extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "amd"); + } +} +class config_Area extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "area"); + this.level = getInteger({ + data: attributes.level, + defaultValue: 0, + validate: n => n >= 1 && n <= 3 + }); + this.name = getStringOption(attributes.name, ["", "barcode", "coreinit", "deviceDriver", "font", "general", "layout", "merge", "script", "signature", "sourceSet", "templateCache"]); + } +} +class Attributes extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "attributes", ["preserve", "delegate", "ignore"]); + } +} +class AutoSave extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "autoSave", ["disabled", "enabled"]); + } +} +class Base extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "base"); + } +} +class BatchOutput extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "batchOutput"); + this.format = getStringOption(attributes.format, ["none", "concat", "zip", "zipCompress"]); + } +} +class BehaviorOverride extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "behaviorOverride"); + } + [$finalize]() { + this[$content] = new Map(this[$content].trim().split(/\s+/).filter(x => x.includes(":")).map(x => x.split(":", 2))); + } +} +class Cache extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "cache", true); + this.templateCache = null; + } +} +class Change extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "change"); + } +} +class Common extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "common", true); + this.data = null; + this.locale = null; + this.localeSet = null; + this.messaging = null; + this.suppressBanner = null; + this.template = null; + this.validationMessaging = null; + this.versionControl = null; + this.log = new XFAObjectArray(); + } +} +class Compress extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "compress"); + this.scope = getStringOption(attributes.scope, ["imageOnly", "document"]); + } +} +class CompressLogicalStructure extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "compressLogicalStructure"); + } +} +class CompressObjectStream extends Option10 { + constructor(attributes) { + super(CONFIG_NS_ID, "compressObjectStream"); + } +} +class Compression extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "compression", true); + this.compressLogicalStructure = null; + this.compressObjectStream = null; + this.level = null; + this.type = null; + } +} +class Config extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "config", true); + this.acrobat = null; + this.present = null; + this.trace = null; + this.agent = new XFAObjectArray(); + } +} +class Conformance extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "conformance", ["A", "B"]); + } +} +class ContentCopy extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "contentCopy"); + } +} +class Copies extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "copies", 1, n => n >= 1); + } +} +class Creator extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "creator"); + } +} +class CurrentPage extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "currentPage", 0, n => n >= 0); + } +} +class Data extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "data", true); + this.adjustData = null; + this.attributes = null; + this.incrementalLoad = null; + this.outputXSL = null; + this.range = null; + this.record = null; + this.startNode = null; + this.uri = null; + this.window = null; + this.xsl = null; + this.excludeNS = new XFAObjectArray(); + this.transform = new XFAObjectArray(); + } +} +class Debug extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "debug", true); + this.uri = null; + } +} +class DefaultTypeface extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "defaultTypeface"); + this.writingScript = getStringOption(attributes.writingScript, ["*", "Arabic", "Cyrillic", "EastEuropeanRoman", "Greek", "Hebrew", "Japanese", "Korean", "Roman", "SimplifiedChinese", "Thai", "TraditionalChinese", "Vietnamese"]); + } +} +class Destination extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "destination", ["pdf", "pcl", "ps", "webClient", "zpl"]); + } +} +class DocumentAssembly extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "documentAssembly"); + } +} +class Driver extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "driver", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.fontInfo = null; + this.xdc = null; + } +} +class DuplexOption extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "duplexOption", ["simplex", "duplexFlipLongEdge", "duplexFlipShortEdge"]); + } +} +class DynamicRender extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "dynamicRender", ["forbidden", "required"]); + } +} +class Embed extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "embed"); + } +} +class config_Encrypt extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "encrypt"); + } +} +class config_Encryption extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "encryption", true); + this.encrypt = null; + this.encryptionLevel = null; + this.permissions = null; + } +} +class EncryptionLevel extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "encryptionLevel", ["40bit", "128bit"]); + } +} +class Enforce extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "enforce"); + } +} +class Equate extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "equate"); + this.force = getInteger({ + data: attributes.force, + defaultValue: 1, + validate: n => n === 0 + }); + this.from = attributes.from || ""; + this.to = attributes.to || ""; + } +} +class EquateRange extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "equateRange"); + this.from = attributes.from || ""; + this.to = attributes.to || ""; + this._unicodeRange = attributes.unicodeRange || ""; + } + get unicodeRange() { + const ranges = []; + const unicodeRegex = /U\+([0-9a-fA-F]+)/; + const unicodeRange = this._unicodeRange; + for (let range of unicodeRange.split(",").map(x => x.trim()).filter(x => !!x)) { + range = range.split("-", 2).map(x => { + const found = x.match(unicodeRegex); + if (!found) { + return 0; + } + return parseInt(found[1], 16); + }); + if (range.length === 1) { + range.push(range[0]); + } + ranges.push(range); + } + return shadow(this, "unicodeRange", ranges); + } +} +class Exclude extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "exclude"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/).filter(x => x && ["calculate", "close", "enter", "exit", "initialize", "ready", "validate"].includes(x)); + } +} +class ExcludeNS extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "excludeNS"); + } +} +class FlipLabel extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "flipLabel", ["usePrinterSetting", "on", "off"]); + } +} +class config_FontInfo extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "fontInfo", true); + this.embed = null; + this.map = null; + this.subsetBelow = null; + this.alwaysEmbed = new XFAObjectArray(); + this.defaultTypeface = new XFAObjectArray(); + this.neverEmbed = new XFAObjectArray(); + } +} +class FormFieldFilling extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "formFieldFilling"); + } +} +class GroupParent extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "groupParent"); + } +} +class IfEmpty extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ifEmpty", ["dataValue", "dataGroup", "ignore", "remove"]); + } +} +class IncludeXDPContent extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "includeXDPContent"); + } +} +class IncrementalLoad extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "incrementalLoad", ["none", "forwardOnly"]); + } +} +class IncrementalMerge extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "incrementalMerge"); + } +} +class Interactive extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "interactive"); + } +} +class Jog extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "jog", ["usePrinterSetting", "none", "pageSet"]); + } +} +class LabelPrinter extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "labelPrinter", true); + this.name = getStringOption(attributes.name, ["zpl", "dpl", "ipl", "tcpl"]); + this.batchOutput = null; + this.flipLabel = null; + this.fontInfo = null; + this.xdc = null; + } +} +class Layout extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "layout", ["paginate", "panel"]); + } +} +class Level extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "level", 0, n => n > 0); + } +} +class Linearized extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "linearized"); + } +} +class Locale extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "locale"); + } +} +class LocaleSet extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "localeSet"); + } +} +class Log extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "log", true); + this.mode = null; + this.threshold = null; + this.to = null; + this.uri = null; + } +} +class MapElement extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "map", true); + this.equate = new XFAObjectArray(); + this.equateRange = new XFAObjectArray(); + } +} +class MediumInfo extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "mediumInfo", true); + this.map = null; + } +} +class config_Message extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "message", true); + this.msgId = null; + this.severity = null; + } +} +class Messaging extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "messaging", true); + this.message = new XFAObjectArray(); + } +} +class Mode extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "mode", ["append", "overwrite"]); + } +} +class ModifyAnnots extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "modifyAnnots"); + } +} +class MsgId extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "msgId", 1, n => n >= 1); + } +} +class NameAttr extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "nameAttr"); + } +} +class NeverEmbed extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "neverEmbed"); + } +} +class NumberOfCopies extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "numberOfCopies", null, n => n >= 2 && n <= 5); + } +} +class OpenAction extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "openAction", true); + this.destination = null; + } +} +class Output extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "output", true); + this.to = null; + this.type = null; + this.uri = null; + } +} +class OutputBin extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "outputBin"); + } +} +class OutputXSL extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "outputXSL", true); + this.uri = null; + } +} +class Overprint extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "overprint", ["none", "both", "draw", "field"]); + } +} +class Packets extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "packets"); + } + [$finalize]() { + if (this[$content] === "*") { + return; + } + this[$content] = this[$content].trim().split(/\s+/).filter(x => ["config", "datasets", "template", "xfdf", "xslt"].includes(x)); + } +} +class PageOffset extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pageOffset"); + this.x = getInteger({ + data: attributes.x, + defaultValue: "useXDCSetting", + validate: n => true + }); + this.y = getInteger({ + data: attributes.y, + defaultValue: "useXDCSetting", + validate: n => true + }); + } +} +class PageRange extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pageRange"); + } + [$finalize]() { + const numbers = this[$content].trim().split(/\s+/).map(x => parseInt(x, 10)); + const ranges = []; + for (let i = 0, ii = numbers.length; i < ii; i += 2) { + ranges.push(numbers.slice(i, i + 2)); + } + this[$content] = ranges; + } +} +class Pagination extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pagination", ["simplex", "duplexShortEdge", "duplexLongEdge"]); + } +} +class PaginationOverride extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "paginationOverride", ["none", "forceDuplex", "forceDuplexLongEdge", "forceDuplexShortEdge", "forceSimplex"]); + } +} +class Part extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "part", 1, n => false); + } +} +class Pcl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pcl", true); + this.name = attributes.name || ""; + this.batchOutput = null; + this.fontInfo = null; + this.jog = null; + this.mediumInfo = null; + this.outputBin = null; + this.pageOffset = null; + this.staple = null; + this.xdc = null; + } +} +class Pdf extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pdf", true); + this.name = attributes.name || ""; + this.adobeExtensionLevel = null; + this.batchOutput = null; + this.compression = null; + this.creator = null; + this.encryption = null; + this.fontInfo = null; + this.interactive = null; + this.linearized = null; + this.openAction = null; + this.pdfa = null; + this.producer = null; + this.renderPolicy = null; + this.scriptModel = null; + this.silentPrint = null; + this.submitFormat = null; + this.tagged = null; + this.version = null; + this.viewerPreferences = null; + this.xdc = null; + } +} +class Pdfa extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pdfa", true); + this.amd = null; + this.conformance = null; + this.includeXDPContent = null; + this.part = null; + } +} +class Permissions extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "permissions", true); + this.accessibleContent = null; + this.change = null; + this.contentCopy = null; + this.documentAssembly = null; + this.formFieldFilling = null; + this.modifyAnnots = null; + this.plaintextMetadata = null; + this.print = null; + this.printHighQuality = null; + } +} +class PickTrayByPDFSize extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "pickTrayByPDFSize"); + } +} +class config_Picture extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "picture"); + } +} +class PlaintextMetadata extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "plaintextMetadata"); + } +} +class Presence extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "presence", ["preserve", "dissolve", "dissolveStructure", "ignore", "remove"]); + } +} +class Present extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "present", true); + this.behaviorOverride = null; + this.cache = null; + this.common = null; + this.copies = null; + this.destination = null; + this.incrementalMerge = null; + this.layout = null; + this.output = null; + this.overprint = null; + this.pagination = null; + this.paginationOverride = null; + this.script = null; + this.validate = null; + this.xdp = null; + this.driver = new XFAObjectArray(); + this.labelPrinter = new XFAObjectArray(); + this.pcl = new XFAObjectArray(); + this.pdf = new XFAObjectArray(); + this.ps = new XFAObjectArray(); + this.submitUrl = new XFAObjectArray(); + this.webClient = new XFAObjectArray(); + this.zpl = new XFAObjectArray(); + } +} +class Print extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "print"); + } +} +class PrintHighQuality extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "printHighQuality"); + } +} +class PrintScaling extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "printScaling", ["appdefault", "noScaling"]); + } +} +class PrinterName extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "printerName"); + } +} +class Producer extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "producer"); + } +} +class Ps extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ps", true); + this.name = attributes.name || ""; + this.batchOutput = null; + this.fontInfo = null; + this.jog = null; + this.mediumInfo = null; + this.outputBin = null; + this.staple = null; + this.xdc = null; + } +} +class Range extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "range"); + } + [$finalize]() { + this[$content] = this[$content].split(",", 2).map(range => range.split("-").map(x => parseInt(x.trim(), 10))).filter(range => range.every(x => !isNaN(x))).map(range => { + if (range.length === 1) { + range.push(range[0]); + } + return range; + }); + } +} +class Record extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "record"); + } + [$finalize]() { + this[$content] = this[$content].trim(); + const n = parseInt(this[$content], 10); + if (!isNaN(n) && n >= 0) { + this[$content] = n; + } + } +} +class Relevant extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "relevant"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/); + } +} +class Rename extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "rename"); + } + [$finalize]() { + this[$content] = this[$content].trim(); + if (this[$content].toLowerCase().startsWith("xml") || new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[$content])) { + warn("XFA - Rename: invalid XFA name"); + } + } +} +class RenderPolicy extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "renderPolicy", ["server", "client"]); + } +} +class RunScripts extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "runScripts", ["both", "client", "none", "server"]); + } +} +class config_Script extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "script", true); + this.currentPage = null; + this.exclude = null; + this.runScripts = null; + } +} +class ScriptModel extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "scriptModel", ["XFA", "none"]); + } +} +class Severity extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "severity", ["ignore", "error", "information", "trace", "warning"]); + } +} +class SilentPrint extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "silentPrint", true); + this.addSilentPrint = null; + this.printerName = null; + } +} +class Staple extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "staple"); + this.mode = getStringOption(attributes.mode, ["usePrinterSetting", "on", "off"]); + } +} +class StartNode extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "startNode"); + } +} +class StartPage extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "startPage", 0, n => true); + } +} +class SubmitFormat extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "submitFormat", ["html", "delegate", "fdf", "xml", "pdf"]); + } +} +class SubmitUrl extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "submitUrl"); + } +} +class SubsetBelow extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "subsetBelow", 100, n => n >= 0 && n <= 100); + } +} +class SuppressBanner extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "suppressBanner"); + } +} +class Tagged extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "tagged"); + } +} +class config_Template extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "template", true); + this.base = null; + this.relevant = null; + this.startPage = null; + this.uri = null; + this.xsl = null; + } +} +class Threshold extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "threshold", ["trace", "error", "information", "warning"]); + } +} +class To extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "to", ["null", "memory", "stderr", "stdout", "system", "uri"]); + } +} +class TemplateCache extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "templateCache"); + this.maxEntries = getInteger({ + data: attributes.maxEntries, + defaultValue: 5, + validate: n => n >= 0 + }); + } +} +class Trace extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "trace", true); + this.area = new XFAObjectArray(); + } +} +class Transform extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "transform", true); + this.groupParent = null; + this.ifEmpty = null; + this.nameAttr = null; + this.picture = null; + this.presence = null; + this.rename = null; + this.whitespace = null; + } +} +class Type extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "type", ["none", "ascii85", "asciiHex", "ccittfax", "flate", "lzw", "runLength", "native", "xdp", "mergedXDP"]); + } +} +class Uri extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "uri"); + } +} +class config_Validate extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "validate", ["preSubmit", "prePrint", "preExecute", "preSave"]); + } +} +class ValidateApprovalSignatures extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "validateApprovalSignatures"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/).filter(x => ["docReady", "postSign"].includes(x)); + } +} +class ValidationMessaging extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "validationMessaging", ["allMessagesIndividually", "allMessagesTogether", "firstMessageOnly", "noMessages"]); + } +} +class Version extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]); + } +} +class VersionControl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "VersionControl"); + this.outputBelow = getStringOption(attributes.outputBelow, ["warn", "error", "update"]); + this.sourceAbove = getStringOption(attributes.sourceAbove, ["warn", "error"]); + this.sourceBelow = getStringOption(attributes.sourceBelow, ["update", "maintain"]); + } +} +class ViewerPreferences extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "viewerPreferences", true); + this.ADBE_JSConsole = null; + this.ADBE_JSDebugger = null; + this.addViewerPreferences = null; + this.duplexOption = null; + this.enforce = null; + this.numberOfCopies = null; + this.pageRange = null; + this.pickTrayByPDFSize = null; + this.printScaling = null; + } +} +class WebClient extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "webClient", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.fontInfo = null; + this.xdc = null; + } +} +class Whitespace extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "whitespace", ["preserve", "ltrim", "normalize", "rtrim", "trim"]); + } +} +class Window extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "window"); + } + [$finalize]() { + const pair = this[$content].split(",", 2).map(x => parseInt(x.trim(), 10)); + if (pair.some(x => isNaN(x))) { + this[$content] = [0, 0]; + return; + } + if (pair.length === 1) { + pair.push(pair[0]); + } + this[$content] = pair; + } +} +class Xdc extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "xdc", true); + this.uri = new XFAObjectArray(); + this.xsl = new XFAObjectArray(); + } +} +class Xdp extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "xdp", true); + this.packets = null; + } +} +class Xsl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "xsl", true); + this.debug = null; + this.uri = null; + } +} +class Zpl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "zpl", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.batchOutput = null; + this.flipLabel = null; + this.fontInfo = null; + this.xdc = null; + } +} +class ConfigNamespace { + static [$buildXFAObject](name, attributes) { + if (ConfigNamespace.hasOwnProperty(name)) { + return ConfigNamespace[name](attributes); + } + return undefined; + } + static acrobat(attrs) { + return new Acrobat(attrs); + } + static acrobat7(attrs) { + return new Acrobat7(attrs); + } + static ADBE_JSConsole(attrs) { + return new ADBE_JSConsole(attrs); + } + static ADBE_JSDebugger(attrs) { + return new ADBE_JSDebugger(attrs); + } + static addSilentPrint(attrs) { + return new AddSilentPrint(attrs); + } + static addViewerPreferences(attrs) { + return new AddViewerPreferences(attrs); + } + static adjustData(attrs) { + return new AdjustData(attrs); + } + static adobeExtensionLevel(attrs) { + return new AdobeExtensionLevel(attrs); + } + static agent(attrs) { + return new Agent(attrs); + } + static alwaysEmbed(attrs) { + return new AlwaysEmbed(attrs); + } + static amd(attrs) { + return new Amd(attrs); + } + static area(attrs) { + return new config_Area(attrs); + } + static attributes(attrs) { + return new Attributes(attrs); + } + static autoSave(attrs) { + return new AutoSave(attrs); + } + static base(attrs) { + return new Base(attrs); + } + static batchOutput(attrs) { + return new BatchOutput(attrs); + } + static behaviorOverride(attrs) { + return new BehaviorOverride(attrs); + } + static cache(attrs) { + return new Cache(attrs); + } + static change(attrs) { + return new Change(attrs); + } + static common(attrs) { + return new Common(attrs); + } + static compress(attrs) { + return new Compress(attrs); + } + static compressLogicalStructure(attrs) { + return new CompressLogicalStructure(attrs); + } + static compressObjectStream(attrs) { + return new CompressObjectStream(attrs); + } + static compression(attrs) { + return new Compression(attrs); + } + static config(attrs) { + return new Config(attrs); + } + static conformance(attrs) { + return new Conformance(attrs); + } + static contentCopy(attrs) { + return new ContentCopy(attrs); + } + static copies(attrs) { + return new Copies(attrs); + } + static creator(attrs) { + return new Creator(attrs); + } + static currentPage(attrs) { + return new CurrentPage(attrs); + } + static data(attrs) { + return new Data(attrs); + } + static debug(attrs) { + return new Debug(attrs); + } + static defaultTypeface(attrs) { + return new DefaultTypeface(attrs); + } + static destination(attrs) { + return new Destination(attrs); + } + static documentAssembly(attrs) { + return new DocumentAssembly(attrs); + } + static driver(attrs) { + return new Driver(attrs); + } + static duplexOption(attrs) { + return new DuplexOption(attrs); + } + static dynamicRender(attrs) { + return new DynamicRender(attrs); + } + static embed(attrs) { + return new Embed(attrs); + } + static encrypt(attrs) { + return new config_Encrypt(attrs); + } + static encryption(attrs) { + return new config_Encryption(attrs); + } + static encryptionLevel(attrs) { + return new EncryptionLevel(attrs); + } + static enforce(attrs) { + return new Enforce(attrs); + } + static equate(attrs) { + return new Equate(attrs); + } + static equateRange(attrs) { + return new EquateRange(attrs); + } + static exclude(attrs) { + return new Exclude(attrs); + } + static excludeNS(attrs) { + return new ExcludeNS(attrs); + } + static flipLabel(attrs) { + return new FlipLabel(attrs); + } + static fontInfo(attrs) { + return new config_FontInfo(attrs); + } + static formFieldFilling(attrs) { + return new FormFieldFilling(attrs); + } + static groupParent(attrs) { + return new GroupParent(attrs); + } + static ifEmpty(attrs) { + return new IfEmpty(attrs); + } + static includeXDPContent(attrs) { + return new IncludeXDPContent(attrs); + } + static incrementalLoad(attrs) { + return new IncrementalLoad(attrs); + } + static incrementalMerge(attrs) { + return new IncrementalMerge(attrs); + } + static interactive(attrs) { + return new Interactive(attrs); + } + static jog(attrs) { + return new Jog(attrs); + } + static labelPrinter(attrs) { + return new LabelPrinter(attrs); + } + static layout(attrs) { + return new Layout(attrs); + } + static level(attrs) { + return new Level(attrs); + } + static linearized(attrs) { + return new Linearized(attrs); + } + static locale(attrs) { + return new Locale(attrs); + } + static localeSet(attrs) { + return new LocaleSet(attrs); + } + static log(attrs) { + return new Log(attrs); + } + static map(attrs) { + return new MapElement(attrs); + } + static mediumInfo(attrs) { + return new MediumInfo(attrs); + } + static message(attrs) { + return new config_Message(attrs); + } + static messaging(attrs) { + return new Messaging(attrs); + } + static mode(attrs) { + return new Mode(attrs); + } + static modifyAnnots(attrs) { + return new ModifyAnnots(attrs); + } + static msgId(attrs) { + return new MsgId(attrs); + } + static nameAttr(attrs) { + return new NameAttr(attrs); + } + static neverEmbed(attrs) { + return new NeverEmbed(attrs); + } + static numberOfCopies(attrs) { + return new NumberOfCopies(attrs); + } + static openAction(attrs) { + return new OpenAction(attrs); + } + static output(attrs) { + return new Output(attrs); + } + static outputBin(attrs) { + return new OutputBin(attrs); + } + static outputXSL(attrs) { + return new OutputXSL(attrs); + } + static overprint(attrs) { + return new Overprint(attrs); + } + static packets(attrs) { + return new Packets(attrs); + } + static pageOffset(attrs) { + return new PageOffset(attrs); + } + static pageRange(attrs) { + return new PageRange(attrs); + } + static pagination(attrs) { + return new Pagination(attrs); + } + static paginationOverride(attrs) { + return new PaginationOverride(attrs); + } + static part(attrs) { + return new Part(attrs); + } + static pcl(attrs) { + return new Pcl(attrs); + } + static pdf(attrs) { + return new Pdf(attrs); + } + static pdfa(attrs) { + return new Pdfa(attrs); + } + static permissions(attrs) { + return new Permissions(attrs); + } + static pickTrayByPDFSize(attrs) { + return new PickTrayByPDFSize(attrs); + } + static picture(attrs) { + return new config_Picture(attrs); + } + static plaintextMetadata(attrs) { + return new PlaintextMetadata(attrs); + } + static presence(attrs) { + return new Presence(attrs); + } + static present(attrs) { + return new Present(attrs); + } + static print(attrs) { + return new Print(attrs); + } + static printHighQuality(attrs) { + return new PrintHighQuality(attrs); + } + static printScaling(attrs) { + return new PrintScaling(attrs); + } + static printerName(attrs) { + return new PrinterName(attrs); + } + static producer(attrs) { + return new Producer(attrs); + } + static ps(attrs) { + return new Ps(attrs); + } + static range(attrs) { + return new Range(attrs); + } + static record(attrs) { + return new Record(attrs); + } + static relevant(attrs) { + return new Relevant(attrs); + } + static rename(attrs) { + return new Rename(attrs); + } + static renderPolicy(attrs) { + return new RenderPolicy(attrs); + } + static runScripts(attrs) { + return new RunScripts(attrs); + } + static script(attrs) { + return new config_Script(attrs); + } + static scriptModel(attrs) { + return new ScriptModel(attrs); + } + static severity(attrs) { + return new Severity(attrs); + } + static silentPrint(attrs) { + return new SilentPrint(attrs); + } + static staple(attrs) { + return new Staple(attrs); + } + static startNode(attrs) { + return new StartNode(attrs); + } + static startPage(attrs) { + return new StartPage(attrs); + } + static submitFormat(attrs) { + return new SubmitFormat(attrs); + } + static submitUrl(attrs) { + return new SubmitUrl(attrs); + } + static subsetBelow(attrs) { + return new SubsetBelow(attrs); + } + static suppressBanner(attrs) { + return new SuppressBanner(attrs); + } + static tagged(attrs) { + return new Tagged(attrs); + } + static template(attrs) { + return new config_Template(attrs); + } + static templateCache(attrs) { + return new TemplateCache(attrs); + } + static threshold(attrs) { + return new Threshold(attrs); + } + static to(attrs) { + return new To(attrs); + } + static trace(attrs) { + return new Trace(attrs); + } + static transform(attrs) { + return new Transform(attrs); + } + static type(attrs) { + return new Type(attrs); + } + static uri(attrs) { + return new Uri(attrs); + } + static validate(attrs) { + return new config_Validate(attrs); + } + static validateApprovalSignatures(attrs) { + return new ValidateApprovalSignatures(attrs); + } + static validationMessaging(attrs) { + return new ValidationMessaging(attrs); + } + static version(attrs) { + return new Version(attrs); + } + static versionControl(attrs) { + return new VersionControl(attrs); + } + static viewerPreferences(attrs) { + return new ViewerPreferences(attrs); + } + static webClient(attrs) { + return new WebClient(attrs); + } + static whitespace(attrs) { + return new Whitespace(attrs); + } + static window(attrs) { + return new Window(attrs); + } + static xdc(attrs) { + return new Xdc(attrs); + } + static xdp(attrs) { + return new Xdp(attrs); + } + static xsl(attrs) { + return new Xsl(attrs); + } + static zpl(attrs) { + return new Zpl(attrs); + } +} + +;// ./src/core/xfa/connection_set.js + + +const CONNECTION_SET_NS_ID = NamespaceIds.connectionSet.id; +class ConnectionSet extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "connectionSet", true); + this.wsdlConnection = new XFAObjectArray(); + this.xmlConnection = new XFAObjectArray(); + this.xsdConnection = new XFAObjectArray(); + } +} +class EffectiveInputPolicy extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "effectiveInputPolicy"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class EffectiveOutputPolicy extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "effectiveOutputPolicy"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Operation extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "operation"); + this.id = attributes.id || ""; + this.input = attributes.input || ""; + this.name = attributes.name || ""; + this.output = attributes.output || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class RootElement extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "rootElement"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class SoapAction extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "soapAction"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class SoapAddress extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "soapAddress"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class connection_set_Uri extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "uri"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class WsdlAddress extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "wsdlAddress"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class WsdlConnection extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "wsdlConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; + this.effectiveInputPolicy = null; + this.effectiveOutputPolicy = null; + this.operation = null; + this.soapAction = null; + this.soapAddress = null; + this.wsdlAddress = null; + } +} +class XmlConnection extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "xmlConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; + this.uri = null; + } +} +class XsdConnection extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "xsdConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; + this.rootElement = null; + this.uri = null; + } +} +class ConnectionSetNamespace { + static [$buildXFAObject](name, attributes) { + if (ConnectionSetNamespace.hasOwnProperty(name)) { + return ConnectionSetNamespace[name](attributes); + } + return undefined; + } + static connectionSet(attrs) { + return new ConnectionSet(attrs); + } + static effectiveInputPolicy(attrs) { + return new EffectiveInputPolicy(attrs); + } + static effectiveOutputPolicy(attrs) { + return new EffectiveOutputPolicy(attrs); + } + static operation(attrs) { + return new Operation(attrs); + } + static rootElement(attrs) { + return new RootElement(attrs); + } + static soapAction(attrs) { + return new SoapAction(attrs); + } + static soapAddress(attrs) { + return new SoapAddress(attrs); + } + static uri(attrs) { + return new connection_set_Uri(attrs); + } + static wsdlAddress(attrs) { + return new WsdlAddress(attrs); + } + static wsdlConnection(attrs) { + return new WsdlConnection(attrs); + } + static xmlConnection(attrs) { + return new XmlConnection(attrs); + } + static xsdConnection(attrs) { + return new XsdConnection(attrs); + } +} + +;// ./src/core/xfa/datasets.js + + + +const DATASETS_NS_ID = NamespaceIds.datasets.id; +class datasets_Data extends XmlObject { + constructor(attributes) { + super(DATASETS_NS_ID, "data", attributes); + } + [$isNsAgnostic]() { + return true; + } +} +class Datasets extends XFAObject { + constructor(attributes) { + super(DATASETS_NS_ID, "datasets", true); + this.data = null; + this.Signature = null; + } + [$onChild](child) { + const name = child[$nodeName]; + if (name === "data" && child[$namespaceId] === DATASETS_NS_ID || name === "Signature" && child[$namespaceId] === NamespaceIds.signature.id) { + this[name] = child; + } + this[$appendChild](child); + } +} +class DatasetsNamespace { + static [$buildXFAObject](name, attributes) { + if (DatasetsNamespace.hasOwnProperty(name)) { + return DatasetsNamespace[name](attributes); + } + return undefined; + } + static datasets(attributes) { + return new Datasets(attributes); + } + static data(attributes) { + return new datasets_Data(attributes); + } +} + +;// ./src/core/xfa/locale_set.js + + + +const LOCALE_SET_NS_ID = NamespaceIds.localeSet.id; +class CalendarSymbols extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "calendarSymbols", true); + this.name = "gregorian"; + this.dayNames = new XFAObjectArray(2); + this.eraNames = null; + this.meridiemNames = null; + this.monthNames = new XFAObjectArray(2); + } +} +class CurrencySymbol extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "currencySymbol"); + this.name = getStringOption(attributes.name, ["symbol", "isoname", "decimal"]); + } +} +class CurrencySymbols extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "currencySymbols", true); + this.currencySymbol = new XFAObjectArray(3); + } +} +class DatePattern extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "datePattern"); + this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); + } +} +class DatePatterns extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "datePatterns", true); + this.datePattern = new XFAObjectArray(4); + } +} +class DateTimeSymbols extends ContentObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "dateTimeSymbols"); + } +} +class Day extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "day"); + } +} +class DayNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "dayNames", true); + this.abbr = getInteger({ + data: attributes.abbr, + defaultValue: 0, + validate: x => x === 1 + }); + this.day = new XFAObjectArray(7); + } +} +class Era extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "era"); + } +} +class EraNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "eraNames", true); + this.era = new XFAObjectArray(2); + } +} +class locale_set_Locale extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "locale", true); + this.desc = attributes.desc || ""; + this.name = "isoname"; + this.calendarSymbols = null; + this.currencySymbols = null; + this.datePatterns = null; + this.dateTimeSymbols = null; + this.numberPatterns = null; + this.numberSymbols = null; + this.timePatterns = null; + this.typeFaces = null; + } +} +class locale_set_LocaleSet extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "localeSet", true); + this.locale = new XFAObjectArray(); + } +} +class Meridiem extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "meridiem"); + } +} +class MeridiemNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "meridiemNames", true); + this.meridiem = new XFAObjectArray(2); + } +} +class Month extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "month"); + } +} +class MonthNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "monthNames", true); + this.abbr = getInteger({ + data: attributes.abbr, + defaultValue: 0, + validate: x => x === 1 + }); + this.month = new XFAObjectArray(12); + } +} +class NumberPattern extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberPattern"); + this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); + } +} +class NumberPatterns extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberPatterns", true); + this.numberPattern = new XFAObjectArray(4); + } +} +class NumberSymbol extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberSymbol"); + this.name = getStringOption(attributes.name, ["decimal", "grouping", "percent", "minus", "zero"]); + } +} +class NumberSymbols extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberSymbols", true); + this.numberSymbol = new XFAObjectArray(5); + } +} +class TimePattern extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "timePattern"); + this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); + } +} +class TimePatterns extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "timePatterns", true); + this.timePattern = new XFAObjectArray(4); + } +} +class TypeFace extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "typeFace", true); + this.name = attributes.name | ""; + } +} +class TypeFaces extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "typeFaces", true); + this.typeFace = new XFAObjectArray(); + } +} +class LocaleSetNamespace { + static [$buildXFAObject](name, attributes) { + if (LocaleSetNamespace.hasOwnProperty(name)) { + return LocaleSetNamespace[name](attributes); + } + return undefined; + } + static calendarSymbols(attrs) { + return new CalendarSymbols(attrs); + } + static currencySymbol(attrs) { + return new CurrencySymbol(attrs); + } + static currencySymbols(attrs) { + return new CurrencySymbols(attrs); + } + static datePattern(attrs) { + return new DatePattern(attrs); + } + static datePatterns(attrs) { + return new DatePatterns(attrs); + } + static dateTimeSymbols(attrs) { + return new DateTimeSymbols(attrs); + } + static day(attrs) { + return new Day(attrs); + } + static dayNames(attrs) { + return new DayNames(attrs); + } + static era(attrs) { + return new Era(attrs); + } + static eraNames(attrs) { + return new EraNames(attrs); + } + static locale(attrs) { + return new locale_set_Locale(attrs); + } + static localeSet(attrs) { + return new locale_set_LocaleSet(attrs); + } + static meridiem(attrs) { + return new Meridiem(attrs); + } + static meridiemNames(attrs) { + return new MeridiemNames(attrs); + } + static month(attrs) { + return new Month(attrs); + } + static monthNames(attrs) { + return new MonthNames(attrs); + } + static numberPattern(attrs) { + return new NumberPattern(attrs); + } + static numberPatterns(attrs) { + return new NumberPatterns(attrs); + } + static numberSymbol(attrs) { + return new NumberSymbol(attrs); + } + static numberSymbols(attrs) { + return new NumberSymbols(attrs); + } + static timePattern(attrs) { + return new TimePattern(attrs); + } + static timePatterns(attrs) { + return new TimePatterns(attrs); + } + static typeFace(attrs) { + return new TypeFace(attrs); + } + static typeFaces(attrs) { + return new TypeFaces(attrs); + } +} + +;// ./src/core/xfa/signature.js + + +const SIGNATURE_NS_ID = NamespaceIds.signature.id; +class signature_Signature extends XFAObject { + constructor(attributes) { + super(SIGNATURE_NS_ID, "signature", true); + } +} +class SignatureNamespace { + static [$buildXFAObject](name, attributes) { + if (SignatureNamespace.hasOwnProperty(name)) { + return SignatureNamespace[name](attributes); + } + return undefined; + } + static signature(attributes) { + return new signature_Signature(attributes); + } +} + +;// ./src/core/xfa/stylesheet.js + + +const STYLESHEET_NS_ID = NamespaceIds.stylesheet.id; +class Stylesheet extends XFAObject { + constructor(attributes) { + super(STYLESHEET_NS_ID, "stylesheet", true); + } +} +class StylesheetNamespace { + static [$buildXFAObject](name, attributes) { + if (StylesheetNamespace.hasOwnProperty(name)) { + return StylesheetNamespace[name](attributes); + } + return undefined; + } + static stylesheet(attributes) { + return new Stylesheet(attributes); + } +} + +;// ./src/core/xfa/xdp.js + + + +const XDP_NS_ID = NamespaceIds.xdp.id; +class xdp_Xdp extends XFAObject { + constructor(attributes) { + super(XDP_NS_ID, "xdp", true); + this.uuid = attributes.uuid || ""; + this.timeStamp = attributes.timeStamp || ""; + this.config = null; + this.connectionSet = null; + this.datasets = null; + this.localeSet = null; + this.stylesheet = new XFAObjectArray(); + this.template = null; + } + [$onChildCheck](child) { + const ns = NamespaceIds[child[$nodeName]]; + return ns && child[$namespaceId] === ns.id; + } +} +class XdpNamespace { + static [$buildXFAObject](name, attributes) { + if (XdpNamespace.hasOwnProperty(name)) { + return XdpNamespace[name](attributes); + } + return undefined; + } + static xdp(attributes) { + return new xdp_Xdp(attributes); + } +} + +;// ./src/core/xfa/xhtml.js + + + + + +const XHTML_NS_ID = NamespaceIds.xhtml.id; +const $richText = Symbol(); +const VALID_STYLES = new Set(["color", "font", "font-family", "font-size", "font-stretch", "font-style", "font-weight", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "letter-spacing", "line-height", "orphans", "page-break-after", "page-break-before", "page-break-inside", "tab-interval", "tab-stop", "text-align", "text-decoration", "text-indent", "vertical-align", "widows", "kerning-mode", "xfa-font-horizontal-scale", "xfa-font-vertical-scale", "xfa-spacerun", "xfa-tab-stops"]); +const StyleMapping = new Map([["page-break-after", "breakAfter"], ["page-break-before", "breakBefore"], ["page-break-inside", "breakInside"], ["kerning-mode", value => value === "none" ? "none" : "normal"], ["xfa-font-horizontal-scale", value => `scaleX(${Math.max(0, parseInt(value) / 100).toFixed(2)})`], ["xfa-font-vertical-scale", value => `scaleY(${Math.max(0, parseInt(value) / 100).toFixed(2)})`], ["xfa-spacerun", ""], ["xfa-tab-stops", ""], ["font-size", (value, original) => { + value = original.fontSize = Math.abs(getMeasurement(value)); + return measureToString(0.99 * value); +}], ["letter-spacing", value => measureToString(getMeasurement(value))], ["line-height", value => measureToString(getMeasurement(value))], ["margin", value => measureToString(getMeasurement(value))], ["margin-bottom", value => measureToString(getMeasurement(value))], ["margin-left", value => measureToString(getMeasurement(value))], ["margin-right", value => measureToString(getMeasurement(value))], ["margin-top", value => measureToString(getMeasurement(value))], ["text-indent", value => measureToString(getMeasurement(value))], ["font-family", value => value], ["vertical-align", value => measureToString(getMeasurement(value))]]); +const spacesRegExp = /\s+/g; +const crlfRegExp = /[\r\n]+/g; +const crlfForRichTextRegExp = /\r\n?/g; +function mapStyle(styleStr, node, richText) { + const style = Object.create(null); + if (!styleStr) { + return style; + } + const original = Object.create(null); + for (const [key, value] of styleStr.split(";").map(s => s.split(":", 2))) { + const mapping = StyleMapping.get(key); + if (mapping === "") { + continue; + } + let newValue = value; + if (mapping) { + newValue = typeof mapping === "string" ? mapping : mapping(value, original); + } + if (key.endsWith("scale")) { + style.transform = style.transform ? `${style[key]} ${newValue}` : newValue; + } else { + style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] = newValue; + } + } + if (style.fontFamily) { + setFontFamily({ + typeface: style.fontFamily, + weight: style.fontWeight || "normal", + posture: style.fontStyle || "normal", + size: original.fontSize || 0 + }, node, node[$globalData].fontFinder, style); + } + if (richText && style.verticalAlign && style.verticalAlign !== "0px" && style.fontSize) { + const SUB_SUPER_SCRIPT_FACTOR = 0.583; + const VERTICAL_FACTOR = 0.333; + const fontSize = getMeasurement(style.fontSize); + style.fontSize = measureToString(fontSize * SUB_SUPER_SCRIPT_FACTOR); + style.verticalAlign = measureToString(Math.sign(getMeasurement(style.verticalAlign)) * fontSize * VERTICAL_FACTOR); + } + if (richText && style.fontSize) { + style.fontSize = `calc(${style.fontSize} * var(--total-scale-factor))`; + } + fixTextIndent(style); + return style; +} +function checkStyle(node) { + if (!node.style) { + return ""; + } + return node.style.split(";").filter(s => !!s.trim()).map(s => s.split(":", 2).map(t => t.trim())).filter(([key, value]) => { + if (key === "font-family") { + node[$globalData].usedTypefaces.add(value); + } + return VALID_STYLES.has(key); + }).map(kv => kv.join(":")).join(";"); +} +const NoWhites = new Set(["body", "html"]); +class XhtmlObject extends XmlObject { + constructor(attributes, name) { + super(XHTML_NS_ID, name); + this[$richText] = false; + this.style = attributes.style || ""; + } + [$clean](builder) { + super[$clean](builder); + this.style = checkStyle(this); + } + [$acceptWhitespace]() { + return !NoWhites.has(this[$nodeName]); + } + [$onText](str, richText = false) { + if (!richText) { + str = str.replaceAll(crlfRegExp, ""); + if (!this.style.includes("xfa-spacerun:yes")) { + str = str.replaceAll(spacesRegExp, " "); + } + } else { + this[$richText] = true; + } + if (str) { + this[$content] += str; + } + } + [$pushGlyphs](measure, mustPop = true) { + const xfaFont = Object.create(null); + const margin = { + top: NaN, + bottom: NaN, + left: NaN, + right: NaN + }; + let lineHeight = null; + for (const [key, value] of this.style.split(";").map(s => s.split(":", 2))) { + switch (key) { + case "font-family": + xfaFont.typeface = stripQuotes(value); + break; + case "font-size": + xfaFont.size = getMeasurement(value); + break; + case "font-weight": + xfaFont.weight = value; + break; + case "font-style": + xfaFont.posture = value; + break; + case "letter-spacing": + xfaFont.letterSpacing = getMeasurement(value); + break; + case "margin": + const values = value.split(/ \t/).map(x => getMeasurement(x)); + switch (values.length) { + case 1: + margin.top = margin.bottom = margin.left = margin.right = values[0]; + break; + case 2: + margin.top = margin.bottom = values[0]; + margin.left = margin.right = values[1]; + break; + case 3: + margin.top = values[0]; + margin.bottom = values[2]; + margin.left = margin.right = values[1]; + break; + case 4: + margin.top = values[0]; + margin.left = values[1]; + margin.bottom = values[2]; + margin.right = values[3]; + break; + } + break; + case "margin-top": + margin.top = getMeasurement(value); + break; + case "margin-bottom": + margin.bottom = getMeasurement(value); + break; + case "margin-left": + margin.left = getMeasurement(value); + break; + case "margin-right": + margin.right = getMeasurement(value); + break; + case "line-height": + lineHeight = getMeasurement(value); + break; + } + } + measure.pushData(xfaFont, margin, lineHeight); + if (this[$content]) { + measure.addString(this[$content]); + } else { + for (const child of this[$getChildren]()) { + if (child[$nodeName] === "#text") { + measure.addString(child[$content]); + continue; + } + child[$pushGlyphs](measure); + } + } + if (mustPop) { + measure.popFont(); + } + } + [$toHTML](availableSpace) { + const children = []; + this[$extra] = { + children + }; + this[$childrenToHTML]({}); + if (children.length === 0 && !this[$content]) { + return HTMLResult.EMPTY; + } + let value; + if (this[$richText]) { + value = this[$content] ? this[$content].replaceAll(crlfForRichTextRegExp, "\n") : undefined; + } else { + value = this[$content] || undefined; + } + return HTMLResult.success({ + name: this[$nodeName], + attributes: { + href: this.href, + style: mapStyle(this.style, this, this[$richText]) + }, + children, + value + }); + } +} +class A extends XhtmlObject { + constructor(attributes) { + super(attributes, "a"); + this.href = fixURL(attributes.href) || ""; + } +} +class B extends XhtmlObject { + constructor(attributes) { + super(attributes, "b"); + } + [$pushGlyphs](measure) { + measure.pushFont({ + weight: "bold" + }); + super[$pushGlyphs](measure); + measure.popFont(); + } +} +class Body extends XhtmlObject { + constructor(attributes) { + super(attributes, "body"); + } + [$toHTML](availableSpace) { + const res = super[$toHTML](availableSpace); + const { + html + } = res; + if (!html) { + return HTMLResult.EMPTY; + } + html.name = "div"; + html.attributes.class = ["xfaRich"]; + return res; + } +} +class Br extends XhtmlObject { + constructor(attributes) { + super(attributes, "br"); + } + [$text]() { + return "\n"; + } + [$pushGlyphs](measure) { + measure.addString("\n"); + } + [$toHTML](availableSpace) { + return HTMLResult.success({ + name: "br" + }); + } +} +class Html extends XhtmlObject { + constructor(attributes) { + super(attributes, "html"); + } + [$toHTML](availableSpace) { + const children = []; + this[$extra] = { + children + }; + this[$childrenToHTML]({}); + if (children.length === 0) { + return HTMLResult.success({ + name: "div", + attributes: { + class: ["xfaRich"], + style: {} + }, + value: this[$content] || "" + }); + } + if (children.length === 1) { + const child = children[0]; + if (child.attributes?.class.includes("xfaRich")) { + return HTMLResult.success(child); + } + } + return HTMLResult.success({ + name: "div", + attributes: { + class: ["xfaRich"], + style: {} + }, + children + }); + } +} +class I extends XhtmlObject { + constructor(attributes) { + super(attributes, "i"); + } + [$pushGlyphs](measure) { + measure.pushFont({ + posture: "italic" + }); + super[$pushGlyphs](measure); + measure.popFont(); + } +} +class Li extends XhtmlObject { + constructor(attributes) { + super(attributes, "li"); + } +} +class Ol extends XhtmlObject { + constructor(attributes) { + super(attributes, "ol"); + } +} +class P extends XhtmlObject { + constructor(attributes) { + super(attributes, "p"); + } + [$pushGlyphs](measure) { + super[$pushGlyphs](measure, false); + measure.addString("\n"); + measure.addPara(); + measure.popFont(); + } + [$text]() { + const siblings = this[$getParent]()[$getChildren](); + if (siblings.at(-1) === this) { + return super[$text](); + } + return super[$text]() + "\n"; + } +} +class Span extends XhtmlObject { + constructor(attributes) { + super(attributes, "span"); + } +} +class Sub extends XhtmlObject { + constructor(attributes) { + super(attributes, "sub"); + } +} +class Sup extends XhtmlObject { + constructor(attributes) { + super(attributes, "sup"); + } +} +class Ul extends XhtmlObject { + constructor(attributes) { + super(attributes, "ul"); + } +} +class XhtmlNamespace { + static [$buildXFAObject](name, attributes) { + if (XhtmlNamespace.hasOwnProperty(name)) { + return XhtmlNamespace[name](attributes); + } + return undefined; + } + static a(attributes) { + return new A(attributes); + } + static b(attributes) { + return new B(attributes); + } + static body(attributes) { + return new Body(attributes); + } + static br(attributes) { + return new Br(attributes); + } + static html(attributes) { + return new Html(attributes); + } + static i(attributes) { + return new I(attributes); + } + static li(attributes) { + return new Li(attributes); + } + static ol(attributes) { + return new Ol(attributes); + } + static p(attributes) { + return new P(attributes); + } + static span(attributes) { + return new Span(attributes); + } + static sub(attributes) { + return new Sub(attributes); + } + static sup(attributes) { + return new Sup(attributes); + } + static ul(attributes) { + return new Ul(attributes); + } +} + +;// ./src/core/xfa/setup.js + + + + + + + + + +const NamespaceSetUp = { + config: ConfigNamespace, + connection: ConnectionSetNamespace, + datasets: DatasetsNamespace, + localeSet: LocaleSetNamespace, + signature: SignatureNamespace, + stylesheet: StylesheetNamespace, + template: TemplateNamespace, + xdp: XdpNamespace, + xhtml: XhtmlNamespace +}; + +;// ./src/core/xfa/unknown.js + + +class UnknownNamespace { + constructor(nsId) { + this.namespaceId = nsId; + } + [$buildXFAObject](name, attributes) { + return new XmlObject(this.namespaceId, name, attributes); + } +} + +;// ./src/core/xfa/builder.js + + + + + + + +class Root extends XFAObject { + constructor(ids) { + super(-1, "root", Object.create(null)); + this.element = null; + this[$ids] = ids; + } + [$onChild](child) { + this.element = child; + return true; + } + [$finalize]() { + super[$finalize](); + if (this.element.template instanceof Template) { + this[$ids].set($root, this.element); + this.element.template[$resolvePrototypes](this[$ids]); + this.element.template[$ids] = this[$ids]; + } + } +} +class Empty extends XFAObject { + constructor() { + super(-1, "", Object.create(null)); + } + [$onChild](_) { + return false; + } +} +class Builder { + constructor(rootNameSpace = null) { + this._namespaceStack = []; + this._nsAgnosticLevel = 0; + this._namespacePrefixes = new Map(); + this._namespaces = new Map(); + this._nextNsId = Math.max(...Object.values(NamespaceIds).map(({ + id + }) => id)); + this._currentNamespace = rootNameSpace || new UnknownNamespace(++this._nextNsId); + } + buildRoot(ids) { + return new Root(ids); + } + build({ + nsPrefix, + name, + attributes, + namespace, + prefixes + }) { + const hasNamespaceDef = namespace !== null; + if (hasNamespaceDef) { + this._namespaceStack.push(this._currentNamespace); + this._currentNamespace = this._searchNamespace(namespace); + } + if (prefixes) { + this._addNamespacePrefix(prefixes); + } + if (attributes.hasOwnProperty($nsAttributes)) { + const dataTemplate = NamespaceSetUp.datasets; + const nsAttrs = attributes[$nsAttributes]; + let xfaAttrs = null; + for (const [ns, attrs] of Object.entries(nsAttrs)) { + const nsToUse = this._getNamespaceToUse(ns); + if (nsToUse === dataTemplate) { + xfaAttrs = { + xfa: attrs + }; + break; + } + } + if (xfaAttrs) { + attributes[$nsAttributes] = xfaAttrs; + } else { + delete attributes[$nsAttributes]; + } + } + const namespaceToUse = this._getNamespaceToUse(nsPrefix); + const node = namespaceToUse?.[$buildXFAObject](name, attributes) || new Empty(); + if (node[$isNsAgnostic]()) { + this._nsAgnosticLevel++; + } + if (hasNamespaceDef || prefixes || node[$isNsAgnostic]()) { + node[$cleanup] = { + hasNamespace: hasNamespaceDef, + prefixes, + nsAgnostic: node[$isNsAgnostic]() + }; + } + return node; + } + isNsAgnostic() { + return this._nsAgnosticLevel > 0; + } + _searchNamespace(nsName) { + let ns = this._namespaces.get(nsName); + if (ns) { + return ns; + } + for (const [name, { + check + }] of Object.entries(NamespaceIds)) { + if (check(nsName)) { + ns = NamespaceSetUp[name]; + if (ns) { + this._namespaces.set(nsName, ns); + return ns; + } + break; + } + } + ns = new UnknownNamespace(++this._nextNsId); + this._namespaces.set(nsName, ns); + return ns; + } + _addNamespacePrefix(prefixes) { + for (const { + prefix, + value + } of prefixes) { + const namespace = this._searchNamespace(value); + let prefixStack = this._namespacePrefixes.get(prefix); + if (!prefixStack) { + prefixStack = []; + this._namespacePrefixes.set(prefix, prefixStack); + } + prefixStack.push(namespace); + } + } + _getNamespaceToUse(prefix) { + if (!prefix) { + return this._currentNamespace; + } + const prefixStack = this._namespacePrefixes.get(prefix); + if (prefixStack?.length > 0) { + return prefixStack.at(-1); + } + warn(`Unknown namespace prefix: ${prefix}.`); + return null; + } + clean(data) { + const { + hasNamespace, + prefixes, + nsAgnostic + } = data; + if (hasNamespace) { + this._currentNamespace = this._namespaceStack.pop(); + } + if (prefixes) { + prefixes.forEach(({ + prefix + }) => { + this._namespacePrefixes.get(prefix).pop(); + }); + } + if (nsAgnostic) { + this._nsAgnosticLevel--; + } + } +} + +;// ./src/core/xfa/parser.js + + + + +class XFAParser extends XMLParserBase { + constructor(rootNameSpace = null, richText = false) { + super(); + this._builder = new Builder(rootNameSpace); + this._stack = []; + this._globalData = { + usedTypefaces: new Set() + }; + this._ids = new Map(); + this._current = this._builder.buildRoot(this._ids); + this._errorCode = XMLParserErrorCode.NoError; + this._whiteRegex = /^\s+$/; + this._nbsps = /\xa0+/g; + this._richText = richText; + } + parse(data) { + this.parseXml(data); + if (this._errorCode !== XMLParserErrorCode.NoError) { + return undefined; + } + this._current[$finalize](); + return this._current.element; + } + onText(text) { + text = text.replace(this._nbsps, match => match.slice(1) + " "); + if (this._richText || this._current[$acceptWhitespace]()) { + this._current[$onText](text, this._richText); + return; + } + if (this._whiteRegex.test(text)) { + return; + } + this._current[$onText](text.trim()); + } + onCdata(text) { + this._current[$onText](text); + } + _mkAttributes(attributes, tagName) { + let namespace = null; + let prefixes = null; + const attributeObj = Object.create({}); + for (const { + name, + value + } of attributes) { + if (name === "xmlns") { + if (!namespace) { + namespace = value; + } else { + warn(`XFA - multiple namespace definition in <${tagName}>`); + } + } else if (name.startsWith("xmlns:")) { + const prefix = name.substring("xmlns:".length); + prefixes ??= []; + prefixes.push({ + prefix, + value + }); + } else { + const i = name.indexOf(":"); + if (i === -1) { + attributeObj[name] = value; + } else { + const nsAttrs = attributeObj[$nsAttributes] ??= Object.create(null); + const [ns, attrName] = [name.slice(0, i), name.slice(i + 1)]; + const attrs = nsAttrs[ns] ||= Object.create(null); + attrs[attrName] = value; + } + } + } + return [namespace, prefixes, attributeObj]; + } + _getNameAndPrefix(name, nsAgnostic) { + const i = name.indexOf(":"); + if (i === -1) { + return [name, null]; + } + return [name.substring(i + 1), nsAgnostic ? "" : name.substring(0, i)]; + } + onBeginElement(tagName, attributes, isEmpty) { + const [namespace, prefixes, attributesObj] = this._mkAttributes(attributes, tagName); + const [name, nsPrefix] = this._getNameAndPrefix(tagName, this._builder.isNsAgnostic()); + const node = this._builder.build({ + nsPrefix, + name, + attributes: attributesObj, + namespace, + prefixes + }); + node[$globalData] = this._globalData; + if (isEmpty) { + node[$finalize](); + if (this._current[$onChild](node)) { + node[$setId](this._ids); + } + node[$clean](this._builder); + return; + } + this._stack.push(this._current); + this._current = node; + } + onEndElement(name) { + const node = this._current; + if (node[$isCDATAXml]() && typeof node[$content] === "string") { + const parser = new XFAParser(); + parser._globalData = this._globalData; + const root = parser.parse(node[$content]); + node[$content] = null; + node[$onChild](root); + } + node[$finalize](); + this._current = this._stack.pop(); + if (this._current[$onChild](node)) { + node[$setId](this._ids); + } + node[$clean](this._builder); + } + onError(code) { + this._errorCode = code; + } +} + +;// ./src/core/xfa/factory.js + + + + + + + + +class XFAFactory { + constructor(data) { + try { + this.root = new XFAParser().parse(XFAFactory._createDocument(data)); + const binder = new Binder(this.root); + this.form = binder.bind(); + this.dataHandler = new DataHandler(this.root, binder.getData()); + this.form[$globalData].template = this.form; + } catch (e) { + warn(`XFA - an error occurred during parsing and binding: ${e}`); + } + } + isValid() { + return !!(this.root && this.form); + } + _createPagesHelper() { + const iterator = this.form[$toPages](); + return new Promise((resolve, reject) => { + const nextIteration = () => { + try { + const value = iterator.next(); + if (value.done) { + resolve(value.value); + } else { + setTimeout(nextIteration, 0); + } + } catch (e) { + reject(e); + } + }; + setTimeout(nextIteration, 0); + }); + } + async _createPages() { + try { + this.pages = await this._createPagesHelper(); + this.dims = this.pages.children.map(c => { + const { + width, + height + } = c.attributes.style; + return [0, 0, parseInt(width), parseInt(height)]; + }); + } catch (e) { + warn(`XFA - an error occurred during layout: ${e}`); + } + } + getBoundingBox(pageIndex) { + return this.dims[pageIndex]; + } + async getNumPages() { + if (!this.pages) { + await this._createPages(); + } + return this.dims.length; + } + setImages(images) { + this.form[$globalData].images = images; + } + setFonts(fonts) { + this.form[$globalData].fontFinder = new FontFinder(fonts); + const missingFonts = []; + for (let typeface of this.form[$globalData].usedTypefaces) { + typeface = stripQuotes(typeface); + const font = this.form[$globalData].fontFinder.find(typeface); + if (!font) { + missingFonts.push(typeface); + } + } + if (missingFonts.length > 0) { + return missingFonts; + } + return null; + } + appendFonts(fonts, reallyMissingFonts) { + this.form[$globalData].fontFinder.add(fonts, reallyMissingFonts); + } + async getPages() { + if (!this.pages) { + await this._createPages(); + } + const pages = this.pages; + this.pages = null; + return pages; + } + serializeData(storage) { + return this.dataHandler.serialize(storage); + } + static _createDocument(data) { + if (!data["/xdp:xdp"]) { + return data["xdp:xdp"]; + } + return Object.values(data).join(""); + } + static getRichTextAsHtml(rc) { + if (!rc || typeof rc !== "string") { + return null; + } + try { + let root = new XFAParser(XhtmlNamespace, true).parse(rc); + if (!["body", "xhtml"].includes(root[$nodeName])) { + const newRoot = XhtmlNamespace.body({}); + newRoot[$appendChild](root); + root = newRoot; + } + const result = root[$toHTML](); + if (!result.success) { + return null; + } + const { + html + } = result; + const { + attributes + } = html; + if (attributes) { + if (attributes.class) { + attributes.class = attributes.class.filter(attr => !attr.startsWith("xfa")); + } + attributes.dir = "auto"; + } + return { + html, + str: root[$text]() + }; + } catch (e) { + warn(`XFA - an error occurred during parsing of rich text: ${e}`); + } + return null; + } +} + +;// ./src/core/annotation.js + + + + + + + + + + + + + + + +class AnnotationFactory { + static createGlobals(pdfManager) { + return Promise.all([pdfManager.ensureCatalog("acroForm"), pdfManager.ensureDoc("xfaDatasets"), pdfManager.ensureCatalog("structTreeRoot"), pdfManager.ensureCatalog("baseUrl"), pdfManager.ensureCatalog("attachments"), pdfManager.ensureCatalog("globalColorSpaceCache")]).then(([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments, globalColorSpaceCache]) => ({ + pdfManager, + acroForm: acroForm instanceof Dict ? acroForm : Dict.empty, + xfaDatasets, + structTreeRoot, + baseUrl, + attachments, + globalColorSpaceCache + }), reason => { + warn(`createGlobals: "${reason}".`); + return null; + }); + } + static async create(xref, ref, annotationGlobals, idFactory, collectFields, orphanFields, collectByType, pageRef) { + const pageIndex = collectFields ? await this._getPageIndex(xref, ref, annotationGlobals.pdfManager) : null; + return annotationGlobals.pdfManager.ensure(this, "_create", [xref, ref, annotationGlobals, idFactory, collectFields, orphanFields, collectByType, pageIndex, pageRef]); + } + static _create(xref, ref, annotationGlobals, idFactory, collectFields = false, orphanFields = null, collectByType = null, pageIndex = null, pageRef = null) { + const dict = xref.fetchIfRef(ref); + if (!(dict instanceof Dict)) { + return undefined; + } + let subtype = dict.get("Subtype"); + subtype = subtype instanceof Name ? subtype.name : null; + if (collectByType && !collectByType.has(AnnotationType[subtype.toUpperCase()])) { + return null; + } + const { + acroForm, + pdfManager + } = annotationGlobals; + const id = ref instanceof Ref ? ref.toString() : `annot_${idFactory.createObjId()}`; + const parameters = { + xref, + ref, + dict, + subtype, + id, + annotationGlobals, + collectFields, + orphanFields, + needAppearances: !collectFields && acroForm.get("NeedAppearances") === true, + pageIndex, + evaluatorOptions: pdfManager.evaluatorOptions, + pageRef + }; + switch (subtype) { + case "Link": + return new LinkAnnotation(parameters); + case "Text": + return new TextAnnotation(parameters); + case "Widget": + let fieldType = getInheritableProperty({ + dict, + key: "FT" + }); + fieldType = fieldType instanceof Name ? fieldType.name : null; + switch (fieldType) { + case "Tx": + return new TextWidgetAnnotation(parameters); + case "Btn": + return new ButtonWidgetAnnotation(parameters); + case "Ch": + return new ChoiceWidgetAnnotation(parameters); + case "Sig": + return new SignatureWidgetAnnotation(parameters); + } + warn(`Unimplemented widget field type "${fieldType}", ` + "falling back to base field type."); + return new WidgetAnnotation(parameters); + case "Popup": + return new PopupAnnotation(parameters); + case "FreeText": + return new FreeTextAnnotation(parameters); + case "Line": + return new LineAnnotation(parameters); + case "Square": + return new SquareAnnotation(parameters); + case "Circle": + return new CircleAnnotation(parameters); + case "PolyLine": + return new PolylineAnnotation(parameters); + case "Polygon": + return new PolygonAnnotation(parameters); + case "Caret": + return new CaretAnnotation(parameters); + case "Ink": + return new InkAnnotation(parameters); + case "Highlight": + return new HighlightAnnotation(parameters); + case "Underline": + return new UnderlineAnnotation(parameters); + case "Squiggly": + return new SquigglyAnnotation(parameters); + case "StrikeOut": + return new StrikeOutAnnotation(parameters); + case "Stamp": + return new StampAnnotation(parameters); + case "FileAttachment": + return new FileAttachmentAnnotation(parameters); + default: + if (!collectFields) { + if (!subtype) { + warn("Annotation is missing the required /Subtype."); + } else { + warn(`Unimplemented annotation type "${subtype}", ` + "falling back to base annotation."); + } + } + return new Annotation(parameters); + } + } + static async _getPageIndex(xref, ref, pdfManager) { + try { + const annotDict = await xref.fetchIfRefAsync(ref); + if (!(annotDict instanceof Dict)) { + return -1; + } + const pageRef = annotDict.getRaw("P"); + if (pageRef instanceof Ref) { + try { + const pageIndex = await pdfManager.ensureCatalog("getPageIndex", [pageRef]); + return pageIndex; + } catch (ex) { + info(`_getPageIndex -- not a valid page reference: "${ex}".`); + } + } + if (annotDict.has("Kids")) { + return -1; + } + const numPages = await pdfManager.ensureDoc("numPages"); + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + const page = await pdfManager.getPage(pageIndex); + const annotations = await pdfManager.ensure(page, "annotations"); + for (const annotRef of annotations) { + if (annotRef instanceof Ref && isRefsEqual(annotRef, ref)) { + return pageIndex; + } + } + } + } catch (ex) { + warn(`_getPageIndex: "${ex}".`); + } + return -1; + } + static generateImages(annotations, xref, isOffscreenCanvasSupported) { + if (!isOffscreenCanvasSupported) { + warn("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."); + return null; + } + let imagePromises; + for (const { + bitmapId, + bitmap + } of annotations) { + if (!bitmap) { + continue; + } + imagePromises ||= new Map(); + imagePromises.set(bitmapId, StampAnnotation.createImage(bitmap, xref)); + } + return imagePromises; + } + static async saveNewAnnotations(evaluator, task, annotations, imagePromises, changes) { + const xref = evaluator.xref; + let baseFontRef; + const promises = []; + const { + isOffscreenCanvasSupported + } = evaluator.options; + for (const annotation of annotations) { + if (annotation.deleted) { + continue; + } + switch (annotation.annotationType) { + case AnnotationEditorType.FREETEXT: + if (!baseFontRef) { + const baseFont = new Dict(xref); + baseFont.setIfName("BaseFont", "Helvetica"); + baseFont.setIfName("Type", "Font"); + baseFont.setIfName("Subtype", "Type1"); + baseFont.setIfName("Encoding", "WinAnsiEncoding"); + baseFontRef = xref.getNewTemporaryRef(); + changes.put(baseFontRef, { + data: baseFont + }); + } + promises.push(FreeTextAnnotation.createNewAnnotation(xref, annotation, changes, { + evaluator, + task, + baseFontRef + })); + break; + case AnnotationEditorType.HIGHLIGHT: + if (annotation.quadPoints) { + promises.push(HighlightAnnotation.createNewAnnotation(xref, annotation, changes)); + } else { + promises.push(InkAnnotation.createNewAnnotation(xref, annotation, changes)); + } + break; + case AnnotationEditorType.INK: + promises.push(InkAnnotation.createNewAnnotation(xref, annotation, changes)); + break; + case AnnotationEditorType.STAMP: + const image = isOffscreenCanvasSupported ? await imagePromises?.get(annotation.bitmapId) : null; + if (image?.imageStream) { + const { + imageStream, + smaskStream + } = image; + if (smaskStream) { + const smaskRef = xref.getNewTemporaryRef(); + changes.put(smaskRef, { + data: smaskStream + }); + imageStream.dict.set("SMask", smaskRef); + } + const imageRef = image.imageRef = xref.getNewTemporaryRef(); + changes.put(imageRef, { + data: imageStream + }); + image.imageStream = image.smaskStream = null; + } + promises.push(StampAnnotation.createNewAnnotation(xref, annotation, changes, { + image + })); + break; + case AnnotationEditorType.SIGNATURE: + promises.push(StampAnnotation.createNewAnnotation(xref, annotation, changes, {})); + break; + } + } + return { + annotations: (await Promise.all(promises)).flat() + }; + } + static async printNewAnnotations(annotationGlobals, evaluator, task, annotations, imagePromises) { + if (!annotations) { + return null; + } + const { + options, + xref + } = evaluator; + const promises = []; + for (const annotation of annotations) { + if (annotation.deleted) { + continue; + } + switch (annotation.annotationType) { + case AnnotationEditorType.FREETEXT: + promises.push(FreeTextAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluator, + task, + evaluatorOptions: options + })); + break; + case AnnotationEditorType.HIGHLIGHT: + if (annotation.quadPoints) { + promises.push(HighlightAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluatorOptions: options + })); + } else { + promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluatorOptions: options + })); + } + break; + case AnnotationEditorType.INK: + promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluatorOptions: options + })); + break; + case AnnotationEditorType.STAMP: + const image = options.isOffscreenCanvasSupported ? await imagePromises?.get(annotation.bitmapId) : null; + if (image?.imageStream) { + const { + imageStream, + smaskStream + } = image; + if (smaskStream) { + imageStream.dict.set("SMask", smaskStream); + } + image.imageRef = new JpegStream(imageStream, imageStream.length); + image.imageStream = image.smaskStream = null; + } + promises.push(StampAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + image, + evaluatorOptions: options + })); + break; + case AnnotationEditorType.SIGNATURE: + promises.push(StampAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluatorOptions: options + })); + break; + } + } + return Promise.all(promises); + } +} +function getRgbColor(color, defaultColor = new Uint8ClampedArray(3)) { + if (!Array.isArray(color)) { + return defaultColor; + } + const rgbColor = defaultColor || new Uint8ClampedArray(3); + switch (color.length) { + case 0: + return null; + case 1: + ColorSpaceUtils.gray.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; + case 3: + ColorSpaceUtils.rgb.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; + case 4: + ColorSpaceUtils.cmyk.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; + default: + return defaultColor; + } +} +function getPdfColorArray(color, defaultValue = null) { + return color && Array.from(color, c => c / 255) || defaultValue; +} +function getQuadPoints(dict, rect) { + const quadPoints = dict.getArray("QuadPoints"); + if (!isNumberArray(quadPoints, null) || quadPoints.length === 0 || quadPoints.length % 8 > 0) { + return null; + } + const newQuadPoints = new Float32Array(quadPoints.length); + for (let i = 0, ii = quadPoints.length; i < ii; i += 8) { + const [x1, y1, x2, y2, x3, y3, x4, y4] = quadPoints.slice(i, i + 8); + const minX = Math.min(x1, x2, x3, x4); + const maxX = Math.max(x1, x2, x3, x4); + const minY = Math.min(y1, y2, y3, y4); + const maxY = Math.max(y1, y2, y3, y4); + if (rect !== null && (minX < rect[0] || maxX > rect[2] || minY < rect[1] || maxY > rect[3])) { + return null; + } + newQuadPoints.set([minX, maxY, maxX, maxY, minX, minY, maxX, minY], i); + } + return newQuadPoints; +} +function getTransformMatrix(rect, bbox, matrix) { + const minMax = new Float32Array([Infinity, Infinity, -Infinity, -Infinity]); + Util.axialAlignedBoundingBox(bbox, matrix, minMax); + const [minX, minY, maxX, maxY] = minMax; + if (minX === maxX || minY === maxY) { + return [1, 0, 0, 1, rect[0], rect[1]]; + } + const xRatio = (rect[2] - rect[0]) / (maxX - minX); + const yRatio = (rect[3] - rect[1]) / (maxY - minY); + return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio]; +} +class Annotation { + constructor(params) { + const { + dict, + xref, + annotationGlobals, + ref, + orphanFields + } = params; + const parentRef = orphanFields?.get(ref); + if (parentRef) { + dict.set("Parent", parentRef); + } + this.setTitle(dict.get("T")); + this.setContents(dict.get("Contents")); + this.setModificationDate(dict.get("M")); + this.setFlags(dict.get("F")); + this.setRectangle(dict.getArray("Rect")); + this.setColor(dict.getArray("C")); + this.setBorderStyle(dict); + this.setAppearance(dict); + this.setOptionalContent(dict); + const MK = dict.get("MK"); + this.setBorderAndBackgroundColors(MK); + this.setRotation(MK, dict); + this.ref = params.ref instanceof Ref ? params.ref : null; + this._streams = []; + if (this.appearance) { + this._streams.push(this.appearance); + } + const isLocked = !!(this.flags & AnnotationFlag.LOCKED); + const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS); + this.data = { + annotationFlags: this.flags, + borderStyle: this.borderStyle, + color: this.color, + backgroundColor: this.backgroundColor, + borderColor: this.borderColor, + rotation: this.rotation, + contentsObj: this._contents, + hasAppearance: !!this.appearance, + id: params.id, + modificationDate: this.modificationDate, + rect: this.rectangle, + subtype: params.subtype, + hasOwnCanvas: false, + noRotate: !!(this.flags & AnnotationFlag.NOROTATE), + noHTML: isLocked && isContentLocked, + isEditable: false, + structParent: -1 + }; + if (annotationGlobals.structTreeRoot) { + let structParent = dict.get("StructParent"); + this.data.structParent = structParent = Number.isInteger(structParent) && structParent >= 0 ? structParent : -1; + annotationGlobals.structTreeRoot.addAnnotationIdToPage(params.pageRef, structParent); + } + if (params.collectFields) { + const kids = dict.get("Kids"); + if (Array.isArray(kids)) { + const kidIds = []; + for (const kid of kids) { + if (kid instanceof Ref) { + kidIds.push(kid.toString()); + } + } + if (kidIds.length !== 0) { + this.data.kidIds = kidIds; + } + } + this.data.actions = collectActions(xref, dict, AnnotationActionEventType); + this.data.fieldName = this._constructFieldName(dict); + this.data.pageIndex = params.pageIndex; + } + const it = dict.get("IT"); + if (it instanceof Name) { + this.data.it = it.name; + } + this._isOffscreenCanvasSupported = params.evaluatorOptions.isOffscreenCanvasSupported; + this._fallbackFontDict = null; + this._needAppearances = false; + } + _hasFlag(flags, flag) { + return !!(flags & flag); + } + _buildFlags(noView, noPrint) { + let { + flags + } = this; + if (noView === undefined) { + if (noPrint === undefined) { + return undefined; + } + if (noPrint) { + return flags & ~AnnotationFlag.PRINT; + } + return flags & ~AnnotationFlag.HIDDEN | AnnotationFlag.PRINT; + } + if (noView) { + flags |= AnnotationFlag.PRINT; + if (noPrint) { + return flags & ~AnnotationFlag.NOVIEW | AnnotationFlag.HIDDEN; + } + return flags & ~AnnotationFlag.HIDDEN | AnnotationFlag.NOVIEW; + } + flags &= ~(AnnotationFlag.HIDDEN | AnnotationFlag.NOVIEW); + if (noPrint) { + return flags & ~AnnotationFlag.PRINT; + } + return flags | AnnotationFlag.PRINT; + } + _isViewable(flags) { + return !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, AnnotationFlag.NOVIEW); + } + _isPrintable(flags) { + return this._hasFlag(flags, AnnotationFlag.PRINT) && !this._hasFlag(flags, AnnotationFlag.HIDDEN) && !this._hasFlag(flags, AnnotationFlag.INVISIBLE); + } + mustBeViewed(annotationStorage, _renderForms) { + const noView = annotationStorage?.get(this.data.id)?.noView; + if (noView !== undefined) { + return !noView; + } + return this.viewable && !this._hasFlag(this.flags, AnnotationFlag.HIDDEN); + } + mustBePrinted(annotationStorage) { + const noPrint = annotationStorage?.get(this.data.id)?.noPrint; + if (noPrint !== undefined) { + return !noPrint; + } + return this.printable; + } + mustBeViewedWhenEditing(isEditing, modifiedIds = null) { + return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id); + } + get viewable() { + if (this.data.quadPoints === null) { + return false; + } + if (this.flags === 0) { + return true; + } + return this._isViewable(this.flags); + } + get printable() { + if (this.data.quadPoints === null) { + return false; + } + if (this.flags === 0) { + return false; + } + return this._isPrintable(this.flags); + } + _parseStringHelper(data) { + const str = typeof data === "string" ? stringToPDFString(data) : ""; + const dir = str && bidi(str).dir === "rtl" ? "rtl" : "ltr"; + return { + str, + dir + }; + } + setDefaultAppearance(params) { + const { + dict, + annotationGlobals + } = params; + const defaultAppearance = getInheritableProperty({ + dict, + key: "DA" + }) || annotationGlobals.acroForm.get("DA"); + this._defaultAppearance = typeof defaultAppearance === "string" ? defaultAppearance : ""; + this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance); + } + setTitle(title) { + this._title = this._parseStringHelper(title); + } + setContents(contents) { + this._contents = this._parseStringHelper(contents); + } + setModificationDate(modificationDate) { + this.modificationDate = typeof modificationDate === "string" ? modificationDate : null; + } + setFlags(flags) { + this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0; + if (this.flags & AnnotationFlag.INVISIBLE && this.constructor.name !== "Annotation") { + this.flags ^= AnnotationFlag.INVISIBLE; + } + } + hasFlag(flag) { + return this._hasFlag(this.flags, flag); + } + setRectangle(rectangle) { + this.rectangle = lookupNormalRect(rectangle, [0, 0, 0, 0]); + } + setColor(color) { + this.color = getRgbColor(color); + } + setLineEndings(lineEndings) { + throw new Error("Not implemented: setLineEndings"); + } + setRotation(mk, dict) { + this.rotation = 0; + let angle = mk instanceof Dict ? mk.get("R") || 0 : dict.get("Rotate") || 0; + if (Number.isInteger(angle) && angle !== 0) { + angle %= 360; + if (angle < 0) { + angle += 360; + } + if (angle % 90 === 0) { + this.rotation = angle; + } + } + } + setBorderAndBackgroundColors(mk) { + if (mk instanceof Dict) { + this.borderColor = getRgbColor(mk.getArray("BC"), null); + this.backgroundColor = getRgbColor(mk.getArray("BG"), null); + } else { + this.borderColor = this.backgroundColor = null; + } + } + setBorderStyle(borderStyle) { + this.borderStyle = new AnnotationBorderStyle(); + if (!(borderStyle instanceof Dict)) { + return; + } + if (borderStyle.has("BS")) { + const dict = borderStyle.get("BS"); + if (dict instanceof Dict) { + const dictType = dict.get("Type"); + if (!dictType || isName(dictType, "Border")) { + this.borderStyle.setWidth(dict.get("W"), this.rectangle); + this.borderStyle.setStyle(dict.get("S")); + this.borderStyle.setDashArray(dict.getArray("D")); + } + } + } else if (borderStyle.has("Border")) { + const array = borderStyle.getArray("Border"); + if (Array.isArray(array) && array.length >= 3) { + this.borderStyle.setHorizontalCornerRadius(array[0]); + this.borderStyle.setVerticalCornerRadius(array[1]); + this.borderStyle.setWidth(array[2], this.rectangle); + if (array.length === 4) { + this.borderStyle.setDashArray(array[3], true); + } + } + } else { + this.borderStyle.setWidth(0); + } + } + setAppearance(dict) { + this.appearance = null; + const appearanceStates = dict.get("AP"); + if (!(appearanceStates instanceof Dict)) { + return; + } + const normalAppearanceState = appearanceStates.get("N"); + if (normalAppearanceState instanceof BaseStream) { + this.appearance = normalAppearanceState; + return; + } + if (!(normalAppearanceState instanceof Dict)) { + return; + } + const as = dict.get("AS"); + if (!(as instanceof Name) || !normalAppearanceState.has(as.name)) { + return; + } + const appearance = normalAppearanceState.get(as.name); + if (appearance instanceof BaseStream) { + this.appearance = appearance; + } + } + setOptionalContent(dict) { + this.oc = null; + const oc = dict.get("OC"); + if (oc instanceof Name) { + warn("setOptionalContent: Support for /Name-entry is not implemented."); + } else if (oc instanceof Dict) { + this.oc = oc; + } + } + async loadResources(keys, appearance) { + const resources = await appearance.dict.getAsync("Resources"); + if (resources) { + await ObjectLoader.load(resources, keys, resources.xref); + } + return resources; + } + async getOperatorList(evaluator, task, intent, annotationStorage) { + const { + hasOwnCanvas, + id, + rect + } = this.data; + let appearance = this.appearance; + const isUsingOwnCanvas = !!(hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY); + if (isUsingOwnCanvas && (this.width === 0 || this.height === 0)) { + this.data.hasOwnCanvas = false; + return { + opList: new OperatorList(), + separateForm: false, + separateCanvas: false + }; + } + if (!appearance) { + if (!isUsingOwnCanvas) { + return { + opList: new OperatorList(), + separateForm: false, + separateCanvas: false + }; + } + appearance = new StringStream(""); + appearance.dict = new Dict(); + } + const appearanceDict = appearance.dict; + const resources = await this.loadResources(RESOURCES_KEYS_OPERATOR_LIST, appearance); + const bbox = lookupRect(appearanceDict.getArray("BBox"), [0, 0, 1, 1]); + const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), IDENTITY_MATRIX); + const transform = getTransformMatrix(rect, bbox, matrix); + const opList = new OperatorList(); + let optionalContent; + if (this.oc) { + optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); + } + if (optionalContent !== undefined) { + opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + opList.addOp(OPS.beginAnnotation, [id, rect, transform, matrix, isUsingOwnCanvas]); + await evaluator.getOperatorList({ + stream: appearance, + task, + resources, + operatorList: opList, + fallbackFontDict: this._fallbackFontDict + }); + opList.addOp(OPS.endAnnotation, []); + if (optionalContent !== undefined) { + opList.addOp(OPS.endMarkedContent, []); + } + this.reset(); + return { + opList, + separateForm: false, + separateCanvas: isUsingOwnCanvas + }; + } + async save(evaluator, task, annotationStorage, changes) { + return null; + } + get overlaysTextContent() { + return false; + } + get hasTextContent() { + return false; + } + async extractTextContent(evaluator, task, viewBox) { + if (!this.appearance) { + return; + } + const resources = await this.loadResources(RESOURCES_KEYS_TEXT_CONTENT, this.appearance); + const text = []; + const buffer = []; + let firstPosition = null; + const sink = { + desiredSize: Math.Infinity, + ready: true, + enqueue(chunk, size) { + for (const item of chunk.items) { + if (item.str === undefined) { + continue; + } + firstPosition ||= item.transform.slice(-2); + buffer.push(item.str); + if (item.hasEOL) { + text.push(buffer.join("").trimEnd()); + buffer.length = 0; + } + } + } + }; + await evaluator.getTextContent({ + stream: this.appearance, + task, + resources, + includeMarkedContent: true, + keepWhiteSpace: true, + sink, + viewBox + }); + this.reset(); + if (buffer.length) { + text.push(buffer.join("").trimEnd()); + } + if (text.length > 1 || text[0]) { + const appearanceDict = this.appearance.dict; + const bbox = lookupRect(appearanceDict.getArray("BBox"), null); + const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), null); + this.data.textPosition = this._transformPoint(firstPosition, bbox, matrix); + this.data.textContent = text; + } + } + _transformPoint(coords, bbox, matrix) { + const { + rect + } = this.data; + bbox ||= [0, 0, 1, 1]; + matrix ||= [1, 0, 0, 1, 0, 0]; + const transform = getTransformMatrix(rect, bbox, matrix); + transform[4] -= rect[0]; + transform[5] -= rect[1]; + const p = coords.slice(); + Util.applyTransform(p, transform); + Util.applyTransform(p, matrix); + return p; + } + getFieldObject() { + if (this.data.kidIds) { + return { + id: this.data.id, + actions: this.data.actions, + name: this.data.fieldName, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + type: "", + kidIds: this.data.kidIds, + page: this.data.pageIndex, + rotation: this.rotation + }; + } + return null; + } + reset() { + for (const stream of this._streams) { + stream.reset(); + } + } + _constructFieldName(dict) { + if (!dict.has("T") && !dict.has("Parent")) { + warn("Unknown field name, falling back to empty field name."); + return ""; + } + if (!dict.has("Parent")) { + return stringToPDFString(dict.get("T")); + } + const fieldName = []; + if (dict.has("T")) { + fieldName.unshift(stringToPDFString(dict.get("T"))); + } + let loopDict = dict; + const visited = new RefSet(); + if (dict.objId) { + visited.put(dict.objId); + } + while (loopDict.has("Parent")) { + loopDict = loopDict.get("Parent"); + if (!(loopDict instanceof Dict) || loopDict.objId && visited.has(loopDict.objId)) { + break; + } + if (loopDict.objId) { + visited.put(loopDict.objId); + } + if (loopDict.has("T")) { + fieldName.unshift(stringToPDFString(loopDict.get("T"))); + } + } + return fieldName.join("."); + } + get width() { + return this.data.rect[2] - this.data.rect[0]; + } + get height() { + return this.data.rect[3] - this.data.rect[1]; + } +} +class AnnotationBorderStyle { + constructor() { + this.width = 1; + this.rawWidth = 1; + this.style = AnnotationBorderStyleType.SOLID; + this.dashArray = [3]; + this.horizontalCornerRadius = 0; + this.verticalCornerRadius = 0; + } + setWidth(width, rect = [0, 0, 0, 0]) { + if (width instanceof Name) { + this.width = 0; + return; + } + if (typeof width === "number") { + if (width > 0) { + this.rawWidth = width; + const maxWidth = (rect[2] - rect[0]) / 2; + const maxHeight = (rect[3] - rect[1]) / 2; + if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) { + warn(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`); + width = 1; + } + } + this.width = width; + } + } + setStyle(style) { + if (!(style instanceof Name)) { + return; + } + switch (style.name) { + case "S": + this.style = AnnotationBorderStyleType.SOLID; + break; + case "D": + this.style = AnnotationBorderStyleType.DASHED; + break; + case "B": + this.style = AnnotationBorderStyleType.BEVELED; + break; + case "I": + this.style = AnnotationBorderStyleType.INSET; + break; + case "U": + this.style = AnnotationBorderStyleType.UNDERLINE; + break; + default: + break; + } + } + setDashArray(dashArray, forceStyle = false) { + if (Array.isArray(dashArray)) { + let isValid = true; + let allZeros = true; + for (const element of dashArray) { + const validNumber = +element >= 0; + if (!validNumber) { + isValid = false; + break; + } else if (element > 0) { + allZeros = false; + } + } + if (dashArray.length === 0 || isValid && !allZeros) { + this.dashArray = dashArray; + if (forceStyle) { + this.setStyle(Name.get("D")); + } + } else { + this.width = 0; + } + } else if (dashArray) { + this.width = 0; + } + } + setHorizontalCornerRadius(radius) { + if (Number.isInteger(radius)) { + this.horizontalCornerRadius = radius; + } + } + setVerticalCornerRadius(radius) { + if (Number.isInteger(radius)) { + this.verticalCornerRadius = radius; + } + } +} +class MarkupAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict + } = params; + if (dict.has("IRT")) { + const rawIRT = dict.getRaw("IRT"); + this.data.inReplyTo = rawIRT instanceof Ref ? rawIRT.toString() : null; + const rt = dict.get("RT"); + this.data.replyType = rt instanceof Name ? rt.name : AnnotationReplyType.REPLY; + } + let popupRef = null; + if (this.data.replyType === AnnotationReplyType.GROUP) { + const parent = dict.get("IRT"); + this.setTitle(parent.get("T")); + this.data.titleObj = this._title; + this.setContents(parent.get("Contents")); + this.data.contentsObj = this._contents; + if (!parent.has("CreationDate")) { + this.data.creationDate = null; + } else { + this.setCreationDate(parent.get("CreationDate")); + this.data.creationDate = this.creationDate; + } + if (!parent.has("M")) { + this.data.modificationDate = null; + } else { + this.setModificationDate(parent.get("M")); + this.data.modificationDate = this.modificationDate; + } + popupRef = parent.getRaw("Popup"); + if (!parent.has("C")) { + this.data.color = null; + } else { + this.setColor(parent.getArray("C")); + this.data.color = this.color; + } + } else { + this.data.titleObj = this._title; + this.setCreationDate(dict.get("CreationDate")); + this.data.creationDate = this.creationDate; + popupRef = dict.getRaw("Popup"); + if (!dict.has("C")) { + this.data.color = null; + } + } + this.data.popupRef = popupRef instanceof Ref ? popupRef.toString() : null; + if (dict.has("RC")) { + this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC")); + } + } + setCreationDate(creationDate) { + this.creationDate = typeof creationDate === "string" ? creationDate : null; + } + _setDefaultAppearance({ + xref, + extra, + strokeColor, + fillColor, + blendMode, + strokeAlpha, + fillAlpha, + pointsCallback + }) { + const bbox = this.data.rect = [Infinity, Infinity, -Infinity, -Infinity]; + const buffer = ["q"]; + if (extra) { + buffer.push(extra); + } + if (strokeColor) { + buffer.push(`${strokeColor[0]} ${strokeColor[1]} ${strokeColor[2]} RG`); + } + if (fillColor) { + buffer.push(`${fillColor[0]} ${fillColor[1]} ${fillColor[2]} rg`); + } + const pointsArray = this.data.quadPoints || Float32Array.from([this.rectangle[0], this.rectangle[3], this.rectangle[2], this.rectangle[3], this.rectangle[0], this.rectangle[1], this.rectangle[2], this.rectangle[1]]); + for (let i = 0, ii = pointsArray.length; i < ii; i += 8) { + const points = pointsCallback(buffer, pointsArray.subarray(i, i + 8)); + Util.rectBoundingBox(...points, bbox); + } + buffer.push("Q"); + const formDict = new Dict(xref); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.setIfName("Subtype", "Form"); + const appearanceStream = new StringStream(buffer.join(" ")); + appearanceStream.dict = appearanceStreamDict; + formDict.set("Fm0", appearanceStream); + const gsDict = new Dict(xref); + if (blendMode) { + gsDict.setIfName("BM", blendMode); + } + gsDict.setIfNumber("CA", strokeAlpha); + gsDict.setIfNumber("ca", fillAlpha); + const stateDict = new Dict(xref); + stateDict.set("GS0", gsDict); + const resources = new Dict(xref); + resources.set("ExtGState", stateDict); + resources.set("XObject", formDict); + const appearanceDict = new Dict(xref); + appearanceDict.set("Resources", resources); + appearanceDict.set("BBox", bbox); + this.appearance = new StringStream("/GS0 gs /Fm0 Do"); + this.appearance.dict = appearanceDict; + this._streams.push(this.appearance, appearanceStream); + } + static async createNewAnnotation(xref, annotation, changes, params) { + const annotationRef = annotation.ref ||= xref.getNewTemporaryRef(); + const ap = await this.createNewAppearanceStream(annotation, xref, params); + let annotationDict; + if (ap) { + const apRef = xref.getNewTemporaryRef(); + annotationDict = this.createNewDict(annotation, xref, { + apRef + }); + changes.put(apRef, { + data: ap + }); + } else { + annotationDict = this.createNewDict(annotation, xref, {}); + } + if (Number.isInteger(annotation.parentTreeId)) { + annotationDict.set("StructParent", annotation.parentTreeId); + } + changes.put(annotationRef, { + data: annotationDict + }); + const retRef = { + ref: annotationRef + }; + const { + popup + } = annotation; + if (popup) { + if (popup.deleted) { + annotationDict.delete("Popup"); + annotationDict.delete("Contents"); + annotationDict.delete("RC"); + return retRef; + } + const popupRef = popup.ref ||= xref.getNewTemporaryRef(); + popup.parent = annotationRef; + const popupDict = PopupAnnotation.createNewDict(popup, xref); + changes.put(popupRef, { + data: popupDict + }); + annotationDict.setIfDefined("Contents", stringToAsciiOrUTF16BE(popup.contents)); + annotationDict.set("Popup", popupRef); + return [retRef, { + ref: popupRef + }]; + } + return retRef; + } + static async createNewPrintAnnotation(annotationGlobals, xref, annotation, params) { + const ap = await this.createNewAppearanceStream(annotation, xref, params); + const annotationDict = this.createNewDict(annotation, xref, ap ? { + ap + } : {}); + const newAnnotation = new this.prototype.constructor({ + dict: annotationDict, + xref, + annotationGlobals, + evaluatorOptions: params.evaluatorOptions + }); + if (annotation.ref) { + newAnnotation.ref = newAnnotation.refToReplace = annotation.ref; + } + return newAnnotation; + } +} +class WidgetAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict, + xref, + annotationGlobals + } = params; + const data = this.data; + this._needAppearances = params.needAppearances; + data.annotationType = AnnotationType.WIDGET; + if (data.fieldName === undefined) { + data.fieldName = this._constructFieldName(dict); + } + if (data.actions === undefined) { + data.actions = collectActions(xref, dict, AnnotationActionEventType); + } + let fieldValue = getInheritableProperty({ + dict, + key: "V", + getArray: true + }); + data.fieldValue = this._decodeFormValue(fieldValue); + const defaultFieldValue = getInheritableProperty({ + dict, + key: "DV", + getArray: true + }); + data.defaultFieldValue = this._decodeFormValue(defaultFieldValue); + if (fieldValue === undefined && annotationGlobals.xfaDatasets) { + const path = this._title.str; + if (path) { + this._hasValueFromXFA = true; + data.fieldValue = fieldValue = annotationGlobals.xfaDatasets.getValue(path); + } + } + if (fieldValue === undefined && data.defaultFieldValue !== null) { + data.fieldValue = data.defaultFieldValue; + } + data.alternativeText = stringToPDFString(dict.get("TU") || ""); + this.setDefaultAppearance(params); + data.hasAppearance ||= this._needAppearances && data.fieldValue !== undefined && data.fieldValue !== null; + const fieldType = getInheritableProperty({ + dict, + key: "FT" + }); + data.fieldType = fieldType instanceof Name ? fieldType.name : null; + const localResources = getInheritableProperty({ + dict, + key: "DR" + }); + const acroFormResources = annotationGlobals.acroForm.get("DR"); + const appearanceResources = this.appearance?.dict.get("Resources"); + this._fieldResources = { + localResources, + acroFormResources, + appearanceResources, + mergedResources: Dict.merge({ + xref, + dictArray: [localResources, appearanceResources, acroFormResources], + mergeSubDicts: true + }) + }; + data.fieldFlags = getInheritableProperty({ + dict, + key: "Ff" + }); + if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) { + data.fieldFlags = 0; + } + data.password = this.hasFieldFlag(AnnotationFieldFlag.PASSWORD); + data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY); + data.required = this.hasFieldFlag(AnnotationFieldFlag.REQUIRED); + data.hidden = this._hasFlag(data.annotationFlags, AnnotationFlag.HIDDEN) || this._hasFlag(data.annotationFlags, AnnotationFlag.NOVIEW); + } + _decodeFormValue(formValue) { + if (Array.isArray(formValue)) { + return formValue.filter(item => typeof item === "string").map(item => stringToPDFString(item)); + } else if (formValue instanceof Name) { + return stringToPDFString(formValue.name); + } else if (typeof formValue === "string") { + return stringToPDFString(formValue); + } + return null; + } + hasFieldFlag(flag) { + return !!(this.data.fieldFlags & flag); + } + _isViewable(flags) { + return true; + } + mustBeViewed(annotationStorage, renderForms) { + if (renderForms) { + return this.viewable; + } + return super.mustBeViewed(annotationStorage, renderForms) && !this._hasFlag(this.flags, AnnotationFlag.NOVIEW); + } + getRotationMatrix(annotationStorage) { + let rotation = annotationStorage?.get(this.data.id)?.rotation; + if (rotation === undefined) { + rotation = this.rotation; + } + return rotation === 0 ? IDENTITY_MATRIX : getRotationMatrix(rotation, this.width, this.height); + } + getBorderAndBackgroundAppearances(annotationStorage) { + let rotation = annotationStorage?.get(this.data.id)?.rotation; + if (rotation === undefined) { + rotation = this.rotation; + } + if (!this.backgroundColor && !this.borderColor) { + return ""; + } + const rect = rotation === 0 || rotation === 180 ? `0 0 ${this.width} ${this.height} re` : `0 0 ${this.height} ${this.width} re`; + let str = ""; + if (this.backgroundColor) { + str = `${getPdfColor(this.backgroundColor, true)} ${rect} f `; + } + if (this.borderColor) { + const borderWidth = this.borderStyle.width || 1; + str += `${borderWidth} w ${getPdfColor(this.borderColor, false)} ${rect} S `; + } + return str; + } + async getOperatorList(evaluator, task, intent, annotationStorage) { + if (intent & RenderingIntentFlag.ANNOTATIONS_FORMS && !(this instanceof SignatureWidgetAnnotation) && !this.data.noHTML && !this.data.hasOwnCanvas) { + return { + opList: new OperatorList(), + separateForm: true, + separateCanvas: false + }; + } + if (!this._hasText) { + return super.getOperatorList(evaluator, task, intent, annotationStorage); + } + const content = await this._getAppearance(evaluator, task, intent, annotationStorage); + if (this.appearance && content === null) { + return super.getOperatorList(evaluator, task, intent, annotationStorage); + } + const opList = new OperatorList(); + if (!this._defaultAppearance || content === null) { + return { + opList, + separateForm: false, + separateCanvas: false + }; + } + const isUsingOwnCanvas = !!(this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY); + const matrix = [1, 0, 0, 1, 0, 0]; + const bbox = [0, 0, this.width, this.height]; + const transform = getTransformMatrix(this.data.rect, bbox, matrix); + let optionalContent; + if (this.oc) { + optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); + } + if (optionalContent !== undefined) { + opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + opList.addOp(OPS.beginAnnotation, [this.data.id, this.data.rect, transform, this.getRotationMatrix(annotationStorage), isUsingOwnCanvas]); + const stream = new StringStream(content); + await evaluator.getOperatorList({ + stream, + task, + resources: this._fieldResources.mergedResources, + operatorList: opList + }); + opList.addOp(OPS.endAnnotation, []); + if (optionalContent !== undefined) { + opList.addOp(OPS.endMarkedContent, []); + } + return { + opList, + separateForm: false, + separateCanvas: isUsingOwnCanvas + }; + } + _getMKDict(rotation) { + const mk = new Dict(null); + if (rotation) { + mk.set("R", rotation); + } + mk.setIfArray("BC", getPdfColorArray(this.borderColor)); + mk.setIfArray("BG", getPdfColorArray(this.backgroundColor)); + return mk.size > 0 ? mk : null; + } + amendSavedDict(annotationStorage, dict) {} + setValue(dict, value, xref, changes) { + const { + dict: parentDict, + ref: parentRef + } = getParentToUpdate(dict, this.ref, xref); + if (!parentDict) { + dict.set("V", value); + } else if (!changes.has(parentRef)) { + const newParentDict = parentDict.clone(); + newParentDict.set("V", value); + changes.put(parentRef, { + data: newParentDict + }); + return newParentDict; + } + return null; + } + async save(evaluator, task, annotationStorage, changes) { + const storageEntry = annotationStorage?.get(this.data.id); + const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); + let value = storageEntry?.value, + rotation = storageEntry?.rotation; + if (value === this.data.fieldValue || value === undefined) { + if (!this._hasValueFromXFA && rotation === undefined && flags === undefined) { + return; + } + value ||= this.data.fieldValue; + } + if (rotation === undefined && !this._hasValueFromXFA && Array.isArray(value) && Array.isArray(this.data.fieldValue) && isArrayEqual(value, this.data.fieldValue) && flags === undefined) { + return; + } + if (rotation === undefined) { + rotation = this.rotation; + } + let appearance = null; + if (!this._needAppearances) { + appearance = await this._getAppearance(evaluator, task, RenderingIntentFlag.SAVE, annotationStorage); + if (appearance === null && flags === undefined) { + return; + } + } else {} + let needAppearances = false; + if (appearance?.needAppearances) { + needAppearances = true; + appearance = null; + } + const { + xref + } = evaluator; + const originalDict = xref.fetchIfRef(this.ref); + if (!(originalDict instanceof Dict)) { + return; + } + const dict = new Dict(xref); + for (const key of originalDict.getKeys()) { + if (key !== "AP") { + dict.set(key, originalDict.getRaw(key)); + } + } + if (flags !== undefined) { + dict.set("F", flags); + if (appearance === null && !needAppearances) { + const ap = originalDict.getRaw("AP"); + if (ap) { + dict.set("AP", ap); + } + } + } + const xfa = { + path: this.data.fieldName, + value + }; + const newParentDict = this.setValue(dict, Array.isArray(value) ? value.map(stringToAsciiOrUTF16BE) : stringToAsciiOrUTF16BE(value), xref, changes); + this.amendSavedDict(annotationStorage, newParentDict || dict); + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + changes.put(this.ref, { + data: dict, + xfa, + needAppearances + }); + if (appearance !== null) { + const newRef = xref.getNewTemporaryRef(); + const AP = new Dict(xref); + dict.set("AP", AP); + AP.set("N", newRef); + const resources = this._getSaveFieldResources(xref); + const appearanceStream = new StringStream(appearance); + const appearanceDict = appearanceStream.dict = new Dict(xref); + appearanceDict.setIfName("Subtype", "Form"); + appearanceDict.set("Resources", resources); + const bbox = rotation % 180 === 0 ? [0, 0, this.width, this.height] : [0, 0, this.height, this.width]; + appearanceDict.set("BBox", bbox); + const rotationMatrix = this.getRotationMatrix(annotationStorage); + if (rotationMatrix !== IDENTITY_MATRIX) { + appearanceDict.set("Matrix", rotationMatrix); + } + changes.put(newRef, { + data: appearanceStream, + xfa: null, + needAppearances: false + }); + } + dict.set("M", `D:${getModificationDate()}`); + } + async _getAppearance(evaluator, task, intent, annotationStorage) { + if (this.data.password) { + return null; + } + const storageEntry = annotationStorage?.get(this.data.id); + let value, rotation; + if (storageEntry) { + value = storageEntry.formattedValue || storageEntry.value; + rotation = storageEntry.rotation; + } + if (rotation === undefined && value === undefined && !this._needAppearances) { + if (!this._hasValueFromXFA || this.appearance) { + return null; + } + } + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + if (value === undefined) { + value = this.data.fieldValue; + if (!value) { + return `/Tx BMC q ${colors}Q EMC`; + } + } + if (Array.isArray(value) && value.length === 1) { + value = value[0]; + } + assert(typeof value === "string", "Expected `value` to be a string."); + value = value.trimEnd(); + if (this.data.combo) { + const option = this.data.options.find(({ + exportValue + }) => value === exportValue); + value = option?.displayValue || value; + } + if (value === "") { + return `/Tx BMC q ${colors}Q EMC`; + } + if (rotation === undefined) { + rotation = this.rotation; + } + let lineCount = -1; + let lines; + if (this.data.multiLine) { + lines = value.split(/\r\n?|\n/).map(line => line.normalize("NFC")); + lineCount = lines.length; + } else { + lines = [value.replace(/\r\n?|\n/, "").normalize("NFC")]; + } + const defaultPadding = 1; + const defaultHPadding = 2; + let { + width: totalWidth, + height: totalHeight + } = this; + if (rotation === 90 || rotation === 270) { + [totalWidth, totalHeight] = [totalHeight, totalWidth]; + } + if (!this._defaultAppearance) { + this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g"); + } + let font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources); + let defaultAppearance, fontSize, lineHeight; + const encodedLines = []; + let encodingError = false; + for (const line of lines) { + const encodedString = font.encodeString(line); + if (encodedString.length > 1) { + encodingError = true; + } + encodedLines.push(encodedString.join("")); + } + if (encodingError && intent & RenderingIntentFlag.SAVE) { + return { + needAppearances: true + }; + } + if (encodingError && this._isOffscreenCanvasSupported) { + const fontFamily = this.data.comb ? "monospace" : "sans-serif"; + const fakeUnicodeFont = new FakeUnicodeFont(evaluator.xref, fontFamily); + const resources = fakeUnicodeFont.createFontResources(lines.join("")); + const newFont = resources.getRaw("Font"); + if (this._fieldResources.mergedResources.has("Font")) { + const oldFont = this._fieldResources.mergedResources.get("Font"); + for (const key of newFont.getKeys()) { + oldFont.set(key, newFont.getRaw(key)); + } + } else { + this._fieldResources.mergedResources.set("Font", newFont); + } + const fontName = fakeUnicodeFont.fontName.name; + font = await WidgetAnnotation._getFontData(evaluator, task, { + fontName, + fontSize: 0 + }, resources); + for (let i = 0, ii = encodedLines.length; i < ii; i++) { + encodedLines[i] = stringToUTF16String(lines[i]); + } + const savedDefaultAppearance = Object.assign(Object.create(null), this.data.defaultAppearanceData); + this.data.defaultAppearanceData.fontSize = 0; + this.data.defaultAppearanceData.fontName = fontName; + [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount); + this.data.defaultAppearanceData = savedDefaultAppearance; + } else { + if (!this._isOffscreenCanvasSupported) { + warn("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."); + } + [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount); + } + let descent = font.descent; + if (isNaN(descent)) { + descent = BASELINE_FACTOR * lineHeight; + } else { + descent = Math.max(BASELINE_FACTOR * lineHeight, Math.abs(descent) * fontSize); + } + const defaultVPadding = Math.min(Math.floor((totalHeight - fontSize) / 2), defaultPadding); + const alignment = this.data.textAlignment; + if (this.data.multiLine) { + return this._getMultilineAppearance(defaultAppearance, encodedLines, font, fontSize, totalWidth, totalHeight, alignment, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage); + } + if (this.data.comb) { + return this._getCombAppearance(defaultAppearance, font, encodedLines[0], fontSize, totalWidth, totalHeight, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage); + } + const bottomPadding = defaultVPadding + descent; + if (alignment === 0 || alignment > 2) { + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(defaultHPadding)} ${numberToString(bottomPadding)} Tm (${escapeString(encodedLines[0])}) Tj` + " ET Q EMC"; + } + const prevInfo = { + shift: 0 + }; + const renderedText = this._renderText(encodedLines[0], font, fontSize, totalWidth, alignment, prevInfo, defaultHPadding, bottomPadding); + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 0 Tm ${renderedText}` + " ET Q EMC"; + } + static async _getFontData(evaluator, task, appearanceData, resources) { + const operatorList = new OperatorList(); + const initialState = { + font: null, + clone() { + return this; + } + }; + const { + fontName, + fontSize + } = appearanceData; + await evaluator.handleSetFont(resources, [fontName && Name.get(fontName), fontSize], null, operatorList, task, initialState, null); + return initialState.font; + } + _getTextWidth(text, font) { + return Math.sumPrecise(font.charsToGlyphs(text).map(g => g.width)) / 1000; + } + _computeFontSize(height, width, text, font, lineCount) { + let { + fontSize + } = this.data.defaultAppearanceData; + let lineHeight = (fontSize || 12) * LINE_FACTOR, + numberOfLines = Math.round(height / lineHeight); + if (!fontSize) { + const roundWithTwoDigits = x => Math.floor(x * 100) / 100; + if (lineCount === -1) { + const textWidth = this._getTextWidth(text, font); + fontSize = roundWithTwoDigits(Math.min(height / LINE_FACTOR, width / textWidth)); + numberOfLines = 1; + } else { + const lines = text.split(/\r\n?|\n/); + const cachedLines = []; + for (const line of lines) { + const encoded = font.encodeString(line).join(""); + const glyphs = font.charsToGlyphs(encoded); + const positions = font.getCharPositions(encoded); + cachedLines.push({ + line: encoded, + glyphs, + positions + }); + } + const isTooBig = fsize => { + let totalHeight = 0; + for (const cache of cachedLines) { + const chunks = this._splitLine(null, font, fsize, width, cache); + totalHeight += chunks.length * fsize; + if (totalHeight > height) { + return true; + } + } + return false; + }; + numberOfLines = Math.max(numberOfLines, lineCount); + while (true) { + lineHeight = height / numberOfLines; + fontSize = roundWithTwoDigits(lineHeight / LINE_FACTOR); + if (isTooBig(fontSize)) { + numberOfLines++; + continue; + } + break; + } + } + const { + fontName, + fontColor + } = this.data.defaultAppearanceData; + this._defaultAppearance = createDefaultAppearance({ + fontSize, + fontName, + fontColor + }); + } + return [this._defaultAppearance, fontSize, height / numberOfLines]; + } + _renderText(text, font, fontSize, totalWidth, alignment, prevInfo, hPadding, vPadding) { + let shift; + if (alignment === 1) { + const width = this._getTextWidth(text, font) * fontSize; + shift = (totalWidth - width) / 2; + } else if (alignment === 2) { + const width = this._getTextWidth(text, font) * fontSize; + shift = totalWidth - width - hPadding; + } else { + shift = hPadding; + } + const shiftStr = numberToString(shift - prevInfo.shift); + prevInfo.shift = shift; + vPadding = numberToString(vPadding); + return `${shiftStr} ${vPadding} Td (${escapeString(text)}) Tj`; + } + _getSaveFieldResources(xref) { + const { + localResources, + appearanceResources, + acroFormResources + } = this._fieldResources; + const fontName = this.data.defaultAppearanceData?.fontName; + if (!fontName) { + return localResources || Dict.empty; + } + for (const resources of [localResources, appearanceResources]) { + if (resources instanceof Dict) { + const localFont = resources.get("Font"); + if (localFont instanceof Dict && localFont.has(fontName)) { + return resources; + } + } + } + if (acroFormResources instanceof Dict) { + const acroFormFont = acroFormResources.get("Font"); + if (acroFormFont instanceof Dict && acroFormFont.has(fontName)) { + const subFontDict = new Dict(xref); + subFontDict.set(fontName, acroFormFont.getRaw(fontName)); + const subResourcesDict = new Dict(xref); + subResourcesDict.set("Font", subFontDict); + return Dict.merge({ + xref, + dictArray: [subResourcesDict, localResources], + mergeSubDicts: true + }); + } + } + return localResources || Dict.empty; + } + getFieldObject() { + return null; + } +} +class TextWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + const { + dict + } = params; + if (dict.has("PMD")) { + this.flags |= AnnotationFlag.HIDDEN; + this.data.hidden = true; + warn("Barcodes are not supported"); + } + this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML; + this._hasText = true; + if (typeof this.data.fieldValue !== "string") { + this.data.fieldValue = ""; + } + let alignment = getInheritableProperty({ + dict, + key: "Q" + }); + if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) { + alignment = null; + } + this.data.textAlignment = alignment; + let maximumLength = getInheritableProperty({ + dict, + key: "MaxLen" + }); + if (!Number.isInteger(maximumLength) || maximumLength < 0) { + maximumLength = 0; + } + this.data.maxLen = maximumLength; + this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE); + this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) && !this.data.multiLine && !this.data.password && !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== 0; + this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL); + const { + data: { + actions + } + } = this; + if (!actions) { + return; + } + const AFDateTime = /^AF(Date|Time)_(?:Keystroke|Format)(?:Ex)?\(['"]?([^'"]+)['"]?\);$/; + let canUseHTMLDateTime = false; + if (actions.Format?.length === 1 && actions.Keystroke?.length === 1 && AFDateTime.test(actions.Format[0]) && AFDateTime.test(actions.Keystroke[0]) || actions.Format?.length === 0 && actions.Keystroke?.length === 1 && AFDateTime.test(actions.Keystroke[0]) || actions.Keystroke?.length === 0 && actions.Format?.length === 1 && AFDateTime.test(actions.Format[0])) { + canUseHTMLDateTime = true; + } + const actionsToVisit = []; + if (actions.Format) { + actionsToVisit.push(...actions.Format); + } + if (actions.Keystroke) { + actionsToVisit.push(...actions.Keystroke); + } + if (canUseHTMLDateTime) { + delete actions.Keystroke; + actions.Format = actionsToVisit; + } + for (const formatAction of actionsToVisit) { + const m = formatAction.match(AFDateTime); + if (!m) { + continue; + } + const isDate = m[1] === "Date"; + let format = m[2]; + const num = parseInt(format, 10); + if (!isNaN(num) && Math.floor(Math.log10(num)) + 1 === m[2].length) { + format = (isDate ? DateFormats : TimeFormats)[num] ?? format; + } + this.data.datetimeFormat = format; + if (!canUseHTMLDateTime) { + break; + } + if (isDate) { + if (/HH|MM|ss|h/.test(format)) { + this.data.datetimeType = "datetime-local"; + this.data.timeStep = /ss/.test(format) ? 1 : 60; + } else { + this.data.datetimeType = "date"; + } + break; + } + this.data.datetimeType = "time"; + this.data.timeStep = /ss/.test(format) ? 1 : 60; + break; + } + } + get hasTextContent() { + return !!this.appearance && !this._needAppearances; + } + _getCombAppearance(defaultAppearance, font, text, fontSize, width, height, hPadding, vPadding, descent, lineHeight, annotationStorage) { + const combWidth = width / this.data.maxLen; + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + const buf = []; + const positions = font.getCharPositions(text); + for (const [start, end] of positions) { + buf.push(`(${escapeString(text.substring(start, end))}) Tj`); + } + const renderedComb = buf.join(` ${numberToString(combWidth)} 0 Td `); + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(hPadding)} ${numberToString(vPadding + descent)} Tm ${renderedComb}` + " ET Q EMC"; + } + _getMultilineAppearance(defaultAppearance, lines, font, fontSize, width, height, alignment, hPadding, vPadding, descent, lineHeight, annotationStorage) { + const buf = []; + const totalWidth = width - 2 * hPadding; + const prevInfo = { + shift: 0 + }; + for (let i = 0, ii = lines.length; i < ii; i++) { + const line = lines[i]; + const chunks = this._splitLine(line, font, fontSize, totalWidth); + for (let j = 0, jj = chunks.length; j < jj; j++) { + const chunk = chunks[j]; + const vShift = i === 0 && j === 0 ? -vPadding - (lineHeight - descent) : -lineHeight; + buf.push(this._renderText(chunk, font, fontSize, width, alignment, prevInfo, hPadding, vShift)); + } + } + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + const renderedText = buf.join("\n"); + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 ${numberToString(height)} Tm ${renderedText}` + " ET Q EMC"; + } + _splitLine(line, font, fontSize, width, cache = {}) { + line = cache.line || line; + const glyphs = cache.glyphs || font.charsToGlyphs(line); + if (glyphs.length <= 1) { + return [line]; + } + const positions = cache.positions || font.getCharPositions(line); + const scale = fontSize / 1000; + const chunks = []; + let lastSpacePosInStringStart = -1, + lastSpacePosInStringEnd = -1, + lastSpacePos = -1, + startChunk = 0, + currentWidth = 0; + for (let i = 0, ii = glyphs.length; i < ii; i++) { + const [start, end] = positions[i]; + const glyph = glyphs[i]; + const glyphWidth = glyph.width * scale; + if (glyph.unicode === " ") { + if (currentWidth + glyphWidth > width) { + chunks.push(line.substring(startChunk, start)); + startChunk = start; + currentWidth = glyphWidth; + lastSpacePosInStringStart = -1; + lastSpacePos = -1; + } else { + currentWidth += glyphWidth; + lastSpacePosInStringStart = start; + lastSpacePosInStringEnd = end; + lastSpacePos = i; + } + } else if (currentWidth + glyphWidth > width) { + if (lastSpacePosInStringStart !== -1) { + chunks.push(line.substring(startChunk, lastSpacePosInStringEnd)); + startChunk = lastSpacePosInStringEnd; + i = lastSpacePos + 1; + lastSpacePosInStringStart = -1; + currentWidth = 0; + } else { + chunks.push(line.substring(startChunk, start)); + startChunk = start; + currentWidth = glyphWidth; + } + } else { + currentWidth += glyphWidth; + } + } + if (startChunk < line.length) { + chunks.push(line.substring(startChunk, line.length)); + } + return chunks; + } + async extractTextContent(evaluator, task, viewBox) { + await super.extractTextContent(evaluator, task, viewBox); + const text = this.data.textContent; + if (!text) { + return; + } + const allText = text.join("\n"); + if (allText === this.data.fieldValue) { + return; + } + const regex = allText.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g, (_m, p1) => p1 ? `\\${p1}` : "\\s+"); + if (new RegExp(`^\\s*${regex}\\s*$`).test(this.data.fieldValue)) { + this.data.textContent = this.data.fieldValue.split("\n"); + } + } + getFieldObject() { + return { + id: this.data.id, + value: this.data.fieldValue, + defaultValue: this.data.defaultFieldValue || "", + multiline: this.data.multiLine, + password: this.data.password, + charLimit: this.data.maxLen, + comb: this.data.comb, + editable: !this.data.readOnly, + hidden: this.data.hidden, + name: this.data.fieldName, + rect: this.data.rect, + actions: this.data.actions, + page: this.data.pageIndex, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + rotation: this.rotation, + datetimeFormat: this.data.datetimeFormat, + hasDatetimeHTML: !!this.data.datetimeType, + type: "text" + }; + } +} +class ButtonWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + this.checkedAppearance = null; + this.uncheckedAppearance = null; + const isRadio = this.hasFieldFlag(AnnotationFieldFlag.RADIO), + isPushButton = this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.checkBox = !isRadio && !isPushButton; + this.data.radioButton = isRadio && !isPushButton; + this.data.pushButton = isPushButton; + this.data.isTooltipOnly = false; + if (this.data.checkBox) { + this._processCheckBox(params); + } else if (this.data.radioButton) { + this._processRadioButton(params); + } else if (this.data.pushButton) { + this.data.hasOwnCanvas = true; + this.data.noHTML = false; + this._processPushButton(params); + } else { + warn("Invalid field flags for button widget annotation"); + } + } + async getOperatorList(evaluator, task, intent, annotationStorage) { + if (this.data.pushButton) { + return super.getOperatorList(evaluator, task, intent, false, annotationStorage); + } + let value = null; + let rotation = null; + if (annotationStorage) { + const storageEntry = annotationStorage.get(this.data.id); + value = storageEntry ? storageEntry.value : null; + rotation = storageEntry ? storageEntry.rotation : null; + } + if (value === null && this.appearance) { + return super.getOperatorList(evaluator, task, intent, annotationStorage); + } + if (value === null || value === undefined) { + value = this.data.checkBox ? this.data.fieldValue === this.data.exportValue : this.data.fieldValue === this.data.buttonValue; + } + const appearance = value ? this.checkedAppearance : this.uncheckedAppearance; + if (appearance) { + const savedAppearance = this.appearance; + const savedMatrix = lookupMatrix(appearance.dict.getArray("Matrix"), IDENTITY_MATRIX); + if (rotation) { + appearance.dict.set("Matrix", this.getRotationMatrix(annotationStorage)); + } + this.appearance = appearance; + const operatorList = super.getOperatorList(evaluator, task, intent, annotationStorage); + this.appearance = savedAppearance; + appearance.dict.set("Matrix", savedMatrix); + return operatorList; + } + return { + opList: new OperatorList(), + separateForm: false, + separateCanvas: false + }; + } + async save(evaluator, task, annotationStorage, changes) { + if (this.data.checkBox) { + this._saveCheckbox(evaluator, task, annotationStorage, changes); + return; + } + if (this.data.radioButton) { + this._saveRadioButton(evaluator, task, annotationStorage, changes); + } + } + async _saveCheckbox(evaluator, task, annotationStorage, changes) { + if (!annotationStorage) { + return; + } + const storageEntry = annotationStorage.get(this.data.id); + const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); + let rotation = storageEntry?.rotation, + value = storageEntry?.value; + if (rotation === undefined && flags === undefined) { + if (value === undefined) { + return; + } + const defaultValue = this.data.fieldValue === this.data.exportValue; + if (defaultValue === value) { + return; + } + } + let dict = evaluator.xref.fetchIfRef(this.ref); + if (!(dict instanceof Dict)) { + return; + } + dict = dict.clone(); + if (rotation === undefined) { + rotation = this.rotation; + } + if (value === undefined) { + value = this.data.fieldValue === this.data.exportValue; + } + const xfa = { + path: this.data.fieldName, + value: value ? this.data.exportValue : "" + }; + const name = Name.get(value ? this.data.exportValue : "Off"); + this.setValue(dict, name, evaluator.xref, changes); + dict.set("AS", name); + dict.set("M", `D:${getModificationDate()}`); + if (flags !== undefined) { + dict.set("F", flags); + } + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + changes.put(this.ref, { + data: dict, + xfa, + needAppearances: false + }); + } + async _saveRadioButton(evaluator, task, annotationStorage, changes) { + if (!annotationStorage) { + return; + } + const storageEntry = annotationStorage.get(this.data.id); + const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); + let rotation = storageEntry?.rotation, + value = storageEntry?.value; + if (rotation === undefined && flags === undefined) { + if (value === undefined) { + return; + } + const defaultValue = this.data.fieldValue === this.data.buttonValue; + if (defaultValue === value) { + return; + } + } + let dict = evaluator.xref.fetchIfRef(this.ref); + if (!(dict instanceof Dict)) { + return; + } + dict = dict.clone(); + if (value === undefined) { + value = this.data.fieldValue === this.data.buttonValue; + } + if (rotation === undefined) { + rotation = this.rotation; + } + const xfa = { + path: this.data.fieldName, + value: value ? this.data.buttonValue : "" + }; + const name = Name.get(value ? this.data.buttonValue : "Off"); + if (value) { + this.setValue(dict, name, evaluator.xref, changes); + } + dict.set("AS", name); + dict.set("M", `D:${getModificationDate()}`); + if (flags !== undefined) { + dict.set("F", flags); + } + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + changes.put(this.ref, { + data: dict, + xfa, + needAppearances: false + }); + } + _getDefaultCheckedAppearance(params, type) { + const { + width, + height + } = this; + const bbox = [0, 0, width, height]; + const FONT_RATIO = 0.8; + const fontSize = Math.min(width, height) * FONT_RATIO; + let metrics, char; + if (type === "check") { + metrics = { + width: 0.755 * fontSize, + height: 0.705 * fontSize + }; + char = "\x33"; + } else if (type === "disc") { + metrics = { + width: 0.791 * fontSize, + height: 0.705 * fontSize + }; + char = "\x6C"; + } else { + unreachable(`_getDefaultCheckedAppearance - unsupported type: ${type}`); + } + const xShift = numberToString((width - metrics.width) / 2); + const yShift = numberToString((height - metrics.height) / 2); + const appearance = `q BT /PdfJsZaDb ${fontSize} Tf 0 g ${xShift} ${yShift} Td (${char}) Tj ET Q`; + const appearanceStreamDict = new Dict(params.xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.setIfName("Subtype", "Form"); + appearanceStreamDict.setIfName("Type", "XObject"); + appearanceStreamDict.set("BBox", bbox); + appearanceStreamDict.set("Matrix", [1, 0, 0, 1, 0, 0]); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(params.xref); + const font = new Dict(params.xref); + font.set("PdfJsZaDb", this.fallbackFontDict); + resources.set("Font", font); + appearanceStreamDict.set("Resources", resources); + this.checkedAppearance = new StringStream(appearance); + this.checkedAppearance.dict = appearanceStreamDict; + this._streams.push(this.checkedAppearance); + } + _processCheckBox(params) { + const customAppearance = params.dict.get("AP"); + if (!(customAppearance instanceof Dict)) { + return; + } + const normalAppearance = customAppearance.get("N"); + if (!(normalAppearance instanceof Dict)) { + return; + } + const asValue = this._decodeFormValue(params.dict.get("AS")); + if (typeof asValue === "string") { + this.data.fieldValue = asValue; + } + const yes = this.data.fieldValue !== null && this.data.fieldValue !== "Off" ? this.data.fieldValue : "Yes"; + const exportValues = this._decodeFormValue(normalAppearance.getKeys()); + if (exportValues.length === 0) { + exportValues.push("Off", yes); + } else if (exportValues.length === 1) { + if (exportValues[0] === "Off") { + exportValues.push(yes); + } else { + exportValues.unshift("Off"); + } + } else if (exportValues.includes(yes)) { + exportValues.length = 0; + exportValues.push("Off", yes); + } else { + const otherYes = exportValues.find(v => v !== "Off"); + exportValues.length = 0; + exportValues.push("Off", otherYes); + } + if (!exportValues.includes(this.data.fieldValue)) { + this.data.fieldValue = "Off"; + } + this.data.exportValue = exportValues[1]; + const checkedAppearance = normalAppearance.get(this.data.exportValue); + this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; + const uncheckedAppearance = normalAppearance.get("Off"); + this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; + if (this.checkedAppearance) { + this._streams.push(this.checkedAppearance); + } else { + this._getDefaultCheckedAppearance(params, "check"); + } + if (this.uncheckedAppearance) { + this._streams.push(this.uncheckedAppearance); + } + this._fallbackFontDict = this.fallbackFontDict; + if (this.data.defaultFieldValue === null) { + this.data.defaultFieldValue = "Off"; + } + } + _processRadioButton(params) { + this.data.buttonValue = null; + const fieldParent = params.dict.get("Parent"); + if (fieldParent instanceof Dict) { + this.parent = params.dict.getRaw("Parent"); + const fieldParentValue = fieldParent.get("V"); + if (fieldParentValue instanceof Name) { + this.data.fieldValue = this._decodeFormValue(fieldParentValue); + } + } + const appearanceStates = params.dict.get("AP"); + if (!(appearanceStates instanceof Dict)) { + return; + } + const normalAppearance = appearanceStates.get("N"); + if (!(normalAppearance instanceof Dict)) { + return; + } + for (const key of normalAppearance.getKeys()) { + if (key !== "Off") { + this.data.buttonValue = this._decodeFormValue(key); + break; + } + } + const checkedAppearance = normalAppearance.get(this.data.buttonValue); + this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; + const uncheckedAppearance = normalAppearance.get("Off"); + this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; + if (this.checkedAppearance) { + this._streams.push(this.checkedAppearance); + } else { + this._getDefaultCheckedAppearance(params, "disc"); + } + if (this.uncheckedAppearance) { + this._streams.push(this.uncheckedAppearance); + } + this._fallbackFontDict = this.fallbackFontDict; + if (this.data.defaultFieldValue === null) { + this.data.defaultFieldValue = "Off"; + } + } + _processPushButton(params) { + const { + dict, + annotationGlobals + } = params; + if (!dict.has("A") && !dict.has("AA") && !this.data.alternativeText) { + warn("Push buttons without action dictionaries are not supported"); + return; + } + this.data.isTooltipOnly = !dict.has("A") && !dict.has("AA"); + Catalog.parseDestDictionary({ + destDict: dict, + resultObj: this.data, + docBaseUrl: annotationGlobals.baseUrl, + docAttachments: annotationGlobals.attachments + }); + } + getFieldObject() { + let type = "button"; + let exportValues; + if (this.data.checkBox) { + type = "checkbox"; + exportValues = this.data.exportValue; + } else if (this.data.radioButton) { + type = "radiobutton"; + exportValues = this.data.buttonValue; + } + return { + id: this.data.id, + value: this.data.fieldValue || "Off", + defaultValue: this.data.defaultFieldValue, + exportValues, + editable: !this.data.readOnly, + name: this.data.fieldName, + rect: this.data.rect, + hidden: this.data.hidden, + actions: this.data.actions, + page: this.data.pageIndex, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + rotation: this.rotation, + type + }; + } + get fallbackFontDict() { + const dict = new Dict(); + dict.setIfName("BaseFont", "ZapfDingbats"); + dict.setIfName("Type", "FallbackType"); + dict.setIfName("Subtype", "FallbackType"); + dict.setIfName("Encoding", "ZapfDingbatsEncoding"); + return shadow(this, "fallbackFontDict", dict); + } +} +class ChoiceWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.indices = dict.getArray("I"); + this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0; + this.data.options = []; + const options = getInheritableProperty({ + dict, + key: "Opt" + }); + if (Array.isArray(options)) { + for (let i = 0, ii = options.length; i < ii; i++) { + const option = xref.fetchIfRef(options[i]); + const isOptionArray = Array.isArray(option); + this.data.options[i] = { + exportValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[0]) : option), + displayValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[1]) : option) + }; + } + } + if (!this.hasIndices) { + if (typeof this.data.fieldValue === "string") { + this.data.fieldValue = [this.data.fieldValue]; + } else { + this.data.fieldValue ||= []; + } + } else { + this.data.fieldValue = []; + const ii = this.data.options.length; + for (const i of this.indices) { + if (Number.isInteger(i) && i >= 0 && i < ii) { + this.data.fieldValue.push(this.data.options[i].exportValue); + } + } + } + if (this.data.options.length === 0 && this.data.fieldValue.length > 0) { + this.data.options = this.data.fieldValue.map(value => ({ + exportValue: value, + displayValue: value + })); + } + this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO); + this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT); + this._hasText = true; + } + getFieldObject() { + const type = this.data.combo ? "combobox" : "listbox"; + const value = this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null; + return { + id: this.data.id, + value, + defaultValue: this.data.defaultFieldValue, + editable: !this.data.readOnly, + name: this.data.fieldName, + rect: this.data.rect, + numItems: this.data.fieldValue.length, + multipleSelection: this.data.multiSelect, + hidden: this.data.hidden, + actions: this.data.actions, + items: this.data.options, + page: this.data.pageIndex, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + rotation: this.rotation, + type + }; + } + amendSavedDict(annotationStorage, dict) { + if (!this.hasIndices) { + return; + } + let values = annotationStorage?.get(this.data.id)?.value; + if (!Array.isArray(values)) { + values = [values]; + } + const indices = []; + const { + options + } = this.data; + for (let i = 0, j = 0, ii = options.length; i < ii; i++) { + if (options[i].exportValue === values[j]) { + indices.push(i); + j += 1; + } + } + dict.set("I", indices); + } + async _getAppearance(evaluator, task, intent, annotationStorage) { + if (this.data.combo) { + return super._getAppearance(evaluator, task, intent, annotationStorage); + } + let exportedValue, rotation; + const storageEntry = annotationStorage?.get(this.data.id); + if (storageEntry) { + rotation = storageEntry.rotation; + exportedValue = storageEntry.value; + } + if (rotation === undefined && exportedValue === undefined && !this._needAppearances) { + return null; + } + if (exportedValue === undefined) { + exportedValue = this.data.fieldValue; + } else if (!Array.isArray(exportedValue)) { + exportedValue = [exportedValue]; + } + const defaultPadding = 1; + const defaultHPadding = 2; + let { + width: totalWidth, + height: totalHeight + } = this; + if (rotation === 90 || rotation === 270) { + [totalWidth, totalHeight] = [totalHeight, totalWidth]; + } + const lineCount = this.data.options.length; + const valueIndices = []; + for (let i = 0; i < lineCount; i++) { + const { + exportValue + } = this.data.options[i]; + if (exportedValue.includes(exportValue)) { + valueIndices.push(i); + } + } + if (!this._defaultAppearance) { + this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g"); + } + const font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources); + let defaultAppearance; + let { + fontSize + } = this.data.defaultAppearanceData; + if (!fontSize) { + const lineHeight = (totalHeight - defaultPadding) / lineCount; + let lineWidth = -1; + let value; + for (const { + displayValue + } of this.data.options) { + const width = this._getTextWidth(displayValue, font); + if (width > lineWidth) { + lineWidth = width; + value = displayValue; + } + } + [defaultAppearance, fontSize] = this._computeFontSize(lineHeight, totalWidth - 2 * defaultHPadding, value, font, -1); + } else { + defaultAppearance = this._defaultAppearance; + } + const lineHeight = fontSize * LINE_FACTOR; + const vPadding = (lineHeight - fontSize) / 2; + const numberOfVisibleLines = Math.floor(totalHeight / lineHeight); + let firstIndex = 0; + if (valueIndices.length > 0) { + const minIndex = Math.min(...valueIndices); + const maxIndex = Math.max(...valueIndices); + firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1); + if (firstIndex > minIndex) { + firstIndex = minIndex; + } + } + const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount); + const buf = ["/Tx BMC q", `1 1 ${totalWidth} ${totalHeight} re W n`]; + if (valueIndices.length) { + buf.push("0.600006 0.756866 0.854904 rg"); + for (const index of valueIndices) { + if (firstIndex <= index && index < end) { + buf.push(`1 ${totalHeight - (index - firstIndex + 1) * lineHeight} ${totalWidth} ${lineHeight} re f`); + } + } + } + buf.push("BT", defaultAppearance, `1 0 0 1 0 ${totalHeight} Tm`); + const prevInfo = { + shift: 0 + }; + for (let i = firstIndex; i < end; i++) { + const { + displayValue + } = this.data.options[i]; + const vpadding = i === firstIndex ? vPadding : 0; + buf.push(this._renderText(displayValue, font, fontSize, totalWidth, 0, prevInfo, defaultHPadding, -lineHeight + vpadding)); + } + buf.push("ET Q EMC"); + return buf.join("\n"); + } +} +class SignatureWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + this.data.fieldValue = null; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = !this.data.hasOwnCanvas; + } + getFieldObject() { + return { + id: this.data.id, + value: null, + page: this.data.pageIndex, + type: "signature" + }; + } +} +class TextAnnotation extends MarkupAnnotation { + constructor(params) { + const DEFAULT_ICON_SIZE = 22; + super(params); + this.data.noRotate = true; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + const { + dict + } = params; + this.data.annotationType = AnnotationType.TEXT; + if (this.data.hasAppearance) { + this.data.name = "NoIcon"; + } else { + this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE; + this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE; + this.data.name = dict.has("Name") ? dict.get("Name").name : "Note"; + } + if (dict.has("State")) { + this.data.state = dict.get("State") || null; + this.data.stateModel = dict.get("StateModel") || null; + } else { + this.data.state = null; + this.data.stateModel = null; + } + } +} +class LinkAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict, + annotationGlobals + } = params; + this.data.annotationType = AnnotationType.LINK; + this.data.noHTML = false; + const quadPoints = getQuadPoints(dict, this.rectangle); + if (quadPoints) { + this.data.quadPoints = quadPoints; + } + this.data.borderColor ||= this.data.color; + Catalog.parseDestDictionary({ + destDict: dict, + resultObj: this.data, + docBaseUrl: annotationGlobals.baseUrl, + docAttachments: annotationGlobals.attachments + }); + } + get overlaysTextContent() { + return true; + } +} +class PopupAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict + } = params; + this.data.annotationType = AnnotationType.POPUP; + this.data.noHTML = false; + if (this.width === 0 || this.height === 0) { + this.data.rect = null; + } + let parentItem = dict.get("Parent"); + if (!parentItem) { + warn("Popup annotation has a missing or invalid parent annotation."); + return; + } + this.data.parentRect = lookupNormalRect(parentItem.getArray("Rect"), null); + this.data.creationDate = parentItem.get("CreationDate") || ""; + const rt = parentItem.get("RT"); + if (isName(rt, AnnotationReplyType.GROUP)) { + parentItem = parentItem.get("IRT"); + } + if (!parentItem.has("M")) { + this.data.modificationDate = null; + } else { + this.setModificationDate(parentItem.get("M")); + this.data.modificationDate = this.modificationDate; + } + if (!parentItem.has("C")) { + this.data.color = null; + } else { + this.setColor(parentItem.getArray("C")); + this.data.color = this.color; + } + if (!this.viewable) { + const parentFlags = parentItem.get("F"); + if (this._isViewable(parentFlags)) { + this.setFlags(parentFlags); + } + } + this.setTitle(parentItem.get("T")); + this.data.titleObj = this._title; + this.setContents(parentItem.get("Contents")); + this.data.contentsObj = this._contents; + if (parentItem.has("RC")) { + this.data.richText = XFAFactory.getRichTextAsHtml(parentItem.get("RC")); + } + this.data.open = !!dict.get("Open"); + } + static createNewDict(annotation, xref, _params) { + const { + oldAnnotation, + rect, + parent + } = annotation; + const popup = oldAnnotation || new Dict(xref); + popup.setIfNotExists("Type", Name.get("Annot")); + popup.setIfNotExists("Subtype", Name.get("Popup")); + popup.setIfNotExists("Open", false); + popup.setIfArray("Rect", rect); + popup.set("Parent", parent); + return popup; + } + static async createNewAppearanceStream(annotation, xref, params) { + return null; + } +} +class FreeTextAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.hasOwnCanvas = this.data.noRotate; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + const { + annotationGlobals, + evaluatorOptions, + xref + } = params; + this.data.annotationType = AnnotationType.FREETEXT; + this.setDefaultAppearance(params); + this._hasAppearance = !!this.appearance; + if (this._hasAppearance) { + const { + fontColor, + fontSize + } = parseAppearanceStream(this.appearance, evaluatorOptions, xref, annotationGlobals.globalColorSpaceCache); + this.data.defaultAppearanceData.fontColor = fontColor; + this.data.defaultAppearanceData.fontSize = fontSize || 10; + } else { + this.data.defaultAppearanceData.fontSize ||= 10; + const { + fontColor, + fontSize + } = this.data.defaultAppearanceData; + if (this._contents.str) { + this.data.textContent = this._contents.str.split(/\r\n?|\n/).map(line => line.trimEnd()); + const { + coords, + bbox, + matrix + } = FakeUnicodeFont.getFirstPositionInfo(this.rectangle, this.rotation, fontSize); + this.data.textPosition = this._transformPoint(coords, bbox, matrix); + } + if (this._isOffscreenCanvasSupported) { + const strokeAlpha = params.dict.get("CA"); + const fakeUnicodeFont = new FakeUnicodeFont(xref, "sans-serif"); + this.appearance = fakeUnicodeFont.createAppearance(this._contents.str, this.rectangle, this.rotation, fontSize, fontColor, strokeAlpha); + this._streams.push(this.appearance); + } else { + warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly."); + } + } + } + get hasTextContent() { + return this._hasAppearance; + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + color, + date, + fontSize, + oldAnnotation, + rect, + rotation, + user, + value + } = annotation; + const freetext = oldAnnotation || new Dict(xref); + freetext.setIfNotExists("Type", Name.get("Annot")); + freetext.setIfNotExists("Subtype", Name.get("FreeText")); + freetext.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate(date)}`); + if (oldAnnotation) { + freetext.delete("RC"); + } + freetext.setIfArray("Rect", rect); + const da = `/Helv ${fontSize} Tf ${getPdfColor(color, true)}`; + freetext.set("DA", da); + freetext.setIfDefined("Contents", stringToAsciiOrUTF16BE(value)); + freetext.setIfNotExists("F", 4); + freetext.setIfNotExists("Border", [0, 0, 0]); + freetext.setIfNumber("Rotate", rotation); + freetext.setIfDefined("T", stringToAsciiOrUTF16BE(user)); + if (apRef || ap) { + const n = new Dict(xref); + freetext.set("AP", n); + n.set("N", apRef || ap); + } + return freetext; + } + static async createNewAppearanceStream(annotation, xref, params) { + const { + baseFontRef, + evaluator, + task + } = params; + const { + color, + fontSize, + rect, + rotation, + value + } = annotation; + if (!color) { + return null; + } + const resources = new Dict(xref); + const font = new Dict(xref); + if (baseFontRef) { + font.set("Helv", baseFontRef); + } else { + const baseFont = new Dict(xref); + baseFont.setIfName("BaseFont", "Helvetica"); + baseFont.setIfName("Type", "Font"); + baseFont.setIfName("Subtype", "Type1"); + baseFont.setIfName("Encoding", "WinAnsiEncoding"); + font.set("Helv", baseFont); + } + resources.set("Font", font); + const helv = await WidgetAnnotation._getFontData(evaluator, task, { + fontName: "Helv", + fontSize + }, resources); + const [x1, y1, x2, y2] = rect; + let w = x2 - x1; + let h = y2 - y1; + if (rotation % 180 !== 0) { + [w, h] = [h, w]; + } + const lines = value.split("\n"); + const scale = fontSize / 1000; + let totalWidth = -Infinity; + const encodedLines = []; + for (let line of lines) { + const encoded = helv.encodeString(line); + if (encoded.length > 1) { + return null; + } + line = encoded.join(""); + encodedLines.push(line); + let lineWidth = 0; + const glyphs = helv.charsToGlyphs(line); + for (const glyph of glyphs) { + lineWidth += glyph.width * scale; + } + totalWidth = Math.max(totalWidth, lineWidth); + } + let hscale = 1; + if (totalWidth > w) { + hscale = w / totalWidth; + } + let vscale = 1; + const lineHeight = LINE_FACTOR * fontSize; + const lineAscent = (LINE_FACTOR - LINE_DESCENT_FACTOR) * fontSize; + const totalHeight = lineHeight * lines.length; + if (totalHeight > h) { + vscale = h / totalHeight; + } + const fscale = Math.min(hscale, vscale); + const newFontSize = fontSize * fscale; + let firstPoint, clipBox, matrix; + switch (rotation) { + case 0: + matrix = [1, 0, 0, 1]; + clipBox = [rect[0], rect[1], w, h]; + firstPoint = [rect[0], rect[3] - lineAscent]; + break; + case 90: + matrix = [0, 1, -1, 0]; + clipBox = [rect[1], -rect[2], w, h]; + firstPoint = [rect[1], -rect[0] - lineAscent]; + break; + case 180: + matrix = [-1, 0, 0, -1]; + clipBox = [-rect[2], -rect[3], w, h]; + firstPoint = [-rect[2], -rect[1] - lineAscent]; + break; + case 270: + matrix = [0, -1, 1, 0]; + clipBox = [-rect[3], rect[0], w, h]; + firstPoint = [-rect[3], rect[2] - lineAscent]; + break; + } + const buffer = ["q", `${matrix.join(" ")} 0 0 cm`, `${clipBox.join(" ")} re W n`, `BT`, `${getPdfColor(color, true)}`, `0 Tc /Helv ${numberToString(newFontSize)} Tf`]; + buffer.push(`${firstPoint.join(" ")} Td (${escapeString(encodedLines[0])}) Tj`); + const vShift = numberToString(lineHeight); + for (let i = 1, ii = encodedLines.length; i < ii; i++) { + const line = encodedLines[i]; + buffer.push(`0 -${vShift} Td (${escapeString(line)}) Tj`); + } + buffer.push("ET", "Q"); + const appearance = buffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.setIfName("Subtype", "Form"); + appearanceStreamDict.setIfName("Type", "XObject"); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Resources", resources); + appearanceStreamDict.set("Matrix", [1, 0, 0, 1, -rect[0], -rect[1]]); + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class LineAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.LINE; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + const lineCoordinates = lookupRect(dict.getArray("L"), [0, 0, 0, 0]); + this.data.lineCoordinates = Util.normalizeRect(lineCoordinates); + if (!this.appearance) { + const strokeColor = getPdfColorArray(this.color, [0, 0, 0]); + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = getPdfColorArray(interiorColor); + const fillAlpha = fillColor ? strokeAlpha : null; + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [this.data.lineCoordinates[0] - borderAdjust, this.data.lineCoordinates[1] - borderAdjust, this.data.lineCoordinates[2] + borderAdjust, this.data.lineCoordinates[3] + borderAdjust]; + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${lineCoordinates[0]} ${lineCoordinates[1]} m`, `${lineCoordinates[2]} ${lineCoordinates[3]} l`, "S"); + return [points[0] - borderWidth, points[7] - borderWidth, points[2] + borderWidth, points[3] + borderWidth]; + } + }); + } + } +} +class SquareAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.SQUARE; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + if (!this.appearance) { + const strokeColor = getPdfColorArray(this.color, [0, 0, 0]); + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = getPdfColorArray(interiorColor); + const fillAlpha = fillColor ? strokeAlpha : null; + if (this.borderStyle.width === 0 && !fillColor) { + return; + } + this._setDefaultAppearance({ + xref, + extra: `${this.borderStyle.width} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + const x = points[4] + this.borderStyle.width / 2; + const y = points[5] + this.borderStyle.width / 2; + const width = points[6] - points[4] - this.borderStyle.width; + const height = points[3] - points[7] - this.borderStyle.width; + buffer.push(`${x} ${y} ${width} ${height} re`); + if (fillColor) { + buffer.push("B"); + } else { + buffer.push("S"); + } + return [points[0], points[7], points[2], points[3]]; + } + }); + } + } +} +class CircleAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.CIRCLE; + if (!this.appearance) { + const strokeColor = getPdfColorArray(this.color, [0, 0, 0]); + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = getPdfColorArray(interiorColor); + const fillAlpha = fillColor ? strokeAlpha : null; + if (this.borderStyle.width === 0 && !fillColor) { + return; + } + const controlPointsDistance = 4 / 3 * Math.tan(Math.PI / (2 * 4)); + this._setDefaultAppearance({ + xref, + extra: `${this.borderStyle.width} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + const x0 = points[0] + this.borderStyle.width / 2; + const y0 = points[1] - this.borderStyle.width / 2; + const x1 = points[6] - this.borderStyle.width / 2; + const y1 = points[7] + this.borderStyle.width / 2; + const xMid = x0 + (x1 - x0) / 2; + const yMid = y0 + (y1 - y0) / 2; + const xOffset = (x1 - x0) / 2 * controlPointsDistance; + const yOffset = (y1 - y0) / 2 * controlPointsDistance; + buffer.push(`${xMid} ${y1} m`, `${xMid + xOffset} ${y1} ${x1} ${yMid + yOffset} ${x1} ${yMid} c`, `${x1} ${yMid - yOffset} ${xMid + xOffset} ${y0} ${xMid} ${y0} c`, `${xMid - xOffset} ${y0} ${x0} ${yMid - yOffset} ${x0} ${yMid} c`, `${x0} ${yMid + yOffset} ${xMid - xOffset} ${y1} ${xMid} ${y1} c`, "h"); + if (fillColor) { + buffer.push("B"); + } else { + buffer.push("S"); + } + return [points[0], points[7], points[2], points[3]]; + } + }); + } + } +} +class PolylineAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.POLYLINE; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + this.data.vertices = null; + const rawVertices = dict.getArray("Vertices"); + if (!isNumberArray(rawVertices, null)) { + return; + } + const vertices = this.data.vertices = Float32Array.from(rawVertices); + if (!this.appearance) { + const strokeColor = getPdfColorArray(this.color, [0, 0, 0]); + const strokeAlpha = dict.get("CA"); + let fillColor = getRgbColor(dict.getArray("IC"), null); + if (fillColor) { + fillColor = getPdfColorArray(fillColor); + } + let operator; + if (fillColor) { + if (this.color) { + operator = fillColor.every((c, i) => c === strokeColor[i]) ? "f" : "B"; + } else { + operator = "f"; + } + } else { + operator = "S"; + } + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [Infinity, Infinity, -Infinity, -Infinity]; + for (let i = 0, ii = vertices.length; i < ii; i += 2) { + Util.rectBoundingBox(vertices[i] - borderAdjust, vertices[i + 1] - borderAdjust, vertices[i] + borderAdjust, vertices[i + 1] + borderAdjust, bbox); + } + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + strokeAlpha, + fillColor, + fillAlpha: fillColor ? strokeAlpha : null, + pointsCallback: (buffer, points) => { + for (let i = 0, ii = vertices.length; i < ii; i += 2) { + buffer.push(`${vertices[i]} ${vertices[i + 1]} ${i === 0 ? "m" : "l"}`); + } + buffer.push(operator); + return [points[0], points[7], points[2], points[3]]; + } + }); + } + } +} +class PolygonAnnotation extends PolylineAnnotation { + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.POLYGON; + } +} +class CaretAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.CARET; + } +} +class InkAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.INK; + this.data.inkLists = []; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + this.data.opacity = dict.get("CA") || 1; + const rawInkLists = dict.getArray("InkList"); + if (!Array.isArray(rawInkLists)) { + return; + } + for (let i = 0, ii = rawInkLists.length; i < ii; ++i) { + if (!Array.isArray(rawInkLists[i])) { + continue; + } + const inkList = new Float32Array(rawInkLists[i].length); + this.data.inkLists.push(inkList); + for (let j = 0, jj = rawInkLists[i].length; j < jj; j += 2) { + const x = xref.fetchIfRef(rawInkLists[i][j]), + y = xref.fetchIfRef(rawInkLists[i][j + 1]); + if (typeof x === "number" && typeof y === "number") { + inkList[j] = x; + inkList[j + 1] = y; + } + } + } + if (!this.appearance) { + const strokeColor = getPdfColorArray(this.color, [0, 0, 0]); + const strokeAlpha = dict.get("CA"); + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [Infinity, Infinity, -Infinity, -Infinity]; + for (const inkList of this.data.inkLists) { + for (let i = 0, ii = inkList.length; i < ii; i += 2) { + Util.rectBoundingBox(inkList[i] - borderAdjust, inkList[i + 1] - borderAdjust, inkList[i] + borderAdjust, inkList[i + 1] + borderAdjust, bbox); + } + } + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + for (const inkList of this.data.inkLists) { + for (let i = 0, ii = inkList.length; i < ii; i += 2) { + buffer.push(`${inkList[i]} ${inkList[i + 1]} ${i === 0 ? "m" : "l"}`); + } + buffer.push("S"); + } + return [points[0], points[7], points[2], points[3]]; + } + }); + } + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + oldAnnotation, + color, + date, + opacity, + paths, + outlines, + rect, + rotation, + thickness, + user + } = annotation; + const ink = oldAnnotation || new Dict(xref); + ink.setIfNotExists("Type", Name.get("Annot")); + ink.setIfNotExists("Subtype", Name.get("Ink")); + ink.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate(date)}`); + ink.setIfArray("Rect", rect); + ink.setIfArray("InkList", outlines?.points || paths?.points); + ink.setIfNotExists("F", 4); + ink.setIfNumber("Rotate", rotation); + ink.setIfDefined("T", stringToAsciiOrUTF16BE(user)); + if (outlines) { + ink.setIfName("IT", "InkHighlight"); + } + if (thickness > 0) { + const bs = new Dict(xref); + ink.set("BS", bs); + bs.set("W", thickness); + } + ink.setIfArray("C", getPdfColorArray(color)); + ink.setIfNumber("CA", opacity); + if (ap || apRef) { + const n = new Dict(xref); + ink.set("AP", n); + n.set("N", apRef || ap); + } + return ink; + } + static async createNewAppearanceStream(annotation, xref, params) { + if (annotation.outlines) { + return this.createNewAppearanceStreamForHighlight(annotation, xref, params); + } + const { + color, + rect, + paths, + thickness, + opacity + } = annotation; + if (!color) { + return null; + } + const appearanceBuffer = [`${thickness} w 1 J 1 j`, `${getPdfColor(color, false)}`]; + if (opacity !== 1) { + appearanceBuffer.push("/R0 gs"); + } + for (const outline of paths.lines) { + appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} m`); + for (let i = 6, ii = outline.length; i < ii; i += 6) { + if (isNaN(outline[i])) { + appearanceBuffer.push(`${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`); + } else { + const [c1x, c1y, c2x, c2y, x, y] = outline.slice(i, i + 6); + appearanceBuffer.push([c1x, c1y, c2x, c2y, x, y].map(numberToString).join(" ") + " c"); + } + } + if (outline.length === 6) { + appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} l`); + } + } + appearanceBuffer.push("S"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.setIfName("Subtype", "Form"); + appearanceStreamDict.setIfName("Type", "XObject"); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + if (opacity !== 1) { + const resources = new Dict(xref); + const extGState = new Dict(xref); + const r0 = new Dict(xref); + r0.set("CA", opacity); + r0.setIfName("Type", "ExtGState"); + extGState.set("R0", r0); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } + static async createNewAppearanceStreamForHighlight(annotation, xref, params) { + const { + color, + rect, + outlines: { + outline + }, + opacity + } = annotation; + if (!color) { + return null; + } + const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"]; + appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} m`); + for (let i = 6, ii = outline.length; i < ii; i += 6) { + if (isNaN(outline[i])) { + appearanceBuffer.push(`${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`); + } else { + const [c1x, c1y, c2x, c2y, x, y] = outline.slice(i, i + 6); + appearanceBuffer.push([c1x, c1y, c2x, c2y, x, y].map(numberToString).join(" ") + " c"); + } + } + appearanceBuffer.push("h f"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.setIfName("Subtype", "Form"); + appearanceStreamDict.setIfName("Type", "XObject"); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(xref); + const extGState = new Dict(xref); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + const r0 = new Dict(xref); + extGState.set("R0", r0); + r0.setIfName("BM", "Multiply"); + if (opacity !== 1) { + r0.set("ca", opacity); + r0.setIfName("Type", "ExtGState"); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class HighlightAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.HIGHLIGHT; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + this.data.opacity = dict.get("CA") || 1; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + const resources = this.appearance?.dict.get("Resources"); + if (!this.appearance || !resources?.has("ExtGState")) { + if (this.appearance) { + warn("HighlightAnnotation - ignoring built-in appearance stream."); + } + const fillColor = getPdfColorArray(this.color, [1, 1, 0]); + const fillAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + fillColor, + blendMode: "Multiply", + fillAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${points[0]} ${points[1]} m`, `${points[2]} ${points[3]} l`, `${points[6]} ${points[7]} l`, `${points[4]} ${points[5]} l`, "f"); + return [points[0], points[7], points[2], points[3]]; + } + }); + } + } else { + this.data.popupRef = null; + } + } + get overlaysTextContent() { + return true; + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + color, + date, + oldAnnotation, + opacity, + rect, + rotation, + user, + quadPoints + } = annotation; + const highlight = oldAnnotation || new Dict(xref); + highlight.setIfNotExists("Type", Name.get("Annot")); + highlight.setIfNotExists("Subtype", Name.get("Highlight")); + highlight.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate(date)}`); + highlight.setIfArray("Rect", rect); + highlight.setIfNotExists("F", 4); + highlight.setIfNotExists("Border", [0, 0, 0]); + highlight.setIfNumber("Rotate", rotation); + highlight.setIfArray("QuadPoints", quadPoints); + highlight.setIfArray("C", getPdfColorArray(color)); + highlight.setIfNumber("CA", opacity); + highlight.setIfDefined("T", stringToAsciiOrUTF16BE(user)); + if (apRef || ap) { + const n = new Dict(xref); + highlight.set("AP", n); + n.set("N", apRef || ap); + } + return highlight; + } + static async createNewAppearanceStream(annotation, xref, params) { + const { + color, + rect, + outlines, + opacity + } = annotation; + if (!color) { + return null; + } + const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"]; + const buffer = []; + for (const outline of outlines) { + buffer.length = 0; + buffer.push(`${numberToString(outline[0])} ${numberToString(outline[1])} m`); + for (let i = 2, ii = outline.length; i < ii; i += 2) { + buffer.push(`${numberToString(outline[i])} ${numberToString(outline[i + 1])} l`); + } + buffer.push("h"); + appearanceBuffer.push(buffer.join("\n")); + } + appearanceBuffer.push("f*"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.setIfName("Subtype", "Form"); + appearanceStreamDict.setIfName("Type", "XObject"); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(xref); + const extGState = new Dict(xref); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + const r0 = new Dict(xref); + extGState.set("R0", r0); + r0.setIfName("BM", "Multiply"); + if (opacity !== 1) { + r0.set("ca", opacity); + r0.setIfName("Type", "ExtGState"); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class UnderlineAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.UNDERLINE; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + if (!this.appearance) { + const strokeColor = getPdfColorArray(this.color, [0, 0, 0]); + const strokeAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + extra: "[] 0 d 0.571 w", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${points[4]} ${points[5] + 1.3} m`, `${points[6]} ${points[7] + 1.3} l`, "S"); + return [points[0], points[7], points[2], points[3]]; + } + }); + } + } else { + this.data.popupRef = null; + } + } + get overlaysTextContent() { + return true; + } +} +class SquigglyAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.SQUIGGLY; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + if (!this.appearance) { + const strokeColor = getPdfColorArray(this.color, [0, 0, 0]); + const strokeAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + extra: "[] 0 d 1 w", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + const dy = (points[1] - points[5]) / 6; + let shift = dy; + let x = points[4]; + const y = points[5]; + const xEnd = points[6]; + buffer.push(`${x} ${y + shift} m`); + do { + x += 2; + shift = shift === 0 ? dy : 0; + buffer.push(`${x} ${y + shift} l`); + } while (x < xEnd); + buffer.push("S"); + return [points[4], y - 2 * dy, xEnd, y + 2 * dy]; + } + }); + } + } else { + this.data.popupRef = null; + } + } + get overlaysTextContent() { + return true; + } +} +class StrikeOutAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.STRIKEOUT; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + if (!this.appearance) { + const strokeColor = getPdfColorArray(this.color, [0, 0, 0]); + const strokeAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + extra: "[] 0 d 1 w", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${(points[0] + points[4]) / 2} ` + `${(points[1] + points[5]) / 2} m`, `${(points[2] + points[6]) / 2} ` + `${(points[3] + points[7]) / 2} l`, "S"); + return [points[0], points[7], points[2], points[3]]; + } + }); + } + } else { + this.data.popupRef = null; + } + } + get overlaysTextContent() { + return true; + } +} +class StampAnnotation extends MarkupAnnotation { + #savedHasOwnCanvas = null; + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.STAMP; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + } + mustBeViewedWhenEditing(isEditing, modifiedIds = null) { + if (isEditing) { + if (!this.data.isEditable) { + return true; + } + this.#savedHasOwnCanvas ??= this.data.hasOwnCanvas; + this.data.hasOwnCanvas = true; + return true; + } + if (this.#savedHasOwnCanvas !== null) { + this.data.hasOwnCanvas = this.#savedHasOwnCanvas; + this.#savedHasOwnCanvas = null; + } + return !modifiedIds?.has(this.data.id); + } + static async createImage(bitmap, xref) { + const { + width, + height + } = bitmap; + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d", { + alpha: true + }); + ctx.drawImage(bitmap, 0, 0); + const data = ctx.getImageData(0, 0, width, height).data; + const buf32 = new Uint32Array(data.buffer); + const hasAlpha = buf32.some(FeatureTest.isLittleEndian ? x => x >>> 24 !== 0xff : x => (x & 0xff) !== 0xff); + if (hasAlpha) { + ctx.fillStyle = "white"; + ctx.fillRect(0, 0, width, height); + ctx.drawImage(bitmap, 0, 0); + } + const jpegBufferPromise = canvas.convertToBlob({ + type: "image/jpeg", + quality: 1 + }).then(blob => blob.arrayBuffer()); + const xobjectName = Name.get("XObject"); + const imageName = Name.get("Image"); + const image = new Dict(xref); + image.set("Type", xobjectName); + image.set("Subtype", imageName); + image.set("BitsPerComponent", 8); + image.setIfName("ColorSpace", "DeviceRGB"); + image.setIfName("Filter", "DCTDecode"); + image.set("BBox", [0, 0, width, height]); + image.set("Width", width); + image.set("Height", height); + let smaskStream = null; + if (hasAlpha) { + const alphaBuffer = new Uint8Array(buf32.length); + if (FeatureTest.isLittleEndian) { + for (let i = 0, ii = buf32.length; i < ii; i++) { + alphaBuffer[i] = buf32[i] >>> 24; + } + } else { + for (let i = 0, ii = buf32.length; i < ii; i++) { + alphaBuffer[i] = buf32[i] & 0xff; + } + } + const smask = new Dict(xref); + smask.set("Type", xobjectName); + smask.set("Subtype", imageName); + smask.set("BitsPerComponent", 8); + smask.setIfName("ColorSpace", "DeviceGray"); + smask.set("Width", width); + smask.set("Height", height); + smaskStream = new Stream(alphaBuffer, 0, 0, smask); + } + const imageStream = new Stream(await jpegBufferPromise, 0, 0, image); + return { + imageStream, + smaskStream, + width, + height + }; + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + date, + oldAnnotation, + rect, + rotation, + user + } = annotation; + const stamp = oldAnnotation || new Dict(xref); + stamp.setIfNotExists("Type", Name.get("Annot")); + stamp.setIfNotExists("Subtype", Name.get("Stamp")); + stamp.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate(date)}`); + stamp.setIfArray("Rect", rect); + stamp.setIfNotExists("F", 4); + stamp.setIfNotExists("Border", [0, 0, 0]); + stamp.setIfNumber("Rotate", rotation); + stamp.setIfDefined("T", stringToAsciiOrUTF16BE(user)); + if (apRef || ap) { + const n = new Dict(xref); + stamp.set("AP", n); + n.set("N", apRef || ap); + } + return stamp; + } + static async #createNewAppearanceStreamForDrawing(annotation, xref) { + const { + areContours, + color, + rect, + lines, + thickness + } = annotation; + if (!color) { + return null; + } + const appearanceBuffer = [`${thickness} w 1 J 1 j`, `${getPdfColor(color, areContours)}`]; + for (const line of lines) { + appearanceBuffer.push(`${numberToString(line[4])} ${numberToString(line[5])} m`); + for (let i = 6, ii = line.length; i < ii; i += 6) { + if (isNaN(line[i])) { + appearanceBuffer.push(`${numberToString(line[i + 4])} ${numberToString(line[i + 5])} l`); + } else { + const [c1x, c1y, c2x, c2y, x, y] = line.slice(i, i + 6); + appearanceBuffer.push([c1x, c1y, c2x, c2y, x, y].map(numberToString).join(" ") + " c"); + } + } + if (line.length === 6) { + appearanceBuffer.push(`${numberToString(line[4])} ${numberToString(line[5])} l`); + } + } + appearanceBuffer.push(areContours ? "F" : "S"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.setIfName("Subtype", "Form"); + appearanceStreamDict.setIfName("Type", "XObject"); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } + static async createNewAppearanceStream(annotation, xref, params) { + if (annotation.oldAnnotation) { + return null; + } + if (annotation.isSignature) { + return this.#createNewAppearanceStreamForDrawing(annotation, xref); + } + const { + rotation + } = annotation; + const { + imageRef, + width, + height + } = params.image; + const resources = new Dict(xref); + const xobject = new Dict(xref); + resources.set("XObject", xobject); + xobject.set("Im0", imageRef); + const appearance = `q ${width} 0 0 ${height} 0 0 cm /Im0 Do Q`; + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.setIfName("Subtype", "Form"); + appearanceStreamDict.setIfName("Type", "XObject"); + appearanceStreamDict.set("BBox", [0, 0, width, height]); + appearanceStreamDict.set("Resources", resources); + if (rotation) { + const matrix = getRotationMatrix(rotation, width, height); + appearanceStreamDict.set("Matrix", matrix); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class FileAttachmentAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + const file = new FileSpec(dict.get("FS"), xref); + this.data.annotationType = AnnotationType.FILEATTACHMENT; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + this.data.file = file.serializable; + const name = dict.get("Name"); + this.data.name = name instanceof Name ? stringToPDFString(name.name) : "PushPin"; + const fillAlpha = dict.get("ca"); + this.data.fillAlpha = typeof fillAlpha === "number" && fillAlpha >= 0 && fillAlpha <= 1 ? fillAlpha : null; + } +} + +;// ./src/core/calculate_md5.js + +const PARAMS = { + get r() { + return shadow(this, "r", new Uint8Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21])); + }, + get k() { + return shadow(this, "k", new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551])); + } +}; +function calculateMD5(data, offset, length) { + let h0 = 1732584193, + h1 = -271733879, + h2 = -1732584194, + h3 = 271733878; + const paddedLength = length + 72 & ~63; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 8; + if (i < n) { + i = n; + } + padded[i++] = length << 3 & 0xff; + padded[i++] = length >> 5 & 0xff; + padded[i++] = length >> 13 & 0xff; + padded[i++] = length >> 21 & 0xff; + padded[i++] = length >>> 29 & 0xff; + i += 3; + const w = new Int32Array(16); + const { + k, + r + } = PARAMS; + for (i = 0; i < paddedLength;) { + for (j = 0; j < 16; ++j, i += 4) { + w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24; + } + let a = h0, + b = h1, + c = h2, + d = h3, + f, + g; + for (j = 0; j < 64; ++j) { + if (j < 16) { + f = b & c | ~b & d; + g = j; + } else if (j < 32) { + f = d & b | ~d & c; + g = 5 * j + 1 & 15; + } else if (j < 48) { + f = b ^ c ^ d; + g = 3 * j + 5 & 15; + } else { + f = c ^ (b | ~d); + g = 7 * j & 15; + } + const tmp = d, + rotateArg = a + f + k[j] + w[g] | 0, + rotate = r[j]; + d = c; + c = b; + b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0; + a = tmp; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + } + return new Uint8Array([h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >>> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >>> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >>> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >>> 24 & 0xFF]); +} + +;// ./src/core/dataset_reader.js + + + +function decodeString(str) { + try { + return stringToUTF8String(str); + } catch (ex) { + warn(`UTF-8 decoding failed: "${ex}".`); + return str; + } +} +class DatasetXMLParser extends SimpleXMLParser { + constructor(options) { + super(options); + this.node = null; + } + onEndElement(name) { + const node = super.onEndElement(name); + if (node && name === "xfa:datasets") { + this.node = node; + throw new Error("Aborting DatasetXMLParser."); + } + } +} +class DatasetReader { + constructor(data) { + if (data.datasets) { + this.node = new SimpleXMLParser({ + hasAttributes: true + }).parseFromString(data.datasets).documentElement; + } else { + const parser = new DatasetXMLParser({ + hasAttributes: true + }); + try { + parser.parseFromString(data["xdp:xdp"]); + } catch {} + this.node = parser.node; + } + } + getValue(path) { + if (!this.node || !path) { + return ""; + } + const node = this.node.searchNode(parseXFAPath(path), 0); + if (!node) { + return ""; + } + const first = node.firstChild; + if (first?.nodeName === "value") { + return node.children.map(child => decodeString(child.textContent)); + } + return decodeString(node.textContent); + } +} + +;// ./src/core/intersector.js +class SingleIntersector { + #annotation; + minX = Infinity; + minY = Infinity; + maxX = -Infinity; + maxY = -Infinity; + #quadPoints = null; + #text = []; + #extraChars = []; + #lastIntersectingQuadIndex = -1; + #canTakeExtraChars = false; + constructor(annotation) { + this.#annotation = annotation; + const quadPoints = annotation.data.quadPoints; + if (!quadPoints) { + [this.minX, this.minY, this.maxX, this.maxY] = annotation.data.rect; + return; + } + for (let i = 0, ii = quadPoints.length; i < ii; i += 8) { + this.minX = Math.min(this.minX, quadPoints[i]); + this.maxX = Math.max(this.maxX, quadPoints[i + 2]); + this.minY = Math.min(this.minY, quadPoints[i + 5]); + this.maxY = Math.max(this.maxY, quadPoints[i + 1]); + } + if (quadPoints.length > 8) { + this.#quadPoints = quadPoints; + } + } + #intersects(x, y) { + if (this.minX >= x || this.maxX <= x || this.minY >= y || this.maxY <= y) { + return false; + } + const quadPoints = this.#quadPoints; + if (!quadPoints) { + return true; + } + if (this.#lastIntersectingQuadIndex >= 0) { + const i = this.#lastIntersectingQuadIndex; + if (!(quadPoints[i] >= x || quadPoints[i + 2] <= x || quadPoints[i + 5] >= y || quadPoints[i + 1] <= y)) { + return true; + } + this.#lastIntersectingQuadIndex = -1; + } + for (let i = 0, ii = quadPoints.length; i < ii; i += 8) { + if (!(quadPoints[i] >= x || quadPoints[i + 2] <= x || quadPoints[i + 5] >= y || quadPoints[i + 1] <= y)) { + this.#lastIntersectingQuadIndex = i; + return true; + } + } + return false; + } + addGlyph(x, y, glyph) { + if (!this.#intersects(x, y)) { + this.disableExtraChars(); + return false; + } + if (this.#extraChars.length > 0) { + this.#text.push(this.#extraChars.join("")); + this.#extraChars.length = 0; + } + this.#text.push(glyph); + this.#canTakeExtraChars = true; + return true; + } + addExtraChar(char) { + if (this.#canTakeExtraChars) { + this.#extraChars.push(char); + } + } + disableExtraChars() { + if (!this.#canTakeExtraChars) { + return; + } + this.#canTakeExtraChars = false; + this.#extraChars.length = 0; + } + setText() { + this.#annotation.data.overlaidText = this.#text.join(""); + } +} +const STEPS = 64; +class Intersector { + #intersectors = []; + #grid = []; + #minX; + #maxX; + #minY; + #maxY; + #invXRatio; + #invYRatio; + constructor(annotations) { + let minX = Infinity; + let minY = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + const intersectors = this.#intersectors; + for (const annotation of annotations) { + if (!annotation.data.quadPoints && !annotation.data.rect) { + continue; + } + const intersector = new SingleIntersector(annotation); + intersectors.push(intersector); + minX = Math.min(minX, intersector.minX); + minY = Math.min(minY, intersector.minY); + maxX = Math.max(maxX, intersector.maxX); + maxY = Math.max(maxY, intersector.maxY); + } + this.#minX = minX; + this.#minY = minY; + this.#maxX = maxX; + this.#maxY = maxY; + this.#invXRatio = (STEPS - 1) / (maxX - minX); + this.#invYRatio = (STEPS - 1) / (maxY - minY); + for (const intersector of intersectors) { + const iMin = this.#getGridIndex(intersector.minX, intersector.minY); + const iMax = this.#getGridIndex(intersector.maxX, intersector.maxY); + const w = (iMax - iMin) % STEPS; + const h = Math.floor((iMax - iMin) / STEPS); + for (let i = iMin; i <= iMin + h * STEPS; i += STEPS) { + for (let j = 0; j <= w; j++) { + let existing = this.#grid[i + j]; + if (!existing) { + this.#grid[i + j] = existing = []; + } + existing.push(intersector); + } + } + } + } + #getGridIndex(x, y) { + const i = Math.floor((x - this.#minX) * this.#invXRatio); + const j = Math.floor((y - this.#minY) * this.#invYRatio); + return i + j * STEPS; + } + addGlyph(transform, width, height, glyph) { + const x = transform[4] + width / 2; + const y = transform[5] + height / 2; + if (x < this.#minX || y < this.#minY || x > this.#maxX || y > this.#maxY) { + return; + } + const intersectors = this.#grid[this.#getGridIndex(x, y)]; + if (!intersectors) { + return; + } + for (const intersector of intersectors) { + intersector.addGlyph(x, y, glyph); + } + } + addExtraChar(char) { + for (const intersector of this.#intersectors) { + intersector.addExtraChar(char); + } + } + setText() { + for (const intersector of this.#intersectors) { + intersector.setText(); + } + } +} + +;// ./src/core/calculate_sha_other.js + +class Word64 { + constructor(highInteger, lowInteger) { + this.high = highInteger | 0; + this.low = lowInteger | 0; + } + and(word) { + this.high &= word.high; + this.low &= word.low; + } + xor(word) { + this.high ^= word.high; + this.low ^= word.low; + } + shiftRight(places) { + if (places >= 32) { + this.low = this.high >>> places - 32 | 0; + this.high = 0; + } else { + this.low = this.low >>> places | this.high << 32 - places; + this.high = this.high >>> places | 0; + } + } + rotateRight(places) { + let low, high; + if (places & 32) { + high = this.low; + low = this.high; + } else { + low = this.low; + high = this.high; + } + places &= 31; + this.low = low >>> places | high << 32 - places; + this.high = high >>> places | low << 32 - places; + } + not() { + this.high = ~this.high; + this.low = ~this.low; + } + add(word) { + const lowAdd = (this.low >>> 0) + (word.low >>> 0); + let highAdd = (this.high >>> 0) + (word.high >>> 0); + if (lowAdd > 0xffffffff) { + highAdd += 1; + } + this.low = lowAdd | 0; + this.high = highAdd | 0; + } + copyTo(bytes, offset) { + bytes[offset] = this.high >>> 24 & 0xff; + bytes[offset + 1] = this.high >> 16 & 0xff; + bytes[offset + 2] = this.high >> 8 & 0xff; + bytes[offset + 3] = this.high & 0xff; + bytes[offset + 4] = this.low >>> 24 & 0xff; + bytes[offset + 5] = this.low >> 16 & 0xff; + bytes[offset + 6] = this.low >> 8 & 0xff; + bytes[offset + 7] = this.low & 0xff; + } + assign(word) { + this.high = word.high; + this.low = word.low; + } +} +const calculate_sha_other_PARAMS = { + get k() { + return shadow(this, "k", [new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019), new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]); + } +}; +function ch(result, x, y, z, tmp) { + result.assign(x); + result.and(y); + tmp.assign(x); + tmp.not(); + tmp.and(z); + result.xor(tmp); +} +function maj(result, x, y, z, tmp) { + result.assign(x); + result.and(y); + tmp.assign(x); + tmp.and(z); + result.xor(tmp); + tmp.assign(y); + tmp.and(z); + result.xor(tmp); +} +function sigma(result, x, tmp) { + result.assign(x); + result.rotateRight(28); + tmp.assign(x); + tmp.rotateRight(34); + result.xor(tmp); + tmp.assign(x); + tmp.rotateRight(39); + result.xor(tmp); +} +function sigmaPrime(result, x, tmp) { + result.assign(x); + result.rotateRight(14); + tmp.assign(x); + tmp.rotateRight(18); + result.xor(tmp); + tmp.assign(x); + tmp.rotateRight(41); + result.xor(tmp); +} +function littleSigma(result, x, tmp) { + result.assign(x); + result.rotateRight(1); + tmp.assign(x); + tmp.rotateRight(8); + result.xor(tmp); + tmp.assign(x); + tmp.shiftRight(7); + result.xor(tmp); +} +function littleSigmaPrime(result, x, tmp) { + result.assign(x); + result.rotateRight(19); + tmp.assign(x); + tmp.rotateRight(61); + result.xor(tmp); + tmp.assign(x); + tmp.shiftRight(6); + result.xor(tmp); +} +function calculateSHA512(data, offset, length, mode384 = false) { + let h0, h1, h2, h3, h4, h5, h6, h7; + if (!mode384) { + h0 = new Word64(0x6a09e667, 0xf3bcc908); + h1 = new Word64(0xbb67ae85, 0x84caa73b); + h2 = new Word64(0x3c6ef372, 0xfe94f82b); + h3 = new Word64(0xa54ff53a, 0x5f1d36f1); + h4 = new Word64(0x510e527f, 0xade682d1); + h5 = new Word64(0x9b05688c, 0x2b3e6c1f); + h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); + h7 = new Word64(0x5be0cd19, 0x137e2179); + } else { + h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); + h1 = new Word64(0x629a292a, 0x367cd507); + h2 = new Word64(0x9159015a, 0x3070dd17); + h3 = new Word64(0x152fecd8, 0xf70e5939); + h4 = new Word64(0x67332667, 0xffc00b31); + h5 = new Word64(0x8eb44a87, 0x68581511); + h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); + h7 = new Word64(0x47b5481d, 0xbefa4fa4); + } + const paddedLength = Math.ceil((length + 17) / 128) * 128; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 16; + if (i < n) { + i = n; + } + i += 11; + padded[i++] = length >>> 29 & 0xff; + padded[i++] = length >> 21 & 0xff; + padded[i++] = length >> 13 & 0xff; + padded[i++] = length >> 5 & 0xff; + padded[i++] = length << 3 & 0xff; + const w = new Array(80); + for (i = 0; i < 80; i++) { + w[i] = new Word64(0, 0); + } + const { + k + } = calculate_sha_other_PARAMS; + let a = new Word64(0, 0), + b = new Word64(0, 0), + c = new Word64(0, 0); + let d = new Word64(0, 0), + e = new Word64(0, 0), + f = new Word64(0, 0); + let g = new Word64(0, 0), + h = new Word64(0, 0); + const t1 = new Word64(0, 0), + t2 = new Word64(0, 0); + const tmp1 = new Word64(0, 0), + tmp2 = new Word64(0, 0); + let tmp3; + for (i = 0; i < paddedLength;) { + for (j = 0; j < 16; ++j) { + w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; + w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7]; + i += 8; + } + for (j = 16; j < 80; ++j) { + tmp3 = w[j]; + littleSigmaPrime(tmp3, w[j - 2], tmp2); + tmp3.add(w[j - 7]); + littleSigma(tmp1, w[j - 15], tmp2); + tmp3.add(tmp1); + tmp3.add(w[j - 16]); + } + a.assign(h0); + b.assign(h1); + c.assign(h2); + d.assign(h3); + e.assign(h4); + f.assign(h5); + g.assign(h6); + h.assign(h7); + for (j = 0; j < 80; ++j) { + t1.assign(h); + sigmaPrime(tmp1, e, tmp2); + t1.add(tmp1); + ch(tmp1, e, f, g, tmp2); + t1.add(tmp1); + t1.add(k[j]); + t1.add(w[j]); + sigma(t2, a, tmp2); + maj(tmp1, a, b, c, tmp2); + t2.add(tmp1); + tmp3 = h; + h = g; + g = f; + f = e; + d.add(t1); + e = d; + d = c; + c = b; + b = a; + tmp3.assign(t1); + tmp3.add(t2); + a = tmp3; + } + h0.add(a); + h1.add(b); + h2.add(c); + h3.add(d); + h4.add(e); + h5.add(f); + h6.add(g); + h7.add(h); + } + let result; + if (!mode384) { + result = new Uint8Array(64); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); + h6.copyTo(result, 48); + h7.copyTo(result, 56); + } else { + result = new Uint8Array(48); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); + } + return result; +} +function calculateSHA384(data, offset, length) { + return calculateSHA512(data, offset, length, true); +} + +;// ./src/core/calculate_sha256.js + +const calculate_sha256_PARAMS = { + get k() { + return shadow(this, "k", [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]); + } +}; +function rotr(x, n) { + return x >>> n | x << 32 - n; +} +function calculate_sha256_ch(x, y, z) { + return x & y ^ ~x & z; +} +function calculate_sha256_maj(x, y, z) { + return x & y ^ x & z ^ y & z; +} +function calculate_sha256_sigma(x) { + return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); +} +function calculate_sha256_sigmaPrime(x) { + return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); +} +function calculate_sha256_littleSigma(x) { + return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; +} +function calculate_sha256_littleSigmaPrime(x) { + return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; +} +function calculateSHA256(data, offset, length) { + let h0 = 0x6a09e667, + h1 = 0xbb67ae85, + h2 = 0x3c6ef372, + h3 = 0xa54ff53a, + h4 = 0x510e527f, + h5 = 0x9b05688c, + h6 = 0x1f83d9ab, + h7 = 0x5be0cd19; + const paddedLength = Math.ceil((length + 9) / 64) * 64; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 8; + if (i < n) { + i = n; + } + i += 3; + padded[i++] = length >>> 29 & 0xff; + padded[i++] = length >> 21 & 0xff; + padded[i++] = length >> 13 & 0xff; + padded[i++] = length >> 5 & 0xff; + padded[i++] = length << 3 & 0xff; + const w = new Uint32Array(64); + const { + k + } = calculate_sha256_PARAMS; + for (i = 0; i < paddedLength;) { + for (j = 0; j < 16; ++j) { + w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; + i += 4; + } + for (j = 16; j < 64; ++j) { + w[j] = calculate_sha256_littleSigmaPrime(w[j - 2]) + w[j - 7] + calculate_sha256_littleSigma(w[j - 15]) + w[j - 16] | 0; + } + let a = h0, + b = h1, + c = h2, + d = h3, + e = h4, + f = h5, + g = h6, + h = h7, + t1, + t2; + for (j = 0; j < 64; ++j) { + t1 = h + calculate_sha256_sigmaPrime(e) + calculate_sha256_ch(e, f, g) + k[j] + w[j]; + t2 = calculate_sha256_sigma(a) + calculate_sha256_maj(a, b, c); + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + h4 = h4 + e | 0; + h5 = h5 + f | 0; + h6 = h6 + g | 0; + h7 = h7 + h | 0; + } + return new Uint8Array([h0 >> 24 & 0xFF, h0 >> 16 & 0xFF, h0 >> 8 & 0xFF, h0 & 0xFF, h1 >> 24 & 0xFF, h1 >> 16 & 0xFF, h1 >> 8 & 0xFF, h1 & 0xFF, h2 >> 24 & 0xFF, h2 >> 16 & 0xFF, h2 >> 8 & 0xFF, h2 & 0xFF, h3 >> 24 & 0xFF, h3 >> 16 & 0xFF, h3 >> 8 & 0xFF, h3 & 0xFF, h4 >> 24 & 0xFF, h4 >> 16 & 0xFF, h4 >> 8 & 0xFF, h4 & 0xFF, h5 >> 24 & 0xFF, h5 >> 16 & 0xFF, h5 >> 8 & 0xFF, h5 & 0xFF, h6 >> 24 & 0xFF, h6 >> 16 & 0xFF, h6 >> 8 & 0xFF, h6 & 0xFF, h7 >> 24 & 0xFF, h7 >> 16 & 0xFF, h7 >> 8 & 0xFF, h7 & 0xFF]); +} + +;// ./src/core/decrypt_stream.js + +const chunkSize = 512; +class DecryptStream extends DecodeStream { + constructor(str, maybeLength, decrypt) { + super(maybeLength); + this.stream = str; + this.dict = str.dict; + this.decrypt = decrypt; + this.nextChunk = null; + this.initialized = false; + } + readBlock() { + let chunk; + if (this.initialized) { + chunk = this.nextChunk; + } else { + chunk = this.stream.getBytes(chunkSize); + this.initialized = true; + } + if (!chunk?.length) { + this.eof = true; + return; + } + this.nextChunk = this.stream.getBytes(chunkSize); + const hasMoreData = this.nextChunk?.length > 0; + const decrypt = this.decrypt; + chunk = decrypt(chunk, !hasMoreData); + const bufferLength = this.bufferLength, + newLength = bufferLength + chunk.length, + buffer = this.ensureBuffer(newLength); + buffer.set(chunk, bufferLength); + this.bufferLength = newLength; + } + getOriginalStream() { + return this; + } +} + +;// ./src/core/crypto.js + + + + + + +class ARCFourCipher { + constructor(key) { + this.a = 0; + this.b = 0; + const s = new Uint8Array(256); + const keyLength = key.length; + for (let i = 0; i < 256; ++i) { + s[i] = i; + } + for (let i = 0, j = 0; i < 256; ++i) { + const tmp = s[i]; + j = j + tmp + key[i % keyLength] & 0xff; + s[i] = s[j]; + s[j] = tmp; + } + this.s = s; + } + encryptBlock(data) { + let a = this.a, + b = this.b; + const s = this.s; + const n = data.length; + const output = new Uint8Array(n); + for (let i = 0; i < n; ++i) { + a = a + 1 & 0xff; + const tmp = s[a]; + b = b + tmp & 0xff; + const tmp2 = s[b]; + s[a] = tmp2; + s[b] = tmp; + output[i] = data[i] ^ s[tmp + tmp2 & 0xff]; + } + this.a = a; + this.b = b; + return output; + } + decryptBlock(data) { + return this.encryptBlock(data); + } + encrypt(data) { + return this.encryptBlock(data); + } +} +class NullCipher { + decryptBlock(data) { + return data; + } + encrypt(data) { + return data; + } +} +class AESBaseCipher { + _s = new Uint8Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]); + _inv_s = new Uint8Array([0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]); + _mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); + _mixCol = new Uint8Array(256).map((_, i) => i < 128 ? i << 1 : i << 1 ^ 0x1b); + constructor() { + this.buffer = new Uint8Array(16); + this.bufferPosition = 0; + } + _expandKey(cipherKey) { + unreachable("Cannot call `_expandKey` on the base class"); + } + _decrypt(input, key) { + let t, u, v; + const state = new Uint8Array(16); + state.set(input); + for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + for (let i = this._cyclesOfRepetition - 1; i >= 1; --i) { + t = state[13]; + state[13] = state[9]; + state[9] = state[5]; + state[5] = state[1]; + state[1] = t; + t = state[14]; + u = state[10]; + state[14] = state[6]; + state[10] = state[2]; + state[6] = t; + state[2] = u; + t = state[15]; + u = state[11]; + v = state[7]; + state[15] = state[3]; + state[11] = t; + state[7] = u; + state[3] = v; + for (let j = 0; j < 16; ++j) { + state[j] = this._inv_s[state[j]]; + } + for (let j = 0, k = i * 16; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + for (let j = 0; j < 16; j += 4) { + const s0 = this._mix[state[j]]; + const s1 = this._mix[state[j + 1]]; + const s2 = this._mix[state[j + 2]]; + const s3 = this._mix[state[j + 3]]; + t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; + state[j] = t >>> 24 & 0xff; + state[j + 1] = t >> 16 & 0xff; + state[j + 2] = t >> 8 & 0xff; + state[j + 3] = t & 0xff; + } + } + t = state[13]; + state[13] = state[9]; + state[9] = state[5]; + state[5] = state[1]; + state[1] = t; + t = state[14]; + u = state[10]; + state[14] = state[6]; + state[10] = state[2]; + state[6] = t; + state[2] = u; + t = state[15]; + u = state[11]; + v = state[7]; + state[15] = state[3]; + state[11] = t; + state[7] = u; + state[3] = v; + for (let j = 0; j < 16; ++j) { + state[j] = this._inv_s[state[j]]; + state[j] ^= key[j]; + } + return state; + } + _encrypt(input, key) { + const s = this._s; + let t, u, v; + const state = new Uint8Array(16); + state.set(input); + for (let j = 0; j < 16; ++j) { + state[j] ^= key[j]; + } + for (let i = 1; i < this._cyclesOfRepetition; i++) { + for (let j = 0; j < 16; ++j) { + state[j] = s[state[j]]; + } + v = state[1]; + state[1] = state[5]; + state[5] = state[9]; + state[9] = state[13]; + state[13] = v; + v = state[2]; + u = state[6]; + state[2] = state[10]; + state[6] = state[14]; + state[10] = v; + state[14] = u; + v = state[3]; + u = state[7]; + t = state[11]; + state[3] = state[15]; + state[7] = v; + state[11] = u; + state[15] = t; + for (let j = 0; j < 16; j += 4) { + const s0 = state[j]; + const s1 = state[j + 1]; + const s2 = state[j + 2]; + const s3 = state[j + 3]; + t = s0 ^ s1 ^ s2 ^ s3; + state[j] ^= t ^ this._mixCol[s0 ^ s1]; + state[j + 1] ^= t ^ this._mixCol[s1 ^ s2]; + state[j + 2] ^= t ^ this._mixCol[s2 ^ s3]; + state[j + 3] ^= t ^ this._mixCol[s3 ^ s0]; + } + for (let j = 0, k = i * 16; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + } + for (let j = 0; j < 16; ++j) { + state[j] = s[state[j]]; + } + v = state[1]; + state[1] = state[5]; + state[5] = state[9]; + state[9] = state[13]; + state[13] = v; + v = state[2]; + u = state[6]; + state[2] = state[10]; + state[6] = state[14]; + state[10] = v; + state[14] = u; + v = state[3]; + u = state[7]; + t = state[11]; + state[3] = state[15]; + state[7] = v; + state[11] = u; + state[15] = t; + for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + return state; + } + _decryptBlock2(data, finalize) { + const sourceLength = data.length; + let buffer = this.buffer, + bufferLength = this.bufferPosition; + const result = []; + let iv = this.iv; + for (let i = 0; i < sourceLength; ++i) { + buffer[bufferLength] = data[i]; + ++bufferLength; + if (bufferLength < 16) { + continue; + } + const plain = this._decrypt(buffer, this._key); + for (let j = 0; j < 16; ++j) { + plain[j] ^= iv[j]; + } + iv = buffer; + result.push(plain); + buffer = new Uint8Array(16); + bufferLength = 0; + } + this.buffer = buffer; + this.bufferLength = bufferLength; + this.iv = iv; + if (result.length === 0) { + return new Uint8Array(0); + } + let outputLength = 16 * result.length; + if (finalize) { + const lastBlock = result.at(-1); + let psLen = lastBlock[15]; + if (psLen <= 16) { + for (let i = 15, ii = 16 - psLen; i >= ii; --i) { + if (lastBlock[i] !== psLen) { + psLen = 0; + break; + } + } + outputLength -= psLen; + result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); + } + } + const output = new Uint8Array(outputLength); + for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { + output.set(result[i], j); + } + return output; + } + decryptBlock(data, finalize, iv = null) { + const sourceLength = data.length; + const buffer = this.buffer; + let bufferLength = this.bufferPosition; + if (iv) { + this.iv = iv; + } else { + for (let i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { + buffer[bufferLength] = data[i]; + } + if (bufferLength < 16) { + this.bufferLength = bufferLength; + return new Uint8Array(0); + } + this.iv = buffer; + data = data.subarray(16); + } + this.buffer = new Uint8Array(16); + this.bufferLength = 0; + this.decryptBlock = this._decryptBlock2; + return this.decryptBlock(data, finalize); + } + encrypt(data, iv) { + const sourceLength = data.length; + let buffer = this.buffer, + bufferLength = this.bufferPosition; + const result = []; + iv ||= new Uint8Array(16); + for (let i = 0; i < sourceLength; ++i) { + buffer[bufferLength] = data[i]; + ++bufferLength; + if (bufferLength < 16) { + continue; + } + for (let j = 0; j < 16; ++j) { + buffer[j] ^= iv[j]; + } + const cipher = this._encrypt(buffer, this._key); + iv = cipher; + result.push(cipher); + buffer = new Uint8Array(16); + bufferLength = 0; + } + this.buffer = buffer; + this.bufferLength = bufferLength; + this.iv = iv; + if (result.length === 0) { + return new Uint8Array(0); + } + const outputLength = 16 * result.length; + const output = new Uint8Array(outputLength); + for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { + output.set(result[i], j); + } + return output; + } +} +class AES128Cipher extends AESBaseCipher { + _rcon = new Uint8Array([0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d]); + constructor(key) { + super(); + this._cyclesOfRepetition = 10; + this._keySize = 160; + this._key = this._expandKey(key); + } + _expandKey(cipherKey) { + const b = 176; + const s = this._s; + const rcon = this._rcon; + const result = new Uint8Array(b); + result.set(cipherKey); + for (let j = 16, i = 1; j < b; ++i) { + let t1 = result[j - 3]; + let t2 = result[j - 2]; + let t3 = result[j - 1]; + let t4 = result[j - 4]; + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + t1 ^= rcon[i]; + for (let n = 0; n < 4; ++n) { + result[j] = t1 ^= result[j - 16]; + j++; + result[j] = t2 ^= result[j - 16]; + j++; + result[j] = t3 ^= result[j - 16]; + j++; + result[j] = t4 ^= result[j - 16]; + j++; + } + } + return result; + } +} +class AES256Cipher extends AESBaseCipher { + constructor(key) { + super(); + this._cyclesOfRepetition = 14; + this._keySize = 224; + this._key = this._expandKey(key); + } + _expandKey(cipherKey) { + const b = 240; + const s = this._s; + const result = new Uint8Array(b); + result.set(cipherKey); + let r = 1; + let t1, t2, t3, t4; + for (let j = 32, i = 1; j < b; ++i) { + if (j % 32 === 16) { + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + } else if (j % 32 === 0) { + t1 = result[j - 3]; + t2 = result[j - 2]; + t3 = result[j - 1]; + t4 = result[j - 4]; + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + t1 ^= r; + if ((r <<= 1) >= 256) { + r = (r ^ 0x1b) & 0xff; + } + } + for (let n = 0; n < 4; ++n) { + result[j] = t1 ^= result[j - 32]; + j++; + result[j] = t2 ^= result[j - 32]; + j++; + result[j] = t3 ^= result[j - 32]; + j++; + result[j] = t4 ^= result[j - 32]; + j++; + } + } + return result; + } +} +class PDFBase { + _hash(password, input, userBytes) { + unreachable("Abstract method `_hash` called"); + } + checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerValidationSalt, password.length); + hashData.set(userBytes, password.length + ownerValidationSalt.length); + const result = this._hash(password, hashData, userBytes); + return isArrayEqual(result, ownerPassword); + } + checkUserPassword(password, userValidationSalt, userPassword) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userValidationSalt, password.length); + const result = this._hash(password, hashData, []); + return isArrayEqual(result, userPassword); + } + getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerKeySalt, password.length); + hashData.set(userBytes, password.length + ownerKeySalt.length); + const key = this._hash(password, hashData, userBytes); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); + } + getUserKey(password, userKeySalt, userEncryption) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userKeySalt, password.length); + const key = this._hash(password, hashData, []); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); + } +} +class PDF17 extends PDFBase { + _hash(password, input, userBytes) { + return calculateSHA256(input, 0, input.length); + } +} +class PDF20 extends PDFBase { + _hash(password, input, userBytes) { + let k = calculateSHA256(input, 0, input.length).subarray(0, 32); + let e = [0]; + let i = 0; + while (i < 64 || e.at(-1) > i - 32) { + const combinedLength = password.length + k.length + userBytes.length, + combinedArray = new Uint8Array(combinedLength); + let writeOffset = 0; + combinedArray.set(password, writeOffset); + writeOffset += password.length; + combinedArray.set(k, writeOffset); + writeOffset += k.length; + combinedArray.set(userBytes, writeOffset); + const k1 = new Uint8Array(combinedLength * 64); + for (let j = 0, pos = 0; j < 64; j++, pos += combinedLength) { + k1.set(combinedArray, pos); + } + const cipher = new AES128Cipher(k.subarray(0, 16)); + e = cipher.encrypt(k1, k.subarray(16, 32)); + const remainder = Math.sumPrecise(e.slice(0, 16)) % 3; + if (remainder === 0) { + k = calculateSHA256(e, 0, e.length); + } else if (remainder === 1) { + k = calculateSHA384(e, 0, e.length); + } else if (remainder === 2) { + k = calculateSHA512(e, 0, e.length); + } + i++; + } + return k.subarray(0, 32); + } +} +class CipherTransform { + constructor(stringCipherConstructor, streamCipherConstructor) { + this.StringCipherConstructor = stringCipherConstructor; + this.StreamCipherConstructor = streamCipherConstructor; + } + createStream(stream, length) { + const cipher = new this.StreamCipherConstructor(); + return new DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) { + return cipher.decryptBlock(data, finalize); + }); + } + decryptString(s) { + const cipher = new this.StringCipherConstructor(); + let data = stringToBytes(s); + data = cipher.decryptBlock(data, true); + return bytesToString(data); + } + encryptString(s) { + const cipher = new this.StringCipherConstructor(); + if (cipher instanceof AESBaseCipher) { + const strLen = s.length; + const pad = 16 - strLen % 16; + s += String.fromCharCode(pad).repeat(pad); + const iv = new Uint8Array(16); + crypto.getRandomValues(iv); + let data = stringToBytes(s); + data = cipher.encrypt(data, iv); + const buf = new Uint8Array(16 + data.length); + buf.set(iv); + buf.set(data, 16); + return bytesToString(buf); + } + let data = stringToBytes(s); + data = cipher.encrypt(data); + return bytesToString(data); + } +} +class CipherTransformFactory { + static get _defaultPasswordBytes() { + return shadow(this, "_defaultPasswordBytes", new Uint8Array([0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a])); + } + #createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) { + if (password) { + const passwordLength = Math.min(127, password.length); + password = password.subarray(0, passwordLength); + } else { + password = []; + } + const pdfAlgorithm = revision === 6 ? new PDF20() : new PDF17(); + if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) { + return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); + } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) { + return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption); + } + return null; + } + #prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) { + const hashDataSize = 40 + ownerPassword.length + fileId.length; + const hashData = new Uint8Array(hashDataSize); + let i = 0, + j, + n; + if (password) { + n = Math.min(32, password.length); + for (; i < n; ++i) { + hashData[i] = password[i]; + } + } + j = 0; + while (i < 32) { + hashData[i++] = CipherTransformFactory._defaultPasswordBytes[j++]; + } + hashData.set(ownerPassword, i); + i += ownerPassword.length; + hashData[i++] = flags & 0xff; + hashData[i++] = flags >> 8 & 0xff; + hashData[i++] = flags >> 16 & 0xff; + hashData[i++] = flags >>> 24 & 0xff; + hashData.set(fileId, i); + i += fileId.length; + if (revision >= 4 && !encryptMetadata) { + hashData.fill(0xff, i, i + 4); + i += 4; + } + let hash = calculateMD5(hashData, 0, i); + const keyLengthInBytes = keyLength >> 3; + if (revision >= 3) { + for (j = 0; j < 50; ++j) { + hash = calculateMD5(hash, 0, keyLengthInBytes); + } + } + const encryptionKey = hash.subarray(0, keyLengthInBytes); + let cipher, checkData; + if (revision >= 3) { + i = 0; + hashData.set(CipherTransformFactory._defaultPasswordBytes, i); + i += 32; + hashData.set(fileId, i); + i += fileId.length; + cipher = new ARCFourCipher(encryptionKey); + checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); + n = encryptionKey.length; + const derivedKey = new Uint8Array(n); + for (j = 1; j <= 19; ++j) { + for (let k = 0; k < n; ++k) { + derivedKey[k] = encryptionKey[k] ^ j; + } + cipher = new ARCFourCipher(derivedKey); + checkData = cipher.encryptBlock(checkData); + } + } else { + cipher = new ARCFourCipher(encryptionKey); + checkData = cipher.encryptBlock(CipherTransformFactory._defaultPasswordBytes); + } + return checkData.every((data, k) => userPassword[k] === data) ? encryptionKey : null; + } + #decodeUserPassword(password, ownerPassword, revision, keyLength) { + const hashData = new Uint8Array(32); + let i = 0; + const n = Math.min(32, password.length); + for (; i < n; ++i) { + hashData[i] = password[i]; + } + let j = 0; + while (i < 32) { + hashData[i++] = CipherTransformFactory._defaultPasswordBytes[j++]; + } + let hash = calculateMD5(hashData, 0, i); + const keyLengthInBytes = keyLength >> 3; + if (revision >= 3) { + for (j = 0; j < 50; ++j) { + hash = calculateMD5(hash, 0, hash.length); + } + } + let cipher, userPassword; + if (revision >= 3) { + userPassword = ownerPassword; + const derivedKey = new Uint8Array(keyLengthInBytes); + for (j = 19; j >= 0; j--) { + for (let k = 0; k < keyLengthInBytes; ++k) { + derivedKey[k] = hash[k] ^ j; + } + cipher = new ARCFourCipher(derivedKey); + userPassword = cipher.encryptBlock(userPassword); + } + } else { + cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); + userPassword = cipher.encryptBlock(ownerPassword); + } + return userPassword; + } + #buildObjectKey(num, gen, encryptionKey, isAes = false) { + const n = encryptionKey.length; + const key = new Uint8Array(n + 9); + key.set(encryptionKey); + let i = n; + key[i++] = num & 0xff; + key[i++] = num >> 8 & 0xff; + key[i++] = num >> 16 & 0xff; + key[i++] = gen & 0xff; + key[i++] = gen >> 8 & 0xff; + if (isAes) { + key[i++] = 0x73; + key[i++] = 0x41; + key[i++] = 0x6c; + key[i++] = 0x54; + } + const hash = calculateMD5(key, 0, i); + return hash.subarray(0, Math.min(n + 5, 16)); + } + #buildCipherConstructor(cf, name, num, gen, key) { + if (!(name instanceof Name)) { + throw new FormatError("Invalid crypt filter name."); + } + const self = this; + const cryptFilter = cf.get(name.name); + const cfm = cryptFilter?.get("CFM"); + if (!cfm || cfm.name === "None") { + return function () { + return new NullCipher(); + }; + } + if (cfm.name === "V2") { + return function () { + return new ARCFourCipher(self.#buildObjectKey(num, gen, key, false)); + }; + } + if (cfm.name === "AESV2") { + return function () { + return new AES128Cipher(self.#buildObjectKey(num, gen, key, true)); + }; + } + if (cfm.name === "AESV3") { + return function () { + return new AES256Cipher(key); + }; + } + throw new FormatError("Unknown crypto method"); + } + constructor(dict, fileId, password) { + const filter = dict.get("Filter"); + if (!isName(filter, "Standard")) { + throw new FormatError("unknown encryption method"); + } + this.filterName = filter.name; + this.dict = dict; + const algorithm = dict.get("V"); + if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) { + throw new FormatError("unsupported encryption algorithm"); + } + this.algorithm = algorithm; + let keyLength = dict.get("Length"); + if (!keyLength) { + if (algorithm <= 3) { + keyLength = 40; + } else { + const cfDict = dict.get("CF"); + const streamCryptoName = dict.get("StmF"); + if (cfDict instanceof Dict && streamCryptoName instanceof Name) { + cfDict.suppressEncryption = true; + const handlerDict = cfDict.get(streamCryptoName.name); + keyLength = handlerDict?.get("Length") || 128; + if (keyLength < 40) { + keyLength <<= 3; + } + } + } + } + if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { + throw new FormatError("invalid key length"); + } + const ownerBytes = stringToBytes(dict.get("O")), + userBytes = stringToBytes(dict.get("U")); + const ownerPassword = ownerBytes.subarray(0, 32); + const userPassword = userBytes.subarray(0, 32); + const flags = dict.get("P"); + const revision = dict.get("R"); + const encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get("EncryptMetadata") !== false; + this.encryptMetadata = encryptMetadata; + const fileIdBytes = stringToBytes(fileId); + let passwordBytes; + if (password) { + if (revision === 6) { + try { + password = utf8StringToString(password); + } catch { + warn("CipherTransformFactory: Unable to convert UTF8 encoded password."); + } + } + passwordBytes = stringToBytes(password); + } + let encryptionKey; + if (algorithm !== 5) { + encryptionKey = this.#prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); + } else { + const ownerValidationSalt = ownerBytes.subarray(32, 40); + const ownerKeySalt = ownerBytes.subarray(40, 48); + const uBytes = userBytes.subarray(0, 48); + const userValidationSalt = userBytes.subarray(32, 40); + const userKeySalt = userBytes.subarray(40, 48); + const ownerEncryption = stringToBytes(dict.get("OE")); + const userEncryption = stringToBytes(dict.get("UE")); + const perms = stringToBytes(dict.get("Perms")); + encryptionKey = this.#createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms); + } + if (!encryptionKey) { + if (!password) { + throw new PasswordException("No password given", PasswordResponses.NEED_PASSWORD); + } + const decodedPassword = this.#decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength); + encryptionKey = this.#prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); + } + if (!encryptionKey) { + throw new PasswordException("Incorrect Password", PasswordResponses.INCORRECT_PASSWORD); + } + if (algorithm === 4 && encryptionKey.length < 16) { + this.encryptionKey = new Uint8Array(16); + this.encryptionKey.set(encryptionKey); + } else { + this.encryptionKey = encryptionKey; + } + if (algorithm >= 4) { + const cf = dict.get("CF"); + if (cf instanceof Dict) { + cf.suppressEncryption = true; + } + this.cf = cf; + this.stmf = dict.get("StmF") || Name.get("Identity"); + this.strf = dict.get("StrF") || Name.get("Identity"); + this.eff = dict.get("EFF") || this.stmf; + } + } + createCipherTransform(num, gen) { + if (this.algorithm === 4 || this.algorithm === 5) { + return new CipherTransform(this.#buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey), this.#buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey)); + } + const key = this.#buildObjectKey(num, gen, this.encryptionKey, false); + const cipherConstructor = function () { + return new ARCFourCipher(key); + }; + return new CipherTransform(cipherConstructor, cipherConstructor); + } +} + +;// ./src/core/xref.js + + + + + + +class XRef { + constructor(stream, pdfManager) { + this.stream = stream; + this.pdfManager = pdfManager; + this.entries = []; + this._xrefStms = new Set(); + this._cacheMap = new Map(); + this._pendingRefs = new RefSet(); + this._newPersistentRefNum = null; + this._newTemporaryRefNum = null; + this._persistentRefsCache = null; + } + getNewPersistentRef(obj) { + if (this._newPersistentRefNum === null) { + this._newPersistentRefNum = this.entries.length || 1; + } + const num = this._newPersistentRefNum++; + this._cacheMap.set(num, obj); + return Ref.get(num, 0); + } + getNewTemporaryRef() { + if (this._newTemporaryRefNum === null) { + this._newTemporaryRefNum = this.entries.length || 1; + if (this._newPersistentRefNum) { + this._persistentRefsCache = new Map(); + for (let i = this._newTemporaryRefNum; i < this._newPersistentRefNum; i++) { + this._persistentRefsCache.set(i, this._cacheMap.get(i)); + this._cacheMap.delete(i); + } + } + } + return Ref.get(this._newTemporaryRefNum++, 0); + } + resetNewTemporaryRef() { + this._newTemporaryRefNum = null; + if (this._persistentRefsCache) { + for (const [num, obj] of this._persistentRefsCache) { + this._cacheMap.set(num, obj); + } + } + this._persistentRefsCache = null; + } + setStartXRef(startXRef) { + this.startXRefQueue = [startXRef]; + } + parse(recoveryMode = false) { + let trailerDict; + if (!recoveryMode) { + trailerDict = this.readXRef(); + } else { + warn("Indexing all PDF objects"); + trailerDict = this.indexObjects(); + } + trailerDict.assignXref(this); + this.trailer = trailerDict; + let encrypt; + try { + encrypt = trailerDict.get("Encrypt"); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Encrypt" reference: "${ex}".`); + } + if (encrypt instanceof Dict) { + const ids = trailerDict.get("ID"); + const fileId = ids?.length ? ids[0] : ""; + encrypt.suppressEncryption = true; + this.encrypt = new CipherTransformFactory(encrypt, fileId, this.pdfManager.password); + } + let root; + try { + root = trailerDict.get("Root"); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Root" reference: "${ex}".`); + } + if (root instanceof Dict) { + try { + const pages = root.get("Pages"); + if (pages instanceof Dict) { + this.root = root; + return; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Pages" reference: "${ex}".`); + } + } + if (!recoveryMode) { + throw new XRefParseException(); + } + throw new InvalidPDFException("Invalid Root reference."); + } + processXRefTable(parser) { + if (!("tableState" in this)) { + this.tableState = { + entryNum: 0, + streamPos: parser.lexer.stream.pos, + parserBuf1: parser.buf1, + parserBuf2: parser.buf2 + }; + } + const obj = this.readXRefTable(parser); + if (!isCmd(obj, "trailer")) { + throw new FormatError("Invalid XRef table: could not find trailer dictionary"); + } + let dict = parser.getObj(); + if (!(dict instanceof Dict) && dict.dict) { + dict = dict.dict; + } + if (!(dict instanceof Dict)) { + throw new FormatError("Invalid XRef table: could not parse trailer dictionary"); + } + delete this.tableState; + return dict; + } + readXRefTable(parser) { + const stream = parser.lexer.stream; + const tableState = this.tableState; + stream.pos = tableState.streamPos; + parser.buf1 = tableState.parserBuf1; + parser.buf2 = tableState.parserBuf2; + let obj; + while (true) { + if (!("firstEntryNum" in tableState) || !("entryCount" in tableState)) { + if (isCmd(obj = parser.getObj(), "trailer")) { + break; + } + tableState.firstEntryNum = obj; + tableState.entryCount = parser.getObj(); + } + let first = tableState.firstEntryNum; + const count = tableState.entryCount; + if (!Number.isInteger(first) || !Number.isInteger(count)) { + throw new FormatError("Invalid XRef table: wrong types in subsection header"); + } + for (let i = tableState.entryNum; i < count; i++) { + tableState.streamPos = stream.pos; + tableState.entryNum = i; + tableState.parserBuf1 = parser.buf1; + tableState.parserBuf2 = parser.buf2; + const entry = {}; + entry.offset = parser.getObj(); + entry.gen = parser.getObj(); + const type = parser.getObj(); + if (type instanceof Cmd) { + switch (type.cmd) { + case "f": + entry.free = true; + break; + case "n": + entry.uncompressed = true; + break; + } + } + if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) { + throw new FormatError(`Invalid entry in XRef subsection: ${first}, ${count}`); + } + if (i === 0 && entry.free && first === 1) { + first = 0; + } + if (!this.entries[i + first]) { + this.entries[i + first] = entry; + } + } + tableState.entryNum = 0; + tableState.streamPos = stream.pos; + tableState.parserBuf1 = parser.buf1; + tableState.parserBuf2 = parser.buf2; + delete tableState.firstEntryNum; + delete tableState.entryCount; + } + if (this.entries[0] && !this.entries[0].free) { + throw new FormatError("Invalid XRef table: unexpected first object"); + } + return obj; + } + processXRefStream(stream) { + if (!("streamState" in this)) { + const { + dict, + pos + } = stream; + const byteWidths = dict.get("W"); + const range = dict.get("Index") || [0, dict.get("Size")]; + this.streamState = { + entryRanges: range, + byteWidths, + entryNum: 0, + streamPos: pos + }; + } + this.readXRefStream(stream); + delete this.streamState; + return stream.dict; + } + readXRefStream(stream) { + const streamState = this.streamState; + stream.pos = streamState.streamPos; + const [typeFieldWidth, offsetFieldWidth, generationFieldWidth] = streamState.byteWidths; + const entryRanges = streamState.entryRanges; + while (entryRanges.length > 0) { + const [first, n] = entryRanges; + if (!Number.isInteger(first) || !Number.isInteger(n)) { + throw new FormatError(`Invalid XRef range fields: ${first}, ${n}`); + } + if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) { + throw new FormatError(`Invalid XRef entry fields length: ${first}, ${n}`); + } + for (let i = streamState.entryNum; i < n; ++i) { + streamState.entryNum = i; + streamState.streamPos = stream.pos; + let type = 0, + offset = 0, + generation = 0; + for (let j = 0; j < typeFieldWidth; ++j) { + const typeByte = stream.getByte(); + if (typeByte === -1) { + throw new FormatError("Invalid XRef byteWidths 'type'."); + } + type = type << 8 | typeByte; + } + if (typeFieldWidth === 0) { + type = 1; + } + for (let j = 0; j < offsetFieldWidth; ++j) { + const offsetByte = stream.getByte(); + if (offsetByte === -1) { + throw new FormatError("Invalid XRef byteWidths 'offset'."); + } + offset = offset << 8 | offsetByte; + } + for (let j = 0; j < generationFieldWidth; ++j) { + const generationByte = stream.getByte(); + if (generationByte === -1) { + throw new FormatError("Invalid XRef byteWidths 'generation'."); + } + generation = generation << 8 | generationByte; + } + const entry = {}; + entry.offset = offset; + entry.gen = generation; + switch (type) { + case 0: + entry.free = true; + break; + case 1: + entry.uncompressed = true; + break; + case 2: + break; + default: + throw new FormatError(`Invalid XRef entry type: ${type}`); + } + if (!this.entries[first + i]) { + this.entries[first + i] = entry; + } + } + streamState.entryNum = 0; + streamState.streamPos = stream.pos; + entryRanges.splice(0, 2); + } + } + indexObjects() { + const TAB = 0x9, + LF = 0xa, + CR = 0xd, + SPACE = 0x20; + const PERCENT = 0x25, + LT = 0x3c; + function readToken(data, offset) { + let token = "", + ch = data[offset]; + while (ch !== LF && ch !== CR && ch !== LT) { + if (++offset >= data.length) { + break; + } + token += String.fromCharCode(ch); + ch = data[offset]; + } + return token; + } + function skipUntil(data, offset, what) { + const length = what.length, + dataLength = data.length; + let skipped = 0; + while (offset < dataLength) { + let i = 0; + while (i < length && data[offset + i] === what[i]) { + ++i; + } + if (i >= length) { + break; + } + offset++; + skipped++; + } + return skipped; + } + const gEndobjRegExp = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g; + const gStartxrefRegExp = /\b(startxref|\d+\s+\d+\s+obj)\b/g; + const objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; + const trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); + const startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]); + const xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); + this.entries.length = 0; + this._cacheMap.clear(); + const stream = this.stream; + stream.pos = 0; + const buffer = stream.getBytes(), + bufferStr = bytesToString(buffer), + length = buffer.length; + let position = stream.start; + const trailers = [], + xrefStms = []; + while (position < length) { + let ch = buffer[position]; + if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { + ++position; + continue; + } + if (ch === PERCENT) { + do { + ++position; + if (position >= length) { + break; + } + ch = buffer[position]; + } while (ch !== LF && ch !== CR); + continue; + } + const token = readToken(buffer, position); + let m; + if (token.startsWith("xref") && (token.length === 4 || /\s/.test(token[4]))) { + position += skipUntil(buffer, position, trailerBytes); + trailers.push(position); + position += skipUntil(buffer, position, startxrefBytes); + } else if (m = objRegExp.exec(token)) { + const num = m[1] | 0, + gen = m[2] | 0; + const startPos = position + token.length; + let contentLength, + updateEntries = false; + if (!this.entries[num]) { + updateEntries = true; + } else if (this.entries[num].gen === gen) { + try { + const parser = new Parser({ + lexer: new Lexer(stream.makeSubStream(startPos)) + }); + parser.getObj(); + updateEntries = true; + } catch (ex) { + if (ex instanceof ParserEOFException) { + warn(`indexObjects -- checking object (${token}): "${ex}".`); + } else { + updateEntries = true; + } + } + } + if (updateEntries) { + this.entries[num] = { + offset: position - stream.start, + gen, + uncompressed: true + }; + } + gEndobjRegExp.lastIndex = startPos; + const match = gEndobjRegExp.exec(bufferStr); + if (match) { + const endPos = gEndobjRegExp.lastIndex + 1; + contentLength = endPos - position; + if (match[1] !== "endobj") { + warn(`indexObjects: Found "${match[1]}" inside of another "obj", ` + 'caused by missing "endobj" -- trying to recover.'); + contentLength -= match[1].length + 1; + } + } else { + contentLength = length - position; + } + const content = buffer.subarray(position, position + contentLength); + const xrefTagOffset = skipUntil(content, 0, xrefBytes); + if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) { + xrefStms.push(position - stream.start); + this._xrefStms.add(position - stream.start); + } + position += contentLength; + } else if (token.startsWith("trailer") && (token.length === 7 || /\s/.test(token[7]))) { + trailers.push(position); + const startPos = position + token.length; + let contentLength; + gStartxrefRegExp.lastIndex = startPos; + const match = gStartxrefRegExp.exec(bufferStr); + if (match) { + const endPos = gStartxrefRegExp.lastIndex + 1; + contentLength = endPos - position; + if (match[1] !== "startxref") { + warn(`indexObjects: Found "${match[1]}" after "trailer", ` + 'caused by missing "startxref" -- trying to recover.'); + contentLength -= match[1].length + 1; + } + } else { + contentLength = length - position; + } + position += contentLength; + } else { + position += token.length + 1; + } + } + for (const xrefStm of xrefStms) { + this.startXRefQueue.push(xrefStm); + this.readXRef(true); + } + const trailerDicts = []; + let isEncrypted = false; + for (const trailer of trailers) { + stream.pos = trailer; + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true, + recoveryMode: true + }); + const obj = parser.getObj(); + if (!isCmd(obj, "trailer")) { + continue; + } + const dict = parser.getObj(); + if (!(dict instanceof Dict)) { + continue; + } + trailerDicts.push(dict); + if (dict.has("Encrypt")) { + isEncrypted = true; + } + } + let trailerDict, trailerError; + for (const dict of [...trailerDicts, "genFallback", ...trailerDicts]) { + if (dict === "genFallback") { + if (!trailerError) { + break; + } + this._generationFallback = true; + continue; + } + let validPagesDict = false; + try { + const rootDict = dict.get("Root"); + if (!(rootDict instanceof Dict)) { + continue; + } + const pagesDict = rootDict.get("Pages"); + if (!(pagesDict instanceof Dict)) { + continue; + } + const pagesCount = pagesDict.get("Count"); + if (Number.isInteger(pagesCount)) { + validPagesDict = true; + } + } catch (ex) { + trailerError = ex; + continue; + } + if (validPagesDict && (!isEncrypted || dict.has("Encrypt")) && dict.has("ID")) { + return dict; + } + trailerDict = dict; + } + if (trailerDict) { + return trailerDict; + } + if (this.topDict) { + return this.topDict; + } + if (!trailerDicts.length) { + for (const num in this.entries) { + if (!Object.hasOwn(this.entries, num)) { + continue; + } + const entry = this.entries[num]; + const ref = Ref.get(parseInt(num), entry.gen); + let obj; + try { + obj = this.fetch(ref); + } catch { + continue; + } + if (obj instanceof BaseStream) { + obj = obj.dict; + } + if (obj instanceof Dict && obj.has("Root")) { + return obj; + } + } + } + throw new InvalidPDFException("Invalid PDF structure."); + } + readXRef(recoveryMode = false) { + const stream = this.stream; + const startXRefParsedCache = new Set(); + while (this.startXRefQueue.length) { + try { + const startXRef = this.startXRefQueue[0]; + if (startXRefParsedCache.has(startXRef)) { + warn("readXRef - skipping XRef table since it was already parsed."); + this.startXRefQueue.shift(); + continue; + } + startXRefParsedCache.add(startXRef); + stream.pos = startXRef + stream.start; + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true + }); + let obj = parser.getObj(); + let dict; + if (isCmd(obj, "xref")) { + dict = this.processXRefTable(parser); + if (!this.topDict) { + this.topDict = dict; + } + obj = dict.get("XRefStm"); + if (Number.isInteger(obj) && !this._xrefStms.has(obj)) { + this._xrefStms.add(obj); + this.startXRefQueue.push(obj); + } + } else if (Number.isInteger(obj)) { + if (!Number.isInteger(parser.getObj()) || !isCmd(parser.getObj(), "obj") || !((obj = parser.getObj()) instanceof BaseStream)) { + throw new FormatError("Invalid XRef stream"); + } + dict = this.processXRefStream(obj); + if (!this.topDict) { + this.topDict = dict; + } + if (!dict) { + throw new FormatError("Failed to read XRef stream"); + } + } else { + throw new FormatError("Invalid XRef stream header"); + } + obj = dict.get("Prev"); + if (Number.isInteger(obj)) { + this.startXRefQueue.push(obj); + } else if (obj instanceof Ref) { + this.startXRefQueue.push(obj.num); + } + } catch (e) { + if (e instanceof MissingDataException) { + throw e; + } + info("(while reading XRef): " + e); + } + this.startXRefQueue.shift(); + } + if (this.topDict) { + return this.topDict; + } + if (recoveryMode) { + return undefined; + } + throw new XRefParseException(); + } + getEntry(i) { + const xrefEntry = this.entries[i]; + if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { + return xrefEntry; + } + return null; + } + fetchIfRef(obj, suppressEncryption = false) { + if (obj instanceof Ref) { + return this.fetch(obj, suppressEncryption); + } + return obj; + } + fetch(ref, suppressEncryption = false) { + if (!(ref instanceof Ref)) { + throw new Error("ref object is not a reference"); + } + const num = ref.num; + const cacheEntry = this._cacheMap.get(num); + if (cacheEntry !== undefined) { + if (cacheEntry instanceof Dict && !cacheEntry.objId) { + cacheEntry.objId = ref.toString(); + } + return cacheEntry; + } + let xrefEntry = this.getEntry(num); + if (xrefEntry === null) { + return xrefEntry; + } + if (this._pendingRefs.has(ref)) { + this._pendingRefs.remove(ref); + warn(`Ignoring circular reference: ${ref}.`); + return CIRCULAR_REF; + } + this._pendingRefs.put(ref); + try { + xrefEntry = xrefEntry.uncompressed ? this.fetchUncompressed(ref, xrefEntry, suppressEncryption) : this.fetchCompressed(ref, xrefEntry, suppressEncryption); + this._pendingRefs.remove(ref); + } catch (ex) { + this._pendingRefs.remove(ref); + throw ex; + } + if (xrefEntry instanceof Dict) { + xrefEntry.objId = ref.toString(); + } else if (xrefEntry instanceof BaseStream) { + xrefEntry.dict.objId = ref.toString(); + } + return xrefEntry; + } + fetchUncompressed(ref, xrefEntry, suppressEncryption = false) { + const gen = ref.gen; + let num = ref.num; + if (xrefEntry.gen !== gen) { + const msg = `Inconsistent generation in XRef: ${ref}`; + if (this._generationFallback && xrefEntry.gen < gen) { + warn(msg); + return this.fetchUncompressed(Ref.get(num, xrefEntry.gen), xrefEntry, suppressEncryption); + } + throw new XRefEntryException(msg); + } + const stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start); + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true + }); + const obj1 = parser.getObj(); + const obj2 = parser.getObj(); + const obj3 = parser.getObj(); + if (obj1 !== num || obj2 !== gen || !(obj3 instanceof Cmd)) { + throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); + } + if (obj3.cmd !== "obj") { + if (obj3.cmd.startsWith("obj")) { + num = parseInt(obj3.cmd.substring(3), 10); + if (!Number.isNaN(num)) { + return num; + } + } + throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); + } + xrefEntry = this.encrypt && !suppressEncryption ? parser.getObj(this.encrypt.createCipherTransform(num, gen)) : parser.getObj(); + if (!(xrefEntry instanceof BaseStream)) { + this._cacheMap.set(num, xrefEntry); + } + return xrefEntry; + } + fetchCompressed(ref, xrefEntry, suppressEncryption = false) { + const tableOffset = xrefEntry.offset; + const stream = this.fetch(Ref.get(tableOffset, 0)); + if (!(stream instanceof BaseStream)) { + throw new FormatError("bad ObjStm stream"); + } + const first = stream.dict.get("First"); + const n = stream.dict.get("N"); + if (!Number.isInteger(first) || !Number.isInteger(n)) { + throw new FormatError("invalid first and n parameters for ObjStm stream"); + } + let parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true + }); + const nums = new Array(n); + const offsets = new Array(n); + for (let i = 0; i < n; ++i) { + const num = parser.getObj(); + if (!Number.isInteger(num)) { + throw new FormatError(`invalid object number in the ObjStm stream: ${num}`); + } + const offset = parser.getObj(); + if (!Number.isInteger(offset)) { + throw new FormatError(`invalid object offset in the ObjStm stream: ${offset}`); + } + nums[i] = num; + const entry = this.getEntry(num); + if (entry?.offset === tableOffset && entry.gen !== i) { + entry.gen = i; + } + offsets[i] = offset; + } + const start = (stream.start || 0) + first; + const entries = new Array(n); + for (let i = 0; i < n; ++i) { + const length = i < n - 1 ? offsets[i + 1] - offsets[i] : undefined; + if (length < 0) { + throw new FormatError("Invalid offset in the ObjStm stream."); + } + parser = new Parser({ + lexer: new Lexer(stream.makeSubStream(start + offsets[i], length, stream.dict)), + xref: this, + allowStreams: true + }); + const obj = parser.getObj(); + entries[i] = obj; + if (obj instanceof BaseStream) { + continue; + } + const num = nums[i], + entry = this.entries[num]; + if (entry && entry.offset === tableOffset && entry.gen === i) { + this._cacheMap.set(num, obj); + } + } + xrefEntry = entries[xrefEntry.gen]; + if (xrefEntry === undefined) { + throw new XRefEntryException(`Bad (compressed) XRef entry: ${ref}`); + } + return xrefEntry; + } + async fetchIfRefAsync(obj, suppressEncryption) { + if (obj instanceof Ref) { + return this.fetchAsync(obj, suppressEncryption); + } + return obj; + } + async fetchAsync(ref, suppressEncryption) { + try { + return this.fetch(ref, suppressEncryption); + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + throw ex; + } + await this.pdfManager.requestRange(ex.begin, ex.end); + return this.fetchAsync(ref, suppressEncryption); + } + } + getCatalogObj() { + return this.root; + } +} + +;// ./src/core/document.js + + + + + + + + + + + + + + + + + + + + +const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; +class Page { + #areAnnotationsCached = false; + #resourcesPromise = null; + constructor({ + pdfManager, + xref, + pageIndex, + pageDict, + ref, + globalIdFactory, + fontCache, + builtInCMapCache, + standardFontDataCache, + globalColorSpaceCache, + globalImageCache, + systemFontCache, + nonBlendModesSet, + xfaFactory + }) { + this.pdfManager = pdfManager; + this.pageIndex = pageIndex; + this.pageDict = pageDict; + this.xref = xref; + this.ref = ref; + this.fontCache = fontCache; + this.builtInCMapCache = builtInCMapCache; + this.standardFontDataCache = standardFontDataCache; + this.globalColorSpaceCache = globalColorSpaceCache; + this.globalImageCache = globalImageCache; + this.systemFontCache = systemFontCache; + this.nonBlendModesSet = nonBlendModesSet; + this.evaluatorOptions = pdfManager.evaluatorOptions; + this.xfaFactory = xfaFactory; + const idCounters = { + obj: 0 + }; + this._localIdFactory = class extends globalIdFactory { + static createObjId() { + return `p${pageIndex}_${++idCounters.obj}`; + } + static getPageObjId() { + return `p${ref.toString()}`; + } + }; + } + #createPartialEvaluator(handler) { + return new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalColorSpaceCache: this.globalColorSpaceCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + } + #getInheritableProperty(key, getArray = false) { + const value = getInheritableProperty({ + dict: this.pageDict, + key, + getArray, + stopWhenFound: false + }); + if (!Array.isArray(value)) { + return value; + } + if (value.length === 1 || !(value[0] instanceof Dict)) { + return value[0]; + } + return Dict.merge({ + xref: this.xref, + dictArray: value + }); + } + get content() { + return this.pageDict.getArray("Contents"); + } + get resources() { + const resources = this.#getInheritableProperty("Resources"); + return shadow(this, "resources", resources instanceof Dict ? resources : Dict.empty); + } + getBoundingBox(name) { + if (this.xfaData) { + return this.xfaData.bbox; + } + const box = lookupNormalRect(this.#getInheritableProperty(name, true), null); + if (box) { + if (box[2] - box[0] > 0 && box[3] - box[1] > 0) { + return box; + } + warn(`Empty, or invalid, /${name} entry.`); + } + return null; + } + get mediaBox() { + return shadow(this, "mediaBox", this.getBoundingBox("MediaBox") || LETTER_SIZE_MEDIABOX); + } + get cropBox() { + return shadow(this, "cropBox", this.getBoundingBox("CropBox") || this.mediaBox); + } + get userUnit() { + const obj = this.pageDict.get("UserUnit"); + return shadow(this, "userUnit", typeof obj === "number" && obj > 0 ? obj : 1.0); + } + get view() { + const { + cropBox, + mediaBox + } = this; + if (cropBox !== mediaBox && !isArrayEqual(cropBox, mediaBox)) { + const box = Util.intersect(cropBox, mediaBox); + if (box && box[2] - box[0] > 0 && box[3] - box[1] > 0) { + return shadow(this, "view", box); + } + warn("Empty /CropBox and /MediaBox intersection."); + } + return shadow(this, "view", mediaBox); + } + get rotate() { + let rotate = this.#getInheritableProperty("Rotate") || 0; + if (rotate % 90 !== 0) { + rotate = 0; + } else if (rotate >= 360) { + rotate %= 360; + } else if (rotate < 0) { + rotate = (rotate % 360 + 360) % 360; + } + return shadow(this, "rotate", rotate); + } + #onSubStreamError(reason, objId) { + if (this.evaluatorOptions.ignoreErrors) { + warn(`getContentStream - ignoring sub-stream (${objId}): "${reason}".`); + return; + } + throw reason; + } + async getContentStream() { + const content = await this.pdfManager.ensure(this, "content"); + if (content instanceof BaseStream) { + return content; + } + if (Array.isArray(content)) { + return new StreamsSequenceStream(content, this.#onSubStreamError.bind(this)); + } + return new NullStream(); + } + get xfaData() { + return shadow(this, "xfaData", this.xfaFactory ? { + bbox: this.xfaFactory.getBoundingBox(this.pageIndex) + } : null); + } + async #replaceIdByRef(annotations, deletedAnnotations, existingAnnotations) { + const promises = []; + for (const annotation of annotations) { + if (annotation.id) { + const ref = Ref.fromString(annotation.id); + if (!ref) { + warn(`A non-linked annotation cannot be modified: ${annotation.id}`); + continue; + } + if (annotation.deleted) { + deletedAnnotations.put(ref, ref); + if (annotation.popupRef) { + const popupRef = Ref.fromString(annotation.popupRef); + if (popupRef) { + deletedAnnotations.put(popupRef, popupRef); + } + } + continue; + } + if (annotation.popup?.deleted) { + const popupRef = Ref.fromString(annotation.popupRef); + if (popupRef) { + deletedAnnotations.put(popupRef, popupRef); + } + } + existingAnnotations?.put(ref); + annotation.ref = ref; + promises.push(this.xref.fetchAsync(ref).then(obj => { + if (obj instanceof Dict) { + annotation.oldAnnotation = obj.clone(); + } + }, () => { + warn(`Cannot fetch \`oldAnnotation\` for: ${ref}.`); + })); + delete annotation.id; + } + } + await Promise.all(promises); + } + async saveNewAnnotations(handler, task, annotations, imagePromises, changes) { + if (this.xfaFactory) { + throw new Error("XFA: Cannot save new annotations."); + } + const partialEvaluator = this.#createPartialEvaluator(handler); + const deletedAnnotations = new RefSetCache(); + const existingAnnotations = new RefSet(); + await this.#replaceIdByRef(annotations, deletedAnnotations, existingAnnotations); + const pageDict = this.pageDict; + const annotationsArray = this.annotations.filter(a => !(a instanceof Ref && deletedAnnotations.has(a))); + const newData = await AnnotationFactory.saveNewAnnotations(partialEvaluator, task, annotations, imagePromises, changes); + for (const { + ref + } of newData.annotations) { + if (ref instanceof Ref && !existingAnnotations.has(ref)) { + annotationsArray.push(ref); + } + } + const dict = pageDict.clone(); + dict.set("Annots", annotationsArray); + changes.put(this.ref, { + data: dict + }); + for (const deletedRef of deletedAnnotations) { + changes.put(deletedRef, { + data: null + }); + } + } + async save(handler, task, annotationStorage, changes) { + const partialEvaluator = this.#createPartialEvaluator(handler); + const annotations = await this._parsedAnnotations; + const promises = []; + for (const annotation of annotations) { + promises.push(annotation.save(partialEvaluator, task, annotationStorage, changes).catch(function (reason) { + warn("save - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); + return null; + })); + } + return Promise.all(promises); + } + async loadResources(keys) { + await (this.#resourcesPromise ??= this.pdfManager.ensure(this, "resources")); + await ObjectLoader.load(this.resources, keys, this.xref); + } + async #getMergedResources(streamDict, keys) { + const localResources = streamDict?.get("Resources"); + if (!(localResources instanceof Dict && localResources.size)) { + return this.resources; + } + await ObjectLoader.load(localResources, keys, this.xref); + return Dict.merge({ + xref: this.xref, + dictArray: [localResources, this.resources], + mergeSubDicts: true + }); + } + async getOperatorList({ + handler, + sink, + task, + intent, + cacheKey, + annotationStorage = null, + modifiedIds = null + }) { + const contentStreamPromise = this.getContentStream(); + const resourcesPromise = this.loadResources(RESOURCES_KEYS_OPERATOR_LIST); + const partialEvaluator = this.#createPartialEvaluator(handler); + const newAnnotsByPage = !this.xfaFactory ? getNewAnnotationsMap(annotationStorage) : null; + const newAnnots = newAnnotsByPage?.get(this.pageIndex); + let newAnnotationsPromise = Promise.resolve(null); + let deletedAnnotations = null; + if (newAnnots) { + const annotationGlobalsPromise = this.pdfManager.ensureDoc("annotationGlobals"); + let imagePromises; + const missingBitmaps = new Set(); + for (const { + bitmapId, + bitmap + } of newAnnots) { + if (bitmapId && !bitmap && !missingBitmaps.has(bitmapId)) { + missingBitmaps.add(bitmapId); + } + } + const { + isOffscreenCanvasSupported + } = this.evaluatorOptions; + if (missingBitmaps.size > 0) { + const annotationWithBitmaps = newAnnots.slice(); + for (const [key, annotation] of annotationStorage) { + if (!key.startsWith(AnnotationEditorPrefix)) { + continue; + } + if (annotation.bitmap && missingBitmaps.has(annotation.bitmapId)) { + annotationWithBitmaps.push(annotation); + } + } + imagePromises = AnnotationFactory.generateImages(annotationWithBitmaps, this.xref, isOffscreenCanvasSupported); + } else { + imagePromises = AnnotationFactory.generateImages(newAnnots, this.xref, isOffscreenCanvasSupported); + } + deletedAnnotations = new RefSet(); + newAnnotationsPromise = Promise.all([annotationGlobalsPromise, this.#replaceIdByRef(newAnnots, deletedAnnotations, null)]).then(([annotationGlobals]) => { + if (!annotationGlobals) { + return null; + } + return AnnotationFactory.printNewAnnotations(annotationGlobals, partialEvaluator, task, newAnnots, imagePromises); + }); + } + const pageListPromise = Promise.all([contentStreamPromise, resourcesPromise]).then(async ([contentStream]) => { + const resources = await this.#getMergedResources(contentStream.dict, RESOURCES_KEYS_OPERATOR_LIST); + const opList = new OperatorList(intent, sink); + handler.send("StartRenderPage", { + transparency: partialEvaluator.hasBlendModes(resources, this.nonBlendModesSet), + pageIndex: this.pageIndex, + cacheKey + }); + await partialEvaluator.getOperatorList({ + stream: contentStream, + task, + resources, + operatorList: opList + }); + return opList; + }); + let [pageOpList, annotations, newAnnotations] = await Promise.all([pageListPromise, this._parsedAnnotations, newAnnotationsPromise]); + if (newAnnotations) { + annotations = annotations.filter(a => !(a.ref && deletedAnnotations.has(a.ref))); + for (let i = 0, ii = newAnnotations.length; i < ii; i++) { + const newAnnotation = newAnnotations[i]; + if (newAnnotation.refToReplace) { + const j = annotations.findIndex(a => a.ref && isRefsEqual(a.ref, newAnnotation.refToReplace)); + if (j >= 0) { + annotations.splice(j, 1, newAnnotation); + newAnnotations.splice(i--, 1); + ii--; + } + } + } + annotations = annotations.concat(newAnnotations); + } + if (annotations.length === 0 || intent & RenderingIntentFlag.ANNOTATIONS_DISABLE) { + pageOpList.flush(true); + return { + length: pageOpList.totalLength + }; + } + const renderForms = !!(intent & RenderingIntentFlag.ANNOTATIONS_FORMS), + isEditing = !!(intent & RenderingIntentFlag.IS_EDITING), + intentAny = !!(intent & RenderingIntentFlag.ANY), + intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), + intentPrint = !!(intent & RenderingIntentFlag.PRINT); + const opListPromises = []; + for (const annotation of annotations) { + if (intentAny || intentDisplay && annotation.mustBeViewed(annotationStorage, renderForms) && annotation.mustBeViewedWhenEditing(isEditing, modifiedIds) || intentPrint && annotation.mustBePrinted(annotationStorage)) { + opListPromises.push(annotation.getOperatorList(partialEvaluator, task, intent, annotationStorage).catch(function (reason) { + warn("getOperatorList - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); + return { + opList: null, + separateForm: false, + separateCanvas: false + }; + })); + } + } + const opLists = await Promise.all(opListPromises); + let form = false, + canvas = false; + for (const { + opList, + separateForm, + separateCanvas + } of opLists) { + pageOpList.addOpList(opList); + form ||= separateForm; + canvas ||= separateCanvas; + } + pageOpList.flush(true, { + form, + canvas + }); + return { + length: pageOpList.totalLength + }; + } + async extractTextContent({ + handler, + task, + includeMarkedContent, + disableNormalization, + sink, + intersector = null + }) { + const contentStreamPromise = this.getContentStream(); + const resourcesPromise = this.loadResources(RESOURCES_KEYS_TEXT_CONTENT); + const langPromise = this.pdfManager.ensureCatalog("lang"); + const [contentStream,, lang] = await Promise.all([contentStreamPromise, resourcesPromise, langPromise]); + const resources = await this.#getMergedResources(contentStream.dict, RESOURCES_KEYS_TEXT_CONTENT); + const partialEvaluator = this.#createPartialEvaluator(handler); + return partialEvaluator.getTextContent({ + stream: contentStream, + task, + resources, + includeMarkedContent, + disableNormalization, + sink, + viewBox: this.view, + lang, + intersector + }); + } + async getStructTree() { + const structTreeRoot = await this.pdfManager.ensureCatalog("structTreeRoot"); + if (!structTreeRoot) { + return null; + } + await this._parsedAnnotations; + try { + const structTree = await this.pdfManager.ensure(this, "_parseStructTree", [structTreeRoot]); + const data = await this.pdfManager.ensure(structTree, "serializable"); + return data; + } catch (ex) { + warn(`getStructTree: "${ex}".`); + return null; + } + } + _parseStructTree(structTreeRoot) { + const tree = new StructTreePage(structTreeRoot, this.pageDict); + tree.parse(this.ref); + return tree; + } + async getAnnotationsData(handler, task, intent) { + const annotations = await this._parsedAnnotations; + if (annotations.length === 0) { + return annotations; + } + const annotationsData = [], + textContentPromises = []; + let partialEvaluator; + const intentAny = !!(intent & RenderingIntentFlag.ANY), + intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), + intentPrint = !!(intent & RenderingIntentFlag.PRINT); + const highlightedAnnotations = []; + for (const annotation of annotations) { + const isVisible = intentAny || intentDisplay && annotation.viewable; + if (isVisible || intentPrint && annotation.printable) { + annotationsData.push(annotation.data); + } + if (annotation.hasTextContent && isVisible) { + partialEvaluator ??= this.#createPartialEvaluator(handler); + textContentPromises.push(annotation.extractTextContent(partialEvaluator, task, [-Infinity, -Infinity, Infinity, Infinity]).catch(function (reason) { + warn(`getAnnotationsData - ignoring textContent during "${task.name}" task: "${reason}".`); + })); + } else if (annotation.overlaysTextContent && isVisible) { + highlightedAnnotations.push(annotation); + } + } + if (highlightedAnnotations.length > 0) { + const intersector = new Intersector(highlightedAnnotations); + textContentPromises.push(this.extractTextContent({ + handler, + task, + includeMarkedContent: false, + disableNormalization: false, + sink: null, + viewBox: this.view, + lang: null, + intersector + }).then(() => { + intersector.setText(); + })); + } + await Promise.all(textContentPromises); + return annotationsData; + } + get annotations() { + const annots = this.#getInheritableProperty("Annots"); + return shadow(this, "annotations", Array.isArray(annots) ? annots : []); + } + get _parsedAnnotations() { + const promise = this.pdfManager.ensure(this, "annotations").then(async annots => { + if (annots.length === 0) { + return annots; + } + const [annotationGlobals, fieldObjects] = await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureDoc("fieldObjects")]); + if (!annotationGlobals) { + return []; + } + const orphanFields = fieldObjects?.orphanFields; + const annotationPromises = []; + for (const annotationRef of annots) { + annotationPromises.push(AnnotationFactory.create(this.xref, annotationRef, annotationGlobals, this._localIdFactory, false, orphanFields, null, this.ref).catch(function (reason) { + warn(`_parsedAnnotations: "${reason}".`); + return null; + })); + } + const sortedAnnotations = []; + let popupAnnotations, widgetAnnotations; + for (const annotation of await Promise.all(annotationPromises)) { + if (!annotation) { + continue; + } + if (annotation instanceof WidgetAnnotation) { + (widgetAnnotations ||= []).push(annotation); + continue; + } + if (annotation instanceof PopupAnnotation) { + (popupAnnotations ||= []).push(annotation); + continue; + } + sortedAnnotations.push(annotation); + } + if (widgetAnnotations) { + sortedAnnotations.push(...widgetAnnotations); + } + if (popupAnnotations) { + sortedAnnotations.push(...popupAnnotations); + } + return sortedAnnotations; + }); + this.#areAnnotationsCached = true; + return shadow(this, "_parsedAnnotations", promise); + } + get jsActions() { + const actions = collectActions(this.xref, this.pageDict, PageActionEventType); + return shadow(this, "jsActions", actions); + } + async collectAnnotationsByType(handler, task, types, promises, annotationGlobals) { + const { + pageIndex + } = this; + if (this.#areAnnotationsCached) { + const cachedAnnotations = await this._parsedAnnotations; + for (const { + data + } of cachedAnnotations) { + if (!types || types.has(data.annotationType)) { + data.pageIndex = pageIndex; + promises.push(Promise.resolve(data)); + } + } + return; + } + const annots = await this.pdfManager.ensure(this, "annotations"); + for (const annotationRef of annots) { + promises.push(AnnotationFactory.create(this.xref, annotationRef, annotationGlobals, this._localIdFactory, false, null, types, this.ref).then(async annotation => { + if (!annotation) { + return null; + } + annotation.data.pageIndex = pageIndex; + if (annotation.hasTextContent && annotation.viewable) { + const partialEvaluator = this.#createPartialEvaluator(handler); + await annotation.extractTextContent(partialEvaluator, task, [-Infinity, -Infinity, Infinity, Infinity]); + } + return annotation.data; + }).catch(function (reason) { + warn(`collectAnnotationsByType: "${reason}".`); + return null; + })); + } + } +} +const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]); +const STARTXREF_SIGNATURE = new Uint8Array([0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66]); +const ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x6f, 0x62, 0x6a]); +function find(stream, signature, limit = 1024, backwards = false) { + const signatureLength = signature.length; + const scanBytes = stream.peekBytes(limit); + const scanLength = scanBytes.length - signatureLength; + if (scanLength <= 0) { + return false; + } + if (backwards) { + const signatureEnd = signatureLength - 1; + let pos = scanBytes.length - 1; + while (pos >= signatureEnd) { + let j = 0; + while (j < signatureLength && scanBytes[pos - j] === signature[signatureEnd - j]) { + j++; + } + if (j >= signatureLength) { + stream.pos += pos - signatureEnd; + return true; + } + pos--; + } + } else { + let pos = 0; + while (pos <= scanLength) { + let j = 0; + while (j < signatureLength && scanBytes[pos + j] === signature[j]) { + j++; + } + if (j >= signatureLength) { + stream.pos += pos; + return true; + } + pos++; + } + } + return false; +} +class PDFDocument { + #pagePromises = new Map(); + #version = null; + constructor(pdfManager, stream) { + if (stream.length <= 0) { + throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes."); + } + this.pdfManager = pdfManager; + this.stream = stream; + this.xref = new XRef(stream, pdfManager); + const idCounters = { + font: 0 + }; + this._globalIdFactory = class { + static getDocId() { + return `g_${pdfManager.docId}`; + } + static createFontId() { + return `f${++idCounters.font}`; + } + static createObjId() { + unreachable("Abstract method `createObjId` called."); + } + static getPageObjId() { + unreachable("Abstract method `getPageObjId` called."); + } + }; + } + parse(recoveryMode) { + this.xref.parse(recoveryMode); + this.catalog = new Catalog(this.pdfManager, this.xref); + } + get linearization() { + let linearization = null; + try { + linearization = Linearization.create(this.stream); + } catch (err) { + if (err instanceof MissingDataException) { + throw err; + } + info(err); + } + return shadow(this, "linearization", linearization); + } + get startXRef() { + const stream = this.stream; + let startXRef = 0; + if (this.linearization) { + stream.reset(); + if (find(stream, ENDOBJ_SIGNATURE)) { + stream.skip(6); + let ch = stream.peekByte(); + while (isWhiteSpace(ch)) { + stream.pos++; + ch = stream.peekByte(); + } + startXRef = stream.pos - stream.start; + } + } else { + const step = 1024; + const startXRefLength = STARTXREF_SIGNATURE.length; + let found = false, + pos = stream.end; + while (!found && pos > 0) { + pos -= step - startXRefLength; + if (pos < 0) { + pos = 0; + } + stream.pos = pos; + found = find(stream, STARTXREF_SIGNATURE, step, true); + } + if (found) { + stream.skip(9); + let ch; + do { + ch = stream.getByte(); + } while (isWhiteSpace(ch)); + let str = ""; + while (ch >= 0x20 && ch <= 0x39) { + str += String.fromCharCode(ch); + ch = stream.getByte(); + } + startXRef = parseInt(str, 10); + if (isNaN(startXRef)) { + startXRef = 0; + } + } + } + return shadow(this, "startXRef", startXRef); + } + checkHeader() { + const stream = this.stream; + stream.reset(); + if (!find(stream, PDF_HEADER_SIGNATURE)) { + return; + } + stream.moveStart(); + stream.skip(PDF_HEADER_SIGNATURE.length); + let version = "", + ch; + while ((ch = stream.getByte()) > 0x20 && version.length < 7) { + version += String.fromCharCode(ch); + } + if (PDF_VERSION_REGEXP.test(version)) { + this.#version = version; + } else { + warn(`Invalid PDF header version: ${version}`); + } + } + parseStartXRef() { + this.xref.setStartXRef(this.startXRef); + } + get numPages() { + let num = 0; + if (this.catalog.hasActualNumPages) { + num = this.catalog.numPages; + } else if (this.xfaFactory) { + num = this.xfaFactory.getNumPages(); + } else if (this.linearization) { + num = this.linearization.numPages; + } else { + num = this.catalog.numPages; + } + return shadow(this, "numPages", num); + } + #hasOnlyDocumentSignatures(fields, recursionDepth = 0) { + const RECURSION_LIMIT = 10; + if (!Array.isArray(fields)) { + return false; + } + return fields.every(field => { + field = this.xref.fetchIfRef(field); + if (!(field instanceof Dict)) { + return false; + } + if (field.has("Kids")) { + if (++recursionDepth > RECURSION_LIMIT) { + warn("#hasOnlyDocumentSignatures: maximum recursion depth reached"); + return false; + } + return this.#hasOnlyDocumentSignatures(field.get("Kids"), recursionDepth); + } + const isSignature = isName(field.get("FT"), "Sig"); + const rectangle = field.get("Rect"); + const isInvisible = Array.isArray(rectangle) && rectangle.every(value => value === 0); + return isSignature && isInvisible; + }); + } + get _xfaStreams() { + const { + acroForm + } = this.catalog; + if (!acroForm) { + return null; + } + const xfa = acroForm.get("XFA"); + const entries = new Map(["xdp:xdp", "template", "datasets", "config", "connectionSet", "localeSet", "stylesheet", "/xdp:xdp"].map(e => [e, null])); + if (xfa instanceof BaseStream && !xfa.isEmpty) { + entries.set("xdp:xdp", xfa); + return entries; + } + if (!Array.isArray(xfa) || xfa.length === 0) { + return null; + } + for (let i = 0, ii = xfa.length; i < ii; i += 2) { + let name; + if (i === 0) { + name = "xdp:xdp"; + } else if (i === ii - 2) { + name = "/xdp:xdp"; + } else { + name = xfa[i]; + } + if (!entries.has(name)) { + continue; + } + const data = this.xref.fetchIfRef(xfa[i + 1]); + if (!(data instanceof BaseStream) || data.isEmpty) { + continue; + } + entries.set(name, data); + } + return entries; + } + get xfaDatasets() { + const streams = this._xfaStreams; + if (!streams) { + return shadow(this, "xfaDatasets", null); + } + for (const key of ["datasets", "xdp:xdp"]) { + const stream = streams.get(key); + if (!stream) { + continue; + } + try { + const str = stringToUTF8String(stream.getString()); + const data = { + [key]: str + }; + return shadow(this, "xfaDatasets", new DatasetReader(data)); + } catch { + warn("XFA - Invalid utf-8 string."); + break; + } + } + return shadow(this, "xfaDatasets", null); + } + get xfaData() { + const streams = this._xfaStreams; + if (!streams) { + return null; + } + const data = Object.create(null); + for (const [key, stream] of streams) { + if (!stream) { + continue; + } + try { + data[key] = stringToUTF8String(stream.getString()); + } catch { + warn("XFA - Invalid utf-8 string."); + return null; + } + } + return data; + } + get xfaFactory() { + let data; + if (this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm) { + data = this.xfaData; + } + return shadow(this, "xfaFactory", data ? new XFAFactory(data) : null); + } + get isPureXfa() { + return this.xfaFactory ? this.xfaFactory.isValid() : false; + } + get htmlForXfa() { + return this.xfaFactory ? this.xfaFactory.getPages() : null; + } + async #loadXfaImages() { + const xfaImages = await this.pdfManager.ensureCatalog("xfaImages"); + if (!xfaImages) { + return; + } + this.xfaFactory.setImages(xfaImages); + } + async #loadXfaFonts(handler, task) { + const acroForm = await this.pdfManager.ensureCatalog("acroForm"); + if (!acroForm) { + return; + } + const resources = await acroForm.getAsync("DR"); + if (!(resources instanceof Dict)) { + return; + } + await ObjectLoader.load(resources, ["Font"], this.xref); + const fontRes = resources.get("Font"); + if (!(fontRes instanceof Dict)) { + return; + } + const options = Object.assign(Object.create(null), this.pdfManager.evaluatorOptions, { + useSystemFonts: false + }); + const { + builtInCMapCache, + fontCache, + standardFontDataCache + } = this.catalog; + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: -1, + idFactory: this._globalIdFactory, + fontCache, + builtInCMapCache, + standardFontDataCache, + options + }); + const operatorList = new OperatorList(); + const pdfFonts = []; + const initialState = { + get font() { + return pdfFonts.at(-1); + }, + set font(font) { + pdfFonts.push(font); + }, + clone() { + return this; + } + }; + const parseFont = (fontName, fallbackFontDict, cssFontInfo) => partialEvaluator.handleSetFont(resources, [Name.get(fontName), 1], null, operatorList, task, initialState, fallbackFontDict, cssFontInfo).catch(reason => { + warn(`loadXfaFonts: "${reason}".`); + return null; + }); + const promises = []; + for (const [fontName, font] of fontRes) { + const descriptor = font.get("FontDescriptor"); + if (!(descriptor instanceof Dict)) { + continue; + } + let fontFamily = descriptor.get("FontFamily"); + fontFamily = fontFamily.replaceAll(/[ ]+(\d)/g, "$1"); + const fontWeight = descriptor.get("FontWeight"); + const italicAngle = -descriptor.get("ItalicAngle"); + const cssFontInfo = { + fontFamily, + fontWeight, + italicAngle + }; + if (!validateCSSFont(cssFontInfo)) { + continue; + } + promises.push(parseFont(fontName, null, cssFontInfo)); + } + await Promise.all(promises); + const missingFonts = this.xfaFactory.setFonts(pdfFonts); + if (!missingFonts) { + return; + } + options.ignoreErrors = true; + promises.length = 0; + pdfFonts.length = 0; + const reallyMissingFonts = new Set(); + for (const missing of missingFonts) { + if (!getXfaFontName(`${missing}-Regular`)) { + reallyMissingFonts.add(missing); + } + } + if (reallyMissingFonts.size) { + missingFonts.push("PdfJS-Fallback"); + } + for (const missing of missingFonts) { + if (reallyMissingFonts.has(missing)) { + continue; + } + for (const fontInfo of [{ + name: "Regular", + fontWeight: 400, + italicAngle: 0 + }, { + name: "Bold", + fontWeight: 700, + italicAngle: 0 + }, { + name: "Italic", + fontWeight: 400, + italicAngle: 12 + }, { + name: "BoldItalic", + fontWeight: 700, + italicAngle: 12 + }]) { + const name = `${missing}-${fontInfo.name}`; + promises.push(parseFont(name, getXfaFontDict(name), { + fontFamily: missing, + fontWeight: fontInfo.fontWeight, + italicAngle: fontInfo.italicAngle + })); + } + } + await Promise.all(promises); + this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts); + } + loadXfaResources(handler, task) { + return Promise.all([this.#loadXfaFonts(handler, task).catch(() => {}), this.#loadXfaImages()]); + } + serializeXfaData(annotationStorage) { + return this.xfaFactory ? this.xfaFactory.serializeData(annotationStorage) : null; + } + get version() { + return this.catalog.version || this.#version; + } + get formInfo() { + const formInfo = { + hasFields: false, + hasAcroForm: false, + hasXfa: false, + hasSignatures: false + }; + const { + acroForm + } = this.catalog; + if (!acroForm) { + return shadow(this, "formInfo", formInfo); + } + try { + const fields = acroForm.get("Fields"); + const hasFields = Array.isArray(fields) && fields.length > 0; + formInfo.hasFields = hasFields; + const xfa = acroForm.get("XFA"); + formInfo.hasXfa = Array.isArray(xfa) && xfa.length > 0 || xfa instanceof BaseStream && !xfa.isEmpty; + const sigFlags = acroForm.get("SigFlags"); + const hasSignatures = !!(sigFlags & 0x1); + const hasOnlyDocumentSignatures = hasSignatures && this.#hasOnlyDocumentSignatures(fields); + formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures; + formInfo.hasSignatures = hasSignatures; + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Cannot fetch form information: "${ex}".`); + } + return shadow(this, "formInfo", formInfo); + } + get documentInfo() { + const { + catalog, + formInfo, + xref + } = this; + const docInfo = { + PDFFormatVersion: this.version, + Language: catalog.lang, + EncryptFilterName: xref.encrypt?.filterName ?? null, + IsLinearized: !!this.linearization, + IsAcroFormPresent: formInfo.hasAcroForm, + IsXFAPresent: formInfo.hasXfa, + IsCollectionPresent: !!catalog.collection, + IsSignaturesPresent: formInfo.hasSignatures + }; + let infoDict; + try { + infoDict = xref.trailer.get("Info"); + } catch (err) { + if (err instanceof MissingDataException) { + throw err; + } + info("The document information dictionary is invalid."); + } + if (!(infoDict instanceof Dict)) { + return shadow(this, "documentInfo", docInfo); + } + for (const [key, value] of infoDict) { + switch (key) { + case "Title": + case "Author": + case "Subject": + case "Keywords": + case "Creator": + case "Producer": + case "CreationDate": + case "ModDate": + if (typeof value === "string") { + docInfo[key] = stringToPDFString(value); + continue; + } + break; + case "Trapped": + if (value instanceof Name) { + docInfo[key] = value; + continue; + } + break; + default: + let customValue; + switch (typeof value) { + case "string": + customValue = stringToPDFString(value); + break; + case "number": + case "boolean": + customValue = value; + break; + default: + if (value instanceof Name) { + customValue = value; + } + break; + } + if (customValue === undefined) { + warn(`Bad value, for custom key "${key}", in Info: ${value}.`); + continue; + } + docInfo.Custom ??= Object.create(null); + docInfo.Custom[key] = customValue; + continue; + } + warn(`Bad value, for key "${key}", in Info: ${value}.`); + } + return shadow(this, "documentInfo", docInfo); + } + get fingerprints() { + const FINGERPRINT_FIRST_BYTES = 1024; + const EMPTY_FINGERPRINT = "\x00".repeat(16); + function validate(data) { + return typeof data === "string" && data.length === 16 && data !== EMPTY_FINGERPRINT; + } + const id = this.xref.trailer.get("ID"); + let hashOriginal, hashModified; + if (Array.isArray(id) && validate(id[0])) { + hashOriginal = stringToBytes(id[0]); + if (id[1] !== id[0] && validate(id[1])) { + hashModified = stringToBytes(id[1]); + } + } else { + hashOriginal = calculateMD5(this.stream.getByteRange(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); + } + return shadow(this, "fingerprints", [toHexUtil(hashOriginal), hashModified ? toHexUtil(hashModified) : null]); + } + async #getLinearizationPage(pageIndex) { + const { + catalog, + linearization, + xref + } = this; + const ref = Ref.get(linearization.objectNumberFirst, 0); + try { + const obj = await xref.fetchAsync(ref); + if (obj instanceof Dict) { + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !obj.has("Type") && !obj.has("Kids") && obj.has("Contents")) { + if (!catalog.pageKidsCountCache.has(ref)) { + catalog.pageKidsCountCache.put(ref, 1); + } + if (!catalog.pageIndexCache.has(ref)) { + catalog.pageIndexCache.put(ref, 0); + } + return [obj, ref]; + } + } + throw new FormatError("The Linearization dictionary doesn't point to a valid Page dictionary."); + } catch (reason) { + warn(`_getLinearizationPage: "${reason.message}".`); + return catalog.getPageDict(pageIndex); + } + } + getPage(pageIndex) { + const cachedPromise = this.#pagePromises.get(pageIndex); + if (cachedPromise) { + return cachedPromise; + } + const { + catalog, + linearization, + xfaFactory + } = this; + let promise; + if (xfaFactory) { + promise = Promise.resolve([Dict.empty, null]); + } else if (linearization?.pageFirst === pageIndex) { + promise = this.#getLinearizationPage(pageIndex); + } else { + promise = catalog.getPageDict(pageIndex); + } + promise = promise.then(([pageDict, ref]) => new Page({ + pdfManager: this.pdfManager, + xref: this.xref, + pageIndex, + pageDict, + ref, + globalIdFactory: this._globalIdFactory, + fontCache: catalog.fontCache, + builtInCMapCache: catalog.builtInCMapCache, + standardFontDataCache: catalog.standardFontDataCache, + globalColorSpaceCache: catalog.globalColorSpaceCache, + globalImageCache: catalog.globalImageCache, + systemFontCache: catalog.systemFontCache, + nonBlendModesSet: catalog.nonBlendModesSet, + xfaFactory + })); + this.#pagePromises.set(pageIndex, promise); + return promise; + } + async checkFirstPage(recoveryMode = false) { + if (recoveryMode) { + return; + } + try { + await this.getPage(0); + } catch (reason) { + if (reason instanceof XRefEntryException) { + this.#pagePromises.delete(0); + await this.cleanup(); + throw new XRefParseException(); + } + } + } + async checkLastPage(recoveryMode = false) { + const { + catalog, + pdfManager + } = this; + catalog.setActualNumPages(); + let numPages; + try { + await Promise.all([pdfManager.ensureDoc("xfaFactory"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("numPages")]); + if (this.xfaFactory) { + return; + } else if (this.linearization) { + numPages = this.linearization.numPages; + } else { + numPages = catalog.numPages; + } + if (!Number.isInteger(numPages)) { + throw new FormatError("Page count is not an integer."); + } else if (numPages <= 1) { + return; + } + await this.getPage(numPages - 1); + } catch (reason) { + this.#pagePromises.delete(numPages - 1); + await this.cleanup(); + if (reason instanceof XRefEntryException && !recoveryMode) { + throw new XRefParseException(); + } + warn(`checkLastPage - invalid /Pages tree /Count: ${numPages}.`); + let pagesTree; + try { + pagesTree = await catalog.getAllPageDicts(recoveryMode); + } catch (reasonAll) { + if (reasonAll instanceof XRefEntryException && !recoveryMode) { + throw new XRefParseException(); + } + catalog.setActualNumPages(1); + return; + } + for (const [pageIndex, [pageDict, ref]] of pagesTree) { + let promise; + if (pageDict instanceof Error) { + promise = Promise.reject(pageDict); + promise.catch(() => {}); + } else { + promise = Promise.resolve(new Page({ + pdfManager, + xref: this.xref, + pageIndex, + pageDict, + ref, + globalIdFactory: this._globalIdFactory, + fontCache: catalog.fontCache, + builtInCMapCache: catalog.builtInCMapCache, + standardFontDataCache: catalog.standardFontDataCache, + globalColorSpaceCache: this.globalColorSpaceCache, + globalImageCache: catalog.globalImageCache, + systemFontCache: catalog.systemFontCache, + nonBlendModesSet: catalog.nonBlendModesSet, + xfaFactory: null + })); + } + this.#pagePromises.set(pageIndex, promise); + } + catalog.setActualNumPages(pagesTree.size); + } + } + async fontFallback(id, handler) { + const { + catalog, + pdfManager + } = this; + for (const translatedFont of await Promise.all(catalog.fontCache)) { + if (translatedFont.loadedName === id) { + translatedFont.fallback(handler, pdfManager.evaluatorOptions); + return; + } + } + } + async cleanup(manuallyTriggered = false) { + return this.catalog ? this.catalog.cleanup(manuallyTriggered) : clearGlobalCaches(); + } + async #collectFieldObjects(name, parentRef, fieldRef, promises, annotationGlobals, visitedRefs, orphanFields) { + const { + xref + } = this; + if (!(fieldRef instanceof Ref) || visitedRefs.has(fieldRef)) { + return; + } + visitedRefs.put(fieldRef); + const field = await xref.fetchAsync(fieldRef); + if (!(field instanceof Dict)) { + return; + } + let subtype = await field.getAsync("Subtype"); + subtype = subtype instanceof Name ? subtype.name : null; + switch (subtype) { + case "Link": + return; + } + if (field.has("T")) { + const partName = stringToPDFString(await field.getAsync("T")); + name = name === "" ? partName : `${name}.${partName}`; + } else { + let obj = field; + while (true) { + obj = obj.getRaw("Parent") || parentRef; + if (obj instanceof Ref) { + if (visitedRefs.has(obj)) { + break; + } + obj = await xref.fetchAsync(obj); + } + if (!(obj instanceof Dict)) { + break; + } + if (obj.has("T")) { + const partName = stringToPDFString(await obj.getAsync("T")); + name = name === "" ? partName : `${name}.${partName}`; + break; + } + } + } + if (parentRef && !field.has("Parent") && isName(field.get("Subtype"), "Widget")) { + orphanFields.put(fieldRef, parentRef); + } + if (!promises.has(name)) { + promises.set(name, []); + } + promises.get(name).push(AnnotationFactory.create(xref, fieldRef, annotationGlobals, null, true, orphanFields, null, null).then(annotation => annotation?.getFieldObject()).catch(function (reason) { + warn(`#collectFieldObjects: "${reason}".`); + return null; + })); + if (!field.has("Kids")) { + return; + } + const kids = await field.getAsync("Kids"); + if (Array.isArray(kids)) { + for (const kid of kids) { + await this.#collectFieldObjects(name, fieldRef, kid, promises, annotationGlobals, visitedRefs, orphanFields); + } + } + } + get fieldObjects() { + const promise = this.pdfManager.ensureDoc("formInfo").then(async formInfo => { + if (!formInfo.hasFields) { + return null; + } + const annotationGlobals = await this.annotationGlobals; + if (!annotationGlobals) { + return null; + } + const { + acroForm + } = annotationGlobals; + const visitedRefs = new RefSet(); + const allFields = Object.create(null); + const fieldPromises = new Map(); + const orphanFields = new RefSetCache(); + for (const fieldRef of acroForm.get("Fields")) { + await this.#collectFieldObjects("", null, fieldRef, fieldPromises, annotationGlobals, visitedRefs, orphanFields); + } + const allPromises = []; + for (const [name, promises] of fieldPromises) { + allPromises.push(Promise.all(promises).then(fields => { + fields = fields.filter(field => !!field); + if (fields.length > 0) { + allFields[name] = fields; + } + })); + } + await Promise.all(allPromises); + return { + allFields: objectSize(allFields) > 0 ? allFields : null, + orphanFields + }; + }); + return shadow(this, "fieldObjects", promise); + } + get hasJSActions() { + const promise = this.pdfManager.ensureDoc("_parseHasJSActions"); + return shadow(this, "hasJSActions", promise); + } + async _parseHasJSActions() { + const [catalogJsActions, fieldObjects] = await Promise.all([this.pdfManager.ensureCatalog("jsActions"), this.pdfManager.ensureDoc("fieldObjects")]); + if (catalogJsActions) { + return true; + } + if (fieldObjects?.allFields) { + return Object.values(fieldObjects.allFields).some(fieldObject => fieldObject.some(object => object.actions !== null)); + } + return false; + } + get calculationOrderIds() { + const calculationOrder = this.catalog.acroForm?.get("CO"); + if (!Array.isArray(calculationOrder) || calculationOrder.length === 0) { + return shadow(this, "calculationOrderIds", null); + } + const ids = []; + for (const id of calculationOrder) { + if (id instanceof Ref) { + ids.push(id.toString()); + } + } + return shadow(this, "calculationOrderIds", ids.length ? ids : null); + } + get annotationGlobals() { + return shadow(this, "annotationGlobals", AnnotationFactory.createGlobals(this.pdfManager)); + } +} + +;// ./src/core/pdf_manager.js + + + + + + + + + + +function parseDocBaseUrl(url) { + if (url) { + const absoluteUrl = createValidAbsoluteUrl(url); + if (absoluteUrl) { + return absoluteUrl.href; + } + warn(`Invalid absolute docBaseUrl: "${url}".`); + } + return null; +} +class BasePdfManager { + constructor({ + docBaseUrl, + docId, + enableXfa, + evaluatorOptions, + handler, + password + }) { + this._docBaseUrl = parseDocBaseUrl(docBaseUrl); + this._docId = docId; + this._password = password; + this.enableXfa = enableXfa; + evaluatorOptions.isOffscreenCanvasSupported &&= FeatureTest.isOffscreenCanvasSupported; + evaluatorOptions.isImageDecoderSupported &&= FeatureTest.isImageDecoderSupported; + this.evaluatorOptions = Object.freeze(evaluatorOptions); + ImageResizer.setOptions(evaluatorOptions); + JpegStream.setOptions(evaluatorOptions); + OperatorList.setOptions(evaluatorOptions); + const options = { + ...evaluatorOptions, + handler + }; + JpxImage.setOptions(options); + IccColorSpace.setOptions(options); + CmykICCBasedCS.setOptions(options); + } + get docId() { + return this._docId; + } + get password() { + return this._password; + } + get docBaseUrl() { + return this._docBaseUrl; + } + ensureDoc(prop, args) { + return this.ensure(this.pdfDocument, prop, args); + } + ensureXRef(prop, args) { + return this.ensure(this.pdfDocument.xref, prop, args); + } + ensureCatalog(prop, args) { + return this.ensure(this.pdfDocument.catalog, prop, args); + } + getPage(pageIndex) { + return this.pdfDocument.getPage(pageIndex); + } + fontFallback(id, handler) { + return this.pdfDocument.fontFallback(id, handler); + } + cleanup(manuallyTriggered = false) { + return this.pdfDocument.cleanup(manuallyTriggered); + } + async ensure(obj, prop, args) { + unreachable("Abstract method `ensure` called"); + } + requestRange(begin, end) { + unreachable("Abstract method `requestRange` called"); + } + requestLoadedStream(noFetch = false) { + unreachable("Abstract method `requestLoadedStream` called"); + } + sendProgressiveData(chunk) { + unreachable("Abstract method `sendProgressiveData` called"); + } + updatePassword(password) { + this._password = password; + } + terminate(reason) { + unreachable("Abstract method `terminate` called"); + } +} +class LocalPdfManager extends BasePdfManager { + constructor(args) { + super(args); + const stream = new Stream(args.source); + this.pdfDocument = new PDFDocument(this, stream); + this._loadedStreamPromise = Promise.resolve(stream); + } + async ensure(obj, prop, args) { + const value = obj[prop]; + if (typeof value === "function") { + return value.apply(obj, args); + } + return value; + } + requestRange(begin, end) { + return Promise.resolve(); + } + requestLoadedStream(noFetch = false) { + return this._loadedStreamPromise; + } + terminate(reason) {} +} +class NetworkPdfManager extends BasePdfManager { + constructor(args) { + super(args); + this.streamManager = new ChunkedStreamManager(args.source, { + msgHandler: args.handler, + length: args.length, + disableAutoFetch: args.disableAutoFetch, + rangeChunkSize: args.rangeChunkSize + }); + this.pdfDocument = new PDFDocument(this, this.streamManager.getStream()); + } + async ensure(obj, prop, args) { + try { + const value = obj[prop]; + if (typeof value === "function") { + return value.apply(obj, args); + } + return value; + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + throw ex; + } + await this.requestRange(ex.begin, ex.end); + return this.ensure(obj, prop, args); + } + } + requestRange(begin, end) { + return this.streamManager.requestRange(begin, end); + } + requestLoadedStream(noFetch = false) { + return this.streamManager.requestAllChunks(noFetch); + } + sendProgressiveData(chunk) { + this.streamManager.onReceiveData({ + chunk + }); + } + terminate(reason) { + this.streamManager.abort(reason); + } +} + +;// ./src/shared/message_handler.js + +const CallbackKind = { + DATA: 1, + ERROR: 2 +}; +const StreamKind = { + CANCEL: 1, + CANCEL_COMPLETE: 2, + CLOSE: 3, + ENQUEUE: 4, + ERROR: 5, + PULL: 6, + PULL_COMPLETE: 7, + START_COMPLETE: 8 +}; +function onFn() {} +function wrapReason(ex) { + if (ex instanceof AbortException || ex instanceof InvalidPDFException || ex instanceof PasswordException || ex instanceof ResponseException || ex instanceof UnknownErrorException) { + return ex; + } + if (!(ex instanceof Error || typeof ex === "object" && ex !== null)) { + unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.'); + } + switch (ex.name) { + case "AbortException": + return new AbortException(ex.message); + case "InvalidPDFException": + return new InvalidPDFException(ex.message); + case "PasswordException": + return new PasswordException(ex.message, ex.code); + case "ResponseException": + return new ResponseException(ex.message, ex.status, ex.missing); + case "UnknownErrorException": + return new UnknownErrorException(ex.message, ex.details); + } + return new UnknownErrorException(ex.message, ex.toString()); +} +class MessageHandler { + #messageAC = new AbortController(); + constructor(sourceName, targetName, comObj) { + this.sourceName = sourceName; + this.targetName = targetName; + this.comObj = comObj; + this.callbackId = 1; + this.streamId = 1; + this.streamSinks = Object.create(null); + this.streamControllers = Object.create(null); + this.callbackCapabilities = Object.create(null); + this.actionHandler = Object.create(null); + comObj.addEventListener("message", this.#onMessage.bind(this), { + signal: this.#messageAC.signal + }); + } + #onMessage({ + data + }) { + if (data.targetName !== this.sourceName) { + return; + } + if (data.stream) { + this.#processStreamMessage(data); + return; + } + if (data.callback) { + const callbackId = data.callbackId; + const capability = this.callbackCapabilities[callbackId]; + if (!capability) { + throw new Error(`Cannot resolve callback ${callbackId}`); + } + delete this.callbackCapabilities[callbackId]; + if (data.callback === CallbackKind.DATA) { + capability.resolve(data.data); + } else if (data.callback === CallbackKind.ERROR) { + capability.reject(wrapReason(data.reason)); + } else { + throw new Error("Unexpected callback case"); + } + return; + } + const action = this.actionHandler[data.action]; + if (!action) { + throw new Error(`Unknown action from worker: ${data.action}`); + } + if (data.callbackId) { + const sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + Promise.try(action, data.data).then(function (result) { + comObj.postMessage({ + sourceName, + targetName, + callback: CallbackKind.DATA, + callbackId: data.callbackId, + data: result + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + callback: CallbackKind.ERROR, + callbackId: data.callbackId, + reason: wrapReason(reason) + }); + }); + return; + } + if (data.streamId) { + this.#createStreamSink(data); + return; + } + action(data.data); + } + on(actionName, handler) { + const ah = this.actionHandler; + if (ah[actionName]) { + throw new Error(`There is already an actionName called "${actionName}"`); + } + ah[actionName] = handler; + } + send(actionName, data, transfers) { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + data + }, transfers); + } + sendWithPromise(actionName, data, transfers) { + const callbackId = this.callbackId++; + const capability = Promise.withResolvers(); + this.callbackCapabilities[callbackId] = capability; + try { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + callbackId, + data + }, transfers); + } catch (ex) { + capability.reject(ex); + } + return capability.promise; + } + sendWithStream(actionName, data, queueingStrategy, transfers) { + const streamId = this.streamId++, + sourceName = this.sourceName, + targetName = this.targetName, + comObj = this.comObj; + return new ReadableStream({ + start: controller => { + const startCapability = Promise.withResolvers(); + this.streamControllers[streamId] = { + controller, + startCall: startCapability, + pullCall: null, + cancelCall: null, + isClosed: false + }; + comObj.postMessage({ + sourceName, + targetName, + action: actionName, + streamId, + data, + desiredSize: controller.desiredSize + }, transfers); + return startCapability.promise; + }, + pull: controller => { + const pullCapability = Promise.withResolvers(); + this.streamControllers[streamId].pullCall = pullCapability; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL, + streamId, + desiredSize: controller.desiredSize + }); + return pullCapability.promise; + }, + cancel: reason => { + assert(reason instanceof Error, "cancel must have a valid reason"); + const cancelCapability = Promise.withResolvers(); + this.streamControllers[streamId].cancelCall = cancelCapability; + this.streamControllers[streamId].isClosed = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL, + streamId, + reason: wrapReason(reason) + }); + return cancelCapability.promise; + } + }, queueingStrategy); + } + #createStreamSink(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const self = this, + action = this.actionHandler[data.action]; + const streamSink = { + enqueue(chunk, size = 1, transfers) { + if (this.isCancelled) { + return; + } + const lastDesiredSize = this.desiredSize; + this.desiredSize -= size; + if (lastDesiredSize > 0 && this.desiredSize <= 0) { + this.sinkCapability = Promise.withResolvers(); + this.ready = this.sinkCapability.promise; + } + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ENQUEUE, + streamId, + chunk + }, transfers); + }, + close() { + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CLOSE, + streamId + }); + delete self.streamSinks[streamId]; + }, + error(reason) { + assert(reason instanceof Error, "error must have a valid reason"); + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ERROR, + streamId, + reason: wrapReason(reason) + }); + }, + sinkCapability: Promise.withResolvers(), + onPull: null, + onCancel: null, + isCancelled: false, + desiredSize: data.desiredSize, + ready: null + }; + streamSink.sinkCapability.resolve(); + streamSink.ready = streamSink.sinkCapability.promise; + this.streamSinks[streamId] = streamSink; + Promise.try(action, data.data, streamSink).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + } + #processStreamMessage(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const streamController = this.streamControllers[streamId], + streamSink = this.streamSinks[streamId]; + switch (data.stream) { + case StreamKind.START_COMPLETE: + if (data.success) { + streamController.startCall.resolve(); + } else { + streamController.startCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL_COMPLETE: + if (data.success) { + streamController.pullCall.resolve(); + } else { + streamController.pullCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL: + if (!streamSink) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + break; + } + if (streamSink.desiredSize <= 0 && data.desiredSize > 0) { + streamSink.sinkCapability.resolve(); + } + streamSink.desiredSize = data.desiredSize; + Promise.try(streamSink.onPull || onFn).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + break; + case StreamKind.ENQUEUE: + assert(streamController, "enqueue should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.controller.enqueue(data.chunk); + break; + case StreamKind.CLOSE: + assert(streamController, "close should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.isClosed = true; + streamController.controller.close(); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.ERROR: + assert(streamController, "error should have stream controller"); + streamController.controller.error(wrapReason(data.reason)); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL_COMPLETE: + if (data.success) { + streamController.cancelCall.resolve(); + } else { + streamController.cancelCall.reject(wrapReason(data.reason)); + } + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL: + if (!streamSink) { + break; + } + const dataReason = wrapReason(data.reason); + Promise.try(streamSink.onCancel || onFn, dataReason).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + streamSink.sinkCapability.reject(dataReason); + streamSink.isCancelled = true; + delete this.streamSinks[streamId]; + break; + default: + throw new Error("Unexpected stream case"); + } + } + async #deleteStreamController(streamController, streamId) { + await Promise.allSettled([streamController.startCall?.promise, streamController.pullCall?.promise, streamController.cancelCall?.promise]); + delete this.streamControllers[streamId]; + } + destroy() { + this.#messageAC?.abort(); + this.#messageAC = null; + } +} + +;// ./src/core/writer.js + + + + + + + +async function writeObject(ref, obj, buffer, { + encrypt = null, + encryptRef = null +}) { + const transform = encrypt && encryptRef !== ref ? encrypt.createCipherTransform(ref.num, ref.gen) : null; + buffer.push(`${ref.num} ${ref.gen} obj\n`); + await writeValue(obj, buffer, transform); + buffer.push("\nendobj\n"); +} +async function writeDict(dict, buffer, transform) { + buffer.push("<<"); + for (const [key, rawObj] of dict.getRawEntries()) { + buffer.push(` /${escapePDFName(key)} `); + await writeValue(rawObj, buffer, transform); + } + buffer.push(">>"); +} +async function writeStream(stream, buffer, transform) { + stream = stream.getOriginalStream(); + stream.reset(); + let bytes = stream.getBytes(); + const { + dict + } = stream; + const [filter, params] = await Promise.all([dict.getAsync("Filter"), dict.getAsync("DecodeParms")]); + const filterZero = Array.isArray(filter) ? await dict.xref.fetchIfRefAsync(filter[0]) : filter; + const isFilterZeroFlateDecode = isName(filterZero, "FlateDecode"); + const MIN_LENGTH_FOR_COMPRESSING = 256; + if (bytes.length >= MIN_LENGTH_FOR_COMPRESSING && !isFilterZeroFlateDecode) { + try { + const cs = new CompressionStream("deflate"); + const writer = cs.writable.getWriter(); + await writer.ready; + writer.write(bytes).then(async () => { + await writer.ready; + await writer.close(); + }).catch(() => {}); + const buf = await new Response(cs.readable).arrayBuffer(); + bytes = new Uint8Array(buf); + let newFilter, newParams; + if (!filter) { + newFilter = Name.get("FlateDecode"); + } else if (!isFilterZeroFlateDecode) { + newFilter = Array.isArray(filter) ? [Name.get("FlateDecode"), ...filter] : [Name.get("FlateDecode"), filter]; + if (params) { + newParams = Array.isArray(params) ? [null, ...params] : [null, params]; + } + } + if (newFilter) { + dict.set("Filter", newFilter); + } + if (newParams) { + dict.set("DecodeParms", newParams); + } + } catch (ex) { + info(`writeStream - cannot compress data: "${ex}".`); + } + } + let string = bytesToString(bytes); + if (transform) { + string = transform.encryptString(string); + } + dict.set("Length", string.length); + await writeDict(dict, buffer, transform); + buffer.push(" stream\n", string, "\nendstream"); +} +async function writeArray(array, buffer, transform) { + buffer.push("["); + for (let i = 0, ii = array.length; i < ii; i++) { + await writeValue(array[i], buffer, transform); + if (i < ii - 1) { + buffer.push(" "); + } + } + buffer.push("]"); +} +async function writeValue(value, buffer, transform) { + if (value instanceof Name) { + buffer.push(`/${escapePDFName(value.name)}`); + } else if (value instanceof Ref) { + buffer.push(`${value.num} ${value.gen} R`); + } else if (Array.isArray(value) || ArrayBuffer.isView(value)) { + await writeArray(value, buffer, transform); + } else if (typeof value === "string") { + if (transform) { + value = transform.encryptString(value); + } + buffer.push(`(${escapeString(value)})`); + } else if (typeof value === "number") { + buffer.push(value.toString()); + } else if (typeof value === "boolean") { + buffer.push(value.toString()); + } else if (value instanceof Dict) { + await writeDict(value, buffer, transform); + } else if (value instanceof BaseStream) { + await writeStream(value, buffer, transform); + } else if (value === null) { + buffer.push("null"); + } else { + warn(`Unhandled value in writer: ${typeof value}, please file a bug.`); + } +} +function writeInt(number, size, offset, buffer) { + for (let i = size + offset - 1; i > offset - 1; i--) { + buffer[i] = number & 0xff; + number >>= 8; + } + return offset + size; +} +function writeString(string, offset, buffer) { + const ii = string.length; + for (let i = 0; i < ii; i++) { + buffer[offset + i] = string.charCodeAt(i) & 0xff; + } + return offset + ii; +} +function computeMD5(filesize, xrefInfo) { + const time = Math.floor(Date.now() / 1000); + const filename = xrefInfo.filename || ""; + const md5Buffer = [time.toString(), filename, filesize.toString(), ...xrefInfo.infoMap.values()]; + const md5BufferLen = Math.sumPrecise(md5Buffer.map(str => str.length)); + const array = new Uint8Array(md5BufferLen); + let offset = 0; + for (const str of md5Buffer) { + offset = writeString(str, offset, array); + } + return bytesToString(calculateMD5(array, 0, array.length)); +} +function writeXFADataForAcroform(str, changes) { + const xml = new SimpleXMLParser({ + hasAttributes: true + }).parseFromString(str); + for (const { + xfa + } of changes) { + if (!xfa) { + continue; + } + const { + path, + value + } = xfa; + if (!path) { + continue; + } + const nodePath = parseXFAPath(path); + let node = xml.documentElement.searchNode(nodePath, 0); + if (!node && nodePath.length > 1) { + node = xml.documentElement.searchNode([nodePath.at(-1)], 0); + } + if (node) { + node.childNodes = Array.isArray(value) ? value.map(val => new SimpleDOMNode("value", val)) : [new SimpleDOMNode("#text", value)]; + } else { + warn(`Node not found for path: ${path}`); + } + } + const buffer = []; + xml.documentElement.dump(buffer); + return buffer.join(""); +} +async function updateAcroform({ + xref, + acroForm, + acroFormRef, + hasXfa, + hasXfaDatasetsEntry, + xfaDatasetsRef, + needAppearances, + changes +}) { + if (hasXfa && !hasXfaDatasetsEntry && !xfaDatasetsRef) { + warn("XFA - Cannot save it"); + } + if (!needAppearances && (!hasXfa || !xfaDatasetsRef || hasXfaDatasetsEntry)) { + return; + } + const dict = acroForm.clone(); + if (hasXfa && !hasXfaDatasetsEntry) { + const newXfa = acroForm.get("XFA").slice(); + newXfa.splice(2, 0, "datasets"); + newXfa.splice(3, 0, xfaDatasetsRef); + dict.set("XFA", newXfa); + } + if (needAppearances) { + dict.set("NeedAppearances", true); + } + changes.put(acroFormRef, { + data: dict + }); +} +function updateXFA({ + xfaData, + xfaDatasetsRef, + changes, + xref +}) { + if (xfaData === null) { + const datasets = xref.fetchIfRef(xfaDatasetsRef); + xfaData = writeXFADataForAcroform(datasets.getString(), changes); + } + const xfaDataStream = new StringStream(xfaData); + xfaDataStream.dict = new Dict(xref); + xfaDataStream.dict.setIfName("Type", "EmbeddedFile"); + changes.put(xfaDatasetsRef, { + data: xfaDataStream + }); +} +async function getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer) { + buffer.push("xref\n"); + const indexes = getIndexes(newRefs); + let indexesPosition = 0; + for (const { + ref, + data + } of newRefs) { + if (ref.num === indexes[indexesPosition]) { + buffer.push(`${indexes[indexesPosition]} ${indexes[indexesPosition + 1]}\n`); + indexesPosition += 2; + } + if (data !== null) { + buffer.push(`${baseOffset.toString().padStart(10, "0")} ${Math.min(ref.gen, 0xffff).toString().padStart(5, "0")} n\r\n`); + baseOffset += data.length; + } else { + buffer.push(`0000000000 ${Math.min(ref.gen + 1, 0xffff).toString().padStart(5, "0")} f\r\n`); + } + } + computeIDs(baseOffset, xrefInfo, newXref); + buffer.push("trailer\n"); + await writeDict(newXref, buffer, null); + buffer.push("\nstartxref\n", baseOffset.toString(), "\n%%EOF\n"); +} +function getIndexes(newRefs) { + const indexes = []; + for (const { + ref + } of newRefs) { + if (ref.num === indexes.at(-2) + indexes.at(-1)) { + indexes[indexes.length - 1] += 1; + } else { + indexes.push(ref.num, 1); + } + } + return indexes; +} +async function getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) { + const xrefTableData = []; + let maxOffset = 0; + let maxGen = 0; + for (const { + ref, + data, + objStreamRef, + index + } of newRefs) { + let gen; + maxOffset = Math.max(maxOffset, baseOffset); + if (objStreamRef) { + gen = index; + xrefTableData.push([2, objStreamRef.num, gen]); + } else if (data !== null) { + gen = Math.min(ref.gen, 0xffff); + xrefTableData.push([1, baseOffset, gen]); + baseOffset += data.length; + } else { + gen = Math.min(ref.gen + 1, 0xffff); + xrefTableData.push([0, 0, gen]); + } + maxGen = Math.max(maxGen, gen); + } + newXref.set("Index", getIndexes(newRefs)); + const offsetSize = getSizeInBytes(maxOffset); + const maxGenSize = getSizeInBytes(maxGen); + const sizes = [1, offsetSize, maxGenSize]; + newXref.set("W", sizes); + computeIDs(baseOffset, xrefInfo, newXref); + const structSize = Math.sumPrecise(sizes); + const data = new Uint8Array(structSize * xrefTableData.length); + const stream = new Stream(data); + stream.dict = newXref; + let offset = 0; + for (const [type, objOffset, gen] of xrefTableData) { + offset = writeInt(type, sizes[0], offset, data); + offset = writeInt(objOffset, sizes[1], offset, data); + offset = writeInt(gen, sizes[2], offset, data); + } + await writeObject(xrefInfo.newRef, stream, buffer, {}); + buffer.push("startxref\n", baseOffset.toString(), "\n%%EOF\n"); +} +function computeIDs(baseOffset, xrefInfo, newXref) { + if (Array.isArray(xrefInfo.fileIds) && xrefInfo.fileIds.length > 0) { + const md5 = computeMD5(baseOffset, xrefInfo); + newXref.set("ID", [xrefInfo.fileIds[0] || md5, md5]); + } +} +function getTrailerDict(xrefInfo, changes, useXrefStream) { + const newXref = new Dict(null); + newXref.setIfDefined("Prev", xrefInfo?.startXRef); + const refForXrefTable = xrefInfo.newRef; + if (useXrefStream) { + changes.put(refForXrefTable, { + data: "" + }); + newXref.set("Size", refForXrefTable.num + 1); + newXref.setIfName("Type", "XRef"); + } else { + newXref.set("Size", refForXrefTable.num); + } + newXref.setIfDefined("Root", xrefInfo?.rootRef); + newXref.setIfDefined("Info", xrefInfo?.infoRef); + newXref.setIfDefined("Encrypt", xrefInfo?.encryptRef); + return newXref; +} +async function writeChanges(changes, xref, buffer = []) { + const newRefs = []; + for (const [ref, { + data, + objStreamRef, + index + }] of changes.items()) { + if (objStreamRef) { + newRefs.push({ + ref, + data, + objStreamRef, + index + }); + continue; + } + if (data === null || typeof data === "string") { + newRefs.push({ + ref, + data + }); + continue; + } + await writeObject(ref, data, buffer, xref); + newRefs.push({ + ref, + data: buffer.join("") + }); + buffer.length = 0; + } + return newRefs.sort((a, b) => a.ref.num - b.ref.num); +} +async function incrementalUpdate({ + originalData, + xrefInfo, + changes, + xref = null, + hasXfa = false, + xfaDatasetsRef = null, + hasXfaDatasetsEntry = false, + needAppearances, + acroFormRef = null, + acroForm = null, + xfaData = null, + useXrefStream = false +}) { + await updateAcroform({ + xref, + acroForm, + acroFormRef, + hasXfa, + hasXfaDatasetsEntry, + xfaDatasetsRef, + needAppearances, + changes + }); + if (hasXfa) { + updateXFA({ + xfaData, + xfaDatasetsRef, + changes, + xref + }); + } + const newXref = getTrailerDict(xrefInfo, changes, useXrefStream); + const buffer = []; + const newRefs = await writeChanges(changes, xref, buffer); + let baseOffset = originalData.length; + const lastByte = originalData.at(-1); + if (lastByte !== 0x0a && lastByte !== 0x0d) { + buffer.push("\n"); + baseOffset += 1; + } + for (const { + data + } of newRefs) { + if (data !== null) { + buffer.push(data); + } + } + await (useXrefStream ? getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) : getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer)); + const totalLength = originalData.length + Math.sumPrecise(buffer.map(str => str.length)); + const array = new Uint8Array(totalLength); + array.set(originalData); + let offset = originalData.length; + for (const str of buffer) { + offset = writeString(str, offset, array); + } + return array; +} + +;// ./src/core/editor/pdf_editor.js + + + + + + + +const MAX_LEAVES_PER_PAGES_NODE = 16; +const MAX_IN_NAME_TREE_NODE = 64; +class PageData { + constructor(page, documentData) { + this.page = page; + this.documentData = documentData; + this.annotations = null; + this.pointingNamedDestinations = null; + documentData.pagesMap.put(page.ref, this); + } +} +class DocumentData { + constructor(document) { + this.document = document; + this.destinations = null; + this.pageLabels = null; + this.pagesMap = new RefSetCache(); + this.oldRefMapping = new RefSetCache(); + this.dedupNamedDestinations = new Map(); + this.usedNamedDestinations = new Set(); + this.postponedRefCopies = new RefSetCache(); + this.usedStructParents = new Set(); + this.oldStructParentMapping = new Map(); + this.structTreeRoot = null; + this.parentTree = null; + this.idTree = null; + this.roleMap = null; + this.classMap = null; + this.namespaces = null; + this.structTreeAF = null; + this.structTreePronunciationLexicon = []; + } +} +class XRefWrapper { + constructor(entries) { + this.entries = entries; + } + fetch(ref) { + return ref instanceof Ref ? this.entries[ref.num] : ref; + } +} +class PDFEditor { + constructor({ + useObjectStreams = true, + title = "", + author = "" + } = {}) { + this.hasSingleFile = false; + this.currentDocument = null; + this.oldPages = []; + this.newPages = []; + this.xref = [null]; + this.xrefWrapper = new XRefWrapper(this.xref); + this.newRefCount = 1; + [this.rootRef, this.rootDict] = this.newDict; + [this.infoRef, this.infoDict] = this.newDict; + [this.pagesRef, this.pagesDict] = this.newDict; + this.namesDict = null; + this.useObjectStreams = useObjectStreams; + this.objStreamRefs = useObjectStreams ? new Set() : null; + this.version = "1.7"; + this.title = title; + this.author = author; + this.pageLabels = null; + this.namedDestinations = new Map(); + this.parentTree = new Map(); + this.structTreeKids = []; + this.idTree = new Map(); + this.classMap = new Dict(); + this.roleMap = new Dict(); + this.namespaces = new Map(); + this.structTreeAF = []; + this.structTreePronunciationLexicon = []; + } + get newRef() { + const ref = Ref.get(this.newRefCount++, 0); + return ref; + } + get newDict() { + const ref = this.newRef; + const dict = this.xref[ref.num] = new Dict(); + return [ref, dict]; + } + async #cloneObject(obj, xref) { + const ref = this.newRef; + this.xref[ref.num] = await this.#collectDependencies(obj, true, xref); + return ref; + } + cloneDict(dict) { + const newDict = dict.clone(); + newDict.xref = this.xrefWrapper; + return newDict; + } + async #collectDependencies(obj, mustClone, xref) { + if (obj instanceof Ref) { + const { + currentDocument: { + oldRefMapping + } + } = this; + let newRef = oldRefMapping.get(obj); + if (newRef) { + return newRef; + } + const oldRef = obj; + obj = await xref.fetchAsync(oldRef); + if (typeof obj === "number") { + return obj; + } + newRef = this.newRef; + oldRefMapping.put(oldRef, newRef); + this.xref[newRef.num] = await this.#collectDependencies(obj, true, xref); + return newRef; + } + const promises = []; + const { + currentDocument: { + postponedRefCopies + } + } = this; + if (Array.isArray(obj)) { + if (mustClone) { + obj = obj.slice(); + } + for (let i = 0, ii = obj.length; i < ii; i++) { + const postponedActions = postponedRefCopies.get(obj[i]); + if (postponedActions) { + postponedActions.push(ref => obj[i] = ref); + continue; + } + promises.push(this.#collectDependencies(obj[i], true, xref).then(newObj => obj[i] = newObj)); + } + await Promise.all(promises); + return obj; + } + let dict; + if (obj instanceof BaseStream) { + ({ + dict + } = obj = obj.getOriginalStream().clone()); + dict.xref = this.xrefWrapper; + } else if (obj instanceof Dict) { + if (mustClone) { + obj = obj.clone(); + obj.xref = this.xrefWrapper; + } + dict = obj; + } + if (dict) { + for (const [key, rawObj] of dict.getRawEntries()) { + const postponedActions = postponedRefCopies.get(rawObj); + if (postponedActions) { + postponedActions.push(ref => dict.set(key, ref)); + continue; + } + promises.push(this.#collectDependencies(rawObj, true, xref).then(newObj => dict.set(key, newObj))); + } + await Promise.all(promises); + } + return obj; + } + async #cloneStructTreeNode(parentStructRef, node, xref, removedStructElements, dedupIDs, dedupClasses, dedupRoles, visited = new RefSet()) { + const { + currentDocument: { + pagesMap, + oldRefMapping + } + } = this; + const pg = node.getRaw("Pg"); + if (pg instanceof Ref && !pagesMap.has(pg)) { + return null; + } + let kids; + const k = kids = node.getRaw("K"); + if (k instanceof Ref) { + if (visited.has(k)) { + return null; + } + kids = await xref.fetchAsync(k); + if (!Array.isArray(kids)) { + kids = [k]; + } + } + kids = Array.isArray(kids) ? kids : [kids]; + const newKids = []; + const structElemIndices = []; + for (let kid of kids) { + const kidRef = kid instanceof Ref ? kid : null; + if (kidRef) { + if (visited.has(kidRef)) { + continue; + } + visited.put(kidRef); + kid = await xref.fetchAsync(kidRef); + } + if (typeof kid === "number") { + newKids.push(kid); + continue; + } + if (!(kid instanceof Dict)) { + continue; + } + const pgRef = kid.getRaw("Pg"); + if (pgRef instanceof Ref && !pagesMap.has(pgRef)) { + continue; + } + const type = kid.get("Type"); + if (!type || isName(type, "StructElem")) { + let setAsSpan = false; + if (kidRef && removedStructElements.has(kidRef)) { + if (!isName(kid.get("S"), "Link")) { + continue; + } + setAsSpan = true; + } + const newKidRef = await this.#cloneStructTreeNode(kidRef, kid, xref, removedStructElements, dedupIDs, dedupClasses, dedupRoles, visited); + if (newKidRef) { + structElemIndices.push(newKids.length); + newKids.push(newKidRef); + if (kidRef) { + oldRefMapping.put(kidRef, newKidRef); + } + if (setAsSpan) { + this.xref[newKidRef.num].setIfName("S", "Span"); + } + } + continue; + } + if (isName(type, "OBJR")) { + if (!kidRef) { + continue; + } + const newKidRef = oldRefMapping.get(kidRef); + if (!newKidRef) { + continue; + } + const newKid = this.xref[newKidRef.num]; + const objRef = newKid.getRaw("Obj"); + if (objRef instanceof Ref) { + const obj = this.xref[objRef.num]; + if (obj instanceof Dict && !obj.has("StructParent") && parentStructRef) { + const structParent = this.parentTree.size; + this.parentTree.set(structParent, [oldRefMapping, parentStructRef]); + obj.set("StructParent", structParent); + } + } + newKids.push(newKidRef); + continue; + } + if (isName(type, "MCR")) { + const newKid = await this.#collectDependencies(kidRef || kid, true, xref); + newKids.push(newKid); + continue; + } + if (kidRef) { + const newKidRef = await this.#collectDependencies(kidRef, true, xref); + newKids.push(newKidRef); + } + } + if (kids.length !== 0 && newKids.length === 0) { + return null; + } + const newNodeRef = this.newRef; + const newNode = this.xref[newNodeRef.num] = this.cloneDict(node); + newNode.delete("ID"); + newNode.delete("C"); + newNode.delete("K"); + newNode.delete("P"); + newNode.delete("S"); + await this.#collectDependencies(newNode, false, xref); + const classNames = node.get("C"); + if (classNames instanceof Name) { + const newClassName = dedupClasses.get(classNames.name); + if (newClassName) { + newNode.set("C", Name.get(newClassName)); + } else { + newNode.set("C", classNames); + } + } else if (Array.isArray(classNames)) { + const newClassNames = []; + for (const className of classNames) { + if (className instanceof Name) { + const newClassName = dedupClasses.get(className.name); + if (newClassName) { + newClassNames.push(Name.get(newClassName)); + } else { + newClassNames.push(className); + } + } + } + newNode.set("C", newClassNames); + } + const roleName = node.get("S"); + if (roleName instanceof Name) { + const newRoleName = dedupRoles.get(roleName.name); + if (newRoleName) { + newNode.set("S", Name.get(newRoleName)); + } else { + newNode.set("S", roleName); + } + } + const id = node.get("ID"); + if (typeof id === "string") { + const stringId = stringToPDFString(id, false); + const newId = dedupIDs.get(stringId); + if (newId) { + newNode.set("ID", stringToAsciiOrUTF16BE(newId)); + } else { + newNode.set("ID", id); + } + } + let attributes = newNode.get("A"); + if (attributes) { + if (!Array.isArray(attributes)) { + attributes = [attributes]; + } + for (let attr of attributes) { + attr = this.xrefWrapper.fetch(attr); + if (isName(attr.get("O"), "Table") && attr.has("Headers")) { + const headers = this.xrefWrapper.fetch(attr.getRaw("Headers")); + if (Array.isArray(headers)) { + for (let i = 0, ii = headers.length; i < ii; i++) { + const newId = dedupIDs.get(stringToPDFString(headers[i], false)); + if (newId) { + headers[i] = newId; + } + } + } + } + } + } + for (const index of structElemIndices) { + const structElemRef = newKids[index]; + const structElem = this.xref[structElemRef.num]; + structElem.set("P", newNodeRef); + } + if (newKids.length === 1) { + newNode.set("K", newKids[0]); + } else if (newKids.length > 1) { + newNode.set("K", newKids); + } + return newNodeRef; + } + async extractPages(pageInfos) { + const promises = []; + let newIndex = 0; + this.hasSingleFile = pageInfos.length === 1; + const allDocumentData = []; + for (const { + document, + includePages, + excludePages + } of pageInfos) { + if (!document) { + continue; + } + const documentData = new DocumentData(document); + allDocumentData.push(documentData); + promises.push(this.#collectDocumentData(documentData)); + let keptIndices, keptRanges, deletedIndices, deletedRanges; + for (const page of includePages || []) { + if (Array.isArray(page)) { + (keptRanges ||= []).push(page); + } else { + (keptIndices ||= new Set()).add(page); + } + } + for (const page of excludePages || []) { + if (Array.isArray(page)) { + (deletedRanges ||= []).push(page); + } else { + (deletedIndices ||= new Set()).add(page); + } + } + for (let i = 0, ii = document.numPages; i < ii; i++) { + if (deletedIndices?.has(i)) { + continue; + } + if (deletedRanges) { + let isDeleted = false; + for (const [start, end] of deletedRanges) { + if (i >= start && i <= end) { + isDeleted = true; + break; + } + } + if (isDeleted) { + continue; + } + } + let takePage = false; + if (keptIndices) { + takePage = keptIndices.has(i); + } + if (!takePage && keptRanges) { + for (const [start, end] of keptRanges) { + if (i >= start && i <= end) { + takePage = true; + break; + } + } + } + if (!takePage && !keptIndices && !keptRanges) { + takePage = true; + } + if (!takePage) { + continue; + } + const newPageIndex = newIndex++; + promises.push(document.getPage(i).then(page => { + this.oldPages[newPageIndex] = new PageData(page, documentData); + })); + } + } + await Promise.all(promises); + promises.length = 0; + this.#collectValidDestinations(allDocumentData); + this.#collectPageLabels(); + for (const page of this.oldPages) { + promises.push(this.#postCollectPageData(page)); + } + await Promise.all(promises); + this.#findDuplicateNamedDestinations(); + this.#setPostponedRefCopies(allDocumentData); + for (let i = 0, ii = this.oldPages.length; i < ii; i++) { + this.newPages[i] = await this.#makePageCopy(i, null); + } + this.#fixPostponedRefCopies(allDocumentData); + await this.#mergeStructTrees(allDocumentData); + return this.writePDF(); + } + async #collectDocumentData(documentData) { + const { + document: { + pdfManager, + xref + } + } = documentData; + await Promise.all([pdfManager.ensureCatalog("destinations").then(destinations => documentData.destinations = destinations), pdfManager.ensureCatalog("rawPageLabels").then(pageLabels => documentData.pageLabels = pageLabels), pdfManager.ensureCatalog("structTreeRoot").then(structTreeRoot => documentData.structTreeRoot = structTreeRoot)]); + const structTreeRoot = documentData.structTreeRoot; + if (structTreeRoot) { + const rootDict = structTreeRoot.dict; + const parentTree = rootDict.get("ParentTree"); + if (parentTree) { + const numberTree = new NumberTree(parentTree, xref); + documentData.parentTree = numberTree.getAll(true); + } + const idTree = rootDict.get("IDTree"); + if (idTree) { + const nameTree = new NameTree(idTree, xref); + documentData.idTree = nameTree.getAll(true); + } + documentData.roleMap = rootDict.get("RoleMap") || null; + documentData.classMap = rootDict.get("ClassMap") || null; + let namespaces = rootDict.get("Namespaces") || null; + if (namespaces && !Array.isArray(namespaces)) { + namespaces = [namespaces]; + } + documentData.namespaces = namespaces; + documentData.structTreeAF = rootDict.get("AF") || null; + documentData.structTreePronunciationLexicon = rootDict.get("PronunciationLexicon") || null; + } + } + async #postCollectPageData(pageData) { + const { + page: { + xref, + annotations + }, + documentData: { + pagesMap, + destinations, + usedNamedDestinations + } + } = pageData; + if (!annotations) { + return; + } + const promises = []; + let newAnnotations = []; + let newIndex = 0; + for (const annotationRef of annotations) { + const newAnnotationIndex = newIndex++; + promises.push(xref.fetchIfRefAsync(annotationRef).then(async annotationDict => { + if (!isName(annotationDict.get("Subtype"), "Link")) { + newAnnotations[newAnnotationIndex] = annotationRef; + return; + } + const action = annotationDict.get("A"); + const dest = action instanceof Dict ? action.get("D") : annotationDict.get("Dest"); + if (!dest || Array.isArray(dest) && (!(dest[0] instanceof Ref) || pagesMap.has(dest[0]))) { + newAnnotations[newAnnotationIndex] = annotationRef; + } else if (typeof dest === "string") { + const destString = stringToPDFString(dest, true); + if (destinations.has(destString)) { + newAnnotations[newAnnotationIndex] = annotationRef; + usedNamedDestinations.add(destString); + } + } + })); + } + await Promise.all(promises); + newAnnotations = newAnnotations.filter(annot => !!annot); + pageData.annotations = newAnnotations.length > 0 ? newAnnotations : null; + } + #setPostponedRefCopies(allDocumentData) { + for (const { + postponedRefCopies, + pagesMap + } of allDocumentData) { + for (const oldPageRef of pagesMap.keys()) { + postponedRefCopies.put(oldPageRef, []); + } + } + } + #fixPostponedRefCopies(allDocumentData) { + for (const { + postponedRefCopies, + oldRefMapping + } of allDocumentData) { + for (const [oldRef, actions] of postponedRefCopies.items()) { + const newRef = oldRefMapping.get(oldRef); + for (const action of actions) { + action(newRef); + } + } + postponedRefCopies.clear(); + } + } + #visitObject(obj, callback, visited = new RefSet()) { + if (obj instanceof Ref) { + if (!visited.has(obj)) { + visited.put(obj); + this.#visitObject(this.xref[obj.num], callback, visited); + } + return; + } + if (Array.isArray(obj)) { + for (const item of obj) { + this.#visitObject(item, callback, visited); + } + return; + } + let dict; + if (obj instanceof BaseStream) { + ({ + dict + } = obj); + } else if (obj instanceof Dict) { + dict = obj; + } + if (dict) { + callback(dict); + for (const value of dict.getRawValues()) { + this.#visitObject(value, callback, visited); + } + } + } + async #mergeStructTrees(allDocumentData) { + let newStructParentId = 0; + const { + parentTree: newParentTree + } = this; + for (let i = 0, ii = this.newPages.length; i < ii; i++) { + const { + documentData: { + parentTree, + oldRefMapping, + oldStructParentMapping, + usedStructParents, + document: { + xref + } + } + } = this.oldPages[i]; + if (!parentTree) { + continue; + } + const pageRef = this.newPages[i]; + const pageDict = this.xref[pageRef.num]; + this.#visitObject(pageDict, dict => { + const structParent = dict.get("StructParent") ?? dict.get("StructParents"); + if (typeof structParent !== "number") { + return; + } + usedStructParents.add(structParent); + let parent = parentTree.get(structParent); + const parentRef = parent instanceof Ref ? parent : null; + if (parentRef) { + const array = xref.fetch(parentRef); + if (Array.isArray(array)) { + parent = array; + } + } + if (Array.isArray(parent) && parent.every(ref => ref === null)) { + parent = null; + } + if (!parent) { + if (dict.has("StructParent")) { + dict.delete("StructParent"); + } else { + dict.delete("StructParents"); + } + return; + } + let newStructParent = oldStructParentMapping.get(structParent); + if (newStructParent === undefined) { + newStructParent = newStructParentId++; + oldStructParentMapping.set(structParent, newStructParent); + newParentTree.set(newStructParent, [oldRefMapping, parent]); + } + if (dict.has("StructParent")) { + dict.set("StructParent", newStructParent); + } else { + dict.set("StructParents", newStructParent); + } + }); + } + const { + structTreeKids, + idTree: newIdTree, + classMap: newClassMap, + roleMap: newRoleMap, + namespaces: newNamespaces, + structTreeAF: newStructTreeAF, + structTreePronunciationLexicon: newStructTreePronunciationLexicon + } = this; + for (const documentData of allDocumentData) { + const { + document: { + xref + }, + oldRefMapping, + parentTree, + usedStructParents, + structTreeRoot, + idTree, + classMap, + roleMap, + namespaces, + structTreeAF, + structTreePronunciationLexicon + } = documentData; + if (!structTreeRoot) { + continue; + } + this.currentDocument = documentData; + const removedStructElements = new RefSet(); + for (const [key, value] of parentTree || []) { + if (!usedStructParents.has(key) && value instanceof Ref) { + removedStructElements.put(value); + } + } + const dedupIDs = new Map(); + for (const [id, nodeRef] of idTree || []) { + let _id = id; + if (newIdTree.has(id)) { + for (let i = 1;; i++) { + const newId = `${id}_${i}`; + if (!newIdTree.has(newId)) { + dedupIDs.set(id, newId); + _id = newId; + break; + } + } + } + newIdTree.set(_id, nodeRef); + } + const dedupClasses = new Map(); + if (classMap?.size > 0) { + for (let [className, classDict] of classMap) { + classDict = await this.#collectDependencies(classDict, true, xref); + if (newClassMap.has(className)) { + for (let i = 1;; i++) { + const newClassName = `${className}_${i}`; + if (!newClassMap.has(newClassName)) { + dedupClasses.set(className, newClassName); + className = newClassName; + break; + } + } + } + newClassMap.set(className, classDict); + } + } + const dedupRoles = new Map(); + if (roleMap?.size > 0) { + for (const [roleName, mappedName] of roleMap) { + const newMappedName = newRoleMap.get(roleName); + if (!newMappedName) { + newRoleMap.set(roleName, mappedName); + continue; + } + if (newMappedName === mappedName) { + continue; + } + for (let i = 1;; i++) { + const newRoleName = `${roleName}_${i}`; + if (!newRoleMap.has(newRoleName)) { + dedupRoles.set(roleName, newRoleName); + newRoleMap.set(newRoleName, mappedName); + break; + } + } + } + } + if (namespaces?.length > 0) { + for (const namespaceRef of namespaces) { + const namespace = await xref.fetchIfRefAsync(namespaceRef); + let ns = namespace.get("NS"); + if (!ns || newNamespaces.has(ns)) { + continue; + } + ns = stringToPDFString(ns, false); + const newNamespace = await this.#collectDependencies(namespace, true, xref); + newNamespaces.set(ns, newNamespace); + } + } + if (structTreeAF) { + for (const afRef of structTreeAF) { + newStructTreeAF.push(await this.#collectDependencies(afRef, true, xref)); + } + } + if (structTreePronunciationLexicon) { + for (const lexiconRef of structTreePronunciationLexicon) { + newStructTreePronunciationLexicon.push(await this.#collectDependencies(lexiconRef, true, xref)); + } + } + let kids = structTreeRoot.dict.get("K"); + if (!kids) { + continue; + } + kids = Array.isArray(kids) ? kids : [kids]; + for (let kid of kids) { + const kidRef = kid instanceof Ref ? kid : null; + if (kidRef && removedStructElements.has(kidRef)) { + continue; + } + kid = await xref.fetchIfRefAsync(kid); + const newKidRef = await this.#cloneStructTreeNode(kidRef, kid, xref, removedStructElements, dedupIDs, dedupClasses, dedupRoles); + if (newKidRef) { + structTreeKids.push(newKidRef); + } + } + for (const [id, nodeRef] of idTree || []) { + const newNodeRef = oldRefMapping.get(nodeRef); + const newId = dedupIDs.get(id) || id; + if (newNodeRef) { + newIdTree.set(newId, newNodeRef); + } else { + newIdTree.delete(newId); + } + } + } + for (const [key, [oldRefMapping, parent]] of newParentTree) { + if (!parent) { + newParentTree.delete(key); + continue; + } + if (!Array.isArray(parent)) { + const newParent = oldRefMapping.get(parent); + if (newParent === undefined) { + newParentTree.delete(key); + } else { + newParentTree.set(key, newParent); + } + continue; + } + const newParents = parent.map(ref => ref instanceof Ref && oldRefMapping.get(ref) || null); + if (newParents.length === 0 || newParents.every(ref => ref === null)) { + newParentTree.delete(key); + continue; + } + newParentTree.set(key, newParents); + } + this.currentDocument = null; + } + #collectValidDestinations(allDocumentData) { + for (const documentData of allDocumentData) { + if (!documentData.destinations) { + continue; + } + const { + destinations, + pagesMap + } = documentData; + const newDestinations = documentData.destinations = new Map(); + for (const [key, dest] of Object.entries(destinations)) { + const pageRef = dest[0]; + const pageData = pagesMap.get(pageRef); + if (!pageData) { + continue; + } + (pageData.pointingNamedDestinations ||= new Set()).add(key); + newDestinations.set(key, dest); + } + } + } + #findDuplicateNamedDestinations() { + const { + namedDestinations + } = this; + for (let i = 0, ii = this.oldPages.length; i < ii; i++) { + const page = this.oldPages[i]; + const { + documentData: { + destinations, + dedupNamedDestinations, + usedNamedDestinations + } + } = page; + let { + pointingNamedDestinations + } = page; + if (!pointingNamedDestinations) { + continue; + } + page.pointingNamedDestinations = pointingNamedDestinations = pointingNamedDestinations.intersection(usedNamedDestinations); + for (const pointingDest of pointingNamedDestinations) { + if (!usedNamedDestinations.has(pointingDest)) { + continue; + } + const dest = destinations.get(pointingDest).slice(); + if (!namedDestinations.has(pointingDest)) { + namedDestinations.set(pointingDest, dest); + continue; + } + const newName = `${pointingDest}_p${i + 1}`; + dedupNamedDestinations.set(pointingDest, newName); + namedDestinations.set(newName, dest); + } + } + } + #fixNamedDestinations(annotations, dedupNamedDestinations) { + if (dedupNamedDestinations.size === 0) { + return; + } + const fixDestination = (dict, key, dest) => { + if (typeof dest === "string") { + dict.set(key, dedupNamedDestinations.get(stringToPDFString(dest, true)) || dest); + } + }; + for (const annotRef of annotations) { + const annotDict = this.xref[annotRef.num]; + if (!isName(annotDict.get("Subtype"), "Link")) { + continue; + } + const action = annotDict.get("A"); + if (action instanceof Dict && action.has("D")) { + const dest = action.get("D"); + fixDestination(action, "D", dest); + continue; + } + const dest = annotDict.get("Dest"); + fixDestination(annotDict, "Dest", dest); + } + } + async #collectPageLabels() { + if (!this.hasSingleFile) { + return; + } + const { + documentData: { + document, + pageLabels + } + } = this.oldPages[0]; + if (!pageLabels) { + return; + } + const numPages = document.numPages; + const oldPageLabels = []; + const oldPageIndices = new Set(this.oldPages.map(({ + page: { + pageIndex + } + }) => pageIndex)); + let currentLabel = null; + let stFirstIndex = -1; + for (let i = 0; i < numPages; i++) { + const newLabel = pageLabels.get(i); + if (newLabel) { + currentLabel = newLabel; + stFirstIndex = currentLabel.has("St") ? i : -1; + } + if (!oldPageIndices.has(i)) { + continue; + } + if (stFirstIndex !== -1) { + const st = currentLabel.get("St"); + currentLabel = this.cloneDict(currentLabel); + currentLabel.set("St", st + (i - stFirstIndex)); + stFirstIndex = -1; + } + oldPageLabels.push(currentLabel); + } + currentLabel = oldPageLabels[0]; + let currentIndex = 0; + const newPageLabels = this.pageLabels = [[0, currentLabel]]; + for (let i = 0, ii = oldPageLabels.length; i < ii; i++) { + const label = oldPageLabels[i]; + if (label === currentLabel) { + continue; + } + currentIndex = i; + currentLabel = label; + newPageLabels.push([currentIndex, currentLabel]); + } + } + async #makePageCopy(pageIndex) { + const { + page, + documentData, + annotations, + pointingNamedDestinations + } = this.oldPages[pageIndex]; + this.currentDocument = documentData; + const { + dedupNamedDestinations, + oldRefMapping + } = documentData; + const { + xref, + rotate, + mediaBox, + resources, + ref: oldPageRef + } = page; + const pageRef = this.newRef; + const pageDict = this.xref[pageRef.num] = this.cloneDict(page.pageDict); + oldRefMapping.put(oldPageRef, pageRef); + if (pointingNamedDestinations) { + for (const pointingDest of pointingNamedDestinations) { + const name = dedupNamedDestinations.get(pointingDest) || pointingDest; + const dest = this.namedDestinations.get(name); + dest[0] = pageRef; + } + } + for (const key of ["Rotate", "MediaBox", "CropBox", "BleedBox", "TrimBox", "ArtBox", "Resources", "Annots", "Parent", "UserUnit"]) { + pageDict.delete(key); + } + const lastRef = this.newRefCount; + await this.#collectDependencies(pageDict, false, xref); + pageDict.set("Rotate", rotate); + pageDict.set("MediaBox", mediaBox); + for (const boxName of ["CropBox", "BleedBox", "TrimBox", "ArtBox"]) { + const box = page.getBoundingBox(boxName); + if (box?.some((value, index) => value !== mediaBox[index])) { + pageDict.set(boxName, box); + } + } + const userUnit = page.userUnit; + if (userUnit !== 1) { + pageDict.set("UserUnit", userUnit); + } + pageDict.setIfDict("Resources", await this.#collectDependencies(resources, true, xref)); + if (annotations) { + const newAnnotations = await this.#collectDependencies(annotations, true, xref); + this.#fixNamedDestinations(newAnnotations, dedupNamedDestinations); + pageDict.setIfArray("Annots", newAnnotations); + } + if (this.useObjectStreams) { + const newLastRef = this.newRefCount; + const pageObjectRefs = []; + for (let i = lastRef; i < newLastRef; i++) { + const obj = this.xref[i]; + if (obj instanceof BaseStream) { + continue; + } + pageObjectRefs.push(Ref.get(i, 0)); + } + for (let i = 0; i < pageObjectRefs.length; i += 0xffff) { + const objStreamRef = this.newRef; + this.objStreamRefs.add(objStreamRef.num); + this.xref[objStreamRef.num] = pageObjectRefs.slice(i, i + 0xffff); + } + } + this.currentDocument = null; + return pageRef; + } + #makePageTree() { + const { + newPages: pages, + rootDict, + pagesRef, + pagesDict + } = this; + rootDict.set("Pages", pagesRef); + pagesDict.setIfName("Type", "Pages"); + pagesDict.set("Count", pages.length); + const maxLeaves = MAX_LEAVES_PER_PAGES_NODE <= 1 ? pages.length : MAX_LEAVES_PER_PAGES_NODE; + const stack = [{ + dict: pagesDict, + kids: pages, + parentRef: pagesRef + }]; + while (stack.length > 0) { + const { + dict, + kids, + parentRef + } = stack.pop(); + if (kids.length <= maxLeaves) { + dict.set("Kids", kids); + for (const ref of kids) { + this.xref[ref.num].set("Parent", parentRef); + } + continue; + } + const chunkSize = Math.max(maxLeaves, Math.ceil(kids.length / maxLeaves)); + const kidsChunks = []; + for (let i = 0; i < kids.length; i += chunkSize) { + kidsChunks.push(kids.slice(i, i + chunkSize)); + } + const kidsRefs = []; + dict.set("Kids", kidsRefs); + for (const chunk of kidsChunks) { + const [kidRef, kidDict] = this.newDict; + kidsRefs.push(kidRef); + kidDict.setIfName("Type", "Pages"); + kidDict.set("Parent", parentRef); + kidDict.set("Count", chunk.length); + stack.push({ + dict: kidDict, + kids: chunk, + parentRef: kidRef + }); + } + } + } + #makeNameNumTree(map, areNames) { + const allEntries = map.sort(areNames ? ([keyA], [keyB]) => keyA.localeCompare(keyB) : ([keyA], [keyB]) => keyA - keyB); + const maxLeaves = MAX_IN_NAME_TREE_NODE <= 1 ? allEntries.length : MAX_IN_NAME_TREE_NODE; + const [treeRef, treeDict] = this.newDict; + const stack = [{ + dict: treeDict, + entries: allEntries + }]; + const valueType = areNames ? "Names" : "Nums"; + while (stack.length > 0) { + const { + dict, + entries + } = stack.pop(); + if (entries.length <= maxLeaves) { + dict.set("Limits", [entries[0][0], entries.at(-1)[0]]); + dict.set(valueType, entries.flat()); + continue; + } + const entriesChunks = []; + const chunkSize = Math.max(maxLeaves, Math.ceil(entries.length / maxLeaves)); + for (let i = 0; i < entries.length; i += chunkSize) { + entriesChunks.push(entries.slice(i, i + chunkSize)); + } + const entriesRefs = []; + dict.set("Kids", entriesRefs); + for (const chunk of entriesChunks) { + const [entriesRef, entriesDict] = this.newDict; + entriesRefs.push(entriesRef); + entriesDict.set("Limits", [chunk[0][0], chunk.at(-1)[0]]); + stack.push({ + dict: entriesDict, + entries: chunk + }); + } + } + return treeRef; + } + #makePageLabelsTree() { + const { + pageLabels + } = this; + if (!pageLabels || pageLabels.length === 0) { + return; + } + const { + rootDict + } = this; + const pageLabelsRef = this.#makeNameNumTree(this.pageLabels, false); + rootDict.set("PageLabels", pageLabelsRef); + } + #makeDestinationsTree() { + const { + namedDestinations + } = this; + if (namedDestinations.size === 0) { + return; + } + if (!this.namesDict) { + [this.namesRef, this.namesDict] = this.newDict; + this.rootDict.set("Names", this.namesRef); + } + this.namesDict.set("Dests", this.#makeNameNumTree(Array.from(namedDestinations.entries()), true)); + } + #makeStructTree() { + const { + structTreeKids + } = this; + if (!structTreeKids || structTreeKids.length === 0) { + return; + } + const { + rootDict + } = this; + const structTreeRef = this.newRef; + const structTree = this.xref[structTreeRef.num] = new Dict(); + structTree.setIfName("Type", "StructTreeRoot"); + structTree.setIfArray("K", structTreeKids); + for (const kidRef of structTreeKids) { + const kid = this.xref[kidRef.num]; + const type = kid.get("Type"); + if (!type || isName(type, "StructElem")) { + kid.set("P", structTreeRef); + } + } + if (this.parentTree.size > 0) { + const parentTreeRef = this.#makeNameNumTree(Array.from(this.parentTree.entries()), false); + const parentTree = this.xref[parentTreeRef.num]; + parentTree.setIfName("Type", "ParentTree"); + structTree.set("ParentTree", parentTreeRef); + structTree.set("ParentTreeNextKey", this.parentTree.size); + } + if (this.idTree.size > 0) { + const idTreeRef = this.#makeNameNumTree(Array.from(this.idTree.entries()), true); + const idTree = this.xref[idTreeRef.num]; + idTree.setIfName("Type", "IDTree"); + structTree.set("IDTree", idTreeRef); + } + if (this.classMap.size > 0) { + const classMapRef = this.newRef; + this.xref[classMapRef.num] = this.classMap; + structTree.set("ClassMap", classMapRef); + } + if (this.roleMap.size > 0) { + const roleMapRef = this.newRef; + this.xref[roleMapRef.num] = this.roleMap; + structTree.set("RoleMap", roleMapRef); + } + if (this.namespaces.size > 0) { + const namespacesRef = this.newRef; + this.xref[namespacesRef.num] = Array.from(this.namespaces.values()); + structTree.set("Namespaces", namespacesRef); + } + if (this.structTreeAF.length > 0) { + const structTreeAFRef = this.newRef; + this.xref[structTreeAFRef.num] = this.structTreeAF; + structTree.set("AF", structTreeAFRef); + } + if (this.structTreePronunciationLexicon.length > 0) { + const structTreePronunciationLexiconRef = this.newRef; + this.xref[structTreePronunciationLexiconRef.num] = this.structTreePronunciationLexicon; + structTree.set("PronunciationLexicon", structTreePronunciationLexiconRef); + } + rootDict.set("StructTreeRoot", structTreeRef); + } + async #makeRoot() { + const { + rootDict + } = this; + rootDict.setIfName("Type", "Catalog"); + rootDict.setIfName("Version", this.version); + this.#makePageTree(); + this.#makePageLabelsTree(); + this.#makeDestinationsTree(); + this.#makeStructTree(); + } + #makeInfo() { + const infoMap = new Map(); + if (this.hasSingleFile) { + const { + xref: { + trailer + } + } = this.oldPages[0].documentData.document; + const oldInfoDict = trailer.get("Info"); + for (const [key, value] of oldInfoDict || []) { + if (typeof value === "string") { + infoMap.set(key, stringToPDFString(value)); + } + } + } + infoMap.delete("ModDate"); + infoMap.set("CreationDate", getModificationDate()); + infoMap.set("Creator", "PDF.js"); + infoMap.set("Producer", "Firefox"); + if (this.author) { + infoMap.set("Author", this.author); + } + if (this.title) { + infoMap.set("Title", this.title); + } + for (const [key, value] of infoMap) { + this.infoDict.set(key, stringToAsciiOrUTF16BE(value)); + } + return infoMap; + } + async #makeEncrypt() { + if (!this.hasSingleFile) { + return [null, null, null]; + } + const { + documentData + } = this.oldPages[0]; + const { + document: { + xref: { + trailer, + encrypt + } + } + } = documentData; + if (!trailer.has("Encrypt")) { + return [null, null, null]; + } + const encryptDict = trailer.get("Encrypt"); + if (!(encryptDict instanceof Dict)) { + return [null, null, null]; + } + this.currentDocument = documentData; + const result = [await this.#cloneObject(encryptDict, trailer.xref), encrypt, trailer.get("ID")]; + this.currentDocument = null; + return result; + } + async #createChanges() { + const changes = new RefSetCache(); + changes.put(Ref.get(0, 0xffff), { + data: null + }); + for (let i = 1, ii = this.xref.length; i < ii; i++) { + if (this.objStreamRefs?.has(i)) { + await this.#createObjectStream(Ref.get(i, 0), this.xref[i], changes); + } else { + changes.put(Ref.get(i, 0), { + data: this.xref[i] + }); + } + } + return [changes, this.newRef]; + } + async #createObjectStream(objStreamRef, objRefs, changes) { + const streamBuffer = [""]; + const objOffsets = []; + let offset = 0; + const buffer = []; + for (let i = 0, ii = objRefs.length; i < ii; i++) { + const objRef = objRefs[i]; + changes.put(objRef, { + data: null, + objStreamRef, + index: i + }); + objOffsets.push(`${objRef.num} ${offset}`); + const data = this.xref[objRef.num]; + await writeValue(data, buffer, null); + const obj = buffer.join(""); + buffer.length = 0; + streamBuffer.push(obj); + offset += obj.length + 1; + } + streamBuffer[0] = objOffsets.join("\n"); + const objStream = new StringStream(streamBuffer.join("\n")); + const objStreamDict = objStream.dict = new Dict(); + objStreamDict.setIfName("Type", "ObjStm"); + objStreamDict.set("N", objRefs.length); + objStreamDict.set("First", streamBuffer[0].length + 1); + changes.put(objStreamRef, { + data: objStream + }); + } + async writePDF() { + await this.#makeRoot(); + const infoMap = this.#makeInfo(); + const [encryptRef, encrypt, fileIds] = await this.#makeEncrypt(); + const [changes, xrefTableRef] = await this.#createChanges(); + const header = [...`%PDF-${this.version}\n%`.split("").map(c => c.charCodeAt(0)), 0xfa, 0xde, 0xfa, 0xce]; + return incrementalUpdate({ + originalData: new Uint8Array(header), + changes, + xrefInfo: { + startXRef: null, + rootRef: this.rootRef, + infoRef: this.infoRef, + encryptRef, + newRef: xrefTableRef, + fileIds: fileIds || [null, null], + infoMap + }, + useXrefStream: this.useObjectStreams, + xref: { + encrypt, + encryptRef + } + }); + } +} + +;// ./src/core/worker_stream.js + +class PDFWorkerStream { + constructor(msgHandler) { + this._msgHandler = msgHandler; + this._contentLength = null; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + getFullReader() { + assert(!this._fullRequestReader, "PDFWorkerStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler); + return this._fullRequestReader; + } + getRangeReader(begin, end) { + const reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler); + this._rangeRequestReaders.push(reader); + return reader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } +} +class PDFWorkerStreamReader { + constructor(msgHandler) { + this._msgHandler = msgHandler; + this.onProgress = null; + this._contentLength = null; + this._isRangeSupported = false; + this._isStreamingSupported = false; + const readableStream = this._msgHandler.sendWithStream("GetReader"); + this._reader = readableStream.getReader(); + this._headersReady = this._msgHandler.sendWithPromise("ReaderHeadersReady").then(data => { + this._isStreamingSupported = data.isStreamingSupported; + this._isRangeSupported = data.isRangeSupported; + this._contentLength = data.contentLength; + }); + } + get headersReady() { + return this._headersReady; + } + get contentLength() { + return this._contentLength; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + get isRangeSupported() { + return this._isRangeSupported; + } + async read() { + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value: undefined, + done: true + }; + } + return { + value: value.buffer, + done: false + }; + } + cancel(reason) { + this._reader.cancel(reason); + } +} +class PDFWorkerStreamRangeReader { + constructor(begin, end, msgHandler) { + this._msgHandler = msgHandler; + this.onProgress = null; + const readableStream = this._msgHandler.sendWithStream("GetRangeReader", { + begin, + end + }); + this._reader = readableStream.getReader(); + } + get isStreamingSupported() { + return false; + } + async read() { + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value: undefined, + done: true + }; + } + return { + value: value.buffer, + done: false + }; + } + cancel(reason) { + this._reader.cancel(reason); + } +} + +;// ./src/core/worker.js + + + + + + + + + + + +class WorkerTask { + constructor(name) { + this.name = name; + this.terminated = false; + this._capability = Promise.withResolvers(); + } + get finished() { + return this._capability.promise; + } + finish() { + this._capability.resolve(); + } + terminate() { + this.terminated = true; + } + ensureNotTerminated() { + if (this.terminated) { + throw new Error("Worker task was terminated"); + } + } +} +class WorkerMessageHandler { + static { + if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" && typeof self.postMessage === "function" && "onmessage" in self) { + this.initializeFromPort(self); + } + } + static setup(handler, port) { + let testMessageProcessed = false; + handler.on("test", data => { + if (testMessageProcessed) { + return; + } + testMessageProcessed = true; + handler.send("test", data instanceof Uint8Array); + }); + handler.on("configure", data => { + setVerbosityLevel(data.verbosity); + }); + handler.on("GetDocRequest", data => this.createDocumentHandler(data, port)); + } + static createDocumentHandler(docParams, port) { + let pdfManager; + let terminated = false; + let cancelXHRs = null; + const WorkerTasks = new Set(); + const verbosity = getVerbosityLevel(); + const { + docId, + apiVersion + } = docParams; + const workerVersion = "5.4.445"; + if (apiVersion !== workerVersion) { + throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); + } + const workerHandlerName = docId + "_worker"; + let handler = new MessageHandler(workerHandlerName, docId, port); + function ensureNotTerminated() { + if (terminated) { + throw new Error("Worker was terminated"); + } + } + function startWorkerTask(task) { + WorkerTasks.add(task); + } + function finishWorkerTask(task) { + task.finish(); + WorkerTasks.delete(task); + } + async function loadDocument(recoveryMode) { + await pdfManager.ensureDoc("checkHeader"); + await pdfManager.ensureDoc("parseStartXRef"); + await pdfManager.ensureDoc("parse", [recoveryMode]); + await pdfManager.ensureDoc("checkFirstPage", [recoveryMode]); + await pdfManager.ensureDoc("checkLastPage", [recoveryMode]); + const isPureXfa = await pdfManager.ensureDoc("isPureXfa"); + if (isPureXfa) { + const task = new WorkerTask("loadXfaResources"); + startWorkerTask(task); + await pdfManager.ensureDoc("loadXfaResources", [handler, task]); + finishWorkerTask(task); + } + const [numPages, fingerprints] = await Promise.all([pdfManager.ensureDoc("numPages"), pdfManager.ensureDoc("fingerprints")]); + const htmlForXfa = isPureXfa ? await pdfManager.ensureDoc("htmlForXfa") : null; + return { + numPages, + fingerprints, + htmlForXfa + }; + } + async function getPdfManager({ + data, + password, + disableAutoFetch, + rangeChunkSize, + length, + docBaseUrl, + enableXfa, + evaluatorOptions + }) { + const pdfManagerArgs = { + source: null, + disableAutoFetch, + docBaseUrl, + docId, + enableXfa, + evaluatorOptions, + handler, + length, + password, + rangeChunkSize + }; + if (data) { + pdfManagerArgs.source = data; + return new LocalPdfManager(pdfManagerArgs); + } + const pdfStream = new PDFWorkerStream(handler), + fullRequest = pdfStream.getFullReader(); + const pdfManagerCapability = Promise.withResolvers(); + let newPdfManager, + cachedChunks = [], + loaded = 0; + fullRequest.headersReady.then(function () { + if (!fullRequest.isRangeSupported) { + return; + } + pdfManagerArgs.source = pdfStream; + pdfManagerArgs.length = fullRequest.contentLength; + pdfManagerArgs.disableAutoFetch ||= fullRequest.isStreamingSupported; + newPdfManager = new NetworkPdfManager(pdfManagerArgs); + for (const chunk of cachedChunks) { + newPdfManager.sendProgressiveData(chunk); + } + cachedChunks = []; + pdfManagerCapability.resolve(newPdfManager); + cancelXHRs = null; + }).catch(function (reason) { + pdfManagerCapability.reject(reason); + cancelXHRs = null; + }); + new Promise(function (resolve, reject) { + const readChunk = function ({ + value, + done + }) { + try { + ensureNotTerminated(); + if (done) { + if (!newPdfManager) { + const pdfFile = arrayBuffersToBytes(cachedChunks); + cachedChunks = []; + if (length && pdfFile.length !== length) { + warn("reported HTTP length is different from actual"); + } + pdfManagerArgs.source = pdfFile; + newPdfManager = new LocalPdfManager(pdfManagerArgs); + pdfManagerCapability.resolve(newPdfManager); + } + cancelXHRs = null; + return; + } + loaded += value.byteLength; + if (!fullRequest.isStreamingSupported) { + handler.send("DocProgress", { + loaded, + total: Math.max(loaded, fullRequest.contentLength || 0) + }); + } + if (newPdfManager) { + newPdfManager.sendProgressiveData(value); + } else { + cachedChunks.push(value); + } + fullRequest.read().then(readChunk, reject); + } catch (e) { + reject(e); + } + }; + fullRequest.read().then(readChunk, reject); + }).catch(function (e) { + pdfManagerCapability.reject(e); + cancelXHRs = null; + }); + cancelXHRs = reason => { + pdfStream.cancelAllRequests(reason); + }; + return pdfManagerCapability.promise; + } + function setupDoc(data) { + function onSuccess(doc) { + ensureNotTerminated(); + handler.send("GetDoc", { + pdfInfo: doc + }); + } + function onFailure(ex) { + ensureNotTerminated(); + if (ex instanceof PasswordException) { + const task = new WorkerTask(`PasswordException: response ${ex.code}`); + startWorkerTask(task); + handler.sendWithPromise("PasswordRequest", ex).then(function ({ + password + }) { + finishWorkerTask(task); + pdfManager.updatePassword(password); + pdfManagerReady(); + }).catch(function () { + finishWorkerTask(task); + handler.send("DocException", ex); + }); + } else { + handler.send("DocException", wrapReason(ex)); + } + } + function pdfManagerReady() { + ensureNotTerminated(); + loadDocument(false).then(onSuccess, function (reason) { + ensureNotTerminated(); + if (!(reason instanceof XRefParseException)) { + onFailure(reason); + return; + } + pdfManager.requestLoadedStream().then(function () { + ensureNotTerminated(); + loadDocument(true).then(onSuccess, onFailure); + }); + }); + } + ensureNotTerminated(); + getPdfManager(data).then(function (newPdfManager) { + if (terminated) { + newPdfManager.terminate(new AbortException("Worker was terminated.")); + throw new Error("Worker was terminated"); + } + pdfManager = newPdfManager; + pdfManager.requestLoadedStream(true).then(stream => { + handler.send("DataLoaded", { + length: stream.bytes.byteLength + }); + }); + }).then(pdfManagerReady, onFailure); + } + handler.on("GetPage", function (data) { + return pdfManager.getPage(data.pageIndex).then(function (page) { + return Promise.all([pdfManager.ensure(page, "rotate"), pdfManager.ensure(page, "ref"), pdfManager.ensure(page, "userUnit"), pdfManager.ensure(page, "view")]).then(function ([rotate, ref, userUnit, view]) { + return { + rotate, + ref, + refStr: ref?.toString() ?? null, + userUnit, + view + }; + }); + }); + }); + handler.on("GetPageIndex", function (data) { + const pageRef = Ref.get(data.num, data.gen); + return pdfManager.ensureCatalog("getPageIndex", [pageRef]); + }); + handler.on("GetDestinations", function (data) { + return pdfManager.ensureCatalog("destinations"); + }); + handler.on("GetDestination", function (data) { + return pdfManager.ensureCatalog("getDestination", [data.id]); + }); + handler.on("GetPageLabels", function (data) { + return pdfManager.ensureCatalog("pageLabels"); + }); + handler.on("GetPageLayout", function (data) { + return pdfManager.ensureCatalog("pageLayout"); + }); + handler.on("GetPageMode", function (data) { + return pdfManager.ensureCatalog("pageMode"); + }); + handler.on("GetViewerPreferences", function (data) { + return pdfManager.ensureCatalog("viewerPreferences"); + }); + handler.on("GetOpenAction", function (data) { + return pdfManager.ensureCatalog("openAction"); + }); + handler.on("GetAttachments", function (data) { + return pdfManager.ensureCatalog("attachments"); + }); + handler.on("GetDocJSActions", function (data) { + return pdfManager.ensureCatalog("jsActions"); + }); + handler.on("GetPageJSActions", function ({ + pageIndex + }) { + return pdfManager.getPage(pageIndex).then(page => pdfManager.ensure(page, "jsActions")); + }); + handler.on("GetAnnotationsByType", async function ({ + types, + pageIndexesToSkip + }) { + const [numPages, annotationGlobals] = await Promise.all([pdfManager.ensureDoc("numPages"), pdfManager.ensureDoc("annotationGlobals")]); + if (!annotationGlobals) { + return null; + } + const pagePromises = []; + const annotationPromises = []; + let task = null; + try { + for (let i = 0, ii = numPages; i < ii; i++) { + if (pageIndexesToSkip?.has(i)) { + continue; + } + if (!task) { + task = new WorkerTask("GetAnnotationsByType"); + startWorkerTask(task); + } + pagePromises.push(pdfManager.getPage(i).then(async page => { + if (!page) { + return []; + } + return page.collectAnnotationsByType(handler, task, types, annotationPromises, annotationGlobals) || []; + })); + } + await Promise.all(pagePromises); + const annotations = await Promise.all(annotationPromises); + return annotations.filter(a => !!a); + } finally { + if (task) { + finishWorkerTask(task); + } + } + }); + handler.on("GetOutline", function (data) { + return pdfManager.ensureCatalog("documentOutline"); + }); + handler.on("GetOptionalContentConfig", function (data) { + return pdfManager.ensureCatalog("optionalContentConfig"); + }); + handler.on("GetPermissions", function (data) { + return pdfManager.ensureCatalog("permissions"); + }); + handler.on("GetMetadata", function (data) { + return Promise.all([pdfManager.ensureDoc("documentInfo"), pdfManager.ensureCatalog("metadata"), pdfManager.ensureCatalog("hasStructTree")]); + }); + handler.on("GetMarkInfo", function (data) { + return pdfManager.ensureCatalog("markInfo"); + }); + handler.on("GetData", function (data) { + return pdfManager.requestLoadedStream().then(stream => stream.bytes); + }); + handler.on("GetAnnotations", function ({ + pageIndex, + intent + }) { + return pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`GetAnnotations: page ${pageIndex}`); + startWorkerTask(task); + return page.getAnnotationsData(handler, task, intent).then(data => { + finishWorkerTask(task); + return data; + }, reason => { + finishWorkerTask(task); + throw reason; + }); + }); + }); + handler.on("GetFieldObjects", function (data) { + return pdfManager.ensureDoc("fieldObjects").then(fieldObjects => fieldObjects?.allFields || null); + }); + handler.on("HasJSActions", function (data) { + return pdfManager.ensureDoc("hasJSActions"); + }); + handler.on("GetCalculationOrderIds", function (data) { + return pdfManager.ensureDoc("calculationOrderIds"); + }); + handler.on("ExtractPages", async function ({ + pageInfos + }) { + if (!pageInfos) { + warn("extractPages: nothing to extract."); + return null; + } + if (!Array.isArray(pageInfos)) { + pageInfos = [pageInfos]; + } + let newDocumentId = 0; + for (const pageInfo of pageInfos) { + if (pageInfo.document === null) { + pageInfo.document = pdfManager.pdfDocument; + } else if (ArrayBuffer.isView(pageInfo.document)) { + const manager = new LocalPdfManager({ + source: pageInfo.document, + docId: `${docId}_extractPages_${newDocumentId++}`, + handler, + password: pageInfo.password ?? null, + evaluatorOptions: Object.assign({}, pdfManager.evaluatorOptions) + }); + let recoveryMode = false; + let isValid = true; + while (true) { + try { + await manager.requestLoadedStream(); + await manager.ensureDoc("checkHeader"); + await manager.ensureDoc("parseStartXRef"); + await manager.ensureDoc("parse", [recoveryMode]); + break; + } catch (e) { + if (e instanceof XRefParseException) { + if (recoveryMode === false) { + recoveryMode = true; + continue; + } else { + isValid = false; + warn("extractPages: XRefParseException."); + } + } else if (e instanceof PasswordException) { + const task = new WorkerTask(`PasswordException: response ${e.code}`); + startWorkerTask(task); + try { + const { + password + } = await handler.sendWithPromise("PasswordRequest", e); + manager.updatePassword(password); + } catch { + isValid = false; + warn("extractPages: invalid password."); + } finally { + finishWorkerTask(task); + } + } else { + isValid = false; + warn("extractPages: invalid document."); + } + if (!isValid) { + break; + } + } + } + if (!isValid) { + pageInfo.document = null; + } + const isPureXfa = await manager.ensureDoc("isPureXfa"); + if (isPureXfa) { + pageInfo.document = null; + warn("extractPages does not support pure XFA documents."); + } else { + pageInfo.document = manager.pdfDocument; + } + } else { + warn("extractPages: invalid document."); + } + } + try { + const pdfEditor = new PDFEditor(); + const buffer = await pdfEditor.extractPages(pageInfos); + return buffer; + } catch (reason) { + console.error(reason); + return null; + } + }); + handler.on("SaveDocument", async function ({ + isPureXfa, + numPages, + annotationStorage, + filename + }) { + const globalPromises = [pdfManager.requestLoadedStream(), pdfManager.ensureCatalog("acroForm"), pdfManager.ensureCatalog("acroFormRef"), pdfManager.ensureDoc("startXRef"), pdfManager.ensureDoc("xref"), pdfManager.ensureCatalog("structTreeRoot")]; + const changes = new RefSetCache(); + const promises = []; + const newAnnotationsByPage = !isPureXfa ? getNewAnnotationsMap(annotationStorage) : null; + const [stream, acroForm, acroFormRef, startXRef, xref, _structTreeRoot] = await Promise.all(globalPromises); + const catalogRef = xref.trailer.getRaw("Root") || null; + let structTreeRoot; + if (newAnnotationsByPage) { + if (!_structTreeRoot) { + if (await StructTreeRoot.canCreateStructureTree({ + catalogRef, + pdfManager, + newAnnotationsByPage + })) { + structTreeRoot = null; + } + } else if (await _structTreeRoot.canUpdateStructTree({ + pdfManager, + newAnnotationsByPage + })) { + structTreeRoot = _structTreeRoot; + } + const imagePromises = AnnotationFactory.generateImages(annotationStorage.values(), xref, pdfManager.evaluatorOptions.isOffscreenCanvasSupported); + const newAnnotationPromises = structTreeRoot === undefined ? promises : []; + for (const [pageIndex, annotations] of newAnnotationsByPage) { + newAnnotationPromises.push(pdfManager.getPage(pageIndex).then(page => { + const task = new WorkerTask(`Save (editor): page ${pageIndex}`); + startWorkerTask(task); + return page.saveNewAnnotations(handler, task, annotations, imagePromises, changes).finally(function () { + finishWorkerTask(task); + }); + })); + } + if (structTreeRoot === null) { + promises.push(Promise.all(newAnnotationPromises).then(async () => { + await StructTreeRoot.createStructureTree({ + newAnnotationsByPage, + xref, + catalogRef, + pdfManager, + changes + }); + })); + } else if (structTreeRoot) { + promises.push(Promise.all(newAnnotationPromises).then(async () => { + await structTreeRoot.updateStructureTree({ + newAnnotationsByPage, + pdfManager, + changes + }); + })); + } + } + if (isPureXfa) { + promises.push(pdfManager.ensureDoc("serializeXfaData", [annotationStorage])); + } else { + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + promises.push(pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`Save: page ${pageIndex}`); + startWorkerTask(task); + return page.save(handler, task, annotationStorage, changes).finally(function () { + finishWorkerTask(task); + }); + })); + } + } + const refs = await Promise.all(promises); + let xfaData = null; + if (isPureXfa) { + xfaData = refs[0]; + if (!xfaData) { + return stream.bytes; + } + } else if (changes.size === 0) { + return stream.bytes; + } + const needAppearances = acroFormRef && acroForm instanceof Dict && changes.values().some(ref => ref.needAppearances); + const xfa = acroForm instanceof Dict && acroForm.get("XFA") || null; + let xfaDatasetsRef = null; + let hasXfaDatasetsEntry = false; + if (Array.isArray(xfa)) { + for (let i = 0, ii = xfa.length; i < ii; i += 2) { + if (xfa[i] === "datasets") { + xfaDatasetsRef = xfa[i + 1]; + hasXfaDatasetsEntry = true; + } + } + if (xfaDatasetsRef === null) { + xfaDatasetsRef = xref.getNewTemporaryRef(); + } + } else if (xfa) { + warn("Unsupported XFA type."); + } + let newXrefInfo = Object.create(null); + if (xref.trailer) { + const infoMap = new Map(); + const xrefInfo = xref.trailer.get("Info") || null; + if (xrefInfo instanceof Dict) { + for (const [key, value] of xrefInfo) { + if (typeof value === "string") { + infoMap.set(key, stringToPDFString(value)); + } + } + } + newXrefInfo = { + rootRef: catalogRef, + encryptRef: xref.trailer.getRaw("Encrypt") || null, + newRef: xref.getNewTemporaryRef(), + infoRef: xref.trailer.getRaw("Info") || null, + infoMap, + fileIds: xref.trailer.get("ID") || null, + startXRef, + filename + }; + } + return incrementalUpdate({ + originalData: stream.bytes, + xrefInfo: newXrefInfo, + changes, + xref, + hasXfa: !!xfa, + xfaDatasetsRef, + hasXfaDatasetsEntry, + needAppearances, + acroFormRef, + acroForm, + xfaData, + useXrefStream: isDict(xref.topDict, "XRef") + }).finally(() => { + xref.resetNewTemporaryRef(); + }); + }); + handler.on("GetOperatorList", function (data, sink) { + const pageIndex = data.pageIndex; + pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`GetOperatorList: page ${pageIndex}`); + startWorkerTask(task); + const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; + page.getOperatorList({ + handler, + sink, + task, + intent: data.intent, + cacheKey: data.cacheKey, + annotationStorage: data.annotationStorage, + modifiedIds: data.modifiedIds + }).then(function (operatorListInfo) { + finishWorkerTask(task); + if (start) { + info(`page=${pageIndex + 1} - getOperatorList: time=` + `${Date.now() - start}ms, len=${operatorListInfo.length}`); + } + sink.close(); + }, function (reason) { + finishWorkerTask(task); + if (task.terminated) { + return; + } + sink.error(reason); + }); + }); + }); + handler.on("GetTextContent", function (data, sink) { + const { + pageIndex, + includeMarkedContent, + disableNormalization + } = data; + pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask("GetTextContent: page " + pageIndex); + startWorkerTask(task); + const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; + page.extractTextContent({ + handler, + task, + sink, + includeMarkedContent, + disableNormalization + }).then(function () { + finishWorkerTask(task); + if (start) { + info(`page=${pageIndex + 1} - getTextContent: time=` + `${Date.now() - start}ms`); + } + sink.close(); + }, function (reason) { + finishWorkerTask(task); + if (task.terminated) { + return; + } + sink.error(reason); + }); + }); + }); + handler.on("GetStructTree", function (data) { + return pdfManager.getPage(data.pageIndex).then(page => pdfManager.ensure(page, "getStructTree")); + }); + handler.on("FontFallback", function (data) { + return pdfManager.fontFallback(data.id, handler); + }); + handler.on("Cleanup", function (data) { + return pdfManager.cleanup(true); + }); + handler.on("Terminate", function (data) { + terminated = true; + const waitOn = []; + if (pdfManager) { + pdfManager.terminate(new AbortException("Worker was terminated.")); + const cleanupPromise = pdfManager.cleanup(); + waitOn.push(cleanupPromise); + pdfManager = null; + } else { + clearGlobalCaches(); + } + cancelXHRs?.(new AbortException("Worker was terminated.")); + for (const task of WorkerTasks) { + waitOn.push(task.finished); + task.terminate(); + } + return Promise.all(waitOn).then(function () { + handler.destroy(); + handler = null; + }); + }); + handler.on("Ready", function (data) { + setupDoc(docParams); + docParams = null; + }); + return workerHandlerName; + } + static initializeFromPort(port) { + const handler = new MessageHandler("worker", "main", port); + this.setup(handler, port); + handler.send("ready", null); + } +} + +;// ./src/pdf.worker.js + +globalThis.pdfjsWorker = { + WorkerMessageHandler: WorkerMessageHandler +}; + +export { WorkerMessageHandler }; diff --git a/popover-fn.js b/popover-fn.js new file mode 100644 index 0000000..d0f5335 --- /dev/null +++ b/popover-fn.js @@ -0,0 +1,673 @@ +// src/events.ts +var ToggleEvent = class extends Event { + oldState; + newState; + constructor(type, { oldState = "", newState = "", ...init } = {}) { + super(type, init); + this.oldState = String(oldState || ""); + this.newState = String(newState || ""); + } +}; +var popoverToggleTaskQueue = /* @__PURE__ */ new WeakMap(); +function queuePopoverToggleEventTask(element, oldState, newState) { + popoverToggleTaskQueue.set( + element, + setTimeout(() => { + if (!popoverToggleTaskQueue.has(element)) return; + element.dispatchEvent( + new ToggleEvent("toggle", { + cancelable: false, + oldState, + newState + }) + ); + }, 0) + ); +} + +// src/popover-helpers.ts +var ShadowRoot = globalThis.ShadowRoot || function() { +}; +var HTMLDialogElement = globalThis.HTMLDialogElement || function() { +}; +var topLayerElements = /* @__PURE__ */ new WeakMap(); +var autoPopoverList = /* @__PURE__ */ new WeakMap(); +var visibilityState = /* @__PURE__ */ new WeakMap(); +function getPopoverVisibilityState(popover) { + return visibilityState.get(popover) || "hidden"; +} +var popoverInvoker = /* @__PURE__ */ new WeakMap(); +function popoverTargetAttributeActivationBehavior(element) { + const popover = element.popoverTargetElement; + if (!(popover instanceof HTMLElement)) { + return; + } + const visibility = getPopoverVisibilityState(popover); + if (element.popoverTargetAction === "show" && visibility === "showing") { + return; + } + if (element.popoverTargetAction === "hide" && visibility === "hidden") return; + if (visibility === "showing") { + hidePopover(popover, true, true); + } else if (checkPopoverValidity(popover, false)) { + popoverInvoker.set(popover, element); + showPopover(popover); + } +} +function checkPopoverValidity(element, expectedToBeShowing) { + if (element.popover !== "auto" && element.popover !== "manual") { + return false; + } + if (!element.isConnected) return false; + if (expectedToBeShowing && getPopoverVisibilityState(element) !== "showing") { + return false; + } + if (!expectedToBeShowing && getPopoverVisibilityState(element) !== "hidden") { + return false; + } + if (element instanceof HTMLDialogElement && element.hasAttribute("open")) { + return false; + } + if (document.fullscreenElement === element) return false; + return true; +} +function getStackPosition(popover) { + if (!popover) return 0; + return Array.from(autoPopoverList.get(popover.ownerDocument) || []).indexOf( + popover + ) + 1; +} +function topMostClickedPopover(target) { + const clickedPopover = nearestInclusiveOpenPopover(target); + const invokerPopover = nearestInclusiveTargetPopoverForInvoker(target); + if (getStackPosition(clickedPopover) > getStackPosition(invokerPopover)) { + return clickedPopover; + } + return invokerPopover; +} +function topMostAutoPopover(document2) { + const documentPopovers = autoPopoverList.get(document2); + for (const popover of documentPopovers || []) { + if (!popover.isConnected) { + documentPopovers.delete(popover); + } else { + return popover; + } + } + return null; +} +function getRootNode(node) { + if (typeof node.getRootNode === "function") { + return node.getRootNode(); + } + if (node.parentNode) return getRootNode(node.parentNode); + return node; +} +function nearestInclusiveOpenPopover(node) { + while (node) { + if (node instanceof HTMLElement && node.popover === "auto" && visibilityState.get(node) === "showing") { + return node; + } + node = node instanceof Element && node.assignedSlot || node.parentElement || getRootNode(node); + if (node instanceof ShadowRoot) node = node.host; + if (node instanceof Document) return; + } +} +function nearestInclusiveTargetPopoverForInvoker(node) { + while (node) { + const nodePopover = node.popoverTargetElement; + if (nodePopover instanceof HTMLElement) return nodePopover; + node = node.parentElement || getRootNode(node); + if (node instanceof ShadowRoot) node = node.host; + if (node instanceof Document) return; + } +} +function topMostPopoverAncestor(newPopover) { + const popoverPositions = /* @__PURE__ */ new Map(); + let i = 0; + for (const popover of autoPopoverList.get(newPopover.ownerDocument) || []) { + popoverPositions.set(popover, i); + i += 1; + } + popoverPositions.set(newPopover, i); + i += 1; + let topMostPopoverAncestor2 = null; + function checkAncestor(candidate) { + const candidateAncestor = nearestInclusiveOpenPopover(candidate); + if (candidateAncestor === null) return null; + const candidatePosition = popoverPositions.get(candidateAncestor); + if (topMostPopoverAncestor2 === null || popoverPositions.get(topMostPopoverAncestor2) < candidatePosition) { + topMostPopoverAncestor2 = candidateAncestor; + } + } + checkAncestor(newPopover.parentElement || getRootNode(newPopover)); + return topMostPopoverAncestor2; +} +function isFocusable(focusTarget) { + if (focusTarget.hidden || focusTarget instanceof ShadowRoot) return false; + if (focusTarget instanceof HTMLButtonElement || focusTarget instanceof HTMLInputElement || focusTarget instanceof HTMLSelectElement || focusTarget instanceof HTMLTextAreaElement || focusTarget instanceof HTMLOptGroupElement || focusTarget instanceof HTMLOptionElement || focusTarget instanceof HTMLFieldSetElement) { + if (focusTarget.disabled) return false; + } + if (focusTarget instanceof HTMLInputElement && focusTarget.type === "hidden") { + return false; + } + if (focusTarget instanceof HTMLAnchorElement && focusTarget.href === "") { + return false; + } + return typeof focusTarget.tabIndex === "number" && focusTarget.tabIndex !== -1; +} +function focusDelegate(focusTarget) { + if (focusTarget.shadowRoot && focusTarget.shadowRoot.delegatesFocus !== true) { + return null; + } + let whereToLook = focusTarget; + if (whereToLook.shadowRoot) { + whereToLook = whereToLook.shadowRoot; + } + let autoFocusDelegate = whereToLook.querySelector("[autofocus]"); + if (autoFocusDelegate) { + return autoFocusDelegate; + } else { + const slots = whereToLook.querySelectorAll("slot"); + for (const slot of slots) { + const assignedElements = slot.assignedElements({ flatten: true }); + for (const el of assignedElements) { + if (el.hasAttribute("autofocus")) { + return el; + } else { + autoFocusDelegate = el.querySelector("[autofocus]"); + if (autoFocusDelegate) { + return autoFocusDelegate; + } + } + } + } + } + const walker = focusTarget.ownerDocument.createTreeWalker( + whereToLook, + NodeFilter.SHOW_ELEMENT + ); + let descendant = walker.currentNode; + while (descendant) { + if (isFocusable(descendant)) { + return descendant; + } + descendant = walker.nextNode(); + } +} +function popoverFocusingSteps(subject) { + focusDelegate(subject)?.focus(); +} +var previouslyFocusedElements = /* @__PURE__ */ new WeakMap(); +function showPopover(element) { + if (!checkPopoverValidity(element, false)) { + return; + } + const document2 = element.ownerDocument; + if (!element.dispatchEvent( + new ToggleEvent("beforetoggle", { + cancelable: true, + oldState: "closed", + newState: "open" + }) + )) { + return; + } + if (!checkPopoverValidity(element, false)) { + return; + } + let shouldRestoreFocus = false; + if (element.popover === "auto") { + const originalType = element.getAttribute("popover"); + const ancestor = topMostPopoverAncestor(element) || document2; + hideAllPopoversUntil(ancestor, false, true); + if (originalType !== element.getAttribute("popover") || !checkPopoverValidity(element, false)) { + return; + } + } + if (!topMostAutoPopover(document2)) { + shouldRestoreFocus = true; + } + previouslyFocusedElements.delete(element); + const originallyFocusedElement = document2.activeElement; + element.classList.add(":popover-open"); + visibilityState.set(element, "showing"); + if (!topLayerElements.has(document2)) { + topLayerElements.set(document2, /* @__PURE__ */ new Set()); + } + topLayerElements.get(document2).add(element); + popoverFocusingSteps(element); + if (element.popover === "auto") { + if (!autoPopoverList.has(document2)) { + autoPopoverList.set(document2, /* @__PURE__ */ new Set()); + } + autoPopoverList.get(document2).add(element); + setInvokerAriaExpanded(popoverInvoker.get(element), true); + } + if (shouldRestoreFocus && originallyFocusedElement && element.popover === "auto") { + previouslyFocusedElements.set(element, originallyFocusedElement); + } + queuePopoverToggleEventTask(element, "closed", "open"); +} +function hidePopover(element, focusPreviousElement = false, fireEvents = false) { + if (!checkPopoverValidity(element, true)) { + return; + } + const document2 = element.ownerDocument; + if (element.popover === "auto") { + hideAllPopoversUntil(element, focusPreviousElement, fireEvents); + if (!checkPopoverValidity(element, true)) { + return; + } + } + setInvokerAriaExpanded(popoverInvoker.get(element), false); + popoverInvoker.delete(element); + if (fireEvents) { + element.dispatchEvent( + new ToggleEvent("beforetoggle", { + oldState: "open", + newState: "closed" + }) + ); + if (!checkPopoverValidity(element, true)) { + return; + } + } + topLayerElements.get(document2)?.delete(element); + autoPopoverList.get(document2)?.delete(element); + element.classList.remove(":popover-open"); + visibilityState.set(element, "hidden"); + if (fireEvents) { + queuePopoverToggleEventTask(element, "open", "closed"); + } + const previouslyFocusedElement = previouslyFocusedElements.get(element); + if (previouslyFocusedElement) { + previouslyFocusedElements.delete(element); + if (focusPreviousElement) { + previouslyFocusedElement.focus(); + } + } +} +function closeAllOpenPopovers(document2, focusPreviousElement = false, fireEvents = false) { + let popover = topMostAutoPopover(document2); + while (popover) { + hidePopover(popover, focusPreviousElement, fireEvents); + popover = topMostAutoPopover(document2); + } +} +function hideAllPopoversUntil(endpoint, focusPreviousElement, fireEvents) { + const document2 = endpoint.ownerDocument || endpoint; + if (endpoint instanceof Document) { + return closeAllOpenPopovers(document2, focusPreviousElement, fireEvents); + } + let lastToHide = null; + let foundEndpoint = false; + for (const popover of autoPopoverList.get(document2) || []) { + if (popover === endpoint) { + foundEndpoint = true; + } else if (foundEndpoint) { + lastToHide = popover; + break; + } + } + if (!foundEndpoint) { + return closeAllOpenPopovers(document2, focusPreviousElement, fireEvents); + } + while (lastToHide && getPopoverVisibilityState(lastToHide) === "showing" && autoPopoverList.get(document2)?.size) { + hidePopover(lastToHide, focusPreviousElement, fireEvents); + } +} +var popoverPointerDownTargets = /* @__PURE__ */ new WeakMap(); +function lightDismissOpenPopovers(event) { + if (!event.isTrusted) return; + const target = event.composedPath()[0]; + if (!target) return; + const document2 = target.ownerDocument; + const topMostPopover = topMostAutoPopover(document2); + if (!topMostPopover) return; + const ancestor = topMostClickedPopover(target); + if (ancestor && event.type === "pointerdown") { + popoverPointerDownTargets.set(document2, ancestor); + } else if (event.type === "pointerup") { + const sameTarget = popoverPointerDownTargets.get(document2) === ancestor; + popoverPointerDownTargets.delete(document2); + if (sameTarget) { + hideAllPopoversUntil(ancestor || document2, false, true); + } + } +} +var initialAriaExpandedValue = /* @__PURE__ */ new WeakMap(); +function setInvokerAriaExpanded(el, force = false) { + if (!el) return; + if (!initialAriaExpandedValue.has(el)) { + initialAriaExpandedValue.set(el, el.getAttribute("aria-expanded")); + } + const popover = el.popoverTargetElement; + if (popover instanceof HTMLElement && popover.popover === "auto") { + el.setAttribute("aria-expanded", String(force)); + } else { + const initialValue = initialAriaExpandedValue.get(el); + if (!initialValue) { + el.removeAttribute("aria-expanded"); + } else { + el.setAttribute("aria-expanded", initialValue); + } + } +} + +// src/popover.ts +var ShadowRoot2 = globalThis.ShadowRoot || function() { +}; +function isSupported() { + return typeof HTMLElement !== "undefined" && typeof HTMLElement.prototype === "object" && "popover" in HTMLElement.prototype; +} +function isPolyfilled() { + return Boolean( + document.body?.showPopover && !/native code/i.test(document.body.showPopover.toString()) + ); +} +function patchSelectorFn(object, name, mapper) { + const original = object[name]; + Object.defineProperty(object, name, { + value(selector) { + return original.call(this, mapper(selector)); + } + }); +} +var nonEscapedPopoverSelector = /(^|[^\\]):popover-open\b/g; +function hasLayerSupport() { + return typeof globalThis.CSSLayerBlockRule === "function"; +} +function getStyles() { + const useLayer = hasLayerSupport(); + return ` +${useLayer ? "@layer popover-polyfill {" : ""} + :where([popover]) { + position: fixed; + z-index: 2147483647; + inset: 0; + padding: 0.25em; + width: fit-content; + height: fit-content; + border-width: initial; + border-color: initial; + border-image: initial; + border-style: solid; + background-color: canvas; + color: canvastext; + overflow: auto; + margin: auto; + } + + :where([popover]:not(.\\:popover-open)) { + display: none; + } + + :where(dialog[popover].\\:popover-open) { + display: block; + } + + :where(dialog[popover][open]) { + display: revert; + } + + :where([anchor].\\:popover-open) { + inset: auto; + } + + :where([anchor]:popover-open) { + inset: auto; + } + + @supports not (background-color: canvas) { + :where([popover]) { + background-color: white; + color: black; + } + } + + @supports (width: -moz-fit-content) { + :where([popover]) { + width: -moz-fit-content; + height: -moz-fit-content; + } + } + + @supports not (inset: 0) { + :where([popover]) { + top: 0; + left: 0; + right: 0; + bottom: 0; + } + } +${useLayer ? "}" : ""} +`; +} +var popoverStyleSheet = null; +function injectStyles(root) { + const styles = getStyles(); + if (popoverStyleSheet === null) { + try { + popoverStyleSheet = new CSSStyleSheet(); + popoverStyleSheet.replaceSync(styles); + } catch { + popoverStyleSheet = false; + } + } + if (popoverStyleSheet === false) { + const sheet = document.createElement("style"); + sheet.textContent = styles; + if (root instanceof Document) { + root.head.prepend(sheet); + } else { + root.prepend(sheet); + } + } else { + root.adoptedStyleSheets = [popoverStyleSheet, ...root.adoptedStyleSheets]; + } +} +function apply() { + if (typeof window === "undefined") return; + window.ToggleEvent = window.ToggleEvent || ToggleEvent; + function rewriteSelector(selector) { + if (selector?.includes(":popover-open")) { + selector = selector.replace( + nonEscapedPopoverSelector, + "$1.\\:popover-open" + ); + } + return selector; + } + patchSelectorFn(Document.prototype, "querySelector", rewriteSelector); + patchSelectorFn(Document.prototype, "querySelectorAll", rewriteSelector); + patchSelectorFn(Element.prototype, "querySelector", rewriteSelector); + patchSelectorFn(Element.prototype, "querySelectorAll", rewriteSelector); + patchSelectorFn(Element.prototype, "matches", rewriteSelector); + patchSelectorFn(Element.prototype, "closest", rewriteSelector); + patchSelectorFn( + DocumentFragment.prototype, + "querySelectorAll", + rewriteSelector + ); + Object.defineProperties(HTMLElement.prototype, { + popover: { + enumerable: true, + configurable: true, + get() { + if (!this.hasAttribute("popover")) return null; + const value = (this.getAttribute("popover") || "").toLowerCase(); + if (value === "" || value == "auto") return "auto"; + return "manual"; + }, + set(value) { + if (value === null) { + this.removeAttribute("popover"); + } else { + this.setAttribute("popover", value); + } + } + }, + showPopover: { + enumerable: true, + configurable: true, + value() { + showPopover(this); + } + }, + hidePopover: { + enumerable: true, + configurable: true, + value() { + hidePopover(this, true, true); + } + }, + togglePopover: { + enumerable: true, + configurable: true, + value(force) { + if (visibilityState.get(this) === "showing" && force === void 0 || force === false) { + hidePopover(this, true, true); + } else if (force === void 0 || force === true) { + showPopover(this); + } + } + } + }); + const originalAttachShadow = Element.prototype.attachShadow; + if (originalAttachShadow) { + Object.defineProperties(Element.prototype, { + attachShadow: { + enumerable: true, + configurable: true, + writable: true, + value(options) { + const shadowRoot = originalAttachShadow.call(this, options); + injectStyles(shadowRoot); + return shadowRoot; + } + } + }); + } + const originalAttachInternals = HTMLElement.prototype.attachInternals; + if (originalAttachInternals) { + Object.defineProperties(HTMLElement.prototype, { + attachInternals: { + enumerable: true, + configurable: true, + writable: true, + value() { + const internals = originalAttachInternals.call(this); + if (internals.shadowRoot) { + injectStyles(internals.shadowRoot); + } + return internals; + } + } + }); + } + const popoverTargetAssociatedElements = /* @__PURE__ */ new WeakMap(); + function applyPopoverInvokerElementMixin(ElementClass) { + Object.defineProperties(ElementClass.prototype, { + popoverTargetElement: { + enumerable: true, + configurable: true, + set(targetElement) { + if (targetElement === null) { + this.removeAttribute("popovertarget"); + popoverTargetAssociatedElements.delete(this); + } else if (!(targetElement instanceof Element)) { + throw new TypeError( + `popoverTargetElement must be an element or null` + ); + } else { + this.setAttribute("popovertarget", ""); + popoverTargetAssociatedElements.set(this, targetElement); + } + }, + get() { + if (this.localName !== "button" && this.localName !== "input") { + return null; + } + if (this.localName === "input" && this.type !== "reset" && this.type !== "image" && this.type !== "button") { + return null; + } + if (this.disabled) { + return null; + } + if (this.form && this.type === "submit") { + return null; + } + const targetElement = popoverTargetAssociatedElements.get(this); + if (targetElement && targetElement.isConnected) { + return targetElement; + } else if (targetElement && !targetElement.isConnected) { + popoverTargetAssociatedElements.delete(this); + return null; + } + const root = getRootNode(this); + const idref = this.getAttribute("popovertarget"); + if ((root instanceof Document || root instanceof ShadowRoot2) && idref) { + return root.getElementById(idref) || null; + } + return null; + } + }, + popoverTargetAction: { + enumerable: true, + configurable: true, + get() { + const value = (this.getAttribute("popovertargetaction") || "").toLowerCase(); + if (value === "show" || value === "hide") return value; + return "toggle"; + }, + set(value) { + this.setAttribute("popovertargetaction", value); + } + } + }); + } + applyPopoverInvokerElementMixin(HTMLButtonElement); + applyPopoverInvokerElementMixin(HTMLInputElement); + const handleInvokerActivation = (event) => { + const composedPath = event.composedPath(); + const target = composedPath[0]; + if (!(target instanceof Element) || target?.shadowRoot) { + return; + } + const root = getRootNode(target); + if (!(root instanceof ShadowRoot2 || root instanceof Document)) { + return; + } + const invoker = composedPath.find( + (el) => el.matches?.("[popovertargetaction],[popovertarget]") + ); + if (invoker) { + popoverTargetAttributeActivationBehavior(invoker); + event.preventDefault(); + return; + } + }; + const onKeydown = (event) => { + const key = event.key; + const target = event.target; + if (!event.defaultPrevented && target && (key === "Escape" || key === "Esc")) { + hideAllPopoversUntil(target.ownerDocument, true, true); + } + }; + const addEventListeners = (root) => { + root.addEventListener("click", handleInvokerActivation); + root.addEventListener("keydown", onKeydown); + root.addEventListener("pointerdown", lightDismissOpenPopovers); + root.addEventListener("pointerup", lightDismissOpenPopovers); + }; + addEventListeners(document); + injectStyles(document); +} +export { + apply, + injectStyles, + isPolyfilled, + isSupported +}; +//# sourceMappingURL=popover-fn.js.map diff --git a/popup.txt b/popup.txt new file mode 100644 index 0000000..676b4c6 --- /dev/null +++ b/popup.txt @@ -0,0 +1,299 @@ + + +function createButton(label = 'BUTTON', onClick) { + const button = document.createElement('button'); + button.textContent = label; + button.addEventListener('click', onClick); + return button; +} + + +function createNewPopup(_title, _contentElements) { + const popup = new PopupBox(_title, _contentElements); + popup.setAttribute('title', _title); + let dlgBody = popup.dialog.querySelector('.dialog-content'); + let dlgFooter = popup.dialog.querySelector('.dialog-footer'); + document.body.appendChild(popup); + return popup; +} + + +class PopupBox extends HTMLElement { + constructor(title = 'Popup', contentElements = [], menuOptions = []) { + super(); + this.attachShadow({ mode: 'open' }); + this.args = { + title: title, + content: contentElements, + menuOptions: menuOptions, + }; + this.content = this.args.content.length > 0 ? {...this.args.content} : {...Array.from(this.shadowRoot.children)}; + this.dialog = this.createDialogStructure(title, contentElements); + this.shadowRoot.append(this.createStyles(), this.dialog); + this.setMenuOptions(menuOptions); + this.#updateDialogContent(); + this.show(); + this.dialog.addEventListener('click', (event) => { + if (event.target != this.dialog && !this.shadowRoot.contains(event.target)) { + event.preventDefault(); + this.hide(); + } + + }); + } + // Attach styles and dialog content to the shadow DOM } + static get observedAttributes() { + return ['title', 'content']; + } + attributeChangedCallback(name, oldValue, newValue) { + if (name === 'title') { + this.dialog.querySelector('.dialog-header').textContent = newValue; + } else if (name === 'content') { + this.#updateDialogContent(); + } + } + + static updateDialogContent() { + const _this = document.querySelector('popup-box'); + _this.updateDialogContent(); + } + + #updateDialogContent() { + this.shadowRoot.querySelector('#dialog-content').innerHTML = ''; + this.shadowRoot.querySelector('#dialog-content').append((Array.from(this.content)).flatMap(content => { + if (content instanceof HTMLElement) { + return content; + } else if (typeof content === 'string') { + const div = document.createElement('div'); + div.innerHTML = content; + return div.children; + } else if (Array.isArray(content)) { + return content; + } else { + return []; + } + })); + } + + addContents(contentElements) { + this.content = Array.from(contentElements); + this.#updateDialogContent(); + } + + createStyles() { + const style = document.createElement('style'); + style.textContent = ` + :host { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; + resize: both; + @touch-action: none; + + } + .dialog { + background: white; + padding: 20px; + border-radius: 8px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); + max-width: 80%; + max-height: 80vh; + overflow: auto; + } + .dialog-header { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + font-size: 1.2rem; + color: black; + background-color: #f5f5f5; + padding: 8px; + } + .dialog-content { + margin-bottom: 20px; + } + .dialog-footer { + border-top: 1px solid #eee; + padding-top: 10px; + text-align: right; + } + button { + padding: 8px 16px; + border: none; + border-radius: 4px; + background: #007bff; + color: white; + cursor: pointer; + } + button:hover { + background: #0056b3; + } + `; + return style; + } + + createDialogStructure(title, contentElements) { + const dialog = document.createElement('div'); + dialog.classList.add('dialog'); + dialog.innerHTML = ` + +
    + +

    ${title}

    +
    + + + + +
    +
    + + +
    ${[...Array.from(contentElements)]?.forEach(element => element.outerHTML)?.join('')} + + +
    + + `; + + dialog.querySelector('.dlg-close-btn').addEventListener('click', () => this.hide()); + dialog.addEventListener('click', (e) => { + if (e.target === this) this.hide(); + }); + + // Close on escape key + window.addEventListener('keydown', (e) => { + if (e.key === 'Escape' && this.isConnected) this.hide(); + }); + + this.dialog = dialog; + return dialog; + } + + show() { + document.body.appendChild(this); + document.body.style.overflow = 'hidden'; + } + + hide() { + if (this.isConnected) { + document.body.removeChild(this); + document.body.style.overflow = 'auto'; + } + } + + connectedCallback() { + this.setContent(this.args.content); + } + + setMenuOptions(options = [], index = 0) { + this.options = options; + if (!Array.isArray(options)) { + console.error('Menu options must be an array.'); + return; + } + if (options.length > 0) { + let i = 0; + const defaultOption = { + label: options[i].lable || 'File', + onClick: () => { + const menu = this.shadowRoot.querySelector('#dialog-menubar'); + const menuOptions = menu.querySelectorAll('.menu-option'); + if (menu.childElementCount > 0) { + menuOptions.forEach(option => { + option.classList.remove('active'); + }); + } + else { + menuOptions.forEach(option => { + option.classList.add('active'); + }); + } + menuOptions.forEach(option => { + option.style.display = option.style.display === 'block' ? 'none' : 'block'; + }); + menu.childElementCount > 0 ? menu.style.display = 'inline' : menu.style.display = 'inline-flex'; + } + }; + this.options.push(defaultOption); + } + const menuBar = this.shadowRoot.querySelector('#dialog-menubar'); + menuBar.innerHTML = ''; + this.options.forEach(option => { + const optsdiv = document.createElement('div'); + const button = document.createElement('button'); + optsdiv.appendChild(button); + optsdiv.classList.add('menu-option'); + button.setAttribute('data-index', index); + button.textContent = option.label; + button.addEventListener('click', option.onClick); + menuBar.appendChild(optsdiv); + }); + } + + // Method to update content + setContent(content) { + const contentDiv = this.shadowRoot.querySelector('#dialog-content'); + contentDiv.innerHTML = ''; + if (typeof content === 'string') { + contentDiv.innerHTML = content; + } else if (Array.isArray(content)) { + contentDiv.innerHTML = content.map(el => el.outerHTML).join(''); + } else if (content instanceof Element) { + contentDiv.appendChild(content); + } + } + + // Method to update title + setTitle(title) { + this.shadowRoot.querySelector('#dialog-title').textContent = title; + } + + // Method to update footer + setFooter(footer) { + const footerDiv = this.shadowRoot.querySelector('.dialog-footer'); + footerDiv.innerHTML = ''; + if (typeof footer === 'string') { + footerDiv.innerHTML = footer; + footerDiv.style.textAlign = 'center'; + } + else if (footer instanceof Element) { + footerDiv.appendChild(footer); + } + else { + footerDiv.innerHTML = footer; + footerDiv.style.textAlign = 'center'; + } + footerDiv.style.fontSize = '12px'; + footerDiv.style.color = 'white'; + footerDiv.style.fontWeight = 'bold'; + footerDiv.style.fontFamily = 'Arial, sans-serif'; + footerDiv.style.fontStyle = 'italic'; + footerDiv.style.fontVariant = 'small-caps'; + footerDiv.style.textShadow = '2px 2px 4px rgba(0, 0, 0, 0.5)'; + footerDiv.style.textDecoration = 'underline'; + footerDiv.style.textDecorationColor = 'white'; + footerDiv.style.textDecorationStyle = 'double'; + footerDiv.style.textDecorationThickness = '2px'; + footerDiv.style.textDecorationLine = 'underline'; + footerDiv.style.textDecorationSkipInk = 'none'; + footerDiv.style.textDecorationSkip = 'none'; + } +} + +customElements.define('popup-box', PopupBox); diff --git a/primer-dc3bfaf4b78e.css b/primer-dc3bfaf4b78e.css new file mode 100644 index 0000000..ca5deba --- /dev/null +++ b/primer-dc3bfaf4b78e.css @@ -0,0 +1,4 @@ +:root{--h00-size-mobile: 2.5rem;--h0-size-mobile: 2rem;--h1-size-mobile: 1.625rem;--h2-size-mobile: 1.375rem;--h3-size-mobile: 1.125rem;--h00-size: 3rem;--h0-size: 2.5rem;--h1-size: 2rem;--h2-size: 1.5rem;--h3-size: 1.25rem;--h4-size: 1rem;--h5-size: 0.875rem;--h6-size: 0.75rem;--body-font-size: 0.875rem;--font-size-small: 0.75rem}:root,[data-color-mode=light][data-light-theme*=light],[data-color-mode=dark][data-dark-theme*=light]{color-scheme:light}@media(prefers-color-scheme: light){[data-color-mode=auto][data-light-theme*=light]{color-scheme:light}}@media(prefers-color-scheme: dark){[data-color-mode=auto][data-dark-theme*=light]{color-scheme:light}}[data-color-mode=light][data-light-theme*=dark],[data-color-mode=dark][data-dark-theme*=dark]{color-scheme:dark}@media(prefers-color-scheme: light){[data-color-mode=auto][data-light-theme*=dark]{color-scheme:dark}}@media(prefers-color-scheme: dark){[data-color-mode=auto][data-dark-theme*=dark]{color-scheme:dark}}[data-color-mode]{color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-default, var(--color-canvas-default))}@media(forced-colors: active){body{--color-accent-emphasis: Highlight;--color-fg-on-emphasis: LinkText;--fgColor-onEmphasis: LinkText;--fgColor-accent: Highlight}}@layer primer-css-base{/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */html{font-size:16px;font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}template,[hidden]{display:none !important}a{background-color:rgba(0,0,0,0)}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:var(--bgColor-attention-muted, var(--color-attention-subtle));color:var(--fgColor-default, var(--color-fg-default))}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace;font-size:1em}figure{margin:1em var(--base-size-40)}hr{box-sizing:content-box;height:0;overflow:visible}button,input,select,textarea{font:inherit;margin:0}optgroup{font-weight:var(--base-text-weight-semibold, 600)}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}*{box-sizing:border-box}input,select,textarea,button{font-family:inherit;font-size:inherit;line-height:inherit}body{font-family:var(--fontStack-sansSerif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji");font-size:var(--body-font-size, 14px);font-weight:var(--base-text-weight-normal, 400);line-height:1.5;color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-default, var(--color-canvas-default))}a{color:var(--fgColor-accent, var(--color-accent-fg));text-decoration:none}a:hover{text-decoration:underline}b,strong{font-weight:var(--base-text-weight-semibold, 600)}fieldset{padding:0;margin:0;border:0}label{font-weight:var(--base-text-weight-semibold, 600)}::placeholder{color:var(--fgColor-muted, var(--color-fg-subtle));opacity:1}hr,.rule{height:0;margin:15px 0;overflow:hidden;background:rgba(0,0,0,0);border:0;border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}hr::before,.rule::before{display:table;content:""}hr::after,.rule::after{display:table;clear:both;content:""}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}button{cursor:pointer;border-radius:0}[hidden][hidden]{display:none !important}details summary{cursor:pointer}a:focus,button:focus,[role=button]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:none}a:focus:not(:focus-visible),button:focus:not(:focus-visible),[role=button]:focus:not(:focus-visible),input[type=radio]:focus:not(:focus-visible),input[type=checkbox]:focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0)}a:focus-visible,button:focus-visible,[role=button]:focus-visible,input[type=radio]:focus-visible,input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:none}a:not([class]):focus,a:not([class]):focus-visible,input[type=radio]:focus,input[type=radio]:focus-visible,input[type=checkbox]:focus,input[type=checkbox]:focus-visible{outline-offset:0}.focus{border-color:var(--focus-outlineColor, var(--color-accent-fg));outline:none;box-shadow:inset 0 0 0 1px var(--focus-outlineColor, var(--color-accent-fg))}@media(forced-colors: active){*:focus,*:focus-visible{outline:solid 1px rgba(0,0,0,0)}input:not([type=radio],[type=checkbox]):focus,input:not([type=radio],[type=checkbox]):focus-visible,textarea:focus,textarea:focus-visible,select:focus,select:focus-visible{outline-offset:2px}}kbd{display:inline-block;padding:var(--base-size-4);font:11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);line-height:10px;color:var(--fgColor-default, var(--color-fg-default));vertical-align:middle;background-color:var(--bgColor-muted, var(--color-canvas-subtle));border:solid 1px var(--borderColor-neutral-muted, var(--color-neutral-muted));border-bottom-color:var(--borderColor-neutral-muted, var(--color-neutral-muted));border-radius:6px;box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted, var(--color-neutral-muted))}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:0}h1{font-size:var(--h1-size, 32px);font-weight:var(--base-text-weight-semibold, 600)}h2{font-size:var(--h2-size, 24px);font-weight:var(--base-text-weight-semibold, 600)}h3{font-size:var(--h3-size, 20px);font-weight:var(--base-text-weight-semibold, 600)}h4{font-size:var(--h4-size, 16px);font-weight:var(--base-text-weight-semibold, 600)}h5{font-size:var(--h5-size, 14px);font-weight:var(--base-text-weight-semibold, 600)}h6{font-size:var(--h6-size, 12px);font-weight:var(--base-text-weight-semibold, 600)}p{margin-top:0;margin-bottom:10px}small{font-size:90%}blockquote{margin:0}ul,ol{padding-left:0;margin-top:0;margin-bottom:0}ol ol,ul ol{list-style-type:lower-roman}ul ul ol,ul ol ol,ol ul ol,ol ol ol{list-style-type:lower-alpha}dd{margin-left:0}tt,code,samp{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}pre{margin-top:0;margin-bottom:0;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.octicon{vertical-align:text-bottom}}.octicon{display:inline-block;overflow:visible !important;vertical-align:text-bottom;fill:currentColor}.Box--overlay{width:448px;margin-right:auto;margin-left:auto;background-color:var(--bgColor-default, var(--color-canvas-default));background-clip:padding-box;border-color:var(--borderColor-default, var(--color-border-default));box-shadow:0 0 18px rgba(0,0,0,.4)}.Box--overlay .Box-header{margin:0;border-width:0;border-bottom-width:1px;border-top-left-radius:6px;border-top-right-radius:6px}.Box-overlay--narrow{width:320px}.Box-overlay--wide{width:640px}.Box-body.scrollable-overlay{max-height:400px;overflow-y:scroll}.Box-body .help{padding-top:var(--base-size-8);margin:0;color:var(--fgColor-muted, var(--color-fg-muted));text-align:center}.btn{position:relative;display:inline-block;padding:5px var(--base-size-16);font-size:14px;font-weight:var(--base-text-weight-medium, 500);line-height:20px;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid;border-radius:6px;appearance:none}.btn:hover{text-decoration:none}.btn:disabled,.btn.disabled,.btn[aria-disabled=true]{cursor:default}.btn i{font-style:normal;font-weight:var(--base-text-weight-medium, 500);opacity:.75}.btn .octicon{margin-right:var(--base-size-4);color:var(--fgColor-muted, var(--color-fg-muted));vertical-align:text-bottom}.btn .octicon:only-child{margin-right:0}.btn .Counter{margin-left:2px;color:inherit;text-shadow:none;vertical-align:top;background-color:var(--buttonCounter-default-bgColor-rest, var(--color-btn-counter-bg))}.btn .dropdown-caret{margin-left:var(--base-size-4);opacity:.8}.btn{color:var(--button-default-fgColor-rest, var(--color-btn-text));background-color:var(--button-default-bgColor-rest, var(--color-btn-bg));border-color:var(--button-default-borderColor-rest, var(--color-btn-border));box-shadow:var(--button-default-shadow-resting, var(--color-btn-shadow)),var(--button-default-shadow-inset, var(--color-btn-inset-shadow));transition:80ms cubic-bezier(0.33, 1, 0.68, 1);transition-property:color,background-color,box-shadow,border-color}.btn:hover,.btn.hover,[open]>.btn{background-color:var(--button-default-bgColor-hover, var(--color-btn-hover-bg));border-color:var(--button-default-borderColor-hover, var(--color-btn-hover-border));transition-duration:.1s}.btn:active{background-color:var(--button-default-bgColor-active, var(--color-btn-active-bg));border-color:var(--button-default-borderColor-active, var(--color-btn-active-border));transition:none}.btn.selected,.btn[aria-selected=true]{background-color:var(--button-default-bgColor-selected, var(--color-btn-selected-bg));box-shadow:var(--shadow-inset, var(--color-primer-shadow-inset))}.btn:disabled,.btn.disabled,.btn[aria-disabled=true]{color:var(--fgColor-disabled, var(--color-primer-fg-disabled));background-color:var(--button-default-bgColor-disabled, var(--color-btn-bg));border-color:var(--button-default-borderColor-disabled, var(--color-btn-border))}.btn:disabled .octicon,.btn.disabled .octicon,.btn[aria-disabled=true] .octicon{color:var(--fgColor-disabled, var(--color-primer-fg-disabled))}.btn-primary{color:var(--button-primary-fgColor-rest, var(--color-btn-primary-text));background-color:var(--button-primary-bgColor-rest, var(--color-btn-primary-bg));border-color:var(--button-primary-borderColor-rest, var(--color-btn-primary-border));box-shadow:var(--shadow-resting-small, var(--color-btn-primary-shadow)),var(--shadow-highlight, var(--color-btn-primary-inset-shadow))}.btn-primary:hover,.btn-primary.hover,[open]>.btn-primary{background-color:var(--button-primary-bgColor-hover, var(--color-btn-primary-hover-bg));border-color:var(--button-primary-borderColor-hover, var(--color-btn-primary-hover-border))}.btn-primary:focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.btn-primary:focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0);box-shadow:none}.btn-primary:focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.btn-primary:active,.btn-primary.selected,.btn-primary[aria-selected=true]{background-color:var(--button-primary-bgColor-active, var(--color-btn-primary-selected-bg));box-shadow:var(--button-primary-shadow-selected, var(--color-btn-primary-selected-shadow))}.btn-primary:disabled,.btn-primary.disabled,.btn-primary[aria-disabled=true]{color:var(--button-primary-fgColor-disabled, var(--color-btn-primary-disabled-text));background-color:var(--button-primary-bgColor-disabled, var(--color-btn-primary-disabled-bg));border-color:var(--button-primary-borderColor-disabled, var(--color-btn-primary-disabled-border))}.btn-primary:disabled .octicon,.btn-primary.disabled .octicon,.btn-primary[aria-disabled=true] .octicon{color:var(--button-primary-fgColor-disabled, var(--color-btn-primary-disabled-text))}.btn-primary .Counter{color:inherit;background-color:var(--buttonCounter-primary-bgColor-rest, var(--color-btn-primary-counter-bg))}.btn-primary .octicon{color:var(--button-primary-iconColor-rest, var(--color-btn-primary-icon))}a.btn-primary:focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}a.btn-primary:focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0);box-shadow:none}a.btn-primary:focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.btn-outline{color:var(--button-outline-fgColor-rest, var(--color-btn-outline-text))}.btn-outline:hover,[open]>.btn-outline{color:var(--button-outline-fgColor-hover, var(--color-btn-outline-hover-text));background-color:var(--button-outline-bgColor-hover, var(--color-btn-outline-hover-bg));border-color:var(--button-outline-borderColor-hover, var(--color-btn-outline-hover-border));box-shadow:var(--shadow-resting-small, var(--color-btn-outline-hover-shadow)),var(--shadow-highlight, var(--color-btn-outline-hover-inset-shadow))}.btn-outline:hover .Counter,[open]>.btn-outline .Counter{background-color:var(--buttonCounter-outline-bgColor-hover, var(--color-btn-outline-hover-counter-bg))}.btn-outline:hover .octicon,[open]>.btn-outline .octicon{color:inherit}.btn-outline:active,.btn-outline.selected,.btn-outline[aria-selected=true]{color:var(--button-outline-fgColor-active, var(--color-btn-outline-selected-text));background-color:var(--button-outline-bgColor-active, var(--color-btn-outline-selected-bg));border-color:var(--button-outline-borderColor-active, var(--color-btn-outline-selected-border));box-shadow:var(--button-outline-shadow-selected, var(--color-btn-outline-selected-shadow))}.btn-outline:active:focus,.btn-outline.selected:focus,.btn-outline[aria-selected=true]:focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.btn-outline:active:focus:not(:focus-visible),.btn-outline.selected:focus:not(:focus-visible),.btn-outline[aria-selected=true]:focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0);box-shadow:none}.btn-outline:active:focus-visible,.btn-outline.selected:focus-visible,.btn-outline[aria-selected=true]:focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.btn-outline:disabled,.btn-outline.disabled,.btn-outline[aria-disabled=true]{color:var(--button-outline-fgColor-disabled, var(--color-btn-outline-disabled-text));background-color:var(--button-outline-bgColor-disabled, var(--color-btn-outline-disabled-bg));border-color:var(--button-default-borderColor-rest, var(--color-btn-border));box-shadow:none}.btn-outline:disabled .Counter,.btn-outline.disabled .Counter,.btn-outline[aria-disabled=true] .Counter{background-color:var(--buttonCounter-outline-bgColor-disabled, var(--color-btn-outline-disabled-counter-bg))}.btn-outline .Counter{color:inherit;background-color:var(--buttonCounter-outline-bgColor-rest, var(--color-btn-outline-counter-bg))}.btn-danger{color:var(--button-danger-fgColor-rest, var(--color-btn-danger-text))}.btn-danger .octicon{color:var(--button-danger-iconColor-rest, var(--color-btn-danger-icon))}.btn-danger:hover,[open]>.btn-danger{color:var(--button-danger-fgColor-hover, var(--color-btn-danger-hover-text));background-color:var(--button-danger-bgColor-hover, var(--color-btn-danger-hover-bg));border-color:var(--button-danger-borderColor-hover, var(--color-btn-danger-hover-border));box-shadow:var(--shadow-resting-small, var(--color-btn-danger-hover-shadow)),var(--shadow-highlight, var(--color-btn-danger-hover-inset-shadow))}.btn-danger:hover .Counter,[open]>.btn-danger .Counter{background-color:var(--buttonCounter-danger-bgColor-hover, var(--color-btn-danger-hover-counter-bg))}.btn-danger:hover .octicon,[open]>.btn-danger .octicon{color:var(--button-danger-iconColor-hover, var(--color-btn-danger-hover-icon))}.btn-danger:active,.btn-danger.selected,.btn-danger[aria-selected=true]{color:var(--button-danger-fgColor-active, var(--color-btn-danger-selected-text));background-color:var(--button-danger-bgColor-active, var(--color-btn-danger-selected-bg));border-color:var(--button-danger-borderColor-active, var(--color-btn-danger-selected-border));box-shadow:var(--button-danger-shadow-selected, var(--color-btn-danger-selected-shadow))}.btn-danger:disabled,.btn-danger.disabled,.btn-danger[aria-disabled=true]{color:var(--button-danger-fgColor-disabled, var(--color-btn-danger-disabled-text));background-color:var(--button-danger-bgColor-disabled, var(--color-btn-danger-disabled-bg));border-color:var(--button-default-borderColor-rest, var(--color-btn-border));box-shadow:none}.btn-danger:disabled .Counter,.btn-danger.disabled .Counter,.btn-danger[aria-disabled=true] .Counter{background-color:var(--buttonCounter-danger-bgColor-disabled, var(--color-btn-danger-disabled-counter-bg))}.btn-danger:disabled .octicon,.btn-danger.disabled .octicon,.btn-danger[aria-disabled=true] .octicon{color:var(--button-danger-fgColor-disabled, var(--color-btn-danger-disabled-text))}.btn-danger .Counter{color:inherit;background-color:var(--buttonCounter-danger-bgColor-rest, var(--color-btn-danger-counter-bg))}.btn-sm{padding:3px 12px;font-size:12px;line-height:20px}.btn-sm .octicon{vertical-align:text-top}.btn-large{padding:.75em 1.5em;font-size:inherit;line-height:1.5;border-radius:.5em}.btn-block{display:block;width:100%;text-align:center}.BtnGroup{display:inline-block;vertical-align:middle}.BtnGroup::before{display:table;content:""}.BtnGroup::after{display:table;clear:both;content:""}.BtnGroup+.BtnGroup,.BtnGroup+.btn{margin-left:var(--base-size-4)}.BtnGroup-item{position:relative;float:left;border-right-width:0;border-radius:0}.BtnGroup-item:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}.BtnGroup-item:last-child{border-right-width:1px;border-top-right-radius:6px;border-bottom-right-radius:6px}.BtnGroup-item.selected,.BtnGroup-item[aria-selected=true],.BtnGroup-item:focus,.BtnGroup-item:active,.BtnGroup-item:hover{border-right-width:1px}.BtnGroup-item.selected+.BtnGroup-item,.BtnGroup-item.selected+.BtnGroup-parent .BtnGroup-item,.BtnGroup-item[aria-selected=true]+.BtnGroup-item,.BtnGroup-item[aria-selected=true]+.BtnGroup-parent .BtnGroup-item,.BtnGroup-item:focus+.BtnGroup-item,.BtnGroup-item:focus+.BtnGroup-parent .BtnGroup-item,.BtnGroup-item:active+.BtnGroup-item,.BtnGroup-item:active+.BtnGroup-parent .BtnGroup-item,.BtnGroup-item:hover+.BtnGroup-item,.BtnGroup-item:hover+.BtnGroup-parent .BtnGroup-item{border-left-width:0}.BtnGroup-parent{float:left}.BtnGroup-parent:first-child .BtnGroup-item{border-top-left-radius:6px;border-bottom-left-radius:6px}.BtnGroup-parent:last-child .BtnGroup-item{border-right-width:1px;border-top-right-radius:6px;border-bottom-right-radius:6px}.BtnGroup-parent .BtnGroup-item{border-right-width:0;border-radius:0}.BtnGroup-parent.selected .BtnGroup-item,.BtnGroup-parent[aria-selected=true] .BtnGroup-item,.BtnGroup-parent:focus .BtnGroup-item,.BtnGroup-parent:active .BtnGroup-item,.BtnGroup-parent:hover .BtnGroup-item{border-right-width:1px}.BtnGroup-parent.selected+.BtnGroup-item,.BtnGroup-parent.selected+.BtnGroup-parent .BtnGroup-item,.BtnGroup-parent[aria-selected=true]+.BtnGroup-item,.BtnGroup-parent[aria-selected=true]+.BtnGroup-parent .BtnGroup-item,.BtnGroup-parent:focus+.BtnGroup-item,.BtnGroup-parent:focus+.BtnGroup-parent .BtnGroup-item,.BtnGroup-parent:active+.BtnGroup-item,.BtnGroup-parent:active+.BtnGroup-parent .BtnGroup-item,.BtnGroup-parent:hover+.BtnGroup-item,.BtnGroup-parent:hover+.BtnGroup-parent .BtnGroup-item{border-left-width:0}.BtnGroup-item:focus,.BtnGroup-item:active,.BtnGroup-parent:focus,.BtnGroup-parent:active{z-index:1}.btn-link{display:inline-block;padding:0;font-size:inherit;color:var(--fgColor-accent, var(--color-accent-fg));text-decoration:none;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;background-color:rgba(0,0,0,0);border:0;appearance:none}.btn-link:hover{text-decoration:underline}.btn-link:disabled,.btn-link:disabled:hover,.btn-link[aria-disabled=true],.btn-link[aria-disabled=true]:hover{color:var(--fgColor-disabled, var(--color-primer-fg-disabled));cursor:default}.btn-link:not(.dropdown-item):focus,.btn-link:not(.dropdown-item):focus-visible{border-radius:6px;outline-offset:0}.btn-invisible{color:var(--fgColor-accent, var(--color-accent-fg));background-color:rgba(0,0,0,0);border:0;border-radius:6px;box-shadow:none}.btn-invisible:hover,.btn-invisible.zeroclipboard-is-hover{color:var(--fgColor-accent, var(--color-accent-fg));background-color:var(--button-default-bgColor-hover, var(--color-btn-hover-bg));outline:none;box-shadow:none}.btn-invisible:active,.btn-invisible.selected,.btn-invisible[aria-selected=true],.btn-invisible.zeroclipboard-is-active{color:var(--fgColor-accent, var(--color-accent-fg));background:none;border-color:var(--button-default-borderColor-active, var(--color-btn-active-border));outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:none}.btn-invisible:active .btn-invisible.zeroclipboard-is-active{background-color:var(--button-default-bgColor-selected, var(--color-btn-selected-bg))}.btn-invisible:disabled,.btn-invisible.disabled,.btn-invisible[aria-disabled=true]{color:var(--fgColor-disabled, var(--color-primer-fg-disabled));background-color:rgba(0,0,0,0)}.btn-octicon{display:inline-block;padding:5px;margin-left:5px;line-height:1;color:var(--fgColor-muted, var(--color-fg-muted));vertical-align:middle;background:rgba(0,0,0,0);border:0;box-shadow:none}.btn-octicon:hover{color:var(--fgColor-accent, var(--color-accent-fg))}.btn-octicon:focus,.btn-octicon:focus-visible{border-radius:6px}.btn-octicon.disabled,.btn-octicon[aria-disabled=true]{color:var(--fgColor-disabled, var(--color-primer-fg-disabled));cursor:default}.btn-octicon.disabled:hover,.btn-octicon[aria-disabled=true]:hover{color:var(--fgColor-disabled, var(--color-primer-fg-disabled))}.btn-octicon-danger:hover{color:var(--fgColor-danger, var(--color-danger-fg))}.close-button{padding:0;color:var(--fgColor-muted, var(--color-fg-muted));background:rgba(0,0,0,0);border:0}.close-button:hover{color:var(--fgColor-default, var(--color-fg-default))}.close-button:active{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:none}.hidden-text-expander{display:block}.hidden-text-expander.inline{position:relative;top:-1px;display:inline-block;margin-left:5px;line-height:0}.hidden-text-expander a,.ellipsis-expander{display:inline-block;height:12px;padding:0 5px 5px;font-size:12px;font-weight:var(--base-text-weight-semibold, 600);line-height:6px;color:var(--fgColor-default, var(--color-fg-default));text-decoration:none;vertical-align:middle;background:var(--bgColor-neutral-muted, var(--color-neutral-muted));border:0;border-radius:1px}.hidden-text-expander a:hover,.ellipsis-expander:hover{text-decoration:none;background-color:var(--bgColor-accent-muted, var(--color-accent-muted))}.hidden-text-expander a:active,.ellipsis-expander:active{color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));background-color:var(--bgColor-accent-emphasis, var(--color-accent-emphasis))}.btn-with-count{float:left;border-top-right-radius:0;border-bottom-right-radius:0}.btn-with-count:focus{z-index:1}.social-count{position:relative;float:left;padding:3px 12px;font-size:12px;font-weight:var(--base-text-weight-semibold, 600);line-height:20px;color:var(--fgColor-default, var(--color-fg-default));vertical-align:middle;background-color:var(--bgColor-default, var(--color-canvas-default));border:1px solid var(--button-default-borderColor-rest, var(--color-btn-border));border-left:0;border-top-right-radius:6px;border-bottom-right-radius:6px;box-shadow:var(--shadow-resting-small, var(--color-shadow-small)),var(--shadow-highlight, var(--color-primer-shadow-highlight))}.social-count:hover,.social-count:active{text-decoration:none}.social-count:hover{color:var(--fgColor-accent, var(--color-accent-fg));cursor:pointer}.TableObject{display:table}.TableObject-item{display:table-cell;width:1%;white-space:nowrap;vertical-align:middle}.TableObject-item--primary{width:99%}.form-control,.form-select{padding:5px 12px;font-size:14px;line-height:20px;color:var(--fgColor-default, var(--color-fg-default));vertical-align:middle;background-color:var(--bgColor-default, var(--color-canvas-default));background-repeat:no-repeat;background-position:right 8px center;border:1px solid var(--control-borderColor-rest, var(--color-border-default));border-radius:6px;box-shadow:var(--shadow-inset, var(--color-primer-shadow-inset));transition:80ms cubic-bezier(0.33, 1, 0.68, 1);transition-property:color,background-color,box-shadow,border-color}.form-control:focus,.form-select:focus{border-color:var(--focus-outlineColor, var(--color-accent-fg));outline:none;box-shadow:inset 0 0 0 1px var(--focus-outlineColor, var(--color-accent-fg))}.form-control:focus:not(:focus-visible),.form-select:focus:not(:focus-visible){border-color:rgba(0,0,0,0);border-color:var(--focus-outlineColor, var(--color-accent-fg));outline:none;box-shadow:inset 0 0 0 1px rgba(0,0,0,0)}.form-control:focus-visible,.form-select:focus-visible{border-color:var(--focus-outlineColor, var(--color-accent-fg));outline:none;box-shadow:inset 0 0 0 1px var(--focus-outlineColor, var(--color-accent-fg))}.form-control.border-0:focus,.form-control.border-0:focus-visible,.form-select.border-0:focus,.form-select.border-0:focus-visible{border:1px solid var(--borderColor-accent-emphasis, var(--color-accent-fg)) !important}.form-control[disabled],fieldset[disabled] .form-control,.form-select[disabled],fieldset[disabled] .form-select{color:var(--control-fgColor-disabled, var(--color-primer-fg-disabled));background-color:var(--control-bgColor-disabled, var(--color-input-disabled-bg));border-color:var(--control-borderColor-disabled, var(--color-border-default));-webkit-text-fill-color:var(--control-fgColor-disabled, var(--color-primer-fg-disabled));opacity:1}.form-control[disabled]::placeholder,fieldset[disabled] .form-control::placeholder,.form-select[disabled]::placeholder,fieldset[disabled] .form-select::placeholder{color:var(--control-fgColor-disabled, var(--color-primer-fg-disabled))}@supports(-webkit-touch-callout: none){.form-control,.form-select{font-size:16px}@media(min-width: 768px){.form-control,.form-select{font-size:14px}}}textarea.form-control{padding-top:var(--base-size-8);padding-bottom:var(--base-size-8);line-height:1.5}.input-contrast{background-color:var(--bgColor-muted, var(--color-canvas-inset))}.input-contrast:focus{background-color:var(--bgColor-default, var(--color-canvas-default))}.input-sm{min-height:28px;padding-top:3px;padding-bottom:3px;font-size:12px;line-height:20px}.input-lg{font-size:16px}.input-block{display:block;width:100%}.input-monospace{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace)}.input-hide-webkit-autofill::-webkit-contacts-auto-fill-button{position:absolute;right:0;display:none !important;pointer-events:none;visibility:hidden}.form-checkbox{padding-left:20px;margin:15px 0;vertical-align:middle}.form-checkbox label em.highlight{position:relative;left:calc(var(--base-size-4)*-1);padding:2px var(--base-size-4);font-style:normal;background:var(--bgColor-attention-muted, var(--color-attention-subtle));border-radius:6px}.form-checkbox input[type=checkbox],.form-checkbox input[type=radio]{float:left;margin:5px 0 0 -20px;vertical-align:middle}.form-checkbox .note{display:block;margin:0;font-size:12px;font-weight:var(--base-text-weight-normal, 400);color:var(--fgColor-muted, var(--color-fg-muted))}.form-checkbox-details{display:none}.form-checkbox-details-trigger:checked~* .form-checkbox-details,.form-checkbox-details-trigger:checked~.form-checkbox-details{display:block}.hfields{margin:15px 0}.hfields::before{display:table;content:""}.hfields::after{display:table;clear:both;content:""}.hfields .form-group{float:left;margin:0 30px 0 0}.hfields .form-group dt label,.hfields .form-group .form-group-header label{display:inline-block;margin:5px 0 0;color:var(--fgColor-muted, var(--color-fg-muted))}.hfields .form-group dt img,.hfields .form-group .form-group-header img{position:relative;top:-2px}.hfields .btn{float:left;margin:28px 25px 0 -20px}.hfields .form-select{margin-top:5px}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{margin:0;appearance:none}.form-actions::before{display:table;content:""}.form-actions::after{display:table;clear:both;content:""}.form-actions .btn{float:right}.form-actions .btn+.btn{margin-right:5px}.form-warning{padding:var(--base-size-8) 10px;margin:10px 0;font-size:14px;color:var(--fgColor-attention, var(--color-attention-fg));background:var(--bgColor-attention-muted, var(--color-attention-subtle));border:1px solid var(--borderColor-attention-emphasis, var(--color-attention-emphasis));border-radius:6px}.form-warning p{margin:0;line-height:1.5}.form-warning a{font-weight:var(--base-text-weight-semibold, 600)}.form-select{display:inline-block;max-width:100%;height:32px;padding-right:var(--base-size-24);background-color:var(--bgColor-default, var(--color-canvas-default));background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iIzU4NjA2OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC40MjcgOS40MjdsMy4zOTYgMy4zOTZhLjI1MS4yNTEgMCAwMC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwMDExLjM5NiA5SDQuNjA0YS4yNS4yNSAwIDAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3TDcuODIgMy4wNzJhLjI1LjI1IDAgMDEuMzU0IDBMMTEuNTcgNi40N2EuMjUuMjUgMCAwMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMDEtLjE3Ny0uNDI3eiIgLz48L3N2Zz4=");background-repeat:no-repeat;background-position:right 4px center;background-size:16px;appearance:none}.form-select::-ms-expand{opacity:0}.form-select[multiple]{height:auto}[data-color-mode=light][data-light-theme*=dark] .form-select,[data-color-mode=dark][data-dark-theme*=dark] .form-select{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iIzZlNzY4MSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC40MjcgOS40MjdsMy4zOTYgMy4zOTZhLjI1MS4yNTEgMCAwMC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwMDExLjM5NiA5SDQuNjA0YS4yNS4yNSAwIDAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3TDcuODIgMy4wNzJhLjI1LjI1IDAgMDEuMzU0IDBMMTEuNTcgNi40N2EuMjUuMjUgMCAwMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMDEtLjE3Ny0uNDI3eiIgLz48L3N2Zz4=")}@media(prefers-color-scheme: light){[data-color-mode=auto][data-light-theme*=dark] .form-select{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iIzZlNzY4MSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC40MjcgOS40MjdsMy4zOTYgMy4zOTZhLjI1MS4yNTEgMCAwMC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwMDExLjM5NiA5SDQuNjA0YS4yNS4yNSAwIDAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3TDcuODIgMy4wNzJhLjI1LjI1IDAgMDEuMzU0IDBMMTEuNTcgNi40N2EuMjUuMjUgMCAwMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMDEtLjE3Ny0uNDI3eiIgLz48L3N2Zz4=")}}@media(prefers-color-scheme: dark){[data-color-mode=auto][data-dark-theme*=dark] .form-select{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iIzZlNzY4MSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC40MjcgOS40MjdsMy4zOTYgMy4zOTZhLjI1MS4yNTEgMCAwMC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwMDExLjM5NiA5SDQuNjA0YS4yNS4yNSAwIDAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3TDcuODIgMy4wNzJhLjI1LjI1IDAgMDEuMzU0IDBMMTEuNTcgNi40N2EuMjUuMjUgMCAwMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMDEtLjE3Ny0uNDI3eiIgLz48L3N2Zz4=")}}.select-sm{height:28px;padding-top:3px;padding-bottom:3px;font-size:12px}.select-sm[multiple]{height:auto;min-height:0}.form-group{margin:15px 0}.form-group .form-control.autocomplete-embedded-icon-wrap:focus-within{background-color:var(--bgColor-default, var(--color-canvas-default))}.form-group .form-control{width:440px;max-width:100%;margin-right:5px;background-color:var(--bgColor-muted, var(--color-canvas-inset))}.form-group .form-control:focus{background-color:var(--bgColor-default, var(--color-canvas-default))}.form-group .form-control.shorter{width:130px}.form-group .form-control.short{width:250px}.form-group .form-control.input-block,.form-group .form-control.long{width:100%}.form-group textarea.form-control{width:100%;height:200px;min-height:200px}.form-group textarea.form-control.short{height:50px;min-height:50px}.form-group dt,.form-group .form-group-header{margin:0 0 6px}.form-group label{position:static}.form-group.flattened dt,.form-group.flattened .form-group-header{float:left;margin:0;line-height:32px}.form-group.flattened dd,.form-group.flattened .form-group-body{line-height:32px}.form-group dd h4,.form-group .form-group-body h4{margin:var(--base-size-4) 0 0}.form-group dd h4.is-error,.form-group .form-group-body h4.is-error{color:var(--fgColor-danger, var(--color-danger-fg))}.form-group dd h4.is-success,.form-group .form-group-body h4.is-success{color:var(--fgColor-success, var(--color-success-fg))}.form-group dd h4+.note,.form-group .form-group-body h4+.note{margin-top:0}.form-group.required dt label::after,.form-group.required .form-group-header label::after{padding-left:5px;color:var(--fgColor-danger, var(--color-danger-fg));content:"*"}.form-group .success,.form-group .error,.form-group .indicator{display:none;font-size:12px;font-weight:var(--base-text-weight-semibold, 600)}.form-group.loading{opacity:.5}.form-group.loading .indicator{display:inline}.form-group.loading .spinner{display:inline-block;vertical-align:middle}.form-group.successful .success{display:inline;color:var(--fgColor-success, var(--color-success-fg))}.form-group.successed .success,.form-group.successed .warning,.form-group.successed .error,.form-group.warn .success,.form-group.warn .warning,.form-group.warn .error,.form-group.errored .success,.form-group.errored .warning,.form-group.errored .error{position:absolute;z-index:10;display:block;max-width:450px;padding:var(--base-size-4) var(--base-size-8);margin:var(--base-size-8) 0 0;font-size:12px;font-weight:var(--base-text-weight-normal, 400);border-style:solid;border-width:1px;border-radius:6px}.form-group.successed .success::after,.form-group.successed .success::before,.form-group.successed .warning::after,.form-group.successed .warning::before,.form-group.successed .error::after,.form-group.successed .error::before,.form-group.warn .success::after,.form-group.warn .success::before,.form-group.warn .warning::after,.form-group.warn .warning::before,.form-group.warn .error::after,.form-group.warn .error::before,.form-group.errored .success::after,.form-group.errored .success::before,.form-group.errored .warning::after,.form-group.errored .warning::before,.form-group.errored .error::after,.form-group.errored .error::before{position:absolute;bottom:100%;left:10px;z-index:15;width:0;height:0;pointer-events:none;content:" ";border:solid rgba(0,0,0,0)}.form-group.successed .success::after,.form-group.successed .warning::after,.form-group.successed .error::after,.form-group.warn .success::after,.form-group.warn .warning::after,.form-group.warn .error::after,.form-group.errored .success::after,.form-group.errored .warning::after,.form-group.errored .error::after{border-width:5px}.form-group.successed .success::before,.form-group.successed .warning::before,.form-group.successed .error::before,.form-group.warn .success::before,.form-group.warn .warning::before,.form-group.warn .error::before,.form-group.errored .success::before,.form-group.errored .warning::before,.form-group.errored .error::before{margin-left:-1px;border-width:6px}.form-group.successed .success{color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-default, var(--color-canvas-default));background-image:linear-gradient(var(--bgColor-success-muted, var(--bgColor-success-muted, var(--color-success-subtle))), var(--color-success-subtle));border-color:var(--borderColor-success-muted, var(--color-success-muted))}.form-group.successed .success::after{border-bottom-color:var(--borderColor-success-muted, var(--color-success-muted))}.form-group.successed .success::before{border-bottom-color:var(--borderColor-success-muted, var(--color-success-muted))}.form-group.warn .form-control:not(:focus,:focus-visible){border-color:var(--borderColor-attention-emphasis, var(--color-attention-emphasis))}.form-group.warn .warning{color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-default, var(--color-canvas-default));background-image:linear-gradient(var(--bgColor-attention-muted, var(--bgColor-attention-muted, var(--color-attention-subtle))), var(--color-attention-subtle));border-color:var(--borderColor-attention-muted, var(--color-attention-muted))}.form-group.warn .warning::after{border-bottom-color:var(--borderColor-attention-muted, var(--color-attention-muted))}.form-group.warn .warning::before{border-bottom-color:var(--borderColor-attention-muted, var(--color-attention-muted))}.form-group.errored .form-control:not(:focus,:focus-visible){border-color:var(--borderColor-danger-emphasis, var(--color-danger-emphasis))}.form-group.errored label{color:var(--fgColor-danger, var(--color-danger-fg))}.form-group.errored .error{color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-default, var(--color-canvas-default));background-image:linear-gradient(var(--bgColor-danger-muted, var(--bgColor-danger-muted, var(--color-danger-subtle))), var(--color-danger-subtle));border-color:var(--borderColor-danger-muted, var(--color-danger-muted))}.form-group.errored .error::after{border-bottom-color:var(--borderColor-danger-muted, var(--color-danger-muted))}.form-group.errored .error::before{border-bottom-color:var(--borderColor-danger-muted, var(--color-danger-muted))}.note{min-height:17px;margin:var(--base-size-4) 0 2px;font-size:12px;color:var(--fgColor-muted, var(--color-fg-muted))}.note .spinner{margin-right:3px;vertical-align:middle}.input-group{display:table}.input-group .form-control{position:relative;width:100%}.input-group .form-control:focus{z-index:2}.input-group .form-control+.btn{margin-left:0}.input-group.inline{display:inline-table}.input-group:focus-within button{outline-offset:0}.input-group .form-control.autocomplete-embedded-icon-wrap{display:inline-flex;padding:calc(var(--base-size-4)*1.25) var(--base-size-8)}.input-group .form-control,.input-group-button{display:table-cell}.input-group-button{width:1%;vertical-align:middle}.input-group-button--autocomplete-embedded-icon{vertical-align:bottom}.input-group .form-control:first-child,.input-group-button:first-child .btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group .form-control:first-child,.input-group-button:first-child .btn:not(.btn-primary){border-color:var(--control-borderColor-rest, var(--color-border-default))}.input-group-button:first-child .btn{margin-right:-1px}.input-group .form-control:last-child,.input-group-button:last-child .btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group .form-control:last-child,.input-group-button:last-child .btn:not(.btn-primary){border-color:var(--control-borderColor-rest, var(--color-border-default))}.input-group-button:last-child .btn{margin-left:-1px}.radio-group::before{display:table;content:""}.radio-group::after{display:table;clear:both;content:""}.radio-label{float:left;padding:6px var(--base-size-16) 6px calc(var(--base-size-16) + 12px + var(--base-size-8));margin-left:-1px;font-size:14px;line-height:20px;color:var(--fgColor-default, var(--color-fg-default));cursor:pointer;border:1px solid var(--borderColor-default, var(--color-border-default))}:checked+.radio-label{position:relative;z-index:1;border-color:var(--borderColor-accent-emphasis, var(--color-accent-emphasis))}.radio-label:first-of-type{margin-left:0;border-top-left-radius:6px;border-bottom-left-radius:6px}.radio-label:last-of-type{border-top-right-radius:6px;border-bottom-right-radius:6px}.radio-label .octicon{margin-left:var(--base-size-4);color:var(--fgColor-muted, var(--color-fg-subtle))}.radio-input{z-index:3;float:left;margin:10px calc(var(--base-size-32)*-1) 0 var(--base-size-16)}.radio-input:disabled{position:relative}.radio-input:disabled+.radio-label{color:var(--fgColor-disabled, var(--color-primer-fg-disabled));cursor:default;background-color:var(--bgColor-neutral-muted, var(--color-neutral-subtle))}.radio-input:disabled+.radio-label .octicon{color:inherit}.AppFrame .AppFrame-a11yNav{position:absolute;z-index:1000;display:flex;width:100%;padding:var(--base-size-16, 16px);background:var(--bgColor-inset, var(--color-canvas-inset));padding-block-end:calc(var(--base-size-16, 16px) - var(--borderWidth-thin, 1px));isolation:isolate;align-items:center;gap:var(--base-size-8, 8px)}.AppFrame .AppFrame-a11yNav:not(:focus-within){width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);border:0}.AppFrame .AppFrame-a11yNav:focus-within{top:0;left:0}@media(max-width: 767.98px){.AppFrame .AppFrame-a11yNav:focus-within{justify-content:center}}.AppFrame .AppFrame-a11yLink{transition:none}.AppFrame .AppFrame-a11yLink:not(:focus){display:block;width:var(--base-size-8, 8px);height:var(--base-size-8, 8px);overflow:hidden;text-indent:var(--base-size-128, 128px);pointer-events:none;background:var(--borderColor-default, var(--color-border-default));border-radius:var(--borderRadius-full, 100vh)}.AppFrame .AppFrame-a11yLink:focus{z-index:20;display:grid;width:auto;height:auto;min-height:var(--control-medium-size, 32px);padding:0 var(--control-medium-paddingInline-spacious, 16px);overflow:auto;color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));background:var(--bgColor-accent-emphasis, var(--color-accent-emphasis));border-radius:var(--borderRadius-full, 100vh);align-items:center}@media(pointer: coarse){.AppFrame .AppFrame-a11yLink:focus::after{position:absolute;top:50%;left:50%;width:100%;height:100%;min-height:var(--control-minTarget-coarse, 44px);content:"";transform:translateX(-50%) translateY(-50%)}}@media(prefers-reduced-motion: no-preference){.AppFrame .AppFrame-a11yLink:focus{animation:AppFrame-a11yLink-focus 200ms ease-out}}@keyframes AppFrame-a11yLink-focus{0%{color:var(--fgColor-accent, var(--color-accent-emphasis));transform:scale(0.3, 0.25)}50%{color:var(--fgColor-accent, var(--color-accent-emphasis));transform:scale(1, 1)}55%{color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}100%{transform:scaleX(1)}}.AppFrame .AppFrame-main{display:flex;min-height:100vh;flex-direction:column}@supports(height: 100dvh){.AppFrame .AppFrame-main{min-height:100dvh}}.AppFrame .AppFrame-header-wrapper{position:relative;height:min-content;overflow:visible}.AppFrame .AppFrame-header-wrapper .AppFrame-header{position:sticky;top:0;z-index:1}.AppFrame .AppFrame-header{flex:0 0 auto}.AppFrame .AppFrame-subheader{flex:0 0 auto}.AppFrame .AppFrame-body{flex:1 0;height:100%}.AppFrame .AppFrame-footer{flex:0 0 auto}.container-sm{max-width:544px;margin-right:auto;margin-left:auto}.container-md{max-width:768px;margin-right:auto;margin-left:auto}.container-lg{max-width:1012px;margin-right:auto;margin-left:auto}.container-xl{max-width:1280px;margin-right:auto;margin-left:auto}.col-1{width:8.33333333%}.col-2{width:16.66666666%}.col-3{width:24.99999999%}.col-4{width:33.33333332%}.col-5{width:41.66666665%}.col-6{width:49.99999998%}.col-7{width:58.33333331%}.col-8{width:66.66666664%}.col-9{width:74.99999997%}.col-10{width:83.3333333%}.col-11{width:91.66666663%}.col-12{width:100%}@media(min-width: 544px){.col-sm-1{width:8.33333333%}.col-sm-2{width:16.66666666%}.col-sm-3{width:24.99999999%}.col-sm-4{width:33.33333332%}.col-sm-5{width:41.66666665%}.col-sm-6{width:49.99999998%}.col-sm-7{width:58.33333331%}.col-sm-8{width:66.66666664%}.col-sm-9{width:74.99999997%}.col-sm-10{width:83.3333333%}.col-sm-11{width:91.66666663%}.col-sm-12{width:100%}}@media(min-width: 768px){.col-md-1{width:8.33333333%}.col-md-2{width:16.66666666%}.col-md-3{width:24.99999999%}.col-md-4{width:33.33333332%}.col-md-5{width:41.66666665%}.col-md-6{width:49.99999998%}.col-md-7{width:58.33333331%}.col-md-8{width:66.66666664%}.col-md-9{width:74.99999997%}.col-md-10{width:83.3333333%}.col-md-11{width:91.66666663%}.col-md-12{width:100%}}@media(min-width: 1012px){.col-lg-1{width:8.33333333%}.col-lg-2{width:16.66666666%}.col-lg-3{width:24.99999999%}.col-lg-4{width:33.33333332%}.col-lg-5{width:41.66666665%}.col-lg-6{width:49.99999998%}.col-lg-7{width:58.33333331%}.col-lg-8{width:66.66666664%}.col-lg-9{width:74.99999997%}.col-lg-10{width:83.3333333%}.col-lg-11{width:91.66666663%}.col-lg-12{width:100%}}@media(min-width: 1280px){.col-xl-1{width:8.33333333%}.col-xl-2{width:16.66666666%}.col-xl-3{width:24.99999999%}.col-xl-4{width:33.33333332%}.col-xl-5{width:41.66666665%}.col-xl-6{width:49.99999998%}.col-xl-7{width:58.33333331%}.col-xl-8{width:66.66666664%}.col-xl-9{width:74.99999997%}.col-xl-10{width:83.3333333%}.col-xl-11{width:91.66666663%}.col-xl-12{width:100%}}.gutter{margin-right:calc(var(--base-size-16)*-1);margin-left:calc(var(--base-size-16)*-1)}.gutter>[class*=col-]{padding-right:var(--base-size-16) !important;padding-left:var(--base-size-16) !important}.gutter-condensed{margin-right:calc(var(--base-size-8)*-1);margin-left:calc(var(--base-size-8)*-1)}.gutter-condensed>[class*=col-]{padding-right:var(--base-size-8) !important;padding-left:var(--base-size-8) !important}.gutter-spacious{margin-right:calc(var(--base-size-24)*-1);margin-left:calc(var(--base-size-24)*-1)}.gutter-spacious>[class*=col-]{padding-right:var(--base-size-24) !important;padding-left:var(--base-size-24) !important}@media(min-width: 544px){.gutter-sm{margin-right:calc(var(--base-size-16)*-1);margin-left:calc(var(--base-size-16)*-1)}.gutter-sm>[class*=col-]{padding-right:var(--base-size-16) !important;padding-left:var(--base-size-16) !important}.gutter-sm-condensed{margin-right:calc(var(--base-size-8)*-1);margin-left:calc(var(--base-size-8)*-1)}.gutter-sm-condensed>[class*=col-]{padding-right:var(--base-size-8) !important;padding-left:var(--base-size-8) !important}.gutter-sm-spacious{margin-right:calc(var(--base-size-24)*-1);margin-left:calc(var(--base-size-24)*-1)}.gutter-sm-spacious>[class*=col-]{padding-right:var(--base-size-24) !important;padding-left:var(--base-size-24) !important}}@media(min-width: 768px){.gutter-md{margin-right:calc(var(--base-size-16)*-1);margin-left:calc(var(--base-size-16)*-1)}.gutter-md>[class*=col-]{padding-right:var(--base-size-16) !important;padding-left:var(--base-size-16) !important}.gutter-md-condensed{margin-right:calc(var(--base-size-8)*-1);margin-left:calc(var(--base-size-8)*-1)}.gutter-md-condensed>[class*=col-]{padding-right:var(--base-size-8) !important;padding-left:var(--base-size-8) !important}.gutter-md-spacious{margin-right:calc(var(--base-size-24)*-1);margin-left:calc(var(--base-size-24)*-1)}.gutter-md-spacious>[class*=col-]{padding-right:var(--base-size-24) !important;padding-left:var(--base-size-24) !important}}@media(min-width: 1012px){.gutter-lg{margin-right:calc(var(--base-size-16)*-1);margin-left:calc(var(--base-size-16)*-1)}.gutter-lg>[class*=col-]{padding-right:var(--base-size-16) !important;padding-left:var(--base-size-16) !important}.gutter-lg-condensed{margin-right:calc(var(--base-size-8)*-1);margin-left:calc(var(--base-size-8)*-1)}.gutter-lg-condensed>[class*=col-]{padding-right:var(--base-size-8) !important;padding-left:var(--base-size-8) !important}.gutter-lg-spacious{margin-right:calc(var(--base-size-24)*-1);margin-left:calc(var(--base-size-24)*-1)}.gutter-lg-spacious>[class*=col-]{padding-right:var(--base-size-24) !important;padding-left:var(--base-size-24) !important}}@media(min-width: 1280px){.gutter-xl{margin-right:calc(var(--base-size-16)*-1);margin-left:calc(var(--base-size-16)*-1)}.gutter-xl>[class*=col-]{padding-right:var(--base-size-16) !important;padding-left:var(--base-size-16) !important}.gutter-xl-condensed{margin-right:calc(var(--base-size-8)*-1);margin-left:calc(var(--base-size-8)*-1)}.gutter-xl-condensed>[class*=col-]{padding-right:var(--base-size-8) !important;padding-left:var(--base-size-8) !important}.gutter-xl-spacious{margin-right:calc(var(--base-size-24)*-1);margin-left:calc(var(--base-size-24)*-1)}.gutter-xl-spacious>[class*=col-]{padding-right:var(--base-size-24) !important;padding-left:var(--base-size-24) !important}}.offset-1{margin-left:8.33333333% !important}.offset-2{margin-left:16.66666666% !important}.offset-3{margin-left:24.99999999% !important}.offset-4{margin-left:33.33333332% !important}.offset-5{margin-left:41.66666665% !important}.offset-6{margin-left:49.99999998% !important}.offset-7{margin-left:58.33333331% !important}.offset-8{margin-left:66.66666664% !important}.offset-9{margin-left:74.99999997% !important}.offset-10{margin-left:83.3333333% !important}.offset-11{margin-left:91.66666663% !important}@media(min-width: 544px){.offset-sm-1{margin-left:8.33333333% !important}.offset-sm-2{margin-left:16.66666666% !important}.offset-sm-3{margin-left:24.99999999% !important}.offset-sm-4{margin-left:33.33333332% !important}.offset-sm-5{margin-left:41.66666665% !important}.offset-sm-6{margin-left:49.99999998% !important}.offset-sm-7{margin-left:58.33333331% !important}.offset-sm-8{margin-left:66.66666664% !important}.offset-sm-9{margin-left:74.99999997% !important}.offset-sm-10{margin-left:83.3333333% !important}.offset-sm-11{margin-left:91.66666663% !important}}@media(min-width: 768px){.offset-md-1{margin-left:8.33333333% !important}.offset-md-2{margin-left:16.66666666% !important}.offset-md-3{margin-left:24.99999999% !important}.offset-md-4{margin-left:33.33333332% !important}.offset-md-5{margin-left:41.66666665% !important}.offset-md-6{margin-left:49.99999998% !important}.offset-md-7{margin-left:58.33333331% !important}.offset-md-8{margin-left:66.66666664% !important}.offset-md-9{margin-left:74.99999997% !important}.offset-md-10{margin-left:83.3333333% !important}.offset-md-11{margin-left:91.66666663% !important}}@media(min-width: 1012px){.offset-lg-1{margin-left:8.33333333% !important}.offset-lg-2{margin-left:16.66666666% !important}.offset-lg-3{margin-left:24.99999999% !important}.offset-lg-4{margin-left:33.33333332% !important}.offset-lg-5{margin-left:41.66666665% !important}.offset-lg-6{margin-left:49.99999998% !important}.offset-lg-7{margin-left:58.33333331% !important}.offset-lg-8{margin-left:66.66666664% !important}.offset-lg-9{margin-left:74.99999997% !important}.offset-lg-10{margin-left:83.3333333% !important}.offset-lg-11{margin-left:91.66666663% !important}}@media(min-width: 1280px){.offset-xl-1{margin-left:8.33333333% !important}.offset-xl-2{margin-left:16.66666666% !important}.offset-xl-3{margin-left:24.99999999% !important}.offset-xl-4{margin-left:33.33333332% !important}.offset-xl-5{margin-left:41.66666665% !important}.offset-xl-6{margin-left:49.99999998% !important}.offset-xl-7{margin-left:58.33333331% !important}.offset-xl-8{margin-left:66.66666664% !important}.offset-xl-9{margin-left:74.99999997% !important}.offset-xl-10{margin-left:83.3333333% !important}.offset-xl-11{margin-left:91.66666663% !important}}:root{--Layout-pane-width: 220px;--Layout-content-width: 100%;--Layout-template-columns: 1fr var(--Layout-pane-width);--Layout-template-areas: "content pane";--Layout-column-gap: var(--base-size-16);--Layout-row-gap: var(--base-size-16);--Layout-outer-spacing-x: 0px;--Layout-outer-spacing-y: 0px;--Layout-inner-spacing-min: 0px;--Layout-inner-spacing-max: 0px}.PageLayout{display:block;margin:var(--Layout-outer-spacing-y) var(--Layout-outer-spacing-x)}@media(min-width: 768px){.PageLayout.PageLayout--panePos-start{--Layout-template-columns: var(--Layout-pane-width) minmax(0, calc(100% - var(--Layout-pane-width) - var(--Layout-column-gap)));--Layout-template-areas: "pane content"}.PageLayout.PageLayout--panePos-end{--Layout-template-columns: minmax(0, calc(100% - var(--Layout-pane-width) - var(--Layout-column-gap))) var(--Layout-pane-width);--Layout-template-areas: "content pane"}.PageLayout .PageLayout-header--hasDivider{padding-bottom:max(var(--Layout-row-gap),var(--Layout-inner-spacing-min));border-bottom:1px solid var(--borderColor-default, var(--color-border-default))}.PageLayout .PageLayout-footer--hasDivider{padding-top:max(var(--Layout-row-gap),var(--Layout-inner-spacing-min));border-top:1px solid var(--borderColor-default, var(--color-border-default))}.PageLayout.PageLayout--hasPaneDivider.PageLayout--panePos-start .PageLayout-pane{border-right:1px solid var(--borderColor-default, var(--color-border-default))}.PageLayout.PageLayout--hasPaneDivider.PageLayout--panePos-start:not(.PageLayout--columnGap-none) .PageLayout-pane{padding-right:calc(var(--Layout-column-gap) - 1px);margin-right:calc(var(--Layout-column-gap)*-1)}.PageLayout.PageLayout--hasPaneDivider.PageLayout--panePos-start:not(.PageLayout--columnGap-none) .PageLayout-content{margin-left:var(--Layout-column-gap)}.PageLayout.PageLayout--hasPaneDivider.PageLayout--panePos-end .PageLayout-pane{border-left:1px solid var(--borderColor-default, var(--color-border-default))}.PageLayout.PageLayout--hasPaneDivider.PageLayout--panePos-end:not(.PageLayout--columnGap-none) .PageLayout-pane{padding-left:calc(var(--Layout-column-gap) - 1px);margin-left:calc(var(--Layout-column-gap)*-1)}.PageLayout.PageLayout--hasPaneDivider.PageLayout--panePos-end:not(.PageLayout--columnGap-none) .PageLayout-content{margin-right:var(--Layout-column-gap)}.PageLayout .PageLayout-pane--sticky{position:sticky;top:0;max-height:100vh;overflow:auto;scrollbar-width:thin}@supports(max-height: 100dvh){.PageLayout .PageLayout-pane--sticky{max-height:100dvh}}.PageLayout [class^=PageLayout-content-centered-]{max-width:calc(var(--Layout-content-width) + var(--Layout-pane-width) + var(--Layout-column-gap));margin-right:auto;margin-left:auto}.PageLayout.PageLayout--hasPaneDivider [class^=PageLayout-content-centered-]{max-width:calc(var(--Layout-content-width) + var(--Layout-pane-width) + var(--Layout-column-gap)*2)}.PageLayout.PageLayout--panePos-start [class^=PageLayout-content-centered-]>[class^=container-]{margin-left:0}.PageLayout.PageLayout--panePos-end [class^=PageLayout-content-centered-]>[class^=container-]{margin-right:0}.PageLayout .PageLayout-content-centered-sm{--Layout-content-width: 544px}.PageLayout .PageLayout-content-centered-md{--Layout-content-width: 768px}.PageLayout .PageLayout-content-centered-lg{--Layout-content-width: 1012px}.PageLayout .PageLayout-content-centered-xl{--Layout-content-width: 1280px}}@media(min-width: 768px)and (min-width: 544px){.PageLayout{--Layout-pane-width: 220px}}@media(min-width: 768px)and (min-width: 768px){.PageLayout{--Layout-pane-width: 256px}}@media(min-width: 768px)and (min-width: 1012px){.PageLayout{--Layout-pane-width: 296px}}@media(min-width: 768px)and (min-width: 768px){.PageLayout.PageLayout--paneWidth-narrow{--Layout-pane-width: 240px}}@media(min-width: 768px)and (min-width: 1012px){.PageLayout.PageLayout--paneWidth-narrow{--Layout-pane-width: 256px}}@media(min-width: 768px)and (min-width: 1012px){.PageLayout.PageLayout--paneWidth-wide{--Layout-pane-width: 320px}}@media(min-width: 768px)and (min-width: 1280px){.PageLayout.PageLayout--paneWidth-wide{--Layout-pane-width: 336px}}@media(max-width: 767.98px){.PageLayout.PageLayout--responsive-stackRegions{--Layout-template-columns: 1fr;--Layout-template-areas: "content" "pane"}.PageLayout.PageLayout--responsive-stackRegions.PageLayout--responsive-panePos-start{--Layout-template-areas: "pane" "content"}.PageLayout.PageLayout--responsive-separateRegions{--Layout-template-columns: 1fr;--Layout-template-areas: "content"}.PageLayout.PageLayout--responsive-separateRegions.PageLayout--responsive-primary-content{--Layout-template-areas: "content"}.PageLayout.PageLayout--responsive-separateRegions.PageLayout--responsive-primary-content .PageLayout-pane{display:none}.PageLayout.PageLayout--responsive-separateRegions.PageLayout--responsive-primary-pane{--Layout-template-areas: "pane"}.PageLayout.PageLayout--responsive-separateRegions.PageLayout--responsive-primary-pane .PageLayout-content{display:none}.PageLayout .PageLayout-region--dividerNarrow-line-before{position:relative;margin-top:var(--Layout-row-gap)}.PageLayout .PageLayout-region--dividerNarrow-line-before::before{position:absolute;left:calc(var(--Layout-outer-spacing-x)*-1);display:block;width:calc(100% + var(--Layout-outer-spacing-x)*2);height:1px;content:"";background-color:var(--borderColor-default, var(--color-border-default));top:calc(-1px - var(--Layout-row-gap))}.PageLayout .PageLayout-region--dividerNarrow-line-after{position:relative;margin-bottom:var(--Layout-row-gap)}.PageLayout .PageLayout-region--dividerNarrow-line-after::after{position:absolute;left:calc(var(--Layout-outer-spacing-x)*-1);display:block;width:calc(100% + var(--Layout-outer-spacing-x)*2);height:1px;content:"";background-color:var(--borderColor-default, var(--color-border-default));bottom:calc(-1px - var(--Layout-row-gap))}.PageLayout .PageLayout-region--dividerNarrow-filled-before{position:relative;margin-top:calc(var(--base-size-8) + var(--Layout-row-gap))}.PageLayout .PageLayout-region--dividerNarrow-filled-before::after{position:absolute;bottom:calc(var(--base-size-8)*-1);left:calc(var(--Layout-outer-spacing-x)*-1);display:block;width:calc(100% + var(--Layout-outer-spacing-x)*2);height:var(--base-size-8);content:"";background-color:var(--bgColor-inset, var(--color-canvas-inset));box-shadow:inset 0 1px var(--borderColor-default, var(--color-border-default)),inset 0 -1px var(--borderColor-default, var(--color-border-default));top:calc(var(--base-size-8)*-1 - var(--Layout-row-gap))}.PageLayout .PageLayout-region--dividerNarrow-filled-after{position:relative;margin-bottom:calc(var(--base-size-8) + var(--Layout-row-gap))}.PageLayout .PageLayout-region--dividerNarrow-filled-after::before{position:absolute;bottom:calc(var(--base-size-8)*-1);left:calc(var(--Layout-outer-spacing-x)*-1);display:block;width:calc(100% + var(--Layout-outer-spacing-x)*2);height:var(--base-size-8);content:"";background-color:var(--bgColor-inset, var(--color-canvas-inset));box-shadow:inset 0 1px var(--borderColor-default, var(--color-border-default)),inset 0 -1px var(--borderColor-default, var(--color-border-default));bottom:calc(var(--base-size-8)*-1 - var(--Layout-row-gap))}}.PageLayout-wrapper{display:grid;grid:auto-flow/1fr;row-gap:var(--Layout-row-gap)}.PageLayout-columns{display:grid;column-gap:var(--Layout-column-gap);row-gap:var(--Layout-row-gap);grid-template-columns:var(--Layout-template-columns);grid-template-rows:1fr;grid-template-areas:var(--Layout-template-areas)}.PageLayout-columns .PageLayout-content{padding-right:var(--Layout-inner-spacing-max);padding-left:var(--Layout-inner-spacing-max);grid-area:content}.PageLayout-columns .PageLayout-pane{grid-area:pane}.PageLayout--outerSpacing-normal{--Layout-outer-spacing-x: var(--base-size-16);--Layout-outer-spacing-y: var(--base-size-16)}@media(min-width: 1012px){.PageLayout--outerSpacing-normal{--Layout-outer-spacing-x: var(--base-size-24);--Layout-outer-spacing-y: var(--base-size-24)}}.PageLayout--outerSpacing-condensed{--Layout-outer-spacing-x: var(--base-size-16);--Layout-outer-spacing-y: var(--base-size-16)}.PageLayout--innerSpacing-normal{--Layout-inner-spacing-min: var(--base-size-16);--Layout-inner-spacing-max: var(--base-size-16)}@media(min-width: 1012px){.PageLayout--innerSpacing-normal{--Layout-inner-spacing-max: var(--base-size-24)}}.PageLayout--innerSpacing-condensed{--Layout-inner-spacing-min: var(--base-size-16);--Layout-inner-spacing-max: var(--base-size-16)}.PageLayout--columnGap-normal{--Layout-column-gap: var(--base-size-16)}@media(min-width: 1012px){.PageLayout--columnGap-normal{--Layout-column-gap: var(--base-size-24)}}.PageLayout--columnGap-condensed{--Layout-column-gap: var(--base-size-16)}.PageLayout--columnGap-none{--Layout-column-gap: 0px}.PageLayout--rowGap-normal{--Layout-row-gap: var(--base-size-16)}@media(min-width: 1012px){.PageLayout--rowGap-normal{--Layout-row-gap: var(--base-size-24)}}.PageLayout--rowGap-none{--Layout-row-gap: 0px}.PageLayout--rowGap-condensed{--Layout-row-gap: var(--base-size-16)}.PageLayout-header,.PageLayout-content,.PageLayout-pane,.PageLayout-footer{padding:var(--Layout-inner-spacing-min)}.Stack{--Stack-gap-whenRegular: var(--stack-gap-normal, 16px);--Stack-gap-whenNarrow: var(--stack-gap-normal, 16px);--Stack-gap-whenWide: var(--Stack-gap-whenRegular);--Stack-divider-color: var(--borderColor-default, var(--color-border-default));display:flex;flex-flow:column;align-items:stretch;align-content:flex-start;gap:var(--Stack-gap-whenRegular)}@media(max-width: 767.98px){.Stack{gap:var(--Stack-gap-whenNarrow)}}@media(min-width: 1400px){.Stack{gap:var(--Stack-gap-whenWide)}}.Stack-divider{display:none;padding:0;margin:0;border:0;align-self:stretch}.Stack-item{flex:0 1 auto;min-inline-size:0}@media(max-width: 767.98px){.Stack--dir-inline-whenNarrow{flex-flow:row}.Stack--dir-block-whenNarrow{flex-flow:column}.Stack--gap-none-whenNarrow{--Stack-gap-whenNarrow: 0}.Stack--gap-condensed-whenNarrow{--Stack-gap-whenNarrow: var(--stack-gap-condensed, 8px)}.Stack--gap-normal-whenNarrow{--Stack-gap-whenNarrow: var(--stack-gap-normal, 16px)}.Stack--align-start-whenNarrow{align-items:flex-start}.Stack--align-center-whenNarrow{align-items:center}.Stack--align-end-whenNarrow{align-items:flex-end}.Stack--align-baseline-whenNarrow{align-items:baseline}.Stack--alignWrap-start-whenNarrow{align-content:flex-start}.Stack--alignWrap-center-whenNarrow{align-content:center}.Stack--alignWrap-end-whenNarrow{align-content:flex-end}.Stack--alignWrap-distribute-whenNarrow{align-content:space-between}.Stack--alignWrap-distributeEvenly-whenNarrow{align-content:space-evenly}.Stack--spread-start-whenNarrow{justify-content:flex-start}.Stack--spread-center-whenNarrow{justify-content:center}.Stack--spread-end-whenNarrow{justify-content:flex-end}.Stack--spread-distribute-whenNarrow{justify-content:space-between}.Stack--spread-distributeEvenly-whenNarrow{justify-content:space-evenly}.Stack--wrap-whenNarrow{flex-wrap:wrap}.Stack--nowrap-whenNarrow{flex-wrap:nowrap}.Stack--showDividers-whenNarrow>.Stack-divider,.Stack--showDividers-whenNarrow>.Stack-item>.Stack-divider{display:block}:not(.Stack--dir-inline-whenNarrow)>.Stack-divider,:not(.Stack--dir-inline-whenNarrow)>.Stack-item>.Stack-divider{border-block-end:var(--borderWidth-thin, var(--borderWidth-thin)) solid var(--Stack-divider-color);inline-size:auto;block-size:0}.Stack--dir-inline-whenNarrow>.Stack-divider,.Stack--dir-inline-whenNarrow>.Stack-item>.Stack-divider{border-inline-end:var(--borderWidth-thin, var(--borderWidth-thin)) solid var(--Stack-divider-color);inline-size:0;block-size:auto}.Stack-item--expand-whenNarrow{flex-grow:1}.Stack-item--keepSize-whenNarrow{flex-shrink:0}}@media(min-width: 768px){.Stack--dir-inline-whenRegular{flex-flow:row}.Stack--dir-block-whenRegular{flex-flow:column}.Stack--gap-none-whenRegular{--Stack-gap-whenRegular: 0}.Stack--gap-condensed-whenRegular{--Stack-gap-whenRegular: var(--stack-gap-condensed, 8px)}.Stack--gap-normal-whenRegular{--Stack-gap-whenRegular: var(--stack-gap-normal, 16px)}.Stack--gap-spacious-whenRegular{--Stack-gap-whenRegular: var(--stack-gap-spacious, 24px)}.Stack--align-start-whenRegular{align-items:flex-start}.Stack--align-center-whenRegular{align-items:center}.Stack--align-end-whenRegular{align-items:flex-end}.Stack--align-baseline-whenRegular{align-items:baseline}.Stack--alignWrap-start-whenRegular{align-content:flex-start}.Stack--alignWrap-center-whenRegular{align-content:center}.Stack--alignWrap-end-whenRegular{align-content:flex-end}.Stack--alignWrap-distribute-whenRegular{align-content:space-between}.Stack--alignWrap-distributeEvenly-whenRegular{align-content:space-evenly}.Stack--spread-start-whenRegular{justify-content:flex-start}.Stack--spread-center-whenRegular{justify-content:center}.Stack--spread-end-whenRegular{justify-content:flex-end}.Stack--spread-distribute-whenRegular{justify-content:space-between}.Stack--spread-distributeEvenly-whenRegular{justify-content:space-evenly}.Stack--wrap-whenRegular{flex-wrap:wrap}.Stack--nowrap-whenRegular{flex-wrap:nowrap}.Stack--showDividers-whenRegular>.Stack-divider,.Stack--showDividers-whenRegular>.Stack-item>.Stack-divider{display:block}:not(.Stack--dir-inline-whenRegular)>.Stack-divider,:not(.Stack--dir-inline-whenRegular)>.Stack-item>.Stack-divider{border-block-end:var(--borderWidth-thin, var(--borderWidth-thin)) solid var(--Stack-divider-color);inline-size:auto;block-size:0}.Stack--dir-inline-whenRegular>.Stack-divider,.Stack--dir-inline-whenRegular>.Stack-item>.Stack-divider{border-inline-end:var(--borderWidth-thin, var(--borderWidth-thin)) solid var(--Stack-divider-color);inline-size:0;block-size:auto}.Stack-item--expand-whenRegular{flex-grow:1}.Stack-item--keepSize-whenRegular{flex-shrink:0}}@media(min-width: 1400px){.Stack--dir-inline-whenWide{flex-flow:row}.Stack--dir-block-whenWide{flex-flow:column}.Stack--gap-none-whenWide{--Stack-gap-whenWide: 0}.Stack--gap-condensed-whenWide{--Stack-gap-whenWide: var(--stack-gap-condensed, 8px)}.Stack--gap-normal-whenWide{--Stack-gap-whenWide: var(--stack-gap-normal, 16px)}.Stack--gap-spacious-whenWide{--Stack-gap-whenWide: var(--stack-gap-spacious, 24px)}.Stack--align-start-whenWide{align-items:flex-start}.Stack--align-center-whenWide{align-items:center}.Stack--align-end-whenWide{align-items:flex-end}.Stack--align-baseline-whenWide{align-items:baseline}.Stack--alignWrap-start-whenWide{align-content:flex-start}.Stack--alignWrap-center-whenWide{align-content:center}.Stack--alignWrap-end-whenWide{align-content:flex-end}.Stack--alignWrap-distribute-whenWide{align-content:space-between}.Stack--alignWrap-distributeEvenly-whenWide{align-content:space-evenly}.Stack--spread-start-whenWide{justify-content:flex-start}.Stack--spread-center-whenWide{justify-content:center}.Stack--spread-end-whenWide{justify-content:flex-end}.Stack--spread-distribute-whenWide{justify-content:space-between}.Stack--spread-distributeEvenly-whenWide{justify-content:space-evenly}.Stack--wrap-whenWide{flex-wrap:wrap}.Stack--nowrap-whenWide{flex-wrap:nowrap}.Stack--showDividers-whenWide>.Stack-divider,.Stack--showDividers-whenWide>.Stack-item>.Stack-divider{display:block}:not(.Stack--dir-inline-whenWide)>.Stack-divider,:not(.Stack--dir-inline-whenWide)>.Stack-item>.Stack-divider{border-block-end:var(--borderWidth-thin, var(--borderWidth-thin)) solid var(--Stack-divider-color);inline-size:auto;block-size:0}.Stack--dir-inline-whenWide>.Stack-divider,.Stack--dir-inline-whenWide>.Stack-item>.Stack-divider{border-inline-end:var(--borderWidth-thin, var(--borderWidth-thin)) solid var(--Stack-divider-color);inline-size:0;block-size:auto}.Stack-item--expand-whenWide{flex-grow:1}.Stack-item--keepSize-whenWide{flex-shrink:0}}.filter-list{list-style-type:none}.filter-list.small .filter-item{padding:6px 12px;font-size:12px}.filter-list.pjax-active .filter-item{color:var(--fgColor-muted, var(--color-fg-muted));background-color:rgba(0,0,0,0)}.filter-list.pjax-active .filter-item.pjax-active{color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));background-color:var(--bgColor-accent-emphasis, var(--color-accent-emphasis))}.filter-item{position:relative;display:block;padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-4);overflow:hidden;font-size:14px;color:var(--fgColor-muted, var(--color-fg-muted));text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;border-radius:6px}.filter-item:hover{text-decoration:none;background-color:var(--bgColor-muted, var(--color-canvas-subtle))}.filter-item.selected,.filter-item[aria-selected=true],.filter-item[aria-current]:not([aria-current=false]){color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));background-color:var(--bgColor-accent-emphasis, var(--color-accent-emphasis))}.filter-item.selected:focus,.filter-item[aria-selected=true]:focus,.filter-item[aria-current]:not([aria-current=false]):focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.filter-item.selected:focus:not(:focus-visible),.filter-item[aria-selected=true]:focus:not(:focus-visible),.filter-item[aria-current]:not([aria-current=false]):focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0);box-shadow:none}.filter-item.selected:focus-visible,.filter-item[aria-selected=true]:focus-visible,.filter-item[aria-current]:not([aria-current=false]):focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.filter-item .count{float:right;font-weight:var(--base-text-weight-semibold, 600)}.filter-item .bar{position:absolute;top:var(--base-size-2);right:0;bottom:var(--base-size-2);z-index:-1;display:inline-block;background-color:var(--bgColor-neutral-muted, var(--color-neutral-subtle))}.SideNav{background-color:var(--bgColor-muted, var(--color-canvas-subtle))}.SideNav-item{position:relative;display:block;width:100%;padding:12px var(--base-size-16);color:var(--fgColor-default, var(--color-fg-default));text-align:left;background-color:rgba(0,0,0,0);border:0;border-top:1px solid var(--borderColor-muted, var(--color-border-muted))}.SideNav-item:first-child{border-top:0}.SideNav-item:last-child{box-shadow:0 1px 0 var(--borderColor-default, var(--color-border-default))}.SideNav-item::before{position:absolute;top:0;bottom:0;left:0;z-index:1;width:2px;pointer-events:none;content:""}.SideNav-item:hover{text-decoration:none;background-color:var(--bgColor-neutral-muted, var(--color-neutral-subtle))}.SideNav-item:active{background-color:var(--bgColor-muted, var(--color-canvas-subtle))}.SideNav-item[aria-current]:not([aria-current=false]),.SideNav-item[aria-selected=true]{background-color:var(--sideNav-bgColor-selected, var(--color-sidenav-selected-bg))}.SideNav-item[aria-current]:not([aria-current=false])::before,.SideNav-item[aria-selected=true]::before{background-color:var(--underlineNav-borderColor-active, var(--color-primer-border-active))}.SideNav-icon{width:16px;margin-right:var(--base-size-8);color:var(--fgColor-muted, var(--color-fg-muted))}.SideNav-subItem{position:relative;display:block;width:100%;padding:var(--base-size-4) 0;color:var(--fgColor-accent, var(--color-accent-fg));text-align:left;background-color:rgba(0,0,0,0);border:0}.SideNav-subItem:hover{color:var(--fgColor-default, var(--color-fg-default));text-decoration:none}.SideNav-subItem[aria-current]:not([aria-current=false]),.SideNav-subItem[aria-selected=true]{font-weight:var(--base-text-weight-medium, 500);color:var(--fgColor-default, var(--color-fg-default))}.subnav{margin-bottom:20px}.subnav::before{display:table;content:""}.subnav::after{display:table;clear:both;content:""}.subnav-bordered{padding-bottom:20px;border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}.subnav-flush{margin-bottom:0}.subnav-item{position:relative;float:left;padding:5px var(--base-size-16);font-weight:var(--base-text-weight-medium, 500);line-height:20px;color:var(--fgColor-default, var(--color-fg-default));border:1px solid var(--control-borderColor-rest, var(--color-border-default))}.subnav-item+.subnav-item{margin-left:-1px}.subnav-item:hover,.subnav-item:focus{text-decoration:none;background-color:var(--bgColor-muted, var(--color-canvas-subtle))}.subnav-item.selected,.subnav-item[aria-selected=true],.subnav-item[aria-current]:not([aria-current=false]){z-index:2;color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));background-color:var(--bgColor-accent-emphasis, var(--color-accent-emphasis));border-color:var(--borderColor-accent-emphasis, var(--color-accent-emphasis))}.subnav-item.selected:focus,.subnav-item[aria-selected=true]:focus,.subnav-item[aria-current]:not([aria-current=false]):focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.subnav-item.selected:focus:not(:focus-visible),.subnav-item[aria-selected=true]:focus:not(:focus-visible),.subnav-item[aria-current]:not([aria-current=false]):focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0);box-shadow:none}.subnav-item.selected:focus-visible,.subnav-item[aria-selected=true]:focus-visible,.subnav-item[aria-current]:not([aria-current=false]):focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.subnav-item:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}.subnav-item:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px}.subnav-search{position:relative;margin-left:12px}.subnav-search-input{width:320px;padding-left:var(--base-size-32);color:var(--fgColor-muted, var(--color-fg-muted))}.subnav-search-input-wide{width:500px}.subnav-search-icon{position:absolute;top:9px;left:var(--base-size-8);display:block;color:var(--fgColor-muted, var(--color-fg-muted));text-align:center;pointer-events:none}.subnav-search-context .btn{border-top-right-radius:0;border-bottom-right-radius:0}.subnav-search-context .btn:hover,.subnav-search-context .btn:focus,.subnav-search-context .btn:active,.subnav-search-context .btn.selected{z-index:2}.subnav-search-context+.subnav-search{margin-left:-1px}.subnav-search-context+.subnav-search .subnav-search-input{border-top-left-radius:0;border-bottom-left-radius:0}.subnav-search-context .select-menu-modal-holder{z-index:30}.subnav-search-context .select-menu-modal{width:220px}.subnav-search-context .select-menu-item-icon{color:inherit}.subnav-spacer-right{padding-right:12px}.pagination a,.pagination span,.pagination em{min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:var(--fgColor-default, var(--color-fg-default));text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid rgba(0,0,0,0);border-radius:6px;transition:border-color .2s cubic-bezier(0.3, 0, 0.5, 1)}.pagination a:hover,.pagination a:focus,.pagination span:hover,.pagination span:focus,.pagination em:hover,.pagination em:focus{text-decoration:none;border-color:var(--borderColor-default, var(--color-border-default));transition-duration:.1s}.pagination a:active,.pagination span:active,.pagination em:active{border-color:var(--borderColor-muted, var(--color-border-muted));transition:none}.pagination .previous_page,.pagination .next_page{color:var(--fgColor-accent, var(--color-accent-fg))}.pagination .current,.pagination .current:hover,.pagination [aria-current]:not([aria-current=false]){color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));background-color:var(--bgColor-accent-emphasis, var(--color-accent-emphasis));border-color:rgba(0,0,0,0)}.pagination .gap,.pagination .disabled,.pagination [aria-disabled=true],.pagination .gap:hover,.pagination .disabled:hover,.pagination [aria-disabled=true]:hover{color:var(--fgColor-disabled, var(--color-primer-fg-disabled));cursor:default;border-color:rgba(0,0,0,0)}@supports(clip-path: polygon(50% 0, 100% 50%, 50% 100%)){.pagination .previous_page::before,.pagination .next_page::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:"";background-color:currentColor}.pagination .previous_page::before{margin-right:var(--base-size-4);clip-path:polygon(9.8px 12.8px, 8.7px 12.8px, 4.5px 8.5px, 4.5px 7.5px, 8.7px 3.2px, 9.8px 4.3px, 6.1px 8px, 9.8px 11.7px, 9.8px 12.8px)}.pagination .next_page::after{margin-left:var(--base-size-4);clip-path:polygon(6.2px 3.2px, 7.3px 3.2px, 11.5px 7.5px, 11.5px 8.5px, 7.3px 12.8px, 6.2px 11.7px, 9.9px 8px, 6.2px 4.3px, 6.2px 3.2px)}}.pagination>*{display:none}.pagination>:first-child,.pagination>:last-child,.pagination>.previous_page,.pagination>.next_page{display:inline-block}@media(min-width: 544px){.pagination>:nth-child(2),.pagination>:nth-last-child(2),.pagination>.current,.pagination>.gap{display:inline-block}}@media(min-width: 768px){.pagination>*{display:inline-block}}.paginate-container{margin-top:var(--base-size-16);margin-bottom:var(--base-size-16);text-align:center}.paginate-container .pagination{display:inline-block}.tooltipped{position:relative}.tooltipped::after{position:absolute;z-index:1000000;display:none;padding:var(--overlay-paddingBlock-condensed, 0.25rem) var(--overlay-padding-condensed, 0.5rem);font:var(--text-body-shorthand-small, normal normal 11px/1.5 var(--fontStack-sansSerif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"));-webkit-font-smoothing:subpixel-antialiased;color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));border-radius:var(--borderRadius-medium);opacity:0}@keyframes tooltip-appear{from{opacity:0}to{opacity:1}}.tooltipped:hover::before,.tooltipped:hover::after,.tooltipped:active::before,.tooltipped:active::after,.tooltipped:focus::before,.tooltipped:focus::after{display:inline-block;text-decoration:none;animation-name:tooltip-appear;animation-duration:.1s;animation-fill-mode:forwards;animation-timing-function:ease-in}.tooltipped-no-delay:hover::before,.tooltipped-no-delay:hover::after,.tooltipped-no-delay:active::before,.tooltipped-no-delay:active::after,.tooltipped-no-delay:focus::before,.tooltipped-no-delay:focus::after{animation-delay:0s}.tooltipped-multiline:hover::after,.tooltipped-multiline:active::after,.tooltipped-multiline:focus::after{display:table-cell}.tooltipped-s::after,.tooltipped-se::after,.tooltipped-sw::after{top:100%;right:50%;margin-top:6px}.tooltipped-se::after{right:auto;left:50%;margin-left:calc(var(--base-size-16)*-1)}.tooltipped-sw::after{margin-right:calc(var(--base-size-16)*-1)}.tooltipped-n::after,.tooltipped-ne::after,.tooltipped-nw::after{right:50%;bottom:100%;margin-bottom:6px}.tooltipped-ne::after{right:auto;left:50%;margin-left:calc(var(--base-size-16)*-1)}.tooltipped-nw::after{margin-right:calc(var(--base-size-16)*-1)}.tooltipped-s::after,.tooltipped-n::after{transform:translateX(50%)}.tooltipped-w::after{right:100%;bottom:50%;margin-right:6px;transform:translateY(50%)}.tooltipped-e::after{bottom:50%;left:100%;margin-left:6px;transform:translateY(50%)}.tooltipped-align-right-1::after,.tooltipped-align-right-2::after{right:0;margin-right:0}.tooltipped-align-right-1::before{right:10px}.tooltipped-align-right-2::before{right:15px}.tooltipped-align-left-1::after,.tooltipped-align-left-2::after{left:0;margin-left:0}.tooltipped-align-left-1::before{left:5px}.tooltipped-align-left-2::before{left:10px}.tooltipped-multiline::after{width:max-content;max-width:var(--overlay-width-small, 20rem);word-wrap:break-word;white-space:pre-line;border-collapse:separate}.tooltipped-multiline.tooltipped-s::after,.tooltipped-multiline.tooltipped-n::after{right:auto;left:50%;transform:translateX(-50%)}.tooltipped-multiline.tooltipped-w::after,.tooltipped-multiline.tooltipped-e::after{right:100%}.tooltipped-sticky::before,.tooltipped-sticky::after{display:inline-block}.tooltipped-sticky.tooltipped-multiline::after{display:table-cell}.anim-fade-in{animation-name:fade-in;animation-duration:1s;animation-timing-function:ease-in-out}.anim-fade-in.fast{animation-duration:300ms}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}.anim-fade-out{animation-name:fade-out;animation-duration:1s;animation-fill-mode:forwards;animation-timing-function:ease-out}.anim-fade-out.fast{animation-duration:.3s}@keyframes fade-out{0%{opacity:1}100%{opacity:0}}.anim-fade-up{opacity:0;animation-name:fade-up;animation-duration:.3s;animation-fill-mode:forwards;animation-timing-function:ease-out;animation-delay:1s}@keyframes fade-up{0%{opacity:.8;transform:translateY(100%)}100%{opacity:1;transform:translateY(0)}}.anim-fade-down{animation-name:fade-down;animation-duration:.3s;animation-fill-mode:forwards;animation-timing-function:ease-in}@keyframes fade-down{0%{opacity:1;transform:translateY(0)}100%{opacity:.5;transform:translateY(100%)}}.anim-grow-x{width:0%;animation-name:grow-x;animation-duration:.3s;animation-fill-mode:forwards;animation-timing-function:ease;animation-delay:.5s}@keyframes grow-x{to{width:100%}}.anim-shrink-x{animation-name:shrink-x;animation-duration:.3s;animation-fill-mode:forwards;animation-timing-function:ease-in-out;animation-delay:.5s}@keyframes shrink-x{to{width:0%}}.anim-scale-in{animation-name:scale-in;animation-duration:.15s;animation-timing-function:cubic-bezier(0.2, 0, 0.13, 1.5)}@keyframes scale-in{0%{opacity:0;transform:scale(0.5)}100%{opacity:1;transform:scale(1)}}.anim-pulse{animation-name:pulse;animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite}@keyframes pulse{0%{opacity:.3}10%{opacity:1}100%{opacity:.3}}.anim-pulse-in{animation-name:pulse-in;animation-duration:.5s}@keyframes pulse-in{0%{transform:scale3d(1, 1, 1)}50%{transform:scale3d(1.1, 1.1, 1.1)}100%{transform:scale3d(1, 1, 1)}}.hover-grow,.anim-hover-grow{transition:transform .3s;backface-visibility:hidden}.hover-grow:hover,.anim-hover-grow:hover{transform:scale(1.025)}.anim-rotate{animation:rotate-keyframes 1s linear infinite}@keyframes rotate-keyframes{100%{transform:rotate(360deg)}}.border-x{border-right:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important;border-left:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-y{border-top:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important;border-bottom:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border{border:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-0{border:0 !important}.border-top{border-top:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-right{border-right:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-bottom{border-bottom:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-left{border-left:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-top-0{border-top:0 !important}.border-right-0{border-right:0 !important}.border-bottom-0{border-bottom:0 !important}.border-left-0{border-left:0 !important}.rounded{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-0{border-radius:0 !important}.rounded-1{border-radius:var(--borderRadius-small, 4px) !important}.rounded-2{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-3{border-radius:var(--borderRadius-large, 8px) !important}.rounded-top-0{border-top-left-radius:0 !important;border-top-right-radius:0 !important}.rounded-top-1{border-top-left-radius:var(--borderRadius-small, 4px) !important;border-top-right-radius:var(--borderRadius-small, 4px) !important}.rounded-top-2{border-top-left-radius:var(--borderRadius-medium, 6px) !important;border-top-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-top-3{border-top-left-radius:var(--borderRadius-medium, 8px) !important;border-top-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-right-0{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important}.rounded-right-1{border-top-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-right-radius:var(--borderRadius-small, 4px) !important}.rounded-right-2{border-top-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-right-3{border-top-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-bottom-0{border-bottom-right-radius:0 !important;border-bottom-left-radius:0 !important}.rounded-bottom-1{border-bottom-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-left-radius:var(--borderRadius-small, 4px) !important}.rounded-bottom-2{border-bottom-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-bottom-3{border-bottom-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-left-radius:var(--borderRadius-medium, 8px) !important}.rounded-left-0{border-bottom-left-radius:0 !important;border-top-left-radius:0 !important}.rounded-left-1{border-bottom-left-radius:var(--borderRadius-small, 4px) !important;border-top-left-radius:var(--borderRadius-small, 4px) !important}.rounded-left-2{border-bottom-left-radius:var(--borderRadius-medium, 6px) !important;border-top-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-left-3{border-bottom-left-radius:var(--borderRadius-medium, 8px) !important;border-top-left-radius:var(--borderRadius-medium, 8px) !important}@media(min-width: 544px){.border-sm{border:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-sm-0{border:0 !important}.border-sm-top{border-top:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-sm-right{border-right:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-sm-bottom{border-bottom:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-sm-left{border-left:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-sm-top-0{border-top:0 !important}.border-sm-right-0{border-right:0 !important}.border-sm-bottom-0{border-bottom:0 !important}.border-sm-left-0{border-left:0 !important}.rounded-sm{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-sm-0{border-radius:0 !important}.rounded-sm-1{border-radius:var(--borderRadius-small, 4px) !important}.rounded-sm-2{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-sm-3{border-radius:var(--borderRadius-large, 8px) !important}.rounded-sm-top-0{border-top-left-radius:0 !important;border-top-right-radius:0 !important}.rounded-sm-top-1{border-top-left-radius:var(--borderRadius-small, 4px) !important;border-top-right-radius:var(--borderRadius-small, 4px) !important}.rounded-sm-top-2{border-top-left-radius:var(--borderRadius-medium, 6px) !important;border-top-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-sm-top-3{border-top-left-radius:var(--borderRadius-medium, 8px) !important;border-top-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-sm-right-0{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important}.rounded-sm-right-1{border-top-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-right-radius:var(--borderRadius-small, 4px) !important}.rounded-sm-right-2{border-top-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-sm-right-3{border-top-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-sm-bottom-0{border-bottom-right-radius:0 !important;border-bottom-left-radius:0 !important}.rounded-sm-bottom-1{border-bottom-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-left-radius:var(--borderRadius-small, 4px) !important}.rounded-sm-bottom-2{border-bottom-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-sm-bottom-3{border-bottom-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-left-radius:var(--borderRadius-medium, 8px) !important}.rounded-sm-left-0{border-bottom-left-radius:0 !important;border-top-left-radius:0 !important}.rounded-sm-left-1{border-bottom-left-radius:var(--borderRadius-small, 4px) !important;border-top-left-radius:var(--borderRadius-small, 4px) !important}.rounded-sm-left-2{border-bottom-left-radius:var(--borderRadius-medium, 6px) !important;border-top-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-sm-left-3{border-bottom-left-radius:var(--borderRadius-medium, 8px) !important;border-top-left-radius:var(--borderRadius-medium, 8px) !important}}@media(min-width: 768px){.border-md{border:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-md-0{border:0 !important}.border-md-top{border-top:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-md-right{border-right:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-md-bottom{border-bottom:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-md-left{border-left:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-md-top-0{border-top:0 !important}.border-md-right-0{border-right:0 !important}.border-md-bottom-0{border-bottom:0 !important}.border-md-left-0{border-left:0 !important}.rounded-md{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-md-0{border-radius:0 !important}.rounded-md-1{border-radius:var(--borderRadius-small, 4px) !important}.rounded-md-2{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-md-3{border-radius:var(--borderRadius-large, 8px) !important}.rounded-md-top-0{border-top-left-radius:0 !important;border-top-right-radius:0 !important}.rounded-md-top-1{border-top-left-radius:var(--borderRadius-small, 4px) !important;border-top-right-radius:var(--borderRadius-small, 4px) !important}.rounded-md-top-2{border-top-left-radius:var(--borderRadius-medium, 6px) !important;border-top-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-md-top-3{border-top-left-radius:var(--borderRadius-medium, 8px) !important;border-top-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-md-right-0{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important}.rounded-md-right-1{border-top-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-right-radius:var(--borderRadius-small, 4px) !important}.rounded-md-right-2{border-top-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-md-right-3{border-top-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-md-bottom-0{border-bottom-right-radius:0 !important;border-bottom-left-radius:0 !important}.rounded-md-bottom-1{border-bottom-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-left-radius:var(--borderRadius-small, 4px) !important}.rounded-md-bottom-2{border-bottom-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-md-bottom-3{border-bottom-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-left-radius:var(--borderRadius-medium, 8px) !important}.rounded-md-left-0{border-bottom-left-radius:0 !important;border-top-left-radius:0 !important}.rounded-md-left-1{border-bottom-left-radius:var(--borderRadius-small, 4px) !important;border-top-left-radius:var(--borderRadius-small, 4px) !important}.rounded-md-left-2{border-bottom-left-radius:var(--borderRadius-medium, 6px) !important;border-top-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-md-left-3{border-bottom-left-radius:var(--borderRadius-medium, 8px) !important;border-top-left-radius:var(--borderRadius-medium, 8px) !important}}@media(min-width: 1012px){.border-lg{border:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-lg-0{border:0 !important}.border-lg-top{border-top:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-lg-right{border-right:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-lg-bottom{border-bottom:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-lg-left{border-left:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-lg-top-0{border-top:0 !important}.border-lg-right-0{border-right:0 !important}.border-lg-bottom-0{border-bottom:0 !important}.border-lg-left-0{border-left:0 !important}.rounded-lg{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-lg-0{border-radius:0 !important}.rounded-lg-1{border-radius:var(--borderRadius-small, 4px) !important}.rounded-lg-2{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-lg-3{border-radius:var(--borderRadius-large, 8px) !important}.rounded-lg-top-0{border-top-left-radius:0 !important;border-top-right-radius:0 !important}.rounded-lg-top-1{border-top-left-radius:var(--borderRadius-small, 4px) !important;border-top-right-radius:var(--borderRadius-small, 4px) !important}.rounded-lg-top-2{border-top-left-radius:var(--borderRadius-medium, 6px) !important;border-top-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-lg-top-3{border-top-left-radius:var(--borderRadius-medium, 8px) !important;border-top-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-lg-right-0{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important}.rounded-lg-right-1{border-top-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-right-radius:var(--borderRadius-small, 4px) !important}.rounded-lg-right-2{border-top-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-lg-right-3{border-top-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-lg-bottom-0{border-bottom-right-radius:0 !important;border-bottom-left-radius:0 !important}.rounded-lg-bottom-1{border-bottom-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-left-radius:var(--borderRadius-small, 4px) !important}.rounded-lg-bottom-2{border-bottom-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-lg-bottom-3{border-bottom-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-left-radius:var(--borderRadius-medium, 8px) !important}.rounded-lg-left-0{border-bottom-left-radius:0 !important;border-top-left-radius:0 !important}.rounded-lg-left-1{border-bottom-left-radius:var(--borderRadius-small, 4px) !important;border-top-left-radius:var(--borderRadius-small, 4px) !important}.rounded-lg-left-2{border-bottom-left-radius:var(--borderRadius-medium, 6px) !important;border-top-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-lg-left-3{border-bottom-left-radius:var(--borderRadius-medium, 8px) !important;border-top-left-radius:var(--borderRadius-medium, 8px) !important}}@media(min-width: 1280px){.border-xl{border:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-xl-0{border:0 !important}.border-xl-top{border-top:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-xl-right{border-right:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-xl-bottom{border-bottom:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-xl-left{border-left:var(--borderWidth-thin, 1px) solid var(--borderColor-default, var(--color-border-default)) !important}.border-xl-top-0{border-top:0 !important}.border-xl-right-0{border-right:0 !important}.border-xl-bottom-0{border-bottom:0 !important}.border-xl-left-0{border-left:0 !important}.rounded-xl{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-xl-0{border-radius:0 !important}.rounded-xl-1{border-radius:var(--borderRadius-small, 4px) !important}.rounded-xl-2{border-radius:var(--borderRadius-medium, 6px) !important}.rounded-xl-3{border-radius:var(--borderRadius-large, 8px) !important}.rounded-xl-top-0{border-top-left-radius:0 !important;border-top-right-radius:0 !important}.rounded-xl-top-1{border-top-left-radius:var(--borderRadius-small, 4px) !important;border-top-right-radius:var(--borderRadius-small, 4px) !important}.rounded-xl-top-2{border-top-left-radius:var(--borderRadius-medium, 6px) !important;border-top-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-xl-top-3{border-top-left-radius:var(--borderRadius-medium, 8px) !important;border-top-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-xl-right-0{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important}.rounded-xl-right-1{border-top-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-right-radius:var(--borderRadius-small, 4px) !important}.rounded-xl-right-2{border-top-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-right-radius:var(--borderRadius-medium, 6px) !important}.rounded-xl-right-3{border-top-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-right-radius:var(--borderRadius-medium, 8px) !important}.rounded-xl-bottom-0{border-bottom-right-radius:0 !important;border-bottom-left-radius:0 !important}.rounded-xl-bottom-1{border-bottom-right-radius:var(--borderRadius-small, 4px) !important;border-bottom-left-radius:var(--borderRadius-small, 4px) !important}.rounded-xl-bottom-2{border-bottom-right-radius:var(--borderRadius-medium, 6px) !important;border-bottom-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-xl-bottom-3{border-bottom-right-radius:var(--borderRadius-medium, 8px) !important;border-bottom-left-radius:var(--borderRadius-medium, 8px) !important}.rounded-xl-left-0{border-bottom-left-radius:0 !important;border-top-left-radius:0 !important}.rounded-xl-left-1{border-bottom-left-radius:var(--borderRadius-small, 4px) !important;border-top-left-radius:var(--borderRadius-small, 4px) !important}.rounded-xl-left-2{border-bottom-left-radius:var(--borderRadius-medium, 6px) !important;border-top-left-radius:var(--borderRadius-medium, 6px) !important}.rounded-xl-left-3{border-bottom-left-radius:var(--borderRadius-medium, 8px) !important;border-top-left-radius:var(--borderRadius-medium, 8px) !important}}.circle{border-radius:var(--borderRadius-full, 50%) !important}.border-dashed{border-style:dashed !important}.color-shadow-small{box-shadow:var(--shadow-resting-small, var(--color-shadow-small)) !important}.color-shadow-medium{box-shadow:var(--shadow-resting-medium, var(--color-shadow-medium)) !important}.color-shadow-large{box-shadow:var(--shadow-floating-large, var(--color-shadow-large)) !important}.color-shadow-extra-large{box-shadow:var(--shadow-floating-xlarge, var(--color-shadow-extra-large)) !important}.shadow-floating-small{box-shadow:var(--shadow-floating-small, var(--color-overlay-shadow)) !important}.box-shadow-none{box-shadow:none !important}.color-fg-default,.fgColor-default{color:var(--fgColor-default, var(--color-fg-default)) !important}.color-fg-muted,.fgColor-muted{color:var(--fgColor-muted, var(--color-fg-muted)) !important}.color-fg-subtle{color:var(--fgColor-muted, var(--color-fg-subtle)) !important}.color-fg-accent,.fgColor-accent{color:var(--fgColor-accent, var(--color-accent-fg)) !important}.color-fg-success,.fgColor-success{color:var(--fgColor-success, var(--color-success-fg)) !important}.color-fg-attention,.fgColor-attention{color:var(--fgColor-attention, var(--color-attention-fg)) !important}.color-fg-severe,.fgColor-severe{color:var(--fgColor-severe, var(--color-severe-fg)) !important}.color-fg-danger,.fgColor-danger{color:var(--fgColor-danger, var(--color-danger-fg)) !important}.color-fg-open,.fgColor-open{color:var(--fgColor-open, var(--color-open-fg)) !important}.color-fg-closed,.fgColor-closed{color:var(--fgColor-closed, var(--color-closed-fg)) !important}.color-fg-done,.fgColor-done{color:var(--fgColor-done, var(--color-done-fg)) !important}.color-fg-sponsors,.fgColor-sponsors{color:var(--fgColor-sponsors, var(--color-sponsors-fg)) !important}.color-fg-on-emphasis,.fgColor-onEmphasis{color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis)) !important}.color-bg-default,.bgColor-default{background-color:var(--bgColor-default, var(--color-canvas-default)) !important}.color-bg-overlay{background-color:var(--overlay-bgColor, var(--color-canvas-overlay)) !important}.color-bg-inset,.bgColor-inset{background-color:var(--bgColor-inset, var(--color-canvas-inset)) !important}.color-bg-subtle,.bgColor-muted{background-color:var(--bgColor-muted, var(--color-canvas-subtle)) !important}.color-bg-emphasis,.bgColor-emphasis{background-color:var(--bgColor-emphasis, var(--color-neutral-emphasis-plus)) !important}.color-bg-accent,.bgColor-accent-muted{background-color:var(--bgColor-accent-muted, var(--color-accent-subtle)) !important}.color-bg-accent-emphasis,.bgColor-accent-emphasis{background-color:var(--bgColor-accent-emphasis, var(--color-accent-emphasis)) !important}.color-bg-success,.bgColor-success-muted{background-color:var(--bgColor-success-muted, var(--color-success-subtle)) !important}.color-bg-success-emphasis,.bgColor-success-emphasis{background-color:var(--bgColor-success-emphasis, var(--color-success-emphasis)) !important}.color-bg-attention,.bgColor-attention-muted{background-color:var(--bgColor-attention-muted, var(--color-attention-subtle)) !important}.color-bg-attention-emphasis,.bgColor-attention-emphasis{background-color:var(--bgColor-attention-emphasis, var(--color-attention-emphasis)) !important}.color-bg-severe,.bgColor-severe-muted{background-color:var(--bgColor-severe-muted, var(--color-severe-subtle)) !important}.color-bg-severe-emphasis,.bgColor-severe-emphasis{background-color:var(--bgColor-severe-emphasis, var(--color-severe-emphasis)) !important}.color-bg-danger,.bgColor-danger-muted{background-color:var(--bgColor-danger-muted, var(--color-danger-subtle)) !important}.color-bg-danger-emphasis,.bgColor-danger-emphasis{background-color:var(--bgColor-danger-emphasis, var(--color-danger-emphasis)) !important}.color-bg-open,.bgColor-open-muted{background-color:var(--bgColor-open-muted, var(--color-open-subtle)) !important}.color-bg-open-emphasis,.bgColor-open-emphasis{background-color:var(--bgColor-open-emphasis, var(--color-open-emphasis)) !important}.color-bg-closed,.bgColor-closed-muted{background-color:var(--bgColor-closed-muted, var(--color-closed-subtle)) !important}.color-bg-closed-emphasis,.bgColor-closed-emphasis{background-color:var(--bgColor-closed-emphasis, var(--color-closed-emphasis)) !important}.color-bg-done,.bgColor-done-muted{background-color:var(--bgColor-done-muted, var(--color-done-subtle)) !important}.color-bg-done-emphasis,.bgColor-done-emphasis{background-color:var(--bgColor-done-emphasis, var(--color-done-emphasis)) !important}.color-bg-sponsors,.bgColor-sponsors-muted{background-color:var(--bgColor-sponsors-muted, var(--color-sponsors-subtle)) !important}.color-bg-sponsors-emphasis,.bgColor-sponsors-emphasis{background-color:var(--bgColor-sponsors-emphasis, var(--color-sponsors-emphasis)) !important}.color-bg-transparent,.bgColor-transparent{background-color:rgba(0,0,0,0) !important}.color-border-default,.borderColor-default{border-color:var(--borderColor-default, var(--color-border-default)) !important}.color-border-muted,.borderColor-muted{border-color:var(--borderColor-muted, var(--color-border-muted)) !important}.color-border-subtle{border-color:var(--borderColor-muted, var(--color-border-subtle)) !important}.color-border-accent,.borderColor-accent-muted{border-color:var(--borderColor-accent-muted, var(--color-accent-muted)) !important}.color-border-accent-emphasis,.borderColor-accent-emphasis{border-color:var(--borderColor-accent-emphasis, var(--color-accent-emphasis)) !important}.color-border-success,.borderColor-success-muted{border-color:var(--borderColor-success-muted, var(--color-success-muted)) !important}.color-border-success-emphasis,.borderColor-success-emphasis{border-color:var(--borderColor-success-emphasis, var(--color-success-emphasis)) !important}.color-border-attention,.borderColor-attention-muted{border-color:var(--borderColor-attention-muted, var(--color-attention-muted)) !important}.color-border-attention-emphasis,.borderColor-attention-emphasis{border-color:var(--borderColor-attention-emphasis, var(--color-attention-emphasis)) !important}.color-border-severe,.borderColor-severe-muted{border-color:var(--borderColor-severe-muted, var(--color-severe-muted)) !important}.color-border-severe-emphasis,.borderColor-severe-emphasis{border-color:var(--borderColor-severe-emphasis, var(--color-severe-emphasis)) !important}.color-border-danger,.borderColor-danger-muted{border-color:var(--borderColor-danger-muted, var(--color-danger-muted)) !important}.color-border-danger-emphasis,.borderColor-danger-emphasis{border-color:var(--borderColor-danger-emphasis, var(--color-danger-emphasis)) !important}.color-border-open,.borderColor-open-muted{border-color:var(--borderColor-open-muted, var(--color-open-muted)) !important}.color-border-open-emphasis,.borderColor-open-emphasis{border-color:var(--borderColor-open-emphasis, var(--color-open-emphasis)) !important}.color-border-closed,.borderColor-closed-muted{border-color:var(--borderColor-closed-muted, var(--color-closed-muted)) !important}.color-border-closed-emphasis,.borderColor-closed-emphasis{border-color:var(--borderColor-closed-emphasis, var(--color-closed-emphasis)) !important}.color-border-done,.borderColor-done-muted{border-color:var(--borderColor-done-muted, var(--color-done-muted)) !important}.color-border-done-emphasis,.borderColor-done-emphasis{border-color:var(--borderColor-done-emphasis, var(--color-done-emphasis)) !important}.color-border-sponsors,.borderColor-sponsors-muted{border-color:var(--borderColor-sponsors-muted, var(--color-sponsors-muted)) !important}.color-border-sponsors-emphasis,.borderColor-sponsors-emphasis{border-color:var(--borderColor-sponsors-emphasis, var(--color-sponsors-emphasis)) !important}.color-fg-inherit,.fgColor-inherit{color:inherit !important}.details-overlay[open]>summary::before{position:fixed;top:0;right:0;bottom:0;left:0;z-index:80;display:block;cursor:default;content:" ";background:rgba(0,0,0,0)}.details-overlay-dark[open]>summary::before{z-index:111;background:var(--overlay-backdrop-bgColor, var(--color-primer-canvas-backdrop))}.details-reset>summary{list-style:none;transition:80ms cubic-bezier(0.33, 1, 0.68, 1);transition-property:color,background-color,box-shadow,border-color}.details-reset>summary:focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:none}.details-reset>summary:focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0)}.details-reset>summary:focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:none}.details-reset>summary.btn-primary:focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.details-reset>summary.btn-primary:focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0);box-shadow:none}.details-reset>summary.btn-primary:focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.details-reset>summary::before{display:none}.details-reset>summary::-webkit-details-marker{display:none}.details-overlay>summary{transition:80ms cubic-bezier(0.33, 1, 0.68, 1);transition-property:color,background-color,box-shadow,border-color}.details-overlay>summary:focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:none}.details-overlay>summary:focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0)}.details-overlay>summary:focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:none}.details-overlay>summary.btn-primary:focus{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.details-overlay>summary.btn-primary:focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0);box-shadow:none}.details-overlay>summary.btn-primary:focus-visible{outline:2px solid var(--focus-outlineColor, var(--color-accent-fg));outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.flex-row{flex-direction:row !important}.flex-row-reverse{flex-direction:row-reverse !important}.flex-column{flex-direction:column !important}.flex-column-reverse{flex-direction:column-reverse !important}.flex-wrap{flex-wrap:wrap !important}.flex-nowrap{flex-wrap:nowrap !important}.flex-wrap-reverse{flex-wrap:wrap-reverse !important}.flex-justify-start{justify-content:flex-start !important}.flex-justify-end{justify-content:flex-end !important}.flex-justify-center{justify-content:center !important}.flex-justify-between{justify-content:space-between !important}.flex-justify-around{justify-content:space-around !important}.flex-items-start{align-items:flex-start !important}.flex-items-end{align-items:flex-end !important}.flex-items-center{align-items:center !important}.flex-items-baseline{align-items:baseline !important}.flex-items-stretch{align-items:stretch !important}.flex-content-start{align-content:flex-start !important}.flex-content-end{align-content:flex-end !important}.flex-content-center{align-content:center !important}.flex-content-between{align-content:space-between !important}.flex-content-around{align-content:space-around !important}.flex-content-stretch{align-content:stretch !important}.flex-1{flex:1 !important}.flex-auto{flex:auto !important}.flex-grow-0{flex-grow:0 !important}.flex-shrink-0{flex-shrink:0 !important}.flex-self-auto{align-self:auto !important}.flex-self-start{align-self:flex-start !important}.flex-self-end{align-self:flex-end !important}.flex-self-center{align-self:center !important}.flex-self-baseline{align-self:baseline !important}.flex-self-stretch{align-self:stretch !important}.flex-order-1{order:1 !important}.flex-order-2{order:2 !important}.flex-order-none{order:inherit !important}@media(min-width: 544px){.flex-sm-row{flex-direction:row !important}.flex-sm-row-reverse{flex-direction:row-reverse !important}.flex-sm-column{flex-direction:column !important}.flex-sm-column-reverse{flex-direction:column-reverse !important}.flex-sm-wrap{flex-wrap:wrap !important}.flex-sm-nowrap{flex-wrap:nowrap !important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse !important}.flex-sm-justify-start{justify-content:flex-start !important}.flex-sm-justify-end{justify-content:flex-end !important}.flex-sm-justify-center{justify-content:center !important}.flex-sm-justify-between{justify-content:space-between !important}.flex-sm-justify-around{justify-content:space-around !important}.flex-sm-items-start{align-items:flex-start !important}.flex-sm-items-end{align-items:flex-end !important}.flex-sm-items-center{align-items:center !important}.flex-sm-items-baseline{align-items:baseline !important}.flex-sm-items-stretch{align-items:stretch !important}.flex-sm-content-start{align-content:flex-start !important}.flex-sm-content-end{align-content:flex-end !important}.flex-sm-content-center{align-content:center !important}.flex-sm-content-between{align-content:space-between !important}.flex-sm-content-around{align-content:space-around !important}.flex-sm-content-stretch{align-content:stretch !important}.flex-sm-1{flex:1 !important}.flex-sm-auto{flex:auto !important}.flex-sm-grow-0{flex-grow:0 !important}.flex-sm-shrink-0{flex-shrink:0 !important}.flex-sm-self-auto{align-self:auto !important}.flex-sm-self-start{align-self:flex-start !important}.flex-sm-self-end{align-self:flex-end !important}.flex-sm-self-center{align-self:center !important}.flex-sm-self-baseline{align-self:baseline !important}.flex-sm-self-stretch{align-self:stretch !important}.flex-sm-order-1{order:1 !important}.flex-sm-order-2{order:2 !important}.flex-sm-order-none{order:inherit !important}}@media(min-width: 768px){.flex-md-row{flex-direction:row !important}.flex-md-row-reverse{flex-direction:row-reverse !important}.flex-md-column{flex-direction:column !important}.flex-md-column-reverse{flex-direction:column-reverse !important}.flex-md-wrap{flex-wrap:wrap !important}.flex-md-nowrap{flex-wrap:nowrap !important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse !important}.flex-md-justify-start{justify-content:flex-start !important}.flex-md-justify-end{justify-content:flex-end !important}.flex-md-justify-center{justify-content:center !important}.flex-md-justify-between{justify-content:space-between !important}.flex-md-justify-around{justify-content:space-around !important}.flex-md-items-start{align-items:flex-start !important}.flex-md-items-end{align-items:flex-end !important}.flex-md-items-center{align-items:center !important}.flex-md-items-baseline{align-items:baseline !important}.flex-md-items-stretch{align-items:stretch !important}.flex-md-content-start{align-content:flex-start !important}.flex-md-content-end{align-content:flex-end !important}.flex-md-content-center{align-content:center !important}.flex-md-content-between{align-content:space-between !important}.flex-md-content-around{align-content:space-around !important}.flex-md-content-stretch{align-content:stretch !important}.flex-md-1{flex:1 !important}.flex-md-auto{flex:auto !important}.flex-md-grow-0{flex-grow:0 !important}.flex-md-shrink-0{flex-shrink:0 !important}.flex-md-self-auto{align-self:auto !important}.flex-md-self-start{align-self:flex-start !important}.flex-md-self-end{align-self:flex-end !important}.flex-md-self-center{align-self:center !important}.flex-md-self-baseline{align-self:baseline !important}.flex-md-self-stretch{align-self:stretch !important}.flex-md-order-1{order:1 !important}.flex-md-order-2{order:2 !important}.flex-md-order-none{order:inherit !important}}@media(min-width: 1012px){.flex-lg-row{flex-direction:row !important}.flex-lg-row-reverse{flex-direction:row-reverse !important}.flex-lg-column{flex-direction:column !important}.flex-lg-column-reverse{flex-direction:column-reverse !important}.flex-lg-wrap{flex-wrap:wrap !important}.flex-lg-nowrap{flex-wrap:nowrap !important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse !important}.flex-lg-justify-start{justify-content:flex-start !important}.flex-lg-justify-end{justify-content:flex-end !important}.flex-lg-justify-center{justify-content:center !important}.flex-lg-justify-between{justify-content:space-between !important}.flex-lg-justify-around{justify-content:space-around !important}.flex-lg-items-start{align-items:flex-start !important}.flex-lg-items-end{align-items:flex-end !important}.flex-lg-items-center{align-items:center !important}.flex-lg-items-baseline{align-items:baseline !important}.flex-lg-items-stretch{align-items:stretch !important}.flex-lg-content-start{align-content:flex-start !important}.flex-lg-content-end{align-content:flex-end !important}.flex-lg-content-center{align-content:center !important}.flex-lg-content-between{align-content:space-between !important}.flex-lg-content-around{align-content:space-around !important}.flex-lg-content-stretch{align-content:stretch !important}.flex-lg-1{flex:1 !important}.flex-lg-auto{flex:auto !important}.flex-lg-grow-0{flex-grow:0 !important}.flex-lg-shrink-0{flex-shrink:0 !important}.flex-lg-self-auto{align-self:auto !important}.flex-lg-self-start{align-self:flex-start !important}.flex-lg-self-end{align-self:flex-end !important}.flex-lg-self-center{align-self:center !important}.flex-lg-self-baseline{align-self:baseline !important}.flex-lg-self-stretch{align-self:stretch !important}.flex-lg-order-1{order:1 !important}.flex-lg-order-2{order:2 !important}.flex-lg-order-none{order:inherit !important}}@media(min-width: 1280px){.flex-xl-row{flex-direction:row !important}.flex-xl-row-reverse{flex-direction:row-reverse !important}.flex-xl-column{flex-direction:column !important}.flex-xl-column-reverse{flex-direction:column-reverse !important}.flex-xl-wrap{flex-wrap:wrap !important}.flex-xl-nowrap{flex-wrap:nowrap !important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse !important}.flex-xl-justify-start{justify-content:flex-start !important}.flex-xl-justify-end{justify-content:flex-end !important}.flex-xl-justify-center{justify-content:center !important}.flex-xl-justify-between{justify-content:space-between !important}.flex-xl-justify-around{justify-content:space-around !important}.flex-xl-items-start{align-items:flex-start !important}.flex-xl-items-end{align-items:flex-end !important}.flex-xl-items-center{align-items:center !important}.flex-xl-items-baseline{align-items:baseline !important}.flex-xl-items-stretch{align-items:stretch !important}.flex-xl-content-start{align-content:flex-start !important}.flex-xl-content-end{align-content:flex-end !important}.flex-xl-content-center{align-content:center !important}.flex-xl-content-between{align-content:space-between !important}.flex-xl-content-around{align-content:space-around !important}.flex-xl-content-stretch{align-content:stretch !important}.flex-xl-1{flex:1 !important}.flex-xl-auto{flex:auto !important}.flex-xl-grow-0{flex-grow:0 !important}.flex-xl-shrink-0{flex-shrink:0 !important}.flex-xl-self-auto{align-self:auto !important}.flex-xl-self-start{align-self:flex-start !important}.flex-xl-self-end{align-self:flex-end !important}.flex-xl-self-center{align-self:center !important}.flex-xl-self-baseline{align-self:baseline !important}.flex-xl-self-stretch{align-self:stretch !important}.flex-xl-order-1{order:1 !important}.flex-xl-order-2{order:2 !important}.flex-xl-order-none{order:inherit !important}}.position-static{position:static !important}.position-relative{position:relative !important}.position-absolute{position:absolute !important}.position-fixed{position:fixed !important}.position-sticky{position:sticky !important}@media(min-width: 544px){.position-sm-static{position:static !important}.position-sm-relative{position:relative !important}.position-sm-absolute{position:absolute !important}.position-sm-fixed{position:fixed !important}.position-sm-sticky{position:sticky !important}}@media(min-width: 768px){.position-md-static{position:static !important}.position-md-relative{position:relative !important}.position-md-absolute{position:absolute !important}.position-md-fixed{position:fixed !important}.position-md-sticky{position:sticky !important}}@media(min-width: 1012px){.position-lg-static{position:static !important}.position-lg-relative{position:relative !important}.position-lg-absolute{position:absolute !important}.position-lg-fixed{position:fixed !important}.position-lg-sticky{position:sticky !important}}@media(min-width: 1280px){.position-xl-static{position:static !important}.position-xl-relative{position:relative !important}.position-xl-absolute{position:absolute !important}.position-xl-fixed{position:fixed !important}.position-xl-sticky{position:sticky !important}}.top-0{top:0 !important}.right-0{right:0 !important}.bottom-0{bottom:0 !important}.left-0{left:0 !important}.top-auto{top:auto !important}.right-auto{right:auto !important}.bottom-auto{bottom:auto !important}.left-auto{left:auto !important}@media(min-width: 544px){.top-sm-0{top:0 !important}.right-sm-0{right:0 !important}.bottom-sm-0{bottom:0 !important}.left-sm-0{left:0 !important}.top-sm-auto{top:auto !important}.right-sm-auto{right:auto !important}.bottom-sm-auto{bottom:auto !important}.left-sm-auto{left:auto !important}}@media(min-width: 768px){.top-md-0{top:0 !important}.right-md-0{right:0 !important}.bottom-md-0{bottom:0 !important}.left-md-0{left:0 !important}.top-md-auto{top:auto !important}.right-md-auto{right:auto !important}.bottom-md-auto{bottom:auto !important}.left-md-auto{left:auto !important}}@media(min-width: 1012px){.top-lg-0{top:0 !important}.right-lg-0{right:0 !important}.bottom-lg-0{bottom:0 !important}.left-lg-0{left:0 !important}.top-lg-auto{top:auto !important}.right-lg-auto{right:auto !important}.bottom-lg-auto{bottom:auto !important}.left-lg-auto{left:auto !important}}@media(min-width: 1280px){.top-xl-0{top:0 !important}.right-xl-0{right:0 !important}.bottom-xl-0{bottom:0 !important}.left-xl-0{left:0 !important}.top-xl-auto{top:auto !important}.right-xl-auto{right:auto !important}.bottom-xl-auto{bottom:auto !important}.left-xl-auto{left:auto !important}}.v-align-middle{vertical-align:middle !important}.v-align-top{vertical-align:top !important}.v-align-bottom{vertical-align:bottom !important}.v-align-text-top{vertical-align:text-top !important}.v-align-text-bottom{vertical-align:text-bottom !important}.v-align-baseline{vertical-align:baseline !important}.overflow-visible{overflow:visible !important}.overflow-x-visible{overflow-x:visible !important}.overflow-y-visible{overflow-y:visible !important}.overflow-hidden{overflow:hidden !important}.overflow-x-hidden{overflow-x:hidden !important}.overflow-y-hidden{overflow-y:hidden !important}.overflow-auto{overflow:auto !important}.overflow-x-auto{overflow-x:auto !important}.overflow-y-auto{overflow-y:auto !important}.overflow-scroll{overflow:scroll !important}.overflow-x-scroll{overflow-x:scroll !important}.overflow-y-scroll{overflow-y:scroll !important}@media(min-width: 544px){.overflow-sm-visible{overflow:visible !important}.overflow-sm-x-visible{overflow-x:visible !important}.overflow-sm-y-visible{overflow-y:visible !important}.overflow-sm-hidden{overflow:hidden !important}.overflow-sm-x-hidden{overflow-x:hidden !important}.overflow-sm-y-hidden{overflow-y:hidden !important}.overflow-sm-auto{overflow:auto !important}.overflow-sm-x-auto{overflow-x:auto !important}.overflow-sm-y-auto{overflow-y:auto !important}.overflow-sm-scroll{overflow:scroll !important}.overflow-sm-x-scroll{overflow-x:scroll !important}.overflow-sm-y-scroll{overflow-y:scroll !important}}@media(min-width: 768px){.overflow-md-visible{overflow:visible !important}.overflow-md-x-visible{overflow-x:visible !important}.overflow-md-y-visible{overflow-y:visible !important}.overflow-md-hidden{overflow:hidden !important}.overflow-md-x-hidden{overflow-x:hidden !important}.overflow-md-y-hidden{overflow-y:hidden !important}.overflow-md-auto{overflow:auto !important}.overflow-md-x-auto{overflow-x:auto !important}.overflow-md-y-auto{overflow-y:auto !important}.overflow-md-scroll{overflow:scroll !important}.overflow-md-x-scroll{overflow-x:scroll !important}.overflow-md-y-scroll{overflow-y:scroll !important}}@media(min-width: 1012px){.overflow-lg-visible{overflow:visible !important}.overflow-lg-x-visible{overflow-x:visible !important}.overflow-lg-y-visible{overflow-y:visible !important}.overflow-lg-hidden{overflow:hidden !important}.overflow-lg-x-hidden{overflow-x:hidden !important}.overflow-lg-y-hidden{overflow-y:hidden !important}.overflow-lg-auto{overflow:auto !important}.overflow-lg-x-auto{overflow-x:auto !important}.overflow-lg-y-auto{overflow-y:auto !important}.overflow-lg-scroll{overflow:scroll !important}.overflow-lg-x-scroll{overflow-x:scroll !important}.overflow-lg-y-scroll{overflow-y:scroll !important}}@media(min-width: 1280px){.overflow-xl-visible{overflow:visible !important}.overflow-xl-x-visible{overflow-x:visible !important}.overflow-xl-y-visible{overflow-y:visible !important}.overflow-xl-hidden{overflow:hidden !important}.overflow-xl-x-hidden{overflow-x:hidden !important}.overflow-xl-y-hidden{overflow-y:hidden !important}.overflow-xl-auto{overflow:auto !important}.overflow-xl-x-auto{overflow-x:auto !important}.overflow-xl-y-auto{overflow-y:auto !important}.overflow-xl-scroll{overflow:scroll !important}.overflow-xl-x-scroll{overflow-x:scroll !important}.overflow-xl-y-scroll{overflow-y:scroll !important}}.clearfix::before{display:table;content:""}.clearfix::after{display:table;clear:both;content:""}.float-left{float:left !important}.float-right{float:right !important}.float-none{float:none !important}@media(min-width: 544px){.float-sm-left{float:left !important}.float-sm-right{float:right !important}.float-sm-none{float:none !important}}@media(min-width: 768px){.float-md-left{float:left !important}.float-md-right{float:right !important}.float-md-none{float:none !important}}@media(min-width: 1012px){.float-lg-left{float:left !important}.float-lg-right{float:right !important}.float-lg-none{float:none !important}}@media(min-width: 1280px){.float-xl-left{float:left !important}.float-xl-right{float:right !important}.float-xl-none{float:none !important}}.width-fit{max-width:100% !important}.width-full{width:100% !important}.width-comfortable{max-width:65ch !important}.height-fit{max-height:100% !important}.height-full{height:100% !important}.min-width-0{min-width:0 !important}.width-auto{width:auto !important}.direction-rtl{direction:rtl !important}.direction-ltr{direction:ltr !important}@media(min-width: 544px){.width-sm-auto{width:auto !important}.direction-sm-rtl{direction:rtl !important}.direction-sm-ltr{direction:ltr !important}}@media(min-width: 768px){.width-md-auto{width:auto !important}.direction-md-rtl{direction:rtl !important}.direction-md-ltr{direction:ltr !important}}@media(min-width: 1012px){.width-lg-auto{width:auto !important}.direction-lg-rtl{direction:rtl !important}.direction-lg-ltr{direction:ltr !important}}@media(min-width: 1280px){.width-xl-auto{width:auto !important}.direction-xl-rtl{direction:rtl !important}.direction-xl-ltr{direction:ltr !important}}.m-0{margin:0 !important}.mt-0{margin-top:0 !important}.mb-0{margin-bottom:0 !important}.mr-0{margin-right:0 !important}.ml-0{margin-left:0 !important}.mx-0{margin-right:0 !important;margin-left:0 !important}.my-0{margin-top:0 !important;margin-bottom:0 !important}.m-1{margin:var(--base-size-4, 4px) !important}.mt-1{margin-top:var(--base-size-4, 4px) !important}.mb-1{margin-bottom:var(--base-size-4, 4px) !important}.mr-1{margin-right:var(--base-size-4, 4px) !important}.ml-1{margin-left:var(--base-size-4, 4px) !important}.mt-n1{margin-top:calc(-1*var(--base-size-4, 4px)) !important}.mb-n1{margin-bottom:calc(-1*var(--base-size-4, 4px)) !important}.mr-n1{margin-right:calc(-1*var(--base-size-4, 4px)) !important}.ml-n1{margin-left:calc(-1*var(--base-size-4, 4px)) !important}.mx-1{margin-right:var(--base-size-4, 4px) !important;margin-left:var(--base-size-4, 4px) !important}.my-1{margin-top:var(--base-size-4, 4px) !important;margin-bottom:var(--base-size-4, 4px) !important}.m-2{margin:var(--base-size-8, 8px) !important}.mt-2{margin-top:var(--base-size-8, 8px) !important}.mb-2{margin-bottom:var(--base-size-8, 8px) !important}.mr-2{margin-right:var(--base-size-8, 8px) !important}.ml-2{margin-left:var(--base-size-8, 8px) !important}.mt-n2{margin-top:calc(-1*var(--base-size-8, 8px)) !important}.mb-n2{margin-bottom:calc(-1*var(--base-size-8, 8px)) !important}.mr-n2{margin-right:calc(-1*var(--base-size-8, 8px)) !important}.ml-n2{margin-left:calc(-1*var(--base-size-8, 8px)) !important}.mx-2{margin-right:var(--base-size-8, 8px) !important;margin-left:var(--base-size-8, 8px) !important}.my-2{margin-top:var(--base-size-8, 8px) !important;margin-bottom:var(--base-size-8, 8px) !important}.m-3{margin:var(--base-size-16, 16px) !important}.mt-3{margin-top:var(--base-size-16, 16px) !important}.mb-3{margin-bottom:var(--base-size-16, 16px) !important}.mr-3{margin-right:var(--base-size-16, 16px) !important}.ml-3{margin-left:var(--base-size-16, 16px) !important}.mt-n3{margin-top:calc(-1*var(--base-size-16, 16px)) !important}.mb-n3{margin-bottom:calc(-1*var(--base-size-16, 16px)) !important}.mr-n3{margin-right:calc(-1*var(--base-size-16, 16px)) !important}.ml-n3{margin-left:calc(-1*var(--base-size-16, 16px)) !important}.mx-3{margin-right:var(--base-size-16, 16px) !important;margin-left:var(--base-size-16, 16px) !important}.my-3{margin-top:var(--base-size-16, 16px) !important;margin-bottom:var(--base-size-16, 16px) !important}.m-4{margin:var(--base-size-24, 24px) !important}.mt-4{margin-top:var(--base-size-24, 24px) !important}.mb-4{margin-bottom:var(--base-size-24, 24px) !important}.mr-4{margin-right:var(--base-size-24, 24px) !important}.ml-4{margin-left:var(--base-size-24, 24px) !important}.mt-n4{margin-top:calc(-1*var(--base-size-24, 24px)) !important}.mb-n4{margin-bottom:calc(-1*var(--base-size-24, 24px)) !important}.mr-n4{margin-right:calc(-1*var(--base-size-24, 24px)) !important}.ml-n4{margin-left:calc(-1*var(--base-size-24, 24px)) !important}.mx-4{margin-right:var(--base-size-24, 24px) !important;margin-left:var(--base-size-24, 24px) !important}.my-4{margin-top:var(--base-size-24, 24px) !important;margin-bottom:var(--base-size-24, 24px) !important}.m-5{margin:var(--base-size-32, 32px) !important}.mt-5{margin-top:var(--base-size-32, 32px) !important}.mb-5{margin-bottom:var(--base-size-32, 32px) !important}.mr-5{margin-right:var(--base-size-32, 32px) !important}.ml-5{margin-left:var(--base-size-32, 32px) !important}.mt-n5{margin-top:calc(-1*var(--base-size-32, 32px)) !important}.mb-n5{margin-bottom:calc(-1*var(--base-size-32, 32px)) !important}.mr-n5{margin-right:calc(-1*var(--base-size-32, 32px)) !important}.ml-n5{margin-left:calc(-1*var(--base-size-32, 32px)) !important}.mx-5{margin-right:var(--base-size-32, 32px) !important;margin-left:var(--base-size-32, 32px) !important}.my-5{margin-top:var(--base-size-32, 32px) !important;margin-bottom:var(--base-size-32, 32px) !important}.m-6{margin:var(--base-size-40, 40px) !important}.mt-6{margin-top:var(--base-size-40, 40px) !important}.mb-6{margin-bottom:var(--base-size-40, 40px) !important}.mr-6{margin-right:var(--base-size-40, 40px) !important}.ml-6{margin-left:var(--base-size-40, 40px) !important}.mt-n6{margin-top:calc(-1*var(--base-size-40, 40px)) !important}.mb-n6{margin-bottom:calc(-1*var(--base-size-40, 40px)) !important}.mr-n6{margin-right:calc(-1*var(--base-size-40, 40px)) !important}.ml-n6{margin-left:calc(-1*var(--base-size-40, 40px)) !important}.mx-6{margin-right:var(--base-size-40, 40px) !important;margin-left:var(--base-size-40, 40px) !important}.my-6{margin-top:var(--base-size-40, 40px) !important;margin-bottom:var(--base-size-40, 40px) !important}.mt-7{margin-top:var(--base-size-48, 48px) !important}.mb-7{margin-bottom:var(--base-size-48, 48px) !important}.mt-n7{margin-top:calc(-1*var(--base-size-48, 48px)) !important}.mb-n7{margin-bottom:calc(-1*var(--base-size-48, 48px)) !important}.my-7{margin-top:var(--base-size-48, 48px) !important;margin-bottom:var(--base-size-48, 48px) !important}.mt-8{margin-top:var(--base-size-64, 64px) !important}.mb-8{margin-bottom:var(--base-size-64, 64px) !important}.mt-n8{margin-top:calc(-1*var(--base-size-64, 64px)) !important}.mb-n8{margin-bottom:calc(-1*var(--base-size-64, 64px)) !important}.my-8{margin-top:var(--base-size-64, 64px) !important;margin-bottom:var(--base-size-64, 64px) !important}.mt-9{margin-top:var(--base-size-80, 80px) !important}.mb-9{margin-bottom:var(--base-size-80, 80px) !important}.mt-n9{margin-top:calc(-1*var(--base-size-80, 80px)) !important}.mb-n9{margin-bottom:calc(-1*var(--base-size-80, 80px)) !important}.my-9{margin-top:var(--base-size-80, 80px) !important;margin-bottom:var(--base-size-80, 80px) !important}.mt-10{margin-top:var(--base-size-96, 96px) !important}.mb-10{margin-bottom:var(--base-size-96, 96px) !important}.mt-n10{margin-top:calc(-1*var(--base-size-96, 96px)) !important}.mb-n10{margin-bottom:calc(-1*var(--base-size-96, 96px)) !important}.my-10{margin-top:var(--base-size-96, 96px) !important;margin-bottom:var(--base-size-96, 96px) !important}.mt-11{margin-top:var(--base-size-112, 112px) !important}.mb-11{margin-bottom:var(--base-size-112, 112px) !important}.mt-n11{margin-top:calc(-1*var(--base-size-112, 112px)) !important}.mb-n11{margin-bottom:calc(-1*var(--base-size-112, 112px)) !important}.my-11{margin-top:var(--base-size-112, 112px) !important;margin-bottom:var(--base-size-112, 112px) !important}.mt-12{margin-top:var(--base-size-128, 128px) !important}.mb-12{margin-bottom:var(--base-size-128, 128px) !important}.mt-n12{margin-top:calc(-1*var(--base-size-128, 128px)) !important}.mb-n12{margin-bottom:calc(-1*var(--base-size-128, 128px)) !important}.my-12{margin-top:var(--base-size-128, 128px) !important;margin-bottom:var(--base-size-128, 128px) !important}.mx-auto{margin-right:auto !important;margin-left:auto !important}@media(min-width: 544px){.m-sm-0{margin:0 !important}.mt-sm-0{margin-top:0 !important}.mb-sm-0{margin-bottom:0 !important}.mr-sm-0{margin-right:0 !important}.ml-sm-0{margin-left:0 !important}.mx-sm-0{margin-right:0 !important;margin-left:0 !important}.my-sm-0{margin-top:0 !important;margin-bottom:0 !important}.m-sm-1{margin:var(--base-size-4, 4px) !important}.mt-sm-1{margin-top:var(--base-size-4, 4px) !important}.mb-sm-1{margin-bottom:var(--base-size-4, 4px) !important}.mr-sm-1{margin-right:var(--base-size-4, 4px) !important}.ml-sm-1{margin-left:var(--base-size-4, 4px) !important}.mt-sm-n1{margin-top:calc(-1*var(--base-size-4, 4px)) !important}.mb-sm-n1{margin-bottom:calc(-1*var(--base-size-4, 4px)) !important}.mr-sm-n1{margin-right:calc(-1*var(--base-size-4, 4px)) !important}.ml-sm-n1{margin-left:calc(-1*var(--base-size-4, 4px)) !important}.mx-sm-1{margin-right:var(--base-size-4, 4px) !important;margin-left:var(--base-size-4, 4px) !important}.my-sm-1{margin-top:var(--base-size-4, 4px) !important;margin-bottom:var(--base-size-4, 4px) !important}.m-sm-2{margin:var(--base-size-8, 8px) !important}.mt-sm-2{margin-top:var(--base-size-8, 8px) !important}.mb-sm-2{margin-bottom:var(--base-size-8, 8px) !important}.mr-sm-2{margin-right:var(--base-size-8, 8px) !important}.ml-sm-2{margin-left:var(--base-size-8, 8px) !important}.mt-sm-n2{margin-top:calc(-1*var(--base-size-8, 8px)) !important}.mb-sm-n2{margin-bottom:calc(-1*var(--base-size-8, 8px)) !important}.mr-sm-n2{margin-right:calc(-1*var(--base-size-8, 8px)) !important}.ml-sm-n2{margin-left:calc(-1*var(--base-size-8, 8px)) !important}.mx-sm-2{margin-right:var(--base-size-8, 8px) !important;margin-left:var(--base-size-8, 8px) !important}.my-sm-2{margin-top:var(--base-size-8, 8px) !important;margin-bottom:var(--base-size-8, 8px) !important}.m-sm-3{margin:var(--base-size-16, 16px) !important}.mt-sm-3{margin-top:var(--base-size-16, 16px) !important}.mb-sm-3{margin-bottom:var(--base-size-16, 16px) !important}.mr-sm-3{margin-right:var(--base-size-16, 16px) !important}.ml-sm-3{margin-left:var(--base-size-16, 16px) !important}.mt-sm-n3{margin-top:calc(-1*var(--base-size-16, 16px)) !important}.mb-sm-n3{margin-bottom:calc(-1*var(--base-size-16, 16px)) !important}.mr-sm-n3{margin-right:calc(-1*var(--base-size-16, 16px)) !important}.ml-sm-n3{margin-left:calc(-1*var(--base-size-16, 16px)) !important}.mx-sm-3{margin-right:var(--base-size-16, 16px) !important;margin-left:var(--base-size-16, 16px) !important}.my-sm-3{margin-top:var(--base-size-16, 16px) !important;margin-bottom:var(--base-size-16, 16px) !important}.m-sm-4{margin:var(--base-size-24, 24px) !important}.mt-sm-4{margin-top:var(--base-size-24, 24px) !important}.mb-sm-4{margin-bottom:var(--base-size-24, 24px) !important}.mr-sm-4{margin-right:var(--base-size-24, 24px) !important}.ml-sm-4{margin-left:var(--base-size-24, 24px) !important}.mt-sm-n4{margin-top:calc(-1*var(--base-size-24, 24px)) !important}.mb-sm-n4{margin-bottom:calc(-1*var(--base-size-24, 24px)) !important}.mr-sm-n4{margin-right:calc(-1*var(--base-size-24, 24px)) !important}.ml-sm-n4{margin-left:calc(-1*var(--base-size-24, 24px)) !important}.mx-sm-4{margin-right:var(--base-size-24, 24px) !important;margin-left:var(--base-size-24, 24px) !important}.my-sm-4{margin-top:var(--base-size-24, 24px) !important;margin-bottom:var(--base-size-24, 24px) !important}.m-sm-5{margin:var(--base-size-32, 32px) !important}.mt-sm-5{margin-top:var(--base-size-32, 32px) !important}.mb-sm-5{margin-bottom:var(--base-size-32, 32px) !important}.mr-sm-5{margin-right:var(--base-size-32, 32px) !important}.ml-sm-5{margin-left:var(--base-size-32, 32px) !important}.mt-sm-n5{margin-top:calc(-1*var(--base-size-32, 32px)) !important}.mb-sm-n5{margin-bottom:calc(-1*var(--base-size-32, 32px)) !important}.mr-sm-n5{margin-right:calc(-1*var(--base-size-32, 32px)) !important}.ml-sm-n5{margin-left:calc(-1*var(--base-size-32, 32px)) !important}.mx-sm-5{margin-right:var(--base-size-32, 32px) !important;margin-left:var(--base-size-32, 32px) !important}.my-sm-5{margin-top:var(--base-size-32, 32px) !important;margin-bottom:var(--base-size-32, 32px) !important}.m-sm-6{margin:var(--base-size-40, 40px) !important}.mt-sm-6{margin-top:var(--base-size-40, 40px) !important}.mb-sm-6{margin-bottom:var(--base-size-40, 40px) !important}.mr-sm-6{margin-right:var(--base-size-40, 40px) !important}.ml-sm-6{margin-left:var(--base-size-40, 40px) !important}.mt-sm-n6{margin-top:calc(-1*var(--base-size-40, 40px)) !important}.mb-sm-n6{margin-bottom:calc(-1*var(--base-size-40, 40px)) !important}.mr-sm-n6{margin-right:calc(-1*var(--base-size-40, 40px)) !important}.ml-sm-n6{margin-left:calc(-1*var(--base-size-40, 40px)) !important}.mx-sm-6{margin-right:var(--base-size-40, 40px) !important;margin-left:var(--base-size-40, 40px) !important}.my-sm-6{margin-top:var(--base-size-40, 40px) !important;margin-bottom:var(--base-size-40, 40px) !important}.mt-sm-7{margin-top:var(--base-size-48, 48px) !important}.mb-sm-7{margin-bottom:var(--base-size-48, 48px) !important}.mt-sm-n7{margin-top:calc(-1*var(--base-size-48, 48px)) !important}.mb-sm-n7{margin-bottom:calc(-1*var(--base-size-48, 48px)) !important}.my-sm-7{margin-top:var(--base-size-48, 48px) !important;margin-bottom:var(--base-size-48, 48px) !important}.mt-sm-8{margin-top:var(--base-size-64, 64px) !important}.mb-sm-8{margin-bottom:var(--base-size-64, 64px) !important}.mt-sm-n8{margin-top:calc(-1*var(--base-size-64, 64px)) !important}.mb-sm-n8{margin-bottom:calc(-1*var(--base-size-64, 64px)) !important}.my-sm-8{margin-top:var(--base-size-64, 64px) !important;margin-bottom:var(--base-size-64, 64px) !important}.mt-sm-9{margin-top:var(--base-size-80, 80px) !important}.mb-sm-9{margin-bottom:var(--base-size-80, 80px) !important}.mt-sm-n9{margin-top:calc(-1*var(--base-size-80, 80px)) !important}.mb-sm-n9{margin-bottom:calc(-1*var(--base-size-80, 80px)) !important}.my-sm-9{margin-top:var(--base-size-80, 80px) !important;margin-bottom:var(--base-size-80, 80px) !important}.mt-sm-10{margin-top:var(--base-size-96, 96px) !important}.mb-sm-10{margin-bottom:var(--base-size-96, 96px) !important}.mt-sm-n10{margin-top:calc(-1*var(--base-size-96, 96px)) !important}.mb-sm-n10{margin-bottom:calc(-1*var(--base-size-96, 96px)) !important}.my-sm-10{margin-top:var(--base-size-96, 96px) !important;margin-bottom:var(--base-size-96, 96px) !important}.mt-sm-11{margin-top:var(--base-size-112, 112px) !important}.mb-sm-11{margin-bottom:var(--base-size-112, 112px) !important}.mt-sm-n11{margin-top:calc(-1*var(--base-size-112, 112px)) !important}.mb-sm-n11{margin-bottom:calc(-1*var(--base-size-112, 112px)) !important}.my-sm-11{margin-top:var(--base-size-112, 112px) !important;margin-bottom:var(--base-size-112, 112px) !important}.mt-sm-12{margin-top:var(--base-size-128, 128px) !important}.mb-sm-12{margin-bottom:var(--base-size-128, 128px) !important}.mt-sm-n12{margin-top:calc(-1*var(--base-size-128, 128px)) !important}.mb-sm-n12{margin-bottom:calc(-1*var(--base-size-128, 128px)) !important}.my-sm-12{margin-top:var(--base-size-128, 128px) !important;margin-bottom:var(--base-size-128, 128px) !important}.mx-sm-auto{margin-right:auto !important;margin-left:auto !important}}@media(min-width: 768px){.m-md-0{margin:0 !important}.mt-md-0{margin-top:0 !important}.mb-md-0{margin-bottom:0 !important}.mr-md-0{margin-right:0 !important}.ml-md-0{margin-left:0 !important}.mx-md-0{margin-right:0 !important;margin-left:0 !important}.my-md-0{margin-top:0 !important;margin-bottom:0 !important}.m-md-1{margin:var(--base-size-4, 4px) !important}.mt-md-1{margin-top:var(--base-size-4, 4px) !important}.mb-md-1{margin-bottom:var(--base-size-4, 4px) !important}.mr-md-1{margin-right:var(--base-size-4, 4px) !important}.ml-md-1{margin-left:var(--base-size-4, 4px) !important}.mt-md-n1{margin-top:calc(-1*var(--base-size-4, 4px)) !important}.mb-md-n1{margin-bottom:calc(-1*var(--base-size-4, 4px)) !important}.mr-md-n1{margin-right:calc(-1*var(--base-size-4, 4px)) !important}.ml-md-n1{margin-left:calc(-1*var(--base-size-4, 4px)) !important}.mx-md-1{margin-right:var(--base-size-4, 4px) !important;margin-left:var(--base-size-4, 4px) !important}.my-md-1{margin-top:var(--base-size-4, 4px) !important;margin-bottom:var(--base-size-4, 4px) !important}.m-md-2{margin:var(--base-size-8, 8px) !important}.mt-md-2{margin-top:var(--base-size-8, 8px) !important}.mb-md-2{margin-bottom:var(--base-size-8, 8px) !important}.mr-md-2{margin-right:var(--base-size-8, 8px) !important}.ml-md-2{margin-left:var(--base-size-8, 8px) !important}.mt-md-n2{margin-top:calc(-1*var(--base-size-8, 8px)) !important}.mb-md-n2{margin-bottom:calc(-1*var(--base-size-8, 8px)) !important}.mr-md-n2{margin-right:calc(-1*var(--base-size-8, 8px)) !important}.ml-md-n2{margin-left:calc(-1*var(--base-size-8, 8px)) !important}.mx-md-2{margin-right:var(--base-size-8, 8px) !important;margin-left:var(--base-size-8, 8px) !important}.my-md-2{margin-top:var(--base-size-8, 8px) !important;margin-bottom:var(--base-size-8, 8px) !important}.m-md-3{margin:var(--base-size-16, 16px) !important}.mt-md-3{margin-top:var(--base-size-16, 16px) !important}.mb-md-3{margin-bottom:var(--base-size-16, 16px) !important}.mr-md-3{margin-right:var(--base-size-16, 16px) !important}.ml-md-3{margin-left:var(--base-size-16, 16px) !important}.mt-md-n3{margin-top:calc(-1*var(--base-size-16, 16px)) !important}.mb-md-n3{margin-bottom:calc(-1*var(--base-size-16, 16px)) !important}.mr-md-n3{margin-right:calc(-1*var(--base-size-16, 16px)) !important}.ml-md-n3{margin-left:calc(-1*var(--base-size-16, 16px)) !important}.mx-md-3{margin-right:var(--base-size-16, 16px) !important;margin-left:var(--base-size-16, 16px) !important}.my-md-3{margin-top:var(--base-size-16, 16px) !important;margin-bottom:var(--base-size-16, 16px) !important}.m-md-4{margin:var(--base-size-24, 24px) !important}.mt-md-4{margin-top:var(--base-size-24, 24px) !important}.mb-md-4{margin-bottom:var(--base-size-24, 24px) !important}.mr-md-4{margin-right:var(--base-size-24, 24px) !important}.ml-md-4{margin-left:var(--base-size-24, 24px) !important}.mt-md-n4{margin-top:calc(-1*var(--base-size-24, 24px)) !important}.mb-md-n4{margin-bottom:calc(-1*var(--base-size-24, 24px)) !important}.mr-md-n4{margin-right:calc(-1*var(--base-size-24, 24px)) !important}.ml-md-n4{margin-left:calc(-1*var(--base-size-24, 24px)) !important}.mx-md-4{margin-right:var(--base-size-24, 24px) !important;margin-left:var(--base-size-24, 24px) !important}.my-md-4{margin-top:var(--base-size-24, 24px) !important;margin-bottom:var(--base-size-24, 24px) !important}.m-md-5{margin:var(--base-size-32, 32px) !important}.mt-md-5{margin-top:var(--base-size-32, 32px) !important}.mb-md-5{margin-bottom:var(--base-size-32, 32px) !important}.mr-md-5{margin-right:var(--base-size-32, 32px) !important}.ml-md-5{margin-left:var(--base-size-32, 32px) !important}.mt-md-n5{margin-top:calc(-1*var(--base-size-32, 32px)) !important}.mb-md-n5{margin-bottom:calc(-1*var(--base-size-32, 32px)) !important}.mr-md-n5{margin-right:calc(-1*var(--base-size-32, 32px)) !important}.ml-md-n5{margin-left:calc(-1*var(--base-size-32, 32px)) !important}.mx-md-5{margin-right:var(--base-size-32, 32px) !important;margin-left:var(--base-size-32, 32px) !important}.my-md-5{margin-top:var(--base-size-32, 32px) !important;margin-bottom:var(--base-size-32, 32px) !important}.m-md-6{margin:var(--base-size-40, 40px) !important}.mt-md-6{margin-top:var(--base-size-40, 40px) !important}.mb-md-6{margin-bottom:var(--base-size-40, 40px) !important}.mr-md-6{margin-right:var(--base-size-40, 40px) !important}.ml-md-6{margin-left:var(--base-size-40, 40px) !important}.mt-md-n6{margin-top:calc(-1*var(--base-size-40, 40px)) !important}.mb-md-n6{margin-bottom:calc(-1*var(--base-size-40, 40px)) !important}.mr-md-n6{margin-right:calc(-1*var(--base-size-40, 40px)) !important}.ml-md-n6{margin-left:calc(-1*var(--base-size-40, 40px)) !important}.mx-md-6{margin-right:var(--base-size-40, 40px) !important;margin-left:var(--base-size-40, 40px) !important}.my-md-6{margin-top:var(--base-size-40, 40px) !important;margin-bottom:var(--base-size-40, 40px) !important}.mt-md-7{margin-top:var(--base-size-48, 48px) !important}.mb-md-7{margin-bottom:var(--base-size-48, 48px) !important}.mt-md-n7{margin-top:calc(-1*var(--base-size-48, 48px)) !important}.mb-md-n7{margin-bottom:calc(-1*var(--base-size-48, 48px)) !important}.my-md-7{margin-top:var(--base-size-48, 48px) !important;margin-bottom:var(--base-size-48, 48px) !important}.mt-md-8{margin-top:var(--base-size-64, 64px) !important}.mb-md-8{margin-bottom:var(--base-size-64, 64px) !important}.mt-md-n8{margin-top:calc(-1*var(--base-size-64, 64px)) !important}.mb-md-n8{margin-bottom:calc(-1*var(--base-size-64, 64px)) !important}.my-md-8{margin-top:var(--base-size-64, 64px) !important;margin-bottom:var(--base-size-64, 64px) !important}.mt-md-9{margin-top:var(--base-size-80, 80px) !important}.mb-md-9{margin-bottom:var(--base-size-80, 80px) !important}.mt-md-n9{margin-top:calc(-1*var(--base-size-80, 80px)) !important}.mb-md-n9{margin-bottom:calc(-1*var(--base-size-80, 80px)) !important}.my-md-9{margin-top:var(--base-size-80, 80px) !important;margin-bottom:var(--base-size-80, 80px) !important}.mt-md-10{margin-top:var(--base-size-96, 96px) !important}.mb-md-10{margin-bottom:var(--base-size-96, 96px) !important}.mt-md-n10{margin-top:calc(-1*var(--base-size-96, 96px)) !important}.mb-md-n10{margin-bottom:calc(-1*var(--base-size-96, 96px)) !important}.my-md-10{margin-top:var(--base-size-96, 96px) !important;margin-bottom:var(--base-size-96, 96px) !important}.mt-md-11{margin-top:var(--base-size-112, 112px) !important}.mb-md-11{margin-bottom:var(--base-size-112, 112px) !important}.mt-md-n11{margin-top:calc(-1*var(--base-size-112, 112px)) !important}.mb-md-n11{margin-bottom:calc(-1*var(--base-size-112, 112px)) !important}.my-md-11{margin-top:var(--base-size-112, 112px) !important;margin-bottom:var(--base-size-112, 112px) !important}.mt-md-12{margin-top:var(--base-size-128, 128px) !important}.mb-md-12{margin-bottom:var(--base-size-128, 128px) !important}.mt-md-n12{margin-top:calc(-1*var(--base-size-128, 128px)) !important}.mb-md-n12{margin-bottom:calc(-1*var(--base-size-128, 128px)) !important}.my-md-12{margin-top:var(--base-size-128, 128px) !important;margin-bottom:var(--base-size-128, 128px) !important}.mx-md-auto{margin-right:auto !important;margin-left:auto !important}}@media(min-width: 1012px){.m-lg-0{margin:0 !important}.mt-lg-0{margin-top:0 !important}.mb-lg-0{margin-bottom:0 !important}.mr-lg-0{margin-right:0 !important}.ml-lg-0{margin-left:0 !important}.mx-lg-0{margin-right:0 !important;margin-left:0 !important}.my-lg-0{margin-top:0 !important;margin-bottom:0 !important}.m-lg-1{margin:var(--base-size-4, 4px) !important}.mt-lg-1{margin-top:var(--base-size-4, 4px) !important}.mb-lg-1{margin-bottom:var(--base-size-4, 4px) !important}.mr-lg-1{margin-right:var(--base-size-4, 4px) !important}.ml-lg-1{margin-left:var(--base-size-4, 4px) !important}.mt-lg-n1{margin-top:calc(-1*var(--base-size-4, 4px)) !important}.mb-lg-n1{margin-bottom:calc(-1*var(--base-size-4, 4px)) !important}.mr-lg-n1{margin-right:calc(-1*var(--base-size-4, 4px)) !important}.ml-lg-n1{margin-left:calc(-1*var(--base-size-4, 4px)) !important}.mx-lg-1{margin-right:var(--base-size-4, 4px) !important;margin-left:var(--base-size-4, 4px) !important}.my-lg-1{margin-top:var(--base-size-4, 4px) !important;margin-bottom:var(--base-size-4, 4px) !important}.m-lg-2{margin:var(--base-size-8, 8px) !important}.mt-lg-2{margin-top:var(--base-size-8, 8px) !important}.mb-lg-2{margin-bottom:var(--base-size-8, 8px) !important}.mr-lg-2{margin-right:var(--base-size-8, 8px) !important}.ml-lg-2{margin-left:var(--base-size-8, 8px) !important}.mt-lg-n2{margin-top:calc(-1*var(--base-size-8, 8px)) !important}.mb-lg-n2{margin-bottom:calc(-1*var(--base-size-8, 8px)) !important}.mr-lg-n2{margin-right:calc(-1*var(--base-size-8, 8px)) !important}.ml-lg-n2{margin-left:calc(-1*var(--base-size-8, 8px)) !important}.mx-lg-2{margin-right:var(--base-size-8, 8px) !important;margin-left:var(--base-size-8, 8px) !important}.my-lg-2{margin-top:var(--base-size-8, 8px) !important;margin-bottom:var(--base-size-8, 8px) !important}.m-lg-3{margin:var(--base-size-16, 16px) !important}.mt-lg-3{margin-top:var(--base-size-16, 16px) !important}.mb-lg-3{margin-bottom:var(--base-size-16, 16px) !important}.mr-lg-3{margin-right:var(--base-size-16, 16px) !important}.ml-lg-3{margin-left:var(--base-size-16, 16px) !important}.mt-lg-n3{margin-top:calc(-1*var(--base-size-16, 16px)) !important}.mb-lg-n3{margin-bottom:calc(-1*var(--base-size-16, 16px)) !important}.mr-lg-n3{margin-right:calc(-1*var(--base-size-16, 16px)) !important}.ml-lg-n3{margin-left:calc(-1*var(--base-size-16, 16px)) !important}.mx-lg-3{margin-right:var(--base-size-16, 16px) !important;margin-left:var(--base-size-16, 16px) !important}.my-lg-3{margin-top:var(--base-size-16, 16px) !important;margin-bottom:var(--base-size-16, 16px) !important}.m-lg-4{margin:var(--base-size-24, 24px) !important}.mt-lg-4{margin-top:var(--base-size-24, 24px) !important}.mb-lg-4{margin-bottom:var(--base-size-24, 24px) !important}.mr-lg-4{margin-right:var(--base-size-24, 24px) !important}.ml-lg-4{margin-left:var(--base-size-24, 24px) !important}.mt-lg-n4{margin-top:calc(-1*var(--base-size-24, 24px)) !important}.mb-lg-n4{margin-bottom:calc(-1*var(--base-size-24, 24px)) !important}.mr-lg-n4{margin-right:calc(-1*var(--base-size-24, 24px)) !important}.ml-lg-n4{margin-left:calc(-1*var(--base-size-24, 24px)) !important}.mx-lg-4{margin-right:var(--base-size-24, 24px) !important;margin-left:var(--base-size-24, 24px) !important}.my-lg-4{margin-top:var(--base-size-24, 24px) !important;margin-bottom:var(--base-size-24, 24px) !important}.m-lg-5{margin:var(--base-size-32, 32px) !important}.mt-lg-5{margin-top:var(--base-size-32, 32px) !important}.mb-lg-5{margin-bottom:var(--base-size-32, 32px) !important}.mr-lg-5{margin-right:var(--base-size-32, 32px) !important}.ml-lg-5{margin-left:var(--base-size-32, 32px) !important}.mt-lg-n5{margin-top:calc(-1*var(--base-size-32, 32px)) !important}.mb-lg-n5{margin-bottom:calc(-1*var(--base-size-32, 32px)) !important}.mr-lg-n5{margin-right:calc(-1*var(--base-size-32, 32px)) !important}.ml-lg-n5{margin-left:calc(-1*var(--base-size-32, 32px)) !important}.mx-lg-5{margin-right:var(--base-size-32, 32px) !important;margin-left:var(--base-size-32, 32px) !important}.my-lg-5{margin-top:var(--base-size-32, 32px) !important;margin-bottom:var(--base-size-32, 32px) !important}.m-lg-6{margin:var(--base-size-40, 40px) !important}.mt-lg-6{margin-top:var(--base-size-40, 40px) !important}.mb-lg-6{margin-bottom:var(--base-size-40, 40px) !important}.mr-lg-6{margin-right:var(--base-size-40, 40px) !important}.ml-lg-6{margin-left:var(--base-size-40, 40px) !important}.mt-lg-n6{margin-top:calc(-1*var(--base-size-40, 40px)) !important}.mb-lg-n6{margin-bottom:calc(-1*var(--base-size-40, 40px)) !important}.mr-lg-n6{margin-right:calc(-1*var(--base-size-40, 40px)) !important}.ml-lg-n6{margin-left:calc(-1*var(--base-size-40, 40px)) !important}.mx-lg-6{margin-right:var(--base-size-40, 40px) !important;margin-left:var(--base-size-40, 40px) !important}.my-lg-6{margin-top:var(--base-size-40, 40px) !important;margin-bottom:var(--base-size-40, 40px) !important}.mt-lg-7{margin-top:var(--base-size-48, 48px) !important}.mb-lg-7{margin-bottom:var(--base-size-48, 48px) !important}.mt-lg-n7{margin-top:calc(-1*var(--base-size-48, 48px)) !important}.mb-lg-n7{margin-bottom:calc(-1*var(--base-size-48, 48px)) !important}.my-lg-7{margin-top:var(--base-size-48, 48px) !important;margin-bottom:var(--base-size-48, 48px) !important}.mt-lg-8{margin-top:var(--base-size-64, 64px) !important}.mb-lg-8{margin-bottom:var(--base-size-64, 64px) !important}.mt-lg-n8{margin-top:calc(-1*var(--base-size-64, 64px)) !important}.mb-lg-n8{margin-bottom:calc(-1*var(--base-size-64, 64px)) !important}.my-lg-8{margin-top:var(--base-size-64, 64px) !important;margin-bottom:var(--base-size-64, 64px) !important}.mt-lg-9{margin-top:var(--base-size-80, 80px) !important}.mb-lg-9{margin-bottom:var(--base-size-80, 80px) !important}.mt-lg-n9{margin-top:calc(-1*var(--base-size-80, 80px)) !important}.mb-lg-n9{margin-bottom:calc(-1*var(--base-size-80, 80px)) !important}.my-lg-9{margin-top:var(--base-size-80, 80px) !important;margin-bottom:var(--base-size-80, 80px) !important}.mt-lg-10{margin-top:var(--base-size-96, 96px) !important}.mb-lg-10{margin-bottom:var(--base-size-96, 96px) !important}.mt-lg-n10{margin-top:calc(-1*var(--base-size-96, 96px)) !important}.mb-lg-n10{margin-bottom:calc(-1*var(--base-size-96, 96px)) !important}.my-lg-10{margin-top:var(--base-size-96, 96px) !important;margin-bottom:var(--base-size-96, 96px) !important}.mt-lg-11{margin-top:var(--base-size-112, 112px) !important}.mb-lg-11{margin-bottom:var(--base-size-112, 112px) !important}.mt-lg-n11{margin-top:calc(-1*var(--base-size-112, 112px)) !important}.mb-lg-n11{margin-bottom:calc(-1*var(--base-size-112, 112px)) !important}.my-lg-11{margin-top:var(--base-size-112, 112px) !important;margin-bottom:var(--base-size-112, 112px) !important}.mt-lg-12{margin-top:var(--base-size-128, 128px) !important}.mb-lg-12{margin-bottom:var(--base-size-128, 128px) !important}.mt-lg-n12{margin-top:calc(-1*var(--base-size-128, 128px)) !important}.mb-lg-n12{margin-bottom:calc(-1*var(--base-size-128, 128px)) !important}.my-lg-12{margin-top:var(--base-size-128, 128px) !important;margin-bottom:var(--base-size-128, 128px) !important}.mx-lg-auto{margin-right:auto !important;margin-left:auto !important}}@media(min-width: 1280px){.m-xl-0{margin:0 !important}.mt-xl-0{margin-top:0 !important}.mb-xl-0{margin-bottom:0 !important}.mr-xl-0{margin-right:0 !important}.ml-xl-0{margin-left:0 !important}.mx-xl-0{margin-right:0 !important;margin-left:0 !important}.my-xl-0{margin-top:0 !important;margin-bottom:0 !important}.m-xl-1{margin:var(--base-size-4, 4px) !important}.mt-xl-1{margin-top:var(--base-size-4, 4px) !important}.mb-xl-1{margin-bottom:var(--base-size-4, 4px) !important}.mr-xl-1{margin-right:var(--base-size-4, 4px) !important}.ml-xl-1{margin-left:var(--base-size-4, 4px) !important}.mt-xl-n1{margin-top:calc(-1*var(--base-size-4, 4px)) !important}.mb-xl-n1{margin-bottom:calc(-1*var(--base-size-4, 4px)) !important}.mr-xl-n1{margin-right:calc(-1*var(--base-size-4, 4px)) !important}.ml-xl-n1{margin-left:calc(-1*var(--base-size-4, 4px)) !important}.mx-xl-1{margin-right:var(--base-size-4, 4px) !important;margin-left:var(--base-size-4, 4px) !important}.my-xl-1{margin-top:var(--base-size-4, 4px) !important;margin-bottom:var(--base-size-4, 4px) !important}.m-xl-2{margin:var(--base-size-8, 8px) !important}.mt-xl-2{margin-top:var(--base-size-8, 8px) !important}.mb-xl-2{margin-bottom:var(--base-size-8, 8px) !important}.mr-xl-2{margin-right:var(--base-size-8, 8px) !important}.ml-xl-2{margin-left:var(--base-size-8, 8px) !important}.mt-xl-n2{margin-top:calc(-1*var(--base-size-8, 8px)) !important}.mb-xl-n2{margin-bottom:calc(-1*var(--base-size-8, 8px)) !important}.mr-xl-n2{margin-right:calc(-1*var(--base-size-8, 8px)) !important}.ml-xl-n2{margin-left:calc(-1*var(--base-size-8, 8px)) !important}.mx-xl-2{margin-right:var(--base-size-8, 8px) !important;margin-left:var(--base-size-8, 8px) !important}.my-xl-2{margin-top:var(--base-size-8, 8px) !important;margin-bottom:var(--base-size-8, 8px) !important}.m-xl-3{margin:var(--base-size-16, 16px) !important}.mt-xl-3{margin-top:var(--base-size-16, 16px) !important}.mb-xl-3{margin-bottom:var(--base-size-16, 16px) !important}.mr-xl-3{margin-right:var(--base-size-16, 16px) !important}.ml-xl-3{margin-left:var(--base-size-16, 16px) !important}.mt-xl-n3{margin-top:calc(-1*var(--base-size-16, 16px)) !important}.mb-xl-n3{margin-bottom:calc(-1*var(--base-size-16, 16px)) !important}.mr-xl-n3{margin-right:calc(-1*var(--base-size-16, 16px)) !important}.ml-xl-n3{margin-left:calc(-1*var(--base-size-16, 16px)) !important}.mx-xl-3{margin-right:var(--base-size-16, 16px) !important;margin-left:var(--base-size-16, 16px) !important}.my-xl-3{margin-top:var(--base-size-16, 16px) !important;margin-bottom:var(--base-size-16, 16px) !important}.m-xl-4{margin:var(--base-size-24, 24px) !important}.mt-xl-4{margin-top:var(--base-size-24, 24px) !important}.mb-xl-4{margin-bottom:var(--base-size-24, 24px) !important}.mr-xl-4{margin-right:var(--base-size-24, 24px) !important}.ml-xl-4{margin-left:var(--base-size-24, 24px) !important}.mt-xl-n4{margin-top:calc(-1*var(--base-size-24, 24px)) !important}.mb-xl-n4{margin-bottom:calc(-1*var(--base-size-24, 24px)) !important}.mr-xl-n4{margin-right:calc(-1*var(--base-size-24, 24px)) !important}.ml-xl-n4{margin-left:calc(-1*var(--base-size-24, 24px)) !important}.mx-xl-4{margin-right:var(--base-size-24, 24px) !important;margin-left:var(--base-size-24, 24px) !important}.my-xl-4{margin-top:var(--base-size-24, 24px) !important;margin-bottom:var(--base-size-24, 24px) !important}.m-xl-5{margin:var(--base-size-32, 32px) !important}.mt-xl-5{margin-top:var(--base-size-32, 32px) !important}.mb-xl-5{margin-bottom:var(--base-size-32, 32px) !important}.mr-xl-5{margin-right:var(--base-size-32, 32px) !important}.ml-xl-5{margin-left:var(--base-size-32, 32px) !important}.mt-xl-n5{margin-top:calc(-1*var(--base-size-32, 32px)) !important}.mb-xl-n5{margin-bottom:calc(-1*var(--base-size-32, 32px)) !important}.mr-xl-n5{margin-right:calc(-1*var(--base-size-32, 32px)) !important}.ml-xl-n5{margin-left:calc(-1*var(--base-size-32, 32px)) !important}.mx-xl-5{margin-right:var(--base-size-32, 32px) !important;margin-left:var(--base-size-32, 32px) !important}.my-xl-5{margin-top:var(--base-size-32, 32px) !important;margin-bottom:var(--base-size-32, 32px) !important}.m-xl-6{margin:var(--base-size-40, 40px) !important}.mt-xl-6{margin-top:var(--base-size-40, 40px) !important}.mb-xl-6{margin-bottom:var(--base-size-40, 40px) !important}.mr-xl-6{margin-right:var(--base-size-40, 40px) !important}.ml-xl-6{margin-left:var(--base-size-40, 40px) !important}.mt-xl-n6{margin-top:calc(-1*var(--base-size-40, 40px)) !important}.mb-xl-n6{margin-bottom:calc(-1*var(--base-size-40, 40px)) !important}.mr-xl-n6{margin-right:calc(-1*var(--base-size-40, 40px)) !important}.ml-xl-n6{margin-left:calc(-1*var(--base-size-40, 40px)) !important}.mx-xl-6{margin-right:var(--base-size-40, 40px) !important;margin-left:var(--base-size-40, 40px) !important}.my-xl-6{margin-top:var(--base-size-40, 40px) !important;margin-bottom:var(--base-size-40, 40px) !important}.mt-xl-7{margin-top:var(--base-size-48, 48px) !important}.mb-xl-7{margin-bottom:var(--base-size-48, 48px) !important}.mt-xl-n7{margin-top:calc(-1*var(--base-size-48, 48px)) !important}.mb-xl-n7{margin-bottom:calc(-1*var(--base-size-48, 48px)) !important}.my-xl-7{margin-top:var(--base-size-48, 48px) !important;margin-bottom:var(--base-size-48, 48px) !important}.mt-xl-8{margin-top:var(--base-size-64, 64px) !important}.mb-xl-8{margin-bottom:var(--base-size-64, 64px) !important}.mt-xl-n8{margin-top:calc(-1*var(--base-size-64, 64px)) !important}.mb-xl-n8{margin-bottom:calc(-1*var(--base-size-64, 64px)) !important}.my-xl-8{margin-top:var(--base-size-64, 64px) !important;margin-bottom:var(--base-size-64, 64px) !important}.mt-xl-9{margin-top:var(--base-size-80, 80px) !important}.mb-xl-9{margin-bottom:var(--base-size-80, 80px) !important}.mt-xl-n9{margin-top:calc(-1*var(--base-size-80, 80px)) !important}.mb-xl-n9{margin-bottom:calc(-1*var(--base-size-80, 80px)) !important}.my-xl-9{margin-top:var(--base-size-80, 80px) !important;margin-bottom:var(--base-size-80, 80px) !important}.mt-xl-10{margin-top:var(--base-size-96, 96px) !important}.mb-xl-10{margin-bottom:var(--base-size-96, 96px) !important}.mt-xl-n10{margin-top:calc(-1*var(--base-size-96, 96px)) !important}.mb-xl-n10{margin-bottom:calc(-1*var(--base-size-96, 96px)) !important}.my-xl-10{margin-top:var(--base-size-96, 96px) !important;margin-bottom:var(--base-size-96, 96px) !important}.mt-xl-11{margin-top:var(--base-size-112, 112px) !important}.mb-xl-11{margin-bottom:var(--base-size-112, 112px) !important}.mt-xl-n11{margin-top:calc(-1*var(--base-size-112, 112px)) !important}.mb-xl-n11{margin-bottom:calc(-1*var(--base-size-112, 112px)) !important}.my-xl-11{margin-top:var(--base-size-112, 112px) !important;margin-bottom:var(--base-size-112, 112px) !important}.mt-xl-12{margin-top:var(--base-size-128, 128px) !important}.mb-xl-12{margin-bottom:var(--base-size-128, 128px) !important}.mt-xl-n12{margin-top:calc(-1*var(--base-size-128, 128px)) !important}.mb-xl-n12{margin-bottom:calc(-1*var(--base-size-128, 128px)) !important}.my-xl-12{margin-top:var(--base-size-128, 128px) !important;margin-bottom:var(--base-size-128, 128px) !important}.mx-xl-auto{margin-right:auto !important;margin-left:auto !important}}.m-auto{margin:auto !important}.mt-auto{margin-top:auto !important}.mr-auto{margin-right:auto !important}.mb-auto{margin-bottom:auto !important}.ml-auto{margin-left:auto !important}.p-0{padding:0 !important}.pt-0{padding-top:0 !important}.pr-0{padding-right:0 !important}.pb-0{padding-bottom:0 !important}.pl-0{padding-left:0 !important}.px-0{padding-right:0 !important;padding-left:0 !important}.py-0{padding-top:0 !important;padding-bottom:0 !important}.p-1{padding:var(--base-size-4, 4px) !important}.pt-1{padding-top:var(--base-size-4, 4px) !important}.pr-1{padding-right:var(--base-size-4, 4px) !important}.pb-1{padding-bottom:var(--base-size-4, 4px) !important}.pl-1{padding-left:var(--base-size-4, 4px) !important}.px-1{padding-right:var(--base-size-4, 4px) !important;padding-left:var(--base-size-4, 4px) !important}.py-1{padding-top:var(--base-size-4, 4px) !important;padding-bottom:var(--base-size-4, 4px) !important}.p-2{padding:var(--base-size-8, 8px) !important}.pt-2{padding-top:var(--base-size-8, 8px) !important}.pr-2{padding-right:var(--base-size-8, 8px) !important}.pb-2{padding-bottom:var(--base-size-8, 8px) !important}.pl-2{padding-left:var(--base-size-8, 8px) !important}.px-2{padding-right:var(--base-size-8, 8px) !important;padding-left:var(--base-size-8, 8px) !important}.py-2{padding-top:var(--base-size-8, 8px) !important;padding-bottom:var(--base-size-8, 8px) !important}.p-3{padding:var(--base-size-16, 16px) !important}.pt-3{padding-top:var(--base-size-16, 16px) !important}.pr-3{padding-right:var(--base-size-16, 16px) !important}.pb-3{padding-bottom:var(--base-size-16, 16px) !important}.pl-3{padding-left:var(--base-size-16, 16px) !important}.px-3{padding-right:var(--base-size-16, 16px) !important;padding-left:var(--base-size-16, 16px) !important}.py-3{padding-top:var(--base-size-16, 16px) !important;padding-bottom:var(--base-size-16, 16px) !important}.p-4{padding:var(--base-size-24, 24px) !important}.pt-4{padding-top:var(--base-size-24, 24px) !important}.pr-4{padding-right:var(--base-size-24, 24px) !important}.pb-4{padding-bottom:var(--base-size-24, 24px) !important}.pl-4{padding-left:var(--base-size-24, 24px) !important}.px-4{padding-right:var(--base-size-24, 24px) !important;padding-left:var(--base-size-24, 24px) !important}.py-4{padding-top:var(--base-size-24, 24px) !important;padding-bottom:var(--base-size-24, 24px) !important}.p-5{padding:var(--base-size-32, 32px) !important}.pt-5{padding-top:var(--base-size-32, 32px) !important}.pr-5{padding-right:var(--base-size-32, 32px) !important}.pb-5{padding-bottom:var(--base-size-32, 32px) !important}.pl-5{padding-left:var(--base-size-32, 32px) !important}.px-5{padding-right:var(--base-size-32, 32px) !important;padding-left:var(--base-size-32, 32px) !important}.py-5{padding-top:var(--base-size-32, 32px) !important;padding-bottom:var(--base-size-32, 32px) !important}.p-6{padding:var(--base-size-40, 40px) !important}.pt-6{padding-top:var(--base-size-40, 40px) !important}.pr-6{padding-right:var(--base-size-40, 40px) !important}.pb-6{padding-bottom:var(--base-size-40, 40px) !important}.pl-6{padding-left:var(--base-size-40, 40px) !important}.px-6{padding-right:var(--base-size-40, 40px) !important;padding-left:var(--base-size-40, 40px) !important}.py-6{padding-top:var(--base-size-40, 40px) !important;padding-bottom:var(--base-size-40, 40px) !important}.pt-7{padding-top:var(--base-size-48, 48px) !important}.pr-7{padding-right:var(--base-size-48, 48px) !important}.pb-7{padding-bottom:var(--base-size-48, 48px) !important}.pl-7{padding-left:var(--base-size-48, 48px) !important}.py-7{padding-top:var(--base-size-48, 48px) !important;padding-bottom:var(--base-size-48, 48px) !important}.pt-8{padding-top:var(--base-size-64, 64px) !important}.pr-8{padding-right:var(--base-size-64, 64px) !important}.pb-8{padding-bottom:var(--base-size-64, 64px) !important}.pl-8{padding-left:var(--base-size-64, 64px) !important}.py-8{padding-top:var(--base-size-64, 64px) !important;padding-bottom:var(--base-size-64, 64px) !important}.pt-9{padding-top:var(--base-size-80, 80px) !important}.pr-9{padding-right:var(--base-size-80, 80px) !important}.pb-9{padding-bottom:var(--base-size-80, 80px) !important}.pl-9{padding-left:var(--base-size-80, 80px) !important}.py-9{padding-top:var(--base-size-80, 80px) !important;padding-bottom:var(--base-size-80, 80px) !important}.pt-10{padding-top:var(--base-size-96, 96px) !important}.pr-10{padding-right:var(--base-size-96, 96px) !important}.pb-10{padding-bottom:var(--base-size-96, 96px) !important}.pl-10{padding-left:var(--base-size-96, 96px) !important}.py-10{padding-top:var(--base-size-96, 96px) !important;padding-bottom:var(--base-size-96, 96px) !important}.pt-11{padding-top:var(--base-size-112, 112px) !important}.pr-11{padding-right:var(--base-size-112, 112px) !important}.pb-11{padding-bottom:var(--base-size-112, 112px) !important}.pl-11{padding-left:var(--base-size-112, 112px) !important}.py-11{padding-top:var(--base-size-112, 112px) !important;padding-bottom:var(--base-size-112, 112px) !important}.pt-12{padding-top:var(--base-size-128, 128px) !important}.pr-12{padding-right:var(--base-size-128, 128px) !important}.pb-12{padding-bottom:var(--base-size-128, 128px) !important}.pl-12{padding-left:var(--base-size-128, 128px) !important}.py-12{padding-top:var(--base-size-128, 128px) !important;padding-bottom:var(--base-size-128, 128px) !important}@media(min-width: 544px){.p-sm-0{padding:0 !important}.pt-sm-0{padding-top:0 !important}.pr-sm-0{padding-right:0 !important}.pb-sm-0{padding-bottom:0 !important}.pl-sm-0{padding-left:0 !important}.px-sm-0{padding-right:0 !important;padding-left:0 !important}.py-sm-0{padding-top:0 !important;padding-bottom:0 !important}.p-sm-1{padding:var(--base-size-4, 4px) !important}.pt-sm-1{padding-top:var(--base-size-4, 4px) !important}.pr-sm-1{padding-right:var(--base-size-4, 4px) !important}.pb-sm-1{padding-bottom:var(--base-size-4, 4px) !important}.pl-sm-1{padding-left:var(--base-size-4, 4px) !important}.px-sm-1{padding-right:var(--base-size-4, 4px) !important;padding-left:var(--base-size-4, 4px) !important}.py-sm-1{padding-top:var(--base-size-4, 4px) !important;padding-bottom:var(--base-size-4, 4px) !important}.p-sm-2{padding:var(--base-size-8, 8px) !important}.pt-sm-2{padding-top:var(--base-size-8, 8px) !important}.pr-sm-2{padding-right:var(--base-size-8, 8px) !important}.pb-sm-2{padding-bottom:var(--base-size-8, 8px) !important}.pl-sm-2{padding-left:var(--base-size-8, 8px) !important}.px-sm-2{padding-right:var(--base-size-8, 8px) !important;padding-left:var(--base-size-8, 8px) !important}.py-sm-2{padding-top:var(--base-size-8, 8px) !important;padding-bottom:var(--base-size-8, 8px) !important}.p-sm-3{padding:var(--base-size-16, 16px) !important}.pt-sm-3{padding-top:var(--base-size-16, 16px) !important}.pr-sm-3{padding-right:var(--base-size-16, 16px) !important}.pb-sm-3{padding-bottom:var(--base-size-16, 16px) !important}.pl-sm-3{padding-left:var(--base-size-16, 16px) !important}.px-sm-3{padding-right:var(--base-size-16, 16px) !important;padding-left:var(--base-size-16, 16px) !important}.py-sm-3{padding-top:var(--base-size-16, 16px) !important;padding-bottom:var(--base-size-16, 16px) !important}.p-sm-4{padding:var(--base-size-24, 24px) !important}.pt-sm-4{padding-top:var(--base-size-24, 24px) !important}.pr-sm-4{padding-right:var(--base-size-24, 24px) !important}.pb-sm-4{padding-bottom:var(--base-size-24, 24px) !important}.pl-sm-4{padding-left:var(--base-size-24, 24px) !important}.px-sm-4{padding-right:var(--base-size-24, 24px) !important;padding-left:var(--base-size-24, 24px) !important}.py-sm-4{padding-top:var(--base-size-24, 24px) !important;padding-bottom:var(--base-size-24, 24px) !important}.p-sm-5{padding:var(--base-size-32, 32px) !important}.pt-sm-5{padding-top:var(--base-size-32, 32px) !important}.pr-sm-5{padding-right:var(--base-size-32, 32px) !important}.pb-sm-5{padding-bottom:var(--base-size-32, 32px) !important}.pl-sm-5{padding-left:var(--base-size-32, 32px) !important}.px-sm-5{padding-right:var(--base-size-32, 32px) !important;padding-left:var(--base-size-32, 32px) !important}.py-sm-5{padding-top:var(--base-size-32, 32px) !important;padding-bottom:var(--base-size-32, 32px) !important}.p-sm-6{padding:var(--base-size-40, 40px) !important}.pt-sm-6{padding-top:var(--base-size-40, 40px) !important}.pr-sm-6{padding-right:var(--base-size-40, 40px) !important}.pb-sm-6{padding-bottom:var(--base-size-40, 40px) !important}.pl-sm-6{padding-left:var(--base-size-40, 40px) !important}.px-sm-6{padding-right:var(--base-size-40, 40px) !important;padding-left:var(--base-size-40, 40px) !important}.py-sm-6{padding-top:var(--base-size-40, 40px) !important;padding-bottom:var(--base-size-40, 40px) !important}.pt-sm-7{padding-top:var(--base-size-48, 48px) !important}.pr-sm-7{padding-right:var(--base-size-48, 48px) !important}.pb-sm-7{padding-bottom:var(--base-size-48, 48px) !important}.pl-sm-7{padding-left:var(--base-size-48, 48px) !important}.py-sm-7{padding-top:var(--base-size-48, 48px) !important;padding-bottom:var(--base-size-48, 48px) !important}.pt-sm-8{padding-top:var(--base-size-64, 64px) !important}.pr-sm-8{padding-right:var(--base-size-64, 64px) !important}.pb-sm-8{padding-bottom:var(--base-size-64, 64px) !important}.pl-sm-8{padding-left:var(--base-size-64, 64px) !important}.py-sm-8{padding-top:var(--base-size-64, 64px) !important;padding-bottom:var(--base-size-64, 64px) !important}.pt-sm-9{padding-top:var(--base-size-80, 80px) !important}.pr-sm-9{padding-right:var(--base-size-80, 80px) !important}.pb-sm-9{padding-bottom:var(--base-size-80, 80px) !important}.pl-sm-9{padding-left:var(--base-size-80, 80px) !important}.py-sm-9{padding-top:var(--base-size-80, 80px) !important;padding-bottom:var(--base-size-80, 80px) !important}.pt-sm-10{padding-top:var(--base-size-96, 96px) !important}.pr-sm-10{padding-right:var(--base-size-96, 96px) !important}.pb-sm-10{padding-bottom:var(--base-size-96, 96px) !important}.pl-sm-10{padding-left:var(--base-size-96, 96px) !important}.py-sm-10{padding-top:var(--base-size-96, 96px) !important;padding-bottom:var(--base-size-96, 96px) !important}.pt-sm-11{padding-top:var(--base-size-112, 112px) !important}.pr-sm-11{padding-right:var(--base-size-112, 112px) !important}.pb-sm-11{padding-bottom:var(--base-size-112, 112px) !important}.pl-sm-11{padding-left:var(--base-size-112, 112px) !important}.py-sm-11{padding-top:var(--base-size-112, 112px) !important;padding-bottom:var(--base-size-112, 112px) !important}.pt-sm-12{padding-top:var(--base-size-128, 128px) !important}.pr-sm-12{padding-right:var(--base-size-128, 128px) !important}.pb-sm-12{padding-bottom:var(--base-size-128, 128px) !important}.pl-sm-12{padding-left:var(--base-size-128, 128px) !important}.py-sm-12{padding-top:var(--base-size-128, 128px) !important;padding-bottom:var(--base-size-128, 128px) !important}}@media(min-width: 768px){.p-md-0{padding:0 !important}.pt-md-0{padding-top:0 !important}.pr-md-0{padding-right:0 !important}.pb-md-0{padding-bottom:0 !important}.pl-md-0{padding-left:0 !important}.px-md-0{padding-right:0 !important;padding-left:0 !important}.py-md-0{padding-top:0 !important;padding-bottom:0 !important}.p-md-1{padding:var(--base-size-4, 4px) !important}.pt-md-1{padding-top:var(--base-size-4, 4px) !important}.pr-md-1{padding-right:var(--base-size-4, 4px) !important}.pb-md-1{padding-bottom:var(--base-size-4, 4px) !important}.pl-md-1{padding-left:var(--base-size-4, 4px) !important}.px-md-1{padding-right:var(--base-size-4, 4px) !important;padding-left:var(--base-size-4, 4px) !important}.py-md-1{padding-top:var(--base-size-4, 4px) !important;padding-bottom:var(--base-size-4, 4px) !important}.p-md-2{padding:var(--base-size-8, 8px) !important}.pt-md-2{padding-top:var(--base-size-8, 8px) !important}.pr-md-2{padding-right:var(--base-size-8, 8px) !important}.pb-md-2{padding-bottom:var(--base-size-8, 8px) !important}.pl-md-2{padding-left:var(--base-size-8, 8px) !important}.px-md-2{padding-right:var(--base-size-8, 8px) !important;padding-left:var(--base-size-8, 8px) !important}.py-md-2{padding-top:var(--base-size-8, 8px) !important;padding-bottom:var(--base-size-8, 8px) !important}.p-md-3{padding:var(--base-size-16, 16px) !important}.pt-md-3{padding-top:var(--base-size-16, 16px) !important}.pr-md-3{padding-right:var(--base-size-16, 16px) !important}.pb-md-3{padding-bottom:var(--base-size-16, 16px) !important}.pl-md-3{padding-left:var(--base-size-16, 16px) !important}.px-md-3{padding-right:var(--base-size-16, 16px) !important;padding-left:var(--base-size-16, 16px) !important}.py-md-3{padding-top:var(--base-size-16, 16px) !important;padding-bottom:var(--base-size-16, 16px) !important}.p-md-4{padding:var(--base-size-24, 24px) !important}.pt-md-4{padding-top:var(--base-size-24, 24px) !important}.pr-md-4{padding-right:var(--base-size-24, 24px) !important}.pb-md-4{padding-bottom:var(--base-size-24, 24px) !important}.pl-md-4{padding-left:var(--base-size-24, 24px) !important}.px-md-4{padding-right:var(--base-size-24, 24px) !important;padding-left:var(--base-size-24, 24px) !important}.py-md-4{padding-top:var(--base-size-24, 24px) !important;padding-bottom:var(--base-size-24, 24px) !important}.p-md-5{padding:var(--base-size-32, 32px) !important}.pt-md-5{padding-top:var(--base-size-32, 32px) !important}.pr-md-5{padding-right:var(--base-size-32, 32px) !important}.pb-md-5{padding-bottom:var(--base-size-32, 32px) !important}.pl-md-5{padding-left:var(--base-size-32, 32px) !important}.px-md-5{padding-right:var(--base-size-32, 32px) !important;padding-left:var(--base-size-32, 32px) !important}.py-md-5{padding-top:var(--base-size-32, 32px) !important;padding-bottom:var(--base-size-32, 32px) !important}.p-md-6{padding:var(--base-size-40, 40px) !important}.pt-md-6{padding-top:var(--base-size-40, 40px) !important}.pr-md-6{padding-right:var(--base-size-40, 40px) !important}.pb-md-6{padding-bottom:var(--base-size-40, 40px) !important}.pl-md-6{padding-left:var(--base-size-40, 40px) !important}.px-md-6{padding-right:var(--base-size-40, 40px) !important;padding-left:var(--base-size-40, 40px) !important}.py-md-6{padding-top:var(--base-size-40, 40px) !important;padding-bottom:var(--base-size-40, 40px) !important}.pt-md-7{padding-top:var(--base-size-48, 48px) !important}.pr-md-7{padding-right:var(--base-size-48, 48px) !important}.pb-md-7{padding-bottom:var(--base-size-48, 48px) !important}.pl-md-7{padding-left:var(--base-size-48, 48px) !important}.py-md-7{padding-top:var(--base-size-48, 48px) !important;padding-bottom:var(--base-size-48, 48px) !important}.pt-md-8{padding-top:var(--base-size-64, 64px) !important}.pr-md-8{padding-right:var(--base-size-64, 64px) !important}.pb-md-8{padding-bottom:var(--base-size-64, 64px) !important}.pl-md-8{padding-left:var(--base-size-64, 64px) !important}.py-md-8{padding-top:var(--base-size-64, 64px) !important;padding-bottom:var(--base-size-64, 64px) !important}.pt-md-9{padding-top:var(--base-size-80, 80px) !important}.pr-md-9{padding-right:var(--base-size-80, 80px) !important}.pb-md-9{padding-bottom:var(--base-size-80, 80px) !important}.pl-md-9{padding-left:var(--base-size-80, 80px) !important}.py-md-9{padding-top:var(--base-size-80, 80px) !important;padding-bottom:var(--base-size-80, 80px) !important}.pt-md-10{padding-top:var(--base-size-96, 96px) !important}.pr-md-10{padding-right:var(--base-size-96, 96px) !important}.pb-md-10{padding-bottom:var(--base-size-96, 96px) !important}.pl-md-10{padding-left:var(--base-size-96, 96px) !important}.py-md-10{padding-top:var(--base-size-96, 96px) !important;padding-bottom:var(--base-size-96, 96px) !important}.pt-md-11{padding-top:var(--base-size-112, 112px) !important}.pr-md-11{padding-right:var(--base-size-112, 112px) !important}.pb-md-11{padding-bottom:var(--base-size-112, 112px) !important}.pl-md-11{padding-left:var(--base-size-112, 112px) !important}.py-md-11{padding-top:var(--base-size-112, 112px) !important;padding-bottom:var(--base-size-112, 112px) !important}.pt-md-12{padding-top:var(--base-size-128, 128px) !important}.pr-md-12{padding-right:var(--base-size-128, 128px) !important}.pb-md-12{padding-bottom:var(--base-size-128, 128px) !important}.pl-md-12{padding-left:var(--base-size-128, 128px) !important}.py-md-12{padding-top:var(--base-size-128, 128px) !important;padding-bottom:var(--base-size-128, 128px) !important}}@media(min-width: 1012px){.p-lg-0{padding:0 !important}.pt-lg-0{padding-top:0 !important}.pr-lg-0{padding-right:0 !important}.pb-lg-0{padding-bottom:0 !important}.pl-lg-0{padding-left:0 !important}.px-lg-0{padding-right:0 !important;padding-left:0 !important}.py-lg-0{padding-top:0 !important;padding-bottom:0 !important}.p-lg-1{padding:var(--base-size-4, 4px) !important}.pt-lg-1{padding-top:var(--base-size-4, 4px) !important}.pr-lg-1{padding-right:var(--base-size-4, 4px) !important}.pb-lg-1{padding-bottom:var(--base-size-4, 4px) !important}.pl-lg-1{padding-left:var(--base-size-4, 4px) !important}.px-lg-1{padding-right:var(--base-size-4, 4px) !important;padding-left:var(--base-size-4, 4px) !important}.py-lg-1{padding-top:var(--base-size-4, 4px) !important;padding-bottom:var(--base-size-4, 4px) !important}.p-lg-2{padding:var(--base-size-8, 8px) !important}.pt-lg-2{padding-top:var(--base-size-8, 8px) !important}.pr-lg-2{padding-right:var(--base-size-8, 8px) !important}.pb-lg-2{padding-bottom:var(--base-size-8, 8px) !important}.pl-lg-2{padding-left:var(--base-size-8, 8px) !important}.px-lg-2{padding-right:var(--base-size-8, 8px) !important;padding-left:var(--base-size-8, 8px) !important}.py-lg-2{padding-top:var(--base-size-8, 8px) !important;padding-bottom:var(--base-size-8, 8px) !important}.p-lg-3{padding:var(--base-size-16, 16px) !important}.pt-lg-3{padding-top:var(--base-size-16, 16px) !important}.pr-lg-3{padding-right:var(--base-size-16, 16px) !important}.pb-lg-3{padding-bottom:var(--base-size-16, 16px) !important}.pl-lg-3{padding-left:var(--base-size-16, 16px) !important}.px-lg-3{padding-right:var(--base-size-16, 16px) !important;padding-left:var(--base-size-16, 16px) !important}.py-lg-3{padding-top:var(--base-size-16, 16px) !important;padding-bottom:var(--base-size-16, 16px) !important}.p-lg-4{padding:var(--base-size-24, 24px) !important}.pt-lg-4{padding-top:var(--base-size-24, 24px) !important}.pr-lg-4{padding-right:var(--base-size-24, 24px) !important}.pb-lg-4{padding-bottom:var(--base-size-24, 24px) !important}.pl-lg-4{padding-left:var(--base-size-24, 24px) !important}.px-lg-4{padding-right:var(--base-size-24, 24px) !important;padding-left:var(--base-size-24, 24px) !important}.py-lg-4{padding-top:var(--base-size-24, 24px) !important;padding-bottom:var(--base-size-24, 24px) !important}.p-lg-5{padding:var(--base-size-32, 32px) !important}.pt-lg-5{padding-top:var(--base-size-32, 32px) !important}.pr-lg-5{padding-right:var(--base-size-32, 32px) !important}.pb-lg-5{padding-bottom:var(--base-size-32, 32px) !important}.pl-lg-5{padding-left:var(--base-size-32, 32px) !important}.px-lg-5{padding-right:var(--base-size-32, 32px) !important;padding-left:var(--base-size-32, 32px) !important}.py-lg-5{padding-top:var(--base-size-32, 32px) !important;padding-bottom:var(--base-size-32, 32px) !important}.p-lg-6{padding:var(--base-size-40, 40px) !important}.pt-lg-6{padding-top:var(--base-size-40, 40px) !important}.pr-lg-6{padding-right:var(--base-size-40, 40px) !important}.pb-lg-6{padding-bottom:var(--base-size-40, 40px) !important}.pl-lg-6{padding-left:var(--base-size-40, 40px) !important}.px-lg-6{padding-right:var(--base-size-40, 40px) !important;padding-left:var(--base-size-40, 40px) !important}.py-lg-6{padding-top:var(--base-size-40, 40px) !important;padding-bottom:var(--base-size-40, 40px) !important}.pt-lg-7{padding-top:var(--base-size-48, 48px) !important}.pr-lg-7{padding-right:var(--base-size-48, 48px) !important}.pb-lg-7{padding-bottom:var(--base-size-48, 48px) !important}.pl-lg-7{padding-left:var(--base-size-48, 48px) !important}.py-lg-7{padding-top:var(--base-size-48, 48px) !important;padding-bottom:var(--base-size-48, 48px) !important}.pt-lg-8{padding-top:var(--base-size-64, 64px) !important}.pr-lg-8{padding-right:var(--base-size-64, 64px) !important}.pb-lg-8{padding-bottom:var(--base-size-64, 64px) !important}.pl-lg-8{padding-left:var(--base-size-64, 64px) !important}.py-lg-8{padding-top:var(--base-size-64, 64px) !important;padding-bottom:var(--base-size-64, 64px) !important}.pt-lg-9{padding-top:var(--base-size-80, 80px) !important}.pr-lg-9{padding-right:var(--base-size-80, 80px) !important}.pb-lg-9{padding-bottom:var(--base-size-80, 80px) !important}.pl-lg-9{padding-left:var(--base-size-80, 80px) !important}.py-lg-9{padding-top:var(--base-size-80, 80px) !important;padding-bottom:var(--base-size-80, 80px) !important}.pt-lg-10{padding-top:var(--base-size-96, 96px) !important}.pr-lg-10{padding-right:var(--base-size-96, 96px) !important}.pb-lg-10{padding-bottom:var(--base-size-96, 96px) !important}.pl-lg-10{padding-left:var(--base-size-96, 96px) !important}.py-lg-10{padding-top:var(--base-size-96, 96px) !important;padding-bottom:var(--base-size-96, 96px) !important}.pt-lg-11{padding-top:var(--base-size-112, 112px) !important}.pr-lg-11{padding-right:var(--base-size-112, 112px) !important}.pb-lg-11{padding-bottom:var(--base-size-112, 112px) !important}.pl-lg-11{padding-left:var(--base-size-112, 112px) !important}.py-lg-11{padding-top:var(--base-size-112, 112px) !important;padding-bottom:var(--base-size-112, 112px) !important}.pt-lg-12{padding-top:var(--base-size-128, 128px) !important}.pr-lg-12{padding-right:var(--base-size-128, 128px) !important}.pb-lg-12{padding-bottom:var(--base-size-128, 128px) !important}.pl-lg-12{padding-left:var(--base-size-128, 128px) !important}.py-lg-12{padding-top:var(--base-size-128, 128px) !important;padding-bottom:var(--base-size-128, 128px) !important}}@media(min-width: 1280px){.p-xl-0{padding:0 !important}.pt-xl-0{padding-top:0 !important}.pr-xl-0{padding-right:0 !important}.pb-xl-0{padding-bottom:0 !important}.pl-xl-0{padding-left:0 !important}.px-xl-0{padding-right:0 !important;padding-left:0 !important}.py-xl-0{padding-top:0 !important;padding-bottom:0 !important}.p-xl-1{padding:var(--base-size-4, 4px) !important}.pt-xl-1{padding-top:var(--base-size-4, 4px) !important}.pr-xl-1{padding-right:var(--base-size-4, 4px) !important}.pb-xl-1{padding-bottom:var(--base-size-4, 4px) !important}.pl-xl-1{padding-left:var(--base-size-4, 4px) !important}.px-xl-1{padding-right:var(--base-size-4, 4px) !important;padding-left:var(--base-size-4, 4px) !important}.py-xl-1{padding-top:var(--base-size-4, 4px) !important;padding-bottom:var(--base-size-4, 4px) !important}.p-xl-2{padding:var(--base-size-8, 8px) !important}.pt-xl-2{padding-top:var(--base-size-8, 8px) !important}.pr-xl-2{padding-right:var(--base-size-8, 8px) !important}.pb-xl-2{padding-bottom:var(--base-size-8, 8px) !important}.pl-xl-2{padding-left:var(--base-size-8, 8px) !important}.px-xl-2{padding-right:var(--base-size-8, 8px) !important;padding-left:var(--base-size-8, 8px) !important}.py-xl-2{padding-top:var(--base-size-8, 8px) !important;padding-bottom:var(--base-size-8, 8px) !important}.p-xl-3{padding:var(--base-size-16, 16px) !important}.pt-xl-3{padding-top:var(--base-size-16, 16px) !important}.pr-xl-3{padding-right:var(--base-size-16, 16px) !important}.pb-xl-3{padding-bottom:var(--base-size-16, 16px) !important}.pl-xl-3{padding-left:var(--base-size-16, 16px) !important}.px-xl-3{padding-right:var(--base-size-16, 16px) !important;padding-left:var(--base-size-16, 16px) !important}.py-xl-3{padding-top:var(--base-size-16, 16px) !important;padding-bottom:var(--base-size-16, 16px) !important}.p-xl-4{padding:var(--base-size-24, 24px) !important}.pt-xl-4{padding-top:var(--base-size-24, 24px) !important}.pr-xl-4{padding-right:var(--base-size-24, 24px) !important}.pb-xl-4{padding-bottom:var(--base-size-24, 24px) !important}.pl-xl-4{padding-left:var(--base-size-24, 24px) !important}.px-xl-4{padding-right:var(--base-size-24, 24px) !important;padding-left:var(--base-size-24, 24px) !important}.py-xl-4{padding-top:var(--base-size-24, 24px) !important;padding-bottom:var(--base-size-24, 24px) !important}.p-xl-5{padding:var(--base-size-32, 32px) !important}.pt-xl-5{padding-top:var(--base-size-32, 32px) !important}.pr-xl-5{padding-right:var(--base-size-32, 32px) !important}.pb-xl-5{padding-bottom:var(--base-size-32, 32px) !important}.pl-xl-5{padding-left:var(--base-size-32, 32px) !important}.px-xl-5{padding-right:var(--base-size-32, 32px) !important;padding-left:var(--base-size-32, 32px) !important}.py-xl-5{padding-top:var(--base-size-32, 32px) !important;padding-bottom:var(--base-size-32, 32px) !important}.p-xl-6{padding:var(--base-size-40, 40px) !important}.pt-xl-6{padding-top:var(--base-size-40, 40px) !important}.pr-xl-6{padding-right:var(--base-size-40, 40px) !important}.pb-xl-6{padding-bottom:var(--base-size-40, 40px) !important}.pl-xl-6{padding-left:var(--base-size-40, 40px) !important}.px-xl-6{padding-right:var(--base-size-40, 40px) !important;padding-left:var(--base-size-40, 40px) !important}.py-xl-6{padding-top:var(--base-size-40, 40px) !important;padding-bottom:var(--base-size-40, 40px) !important}.pt-xl-7{padding-top:var(--base-size-48, 48px) !important}.pr-xl-7{padding-right:var(--base-size-48, 48px) !important}.pb-xl-7{padding-bottom:var(--base-size-48, 48px) !important}.pl-xl-7{padding-left:var(--base-size-48, 48px) !important}.py-xl-7{padding-top:var(--base-size-48, 48px) !important;padding-bottom:var(--base-size-48, 48px) !important}.pt-xl-8{padding-top:var(--base-size-64, 64px) !important}.pr-xl-8{padding-right:var(--base-size-64, 64px) !important}.pb-xl-8{padding-bottom:var(--base-size-64, 64px) !important}.pl-xl-8{padding-left:var(--base-size-64, 64px) !important}.py-xl-8{padding-top:var(--base-size-64, 64px) !important;padding-bottom:var(--base-size-64, 64px) !important}.pt-xl-9{padding-top:var(--base-size-80, 80px) !important}.pr-xl-9{padding-right:var(--base-size-80, 80px) !important}.pb-xl-9{padding-bottom:var(--base-size-80, 80px) !important}.pl-xl-9{padding-left:var(--base-size-80, 80px) !important}.py-xl-9{padding-top:var(--base-size-80, 80px) !important;padding-bottom:var(--base-size-80, 80px) !important}.pt-xl-10{padding-top:var(--base-size-96, 96px) !important}.pr-xl-10{padding-right:var(--base-size-96, 96px) !important}.pb-xl-10{padding-bottom:var(--base-size-96, 96px) !important}.pl-xl-10{padding-left:var(--base-size-96, 96px) !important}.py-xl-10{padding-top:var(--base-size-96, 96px) !important;padding-bottom:var(--base-size-96, 96px) !important}.pt-xl-11{padding-top:var(--base-size-112, 112px) !important}.pr-xl-11{padding-right:var(--base-size-112, 112px) !important}.pb-xl-11{padding-bottom:var(--base-size-112, 112px) !important}.pl-xl-11{padding-left:var(--base-size-112, 112px) !important}.py-xl-11{padding-top:var(--base-size-112, 112px) !important;padding-bottom:var(--base-size-112, 112px) !important}.pt-xl-12{padding-top:var(--base-size-128, 128px) !important}.pr-xl-12{padding-right:var(--base-size-128, 128px) !important}.pb-xl-12{padding-bottom:var(--base-size-128, 128px) !important}.pl-xl-12{padding-left:var(--base-size-128, 128px) !important}.py-xl-12{padding-top:var(--base-size-128, 128px) !important;padding-bottom:var(--base-size-128, 128px) !important}}.p-responsive{padding-right:var(--base-size-16) !important;padding-left:var(--base-size-16) !important}@media(min-width: 544px){.p-responsive{padding-right:var(--base-size-40) !important;padding-left:var(--base-size-40) !important}}@media(min-width: 1012px){.p-responsive{padding-right:var(--base-size-16) !important;padding-left:var(--base-size-16) !important}}.h1{font-size:var(--h1-size-mobile, 26px) !important}@media(min-width: 768px){.h1{font-size:var(--h1-size, 32px) !important}}.h2{font-size:var(--h2-size-mobile, 22px) !important}@media(min-width: 768px){.h2{font-size:var(--h2-size, 24px) !important}}.h3{font-size:var(--h3-size-mobile, 18px) !important}@media(min-width: 768px){.h3{font-size:var(--h3-size, 20px) !important}}.h4{font-size:var(--h4-size, 16px) !important}.h5{font-size:var(--h5-size, 14px) !important}.h6{font-size:var(--h6-size, 12px) !important}.h1,.h2,.h3,.h4,.h5,.h6{font-weight:var(--base-text-weight-semibold, 600) !important}.f1{font-size:var(--h1-size-mobile, 26px) !important}@media(min-width: 768px){.f1{font-size:var(--h1-size, 32px) !important}}.f2{font-size:var(--h2-size-mobile, 22px) !important}@media(min-width: 768px){.f2{font-size:var(--h2-size, 24px) !important}}.f3{font-size:var(--h3-size-mobile, 18px) !important}@media(min-width: 768px){.f3{font-size:var(--h3-size, 20px) !important}}.f4{font-size:var(--h4-size, 16px) !important}@media(min-width: 768px){.f4{font-size:var(--h4-size, 16px) !important}}.f5{font-size:var(--h5-size, 14px) !important}.f6{font-size:var(--h6-size, 12px) !important}.f00-light{font-size:var(--h00-size-mobile, 40px) !important;font-weight:var(--base-text-weight-light, 300) !important}@media(min-width: 768px){.f00-light{font-size:var(--h00-size, 48px) !important}}.f0-light{font-size:var(--h0-size-mobile, 32px) !important;font-weight:var(--base-text-weight-light, 300) !important}@media(min-width: 768px){.f0-light{font-size:var(--h0-size, 40px) !important}}.f1-light{font-size:var(--h1-size-mobile, 26px) !important;font-weight:var(--base-text-weight-light, 300) !important}@media(min-width: 768px){.f1-light{font-size:var(--h1-size, 32px) !important}}.f2-light{font-size:var(--h2-size-mobile, 22px) !important;font-weight:var(--base-text-weight-light, 300) !important}@media(min-width: 768px){.f2-light{font-size:var(--h2-size, 24px) !important}}.f3-light{font-size:var(--h3-size-mobile, 18px) !important;font-weight:var(--base-text-weight-light, 300) !important}@media(min-width: 768px){.f3-light{font-size:var(--h3-size, 20px) !important}}.text-small{font-size:var(--h6-size, 12px) !important}.lead{margin-bottom:30px;font-size:var(--h3-size, 20px);font-weight:var(--base-text-weight-light, 300)}.lh-condensed-ultra{line-height:1 !important}.lh-condensed{line-height:1.25 !important}.lh-default{line-height:1.5 !important}.lh-0{line-height:0 !important}@media(min-width: 544px){.lh-sm-condensed-ultra{line-height:1 !important}.lh-sm-condensed{line-height:1.25 !important}.lh-sm-default{line-height:1.5 !important}.lh-sm-0{line-height:0 !important}}@media(min-width: 768px){.lh-md-condensed-ultra{line-height:1 !important}.lh-md-condensed{line-height:1.25 !important}.lh-md-default{line-height:1.5 !important}.lh-md-0{line-height:0 !important}}@media(min-width: 1012px){.lh-lg-condensed-ultra{line-height:1 !important}.lh-lg-condensed{line-height:1.25 !important}.lh-lg-default{line-height:1.5 !important}.lh-lg-0{line-height:0 !important}}@media(min-width: 1280px){.lh-xl-condensed-ultra{line-height:1 !important}.lh-xl-condensed{line-height:1.25 !important}.lh-xl-default{line-height:1.5 !important}.lh-xl-0{line-height:0 !important}}.text-right{text-align:right !important}.text-left{text-align:left !important}.text-center{text-align:center !important}@media(min-width: 544px){.text-sm-right{text-align:right !important}.text-sm-left{text-align:left !important}.text-sm-center{text-align:center !important}}@media(min-width: 768px){.text-md-right{text-align:right !important}.text-md-left{text-align:left !important}.text-md-center{text-align:center !important}}@media(min-width: 1012px){.text-lg-right{text-align:right !important}.text-lg-left{text-align:left !important}.text-lg-center{text-align:center !important}}@media(min-width: 1280px){.text-xl-right{text-align:right !important}.text-xl-left{text-align:left !important}.text-xl-center{text-align:center !important}}.text-normal{font-weight:var(--base-text-weight-normal, 400) !important}.text-bold{font-weight:var(--base-text-weight-semibold, 600) !important}.text-semibold{font-weight:var(--base-text-weight-medium, 500) !important}.text-light{font-weight:var(--base-text-weight-light, 300) !important}.text-italic{font-style:italic !important}.text-uppercase{text-transform:uppercase !important}.text-underline{text-decoration:underline !important}.no-underline{text-decoration:none !important}.no-wrap{white-space:nowrap !important}.ws-normal{white-space:normal !important}.wb-break-word{word-break:break-word !important;word-wrap:break-word !important;overflow-wrap:break-word !important}.wb-break-all{word-break:break-all !important}.text-emphasized{font-weight:var(--base-text-weight-semibold, 600)}.list-style-none{list-style:none !important}.text-mono{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace) !important}.user-select-none{-webkit-user-select:none !important;user-select:none !important}.text-capitalize{text-transform:capitalize !important}.d-block{display:block !important}.d-flex{display:flex !important}.d-inline{display:inline !important}.d-inline-block{display:inline-block !important}.d-inline-flex{display:inline-flex !important}.d-none{display:none !important}.d-table{display:table !important}.d-table-cell{display:table-cell !important}@media(min-width: 544px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}.d-sm-inline{display:inline !important}.d-sm-inline-block{display:inline-block !important}.d-sm-inline-flex{display:inline-flex !important}.d-sm-none{display:none !important}.d-sm-table{display:table !important}.d-sm-table-cell{display:table-cell !important}}@media(min-width: 768px){.d-md-block{display:block !important}.d-md-flex{display:flex !important}.d-md-inline{display:inline !important}.d-md-inline-block{display:inline-block !important}.d-md-inline-flex{display:inline-flex !important}.d-md-none{display:none !important}.d-md-table{display:table !important}.d-md-table-cell{display:table-cell !important}}@media(min-width: 1012px){.d-lg-block{display:block !important}.d-lg-flex{display:flex !important}.d-lg-inline{display:inline !important}.d-lg-inline-block{display:inline-block !important}.d-lg-inline-flex{display:inline-flex !important}.d-lg-none{display:none !important}.d-lg-table{display:table !important}.d-lg-table-cell{display:table-cell !important}}@media(min-width: 1280px){.d-xl-block{display:block !important}.d-xl-flex{display:flex !important}.d-xl-inline{display:inline !important}.d-xl-inline-block{display:inline-block !important}.d-xl-inline-flex{display:inline-flex !important}.d-xl-none{display:none !important}.d-xl-table{display:table !important}.d-xl-table-cell{display:table-cell !important}}.v-hidden{visibility:hidden !important}.v-visible{visibility:visible !important}@media(max-width: 543.98px){.hide-sm{display:none !important}}@media(min-width: 544px)and (max-width: 767.98px){.hide-md{display:none !important}}@media(min-width: 768px)and (max-width: 1011.98px){.hide-lg{display:none !important}}@media(min-width: 1012px){.hide-xl{display:none !important}}.show-whenNarrow,.show-whenRegular,.show-whenWide,.show-whenRegular.hide-whenWide{display:none !important}.hide-whenNarrow,.hide-whenRegular,.hide-whenWide{display:block !important}@media(max-width: 767.98px){.show-whenNarrow{display:block !important}.hide-whenNarrow{display:none !important}}@media(min-width: 768px){.show-whenRegular,.show-whenRegular.hide-whenWide{display:block !important}.hide-whenRegular{display:none !important}}@media(min-width: 1280px){.show-whenWide{display:block !important}.hide-whenWide,.show-whenRegular.hide-whenWide{display:none !important}}.table-fixed{table-layout:fixed !important}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:rect(0 0 0 0);overflow-wrap:normal;border:0}.show-on-focus{position:absolute !important}.show-on-focus:not(:focus){width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.show-on-focus:focus{z-index:999}.suggester{position:relative;top:0;left:0;min-width:180px;padding:0;margin:0;margin-top:var(--base-size-24);list-style:none;cursor:pointer;background:var(--overlay-bgColor, var(--color-canvas-overlay));border:1px solid var(--borderColor-default, var(--color-border-default));border-radius:6px;box-shadow:var(--shadow-resting-medium, var(--color-shadow-medium))}.suggester li{display:block;padding:var(--base-size-4) var(--base-size-8);font-weight:var(--base-text-weight-medium, 500);border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}.suggester li small{font-weight:var(--base-text-weight-normal, 400);color:var(--fgColor-muted, var(--color-fg-muted))}.suggester li:last-child{border-bottom:0;border-bottom-right-radius:6px;border-bottom-left-radius:6px}.suggester li:first-child{border-top-left-radius:6px;border-top-right-radius:6px}.suggester li:hover{color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));text-decoration:none;background:var(--bgColor-accent-emphasis, var(--color-accent-emphasis))}.suggester li:hover small{color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.suggester li:hover .octicon{color:inherit !important}.suggester li[aria-selected=true],.suggester li.navigation-focus{color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));text-decoration:none;background:var(--bgColor-accent-emphasis, var(--color-accent-emphasis))}.suggester li[aria-selected=true] small,.suggester li.navigation-focus small{color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))}.suggester li[aria-selected=true] .octicon,.suggester li.navigation-focus .octicon{color:inherit !important}.suggester-container{position:absolute;top:0;left:0;z-index:30}@media(max-width: 544px){.page-responsive .suggester-container{right:var(--base-size-8) !important;left:var(--base-size-8) !important}.page-responsive .suggester li{padding:var(--base-size-8) var(--base-size-16)}}.avatar-parent-child{position:relative}.avatar-child{position:absolute;right:-15%;bottom:-9%;background-color:var(--bgColor-default, var(--color-canvas-default));border-radius:4px;box-shadow:var(--avatar-shadow, var(--color-avatar-child-shadow))}.CircleBadge{display:flex;align-items:center;justify-content:center;background-color:var(--bgColor-default, var(--color-canvas-default));border-radius:50%;box-shadow:var(--shadow-resting-medium, var(--color-shadow-medium))}.CircleBadge-icon{max-width:60% !important;height:auto !important;max-height:55% !important}.CircleBadge--small{width:56px;height:56px}.CircleBadge--medium{width:96px;height:96px}.CircleBadge--large{width:128px;height:128px}.DashedConnection{position:relative}.DashedConnection::before{position:absolute;top:50%;left:0;width:100%;content:"";border-bottom:2px dashed var(--borderColor-default, var(--color-border-default))}.DashedConnection .CircleBadge{position:relative}.branch-name{display:inline-block;padding:2px 6px;font:12px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);color:var(--fgColor-muted, var(--color-fg-muted));word-break:break-all;background-color:var(--bgColor-accent-muted, var(--color-accent-subtle));border-radius:6px}.branch-name .octicon{margin:1px -2px 0 0;color:var(--fgColor-muted, var(--color-fg-muted))}a.branch-name{color:var(--fgColor-accent, var(--color-accent-fg));background-color:var(--bgColor-accent-muted, var(--color-accent-subtle))}a.branch-name .octicon{color:var(--fgColor-accent, var(--color-accent-fg))}.Header{z-index:32;display:flex;padding:var(--base-size-16);font-size:14px;line-height:1.5;color:var(--header-fgColor-default, var(--color-header-text));background-color:var(--header-bgColor, var(--color-header-bg));align-items:center;flex-wrap:nowrap}.Header-item{display:flex;margin-right:var(--base-size-16);align-self:stretch;align-items:center;flex-wrap:nowrap}.Header-item--full{flex:auto}.Header-link{font-weight:var(--base-text-weight-semibold, 600);color:var(--header-fgColor-logo, var(--color-header-logo));white-space:nowrap}.Header-link:hover,.Header-link:focus{color:var(--header-fgColor-default, var(--color-header-text));text-decoration:none}.Header-input{color:var(--header-fgColor-default, var(--color-header-text));background-color:var(--headerSearch-bgColor, var(--color-header-search-bg));border:1px solid var(--headerSearch-borderColor, var(--color-header-search-border));box-shadow:none}.Header-input::placeholder{color:hsla(0,0%,100%,.75)}.IssueLabel{display:inline-block;padding:0 7px;font-size:12px;font-weight:var(--base-text-weight-medium, 500);line-height:18px;white-space:nowrap;border:1px solid rgba(0,0,0,0);border-radius:2em}.IssueLabel .g-emoji{position:relative;top:-0.05em;display:inline-block;font-size:1em;line-height:1}.IssueLabel:hover{text-decoration:none}.IssueLabel--big{padding-right:10px;padding-left:10px;line-height:22px}.AnimatedEllipsis{display:inline-block;overflow:hidden;vertical-align:bottom}.AnimatedEllipsis::after{display:inline-block;content:"...";animation:AnimatedEllipsis-keyframes 1.2s steps(4, jump-none) infinite}@keyframes AnimatedEllipsis-keyframes{0%{transform:translateX(-100%)}}.markdown-body{font-family:var(--fontStack-sansSerif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji");font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body::before{display:table;content:""}.markdown-body::after{display:table;clear:both;content:""}.markdown-body>*:first-child{margin-top:0 !important}.markdown-body>*:last-child{margin-bottom:0 !important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger, var(--color-danger-fg))}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16)}.markdown-body hr{height:.25em;padding:0;margin:var(--base-size-24) 0;background-color:var(--borderColor-default, var(--color-border-default));border:0}.markdown-body blockquote{padding:0 1em;color:var(--fgColor-muted, var(--color-fg-muted));border-left:.25em solid var(--borderColor-default, var(--color-border-default))}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold, 600);line-height:1.25}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default, var(--color-fg-default));vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{padding:0 .2em;font-size:inherit}.markdown-body h1{padding-bottom:.3em;font-size:2em;border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}.markdown-body h2{padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}.markdown-body h3{font-size:1.25em}.markdown-body h4{font-size:1em}.markdown-body h5{font-size:.875em}.markdown-body h6{font-size:.85em;color:var(--fgColor-muted, var(--color-fg-muted))}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{padding-bottom:0;border-bottom:0}.markdown-body ul,.markdown-body ol{padding-left:2em}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type="a s"]{list-style-type:lower-alpha}.markdown-body ol[type="A s"]{list-style-type:upper-alpha}.markdown-body ol[type="i s"]{list-style-type:lower-roman}.markdown-body ol[type="I s"]{list-style-type:upper-roman}.markdown-body ol[type="1"]{list-style-type:decimal}.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table{display:block;width:100%;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.markdown-body table th{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid var(--borderColor-default, var(--color-border-default))}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default, var(--color-canvas-default));border-top:1px solid var(--borderColor-muted, var(--color-border-muted))}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted, var(--color-canvas-subtle))}.markdown-body table img{background-color:rgba(0,0,0,0)}.markdown-body img{max-width:100%;box-sizing:content-box}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:rgba(0,0,0,0)}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid var(--borderColor-default, var(--color-border-default))}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:var(--fgColor-default, var(--color-fg-default))}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em .4em;margin:0;font-size:85%;white-space:break-spaces;background-color:var(--bgColor-neutral-muted, var(--color-neutral-muted));border-radius:6px}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre{word-wrap:normal}.markdown-body pre code{font-size:100%}.markdown-body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:rgba(0,0,0,0);border:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);overflow:auto;font-size:85%;line-height:1.45;color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-muted, var(--color-canvas-subtle));border-radius:6px}.markdown-body pre code,.markdown-body pre tt{display:inline;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:rgba(0,0,0,0);border:0}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default, var(--color-canvas-default));border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold, 600);background:var(--bgColor-muted, var(--color-canvas-subtle));border-top:0}.markdown-body [data-footnote-ref]::before{content:"["}.markdown-body [data-footnote-ref]::after{content:"]"}.markdown-body .footnotes{font-size:12px;color:var(--fgColor-muted, var(--color-fg-muted));border-top:1px solid var(--borderColor-default, var(--color-border-default))}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{display:inline-block;padding-left:var(--base-size-16);margin-top:var(--base-size-16)}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target::before{position:absolute;top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis, var(--color-accent-emphasis));border-radius:6px}.markdown-body .footnotes li:target{color:var(--fgColor-default, var(--color-fg-default))}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.SelectMenu{position:fixed;top:0;right:0;bottom:0;left:0;z-index:99;display:flex;padding:var(--base-size-16);pointer-events:none;flex-direction:column}@media(min-width: 544px){.SelectMenu{position:absolute;top:auto;right:auto;bottom:auto;left:auto;padding:0}}.SelectMenu::before{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;content:"";background-color:var(--overlay-backdrop-bgColor, var(--color-primer-canvas-backdrop))}@media(min-width: 544px){.SelectMenu::before{display:none}}.SelectMenu-modal{position:relative;z-index:99;display:flex;max-height:66%;margin:auto 0;overflow:hidden;pointer-events:auto;flex-direction:column;background-color:var(--overlay-bgColor, var(--color-canvas-overlay));border:1px solid var(--selectMenu-borderColor, var(--color-select-menu-backdrop-border));border-radius:12px;box-shadow:var(--shadow-floating-legacy, var(--color-overlay-shadow));animation:SelectMenu-modal-animation .12s cubic-bezier(0, 0.1, 0.1, 1) backwards}@keyframes SelectMenu-modal-animation{0%{opacity:0;transform:scale(0.9)}}@keyframes SelectMenu-modal-animation--sm{0%{opacity:0;transform:translateY(calc(var(--base-size-16) * -1))}}@media(min-width: 544px){.SelectMenu-modal{width:300px;height:auto;max-height:480px;margin:var(--base-size-8) 0 var(--base-size-16) 0;font-size:12px;border-color:var(--borderColor-default, var(--color-border-default));border-radius:6px;box-shadow:var(--shadow-floating-legacy, var(--color-overlay-shadow));animation-name:SelectMenu-modal-animation--sm}}.SelectMenu-header{display:flex;padding:var(--base-size-16);flex:none;align-items:center;border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}@media(min-width: 544px){.SelectMenu-header{padding:7px 7px 7px var(--base-size-16)}}.SelectMenu-title{flex:1;font-size:14px;font-weight:var(--base-text-weight-semibold, 600)}@media(min-width: 544px){.SelectMenu-title{font-size:inherit}}.SelectMenu-closeButton{padding:var(--base-size-16);margin:calc(var(--base-size-16)*-1);line-height:1;color:var(--fgColor-muted, var(--color-fg-muted));background-color:rgba(0,0,0,0);border:0}@media(min-width: 544px){.SelectMenu-closeButton{padding:var(--base-size-8);margin:calc(var(--base-size-8)*-1) -7px}}.SelectMenu-filter{padding:var(--base-size-16);margin:0;border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}@media(min-width: 544px){.SelectMenu-filter{padding:var(--base-size-8)}}.SelectMenu-input{display:block;width:100%}@media(min-width: 544px){.SelectMenu-input{font-size:14px}}.SelectMenu-list{position:relative;padding:0;margin:0;margin-bottom:-1px;flex:auto;overflow-x:hidden;overflow-y:auto;background-color:var(--overlay-bgColor, var(--color-canvas-overlay));-webkit-overflow-scrolling:touch}.SelectMenu-item{display:flex;align-items:center;width:100%;padding:var(--base-size-16);overflow:hidden;color:var(--fgColor-default, var(--color-fg-default));text-align:left;cursor:pointer;background-color:var(--overlay-bgColor, var(--color-canvas-overlay));border:0;border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}@media(min-width: 544px){.SelectMenu-item{padding-top:7px;padding-bottom:7px}}.SelectMenu-list--borderless .SelectMenu-item{border-bottom:0}.SelectMenu-icon{width:var(--base-size-16);margin-right:var(--base-size-8);flex-shrink:0}.SelectMenu-icon--check{visibility:hidden;transition:transform .12s cubic-bezier(0.5, 0.1, 1, 0.5),visibility 0s .12s linear;transform:scale(0)}.SelectMenu-tabs{display:flex;flex-shrink:0;overflow-x:auto;overflow-y:hidden;box-shadow:inset 0 -1px 0 var(--borderColor-muted, var(--color-border-muted));-webkit-overflow-scrolling:touch}.SelectMenu-tabs::-webkit-scrollbar{display:none}@media(min-width: 544px){.SelectMenu-tabs{padding:var(--base-size-8) var(--base-size-8) 0 var(--base-size-8)}}.SelectMenu-tab{flex:1;padding:var(--base-size-8) var(--base-size-16);font-size:12px;font-weight:var(--base-text-weight-medium, 500);color:var(--fgColor-muted, var(--color-fg-muted));text-align:center;background-color:rgba(0,0,0,0);border:0;box-shadow:inset 0 -1px 0 var(--borderColor-muted, var(--color-border-muted))}@media(min-width: 544px){.SelectMenu-tab{flex:none;padding:var(--base-size-4) var(--base-size-16);border:1px solid rgba(0,0,0,0);border-bottom-width:0;border-top-left-radius:6px;border-top-right-radius:6px}}.SelectMenu-tab[aria-selected=true]{z-index:1;color:var(--fgColor-default, var(--color-fg-default));cursor:default;background-color:var(--overlay-bgColor, var(--color-canvas-overlay));box-shadow:0 0 0 1px var(--borderColor-muted, var(--color-border-muted))}@media(min-width: 544px){.SelectMenu-tab[aria-selected=true]{border-color:var(--borderColor-muted, var(--color-border-muted));box-shadow:none}}.SelectMenu-message{padding:7px var(--base-size-16);text-align:center;background-color:var(--overlay-bgColor, var(--color-canvas-overlay));border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}.SelectMenu-blankslate,.SelectMenu-loading{padding:var(--base-size-24) var(--base-size-16);text-align:center;background-color:var(--overlay-bgColor, var(--color-canvas-overlay))}.SelectMenu-divider{padding:var(--base-size-4) var(--base-size-16);margin:0;font-size:12px;font-weight:var(--base-text-weight-medium, 500);color:var(--fgColor-muted, var(--color-fg-muted));background-color:var(--bgColor-muted, var(--color-canvas-subtle));border-bottom:1px solid var(--borderColor-muted, var(--color-border-muted))}.SelectMenu-list--borderless .SelectMenu-divider{border-top:1px solid var(--borderColor-muted, var(--color-border-muted))}.SelectMenu-list--borderless .SelectMenu-divider:empty{padding:0;border-top:0}.SelectMenu-footer{z-index:0;padding:var(--base-size-8) var(--base-size-16);font-size:12px;color:var(--fgColor-muted, var(--color-fg-muted));text-align:center;border-top:1px solid var(--borderColor-muted, var(--color-border-muted))}@media(min-width: 544px){.SelectMenu-footer{padding:7px var(--base-size-16)}}.SelectMenu--hasFilter .SelectMenu-modal{height:80%;max-height:none;margin-top:0}@media(min-width: 544px){.SelectMenu--hasFilter .SelectMenu-modal{height:auto;max-height:480px;margin-top:var(--base-size-8)}}.SelectMenu-tab:focus,.SelectMenu-item:focus{outline:0}.SelectMenu-item:hover{text-decoration:none}.SelectMenu-item[aria-checked=true]{font-weight:var(--base-text-weight-medium, 500);color:var(--fgColor-default, var(--color-fg-default))}.SelectMenu-item[aria-checked=true] .SelectMenu-icon--check{visibility:visible;transition:transform .12s cubic-bezier(0, 0, 0.2, 1),visibility 0s linear;transform:scale(1)}.SelectMenu-item:disabled,.SelectMenu-item[aria-disabled=true]{color:var(--fgColor-disabled, var(--color-primer-fg-disabled));pointer-events:none}@media(hover: hover){body:not(.intent-mouse) .SelectMenu-closeButton:focus,.SelectMenu-closeButton:hover{color:var(--fgColor-default, var(--color-fg-default))}.SelectMenu-closeButton:active{color:var(--fgColor-muted, var(--color-fg-muted))}body:not(.intent-mouse) .SelectMenu-item:focus,.SelectMenu-item:hover{background-color:var(--bgColor-neutral-muted, var(--color-neutral-subtle))}.SelectMenu-item:active{background-color:var(--bgColor-muted, var(--color-canvas-subtle))}body:not(.intent-mouse) .SelectMenu-tab:focus{background-color:var(--selectMenu-bgColor-active, var(--color-select-menu-tap-focus-bg))}.SelectMenu-tab:hover{color:var(--fgColor-default, var(--color-fg-default))}.SelectMenu-tab:not([aria-selected=true]):active{color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-muted, var(--color-canvas-subtle))}}@media(hover: none){.SelectMenu-item:focus,.SelectMenu-item:active{background-color:var(--bgColor-muted, var(--color-canvas-subtle))}.SelectMenu-item{-webkit-tap-highlight-color:var(--control-bgColor-active, var(--color-select-menu-tap-highlight))}}.Toast{display:flex;margin:var(--base-size-8);color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-default, var(--color-canvas-default));border-radius:6px;box-shadow:inset 0 0 0 1px var(--borderColor-default, var(--color-border-default)),var(--shadow-floating-legacy, var(--color-overlay-shadow))}@media(min-width: 544px){.Toast{width:max-content;max-width:450px;margin:var(--base-size-16)}}.Toast-icon{display:flex;align-items:center;justify-content:center;width:calc(var(--base-size-16)*3);flex-shrink:0;color:var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));background-color:var(--bgColor-accent-emphasis, var(--color-accent-emphasis));border:1px solid rgba(0,0,0,0);border-right:0;border-top-left-radius:inherit;border-bottom-left-radius:inherit}.Toast-content{padding:var(--base-size-16)}.Toast-dismissButton{max-height:54px;padding:var(--base-size-16);color:inherit;background-color:rgba(0,0,0,0);border:0}.Toast-dismissButton:hover{opacity:.7}.Toast-dismissButton:active{opacity:.5}.Toast--loading{color:var(--fgColor-default, var(--color-fg-default));box-shadow:inset 0 0 0 1px var(--borderColor-default, var(--color-border-default)),var(--shadow-floating-legacy, var(--color-overlay-shadow))}.Toast--loading .Toast-icon{background-color:var(--bgColor-neutral-emphasis, var(--color-neutral-emphasis))}.Toast--error{color:var(--fgColor-default, var(--color-fg-default));box-shadow:inset 0 0 0 1px var(--borderColor-default, var(--color-border-default)),var(--shadow-floating-legacy, var(--color-overlay-shadow))}.Toast--error .Toast-icon{background-color:var(--bgColor-danger-emphasis, var(--color-danger-emphasis))}.Toast--warning{color:var(--fgColor-default, var(--color-fg-default));box-shadow:inset 0 0 0 1px var(--borderColor-default, var(--color-border-default)),var(--shadow-floating-legacy, var(--color-overlay-shadow))}.Toast--warning .Toast-icon{background-color:var(--bgColor-attention-emphasis, var(--color-attention-emphasis))}.Toast--success{color:var(--fgColor-default, var(--color-fg-default));box-shadow:inset 0 0 0 1px var(--borderColor-default, var(--color-border-default)),var(--shadow-floating-legacy, var(--color-overlay-shadow))}.Toast--success .Toast-icon{background-color:var(--bgColor-success-emphasis, var(--color-success-emphasis))}.Toast--animateIn{animation:Toast--animateIn .18s cubic-bezier(0.22, 0.61, 0.36, 1) backwards}@keyframes Toast--animateIn{0%{opacity:0;transform:translateY(100%)}}.Toast--animateOut{animation:Toast--animateOut .18s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards}@keyframes Toast--animateOut{100%{pointer-events:none;opacity:0;transform:translateY(100%)}}.Toast--spinner{animation:Toast--spinner 1000ms linear infinite}@keyframes Toast--spinner{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}:root{--actionListContent-paddingBlock:var(--control-medium-paddingBlock)}action-list,nav-list{display:block}.ActionListHeader{margin-bottom:var(--base-size-16);margin-left:var(--base-size-8)}.ActionListWrap{list-style:none}.ActionListWrap--inset,.ActionListWrap--inset[popover]{padding:var(--base-size-8)}.ActionListWrap--divided .ActionListItem-label:before{height:1px}.ActionListWrap--divided .ActionListItem-label:before,:is(.ActionListWrap--divided .ActionListItem-descriptionWrap--inline):before{background:var(--borderColor-muted);content:"";display:block;position:absolute;top:calc(var(--actionListContent-paddingBlock)*-1);width:100%}:is(.ActionListWrap--divided .ActionListItem-descriptionWrap--inline):before{height:var(--borderWidth-thin)}:is(.ActionListWrap--divided .ActionListItem-descriptionWrap--inline) .ActionListItem-label:before{content:unset}.ActionList-sectionDivider+.ActionListItem .ActionListItem-descriptionWrap--inline:before,.ActionList-sectionDivider+.ActionListItem .ActionListItem-label:before,.ActionListItem:first-of-type .ActionListItem-descriptionWrap--inline:before,.ActionListItem:first-of-type .ActionListItem-label:before,:is(.ActionListWrap--divided .ActionListItem--navActive) .ActionListItem-label:before,:is(.ActionListWrap--divided .ActionListItem--navActive)+.ActionListItem .ActionListItem-label:before{visibility:hidden}.ActionListItem{background-color:var(--control-transparent-bgColor-rest);border-radius:var(--borderRadius-medium);list-style:none;position:relative}.ActionListItem:active,.ActionListItem:hover{cursor:pointer}@media(hover: hover){.ActionListItem:hover .ActionListItem-descriptionWrap--inline:before,.ActionListItem:hover .ActionListItem-label:before,.ActionListItem:hover+.ActionListItem .ActionListItem-descriptionWrap--inline:before,.ActionListItem:hover+.ActionListItem .ActionListItem-label:before{visibility:hidden}}.ActionListItem[hidden]+.ActionList-sectionDivider{display:none}.ActionListItem.ActionListItem--hasSubItem>.ActionListContent{z-index:1}@media(hover: hover){:is(.ActionListItem.ActionListItem--hasSubItem>.ActionListContent):hover{background-color:var(--control-transparent-bgColor-hover)}}:is(.ActionListItem.ActionListItem--hasSubItem>.ActionListContent):active{background-color:var(--control-transparent-bgColor-active)}@media(hover: hover){:is(.ActionListItem:not(.ActionListItem--hasSubItem),.ActionListItem.ActionListItem--hasSubItem>.ActionListContent):hover{background-color:var(--control-transparent-bgColor-hover);cursor:pointer}:is(.ActionListItem:not(.ActionListItem--hasSubItem),.ActionListItem.ActionListItem--hasSubItem>.ActionListContent):hover:not(.ActionListItem--navActive,:focus-visible){box-shadow:var(--boxShadow-thin) var(--control-transparent-borderColor-active);outline:solid var(--borderWidth-thin) rgba(0,0,0,0);outline-offset:calc(var(--borderWidth-thin)*-1)}}:is(.ActionListItem:not(.ActionListItem--hasSubItem),.ActionListItem.ActionListItem--hasSubItem>.ActionListContent):active{background:var(--control-transparent-bgColor-active)}:is(.ActionListItem:not(.ActionListItem--hasSubItem),.ActionListItem.ActionListItem--hasSubItem>.ActionListContent):active:not(.ActionListItem--navActive){box-shadow:var(--boxShadow-thin) var(--control-transparent-borderColor-active);outline:solid var(--borderWidth-thin) rgba(0,0,0,0);outline-offset:calc(var(--borderWidth-thin)*-1)}:is(.ActionListItem:not(.ActionListItem--hasSubItem),.ActionListItem.ActionListItem--hasSubItem>.ActionListContent):active .ActionListItem-label:before,:is(.ActionListItem:not(.ActionListItem--hasSubItem),.ActionListItem.ActionListItem--hasSubItem>.ActionListContent):active+.ActionListItem .ActionListItem-label:before{visibility:hidden}.ActionListItem[aria-selected=true]{background:var(--control-transparent-bgColor-selected);font-weight:var(--base-text-weight-normal)}@media(hover: hover){.ActionListItem[aria-selected=true]:hover{background-color:var(--control-transparent-bgColor-hover)}}.ActionListItem[aria-selected=true]+.ActionListItem:before,.ActionListItem[aria-selected=true]:before{visibility:hidden}.ActionListItem[aria-selected=true]:after{background:var(--borderColor-accent-emphasis);border-radius:var(--borderRadius-medium);content:"";height:var(--base-size-24);left:calc(var(--base-size-4)*-1);position:absolute;top:calc(50% - 12px);width:var(--base-size-4)}.ActionListItem.ActionListItem--navActive{outline:2px solid rgba(0,0,0,0)}.ActionListItem.ActionListItem--navActive:not(.ActionListItem--subItem) .ActionListItem-label{font-weight:var(--base-text-weight-semibold)}.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger){background:var(--control-transparent-bgColor-selected)}@media(hover: hover){.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger):hover{background-color:var(--control-transparent-bgColor-hover)}}.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger)+.ActionListItem:before,.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger):before{visibility:hidden}.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger):after{background:var(--borderColor-accent-emphasis);border-radius:var(--borderRadius-medium);content:"";height:var(--base-size-24);left:calc(var(--base-size-8)*-1);position:absolute;top:calc(50% - 12px);width:var(--base-size-4)}:is(:is(.ActionListItem.ActionListItem--disabled,.ActionListItem[aria-disabled=true]) .ActionListContent) .ActionListItem-description,:is(:is(.ActionListItem.ActionListItem--disabled,.ActionListItem[aria-disabled=true]) .ActionListContent) .ActionListItem-label{color:var(--control-fgColor-disabled)}:is(:is(.ActionListItem.ActionListItem--disabled,.ActionListItem[aria-disabled=true]) .ActionListContent) .ActionListItem-visual{fill:var(--control-fgColor-disabled)}@media(hover: hover){:is(.ActionListItem.ActionListItem--disabled,.ActionListItem[aria-disabled=true]):hover{background-color:initial;cursor:not-allowed}}.ActionListItem.ActionListItem--danger .ActionListItem-label,.ActionListItem.ActionListItem--danger .ActionListItem-visual{color:var(--control-danger-fgColor-rest)}@media(hover: hover){.ActionListItem.ActionListItem--danger:hover{background:var(--control-danger-bgColor-hover)}.ActionListItem.ActionListItem--danger:hover .ActionListItem-description,.ActionListItem.ActionListItem--danger:hover .ActionListItem-label,.ActionListItem.ActionListItem--danger:hover .ActionListItem-visual{color:var(--control-danger-fgColor-hover)}}:is(.ActionListItem.ActionListItem--danger .ActionListContent):active{background:var(--control-danger-bgColor-active)}:is(.ActionListItem.ActionListItem--danger .ActionListContent):active .ActionListItem-description,:is(.ActionListItem.ActionListItem--danger .ActionListContent):active .ActionListItem-label,:is(.ActionListItem.ActionListItem--danger .ActionListContent):active .ActionListItem-visual{color:var(--control-danger-fgColor-hover)}.ActionListContent{background-color:initial;border:none;border-radius:var(--borderRadius-medium);color:var(--control-fgColor-rest);display:grid;padding-block:var(--actionListContent-paddingBlock);padding-inline:var(--control-medium-paddingInline-condensed);position:relative;text-align:left;touch-action:manipulation;transition:background 33.333ms linear;-webkit-user-select:none;user-select:none;width:100%;-webkit-tap-highlight-color:transparent;align-items:start;grid-template-areas:"leadingAction leadingVisual label trailingVisual trailingAction";grid-template-columns:min-content min-content minmax(0, auto) min-content min-content;grid-template-rows:min-content}.ActionListContent>:not(:last-child){margin-right:var(--control-medium-gap)}.ActionListContent:hover{-webkit-text-decoration:none;text-decoration:none}.ActionListContent[aria-disabled=true] .ActionListItem-description,.ActionListContent[aria-disabled=true] .ActionListItem-label{color:var(--control-fgColor-disabled)}.ActionListContent[aria-disabled=true] .ActionListItem-visual{fill:var(--control-fgColor-disabled)}@media(hover: hover){.ActionListContent[aria-disabled=true]:hover{background-color:initial;cursor:not-allowed}}@media screen and (prefers-reduced-motion: no-preference){.ActionListContent[aria-expanded]+.ActionList--subGroup{transition:opacity .16s cubic-bezier(0.25, 1, 0.5, 1),transform .16s cubic-bezier(0.25, 1, 0.5, 1)}}:is(.ActionListContent[aria-expanded]+.ActionList--subGroup) .ActionListContent{padding-left:var(--base-size-24)}:is(.ActionListContent.ActionListContent--visual16[aria-expanded]+.ActionList--subGroup) .ActionListContent{padding-left:var(--base-size-32)}:is(.ActionListContent.ActionListContent--visual20[aria-expanded]+.ActionList--subGroup) .ActionListContent{padding-left:var(--base-size-36)}:is(.ActionListContent.ActionListContent--visual24[aria-expanded]+.ActionList--subGroup) .ActionListContent{padding-left:var(--base-size-40)}.ActionListContent[aria-expanded=true] .ActionListItem-collapseIcon{transform:scaleY(-1);transition:transform .12s linear}.ActionListContent[aria-expanded=true]+.ActionList--subGroup{height:auto;opacity:1;overflow:visible;transform:translateY(0);visibility:visible}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=true]>.ActionListItem-label{font-weight:var(--base-text-weight-semibold)}.ActionListContent[aria-expanded=false] .ActionListItem-collapseIcon{transform:scaleY(1);transition:transform .12s linear}.ActionListContent[aria-expanded=false]+.ActionList--subGroup{height:0;opacity:0;overflow:hidden;transform:translateY(calc(var(--base-size-16) * -1));visibility:hidden}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]{background:var(--control-transparent-bgColor-selected)}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false] .ActionListItem-label{font-weight:var(--base-text-weight-semibold)}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]+.ActionListItem:before,.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]:before{visibility:hidden}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]:after{background:var(--borderColor-accent-emphasis);border-radius:var(--borderRadius-medium);content:"";height:var(--base-size-24);left:calc(var(--base-size-8)*-1);position:absolute;top:calc(50% - 12px);width:var(--base-size-4)}:is(.ActionListContent[aria-checked=true],.ActionListContent[aria-selected=true]) .FormControl-checkbox{background:var(--control-checked-bgColor-rest);border-color:var(--control-checked-borderColor-rest);transition:background-color,border-color 80ms cubic-bezier(0.32, 0, 0.67, 0) 0s}:is(:is(.ActionListContent[aria-checked=true],.ActionListContent[aria-selected=true]) .FormControl-checkbox):before{animation:checkmarkIn 80ms cubic-bezier(0.65, 0, 0.35, 1) 80ms forwards;transition:visibility 0s linear 0s;visibility:visible}:is(.ActionListContent[aria-checked=true],.ActionListContent[aria-selected=true]) .ActionListItem-singleSelectCheckmark{visibility:visible}:is(.ActionListContent[aria-checked=false],.ActionListContent[aria-selected=false]) .ActionListItem-singleSelectCheckmark{transition:visibility 0s linear .2s;visibility:hidden}.ActionListContent.ActionListContent--sizeLarge{--actionListContent-paddingBlock:var(--control-large-paddingBlock)}.ActionListContent.ActionListContent--sizeXLarge{--actionListContent-paddingBlock:var(--control-xlarge-paddingBlock)}@media(pointer: coarse){.ActionListContent{--actionListContent-paddingBlock:var(--control-large-paddingBlock)}}.ActionListContent.ActionListContent--blockDescription .ActionListItem-visual{place-self:start}.ActionListItem-action--leading{grid-area:leadingAction}.ActionListItem-visual--leading{grid-area:leadingVisual}.ActionListItem-visual--trailing{grid-area:trailingVisual}.ActionListItem-action--trailing{grid-area:trailingAction}.ActionListItem-visual--leading svg{fill:currentcolor}.ActionListItem-descriptionWrap{display:flex;flex-direction:column;gap:var(--base-size-4);grid-area:label}.ActionListItem-descriptionWrap .ActionListItem-label{font-weight:var(--base-text-weight-semibold)}.ActionListItem-descriptionWrap--inline{align-items:baseline;flex-direction:row;gap:var(--base-size-8);position:relative}.ActionListItem-description{color:var(--fgColor-muted);font-size:var(--text-body-size-small);font-weight:var(--base-text-weight-normal);line-height:var(--text-body-lineHeight-small)}.ActionListItem-action,.ActionListItem-visual{align-items:center;color:var(--fgColor-muted);display:flex;fill:var(--fgColor-muted);min-height:var(--control-medium-lineBoxHeight);pointer-events:none}.ActionListItem-label{color:var(--fgColor-default);font-size:var(--text-body-size-medium);font-weight:var(--base-text-weight-normal);grid-area:label;line-height:var(--text-body-lineHeight-medium);position:relative}.ActionListItem-label--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ActionListItem--subItem>.ActionListContent>.ActionListItem-label{font-size:var(--text-body-size-small);line-height:var(--text-body-lineHeight-small)}.ActionListItem--withActions{align-items:center;display:flex;flex-wrap:nowrap}.ActionListItem-trailingAction{border-bottom-left-radius:0;border-top-left-radius:0}.ActionListItem--trailingActionHover .ActionListItem-trailingAction{visibility:hidden}:is(.ActionListItem--trailingActionHover:hover,.ActionListItem--trailingActionHover:focus-within) .ActionListItem-trailingAction{visibility:visible}.ActionList-sectionDivider:not(:empty){color:var(--fgColor-muted);display:flex;flex-direction:column;font-size:var(--text-body-size-small);font-weight:var(--base-text-weight-semibold);line-height:var(--text-body-lineHeight-small);padding-block:var(--base-size-8);padding-inline:var(--actionListContent-paddingBlock)}.ActionList-sectionDivider:empty{background:var(--borderColor-muted);border:0;display:block;height:var(--borderWidth-thin);list-style:none;margin-block-end:var(--base-size-8);margin-block-start:calc(var(--base-size-8) - var(--borderWidth-thin));margin-inline:calc(var(--base-size-8)*-1);padding:0}.ActionList-sectionDivider .ActionList-sectionDivider-title{align-self:flex-start;color:var(--fgColor-muted);font-size:var(--text-body-size-small);font-weight:var(--base-text-weight-semibold)}.ActionList-sectionDivider--filled{background:var(--bgColor-muted);border-bottom:solid var(--borderWidth-thin) var(--borderColor-muted, var(--color-action-list-item-inline-divider));border-top:solid var(--borderWidth-thin) var(--borderColor-muted, var(--color-action-list-item-inline-divider));margin-block-end:var(--base-size-8);margin-block-start:calc(var(--base-size-8) - var(--borderWidth-thin));margin-inline:calc(var(--base-size-8)*-1)}.ActionList-sectionDivider--filled:empty{box-sizing:border-box;height:var(--base-size-8)}.ActionList-sectionDivider--filled:first-child{margin-block-start:0}.autocomplete-label-stacked{display:block;margin-bottom:var(--base-size-6)}.autocomplete-label-inline{display:inline;margin-right:var(--base-size-6)}@media(max-width: 543.98px){.autocomplete-label-inline{display:block;margin-bottom:var(--base-size-6)}}.autocomplete-body{display:inline;position:relative}.autocomplete-embedded-icon-wrap{align-items:center;display:inline-flex;padding:var(--base-size-4) var(--base-size-8)}.autocomplete-embedded-icon-wrap:focus-within{border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px var(--focus-outlineColor);outline:none}.autocomplete-embedded-icon-wrap .form-control{border:none;box-shadow:none;margin-left:var(--base-size-8);padding:0}:is(.autocomplete-embedded-icon-wrap .form-control):focus,:is(.autocomplete-embedded-icon-wrap .form-control):focus-visible{box-shadow:none}.autocomplete-results{background:var(--overlay-bgColor);border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-medium);box-shadow:var(--shadow-resting-medium);font-size:var(--text-codeBlock-size);left:0;list-style:none;max-height:20em;min-width:100%;overflow-y:auto;position:absolute;width:max-content;z-index:99}.autocomplete-item{background-color:var(--overlay-bgColor);border:0;color:var(--fgColor-default);cursor:pointer;display:block;font-weight:var(--base-text-weight-semibold);overflow:hidden;padding:var(--base-size-4) var(--base-size-8);text-align:left;text-overflow:ellipsis;white-space:nowrap;width:100%}.autocomplete-item,.autocomplete-item:hover{-webkit-text-decoration:none;text-decoration:none}.autocomplete-item:hover{background-color:var(--bgColor-accent-emphasis);color:var(--fgColor-onEmphasis)}.autocomplete-item:hover *{color:inherit !important}.autocomplete-item.navigation-focus,.autocomplete-item.selected,.autocomplete-item[aria-selected=true]{background-color:var(--bgColor-accent-emphasis);color:var(--fgColor-onEmphasis);-webkit-text-decoration:none;text-decoration:none}:is(.autocomplete-item.selected,.autocomplete-item[aria-selected=true],.autocomplete-item.navigation-focus) *{color:inherit !important}.Banner{background-image:linear-gradient(var(--bgColor-accent-muted), var(--bgColor-accent-muted));border:var(--borderWidth-thin) solid var(--borderColor-accent-muted);border-radius:var(--borderRadius-medium);color:var(--fgColor-default);display:grid;grid-auto-flow:column;grid-template-areas:"visual message actions close";grid-template-columns:min-content 1fr minmax(0, auto) min-content;grid-template-rows:min-content;padding:var(--base-size-8);position:relative}@media(max-width: 543.98px){.Banner{grid-template-areas:"visual message close" ". actions actions";grid-template-columns:min-content 1fr min-content;grid-template-rows:min-content min-content}.Banner .Banner-actions{margin:var(--base-size-8) 0 0 var(--base-size-8)}}.Banner .Banner-visual{align-self:start;display:grid;grid-area:visual;padding:var(--base-size-6) var(--base-size-8)}:is(.Banner .Banner-visual)>.octicon{margin-block:calc(var(--base-size-4)/2)}:is(.Banner .Banner-visual)>*{align-self:center}.Banner .Banner-message{align-self:center;grid-area:message;padding:var(--base-size-6) var(--base-size-8)}:is(.Banner .Banner-message) p:last-child{margin-bottom:0}:is(.Banner .Banner-message) .Banner-title:not(:only-child){font-weight:var(--base-text-weight-semibold);margin-bottom:0}.Banner .Banner-actions{grid-area:actions}:is(.Banner .Banner-actions):last-child{align-self:center}.Banner .Banner-close{grid-area:close;margin-left:var(--controlStack-medium-gap-condensed)}.Banner .Banner-visual .octicon{color:var(--fgColor-accent)}.Banner.Banner--warning{background-image:linear-gradient(var(--bgColor-attention-muted), var(--bgColor-attention-muted));border-color:var(--borderColor-attention-muted);color:var(--fgColor-default)}.Banner.Banner--warning .Banner-visual .octicon{color:var(--fgColor-attention)}.Banner.Banner--error{background-image:linear-gradient(var(--bgColor-danger-muted), var(--bgColor-danger-muted));border-color:var(--borderColor-danger-muted);color:var(--fgColor-default)}.Banner.Banner--error .Banner-visual .octicon{color:var(--fgColor-danger)}.Banner.Banner--success{background-image:linear-gradient(var(--bgColor-success-muted), var(--bgColor-success-muted));border-color:var(--borderColor-success-muted);color:var(--fgColor-default)}.Banner.Banner--success .Banner-visual .octicon{color:var(--fgColor-success)}.Banner.Banner--upsell{background-image:linear-gradient(var(--bgColor-done-muted), var(--bgColor-done-muted));border-color:var(--borderColor-done-muted);color:var(--fgColor-default)}.Banner.Banner--upsell .Banner-visual .octicon{color:var(--fgColor-done)}.Banner.Banner--full{border-left:0;border-radius:0;border-right:0;margin-top:calc(var(--borderWidth-thin)*-1)}@media(max-width: 767.98px){.Banner.Banner--full-whenNarrow{border-left:0;border-radius:0;border-right:0;margin-top:calc(var(--borderWidth-thin)*-1)}}.btn-mktg{appearance:none !important;background:linear-gradient(180deg, rgba(255, 255, 255, 0.1490196078) 0, rgba(255, 255, 255, 0) 100%),var(--color-mktg-btn-bg) !important;border:0;border-radius:.375rem;color:var(--bgColor-default);display:inline-block;font-size:1rem;font-weight:var(--base-text-weight-semibold);line-height:1;padding:.9rem 1.5rem 1.1rem;position:relative;text-align:center;transition:box-shadow .2s,outline .2s ease;-webkit-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap;z-index:1}.btn-mktg:before{background:linear-gradient(180deg, rgba(255, 255, 255, 0.1490196078), rgba(255, 255, 255, 0)) !important;background-blend-mode:normal;border-radius:inherit;bottom:0;content:"";left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .2s;z-index:-1}.btn-mktg:hover{box-shadow:var(--color-mktg-btn-shadow-hover) !important;-webkit-text-decoration:none;text-decoration:none}:is(.btn-mktg:hover,.btn-mktg:focus,.btn-mktg:focus-visible,.btn-mktg.focus):before{opacity:1}.btn-mktg:focus{box-shadow:none;outline:2px solid var(--focus-outlineColor);outline-offset:2px}.btn-mktg:focus:not(:focus-visible){box-shadow:none;outline:1px solid rgba(0,0,0,0)}.btn-mktg:focus-visible{box-shadow:none;outline:2px solid var(--focus-outlineColor);outline-offset:2px}.btn-mktg:active:before{opacity:.5 !important}.btn-mktg.disabled,.btn-mktg[disabled]{cursor:default;opacity:.5;pointer-events:none}.btn-muted-mktg{background:none !important;box-shadow:var(--color-mktg-btn-shadow-outline);color:var(--fgColor-default) !important}.btn-muted-mktg:before{display:none}.btn-muted-mktg:hover{box-shadow:var(--color-mktg-btn-shadow-hover-muted) !important}.btn-muted-mktg:active{box-shadow:var(--fgColor-default) 0 0 0 3px inset !important}.btn-muted-mktg:disabled{box-shadow:var(--fgColor-default) 0 0 0 1px inset !important}.btn-subtle-mktg{box-shadow:none !important;color:var(--fgColor-default) !important}.btn-subtle-mktg,.btn-subtle-mktg:before{background:none !important}.btn-subtle-mktg:hover{box-shadow:var(--color-mktg-btn-shadow-hover-muted) !important}.btn-signup-mktg{background:linear-gradient(180deg, rgba(52, 183, 89, 0.1490196078), rgba(46, 164, 79, 0)),#2ea44f !important;color:#fff}.btn-signup-mktg:before{background:linear-gradient(180deg, rgba(52, 183, 89, 0.1490196078), rgba(46, 164, 79, 0)) !important}.btn-signup-mktg:focus{box-shadow:none;outline:2px solid var(--focus-outlineColor);outline-offset:2px}.btn-signup-mktg:focus:not(:focus-visible){box-shadow:none;outline:1px solid rgba(0,0,0,0)}.btn-signup-mktg:focus-visible{box-shadow:none;outline:2px solid var(--focus-outlineColor);outline-offset:2px}.btn-small-mktg{padding:.625rem 1rem .8125rem}.btn-large-mktg{font-size:1.25rem;padding:16px 30px 20px !important}@property --dialog-scrollgutter{initial-value:0;inherits:false;syntax:""}body:has(dialog:modal.Overlay--disableScroll){overflow:hidden !important;padding-right:var(--dialog-scrollgutter) !important}dialog.Overlay:not([open]){display:none}.Overlay--hidden{display:none !important}.Overlay--visibilityHidden{height:0;opacity:0;overflow:hidden;visibility:hidden}@supports not selector(:popover-open){[popover]:not(.\:popover-open){display:none}}.Overlay{background-color:var(--overlay-bgColor);border:0;border-radius:var(--borderRadius-large);box-shadow:var(--shadow-floating-small);color:var(--fgColor-default);display:flex;flex-direction:column;inset:0;margin:auto;max-height:min(100vh - 2rem,var(--overlay-height));min-width:192px;opacity:1;padding:0;position:static;white-space:normal;width:min(var(--overlay-width),100vw - 2rem)}.Overlay.Overlay--size-auto{max-height:calc(100vh - 2rem);max-width:calc(100vw - 2rem);min-width:192px}.Overlay.Overlay--size-full{height:100vh;width:100vw}.Overlay.Overlay--size-xsmall{--overlay-width:192px;max-height:calc(100vh - 2rem)}.Overlay.Overlay--size-small{--overlay-height:256px;--overlay-width:320px}.Overlay.Overlay--size-small-portrait{--overlay-height:432px;--overlay-width:320px}.Overlay.Overlay--size-medium{--overlay-height:320px;--overlay-width:480px}.Overlay.Overlay--size-medium-portrait{--overlay-height:600px;--overlay-width:480px}.Overlay.Overlay--size-large{--overlay-height:432px;--overlay-width:640px}.Overlay.Overlay--size-xlarge{--overlay-height:600px;--overlay-width:960px}.Overlay.Overlay--height-auto{height:auto}.Overlay.Overlay--placement-left,.Overlay.Overlay--placement-right{height:100%;max-height:unset;position:fixed}@media screen and (prefers-reduced-motion: no-preference){.Overlay.Overlay--motion-scaleFade,.Overlay.Overlay--placement-left,.Overlay.Overlay--placement-right{animation:Overlay--motion-scaleFade .2s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running}}.Overlay.Overlay--placement-left{animation-name:Overlay--motion-slideInRight;border-bottom-left-radius:0;border-top-left-radius:0;inset:0 auto 0 0}.Overlay.Overlay--placement-right{animation-name:Overlay--motion-slideInLeft;border-bottom-right-radius:0;border-top-right-radius:0;inset:0 0 0 auto}.Overlay.Overlay--height-xsmall{height:min(192px,100vh - 2rem)}.Overlay.Overlay--height-small{height:min(256px,100vh - 2rem)}.Overlay.Overlay--height-medium{height:min(320px,100vh - 2rem)}.Overlay.Overlay--height-large{height:min(432px,100vh - 2rem)}.Overlay.Overlay--height-xlarge{height:min(600px,100vh - 2rem)}.Overlay.Overlay--width-auto{width:auto}.Overlay.Overlay--width-small{width:min(256px,100vw - 2rem)}.Overlay.Overlay--width-medium{width:min(320px,100vw - 2rem)}.Overlay.Overlay--width-large{width:min(480px,100vw - 2rem)}.Overlay.Overlay--width-xlarge{width:min(640px,100vw - 2rem)}.Overlay.Overlay--width-xxlarge{width:min(960px,100vw - 2rem)}.Overlay:modal{position:fixed}@keyframes Overlay--motion-scaleFade{0%{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}.Overlay-form{flex-grow:1;overflow:auto}.Overlay-form,.Overlay-header{display:flex;flex-direction:column}.Overlay-header{color:var(--fgColor-default);z-index:1}.Overlay-header.Overlay-header--divided{box-shadow:inset 0 calc(var(--borderWidth-thin)*-1) var(--borderColor-default);padding-bottom:var(--stack-padding-condensed)}:is(.Overlay-header.Overlay-header--large .Overlay-headerContentWrap) .Overlay-titleWrap{gap:var(--stack-gap-condensed)}:is(:is(.Overlay-header.Overlay-header--large .Overlay-headerContentWrap) .Overlay-titleWrap) .Overlay-title{font:var(--text-title-shorthand-small)}:is(:is(.Overlay-header.Overlay-header--large .Overlay-headerContentWrap) .Overlay-titleWrap) .Overlay-description{font-size:var(--text-body-size-medium)}.Overlay-header .Overlay-headerContentWrap{align-items:flex-start;display:flex;gap:var(--stack-gap-condensed);padding:var(--stack-gap-condensed) var(--stack-gap-condensed) 0 var(--stack-gap-condensed)}:is(.Overlay-header .Overlay-headerContentWrap) .Overlay-actionWrap{display:flex;flex-direction:row;gap:var(--stack-gap-condensed)}:is(.Overlay-header .Overlay-headerContentWrap) .Overlay-titleWrap{display:flex;flex-direction:column;flex-grow:1;gap:var(--control-small-gap);padding:calc(var(--stack-gap-condensed)*.75) 0 calc(var(--stack-gap-condensed)*.75) var(--stack-gap-condensed)}:is(:is(.Overlay-header .Overlay-headerContentWrap) .Overlay-titleWrap) .Overlay-title{font-size:var(--text-body-size-medium);font-weight:var(--base-text-weight-semibold);margin:0}:is(:is(.Overlay-header .Overlay-headerContentWrap) .Overlay-titleWrap) .Overlay-description{color:var(--fgColor-muted);font-size:var(--text-body-size-small);font-weight:var(--base-text-weight-normal);margin:0}.Overlay-headerFilter{padding:var(--stack-gap-condensed) var(--stack-gap-condensed) 0 var(--stack-gap-condensed)}.Overlay-body{flex-grow:1;font-size:var(--text-body-size-medium);overflow-y:auto;padding:var(--stack-padding-normal);scrollbar-width:thin}.Overlay-body.Overlay-body--paddingCondensed{padding:var(--stack-padding-condensed);padding-top:0}.Overlay-body.Overlay-body--paddingNone{padding:0}.Overlay-footer{display:flex;flex-direction:row;flex-shrink:0;flex-wrap:wrap;padding:0 var(--stack-padding-normal) var(--stack-padding-normal) var(--stack-padding-normal);z-index:1}.Overlay-footer.Overlay-footer--divided{box-shadow:inset 0 var(--borderWidth-thin) var(--borderColor-default);padding-top:var(--stack-padding-normal)}.Overlay-footer.Overlay-footer--alignStart{gap:var(--stack-gap-condensed);justify-content:flex-start}.Overlay-footer.Overlay-footer--alignCenter{gap:var(--stack-gap-condensed);justify-content:center}.Overlay-footer.Overlay-footer--alignEnd{gap:var(--stack-gap-condensed);justify-content:flex-end}.Overlay-closeButton{align-self:flex-start;background-color:initial;border:var(--borderWidth-thin) solid rgba(0,0,0,0);border-radius:var(--borderRadius-medium);color:var(--fgColor-muted);cursor:pointer;display:grid;flex-shrink:0;height:var(--base-size-32);padding:0;place-content:center;position:relative;transition:.2s cubic-bezier(0.3, 0, 0.5, 1);transition-property:color,background-color,border-color;-webkit-user-select:none;user-select:none;width:var(--base-size-32)}.Overlay-closeButton:focus,.Overlay-closeButton:hover{background-color:var(--button-default-bgColor-hover);border:var(--borderWidth-thin) solid var(--control-bgColor-hover)}.Overlay-closeButton.close-button{border:var(--borderWidth-thin) solid rgba(0,0,0,0)}.Overlay--full{border-radius:unset !important;flex-grow:1;height:100%;max-height:100vh;max-width:100vw;width:100%}@media(max-width: 767px){.Overlay--placement-right-whenNarrow,.Overlay.Overlay--placement-left-whenNarrow{height:100%;max-height:100vh;position:fixed}.Overlay.Overlay--placement-left-whenNarrow{animation-name:Overlay--motion-slideInLeft;border-bottom-left-radius:0;border-top-left-radius:0;inset:0 auto 0 0}.Overlay.Overlay--placement-right-whenNarrow{animation-name:Overlay--motion-slideInLeft;border-bottom-right-radius:0;border-top-right-radius:0;inset:0 0 0 auto}.Overlay.Overlay--placement-bottom-whenNarrow{animation-name:Overlay--motion-slideUp;border-bottom-left-radius:0;border-bottom-right-radius:0;inset:auto 0 0;max-width:100vw;width:100%}.Overlay--full-whenNarrow{border-radius:unset !important;flex-grow:1;height:100%;max-height:100vh;max-width:100vw;width:100%}}@keyframes Overlay--motion-slideDown{0%{transform:translateY(-100%)}}@keyframes Overlay--motion-slideUp{0%{transform:translateY(100%)}}@keyframes Overlay--motion-slideInRight{0%{transform:translateX(-100%)}}@keyframes Overlay--motion-slideInLeft{0%{transform:translateX(100%)}}.dropdown{position:relative}.dropdown-caret{border-bottom-color:rgba(0,0,0,0);border-left-color:rgba(0,0,0,0);border-right-color:rgba(0,0,0,0);border-style:solid;border-width:var(--borderWidth-thicker) var(--borderWidth-thicker) 0;content:"";display:inline-block;height:0;vertical-align:middle;width:0}.dropdown-menu{background-clip:padding-box;background-color:var(--overlay-bgColor);border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-medium);box-shadow:var(--shadow-floating-legacy, var(--color-shadow-large));left:0;list-style:none;margin-top:var(--base-size-2);padding-bottom:var(--control-small-paddingBlock);padding-top:var(--control-small-paddingBlock);position:absolute;top:100%;width:160px;z-index:100}.dropdown-menu:after,.dropdown-menu:before{content:"";display:inline-block;position:absolute}.dropdown-menu:before{border:8px solid rgba(0,0,0,0);border-bottom:8px solid var(--borderColor-default)}.dropdown-menu:after{border:7px solid rgba(0,0,0,0);border-bottom:7px solid var(--overlay-bgColor)}.dropdown-menu>ul{list-style:none}.dropdown-menu-no-overflow{width:auto}.dropdown-menu-no-overflow .dropdown-item{overflow:visible;padding:var(--control-small-paddingBlock) var(--control-medium-paddingInline-spacious);text-overflow:inherit}.dropdown-item{color:var(--fgColor-default);display:block;overflow:hidden;padding:var(--control-small-paddingBlock) var(--control-medium-paddingInline-condensed) var(--control-small-paddingBlock) var(--control-medium-paddingInline-spacious);text-overflow:ellipsis;white-space:nowrap}.dropdown-item:hover{background-color:var(--bgColor-accent-emphasis);color:var(--fgColor-onEmphasis);-webkit-text-decoration:none;text-decoration:none}.dropdown-item:hover>.octicon{color:inherit;opacity:1}.dropdown-item:hover [class*=color-fg-]{color:inherit !important}.dropdown-item:hover>.Label{border-color:currentcolor;color:inherit !important}.dropdown-item.btn-link,.dropdown-signout{text-align:left;width:100%}.dropdown-signout{background:none;border:0}.dropdown-divider{border-top:var(--borderWidth-thin) solid var(--borderColor-default);display:block;height:0;margin:var(--stack-gap-condensed) 0}.dropdown-header{color:var(--fgColor-muted);font-size:var(--text-body-size-small);padding:var(--control-small-paddingBlock) var(--control-medium-paddingInline-spacious)}.dropdown-item[aria-checked=false] .octicon-check{display:none}.dropdown-menu-w{left:auto;margin-right:var(--base-size-8);margin-top:0;right:100%;top:0;width:auto}.dropdown-menu-w:before{border-color:rgba(0,0,0,0);border-left-color:var(--borderColor-default);left:auto;right:-16px;top:10px}.dropdown-menu-w:after{border-color:rgba(0,0,0,0);border-left-color:var(--overlay-bgColor);left:auto;right:-14px;top:var(--base-size-12)}.dropdown-menu-e{left:100%;margin-left:var(--base-size-8);margin-top:0;top:0;width:auto}.dropdown-menu-e:before{border-color:rgba(0,0,0,0);border-right-color:var(--borderColor-default);left:-16px;top:10px}.dropdown-menu-e:after{border-color:rgba(0,0,0,0);border-right-color:var(--overlay-bgColor);left:-14px;top:var(--base-size-12)}.dropdown-menu-ne{bottom:100%;left:0;margin-bottom:var(--base-size-4);top:auto}.dropdown-menu-ne:after,.dropdown-menu-ne:before{right:auto;top:auto}.dropdown-menu-ne:before{border-bottom:0;border-left:8px solid rgba(0,0,0,0);border-right:8px solid rgba(0,0,0,0);border-top:8px solid var(--borderColor-default);bottom:-8px;left:var(--base-size-8)}.dropdown-menu-ne:after{border-bottom:0;border-left:7px solid rgba(0,0,0,0);border-right:7px solid rgba(0,0,0,0);border-top:7px solid var(--overlay-bgColor);bottom:-7px;left:10px}.dropdown-menu-s{left:auto;right:50%;transform:translateX(50%)}.dropdown-menu-s:before{right:50%;top:-16px;transform:translateX(50%)}.dropdown-menu-s:after{right:50%;top:-14px;transform:translateX(50%)}.dropdown-menu-sw{left:auto;right:0}.dropdown-menu-sw:before{left:auto;right:var(--base-size-8);top:-16px}.dropdown-menu-sw:after{left:auto;right:10px;top:-14px}.dropdown-menu-se:before{left:var(--base-size-8);top:-16px}.dropdown-menu-se:after{left:10px;top:-14px}.Layout{display:grid;--Layout-sidebar-width:220px;--Layout-gutter:16px}@media(max-width: 543.98px){.Layout{grid-auto-flow:row;grid-template-columns:1fr !important}.Layout .Layout-divider,.Layout .Layout-main,.Layout .Layout-sidebar{grid-column:1 !important;width:100% !important}.Layout.Layout--sidebarPosition-flowRow-start .Layout-sidebar{grid-row:1}.Layout.Layout--sidebarPosition-flowRow-end .Layout-sidebar,.Layout.Layout--sidebarPosition-flowRow-start .Layout-main{grid-row:2/span 2}.Layout.Layout--sidebarPosition-flowRow-end .Layout-main{grid-row:1}.Layout.Layout--sidebarPosition-flowRow-none .Layout-sidebar{display:none}.Layout.Layout--divided{--Layout-gutter:0}.Layout.Layout--divided .Layout-divider{grid-row:2;height:1px}.Layout-divider--flowRow-hidden:is(.Layout.Layout--divided .Layout-divider){display:none}.Layout-divider--flowRow-shallow:is(.Layout.Layout--divided .Layout-divider){background:var(--bgColor-inset);border-color:var(--borderColor-default);border-style:solid;border-width:var(--borderWidth-thin) 0;height:8px;margin-right:0}.Layout.Layout--divided .Layout-main,.Layout.Layout--divided.Layout--sidebarPosition-flowRow-end .Layout-sidebar{grid-row:3/span 1}.Layout.Layout--divided.Layout--sidebarPosition-flowRow-end .Layout-main{grid-row:1}}@media(max-width: 767.98px){.Layout.Layout--flowRow-until-md{grid-auto-flow:row;grid-template-columns:1fr !important}.Layout.Layout--flowRow-until-md .Layout-divider,.Layout.Layout--flowRow-until-md .Layout-main,.Layout.Layout--flowRow-until-md .Layout-sidebar{grid-column:1 !important;width:100% !important}.Layout.Layout--flowRow-until-md.Layout--sidebarPosition-flowRow-start .Layout-sidebar{grid-row:1}.Layout.Layout--flowRow-until-md.Layout--sidebarPosition-flowRow-end .Layout-sidebar,.Layout.Layout--flowRow-until-md.Layout--sidebarPosition-flowRow-start .Layout-main{grid-row:2/span 2}.Layout.Layout--flowRow-until-md.Layout--sidebarPosition-flowRow-end .Layout-main{grid-row:1}.Layout.Layout--flowRow-until-md.Layout--sidebarPosition-flowRow-none .Layout-sidebar{display:none}.Layout.Layout--flowRow-until-md.Layout--divided{--Layout-gutter:0}.Layout.Layout--flowRow-until-md.Layout--divided .Layout-divider{grid-row:2;height:1px}.Layout-divider--flowRow-hidden:is(.Layout.Layout--flowRow-until-md.Layout--divided .Layout-divider){display:none}.Layout-divider--flowRow-shallow:is(.Layout.Layout--flowRow-until-md.Layout--divided .Layout-divider){background:var(--bgColor-inset);border-color:var(--borderColor-default);border-style:solid;border-width:var(--borderWidth-thin) 0;height:8px;margin-right:0}.Layout.Layout--flowRow-until-md.Layout--divided .Layout-main,.Layout.Layout--flowRow-until-md.Layout--divided.Layout--sidebarPosition-flowRow-end .Layout-sidebar{grid-row:3/span 1}.Layout.Layout--flowRow-until-md.Layout--divided.Layout--sidebarPosition-flowRow-end .Layout-main{grid-row:1}}@media(max-width: 1011.98px){.Layout.Layout--flowRow-until-lg{grid-auto-flow:row;grid-template-columns:1fr !important}.Layout.Layout--flowRow-until-lg .Layout-divider,.Layout.Layout--flowRow-until-lg .Layout-main,.Layout.Layout--flowRow-until-lg .Layout-sidebar{grid-column:1 !important;width:100% !important}.Layout.Layout--flowRow-until-lg.Layout--sidebarPosition-flowRow-start .Layout-sidebar{grid-row:1}.Layout.Layout--flowRow-until-lg.Layout--sidebarPosition-flowRow-end .Layout-sidebar,.Layout.Layout--flowRow-until-lg.Layout--sidebarPosition-flowRow-start .Layout-main{grid-row:2/span 2}.Layout.Layout--flowRow-until-lg.Layout--sidebarPosition-flowRow-end .Layout-main{grid-row:1}.Layout.Layout--flowRow-until-lg.Layout--sidebarPosition-flowRow-none .Layout-sidebar{display:none}.Layout.Layout--flowRow-until-lg.Layout--divided{--Layout-gutter:0}.Layout.Layout--flowRow-until-lg.Layout--divided .Layout-divider{grid-row:2;height:1px}.Layout-divider--flowRow-hidden:is(.Layout.Layout--flowRow-until-lg.Layout--divided .Layout-divider){display:none}.Layout-divider--flowRow-shallow:is(.Layout.Layout--flowRow-until-lg.Layout--divided .Layout-divider){background:var(--bgColor-inset);border-color:var(--borderColor-default);border-style:solid;border-width:var(--borderWidth-thin) 0;height:8px;margin-right:0}.Layout.Layout--flowRow-until-lg.Layout--divided .Layout-main,.Layout.Layout--flowRow-until-lg.Layout--divided.Layout--sidebarPosition-flowRow-end .Layout-sidebar{grid-row:3/span 1}.Layout.Layout--flowRow-until-lg.Layout--divided.Layout--sidebarPosition-flowRow-end .Layout-main{grid-row:1}}.Layout{grid-auto-flow:column;grid-template-columns:auto 0 minmax(0, calc(100% - var(--Layout-sidebar-width) - var(--Layout-gutter)));grid-gap:var(--Layout-gutter)}.Layout .Layout-sidebar{grid-column:1}.Layout .Layout-divider{display:none}.Layout .Layout-main{grid-column:2/span 2}@media(min-width: 1012px){.Layout{--Layout-gutter:24px}}.Layout.Layout--gutter-none{--Layout-gutter:0px}.Layout.Layout--gutter-condensed{--Layout-gutter:16px}@media(min-width: 1012px){.Layout.Layout--gutter-spacious{--Layout-gutter:32px}}@media(min-width: 1280px){.Layout.Layout--gutter-spacious{--Layout-gutter:40px}}@media(min-width: 544px){.Layout{--Layout-sidebar-width:220px}}@media(min-width: 768px){.Layout{--Layout-sidebar-width:256px}}@media(min-width: 1012px){.Layout{--Layout-sidebar-width:296px}}@media(min-width: 768px){.Layout.Layout--sidebar-narrow{--Layout-sidebar-width:240px}}@media(min-width: 1012px){.Layout.Layout--sidebar-narrow{--Layout-sidebar-width:256px}.Layout.Layout--sidebar-wide{--Layout-sidebar-width:320px}}@media(min-width: 1280px){.Layout.Layout--sidebar-wide{--Layout-sidebar-width:336px}}.Layout.Layout--sidebarPosition-start .Layout-sidebar{grid-column:1}.Layout.Layout--sidebarPosition-start .Layout-main{grid-column:2/span 2}.Layout.Layout--sidebarPosition-end{grid-template-columns:minmax(0, calc(100% - var(--Layout-sidebar-width) - var(--Layout-gutter))) 0 auto}.Layout.Layout--sidebarPosition-end .Layout-main{grid-column:1}.Layout.Layout--sidebarPosition-end .Layout-sidebar{grid-column:2/span 2}.Layout.Layout--divided .Layout-divider{background:var(--borderColor-default);display:block;grid-column:2;margin-right:-1px;width:1px}.Layout.Layout--divided .Layout-main,.Layout.Layout--divided.Layout--sidebarPosition-end .Layout-sidebar{grid-column:3/span 1}.Layout.Layout--divided.Layout--sidebarPosition-end .Layout-main{grid-column:1}.Layout-divider{display:none;width:1px}.Layout-sidebar{width:var(--Layout-sidebar-width)}.Layout-main{min-width:0}.Layout-main .Layout-main-centered-lg,.Layout-main .Layout-main-centered-md,.Layout-main .Layout-main-centered-xl{margin-left:auto;margin-right:auto}:is(.Layout-main .Layout-main-centered-md,.Layout-main .Layout-main-centered-lg,.Layout-main .Layout-main-centered-xl)>.container-lg,:is(.Layout-main .Layout-main-centered-md,.Layout-main .Layout-main-centered-lg,.Layout-main .Layout-main-centered-xl)>.container-md,:is(.Layout-main .Layout-main-centered-md,.Layout-main .Layout-main-centered-lg,.Layout-main .Layout-main-centered-xl)>.container-xl{margin-left:0}.Layout-main .Layout-main-centered-md{max-width:calc(var(--breakpoint-medium) + var(--Layout-sidebar-width) + var(--Layout-gutter))}.Layout-main .Layout-main-centered-lg{max-width:calc(var(--breakpoint-large) + var(--Layout-sidebar-width) + var(--Layout-gutter))}.Layout-main .Layout-main-centered-xl{max-width:calc(var(--breakpoint-xlarge) + var(--Layout-sidebar-width) + var(--Layout-gutter))}.menu{background-color:var(--bgColor-default);border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-medium);list-style:none;margin-bottom:var(--stack-gap-normal)}.menu-item{border-bottom:var(--borderWidth-thin) solid var(--borderColor-default);color:var(--fgColor-default);display:block;padding:var(--control-medium-paddingInline-condensed) var(--control-medium-paddingInline-spacious);position:relative}.menu-item:first-child{border-top:0;border-top-right-radius:var(--borderRadius-medium)}.menu-item:first-child,.menu-item:first-child:before{border-top-left-radius:var(--borderRadius-medium)}.menu-item:last-child{border-bottom:0;border-bottom-right-radius:var(--borderRadius-medium)}.menu-item:last-child,.menu-item:last-child:before{border-bottom-left-radius:var(--borderRadius-medium)}.menu-item:hover{background-color:var(--bgColor-neutral-muted);-webkit-text-decoration:none;text-decoration:none}.menu-item:active{background-color:var(--bgColor-muted)}.menu-item.selected,.menu-item[aria-current]:not([aria-current=false]),.menu-item[aria-selected=true]{background-color:var(--menu-bgColor-active);cursor:default}:is(.menu-item.selected,.menu-item[aria-selected=true],.menu-item[aria-current]:not([aria-current=false])):before{background-color:var(--underlineNav-borderColor-active);bottom:0;content:"";left:0;position:absolute;top:0;width:2px}.menu-item .octicon{color:var(--fgColor-muted);margin-right:var(--control-medium-gap);text-align:center;width:16px}.menu-item .Counter{float:right;margin-left:var(--control-small-gap)}.menu-item .menu-warning{color:var(--fgColor-attention);float:right}.menu-item .avatar{float:left;margin-right:var(--control-small-gap)}.menu-item.alert .Counter{color:var(--fgColor-danger)}.menu-heading{border-bottom:var(--borderWidth-thin) solid var(--borderColor-default);color:var(--fgColor-default);display:block;font-size:inherit;font-weight:var(--base-text-weight-semibold);margin-bottom:0;margin-top:0;padding:var(--control-medium-paddingInline-condensed) var(--control-medium-paddingInline-spacious)}.menu-heading:hover{-webkit-text-decoration:none;text-decoration:none}.menu-heading:first-child{border-top-left-radius:var(--borderRadius-medium);border-top-right-radius:var(--borderRadius-medium)}.menu-heading:last-child{border-bottom:0;border-bottom-left-radius:var(--borderRadius-medium);border-bottom-right-radius:var(--borderRadius-medium)}.SegmentedControl{--segmentedControl-item-padding:var(--control-small-paddingBlock);--overlay-offset:0.5rem;background-color:var(--controlTrack-bgColor-rest, var(--color-segmented-control-bg));border-color:var(--controlTrack-borderColor-rest, rgba(0, 0, 0, 0));border-radius:var(--borderRadius-medium);display:inline-flex;list-style:none}.SegmentedControl--iconOnly .Button--iconOnly.Button--medium,.SegmentedControl--iconOnly .Button--iconOnly.Button--small{padding-inline:0 !important;width:100%}.SegmentedControl--small{--segmentedControl-item-padding:var(--control-xsmall-paddingBlock)}.SegmentedControl--small .SegmentedControl-item{height:var(--control-small-size)}:is(.SegmentedControl--small .SegmentedControl-item) .Button{padding-inline:calc(var(--control-xsmall-paddingInline-normal) - var(--segmentedControl-item-padding))}.SegmentedControl--small.SegmentedControl--iconOnly .SegmentedControl-item{width:var(--control-small-size)}.SegmentedControl--medium .SegmentedControl-item{height:var(--control-medium-size)}.SegmentedControl--medium.SegmentedControl--iconOnly .SegmentedControl-item{width:var(--control-medium-size)}.SegmentedControl-item{border:var(--borderWidth-thin) solid rgba(0,0,0,0);border-radius:var(--borderRadius-medium);display:inline-flex;height:var(--control-medium-size);justify-content:center;padding:var(--segmentedControl-item-padding);position:relative}:is(.SegmentedControl-item .Button--invisible):hover:not(:disabled){background-color:var(--controlTrack-bgColor-hover, var(--color-action-list-item-default-hover-bg))}:is(.SegmentedControl-item .Button--invisible):active:not(:disabled){background-color:var(--controlTrack-bgColor-active, var(--color-action-list-item-default-active-bg))}.SegmentedControl-item.SegmentedControl-item--selected{background-color:var(--controlKnob-bgColor-rest, var(--color-segmented-control-button-bg));border-color:var(--controlKnob-borderColor-rest, var(--color-segmented-control-button-selected-border))}.SegmentedControl-item.SegmentedControl-item--selected .Button{font-weight:var(--base-text-weight-semibold)}:is(.SegmentedControl-item.SegmentedControl-item--selected .Button):hover{background-color:initial}.SegmentedControl-item.SegmentedControl-item--selected:before{border-color:rgba(0,0,0,0) !important}.SegmentedControl-item.SegmentedControl-item--selected+.SegmentedControl-item:before{border-color:rgba(0,0,0,0)}.SegmentedControl-item .Button-label[data-content]:before{content:attr(data-content);display:block;font-weight:var(--base-text-weight-semibold);height:0;visibility:hidden}.SegmentedControl-item:not(:first-child):before{border-left:var(--borderWidth-thin) solid var(--borderColor-default);content:"";inset:0 0 0 -1px;margin-bottom:var(--control-medium-paddingBlock);margin-top:var(--control-medium-paddingBlock);position:absolute}.SegmentedControl-item .Button{border:0;border-radius:calc(var(--borderRadius-medium) - var(--segmentedControl-item-padding)/2);font-weight:var(--base-text-weight-normal);height:100%;min-width:-moz-fit-content;min-width:fit-content;padding-inline:calc(var(--control-medium-paddingInline-normal) - var(--segmentedControl-item-padding));width:100%}:is(.SegmentedControl-item .Button):focus-visible{border-radius:calc(var(--borderRadius-medium) - var(--segmentedControl-item-padding)/1);outline-offset:calc(var(--segmentedControl-item-padding) - var(--borderWidth-thin))}.SegmentedControl-item .Button--invisible.Button--invisible-noVisuals .Button-label{color:var(--button-default-fgColor-rest)}.SegmentedControl-item .Button-content{align-self:stretch;flex:1 1 auto}.SegmentedControl-item .Button-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.SegmentedControl--fullWidth{display:flex}.SegmentedControl--fullWidth .SegmentedControl-item{flex:1;justify-content:center}.SelectPanel-loadingPanel{min-height:min(var(--overlay-height) - 10rem,100vh - 2rem)}.SelectPanel-emptyPanel{align-items:center;display:flex;justify-content:center;min-height:min(var(--overlay-height) - 23rem,100vh - 2rem)}.Stack{align-content:flex-start;align-items:stretch;display:flex;flex-flow:column;gap:var(--stack-gap, var(--stack-gap-normal, 1rem))}.Stack[data-padding-narrow=none],.Stack[data-padding=none]{padding:0}.Stack[data-padding-narrow=condensed],.Stack[data-padding=condensed]{padding:var(--stack-padding-condensed, 8px)}.Stack[data-padding-narrow=normal],.Stack[data-padding=normal]{padding:var(--stack-padding-normal, 16px)}.Stack[data-padding-narrow=spacious],.Stack[data-padding=spacious]{padding:var(--stack-padding-spacious, 24px)}.Stack[data-direction-narrow=horizontal],.Stack[data-direction=horizontal]{flex-flow:row}.Stack[data-direction-narrow=vertical],.Stack[data-direction=vertical]{flex-flow:column}.Stack[data-gap-narrow=none],.Stack[data-gap=none]{--stack-gap:var(--stack-gap-none,0)}.Stack[data-gap-narrow=condensed],.Stack[data-gap=condensed]{--stack-gap:var(--stack-gap-condensed,0.5rem)}.Stack[data-gap-narrow=normal],.Stack[data-gap=normal]{--stack-gap:var(--stack-gap-normal,1rem)}.Stack[data-gap-narrow=spacious],.Stack[data-gap=spacious]{--stack-gap:var(--stack-gap-spacious,1.5rem)}.Stack[data-align-narrow=start],.Stack[data-align=start]{align-items:flex-start}.Stack[data-align-narrow=center],.Stack[data-align=center]{align-items:center}.Stack[data-align-narrow=end],.Stack[data-align=end]{align-items:flex-end}.Stack[data-align-narrow=baseline],.Stack[data-align=baseline]{align-items:baseline}.Stack[data-justify-narrow=start],.Stack[data-justify=start]{justify-content:flex-start}.Stack[data-justify-narrow=center],.Stack[data-justify=center]{justify-content:center}.Stack[data-justify-narrow=end],.Stack[data-justify=end]{justify-content:flex-end}.Stack[data-justify-narrow=space-between],.Stack[data-justify=space-between]{justify-content:space-between}.Stack[data-justify-narrow=space-evenly],.Stack[data-justify=space-evenly]{justify-content:space-evenly}.Stack[data-wrap-narrow=wrap],.Stack[data-wrap=wrap]{flex-wrap:wrap}.Stack[data-wrap-narrow=nowrap],.Stack[data-wrap=nowrap]{flex-wrap:nowrap}@media(min-width: 48rem){.Stack[data-padding-regular=none]{padding:0}.Stack[data-padding-regular=condensed]{padding:var(--stack-padding-condensed, 8px)}.Stack[data-padding-regular=normal]{padding:var(--stack-padding-normal, 16px)}.Stack[data-padding-regular=spacious]{padding:var(--stack-padding-spacious, 24px)}.Stack[data-direction-regular=horizontal]{flex-flow:row}.Stack[data-direction-regular=vertical]{flex-flow:column}.Stack[data-gap-regular=none]{--stack-gap:var(--stack-gap-none,0)}.Stack[data-gap-regular=condensed]{--stack-gap:var(--stack-gap-condensed,0.5rem)}.Stack[data-gap-regular=normal]{--stack-gap:var(--stack-gap-normal,1rem)}.Stack[data-gap-regular=spacious]{--stack-gap:var(--stack-gap-spacious,1.5rem)}.Stack[data-align-regular=start]{align-items:flex-start}.Stack[data-align-regular=center]{align-items:center}.Stack[data-align-regular=end]{align-items:flex-end}.Stack[data-align-regular=baseline]{align-items:baseline}.Stack[data-justify-regular=start]{justify-content:flex-start}.Stack[data-justify-regular=center]{justify-content:center}.Stack[data-justify-regular=end]{justify-content:flex-end}.Stack[data-justify-regular=space-between]{justify-content:space-between}.Stack[data-justify-regular=space-evenly]{justify-content:space-evenly}.Stack[data-wrap-regular=wrap]{flex-wrap:wrap}.Stack[data-wrap-regular=nowrap]{flex-wrap:nowrap}}@media(min-width: 87.5rem){.Stack[data-padding-wide=none]{padding:0}.Stack[data-padding-wide=condensed]{padding:var(--stack-padding-condensed, 8px)}.Stack[data-padding-wide=normal]{padding:var(--stack-padding-normal, 16px)}.Stack[data-padding-wide=spacious]{padding:var(--stack-padding-spacious, 24px)}.Stack[data-direction-wide=horizontal]{flex-flow:row}.Stack[data-direction-wide=vertical]{flex-flow:column}.Stack[data-gap-wide=none]{--stack-gap:var(--stack-gap-none,0)}.Stack[data-gap-wide=condensed]{--stack-gap:var(--stack-gap-condensed,0.5rem)}.Stack[data-gap-wide=normal]{--stack-gap:var(--stack-gap-normal,1rem)}.Stack[data-gap-wide=spacious]{--stack-gap:var(--stack-gap-spacious,1.5rem)}.Stack[data-align-wide=start]{align-items:flex-start}.Stack[data-align-wide=center]{align-items:center}.Stack[data-align-wide=end]{align-items:flex-end}.Stack[data-align-wide=baseline]{align-items:baseline}.Stack[data-justify-wide=start]{justify-content:flex-start}.Stack[data-justify-wide=center]{justify-content:center}.Stack[data-justify-wide=end]{justify-content:flex-end}.Stack[data-justify-wide=space-between]{justify-content:space-between}.Stack[data-justify-wide=space-evenly]{justify-content:space-evenly}.Stack[data-wrap-wide=wrap]{flex-wrap:wrap}.Stack[data-wrap-wide=nowrap]{flex-wrap:nowrap}}.StackItem{flex:0 1 auto;min-inline-size:0}.StackItem[data-grow-narrow=true],.StackItem[data-grow=true]{flex-grow:1}@media(min-width: 48rem){.StackItem[data-grow-regular=true]{flex-grow:1}.StackItem[data-grow-regular=false]{flex-grow:0}}@media(min-width: 87.5rem){.StackItem[data-grow-wide=true]{flex-grow:1}.StackItem[data-grow-wide=false]{flex-grow:0}}.tabnav{border-bottom:var(--borderWidth-thin) solid var(--borderColor-default);margin-bottom:var(--stack-gap-normal);margin-top:0}.tabnav-tabs{display:flex;margin-bottom:calc(var(--borderWidth-thin)*-1);overflow:hidden}.tabnav-tab{background-color:initial;border:var(--borderWidth-thin) solid rgba(0,0,0,0);border-bottom:0;color:var(--fgColor-muted);display:inline-block;flex-shrink:0;font-size:var(--text-body-size-medium);line-height:23px;padding:var(--base-size-8) var(--control-medium-paddingInline-spacious);-webkit-text-decoration:none;text-decoration:none;transition:color .2s cubic-bezier(0.3, 0, 0.5, 1)}.tabnav-tab.selected,.tabnav-tab[aria-current]:not([aria-current=false]),.tabnav-tab[aria-selected=true]{background-color:var(--bgColor-default);border-color:var(--borderColor-default);border-radius:var(--borderRadius-medium) var(--borderRadius-medium) 0 0;color:var(--fgColor-default)}:is(.tabnav-tab.selected,.tabnav-tab[aria-selected=true],.tabnav-tab[aria-current]:not([aria-current=false])) .octicon{color:inherit}.tabnav-tab:hover{color:var(--fgColor-default);-webkit-text-decoration:none;text-decoration:none;transition-duration:.1s}.tabnav-tab:focus,.tabnav-tab:focus-visible{border-radius:var(--borderRadius-medium) var(--borderRadius-medium) 0 0 !important;outline-offset:-6px}.tabnav-tab .octicon,.tabnav-tab:active{color:var(--fgColor-muted)}.tabnav-tab .octicon{margin-right:var(--control-small-gap)}.tabnav-tab .Counter{color:inherit;margin-left:var(--control-small-gap)}.tabnav-extra{color:var(--fgColor-muted);display:inline-block;font-size:var(--text-body-size-small);margin-left:10px;padding-top:10px}.tabnav-extra>.octicon{margin-right:var(--base-size-2)}a.tabnav-extra:hover{color:var(--fgColor-accent);-webkit-text-decoration:none;text-decoration:none}.tabnav-btn{margin-left:var(--controlStack-medium-gap-condensed)}.FormControl{display:inline-flex;flex-direction:column;gap:var(--base-size-4)}.FormControl--fullWidth{display:flex}.FormControl-label{color:var(--fgColor-default);font-size:var(--text-body-size-medium);font-weight:var(--base-text-weight-semibold);line-height:var(--text-body-lineHeight-medium)}.FormControl-caption{color:var(--fgColor-muted);font-weight:var(--text-caption-weight);margin-bottom:0}.FormControl-caption,.FormControl-inlineValidation{font-size:var(--text-caption-size);line-height:var(--text-caption-lineHeight)}.FormControl-inlineValidation{align-items:flex-start;color:var(--control-danger-fgColor-rest);display:flex;fill:var(--control-danger-fgColor-rest);flex-direction:row;font-weight:var(--base-text-weight-semibold);gap:var(--base-size-4)}.FormControl-inlineValidation p{margin-bottom:0}.FormControl-inlineValidation--success{color:var(--fgColor-success);fill:var(--fgColor-success)}.FormControl-inlineValidation--visual{align-items:center;display:flex;min-height:var(--base-size-16)}.FormControl-spacingWrapper{display:flex;flex-direction:column;row-gap:var(--stack-gap-normal)}.FormControl-horizontalGroup{column-gap:.5rem;display:flex}.FormControl-input,.FormControl-select,.FormControl-textarea{background-color:var(--bgColor-default);border:var(--borderWidth-thin) solid var(--control-borderColor-rest, var(--color-border-default));box-shadow:var(--shadow-inset);color:var(--fgColor-default)}[disabled]:is(.FormControl-input,.FormControl-select,.FormControl-textarea){background-color:var(--control-bgColor-disabled);border-color:var(--control-borderColor-disabled);box-shadow:none;color:var(--control-fgColor-disabled);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--control-fgColor-disabled)}[invalid=true]:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not(:focus){border-color:var(--control-borderColor-danger)}[invalid=false]:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not(:focus){border-color:var(--control-borderColor-success)}:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type=checkbox],[type=radio]):focus{border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px var(--focus-outlineColor);outline:none}:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type=checkbox],[type=radio]):focus:not(:focus-visible){border-color:rgba(0,0,0,0);border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px rgba(0,0,0,0) var(--focus-outlineColor);outline:none}:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type=checkbox],[type=radio]):focus-visible{border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px var(--focus-outlineColor);outline:none}.FormControl-input,.FormControl-select,.FormControl-textarea{border-radius:var(--borderRadius-medium);font-size:var(--text-body-size-medium);line-height:var(--text-body-lineHeight-medium);padding-block:calc(var(--control-medium-paddingBlock) - var(--borderWidth-thin));padding-inline:var(--control-medium-paddingInline-condensed);transition:80ms cubic-bezier(0.33, 1, 0.68, 1);transition-property:color,background-color,box-shadow,border-color;width:100%}[disabled]:is(.FormControl-input,.FormControl-select,.FormControl-textarea)::placeholder{color:var(--control-fgColor-disabled)}[readonly]:is(.FormControl-input,.FormControl-select,.FormControl-textarea){background-color:var(--control-bgColor-disabled)}:is(.FormControl-input,.FormControl-select,.FormControl-textarea)::placeholder{color:var(--control-fgColor-placeholder);opacity:1}.FormControl-small:is(.FormControl-input,.FormControl-select,.FormControl-textarea){font-size:var(--text-body-size-small);height:var(--control-small-size);padding-block:var(--control-small-paddingBlock);padding-inline:var(--control-small-paddingInline-normal)}.FormControl-medium:is(.FormControl-input,.FormControl-select,.FormControl-textarea){height:var(--control-medium-size)}.FormControl-large:is(.FormControl-input,.FormControl-select,.FormControl-textarea){height:var(--control-large-size);padding-block:var(--control-large-paddingBlock);padding-inline:var(--control-large-paddingInline-normal)}.FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea){background-color:var(--bgColor-muted)}.FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea):focus,.FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea):focus-visible{background-color:var(--bgColor-default)}.FormControl-monospace:is(.FormControl-input,.FormControl-select,.FormControl-textarea){font-family:var(--fontStack-monospace)}.FormControl-error:is(.FormControl-input,.FormControl-select,.FormControl-textarea){border-color:var(--control-borderColor-danger)}.FormControl-success:is(.FormControl-input,.FormControl-select,.FormControl-textarea){border-color:var(--control-borderColor-success)}.FormControl-warning:is(.FormControl-input,.FormControl-select,.FormControl-textarea){border-color:var(--control-borderColor-warning)}.FormControl-toggleSwitchInput{align-items:flex-start;display:flex;gap:var(--base-size-16)}.FormControl-input-wrap{display:grid;position:relative}.FormControl-input-wrap .FormControl-input-leadingVisualWrap{color:var(--fgColor-muted);display:block;height:var(--base-size-16);left:var(--base-size-8);pointer-events:none;position:absolute;top:var(--base-size-8);width:var(--base-size-16)}:is(.FormControl-input-wrap .FormControl-input-leadingVisualWrap) .FormControl-input-leadingVisual{display:block;-webkit-user-select:none;user-select:none}.FormControl-input-wrap .FormControl-input-trailingVisualWrap{align-items:center;color:var(--fgColor-muted);display:flex;gap:var(--base-size-4);height:var(--base-size-16);pointer-events:none;position:absolute;right:var(--base-size-8);top:var(--base-size-8)}:is(.FormControl-input-wrap .FormControl-input-trailingVisualWrap):has(.FormControl-input-trailingVisualLabel),:is(.FormControl-input-wrap .FormControl-input-trailingVisualWrap):has(.FormControl-input-trailingVisualText){max-width:25%;padding-left:var(--base-size-8)}:is(.FormControl-input-wrap .FormControl-input-trailingVisualWrap) .FormControl-input-trailingVisualLabel{overflow:hidden;text-overflow:ellipsis}.FormControl-input-wrap .FormControl-input-trailingAction{align-items:center;background:rgba(0,0,0,0);border:0;border-radius:var(--borderRadius-small);color:var(--fgColor-muted);cursor:pointer;display:grid;height:var(--control-xsmall-size);justify-content:center;padding:0;position:absolute;right:var(--base-size-4);top:var(--base-size-4);transition:.2s cubic-bezier(0.3, 0, 0.5, 1);transition-property:color,background-color,border-color;width:var(--control-xsmall-size);z-index:4}:is(.FormControl-input-wrap .FormControl-input-trailingAction) svg{-webkit-user-select:none;user-select:none}[disabled]:is(.FormControl-input-wrap .FormControl-input-trailingAction){color:var(--control-fgColor-disabled);pointer-events:none}:is(.FormControl-input-wrap .FormControl-input-trailingAction):hover{background:var(--control-transparent-bgColor-hover)}:is(.FormControl-input-wrap .FormControl-input-trailingAction):active{background:var(--control-transparent-bgColor-active)}.FormControl-input-trailingAction--divider:is(.FormControl-input-wrap .FormControl-input-trailingAction):before{background:var(--borderColor-default);content:"";display:block;height:var(--base-size-16);left:calc(var(--base-size-4)*-1);position:absolute;top:calc((var(--control-xsmall-size) - var(--base-size-16))/2);width:var(--borderWidth-thin)}:is(:is(.FormControl-input-wrap .FormControl-input-trailingAction):after){content:"";height:100%;left:50%;min-height:var(--control-medium-size) var(--control-medium-size);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}@media(pointer: coarse){:is(.FormControl-input-wrap .FormControl-input-trailingAction):after{min-height:var(--control-minTarget-coarse);min-width:var(--control-minTarget-coarse)}}.FormControl-input-wrap.FormControl-input-wrap--leadingVisual .FormControl-input{padding-inline-start:calc(var(--control-medium-paddingInline-condensed) + var(--base-size-16) + var(--control-medium-gap))}.FormControl-input-wrap.FormControl-input-wrap--trailingVisual .FormControl-input{padding-inline-end:calc(var(--control-medium-paddingInline-condensed) + var(--base-size-16) + var(--control-medium-gap))}.FormControl-input-wrap.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualLabel) .FormControl-input,.FormControl-input-wrap.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualText) .FormControl-input{padding-inline-end:25%}.FormControl-input-wrap.FormControl-input-wrap--trailingAction .FormControl-input{padding-inline-end:calc(var(--control-medium-paddingInline-condensed) + var(--base-size-16) + var(--control-medium-gap))}.FormControl-input-wrap.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input{padding-inline-end:calc(var(--control-medium-paddingInline-condensed) + var(--base-size-16) + var(--control-medium-gap) + var(--borderWidth-thin))}.FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-leadingVisualWrap{left:calc(var(--control-medium-paddingInline-condensed) - var(--base-size-2));top:calc(var(--control-medium-paddingInline-condensed) - var(--base-size-2))}.FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-trailingVisualWrap{right:calc(var(--control-medium-paddingInline-condensed) - var(--base-size-2));top:calc(var(--control-medium-paddingInline-condensed) - var(--base-size-2))}.FormControl-input-wrap.FormControl-input-wrap--small.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-small{padding-inline-end:calc(var(--control-small-paddingInline-condensed) + var(--base-size-16) + var(--control-small-gap))}.FormControl-input-wrap.FormControl-input-wrap--small.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-small{padding-inline-end:calc(var(--control-small-paddingInline-condensed) + var(--base-size-16) + var(--control-small-gap) + var(--borderWidth-thin))}.FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-trailingAction{height:calc(var(--control-small-size) - var(--base-size-8));width:calc(var(--control-small-size) - var(--base-size-8))}:is(.FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-trailingAction):before{top:calc((var(--control-xsmall-size) - var(--base-size-16))/4)}.FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-leadingVisualWrap{left:var(--control-medium-paddingInline-normal);top:var(--control-medium-paddingInline-normal)}.FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingVisualWrap{right:var(--control-medium-paddingInline-normal);top:var(--control-medium-paddingInline-normal)}.FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--leadingVisual .FormControl-input.FormControl-large{padding-inline-start:calc(var(--control-large-paddingInline-normal) + var(--base-size-16) + var(--control-large-gap))}.FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingVisual .FormControl-input{padding-inline-end:calc(var(--control-large-paddingInline-normal) + var(--base-size-16) + var(--control-large-gap))}.FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingLabel .FormControl-input.FormControl-large,.FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingText .FormControl-input.FormControl-large,.FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualLabel) .FormControl-input,.FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualText) .FormControl-input{padding-inline-end:25%}.FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-large{padding-inline-end:calc(var(--control-large-paddingInline-normal) + var(--base-size-16) + var(--control-large-gap))}.FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-large{padding-inline-end:calc(var(--control-large-paddingInline-normal) + var(--base-size-16) + var(--control-large-gap) + var(--borderWidth-thin))}.FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingAction{height:var(--control-small-size);right:calc(var(--control-medium-paddingInline-condensed) - var(--base-size-2));top:calc(var(--control-medium-paddingInline-condensed) - var(--base-size-2));width:var(--control-small-size)}:is(.FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingAction):before{height:var(--base-size-20);top:unset}.FormControl-select-wrap{display:grid;grid-template-columns:minmax(0, auto) var(--base-size-16)}.FormControl-select-wrap:after{background-color:var(--bgColor-neutral-emphasis);content:"";grid-column:2;grid-row:1;height:var(--base-size-16);mask:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iIzU4NjA2OSIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBkPSJtNC40MjcgOS40MjcgMy4zOTYgMy4zOTZhLjI1LjI1IDAgMCAwIC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwIDAgMTEuMzk2IDlINC42MDRhLjI1LjI1IDAgMCAwLS4xNzcuNDI3TTQuNDIzIDYuNDcgNy44MiAzLjA3MmEuMjUuMjUgMCAwIDEgLjM1NCAwTDExLjU3IDYuNDdhLjI1LjI1IDAgMCAxLS4xNzcuNDI3SDQuNmEuMjUuMjUgMCAwIDEtLjE3Ny0uNDI3Ii8+PC9zdmc+");mask-repeat:no-repeat;mask-size:contain;padding-right:var(--base-size-4);place-self:center end;pointer-events:none;width:var(--base-size-16)}.FormControl-select-wrap .FormControl-select{appearance:none;grid-column:1/-1;grid-row:1;padding-right:var(--base-size-20)}.FormControl-select-wrap[data-multiple]:after{content:none}.FormControl-select-wrap[data-multiple] .FormControl-select{padding-right:var(--base-size-8)}.FormControl-checkbox-wrap,.FormControl-radio-wrap{display:inline-grid;gap:var(--base-size-8);grid-template-columns:min-content auto}:is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-checkbox-labelWrap,:is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-radio-labelWrap{display:flex;flex-direction:column;gap:var(--base-size-4)}:is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-label{cursor:pointer}.FormControl-check-group-wrap fieldset,.FormControl-radio-group-wrap fieldset{border:0;margin:0;padding:0}.FormControl-checkbox{background-color:var(--bgColor-default);border:var(--borderWidth-thin) solid var(--control-borderColor-rest, var(--color-border-default));box-shadow:var(--shadow-inset);color:var(--fgColor-default)}.FormControl-checkbox[disabled]{background-color:var(--control-bgColor-disabled);border-color:var(--control-borderColor-disabled);box-shadow:none;color:var(--control-fgColor-disabled);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--control-fgColor-disabled)}.FormControl-checkbox[invalid=true]:not(:focus){border-color:var(--control-borderColor-danger)}.FormControl-checkbox[invalid=false]:not(:focus){border-color:var(--control-borderColor-success)}.FormControl-checkbox:not([type=checkbox],[type=radio]):focus{border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px var(--focus-outlineColor);outline:none}.FormControl-checkbox:not([type=checkbox],[type=radio]):focus:not(:focus-visible){border-color:rgba(0,0,0,0);border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px rgba(0,0,0,0) var(--focus-outlineColor);outline:none}.FormControl-checkbox:not([type=checkbox],[type=radio]):focus-visible{border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px var(--focus-outlineColor);outline:none}.FormControl-checkbox{appearance:none;border-color:var(--control-borderColor-emphasis);border-radius:var(--borderRadius-small);cursor:pointer;display:grid;height:var(--base-size-16);margin:0;margin-top:var(--base-size-2);place-content:center;position:relative;transition:background-color,border-color 80ms cubic-bezier(0.33, 1, 0.68, 1);width:var(--base-size-16)}.FormControl-checkbox:before{animation:checkmarkOut 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards;background-color:var(--control-checked-fgColor-rest);clip-path:inset(var(--base-size-16) 0 0 0);content:"";height:var(--base-size-16);mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTIgOSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzguMjJhLjc1Ljc1IDAgMCAxIDAgMS4wNjFMNC41MiA4LjU0MWEuNzUuNzUgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1Ljc1IDAgMCAxIDEuMDYyIDAiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==");mask-position:center;mask-repeat:no-repeat;mask-size:75%;transition:visibility 0s linear .23s;visibility:hidden;width:var(--base-size-16)}:is(.FormControl-checkbox:after){content:"";height:100%;left:50%;min-height:var(--control-medium-size) var(--control-medium-size);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}:is(.FormControl-checkbox[disabled]~.FormControl-checkbox-labelWrap) .FormControl-label{color:var(--control-fgColor-disabled);cursor:not-allowed}.FormControl-checkbox:checked{background:var(--control-checked-bgColor-rest, var(--color-accent-fg));border-color:var(--control-checked-borderColor-rest, var(--color-accent-fg));transition:background-color,border-color 80ms cubic-bezier(0.32, 0, 0.67, 0) 0s}.FormControl-checkbox:checked:before{animation:checkmarkIn 80ms cubic-bezier(0.65, 0, 0.35, 1) 80ms forwards;transition:visibility 0s linear 0s;visibility:visible}.FormControl-checkbox:checked:disabled{background-color:var(--control-fgColor-disabled);border-color:var(--control-fgColor-disabled);cursor:not-allowed;opacity:1}.FormControl-checkbox:checked:disabled:before{background-color:var(--control-checked-fgColor-rest)}@media(forced-colors: active){.FormControl-checkbox:checked{background-color:canvastext;border-color:canvastext}}.FormControl-checkbox:focus-visible{box-shadow:none;outline:2px solid var(--focus-outlineColor);outline-offset:2px}.FormControl-checkbox:indeterminate:before{mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIyIiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTAgMiI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMCAxYTEgMSAwIDAgMSAxLTFoOGExIDEgMCAxIDEgMCAySDFhMSAxIDAgMCAxLTEtMSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");visibility:visible}.FormControl-radio{background-color:var(--bgColor-default);border:var(--borderWidth-thin) solid var(--control-borderColor-rest, var(--color-border-default));box-shadow:var(--shadow-inset);color:var(--fgColor-default)}.FormControl-radio[disabled]{background-color:var(--control-bgColor-disabled);border-color:var(--control-borderColor-disabled);box-shadow:none;color:var(--control-fgColor-disabled);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--control-fgColor-disabled)}.FormControl-radio[invalid=true]:not(:focus){border-color:var(--control-borderColor-danger)}.FormControl-radio[invalid=false]:not(:focus){border-color:var(--control-borderColor-success)}.FormControl-radio:not([type=checkbox],[type=radio]):focus{border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px var(--focus-outlineColor);outline:none}.FormControl-radio:not([type=checkbox],[type=radio]):focus:not(:focus-visible){border-color:rgba(0,0,0,0);border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px rgba(0,0,0,0) var(--focus-outlineColor);outline:none}.FormControl-radio:not([type=checkbox],[type=radio]):focus-visible{border-color:var(--focus-outlineColor);box-shadow:inset 0 0 0 1px var(--focus-outlineColor);outline:none}.FormControl-radio{appearance:none;border-color:var(--control-borderColor-emphasis);border-radius:var(--borderRadius-full);cursor:pointer;height:var(--base-size-16);margin:0;margin-top:var(--base-size-2);position:relative;transition:background-color,border-color 80ms cubic-bezier(0.33, 1, 0.68, 1);width:var(--base-size-16)}:is(.FormControl-radio:after){content:"";height:100%;left:50%;min-height:var(--control-medium-size) var(--control-medium-size);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}:is(.FormControl-radio[disabled]~.FormControl-radio-labelWrap) .FormControl-label{color:var(--control-fgColor-disabled);cursor:not-allowed}.FormControl-radio:checked{border-color:var(--control-checked-borderColor-rest, var(--color-accent-fg));border-width:var(--base-size-4)}.FormControl-radio:checked:disabled,.FormControl-radio[disabled]:checked{border-color:var(--control-fgColor-disabled);cursor:not-allowed}:is(:is(.FormControl-radio[disabled]:checked,.FormControl-radio:checked:disabled)~.FormControl-radio-labelWrap) .FormControl-label{color:var(--control-fgColor-disabled);cursor:not-allowed}.FormControl-radio:focus-visible{box-shadow:none;outline:2px solid var(--focus-outlineColor);outline-offset:2px}@media(forced-colors: active){.FormControl-radio{background-color:canvastext;border-color:canvastext}}@keyframes checkmarkIn{0%{clip-path:inset(var(--base-size-16) 0 0 0)}to{clip-path:inset(0 0 0 0)}}@keyframes checkmarkOut{0%{clip-path:inset(0 0 0 0)}to{clip-path:inset(var(--base-size-16) 0 0 0)}}.ToggleSwitch,.ToggleSwitch.ToggleSwitch{display:inline-flex}.ToggleSwitch{align-items:center;gap:var(--controlStack-medium-gap-condensed)}.ToggleSwitch--checked .ToggleSwitch-statusOn{height:auto;visibility:visible}.ToggleSwitch--checked .ToggleSwitch-statusOff{height:0;visibility:hidden}.ToggleSwitch-track{appearance:none;background-color:var(--controlTrack-bgColor-rest);border:var(--borderWidth-thin) solid var(--controlTrack-borderColor-rest);border-radius:var(--borderRadius-medium);cursor:pointer;display:block;height:var(--control-medium-size);overflow:hidden;padding:0;position:relative;-webkit-text-decoration:none;text-decoration:none;transition-duration:80ms;transition-property:background-color,border-color;transition-timing-function:cubic-bezier(0.5, 1, 0.89, 1);-webkit-user-select:none;user-select:none;width:var(--base-size-64)}.ToggleSwitch-track:focus,.ToggleSwitch-track:focus-visible{outline-offset:1px}.ToggleSwitch-track:hover{background-color:var(--controlTrack-bgColor-hover)}.ToggleSwitch-track:active{background-color:var(--controlTrack-bgColor-active)}@media(pointer: coarse){:is(.ToggleSwitch-track:before){content:"";height:100%;left:50%;min-height:44px;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}}@media(prefers-reduced-motion){.ToggleSwitch-track,.ToggleSwitch-track *{transition:none}}.ToggleSwitch-track[aria-pressed=true][disabled]{background-color:var(--controlTrack-bgColor-disabled);border-color:rgba(0,0,0,0);color:var(--control-checked-fgColor-disabled)}.ToggleSwitch-track[aria-pressed=true]{background-color:var(--control-checked-bgColor-rest);border-color:var(--borderColor-transparent)}.ToggleSwitch-track[aria-pressed=true]:not([disabled]):hover{background-color:var(--control-checked-bgColor-hover)}.ToggleSwitch-track[aria-pressed=true]:not([disabled]):active{background-color:var(--control-checked-bgColor-active)}.ToggleSwitch-track[aria-pressed=true] .ToggleSwitch-knob{background-color:var(--controlKnob-bgColor-checked);border-color:var(--controlKnob-borderColor-checked);transform:translateX(100%)}.ToggleSwitch-track[aria-pressed=true] .ToggleSwitch-lineIcon{transform:translateX(0)}.ToggleSwitch-track[aria-pressed=true] .ToggleSwitch-circleIcon{transform:translateX(100%)}.ToggleSwitch-track[disabled]{background-color:var(--controlTrack-bgColor-disabled);border-color:rgba(0,0,0,0);cursor:not-allowed;transition-property:none}.ToggleSwitch-track[disabled] .ToggleSwitch-knob{border-color:var(--borderColor-default);box-shadow:none}.ToggleSwitch-track[disabled] .ToggleSwitch-circleIcon,.ToggleSwitch-track[disabled] .ToggleSwitch-lineIcon{color:var(--controlTrack-fgColor-disabled)}.ToggleSwitch-icons{align-items:center;display:flex;height:100%;overflow:hidden;width:100%}.ToggleSwitch-lineIcon{color:var(--control-checked-fgColor-rest);transform:translateX(-100%)}.ToggleSwitch-circleIcon,.ToggleSwitch-lineIcon{flex:1 0 50%;line-height:0;transition-duration:80ms;transition-property:transform}.ToggleSwitch-circleIcon{color:var(--controlTrack-fgColor-rest);transform:translateX(0)}.ToggleSwitch-knob{background-color:var(--controlKnob-bgColor-rest);border:var(--borderWidth-thin) solid var(--controlKnob-borderColor-rest);border-radius:var(--borderRadius-medium);bottom:0;box-shadow:var(--shadow-resting-medium),var(--button-default-shadow-inset);position:absolute;top:0;transition-duration:80ms;transition-property:transform;transition-timing-function:cubic-bezier(0.5, 1, 0.89, 1);width:50%;z-index:1}@media(prefers-reduced-motion){.ToggleSwitch-knob{transition:none}}.ToggleSwitch-status{color:var(--fgColor-default);font-size:var(--text-body-size-medium);line-height:var(--text-title-lineHeight-large);position:relative;text-align:right}.ToggleSwitch-statusIcon{display:flex;margin-top:.063rem;width:var(--base-size-16)}.ToggleSwitch--small .ToggleSwitch-status{font-size:var(--text-body-size-small)}.ToggleSwitch--small .ToggleSwitch-track{height:var(--control-xsmall-size);width:var(--base-size-48)}.ToggleSwitch--disabled .ToggleSwitch-status{color:var(--fgColor-muted)}.ToggleSwitch-statusOn{height:0;visibility:hidden}.ToggleSwitch-statusOff{height:auto;visibility:visible}.ToggleSwitch--statusAtEnd{flex-direction:row-reverse}.ToggleSwitch--statusAtEnd .ToggleSwitch-status{text-align:left}.UnderlineNav{box-shadow:inset 0 -1px 0 var(--borderColor-muted);display:flex;min-height:var(--base-size-48);overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:auto;justify-content:space-between}.UnderlineNav .Counter{background-color:var(--bgColor-neutral-muted, var(--color-neutral-muted));color:var(--fgColor-default);margin-left:var(--control-medium-gap)}.UnderlineNav .Counter--primary{background-color:var(--bgColor-neutral-emphasis);color:var(--fgColor-onEmphasis)}.UnderlineNav-body{align-items:center;display:flex;gap:var(--control-medium-gap);list-style:none}.UnderlineNav-item{align-items:center;background-color:initial;border:0;border-radius:var(--borderRadius-medium);color:var(--fgColor-default);cursor:pointer;display:flex;font-size:var(--text-body-size-medium);line-height:30px;padding:0 var(--control-medium-paddingInline-condensed);position:relative;text-align:center;white-space:nowrap}.UnderlineNav-item:focus,.UnderlineNav-item:focus-visible,.UnderlineNav-item:hover{border-bottom-color:var(--borderColor-neutral-muted);color:var(--fgColor-default);outline-offset:-2px;-webkit-text-decoration:none;text-decoration:none;transition:border-bottom-color .12s ease-out}.UnderlineNav-item [data-content]:before{content:attr(data-content);display:block;font-weight:var(--base-text-weight-semibold);height:0;visibility:hidden}:is(.UnderlineNav-item:before){content:"";height:100%;left:50%;min-height:48px;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}@media(pointer: fine){.UnderlineNav-item:hover{background:var(--control-transparent-bgColor-hover);color:var(--fgColor-default);-webkit-text-decoration:none;text-decoration:none;transition:background .12s ease-out}}.UnderlineNav-item.selected,.UnderlineNav-item[aria-current]:not([aria-current=false]),.UnderlineNav-item[role=tab][aria-selected=true]{border-bottom-color:var(--underlineNav-borderColor-active);color:var(--fgColor-default);font-weight:var(--base-text-weight-semibold)}:is(.UnderlineNav-item.selected,.UnderlineNav-item[role=tab][aria-selected=true],.UnderlineNav-item[aria-current]:not([aria-current=false])):after{background:var(--underlineNav-borderColor-active);border-radius:var(--borderRadius-medium);bottom:calc(50% - var(--base-size-24));content:"";height:2px;position:absolute;right:50%;transform:translate(50%, -50%);width:100%;z-index:1}.UnderlineNav--right{justify-content:flex-end}.UnderlineNav--right .UnderlineNav-actions{flex:1 1 auto}.UnderlineNav-actions{align-self:center}.UnderlineNav--full{display:block}.UnderlineNav--full .UnderlineNav-body{min-height:var(--base-size-48)}.UnderlineNav-octicon{color:var(--fgColor-muted);display:inline !important;fill:var(--fgColor-muted);margin-right:var(--control-medium-gap)}.UnderlineNav-container{display:flex;justify-content:space-between}@keyframes shimmer{0%{mask-position:200%}to{mask-position:0}}.SkeletonBox{animation:shimmer;background-color:var(--bgColor-muted);border-radius:var(--borderRadius-small);display:block;height:1rem}@media(prefers-reduced-motion: no-preference){.SkeletonBox{animation:shimmer;animation-duration:1s;animation-iteration-count:infinite;mask-image:linear-gradient(75deg, #000 30%, rgba(0, 0, 0, 0.6509803922) 80%);mask-size:200%}}@media(forced-colors: active){.SkeletonBox{outline:1px solid rgba(0,0,0,0);outline-offset:-1px}}.TreeViewRootUlStyles{list-style:none;margin:0;padding:0}.TreeViewRootUlStyles .TreeViewItem{outline:none}:is(.TreeViewRootUlStyles .TreeViewItem):focus-visible>div{box-shadow:var(--boxShadow-thick) var(--fgColor-accent)}@media(forced-colors: active){:is(.TreeViewRootUlStyles .TreeViewItem):focus-visible>div{outline:2px solid HighlightText;outline-offset:-2}}[data-has-leading-action]:is(.TreeViewRootUlStyles .TreeViewItem){--has-leading-action:1}.TreeViewRootUlStyles .TreeViewItemContainer{--level:1;--toggle-width:1rem;--min-item-height:2rem;border-radius:var(--borderRadius-medium);color:var(--fgColor-default);display:grid;font-size:var(--text-body-size-medium);grid-template-areas:"spacer leadingAction toggle content";grid-template-columns:var(--spacer-width) var(--leading-action-width) var(--toggle-width) 1fr;position:relative;width:100%;--leading-action-width:calc(var(--has-leading-action, 0)*1.5rem);--spacer-width:calc((var(--level) - 1)*(var(--toggle-width)/2))}:is(.TreeViewRootUlStyles .TreeViewItemContainer):hover{background-color:var(--control-transparent-bgColor-hover)}@media(forced-colors: active){:is(.TreeViewRootUlStyles .TreeViewItemContainer):hover{outline:2px solid rgba(0,0,0,0);outline-offset:-2px}}@media(pointer: coarse){.TreeViewRootUlStyles .TreeViewItemContainer{--toggle-width:1.5rem;--min-item-height:2.75rem}}:is(.TreeViewRootUlStyles .TreeViewItemContainer):has(.TreeViewFailureMessage):hover{background-color:initial;cursor:default}@media(forced-colors: active){:is(.TreeViewRootUlStyles .TreeViewItemContainer):has(.TreeViewFailureMessage):hover{outline:none}}:is(.TreeViewRootUlStyles .TreeViewItemContainer):has([role=treeitem]:focus-visible){box-shadow:var(--boxShadow-thick) var(--fgColor-accent)}.TreeViewRootUlStyles:where([data-omit-spacer=true]) .TreeViewItemContainer{grid-template-columns:0 0 0 1fr}.TreeViewRootUlStyles .TreeViewItem>.TreeViewItemContainer:has(.TreeViewItemContent[aria-current=true]){background-color:var(--control-transparent-bgColor-selected)}:is(.TreeViewRootUlStyles .TreeViewItem>.TreeViewItemContainer:has(.TreeViewItemContent[aria-current=true])):after{background-color:var(--fgColor-accent);border-radius:var(--borderRadius-medium);content:"";height:1.5rem;left:calc(var(--base-size-8)*-1);position:absolute;top:calc(50% - var(--base-size-12));width:.25rem}@media(forced-colors: active){:is(.TreeViewRootUlStyles .TreeViewItem>.TreeViewItemContainer:has(.TreeViewItemContent[aria-current=true])):after{background-color:HighlightText}}.TreeViewRootUlStyles .TreeViewItemToggle{align-items:flex-start;color:var(--fgColor-muted);cursor:pointer;display:flex;grid-area:toggle;height:100%;justify-content:center;padding-top:calc(var(--min-item-height)/2 - var(--base-size-12)/2)}.TreeViewRootUlStyles .TreeViewItemToggleHover:hover{background-color:var(--control-transparent-bgColor-hover)}.TreeViewRootUlStyles .TreeViewItemToggleEnd{border-bottom-left-radius:var(--borderRadius-medium);border-top-left-radius:var(--borderRadius-medium)}.TreeViewRootUlStyles a.TreeViewItemContent:hover,.TreeViewRootUlStyles button.TreeViewItemContent:hover{-webkit-text-decoration:underline;text-decoration:underline;text-decoration-color:var(--control-fgColor-rest)}.TreeViewRootUlStyles :has(.TreeViewItemContent[aria-disabled=true]){cursor:not-allowed}.TreeViewRootUlStyles .TreeViewItemContent{cursor:pointer;display:flex;gap:var(--stack-gap-condensed);grid-area:content;height:100%;line-height:var(--custom-line-height, var(--text-body-lineHeight-medium, 1.4285));outline:none;padding:0 var(--base-size-8);padding-bottom:calc((var(--min-item-height) - var(--custom-line-height, 1.3rem))/2);padding-top:calc((var(--min-item-height) - var(--custom-line-height, 1.3rem))/2)}.TreeViewRootUlStyles .TreeViewItemContent,:is(.TreeViewRootUlStyles .TreeViewItemContent) .TreeViewItemCheckbox{background-color:initial;border:none;text-align:left;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}:is(.TreeViewRootUlStyles .TreeViewItemContent) .TreeViewItemCheckbox{border-radius:var(--borderRadius-medium);color:var(--control-fgColor-rest);position:relative;transition:background 33.333ms linear}[aria-checked=true]:is(.TreeViewRootUlStyles .TreeViewItemContent) .FormControl-checkbox{background:var(--control-checked-bgColor-rest);border-color:var(--control-checked-borderColor-rest);transition:background-color,border-color 80ms cubic-bezier(0.32, 0, 0.67, 0) 0s}:is([aria-checked=true]:is(.TreeViewRootUlStyles .TreeViewItemContent) .FormControl-checkbox):before{animation:checkmarkIn 80ms cubic-bezier(0.65, 0, 0.35, 1) 80ms forwards;transition:visibility 0s linear 0s;visibility:visible}[aria-checked=mixed]:is(.TreeViewRootUlStyles .TreeViewItemContent) .FormControl-checkbox{background:var(--control-checked-bgColor-rest);border-color:var(--control-checked-borderColor-rest);transition:background-color,border-color 80ms cubic-bezier(0.32, 0, 0.67, 0) 0s}:is([aria-checked=mixed]:is(.TreeViewRootUlStyles .TreeViewItemContent) .FormControl-checkbox):before{animation:checkmarkIn 80ms cubic-bezier(0.65, 0, 0.35, 1) 80ms forwards;clip-path:none;mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIyIiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTAgMiI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMCAxYTEgMSAwIDAgMSAxLTFoOGExIDEgMCAxIDEgMCAySDFhMSAxIDAgMCAxLTEtMSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");visibility:visible}[aria-disabled=true]:is(.TreeViewRootUlStyles .TreeViewItemContent){pointer-events:none}[aria-disabled=true]:is(.TreeViewRootUlStyles .TreeViewItemContent) .TreeViewItemContentText{color:var(--control-fgColor-disabled)}:is([aria-disabled=true]:is(.TreeViewRootUlStyles .TreeViewItemContent) .TreeViewItemVisual) svg,[aria-disabled=true]:is(.TreeViewRootUlStyles .TreeViewItemContent) .TreeViewItemVisual{fill:var(--control-fgColor-disabled)}@media(hover: hover){:is([aria-disabled=true]:is(.TreeViewRootUlStyles .TreeViewItemContent) .FormControl-checkbox):hover{cursor:not-allowed}[aria-disabled=true]:is(.TreeViewRootUlStyles .TreeViewItemContent):hover{background-color:initial;cursor:not-allowed}}.TreeViewRootUlStyles .TreeViewItemContentText{color:var(--control-fgColor-rest);flex:1 1 auto;width:0}.TreeViewRootUlStyles:where([data-truncate-text=true]) .TreeViewItemContentText{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.TreeViewRootUlStyles:where([data-truncate-text=false]) .TreeViewItemContentText{word-break:break-word}.TreeViewRootUlStyles .TreeViewItemVisual{align-items:center;color:var(--fgColor-muted);display:flex;height:var(--custom-line-height, 1.3rem)}.TreeViewRootUlStyles .TreeViewItemLeadingAction{color:var(--fgColor-muted);display:flex;grid-area:leadingAction}:is(.TreeViewRootUlStyles .TreeViewItemLeadingAction)>button{flex-shrink:1}.TreeViewRootUlStyles .TreeViewItemLevelLine{border-color:var(--borderColor-muted);border-right:var(--borderWidth-thin) solid;height:100%;width:100%}@media(hover: hover){.TreeViewRootUlStyles .TreeViewItemLevelLine{border-color:rgba(0,0,0,0)}.TreeViewRootUlStyles:focus-within .TreeViewItemLevelLine,.TreeViewRootUlStyles:hover .TreeViewItemLevelLine{border-color:var(--borderColor-muted)}}.TreeViewRootUlStyles .TreeViewVisuallyHidden{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0, 0, 0, 0);border-width:0;white-space:nowrap}.TreeViewSkeletonItemContainerStyle{align-items:center;column-gap:.5rem;display:flex;height:2rem}@media(pointer: coarse){.TreeViewSkeletonItemContainerStyle{height:2.75rem}}.TreeViewSkeletonItemContainerStyle:nth-of-type(5n+1){--tree-item-loading-width:67%}.TreeViewSkeletonItemContainerStyle:nth-of-type(5n+2){--tree-item-loading-width:47%}.TreeViewSkeletonItemContainerStyle:nth-of-type(5n+3){--tree-item-loading-width:73%}.TreeViewSkeletonItemContainerStyle:nth-of-type(5n+4){--tree-item-loading-width:64%}.TreeViewSkeletonItemContainerStyle:nth-of-type(5n+5){--tree-item-loading-width:50%}.TreeItemSkeletonTextStyles{width:var(--tree-item-loading-width, 67%)}.TreeViewFailureMessage{align-items:center;display:grid;gap:.5rem;grid-template-columns:auto 1fr;width:100%}.avatar{background-color:var(--avatar-bgColor);border-radius:var(--borderRadius-medium);box-shadow:0 0 0 1px var(--avatar-borderColor);display:inline-block;flex-shrink:0;line-height:1;overflow:hidden;vertical-align:middle}.avatar-link{float:left;line-height:1}.avatar-group-item{display:inline-block;margin-bottom:var(--base-size-4)}.avatar-1,.avatar-2,.avatar-small{border-radius:var(--borderRadius-small)}.avatar-1{height:var(--base-size-16);width:var(--base-size-16)}.avatar-2{height:var(--base-size-20);width:var(--base-size-20)}.avatar-3{height:var(--base-size-24);width:var(--base-size-24)}.avatar-4{height:var(--base-size-28);width:var(--base-size-28)}.avatar-5{height:var(--base-size-32);width:var(--base-size-32)}.avatar-6{height:var(--base-size-40);width:var(--base-size-40)}.avatar-7{height:var(--base-size-48);width:var(--base-size-48)}.avatar-8{height:var(--base-size-64);width:var(--base-size-64)}.AvatarStack{height:20px;min-width:26px;position:relative}.AvatarStack .AvatarStack-body{position:absolute}.AvatarStack.AvatarStack--two{min-width:36px}.AvatarStack.AvatarStack--three-plus{min-width:46px}.AvatarStack-body{background:var(--bgColor-default);border-radius:100px;display:flex}.AvatarStack-body .avatar{background-color:var(--bgColor-default);border-radius:var(--borderRadius-small);box-sizing:initial;display:flex;height:20px;margin-right:-11px;position:relative;transition:margin .1s ease-in-out;width:20px;z-index:2}:is(.AvatarStack-body .avatar):first-child{z-index:3}:is(.AvatarStack-body .avatar):last-child{z-index:1}:is(.AvatarStack-body .avatar) img{border-radius:var(--borderRadius-small)}.AvatarStack-body span:nth-child(n+4) .avatar,:is(.AvatarStack-body .avatar):nth-child(n+4){display:none;opacity:0}:is(.AvatarStack-body:hover:not([data-disable-expand]),.AvatarStack-body:focus-within:not([data-disable-expand])) .avatar{margin-right:var(--base-size-4)}:is(.AvatarStack-body:hover:not([data-disable-expand]),.AvatarStack-body:focus-within:not([data-disable-expand])) .avatar:nth-child(n+4),:is(.AvatarStack-body:hover:not([data-disable-expand]),.AvatarStack-body:focus-within:not([data-disable-expand])) span:nth-child(n+4) .avatar{display:flex;opacity:1}:is(.AvatarStack-body:hover:not([data-disable-expand]),.AvatarStack-body:focus-within:not([data-disable-expand])) .avatar-more{display:none !important}.AvatarStack-body[data-disable-expand]{position:relative}.avatar.avatar-more{background:var(--bgColor-muted);margin-right:0;z-index:1}.avatar.avatar-more:after,.avatar.avatar-more:before{border-radius:2px;content:"";display:block;height:20px;outline:var(--borderWidth-thin) solid var(--bgColor-default);position:absolute}.avatar.avatar-more:before{background:var(--avatarStack-fade-bgColor-muted);width:17px}.avatar.avatar-more:after{background:var(--avatarStack-fade-bgColor-default);width:14px}.AvatarStack--right .AvatarStack-body{flex-direction:row-reverse;right:0}:is(.AvatarStack--right .AvatarStack-body):hover:not([data-disable-expand]) .avatar{margin-left:var(--base-size-4);margin-right:0}.AvatarStack--right .avatar.avatar-more{background:var(--avatarStack-fade-bgColor-default)}:is(.AvatarStack--right .avatar.avatar-more):before{width:5px}:is(.AvatarStack--right .avatar.avatar-more):after{background:var(--bgColor-muted);width:2px}.AvatarStack--right .avatar{margin-left:-11px;margin-right:0}.Box{background-color:var(--bgColor-default);border-color:var(--borderColor-default);border-radius:var(--borderRadius-medium);border-style:solid;border-width:var(--borderWidth-thin)}.Box--condensed{line-height:1.25}.Box--condensed .Box-body,.Box--condensed .Box-footer,.Box--condensed .Box-header{padding:var(--stack-padding-condensed) var(--stack-padding-normal)}.btn-octicon:is(.Box--condensed .Box-btn-octicon){line-height:1.25;margin:calc(var(--controlStack-medium-gap-condensed)*-1) calc(var(--controlStack-small-gap-spacious)*-1);padding:var(--control-medium-paddingInline-condensed) var(--control-medium-paddingInline-spacious)}.Box--condensed .Box-row{padding:var(--stack-padding-condensed) var(--stack-padding-normal)}.Box--spacious .Box-header{line-height:1.25;padding:var(--stack-padding-spacious)}.Box--spacious .Box-title{font-size:var(--text-title-size-medium)}.Box--spacious .Box-body,.Box--spacious .Box-footer{padding:var(--stack-padding-spacious)}.btn-octicon:is(.Box--spacious .Box-btn-octicon){margin:calc(var(--stack-gap-spacious)*-1);padding:var(--stack-padding-spacious)}.Box--spacious .Box-row{padding:var(--stack-padding-spacious)}.Box-header{background-color:var(--bgColor-muted);border-color:var(--borderColor-default);border-style:solid;border-top-left-radius:var(--borderRadius-medium);border-top-right-radius:var(--borderRadius-medium);border-width:var(--borderWidth-thin);margin:calc(var(--borderWidth-thin)*-1) calc(var(--borderWidth-thin)*-1) 0;padding:var(--stack-padding-normal)}.Box-title{font-size:var(--text-body-size-medium);font-weight:var(--base-text-weight-semibold)}.Box-body{border-bottom:var(--borderWidth-thin) solid var(--borderColor-default);padding:var(--stack-padding-normal)}.Box-body:last-of-type{border-bottom-left-radius:var(--borderRadius-medium);border-bottom-right-radius:var(--borderRadius-medium);margin-bottom:calc(var(--borderWidth-thin)*-1)}.Box-row{border-top:var(--borderWidth-thin) solid var(--borderColor-muted);list-style-type:none;margin-top:calc(var(--borderWidth-thin)*-1);padding:var(--stack-padding-normal)}.Box-row:first-of-type{border-top-left-radius:var(--borderRadius-medium);border-top-right-radius:var(--borderRadius-medium)}.Box-row:last-of-type{border-bottom-left-radius:var(--borderRadius-medium);border-bottom-right-radius:var(--borderRadius-medium)}.Box-row.Box-row--unread,.Box-row.unread{box-shadow:inset 2px 0 0 var(--borderColor-accent-emphasis)}.Box-row.navigation-focus .Box-row--drag-button{color:var(--fgColor-accent);cursor:grab;opacity:1}.Box-row.navigation-focus.is-dragging .Box-row--drag-button{cursor:grabbing}.Box-row.navigation-focus.sortable-chosen,.Box-row.navigation-focus.sortable-ghost{background-color:var(--bgColor-muted)}.Box-row.navigation-focus.sortable-ghost .Box-row--drag-hide{opacity:0}.Box-row--focus-gray.navigation-focus{background-color:var(--bgColor-muted)}.Box-row--focus-blue.navigation-focus{background-color:var(--bgColor-accent-muted)}.Box-row--hover-gray:hover{background-color:var(--bgColor-muted)}.Box-row--hover-blue:hover{background-color:var(--bgColor-accent-muted)}@media(min-width: 768px){.Box-row-link{color:var(--fgColor-default)}.Box-row-link,.Box-row-link:hover{-webkit-text-decoration:none;text-decoration:none}.Box-row-link:hover{color:var(--fgColor-accent)}}.Box-row--drag-button{opacity:0}.Box-footer{border-radius:0 0 var(--borderRadius-medium) var(--borderRadius-medium);border-top:var(--borderWidth-thin) solid var(--borderColor-default);margin-top:calc(var(--borderWidth-thin)*-1);padding:var(--stack-padding-normal)}.Box--scrollable{max-height:324px;overflow:scroll}.Box--blue,.Box--blue .Box-header{border-color:var(--borderColor-accent-muted)}.Box--blue .Box-header{background-color:var(--bgColor-accent-muted)}.Box--blue .Box-body,.Box--blue .Box-footer,.Box--blue .Box-row{border-color:var(--borderColor-accent-muted)}.Box--danger,:is(.Box--danger .Box-body):last-of-type,:is(.Box--danger .Box-row):first-of-type{border-color:var(--borderColor-danger-emphasis)}.Box-header--blue{background-color:var(--bgColor-accent-muted);border-color:var(--borderColor-accent-muted)}.Box-row--yellow{background-color:var(--bgColor-attention-muted)}.Box-row--blue{background-color:var(--bgColor-accent-muted)}.Box-row--gray{background-color:var(--bgColor-muted)}.Box-btn-octicon.btn-octicon{line-height:var(--text-title-lineHeight-large);margin:calc(var(--controlStack-small-gap-spacious)*-1);padding:var(--control-medium-paddingInline-spacious)}.blankslate-container{container-type:inline-size;width:100%}.blankslate{--blankslate-outer-padding-block:var(--base-size-32);--blankslate-outer-padding-inline:var(--base-size-32);padding:var(--blankslate-outer-padding-block) var(--blankslate-outer-padding-inline);position:relative;text-align:center}.blankslate p{color:var(--fgColor-muted);font-size:var(--text-body-size-large)}.blankslate code{background:var(--bgColor-default);border:var(--borderWidth-thin) solid var(--borderColor-muted);border-radius:var(--borderRadius-medium);font-size:var(--text-body-size-medium);padding:var(--base-size-2) var(--base-size-4) var(--base-size-4)}.blankslate img{height:56px;width:56px}.blankslate-icon{color:var(--fgColor-muted);margin-bottom:var(--stack-gap-condensed);margin-left:var(--control-small-gap);margin-right:var(--control-small-gap)}.blankslate-image{margin-bottom:var(--stack-gap-normal)}.blankslate-heading{font-size:var(--text-title-size-medium);font-weight:var(--text-title-weight-medium);margin-bottom:var(--base-size-4)}.blankslate-action{margin-top:var(--stack-gap-normal)}.blankslate-action:first-of-type{margin-top:var(--stack-gap-spacious)}.blankslate-action:last-of-type{margin-bottom:var(--stack-gap-condensed)}.blankslate-capped{border-radius:0 0 var(--borderRadius-medium) var(--borderRadius-medium)}.blankslate-spacious{--blankslate-outer-padding-block:var(--base-size-80);--blankslate-outer-padding-inline:var(--base-size-40)}.blankslate-narrow{margin:0 auto;max-width:485px}.blankslate-large img{height:80px;width:80px}.blankslate-large h3{font-size:24px;margin:var(--stack-gap-normal) 0}.blankslate-large p{font-size:var(--text-body-size-large)}.blankslate-clean-background{border:0}@container (max-width: 34rem){.blankslate{--blankslate-outer-padding-block:var(--base-size-20);--blankslate-outer-padding-inline:var(--base-size-20)}.blankslate-spacious{--blankslate-outer-padding-block:var(--base-size-44);--blankslate-outer-padding-inline:var(--base-size-28)}.blankslate-icon{margin-bottom:var(--stack-gap-condensed)}.blankslate-heading{font-size:var(--text-title-size-small)}.blankslate p{font-size:var(--text-body-size-medium)}.blankslate-action{margin-top:var(--stack-gap-condensed)}.blankslate-action:first-of-type{margin-top:var(--stack-gap-normal)}.blankslate-action:last-of-type{margin-bottom:calc(var(--stack-gap-condensed)/2)}}anchored-position[popover]{border-width:0;min-width:192px;overflow:visible;padding:0;position:absolute}anchored-position:not(.Overlay){background:none}.Overlay[popover]:not(:popover-open){display:none}anchored-position.not-anchored::backdrop,dialog::backdrop{background-color:var(--overlay-backdrop-bgColor, var(--color-neutral-muted))}select-panel dialog::backdrop{background:none}@media(forced-colors: active){.Overlay{outline:1px solid rgba(0,0,0,0)}}.breadcrumb-item{display:inline-block;list-style:none;max-width:100%}.breadcrumb-item:after{border-right:.1em solid var(--borderColor-neutral-emphasis);content:"";display:inline-block;height:.8em;margin:0 .15em 0 .5em;transform:rotate(15deg) translateY(0.0625em)}:is(.breadcrumb-item-selected,.breadcrumb-item[aria-current]:not([aria-current=false])):after{content:none}.breadcrumb-item-selected a{color:var(--fgColor-default);cursor:default !important;-webkit-text-decoration:none !important;text-decoration:none !important}:root{--duration-fast:80ms;--easing-easeInOut:cubic-bezier(0.65,0,0.35,1)}.Button{align-items:center;background-color:initial;border:var(--borderWidth-thin) solid;border-color:rgba(0,0,0,0);border-radius:var(--borderRadius-medium);color:var(--button-default-fgColor-rest);cursor:pointer;display:inline-flex;flex-direction:row;font-size:var(--text-body-size-medium);font-weight:var(--base-text-weight-medium);gap:var(--base-size-4);height:var(--control-medium-size);justify-content:space-between;min-width:max-content;padding:0 var(--control-medium-paddingInline-normal);position:relative;text-align:center;transition:var(--duration-fast) var(--easing-easeInOut);transition-property:color,fill,background-color,border-color;-webkit-user-select:none;user-select:none}@media(pointer: coarse){:is(.Button:before){content:"";height:100%;left:50%;min-height:48px;min-width:48px;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}}.Button:hover{transition-duration:var(--duration-fast)}.Button:active{transition:none}.Button:disabled,.Button[aria-disabled=true]{box-shadow:none;cursor:not-allowed}.Button.Button--iconOnly{color:var(--fgColor-muted)}:is(a.Button,summary.Button):hover{-webkit-text-decoration:none;text-decoration:none}.Button-content{align-items:center;display:grid;flex:1 0 auto;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0, auto) min-content;place-content:center}.Button-content>:not(:last-child){margin-right:var(--control-medium-gap)}.Button-content--alignStart{justify-content:start}.Button-visual{display:flex;pointer-events:none}.Button-visual .Counter{background-color:var(--buttonCounter-default-bgColor-rest);color:inherit}.Button-label{grid-area:text;line-height:var(--text-body-lineHeight-medium);white-space:nowrap}.Button-leadingVisual{grid-area:leadingVisual}.Button-leadingVisual svg{fill:currentcolor}.Button-trailingVisual{grid-area:trailingVisual}.Button-trailingAction{margin-right:calc(var(--base-size-4)*-1)}.Button--small{font-size:var(--text-body-size-small);gap:var(--control-small-gap);height:var(--control-small-size);min-width:var(--control-small-size);padding:0 var(--control-small-paddingInline-condensed)}.Button--small .Button-label{line-height:var(--text-body-lineHeight-small)}:is(.Button--small .Button-content)>:not(:last-child){margin-right:var(--control-small-gap)}.Button--large{gap:var(--control-large-gap);height:var(--control-large-size);padding:0 var(--control-large-paddingInline-spacious)}.Button--large .Button-label{line-height:var(--text-body-lineHeight-large)}:is(.Button--large .Button-content)>:not(:last-child){margin-right:var(--control-large-gap)}.Button--fullWidth{width:100%}.Button--labelWrap{height:unset;min-height:var(--control-medium-size);min-width:-moz-fit-content;min-width:fit-content}.Button--labelWrap .Button-content{align-self:stretch;flex:1 1 auto;padding-block:calc(var(--control-medium-paddingBlock) - var(--base-size-2))}.Button--labelWrap .Button-label{white-space:unset}.Button--labelWrap.Button--small{height:unset;min-height:var(--control-small-size)}.Button--labelWrap.Button--small .Button-content{padding-block:calc(var(--control-small-paddingBlock) - var(--base-size-2))}.Button--labelWrap.Button--large{height:unset;min-height:var(--control-large-size);padding-inline:var(--control-large-paddingInline-spacious)}.Button--labelWrap.Button--large .Button-content{padding-block:calc(var(--control-large-paddingBlock) - var(--base-size-2))}.Button--primary{background-color:var(--button-primary-bgColor-rest);border-color:var(--button-primary-borderColor-rest);box-shadow:var(--shadow-resting-small, var(--color-btn-primary-shadow));color:var(--button-primary-fgColor-rest);fill:var(--button-primary-iconColor-rest)}.Button--primary.Button--iconOnly{color:var(--button-primary-iconColor-rest)}.Button--primary:hover:not(:disabled,.Button--inactive){background-color:var(--button-primary-bgColor-hover);border-color:var(--button-primary-borderColor-hover)}.Button--primary:focus{box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis);outline:2px solid var(--focus-outlineColor);outline-offset:-2px}.Button--primary:focus:not(:focus-visible){box-shadow:none;outline:1px solid rgba(0,0,0,0)}.Button--primary:focus-visible{box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis);outline:2px solid var(--focus-outlineColor);outline-offset:-2px}.Button--primary:active:not(:disabled),.Button--primary[aria-pressed=true]{background-color:var(--button-primary-bgColor-active);box-shadow:var(--button-primary-shadow-selected)}.Button--primary:disabled,.Button--primary[aria-disabled=true]{background-color:var(--button-primary-bgColor-disabled);border-color:var(--button-primary-borderColor-disabled);color:var(--button-primary-fgColor-disabled);fill:var(--button-primary-fgColor-disabled)}.Button--primary .Counter{background-color:var(--buttonCounter-primary-bgColor-rest);color:inherit}.Button--secondary{background-color:var(--button-default-bgColor-rest);border-color:var(--button-default-borderColor-rest);box-shadow:var(--button-default-shadow-resting),var(--button-default-shadow-inset);color:var(--button-default-fgColor-rest);fill:var(--fgColor-muted)}.Button--secondary:hover:not(:disabled,.Button--inactive){background-color:var(--button-default-bgColor-hover);border-color:var(--button-default-borderColor-hover)}.Button--secondary:active:not(:disabled){background-color:var(--button-default-bgColor-active);border-color:var(--button-default-borderColor-active)}.Button--secondary[aria-pressed=true]{background-color:var(--button-default-bgColor-selected);box-shadow:var(--shadow-inset)}.Button--secondary:disabled,.Button--secondary[aria-disabled=true]{background-color:var(--button-default-bgColor-disabled);border-color:var(--button-default-borderColor-disabled);color:var(--control-fgColor-disabled);fill:var(--control-fgColor-disabled)}.Button--invisible{color:var(--button-invisible-fgColor-rest)}.Button--invisible.Button--iconOnly{color:var(--button-invisible-iconColor-rest, var(--color-fg-muted))}.Button--invisible:hover:not(:disabled,.Button--inactive){background-color:var(--control-transparent-bgColor-hover, var(--color-action-list-item-default-hover-bg))}.Button--invisible:active:not(:disabled),.Button--invisible[aria-pressed=true]{background-color:var(--button-invisible-bgColor-active)}.Button--invisible:disabled,.Button--invisible[aria-disabled=true]{background-color:var(--button-invisible-bgColor-disabled);border-color:var(--button-invisible-borderColor-disabled);color:var(--button-invisible-fgColor-disabled);fill:var(--button-invisible-fgColor-disabled)}.Button--invisible.Button--invisible-noVisuals .Button-label{color:var(--button-invisible-fgColor-rest)}.Button--invisible .Button-visual{color:var(--button-invisible-iconColor-rest, var(--color-fg-muted))}:is(.Button--invisible .Button-visual) .Counter{color:var(--fgColor-default)}.Button--link{border:none;color:var(--fgColor-link);display:inline-block;fill:var(--fgColor-link);font-size:inherit;height:unset;min-width:-moz-fit-content;min-width:fit-content;padding:0}.Button--link:hover:not(:disabled,.Button--inactive){-webkit-text-decoration:underline;text-decoration:underline}.Button--link:focus,.Button--link:focus-visible{outline-offset:2px}.Button--link:disabled,.Button--link[aria-disabled=true]{background-color:initial;border-color:rgba(0,0,0,0);color:var(--control-fgColor-disabled);fill:var(--control-fgColor-disabled)}.Button--link .Button-label{white-space:unset}.Button--danger{background-color:var(--button-danger-bgColor-rest);border-color:var(--button-danger-borderColor-rest);box-shadow:var(--button-default-shadow-resting),var(--button-default-shadow-inset);color:var(--button-danger-fgColor-rest);fill:var(--button-danger-iconColor-rest)}.Button--danger.Button--iconOnly{color:var(--button-danger-iconColor-rest)}.Button--danger:hover:not(:disabled,.Button--inactive){background-color:var(--button-danger-bgColor-hover);border-color:var(--button-danger-borderColor-hover);box-shadow:var(--shadow-resting-small);color:var(--button-danger-fgColor-hover);fill:var(--button-danger-fgColor-hover)}.Button--danger:hover:not(:disabled,.Button--inactive) .Counter{background-color:var(--buttonCounter-danger-bgColor-hover);color:var(--buttonCounter-danger-fgColor-hover)}.Button--danger:active:not(:disabled),.Button--danger[aria-pressed=true]{background-color:var(--button-danger-bgColor-active);border-color:var(--button-danger-borderColor-active);box-shadow:var(--button-danger-shadow-selected);color:var(--button-danger-fgColor-active);fill:var(--button-danger-fgColor-active)}.Button--danger:disabled,.Button--danger[aria-disabled=true]{background-color:var(--button-danger-bgColor-disabled);border-color:var(--button-default-borderColor-disabled);color:var(--button-danger-fgColor-disabled);fill:var(--button-danger-fgColor-disabled)}:is(.Button--danger:disabled,.Button--danger[aria-disabled=true]) .Counter{background-color:var(--buttonCounter-danger-bgColor-disabled);color:var(--buttonCounter-danger-fgColor-disabled)}.Button--danger .Counter{background-color:var(--buttonCounter-danger-bgColor-rest);color:var(--buttonCounter-danger-fgColor-rest)}.Button--iconOnly{display:inline-grid;padding:unset;place-content:center;width:var(--control-medium-size)}.Button--iconOnly.Button--small{width:var(--control-small-size)}.Button--iconOnly.Button--large{width:var(--control-large-size)}.Button--inactive:not([aria-disabled=true],:disabled){background-color:var(--button-inactive-bgColor);border:0;color:var(--button-inactive-fgColor);cursor:default}.ButtonGroup{display:inline-flex}.ButtonGroup .Button{border-radius:0;margin-inline-end:-1px;position:relative}:is(.ButtonGroup .Button):active,:is(.ButtonGroup .Button):focus,:is(.ButtonGroup .Button):hover{z-index:1}.ButtonGroup>:first-child .Button{border-bottom-left-radius:var(--borderRadius-medium);border-top-left-radius:var(--borderRadius-medium)}.ButtonGroup>:last-child .Button{border-bottom-right-radius:var(--borderRadius-medium);border-top-right-radius:var(--borderRadius-medium)}.Counter{background-color:var(--bgColor-neutral-muted, var(--color-neutral-muted));border:var(--borderWidth-thin) solid var(--counter-borderColor);border-radius:2em;color:var(--fgColor-default);display:inline-block;font-size:var(--text-body-size-small);font-weight:var(--base-text-weight-medium);line-height:calc(var(--base-size-20) - var(--borderWidth-thin)*2);min-width:var(--base-size-20);padding:0 var(--base-size-6);text-align:center}.Counter:empty{display:none}.Counter .octicon{opacity:.8;vertical-align:text-top}.Counter--primary{background-color:var(--bgColor-neutral-emphasis);color:var(--fgColor-onEmphasis)}.Counter--secondary{background-color:var(--bgColor-neutral-muted);color:var(--fgColor-muted)}.flash:not(.Banner){background-image:linear-gradient(var(--bgColor-accent-muted), var(--bgColor-accent-muted));border-color:var(--borderColor-accent-muted);border-radius:var(--borderRadius-medium);border-style:solid;border-width:var(--borderWidth-thin);color:var(--fgColor-default);padding:var(--base-size-20) var(--control-medium-paddingInline-spacious);position:relative}.flash:not(.Banner) .octicon{color:var(--fgColor-accent);margin-right:var(--base-size-12)}.flash:not(.Banner) p:last-child{margin-bottom:0}.flash-messages{margin-bottom:var(--stack-gap-spacious)}.flash-close:not(.Banner-close){appearance:none;background:none;border:0;cursor:pointer;float:right;margin-top:calc(var(--base-size-4)*-1);text-align:center}.flash-close:not(.Banner-close):hover{opacity:.7}.flash-close:not(.Banner-close):active{opacity:.5}.flash-close:not(.Banner-close) .octicon{margin-right:0}.flash-action:not(.Banner-actions){background-clip:padding-box;float:right;margin-left:var(--stack-gap-spacious);margin-top:-3px}.flash-action.btn:not(.Banner-actions) .octicon{color:var(--fgColor-muted);margin-right:var(--control-small-gap)}.flash-action.btn-primary:not(.Banner-actions){background-clip:initial}.flash-action.btn-primary:not(.Banner-actions) .octicon{color:inherit}.flash-warn:not(.Banner){background-image:linear-gradient(var(--bgColor-attention-muted), var(--bgColor-attention-muted));border-color:var(--borderColor-attention-muted);color:var(--fgColor-default)}.flash-warn:not(.Banner) .octicon{color:var(--fgColor-attention)}.flash-error:not(.Banner){background-image:linear-gradient(var(--bgColor-danger-muted), var(--bgColor-danger-muted));border-color:var(--borderColor-danger-muted);color:var(--fgColor-default)}.flash-error:not(.Banner) .octicon{color:var(--fgColor-danger)}.flash-success:not(.Banner){background-image:linear-gradient(var(--bgColor-success-muted), var(--bgColor-success-muted));border-color:var(--borderColor-success-muted);color:var(--fgColor-default)}.flash-success:not(.Banner) .octicon{color:var(--fgColor-success)}.flash-full:not(.Banner){border-radius:0;border-width:var(--borderWidth-thin) 0;margin-top:calc(var(--borderWidth-thin)*-1)}.flash-banner{border-left:0;border-radius:0;border-right:0;border-top:0;position:fixed;top:0;width:100%;z-index:90}.flash-banner,.flash-full{background-color:var(--bgColor-default)}.warning{background-color:var(--bgColor-attention-muted);font-weight:var(--base-text-weight-semibold);margin-bottom:.8em;padding:.5em}.labels{position:relative}.Label,.label{border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-full);display:inline-block;font-size:var(--text-body-size-small);font-weight:var(--base-text-weight-medium);line-height:18px;padding:0 var(--base-size-6);white-space:nowrap}:is(.label,.Label):hover{-webkit-text-decoration:none;text-decoration:none}.Label--large{line-height:22px;padding:0 var(--base-size-8)}.Label--inline{display:inline;font-size:85%;padding:.12em .5em}.Label--primary{border-color:var(--borderColor-neutral-emphasis);color:var(--fgColor-default)}.Label--secondary{border-color:var(--borderColor-default);color:var(--fgColor-muted)}.Label--accent,.Label--info{border-color:var(--borderColor-accent-emphasis);color:var(--fgColor-accent)}.Label--success{border-color:var(--borderColor-success-emphasis);color:var(--fgColor-success)}.Label--attention,.Label--warning{border-color:var(--borderColor-attention-emphasis);color:var(--fgColor-attention)}.Label--severe{border-color:var(--borderColor-severe-emphasis);color:var(--fgColor-severe)}.Label--danger{border-color:var(--borderColor-danger-emphasis);color:var(--fgColor-danger)}.Label--open{border-color:var(--borderColor-open-emphasis);color:var(--fgColor-open)}.Label--closed{border-color:var(--borderColor-closed-emphasis);color:var(--fgColor-closed)}.Label--done{border-color:var(--borderColor-done-emphasis);color:var(--fgColor-done)}.Label--sponsors{border-color:var(--borderColor-sponsors-emphasis);color:var(--fgColor-sponsors)}.Link{color:var(--fgColor-accent);-webkit-text-decoration:none;text-decoration:none}.Link:hover{cursor:pointer}.Link:focus,.Link:hover{-webkit-text-decoration:underline;text-decoration:underline}.Link:focus,.Link:focus-visible{outline-offset:0}.Link--underline{-webkit-text-decoration:underline;text-decoration:underline}.Link--primary{color:var(--fgColor-default) !important}.Link--primary:hover{color:var(--fgColor-accent) !important}.Link--secondary{color:var(--fgColor-muted) !important}.Link--secondary:hover{color:var(--fgColor-accent) !important}.Link--muted{color:var(--fgColor-muted) !important}.Link--muted:hover{color:var(--fgColor-accent) !important;-webkit-text-decoration:none;text-decoration:none}.Link--onHover:hover{color:var(--fgColor-accent) !important;cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline}:is(.Link--secondary,.Link--primary,.Link--muted):hover [class*=color-fg]{color:inherit !important}.Link-content{align-items:center;display:inline-flex;gap:var(--base-size-4);line-height:normal;text-decoration:inherit}.Popover{position:absolute;z-index:100}.Popover-message{background-color:var(--overlay-bgColor);border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-medium);box-shadow:var(--shadow-floating-legacy, var(--color-shadow-large)) !important;margin-left:auto;margin-right:auto;position:relative;width:232px}.Popover-message:after,.Popover-message:before{content:"";display:inline-block;left:50%;position:absolute}.Popover-message:before{border:8px solid rgba(0,0,0,0);border-bottom:8px solid var(--borderColor-default);margin-left:-9px;top:-16px}.Popover-message:after{border:7px solid rgba(0,0,0,0);border-bottom:7px solid var(--overlay-bgColor);margin-left:-8px;top:-14px}.Popover-message--no-caret:after,.Popover-message--no-caret:before{display:none}:is(.Popover-message--bottom,.Popover-message--bottom-right,.Popover-message--bottom-left):after,:is(.Popover-message--bottom,.Popover-message--bottom-right,.Popover-message--bottom-left):before{border-bottom-color:rgba(0,0,0,0);top:auto}:is(.Popover-message--bottom,.Popover-message--bottom-right,.Popover-message--bottom-left):before{border-top-color:var(--borderColor-default);bottom:-16px}:is(.Popover-message--bottom,.Popover-message--bottom-right,.Popover-message--bottom-left):after{border-top-color:var(--overlay-bgColor);bottom:-14px}.Popover-message--bottom-right,.Popover-message--top-right{margin-right:0;right:-9px}:is(.Popover-message--top-right,.Popover-message--bottom-right):after,:is(.Popover-message--top-right,.Popover-message--bottom-right):before{left:auto;margin-left:0}:is(.Popover-message--top-right,.Popover-message--bottom-right):before{right:var(--base-size-20)}:is(.Popover-message--top-right,.Popover-message--bottom-right):after{margin-right:1px;right:var(--base-size-20)}.Popover-message--bottom-left,.Popover-message--top-left{left:-9px;margin-left:0}:is(.Popover-message--top-left,.Popover-message--bottom-left):after,:is(.Popover-message--top-left,.Popover-message--bottom-left):before{left:var(--base-size-24);margin-left:0}:is(.Popover-message--top-left,.Popover-message--bottom-left):after{left:var(--base-size-24);margin-left:1px}:is(.Popover-message--right,.Popover-message--right-top,.Popover-message--right-bottom,.Popover-message--left,.Popover-message--left-top,.Popover-message--left-bottom):after,:is(.Popover-message--right,.Popover-message--right-top,.Popover-message--right-bottom,.Popover-message--left,.Popover-message--left-top,.Popover-message--left-bottom):before{border-bottom-color:rgba(0,0,0,0);left:auto;margin-left:0;top:50%}:is(.Popover-message--right,.Popover-message--right-top,.Popover-message--right-bottom,.Popover-message--left,.Popover-message--left-top,.Popover-message--left-bottom):before{margin-top:-9px}:is(.Popover-message--right,.Popover-message--right-top,.Popover-message--right-bottom,.Popover-message--left,.Popover-message--left-top,.Popover-message--left-bottom):after{margin-top:-8px}:is(.Popover-message--right,.Popover-message--right-top,.Popover-message--right-bottom):before{border-left-color:var(--borderColor-default);right:-16px}:is(.Popover-message--right,.Popover-message--right-top,.Popover-message--right-bottom):after{border-left-color:var(--overlay-bgColor);right:-14px}:is(.Popover-message--left,.Popover-message--left-top,.Popover-message--left-bottom):before{border-right-color:var(--borderColor-default);left:-16px}:is(.Popover-message--left,.Popover-message--left-top,.Popover-message--left-bottom):after{border-right-color:var(--overlay-bgColor);left:-14px;margin-bottom:1px}:is(.Popover-message--right-top,.Popover-message--left-top):after,:is(.Popover-message--right-top,.Popover-message--left-top):before{top:var(--base-size-24)}:is(.Popover-message--right-bottom,.Popover-message--left-bottom):after,:is(.Popover-message--right-bottom,.Popover-message--left-bottom):before{top:auto}:is(.Popover-message--right-bottom,.Popover-message--left-bottom):before{bottom:var(--base-size-16)}:is(.Popover-message--right-bottom,.Popover-message--left-bottom):after{bottom:var(--base-size-16);margin-bottom:1px}@media(min-width: 544px){.Popover-message--large{min-width:320px}}@media(max-width: 767.98px){.Popover{bottom:0 !important;left:0 !important;position:fixed;right:0 !important;top:auto !important}.Popover-message{bottom:auto;left:auto;margin:var(--stack-gap-condensed);right:auto;top:auto;width:auto !important}.Popover-message>.btn-octicon{padding:var(--control-medium-paddingInline-normal) !important}.Popover-message:after,.Popover-message:before{display:none}}.Progress{background-color:var(--progressBar-track-bgColor);border-radius:var(--borderRadius-medium);display:flex;height:8px;outline:solid 1px var(--progressBar-track-borderColor);outline-offset:-1px;overflow:hidden}.Progress--large{height:10px}.Progress--small{height:5px}.Progress-item{background:LinkText;outline:2px solid rgba(0,0,0,0)}.Progress-item+.Progress-item{margin-left:var(--base-size-2)}@media(forced-colors: active){:root{--progressBar-track-bgColor:CanvasText}.Progress,.Progress-item{forced-color-adjust:none}}.State,.state{border-radius:2em;display:inline-block;font-size:var(--text-body-size-medium);font-weight:var(--base-text-weight-medium);line-height:var(--control-medium-lineBoxHeight);padding:var(--base-size-4) var(--control-medium-paddingInline-normal);text-align:center;white-space:nowrap}.State,.State--draft,.state{background-color:var(--bgColor-draft-emphasis, var(--bgColor-neutral-emphasis));border:var(--borderWidth-thin) solid rgba(0,0,0,0);box-shadow:var(--boxShadow-thin) var(--borderColor-draft-emphasis, var(--borderColor-neutral-emphasis));color:var(--fgColor-onEmphasis)}.State--open{background-color:var(--bgColor-open-emphasis, var(--color-open-emphasis));box-shadow:var(--boxShadow-thin) var(--borderColor-open-emphasis)}.State--merged,.State--open{color:var(--fgColor-onEmphasis)}.State--merged{background-color:var(--bgColor-done-emphasis, var(--color-done-emphasis));box-shadow:var(--boxShadow-thin) var(--borderColor-done-emphasis)}.State--closed{background-color:var(--bgColor-closed-emphasis, var(--color-closed-emphasis));box-shadow:var(--boxShadow-thin) var(--borderColor-closed-emphasis);color:var(--fgColor-onEmphasis)}.State--small{font-size:var(--text-body-size-small);line-height:var(--base-size-24);padding:0 10px}.State--small .octicon{width:1em}.Subhead{border-bottom:var(--borderWidth-thin) solid var(--borderColor-muted);display:flex;flex-flow:row wrap;justify-content:flex-end;margin-bottom:var(--stack-gap-normal);padding-bottom:var(--stack-padding-condensed)}.Subhead--spacious{margin-top:var(--base-size-40)}.Subhead-heading{flex:1 1 auto;font-weight:var(--base-text-weight-normal);order:0}.Subhead-heading--large{font-size:var(--base-size-24)}.Subhead-heading--medium{font-size:var(--text-title-size-medium)}.Subhead-heading--danger{color:var(--fgColor-danger);font-weight:var(--base-text-weight-semibold)}.Subhead-description{color:var(--fgColor-muted);flex:1 100%;font-size:var(--text-body-size-medium);order:2}.Subhead-actions{align-self:center;justify-content:flex-end;margin:var(--base-size-4) 0 var(--base-size-4) var(--base-size-4);order:1}.Subhead-actions+.Subhead-description{margin-top:var(--base-size-4)}.Truncate{display:inline-flex;max-width:100%;min-width:0}.Truncate>.Truncate-text{max-width:-moz-fit-content;max-width:fit-content;min-width:1ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:is(.Truncate>.Truncate-text)+.Truncate-text{margin-left:var(--control-small-gap)}.Truncate-text--primary:is(.Truncate>.Truncate-text){flex-basis:200%}.Truncate-text--expandable:is(.Truncate>.Truncate-text):active,.Truncate-text--expandable:is(.Truncate>.Truncate-text):focus,.Truncate-text--expandable:is(.Truncate>.Truncate-text):hover{cursor:pointer;flex-shrink:0;max-width:100% !important}.TimelineItem{display:flex;margin-left:var(--stack-gap-normal);padding:var(--stack-padding-normal) 0;position:relative}.TimelineItem:before{background-color:var(--borderColor-muted);bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:var(--borderWidth-thick)}.TimelineItem:target .TimelineItem-badge{border-color:var(--borderColor-accent-emphasis);box-shadow:0 0 .2em var(--borderColor-accent-muted)}.TimelineItem-badge{align-items:center;background-color:var(--timelineBadge-bgColor);border:var(--borderWidth-thick) solid var(--bgColor-default);border-radius:50%;color:var(--fgColor-muted);display:flex;flex-shrink:0;height:var(--control-medium-size);justify-content:center;margin-left:calc(var(--control-medium-size)/-2 + 1px);margin-right:var(--controlStack-medium-gap-condensed);position:relative;width:var(--control-medium-size);z-index:1}.TimelineItem-badge--success{background-color:var(--bgColor-success-emphasis);border:var(--borderWidth-thin) solid rgba(0,0,0,0);color:var(--fgColor-onEmphasis)}.TimelineItem-body{color:var(--fgColor-muted);flex:auto;margin-top:var(--base-size-4);max-width:100%;min-width:0}.TimelineItem-avatar{left:-72px;position:absolute;z-index:1}.TimelineItem-break{background-color:var(--bgColor-default);border:0;border-top:var(--borderWidth-thicker) solid var(--borderColor-default);height:var(--stack-gap-spacious);margin:0;margin-bottom:calc(var(--stack-gap-normal)*-1);margin-left:-56px;position:relative;z-index:1}.TimelineItem--condensed{padding-bottom:0;padding-top:var(--base-size-4)}.TimelineItem--condensed:last-child{padding-bottom:var(--stack-gap-normal)}.TimelineItem--condensed .TimelineItem-badge{background-color:var(--bgColor-default);border:0;color:var(--fgColor-muted);height:var(--base-size-16);margin-bottom:var(--base-size-8);margin-top:var(--base-size-8)}.css-truncate .css-truncate-overflow,.css-truncate .css-truncate-target,.css-truncate.css-truncate-overflow,.css-truncate.css-truncate-target{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.css-truncate .css-truncate-target,.css-truncate.css-truncate-target{display:inline-block;max-width:125px;vertical-align:top}.css-truncate.expandable.css-truncate-target:hover,.css-truncate.expandable.zeroclipboard-is-hover .css-truncate-target,.css-truncate.expandable.zeroclipboard-is-hover.css-truncate-target,.css-truncate.expandable:hover .css-truncate-target{max-width:10000px !important}.ActionBar{align-items:center;box-sizing:initial;display:flex !important;flex-grow:1;flex-shrink:1;justify-content:flex-end;min-width:calc(var(--control-medium-size)*3);overflow:hidden;position:relative}.ActionBar-item-container{box-sizing:initial;height:var(--control-medium-size);overflow:hidden}.ActionBar-item{float:left;position:relative}.ActionBar-more-menu{float:left}.ActionBar--small{min-width:calc(var(--control-small-size)*3)}.ActionBar--large{min-width:calc(var(--control-large-size)*3)}.ActionBar-divider{border-left:var(--borderWidth-thin) solid var(--borderColor-muted);bottom:50%;float:left;height:calc(var(--control-medium-size)/2);margin:0 var(--controlStack-medium-gap-condensed);top:50%;transform:translateY(-50%)}.ActionBar--small .ActionBar-divider{margin:0 var(--controlStack-small-gap-condensed)}.ActionBar--large .ActionBar-divider{margin:0 var(--controlStack-large-gap-condensed)}.OrderedList{margin:var(--base-size-8)}.OrderedList-type--decimal{list-style-type:decimal}.OrderedList-type--upperAlpha{list-style-type:upper-alpha}.OrderedList-type--lowerAlpha{list-style-type:lower-alpha}.OrderedList-type--upperRoman{list-style-type:upper-roman}.OrderedList-type--lowerRoman{list-style-type:lower-roman}.UnorderedList{margin:var(--base-size-8)} +/*# sourceMappingURL=index.scss.map */ + +/*# sourceMappingURL=primer-6db7cb3f513c.css.map*/ \ No newline at end of file diff --git a/primer-react.4e7455f297b9951a53ae.module.css b/primer-react.4e7455f297b9951a53ae.module.css new file mode 100644 index 0000000..b7c2d34 --- /dev/null +++ b/primer-react.4e7455f297b9951a53ae.module.css @@ -0,0 +1,3 @@ +@layer primer-react{.prc-src-InternalVisuallyHidden-2YaI6{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.prc-components-Chord-DdhWN{border:var(--borderWidth-thin,.0625rem) solid;border-radius:var(--borderRadius-default,.375rem);box-shadow:none;display:inline-flex;font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);gap:.5ch;justify-content:center;line-height:10px;overflow:hidden;padding:var(--base-size-4,.25rem);vertical-align:initial}.prc-components-ChordNormal-Ov9XG{background:var(--bgColor-transparent,#0000);border-color:var(--borderColor-default,var(--color-border-default));color:var(--fgColor-muted,var(--color-fg-muted))}.prc-components-ChordOnEmphasis-O-4BS{background:var(--counter-bgColor-emphasis,#59636e)}.prc-components-ChordOnEmphasis-O-4BS,.prc-components-ChordOnPrimary-J2XUj{border-color:#0000;color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-components-ChordOnPrimary-J2XUj{background:var(--button-primary-bgColor-active,var(--color-btn-primary-selected-bg))}.prc-components-ChordSmall-c-P-x{border-radius:var(--borderRadius-small,.1875rem);font-size:11px;line-height:var(--base-size-8,.5rem);min-width:var(--base-size-16,1rem);padding:var(--base-size-2,.125rem)}.prc-components-ChordNormal-Ov9XG:not(.prc-components-ChordSmall-c-P-x){border-radius:var(--borderRadius-medium,.375rem);font-size:var(--text-body-size-small,.75rem);line-height:10px;min-width:var(--base-size-20,1.25rem);padding:var(--base-size-4,.25rem)}}@layer primer-react{}@layer primer-react{.prc-Text-Text-9mHv3:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);line-height:var(--text-body-lineHeight-small,1.66667)}.prc-Text-Text-9mHv3:where([data-size=medium]){font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-body-lineHeight-medium,1.42857)}.prc-Text-Text-9mHv3:where([data-size=large]){font-size:var(--text-body-size-large,1rem);line-height:var(--text-body-lineHeight-large,1.5)}.prc-Text-Text-9mHv3:where([data-weight=light]){font-weight:var(--base-text-weight-light,300)}.prc-Text-Text-9mHv3:where([data-weight=normal]){font-weight:var(--base-text-weight-normal,400)}.prc-Text-Text-9mHv3:where([data-weight=medium]){font-weight:var(--base-text-weight-medium,500)}.prc-Text-Text-9mHv3:where([data-weight=semibold]){font-weight:var(--base-text-weight-semibold,600)}}@layer primer-react{.prc-KeybindingHint-KeybindingHint-qpYIs{background:none;border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:unset;overflow:visible;padding:0;position:relative;vertical-align:initial;white-space:nowrap}.prc-Button-ButtonBase-9n-Xk{align-items:center;appearance:none;background-color:initial;border:var(--borderWidth-thin,.0625rem) solid;border-color:var(--button-default-borderColor-rest,var(--color-btn-border));border-radius:var(--borderRadius-medium,.375rem);color:var(--button-default-fgColor-rest,var(--color-btn-text));cursor:pointer;display:flex;font-family:inherit;font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-medium,500);gap:var(--base-size-8,.5rem);height:var(--control-medium-size,2rem);justify-content:space-between;min-width:max-content;padding:0 var(--control-medium-paddingInline-normal,.75rem);text-align:center;-webkit-text-decoration:none;text-decoration:none;transition:80ms cubic-bezier(.65,0,.35,1);transition-property:color,fill,background-color,border-color;-webkit-user-select:none;user-select:none}.prc-Button-ButtonBase-9n-Xk:has([data-kbd-chord]){padding-inline-end:var(--base-size-6,.375rem)}.prc-Button-ButtonBase-9n-Xk:hover{transition-duration:80ms}.prc-Button-ButtonBase-9n-Xk:focus-visible{box-shadow:none;outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:-2px}.prc-Button-ButtonBase-9n-Xk:active{transition:none}.prc-Button-ButtonBase-9n-Xk:disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:not([data-loading=true]){box-shadow:none;cursor:not-allowed}:is(.prc-Button-ButtonBase-9n-Xk:disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:not([data-loading=true])) .prc-Button-CounterLabel-5hAs4,:is(.prc-Button-ButtonBase-9n-Xk:disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:not([data-loading=true])) .prc-Button-Visual-YNt2F{color:inherit}}@layer primer-react{@media (forced-colors:active){.prc-Button-ButtonBase-9n-Xk:focus{outline:1px solid #0000}}.prc-Button-ButtonBase-9n-Xk :where(.prc-Button-Visual-YNt2F){color:var(--fgColor-muted,var(--color-fg-muted));display:flex;pointer-events:none}.prc-Button-ButtonBase-9n-Xk :where(.prc-Button-VisualWrap-E4cnq){display:flex;pointer-events:none}.prc-Button-ButtonBase-9n-Xk:where(.prc-Button-IconButton-fyge7){display:inline-grid;flex-shrink:0;min-width:unset;padding:unset;place-content:center;width:var(--control-medium-size,2rem)}.prc-Button-ButtonBase-9n-Xk:where(.prc-Button-IconButton-fyge7):where([data-size=small]){width:var(--control-small-size,1.75rem)}.prc-Button-ButtonBase-9n-Xk:where(.prc-Button-IconButton-fyge7):where([data-size=large]){width:var(--control-large-size,2.5rem)}.prc-Button-ButtonBase-9n-Xk:where([href]){display:inline-flex}.prc-Button-ButtonBase-9n-Xk:where([href]):hover{-webkit-text-decoration:none;text-decoration:none}.prc-Button-ButtonBase-9n-Xk :where(.prc-Button-ButtonContent-Iohp5){align-content:center;align-items:center;display:grid;flex:1 0 auto;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0,auto) min-content}:is(.prc-Button-ButtonBase-9n-Xk :where(.prc-Button-ButtonContent-Iohp5))>:not(:last-child){margin-right:var(--base-size-8,.5rem)}:is(.prc-Button-ButtonBase-9n-Xk :where(.prc-Button-ButtonContent-Iohp5)):where([data-align=center]){justify-content:center}:is(.prc-Button-ButtonBase-9n-Xk :where(.prc-Button-ButtonContent-Iohp5)):where([data-align=start]){justify-content:flex-start}.prc-Button-ButtonBase-9n-Xk :where([data-component=leadingVisual]){grid-area:leadingVisual}.prc-Button-ButtonBase-9n-Xk :where(.prc-Button-Label-FWkx3){grid-area:text;line-height:var(--text-body-lineHeight-medium,1.42857);white-space:nowrap}.prc-Button-ButtonBase-9n-Xk :where([data-component=trailingVisual]){grid-area:trailingVisual}.prc-Button-ButtonBase-9n-Xk :where([data-component=trailingAction]){margin-right:calc(var(--base-size-4,.25rem)*-1)}.prc-Button-ButtonBase-9n-Xk:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);gap:var(--control-small-gap,.25rem);height:var(--control-small-size,1.75rem);padding:0 var(--control-small-paddingInline-condensed,.5rem)}.prc-Button-ButtonBase-9n-Xk:where([data-size=small]) .prc-Button-ButtonContent-Iohp5>:not(:last-child){margin-right:var(--control-small-gap,.25rem)}.prc-Button-ButtonBase-9n-Xk:where([data-size=small]) .prc-Button-Label-FWkx3{line-height:var(--text-body-lineHeight-small,1.66667)}.prc-Button-ButtonBase-9n-Xk:where([data-size=large]){gap:var(--control-large-gap,.5rem);height:var(--control-large-size,2.5rem);padding:0 var(--control-large-paddingInline-spacious,1rem)}.prc-Button-ButtonBase-9n-Xk:where([data-size=large]) .prc-Button-ButtonContent-Iohp5>:not(:last-child){margin-right:var(--control-large-gap,.5rem)}.prc-Button-ButtonBase-9n-Xk:where([data-size=large]):has([data-kbd-chord]){padding-inline-end:var(--base-size-8,.5rem)}.prc-Button-ButtonBase-9n-Xk:where([data-block=block]){width:100%}.prc-Button-ButtonBase-9n-Xk:where([data-label-wrap=true]){height:unset;min-height:var(--control-medium-size,2rem);min-width:-moz-fit-content;min-width:fit-content}.prc-Button-ButtonBase-9n-Xk:where([data-label-wrap=true]) .prc-Button-ButtonContent-Iohp5{align-self:stretch;flex:1 1 auto;padding-block:calc(var(--control-medium-paddingBlock,.375rem) - var(--base-size-2,.125rem))}.prc-Button-ButtonBase-9n-Xk:where([data-label-wrap=true]) .prc-Button-Label-FWkx3{white-space:unset;word-break:break-word}.prc-Button-ButtonBase-9n-Xk:where([data-label-wrap=true]):where([data-size=small]){height:unset;min-height:var(--control-small-size,1.75rem)}.prc-Button-ButtonBase-9n-Xk:where([data-label-wrap=true]):where([data-size=small]) .prc-Button-ButtonContent-Iohp5{padding-block:calc(var(--control-small-paddingBlock,.25rem) - var(--base-size-2,.125rem))}.prc-Button-ButtonBase-9n-Xk:where([data-label-wrap=true]):where([data-size=large]){height:unset;min-height:var(--control-large-size,2.5rem);padding-inline:var(--control-large-paddingInline-spacious,1rem)}.prc-Button-ButtonBase-9n-Xk:where([data-label-wrap=true]):where([data-size=large]) .prc-Button-ButtonContent-Iohp5{padding-block:calc(var(--control-large-paddingBlock,.625rem) - var(--base-size-2,.125rem))}.prc-Button-ButtonBase-9n-Xk:where([data-loading=true]) .prc-Button-LoadingSpinner-6KfaT:not([data-component=leadingVisual],[data-component=trailingVisual],[data-component=trailingAction]){grid-area:text;margin-right:0!important;place-self:center}:is(.prc-Button-ButtonBase-9n-Xk:where([data-loading=true]) .prc-Button-LoadingSpinner-6KfaT:not([data-component=leadingVisual],[data-component=trailingVisual],[data-component=trailingAction]))+.prc-Button-Label-FWkx3{visibility:hidden}.prc-Button-ButtonBase-9n-Xk .prc-Button-LoadingSpinner-6KfaT{align-items:center;display:flex;justify-content:center}.prc-Button-ButtonBase-9n-Xk:where([data-variant=default]){background-color:var(--button-default-bgColor-rest,var(--color-btn-bg));box-shadow:var(--button-default-shadow-resting,var(--color-btn-shadow));color:var(--button-default-fgColor-rest,var(--color-btn-text))}.prc-Button-ButtonBase-9n-Xk[aria-expanded=true]:where([data-variant=default]){background-color:var(--button-default-bgColor-active,var(--color-btn-active-bg));border-color:var(--button-default-borderColor-active,var(--color-btn-active-border))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=default]):hover{background-color:var(--button-default-bgColor-hover,var(--color-btn-hover-bg));border-color:var(--button-default-borderColor-hover,var(--color-btn-hover-border))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=default]):active{background-color:var(--button-default-bgColor-active,var(--color-btn-active-bg));border-color:var(--button-default-borderColor-active,var(--color-btn-active-border))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=default]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=default]):not([data-loading=true]){background-color:var(--button-default-bgColor-disabled,var(--color-btn-bg));border-color:var(--button-default-borderColor-disabled,var(--color-btn-border));box-shadow:none;color:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}:is(.prc-Button-ButtonBase-9n-Xk:where([data-variant=default]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=default]):not([data-loading=true])) [data-kbd-chord]{background:var(--buttonKeybindingHint-default-bgColor-disabled,#eff2f5);border-color:var(--buttonKeybindingHint-default-borderColor-disabled,#818b981a);color:var(--buttonKeybindingHint-default-fgColor-disabled,#818b98)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=default]) .prc-Button-CounterLabel-5hAs4{background-color:var(--buttonCounter-default-bgColor-rest,var(--color-btn-counter-bg))!important}.prc-Button-ButtonBase-9n-Xk:where([data-variant=default]) [data-kbd-chord]{background:var(--buttonKeybindingHint-default-bgColor-rest,#eff2f5);border-color:var(--buttonKeybindingHint-default-borderColor-rest,#d1d9e0b3);color:var(--buttonKeybindingHint-default-fgColor-rest,#59636e)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=default]):where(.prc-Button-IconButton-fyge7){color:var(--fgColor-muted,var(--color-fg-muted))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=primary]){background-color:var(--button-primary-bgColor-rest,var(--color-btn-primary-bg));border-color:var(--button-primary-borderColor-rest,var(--color-btn-primary-border));box-shadow:var(--shadow-resting-small,var(--color-shadow-small));color:var(--button-primary-fgColor-rest,var(--color-btn-primary-text))}.prc-Button-ButtonBase-9n-Xk[aria-expanded=true]:where([data-variant=primary]){background-color:var(--button-primary-bgColor-active,var(--color-btn-primary-selected-bg));box-shadow:var(--button-primary-shadow-selected,var(--color-btn-primary-selected-shadow))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=primary]):hover{background-color:var(--button-primary-bgColor-hover,var(--color-btn-primary-hover-bg));border-color:var(--button-primary-borderColor-hover,var(--color-btn-primary-hover-border))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=primary]):focus-visible{box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis,var(--color-fg-on-emphasis));outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:-2px}.prc-Button-ButtonBase-9n-Xk:where([data-variant=primary]):active{background-color:var(--button-primary-bgColor-active,var(--color-btn-primary-selected-bg));box-shadow:var(--button-primary-shadow-selected,var(--color-btn-primary-selected-shadow))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=primary]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=primary]):not([data-loading=true]){background-color:var(--button-primary-bgColor-disabled,var(--color-btn-primary-disabled-bg));border-color:var(--button-primary-borderColor-disabled,var(--color-btn-primary-disabled-border));box-shadow:none;color:var(--button-primary-fgColor-disabled,var(--color-btn-primary-disabled-text))}:is(.prc-Button-ButtonBase-9n-Xk:where([data-variant=primary]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=primary]):not([data-loading=true])) [data-kbd-chord]{background:var(--buttonKeybindingHint-primary-bgColor-disabled,#002d111a);border-color:var(--buttonKeybindingHint-primary-borderColor-disabled,#818b981a);color:var(--buttonKeybindingHint-primary-fgColor-disabled,#fffc)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=primary]) .prc-Button-CounterLabel-5hAs4{background-color:var(--buttonCounter-primary-bgColor-rest,var(--color-btn-primary-counter-bg))!important;color:var(--button-primary-fgColor-rest,var(--color-btn-primary-text))!important}.prc-Button-ButtonBase-9n-Xk:where([data-variant=primary]) [data-kbd-chord]{background:var(--buttonKeybindingHint-primary-bgColor-rest,#002d1133);border-color:var(--buttonKeybindingHint-primary-borderColor-rest,#1f232826);color:var(--buttonKeybindingHint-primary-fgColor-rest,#fff)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=primary]) .prc-Button-Visual-YNt2F{color:var(--button-primary-fgColor-rest,var(--color-btn-primary-text))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]){background-color:var(--button-danger-bgColor-rest,var(--color-btn-bg));box-shadow:var(--button-default-shadow-resting,var(--color-btn-shadow));color:var(--button-danger-fgColor-rest,var(--color-btn-danger-text))}.prc-Button-ButtonBase-9n-Xk[aria-expanded=true]:where([data-variant=danger]){background-color:var(--button-danger-bgColor-active,var(--color-btn-danger-selected-bg));border-color:var(--button-danger-borderColor-active,var(--color-btn-danger-selected-border));box-shadow:var(--button-danger-shadow-selected,var(--color-btn-danger-selected-shadow));color:var(--button-danger-fgColor-active,var(--color-btn-danger-selected-text))}.prc-Button-ButtonBase-9n-Xk[aria-expanded=true]:where([data-variant=danger]) .prc-Button-Visual-YNt2F{color:var(--button-danger-iconColor-hover,var(--color-btn-danger-hover-icon))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):hover{background-color:var(--button-danger-bgColor-hover,var(--color-btn-danger-hover-bg));border-color:var(--button-danger-borderColor-hover,var(--color-btn-danger-hover-border));box-shadow:var(--shadow-resting-small,var(--color-shadow-small));color:var(--button-danger-fgColor-hover,var(--color-btn-danger-hover-text))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):hover .prc-Button-CounterLabel-5hAs4{background-color:var(--buttonCounter-danger-bgColor-hover,var(--color-btn-danger-hover-counter-bg))!important;color:var(--buttonCounter-danger-fgColor-hover,var(--color-btn-danger-hover-counter-fg))!important}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):hover [data-kbd-chord]{background:var(--buttonKeybindingHint-danger-bgColor-hover,#1f232833);border-color:var(--buttonKeybindingHint-danger-borderColor-hover,#1f232826);color:var(--buttonKeybindingHint-danger-fgColor-hover,#fff);transition:80ms ease-out}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):hover .prc-Button-Visual-YNt2F{color:var(--button-danger-iconColor-hover,var(--color-btn-danger-hover-icon))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):active{background-color:var(--button-danger-bgColor-active,var(--color-btn-danger-selected-bg));border-color:var(--button-danger-borderColor-active,var(--color-btn-danger-selected-border));box-shadow:var(--button-danger-shadow-selected,var(--color-btn-danger-selected-shadow));color:var(--button-danger-fgColor-active,var(--color-btn-danger-selected-text))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):active .prc-Button-CounterLabel-5hAs4{background-color:var(--buttonCounter-danger-bgColor-hover,var(--color-btn-danger-hover-counter-bg))!important;color:var(--buttonCounter-danger-fgColor-hover,var(--color-btn-danger-hover-counter-fg))!important}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):active [data-kbd-chord]{background:var(--buttonKeybindingHint-danger-bgColor-active,#1f232866);border-color:var(--buttonKeybindingHint-danger-borderColor-active,#1f232826);color:var(--buttonKeybindingHint-danger-fgColor-active,#fff);transition:80ms ease-out}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):active .prc-Button-Visual-YNt2F{color:var(--button-danger-iconColor-hover,var(--color-btn-danger-hover-icon))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=danger]):not([data-loading=true]){background-color:var(--button-danger-bgColor-disabled,var(--color-btn-danger-disabled-bg));border-color:var(--button-default-borderColor-disabled,var(--color-btn-border));box-shadow:none;color:var(--button-danger-fgColor-disabled,var(--color-btn-danger-disabled-text))}:is(.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=danger]):not([data-loading=true])) .prc-Button-CounterLabel-5hAs4{background-color:var(--buttonCounter-danger-bgColor-disabled,var(--color-btn-danger-disabled-counter-bg))!important;color:var(--buttonCounter-danger-fgColor-disabled,var(--color-btn-danger-disabled-counter-fg))!important}:is(.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=danger]):not([data-loading=true])) [data-kbd-chord]{background:var(--buttonKeybindingHint-danger-bgColor-disabled,#eff2f5);border-color:var(--buttonKeybindingHint-danger-borderColor-disabled,#818b981a);color:var(--buttonKeybindingHint-danger-fgColor-disabled,#818b98)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]) .prc-Button-CounterLabel-5hAs4{background-color:var(--buttonCounter-danger-bgColor-rest,var(--color-btn-danger-counter-bg))!important;color:var(--buttonCounter-danger-fgColor-rest,var(--color-btn-danger-counter-fg))!important}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]) [data-kbd-chord]{background:var(--buttonKeybindingHint-danger-bgColor-rest,#eff2f5);border-color:var(--buttonKeybindingHint-danger-borderColor-rest,#d1d9e0b3);color:var(--buttonKeybindingHint-danger-fgColor-rest,#59636e)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=danger]) .prc-Button-Visual-YNt2F{color:var(--button-danger-iconColor-rest,var(--color-btn-danger-icon))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]){border-color:var(--button-invisible-borderColor-rest,#0000);box-shadow:none;color:var(--button-default-fgColor-rest,var(--color-btn-text))}.prc-Button-ButtonBase-9n-Xk[aria-expanded=true]:where([data-variant=invisible]){background-color:var(--button-invisible-bgColor-active,var(--color-action-list-item-default-active-bg))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]):hover{background-color:var(--button-invisible-bgColor-hover,var(--color-action-list-item-default-hover-bg));border-color:var(--button-invisible-borderColor-hover,#0000)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]):hover .prc-Button-Visual-YNt2F{color:var(--button-invisible-iconColor-hover,#59636e)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]):hover [data-kbd-chord]{background:var(--buttonKeybindingHint-invisible-bgColor-hover,#818b981a);transition:80ms ease-out}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]):active{background-color:var(--button-invisible-bgColor-active,var(--color-action-list-item-default-active-bg))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]):active .prc-Button-Visual-YNt2F{color:var(--button-invisible-iconColor-hover,#59636e)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]):active [data-kbd-chord]{background:var(--buttonKeybindingHint-invisible-bgColor-active,#818b9826);transition:80ms ease-out}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=invisible]):not([data-loading=true]){background-color:var(--button-invisible-bgColor-disabled,var(--color-action-list-item-default-selected-bg));border-color:var(--button-invisible-borderColor-disabled,var(--color-action-list-item-default-selected-bg));box-shadow:none;color:var(--button-invisible-fgColor-disabled,var(--color-primer-fg-disabled))}:is(.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=invisible]):not([data-loading=true])) [data-kbd-chord]{background:var(--buttonKeybindingHint-invisible-bgColor-disabled,#fff0);border-color:var(--buttonKeybindingHint-invisible-borderColor-disabled,#818b981a);color:var(--buttonKeybindingHint-invisible-fgColor-disabled,#818b98)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]) .prc-Button-Visual-YNt2F{color:var(--button-invisible-iconColor-rest,#59636e)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]) .prc-Button-CounterLabel-5hAs4{background-color:var(--buttonCounter-invisible-bgColor-rest,#818b981f)!important}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]) [data-kbd-chord]{background:var(--buttonKeybindingHint-invisible-bgColor-rest,#eff2f5);border-color:var(--buttonKeybindingHint-invisible-borderColor-rest,#fff0);color:var(--buttonKeybindingHint-invisible-fgColor-rest,#59636e)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=invisible]):where(.prc-Button-IconButton-fyge7){color:var(--button-invisible-iconColor-rest,#59636e)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=link]){border:unset;border-radius:0;color:var(--fgColor-link,var(--color-accent-fg));display:inline-flex;font-size:inherit;height:unset;min-width:-moz-fit-content;min-width:fit-content;padding:0;text-align:left}.prc-Button-ButtonBase-9n-Xk:where([data-variant=link]):hover:not(:disabled,[data-inactive]){-webkit-text-decoration:underline;text-decoration:underline}.prc-Button-ButtonBase-9n-Xk:where([data-variant=link]):focus,.prc-Button-ButtonBase-9n-Xk:where([data-variant=link]):focus-visible{outline-offset:2px}.prc-Button-ButtonBase-9n-Xk:where([data-variant=link]):disabled,.prc-Button-ButtonBase-9n-Xk[aria-disabled=true]:where([data-variant=link]):not([data-loading=true]){background-color:initial;border-color:#0000;color:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}.prc-Button-ButtonBase-9n-Xk:where([data-variant=link]) .prc-Button-Label-FWkx3{white-space:unset}.prc-Button-ButtonBase-9n-Xk:where([data-variant=link]):where([data-inactive]){background:#0000!important;color:var(--button-inactive-fgColor,#59636e)}.prc-Button-ButtonBase-9n-Xk:where([data-variant=link]) .prc-Button-Visual-YNt2F{color:var(--fgColor-link,var(--color-accent-fg))}:is([data-a11y-link-underlines=true] .prc-Button-ButtonBase-9n-Xk:where([data-variant=link])):not(:has(.prc-Button-Visual-YNt2F)){-webkit-text-decoration:underline;text-decoration:underline}:is([data-a11y-link-underlines=true] .prc-Button-ButtonBase-9n-Xk:where([data-variant=link])):has(.prc-Button-Visual-YNt2F){background-image:linear-gradient(90deg,currentColor,currentColor);background-position:0 calc(100% - 2px);background-repeat:no-repeat;background-size:100% 1.5px}:is([data-a11y-link-underlines=true] .prc-Button-ButtonBase-9n-Xk:where([data-variant=link])):has(.prc-Button-Visual-YNt2F):hover{-webkit-text-decoration:none;text-decoration:none}:is([data-a11y-link-underlines=false] .prc-Button-ButtonBase-9n-Xk:where([data-variant=link])):not(:has(.prc-Button-Visual-YNt2F)){background-image:none;-webkit-text-decoration:none;text-decoration:none}:is([data-a11y-link-underlines=false] .prc-Button-ButtonBase-9n-Xk:where([data-variant=link])):has(.prc-Button-Visual-YNt2F){background-image:none}.prc-Button-ButtonBase-9n-Xk:where([data-inactive]),.prc-Button-ButtonBase-9n-Xk:where([data-inactive]):active,.prc-Button-ButtonBase-9n-Xk:where([data-inactive]):hover{background-color:var(--button-inactive-bgColor,#e6eaef);border-color:var(--button-inactive-bgColor,#e6eaef);box-shadow:none;color:var(--button-inactive-fgColor,#59636e);cursor:auto}:is(.prc-Button-ButtonBase-9n-Xk:where([data-inactive]),.prc-Button-ButtonBase-9n-Xk:where([data-inactive]):hover,.prc-Button-ButtonBase-9n-Xk:where([data-inactive]):active) .prc-Button-CounterLabel-5hAs4,:is(.prc-Button-ButtonBase-9n-Xk:where([data-inactive]),.prc-Button-ButtonBase-9n-Xk:where([data-inactive]):hover,.prc-Button-ButtonBase-9n-Xk:where([data-inactive]):active) .prc-Button-Visual-YNt2F{color:inherit!important}:is(.prc-Button-ButtonBase-9n-Xk:where([data-inactive]),.prc-Button-ButtonBase-9n-Xk:where([data-inactive]):hover,.prc-Button-ButtonBase-9n-Xk:where([data-inactive]):active) [data-kbd-chord]{background:var(--buttonKeybindingHint-inactive-bgColor,#eff2f5);border-color:var(--buttonKeybindingHint-inactive-borderColor,#d1d9e0b3);color:var(--buttonKeybindingHint-inactive-fgColor,#59636e)}.prc-Button-ButtonBase-9n-Xk:where([data-has-count]):has([data-component=leadingVisual]):not(:has([data-component=text])){padding-inline:var(--control-medium-paddingInline-condensed,.5rem)}.prc-Button-ButtonBase-9n-Xk:where([data-has-count]):has([data-component=leadingVisual]):not(:has([data-component=text])):where([data-size=small]){padding-inline:var(--control-xsmall-paddingInline-condensed,.25rem)}.prc-Button-ButtonBase-9n-Xk:where([data-has-count]):has([data-component=leadingVisual]):not(:has([data-component=text])):where([data-size=large]){padding-inline:var(--control-large-paddingInline-normal,.75rem)}.prc-Button-ConditionalWrapper-Rvbgb{display:block}[data-kbd-chord]{transition:80ms ease-in;transition-property:color,background-color,border-color}.prc-Spinner-Box-Y-ke-{display:inline-flex}}@layer primer-react{@keyframes prc-Spinner-rotate-keyframes-LV51p{to{transform:rotate(1turn)}}.prc-Spinner-SpinnerAnimation-tutJZ{animation:prc-Spinner-rotate-keyframes-LV51p var(--base-duration-1000,1s) var(--base-easing-linear,0,0,1,1) infinite}.prc-VisuallyHidden-VisuallyHidden-Q0qSB:not(:focus):not(:active):not(:focus-within){clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.prc-CounterLabel-CounterLabel-X-kRU{border:var(--borderWidth-thin,.0625rem) solid var(--counter-borderColor,var(--color-counter-border));border-radius:20px;display:inline-block;font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-semibold,600);line-height:1;padding:var(--base-size-2,.125rem) var(--base-size-6,.375rem)}}@layer primer-react{}@layer primer-react{.prc-CounterLabel-CounterLabel-X-kRU:where([data-variant=primary]){background-color:var(--bgColor-neutral-emphasis,var(--color-fg-subtle));color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-CounterLabel-CounterLabel-X-kRU:where([data-variant=secondary]){background-color:var(--bgColor-neutral-muted,var(--color-neutral-subtle));color:var(--fgColor-default,var(--color-fg-default))}.prc-CounterLabel-CounterLabel-X-kRU:where(:empty){display:none}}@layer primer-react{@keyframes prc-TooltipV2-tooltip-appear-xyBco{0%{opacity:0}to{opacity:1}}.prc-TooltipV2-Tooltip-tLeuB{display:none}.prc-TooltipV2-Tooltip-tLeuB[popover]{margin:auto;max-width:250px;overflow:visible;padding:var(--overlay-paddingBlock-condensed,.25rem) var(--overlay-padding-condensed,.5rem);position:absolute;width:max-content;clip:auto;color:var(--tooltip-fgColor,#fff);font:var(--text-body-shorthand-small,400 .75rem/1.66667 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");text-align:center;word-wrap:break-word;background:var(--tooltip-bgColor,#25292e);border:0;border-radius:var(--borderRadius-medium,.375rem);white-space:normal;-webkit-font-smoothing:subpixel-antialiased;inset:auto;text-wrap:balance}.prc-TooltipV2-Tooltip-tLeuB[popover]:popover-open{display:block}.prc-TooltipV2-Tooltip-tLeuB[popover].\\:popover-open{display:block}@media (forced-colors:active){.prc-TooltipV2-Tooltip-tLeuB{outline:1px solid #0000}}.prc-TooltipV2-Tooltip-tLeuB:after{content:"";display:block;height:var(--overlay-offset,.25rem);left:0;position:absolute;right:0}.prc-TooltipV2-Tooltip-tLeuB[data-direction=n]:after,.prc-TooltipV2-Tooltip-tLeuB[data-direction=ne]:after,.prc-TooltipV2-Tooltip-tLeuB[data-direction=nw]:after{top:100%}.prc-TooltipV2-Tooltip-tLeuB[data-direction=s]:after,.prc-TooltipV2-Tooltip-tLeuB[data-direction=se]:after,.prc-TooltipV2-Tooltip-tLeuB[data-direction=sw]:after{bottom:100%}.prc-TooltipV2-Tooltip-tLeuB[data-direction=w]:after{left:100%}.prc-TooltipV2-Tooltip-tLeuB[data-direction=e]:after,.prc-TooltipV2-Tooltip-tLeuB[data-direction=w]:after{bottom:0;content:"";display:block;height:100%;position:absolute;width:8px}.prc-TooltipV2-Tooltip-tLeuB[data-direction=e]:after{margin-left:-8px;right:100%}@media screen and (prefers-reduced-motion:no-preference){.prc-TooltipV2-Tooltip-tLeuB:popover-open,.prc-TooltipV2-Tooltip-tLeuB:popover-open:before{animation-delay:0s;animation-duration:.1s;animation-fill-mode:forwards;animation-name:prc-TooltipV2-tooltip-appear-xyBco;animation-timing-function:ease-in}.prc-TooltipV2-Tooltip-tLeuB.\\:popover-open,.prc-TooltipV2-Tooltip-tLeuB.\\:popover-open:before{animation-delay:0s;animation-duration:.1s;animation-fill-mode:forwards;animation-name:prc-TooltipV2-tooltip-appear-xyBco;animation-timing-function:ease-in}}.prc-TooltipV2-KeybindingHintContainer-Ymj-3.prc-TooltipV2-HasTextBefore-fdOXj{margin-left:var(--base-size-6,.375rem)}.prc-Tooltip-Tooltip-JLsri{display:inline-block;position:relative}.prc-Tooltip-Tooltip-JLsri:after{display:none;font:normal normal var(--text-body-size-small,.75rem) /var(--text-body-lineHeight-small,1.66667) var(--fontStack-system,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");padding:.5em .75em;position:absolute;z-index:1000000;-webkit-font-smoothing:subpixel-antialiased;color:var(--tooltip-fgColor,var(--fgColor-onEmphasis,var(--color-fg-on-emphasis)));letter-spacing:normal;text-align:center;-webkit-text-decoration:none;text-decoration:none;text-shadow:none;text-transform:none;word-wrap:break-word;background:var(--tooltip-bgColor,var(--bgColor-emphasis,var(--color-neutral-emphasis-plus)));border-radius:var(--borderRadius-medium,.375rem);content:attr(aria-label);opacity:0;pointer-events:none;white-space:pre}}@layer primer-react{@keyframes prc-Tooltip-tooltip-appear-orG4s{0%{opacity:0}to{opacity:1}}.prc-Tooltip-Tooltip-JLsri:active:after,.prc-Tooltip-Tooltip-JLsri:focus-within:after,.prc-Tooltip-Tooltip-JLsri:focus:after,.prc-Tooltip-Tooltip-JLsri:hover:after{animation-delay:0s;animation-duration:.1s;animation-fill-mode:forwards;animation-name:prc-Tooltip-tooltip-appear-orG4s;animation-timing-function:ease-in;display:inline-block;-webkit-text-decoration:none;text-decoration:none}.prc-Tooltip-Tooltip--noDelay-g8wqY:active:after,.prc-Tooltip-Tooltip--noDelay-g8wqY:focus-within:after,.prc-Tooltip-Tooltip--noDelay-g8wqY:focus:after,.prc-Tooltip-Tooltip--noDelay-g8wqY:hover:after{animation-delay:0s}.prc-Tooltip-Tooltip--multiline-3-2P7:active:after,.prc-Tooltip-Tooltip--multiline-3-2P7:focus-within:after,.prc-Tooltip-Tooltip--multiline-3-2P7:focus:after,.prc-Tooltip-Tooltip--multiline-3-2P7:hover:after{display:table-cell}.prc-Tooltip-Tooltip--s-RbCQB:after,.prc-Tooltip-Tooltip--se-VqnS5:after,.prc-Tooltip-Tooltip--sw-FsNH8:after{margin-top:6px;right:50%;top:100%}.prc-Tooltip-Tooltip--se-VqnS5:after{left:50%;margin-left:calc(var(--base-size-16,1rem)*-1);right:auto}.prc-Tooltip-Tooltip--sw-FsNH8:after{margin-right:calc(var(--base-size-16,1rem)*-1)}.prc-Tooltip-Tooltip--n-SqCQ-:after,.prc-Tooltip-Tooltip--ne-WzCLj:after,.prc-Tooltip-Tooltip--nw-fM9Mv:after{bottom:100%;margin-bottom:6px;right:50%}.prc-Tooltip-Tooltip--ne-WzCLj:after{left:50%;margin-left:calc(var(--base-size-16,1rem)*-1);right:auto}.prc-Tooltip-Tooltip--nw-fM9Mv:after{margin-right:calc(var(--base-size-16,1rem)*-1)}.prc-Tooltip-Tooltip--n-SqCQ-:after,.prc-Tooltip-Tooltip--s-RbCQB:after{transform:translateX(50%)}.prc-Tooltip-Tooltip--w-2-qCh:after{margin-right:6px;right:100%}.prc-Tooltip-Tooltip--e-JU1w8:after,.prc-Tooltip-Tooltip--w-2-qCh:after{bottom:50%;transform:translateY(50%)}.prc-Tooltip-Tooltip--e-JU1w8:after{left:100%;margin-left:6px}.prc-Tooltip-Tooltip--multiline-3-2P7:after{max-width:250px;width:max-content;word-wrap:break-word;border-collapse:initial;white-space:pre-line}.prc-Tooltip-Tooltip--multiline-3-2P7.prc-Tooltip-Tooltip--n-SqCQ-:after,.prc-Tooltip-Tooltip--multiline-3-2P7.prc-Tooltip-Tooltip--s-RbCQB:after{left:50%;right:auto;transform:translateX(-50%)}.prc-Tooltip-Tooltip--multiline-3-2P7.prc-Tooltip-Tooltip--e-JU1w8:after,.prc-Tooltip-Tooltip--multiline-3-2P7.prc-Tooltip-Tooltip--w-2-qCh:after{right:100%}.prc-Tooltip-Tooltip--alignRight-aNEnL:after{margin-right:0;right:0}.prc-Tooltip-Tooltip--alignLeft-LqNu7:after{left:0;margin-left:0}}@layer primer-react{:where(.prc-Heading-Heading-MtWFE){font-size:var(--text-title-size-large,2rem);font-weight:var(--base-text-weight-semibold,600);margin:0}:where(.prc-Heading-Heading-MtWFE):where([data-variant=large]){font:var(--text-title-shorthand-large,600 2rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji")}:where(.prc-Heading-Heading-MtWFE):where([data-variant=medium]){font:var(--text-title-shorthand-medium,600 1.25rem/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji")}:where(.prc-Heading-Heading-MtWFE):where([data-variant=small]){font:var(--text-title-shorthand-small,600 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji")}}@layer primer-react{:where(.prc-Link-Link-9ZwDx){color:var(--fgColor-accent,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none;text-underline-offset:.05rem}:where(.prc-Link-Link-9ZwDx):is(button){appearance:none;background-color:initial;border:0;cursor:pointer;display:inline-block;font-size:inherit;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}:where(.prc-Link-Link-9ZwDx):hover{-webkit-text-decoration:underline;text-decoration:underline}[data-a11y-link-underlines=true] :where(.prc-Link-Link-9ZwDx):where([data-inline=true]){-webkit-text-decoration:underline;text-decoration:underline}:where(.prc-Link-Link-9ZwDx):where([data-muted=true]){color:var(--fgColor-muted,var(--color-fg-muted))}:where(.prc-Link-Link-9ZwDx):where([data-muted=true]):hover{color:var(--fgColor-accent,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none}}@layer primer-react{.prc-ActionList-ActionList-rPFF2,.prc-ActionList-ActionList-rPFF2 ul{list-style:none;margin:0;padding:0}.prc-ActionList-ActionList-rPFF2:where([data-variant=inset]){padding-block:var(--base-size-8,.5rem)}.prc-ActionList-ActionList-rPFF2:where([data-variant=inset],[data-variant=horizontal-inset]) .prc-ActionList-ActionListItem-So4vC{margin-inline:var(--base-size-8,.5rem)}.prc-ActionList-ActionList-rPFF2:where([data-variant=horizontal-inset]){padding-bottom:var(--base-size-8,.5rem)}.prc-ActionList-ActionList-rPFF2:where([data-dividers=true]) .prc-ActionList-ActionListSubContent-gKsFp:before{background:var(--borderColor-muted,var(--color-border-muted));content:"";display:block;height:1px;position:absolute;top:-7px;width:100%}:is(.prc-ActionList-ActionList-rPFF2:where([data-dividers=true]) [data-description-variant=inline]):before{background:var(--borderColor-muted,var(--color-border-muted));content:"";display:block;height:var(--borderWidth-thin,.0625rem);position:absolute;top:-7px;width:100%}:is(.prc-ActionList-ActionList-rPFF2:where([data-dividers=true]) [data-description-variant=inline]) .prc-ActionList-ActionListSubContent-gKsFp:before{content:unset}.prc-ActionList-ActionList-rPFF2:where([data-dividers=true]) .prc-ActionList-ActionListItem-So4vC:first-of-type .prc-ActionList-ActionListSubContent-gKsFp:before,.prc-ActionList-ActionList-rPFF2:where([data-dividers=true]) .prc-ActionList-Divider-taVfb+.prc-ActionList-ActionListItem-So4vC .prc-ActionList-ActionListSubContent-gKsFp:before{visibility:hidden}.prc-ActionList-ActionList-rPFF2:where([data-dividers=true]) .prc-ActionList-ActionListItem-So4vC:first-of-type [data-description-variant=inline]:before,.prc-ActionList-ActionList-rPFF2:where([data-dividers=true]) .prc-ActionList-Divider-taVfb+.prc-ActionList-ActionListItem-So4vC [data-description-variant=inline]:before{visibility:hidden}.prc-ActionList-ActionList-rPFF2 .prc-ActionList-Divider-taVfb:first-child{display:none}.prc-ActionList-ActionList-rPFF2:has([data-has-description=true]):has([data-has-description=false]) .prc-ActionList-ItemLabel-81ohH{font-weight:var(--base-text-weight-normal,400)}.prc-ActionList-ActionListItem-So4vC{background-color:var(--control-transparent-bgColor-rest,#0000);border-radius:var(--borderRadius-medium,.375rem);list-style:none;position:relative}.prc-ActionList-ActionListItem-So4vC:has(>.prc-ActionList-TrailingAction-dMRxe){display:flex;flex-wrap:nowrap}@media (forced-colors:active){.prc-ActionList-ActionListItem-So4vC :focus,.prc-ActionList-ActionListItem-So4vC:focus-visible,.prc-ActionList-ActionListItem-So4vC>a.prc-ActionList-focus-visible-OJCTY,.prc-ActionList-ActionListItem-So4vC[data-is-active-descendant]{outline:1px solid #0000!important}}@media (hover:hover){.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):active,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):hover{cursor:pointer}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):hover:not([data-active],:focus-visible){box-shadow:var(--boxShadow-thin,inset 0 0 0 .0625rem) var(--control-transparent-borderColor-active,var(--color-action-list-item-default-active-border));outline:solid var(--borderWidth-thin,.0625rem) #0000;outline-offset:calc(var(--borderWidth-thin,.0625rem)*-1)}}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):active{background-color:var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg))}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):active:not([data-active]){box-shadow:var(--boxShadow-thin,inset 0 0 0 .0625rem) var(--control-transparent-borderColor-active,var(--color-action-list-item-default-active-border));outline:solid var(--borderWidth-thin,.0625rem) #0000;outline-offset:calc(var(--borderWidth-thin,.0625rem)*-1)}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):focus-visible{box-shadow:none;outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:0}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):focus-visible .prc-ActionList-ActionListSubContent-gKsFp:before,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):focus-visible+.prc-ActionList-ActionListItem-So4vC .prc-ActionList-ActionListSubContent-gKsFp:before{visibility:hidden}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]) .prc-ActionList-ItemLabel-81ohH,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]) .prc-ActionList-LeadingAction-hbWbh,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]) .prc-ActionList-LeadingVisual-NBr28{color:var(--control-danger-fgColor-rest,var(--color-danger-fg))}@media (hover:hover){.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):hover{background:var(--control-danger-bgColor-hover,var(--color-action-list-item-danger-hover-bg))}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):hover .prc-ActionList-ItemLabel-81ohH,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):hover .prc-ActionList-LeadingAction-hbWbh,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):hover .prc-ActionList-LeadingVisual-NBr28{color:var(--control-danger-fgColor-hover,var(--color-action-list-item-danger-hover-text))}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):hover [data-kbd-chord]{background-color:var(--bgColor-default,var(--color-canvas-default));transition:none}}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):active{background:var(--control-danger-bgColor-active,var(--color-action-list-item-danger-active-bg))}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):active .prc-ActionList-ItemLabel-81ohH,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):active .prc-ActionList-LeadingAction-hbWbh,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):active .prc-ActionList-LeadingVisual-NBr28{color:var(--control-danger-fgColor-hover,var(--color-action-list-item-danger-hover-text))}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-variant=danger]):active [data-kbd-chord]{background-color:var(--bgColor-default,var(--color-canvas-default));transition:none}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-active]){background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg));outline:2px solid #0000}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-active]) .prc-ActionList-ItemLabel-81ohH{color:var(--control-fgColor-rest,var(--color-fg-default));font-weight:var(--base-text-weight-semibold,600)}@media (hover:hover){.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-active]):hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-active]) .prc-ActionList-ActionListSubContent-gKsFp:before,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-active])+.prc-ActionList-ActionListItem-So4vC .prc-ActionList-ActionListSubContent-gKsFp:before{visibility:hidden}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-active]):after{background:var(--borderColor-accent-emphasis,var(--color-accent-emphasis));border-radius:var(--borderRadius-medium,.375rem);content:"";height:calc(100% - var(--base-size-8,.5rem));left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:var(--base-size-4,.25rem);width:var(--base-size-4,.25rem)}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-is-active-descendant]){background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg));outline:2px solid #0000}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-is-active-descendant]):after{background:var(--borderColor-accent-emphasis,var(--color-accent-emphasis));border-radius:var(--borderRadius-medium,.375rem);content:"";height:calc(100% - var(--base-size-8,.5rem));left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:var(--base-size-4,.25rem);width:var(--base-size-4,.25rem)}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-inactive=true]) * :not([popover],.prc-ActionList-InactiveWarning-1Dszv){color:var(--fgColor-muted,var(--color-fg-muted))}@media (hover:hover){.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-inactive=true]):hover{background-color:initial;cursor:not-allowed}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-inactive=true]):hover * :not([popover],.prc-ActionList-InactiveWarning-1Dszv){color:var(--fgColor-muted,var(--color-fg-muted))}}.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-inactive=true]):active{background:#0000}:is(.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):where([data-loading=true]),.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):has([data-loading=true])) *{color:var(--fgColor-muted,var(--color-fg-muted))}@media (hover:hover){.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):hover .prc-ActionList-ActionListSubContent-gKsFp:before,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):hover [data-description-variant=inline]:before,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):hover+.prc-ActionList-ActionListItem-So4vC .prc-ActionList-ActionListSubContent-gKsFp:before,.prc-ActionList-ActionListItem-So4vC:not(:has([aria-disabled],[disabled]),[data-has-subitem=true]):hover+.prc-ActionList-ActionListItem-So4vC [data-description-variant=inline]:before{visibility:hidden}}.prc-ActionList-ActionListItem-So4vC[data-has-subitem=true]>.prc-ActionList-ActionListContent-KBb8-{z-index:1}@media (hover:hover){:is(.prc-ActionList-ActionListItem-So4vC[data-has-subitem=true]>.prc-ActionList-ActionListContent-KBb8-):hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg));cursor:pointer}}:is(.prc-ActionList-ActionListItem-So4vC[data-has-subitem=true]>.prc-ActionList-ActionListContent-KBb8-):active{background-color:var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg))}.prc-ActionList-ActionListItem-So4vC[data-has-subitem=true] .prc-ActionList-Spacer-4tR2m{display:block}:is(.prc-ActionList-ActionListItem-So4vC[aria-disabled=true],.prc-ActionList-ActionListItem-So4vC:has([aria-disabled=true],[disabled])) .prc-ActionList-ActionListContent-KBb8- *{color:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}@media (hover:hover){:is(:is(.prc-ActionList-ActionListItem-So4vC[aria-disabled=true],.prc-ActionList-ActionListItem-So4vC:has([aria-disabled=true],[disabled])) .prc-ActionList-ActionListContent-KBb8-):hover{background-color:initial;cursor:not-allowed}:is(.prc-ActionList-ActionListItem-So4vC[aria-disabled=true],.prc-ActionList-ActionListItem-So4vC:has([aria-disabled=true],[disabled])):hover{background-color:initial}}:is(.prc-ActionList-ActionListItem-So4vC[aria-disabled=true],.prc-ActionList-ActionListItem-So4vC:has([aria-disabled=true],[disabled])) .prc-ActionList-MultiSelectCheckbox-2OqxZ{background-color:var(--control-bgColor-disabled,var(--color-input-disabled-bg));border-color:var(--control-borderColor-disabled,var(--color-btn-border))}:is([aria-checked=true]:is(.prc-ActionList-ActionListItem-So4vC[aria-disabled=true],.prc-ActionList-ActionListItem-So4vC:has([aria-disabled=true],[disabled])),[aria-selected=true]:is(.prc-ActionList-ActionListItem-So4vC[aria-disabled=true],.prc-ActionList-ActionListItem-So4vC:has([aria-disabled=true],[disabled]))) .prc-ActionList-MultiSelectCheckbox-2OqxZ{background-color:var(--control-checked-bgColor-disabled,var(--color-switch-track-disabled-bg));border-color:var(--control-checked-bgColor-disabled,var(--color-switch-track-disabled-bg))}:is(:is([aria-checked=true]:is(.prc-ActionList-ActionListItem-So4vC[aria-disabled=true],.prc-ActionList-ActionListItem-So4vC:has([aria-disabled=true],[disabled])),[aria-selected=true]:is(.prc-ActionList-ActionListItem-So4vC[aria-disabled=true],.prc-ActionList-ActionListItem-So4vC:has([aria-disabled=true],[disabled]))) .prc-ActionList-MultiSelectCheckbox-2OqxZ):before{background-color:var(--control-checked-fgColor-disabled,var(--color-switch-track-checked-disabled-fg))}.prc-ActionList-ActionListItem-So4vC:has(.prc-ActionList-TrailingAction-dMRxe [data-loading=true]):not([aria-disabled=true]) .prc-ActionList-Description-Z-EZJ,.prc-ActionList-ActionListItem-So4vC:has(.prc-ActionList-TrailingAction-dMRxe [data-loading=true]):not([aria-disabled=true]) .prc-ActionList-ItemLabel-81ohH{color:var(--fgColor-default,var(--color-fg-default))}.prc-ActionList-ActionListItem-So4vC[aria-hidden]+.prc-ActionList-Divider-taVfb{display:none}.prc-ActionList-ActionListItem-So4vC .prc-ActionList-MultiSelectCheckbox-2OqxZ{background-color:var(--bgColor-default,var(--color-canvas-default));border:var(--borderWidth-thin,.0625rem) solid var(--control-borderColor-emphasis,var(--color-switch-knob-border));border-radius:var(--borderRadius-small,.1875rem);cursor:pointer;display:grid;height:var(--base-size-16,1rem);margin:0;place-content:center;position:relative;transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1);width:var(--base-size-16,1rem)}:is(.prc-ActionList-ActionListItem-So4vC .prc-ActionList-MultiSelectCheckbox-2OqxZ):before{animation:prc-ActionList-checkmarkOut-GbMf4 80ms cubic-bezier(.65,0,.35,1);background-color:var(--control-checked-fgColor-rest,var(--color-switch-track-checked-fg));clip-path:inset(var(--base-size-16,1rem) 0 0 0);content:"";height:var(--base-size-16,1rem);mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTIgOSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzguMjJhLjc1Ljc1IDAgMCAxIDAgMS4wNjFsLTcuMjYgNy4yNmEuNzUuNzUgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1Ljc1IDAgMCAxIDEuMDYyIDAiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==");mask-position:center;mask-repeat:no-repeat;mask-size:75%;transition:visibility 0s linear .23s;width:var(--base-size-16,1rem)}@media (forced-colors:active){.prc-ActionList-ActionListItem-So4vC .prc-ActionList-MultiSelectCheckbox-2OqxZ{border-width:var(--borderWidth-thin,.0625rem)}}:is(.prc-ActionList-ActionListItem-So4vC[aria-checked=true],.prc-ActionList-ActionListItem-So4vC[aria-selected=true]) .prc-ActionList-MultiSelectCheckbox-2OqxZ{background-color:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg));border-color:var(--control-checked-borderColor-rest,var(--color-switch-track-checked-bg));transition:background-color,border-color 80ms cubic-bezier(.32,0,.67,0) 0s}:is(:is(.prc-ActionList-ActionListItem-So4vC[aria-checked=true],.prc-ActionList-ActionListItem-So4vC[aria-selected=true]) .prc-ActionList-MultiSelectCheckbox-2OqxZ):before{animation:prc-ActionList-checkmarkIn-gjsPG 80ms cubic-bezier(.65,0,.35,1) 80ms forwards;transition:visibility 0s linear 0s;visibility:visible}@media (forced-colors:active){:is(.prc-ActionList-ActionListItem-So4vC[aria-checked=true],.prc-ActionList-ActionListItem-So4vC[aria-selected=true]) .prc-ActionList-MultiSelectCheckbox-2OqxZ{border-width:8px}}:is(.prc-ActionList-ActionListItem-So4vC[aria-checked=true],.prc-ActionList-ActionListItem-So4vC[aria-selected=true]) .prc-ActionList-SingleSelectCheckmark-zMd8d{visibility:visible}.prc-ActionList-SingleSelectCheckmark-zMd8d,:is(.prc-ActionList-ActionListItem-So4vC[aria-checked=false],.prc-ActionList-ActionListItem-So4vC[aria-selected=false]) .prc-ActionList-SingleSelectCheckmark-zMd8d,:is(:is(.prc-ActionList-ActionListItem-So4vC[aria-checked=false],.prc-ActionList-ActionListItem-So4vC[aria-selected=false]) .prc-ActionList-MultiSelectCheckbox-2OqxZ):before{visibility:hidden}.prc-ActionList-ActionListContent-KBb8-{--subitem-depth:0px;background-color:initial;border:none;border-radius:var(--borderRadius-medium,.375rem);color:var(--control-fgColor-rest,var(--color-fg-default));display:grid;padding-block:var(--control-medium-paddingBlock,.375rem);padding-inline:var(--control-medium-paddingInline-condensed,.5rem);position:relative;text-align:left;touch-action:manipulation;transition:background 33.333ms linear;-webkit-user-select:none;user-select:none;width:100%;-webkit-tap-highlight-color:transparent;align-items:start;grid-template-areas:"spacer leadingAction leadingVisual content";grid-template-columns:min-content min-content min-content minmax(0,auto);grid-template-rows:min-content}.prc-ActionList-ActionListContent-KBb8->:not(:last-child,.prc-ActionList-Spacer-4tR2m){margin-right:var(--control-medium-gap,.5rem)}.prc-ActionList-ActionListContent-KBb8-:hover{cursor:pointer;-webkit-text-decoration:none;text-decoration:none}.prc-ActionList-ActionListContent-KBb8-[data-size=large]{padding-block:var(--control-large-paddingBlock,.625rem)}.prc-ActionList-ActionListContent-KBb8-[aria-expanded=true] .prc-ActionList-ExpandIcon-J4OqB{transform:scaleY(-1)}.prc-ActionList-ActionListContent-KBb8-[aria-expanded=false] .prc-ActionList-ExpandIcon-J4OqB{transform:scaleY(1)}.prc-ActionList-ActionListContent-KBb8-[aria-expanded=false]+.prc-ActionList-SubGroup-5Zje2{display:none}.prc-ActionList-ActionListContent-KBb8-[aria-expanded=false]:has(+.prc-ActionList-SubGroup-5Zje2 [data-active=true]){background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg))}.prc-ActionList-ActionListContent-KBb8-[aria-expanded=false]:has(+.prc-ActionList-SubGroup-5Zje2 [data-active=true]) .prc-ActionList-ItemLabel-81ohH{font-weight:var(--base-text-weight-semibold,600)}.prc-ActionList-ActionListContent-KBb8-[aria-expanded=false]:has(+.prc-ActionList-SubGroup-5Zje2 [data-active=true]) .prc-ActionList-ActionListSubContent-gKsFp:before,.prc-ActionList-ActionListContent-KBb8-[aria-expanded=false]:has(+.prc-ActionList-SubGroup-5Zje2 [data-active=true])+.prc-ActionList-ActionListItem-So4vC .prc-ActionList-ActionListSubContent-gKsFp:before{visibility:hidden}.prc-ActionList-ActionListContent-KBb8-[aria-expanded=false]:has(+.prc-ActionList-SubGroup-5Zje2 [data-active=true]):after{background:var(--borderColor-accent-emphasis,var(--color-accent-emphasis));border-radius:var(--borderRadius-medium,.375rem);content:"";height:calc(100% - var(--base-size-8,.5rem));left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:var(--base-size-4,.25rem);width:var(--base-size-4,.25rem)}.prc-ActionList-ActionListSubContent-gKsFp{align-items:start;display:grid;grid-area:content;grid-template-areas:"label trailingVisual trailingAction";grid-template-columns:minmax(0,auto) min-content min-content;grid-template-rows:min-content;position:relative;width:100%}.prc-ActionList-ActionListSubContent-gKsFp>:not(:last-child){margin-right:var(--control-medium-gap,.5rem)}.prc-ActionList-Spacer-4tR2m{display:none;grid-area:spacer;width:max(0px,var(--subitem-depth) * 8px)}.prc-ActionList-LeadingAction-hbWbh{grid-area:leadingAction}.prc-ActionList-LeadingVisual-NBr28{grid-area:leadingVisual}.prc-ActionList-TrailingVisual-jwT9C{font-size:var(--text-body-size-medium,.875rem);grid-area:trailingVisual}.prc-ActionList-TrailingAction-dMRxe{grid-area:trailingAction}.prc-ActionList-TrailingAction-dMRxe>[data-loading-wrapper]{height:100%}.prc-ActionList-ItemDescriptionWrap-ujC8S{display:flex;flex-direction:column;gap:var(--base-size-4,.25rem);grid-area:label}.prc-ActionList-ItemDescriptionWrap-ujC8S .prc-ActionList-ItemLabel-81ohH{font-weight:var(--base-text-weight-semibold,600);word-break:break-word}.prc-ActionList-ItemDescriptionWrap-ujC8S:where([data-description-variant=inline]){align-items:baseline;flex-direction:row;gap:var(--base-size-8,.5rem);position:relative;word-break:normal}.prc-ActionList-ItemDescriptionWrap-ujC8S:where([data-description-variant=inline]) .prc-ActionList-ItemLabel-81ohH{word-break:normal}.prc-ActionList-ItemDescriptionWrap-ujC8S:where([data-description-variant=inline]):has([data-truncate=true]) .prc-ActionList-ItemLabel-81ohH{flex:1 0 auto}.prc-ActionList-ItemDescriptionWrap-ujC8S:where([data-description-variant=inline]) .prc-ActionList-Description-Z-EZJ{line-height:16px}.prc-ActionList-Description-Z-EZJ{font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);line-height:16px}.prc-ActionList-Description-Z-EZJ,.prc-ActionList-VisualWrap-bdCsS{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-ActionList-VisualWrap-bdCsS{display:flex;line-height:20px;min-height:var(--control-medium-lineBoxHeight,1.25rem);min-width:max-content;pointer-events:none;fill:var(--fgColor-muted,var(--color-fg-muted));align-items:center}.prc-ActionList-ItemLabel-81ohH{color:var(--fgColor-default,var(--color-fg-default));font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-normal,400);grid-area:label;line-height:20px;position:relative;word-break:break-word}.prc-ActionList-SubGroup-5Zje2 .prc-ActionList-ItemLabel-81ohH{font-size:var(--text-body-size-small,.75rem)}.prc-ActionList-SubGroup-5Zje2 .prc-ActionList-ActionListItem-So4vC{margin-inline:0}.prc-ActionList-TrailingActionButton-UUAk6{border-bottom-left-radius:0;border-top-left-radius:0;height:100%}.prc-ActionList-TrailingActionButton-UUAk6[data-loading=true]:has([data-component=buttonContent]){padding:0 0 0 calc(var(--base-size-12,.75rem)*2)}.prc-ActionList-TrailingActionButton-UUAk6[data-loading=true]:has([data-component=buttonContent]) [data-component=loadingSpinner]{align-items:center;display:flex;height:var(--control-medium-size,2rem);justify-content:center;place-self:end;width:var(--control-medium-size,2rem)}.prc-ActionList-InactiveButtonWrap-Ia-xM:has(.prc-ActionList-TrailingVisual-jwT9C){grid-area:trailingVisual}.prc-ActionList-InactiveButtonWrap-Ia-xM:has(.prc-ActionList-LeadingVisual-NBr28){grid-area:leadingVisual}.prc-ActionList-Divider-taVfb{background:var(--borderColor-muted,var(--color-border-muted));border:0;display:block;height:var(--borderWidth-thin,.0625rem);list-style:none;margin-block-end:var(--base-size-8,.5rem);margin-block-start:calc(var(--base-size-8,.5rem) - var(--borderWidth-thin,.0625rem));padding:0}.prc-ActionList-InactiveButtonReset-uK4-x{background:none;border:none;color:inherit;cursor:pointer;display:flex;font:inherit;padding:0}.prc-ActionList-InactiveWarning-1Dszv{color:var(--fgColor-attention,var(--color-attention-fg));font-size:var(--text-body-size-small,.75rem);grid-row:2/2;line-height:16px}@keyframes prc-ActionList-checkmarkIn-gjsPG{0%{clip-path:inset(var(--base-size-16,1rem) 0 0 0)}to{clip-path:inset(0 0 0 0)}}@keyframes prc-ActionList-checkmarkOut-GbMf4{0%{clip-path:inset(0 0 0 0)}to{clip-path:inset(var(--base-size-16,1rem) 0 0 0)}}}@layer primer-react{.prc-Stack-Stack-UQ9k6{align-content:flex-start;align-items:stretch;display:flex;flex-flow:column;gap:var(--stack-gap,var(--stack-gap-normal,1rem))}.prc-Stack-Stack-UQ9k6[data-padding-narrow=none],.prc-Stack-Stack-UQ9k6[data-padding=none]{padding:0}.prc-Stack-Stack-UQ9k6[data-padding-narrow=condensed],.prc-Stack-Stack-UQ9k6[data-padding=condensed]{padding:var(--stack-padding-condensed,.5rem)}.prc-Stack-Stack-UQ9k6[data-padding-narrow=normal],.prc-Stack-Stack-UQ9k6[data-padding=normal]{padding:var(--stack-padding-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-padding-narrow=spacious],.prc-Stack-Stack-UQ9k6[data-padding=spacious]{padding:var(--stack-padding-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-direction-narrow=horizontal],.prc-Stack-Stack-UQ9k6[data-direction=horizontal]{flex-flow:row}.prc-Stack-Stack-UQ9k6[data-direction-narrow=vertical],.prc-Stack-Stack-UQ9k6[data-direction=vertical]{flex-flow:column}.prc-Stack-Stack-UQ9k6[data-gap-narrow=none],.prc-Stack-Stack-UQ9k6[data-gap=none]{--stack-gap:0}.prc-Stack-Stack-UQ9k6[data-gap-narrow=condensed],.prc-Stack-Stack-UQ9k6[data-gap=condensed]{--stack-gap:var(--stack-gap-condensed,0.5rem)}.prc-Stack-Stack-UQ9k6[data-gap-narrow=normal],.prc-Stack-Stack-UQ9k6[data-gap=normal]{--stack-gap:var(--stack-gap-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-gap-narrow=spacious],.prc-Stack-Stack-UQ9k6[data-gap=spacious]{--stack-gap:var(--stack-gap-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-align-narrow=start],.prc-Stack-Stack-UQ9k6[data-align=start]{align-items:flex-start}.prc-Stack-Stack-UQ9k6[data-align-narrow=center],.prc-Stack-Stack-UQ9k6[data-align=center]{align-items:center}.prc-Stack-Stack-UQ9k6[data-align-narrow=end],.prc-Stack-Stack-UQ9k6[data-align=end]{align-items:flex-end}.prc-Stack-Stack-UQ9k6[data-align-narrow=baseline],.prc-Stack-Stack-UQ9k6[data-align=baseline]{align-items:baseline}.prc-Stack-Stack-UQ9k6[data-justify-narrow=start],.prc-Stack-Stack-UQ9k6[data-justify=start]{justify-content:flex-start}.prc-Stack-Stack-UQ9k6[data-justify-narrow=center],.prc-Stack-Stack-UQ9k6[data-justify=center]{justify-content:center}.prc-Stack-Stack-UQ9k6[data-justify-narrow=end],.prc-Stack-Stack-UQ9k6[data-justify=end]{justify-content:flex-end}.prc-Stack-Stack-UQ9k6[data-justify-narrow=space-between],.prc-Stack-Stack-UQ9k6[data-justify=space-between]{justify-content:space-between}.prc-Stack-Stack-UQ9k6[data-justify-narrow=space-evenly],.prc-Stack-Stack-UQ9k6[data-justify=space-evenly]{justify-content:space-evenly}.prc-Stack-Stack-UQ9k6[data-wrap-narrow=wrap],.prc-Stack-Stack-UQ9k6[data-wrap=wrap]{flex-wrap:wrap}.prc-Stack-Stack-UQ9k6[data-wrap-narrow=nowrap],.prc-Stack-Stack-UQ9k6[data-wrap=nowrap]{flex-wrap:nowrap}@media (min-width:48rem){.prc-Stack-Stack-UQ9k6[data-padding-regular=none]{padding:0}.prc-Stack-Stack-UQ9k6[data-padding-regular=condensed]{padding:var(--stack-padding-condensed,.5rem)}.prc-Stack-Stack-UQ9k6[data-padding-regular=normal]{padding:var(--stack-padding-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-padding-regular=spacious]{padding:var(--stack-padding-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-direction-regular=horizontal]{flex-flow:row}.prc-Stack-Stack-UQ9k6[data-direction-regular=vertical]{flex-flow:column}.prc-Stack-Stack-UQ9k6[data-gap-regular=none]{--stack-gap:0}.prc-Stack-Stack-UQ9k6[data-gap-regular=condensed]{--stack-gap:var(--stack-gap-condensed,0.5rem)}.prc-Stack-Stack-UQ9k6[data-gap-regular=normal]{--stack-gap:var(--stack-gap-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-gap-regular=spacious]{--stack-gap:var(--stack-gap-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-align-regular=start]{align-items:flex-start}.prc-Stack-Stack-UQ9k6[data-align-regular=center]{align-items:center}.prc-Stack-Stack-UQ9k6[data-align-regular=end]{align-items:flex-end}.prc-Stack-Stack-UQ9k6[data-align-regular=baseline]{align-items:baseline}.prc-Stack-Stack-UQ9k6[data-justify-regular=start]{justify-content:flex-start}.prc-Stack-Stack-UQ9k6[data-justify-regular=center]{justify-content:center}.prc-Stack-Stack-UQ9k6[data-justify-regular=end]{justify-content:flex-end}.prc-Stack-Stack-UQ9k6[data-justify-regular=space-between]{justify-content:space-between}.prc-Stack-Stack-UQ9k6[data-justify-regular=space-evenly]{justify-content:space-evenly}.prc-Stack-Stack-UQ9k6[data-wrap-regular=wrap]{flex-wrap:wrap}.prc-Stack-Stack-UQ9k6[data-wrap-regular=nowrap]{flex-wrap:nowrap}}@media (min-width:87.5rem){.prc-Stack-Stack-UQ9k6[data-padding-wide=none]{padding:0}.prc-Stack-Stack-UQ9k6[data-padding-wide=condensed]{padding:var(--stack-padding-condensed,.5rem)}.prc-Stack-Stack-UQ9k6[data-padding-wide=normal]{padding:var(--stack-padding-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-padding-wide=spacious]{padding:var(--stack-padding-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-direction-wide=horizontal]{flex-flow:row}.prc-Stack-Stack-UQ9k6[data-direction-wide=vertical]{flex-flow:column}.prc-Stack-Stack-UQ9k6[data-gap-wide=none]{--stack-gap:0}.prc-Stack-Stack-UQ9k6[data-gap-wide=condensed]{--stack-gap:var(--stack-gap-condensed,0.5rem)}.prc-Stack-Stack-UQ9k6[data-gap-wide=normal]{--stack-gap:var(--stack-gap-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-gap-wide=spacious]{--stack-gap:var(--stack-gap-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-align-wide=start]{align-items:flex-start}.prc-Stack-Stack-UQ9k6[data-align-wide=center]{align-items:center}.prc-Stack-Stack-UQ9k6[data-align-wide=end]{align-items:flex-end}.prc-Stack-Stack-UQ9k6[data-align-wide=baseline]{align-items:baseline}.prc-Stack-Stack-UQ9k6[data-justify-wide=start]{justify-content:flex-start}.prc-Stack-Stack-UQ9k6[data-justify-wide=center]{justify-content:center}.prc-Stack-Stack-UQ9k6[data-justify-wide=end]{justify-content:flex-end}.prc-Stack-Stack-UQ9k6[data-justify-wide=space-between]{justify-content:space-between}.prc-Stack-Stack-UQ9k6[data-justify-wide=space-evenly]{justify-content:space-evenly}.prc-Stack-Stack-UQ9k6[data-wrap-wide=wrap]{flex-wrap:wrap}.prc-Stack-Stack-UQ9k6[data-wrap-wide=nowrap]{flex-wrap:nowrap}}.prc-Stack-StackItem-TzbLx{flex:0 1 auto;min-inline-size:0}.prc-Stack-StackItem-TzbLx[data-shrink-narrow=false],.prc-Stack-StackItem-TzbLx[data-shrink=false]{flex-shrink:0}.prc-Stack-StackItem-TzbLx[data-grow-narrow=true],.prc-Stack-StackItem-TzbLx[data-grow=true]{flex-grow:1}@media (min-width:48rem){.prc-Stack-StackItem-TzbLx[data-grow-regular=true]{flex-grow:1}.prc-Stack-StackItem-TzbLx[data-grow-regular=false]{flex-grow:0}.prc-Stack-StackItem-TzbLx[data-shrink-regular=true]{flex-shrink:1}.prc-Stack-StackItem-TzbLx[data-shrink-regular=false]{flex-shrink:0}}@media (min-width:87.5rem){.prc-Stack-StackItem-TzbLx[data-grow-wide=true]{flex-grow:1}.prc-Stack-StackItem-TzbLx[data-grow-wide=false]{flex-grow:0}.prc-Stack-StackItem-TzbLx[data-shrink-wide=true]{flex-shrink:1}.prc-Stack-StackItem-TzbLx[data-shrink-wide=false]{flex-shrink:0}}}@layer primer-react{.prc-ActionList-ActionListHeader-Frcbm{margin-block-end:var(--base-size-8,.5rem)}.prc-ActionList-ActionListHeader-Frcbm:where([data-list-variant=full]){margin-inline-start:var(--base-size-8,.5rem)}.prc-ActionList-ActionListHeader-Frcbm:where([data-list-variant=inset],[data-list-variant=horizontal-inset]){margin-inline-start:calc(var(--control-medium-paddingInline-condensed,.5rem) + var(--base-size-8,.5rem))}}@layer primer-react{.prc-ActionList-Group-lMIPQ{list-style:none}.prc-ActionList-Group-lMIPQ:not(:first-child){margin-block-start:var(--base-size-8,.5rem)}.prc-ActionList-Group-lMIPQ:not(:first-child):has(.prc-ActionList-GroupHeadingWrap-laXcX+ul>.prc-ActionList-GroupHeadingWrap-laXcX)>.prc-ActionList-GroupHeadingWrap-laXcX{display:none}.prc-ActionList-GroupList-V5B3-{padding-inline-start:0}.prc-ActionList-GroupHeadingWrap-laXcX{color:var(--fgColor-muted,var(--color-fg-muted));display:flex;flex-direction:column;font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-semibold,600);line-height:18px;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-16,1rem)}.prc-ActionList-GroupHeadingWrap-laXcX:where([data-variant=filled]){background:var(--bgColor-muted,var(--color-canvas-subtle));border-bottom:solid var(--borderWidth-thin,.0625rem) var(--borderColor-muted,var(--color-border-muted));border-top:solid var(--borderWidth-thin,.0625rem) var(--borderColor-muted,var(--color-border-muted));margin-block-end:var(--base-size-8,.5rem);margin-block-start:calc(var(--base-size-8,.5rem) - var(--borderWidth-thin,.0625rem));padding-inline:var(--base-size-16,1rem)}.prc-ActionList-GroupHeadingWrap-laXcX:where([data-variant=filled]):first-child{margin-block-start:0}.prc-ActionList-GroupHeading-STzxi{align-self:flex-start;color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-semibold,600);margin:0}.prc-Truncate-Truncate-2G1eo{display:inherit;max-width:var(--truncate-max-width);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}@layer primer-react{.prc-Truncate-Truncate-2G1eo:where([data-expandable]):hover{max-width:10000px}.prc-Truncate-Truncate-2G1eo:where([data-inline]){display:inline-block;vertical-align:top}}@layer primer-react{.prc-CheckboxOrRadioGroup-Body-S3dlj{display:flex;flex-direction:column;list-style:none;margin:0;padding:0}.prc-CheckboxOrRadioGroup-Body-S3dlj>*+*{margin-top:var(--base-size-8,.5rem)}.prc-CheckboxOrRadioGroup-GroupFieldset-wQbrJ{border:none;margin:0;padding:0}.prc-CheckboxOrRadioGroup-GroupFieldset-wQbrJ:where([data-validation]){margin-bottom:var(--base-size-8,.5rem)}.prc-CheckboxOrRadioGroup-GroupLegend-qbh-X{padding:0}.prc-CheckboxOrRadioGroup-GroupLegend-qbh-X:where([data-legend-visible]){margin-bottom:var(--base-size-8,.5rem)}.prc-CheckboxOrRadioGroup-CheckboxOrRadioGroupCaption-txKKq{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-CheckboxOrRadioGroup-CheckboxOrRadioGroupCaption-txKKq,.prc-CheckboxOrRadioGroup-RadioGroupLabel-C-0pm{font-size:var(--text-body-size-medium,.875rem)}.prc-CheckboxOrRadioGroup-RadioGroupLabel-C-0pm{display:block;font-weight:var(--base-text-weight-semibold,600)}.prc-CheckboxOrRadioGroup-RadioGroupLabel-C-0pm:where([data-label-disabled]){color:var(--fgColor-muted,var(--color-fg-muted))}.prc-CheckboxOrRadioGroup-GroupLabelChildren-ObjCg{margin-right:var(--base-size-8,.5rem)}.prc-components-InputValidation-kbli-{color:var(--inputValidation-fgColor);display:flex;font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-semibold,600)}}@layer primer-react{.prc-components-InputValidation-kbli- :where(a){color:currentColor;-webkit-text-decoration:underline;text-decoration:underline}.prc-components-InputValidation-kbli-:where([data-validation-status=success]){--inputValidation-fgColor:var(--fgColor-success,var(--color-success-fg))}.prc-components-InputValidation-kbli-:where([data-validation-status=error]){--inputValidation-fgColor:var(--fgColor-danger,var(--color-danger-fg))}.prc-components-ValidationIcon-sv29w{display:flex;margin-top:var(--base-size-2,.125rem);margin-inline-end:var(--base-size-4,.25rem);min-height:var(--inputValidation-iconSize)}.prc-components-ValidationText-JEfut{line-height:var(--inputValidation-lineHeight)}}@layer primer-react{.prc-components-Animation-e139d:where([data-show]){animation:prc-components-fadeIn-RDp5O .17s cubic-bezier(.44,.74,.36,1)}@media (prefers-reduced-motion){.prc-components-Animation-e139d:where([data-show]){animation:none}}@keyframes prc-components-fadeIn-RDp5O{0%{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0)}}}@layer primer-react{.prc-Checkbox-Input-lWIkv{appearance:none;background-color:var(--bgColor-default,var(--color-canvas-default));border-color:var(--control-borderColor-emphasis,var(--color-switch-knob-border));border-style:solid;border-width:var(--borderWidth-thin,.0625rem);cursor:pointer;display:grid;height:var(--base-size-16,1rem);margin:0;margin-top:var(--base-size-2,.125rem);place-content:center;position:relative;width:var(--base-size-16,1rem)}.prc-Checkbox-Input-lWIkv:disabled{background-color:var(--control-bgColor-disabled,var(--color-input-disabled-bg));border-color:var(--control-borderColor-disabled,var(--color-btn-border))}.prc-components-TextInputBaseWrapper-wY-n0{align-items:stretch;background-color:var(--bgColor-default,var(--color-canvas-default));border:var(--borderWidth-thin,.0625rem) solid var(--control-borderColor-rest,var(--color-btn-border));border-radius:var(--borderRadius-medium,.375rem);box-shadow:var(--shadow-inset,var(--color-primer-shadow-inset));color:var(--fgColor-default,var(--color-fg-default));cursor:text;display:inline-flex;font-size:var(--text-body-size-medium,.875rem);line-height:var(--base-size-20,1.25rem);min-height:var(--base-size-32,2rem);outline:none;overflow:hidden;vertical-align:middle}.prc-components-TextInputBaseWrapper-wY-n0 input,.prc-components-TextInputBaseWrapper-wY-n0 textarea{cursor:text}.prc-components-TextInputBaseWrapper-wY-n0 select{cursor:pointer}:is(.prc-components-TextInputBaseWrapper-wY-n0 input,.prc-components-TextInputBaseWrapper-wY-n0 textarea,.prc-components-TextInputBaseWrapper-wY-n0 select)::placeholder{color:var(--fgColor-muted,var(--color-fg-muted))}}@layer primer-react{.prc-components-TextInputBaseWrapper-wY-n0:where(:not([data-trailing-action]):focus-within),.prc-components-TextInputBaseWrapper-wY-n0:where([data-trailing-action][data-focused]){border-color:var(--borderColor-accent-emphasis,var(--color-accent-emphasis));outline:var(--borderWidth-thick,.125rem) solid var(--borderColor-accent-emphasis,var(--color-accent-emphasis));outline-offset:-1px}.prc-components-TextInputBaseWrapper-wY-n0>textarea{padding:var(--base-size-12,.75rem)}.prc-components-TextInputBaseWrapper-wY-n0:where([data-contrast]){background-color:var(--control-bgColor-contrast,var(--bgColor-inset,var(--color-canvas-inset)))}.prc-components-TextInputBaseWrapper-wY-n0:where([data-disabled]){background-color:var(--control-bgColor-disabled,var(--color-input-disabled-bg));border-color:var(--control-borderColor-disabled,var(--color-btn-border));box-shadow:none;color:var(--fgColor-disabled,var(--color-primer-fg-disabled))}.prc-components-TextInputBaseWrapper-wY-n0:where([data-disabled]) input,.prc-components-TextInputBaseWrapper-wY-n0:where([data-disabled]) select,.prc-components-TextInputBaseWrapper-wY-n0:where([data-disabled]) textarea{cursor:not-allowed}.prc-components-TextInputBaseWrapper-wY-n0:where([data-monospace]){font-family:var(--fontStack-monospace,ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace)}.prc-components-TextInputBaseWrapper-wY-n0:where([data-validation=error]){border-color:var(--borderColor-danger-emphasis,var(--color-danger-emphasis))}.prc-components-TextInputBaseWrapper-wY-n0:where([data-validation=error]):where(:not([data-trailing-action])):focus-within,.prc-components-TextInputBaseWrapper-wY-n0:where([data-validation=error]):where([data-trailing-action][data-focused]){border-color:var(--control-borderColor-danger,var(--color-danger-emphasis));outline:2px solid var(--control-borderColor-danger,var(--color-danger-emphasis));outline-offset:-1px}.prc-components-TextInputBaseWrapper-wY-n0:where([data-validation=success]){border-color:var(--bgColor-success-emphasis,var(--color-success-emphasis))}.prc-components-TextInputBaseWrapper-wY-n0:where([data-block]){align-self:stretch;display:flex;width:100%}@media screen and (min-width:48rem){.prc-components-TextInputBaseWrapper-wY-n0{font-size:var(--text-body-size-medium,.875rem)}}.prc-components-TextInputBaseWrapper-wY-n0{--inner-action-size:var(--base-size-24,1.5rem)}.prc-components-TextInputBaseWrapper-wY-n0:where([data-size=small]){--inner-action-size:var(--base-size-20,1.25rem);font-size:var(--text-body-size-small,.75rem);line-height:var(--base-size-20,1.25rem);min-height:var(--base-size-28,1.75rem);padding-bottom:3px;padding-left:var(--base-size-8,.5rem);padding-right:var(--base-size-8,.5rem);padding-top:3px}.prc-components-TextInputBaseWrapper-wY-n0:where([data-size=large]){--inner-action-size:var(--base-size-28,1.75rem);height:var(--base-size-40,2.5rem);padding-bottom:10px;padding-left:var(--base-size-8,.5rem);padding-right:var(--base-size-8,.5rem);padding-top:10px}.prc-components-TextInputBaseWrapper-wY-n0:where([data-variant=small]){font-size:(--text-body-size-small);line-height:var(--base-size-20,1.25rem);min-height:28px;padding-bottom:3px;padding-left:var(--base-size-8,.5rem);padding-right:var(--base-size-8,.5rem);padding-top:3px}.prc-components-TextInputBaseWrapper-wY-n0:where([data-variant=large]){font-size:var(--text-title-size-medium,1.25rem);padding-bottom:10px;padding-left:var(--base-size-8,.5rem);padding-right:var(--base-size-8,.5rem);padding-top:10px}.prc-components-TextInputWrapper-Hpdqi,.prc-components-TextInputWrapper-Hpdqi>input,.prc-components-TextInputWrapper-Hpdqi>select{padding-left:0;padding-right:0}.prc-components-TextInputWrapper-Hpdqi{background-position:right 8px center;background-repeat:no-repeat}.prc-components-TextInputWrapper-Hpdqi>:not(:last-child){margin-right:var(--base-size-8,.5rem)}.prc-components-TextInputWrapper-Hpdqi .TextInput-action,.prc-components-TextInputWrapper-Hpdqi .TextInput-icon{align-self:center;color:var(--fgColor-muted,var(--color-fg-muted));flex-shrink:0}.prc-components-TextInputWrapper-Hpdqi:where([data-leading-visual]){padding-left:var(--base-size-8,.5rem)}.prc-components-TextInputWrapper-Hpdqi:where([data-trailing-visual]:not([data-trailing-action])){padding-right:var(--base-size-8,.5rem)}:is(.prc-components-TextInputWrapper-Hpdqi:where(:not([data-leading-visual])[data-trailing-visual]),.prc-components-TextInputWrapper-Hpdqi:where(:not([data-leading-visual])[data-trailing-action]))>input,:is(.prc-components-TextInputWrapper-Hpdqi:where(:not([data-leading-visual])[data-trailing-visual]),.prc-components-TextInputWrapper-Hpdqi:where(:not([data-leading-visual])[data-trailing-action]))>select{padding-left:var(--base-size-8,.5rem)}.prc-components-TextInputWrapper-Hpdqi:where(:not([data-trailing-visual]):not([data-trailing-action]))>input,.prc-components-TextInputWrapper-Hpdqi:where(:not([data-trailing-visual]):not([data-trailing-action]))>select{padding-right:var(--base-size-8,.5rem)}.prc-components-TextInputWrapper-Hpdqi:where(:not([data-leading-visual]):not([data-trailing-visual]):not([data-trailing-action]))>input,.prc-components-TextInputWrapper-Hpdqi:where(:not([data-leading-visual]):not([data-trailing-visual]):not([data-trailing-action]))>select{padding-left:var(--base-size-12,.75rem);padding-right:var(--base-size-12,.75rem)}.prc-components-TextInputWrapper-Hpdqi:where([data-size=large]):where([data-leading-visual]){padding-left:var(--base-size-12,.75rem)}.prc-components-TextInputWrapper-Hpdqi:where([data-size=large]):where([data-trailing-visual]:not([data-trailing-action])){padding-right:var(--base-size-12,.75rem)}}@layer primer-react{.prc-Radio-Radio-h1gb9{border-radius:var(--borderRadius-full,100vh);transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1)}.prc-Radio-Radio-h1gb9:where(:checked){background-color:var(--control-checked-fgColor-rest,var(--color-switch-track-checked-fg));border-color:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg));border-width:var(--borderWidth-thicker,.25rem)}.prc-Radio-Radio-h1gb9:where(:checked):disabled{background-color:var(--control-checked-fgColor-disabled,var(--color-switch-track-checked-disabled-fg));border-color:var(--control-checked-bgColor-disabled,var(--color-switch-track-disabled-bg));cursor:not-allowed}.prc-Radio-Radio-h1gb9:focus-visible{box-shadow:none;outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:2px}@media (forced-colors:active){.prc-Radio-Radio-h1gb9{background-color:canvastext;border-color:canvastext}}}@layer primer-react{@property --prc-dialog-scrollgutter{initial-value:0;inherits:false;syntax:""}@keyframes prc-Dialog-dialog-backdrop-appear-tCG2K{0%{opacity:0}to{opacity:1}}@keyframes prc-Dialog-Overlay--motion-scaleFade-mE6-C{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes prc-Dialog-Overlay--motion-slideUp-tPElO{0%{transform:translateY(100%)}}@keyframes prc-Dialog-Overlay--motion-slideInRight-BR-CZ{0%{transform:translateX(-100%)}}@keyframes prc-Dialog-Overlay--motion-slideInLeft-ISmQZ{0%{transform:translateX(100%)}}@keyframes prc-Dialog-detect-scroll-b3i8Q{0%,to{--can-scroll:1}}.prc-Dialog-Backdrop-5Nt2U{animation:prc-Dialog-dialog-backdrop-appear-tCG2K .2s cubic-bezier(.33,1,.68,1);background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;display:flex;left:0;position:fixed;right:0;top:0}.prc-Dialog-Backdrop-5Nt2U,.prc-Dialog-Backdrop-5Nt2U[data-position-regular=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=left]{align-items:center;justify-content:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=right]{align-items:center;justify-content:flex-end}@media (max-width:767px){.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=bottom]{align-items:end;justify-content:center}}.prc-Dialog-Dialog-G8cDF{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;height:auto;max-height:calc(100dvh - 64px);max-width:calc(100dvw - 64px);min-width:296px;opacity:1;width:640px}.prc-Dialog-Dialog-G8cDF:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=large]){height:640px}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem))}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-top-left-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{animation:prc-Dialog-Overlay--motion-slideInRight-BR-CZ .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-right-radius:0;border-top-right-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{animation:prc-Dialog-Overlay--motion-slideInLeft-ISmQZ .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@media (max-width:767px){.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));height:auto;width:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=large]){height:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100dvh - 64px);max-width:100dvw;width:100dvw}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{animation:prc-Dialog-Overlay--motion-slideUp-tPElO .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{border-radius:unset!important;flex-grow:1;height:100%;max-height:100dvh;max-width:100dvw;width:100%}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}}body:not([data-dialog-scroll-optimized]):has(.prc-Dialog-Dialog-G8cDF.prc-Dialog-DisableScroll-UkWFM),body[data-dialog-scroll-disabled]{overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}.prc-Dialog-DialogOverflowWrapper-JvHzz{flex-grow:1}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk){--can-scroll:0}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{animation:prc-Dialog-detect-scroll-b3i8Q;border-bottom:var(--borderWidth-default,.0625rem) solid var(--borderColor-default,var(--color-border-default));animation-timeline:scroll(self)}@supports (animation-timeline:scroll(self)){.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{border-bottom:calc(var(--borderWidth-thin,.0625rem)*var(--can-scroll)) solid var(--borderColor-default,var(--color-border-default))}}.prc-Dialog-Header-f7Me-{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));flex-shrink:0;max-height:35vh;overflow-y:auto;padding:var(--base-size-8,.5rem);z-index:1}.prc-Dialog-HeaderInner-H-fFY{display:flex}.prc-Dialog-HeaderContent-mjAsn{display:flex;flex-direction:column;flex-grow:1;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem)}.prc-Dialog-Title-M-iPn{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--text-title-weight-large,600);margin:0}.prc-Dialog-Subtitle-aBFSq{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0;margin-top:var(--base-size-4,.25rem)}.prc-Dialog-Body-bB903{flex-grow:1;overflow:auto}.prc-Dialog-Body-bB903,.prc-Dialog-Footer-PMeQk{padding:var(--base-size-16,1rem)}.prc-Dialog-Footer-PMeQk{display:flex;flex-flow:wrap;flex-shrink:0;gap:var(--base-size-8,.5rem);justify-content:flex-end;z-index:1}@media (max-height:325px){.prc-Dialog-Footer-PMeQk{flex-direction:row;flex-wrap:nowrap;justify-content:unset;overflow-x:scroll}}}@layer primer-react{.prc-ScrollableRegion-ScrollableRegion--xtjK{overflow:auto;position:relative}.prc-Select-Select-dJWwD{appearance:none;background-color:inherit;border:0;border-radius:inherit;color:currentColor;font-size:inherit;margin-bottom:1px;margin-left:1px;margin-top:1px;outline:none;width:100%}.prc-Select-Select-dJWwD:disabled{background-color:initial}}@layer primer-react{@media screen and (forced-colors:active){.prc-Select-Select-dJWwD:disabled{background-color:-moz-combobox}}.prc-Select-TextInputWrapper-5NYFF{overflow:hidden;position:relative}@media screen and (forced-colors:active){.prc-Select-TextInputWrapper-5NYFF svg{fill:"FieldText"}.prc-Select-Disabled-56BAq svg{fill:"GrayText"}}.prc-Select-ArrowIndicator-WjH-8{pointer-events:none;position:absolute;right:var(--base-size-4,.25rem);top:50%;transform:translateY(-50%)}.prc-FormControl-Caption-GNJPU{color:var(--fgColor-muted,var(--color-fg-muted));display:block;font-size:var(--text-body-size-small,.75rem)}}@layer primer-react{.prc-FormControl-Caption-GNJPU:where([data-control-disabled]){color:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}}@layer primer-react{.prc-components-Label-2mrqP{align-self:flex-start;color:var(--fgColor-default,var(--color-fg-default));cursor:pointer;display:block;font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-semibold,600)}.prc-components-Label-2mrqP:where([data-control-disabled]){color:var(--control-fgColor-disabled,var(--color-primer-fg-disabled));cursor:not-allowed}.prc-components-Label-2mrqP:where([data-visually-hidden]){height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0 0 0 0);border:0;clip-path:inset(50%);white-space:nowrap}.prc-components-RequiredText-7UsHS{column-gap:var(--base-size-4,.25rem);display:flex}.prc-PageHeader-PageHeader-YLwBQ{--grid-row-order-context-area:1;--grid-row-order-leading-action:2;--grid-row-order-breadcrumbs:2;--grid-row-order-title-area:2;--grid-row-order-trailing-action:2;--grid-row-order-actions:2;--grid-row-order-description:3;--grid-row-order-navigation:4;--title-area-region-order-leading-visual:0;--title-area-region-order-title:1;--title-area-region-order-trailing-visual:2;--context-area-region-order-parent-link:0;--context-area-region-order-context-bar:1;--context-area-region-order-context-area-actions:2;display:grid;grid-template-areas:"context-area context-area context-area context-area context-area" "leading-action breadcrumbs title-area trailing-action actions" "description description description description description" "navigation navigation navigation navigation navigation";grid-template-columns:auto auto auto auto 1fr}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant=large]){font-size:var(--custom-font-size,var(--text-title-size-large,2rem));font-weight:var(--custom-font-weight,var(--base-text-weight-normal,400));line-height:var(--custom-line-height,var(--text-title-lineHeight-large,1.5));--title-line-height:var(--custom-line-height,var(--text-title-lineHeight-large,1.5))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant=medium]){font-weight:var(--custom-font-weight,var(--base-text-weight-semibold,600))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant=medium]),.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant=subtitle]){font-size:var(--custom-font-size,var(--text-title-size-medium,1.25rem));line-height:var(--custom-line-height,var(--text-title-lineHeight-medium,1.6));--title-line-height:var(--custom-line-height,var(--text-title-lineHeight-medium,1.6))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant=subtitle]){font-weight:var(--custom-font-weight,var(--base-text-weight-normal,400))}}@layer primer-react{@media (max-width:calc(48rem - 0.02px)){.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-narrow=large]){font-size:var(--custom-font-size,var(--text-title-size-large,2rem));font-weight:var(--custom-font-weight,var(--base-text-weight-normal,400));line-height:var(--custom-line-height,var(--text-title-lineHeight-large,1.5));--title-line-height:var(--custom-line-height,var(--text-title-lineHeight-large,1.5))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-narrow=medium]){font-weight:var(--custom-font-weight,var(--base-text-weight-semibold,600))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-narrow=medium]),.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-narrow=subtitle]){font-size:var(--custom-font-size,var(--text-title-size-medium,1.25rem));line-height:var(--custom-line-height,var(--text-title-lineHeight-medium,1.6));--title-line-height:var(--custom-line-height,var(--text-title-lineHeight-medium,1.6))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-narrow=subtitle]){font-weight:var(--custom-font-weight,var(--base-text-weight-normal,400))}}@media (min-width:48rem){.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-regular=large]){font-size:var(--custom-font-size,var(--text-title-size-large,2rem));font-weight:var(--custom-font-weight,var(--base-text-weight-normal,400));line-height:var(--custom-line-height,var(--text-title-lineHeight-large,1.5));--title-line-height:var(--custom-line-height,var(--text-title-lineHeight-large,1.5))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-regular=medium]){font-weight:var(--custom-font-weight,var(--base-text-weight-semibold,600))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-regular=medium]),.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-regular=subtitle]){font-size:var(--custom-font-size,var(--text-title-size-medium,1.25rem));line-height:var(--custom-line-height,var(--text-title-lineHeight-medium,1.6));--title-line-height:var(--custom-line-height,var(--text-title-lineHeight-medium,1.6))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-regular=subtitle]){font-weight:var(--custom-font-weight,var(--base-text-weight-normal,400))}}@media (min-width:87.5rem){.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-wide=large]){font-size:var(--custom-font-size,var(--text-title-size-large,2rem));font-weight:var(--custom-font-weight,var(--base-text-weight-normal,400));line-height:var(--custom-line-height,var(--text-title-lineHeight-large,1.5));--title-line-height:var(--custom-line-height,var(--text-title-lineHeight-large,1.5))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-wide=medium]){font-weight:var(--custom-font-weight,var(--base-text-weight-semibold,600))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-wide=medium]),.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-wide=subtitle]){font-size:var(--custom-font-size,var(--text-title-size-medium,1.25rem));line-height:var(--custom-line-height,var(--text-title-lineHeight-medium,1.6));--title-line-height:var(--custom-line-height,var(--text-title-lineHeight-medium,1.6))}.prc-PageHeader-PageHeader-YLwBQ:has([data-component=TitleArea][data-size-variant-wide=subtitle]){font-weight:var(--custom-font-weight,var(--base-text-weight-normal,400))}}.prc-PageHeader-PageHeader-YLwBQ[data-has-border=true]:has([data-component=PH_Navigation][data-hidden-all]),.prc-PageHeader-PageHeader-YLwBQ[data-has-border=true]:not(:has([data-component=PH_Navigation])){border-block-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));padding-block-end:var(--base-size-8,.5rem)}@media (max-width:calc(48rem - 0.02px)){.prc-PageHeader-PageHeader-YLwBQ[data-has-border=true]:has([data-component=PH_Navigation][data-hidden-narrow]){border-block-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));padding-block-end:var(--base-size-8,.5rem)}}@media (min-width:48rem){.prc-PageHeader-PageHeader-YLwBQ[data-has-border=true]:has([data-component=PH_Navigation][data-hidden-regular]){border-block-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));padding-block-end:var(--base-size-8,.5rem)}}@media (min-width:87.5rem){.prc-PageHeader-PageHeader-YLwBQ[data-has-border=true]:has([data-component=PH_Navigation][data-hidden-wide]){border-block-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));padding-block-end:var(--base-size-8,.5rem)}}.prc-PageHeader-PageHeader-YLwBQ [data-component=PH_Actions],.prc-PageHeader-PageHeader-YLwBQ [data-component=PH_LeadingAction],.prc-PageHeader-PageHeader-YLwBQ [data-component=PH_LeadingVisual],.prc-PageHeader-PageHeader-YLwBQ [data-component=PH_TrailingAction],.prc-PageHeader-PageHeader-YLwBQ [data-component=PH_TrailingVisual]{height:calc(var(--title-line-height)*1em)}.prc-PageHeader-PageHeader-YLwBQ [data-hidden-all]{display:none}@media (max-width:calc(48rem - 0.02px)){.prc-PageHeader-PageHeader-YLwBQ [data-hidden-narrow]{display:none}}@media (min-width:48rem){.prc-PageHeader-PageHeader-YLwBQ [data-hidden-regular]{display:none}}@media (min-width:87.5rem){.prc-PageHeader-PageHeader-YLwBQ [data-hidden-wide]{display:none}}.prc-PageHeader-ContextArea-ueeWv{flex-direction:row;font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-normal,400);grid-area:context-area;grid-row:var(--grid-row-order-context-area);line-height:var(--text-body-lineHeight-medium,1.4285);padding-bottom:var(--base-size-8,.5rem)}.prc-PageHeader-ContextArea-ueeWv,.prc-PageHeader-ParentLink-AJ9VB{align-items:center;display:flex;gap:var(--stack-gap-condensed,.5rem)}.prc-PageHeader-ParentLink-AJ9VB{order:var(--context-area-region-order-parent-link)}.prc-PageHeader-ContextBar-8AoJ5{display:flex;order:var(--context-area-region-order-context-bar)}.prc-PageHeader-ContextAreaActions-DLQP5{align-items:center;flex-grow:1;justify-content:flex-end;order:var(--context-area-region-order-context-area-actions)}.prc-PageHeader-ContextAreaActions-DLQP5,.prc-PageHeader-TitleArea-2n2J0{display:flex;flex-direction:row;gap:var(--stack-gap-condensed,.5rem)}.prc-PageHeader-TitleArea-2n2J0{align-items:flex-start;grid-area:title-area;grid-row:var(--grid-row-order-title-area)}.prc-PageHeader-LeadingAction-4NMe9{grid-area:leading-action;grid-row:var(--grid-row-order-leading-action)}.prc-PageHeader-Breadcrumbs-FGVQU,.prc-PageHeader-LeadingAction-4NMe9{align-items:center;display:flex;padding-right:var(--base-size-8,.5rem)}.prc-PageHeader-Breadcrumbs-FGVQU{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-normal,400);grid-area:breadcrumbs;grid-row:var(--grid-row-order-breadcrumbs);line-height:var(--text-body-lineHeight-medium,1.4285)}.prc-PageHeader-LeadingVisual-njece{align-items:center;display:flex;order:var(--title-area-region-order-leading-visual)}.prc-PageHeader-Title-p0Mgh{display:block;font-size:inherit;font-weight:inherit;order:var(--title-area-region-order-title)}.prc-PageHeader-Title-p0Mgh:where([data-hidden=true]){display:none}.prc-PageHeader-TrailingVisual-Zb96K{align-items:center;display:flex;order:var(--title-area-region-order-trailing-visual)}.prc-PageHeader-TrailingAction-xqlZJ{grid-area:trailing-action;grid-row:var(--grid-row-order-trailing-action)}.prc-PageHeader-Actions-wawWm,.prc-PageHeader-TrailingAction-xqlZJ{align-items:center;display:flex;padding-left:var(--base-size-8,.5rem)}.prc-PageHeader-Actions-wawWm{flex-direction:row;gap:var(--stack-gap-condensed,.5rem);grid-area:actions;grid-row:var(--grid-row-order-actions);justify-content:flex-end;min-width:max-content}.prc-PageHeader-Description-w-ejP{align-items:center;display:flex;flex-direction:row;gap:var(--stack-gap-condensed,.5rem);grid-area:description;grid-row:var(--grid-row-order-description)}.prc-PageHeader-Description-w-ejP,.prc-PageHeader-Navigation--uLav{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-normal,400);line-height:var(--text-body-lineHeight-medium,1.4285);padding-top:var(--base-size-8,.5rem)}.prc-PageHeader-Navigation--uLav{display:block;grid-area:navigation;grid-row:var(--grid-row-order-navigation)}.prc-FormControl-LeadingVisual-AAfW7{--leadingVisual-size:16px;align-items:center;color:var(--fgColor-default,var(--color-fg-default));display:flex}}@layer primer-react{.prc-FormControl-LeadingVisual-AAfW7:where([data-control-disabled]){color:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}.prc-FormControl-LeadingVisual-AAfW7>*{min-height:var(--leadingVisual-size);min-width:var(--leadingVisual-size);fill:currentColor}.prc-FormControl-LeadingVisual-AAfW7:where([data-has-caption]){--leadingVisual-size:24px}}@layer primer-react{.prc-FormControl-ControlHorizontalLayout-0XQ-8{display:flex}.prc-FormControl-ControlHorizontalLayout-0XQ-8:where([data-has-leading-visual]){align-items:center}.prc-FormControl-ControlVerticalLayout-8YotI{align-items:flex-start;display:flex;flex-direction:column}.prc-FormControl-ControlVerticalLayout-8YotI>:not(label)+*,.prc-FormControl-ControlVerticalLayout-8YotI[data-has-label]>*+*{margin-top:var(--base-size-4,.25rem)}.prc-FormControl-ControlChoiceInputs--r3lG>input{margin-left:0;margin-right:0}.prc-FormControl-LabelContainer-M-FSK>*{padding-left:var(--stack-gap-condensed,.5rem)}.prc-FormControl-LabelContainer-M-FSK>label{font-weight:var(--base-text-weight-normal,400)}.prc-FormControl-LeadingVisual-IcFhb{color:var(--fgColor-muted,var(--color-fg-muted));margin-left:var(--base-size-8,.5rem)}.prc-FormControl-LeadingVisual-IcFhb:where([data-disabled]){color:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}.prc-FormControl-LeadingVisual-IcFhb>*{min-height:var(--text-body-size-large,1rem);min-width:var(--text-body-size-large,1rem);fill:currentColor}.prc-FormControl-LeadingVisual-IcFhb>:where([data-has-caption]){min-height:var(--base-size-24,1.5rem);min-width:var(--base-size-24,1.5rem)}}@layer primer-react{.prc-TextInput-CharacterCounter-vJZBe{align-items:center;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;gap:var(--control-xsmall-gap,.25rem)}.prc-TextInput-CharacterCounter--error-HA0kN{color:var(--fgColor-danger,var(--color-danger-fg))}.prc-components-Spinner-fIUBk{height:100%;max-width:100%;position:absolute;right:0;top:0}.prc-components-SpinnerLeading-phYLe{left:0}.prc-components-SpinnerHidden-mRxuj{visibility:hidden}.prc-components-SpinnerVisible-paqsj{visibility:visible}.prc-components-Box-XRSqm{display:flex;position:relative}.prc-components-Invisible-bKOcl{background-color:initial;color:var(--fgColor-muted,var(--color-fg-muted));padding:var(--base-size-2,.125rem) var(--base-size-4,.25rem);position:relative}.prc-components-Invisible-bKOcl:focus,.prc-components-Invisible-bKOcl:hover{color:var(--fgColor-default,var(--color-fg-default))}.prc-components-Invisible-bKOcl[data-component=IconButton]{height:var(--inner-action-size);width:var(--inner-action-size)}}@layer primer-react{}@layer primer-react{@media (pointer:coarse){.prc-components-Invisible-bKOcl :after{content:"";left:0;min-height:44px;position:absolute;right:0;top:50%;transform:translateY(-50%)}}.prc-components-TextInputAction-CjGDX{line-height:0;margin-left:var(--base-size-4,.25rem);margin-right:var(--base-size-4,.25rem)}.prc-components-ConditionalTooltip-1n0Zr{display:inline-block}.prc-components-Input-IwWrt{appearance:none;background-color:initial;border:0;color:inherit;font-family:inherit;font-size:inherit;width:100%}.prc-components-Input-IwWrt:focus{outline:0}.prc-Autocomplete-SpinnerWrapper-DJN3d{display:flex;justify-content:center}.prc-Autocomplete-EmptyStateWrapper-OoIjW,.prc-Autocomplete-SpinnerWrapper-DJN3d{padding:var(--base-size-16,1rem)}.prc-Autocomplete-Overlay-bwNcB{overflow:auto}}@layer primer-react{}@layer primer-react{}@layer primer-react{}@layer primer-react{@keyframes prc-Overlay-overlay-appear-JpFey{0%{opacity:0}to{opacity:1}}.prc-Overlay-Overlay-jfs-T{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);bottom:var(--bottom,auto);box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));height:auto;left:var(--left,auto);max-height:100vh;max-width:calc(100vw - 2rem);min-width:192px;overflow:hidden;position:absolute;right:var(--right,auto);top:var(--top,auto);width:auto}.prc-Overlay-Overlay-jfs-T:focus{outline:none}@media (forced-colors:active){.prc-Overlay-Overlay-jfs-T{outline:1px solid #0000}}.prc-Overlay-Overlay-jfs-T:where([data-reflow-container=true]){max-width:calc(100vw - 2rem)}.prc-Overlay-Overlay-jfs-T:where([data-overflow-auto]){overflow:auto}.prc-Overlay-Overlay-jfs-T:where([data-overflow-hidden]){overflow:hidden}.prc-Overlay-Overlay-jfs-T:where([data-overflow-scroll]){overflow:scroll}.prc-Overlay-Overlay-jfs-T:where([data-overflow-visible]){overflow:visible}.prc-Overlay-Overlay-jfs-T:where([data-height-xsmall]){height:192px}.prc-Overlay-Overlay-jfs-T:where([data-height-small]){height:256px}.prc-Overlay-Overlay-jfs-T:where([data-height-medium]){height:320px}.prc-Overlay-Overlay-jfs-T:where([data-height-large]){height:432px}.prc-Overlay-Overlay-jfs-T:where([data-height-xlarge]){height:600px}.prc-Overlay-Overlay-jfs-T:where([data-height-auto]),.prc-Overlay-Overlay-jfs-T:where([data-height-initial]){height:auto}.prc-Overlay-Overlay-jfs-T:where([data-height-fit-content]){height:-moz-fit-content;height:fit-content}.prc-Overlay-Overlay-jfs-T:where([data-max-height-xsmall]){max-height:192px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-small]){max-height:256px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-medium]){max-height:320px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-large]){max-height:432px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-xlarge]){max-height:600px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-fit-content]){max-height:-moz-fit-content;max-height:fit-content}.prc-Overlay-Overlay-jfs-T:where([data-width-small]){width:256px}.prc-Overlay-Overlay-jfs-T:where([data-width-medium]){width:320px}.prc-Overlay-Overlay-jfs-T:where([data-width-large]){width:480px}.prc-Overlay-Overlay-jfs-T:where([data-width-xlarge]){width:640px}.prc-Overlay-Overlay-jfs-T:where([data-width-xxlarge]){width:960px}.prc-Overlay-Overlay-jfs-T:where([data-width-auto]){width:auto}.prc-Overlay-Overlay-jfs-T:where([data-max-width-small]){max-width:256px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-medium]){max-width:320px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-large]){max-width:480px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-xlarge]){max-width:640px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-xxlarge]){max-width:960px}.prc-Overlay-Overlay-jfs-T:where([data-visibility-visible]){visibility:visible}.prc-Overlay-Overlay-jfs-T:where([data-visibility-hidden]){visibility:hidden}@media screen and (max-width:calc(48rem - 0.02px)){.prc-Overlay-Overlay-jfs-T:where([data-responsive=fullscreen]){border-radius:unset;height:100vh;left:0;margin:0;max-height:none;max-width:none;position:fixed;top:0;width:100vw}}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-variant=fullscreen]){height:100dvh}}@media (prefers-reduced-motion:no-preference){.prc-Overlay-Overlay-jfs-T{animation:prc-Overlay-overlay-appear-JpFey .2s cubic-bezier(.33,1,.68,1)}}}@layer primer-react{.prc-Checkbox-Checkbox-jjOgT{border-radius:var(--borderRadius-small,.1875rem);transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1)}.prc-Checkbox-Checkbox-jjOgT:before{animation:prc-Checkbox-checkmarkOut-mrgEX 80ms cubic-bezier(.65,0,.35,1) forwards;background-color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis));clip-path:inset(var(--base-size-16,1rem) 0 0 0);content:"";height:var(--base-size-16,1rem);mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTIgOSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzguMjJhLjc1Ljc1IDAgMCAxIDAgMS4wNjFsLTcuMjYgNy4yNmEuNzUuNzUgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1Ljc1IDAgMCAxIDEuMDYyIDAiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==");mask-position:center;mask-repeat:no-repeat;mask-size:75%;transition:visibility 0s linear .23s;visibility:hidden;width:var(--base-size-16,1rem)}.prc-Checkbox-Checkbox-jjOgT:checked,.prc-Checkbox-Checkbox-jjOgT:indeterminate{background:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg));border-color:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg))}:is(.prc-Checkbox-Checkbox-jjOgT:checked,.prc-Checkbox-Checkbox-jjOgT:indeterminate):before{animation:prc-Checkbox-checkmarkIn-73iWj 80ms cubic-bezier(.65,0,.35,1) 80ms forwards}:is(.prc-Checkbox-Checkbox-jjOgT:checked,.prc-Checkbox-Checkbox-jjOgT:indeterminate):disabled{background-color:var(--control-checked-bgColor-disabled,var(--color-switch-track-disabled-bg));border-color:var(--control-checked-borderColor-disabled,var(--color-switch-track-disabled-bg));opacity:1}:is(.prc-Checkbox-Checkbox-jjOgT:checked,.prc-Checkbox-Checkbox-jjOgT:indeterminate):disabled:before{background-color:var(--control-checked-fgColor-disabled,var(--color-switch-track-checked-disabled-fg))}@media (forced-colors:active){.prc-Checkbox-Checkbox-jjOgT:checked,.prc-Checkbox-Checkbox-jjOgT:indeterminate{background-color:canvastext;border-color:canvastext}}.prc-Checkbox-Checkbox-jjOgT:disabled{cursor:not-allowed}.prc-Checkbox-Checkbox-jjOgT:checked{transition:background-color,border-color 80ms cubic-bezier(.32,0,.67,0) 0s}.prc-Checkbox-Checkbox-jjOgT:checked:before{transition:visibility 0s linear 0s;visibility:visible}.prc-Checkbox-Checkbox-jjOgT:indeterminate{background:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg))}.prc-Checkbox-Checkbox-jjOgT:indeterminate:before{mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIyIiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTAgMiI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMCAxYTEgMSAwIDAgMSAxLTFoOGExIDEgMCAxIDEgMCAySDFhMSAxIDAgMCAxLTEtMSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");visibility:visible}.prc-Checkbox-Checkbox-jjOgT:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:2px}@keyframes prc-Checkbox-checkmarkIn-73iWj{0%{clip-path:inset(var(--base-size-16,1rem) 0 0 0)}to{clip-path:inset(0 0 0 0)}}@keyframes prc-Checkbox-checkmarkOut-mrgEX{0%{clip-path:inset(0 0 0 0)}to{clip-path:inset(var(--base-size-16,1rem) 0 0 0)}}}@layer primer-react{.prc-Token-TokenBase-te5-F{align-items:center;border-radius:var(--borderRadius-full,624.9375rem);display:inline-flex;font-family:inherit;font-weight:var(--base-text-weight-semibold,600);line-height:1;position:relative;-webkit-text-decoration:none;text-decoration:none;white-space:nowrap}.prc-Token-TokenBase-te5-F:where([data-cursor-is-interactive=true]){cursor:pointer}.prc-Token-TokenBase-te5-F:where([data-cursor-is-interactive=false]){cursor:auto}.prc-Token-TokenBase-te5-F:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);height:var(--base-size-16,1rem);padding-left:var(--base-size-4,.25rem);padding-right:var(--base-size-4,.25rem);width:auto}.prc-Token-TokenBase-te5-F:where([data-size=medium]){font-size:var(--text-body-size-small,.75rem);height:var(--base-size-20,1.25rem);padding-left:var(--base-size-6,.375rem);padding-right:var(--base-size-6,.375rem);width:auto}.prc-Token-TokenBase-te5-F[data-size=large]{height:var(--base-size-24,1.5rem);padding-left:var(--base-size-8,.5rem);padding-right:var(--base-size-8,.5rem)}.prc-Token-TokenBase-te5-F[data-size=large],.prc-Token-TokenBase-te5-F[data-size=xlarge]{font-size:var(--text-body-size-medium,.875rem);width:auto}.prc-Token-TokenBase-te5-F[data-size=xlarge]{height:var(--base-size-32,2rem);padding-bottom:0;padding-left:var(--base-size-12,.75rem);padding-right:var(--base-size-12,.75rem);padding-top:0}.prc-Token-TokenButton-L3DuN{align-items:center;align-self:baseline;appearance:none;background-color:initial;border:0;border-radius:var(--borderRadius-full,624.9375rem);color:currentColor;cursor:pointer;display:inline-flex;font-family:inherit;justify-content:center;margin-left:var(--base-size-4,.25rem);padding:0;-webkit-text-decoration:none;text-decoration:none;-webkit-user-select:none;user-select:none}.prc-Token-TokenButton-L3DuN[data-size=small]{height:var(--base-size-16,1rem);width:var(--base-size-16,1rem)}.prc-Token-TokenButton-L3DuN[data-size=medium]{height:var(--base-size-20,1.25rem);width:var(--base-size-20,1.25rem)}.prc-Token-TokenButton-L3DuN[data-size=large]{height:var(--base-size-24,1.5rem);margin-left:var(--base-size-6,.375rem);width:var(--base-size-24,1.5rem)}.prc-Token-TokenButton-L3DuN[data-size=xlarge]{height:var(--base-size-32,2rem);margin-left:var(--base-size-6,.375rem);width:var(--base-size-32,2rem)}.prc-Token-TokenButton-L3DuN:focus,.prc-Token-TokenButton-L3DuN:hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}.prc-Token-TokenButton-L3DuN:active{background-color:var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg))}.prc-components-UnderlineWrapper-eT-Yj{align-items:center;box-shadow:inset 0 -1px var(--borderColor-muted,var(--color-border-muted));display:flex;justify-content:flex-start;min-height:var(--control-xlarge-size,48px);padding-inline:var(--stack-padding-normal,1rem)}.prc-components-UnderlineWrapper-eT-Yj[data-variant=flush]{padding-inline:unset}.prc-components-UnderlineItemList-xKlKC{display:flex;gap:8px;list-style:none;margin:0;padding:0;white-space:nowrap}.prc-components-UnderlineItem-7fP-n,.prc-components-UnderlineItemList-xKlKC{align-items:center;position:relative}.prc-components-UnderlineItem-7fP-n{appearance:none;background-color:initial;border:0;border-radius:var(--borderRadius-medium,var(--borderRadius-small,.1875rem));color:var(--fgColor-default,var(--color-fg-default));cursor:pointer;display:inline-flex;font:inherit;font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-body-lineHeight-medium,1.4285);padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem);text-align:center;-webkit-text-decoration:none;text-decoration:none}}@layer primer-react{}@layer primer-react{@media (hover:hover){.prc-components-UnderlineItem-7fP-n:hover{background-color:var(--bgColor-neutral-muted,var(--color-neutral-subtle));-webkit-text-decoration:none;text-decoration:none;transition:background-color .12s ease-out}}.prc-components-UnderlineItem-7fP-n:focus{box-shadow:inset 0 0 0 2px var(--fgColor-accent,var(--color-accent-fg));outline:2px solid #0000}.prc-components-UnderlineItem-7fP-n:focus:not(:focus-visible){box-shadow:none}.prc-components-UnderlineItem-7fP-n:focus-visible{box-shadow:inset 0 0 0 2px var(--fgColor-accent,var(--color-accent-fg));outline:2px solid #0000}.prc-components-UnderlineItem-7fP-n [data-content]:before{content:attr(data-content);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;visibility:hidden;white-space:nowrap}.prc-components-UnderlineItem-7fP-n [data-component=icon]{align-items:center;color:var(--fgColor-muted,var(--color-fg-muted));display:inline-flex;margin-inline-end:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n [data-component=counter]{align-items:center;display:flex;margin-inline-start:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n:after{background-color:initial;border-radius:0;bottom:calc(50% - var(--control-xlarge-size, var(--base-size-48,3rem))/2 - 1px);content:"";height:2px;pointer-events:none;position:absolute;right:50%;transform:translate(50%,-50%);width:100%}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]) [data-component=text],.prc-components-UnderlineItem-7fP-n[aria-selected=true] [data-component=text]{font-weight:var(--base-text-weight-semibold,600)}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:var(--underlineNav-borderColor-active,var(--color-primer-border-active,#fd8c73))}@media (forced-colors:active){.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:LinkText}}.prc-components-LoadingCounter-dBuLy{animation:prc-components-loadingCounterKeyFrames-8tMlf 1.2s ease-in-out infinite alternate;background-color:var(--bgColor-neutral-muted,var(--color-neutral-subtle));border-color:var(--borderColor-default,var(--color-border-default));border-radius:20px;display:inline-block;height:1rem;width:1.5rem}@keyframes prc-components-loadingCounterKeyFrames-8tMlf{0%{opacity:1}to{opacity:.2}}}@layer primer-react{.prc-Token-TokenTextContainer-cOUaD{background:#0000;border:none;color:inherit;color:currentColor;flex-grow:1;font:inherit;line-height:normal;margin:0;min-width:0;overflow:hidden;padding:0;-webkit-text-decoration:none;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;width:auto;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;appearance:none}.prc-Token-TokenTextContainer-cOUaD:is(a,button,[tabIndex="0"]){cursor:pointer}.prc-Token-TokenTextContainer-cOUaD:is(a,button,[tabIndex="0"]):after{bottom:0;content:"";left:0;position:absolute;right:0;top:0}.prc-Token-Token-A5-r7{background-color:var(--bgColor-neutral-muted,var(--color-neutral-subtle));border-color:var(--borderColor-muted,var(--color-border-muted));border-style:solid;color:var(--fgColor-muted,var(--color-fg-muted));max-width:100%}}@layer primer-react{.prc-Token-Token-A5-r7:where([data-interactive=true]):hover{background-color:var(--bgColor-neutral-muted,var(--color-neutral-subtle));box-shadow:var(--shadow-resting-medium,var(--color-shadow-medium));color:var(--fgColor-default,var(--color-fg-default))}.prc-Token-Token-A5-r7:where([data-is-selected=true]){border-color:var(--borderColor-emphasis,var(--color-fg-subtle));border-style:solid;color:var(--fgColor-default,var(--color-fg-default))}.prc-Token-Token-A5-r7[data-is-remove-btn=true]{padding-right:0}.prc-Token-LeadingVisualContainer-z-WxM{flex-shrink:0;line-height:0;margin-right:var(--base-size-4,.25rem)}.prc-Token-LargeLeadingVisual-foRMf{margin-right:var(--base-size-6,.375rem)}.prc-Breadcrumbs-BreadcrumbsBase-3Gb-B{display:flex;justify-content:space-between;width:100%}.prc-Breadcrumbs-BreadcrumbsList-BKjpe{margin-bottom:0;margin-top:0;padding-left:0}:is([data-overflow=menu],[data-overflow=menu-with-root]) .prc-Breadcrumbs-BreadcrumbsList-BKjpe{display:flex;flex-direction:row;white-space:nowrap}.prc-Breadcrumbs-ItemSeparator-kjXqh{align-self:center;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;justify-content:center;-webkit-user-select:none;user-select:none;white-space:nowrap}.prc-Breadcrumbs-ItemWrapper-k0NLn{list-style:none}.prc-Breadcrumbs-ItemWrapper-k0NLn,.prc-Breadcrumbs-ItemWrapper-k0NLn:after{display:inline-block;font-size:var(--text-body-size-medium,.875rem)}.prc-Breadcrumbs-ItemWrapper-k0NLn:after{border-right:.1em solid var(--fgColor-muted,var(--color-fg-muted));content:"";height:.8em;margin:0 .5em;transform:rotate(15deg) translateY(.0625em)}.prc-Breadcrumbs-ItemWrapper-k0NLn:first-child{margin-left:0}.prc-Breadcrumbs-ItemWrapper-k0NLn:last-child:after{content:none}.prc-Breadcrumbs-Item-jcraJ{display:inline-block;font-size:var(--text-body-size-medium,.875rem)}.prc-Breadcrumbs-Item-jcraJ:focus-visible{border-radius:var(--borderRadius-small,.1875rem);box-shadow:none;outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:2px}[data-variant=normal] .prc-Breadcrumbs-Item-jcraJ{color:var(--fgColor-link,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none}:is([data-variant=normal] .prc-Breadcrumbs-Item-jcraJ):not([aria-current]):hover{-webkit-text-decoration:underline;text-decoration:underline}:is([data-variant=normal] .prc-Breadcrumbs-Item-jcraJ):focus-visible{-webkit-text-decoration:none;text-decoration:none}[aria-current]:is([data-variant=normal] .prc-Breadcrumbs-Item-jcraJ){color:var(--fgColor-default,var(--color-fg-default))}[data-variant=spacious] .prc-Breadcrumbs-Item-jcraJ{border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-default,var(--color-fg-default));padding-block:var(--base-size-4,.25rem);padding-inline:var(--base-size-6,.375rem);-webkit-text-decoration:none;text-decoration:none}:is([data-variant=spacious] .prc-Breadcrumbs-Item-jcraJ):hover{background:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg));-webkit-text-decoration:none;text-decoration:none}[aria-current]:is([data-variant=spacious] .prc-Breadcrumbs-Item-jcraJ){font-weight:var(--base-text-weight-semibold,600)}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs{align-items:center;display:inline-grid;flex:0 99999 auto;grid-auto-flow:column;list-style:none;min-width:auto;white-space:nowrap}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs:has(.prc-Breadcrumbs-MenuOverlay--ayLx){white-space:normal}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs:first-child{margin-left:0}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs:last-child .prc-Breadcrumbs-ItemSeparator-kjXqh{display:none}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuDetails-JOGTj{display:inline-block;position:relative}:is(.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuDetails-JOGTj) summary{cursor:pointer;list-style:none}}@layer primer-react{:is(:is(.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuDetails-JOGTj) summary)::-webkit-details-marker{display:none}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuOverlay--ayLx{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));max-height:100vh;max-width:var(--overlay-width-small,20rem);min-width:var(--overlay-width-xsmall,12rem);overflow:hidden;position:absolute;top:calc(var(--overlay-offset,.25rem) + var(--control-small-size,1.75rem));z-index:1}@media (prefers-reduced-motion:no-preference){.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuOverlay--ayLx{animation:prc-Breadcrumbs-overlay-appear-CSLnF .2s cubic-bezier(.33,1,.68,1)}}}@layer primer-react{.prc-SelectPanel-Overlay-tEbxh{--max-height:0}.prc-SelectPanel-Wrapper-OD-e6{display:flex;flex-direction:column;height:inherit;max-height:inherit}.prc-SelectPanel-Header-p2DSz{align-items:flex-start;display:flex;justify-content:space-between;padding-left:var(--base-size-8,.5rem);padding-right:var(--base-size-8,.5rem);padding-top:var(--base-size-8,.5rem)}.prc-SelectPanel-Header-p2DSz:where([data-variant=fullscreen]){flex-shrink:0;min-height:40px}.prc-SelectPanel-Title-4cax5{font-size:var(--text-body-size-medium,.875rem);margin-left:var(--base-size-8,.5rem)}.prc-SelectPanel-Wrapper-OD-e6[data-variant=modal] .prc-SelectPanel-Title-4cax5{margin-top:var(--base-size-8,.5rem)}@media screen and (max-width:calc(48rem - 0.02px)){.prc-SelectPanel-Wrapper-OD-e6[data-variant=anchored] .prc-SelectPanel-Title-4cax5{margin-top:var(--base-size-8,.5rem)}}.prc-SelectPanel-Subtitle-5L2Fr{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem)}.prc-SelectPanel-Notice-zIRk9,.prc-SelectPanel-Subtitle-5L2Fr{margin-left:var(--base-size-8,.5rem)}.prc-SelectPanel-Notice-zIRk9{margin-right:var(--base-size-8,.5rem);margin-top:var(--base-size-4,.25rem)}.prc-SelectPanel-Notice-zIRk9 a{color:inherit;-webkit-text-decoration:underline;text-decoration:underline}.prc-SelectPanel-Notice-zIRk9:where([data-variant=info]){background-color:var(--bgColor-accent-muted,var(--color-accent-subtle));border-color:var(--borderColor-accent-muted,var(--color-accent-muted));color:var(--fgColor-accent,var(--color-accent-fg))}.prc-SelectPanel-Notice-zIRk9:where([data-variant=warning]){background-color:var(--bgColor-attention-muted,var(--color-attention-subtle));border-color:var(--borderColor-attention-muted,var(--color-attention-muted));color:var(--fgColor-attention,var(--color-attention-fg))}.prc-SelectPanel-Notice-zIRk9:where([data-variant=critical]){background-color:var(--bgColor-danger-muted,var(--color-danger-subtle));border-color:var(--borderColor-danger-muted,var(--color-danger-muted));color:var(--fgColor-danger,var(--color-danger-fg))}.prc-SelectPanel-Footer-Rxa8K{border-top:var(--borderWidth-thin,.0625rem) solid;border-top-color:var(--borderColor-default,var(--color-border-default));display:flex;padding:var(--base-size-8,.5rem)}.prc-SelectPanel-FilteredActionList--VY7U{height:inherit;max-height:inherit}.prc-SelectPanel-Message-4RsG4{align-items:center;display:flex;flex-direction:column;flex-grow:1;gap:var(--base-size-4,.25rem);height:100%;justify-content:center;padding:var(--base-size-24,1.5rem);text-align:center}.prc-SelectPanel-Message-4RsG4 a{color:inherit;-webkit-text-decoration:underline;text-decoration:underline}.prc-SelectPanel-MessageTitle-mTq0E{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-semibold,600)}.prc-SelectPanel-MessageBody-zVnxH{align-items:center;color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);gap:var(--stack-gap-condensed,.5rem)}.prc-SelectPanel-MessageIcon-gpYuP{color:var(--fgColor-attention,var(--color-attention-fg));margin-bottom:var(--base-size-8,.5rem)}.prc-SelectPanel-MessageIcon-gpYuP:where([data-variant=error]){color:var(--fgColor-danger,var(--color-danger-fg))}.prc-SelectPanel-MessageAction-zx88f{margin-top:var(--base-size-8,.5rem)}.prc-SelectPanel-ResponsiveCloseButton-uA7Py{display:inline-grid}.prc-SelectPanel-ResponsiveFooter-qnA4v{align-items:center;display:none;justify-content:center;padding:var(--base-size-8,.5rem)}.prc-SelectPanel-ResponsiveFooter-qnA4v:where([data-display-footer=always]){display:flex}@media screen and (max-width:calc(48rem - 0.02px)){.prc-SelectPanel-ResponsiveFooter-qnA4v:where([data-display-footer=only-small]){display:flex}}.prc-SelectPanel-ResponsiveFooter-qnA4v[data-stretch-secondary-action=never]{justify-content:space-between}@media screen and (max-width:calc(48rem - 0.02px)){.prc-SelectPanel-ResponsiveFooter-qnA4v:where([data-stretch-secondary-action=only-big]){justify-content:space-between}}.prc-SelectPanel-ResponsiveFooter-qnA4v:where([data-stretch-save-button=only-small]){justify-content:space-between}@media screen and (max-width:calc(48rem - 0.02px)){.prc-SelectPanel-ResponsiveFooter-qnA4v:where([data-stretch-save-button=only-small]){justify-content:center}}.prc-SelectPanel-SecondaryAction-AFlHt{align-items:stretch;display:flex;flex-grow:1;justify-content:center}.prc-SelectPanel-SecondaryAction-AFlHt[data-stretch-secondary-action=never]{align-items:flex-start;flex-grow:0}@media screen and (max-width:calc(48rem - 0.02px)){.prc-SelectPanel-SecondaryAction-AFlHt:where([data-stretch-secondary-action=only-big]){align-items:flex-start;flex-grow:0}}.prc-SelectPanel-CancelSaveButtons-DvvZo{display:flex;gap:var(--stack-gap-condensed,.5rem);justify-content:flex-end}.prc-SelectPanel-ResponsiveCancelSaveButtons-e8Csd{display:none}@media screen and (max-width:calc(48rem - 0.02px)){.prc-SelectPanel-ResponsiveCancelSaveButtons-e8Csd{display:flex;gap:var(--stack-gap-condensed,.5rem);justify-content:flex-end}}.prc-SelectPanel-ResponsiveSaveButton-6If1k{display:none}@media screen and (max-width:calc(48rem - 0.02px)){.prc-SelectPanel-ResponsiveSaveButton-6If1k{display:flex}}@media screen and (max-width:calc(48rem - 0.02px)){.prc-SelectPanel-ResponsiveSaveButton-6If1k:where([data-stretch-save-button=only-small]){flex-grow:1}}.prc-SelectPanel-Backdrop-ukvA6{background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));inset:0;position:absolute}.prc-SelectPanel-TextInput--Qqkq{margin:var(--base-size-8,.5rem)}}@layer primer-react{@keyframes prc-Skeleton-shimmer---lzU{0%{mask-position:200%}to{mask-position:0}}.prc-Skeleton-SkeletonBox-e93nW{animation:prc-Skeleton-shimmer---lzU;background-color:var(--skeletonLoader-bgColor,#818b981a);border-radius:var(--borderRadius-small,.1875rem);display:block;height:1rem}@media (prefers-reduced-motion:no-preference){.prc-Skeleton-SkeletonBox-e93nW{animation:prc-Skeleton-shimmer---lzU;animation-duration:var(--base-duration-1000,1s);animation-iteration-count:infinite;mask-image:linear-gradient(75deg,#000 30%,#000000a6 80%);mask-size:200%}}@media (forced-colors:active){.prc-Skeleton-SkeletonBox-e93nW{outline:1px solid #0000;outline-offset:-1px}}}@layer primer-react{.prc-TextInputWithTokens-TextInputWrapper-HAIfc{padding-bottom:var(--base-size-6,.375rem);padding-left:var(--base-size-12,.75rem);padding-top:var(--base-size-6,.375rem)}.prc-TextInputWithTokens-TextInputWrapper-HAIfc:where([data-block]){display:flex;width:100%}.prc-TextInputWithTokens-TextInputWrapper-HAIfc:where([data-token-wrapping=true]){overflow:auto}.prc-TextInputWithTokens-UnstyledTextInput-XwhBc{height:100%}.prc-TextInputWithTokens-InputWrapper-1lXK5{flex-grow:1;order:1}.prc-TextInputWithTokens-Container-dPCL7{align-items:center;display:flex;flex-grow:1;flex-wrap:wrap;margin-bottom:calc(var(--base-size-4,.25rem)*-1);margin-left:calc(var(--base-size-4,.25rem)*-1)}.prc-TextInputWithTokens-Container-dPCL7:where([data-prevent-token-wrapping=true]){flex-wrap:nowrap}.prc-TextInputWithTokens-Container-dPCL7>*{flex-shrink:0;margin-bottom:var(--base-size-4,.25rem);margin-left:var(--base-size-4,.25rem)}.prc-TextInputWithTokens-OverflowCountSmall-HJUP6{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem)}.prc-TextInputWithTokens-OverflowCountLarge-caBt8,.prc-TextInputWithTokens-OverflowCountMedium-uq-gt{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-medium,.875rem)}.prc-TextInputWithTokens-OverflowCountXLarge-A-rpJ{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-large,1rem)}.prc-Details-Details-GckmQ>summary{list-style:none}}@layer primer-react{.prc-Details-Details-GckmQ>summary::-webkit-details-marker{display:none}}@layer primer-react{.prc-Banner-Banner-IPLJ2{align-items:start;background-color:var(--banner-bgColor);border:var(--borderWidth-thin,.0625rem) solid var(--banner-borderColor);border-radius:var(--borderRadius-medium,.375rem);display:grid;grid-template-columns:auto minmax(0,1fr) auto;padding:var(--base-size-8,.5rem)}@supports (container-type:inline-size){.prc-Banner-Banner-IPLJ2[data-actions-layout=default]{container:banner/inline-size}}.prc-Banner-Banner-IPLJ2[data-actions-layout=stacked] .prc-Banner-BannerContainer-T-Siu{flex-direction:column}.prc-Banner-Banner-IPLJ2[data-actions-layout=stacked] .prc-Banner-BannerActions-gvCLf :where([data-primary-action=trailing]){display:none}.prc-Banner-Banner-IPLJ2[data-actions-layout=stacked] .prc-Banner-BannerActions-gvCLf :where([data-primary-action=leading]){display:flex}.prc-Banner-Banner-IPLJ2[data-actions-layout=inline] .prc-Banner-BannerContainer-T-Siu{flex-wrap:nowrap}.prc-Banner-Banner-IPLJ2[data-actions-layout=inline] .prc-Banner-BannerActions-gvCLf{flex:0 0 auto}.prc-Banner-Banner-IPLJ2[data-actions-layout=inline] .prc-Banner-BannerActions-gvCLf :where([data-primary-action=trailing]){display:flex}.prc-Banner-Banner-IPLJ2[data-actions-layout=inline] .prc-Banner-BannerActions-gvCLf :where([data-primary-action=leading]){display:none}.prc-Banner-Banner-IPLJ2[data-layout=compact]{padding:var(--base-size-4,.25rem)}.prc-Banner-Banner-IPLJ2[data-flush]{border-left:none;border-radius:0;border-right:none}.prc-Banner-Banner-IPLJ2[data-variant=critical]{--banner-bgColor:var(--bgColor-danger-muted,var(--color-danger-subtle));--banner-borderColor:var(--borderColor-danger-muted,var(--color-danger-muted));--banner-icon-fgColor:var(--fgColor-danger,var(--color-danger-fg))}.prc-Banner-Banner-IPLJ2[data-variant=info]{--banner-bgColor:var(--bgColor-accent-muted,var(--color-accent-subtle));--banner-borderColor:var(--borderColor-accent-muted,var(--color-accent-muted));--banner-icon-fgColor:var(--fgColor-accent,var(--color-accent-fg))}.prc-Banner-Banner-IPLJ2[data-variant=success]{--banner-bgColor:var(--bgColor-success-muted,var(--color-success-subtle));--banner-borderColor:var(--borderColor-success-muted,var(--color-success-muted));--banner-icon-fgColor:var(--fgColor-success,var(--color-success-fg))}.prc-Banner-Banner-IPLJ2[data-variant=upsell]{--banner-bgColor:var(--bgColor-upsell-muted,#fbefff);--banner-borderColor:var(--borderColor-upsell-muted,#c297ff66);--banner-icon-fgColor:var(--fgColor-upsell,#8250df)}.prc-Banner-Banner-IPLJ2[data-variant=warning]{--banner-bgColor:var(--bgColor-attention-muted,var(--color-attention-subtle));--banner-borderColor:var(--borderColor-attention-muted,var(--color-attention-muted));--banner-icon-fgColor:var(--fgColor-attention,var(--color-attention-fg))}.prc-Banner-BannerContainer-T-Siu{align-items:start;column-gap:var(--base-size-4,.25rem);font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-body-lineHeight-medium,1.42857);row-gap:var(--base-size-4,.25rem)}.prc-Banner-Banner-IPLJ2 :where(.prc-Banner-BannerContainer-T-Siu){display:flex;flex-wrap:wrap;justify-content:space-between}.prc-Banner-Banner-IPLJ2[data-dismissible]:not([data-title-hidden],[data-actions-layout=inline]) .prc-Banner-BannerContainer-T-Siu{display:grid;grid-template-columns:auto;grid-template-rows:auto}.prc-Banner-BannerContent-LraS2{display:grid;grid-column-start:1;margin-block:var(--base-size-8,.5rem);row-gap:var(--base-size-4,.25rem)}.prc-Banner-Banner-IPLJ2[data-title-hidden]:not(:has(.prc-Banner-BannerActions-gvCLf)) .prc-Banner-BannerContent-LraS2{margin-block:var(--base-size-6,.375rem)}@media screen and (min-width:544px){.prc-Banner-BannerContent-LraS2{flex:1 1 0%}}.prc-Banner-BannerTitle-T4z0L{font-size:inherit;font-weight:var(--base-text-weight-semibold,600);margin:0}.prc-Banner-BannerIcon-o4ayx{display:grid;padding:var(--base-size-8,.5rem);place-items:center}.prc-Banner-BannerIcon-o4ayx svg{color:var(--banner-icon-fgColor);height:var(--base-size-20,1.25rem);fill:var(--banner-icon-fgColor)}.prc-Banner-Banner-IPLJ2[data-title-hidden]:not(:has(.prc-Banner-BannerActions-gvCLf)) .prc-Banner-BannerIcon-o4ayx svg{height:var(--base-size-16,1rem)}.prc-Banner-BannerDismiss-b12FL{display:grid;margin-inline-start:var(--base-size-4,.25rem);padding:var(--base-size-8,.5rem);place-items:center}:where(.prc-Banner-Banner-IPLJ2):has(.prc-Banner-BannerActions-gvCLf) .prc-Banner-BannerDismiss-b12FL{margin-block:var(--base-size-2,.125rem)}.prc-Banner-BannerDismiss-b12FL svg{color:var(--banner-icon-fgColor)}.prc-Banner-BannerActionsContainer-PdBu1{align-items:center;column-gap:var(--base-size-12,.75rem);display:flex;margin-block:var(--base-size-2,.125rem)}.prc-Banner-BannerActions-gvCLf :where([data-primary-action=trailing]){display:none}.prc-Banner-Banner-IPLJ2[data-dismissible]:not([data-title-hidden],[data-actions-layout=inline]) .prc-Banner-BannerActions-gvCLf{margin-block-end:var(--base-size-6,.375rem)}.prc-Banner-Banner-IPLJ2[data-dismissible]:not([data-title-hidden],[data-actions-layout=inline]) .prc-Banner-BannerActionsContainer-PdBu1[data-primary-action=trailing]{display:none}.prc-Banner-Banner-IPLJ2[data-dismissible]:not([data-title-hidden],[data-actions-layout=inline]) .prc-Banner-BannerActionsContainer-PdBu1[data-primary-action=leading]{display:flex}@container banner (max-width: 500px){.prc-Banner-BannerContainer-T-Siu{display:grid}.prc-Banner-BannerContainer-T-Siu:has(.prc-Banner-BannerActionsContainer-PdBu1){grid-template-rows:auto auto}.prc-Banner-BannerActions-gvCLf{margin-block-end:var(--base-size-6,.375rem)}.prc-Banner-BannerActions-gvCLf [data-primary-action=trailing]{display:none}.prc-Banner-BannerActions-gvCLf [data-primary-action=leading]{display:flex}}@container banner (min-width: 500px){.prc-Banner-BannerContainer-T-Siu{display:grid;grid-template-columns:auto auto}:where(.prc-Banner-Banner-IPLJ2):not([data-dismissible]) :where(.prc-Banner-BannerActionsContainer-PdBu1[data-primary-action=trailing]) :where([data-variant=link]:only-child){padding-inline:0 var(--base-size-12,.75rem)}.prc-Banner-BannerActions-gvCLf [data-primary-action=trailing]{display:flex;min-height:var(--base-size-32,2rem)}.prc-Banner-BannerActions-gvCLf [data-primary-action=leading]{display:none}}}@layer primer-react{.prc-FilteredActionList-LoadingSkeleton-VKyQq{border-radius:4px}.prc-FilteredActionList-LoadingSpinner-I3a7Y{align-content:center;flex-grow:1;height:100%;padding:var(--base-size-16,1rem);text-align:center}.prc-FilteredActionList-LoadingSkeletonContainer-FMeRG{display:flex;flex-direction:column;flex-grow:1;padding:var(--base-size-8,.5rem)}.prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium{position:relative}.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:none;position:absolute;right:var(--base-size-8,.5rem);top:var(--base-size-8,.5rem)}}@layer primer-react{@media screen and (max-width:calc(48rem - 0.02px)){.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:inline-grid}}}@layer primer-react{.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-variant=fullscreen]){padding-top:var(--base-size-36,2.25rem)}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-overflow-auto]){overflow:auto}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-overflow-hidden]){overflow:hidden}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-overflow-scroll]){overflow:scroll}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-overflow-visible]){overflow:visible}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-max-height-xsmall]){max-height:192px}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-max-height-small]){max-height:256px}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-max-height-medium]){max-height:320px}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-max-height-large]){max-height:432px}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-max-height-xlarge]){max-height:600px}.prc-ActionMenu-ActionMenuContainer-Om1Qz:where([data-max-height-fit-content]){max-height:-moz-fit-content;max-height:fit-content}}@layer primer-react{:where(.prc-Avatar-Avatar-0xaUi){border-radius:50%;box-shadow:0 0 0 1px var(--avatar-borderColor,var(--color-avatar-border));display:inline-block;height:var(--avatarSize-regular);line-height:1;overflow:hidden;vertical-align:middle;width:var(--avatarSize-regular)}:where(.prc-Avatar-Avatar-0xaUi):where([data-square]){border-radius:clamp(4px,calc(var(--avatarSize-regular) - 24px),var(--borderRadius-medium,.375rem))}@media screen and (max-width:calc(48rem - 0.02px)){:where(.prc-Avatar-Avatar-0xaUi):where([data-responsive]){height:var(--avatarSize-narrow);width:var(--avatarSize-narrow)}}@media screen and (min-width:48rem){:where(.prc-Avatar-Avatar-0xaUi):where([data-responsive]){height:var(--avatarSize-regular);width:var(--avatarSize-regular)}}@media screen and (min-width:87.5rem){:where(.prc-Avatar-Avatar-0xaUi):where([data-responsive]){height:var(--avatarSize-wide);width:var(--avatarSize-wide)}}}@layer primer-react{.prc-Textarea-TextArea-snlco{appearance:none;background-color:initial;border:0;color:inherit;font-family:inherit;font-size:inherit;resize:both;width:100%}.prc-Textarea-TextArea-snlco:focus{outline:0}.prc-Textarea-TextArea-snlco[data-resize=none]{resize:none}.prc-Textarea-TextArea-snlco[data-resize=both]{resize:both}.prc-Textarea-TextArea-snlco[data-resize=horizontal]{resize:horizontal}.prc-Textarea-TextArea-snlco[data-resize=vertical]{resize:vertical}.prc-Textarea-TextArea-snlco:disabled{resize:none}.prc-Textarea-CharacterCounter-qnOXd{align-items:center;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;gap:var(--control-xsmall-gap,.25rem)}.prc-Textarea-CharacterCounter--error-eewrs{color:var(--fgColor-danger,var(--color-danger-fg))}.prc-FilteredActionList-Root-QgIk1{display:flex;flex-direction:column;overflow:hidden}.prc-FilteredActionList-Header-y6ihu{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));z-index:1}.prc-FilteredActionList-Container-647gF{display:flex;height:100%;overflow:auto}.prc-FilteredActionList-ActionList-3-Bxb,.prc-FilteredActionList-Container-647gF{flex-grow:1}.prc-FilteredActionList-ActionListItem-RSinr:focus{background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg))}.prc-FilteredActionList-ActionListItem-RSinr:focus:after{background:var(--borderColor-accent-emphasis,var(--color-accent-emphasis));border-radius:var(--borderRadius-medium,.375rem);content:"";height:calc(100% - var(--base-size-8,.5rem));left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:var(--base-size-4,.25rem);width:var(--base-size-4,.25rem)}}@layer primer-react{.prc-FilteredActionList-ActionListItem-RSinr:where([data-input-focused]):where([data-first-child]){background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg))}.prc-FilteredActionList-ActionListItem-RSinr:where([data-input-focused]):where([data-first-child]):after{background:var(--borderColor-accent-emphasis,var(--color-accent-emphasis));border-radius:var(--borderRadius-medium,.375rem);content:"";height:calc(100% - var(--base-size-8,.5rem));left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:var(--base-size-4,.25rem);width:var(--base-size-4,.25rem)}@media screen and (max-width:calc(48rem - 0.02px)){@supports (-webkit-touch-callout:none){.prc-FilteredActionList-FullScreenTextInput-CJvWO{font-size:var(--text-title-size-small,1rem)}}}.prc-FilteredActionList-SelectAllContainer-X2ij0{align-items:center;background:var(--bgColor-muted,var(--color-canvas-subtle));border-bottom:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));display:flex;padding-block:var(--base-size-4,.25rem);padding-inline:var(--base-size-16,1rem)}.prc-FilteredActionList-SelectAllCheckbox-Axs5l{margin:var(--base-size-4,.25rem) var(--base-size-8,.5rem) calc(var(--base-size-4,.25rem) - 1px) 0}.prc-FilteredActionList-SelectAllLabel-Bi-PZ{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-medium,.875rem)}.prc-CircleBadge-CircleBadge-tNGX1{align-items:center;background-color:var(--bgColor-default,var(--color-canvas-default));border-radius:50%;box-shadow:var(--shadow-resting-medium,var(--color-shadow-medium));display:flex;justify-content:center}}@layer primer-react{.prc-CircleBadge-CircleBadge-tNGX1:where([data-inline]){display:inline-flex}.prc-CircleBadge-CircleBadgeIcon-h73Dg{height:auto;max-height:55%;max-width:60%}.prc-Flash-Flash-q6HW0{border-radius:var(--borderRadius-medium,.375rem);border-style:solid;border-width:var(--borderWidth-thin,.0625rem);color:var(--fgColor-default,var(--color-fg-default));margin-top:0;padding:var(--base-size-16,1rem);position:relative}}@layer primer-react{.prc-Flash-Flash-q6HW0:where([data-variant=default]){background-color:var(--bgColor-accent-muted,var(--color-accent-subtle));border-color:var(--borderColor-accent-muted,var(--color-accent-muted))}.prc-Flash-Flash-q6HW0:where([data-variant=default]) :where(svg){color:var(--fgColor-accent,var(--color-accent-fg))}.prc-Flash-Flash-q6HW0:where([data-variant=success]){background-color:var(--bgColor-success-muted,var(--color-success-subtle));border-color:var(--borderColor-success-muted,var(--color-success-muted))}.prc-Flash-Flash-q6HW0:where([data-variant=success]) :where(svg){color:var(--fgColor-success,var(--color-success-fg))}.prc-Flash-Flash-q6HW0:where([data-variant=danger]){background-color:var(--bgColor-danger-muted,var(--color-danger-subtle));border-color:var(--borderColor-danger-muted,var(--color-danger-muted))}.prc-Flash-Flash-q6HW0:where([data-variant=danger]) :where(svg){color:var(--fgColor-danger,var(--color-danger-fg))}.prc-Flash-Flash-q6HW0:where([data-variant=warning]){background-color:var(--bgColor-attention-muted,var(--color-attention-subtle));border-color:var(--borderColor-attention-muted,var(--color-attention-muted))}.prc-Flash-Flash-q6HW0:where([data-variant=warning]) :where(svg){color:var(--fgColor-attention,var(--color-attention-fg))}.prc-Flash-Flash-q6HW0:where([data-full]){border-radius:0;border-width:var(--borderWidth-thin,.0625rem) 0;margin-top:-1px}.prc-Flash-Flash-q6HW0 :where(p:last-child){margin-bottom:0}.prc-Flash-Flash-q6HW0 :where(svg){margin-right:var(--base-size-8,.5rem)}}@layer primer-react{:where(.prc-Label-Label-qG-Zu){align-items:center;background-color:initial;border-radius:var(--borderRadius-full,624.9375rem);border-style:solid;border-width:var(--borderWidth-thin,.0625rem);color:var(--fgColor-default,var(--color-fg-default));display:inline-flex;font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-medium,500);line-height:1;white-space:nowrap}:where(.prc-Label-Label-qG-Zu):where([data-size=small]){height:var(--base-size-20,1.25rem);padding:0 var(--base-size-6,.375rem)}:where(.prc-Label-Label-qG-Zu):where([data-size=large]){height:var(--base-size-24,1.5rem);padding:0 var(--base-size-8,.5rem)}:where(.prc-Label-Label-qG-Zu):where([data-variant=default]){border-color:var(--borderColor-default,var(--color-border-default))}:where(.prc-Label-Label-qG-Zu):where([data-variant=primary]){border-color:var(--fgColor-default,var(--color-fg-default))}:where(.prc-Label-Label-qG-Zu):where([data-variant=secondary]){border-color:var(--borderColor-muted,var(--color-border-muted));color:var(--fgColor-muted,var(--color-fg-muted))}:where(.prc-Label-Label-qG-Zu):where([data-variant=accent]){border-color:var(--bgColor-accent-emphasis,var(--color-accent-emphasis));color:var(--fgColor-accent,var(--color-accent-fg))}:where(.prc-Label-Label-qG-Zu):where([data-variant=success]){border-color:var(--bgColor-success-emphasis,var(--color-success-emphasis));color:var(--fgColor-success,var(--color-success-fg))}:where(.prc-Label-Label-qG-Zu):where([data-variant=attention]){border-color:var(--bgColor-attention-emphasis,var(--color-attention-emphasis));color:var(--fgColor-attention,var(--color-attention-fg))}:where(.prc-Label-Label-qG-Zu):where([data-variant=severe]){border-color:var(--bgColor-severe-emphasis,var(--color-severe-emphasis));color:var(--fgColor-severe,var(--color-severe-fg))}:where(.prc-Label-Label-qG-Zu):where([data-variant=danger]){border-color:var(--borderColor-danger-emphasis,var(--color-danger-emphasis));color:var(--fgColor-danger,var(--color-danger-fg))}:where(.prc-Label-Label-qG-Zu):where([data-variant=done]){border-color:var(--bgColor-done-emphasis,var(--color-done-emphasis));color:var(--fgColor-done,var(--color-done-fg))}:where(.prc-Label-Label-qG-Zu):where([data-variant=sponsors]){border-color:var(--bgColor-sponsors-emphasis,var(--color-sponsors-emphasis));color:var(--fgColor-sponsors,var(--color-sponsors-fg))}}@layer primer-react{.prc-Header-Header-zcBYI{background-color:var(--header-bgColor,var(--color-header-bg));color:var(--header-fgColor-default,var(--color-header-text));font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-title-lineHeight-large,1.5);overflow:auto;padding:var(--base-size-16,1rem);z-index:32}.prc-Header-Header-zcBYI,.prc-Header-HeaderItem-BPQgk{align-items:center;display:flex;flex-wrap:nowrap}.prc-Header-HeaderItem-BPQgk{align-self:stretch;margin-right:var(--base-size-16,1rem)}.prc-Header-HeaderItem-BPQgk:where([data-full]){flex:auto}.prc-Header-HeaderLink-NpVNI{align-items:center;color:var(--header-fgColor-logo,var(--color-header-logo));cursor:pointer;display:flex;font-weight:var(--text-title-weight-large,600);-webkit-text-decoration:none;text-decoration:none;white-space:nowrap}.prc-Header-HeaderLink-NpVNI:focus,.prc-Header-HeaderLink-NpVNI:hover{color:var(--header-fgColor-default,var(--color-header-text))}.prc-NavList-GroupHeading-mN50z>a{color:var(--fgColor-default,var(--color-fg-default));text-decoration:inherit}.prc-NavList-GroupHeading-mN50z>a:hover{-webkit-text-decoration:underline;text-decoration:underline}.prc-SegmentedControl-SegmentedControl-lqIXp{--segmented-control-icon-width:32px;background-color:var(--controlTrack-bgColor-rest,var(--color-switch-track-bg));border:var(--borderWidth-thin,.0625rem) solid var(--controlTrack-borderColor-rest,#0000);border-radius:var(--borderRadius-medium,.375rem);display:inline-flex;font-size:var(--text-body-size-medium,.875rem);height:32px;margin:0;padding:0}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}@layer primer-react{}@layer primer-react{@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-narrow=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-narrow=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}@media (min-width:48rem){.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-regular=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-regular=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}@media (min-width:87.5rem){.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-wide=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-regular=true]:not([data-full-width-wide=true]),.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-wide=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant=dropdown],.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant=hideLabels] .prc-SegmentedControl-Text-7S2y2{display:none}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-narrow=dropdown],.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-narrow=hideLabels] .prc-SegmentedControl-Text-7S2y2{display:none}}@media (min-width:48rem){.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-regular=dropdown],.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-regular=hideLabels] .prc-SegmentedControl-Text-7S2y2{display:none}}@media (min-width:87.5rem){.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-wide=dropdown],.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-wide=hideLabels] .prc-SegmentedControl-Text-7S2y2{display:none}}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);height:28px}.prc-SegmentedControl-DropdownContainer-ZaPMn{display:none}.prc-SegmentedControl-DropdownContainer-ZaPMn[data-variant=dropdown]{display:block}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-DropdownContainer-ZaPMn[data-variant-narrow=dropdown]{display:block}}@media (min-width:48rem){.prc-SegmentedControl-DropdownContainer-ZaPMn[data-variant-regular=dropdown]{display:block}}@media (min-width:87.5rem){.prc-SegmentedControl-DropdownContainer-ZaPMn[data-variant-wide=dropdown]{display:block}}.prc-SegmentedControl-Item-tSCQh{display:block;flex-grow:1;margin-bottom:-1px;margin-top:-1px;position:relative}.prc-SegmentedControl-Item-tSCQh:not(:last-child){margin-right:1px}.prc-SegmentedControl-Item-tSCQh:not(:last-child):after{background-color:var(--borderColor-default,var(--color-border-default));bottom:var(--base-size-8,.5rem);content:"";position:absolute;right:calc(var(--base-size-2,.125rem)*-1);top:var(--base-size-8,.5rem);width:1px}.prc-SegmentedControl-Item-tSCQh:not(:last-child):has(+[data-selected]):after,.prc-SegmentedControl-Item-tSCQh:not(:last-child):where([data-selected]):after{background-color:initial}.prc-SegmentedControl-Item-tSCQh:focus-within:has(:focus-visible){background-color:initial}.prc-SegmentedControl-Item-tSCQh:first-child{margin-left:-1px}.prc-SegmentedControl-Item-tSCQh:last-child{margin-right:-1px}.prc-SegmentedControl-Item-tSCQh .prc-SegmentedControl-Counter-GmZOI{align-items:center;display:flex;margin-inline-start:var(--base-size-8,.5rem)}.prc-SegmentedControl-Button-E48xz{--segmented-control-button-inner-padding:12px;--segmented-control-button-bg-inset:4px;--segmented-control-outer-radius:var(--borderRadius-medium,0.375rem);background-color:initial;border-color:#0000;border-radius:var(--segmented-control-outer-radius);border-width:0;color:currentColor;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:var(--base-text-weight-normal,400);height:100%;padding:var(--segmented-control-button-bg-inset);width:100%}.prc-SegmentedControl-Button-E48xz svg{fill:var(--fgColor-muted,var(--color-fg-muted));color:var(--fgColor-muted,var(--color-fg-muted))}.prc-SegmentedControl-Button-E48xz:focus:not(:disabled){box-shadow:none;outline:var(--base-size-2,.125rem) solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-1px}.prc-SegmentedControl-Button-E48xz:focus:not(:disabled):not(:focus-visible){outline:1px solid #0000}.prc-SegmentedControl-Button-E48xz:focus-visible:not(:disabled){box-shadow:none;outline:var(--base-size-2,.125rem) solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-1px}.prc-SegmentedControl-Button-E48xz:focus:focus-visible:not(:last-child):after{width:0}.prc-SegmentedControl-Button-E48xz[aria-disabled=true]:not([aria-current=true]){background-color:initial;color:var(--fgColor-disabled,var(--color-primer-fg-disabled));cursor:not-allowed}.prc-SegmentedControl-Button-E48xz[aria-disabled=true]:not([aria-current=true]) svg{fill:var(--fgColor-disabled,var(--color-primer-fg-disabled));color:var(--fgColor-disabled,var(--color-primer-fg-disabled))}@media (pointer:coarse){.prc-SegmentedControl-Button-E48xz:before{content:"";left:0;min-height:44px;position:absolute;right:0;top:50%;transform:translateY(-50%)}}.prc-SegmentedControl-IconButton-tlzDE{width:var(--segmented-control-icon-width,32px)}.prc-SegmentedControl-Content-1COlk{align-items:center;border-color:#0000;border-radius:calc(var(--segmented-control-outer-radius) - var(--segmented-control-button-bg-inset)/2);border-style:solid;border-width:var(--borderWidth-thin,.0625rem);display:flex;height:100%;justify-content:center;padding-left:calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));padding-right:calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset))}.prc-SegmentedControl-Button-E48xz[aria-current=true]{font-weight:var(--base-text-weight-semibold,600);padding:0}.prc-SegmentedControl-Button-E48xz[aria-current=true] .prc-SegmentedControl-Content-1COlk{background-color:var(--controlKnob-bgColor-rest,var(--color-switch-knob-bg));border-color:var(--controlKnob-borderColor-rest,var(--color-switch-knob-border));border-radius:var(--segmented-control-outer-radius);padding-left:var(--segmented-control-button-inner-padding);padding-right:var(--segmented-control-button-inner-padding)}.prc-SegmentedControl-Button-E48xz:not([aria-current=true],[aria-disabled=true]):hover .prc-SegmentedControl-Content-1COlk{background-color:var(--controlTrack-bgColor-hover,var(--color-switch-track-hover-bg))}.prc-SegmentedControl-Button-E48xz:not([aria-current=true],[aria-disabled=true]):active .prc-SegmentedControl-Content-1COlk{background-color:var(--controlTrack-bgColor-active,var(--color-switch-track-active-bg))}.prc-SegmentedControl-Text-7S2y2:after{content:attr(data-text);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;overflow:hidden;pointer-events:none;-webkit-user-select:none;user-select:none;visibility:hidden}.prc-SegmentedControl-LeadingIcon-74n5s{margin-right:var(--base-size-4,.25rem)}.prc-SubNav-SubNav-rFG0y{display:flex;justify-content:space-between}.prc-SubNav-Body-lEnuM{display:flex;margin-bottom:-1px}.prc-SubNav-Body-lEnuM>*{margin-left:var(--base-size-8,.5rem)}.prc-SubNav-Body-lEnuM>:first-child{margin-left:0}.prc-SubNav-Actions-iCuaN{align-self:center}.prc-SubNav-Link-iCE7h,.prc-SubNav-Links-2ibrQ{display:flex}.prc-SubNav-Link-iCE7h{align-items:center;border-bottom:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));border-right:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));border-top:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));color:var(--fgColor-default,var(--color-fg-default));font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-medium,500);line-height:20px;min-height:34px;padding-left:var(--base-size-16,1rem);padding-right:var(--base-size-16,1rem);text-align:center;-webkit-text-decoration:none;text-decoration:none}.prc-SubNav-Link-iCE7h:first-of-type{border-bottom-left-radius:var(--borderRadius-medium,.375rem);border-left:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));border-top-left-radius:var(--borderRadius-medium,.375rem)}.prc-SubNav-Link-iCE7h:last-of-type{border-bottom-right-radius:var(--borderRadius-medium,.375rem);border-top-right-radius:var(--borderRadius-medium,.375rem)}.prc-SubNav-Link-iCE7h:focus,.prc-SubNav-Link-iCE7h:hover{background-color:var(--bgColor-muted,var(--color-canvas-subtle));-webkit-text-decoration:none;text-decoration:none;transition:background-color .2s ease}.prc-SubNav-Link-iCE7h:is([data-selected=true]){background-color:var(--bgColor-accent-emphasis,var(--color-accent-emphasis));border-color:var(--bgColor-accent-emphasis,var(--color-accent-emphasis));color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-Timeline-Timeline-awSoC{display:flex;flex-direction:column}}@layer primer-react{}@layer primer-react{.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child{padding-top:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child):where([data-condensed]):before{top:var(--base-size-12,.75rem)}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child{padding-bottom:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child):where([data-condensed]):before{height:var(--base-size-12,.75rem)}.prc-Timeline-TimelineItem-QwDVH{display:flex;margin-left:var(--base-size-16,1rem);padding:var(--base-size-16,1rem) 0;position:relative}.prc-Timeline-TimelineItem-QwDVH:before{background-color:var(--borderColor-muted,var(--color-border-muted));bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:2px}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]){padding-bottom:0;padding-top:var(--base-size-4,.25rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]):last-child{padding-bottom:var(--base-size-16,1rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]) .prc-Timeline-TimelineBadge-u0qSm{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;color:var(--fgColor-muted,var(--color-fg-muted));height:16px;margin-bottom:var(--base-size-8,.5rem);margin-top:var(--base-size-8,.5rem)}.prc-Timeline-TimelineBadgeWrapper-SZw4k{position:relative;z-index:1}.prc-Timeline-TimelineBadge-u0qSm{align-items:center;background-color:var(--timelineBadge-bgColor,var(--color-timeline-badge-bg));border-color:var(--bgColor-default,var(--color-canvas-default));border-radius:50%;border-style:solid;border-width:var(--borderWidth-thick,.125rem);display:flex;flex-shrink:0;height:32px;justify-content:center;margin-left:-15px;margin-right:var(--base-size-8,.5rem);overflow:hidden;width:32px}.prc-Timeline-TimelineBadge-u0qSm,.prc-Timeline-TimelineBody-tjOtb{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-Timeline-TimelineBody-tjOtb{flex:auto;font-size:var(--text-body-size-medium,.875rem);margin-top:var(--base-size-4,.25rem);max-width:100%;min-width:0}.prc-Timeline-TimelineBreak-X8eti{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;border-top:var(--borderWidth-thicker,.25rem) solid var(--borderColor-default,var(--color-border-default));height:var(--base-size-24,1.5rem);margin:0;margin-bottom:calc(var(--base-size-16,1rem)*-1);margin-left:0;position:relative;z-index:1}.prc-Timeline-TimelineBreak-X8eti:has(+[data-condensed]){margin-bottom:calc(var(--base-size-12,.75rem)*-1)}.prc-UnderlineNav-MenuItemContent-3J7gB{align-items:center;display:flex;justify-content:space-between}.prc-UnderlineNav-MoreButton-Y8soj{background:#0000;border:0;box-shadow:none;font-weight:var(--base-text-weight-normal,400);margin:0;padding:var(--base-size-4,.25rem) var(--base-size-8,.5rem)}.prc-UnderlineNav-MoreButton-Y8soj>[data-component=trailingVisual]{margin-left:0}.prc-UnderlineNav-UnderlineNavItem-syRjR{align-items:center;display:flex;flex-direction:column}.prc-Pagehead-Pagehead-DKxNa{border-bottom:1px solid var(--borderColor-default,var(--color-border-default));margin-bottom:var(--base-size-24,1.5rem);padding-bottom:var(--base-size-24,1.5rem);padding-top:var(--base-size-24,1.5rem);position:relative}.prc-ActionList-Header-585kg{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--text-title-weight-large,600);padding:6px var(--base-size-16,1rem)}}@layer primer-react{}@layer primer-react{}@layer primer-react{}@layer primer-react{.prc-ActionList-Header-585kg:where([data-filled]){background:var(--bgColor-muted,var(--color-canvas-subtle));border-bottom:var(--borderWidth-thin,.0625rem) solid var(--bgColor-neutral-muted,var(--color-neutral-subtle));border-top:var(--borderWidth-thin,.0625rem) solid var(--bgColor-neutral-muted,var(--color-neutral-subtle));margin:var(--base-size-8,.5rem) 0}.prc-ActionList-Header-585kg:where([data-filled]):first-child{margin-top:0}}@layer primer-react{.prc-ActionList-DividedContent-qks5p{position:relative}.prc-ActionList-DividedContent-qks5p,.prc-ActionList-MainContent-XZAI3{display:flex;flex-grow:1;min-width:0}.prc-ActionList-MainContent-XZAI3{align-items:baseline;flex-direction:var(--main-content-flex-direction)}.prc-ActionList-Item-eN6NY{border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-default,var(--color-fg-default));display:flex;padding:6px var(--base-size-8,.5rem);-webkit-text-decoration:none;text-decoration:none;transition:background 33.333ms linear}.prc-ActionList-Item--danger-2UZJs{color:var(--fgColor-danger,var(--color-danger-fg))}.prc-ActionList-Item--disabled-6k-1w{color:var(--fgColor-disabled,var(--color-primer-fg-disabled));cursor:default}@media (hover:hover) and (pointer:fine){.prc-ActionList-Item-eN6NY:hover{background:var(--item-hover-bg-override,var(--bgColor-muted,var(--color-canvas-subtle)));cursor:pointer}.prc-ActionList-Item--danger-2UZJs:hover{background:var(--item-hover-bg-override,var(--bgColor-danger-muted,var(--color-danger-subtle)));color:var(--fgColor-danger,var(--color-danger-fg))}.prc-ActionList-Item--disabled-6k-1w:hover{background:#0000;cursor:default}}.prc-ActionList-Item-eN6NY:not(:first-of-type):not([data-component="ActionList.Divider"]+*):not([data-component="ActionList.Header"]+*){margin-top:0}.prc-ActionList-Item-eN6NY:not(:first-of-type):not([data-component="ActionList.Divider"]+*):not([data-component="ActionList.Header"]+*) :where([data-divider]){margin-top:1px}.prc-ActionList-Item-eN6NY:not(:first-of-type):not([data-component="ActionList.Divider"]+*):not([data-component="ActionList.Header"]+*) .prc-ActionList-DividedContent-qks5p:before{border-top-width:0;border:0 solid var(--borderColor-muted,var(--color-border-muted));content:" ";display:block;position:absolute;top:-7px;width:100%}:where([data-divider]) .prc-ActionList-DividedContent-qks5p:before{border-top-width:1px}.prc-ActionList-Item-eN6NY:hover .prc-ActionList-DividedContent-qks5p:before,:hover+.prc-ActionList-Item-eN6NY .prc-ActionList-DividedContent-qks5p:before{border-color:var(--item-hover-divider-border-color-override,#0000)!important}.prc-ActionList-Item-eN6NY:focus .prc-ActionList-DividedContent-qks5p:before,.prc-ActionList-Item-eN6NY[data-is-active-descendant] .prc-ActionList-DividedContent-qks5p:before,:focus+.prc-ActionList-Item-eN6NY .prc-ActionList-DividedContent-qks5p:before,[data-active-descendant]+.prc-ActionList-Item-eN6NY .prc-ActionList-DividedContent-qks5p:before{ + /* !important because all the :not's above give higher specificity */border-color:#0000!important}.prc-ActionList-Item-eN6NY[data-is-active-descendant=activated-directly]{background:var(--bgColor-accent-muted,var(--color-accent-subtle))}.prc-ActionList-Item-eN6NY[data-is-active-descendant=activated-indirectly]{background:var(--bgColor-muted,var(--color-canvas-subtle))}.prc-ActionList-Item-eN6NY:focus{outline:none}.prc-ActionList-Item-eN6NY:active,.prc-ActionList-Item-eN6NY:focus{background:var(--bgColor-accent-muted,var(--color-accent-subtle))}.prc-ActionList-MainContent--inline-112-0{flex-direction:row}.prc-ActionList-MainContent--block-l6ozE{flex-direction:column}.prc-ActionList-BaseVisualContainer-C06g1,.prc-ActionList-LeadingVisualContainer-2mC-O{align-items:center;display:flex;flex-shrink:0;height:20px;justify-content:center;margin-right:var(--base-size-8,.5rem);width:var(--base-size-16,1rem)}.prc-ActionList-LeadingVisualContainer-2mC-O{flex-direction:column}.prc-ActionList-LeadingVisualContainer-2mC-O svg{fill:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem)}.prc-ActionList-LeadingVisualContainer-2mC-O:where([data-variant=danger]) svg{fill:var(--fgColor-danger,var(--color-danger-fg))}.prc-ActionList-LeadingVisualContainer-2mC-O:where([data-disabled]) svg{fill:var(--fgColor-disabled,var(--color-primer-fg-disabled))}.prc-ActionList-TrailingContent-0Uf2c{align-items:center;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;flex-shrink:0;height:20px;justify-content:center;margin-left:var(--base-size-8,.5rem);margin-right:0;width:auto}.prc-ActionList-TrailingContent-0Uf2c:where([data-variant=danger]){color:var(--fgColor-muted,var(--color-fg-muted))}.prc-ActionList-TrailingContent-0Uf2c:where([data-disabled]){color:var(--fgColor-disabled,var(--color-primer-fg-disabled))}.prc-ActionList-TrailingContent-0Uf2c div:nth-child(2){margin-left:var(--base-size-8,.5rem)}.prc-ActionList-TrailingContent-0Uf2c svg{fill:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem)}.prc-ActionList-TrailingContent-0Uf2c:where([data-variant=danger]) svg{fill:var(--fgColor-danger,var(--color-danger-fg))}.prc-ActionList-TrailingContent-0Uf2c:where([data-disabled]) svg{fill:var(--fgColor-disabled,var(--color-primer-fg-disabled))}.prc-ActionList-DescriptionContainer-RBvTf{flex-basis:var(--description-container-flex-basis);flex-grow:1;font-size:var(--text-body-size-small,.75rem);line-height:16px;margin-left:var(--description-container-margin-left);min-width:0}.prc-ActionList-DescriptionContainer-RBvTf,.prc-ActionList-MultiSelectIcon-XFUmo{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-ActionList-MultiSelectIcon-XFUmo rect{fill:var(--bgColor-default,var(--color-canvas-default));stroke:var(--borderColor-default,var(--color-border-default));shape-rendering:auto}.prc-ActionList-MultiSelectIcon-XFUmo path{fill:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis));box-shadow:var(--shadow-resting-small,var(--color-shadow-small));opacity:0}.prc-ActionList-MultiSelectIcon-XFUmo:where([data-selected]) rect{fill:var(--bgColor-accent-emphasis,var(--color-accent-emphasis));stroke:var(--bgColor-accent-emphasis,var(--color-accent-emphasis))}.prc-ActionList-MultiSelectIcon-XFUmo:where([data-selected]) path{opacity:1}.prc-ActionList-Item-eN6NY[data-divider]:not(:first-of-type):not([data-component="ActionList.Divider"]+.prc-ActionList-Item-eN6NY):not([data-component="ActionList.Header"]+.prc-ActionList-Item-eN6NY) .prc-ActionList-DividedContent-qks5p:before{border-top-width:var(--borderWidth-thin,.0625rem)}.prc-ActionList-Item-eN6NY[data-divider]:not(:first-of-type):not([data-component="ActionList.Divider"]+.prc-ActionList-Item-eN6NY):not([data-component="ActionList.Header"]+.prc-ActionList-Item-eN6NY){margin-top:1px}*{box-sizing:border-box}body{margin:0}table{border-collapse:collapse}[data-color-mode=light] input{--csstools-color-scheme--light:initial;color-scheme:light}[data-color-mode=dark] input{--csstools-color-scheme--light: ;color-scheme:dark}}@layer primer-react{@media (prefers-color-scheme:light){[data-color-mode=auto][data-light-theme*=light]{--csstools-color-scheme--light:initial;color-scheme:light}}@media (prefers-color-scheme:dark){[data-color-mode=auto][data-dark-theme*=dark]{--csstools-color-scheme--light: ;color-scheme:dark}}[role=button]:focus:not(:focus-visible):not(.focus-visible),[role=tabpanel][tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),a:focus:not(:focus-visible):not(.focus-visible),button:focus:not(:focus-visible):not(.focus-visible),summary:focus:not(:focus-visible):not(.focus-visible){box-shadow:none;outline:none}[tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),details-dialog:focus:not(:focus-visible):not(.focus-visible){outline:none}.prc-src-BaseStyles-aopSS{color:var(--BaseStyles-fgColor,var(--fgColor-default,var(--color-fg-default)));font-family:var(--BaseStyles-fontFamily,var(--fontStack-system,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"));line-height:var(--BaseStyles-lineHeight,1.5)}.prc-src-BaseStyles-aopSS :where(a:not([class*=prc-]):not([class*=PRC-]):not([class*=Primer_Brand__])){color:var(--fgColor-accent,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none}:is(.prc-src-BaseStyles-aopSS :where(a:not([class*=prc-]):not([class*=PRC-]):not([class*=Primer_Brand__]))):hover{-webkit-text-decoration:underline;text-decoration:underline}}@layer primer-react{.prc-ActionList-Divider-hCCoA{background:var(--borderColor-muted,var(--color-border-muted));height:var(--borderWidth-thin,.0625rem);margin-bottom:var(--base-size-8,.5rem);margin-top:calc(var(--base-size-8,.5rem) - 1px)}.prc-SkeletonText-SkeletonText--DvUT{--font-size:var(--text-body-size-medium,0.875rem);--line-height:var(--text-body-lineHeight-medium,1.42857);--leading:calc(var(--font-size)*var(--line-height) - var(--font-size))}}@layer primer-react{@supports (margin-block:mod(1px,1px)){.prc-SkeletonText-SkeletonText--DvUT{--leading:mod(var(--font-size) * var(--line-height),var(--font-size))}}.prc-SkeletonText-SkeletonText--DvUT{border-radius:var(--borderRadius-small,.1875rem);height:var(--font-size);margin-block:calc(var(--leading)/2)}.prc-SkeletonText-SkeletonText--DvUT:where([data-in-multiline]){margin-block-end:calc(var(--leading)*2)}.prc-SkeletonText-SkeletonText--DvUT:where([data-in-multiline]):last-child{margin-bottom:0;max-width:65%;min-width:50px}.prc-SkeletonText-SkeletonText--DvUT:where([data-text-skeleton-size=display]),.prc-SkeletonText-SkeletonText--DvUT:where([data-text-skeleton-size=titleLarge]){border-radius:var(--borderRadius-medium,.375rem)}.prc-SkeletonText-SkeletonText--DvUT:where([data-text-skeleton-size=display]){--font-size:var(--text-display-size,2.5rem);--line-height:var(--text-display-lineHeight,1.4)}.prc-SkeletonText-SkeletonText--DvUT:where([data-text-skeleton-size=titleLarge]){--font-size:var(--text-title-size-large,2rem);--line-height:var(--text-title-lineHeight-large,1.5)}.prc-SkeletonText-SkeletonText--DvUT:where([data-text-skeleton-size=titleMedium]){--font-size:var(--text-title-size-medium,1.25rem);--line-height:var(--text-title-lineHeight-medium,1.6)}.prc-SkeletonText-SkeletonText--DvUT:where([data-text-skeleton-size=titleSmall]){--font-size:var(--text-title-size-small,1rem);--line-height:var(--text-title-lineHeight-small,1.5)}.prc-SkeletonText-SkeletonText--DvUT:where([data-text-skeleton-size=subtitle]){--font-size:var(--text-subtitle-size,1.25rem);--line-height:var(--text-subtitle-lineHeight,1.6)}.prc-SkeletonText-SkeletonText--DvUT:where([data-text-skeleton-size=bodyLarge]){--font-size:var(--text-body-size-large,1rem);--line-height:var(--text-body-lineHeight-large,1.5)}.prc-SkeletonText-SkeletonText--DvUT:where([data-text-skeleton-size=bodySmall]){--font-size:var(--text-body-size-small,0.75rem);--line-height:var(--text-body-lineHeight-small,1.66667)}.prc-SkeletonText-SkeletonTextWrapper-gfaKQ{padding-block:.1px}.prc-ConfirmationDialog-ConfirmationHeader-O9n-1{display:flex;flex-direction:row;padding:var(--base-size-8,.5rem)}.prc-ConfirmationDialog-ConfirmationHeader-O9n-1>h1{flex-grow:1;padding:var(--base-size-6,.375rem) var(--base-size-8,.5rem)}.prc-ConfirmationDialog-ConfirmationBody--0CDE{flex-grow:1;font-size:var(--text-body-size-medium,.875rem);padding:0 var(--base-size-16,1rem) var(--base-size-16,1rem) var(--base-size-16,1rem)}.prc-ConfirmationDialog-ConfirmationFooter-6q0Nn{display:grid;grid-auto-columns:max-content;grid-auto-flow:column;grid-gap:var(--base-size-8,.5rem);align-items:end;justify-content:end;padding:var(--base-size-4,.25rem) var(--base-size-16,1rem) var(--base-size-16,1rem)}.prc-Blankslate-Container-Vr9Ce{container:blankslate/inline-size}.prc-Blankslate-Blankslate-Eihy3{display:grid;justify-items:center;padding:var(--blankslate-padding)}}@layer primer-react{}@layer primer-react{.prc-Blankslate-Blankslate-Eihy3:where([data-border]){border:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));border-radius:var(--borderRadius-medium,.375rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-narrow]){margin:0 auto;max-width:485px}.prc-Blankslate-Blankslate-Eihy3:where([data-size=medium]){--blankslate-heading-text:var(--text-title-shorthand-medium,600 1.25rem/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-heading-margin-block:0 var(--base-size-4,0.25rem);--blankslate-description-text:var(--text-body-shorthand-large,400 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-padding:var(--base-size-32,2rem);--blankslate-action-margin-block-end:var(--base-size-16,1rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=medium][data-spacious]){--blankslate-padding:var(--base-size-80,5rem) var(--base-size-40,2.5rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=small]){--blankslate-heading-text:var(--text-title-shorthand-small,600 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-heading-margin-block:0 var(--base-size-4,0.25rem);--blankslate-description-text:var(--text-body-shorthand-medium,400 0.875rem/1.42857 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-padding:var(--base-size-32,2rem) var(--base-size-20,1.25rem);--blankslate-action-margin-block-end:var(--base-size-12,0.75rem);--blankslate-visual-size:var(--base-size-24,1.5rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=small][data-spacious]){--blankslate-padding:var(--base-size-44,2.75rem) var(--base-size-28,1.75rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=large]){--blankslate-heading-text:var(--text-title-shorthand-large,600 2rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-heading-margin-block:var(--base-size-8,0.5rem) var(--base-size-4,0.25rem);--blankslate-description-text:var(--text-body-shorthand-large,400 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-description-margin-block:0 var(--base-size-8,0.5rem);--blankslate-padding:var(--base-size-32,2rem);--blankslate-action-margin-block-end:var(--base-size-16,1rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-size=large][data-spacious]){--blankslate-padding:var(--base-size-80,5rem) var(--base-size-40,2.5rem)}.prc-Blankslate-Description-nqiRV,.prc-Blankslate-Heading-tVZsq{margin:0;text-align:center}.prc-Blankslate-Heading-tVZsq{font:var(--blankslate-heading-text);margin-block:var(--blankslate-heading-margin-block)}.prc-Blankslate-Description-nqiRV{font:var(--blankslate-description-text);margin-block:var(--blankslate-description-margin-block)}.prc-Blankslate-Description-nqiRV,.prc-Blankslate-Visual-10aPl{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-Blankslate-Visual-10aPl{display:inline-flex;margin-block-end:var(--base-size-8,.5rem);max-width:var(--blankslate-visual-size)}.prc-Blankslate-Visual-10aPl svg{width:100%}.prc-Blankslate-Action-RsgHG{font:var(--blankslate-description-text);margin-block-start:var(--base-size-16,1rem)}.prc-Blankslate-Action-RsgHG:where(:last-of-type){margin-block-end:var(--blankslate-action-margin-block-end)}@container blankslate (max-width: 34rem){.prc-Blankslate-Blankslate-Eihy3{--blankslate-padding:var(--base-size-20,1.25rem)}.prc-Blankslate-Blankslate-Eihy3:where([data-spacious=true]){--blankslate-padding:var(--base-size-44,2.75rem) var(--base-size-28,1.75rem)}.prc-Blankslate-Blankslate-Eihy3{--blankslate-heading-text:var(--text-title-shorthand-small,600 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");--blankslate-description-text:var(--text-body-shorthand-medium,400 0.875rem/1.42857 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji")}.prc-Blankslate-Visual-10aPl{color:var(--fgColor-muted,var(--color-fg-muted));margin-bottom:var(--base-size-8,.5rem);max-width:var(--base-size-24,1.5rem)}.prc-Blankslate-Action-RsgHG{margin-top:var(--base-size-8,.5rem)}.prc-Blankslate-Action-RsgHG:first-of-type{margin-top:var(--base-size-16,1rem)}.prc-Blankslate-Action-RsgHG:last-of-type{margin-bottom:calc(var(--base-size-8,.5rem)/2)}}}@layer primer-react{.prc-components-ButtonReset-O-bEI{align-items:center;appearance:none;background:none;border:0;color:inherit;cursor:pointer;display:inline-flex;font:inherit;margin:0;padding:0;text-align:start}.prc-components-ButtonReset-O-bEI::-moz-focus-inner{border:0}}@layer primer-react{.prc-ActionList-List-0R5kQ:focus-within,.prc-ActionList-List-0R5kQ[data-has-active-descendant]{--item-hover-bg-override:none;--item-hover-divider-border-color-override:var(--borderColor-muted,var(--color-border-muted))}.prc-TabNav-TabNavTabList-Ave63{display:flex;margin-bottom:-1px;overflow:auto}.prc-TabNav-TabNavNav-MHmhC{border-bottom:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));margin-top:0}.prc-TabNav-TabNavLink-u3umI{background-color:initial;border:var(--borderWidth-thin,.0625rem) solid #0000;border-bottom:0;font-size:var(--text-body-size-medium,.875rem);line-height:20px;padding:var(--base-size-8,.5rem) var(--base-size-12,.75rem)}.prc-TabNav-TabNavLink-u3umI,.prc-TabNav-TabNavLink-u3umI:hover{color:var(--fgColor-default,var(--color-fg-default))}.prc-TabNav-TabNavLink-u3umI,.prc-TabNav-TabNavLink-u3umI:focus,.prc-TabNav-TabNavLink-u3umI:hover{-webkit-text-decoration:none;text-decoration:none}.prc-TabNav-TabNavLink-u3umI:focus{box-shadow:none;outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:-6px}.prc-TabNav-TabNavLink-u3umI.prc-TabNav-Selected-LYsaH{background-color:var(--bgColor-default,var(--color-canvas-default));border-color:var(--borderColor-default,var(--color-border-default));border-top-left-radius:var(--borderRadius-medium,.375rem);border-top-right-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-default,var(--color-fg-default))}.prc-DialogV1-Overlay-nYh-4:before{background:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;content:" ";cursor:default;display:block;left:0;position:fixed;right:0;top:0;z-index:99}.prc-DialogV1-CloseIcon-NbiwR{position:absolute;right:var(--base-size-16,1rem);top:var(--base-size-8,.5rem)}.prc-DialogV1-Dialog-XiEJf{background-color:var(--bgColor-default,var(--color-canvas-default));border-radius:var(--borderRadius-medium,.375rem);box-shadow:var(--shadow-floating-large,var(--color-shadow-large));left:50%;margin:10vh auto;max-height:80vh;outline:none;position:fixed;top:0;transform:translateX(-50%);z-index:999}}@layer primer-react{}@layer primer-react{.prc-DialogV1-Dialog-XiEJf:where([data-width=default]){width:440px}.prc-DialogV1-Dialog-XiEJf:where([data-width=narrow]){width:320px}.prc-DialogV1-Dialog-XiEJf:where([data-width=wide]){width:640px}@media screen and (max-width:750px){.prc-DialogV1-Dialog-XiEJf{border-radius:0;height:100dvh;margin:0;width:100dvw}}.prc-DialogV1-Header-r20Rf{background:var(--bgColor-muted,var(--color-canvas-subtle));border-bottom:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));border-radius:var(--borderRadius-medium,.375rem) var(--borderRadius-medium,.375rem) 0 0;display:flex;padding:var(--base-size-16,1rem)}@media screen and (max-width:750px){.prc-DialogV1-Header-r20Rf{border-radius:0}}.prc-DialogV1-HeaderChild-tk8Zn{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-semibold,600)}.prc-TreeView-TreeViewRootUlStyles-Mzrmj{list-style:none;margin:0;padding:0}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItem-Ter5f{outline:none}:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItem-Ter5f).focus-visible>div,:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItem-Ter5f):focus-visible>div{box-shadow:var(--boxShadow-thick,inset 0 0 0 .125rem) var(--fgColor-accent,var(--color-accent-fg))}}@layer primer-react{@media (forced-colors:active){:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItem-Ter5f).focus-visible>div,:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItem-Ter5f):focus-visible>div{outline:2px solid HighlightText;outline-offset:-2}}[data-has-leading-action]:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItem-Ter5f){--has-leading-action:1}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemContainer-z6qqQ{--level:1;--toggle-width:1rem;--min-item-height:2rem;border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-default,var(--color-fg-default));cursor:pointer;display:grid;font-size:var(--text-body-size-medium,.875rem);grid-template-areas:"spacer leadingAction toggle content trailingAction";grid-template-columns:var(--spacer-width) var(--leading-action-width) var(--toggle-width) 1fr;position:relative;width:100%;--leading-action-width:calc(var(--has-leading-action, 0)*1.5rem);--spacer-width:calc((var(--level) - 1)*(var(--toggle-width)/2))}:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemContainer-z6qqQ):hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}@media (forced-colors:active){:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemContainer-z6qqQ):hover{outline:2px solid #0000;outline-offset:-2px}}@media (pointer:coarse){.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemContainer-z6qqQ{--toggle-width:1.5rem;--min-item-height:2.75rem}}:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemContainer-z6qqQ):has(.prc-TreeView-TreeViewItemSkeleton-FGlnx):hover{background-color:initial;cursor:default}@media (forced-colors:active){:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemContainer-z6qqQ):has(.prc-TreeView-TreeViewItemSkeleton-FGlnx):hover{outline:none}}.prc-TreeView-TreeViewRootUlStyles-Mzrmj:where([data-omit-spacer=true]) .prc-TreeView-TreeViewItemContainer-z6qqQ{grid-template-columns:0 0 0 1fr}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItem-Ter5f[aria-current=true]>.prc-TreeView-TreeViewItemContainer-z6qqQ{background-color:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg))}:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItem-Ter5f[aria-current=true]>.prc-TreeView-TreeViewItemContainer-z6qqQ):after{background-color:var(--fgColor-accent,var(--color-accent-fg));border-radius:var(--borderRadius-medium,.375rem);content:"";height:1.5rem;left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:calc(50% - var(--base-size-12,.75rem));width:.25rem}@media (forced-colors:active){:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItem-Ter5f[aria-current=true]>.prc-TreeView-TreeViewItemContainer-z6qqQ):after{background-color:HighlightText}}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemToggle-hq3Xq{align-items:flex-start;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;grid-area:toggle;height:100%;justify-content:center;padding-top:calc(var(--min-item-height)/2 - var(--base-size-12,.75rem)/2)}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemToggleHover-H9tbt:hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemToggleEnd-nWt9I{border-bottom-left-radius:var(--borderRadius-medium,.375rem);border-top-left-radius:var(--borderRadius-medium,.375rem)}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemContent-RKsCI{display:flex;gap:var(--stack-gap-condensed,.5rem);grid-area:content;height:100%;line-height:var(--custom-line-height,var(--text-body-lineHeight-medium,1.4285));padding:0 var(--base-size-8,.5rem);padding-bottom:calc((var(--min-item-height) - var(--custom-line-height, 1.3rem))/2);padding-top:calc((var(--min-item-height) - var(--custom-line-height, 1.3rem))/2)}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemContentText-FFaKp{flex:1 1 auto;width:0}.prc-TreeView-TreeViewRootUlStyles-Mzrmj:where([data-truncate-text=true]) .prc-TreeView-TreeViewItemContentText-FFaKp{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.prc-TreeView-TreeViewRootUlStyles-Mzrmj:where([data-truncate-text=false]) .prc-TreeView-TreeViewItemContentText-FFaKp{word-break:break-word}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemVisual-naWzj{align-items:center;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;height:var(--custom-line-height,1.3rem)}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemLeadingAction-vmOIV{color:var(--fgColor-muted,var(--color-fg-muted));display:flex;grid-area:leadingAction}:is(.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemLeadingAction-vmOIV)>button{flex-shrink:1}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemTrailingAction-h9M5g{color:var(--fgColor-muted,var(--color-fg-muted));display:flex;grid-area:trailingAction}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemTrailingActionButton-pCTdP{flex-shrink:1}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemLevelLine-F-0-2{border-color:var(--borderColor-muted,var(--color-border-muted));border-right:var(--borderWidth-thin,.0625rem) solid;height:100%;width:100%}@media (hover:hover){.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewItemLevelLine-F-0-2{border-color:#0000}.prc-TreeView-TreeViewRootUlStyles-Mzrmj:focus-within .prc-TreeView-TreeViewItemLevelLine-F-0-2,.prc-TreeView-TreeViewRootUlStyles-Mzrmj:hover .prc-TreeView-TreeViewItemLevelLine-F-0-2{border-color:var(--borderColor-muted,var(--color-border-muted))}}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewDirectoryIcon-yP1oY{color:var(--treeViewItem-leadingVisual-iconColor-rest,var(--color-tree-view-item-directory-fill));display:grid}.prc-TreeView-TreeViewRootUlStyles-Mzrmj .prc-TreeView-TreeViewVisuallyHidden-1N8xK{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.prc-TreeView-TreeViewSkeletonItemContainerStyle-lKqwd{align-items:center;column-gap:.5rem;display:flex;height:2rem}@media (pointer:coarse){.prc-TreeView-TreeViewSkeletonItemContainerStyle-lKqwd{height:2.75rem}}.prc-TreeView-TreeViewSkeletonItemContainerStyle-lKqwd:nth-of-type(5n+1){--tree-item-loading-width:67%}.prc-TreeView-TreeViewSkeletonItemContainerStyle-lKqwd:nth-of-type(5n+2){--tree-item-loading-width:47%}.prc-TreeView-TreeViewSkeletonItemContainerStyle-lKqwd:nth-of-type(5n+3){--tree-item-loading-width:73%}.prc-TreeView-TreeViewSkeletonItemContainerStyle-lKqwd:nth-of-type(5n+4){--tree-item-loading-width:64%}.prc-TreeView-TreeViewSkeletonItemContainerStyle-lKqwd:nth-of-type(5n+5){--tree-item-loading-width:50%}.prc-TreeView-TreeItemSkeletonTextStyles-8VJ-g{width:var(--tree-item-loading-width,67%)}}@layer primer-react{.prc-SkeletonAvatar-SkeletonAvatar-IS5NT:where([data-component=SkeletonAvatar]){border-radius:50%;display:inline-block;height:var(--avatarSize-regular);line-height:1;width:var(--avatarSize-regular)}.prc-SkeletonAvatar-SkeletonAvatar-IS5NT:where([data-square]){border-radius:clamp(4px,var(--avatarSize-regular) - 24px,var(--borderRadius-medium,.375rem))}@media screen and (max-width:calc(48rem - 0.02px)){.prc-SkeletonAvatar-SkeletonAvatar-IS5NT:where([data-responsive]){height:var(--avatarSize-narrow);width:var(--avatarSize-narrow)}}@media screen and (min-width:48rem){.prc-SkeletonAvatar-SkeletonAvatar-IS5NT:where([data-responsive]){height:var(--avatarSize-regular);width:var(--avatarSize-regular)}}@media screen and (min-width:87.5rem){.prc-SkeletonAvatar-SkeletonAvatar-IS5NT:where([data-responsive]){height:var(--avatarSize-wide);width:var(--avatarSize-wide)}}}@layer primer-react{.prc-DataTable-TableContainer-hn0p3{column-gap:var(--base-size-8,.5rem);display:grid;grid-template-areas:"title actions" "divider divider" "subtitle subtitle" "filter filter" "table table" "footer footer";grid-template-columns:1fr 1fr}.prc-DataTable-TableTitle-nM43N{align-self:center;font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-semibold,600);grid-area:title;line-height:20px}.prc-DataTable-TableSubtitle--L6Ho,.prc-DataTable-TableTitle-nM43N{color:var(--fgColor-default,var(--color-fg-default));margin:0}.prc-DataTable-TableSubtitle--L6Ho{font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);grid-area:subtitle;line-height:var(--text-title-lineHeight-small,1.5)}.prc-DataTable-TableActions-fkc2b{align-items:center;column-gap:var(--base-size-8,.5rem);display:flex;grid-area:actions;justify-self:end}.prc-DataTable-TableDivider-TRc3b{background-color:var(--borderColor-default,var(--color-border-default));grid-area:divider;height:1px;margin-block-end:var(--base-size-8,.5rem);margin-block-start:var(--base-size-16,1rem);width:100%}.prc-DataTable-TableActions-fkc2b+.prc-DataTable-TableOverflowWrapper-bSqT-,.prc-DataTable-TableSubtitle--L6Ho+.prc-DataTable-TableOverflowWrapper-bSqT-,.prc-DataTable-TableTitle-nM43N+.prc-DataTable-TableOverflowWrapper-bSqT-{margin-block-start:var(--base-size-8,.5rem)}.prc-DataTable-Table-7ux1n,.prc-DataTable-TableOverflowWrapper-bSqT-{grid-area:table}.prc-DataTable-Table-7ux1n{--table-border-radius:0.375rem;--table-cell-padding:var(--cell-padding-block,0.5rem) var(--cell-padding-inline,0.75rem);--table-font-size:0.75rem;background-color:var(--bgColor-default,var(--color-canvas-default));border-collapse:initial;border-spacing:0;display:grid;font-size:var(--table-font-size);grid-template-columns:var(--grid-template-columns);line-height:1.66667;width:100%}.prc-DataTable-Table-7ux1n:where([data-cell-padding=condensed]){--cell-padding-block:0.25rem;--cell-padding-inline:0.5rem}.prc-DataTable-Table-7ux1n:where([data-cell-padding=normal]){--cell-padding-block:0.5rem;--cell-padding-inline:0.75rem}.prc-DataTable-Table-7ux1n:where([data-cell-padding=spacious]){--cell-padding-block:0.75rem;--cell-padding-inline:1rem}.prc-DataTable-TableCell-Fk4ve:first-child,.prc-DataTable-TableHeader-eyTab:first-child{border-inline-start:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default))}.prc-DataTable-TableCell-Fk4ve:last-child,.prc-DataTable-TableHeader-eyTab:last-child{border-inline-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default))}.prc-DataTable-TableCell-Fk4ve,.prc-DataTable-TableHeader-eyTab{align-items:center;border-block-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));display:flex;padding:var(--table-cell-padding);text-align:start}.prc-DataTable-TableCell-Fk4ve:where([data-cell-align=end]),.prc-DataTable-TableHeader-eyTab:where([data-cell-align=end]){display:flex;justify-content:flex-end;text-align:end}.prc-DataTable-TableHeader-eyTab[data-cell-align=end] .prc-DataTable-TableSortButton--aq0y{display:flex;flex-direction:row-reverse}.prc-DataTable-TableHead-4FaBf .prc-DataTable-TableRow-Icc7F:first-of-type .prc-DataTable-TableHeader-eyTab{border-block-start:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default))}.prc-DataTable-TableHead-4FaBf .prc-DataTable-TableRow-Icc7F:first-of-type .prc-DataTable-TableHeader-eyTab:first-child{border-top-left-radius:var(--table-border-radius)}.prc-DataTable-TableHead-4FaBf .prc-DataTable-TableRow-Icc7F:first-of-type .prc-DataTable-TableHeader-eyTab:last-child{border-top-right-radius:var(--table-border-radius)}.prc-DataTable-TableOverflowWrapper-bSqT-:last-child .prc-DataTable-Table-7ux1n .prc-DataTable-TableBody-QKQy2 .prc-DataTable-TableRow-Icc7F:last-of-type .prc-DataTable-TableCell-Fk4ve:first-child{border-bottom-left-radius:var(--table-border-radius)}.prc-DataTable-TableOverflowWrapper-bSqT-:last-child .prc-DataTable-Table-7ux1n .prc-DataTable-TableBody-QKQy2 .prc-DataTable-TableRow-Icc7F:last-of-type .prc-DataTable-TableCell-Fk4ve:last-child{border-bottom-right-radius:var(--table-border-radius)}.prc-DataTable-TableRow-Icc7F>:first-child .prc-DataTable-TableCellSkeletonItem-bGhwZ,.prc-DataTable-TableRow-Icc7F>:first-child:not(.prc-DataTable-TableCellSkeleton-DMdM5){padding-inline-start:var(--base-size-16,1rem)}.prc-DataTable-TableRow-Icc7F>:last-child .prc-DataTable-TableCellSkeletonItem-bGhwZ,.prc-DataTable-TableRow-Icc7F>:last-child:not(.prc-DataTable-TableCellSkeleton-DMdM5){padding-inline-end:var(--base-size-16,1rem)}.prc-DataTable-TableHeader-eyTab{background-color:var(--bgColor-muted,var(--color-canvas-subtle));border-block-start:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));color:var(--fgColor-muted,var(--color-fg-muted));font-weight:var(--base-text-weight-semibold,600)}.prc-DataTable-TableHeader-eyTab:where([aria-sort=ascending]),.prc-DataTable-TableHeader-eyTab:where([aria-sort=descending]){color:var(--fgColor-default,var(--color-fg-default))}.prc-DataTable-TableSortIcon-wHvJw{visibility:hidden}.prc-DataTable-TableHeader-eyTab .prc-DataTable-TableSortButton--aq0y:focus .prc-DataTable-TableSortIcon--ascending-Lpx6z,.prc-DataTable-TableHeader-eyTab:hover .prc-DataTable-TableSortIcon--ascending-Lpx6z,.prc-DataTable-TableHeader-eyTab[aria-sort=ascending] .prc-DataTable-TableSortIcon--ascending-Lpx6z,.prc-DataTable-TableHeader-eyTab[aria-sort=descending] .prc-DataTable-TableSortIcon--descending-hHJGo{visibility:visible}.prc-DataTable-TableRow-Icc7F:hover .prc-DataTable-TableCell-Fk4ve:not(.prc-DataTable-TableCellSkeleton-DMdM5){background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}.prc-DataTable-TableCell-Fk4ve:where([scope=row]){align-items:center;color:var(--fgColor-default,var(--color-fg-default));display:flex;font-weight:var(--base-text-weight-semibold,600)}.prc-DataTable-TableCellSkeleton-DMdM5{padding:0}.prc-DataTable-TableCellSkeletonItems-Ljhq5{display:flex;flex-direction:column;width:100%}.prc-DataTable-TableCellSkeletonItem-bGhwZ{padding:var(--table-cell-padding)}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+1){--skeleton-item-width:85%}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+2){--skeleton-item-width:67.5%}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+3){--skeleton-item-width:80%}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+4){--skeleton-item-width:60%}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+5){--skeleton-item-width:75%}.prc-DataTable-TableCellSkeletonItem-bGhwZ [data-component=SkeletonText]{width:var(--skeleton-item-width)}.prc-DataTable-TableCellSkeletonItem-bGhwZ:not(:last-of-type){border-block-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default))}.prc-DataTable-TableSortButton--aq0y{column-gap:.5rem}.prc-DataTable-TableBody-QKQy2,.prc-DataTable-TableHead-4FaBf,.prc-DataTable-TableRow-Icc7F{display:contents}@supports (grid-template-columns:subgrid){.prc-DataTable-TableBody-QKQy2,.prc-DataTable-TableHead-4FaBf,.prc-DataTable-TableRow-Icc7F{display:grid;grid-column:-1/1;grid-template-columns:subgrid}}.prc-DataTable-PlaceholderText-8bHo7{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-BranchName-BranchName-CMTaU{background-color:var(--bgColor-accent-muted,var(--color-accent-subtle));border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-link,var(--color-accent-fg));display:inline-block;font-family:var(--fontStack-monospace,ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace);font-size:var(--text-body-size-small,.75rem);padding:var(--base-size-2,.125rem) var(--base-size-6,.375rem);-webkit-text-decoration:none;text-decoration:none}.prc-BranchName-BranchName-CMTaU:is(:not(a)){color:var(--fgColor-muted,var(--color-fg-muted))}.prc-ButtonGroup-ButtonGroup-vFUrY{display:inline-flex;isolation:isolate;vertical-align:middle}.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]){margin-inline-end:-1px;position:relative}:is(.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper])) a,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper])) button{border-radius:0}:is(.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper])):first-child a,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper])):first-child button{border-bottom-left-radius:var(--borderRadius-medium,.375rem);border-top-left-radius:var(--borderRadius-medium,.375rem)}:is(.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper])):last-child a,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper])):last-child button{border-bottom-right-radius:var(--borderRadius-medium,.375rem);border-top-right-radius:var(--borderRadius-medium,.375rem)}:is(.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper])):active,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper])):focus,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper])):hover{z-index:1}.prc-ButtonGroup-ButtonGroup-vFUrY:has(div:last-child:empty) a,.prc-ButtonGroup-ButtonGroup-vFUrY:has(div:last-child:empty) button{border-radius:var(--borderRadius-medium,.375rem)}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]{margin-inline-end:-1px;position:relative}:is(.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]) a,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]) button{border-radius:0}:is(.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]):active,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]):focus,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]):hover{z-index:1}:is(.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]):first-child a,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]):first-child button{border-bottom-left-radius:var(--borderRadius-medium,.375rem);border-top-left-radius:var(--borderRadius-medium,.375rem)}:is(.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]):last-child a,:is(.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]):last-child button{border-bottom-right-radius:var(--borderRadius-medium,.375rem);border-top-right-radius:var(--borderRadius-medium,.375rem)}.prc-UnderlinePanels-StyledUnderlineWrapper-aiLna{overflow-x:auto;overflow-y:hidden;width:100%;-webkit-overflow-scrolling:auto}.prc-UnderlinePanels-StyledUnderlineWrapper-aiLna[data-icons-visible=false] [data-component=icon]{display:none}.prc-DataTable-TablePagination-AJ0K7{align-items:center;border:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));border-end-end-radius:var(--borderRadius-medium,.375rem);border-end-start-radius:var(--borderRadius-medium,.375rem);border-top-width:0;column-gap:1rem;display:flex;grid-area:footer;justify-content:space-between;padding:var(--base-size-8,.5rem) var(--base-size-16,1rem);width:100%}}@layer primer-react{}@layer primer-react{}@layer primer-react{}@layer primer-react{@media ((max-width:calc(768px - 0.02px))){.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=narrow]>:not(:first-child):not(:last-child){display:none}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=narrow]>:first-child{margin-inline-end:0}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=narrow]>:last-child{margin-inline-start:0}}@media ((min-width:768px)){.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=regular]>:not(:first-child):not(:last-child){display:none}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=regular]>:first-child{margin-inline-end:0}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=regular]>:last-child{margin-inline-start:0}}@media ((min-width:1400px)){.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=wide]>:not(:first-child):not(:last-child){display:none}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=wide]>:first-child{margin-inline-end:0}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=wide]>:last-child{margin-inline-start:0}}.prc-DataTable-TablePaginationRange-R7KK2{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);margin:0}.prc-DataTable-TablePaginationSteps-Vxbth{align-items:center;color:var(--fgColor-default,var(--color-fg-default));display:flex;flex-wrap:wrap;font-size:var(--text-body-size-medium,.875rem);list-style:none;margin:0;padding:0}.prc-DataTable-TablePaginationStep-jdto6:first-of-type{margin-right:var(--base-size-16,1rem)}.prc-DataTable-TablePaginationStep-jdto6:last-of-type{margin-left:var(--base-size-16,1rem)}.prc-DataTable-TablePaginationAction-SPa7Q{align-items:center;border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-muted,var(--color-fg-muted));display:flex;font-size:var(--text-body-size-medium,.875rem);line-height:1.42857;padding:var(--base-size-8,.5rem);-webkit-user-select:none;user-select:none}.prc-DataTable-TablePaginationAction-SPa7Q[data-has-page]{color:var(--fgColor-accent,var(--color-accent-fg))}.prc-DataTable-TablePaginationPage-Fn3s-{align-items:center;border-radius:var(--borderRadius-medium,.375rem);display:flex;font-size:var(--text-body-size-medium,.875rem);justify-content:center;line-height:1.42857;min-height:2rem;min-width:2rem;padding:var(--base-size-8,.5rem) calc((var(--base-size-32,2rem) - var(--base-size-20,1.25rem))/2);-webkit-user-select:none;user-select:none}.prc-DataTable-TablePaginationAction-SPa7Q[data-has-page]:focus,.prc-DataTable-TablePaginationAction-SPa7Q[data-has-page]:hover,.prc-DataTable-TablePaginationPage-Fn3s-:focus,.prc-DataTable-TablePaginationPage-Fn3s-:hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}.prc-DataTable-TablePaginationPage-Fn3s-[data-active=true]{background-color:var(--bgColor-accent-emphasis,var(--color-accent-emphasis));color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-DataTable-TablePaginationPage-Fn3s-[data-active=true]:focus-visible{box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis,var(--color-fg-on-emphasis));outline:2px solid var(--bgColor-accent-emphasis,var(--color-accent-emphasis));outline-offset:-2px}.prc-DataTable-TablePaginationTruncationStep-gRyLp{align-items:center;display:flex;justify-content:center;min-height:2rem;min-width:2rem;-webkit-user-select:none;user-select:none}.prc-ToggleSwitch-ToggleSwitch-rQz-0{--toggleSwitch-transition-duration:80ms;--toggleSwitch-transition-easing:cubic-bezier(0.5,1,0.89,1);align-items:center;display:inline-flex}}@layer primer-react{.prc-ToggleSwitch-ToggleSwitch-rQz-0:where([data-status-label-position=start]){flex-direction:row}.prc-ToggleSwitch-ToggleSwitch-rQz-0:where([data-status-label-position=end]){flex-direction:row-reverse}.prc-ToggleSwitch-LoadingSpinner--4KG4{display:inline-flex}.prc-ToggleSwitch-LoadingSpinner--4KG4:where([data-status-label-position=end]){margin-left:var(--base-size-8,.5rem);margin-right:0}.prc-ToggleSwitch-StatusText-7fNOA{color:var(--fgColor-default,var(--color-fg-default));cursor:pointer;font-size:var(--text-body-size-medium,.875rem);margin-left:var(--base-size-8,.5rem);margin-right:var(--base-size-8,.5rem);position:relative}.prc-ToggleSwitch-StatusText-7fNOA:where([data-disabled=true]){color:var(--fgColor-muted,var(--color-fg-muted));cursor:not-allowed}.prc-ToggleSwitch-StatusText-7fNOA:where([data-size=small]){font-size:var(--text-body-size-small,.75rem)}.prc-ToggleSwitch-StatusText-7fNOA:where([data-size=medium]){font-size:var(--text-body-size-medium,.875rem)}.prc-ToggleSwitch-StatusTextItem-VE86e{display:block;text-align:right}.prc-ToggleSwitch-StatusTextItem-VE86e:where([data-hidden=true]){height:0;visibility:hidden}.prc-ToggleSwitch-SwitchButton-1CtM6{appearance:none;border-radius:var(--borderRadius-medium,.375rem);border-style:solid;border-width:var(--borderWidth-thin,.0625rem);cursor:pointer;display:block;height:32px;overflow:hidden;padding:0;position:relative;-webkit-text-decoration:none;text-decoration:none;transition-duration:var(--toggleSwitch-transition-duration);transition-property:background-color,border-color;transition-timing-function:var(--toggleSwitch-transition-easing);-webkit-user-select:none;user-select:none;width:64px}.prc-ToggleSwitch-SwitchButton-1CtM6:focus-visible{outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:3px}.prc-ToggleSwitch-SwitchButton-1CtM6:focus:not(:focus-visible){outline:1px solid #0000}@media (pointer:coarse){.prc-ToggleSwitch-SwitchButton-1CtM6:before{content:"";left:0;min-height:44px;position:absolute;right:0;top:50%;transform:translateY(-50%)}}@media (prefers-reduced-motion){.prc-ToggleSwitch-SwitchButton-1CtM6,.prc-ToggleSwitch-SwitchButton-1CtM6 *{transition:none}}.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-size=small]){height:24px;width:48px}.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-disabled=true]){background-color:var(--controlTrack-bgColor-disabled,var(--color-switch-track-disabled-bg,#8c959f));border-color:#0000;cursor:not-allowed;transition-property:none}@media (forced-colors:active){.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-disabled=true]){border-color:GrayText}}.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=false]:not([data-disabled=true])){background-color:var(--controlTrack-bgColor-rest,var(--color-switch-track-bg,#eaeef2));border-color:var(--controlTrack-borderColor-rest,var(--color-switch-track-border))}.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=false]:not([data-disabled=true]):focus-visible),.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=false]:not([data-disabled=true]):hover){background-color:var(--controlTrack-bgColor-hover,var(--color-switch-track-hover-bg,#dfe6ec))}.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=false]:not([data-disabled=true]):active),.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=false]:not([data-disabled=true]):active:focus-visible){background-color:var(--controlTrack-bgColor-active,var(--color-switch-track-active-bg,#d9e0e8))}.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=true]:not([data-disabled=true])){background-color:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg,#0969da));border-color:var(--control-checked-borderColor-rest,#0000)}.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=true]:not([data-disabled=true]):focus-visible),.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=true]:not([data-disabled=true]):hover){background-color:var(--control-checked-bgColor-hover,var(--color-switch-track-checked-hover-bg,#0860ca))}.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=true]:not([data-disabled=true]):active),.prc-ToggleSwitch-SwitchButton-1CtM6:where([data-checked=true]:not([data-disabled=true]):active:focus-visible){background-color:var(--control-checked-bgColor-active,var(--color-switch-track-checked-active-bg,#0757ba))}.prc-ToggleSwitch-SwitchButtonContent-u57jo{align-items:center;display:flex;height:100%;overflow:hidden;width:100%}.prc-ToggleSwitch-IconContainer-mUpUm{flex-basis:50%;flex-grow:1;flex-shrink:0;line-height:0;transition-duration:var(--toggleSwitch-transition-duration);transition-property:transform;transition-timing-function:var(--toggleSwitch-transition-easing)}@media (prefers-reduced-motion){.prc-ToggleSwitch-IconContainer-mUpUm{transition:none}}.prc-ToggleSwitch-LineIconContainer-cn8pC{color:var(--control-checked-fgColor-rest,var(--color-switch-track-checked-fg,#fff))}.prc-ToggleSwitch-LineIconContainer-cn8pC:where([data-disabled=true]){color:var(--control-checked-fgColor-disabled,var(--color-switch-track-checked-disabled-fg,#fff))}.prc-ToggleSwitch-LineIconContainer-cn8pC:where([data-checked=true]){transform:translateX(0)}.prc-ToggleSwitch-LineIconContainer-cn8pC:where([data-checked=false]){transform:translateX(-100%)}.prc-ToggleSwitch-CircleIconContainer-XiMW5{color:var(--controlTrack-fgColor-rest,var(--color-switch-track-fg,#656d76))}.prc-ToggleSwitch-CircleIconContainer-XiMW5:where([data-disabled=true]){color:var(--controlTrack-fgColor-disabled,var(--color-switch-track-disabled-fg,#fff))}.prc-ToggleSwitch-CircleIconContainer-XiMW5:where([data-checked=true]){transform:translateX(100%)}.prc-ToggleSwitch-CircleIconContainer-XiMW5:where([data-checked=false]){transform:translateX(0)}.prc-ToggleSwitch-ToggleKnob-N9ops{background-color:var(--controlKnob-bgColor-rest,var(--color-switch-knob-bg,#fff));border-color:var(--controlKnob-borderColor-rest,var(--color-switch-knob-border,#858f99));border-radius:calc(var(--borderRadius-medium,.375rem) - var(--borderWidth-thin,.0625rem));border-style:solid;border-width:var(--borderWidth-thin,.0625rem);bottom:0;position:absolute;top:0;transition-duration:var(--toggleSwitch-transition-duration);transition-property:transform;transition-timing-function:var(--toggleSwitch-transition-easing);width:50%;z-index:1}@media (prefers-reduced-motion){.prc-ToggleSwitch-ToggleKnob-N9ops{transition:none}}.prc-ToggleSwitch-ToggleKnob-N9ops:where([data-checked=false]){transform:translateX(0)}.prc-ToggleSwitch-ToggleKnob-N9ops:where([data-checked=true]){border-color:var(--controlKnob-borderColor-checked,var(--color-switch-knob-checked-border,#0969da));transform:translateX(100%)}.prc-ToggleSwitch-ToggleKnob-N9ops:where([data-disabled=true]){background-color:var(--controlKnob-bgColor-disabled,var(--color-btn-bg));border-color:var(--controlTrack-bgColor-disabled,var(--color-switch-track-disabled-bg,#8c959f))}@media (forced-colors:active){.prc-ToggleSwitch-ToggleKnob-N9ops:where([data-disabled=true]){color:GrayText}}}@layer primer-react{.prc-SelectPanel2-Overlay--Q-FI{border:none;color:var(--fgColor-default,var(--color-fg-default));padding:0;--max-height:0;--position-top:0;--position-left:0}.prc-SelectPanel2-Overlay--Q-FI:where([open]){display:flex}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=anchored]),.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=full-screen]){left:var(--position-left);margin:0;top:var(--position-top)}:is(.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=anchored]),.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=full-screen]))::backdrop{background-color:initial}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=modal]){bottom:0;left:0;right:0;top:0}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=modal])::backdrop{background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop))}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=full-screen]){border-radius:unset;height:100%;left:0;margin:0;max-height:100vh;max-width:100vw;top:0;width:100%}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=bottom-sheet]){border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:0;left:0;margin:0;max-height:calc(100vh - 64px);max-width:100vw;top:auto;width:100%}.prc-SelectPanel2-Form-bZ9HS{width:100%}.prc-SelectPanel2-Container-e5e6-,.prc-SelectPanel2-Form-bZ9HS{display:flex;flex-direction:column}.prc-SelectPanel2-Container-e5e6-{flex-grow:1;flex-shrink:1;justify-content:space-between;overflow:hidden}.prc-SelectPanel2-Container-e5e6- ul{flex-grow:1;overflow-y:auto}.prc-SelectPanel2-HeaderContent-MsaAS{align-items:center;display:flex;justify-content:space-between;margin-bottom:0}.prc-SelectPanel2-HeaderContent-MsaAS:where([data-description]){align-items:flex-start}.prc-SelectPanel2-HeaderContent-MsaAS:where([data-search-input]){margin-bottom:var(--base-size-8,.5rem)}.prc-SelectPanel2-TitleWrapper-HzPu3{margin-left:var(--base-size-8,.5rem);margin-top:0}.prc-SelectPanel2-TitleWrapper-HzPu3:where([data-description]){margin-top:2px}.prc-SelectPanel2-TitleWrapper-HzPu3:where([data-on-back]){margin-left:var(--base-size-4,.25rem)}.prc-SelectPanel2-TextInput-lHH1n{padding-left:var(--base-size-8,.5rem)!important}.prc-SelectPanel2-TextInput-lHH1n:has(input:placeholder-shown) .TextInput-action{display:none}.prc-SelectPanel2-Checkbox-AYR38{margin-top:0}.prc-SelectPanel2-FlexBox-gWPRg{display:flex}.prc-SelectPanel2-Title-T-h3f{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-semibold,600)}.prc-SelectPanel2-Description-qTXfi{display:block;font-size:var(--text-body-size-small,.75rem)}.prc-SelectPanel2-ClearAction-tQj-f,.prc-SelectPanel2-Description-qTXfi{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-SelectPanel2-ClearAction-tQj-f{background:none}.prc-SelectPanel2-Footer-TibV0{align-items:center;border-top:var(--borderWidth-thin,.0625rem) solid;border-top-color:var(--borderColor-default,var(--color-border-default));display:flex;flex-shrink:0;justify-content:space-between;min-height:44px;padding:var(--base-size-16,1rem)}.prc-SelectPanel2-Footer-TibV0:where([data-hide-primary-actions]){padding:var(--base-size-8,.5rem)}.prc-SelectPanel2-FooterContent-UjAOM{flex-grow:0}.prc-SelectPanel2-FooterContent-UjAOM:where([data-hide-primary-actions]){flex-grow:1}.prc-SelectPanel2-FooterActions-T6yQR,.prc-SelectPanel2-SecondaryCheckbox-omkf-{display:flex;gap:var(--stack-gap-condensed,.5rem)}.prc-SelectPanel2-SecondaryCheckbox-omkf-{align-items:center}.prc-SelectPanel2-SmallText-c42ay{font-size:var(--text-body-size-small,.75rem)}.prc-SelectPanel2-SelectPanelLoading-mtyhD{align-items:center;display:flex;flex-direction:column;gap:var(--stack-gap-normal,1rem);height:100%;justify-content:center;min-height:min(calc(var(--max-height) - 150px),324px)}.prc-SelectPanel2-LoadingText-DB0wN{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-medium,.875rem)}.prc-SelectPanel2-MessageFull-nY-qF{align-items:center;display:flex;flex-direction:column;flex-grow:1;gap:var(--base-size-4,.25rem);height:100%;justify-content:center;min-height:min(calc(var(--max-height) - 150px),324px);padding-left:var(--base-size-24,1.5rem);padding-right:var(--base-size-24,1.5rem);text-align:center}.prc-SelectPanel2-MessageFull-nY-qF a{color:inherit;-webkit-text-decoration:underline;text-decoration:underline}.prc-SelectPanel2-Octicon-zt-zU{margin-bottom:var(--base-size-8,.5rem)}.prc-SelectPanel2-Octicon-zt-zU.prc-SelectPanel2-Error-ZrZQQ{color:var(--fgColor-danger,var(--color-danger-fg))}.prc-SelectPanel2-Octicon-zt-zU.prc-SelectPanel2-Warning-PDsVF{color:var(--fgColor-attention,var(--color-attention-fg))}.prc-SelectPanel2-MessageTitle-T7v9d{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-medium,500)}.prc-SelectPanel2-MessageContent-UZ9vY{align-items:center;color:var(--fgColor-muted,var(--color-fg-muted));flex-direction:column;font-size:var(--text-body-size-medium,.875rem)}.prc-SelectPanel2-MessageContent-UZ9vY,.prc-SelectPanel2-MessageInline-sErQf{display:flex;gap:var(--stack-gap-condensed,.5rem)}.prc-SelectPanel2-MessageInline-sErQf{border-bottom:var(--borderWidth-thin,.0625rem) solid;font-size:var(--text-body-size-small,.75rem);padding:var(--base-size-12,.75rem) var(--base-size-16,1rem)}.prc-SelectPanel2-MessageInline-sErQf a{color:inherit;-webkit-text-decoration:underline;text-decoration:underline}.prc-SelectPanel2-MessageInline-sErQf:where([data-variant=error]){background-color:var(--bgColor-danger-muted,var(--color-danger-subtle));border-color:var(--borderColor-danger-muted,var(--color-danger-muted));color:var(--fgColor-danger,var(--color-danger-fg))}.prc-SelectPanel2-MessageInline-sErQf:where([data-variant=warning]){background-color:var(--bgColor-attention-muted,var(--color-attention-subtle));border-color:var(--borderColor-attention-muted,var(--color-attention-muted));color:var(--fgColor-attention,var(--color-attention-fg))}.prc-SelectPanel2-Header-LKyEJ{border-bottom:var(--borderWidth-thin,.0625rem) solid;border-bottom-color:var(--borderColor-default,var(--color-border-default));display:flex;flex-direction:column;padding:var(--base-size-8,.5rem)}}@layer primer-react{@keyframes prc-ProgressBar-shimmer-hIHBF{0%{mask-position:200%}to{mask-position:0}}.prc-ProgressBar-ProgressBarItem-mDIlB{--progress-width: ;--progress-bg: ;background-color:var(--progress-bg);width:var(--progress-width)}@media (prefers-reduced-motion:no-preference){.prc-ProgressBar-ProgressBarItem-mDIlB[data-animated=true]{animation-duration:1s;animation-iteration-count:infinite;animation-name:prc-ProgressBar-shimmer-hIHBF;mask-image:linear-gradient(75deg,#000 30%,#000000a6 80%);mask-size:200%}}.prc-ProgressBar-ProgressBarContainer-tCYE2{background-color:var(--progressBar-track-bgColor,#d1d9e0);border-radius:var(--borderRadius-small,.1875rem);display:flex;gap:2px;outline:solid 1px var(--progressBar-track-borderColor,#fff0);outline-offset:-1px;overflow:hidden}.prc-ProgressBar-ProgressBarContainer-tCYE2:where([data-progress-display=inline]){display:inline-flex}.prc-ProgressBar-ProgressBarContainer-tCYE2:where([data-progress-bar-size=default]){height:8px}.prc-ProgressBar-ProgressBarContainer-tCYE2:where([data-progress-bar-size=small]){height:5px}.prc-ProgressBar-ProgressBarContainer-tCYE2:where([data-progress-bar-size=large]){height:10px}@media (forced-colors:active){:root{--progress-bg:LinkText;--progressBar-track-bgColor:CanvasText}.prc-ProgressBar-ProgressBarContainer-tCYE2,.prc-ProgressBar-ProgressBarItem-mDIlB{forced-color-adjust:none}}}@layer primer-react{.prc-StateLabel-StateLabel-Iawzp{align-items:center;border-radius:var(--borderRadius-full,624.9375rem);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis));display:inline-flex;font-weight:var(--base-text-weight-semibold,600);line-height:16px;text-align:center}.prc-StateLabel-StateLabel-Iawzp:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);padding:var(--base-size-4,.25rem) var(--base-size-8,.5rem)}.prc-StateLabel-StateLabel-Iawzp:where([data-size=medium]){font-size:var(--text-body-size-medium,.875rem);padding:var(--base-size-8,.5rem) var(--base-size-12,.75rem)}.prc-StateLabel-StateLabel-Iawzp:where([data-status=issueClosed]){background-color:var(--bgColor-done-emphasis,var(--color-done-emphasis));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-done-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=issueClosedNotPlanned]){background-color:var(--bgColor-neutral-emphasis,var(--color-fg-subtle));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-neutral-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=pullClosed]){background-color:var(--bgColor-closed-emphasis,var(--color-closed-emphasis));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-closed-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=pullMerged]){background-color:var(--bgColor-done-emphasis,var(--color-done-emphasis));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-done-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=pullQueued]){background-color:var(--bgColor-attention-emphasis,var(--color-attention-emphasis));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-attention-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=issueOpened]){background-color:var(--bgColor-open-emphasis,var(--color-open-emphasis));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-open-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=pullOpened]){background-color:var(--bgColor-open-emphasis,var(--color-open-emphasis));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-open-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=draft]){background-color:var(--bgColor-draft-emphasis,var(--bgColor-neutral-emphasis,var(--color-fg-subtle)));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-draft-emphasis,var(--borderColor-neutral-emphasis,#0000));color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=issueDraft]){background-color:var(--bgColor-draft-emphasis,var(--bgColor-neutral-emphasis,var(--color-fg-subtle)));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-draft-emphasis,var(--borderColor-neutral-emphasis,#0000));color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=unavailable]){background-color:var(--bgColor-neutral-emphasis,var(--color-fg-subtle));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-neutral-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=open]){background-color:var(--bgColor-open-emphasis,var(--color-open-emphasis));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-open-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-StateLabel-Iawzp:where([data-status=closed]){background-color:var(--bgColor-done-emphasis,var(--color-done-emphasis));box-shadow:var(--boxShadow-thin,inset 0 0 0 1px) var(--borderColor-done-emphasis,#0000);color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-StateLabel-Icon-YICrR{margin-right:var(--base-size-4,.25rem)}.prc-StateLabel-Icon-YICrR:where([data-size-small]){width:1em}}@layer primer-react{.prc-ActionBar-List-9uz46{align-items:center;display:flex;gap:var(--actionbar-gap,var(--stack-gap-condensed,.5rem));list-style:none;margin-bottom:-1px;min-width:0;position:relative;white-space:nowrap}.prc-ActionBar-List-9uz46:where([data-gap=none]){--actionbar-gap:0}.prc-ActionBar-List-9uz46:where([data-gap=none]) .prc-ActionBar-Divider-6V8yH{padding:0 var(--base-size-8,.5rem)}.prc-ActionBar-List-9uz46:where([data-gap=condensed]){--actionbar-gap:var(--stack-gap-condensed,0.5rem)}.prc-ActionBar-Nav-9spON{align-items:center;display:flex;justify-content:flex-end;padding-inline:var(--base-size-16,1rem)}.prc-ActionBar-Nav-9spON:where([data-flush=true]){padding-inline:0}.prc-ActionBar-Divider-6V8yH:before{background:var(--borderColor-muted,var(--color-border-muted));content:"";display:block;height:var(--base-size-20,1.25rem);width:var(--borderWidth-thin,.0625rem)}.prc-ActionBar-Group-peNCk{display:flex;gap:inherit}.prc-InlineMessage-InlineMessage-8xfK-{align-items:start;color:var(--inline-message-fgColor);column-gap:.5rem;display:grid;font-size:var(--inline-message-fontSize);grid-template-columns:auto 1fr;line-height:var(--inline-message-lineHeight)}.prc-InlineMessage-InlineMessage-8xfK-[data-size=small]{--inline-message-fontSize:var(--text-body-size-small,0.75rem);--inline-message-lineHeight:var(--text-body-lineHeight-small,1.6666)}.prc-InlineMessage-InlineMessage-8xfK-[data-size=medium]{--inline-message-fontSize:var(--text-body-size-medium,0.875rem);--inline-message-lineHeight:var(--text-body-lineHeight-medium,1.4285)}.prc-InlineMessage-InlineMessage-8xfK-[data-variant=warning]{--inline-message-fgColor:var(--fgColor-attention,var(--color-attention-fg))}.prc-InlineMessage-InlineMessage-8xfK-[data-variant=critical]{--inline-message-fgColor:var(--fgColor-danger,var(--color-danger-fg))}.prc-InlineMessage-InlineMessage-8xfK-[data-variant=success]{--inline-message-fgColor:var(--fgColor-success,var(--color-success-fg))}.prc-InlineMessage-InlineMessage-8xfK-[data-variant=unavailable]{--inline-message-fgColor:var(--fgColor-muted,var(--color-fg-muted))}.prc-InlineMessage-InlineMessageIcon-rl8pZ{min-height:calc(var(--inline-message-lineHeight)*var(--inline-message-fontSize))}.prc-PageLayout-PageLayoutRoot--KH-d{--region-order-header:0;--region-order-pane-start:1;--region-order-content:2;--region-order-pane-end:3;--region-order-footer:4;--spacing-none:0;--spacing-condensed:var(--base-size-16,1rem);--spacing-normal:var(--base-size-16,1rem)}}@layer primer-react{}@layer primer-react{@media screen and (min-width:1012px){.prc-PageLayout-PageLayoutRoot--KH-d{--spacing-normal:var(--base-size-24,1.5rem)}}.prc-PageLayout-PageLayoutRoot--KH-d{--pane-width-small:100%;--pane-width-medium:100%;--pane-width-large:100%;--pane-max-width-diff:511px}@media screen and (min-width:768px){.prc-PageLayout-PageLayoutRoot--KH-d{--pane-width-small:240px;--pane-width-medium:256px;--pane-width-large:256px}}@media screen and (min-width:1012px){.prc-PageLayout-PageLayoutRoot--KH-d{--pane-width-small:256px;--pane-width-medium:296px;--pane-width-large:320px}}@media screen and (min-width:1280px){.prc-PageLayout-PageLayoutRoot--KH-d{--pane-max-width-diff:959px}}.prc-PageLayout-PageLayoutRoot--KH-d{--spacing:0;--spacing-row:0;--spacing-column:0;--spacing-divider:0;--offset-header:0;--pane-width:0;--pane-min-width:0;--pane-max-width:0;--pane-width-custom:0;--pane-width-size:0;padding:var(--spacing)}.prc-PageLayout-PageLayoutWrapper-2BhU2{display:flex;flex-wrap:wrap;height:100%;margin-left:auto;margin-right:auto;width:100%}.prc-PageLayout-PageLayoutWrapper-2BhU2:where([data-width=medium]){max-width:768px}.prc-PageLayout-PageLayoutWrapper-2BhU2:where([data-width=large]){max-width:1012px}.prc-PageLayout-PageLayoutWrapper-2BhU2:where([data-width=full]){max-width:100%}.prc-PageLayout-PageLayoutWrapper-2BhU2:where([data-width=xlarge]){max-width:1280px}.prc-PageLayout-PageLayoutContent-BneH9{display:flex;flex:1 1 100%;flex-wrap:wrap;max-width:100%}.prc-PageLayout-HorizontalDivider-JLVqp{margin-left:calc(var(--spacing-divider)*-1);margin-right:calc(var(--spacing-divider)*-1)}.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant=none]){display:none}.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant=line]){background-color:var(--borderColor-default,var(--color-border-default));display:block;height:1px}.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant=filled]){background-color:var(--bgColor-inset,var(--color-canvas-inset));box-shadow:inset 0 -1px 0 0 var(--borderColor-default,var(--color-border-default)),inset 0 1px 0 0 var(--borderColor-default,var(--color-border-default));display:block;height:var(--base-size-8,.5rem)}@media (max-width:calc(48rem - 0.02px)){.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant-narrow=none]){display:none}.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant-narrow=line]){background-color:var(--borderColor-default,var(--color-border-default));display:block;height:1px}.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant-narrow=filled]){background-color:var(--bgColor-inset,var(--color-canvas-inset));box-shadow:inset 0 -1px 0 0 var(--borderColor-default,var(--color-border-default)),inset 0 1px 0 0 var(--borderColor-default,var(--color-border-default));display:block;height:var(--base-size-8,.5rem)}}@media (min-width:48rem){.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant-regular=none]){display:none}.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant-regular=line]){background-color:var(--borderColor-default,var(--color-border-default));display:block;height:1px}.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant-regular=filled]){background-color:var(--bgColor-inset,var(--color-canvas-inset));box-shadow:inset 0 -1px 0 0 var(--borderColor-default,var(--color-border-default)),inset 0 1px 0 0 var(--borderColor-default,var(--color-border-default));display:block;height:var(--base-size-8,.5rem)}}@media (min-width:87.5rem){.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant-wide=none]){display:none}.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant-wide=line]){background-color:var(--borderColor-default,var(--color-border-default));display:block;height:1px}.prc-PageLayout-HorizontalDivider-JLVqp:where([data-variant-wide=filled]){background-color:var(--bgColor-inset,var(--color-canvas-inset));box-shadow:inset 0 -1px 0 0 var(--borderColor-default,var(--color-border-default)),inset 0 1px 0 0 var(--borderColor-default,var(--color-border-default));display:block;height:var(--base-size-8,.5rem)}}@media screen and (min-width:768px){.prc-PageLayout-HorizontalDivider-JLVqp{margin-left:0!important;margin-right:0!important}}.prc-PageLayout-VerticalDivider-9QRmK{height:100%;position:relative}.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant=none]){display:none}.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant=line]){background-color:var(--borderColor-default,var(--color-border-default));display:block;width:1px}.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant=filled]){background-color:var(--bgColor-inset,var(--color-canvas-inset));box-shadow:inset -1px 0 0 0 var(--borderColor-default,var(--color-border-default)),inset 1px 0 0 0 var(--borderColor-default,var(--color-border-default));display:block;width:var(--base-size-8,.5rem)}@media (max-width:calc(48rem - 0.02px)){.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant-narrow=none]){display:none}.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant-narrow=line]){background-color:var(--borderColor-default,var(--color-border-default));display:block;width:1px}.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant-narrow=filled]){background-color:var(--bgColor-inset,var(--color-canvas-inset));box-shadow:inset -1px 0 0 0 var(--borderColor-default,var(--color-border-default)),inset 1px 0 0 0 var(--borderColor-default,var(--color-border-default));display:block;width:var(--base-size-8,.5rem)}}@media (min-width:48rem){.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant-regular=none]){display:none}.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant-regular=line]){background-color:var(--borderColor-default,var(--color-border-default));display:block;width:1px}.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant-regular=filled]){background-color:var(--bgColor-inset,var(--color-canvas-inset));box-shadow:inset -1px 0 0 0 var(--borderColor-default,var(--color-border-default)),inset 1px 0 0 0 var(--borderColor-default,var(--color-border-default));display:block;width:var(--base-size-8,.5rem)}}@media (min-width:87.5rem){.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant-wide=none]){display:none}.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant-wide=line]){background-color:var(--borderColor-default,var(--color-border-default));display:block;width:1px}.prc-PageLayout-VerticalDivider-9QRmK:where([data-variant-wide=filled]){background-color:var(--bgColor-inset,var(--color-canvas-inset));box-shadow:inset -1px 0 0 0 var(--borderColor-default,var(--color-border-default)),inset 1px 0 0 0 var(--borderColor-default,var(--color-border-default));display:block;width:var(--base-size-8,.5rem)}}.prc-PageLayout-Header-0of-R{margin-bottom:var(--spacing);width:100%}.prc-PageLayout-Header-0of-R:where([data-hidden=true]){display:none}@media (max-width:calc(48rem - 0.02px)){.prc-PageLayout-Header-0of-R:where([data-hidden-narrow=true]){display:none}}@media (min-width:48rem){.prc-PageLayout-Header-0of-R:where([data-hidden-regular=true]){display:none}}@media (min-width:87.5rem){.prc-PageLayout-Header-0of-R:where([data-hidden-wide=true]){display:none}}.prc-PageLayout-HeaderContent-gdFfN{padding:var(--spacing)}.prc-PageLayout-HeaderHorizontalDivider-odAHl{margin-top:var(--spacing)}.prc-PageLayout-ContentWrapper-gR9eG{display:flex;flex-basis:0;flex-direction:column;flex-grow:1;flex-shrink:1;min-width:1px;order:var(--region-order-content)}.prc-PageLayout-ContentWrapper-gR9eG:where([data-is-hidden=true]){display:none}@media (max-width:calc(48rem - 0.02px)){.prc-PageLayout-ContentWrapper-gR9eG:where([data-is-hidden-narrow=true]){display:none}}@media (min-width:48rem){.prc-PageLayout-ContentWrapper-gR9eG:where([data-is-hidden-regular=true]){display:none}}@media (min-width:87.5rem){.prc-PageLayout-ContentWrapper-gR9eG:where([data-is-hidden-wide=true]){display:none}}.prc-PageLayout-Content-xWL-A{flex-grow:1;margin-left:auto;margin-right:auto;padding:var(--spacing);width:100%}.prc-PageLayout-Content-xWL-A:where([data-width=medium]){max-width:768px}.prc-PageLayout-Content-xWL-A:where([data-width=large]){max-width:1012px}.prc-PageLayout-Content-xWL-A:where([data-width=full]){max-width:100%}.prc-PageLayout-Content-xWL-A:where([data-width=xlarge]){max-width:1280px}.prc-PageLayout-PaneWrapper-pHPop{display:flex;margin-left:0;margin-right:0;width:100%}.prc-PageLayout-PaneWrapper-pHPop:where([data-is-hidden=true]){display:none}@media (max-width:calc(48rem - 0.02px)){.prc-PageLayout-PaneWrapper-pHPop:where([data-is-hidden-narrow=true]){display:none}.prc-PageLayout-PaneWrapper-pHPop:where([data-position-narrow=end]){flex-direction:column;margin-top:var(--spacing-row);order:var(--region-order-pane-end)}.prc-PageLayout-PaneWrapper-pHPop:where([data-position-narrow=start]){flex-direction:column-reverse;margin-bottom:var(--spacing-row);order:var(--region-order-pane-start)}}@media (max-width:calc(48rem - 0.02px)){.prc-PageLayout-PaneWrapper-pHPop:where([data-position=end]){flex-direction:column;margin-top:var(--spacing-row);order:var(--region-order-pane-end)}.prc-PageLayout-PaneWrapper-pHPop:where([data-position=start]){flex-direction:column-reverse;margin-bottom:var(--spacing-row);order:var(--region-order-pane-start)}}@media screen and (min-width:768px){.prc-PageLayout-PaneWrapper-pHPop:where([data-is-hidden-regular=true]){display:none}.prc-PageLayout-PaneWrapper-pHPop{margin-bottom:0!important;margin-top:0!important;width:auto}.prc-PageLayout-PaneWrapper-pHPop:where([data-sticky]){max-height:100vh;position:sticky;top:var(--offset-header)}.prc-PageLayout-PaneWrapper-pHPop:where([data-position=end]){flex-direction:row-reverse;margin-left:var(--spacing-column);order:var(--region-order-pane-end)}.prc-PageLayout-PaneWrapper-pHPop:where([data-position=start]){flex-direction:row;margin-right:var(--spacing-column);order:var(--region-order-pane-start)}.prc-PageLayout-PaneWrapper-pHPop:where([data-position-regular=end]){flex-direction:row-reverse;margin-left:var(--spacing-column);order:var(--region-order-pane-end)}.prc-PageLayout-PaneWrapper-pHPop:where([data-position-regular=start]){flex-direction:row;margin-right:var(--spacing-column);order:var(--region-order-pane-start)}}@media (min-width:87.5rem){.prc-PageLayout-PaneWrapper-pHPop:where([data-is-hidden-wide=true]){display:none}.prc-PageLayout-PaneWrapper-pHPop:where([data-position-wide=end]){flex-direction:row-reverse;margin-left:var(--spacing-column);order:var(--region-order-pane-end)}.prc-PageLayout-PaneWrapper-pHPop:where([data-position-wide=start]){flex-direction:row;margin-right:var(--spacing-column);order:var(--region-order-pane-start)}}.prc-PageLayout-PaneVerticalDivider-le57g:where([data-position=start]){margin-left:var(--spacing)}.prc-PageLayout-PaneVerticalDivider-le57g:where([data-position=end]){margin-right:var(--spacing)}@media (max-width:calc(48rem - 0.02px)){.prc-PageLayout-PaneVerticalDivider-le57g:where([data-position-narrow=start]){margin-left:var(--spacing);margin-right:0}.prc-PageLayout-PaneVerticalDivider-le57g:where([data-position-narrow=end]){margin-left:0;margin-right:var(--spacing)}}@media (min-width:48rem){.prc-PageLayout-PaneVerticalDivider-le57g:where([data-position-regular=start]){margin-left:var(--spacing);margin-right:0}.prc-PageLayout-PaneVerticalDivider-le57g:where([data-position-regular=end]){margin-left:0;margin-right:var(--spacing)}}@media (min-width:87.5rem){.prc-PageLayout-PaneVerticalDivider-le57g:where([data-position-wide=start]){margin-left:var(--spacing);margin-right:0}.prc-PageLayout-PaneVerticalDivider-le57g:where([data-position-wide=end]){margin-left:0;margin-right:var(--spacing)}}.prc-PageLayout-Pane-AyzHK{padding:var(--spacing);width:var(--pane-width-size)}@media screen and (min-width:768px){.prc-PageLayout-Pane-AyzHK{overflow:auto}}.prc-PageLayout-Pane-AyzHK:where([data-resizable]){width:100%}@media screen and (min-width:768px){.prc-PageLayout-Pane-AyzHK:where([data-resizable]){width:clamp(var(--pane-min-width),var(--pane-width),var(--pane-max-width))}}.prc-PageLayout-PaneHorizontalDivider-9tbnE:where([data-position=start]){margin-top:var(--spacing)}.prc-PageLayout-PaneHorizontalDivider-9tbnE:where([data-position=end]){margin-bottom:var(--spacing)}@media (max-width:calc(48rem - 0.02px)){.prc-PageLayout-PaneHorizontalDivider-9tbnE:where([data-position-narrow=start]){margin-bottom:0;margin-top:var(--spacing)}.prc-PageLayout-PaneHorizontalDivider-9tbnE:where([data-position-narrow=end]){margin-bottom:var(--spacing);margin-top:0}}@media (min-width:48rem){.prc-PageLayout-PaneHorizontalDivider-9tbnE:where([data-position-regular=start]){margin-bottom:0;margin-top:var(--spacing)}.prc-PageLayout-PaneHorizontalDivider-9tbnE:where([data-position-regular=end]){margin-bottom:var(--spacing);margin-top:0}}@media (min-width:87.5rem){.prc-PageLayout-PaneHorizontalDivider-9tbnE:where([data-position-wide=start]){margin-bottom:0;margin-top:var(--spacing)}.prc-PageLayout-PaneHorizontalDivider-9tbnE:where([data-position-wide=end]){margin-bottom:var(--spacing);margin-top:0}}.prc-PageLayout-FooterWrapper-9cB8y{margin-top:var(--spacing);order:var(--region-order-footer);width:100%}.prc-PageLayout-FooterWrapper-9cB8y:where([data-hidden=true]){display:none}@media (max-width:calc(48rem - 0.02px)){.prc-PageLayout-FooterWrapper-9cB8y:where([data-hidden-narrow=true]){display:none}}@media (min-width:48rem){.prc-PageLayout-FooterWrapper-9cB8y:where([data-hidden-regular=true]){display:none}}@media (min-width:87.5rem){.prc-PageLayout-FooterWrapper-9cB8y:where([data-hidden-wide=true]){display:none}}.prc-PageLayout-FooterHorizontalDivider-W-RaS{margin-bottom:var(--spacing)}.prc-PageLayout-FooterContent-HUS0V{padding:var(--spacing)}.prc-PageLayout-DraggableHandle-9s6B4{cursor:col-resize;inset:0 -2px;position:absolute;touch-action:none;-webkit-user-select:none;user-select:none}.prc-PageLayout-DraggableHandle-9s6B4:before{background-color:var(--draggable-handle--bg-color,var(--bgColor-neutral-muted,var(--color-neutral-subtle)));border-radius:inherit;content:"";inset:0;opacity:var(--draggable-handle--drag-opacity,0);position:absolute;transition:var(--draggable-handle--transition,opacity .15s ease)}.prc-PageLayout-DraggableHandle-9s6B4:hover:before{opacity:1}.prc-PageLayout-ContentWrapper-gR9eG[data-dragging=true],.prc-PageLayout-Pane-AyzHK[data-dragging=true]{contain:layout style paint;content-visibility:auto;pointer-events:none}.prc-LabelGroup-Container-E-ePP{display:flex;flex-wrap:nowrap;gap:var(--base-size-4,.25rem);line-height:1;max-width:100%;overflow:hidden}}@layer primer-react{.prc-LabelGroup-Container-E-ePP:where([data-overflow=inline]){flex-wrap:wrap}.prc-LabelGroup-Container-E-ePP:where([data-list]){list-style-type:none;margin-block-end:0;margin-block-start:0;padding-inline-start:0}.prc-LabelGroup-ItemWrapper-GkO4t{align-items:center;display:flex;min-height:28px}.prc-LabelGroup-ItemWrapper--hidden-mdrB0{order:9999;pointer-events:none;visibility:hidden}.prc-LabelGroup-OverlayContainer-duQvd{align-items:flex-start;display:flex}.prc-LabelGroup-OverlayInner-nDXRC{display:flex;flex-wrap:wrap;gap:var(--base-size-4,.25rem)}.prc-LabelGroup-CloseButton-IyLno{flex-shrink:0}.prc-Pagination-Page-Etgqf{align-items:center;background-color:initial;border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-default,var(--color-fg-default));cursor:pointer;display:inline-flex;font-style:normal;height:32px;justify-content:center;line-height:1;margin-right:var(--base-size-4,.25rem);min-width:32px;padding:var(--base-size-8,.5rem) calc((var(--base-size-32,2rem) - var(--base-size-20,1.25rem))/2);text-align:center;-webkit-text-decoration:none;text-decoration:none;transition:background-color .2s cubic-bezier(.3,0,.5,1);-webkit-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.prc-Pagination-Page-Etgqf[rel=next]>svg,.prc-Pagination-Page-Etgqf[rel=prev]>svg{height:1em;width:1em}.prc-Pagination-Page-Etgqf[rel=prev]>svg{margin-inline-end:var(--base-size-4,.25rem)}.prc-Pagination-Page-Etgqf[rel=next]>svg{margin-inline-start:var(--base-size-4,.25rem)}.prc-Pagination-Page-Etgqf:last-child{margin-right:0}.prc-Pagination-Page-Etgqf:focus,.prc-Pagination-Page-Etgqf:hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg));outline:0;-webkit-text-decoration:none;text-decoration:none;transition-duration:.1s}.prc-Pagination-Page-Etgqf:focus-visible{outline:2px solid var(--bgColor-accent-emphasis,var(--color-accent-emphasis));outline-offset:-2px}.prc-Pagination-Page-Etgqf:active{border-color:var(--borderColor-muted,var(--color-border-muted))}.prc-Pagination-Page-Etgqf[rel=next],.prc-Pagination-Page-Etgqf[rel=prev]{color:var(--fgColor-accent,var(--color-accent-fg))}.prc-Pagination-Page-Etgqf[aria-current],.prc-Pagination-Page-Etgqf[aria-current]:hover{background-color:var(--bgColor-accent-emphasis,var(--color-accent-emphasis));border-color:#0000;color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.prc-Pagination-Page-Etgqf[aria-current]:focus-visible{box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis,var(--color-fg-on-emphasis));outline:2px solid var(--bgColor-accent-emphasis,var(--color-accent-emphasis));outline-offset:-2px}.prc-Pagination-Page-Etgqf[aria-hidden],.prc-Pagination-Page-Etgqf[aria-hidden]:hover,.prc-Pagination-Page-Etgqf[role=presentation],.prc-Pagination-Page-Etgqf[role=presentation]:hover{background-color:initial;color:var(--fgColor-disabled,var(--color-primer-fg-disabled));cursor:default}.prc-Pagination-PaginationContainer-HEhGo{margin-bottom:15px;margin-top:20px;text-align:center}.prc-Pagination-TablePaginationSteps-cAXs3{display:inline-block}}@layer primer-react{@media screen and (max-width:calc(48rem - 0.02px)){.prc-Pagination-TablePaginationSteps-cAXs3[data-hidden-viewport-ranges*=narrow]>:not(:first-child):not(:last-child){display:none}.prc-Pagination-TablePaginationSteps-cAXs3[data-hidden-viewport-ranges*=narrow]>:first-child{margin-inline-end:0}.prc-Pagination-TablePaginationSteps-cAXs3[data-hidden-viewport-ranges*=narrow]>:last-child{margin-inline-start:0}}@media screen and (min-width:48rem){.prc-Pagination-TablePaginationSteps-cAXs3[data-hidden-viewport-ranges*=regular]>:not(:first-child):not(:last-child){display:none}.prc-Pagination-TablePaginationSteps-cAXs3[data-hidden-viewport-ranges*=regular]>:first-child{margin-inline-end:0}.prc-Pagination-TablePaginationSteps-cAXs3[data-hidden-viewport-ranges*=regular]>:last-child{margin-inline-start:0}}@media screen and (min-width:87.5rem){.prc-Pagination-TablePaginationSteps-cAXs3[data-hidden-viewport-ranges*=wide]>:not(:first-child):not(:last-child){display:none}.prc-Pagination-TablePaginationSteps-cAXs3[data-hidden-viewport-ranges*=wide]>:first-child{margin-inline-end:0}.prc-Pagination-TablePaginationSteps-cAXs3[data-hidden-viewport-ranges*=wide]>:last-child{margin-inline-start:0}}}@layer primer-react{.prc-Popover-Popover-7QIH8{display:none;position:absolute;z-index:100}.prc-Popover-Popover-7QIH8:where([data-open]){display:block}.prc-Popover-Popover-7QIH8:where([data-relative]){position:relative}.prc-Popover-PopoverContent-2x-Aj{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-medium,.375rem);box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));margin-left:auto;margin-right:auto;padding:var(--base-size-24,1.5rem);position:relative}.prc-Popover-PopoverContent-2x-Aj:after,.prc-Popover-PopoverContent-2x-Aj:before{content:"";display:inline-block;left:50%;position:absolute}.prc-Popover-PopoverContent-2x-Aj:before{border-bottom-color:#0000;border:var(--base-size-8,.5rem) solid #0000;border-bottom:var(--base-size-8,.5rem) solid var(--borderColor-default,var(--color-border-default));margin-left:-9px;top:calc(var(--base-size-16,1rem)*-1)}.prc-Popover-PopoverContent-2x-Aj:after{border:7px solid #0000;border-bottom:7px solid var(--overlay-bgColor,var(--color-canvas-overlay));margin-left:calc(var(--base-size-8,.5rem)*-1);top:-14px}:is(:where([data-caret=bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-left]) .prc-Popover-PopoverContent-2x-Aj):after,:is(:where([data-caret=bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-left]) .prc-Popover-PopoverContent-2x-Aj):before{border-bottom-color:#0000;top:auto}:is(:where([data-caret=bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-left]) .prc-Popover-PopoverContent-2x-Aj):before{border-top-color:var(--borderColor-default,var(--color-border-default));bottom:calc(var(--base-size-16,1rem)*-1)}:is(:where([data-caret=bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-left]) .prc-Popover-PopoverContent-2x-Aj):after{border-top-color:var(--overlay-bgColor,var(--color-canvas-overlay));bottom:-14px}:where([data-caret=bottom-right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=top-right]) .prc-Popover-PopoverContent-2x-Aj{margin-right:0;right:-9px}:is(:where([data-caret=top-right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-right]) .prc-Popover-PopoverContent-2x-Aj):after,:is(:where([data-caret=top-right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-right]) .prc-Popover-PopoverContent-2x-Aj):before{left:auto;margin-left:0}:is(:where([data-caret=top-right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-right]) .prc-Popover-PopoverContent-2x-Aj):before{right:20px}:is(:where([data-caret=top-right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-right]) .prc-Popover-PopoverContent-2x-Aj):after{right:21px}:where([data-caret=bottom-left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=top-left]) .prc-Popover-PopoverContent-2x-Aj{left:-9px;margin-left:0}:is(:where([data-caret=top-left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-left]) .prc-Popover-PopoverContent-2x-Aj):after,:is(:where([data-caret=top-left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-left]) .prc-Popover-PopoverContent-2x-Aj):before{left:var(--base-size-24,1.5rem);margin-left:0}:is(:where([data-caret=top-left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=bottom-left]) .prc-Popover-PopoverContent-2x-Aj):after{left:calc(var(--base-size-24,1.5rem) + 1px)}:is(:where([data-caret=right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):after,:is(:where([data-caret=right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):before{border-bottom-color:#0000;left:auto;margin-left:0;top:50%}:is(:where([data-caret=right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):before{margin-top:calc((var(--base-size-8,.5rem) + 1px)*-1)}:is(:where([data-caret=right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):after{margin-top:calc(var(--base-size-8,.5rem)*-1)}:is(:where([data-caret=right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj):before{border-left-color:var(--borderColor-default,var(--color-border-default));right:calc(var(--base-size-16,1rem)*-1)}:is(:where([data-caret=right]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj):after{border-left-color:var(--overlay-bgColor,var(--color-canvas-overlay));right:-14px}:is(:where([data-caret=left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):before{border-right-color:var(--borderColor-default,var(--color-border-default));left:calc(var(--base-size-16,1rem)*-1)}:is(:where([data-caret=left]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):after{border-right-color:var(--overlay-bgColor,var(--color-canvas-overlay));left:-14px}:is(:where([data-caret=right-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-top]) .prc-Popover-PopoverContent-2x-Aj):after,:is(:where([data-caret=right-top]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-top]) .prc-Popover-PopoverContent-2x-Aj):before{top:var(--base-size-24,1.5rem)}:is(:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):after,:is(:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):before{top:auto}:is(:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):before{bottom:var(--base-size-16,1rem)}:is(:where([data-caret=right-bottom]) .prc-Popover-PopoverContent-2x-Aj,:where([data-caret=left-bottom]) .prc-Popover-PopoverContent-2x-Aj):after{bottom:calc(var(--base-size-16,1rem) + 1px)}.prc-Popover-PopoverContent-2x-Aj:where([data-width=xsmall]){width:var(--overlay-width-xsmall,12rem)}.prc-Popover-PopoverContent-2x-Aj:where([data-width=small]){width:var(--overlay-width-small,20rem)}.prc-Popover-PopoverContent-2x-Aj:where([data-width=medium]){width:var(--overlay-width-medium,30rem)}.prc-Popover-PopoverContent-2x-Aj:where([data-width=large]){width:var(--overlay-width-large,40rem)}.prc-Popover-PopoverContent-2x-Aj:where([data-width=xlarge]){width:var(--overlay-width-xlarge,60rem)}.prc-Popover-PopoverContent-2x-Aj:where([data-width=auto]){width:auto}.prc-Popover-PopoverContent-2x-Aj:where([data-height=small]){height:var(--overlay-height-small,16rem)}.prc-Popover-PopoverContent-2x-Aj:where([data-height=medium]){height:var(--overlay-height-medium,20rem)}.prc-Popover-PopoverContent-2x-Aj:where([data-height=large]){height:var(--overlay-height-large,27rem)}.prc-Popover-PopoverContent-2x-Aj:where([data-height=xlarge]){height:var(--overlay-height-xlarge,37.5rem)}.prc-Popover-PopoverContent-2x-Aj:where([data-height=fit-content]){height:-moz-fit-content;height:fit-content}.prc-Popover-PopoverContent-2x-Aj:where([data-height=auto]){height:auto}}@layer primer-react{.prc-AvatarStack-AvatarStack-vkIK2{--avatar-border-width:1px;--mask-size:calc(100% + var(--avatar-border-width)*2);--mask-start:-1;--opacity-step:15%;display:flex;height:var(--avatar-stack-size);isolation:isolate;min-width:var(--avatar-stack-size);position:relative}.prc-AvatarStack-AvatarStack-vkIK2:where([data-variant=cascade]){--overlap-size:calc(var(--avatar-stack-size)*0.55);--overlap-size-avatar-three-plus:calc(var(--avatar-stack-size)*0.85)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-variant=stack]){--overlap-size:calc(var(--avatar-stack-size)*0.55);--overlap-size-avatar-three-plus:calc(var(--avatar-stack-size)*0.55)}@media screen and (max-width:calc(48rem - 0.02px)){.prc-AvatarStack-AvatarStack-vkIK2:where([data-responsive]){--avatar-stack-size:var(--stackSize-narrow)}}@media screen and (min-width:48rem){.prc-AvatarStack-AvatarStack-vkIK2:where([data-responsive]){--avatar-stack-size:var(--stackSize-regular)}}@media screen and (min-width:87.5rem){.prc-AvatarStack-AvatarStack-vkIK2:where([data-responsive]){--avatar-stack-size:var(--stackSize-wide)}}.prc-AvatarStack-AvatarStack-vkIK2:where([data-avatar-count="1"][data-shape=circle]) .prc-AvatarStack-AvatarItem-70eW3:where([data-component=Avatar]){box-shadow:0 0 0 var(--avatar-border-width) var(--avatar-borderColor,var(--color-avatar-border))}.prc-AvatarStack-AvatarStack-vkIK2:where([data-avatar-count="1"][data-shape=square]) .prc-AvatarStack-AvatarItem-70eW3{box-shadow:1px 0 #000}.prc-AvatarStack-AvatarStack-vkIK2:where([data-avatar-count="1"][data-shape=square][data-align-right]) .prc-AvatarStack-AvatarItem-70eW3{box-shadow:-1px 0 #000}.prc-AvatarStack-AvatarStack-vkIK2:where([data-avatar-count="2"]){min-width:calc(var(--avatar-stack-size) + var(--avatar-stack-size) - var(--overlap-size))}.prc-AvatarStack-AvatarStack-vkIK2:where([data-avatar-count="3"][data-variant=cascade]){min-width:calc(var(--avatar-stack-size) + var(--avatar-stack-size) - var(--overlap-size) + var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus))}.prc-AvatarStack-AvatarStack-vkIK2:where([data-avatar-count="3"][data-variant=stack]){min-width:calc(var(--avatar-stack-size) + (var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus))*2)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-avatar-count="3+"][data-variant=cascade]){min-width:calc(var(--avatar-stack-size) + var(--avatar-stack-size) - var(--overlap-size) + (var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus))*2)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-avatar-count="3+"][data-variant=stack]){min-width:calc(var(--avatar-stack-size) + (var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus))*3);--overlap-size:var(--overlap-size-avatar-three-plus)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-align-right]){--mask-start:1;direction:rtl}.prc-AvatarStack-AvatarStackBody-JFK4u{display:flex;position:absolute}.prc-AvatarStack-AvatarStackBody-JFK4u:where([data-disable-expand]){position:relative}.prc-AvatarStack-AvatarItem-70eW3{--avatarSize-regular:var(--avatar-stack-size);display:flex;flex-shrink:0;height:var(--avatar-stack-size);overflow:hidden;position:relative;transition:margin .2s ease-in-out,opacity .2s ease-in-out,mask-position .2s ease-in-out,mask-size .2s ease-in-out;width:var(--avatar-stack-size)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=circle]) .prc-AvatarStack-AvatarItem-70eW3:is(img){box-shadow:0 0 0 var(--avatar-border-width) #0000}.prc-AvatarStack-AvatarItem-70eW3:not([data-component=Avatar]):not(:has([data-square])){border-radius:50%}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=square]) .prc-AvatarStack-AvatarItem-70eW3:is(img){box-shadow:1px 0 #fff}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=square][data-align-right]) .prc-AvatarStack-AvatarItem-70eW3:is(img){box-shadow:-1px 0 #fff}.prc-AvatarStack-AvatarItem-70eW3:first-child{margin-inline-start:0}.prc-AvatarStack-AvatarItem-70eW3:nth-child(n+2){margin-inline-start:calc(var(--overlap-size)*-1);mask-composite:exclude;mask-position:calc((var(--avatar-stack-size) - var(--overlap-size))*var(--mask-start) - var(--avatar-border-width)) center,0 0;mask-repeat:no-repeat,no-repeat;mask-size:var(--mask-size) var(--mask-size),auto;padding:.1px}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=circle]) .prc-AvatarStack-AvatarItem-70eW3:nth-child(n+2){mask-image:radial-gradient(at 50% 50%,#000 70%,#0000 71%),linear-gradient(#000 0 0)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=square]) .prc-AvatarStack-AvatarItem-70eW3:nth-child(n+2){mask-image:linear-gradient(at 50% 50%,#000 70%,#0000 71%),linear-gradient(#000 0 0)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-variant=cascade]) .prc-AvatarStack-AvatarItem-70eW3:nth-child(n+3){--overlap-size:var(--overlap-size-avatar-three-plus);opacity:calc(100% - var(--opacity-step)*2)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-variant=cascade]) .prc-AvatarStack-AvatarItem-70eW3:nth-child(n+4){opacity:calc(100% - var(--opacity-step)*3)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-variant=cascade]) .prc-AvatarStack-AvatarItem-70eW3:nth-child(n+5){opacity:calc(100% - var(--opacity-step)*4)}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=square]) .prc-AvatarStack-AvatarItem-70eW3:first-child{z-index:5}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=square]) .prc-AvatarStack-AvatarItem-70eW3:nth-child(2){z-index:4}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=square]) .prc-AvatarStack-AvatarItem-70eW3:nth-child(3){z-index:3}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=square]) .prc-AvatarStack-AvatarItem-70eW3:nth-child(4){z-index:2}.prc-AvatarStack-AvatarStack-vkIK2:where([data-shape=square]) .prc-AvatarStack-AvatarItem-70eW3:nth-child(5){z-index:1}.prc-AvatarStack-AvatarItem-70eW3:nth-child(n+6){opacity:0;visibility:hidden}.prc-AvatarStack-AvatarStackBody-JFK4u:not([data-disable-expand]):focus-within,.prc-AvatarStack-AvatarStackBody-JFK4u:not([data-disable-expand]):hover{width:auto}:is(.prc-AvatarStack-AvatarStackBody-JFK4u:not([data-disable-expand]):hover,.prc-AvatarStack-AvatarStackBody-JFK4u:not([data-disable-expand]):focus-within) .prc-AvatarStack-AvatarItem-70eW3{--mask-size:100%;margin-inline-start:var(--base-size-4,.25rem);mask-position:calc(var(--avatar-stack-size)*var(--mask-start)) center,0 0;opacity:1;visibility:visible}:is(:is(.prc-AvatarStack-AvatarStackBody-JFK4u:not([data-disable-expand]):hover,.prc-AvatarStack-AvatarStackBody-JFK4u:not([data-disable-expand]):focus-within) .prc-AvatarStack-AvatarItem-70eW3):first-child{margin-inline-start:0}.prc-UnderlineNav-UnderlineNav-1AFnH{border-bottom:var(--borderWidth-thin,.0625rem) solid var(--borderColor-muted,var(--color-border-muted));display:flex;justify-content:space-between}.prc-UnderlineNav-UnderlineNav-1AFnH.prc-UnderlineNav-UnderlineNav--right-gSEmk{justify-content:flex-end}.prc-UnderlineNav-UnderlineNav-1AFnH.prc-UnderlineNav-UnderlineNav--right-gSEmk .prc-UnderlineNav-UnderlineNavItem-TFW6v{margin-left:var(--base-size-16,1rem);margin-right:0}.prc-UnderlineNav-UnderlineNav-1AFnH.prc-UnderlineNav-UnderlineNav--right-gSEmk .prc-UnderlineNav-UnderlineNavActions-DASST{flex:1 1 auto}.prc-UnderlineNav-UnderlineNav-1AFnH.prc-UnderlineNav-UnderlineNav--full-ah6i4{display:block}.prc-UnderlineNav-UnderlineNav-1AFnH .prc-UnderlineNav-UnderlineNavBody-NCFdZ{display:flex;margin-bottom:-1px}.prc-UnderlineNav-UnderlineNav-1AFnH .prc-UnderlineNav-UnderlineNavActions-DASST{align-self:center}.prc-UnderlineNav-UnderlineNavLink-u9IaZ{border-bottom:2px solid #0000;color:var(--fgColor-default,var(--color-fg-default));font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-title-lineHeight-large,1.5);margin-right:var(--base-size-16,1rem);padding:var(--base-size-16,1rem) var(--base-size-8,.5rem);text-align:center;-webkit-text-decoration:none;text-decoration:none}.prc-UnderlineNav-UnderlineNavLink-u9IaZ:focus:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-8px}.prc-UnderlineNav-UnderlineNavLink-u9IaZ:focus:not(:disabled):not(:focus-visible){outline:1px solid #0000}.prc-UnderlineNav-UnderlineNavLink-u9IaZ:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-8px}.prc-UnderlineNav-UnderlineNavLink-u9IaZ:focus,.prc-UnderlineNav-UnderlineNavLink-u9IaZ:hover{border-bottom-color:var(--borderColor-muted,var(--color-border-muted));color:var(--fgColor-default,var(--color-fg-default));-webkit-text-decoration:none;text-decoration:none;transition:border-bottom-color .2s ease}.prc-UnderlineNav-UnderlineNavLink-u9IaZ:focus .prc-UnderlineNav-UnderlineNavOcticon-oU5sK,.prc-UnderlineNav-UnderlineNavLink-u9IaZ:hover .prc-UnderlineNav-UnderlineNavOcticon-oU5sK{color:var(--fgColor-muted,var(--color-fg-muted))}}@layer primer-react{.prc-UnderlineNav-UnderlineNavLink-u9IaZ:where([data-selected]){border-bottom-color:var(--underlineNav-borderColor-active,var(--color-primer-border-active));color:var(--fgColor-default,var(--color-fg-default))}.prc-UnderlineNav-UnderlineNavLink-u9IaZ:where([data-selected]) .prc-UnderlineNav-UnderlineNavOcticon-oU5sK{color:var(--fgColor-default,var(--color-fg-default))}}@layer primer-react{.prc-Token-IssueLabel-2IazM{--label-r:153;--label-g:153;--label-b:153;--label-h:0;--label-s:0;--label-l:60;--perceived-lightness:calc(var(--label-r)*0.2126/255 + var(--label-g)*0.7152/255 + var(--label-b)*0.0722/255);--lightness-switch:max(0,min(calc((var(--perceived-lightness) - var(--lightness-threshold))*-1000),1));border-style:solid;border-width:var(--borderWidth-thin,.0625rem);position:relative}@media (prefers-color-scheme:light){[data-color-mode=auto][data-light-theme*=light] .prc-Token-IssueLabel-2IazM{--lightness-threshold:0.453;--border-threshold:0.96;--border-alpha:max(0,min(calc((var(--perceived-lightness) - var(--border-threshold))*100),1));background:rgb(var(--label-r),var(--label-g),var(--label-b));border-color:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) - 25)*1%),var(--border-alpha));color:hsl(0deg,0%,calc(var(--lightness-switch)*100%))}:is([data-color-mode=auto][data-light-theme*=light] .prc-Token-IssueLabel-2IazM):where([data-selected=true]){background:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) - 5)*1%))}:is([data-color-mode=auto][data-light-theme*=light] .prc-Token-IssueLabel-2IazM):where([data-selected=true]):after{box-shadow:0 0 0 2px rgb(var(--label-r),var(--label-g),var(--label-b))}:is([data-color-mode=auto][data-light-theme*=light] .prc-Token-IssueLabel-2IazM):where([data-cursor-is-interactive=true]:hover){background-image:linear-gradient(#00000026,#00000026),linear-gradient(rgb(var(--label-r),var(--label-g),var(--label-b)),rgb(var(--label-r),var(--label-g),var(--label-b)));box-shadow:var(--shadow-resting-medium,var(--color-shadow-medium))}[data-color-mode=auto][data-light-theme*=dark] .prc-Token-IssueLabel-2IazM{--lightness-threshold:0.6;--background-alpha:0.18;--border-alpha:0.3;--lighten-by:calc((var(--lightness-threshold) - var(--perceived-lightness))*100*var(--lightness-switch));background:rgb(var(--label-r),var(--label-g),var(--label-b),var(--background-alpha));border-color:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + var(--lighten-by))*1%),var(--border-alpha));color:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + var(--lighten-by))*1%))}:is([data-color-mode=auto][data-light-theme*=dark] .prc-Token-IssueLabel-2IazM):where([data-selected=true]):after{box-shadow:0 0 0 2px hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + var(--lighten-by))*1%))}:is([data-color-mode=auto][data-light-theme*=dark] .prc-Token-IssueLabel-2IazM):where([data-cursor-is-interactive=true]:hover){background:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + 10)*1%),.3);box-shadow:var(--shadow-resting-medium,var(--color-shadow-medium))}}@media (prefers-color-scheme:dark){[data-color-mode=auto][data-dark-theme*=light] .prc-Token-IssueLabel-2IazM{--lightness-threshold:0.453;--border-threshold:0.96;--border-alpha:max(0,min(calc((var(--perceived-lightness) - var(--border-threshold))*100),1));background:rgb(var(--label-r),var(--label-g),var(--label-b));border-color:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) - 25)*1%),var(--border-alpha));color:hsl(0deg,0%,calc(var(--lightness-switch)*100%))}:is([data-color-mode=auto][data-dark-theme*=light] .prc-Token-IssueLabel-2IazM):where([data-selected=true]){background:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) - 5)*1%))}:is([data-color-mode=auto][data-dark-theme*=light] .prc-Token-IssueLabel-2IazM):where([data-selected=true]):after{box-shadow:0 0 0 2px rgb(var(--label-r),var(--label-g),var(--label-b))}:is([data-color-mode=auto][data-dark-theme*=light] .prc-Token-IssueLabel-2IazM):where([data-cursor-is-interactive=true]:hover){background-image:linear-gradient(#00000026,#00000026),linear-gradient(rgb(var(--label-r),var(--label-g),var(--label-b)),rgb(var(--label-r),var(--label-g),var(--label-b)));box-shadow:var(--shadow-resting-medium,var(--color-shadow-medium))}[data-color-mode=auto][data-dark-theme*=dark] .prc-Token-IssueLabel-2IazM{--lightness-threshold:0.6;--background-alpha:0.18;--border-alpha:0.3;--lighten-by:calc((var(--lightness-threshold) - var(--perceived-lightness))*100*var(--lightness-switch));background:rgb(var(--label-r),var(--label-g),var(--label-b),var(--background-alpha));border-color:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + var(--lighten-by))*1%),var(--border-alpha));color:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + var(--lighten-by))*1%))}:is([data-color-mode=auto][data-dark-theme*=dark] .prc-Token-IssueLabel-2IazM):where([data-selected=true]):after{box-shadow:0 0 0 2px hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + var(--lighten-by))*1%))}:is([data-color-mode=auto][data-dark-theme*=dark] .prc-Token-IssueLabel-2IazM):where([data-cursor-is-interactive=true]:hover){background:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + 10)*1%),.3);box-shadow:var(--shadow-resting-medium,var(--color-shadow-medium))}}[data-color-mode=light] .prc-Token-IssueLabel-2IazM{--lightness-threshold:0.453;--border-threshold:0.96;--border-alpha:max(0,min(calc((var(--perceived-lightness) - var(--border-threshold))*100),1));background:rgb(var(--label-r),var(--label-g),var(--label-b));border-color:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) - 25)*1%),var(--border-alpha));color:hsl(0deg,0%,calc(var(--lightness-switch)*100%))}:is([data-color-mode=light] .prc-Token-IssueLabel-2IazM):where([data-selected=true]){background:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) - 5)*1%))}:is([data-color-mode=light] .prc-Token-IssueLabel-2IazM):where([data-selected=true]):after{box-shadow:0 0 0 2px rgb(var(--label-r),var(--label-g),var(--label-b))}:is([data-color-mode=light] .prc-Token-IssueLabel-2IazM):where([data-cursor-is-interactive=true]:hover){background-image:linear-gradient(#00000026,#00000026),linear-gradient(rgb(var(--label-r),var(--label-g),var(--label-b)),rgb(var(--label-r),var(--label-g),var(--label-b)));box-shadow:var(--shadow-resting-medium,var(--color-shadow-medium))}[data-color-mode=dark] .prc-Token-IssueLabel-2IazM{--lightness-threshold:0.6;--background-alpha:0.18;--border-alpha:0.3;--lighten-by:calc((var(--lightness-threshold) - var(--perceived-lightness))*100*var(--lightness-switch));background:rgb(var(--label-r),var(--label-g),var(--label-b),var(--background-alpha));border-color:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + var(--lighten-by))*1%),var(--border-alpha));color:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + var(--lighten-by))*1%))}:is([data-color-mode=dark] .prc-Token-IssueLabel-2IazM):where([data-selected=true]):after{box-shadow:0 0 0 2px hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + var(--lighten-by))*1%))}:is([data-color-mode=dark] .prc-Token-IssueLabel-2IazM):where([data-cursor-is-interactive=true]:hover){background:hsl(var(--label-h),calc(var(--label-s)*1%),calc((var(--label-l) + 10)*1%),.3);box-shadow:var(--shadow-resting-medium,var(--color-shadow-medium))}.prc-Token-IssueLabel-2IazM:where([data-selected=true]){outline:none}.prc-Token-IssueLabel-2IazM:where([data-selected=true]):after{border-radius:var(--borderRadius-full,624.9375rem);bottom:calc(var(--base-size-2,.125rem)*-1);content:"";display:block;left:calc(var(--base-size-2,.125rem)*-1);pointer-events:none;position:absolute;right:calc(var(--base-size-2,.125rem)*-1);top:calc(var(--base-size-2,.125rem)*-1);z-index:1}.prc-Token-IssueLabel-2IazM:where([data-has-remove-button=true]){padding-right:0}.prc-Token-RemoveButton-LhKs7:where([data-has-multiple-action-targets=true]){position:relative;z-index:1}} +/*# sourceMappingURL=primer-react-2333131617aa.js.map*/ \ No newline at end of file diff --git a/promise-withResolvers.js b/promise-withResolvers.js new file mode 100644 index 0000000..cf4c941 --- /dev/null +++ b/promise-withResolvers.js @@ -0,0 +1,23 @@ +/*#__PURE__*/ +export function withResolvers() { + const out = {}; + out.promise = new Promise((resolve, reject) => { + out.resolve = resolve; + out.reject = reject; + }); + return out; +} +/*#__PURE__*/ +export function isSupported() { + return 'withResolvers' in Promise && typeof Promise.withResolvers === 'function'; +} +/*#__PURE__*/ +export function isPolyfilled() { + return 'withResolvers' in Promise && Promise.withResolvers === withResolvers; +} +export function apply() { + if (!isSupported()) { + Object.assign(Promise, { withResolvers }); + } +} +//# sourceMappingURL=promise-withResolvers.js.map \ No newline at end of file diff --git a/q.zip b/q.zip new file mode 100644 index 0000000..a8fe593 Binary files /dev/null and b/q.zip differ diff --git a/react/reactdomclient.js b/react/reactdomclient.js new file mode 100644 index 0000000..02e6e22 --- /dev/null +++ b/react/reactdomclient.js @@ -0,0 +1,38 @@ +'use strict'; + +function checkDCE() { + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if ( + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function' + ) { + return; + } + if (process.env.NODE_ENV !== 'production') { + // This branch is unreachable because this function is only called + // in production, but the condition is true only in development. + // Therefore if the branch is still here, dead code elimination wasn't + // properly applied. + // Don't change the message. React DevTools relies on it. Also make sure + // this message doesn't occur elsewhere in this function, or it will cause + // a false positive. + throw new Error('^_^'); + } + try { + // Verify that the code above has been dead code eliminated (DCE'd). + __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); + } catch (err) { + // DevTools shouldn't crash React, no matter what. + // We should still report in case we break this code. + console.error(err); + } +} + +if (process.env.NODE_ENV === 'production') { + // DCE check should happen before ReactDOM bundle executes so that + // DevTools can report bad minification during injection. + checkDCE(); + module.exports = require('./cjs/react-dom-client.production.js'); +} else { + module.exports = require('./cjs/react-dom-client.development.js'); +} diff --git a/recent-request-ids.ts b/recent-request-ids.ts new file mode 100644 index 0000000..7e1b93d --- /dev/null +++ b/recent-request-ids.ts @@ -0,0 +1,39 @@ +import {ssrSafeDocument} from '@github-ui/ssr-utils' + +const MAX_ENTRIES = 10 +const buffer: Array = new Array(MAX_ENTRIES).fill(null) +let currentIndex = 0 + +export function addRequestId(id: string) { + buffer[currentIndex] = id + currentIndex = (currentIndex + 1) % MAX_ENTRIES +} + +export function getRecentRequestIds(): string[] { + const result: string[] = [] + for (let i = 0; i < MAX_ENTRIES; i++) { + const idx = (currentIndex - 1 - i + MAX_ENTRIES) % MAX_ENTRIES + const id = buffer[idx] + if (id) result.push(id) + } + return result +} + +export function initRequestIdFromMeta() { + const definedDocument = ssrSafeDocument + if (!definedDocument) { + return + } + const meta = definedDocument.querySelector('meta[name="request-id"]') + const id = meta?.getAttribute('content') + if (id) { + addRequestId(id) + } +} + +export function clearRecentRequestIds() { + for (let i = 0; i < MAX_ENTRIES; i++) { + buffer[i] = null + } + currentIndex = 0 +} diff --git a/reftest.xhtml b/reftest.xhtml new file mode 100644 index 0000000..dd077c7 --- /dev/null +++ b/reftest.xhtml @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/registry.ts b/registry.ts new file mode 100644 index 0000000..231528c --- /dev/null +++ b/registry.ts @@ -0,0 +1,20 @@ +interface CustomMetric { + name: string + hash: string + type: PlatformBrowserCustomMetricType +} + +export const CUSTOM_METRIC_REGISTRY = { + PRS_COMMENT_BOX_INP: { + name: 'pull_requests.comment_box.inp', + hash: '070a85f091c124d118031ed374badf58df0cd9c2902f9aa4f9e09f6fdcbb91d0', + type: 'distribution', + }, + PULL_REQUESTS_FILES_JS_HEAP: { + name: 'pull_requests.files.js_heap', + hash: '7c5d986de8ccbfd17ae58e0da85158912cf65aeb256aecf28c35ddeb794cd2d3', + type: 'distribution', + }, +} as const satisfies Record + +export type CustomMetricKey = keyof typeof CUSTOM_METRIC_REGISTRY diff --git a/remove-child-patch.ts b/remove-child-patch.ts new file mode 100644 index 0000000..740c02c --- /dev/null +++ b/remove-child-patch.ts @@ -0,0 +1,18 @@ +import {isReactInStackTrace} from '@github-ui/is-react-in-stack-trace' + +export const applyRemoveChildPatch = () => { + if (typeof Node === 'function' && Node.prototype) { + const originalRemoveChild = Node.prototype.removeChild + // @ts-expect-error we always return a Node which is narrower than the function expects + Node.prototype.removeChild = function (child) { + try { + return originalRemoveChild.apply(this, [child]) + } catch (e) { + if (e instanceof Error && isReactInStackTrace(e.stack)) { + return child + } + throw e + } + } + } +} diff --git a/requestidlecallback.js b/requestidlecallback.js new file mode 100644 index 0000000..d85c00b --- /dev/null +++ b/requestidlecallback.js @@ -0,0 +1,41 @@ +// https://w3c.github.io/requestidlecallback/#why50 +// "Capping idle deadlines to 50ms means that even if the user input occurs +// immediately after the idle task has begun, the user agent still has a +// remaining 50ms in which to respond to the user input without producing user +// perceptible lag" +const maxDeadline = 50; +export function requestIdleCallback(callback, options = {}) { + const start = Date.now(); + const timeout = options.timeout || 0; + const deadline = Object.defineProperty({ + didTimeout: false, + timeRemaining() { + return Math.max(0, maxDeadline - (Date.now() - start)); + }, + }, 'didTimeout', { + get() { + return Date.now() - start > timeout; + }, + }); + return window.setTimeout(() => { + callback(deadline); + }); +} +export function cancelIdleCallback(id) { + clearTimeout(id); +} +/*#__PURE__*/ +export function isSupported() { + return typeof globalThis.requestIdleCallback === 'function'; +} +/*#__PURE__*/ +export function isPolyfilled() { + return globalThis.requestIdleCallback === requestIdleCallback && globalThis.cancelIdleCallback === cancelIdleCallback; +} +export function apply() { + if (!isSupported()) { + globalThis.requestIdleCallback = requestIdleCallback; + globalThis.cancelIdleCallback = cancelIdleCallback; + } +} +//# sourceMappingURL=requestidlecallback.js.map \ No newline at end of file diff --git a/respecv3561.txt b/respecv3561.txt new file mode 100644 index 0000000..cae8ca2 --- /dev/null +++ b/respecv3561.txt @@ -0,0 +1,1253 @@ +window.respecVersion="35.6.1",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=!!window.require;if(!t){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function n(e,n){t||(window.require.modules[e]=n)}const r=document.documentElement;r?.hasAttribute("lang")||(r.lang="en",r.hasAttribute("dir")||(r.dir="ltr"));const s={},o=r?.lang??"en";var i=Object.freeze({__proto__:null,l10n:s,lang:o,name:"core/l10n",run:function(e){e.l10n=s[o]||s.en}});const a=(e,t)=>t.some((t=>e instanceof t));let c,l;const u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return b(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){f=e(f)}function m(e){return(l||(l=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(y(this),t),b(this.request)}:function(...t){return b(e.apply(y(this),t))}}function g(e){return"function"==typeof e?m(e):(e instanceof IDBTransaction&&function(e){if(u.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",o),e.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",o),e.addEventListener("abort",o)}));u.set(e,t)}(e),a(e,c||(c=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,f):e)}function b(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",o)},s=()=>{t(b(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",o)}));return p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=g(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const y=e=>p.get(e);const w=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],k=new Map;function $(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(k.get(t))return k.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=v.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!w.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,s?"readwrite":"readonly");let i=o.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),s&&o.done]))[0]};return k.set(t,o),o}h((e=>({...e,get:(t,n,r)=>$(t,n)||e.get(t,n,r),has:(t,n)=>!!$(t,n)||e.has(t,n)})));const x=["continue","continuePrimaryKey","advance"],_={},C=new WeakMap,S=new WeakMap,R={get(e,t){if(!x.includes(t))return e[t];let n=_[t];return n||(n=_[t]=function(...e){C.set(this,S.get(this)[t](...e))}),n}};async function*E(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,R);for(S.set(n,t),p.set(n,y(t));t;)yield n,t=await(C.get(n)||t.continue()),C.delete(n)}function A(e,t){return t===Symbol.asyncIterator&&a(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&a(e,[IDBIndex,IDBObjectStore])}h((e=>({...e,get:(t,n,r)=>A(t,n)?E:e.get(t,n,r),has:(t,n)=>A(t,n)||e.has(t,n)})));var L=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),b(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=b(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(b(i.result),e.oldVersion,e.newVersion,b(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{o&&e.addEventListener("close",(()=>o())),s&&e.addEventListener("versionchange",(e=>s(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:y,wrap:b});function T(e,t,n,r,s,{level:o="error",autofix:i,ruleName:a}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const s=n.map((e=>e.trivia+e.value)).join(""),o=e[t];return"eof"===o.type?s:r?s+o.trivia:s.slice(o.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),f=l(p),h=d+f.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===s?"since":"inside",g=`${s} error at line ${u}${e.name?` in ${e.name}`:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map((e=>function(e,t){let n=e;return t&&(n+=` ${t}`),n}(e.type,e.name))).join(" -> ")}(n)}\``:""}:\n${h}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:o,ruleName:a,autofix:i,input:f,tokens:p}}function P(e,t,n,r){return T(e,t,n,r,"Syntax")}function I(e,t,n,r,s={}){return s.ruleName=n,T(t.source,e.index,t,r,"Validation",s)}class D{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function N(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const s=N(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,s),s)return{reference:e,dictionary:s.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=N(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function j(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some((e=>e.required));if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?j(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class O extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class z extends D{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new z({source:e.source,tokens:{value:n}})}}get value(){return ne(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class M extends z{static parse(e){const t=e.consumeKind("eof");if(t)return new M({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function q(e,t){return re(e,{parser:z.parser(e,t),listName:t+" list"})}const W=["identifier","decimal","integer","string"],U=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((e=>[e,`Legacy${e}`])),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function F(e){for(const t of W){const n=q(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class B extends D{static parse(e){const t={assign:e.consume("=")},n=he(new B({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...W)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?F(e):ae(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):t.assign&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map((n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e))),e.token(this.tokens.close)])}}class H extends D{static parse(e){const t=e.consumeKind("identifier");if(t)return new H({source:e.source,tokens:{name:t},params:B.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:this.params.tokens.secondaryName?ne(t.secondaryName.value):null}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.";yield I(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(U.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${U.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield I(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=U.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class V extends O{static parse(e){const t={};t.open=e.consume("[");const n=new V({source:e.source,tokens:t});return t.open?(n.push(...re(e,{parser:H.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Expected a closing token for the extended attribute list"),n.length||(e.unconsume(t.close.index),e.error("An extended attribute list must not be empty")),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n):n}*validate(e){for(const t of this)yield*t.validate(e)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map((t=>t.write(e))),e.token(this.tokens.close)]):""}}function G(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function Y(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!n)return;const r=he(new K({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error(`No opening bracket after ${n.value}`),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=le(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{const s=ce(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(s);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...be)||e.error(`Record key must be one of: ${be.join(", ")}`),s=new K({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const o=ce(e,t)||e.error("Error parsing generic type record");r.subtype.push(s,o);break}}return r.idlType||e.error(`Error parsing generic type ${n.value}`),r.tokens.close=e.consume(">")||e.error(`Missing closing bracket after ${n.value}`),r.this}(e,t)||ie(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...be,...ge);if(!t)return;n=new K({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error(`Unsupported generic type ${t.value}`)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,G(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class K extends D{static parse(e,t){return Y(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=he(new K({source:e.source,tokens:n}));for(r.type=t||null;;){const n=ce(e,t)||e.error("No type after open parenthesis or 'or' in union type");"any"===n.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===n.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(n);const s=e.consume("or");if(!s)break;n.tokens.separator=s}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),G(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new V({source:e,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return ne([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((e=>e)).map((e=>e.value)).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"BufferSource"===this.idlType)for(const e of[this.extAttrs,this.parent?.extAttrs])for(const t of e){if("AllowShared"!==t.name)continue;const n="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield I(this.tokens.base,this,"migrate-allowshared",n,{autofix:Z(this,t,e)})}if("void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.";yield I(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=N(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield I(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map((t=>t.write(e))),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}}function Z(e,t,n){return()=>{const r=n.indexOf(t);n.splice(r,1),!n.length&&e.tokens.base.trivia.match(/^\s$/)&&(e.tokens.base.trivia=""),e.tokens.base.value="AllowSharedBufferSource"}}class J extends D{static parse(e){const t=e.consume("=");if(!t)return null;const n=se(e)||e.consumeKind("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new J({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return oe(this.expression[0]).type}get value(){return oe(this.expression[0]).value}get negative(){return oe(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map((t=>e.token(t)))])}}class Q extends D{static parse(e){const t=e.position,n={},r=he(new Q({source:e.source,tokens:n}));return r.extAttrs=V.parse(e),n.optional=e.consume("optional"),r.idlType=ce(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...ye),n.name?(r.default=n.optional?J.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return ne(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=N(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield I(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield I(this.tokens.name,this,"dict-arg-default",e,{autofix:X(this)})}}else if(this.parent&&!j(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e),r=t.slice(n+1).some((e=>!e.optional));return!r}(this)){const e="Dictionary argument must be optional if it has no required fields";yield I(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=fe(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",X(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function X(e){return()=>{e.default=J.parse(new $e(" = {}"))}}class ee extends D{static parse(e,{special:t,regular:n}={}){const r={special:t},s=he(new ee({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(s.arguments=[],s):(t||n||(r.special=e.consume("getter","setter","deleter")),s.idlType=le(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=ae(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),s.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?ne(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield I(this.tokens.open,this,"incomplete-op",e)}if(this.idlType){if("async_sequence"===this.idlType.generic){const e="async_sequence types cannot be returned by an operation.";yield I(this.idlType.tokens.base,this,"async-sequence-idl-to-js",e)}yield*this.idlType.validate(e)}for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class te extends D{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,o={special:t},i=he(new te({source:e.source,tokens:o}));if(t||n||(o.special=e.consume("inherit")),"inherit"===i.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),o.readonly=e.consume("readonly"),r&&!o.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),o.base=e.consume("attribute"),o.base)return i.idlType=ce(e,"attribute-type")||e.error("Attribute lacks a type"),o.name=e.consumeKind("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),o.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),i.this;e.unconsume(s)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return ne(this.tokens.name.value)}*validate(e){if(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),["async_sequence","sequence","record"].includes(this.idlType.generic)){const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield I(this.tokens.name,this,"attr-invalid-type",e)}{const{reference:t}=N(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield I(e,this,"attr-invalid-type",n)}}if(this.readonly&&function(e,t){if(e.union)return!1;if(e.extAttrs.some((e=>"EnforceRange"===e.name)))return!0;const n=t.unique.get(e.idlType);return"typedef"===n?.type&&n.idlType.extAttrs.some((e=>"EnforceRange"===e.name))}(this.idlType,e)){const e=this.idlType.tokens.base,t="Readonly attributes cannot accept [EnforceRange] extended attribute.";yield I(e,this,"attr-invalid-type",t)}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function ne(e){return e.startsWith("_")?e.slice(1):e}function re(e,{parser:t,allowDangler:n,listName:r="list"}){const s=t(e);if(!s)return[];s.tokens.separator=e.consume(",");const o=[s];for(;s.tokens.separator;){const s=t(e);if(!s){n||e.error(`Trailing comma in ${r}`);break}if(s.tokens.separator=e.consume(","),o.push(s),!s.tokens.separator)break}return o}function se(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function oe({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function ie(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const s=e.consume("long");return new K({source:t,tokens:{prefix:n,base:r,postfix:s}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new K({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new K({source:t,tokens:{base:r}}):void 0}function ae(e){return re(e,{parser:Q.parse,listName:"arguments list"})}function ce(e,t){const n=V.parse(e),r=K.parse(e,t);return r&&(he(r).extAttrs=n),r}function le(e,t){const n=K.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new K({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ue(e){const t=e.consume("stringifier");if(!t)return;return te.parse(e,{special:t})||ee.parse(e,{special:t})||e.error("Unterminated stringifier")}function de(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function pe(e){return()=>{if(e.extAttrs.length){const t=new $e("Exposed=Window,"),n=H.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=` ${r.tokens.name.trivia}`),e.extAttrs.unshift(n)}else{he(e).extAttrs=V.parse(new $e("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${de(t)}`}}}function fe(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return fe(e.idlType);return Object.values(e.tokens).sort(((e,t)=>e.index-t.index))[0]}function he(e,t){if(t||(t=e),!e)return e;return new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)&&"source"!==t?he(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}})}const me={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},ge=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],be=["ByteString","DOMString","USVString"],ye=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],we=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","async_iterable","async_sequence","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(ye,be,ge),ve=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],ke=["_constructor","toString","_toString"];class $e{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,o=0;for(;nthis.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class xe extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:s,input:o,tokens:i}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=s,this.input=o,this.tokens=i}}class _e extends z{static parse(e){const t=e.consumeKind("string");if(t)return new _e({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class Ce extends D{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=he(new Ce({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=re(e,{parser:_e.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return ne(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Se extends D{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new Se({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return ne(this.tokens.target.value)}get includes(){return ne(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class Re extends D{static parse(e){const t={},n=he(new Re({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=ce(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return ne(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class Ee extends D{static parse(e,t){const n={base:t},r=he(new Ee({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=le(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=ae(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return ne(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e);for(const t of this.arguments)if(yield*t.validate(e),"async_sequence"===t.idlType.generic){const e="async_sequence types cannot be returned as a callback argument.";yield I(t.tokens.name,t,"async-sequence-idl-to-js",e)}yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map((t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Ae extends D{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:s,type:o}=t;for(s.name=e.consumeKind("identifier")||e.error(`Missing name in ${o}`),e.current=t,t=he(t),n&&Object.assign(s,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),s.open=e.consume("{")||e.error(`Bodyless ${o}`),t.members=[];;){if(s.close=e.consume("}"),s.close)return s.termination=e.consume(";")||e.error(`Missing semicolon after ${o}`),t.this;const n=V.parse(e);let i;for(const[t,...n]of r)if(i=he(t(e,...n)),i)break;i||e.error("Unknown member"),i.extAttrs=n,t.members.push(i.this)}}get partial(){return!!this.tokens.partial}get name(){return ne(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?ne(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Le extends D{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=ie(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new K({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=se(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new Le({source:e.source,tokens:t});return he(r).idlType=n,r}get type(){return"const"}get name(){return ne(this.tokens.name.value)}get value(){return oe(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class Te extends D{static parse(e){const t=e.position,n=he(new Te({source:e.source,tokens:{}})),{tokens:r}=n;if(r.readonly=e.consume("readonly"),r.readonly||(r.async=e.consume("async")),r.base=r.readonly?e.consume("maplike","setlike"):r.async?e.consume("iterable"):e.consume("iterable","async_iterable","maplike","setlike"),!r.base)return void e.unconsume(t);const{type:s}=n,o="maplike"===s,i=o||"iterable"===s||"async_iterable"===s,a="async_iterable"===s||n.async&&"iterable"===s;r.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=ce(e)||e.error(`Missing a type argument in ${s} declaration`);return n.idlType=[c],n.arguments=[],i&&(c.tokens.separator=e.consume(","),c.tokens.separator?n.idlType.push(ce(e)):o&&e.error(`Missing second type argument in ${s} declaration`)),r.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(r.argsOpen=e.consume("("),n.arguments.push(...ae(e)),r.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),r.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),n.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){if(this.async&&"iterable"===this.type){const e="`async iterable` is now changed to `async_iterable`.";yield I(this.tokens.async,this,"obsolete-async-iterable-syntax",e,{autofix:(t=this,()=>{const e=t.tokens.async;t.tokens.base={...e,type:"async_iterable",value:"async_iterable"},delete t.tokens.async})})}var t;for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class Pe extends D{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=ae(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new Pe({source:e.source,tokens:n});return he(s).arguments=r,s}get type(){return"constructor"}*validate(e){for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function Ie(e){const t=e.consume("static");if(!t)return;return te.parse(e,{special:t})||ee.parse(e,{special:t})||e.error("No body in static member")}class De extends Ae{static parse(e,t,{extMembers:n=[],partial:r=null}={}){const s={partial:r,base:t};return Ae.parse(e,new De({source:e.source,tokens:s}),{inheritable:!r,allowedMembers:[...n,[Le.parse],[Pe.parse],[Ie],[ue],[Te.parse],[te.parse],[ee.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield I(this.tokens.name,this,"require-exposed",e,{autofix:pe(this)})}const t=this.extAttrs.filter((e=>"Constructor"===e.name));for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield I(e.tokens.name,this,"constructor-member",t,{autofix:Ne(this,e)})}if(this.extAttrs.some((e=>"Global"===e.name))){const e=this.extAttrs.filter((e=>"LegacyFactoryFunction"===e.name));for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield I(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter((e=>"constructor"===e.type));for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield I(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=function(e){const t=i(e);return{statics:new Set(t.filter((e=>"static"===e.special)).map((e=>e.name))),nonstatics:new Set(t.filter((e=>"static"!==e.special)).map((e=>e.name)))}}(t),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=i(e),s=r.filter((e=>"static"===e.special)),a=r.filter((e=>"static"!==e.special));yield*o(s,n.statics,e,t),yield*o(a,n.nonstatics,e,t),s.forEach((e=>n.statics.add(e.name))),a.forEach((e=>n.nonstatics.add(e.name)))}function*o(e,t,n,r){for(const s of e){const{name:e}=s;if(e&&t.has(e)){const t=`The ${"static"===s.special?"static ":""}operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield I(s.tokens.name,n,"no-cross-overload",t)}}}function i(e){return e.members.filter((({type:e})=>"operation"===e))}}(e,this))}}function Ne(e,t){return e=he(e),()=>{const n=de(e.extAttrs.tokens.open.trivia),r=e.members.length?de(fe(e.members[0]).trivia):function(e){const t=de(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=Pe.parse(new $e(`\n${r}constructor();`));s.extAttrs=new V({source:e.source,tokens:{}}),he(s).arguments=t.arguments;const o=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,(e=>"constructor"===e.type));e.members.splice(o+1,0,s);const{close:i}=e.tokens;i.trivia.includes("\n")||(i.trivia+=`\n${n}`);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class je extends Ae{static parse(e,t,{extMembers:n=[],partial:r}={}){const s={partial:r,base:t};if(s.mixin=e.consume("mixin"),s.mixin)return Ae.parse(e,new je({source:e.source,tokens:s}),{allowedMembers:[...n,[Le.parse],[ue],[te.parse,{noInherit:!0}],[ee.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Oe extends D{static parse(e){const t={},n=he(new Oe({source:e.source,tokens:t}));return n.extAttrs=V.parse(e),t.required=e.consume("required"),n.idlType=ce(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=J.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return ne(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class ze extends Ae{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("dictionary"),r.base)return Ae.parse(e,new ze({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[...t,[Oe.parse]]})}get type(){return"dictionary"}}class Me extends Ae{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("namespace"),r.base)return Ae.parse(e,new Me({source:e.source,tokens:r}),{allowedMembers:[...t,[te.parse,{noInherit:!0,readonly:!0}],[Le.parse],[ee.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield I(this.tokens.name,this,"require-exposed",e,{autofix:pe(this)})}yield*super.validate(e)}}class qe extends Ae{static parse(e,t,{extMembers:n=[]}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return Ae.parse(e,new qe({source:e.source,tokens:r}),{allowedMembers:[...n,[Le.parse],[ee.parse,{regular:!0}]]})}get type(){return"callback interface"}}function We(e,t){const n=e.source;function r(t){e.error(t)}function s(...t){return e.consume(...t)}function o(n){const o=s("interface");if(o)return je.parse(e,o,{...n,...t?.extensions?.mixin})||De.parse(e,o,{...n,...t?.extensions?.interface})||r("Interface has no proper body")}function i(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const n=s("callback");if(n)return e.probe("interface")?qe.parse(e,n,{...t?.extensions?.callbackInterface}):Ee.parse(e,n)}()||o()||function(){const n=s("partial");if(n)return ze.parse(e,{partial:n,...t?.extensions?.dictionary})||o({partial:n})||Me.parse(e,{partial:n,...t?.extensions?.namespace})||r("Partial doesn't apply to anything")}()||ze.parse(e,t?.extensions?.dictionary)||Ce.parse(e)||Re.parse(e)||Se.parse(e)||Me.parse(e,t?.extensions?.namespace)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=V.parse(e),n=i();if(!n){t.length&&r("Stray extended attributes");break}he(n).extAttrs=t,s.push(n)}const o=M.parse(e);return t.concrete&&s.push(o),s}();return e.positione.join(""),trivia:Ue,name:Ue,reference:Ue,type:Ue,generic:Ue,nameless:Ue,inheritance:Ue,definition:Ue,extendedAttribute:Ue,extendedAttributeReference:Ue};class Be{constructor(e){this.ts=Object.assign({},Fe,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=Ue,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function He(e,t){const n=new Map,r=e.filter((e=>"includes"===e.type));for(const e of r){const r=t.get(e.includes);if(!r)continue;const s=n.get(e.target);s?s.push(r):n.set(e.target,[r])}return n}function*Ve(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const s of e)if(s.partial){const e=r.get(s.name);e?e.push(s):r.set(s.name,[s])}else s.name&&(t.has(s.name)?n.add(s):t.set(s.name,s));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:He(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield I(n.tokens.name,n,"no-duplicate",r)}}(t)}var Ge=Object.freeze({__proto__:null,WebIDLParseError:xe,parse:function(e,t={}){const n=new $e(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),We(n,t)},validate:function(e){return[...Ve((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=Fe}={}){t=Object.assign({},Fe,t);const n=new Be(t);return t.wrap(e.map((e=>e.write(n))))}});const Ye=/^[!#$%&'*+-.^`|~\w]+$/,Ke=/[\u000A\u000D\u0009\u0020]/u,Ze=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function Je(e,t,n){(t&&""!==t&&!e.has(t)&&Ze.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function Qe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Xe={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function et(e){Xe=e}const tt=/[&<>"']/,nt=new RegExp(tt.source,"g"),rt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,st=new RegExp(rt.source,"g"),ot={"&":"&","<":"<",">":">",'"':""","'":"'"},it=e=>ot[e];function at(e,t){if(t){if(tt.test(e))return e.replace(nt,it)}else if(rt.test(e))return e.replace(st,it);return e}const ct=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function lt(e){return e.replace(ct,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ut=/(^|[^\[])\^/g;function dt(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(ut,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function pt(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const ft={exec:()=>null};function ht(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:mt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=mt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=mt(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i="",a="",c=!1;for(;e;){let n=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(i+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(l))break;if(o.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(s.test(r))break;if(o.test(r))break;if(n.test(r))break;a+="\n"+l}d||l.trim()||(d=!0),i+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}s.loose||(c?s.loose=!0:/\n *\n *$/.test(i)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(a),f&&(p="[ ] "!==f[0],a=a.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:i,task:!!f,checked:p,loose:!1,text:a,tokens:[]}),s.raw+=i}s.items[s.items.length-1].raw=i.trimEnd(),s.items[s.items.length-1].text=a.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=ht(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(const e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of s)o.rows.push(ht(e,o.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:at(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^
    /i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=mt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),gt(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return gt(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let s,o,i=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(o=[...s].length,r[3]||r[4]){i+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=at(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=at(t[1]),n="mailto:"+e):(e=at(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=at(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=at(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:at(t[0]),{type:"text",raw:t[0],text:e}}}}const yt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wt=/(?:[*+-]|\d{1,9}[.)])/,vt=dt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,wt).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),kt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$t=/(?!\s*\])(?:\\.|[^\[\]\\])+/,xt=dt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",$t).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_t=dt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wt).getRegex(),Ct="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",St=/|$))/,Rt=dt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",St).replace("tag",Ct).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Et=dt(kt).replace("hr",yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ct).getRegex(),At={blockquote:dt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Et).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:xt,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:yt,html:Rt,lheading:vt,list:_t,newline:/^(?: *(?:\n|$))+/,paragraph:Et,table:ft,text:/^[^\n]+/},Lt=dt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ct).getRegex(),Tt={...At,table:Lt,paragraph:dt(kt).replace("hr",yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Lt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ct).getRegex()},Pt={...At,html:dt("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",St).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:dt(kt).replace("hr",yt).replace("heading"," *#{1,6} *[^\n]").replace("lheading",vt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},It=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Dt=/^( {2,}|\\)\n(?!\s*$)/,Nt="\\p{P}\\p{S}",jt=dt(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Nt).getRegex(),Ot=dt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Nt).getRegex(),zt=dt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Nt).getRegex(),Mt=dt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Nt).getRegex(),qt=dt(/\\([punct])/,"gu").replace(/punct/g,Nt).getRegex(),Wt=dt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ut=dt(St).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ft=dt("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Ut).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ht=dt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Bt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vt=dt(/^!?\[(label)\]\[(ref)\]/).replace("label",Bt).replace("ref",$t).getRegex(),Gt=dt(/^!?\[(ref)\](?:\[\])?/).replace("ref",$t).getRegex(),Yt={_backpedal:ft,anyPunctuation:qt,autolink:Wt,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Dt,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ft,emStrongLDelim:Ot,emStrongRDelimAst:zt,emStrongRDelimUnd:Mt,escape:It,link:Ht,nolink:Gt,punctuation:jt,reflink:Vt,reflinkSearch:dt("reflink|nolink(?!\\()","g").replace("reflink",Vt).replace("nolink",Gt).getRegex(),tag:Ft,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,o,i,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,o.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class tn{options;constructor(e){this.options=e||Xe}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:at(e,!0))+"
    \n":"
    "+(n?e:at(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e,t){return e}heading(e,t,n){return`${e}\n`}hr(){return"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e,t,n){return`
  • ${e}
  • \n`}checkbox(e){return"'}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,n){const r=pt(e);if(null===r)return n;let s='
    ",s}image(e,t,n){const r=pt(e);if(null===r)return n;let s=`${n}0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,o),i+=this.renderer.listitem(a,s,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=s;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=s;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=s,i=o.tokens?this.parseInline(o.tokens):o.text;for(;r+1{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new tn(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.renderer[r],o=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new bt(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],o=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new sn;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.hooks[r],o=t[r];sn.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>o.call(t,e)));const n=s.call(t,e);return o.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return en.lex(e,t??this.defaults)}parser(e,t){return rn.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const s={...r},o={...this.defaults,...s};!0===this.defaults.async&&!1===s.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const i=this.#t(!!o.silent,!!o.async);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then((t=>e(t,o))).then((e=>o.hooks?o.hooks.processAllTokens(e):e)).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let r=e(n,o);o.hooks&&(r=o.hooks.processAllTokens(r)),o.walkTokens&&this.walkTokens(r,o.walkTokens);let s=t(r,o);return o.hooks&&(s=o.hooks.postprocess(s)),s}catch(e){return i(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+at(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function an(e,t){return on.parse(e,t)}function cn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}an.options=an.setOptions=function(e){return on.setOptions(e),an.defaults=on.defaults,et(an.defaults),an},an.getDefaults=Qe,an.defaults=Xe,an.use=function(...e){return on.use(...e),an.defaults=on.defaults,et(an.defaults),an},an.walkTokens=function(e,t){return on.walkTokens(e,t)},an.parseInline=on.parseInline,an.Parser=rn,an.parser=rn.parse,an.Renderer=tn,an.TextRenderer=nn,an.Lexer=en,an.lexer=en.lex,an.Tokenizer=bt,an.Hooks=sn,an.parse=an,an.options,an.setOptions,an.use,an.walkTokens,an.parseInline,rn.parse,en.lex;var ln,un={exports:{}};var dn,pn=(ln||(ln=1,dn=un,function(e,t){dn.exports=t()}(0,(function(){var e=[],t=[],n={},r={},s={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],(function(n,r){var s,o,a=(s=t[1],o=arguments,s.replace(/\$(\d{1,2})/g,(function(e,t){return o[t]||""})));return i(""===n?e[r-1]:n,a)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var s=r.length;s--;){var o=r[s];if(o[0].test(t))return a(t,o)}return t}function l(e,t,n){return function(r){var s=r.toLowerCase();return t.hasOwnProperty(s)?i(r,s):e.hasOwnProperty(s)?i(r,e[s]):c(s,r,n)}}function u(e,t,n,r){return function(r){var s=r.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&c(s,s,n)===s}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(s,r,e),d.isPlural=u(s,r,e),d.singular=l(r,s,t),d.isSingular=u(r,s,t),d.addPluralRule=function(t,n){e.push([o(t),n])},d.addSingularRule=function(e,n){t.push([o(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),s[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}))),un.exports),fn=cn(pn),hn=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,s=o.prototype;return s.delete=function(e){return this.has(e)&&delete e[this._]},s.get=function(e){return this.has(e)?e[this._]:void 0},s.has=function(e){return r.call(e,this._)},s.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},o;function o(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=s.prototype;function s(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=s}(Math.random(),Object.defineProperty)}function s(e,t,n,r,s,o){for(var i=("selectedIndex"in t),a=i;r>>0;ni;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,k=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(S),n=z("div");return n.innerHTML=''+e+"",O(t,n.firstChild.childNodes),t}:E)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===S?C.createDocumentFragment():C.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,W,U,F,B,H,V,G,Y=(q="appendChild",W="cloneNode",U="createTextNode",B=(F="importNode")in(M=e),(H=M.createDocumentFragment())[q](M[U]("g")),H[q](M[U]("")),(B?M[F](H,!0):H[W](!0)).childNodes.length<2?function e(t,n){for(var r=t[W](),s=t.childNodes||[],o=s.length,i=0;n&&i

    ',V.content.childNodes[0].getAttribute(G)==Z)||(Z="_dt: "+Z.slice(1,-1)+";",J=!0)}catch(u){}var Q="\x3c!--"+Z+"--\x3e",X=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,se=" \\f\\n\\r\\t",oe="[^"+se+"\\/>\"'=]+",ie="["+se+"]+"+oe,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+oe.replace("\\/","")+"))?)",le=new RegExp(ae+ie+ce+"+)(["+se+"]*/?>)","g"),ue=new RegExp(ae+ie+ce+"*)(["+se+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+Q+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,fe)+r}function fe(e,t,n){return t+(n||'"')+Z+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+">"}var me=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function ge(t,n,r,s){for(var o=t.childNodes,i=o.length,a=0;a{e.remove()}))}function Dn(e,t="long"){const n=new Intl.ListFormat(o,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:s})=>"element"===n&&t?t(s,r++,e):s))}}const Nn=Dn("conjunction"),jn=Dn("disjunction");function On(e,t){return Nn(e,t).join("")}function zn(e,t){return jn(e,t).join("")}function Mn(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/new Date)return o}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&o)return console.warn(`Returning a stale cached response for ${r}`),o;if(s&&i.ok){const e=i.clone(),r=new Headers(i.headers),o=new Date(Date.now()+t);r.set("Expires",o.toISOString());const a=new Response(await e.blob(),{headers:r});await s.put(n,a).catch(console.error)}return i}function Vn(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>kn`${e}, `));return kn`${r}${n[n.length-1]}`}function Gn(e,t){return[].concat(Nn(e,t)).map((e=>"string"==typeof e?kn`${e}`:e))}function Yn(e,t=""){const n=function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(qn(e.textContent));return Kn(e,t,n)}function Kn(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let s=r?n:n.toLowerCase();if(s=s.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),s?!/\.$/.test(s)&&/^[a-z]/i.test(t||s)||(s=`x${s}`):s="generatedID",t&&(s=`${t}-${s}`),e.ownerDocument.getElementById(s)){let t=0,n=`${s}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${s}-${t}`;s=n}return e.id=s,s}function Zn(e){const t=new Set,n="ltNodefault"in e.dataset?"":qn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>qn(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(qn(e))))}return[...t]}function Jn(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function Qn(e,t){const n=t.closest(Tn);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function Xn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function er(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}function tr(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function nr(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class rr extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function sr(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Jn(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),or(t),t}function or(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...ir(t)])e.remove()}function*ir(e){for(;e.nextNode();)yield e.currentNode}class ar extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class cr extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||Kn(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:s,elements:o,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:s,elements:o,title:i,details:a,stack:n,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function lr(e,t,n={}){const r={...n,isWarning:!1};wr("error",new cr(e,t,r))}function ur(e,t,n={}){const r={...n,isWarning:!0};wr("warn",new cr(e,t,r))}function dr(e){return{showError:(t,n)=>lr(t,e,n),showWarning:(t,n)=>ur(t,e,n)}}function pr(e){return e?`\`${e}\``:""}function fr(e,{quotes:t}={quotes:!1}){return zn(e,t?e=>pr(mr(e)):pr)}function hr(e,{quotes:t}={quotes:!1}){return On(e,t?e=>pr(mr(e)):pr)}function mr(e){return String(e)?`"${e}"`:""}function gr(e,...t){return br(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[s,o]=r.slice(1,-1).split("|");if(o){return`${e}[${s}](${new URL(o,"https://respec.org/docs/")})`}return`${e}[\`${s}\`](https://respec.org/docs/#${s})`})).join(""))}function br(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}const yr=new EventTarget;function wr(e,t){if(yr.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function vr(e,t,n={once:!1}){yr.addEventListener(e,(async n=>{try{await t(n.detail)}catch(t){lr(`Error in handler for topic "${e}": ${t.message}`,`sub:${e}`,{cause:t})}}),n)}n("core/pubsubhub",{sub:vr});const kr=["githubToken","githubUser"];const $r=new Map([["text/html","html"],["application/xml","xml"]]);function xr(e,t=document){const n=$r.get(e);if(!n){const t=[...$r.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=_r(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function _r(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;or(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),In(r);const s=e.createDocumentFragment(),o=e.querySelector("meta[name='viewport']");o&&t.firstChild!==o&&s.appendChild(o);let i=e.querySelector("meta[charset], meta[content*='charset=']");i||(i=kn``);s.appendChild(i);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=kn` + + `;s.appendChild(c),t.prepend(s),wr("beforesave",r)}(n);let r="";if("xml"===e)r=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}n("core/exporter",{rsDocToDataURL:xr});class Cr{constructor(){this._respecDonePromise=new Promise((e=>{vr("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],vr("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),vr("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return _r("html",document)}}const Sr="core/post-process";const Rr="core/pre-process";const Er="core/base-runner";async function Ar(e){!function(){const e=new Cr;Object.defineProperty(document,"respec",{value:e})}(),wr("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),vr("amend-user-config",n),vr("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of kr)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let s;try{s=JSON.parse(r)}catch{s=r}return[n,s]})),r=Object.fromEntries(n);Object.assign(e,r),wr("amend-user-config",r)}(respecConfig),performance.mark(`${Er}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||lr("Every item in `preProcess` must be a JS function.",Rr),t}));for(const[n,r]of t.entries()){const t=`${Rr}/${r.name||`[${n}]`}`,s=dr(t);try{await r(e,document,s)}catch(e){lr(`Function ${t} threw an error during \`preProcess\`.`,Rr,{hint:"See developer console.",cause:e})}}}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,s)=>{const o=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),s(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){s(e)}finally{clearTimeout(o),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),wr("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||lr("Every item in `postProcess` must be a JS function.",Sr),t}));for(const[n,r]of t.entries()){const t=`${Sr}/${r.name||`[${n}]`}`,s=dr(t);try{await r(e,document,s)}catch(e){lr(`Function ${t} threw an error during \`postProcess\`.`,Sr,{hint:"See developer console.",cause:e})}}}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),wr("end-all"),In(document),performance.mark(`${Er}-end`),performance.measure(Er,`${Er}-start`,`${Er}-end`)}var Lr=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} +#respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} +#respec-pill,.respec-info-button{height:2.4em;background:#fff;background:var(--bg,#fff);color:#787878;color:var(--tocnav-normal-text,#787878);border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);box-shadow:1px 1px 8px 0 var(--tocsidebar-shadow,rgba(100,100,100,.5));padding:.2em 0} +.respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity} +.respec-info-button:focus,.respec-info-button:hover{opacity:1;transition:opacity .2s} +#respec-pill{width:4.8em} +#respec-pill:not(:disabled){animation:respec-fadein .6s ease-in-out} +@keyframes respec-fadein{ +from{margin-top:-1.2em;border-radius:50%;border:.2em solid rgba(100,100,100,.5);box-shadow:none;height:4.8em} +to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);height:2.4em} +} +#respec-pill:disabled{margin-top:-1.2em;position:relative;border:none;box-shadow:none;border-radius:50%;width:4.8em;height:4.8em;padding:0} +#respec-pill:disabled::after{position:absolute;content:'';inset:-.2em;border-radius:50%;border:.2em solid rgba(100,100,100,.5);border-left:.2em solid transparent;animation:respec-spin .5s infinite linear} +@media (prefers-reduced-motion){ +#respec-pill:not(:disabled){animation:none} +#respec-pill:disabled::after{animation:none;border-left:.2em solid rgba(100,100,100,.5)} +} +@keyframes respec-spin{ +0%{transform:rotate(0)} +100%{transform:rotate(360deg)} +} +.respec-hidden{visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s linear} +.respec-visible{visibility:visible;opacity:1;transition:opacity .2s linear} +#respec-pill:focus,#respec-pill:hover{color:#000;background-color:#f5f5f5;transition:color .2s} +#respec-menu{position:absolute;margin:0;padding:0;font-family:sans-serif;background:var(--bg,#fff);color:var(--text,#000);box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);width:200px;display:none;text-align:left;margin-top:32px;font-size:.8em} +#respec-menu:not([hidden]){display:block} +#respec-menu li{list-style-type:none;margin:0;padding:0} +.respec-save-buttons{display:grid;grid-template-columns:repeat(auto-fill,minmax(47%,2fr));grid-gap:.5cm;padding:.5cm} +.respec-save-button:link{padding-top:16px;color:var(--def-text,#fff);background:var(--def-bg,#2a5aa8);justify-self:stretch;height:1cm;text-decoration:none;text-align:center;font-size:inherit;border:none;border-radius:.2cm} +.respec-save-button:link:hover{color:var(--def-text,#fff);background:var(--defrow-border,#2a5aa8);padding:0;margin:0;border:0;padding-top:16px} +.respec-save-button:link:focus{background:var(--tocnav-active-bg,#193766);color:var(--tocnav-active-text,#000)} +#respec-pill:focus,#respec-ui button:focus,.respec-option:focus{outline:0;outline-style:none} +#respec-pill-error{background-color:red;color:#fff} +#respec-pill-warning{background-color:orange;color:#fff} +.respec-error-list,.respec-warning-list{margin:0;padding:0;font-family:sans-serif;font-size:.85em} +.respec-warning-list{background-color:#fffbe6} +:is(.respec-warning-list,.respec-error-list)>li{list-style-type:none;margin:0;padding:.5em 0;padding-left:2em;padding-right:.5em} +:is(.respec-warning-list,.respec-error-list)>li+li{margin-top:.5rem} +:is(.respec-warning-list,.respec-error-list)>li:before{position:absolute;left:.4em} +:is(.respec-warning-list,.respec-error-list) p{padding:0;margin:0} +.respec-warning-list>li{color:#5c3b00;border-bottom:thin solid #fff5c2} +.respec-error-list,.respec-error-list li{background-color:#fff0f0} +.respec-warning-list>li::before{content:"⚠️"} +.respec-error-list>li::before{content:"💥"} +.respec-error-list>li{color:#5c3b00;border-bottom:thin solid #ffd7d7} +:is(.respec-warning-list,.respec-error-list)>li li{list-style:disc} +#respec-overlay{display:block;position:fixed;z-index:10000;top:0;left:0;height:100%;width:100%;background:#000} +.respec-show-overlay{transition:opacity .2s linear;opacity:.5} +.respec-hide-overlay{transition:opacity .2s linear;opacity:0} +.respec-modal{display:block;position:fixed;z-index:11000;top:10%;background:var(--bg,#fff);color:var(--text,#000);border:5px solid #666;border-color:var(--tocsidebar-shadow,#666);min-width:20%;padding:0;max-height:80%;overflow-y:auto;margin:0 -.5cm;left:20%;max-width:75%;min-width:60%} +.respec-modal h3{margin:0;padding:.2em;left:0!important;text-align:center;background:var(--tocsidebar-shadow,#ddd);color:var(--text,#000);font-size:1em} +#respec-menu button.respec-option{background:var(--bg,#fff);color:var(--text,#000);border:none;width:100%;text-align:left;font-size:inherit;padding:1.2em 1.2em} +#respec-menu button.respec-option:hover{background-color:var(--tocnav-hover-bg,#eee);color:var(--tocnav-hover-text,#000)} +.respec-cmd-icon{padding-right:.5em} +#respec-ui button.respec-option:first-child{margin-top:0} +#respec-ui button.respec-option:last-child{border:none;border-radius:inherit;margin-bottom:0} +.respec-button-copy-paste{position:absolute;height:28px;width:40px;cursor:pointer;background-image:linear-gradient(#fcfcfc,#eee);border:1px solid #90b8de;border-left:0;border-radius:0 0 3px 0;-webkit-user-select:none;user-select:none;-webkit-appearance:none;top:0;left:127px} +@media print{ +#respec-ui{display:none} +} +.respec-iframe{width:100%;min-height:550px;height:100%;overflow:hidden;padding:0;margin:0;border:0} +.respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center} +.respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px} +p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} +.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Tr=/>/gm,Pr=/&/gm;class Ir extends xn.Renderer{code(e,t,n){const{language:r,...s}=Ir.parseInfoString(t);if(/(^webidl$)/i.test(r))return`
    ${e}
    `;const o=super.code(e,r,n).replace('class="language-','class="'),{example:i,illegalExample:a}=s;if(!i&&!a)return o;const c=i||a,l=`${r} ${i?"example":"illegal-example"}`;return o.replace("
    ",`
    `)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw`
    +      
    + ${n} +
    ${t}
    +
    + `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let s;if(r)try{s=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...s}}heading(e,t,n){const r=/(.+)\s+{#([\w-]+)}$/;if(r.test(e)){const[,n,s]=e.match(r);return`${n}`}return super.heading(e,t,n)}}const Dr={gfm:!0,renderer:new Ir};function Nr(e,t={inline:!1}){const n=br(e).replace(Tr,">").replace(Pr,"&");return t.inline?xn.parseInline(n,Dr):xn.parse(n,Dr)}function jr(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Nr(e.innerHTML)}const Or=(zr="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(zr);return t.forEach(jr),Array.from(t)});var zr;var Mr=Object.freeze({__proto__:null,markdownToHtml:Nr,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void Or(document.body);const r=document.getElementById("respec-ui");r.remove();const s=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),s=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),s.trim()){const t=nr(e);e.append(`\n\n${t}`)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),jr(s),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(s.querySelectorAll(".nolinks a[href]")),s.append(r),document.body.replaceWith(s)}});function qr(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=Lr,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const Wr=kn``,Ur=kn``,Fr=kn``;let Br,Hr;window.addEventListener("load",(()=>Jr(Ur)));const Vr=[],Gr=[],Yr={};vr("start-all",(()=>document.body.prepend(Wr)),{once:!0}),vr("end-all",(()=>document.body.prepend(Wr)),{once:!0});const Kr=kn``;function Zr(){Ur.classList.toggle("respec-hidden"),Ur.classList.toggle("respec-visible"),Ur.hidden=!Ur.hidden}function Jr(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}Wr.appendChild(Kr),Kr.addEventListener("click",(e=>{e.stopPropagation(),Kr.setAttribute("aria-expanded",String(Ur.hidden)),Zr(),Ur.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{Ur.hidden||Zr()})),Wr.appendChild(Ur),Ur.addEventListener("keydown",(e=>{"Escape"!==e.key||Ur.hidden||(Kr.setAttribute("aria-expanded",String(Ur.hidden)),Zr(),Kr.focus())}));const Qr=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Xr(e,t,n,r){t.push(e),Yr.hasOwnProperty(n)||(Yr[n]=function(e,t,n){const r=`respec-pill-${e}`,s=kn``;s.addEventListener("click",(()=>{s.setAttribute("aria-expanded","true");const r=kn`
      `;for(const e of t){const t=document.createRange().createContextualFragment(ts(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}es.freshModal(n,r,s)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return qr(s,o),s}(n,t,r),Wr.appendChild(Yr[n]));const s=Yr[n];s.textContent=t.length;const o=1===t.length?Cn.singular(r):r;qr(s,new Map([["label",`${t.length} ${o}`]]))}qr(Kr,Qr);const es={show(){try{Wr.hidden=!1}catch(e){console.error(e)}},hide(){Wr.hidden=!0},enable(){Kr.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,o=kn``,i=kn`
    1. ${o}
    2. `;return i.addEventListener("click",t),Ur.appendChild(i),o},error(e){Xr(e,Vr,"error","ReSpec Errors")},warning(e){Xr(e,Gr,"warning","ReSpec Warnings")},closeModal(e){Hr&&(Hr.classList.remove("respec-show-overlay"),Hr.classList.add("respec-hide-overlay"),Hr.addEventListener("transitionend",(()=>{Hr.remove(),Hr=null}))),e&&e.setAttribute("aria-expanded","false"),Br&&(Br.remove(),Br=null,Kr.focus())},freshModal(e,t,n){Br&&Br.remove(),Hr&&Hr.remove(),Hr=kn`
      `;const r=`${n.id}-modal`,s=`${r}-heading`;Br=kn``;const o=new Map([["labelledby",s]]);qr(Br,o),document.body.append(Hr,Br),Hr.addEventListener("click",(()=>this.closeModal(n))),Hr.classList.toggle("respec-show-overlay"),Br.hidden=!1,Jr(Br)}};function ts(e){if("string"==typeof e)return e;const t=e.plugin?`

      (plugin: "${e.plugin}")

      `:"",n=e.hint?`\n${Nr(`

      How to fix: ${br(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`

      Occurred ${e.elements.length} times at:

      \n ${Nr(e.elements.map(ns).join("\n"))}`:"",s=e.details?`\n\n
      \n${e.details}\n
      \n`:"";return`${Nr(`**${Mn(e.message)}**`,{inline:!0})}${n}${r}${s}${t}`}function ns(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function rs(e){try{es.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Ar(e)}finally{es.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&es.closeModal()})),window.respecUI=es,vr("error",(e=>es.error(e))),vr("warn",(e=>es.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const ss=[Promise.resolve().then((function(){return os})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return ls})),Promise.resolve().then((function(){return no})),Promise.resolve().then((function(){return oo})),Promise.resolve().then((function(){return uo})),Promise.resolve().then((function(){return bo})),Promise.resolve().then((function(){return Co})),Promise.resolve().then((function(){return Mr})),Promise.resolve().then((function(){return So})),Promise.resolve().then((function(){return Ao})),Promise.resolve().then((function(){return Po})),Promise.resolve().then((function(){return Zs})),Promise.resolve().then((function(){return No})),Promise.resolve().then((function(){return jo})),Promise.resolve().then((function(){return Mo})),Promise.resolve().then((function(){return Yi})),Promise.resolve().then((function(){return Ji})),Promise.resolve().then((function(){return aa})),Promise.resolve().then((function(){return ca})),Promise.resolve().then((function(){return pa})),Promise.resolve().then((function(){return ba})),Promise.resolve().then((function(){return $a})),Promise.resolve().then((function(){return Ca})),Promise.resolve().then((function(){return Ra})),Promise.resolve().then((function(){return Ka})),Promise.resolve().then((function(){return mi})),Promise.resolve().then((function(){return mc})),Promise.resolve().then((function(){return Lc})),Promise.resolve().then((function(){return oc})),Promise.resolve().then((function(){return Si})),Promise.resolve().then((function(){return Fc})),Promise.resolve().then((function(){return Hc})),Promise.resolve().then((function(){return ko})),Promise.resolve().then((function(){return Vc})),Promise.resolve().then((function(){return Gc})),Promise.resolve().then((function(){return tl})),Promise.resolve().then((function(){return rl})),Promise.resolve().then((function(){return ol})),Promise.resolve().then((function(){return dl})),Promise.resolve().then((function(){return vl})),Promise.resolve().then((function(){return _l})),Promise.resolve().then((function(){return El})),Promise.resolve().then((function(){return Pl})),Promise.resolve().then((function(){return zl})),Promise.resolve().then((function(){return Ml})),Promise.resolve().then((function(){return Hl})),Promise.resolve().then((function(){return Ql})),Promise.resolve().then((function(){return ja})),Promise.resolve().then((function(){return ou})),Promise.resolve().then((function(){return uu})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return hu})),Promise.resolve().then((function(){return gu})),Promise.resolve().then((function(){return _u})),Promise.resolve().then((function(){return Ru})),Promise.resolve().then((function(){return Pu})),Promise.resolve().then((function(){return Iu})),Promise.resolve().then((function(){return Du})),Promise.resolve().then((function(){return ju})),Promise.resolve().then((function(){return Mu})),Promise.resolve().then((function(){return Bu})),Promise.resolve().then((function(){return Gu})),Promise.resolve().then((function(){return Ju})),Promise.resolve().then((function(){return ed})),Promise.resolve().then((function(){return od})),Promise.resolve().then((function(){return cd})),Promise.resolve().then((function(){return dd})),Promise.resolve().then((function(){return bd})),Promise.resolve().then((function(){return vd})),Promise.resolve().then((function(){return xd})),Promise.resolve().then((function(){return Rd})),Promise.resolve().then((function(){return Td}))];Promise.all(ss).then((e=>rs(e))).catch((e=>console.error(e)));var os=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}window.location.hash=`#${e}`}))}});const is="w3c/group",as="https://respec.org/w3c/groups/";async function cs(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,as),s=await Hn(r.href);if(s.ok){const e=await s.json(),{id:t,name:n,patentURI:r,patentPolicy:o,type:i,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:o,groupType:i}}const o=await s.text();let i,a=`Failed to fetch group details (HTTP: ${s.status}).`;409===s.status?[a,i]=o.split("\n",2):404===s.status&&(i=gr`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`),lr(a,is,{hint:i})}var ls=Object.freeze({__proto__:null,name:is,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(cs)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter(Boolean))for(const t of Object.keys(n))n[t].push(e[t]);return n}(t):await cs(t);Object.assign(e,n)}});function us(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return ur(t,"core/templates/show-link"),void console.warn(t,e)}return kn` +
      ${e.key}
      + ${e.data?e.data.map(ds):ds(e)} + `}function ds(e){return kn`
      + ${e.href?kn`${e.value||e.href}`:e.value} +
      `}const ps="core/templates/show-logo";function fs(e,t){const n=kn``;if(!e.alt){const r=gr`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;lr(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,ps,{hint:r,elements:[n]})}if(!e.src){const e=gr`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;lr(`Logo at index ${t} is missing "\`src\`" property.`,ps,{hint:e,elements:[n]})}return n}const hs="core/templates/show-people",ms=Wn({en:{until:e=>kn` Until ${e} `},es:{until:e=>kn` Hasta ${e} `},ko:{until:e=>kn` ${e} 이전 `},ja:{until:e=>kn` ${e} 以前 `},de:{until:e=>kn` bis ${e} `},zh:{until:e=>kn` 直到 ${e} `}}),gs=()=>kn` + + + + `;function bs(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(s=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,o=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${s}\`](${n}#${s})" configuration option.`;if(!e.name)return lr(`${o} Missing required property \`"name"\`.`,hs,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${o} ORCID "${e.orcid}" at index ${t} is invalid.`,s=`The origin should be "https://orcid.org", not "${r.origin}".`;return lr(n,hs,{hint:s}),!1}const s=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(s))return lr(`${o} ORCID "${s}" has wrong format.`,hs,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0),r=(12-n%11)%11,s=10===r?"X":String(r);return t===s}(n))return lr(`${o} ORCID "${n}" failed checksum check.`,hs,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(i=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(i)?new Date(i):"Invalid Date").toString())?(lr(`${o} The property "\`retiredDate\`" is not a valid date.`,hs,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return lr(`${n}. Member "extra" at index ${r} is not an object.`,hs,{hint:t}),!1;case!e.hasOwnProperty("name"):return lr(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,hs,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return lr(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,hs,{hint:t}),!1}return!0})):(lr(`${n}. A person's "extras" member must be an array.`,hs,{hint:t}),!1)}(e.extras,r,o))&&(e.url&&e.mailto&&ur(`${o} Has both "url" and "mailto" property.`,hs,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&ur(`${o} Has a "\`companyURL\`" property but no "\`company\`" property.`,hs,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var i});var s;return n.filter(r).map(ys)}function ys(e){const t=[e.name],n=[e.company],r=e.w3cid||null,s=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";s.push(kn`${t}`)}else s.push(kn`${t}`);if(e.orcid&&s.push(kn`${gs()}`),e.company){const t="p-org org h-org",r=e.companyURL?kn`${n}`:kn`${n}`;s.push(kn` (${r})`)}e.note&&s.push(document.createTextNode(` (${e.note})`)),e.extras&&s.push(...e.extras.map((e=>kn`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?kn`${n}`:kn`${n}`}(e)}`)));const{retiredDate:o}=e;if(e.retiredDate){const e=kn``;s.push(kn` - ${ms.until(e)} `)}return kn`
      + ${s} +
      `}const ws=Wn({en:{archives:"archives",author:"Author:",authors:"Authors:",commit_history:"Commit history",edited_in_place:"edited in place",editor:"Editor:",editors:"Editors:",feedback:"Feedback:",former_editor:"Former editor:",former_editors:"Former editors:",history:"History:",implementation_report:"Implementation report:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",latest_recommendation:"Latest Recommendation:",message_topic:"… message topic …",more_details_about_this_doc:"More details about this document",multiple_alternates:e=>`This document is also available in ${e?"these non-normative formats":"this non-normative format"}:`,prev_editor_draft:"Previous editor's draft:",prev_recommendation:"Previous Recommendation:",prev_version:"Previous version:",publication_history:"Publication history",test_suite:"Test suite:",this_version:"This version:",with_subject_line:"with subject line",your_topic_here:"YOUR TOPIC HERE"},ko:{author:"저자:",authors:"저자:",editor:"편집자:",editors:"편집자:",former_editor:"이전 편집자:",former_editors:"이전 편집자:",latest_editors_draft:"최신 편집 초안:",latest_published_version:"최신 버전:",this_version:"현재 버전:"},zh:{author:"作者:",authors:"作者:",commit_history:"Git提交历史",editor:"编辑:",editors:"编辑:",feedback:"反馈:",former_editor:"原编辑:",former_editors:"原编辑:",history:"历史:",implementation_report:"实现报告:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",latest_recommendation:"最新发布的正式推荐标准:",message_topic:"… 邮件主题 …",prev_editor_draft:"上一版编辑草稿:",prev_recommendation:"上一版正式推荐标准:",prev_version:"上一版:",test_suite:"测试套件:",this_version:"本版本:"},ja:{archives:"アーカイブ",author:"著者:",authors:"著者:",commit_history:"更新履歴",edited_in_place:"改版なく更新",editor:"編者:",editors:"編者:",feedback:"フィードバック:",former_editor:"以前の版の編者:",former_editors:"以前の版の編者:",history:"履歴:",implementation_report:"実装レポート:",latest_editors_draft:"最新の編集用草案:",latest_published_version:"最新バージョン:",latest_recommendation:"最新の勧告版:",message_topic:"… メール件名 …",more_details_about_this_doc:"この文書についてのより詳細",prev_editor_draft:"前回の編集用草案:",prev_recommendation:"前回の勧告版:",prev_version:"前回のバージョン:",publication_history:"公表履歴",test_suite:"テストスイート:",this_version:"このバージョン:",with_subject_line:"次の件名で"},nl:{author:"Auteur:",authors:"Auteurs:",editor:"Redacteur:",editors:"Redacteurs:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",this_version:"Deze versie:"},es:{archives:"archivos",author:"Autor:",authors:"Autores:",commit_history:"Historial de cambios",edited_in_place:"editado en lugar",editor:"Editor:",editors:"Editores:",feedback:"Comentarios:",former_editor:"Antiguo editor:",former_editors:"Antiguos editores:",history:"Historia:",implementation_report:"Informe de implementación:",latest_editors_draft:"Última versión del editor:",latest_published_version:"Última versión publicada:",latest_recommendation:"Recomendación más reciente:",message_topic:"… detalles de mensaje …",more_details_about_this_doc:"Más detalles sobre este documento:",publication_history:"Historial de publicación",prev_editor_draft:"Última versión del editor:",prev_recommendation:"Última Recomendación:",prev_version:"Última versión:",test_suite:"Suite de pruebas:",this_version:"Esta versión:",with_subject_line:"con línea de asunto",your_topic_here:"TU SUJETO AQUÍ"},de:{archives:"Archiv",author:"Autor/in:",authors:"Autor/innen:",commit_history:"Commit-Historie",edited_in_place:"zuletzt geändert am",editor:"Redaktion:",editors:"Redaktion:",feedback:"Feedback:",former_editor:"Frühere Mitwirkende:",former_editors:"Frühere Mitwirkende:",history:"Verlauf:",implementation_report:"Umsetzungsbericht:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",latest_recommendation:"Aktuellste Empfehlung:",more_details_about_this_doc:"Mehr Informationen über dieses Dokument",multiple_alternates:e=>`Dieses Dokument ist ebenfalls in ${e?"diesen nicht-normativen Formaten verfügbar":"diesem nicht-normativen Format verfügbar"}:`,prev_editor_draft:"Vorheriger Entwurf:",prev_recommendation:"Vorherige Empfehlung:",prev_version:"Vorherige Version:",publication_history:"Veröffentlichungsverlauf",test_suite:"Testumgebung:",this_version:"Diese Fassung:"},cs:{archives:"archivy",author:"Autor:",authors:"Autoři:",commit_history:"Historie změn",edited_in_place:"upraveno přímo",editor:"Editor:",editors:"Editoři:",feedback:"Zpětná vazba:",former_editor:"Bývalý editor:",former_editors:"Bývalí editoři:",history:"Historie:",implementation_report:"Implementační zpráva:",latest_editors_draft:"Nejnovější pracovní verze:",latest_published_version:"Nejnovější publikovaná verze:",latest_recommendation:"Nejnovější doporučení:",message_topic:"… předmět zprávy …",more_details_about_this_doc:"Více informací o tomto dokumentu",multiple_alternates:e=>`Tento dokument je také dostupný v ${e?"těchto ne-normativních formátech":"tomto ne-normativním formátu"}:`,prev_editor_draft:"Předchozí pracovní verze:",prev_recommendation:"Předchozí doporučení:",prev_version:"Předchozí verze:",publication_history:"Historie publikací",test_suite:"Testovací sada:",this_version:"Tato verze:",with_subject_line:"s předmětem",your_topic_here:"VÁŠ PŘEDMĚT ZDE"}});function vs(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}var ks=(e,t)=>(vr("beforesave",(e=>{const t=e.querySelector(".head details");t&&(t.open=!0)})),kn`
      + ${e.logos.length?kn`

      ${e.logos.map(fs)}

      `:""} + ${document.querySelector("h1#title")} ${vs(e)} +

      ${function(e){const t=e.isCR||e.isCRY?e.longStatus:e.textStatus,n=e.prependW3C?kn`W3C ${t}`:kn`${t}`;return kn`${n}${" "} + ${e.modificationDate?kn`, ${ws.edited_in_place}${" "} + `:""}`}(e)}

      +
      + ${ws.more_details_about_this_doc} +
      + ${e.thisVersion?kn`
      ${ws.this_version}
      +
      + ${e.thisVersion} +
      `:""} + ${"latestVersion"in e?kn`
      ${ws.latest_published_version}
      +
      + ${e.latestVersion?kn`${e.latestVersion}`:"none"} +
      `:""} + ${e.edDraftURI?kn` +
      ${ws.latest_editors_draft}
      +
      ${e.edDraftURI}
      + `:""} + ${e.historyURI||e.github?kn`
      ${ws.history}
      + ${e.historyURI?kn`
      + ${e.historyURI} +
      `:""} + ${e.github?kn`
      + ${ws.commit_history} +
      `:""}`:""} + ${e.testSuiteURI?kn` +
      ${ws.test_suite}
      +
      ${e.testSuiteURI}
      + `:""} + ${e.implementationReportURI?kn` +
      ${ws.implementation_report}
      +
      + ${e.implementationReportURI} +
      + `:""} + ${e.prevED?kn` +
      ${ws.prev_editor_draft}
      +
      ${e.prevED}
      + `:""} + ${e.showPreviousVersion?kn` +
      ${ws.prev_version}
      +
      ${e.prevVersion}
      + `:""} + ${e.prevRecURI?e.isRec?kn` +
      ${ws.prev_recommendation}
      +
      ${e.prevRecURI}
      + `:kn` +
      ${ws.latest_recommendation}
      +
      ${e.prevRecURI}
      + `:""} + ${e.editors.length?kn` +
      ${e.editors.length>1?ws.editors:ws.editor}
      + ${bs(e,"editors")} + `:""} + ${e.formerEditors.length?kn` +
      + ${e.formerEditors.length>1?ws.former_editors:ws.former_editor} +
      + ${bs(e,"formerEditors")} + `:""} + ${e.authors.length?kn` +
      ${e.authors.length>1?ws.authors:ws.author}
      + ${bs(e,"authors")} + `:""} + ${e.github||e.wgPublicList?kn`
      ${ws.feedback}
      + ${$s(e)}`:""} + ${e.errata?kn`
      Errata:
      +
      Errata exists.
      `:""} + ${e.otherLinks?e.otherLinks.map(us):""} +
      +
      + ${e.isRec?kn`

      + See also + + translations. +

      `:""} + ${e.alternateFormats?kn`

      + ${ws.multiple_alternates(t.multipleAlternates)} + ${t.alternatesHTML} +

      `:""} + ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.isUnofficial&&e.licenseInfo)return kn``;return function(e){return kn``}(e)}(e)} +
      +
      `);function $s(e){const t=[];if(e.github){const{repoURL:n,issuesURL:r,newIssuesURL:s,pullsURL:o,fullName:i}=e.github;t.push(kn`
      + GitHub ${i} + (pull requests, + new issue, + open issues) +
      `)}if(e.wgPublicList){const n=new URL(`mailto:${e.wgPublicList}@w3.org`),r=e.subjectPrefix??`[${e.shortName}] ${ws.your_topic_here}`,s=kn`${n.pathname}`,o=e.subjectPrefix||kn`[${e.shortName}] ${ws.message_topic}`,i=kn`${ws.with_subject_line}${" "} + ${o}`,a=new URL(e.wgPublicList,"https://lists.w3.org/Archives/Public/"),c=kn`(${ws.archives})`;t.push(kn`
      ${s} ${i} ${c}
      `)}return t}var xs=(e,t)=>{const n=document.querySelector(".copyright");n&&n.remove();const r=document.querySelector("h1#title"),s=r.cloneNode(!0);return kn`
      + ${e.logos.length?kn`

      ${e.logos.map(fs)}

      `:""} + ${r} ${vs(e)} +

      + ${e.longStatus} + +

      +
      + ${e.thisVersion?kn`
      ${ws.this_version}
      +
      + ${e.thisVersion} +
      `:""} + ${"latestVersion"in e?kn`
      ${ws.latest_published_version}
      +
      + ${e.latestVersion?kn`${e.latestVersion}`:"none"} +
      `:""} + ${e.edDraftURI?kn` +
      ${ws.latest_editors_draft}
      +
      ${e.edDraftURI}
      + `:""} + ${e.testSuiteURI?kn` +
      Test suite:
      +
      ${e.testSuiteURI}
      + `:""} + ${e.implementationReportURI?kn` +
      Implementation report:
      +
      + ${e.implementationReportURI} +
      + `:""} + ${e.prevVersion?kn` +
      Previous version:
      +
      ${e.prevVersion}
      + `:""} + ${e.isCGFinal?"":kn` + ${e.prevED?kn` +
      Previous editor's draft:
      +
      ${e.prevED}
      + `:""} + `} + ${e.editors.length?kn` +
      ${e.editors.length>1?ws.editors:ws.editor}
      + ${bs(e,"editors")} + `:""} + ${e.formerEditors.length?kn` +
      + ${e.formerEditors.length>1?ws.former_editors:ws.former_editor} +
      + ${bs(e,"formerEditors")} + `:""} + ${e.authors.length?kn` +
      ${e.authors.length>1?ws.authors:ws.author}
      + ${bs(e,"authors")} + `:""} + ${e.github||e.wgPublicList?kn`
      ${ws.feedback}
      + ${$s(e)}`:""} + ${e.otherLinks?e.otherLinks.map(us):""} +
      + ${e.alternateFormats?kn`

      + ${t.multipleAlternates?"This document is also available in these non-normative formats:":"This document is also available in this non-normative format:"} + ${t.alternatesHTML} +

      `:""} + ${n||kn``} +
      +
      `};const _s=Wn({en:{sotd:"Status of This Document",status_at_publication:kn`This section describes the status of this + document at the time of its publication. A list of current W3C + publications and the latest revision of this technical report can be found + in the + W3C standards and drafts index.`},ko:{sotd:"현재 문서의 상태",status_at_publication:kn`이 부분은 현재 문서의 발행 당시 상태에 대해 + 기술합니다. W3C 발행 문서의 최신 목록 및 테크니컬 리포트 최신판의 + W3C standards and drafts index 에서 + 열람할 수 있습니다.`},zh:{sotd:"关于本文档",status_at_publication:kn`本章节描述了本文档的发布状态。W3C的文档列表和最新版本可通过W3C技术报告索引访问。`},ja:{sotd:"この文書の位置付け",status_at_publication:kn`この節には、公開時点でのこの文書の位置づけが記されている。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。 + W3C standards and drafts index`},nl:{sotd:"Status van dit document"},es:{sotd:"Estado de este Document",status_at_publication:kn`Esta sección describe el estado del presente + documento al momento de su publicación. Una lista de las publicaciones + actuales del W3C y la última revisión del presente informe técnico puede + hallarse en + el índice de normas y borradores del + W3C.`},de:{sotd:"Status dieses Dokuments",status_at_publication:kn`Dieser Abschnitt beschreibt den Status des + Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen + Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann + im W3C standards and drafts index.`},cs:{sotd:"Stav tohoto dokumentu",status_at_publication:kn`Tato sekce popisuje stav tohoto dokumentu v době + jeho zveřejnění. Seznam aktuálních publikací W3C a nejnovější verzi této + technické zprávy najdete v + indexu standardů a návrhů W3C + na https://www.w3.org/TR/.`}}),Cs="https://www.w3.org/policies/process/20250818/";function Ss(e){return/^[aeiou]/i.test(e)?`an ${e}`:`a ${e}`}var Rs=(e,t)=>kn` +

      ${_s.sotd}

      + ${e.isPreview?Es(e):""} + ${e.isUnofficial?function(e){const{additionalContent:t}=e;return kn` +

      + This document is a draft of a potential specification. It has no official + standing of any kind and does not represent the support or consensus of + any standards organization. +

      + ${t} + `}(t):e.isTagFinding?t.additionalContent:e.isNoTrack?function(e,t){const{isMO:n}=e,{additionalContent:r}=t;return kn` +

      + This document is merely a W3C-internal + ${n?"member-confidential":""} document. It has no official standing + of any kind and does not represent consensus of the W3C Membership. +

      + ${r} + `}(e,t):kn` +

      ${_s.status_at_publication}

      + ${e.isMemberSubmission?function(e,t){return kn` + ${t.additionalContent} + ${e.isMemberSubmission?function(e){const t=`https://www.w3.org/Submission/${e.publishDate.getUTCFullYear()}/${e.submissionCommentNumber}/Comment/`,n="PP2017"===e.wgPatentPolicy?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/policies/patent-policy/";return kn`

      + By publishing this document, W3C acknowledges that the + Submitting Members have made a formal + Submission request to W3C for discussion. Publication of this document by + W3C indicates no endorsement of its content by W3C, nor that W3C has, is, or + will be allocating any resources to the issues addressed by it. This + document is not the product of a chartered W3C group, but is published as + potential input to the + W3C Process. A + W3C Team Comment has been published in + conjunction with this Member Submission. Publication of acknowledged Member + Submissions at the W3C site is one of the benefits of + + W3C Membership. Please consult the requirements associated with Member Submissions of + section 3.3 of the W3C Patent Policy. Please consult the complete + list of acknowledged W3C Member Submissions. +

      `}(e):""} + `}(e,t):kn` + ${e.sotdAfterWGinfo?"":t.additionalContent} + ${e.overrideStatus?"":kn` ${function(e){if(!e.wg)return;let t=null;const n=document.querySelector(".proposed-addition"),r=document.querySelector(".proposed-correction"),s=document.querySelector(".addition"),o=document.querySelector(".correction"),i=n||r||s||o;e.isRec&&i&&(n&&r||s&&o?t=kn`It includes + ${n?kn` + proposed amendments`:kn` + candidate amendments`}, + introducing substantive changes and new features since the previous + Recommendation.`:n||s?t=kn`It includes + ${n?kn` + proposed additions`:kn` + candidate additions`}, + introducing new features since the previous Recommendation.`:(r||o)&&(t=kn`It includes + ${r?kn` + proposed corrections`:kn` + candidate corrections`}.`));const a=js[e.specStatus]?kn` using the + ${js[e.specStatus]} track`:"";return kn`

      + This document was published by ${As(e)} as + ${Ss(e.longStatus)}${a}. ${t} +

      `}(e)} `} + ${e.sotdAfterWGinfo?t.additionalContent:""} + ${e.isRec?function(e){const{revisedRecEnd:t}=e,n=document.querySelector("#sotd.updateable-rec");let r="";document.querySelector(".proposed-addition")?r="additions":document.querySelector(".proposed-correction")&&(r="corrections");return kn` +

      + W3C recommends the wide deployment of this specification as a standard for + the Web. +

      + +

      + A W3C Recommendation is a specification that, after extensive + consensus-building, is endorsed by + W3C and its Members, and + has commitments from Working Group members to + royalty-free licensing + for implementations. + ${n?kn`Future updates to this Recommendation may incorporate + new features.`:""} +

      + ${document.querySelector(".addition")?kn`

      + Candidate additions are marked in the document. +

      `:""} + ${document.querySelector(".correction")?kn`

      + Candidate corrections are marked in the document. +

      `:""} + ${document.querySelector(".proposed-addition")?kn`

      + Proposed additions are marked in the document. +

      `:""} + ${document.querySelector(".proposed-correction")?kn`

      + Proposed corrections are marked in the document. +

      `:""} + ${r?kn`

      + The W3C Membership and other interested parties are invited to review + the proposed ${r} and send comments through + ${Ln.format(t)}. Advisory Committee Representatives + should consult their + WBS questionnaires. +

      `:""} + `}(e):function(e){const t=document.querySelector("#sotd.updateable-rec");let n=null,r=null,s=kn`Publication as ${Ss(e.textStatus)} does not + imply endorsement by W3C and its Members.`,o=kn`

      + This is a draft document and may be updated, replaced, or obsoleted by other + documents at any time. It is inappropriate to cite this document as other + than a work in progress. + ${t?kn`Future updates to this upcoming Recommendation may incorporate + new features.`:""} +

      `;"DISC"===e.specStatus&&(o=kn`

      + Publication as a Discontinued Draft implies that this document is no + longer intended to advance or to be maintained. It is inappropriate to + cite this document as other than abandoned work. +

      `);const i=kn`

      + This document is maintained and updated at any time. Some parts of this + document are work in progress. +

      `;switch(e.specStatus){case"STMT":s=kn`

      + A W3C Statement is a specification that, after extensive + consensus-building, is endorsed by + W3C and its Members. +

      `;break;case"RY":s=kn`

      W3C recommends the wide usage of this registry.

      +

      + A W3C Registry is a specification that, after extensive + consensus-building, is endorsed by + W3C and its Members. +

      `;break;case"CRD":n=kn`A Candidate Recommendation Draft integrates + changes from the previous Candidate Recommendation that the Working Group + intends to include in a subsequent Candidate Recommendation Snapshot.`,"LS"===e.pubMode&&(o=i);break;case"CRYD":n=kn`A Candidate Registry Draft integrates changes + from the previous Candidate Registry Snapshot that the Working Group + intends to include in a subsequent Candidate Registry Snapshot.`,"LS"===e.pubMode&&(o=i);break;case"CRY":n=kn`A Candidate Registry Snapshot has received + wide review.`,r=kn`

      + The W3C Membership and other interested parties are invited to review + the document and send comments through ${e.humanPREnd}. Advisory + Committee Representatives should consult their + WBS questionnaires. Note that substantive technical comments were expected during the + Candidate Recommendation review period that ended ${e.humanCREnd}. +

      `;break;case"CR":n=kn`A Candidate Recommendation Snapshot has received + wide review, is intended to + gather + implementation experience, + and has commitments from Working Group members to + royalty-free licensing + for implementations.`,o=kn`${t?kn`Future updates to this upcoming Recommendation may incorporate + new features.`:""}`,r="LS"===e.pubMode?kn`

      + Comments are welcome at any time but most especially before + ${Ln.format(e.crEnd)}. +

      `:kn`

      + This Candidate Recommendation is not expected to advance to Proposed + Recommendation any earlier than ${Ln.format(e.crEnd)}. +

      `;break;case"PR":r=kn`

      + The W3C Membership and other interested parties are invited to review + the document and send comments through ${Ln.format(e.prEnd)}. + Advisory Committee Representatives should consult their + WBS questionnaires. Note that substantive technical comments were expected during the + Candidate Recommendation review period that ended + ${Ln.format(e.crEnd)}. +

      `;break;case"DNOTE":s=kn`${e.textStatus}s are not endorsed by + W3C nor its Members.`;break;case"NOTE":s=kn`This ${e.textStatus} is endorsed by + ${As(e)}, but is not endorsed by + W3C itself nor its + Members.`,o=""}return kn`

      ${s} ${n}

      + ${o} ${r}`}(e)} + ${function(e){const{isNote:t,isRegistry:n,wgId:r,multipleWGs:s,wgPatentHTML:o,wgPatentURI:i,wgPatentPolicy:a}=e,c="PP2017"===a?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/policies/patent-policy/",l=t||n?kn` + The + ${"PP2017"===a?"1 August 2017 ":""}W3C Patent + Policy + does not carry any licensing requirements or commitments on this + document. + `:kn` + This document was produced by ${s?"groups":"a group"} + operating under the + ${"PP2017"===a?"1 August 2017 ":""}W3C Patent + Policy. + `;return kn`

      + ${l} + ${t||n?"":kn` + ${s?kn` W3C maintains ${o} `:kn` + W3C maintains a + public list of any patent disclosures + `} + made in connection with the deliverables of + ${s?"each group; these pages also include":"the group; that page also includes"} + instructions for disclosing a patent. An individual who has actual + knowledge of a patent that the individual believes contains + Essential Claim(s) + must disclose the information in accordance with + section 6 of the W3C Patent Policy. + `} +

      `}(e)} +

      + This document is governed by the + 18 August 2025 W3C Process Document. +

      + `} + `} + ${t.additionalSections} + `;function Es(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return kn`
      + + This is a + preview${t&&n?kn` + of pull request + #${n} + `:""} + +

      + Do not attempt to implement this version of the specification. Do not + reference this version as authoritative in any way. + ${r?kn` + Instead, see + ${r} for the Editor's draft. + `:""} +

      +
      `}function As(e){return Array.isArray(e.wg)?Gn(e.wg,((t,n)=>kn`the ${t}`)):e.wg?kn`the ${e.wg}`:void 0}var Ls=(e,t)=>kn` +

      ${_s.sotd}

      + ${e.isPreview?Es(e):""} +

      + This specification was published by the + ${e.wg}. It is not a W3C Standard nor is it + on the W3C Standards Track. + ${e.isCGFinal?kn` + Please note that under the + W3C Community Final Specification Agreement (FSA) + other conditions apply. + `:kn` + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + `} + Learn more about + W3C Community and Business Groups. +

      + ${e.sotdAfterWGinfo?"":t.additionalContent} + ${!e.github&&e.wgPublicList?function(e,t){const{mailToWGPublicListWithSubject:n,mailToWGPublicListSubscription:r}=t,{wgPublicList:s,subjectPrefix:o}=e;return kn`

      + If you wish to make comments regarding this document, please send them to + ${s}@w3.org + (subscribe, + archives)${o?kn` with ${o} at the start of your email's + subject`:""}. +

      `}(e,t):""} + ${e.github?function(e,t){if(e.github||e.wgPublicList)return kn`

      + ${e.github?kn` + GitHub Issues are preferred for + discussion of this specification. + `:""} + ${e.wgPublicList?kn` + ${e.github&&e.wgPublicList?"Alternatively, you can send comments to our mailing list.":"Comments regarding this document are welcome."} + Please send them to + ${e.wgPublicList}@w3.org + (subscribe, + archives)${e.subjectPrefix?kn` with ${e.subjectPrefix} at the start of your + email's subject`:""}. + `:""} +

      `}(e,t):""} + ${e.sotdAfterWGinfo?t.additionalContent:""} + ${t.additionalSections} + `;const Ts="w3c/headers";function Ps(e){return new URL(e,"https://www.w3.org/").href}const Is={LS:"WD",LD:"WD",FPWD:"WD","Member-SUBM":"SUBM"},Ds={DNOTE:"Group Note Draft",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Registry Draft",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",UD:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},Ns={...Ds,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},js={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},Os=["DNOTE","NOTE","STMT"],zs=["CR","CRD","DISC","FPWD","PR","REC","RSCND","WD"],Ms=["DRY","CRY","CRYD","RY"],qs=["draft-finding","finding","editor-draft-finding"],Ws=["CG-DRAFT","CG-FINAL"],Us=["BG-DRAFT","BG-FINAL"],Fs=[...Ws,...Us],Bs=[...Os,...zs,...Ms],Hs=["base",...Ws,...Us,"editor-draft-finding","draft-finding","finding","MO","unofficial"],Vs=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["w3c-software",{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/copyright/software-license-2002/"}],["w3c-software-doc",{name:"W3C Software and Document Notice and License",short:"permissive document license",url:"https://www.w3.org/copyright/software-license-2023/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/copyright/document-license/"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}],[void 0,{name:"unlicensed",url:null,short:"UNLICENSED"}]]),Gs=["PP2017","PP2020"];function Ys(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=En.format(r);return new Date(e)}return lr(gr`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,Ts),new Date(En.format(new Date))}function Ks(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){ur(gr`ReSpec does not support automated SotD generation for TAG findings.`,Ts,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var Zs=Object.freeze({__proto__:null,W3CNotes:Os,bgStatus:Us,cgStatus:Ws,cgbgStatus:Fs,licenses:Vs,name:Ts,noTrackStatus:Hs,recTrackStatus:zs,registryTrackStatus:Ms,run:async function(e){if(e.isBasic="base"===e.specStatus,e.isCGBG=Fs.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isCRY="CRY"===e.specStatus||"CRYD"===e.specStatus,e.isEd="ED"===e.specStatus,e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Os.includes(e.specStatus),e.isNoTrack=Hs.includes(e.specStatus),e.isPR="PR"===e.specStatus,e.isRecTrack=zs.includes(e.specStatus),e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRegistry=Ms.includes(e.specStatus),e.isRegular=!e.isCGBG&&!e.isBasic,e.isTagEditorFinding="editor-draft-finding"===e.specStatus,e.isTagFinding=qs.includes(e.specStatus),e.isUnofficial="unofficial"===e.specStatus,e.licenseInfo=function(e){let t;if("string"==typeof e.license){const n=e.license.toLowerCase();if(Vs.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=gr`Please set + ${"[license]"} to one of: ${fr([...Vs.keys()].filter((e=>e)),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;lr(t,Ts,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=gr`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;lr(gr`License "\`${e.license}\`" is not allowed for W3C Specifications.`,Ts,{hint:t})}return Vs.get(t)}(e),e.prependW3C=!e.isBasic&&!e.isUnofficial,e.longStatus=Ns[e.specStatus],e.textStatus=Ds[e.specStatus],e.showPreviousVersion=!1,e.isRegular&&!e.shortName){const e=gr`Please set ${"[shortName]"} to a short name for the specification.`;lr(gr`The ${"[shortName]"} configuration option is required for this kind of document.`,Ts,{hint:e})}if(e.publishDate=Ys(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.modificationDate&&(e.modificationDate=Ys(e,"modificationDate",document.lastModified)),e.isRecTrack&&!e.github&&!e.wgPublicList){const e=gr`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;lr("W3C Process requires a either a link to a public repository or mailing list.",Ts,{hint:e})}if(e.isEd&&!e.edDraftURI){const e=gr`Please set ${"[edDraftURI]"} to the URL of the Editor's Draft. Alternatively, use the set ${"[github]"} option, which automatically sets it for you.`;ur(gr`Editor's Drafts should set ${"[edDraftURI]"} configuration option.`,Ts,{hint:e})}const t=function(e){const{specStatus:t,group:n}=e;if(Bs.includes(t)||"wg"===e.groupType)return"/TR";switch(t){case"CG-FINAL":case"BG-FINAL":return`/community/reports/${n}`;case"finding":case"draft-finding":return"/2001/tag/doc";case"Member-SUBM":return"/Submission"}if(("tag"===e.group||"ab"===e.group)&&"TR"===e.canonicalURI)return"/TR";return""}(e);if(t&&!e.thisVersion){const n=Is[e.specStatus]||e.specStatus,{shortName:r,publishDate:s}=e,o=`${n}-${r}-${Fn(s)}`,i=[...Bs,"Member-SUBM"].includes(e.specStatus)?`${s.getUTCFullYear()}/`:"";e.thisVersion=Ps(`${t}/${i}${o}/`)}e.isEd&&(e.thisVersion=e.edDraftURI),e.isCGBG&&function(e){const t=Ds[e.specStatus],n=e.latestVersion?new URL(Ps(e.latestVersion)):null;if(!e.wg){return void lr(gr`The ${"[group]"} configuration option is required for this kind of document (${t}).`,Ts)}if(e.isCGFinal){if(!1===("https://www.w3.org"===n?.origin||"https://w3.org/"===n?.origin)){lr(gr`For ${t}, the ${"[latestVersion]"} URL must point to somewhere at https://www.w3.org/.`,Ts,{hint:"Ask a W3C Team Member for a W3C URL where the report can be published."})}}}(e),null!==e.latestVersion&&(e.latestVersion=e.latestVersion?Ps(e.latestVersion):Ps(`${t}/${e.shortName}/`)),e.latestVersion&&function(e){const t=new URL(e.latestVersion);if(("https://www.w3.org"===t.origin||"https://w3.org/"===t.origin)&&t.pathname.startsWith("/TR/")&&!1===["ED",...Bs].includes(e.specStatus)){const t=gr`Ask a W3C Team Member for a W3C URL where the report can be published and change ${"[latestVersion]"} to something else.`;lr(gr`Documents with a status of \`"${e.specStatus}"\` can't be published on the W3C's /TR/ (Technical Report) space.`,Ts,{hint:t})}}(e);const n=`${t}/${e.shortName}`;if(e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){lr(gr`${"[`previousPublishDate`]"} is set, but missing ${"[`previousMaturity`]"}.`,Ts)}e.previousPublishDate=Ys(e,"previousPublishDate");const r=Is[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=En.format(e.publishDate);e.thisVersion=Ps(`${n}-${t}`);const r=En.format(e.previousPublishDate);e.prevVersion=Ps(`${n}-${r}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const n=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,o=Fn(e.previousPublishDate);e.prevVersion=Ps(`${t}/${n}/${r}-${s}-${o}/`)}}e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=Ps(`${t}/${e.prevRecShortname}`));for(let t=0;t{if(e.w3cid)return;const n=gr`See ${"[w3cid]"} for instructions for how to retrieve it and add it.`;lr(gr`Editor ${e.name?`"${e.name}"`:`number ${t+1}`} is missing their ${"[w3cid]"}.`,Ts,{hint:n})}));if(e.alternateFormats?.some((({uri:e,label:t})=>!e||!t))){lr(gr`Every ${"[`alternateFormats`]"} entry must have a \`uri\` and a \`label\`.`,Ts)}e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.dashDate=En.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=En.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every((e=>Gs.includes(e)))){const e=gr`Invalid ${"[wgPatentPolicy]"} value(s): ${hr([...t].filter((e=>!Gs.includes(e))))}.`,n=`Please use one of: ${fr(Gs)}.`;lr(e,Ts,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=gr`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;lr(e,Ts,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI||!e.latestVersion)return;const t=e.isEd||Bs.includes(e.specStatus);if(e.historyURI&&!t){const t=gr`Please remove ${"[historyURI]"}.`;return lr(gr`The ${"[historyURI]"} can't be used with non /TR/ documents.`,Ts,{hint:t}),void(e.historyURI=null)}const n=new URL(e.historyURI??`${e.shortName}/`,"https://www.w3.org/standards/history/");if(e.historyURI&&t||["FPWD","DNOTE","NOTE","DRY"].includes(e.specStatus))return void(e.historyURI=n.href);try{const t=await fetch(n,{method:"HEAD"});t.ok&&(e.historyURI=t.url)}catch{}}(e),e.isTagEditorFinding&&(delete e.thisVersion,delete e.latestVersion),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate);const r={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&Gn(e.alternateFormats.map((({label:e})=>e)),((t,n)=>{const r=e.alternateFormats[n];return kn`${r.label}`}))}},s=(e.isCGBG?xs:ks)(e,r);document.body.prepend(s),document.body.classList.add("h-entry");const o=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!o.id){lr("A Status of This Document must include at least on custom paragraph.",Ts,{elements:[o],hint:"Add a `

      ` in the 'sotd' section that reflects the status of this specification."})}o.id=o.id||"sotd",o.classList.add("introductory");const i=[e.wg,e.wgURI,e.wgPatentURI];if(i.some((e=>Array.isArray(e)))&&!i.every((e=>Array.isArray(e)))){const e=gr`Use the ${"[group]"} option with an array instead.`;lr(gr`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,Ts,{hint:e})}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgPatentHTML=Gn(e.wg,((t,n)=>kn`a + public list of any patent disclosures (${t})`))):e.multipleWGs=!1,e.isPR&&!e.crEnd){lr(gr`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,Ts)}if(e.isCR&&!e.crEnd){lr(gr`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,Ts)}if(e.crEnd=Ys(e,"crEnd"),e.isPr&&!e.prEnd){lr(gr`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,Ts)}e.prEnd=Ys(e,"prEnd");const a=o.classList.contains("updateable-rec"),c=null!==document.querySelector(".correction"),l=null!==document.querySelector(".proposed-correction"),u=null!==document.querySelector(".addition"),d=null!==document.querySelector(".proposed-addition"),p=c||u||d||l;if(e.isRec&&!e.errata&&!p){const e=gr`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;lr("Recommendations must have an errata link.",Ts,{hint:e})}if(!a&&(u||c)){lr(gr`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as allowing new features.`,Ts)}if(e.isRec&&a&&(d||l)&&!e.revisedRecEnd){lr(gr`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,Ts)}if(e.revisedRecEnd=Ys(e,"revisedRecEnd"),e.noRecTrack&&zs.includes(e.specStatus)){const t=gr`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=fr(zs,{quotes:!0});lr(t,Ts,{hint:`Status **can't** be any of: ${n}.`})}if(o.classList.contains("override")||kn.bind(o)`${function(e,t){const n={...Ks(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?`?subject=${encodeURIComponent(e.subjectPrefix)}`:"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}},r=e.isCGBG?Ls:Rs;return r(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=gr`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/policies/process/#implementation-experience).`;lr(gr`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,Ts,{hint:e})}if(!e.implementationReportURI&&e.isPR){ur(gr`PR documents should include an ${"[implementationReportURI]"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/policies/process-20190301/#implementation-experience).`,Ts)}wr("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:qn(document.getElementById("w3c-state")?.textContent??"")})},status2text:Ds,status2track:js,tagStatus:qs,trStatus:Bs});const Js={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Qs="w3c/defaults",Xs={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},eo={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211",height:"48"},to={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"informative-dfn":"warn","no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0,subtitle:"",prevVersion:"",formerEditors:[],editors:[],authors:[]};var no=Object.freeze({__proto__:null,name:Qs,run:function(e){const t=!1!==e.lint&&{...Js.lint,...to.lint,...e.lint};Object.assign(e,{...Js,...to,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t,groupType:n,group:r}=e;if(!t){const t=gr`Select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;return lr(gr`The ${"[specStatus]"} configuration option is required.`,Qs,{hint:t}),void(e.specStatus="base")}if(void 0===Ds[t]){const n=gr`The ${"[specStatus]"} "\`${t}\`" is not supported at for this type of document.`,r=gr`set ${"[specStatus]"} to one of: ${fr(Object.keys(Ds),{quotes:!0})}.`;return lr(n,Qs,{hint:r}),void(e.specStatus="base")}switch(n){case"cg":if(![...Ws,"unofficial","UD"].includes(t)){const n=gr`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=fr(Ws,{quotes:!0});lr(n,Qs,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Us,"unofficial","UD"].includes(t)){const n=gr`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=fr(Us,{quotes:!0});lr(n,Qs,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(![...Bs,"unofficial","UD","ED"].includes(t)){const e=gr`Pleas see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;lr(gr`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,Qs,{hint:e})}break;case"other":if("tag"===r&&!["ED",...Bs,...qs].includes(t)){const n=gr`The W3C Technical Architecture Group's documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=fr(["ED",...Bs,...qs],{quotes:!0});lr(n,Qs,{hint:`Please use one of: ${r}. Automatically falling back to \`"unofficial"\`.`}),e.specStatus="unofficial"}break;default:if(!e.wgId&&!["unofficial","base","UD","Member-SUBM"].includes(e.specStatus)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=gr`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",lr(t,Qs,{hint:n})}}}(e),function(e){const{specStatus:t,wg:n}=e,r=[...zs,...Ms,...Os,...qs,"ED"].includes(t),s=n&&n.length&&r,o=["Member-SUBM"].includes(t);(s||o)&&(e.logos.unshift(Xs),"Member-SUBM"===t&&e.logos.push(eo))}(e)}});var ro=String.raw`@keyframes pop{ +0%{transform:scale(1,1)} +25%{transform:scale(1.25,1.25);opacity:.75} +100%{transform:scale(1,1)} +} +a.internalDFN{color:inherit;border-bottom:1px solid #99c;text-decoration:none} +a.externalDFN{color:inherit;border-bottom:1px dotted #ccc;text-decoration:none} +a.bibref{text-decoration:none} +.respec-offending-element:target{animation:pop .25s ease-in-out 0s 1} +.respec-offending-element,a[href].respec-offending-element{text-decoration:red wavy underline} +@supports not (text-decoration:red wavy underline){ +.respec-offending-element:not(pre){display:inline-block} +.respec-offending-element{background:url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=) bottom repeat-x} +} +#references :target{background:#eaf3ff;animation:pop .4s ease-in-out 0s 1} +cite .bibref{font-style:italic} +a[href].orcid{padding-left:4px;padding-right:4px} +a[href].orcid>svg{margin-bottom:-2px} +ol.tof,ul.tof{list-style:none outside none} +.caption{margin-top:.5em;font-style:italic} +#issue-summary>ul{column-count:2} +#issue-summary li{list-style:none;display:inline-block} +details.respec-tests-details{margin-left:1em;display:inline-block;vertical-align:top} +details.respec-tests-details>*{padding-right:2em} +details.respec-tests-details[open]{z-index:999999;position:absolute;border:thin solid #cad3e2;border-radius:.3em;background-color:#fff;padding-bottom:.5em} +details.respec-tests-details[open]>summary{border-bottom:thin solid #cad3e2;padding-left:1em;margin-bottom:1em;line-height:2em} +details.respec-tests-details>ul{width:100%;margin-top:-.3em} +details.respec-tests-details>li{padding-left:1em} +.self-link:hover{opacity:1;text-decoration:none;background-color:transparent} +aside.example .marker>a.self-link{color:inherit} +.header-wrapper{display:flex;align-items:baseline} +:is(h2,h3,h4,h5,h6):not(#toc>h2,#abstract>h2,#sotd>h2,.head>h2){position:relative;left:-.5em} +:is(h2,h3,h4,h5,h6):not(#toch2)+a.self-link{color:inherit;order:-1;position:relative;left:-1.1em;font-size:1rem;opacity:.5} +:is(h2,h3,h4,h5,h6)+a.self-link::before{content:"§";text-decoration:none;color:var(--heading-text)} +:is(h2,h3)+a.self-link{top:-.2em} +:is(h4,h5,h6)+a.self-link::before{color:#000} +@media (max-width:767px){ +dd{margin-left:0} +} +@media print{ +.removeOnSave{display:none} +}`;const so=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=ro,document.head.appendChild(e),e}();var oo=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&so.remove()}});function io(){const e=document.createElement("script");e.src="https://www.w3.org/scripts/TR/2021/fixup.js",location.hash&&e.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),document.body.appendChild(e)}const ao=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2021/fixup.js",as:"script"},{hint:"preload",href:lo("base.css").href,as:"style"},{hint:"preload",href:lo("dark.css").href,as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",as:"image",corsMode:"anonymous"}],t=document.createDocumentFragment();for(const n of e.map(Pn))t.appendChild(n);return t}();function co(e){return t=>{const n=t.querySelector(`head link[href="${e}"]`);t.querySelector("head").append(n)}}function lo(e="base.css"){return new URL(`/StyleSheets/TR/2021/${e}`,"https://www.w3.org/")}ao.appendChild(kn``),document.head.querySelector("meta[name=viewport]")||ao.prepend(kn``),document.head.prepend(ao);var uo=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){e.noToc||vr("end-all",io,{once:!0});const t=lo(function(e){const t=e.specStatus?.toUpperCase()??"";let n="";const r=[...zs,...Ms,...Os,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;case"MEMBER-SUBM":n="W3C-Member-SUBM";break;default:n=r?`W3C-${e.specStatus}`:"base.css"}return n}(e));document.head.appendChild(kn``),vr("beforesave",co(t));let n=document.querySelector("head meta[name=color-scheme]");if(n||(n=kn``,document.head.appendChild(n)),n.content.includes("dark")){const e=lo("dark.css");document.head.appendChild(kn``),vr("beforesave",co(e))}}});const po="core/github";let fo,ho;const mo=new Promise(((e,t)=>{fo=e,ho=e=>{lr(e,po),t(new Error(e))}})),go=Wn({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var bo=Object.freeze({__proto__:null,github:mo,name:po,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void fo(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=gr`Config option ${"[github]"} is missing property \`repoURL\`.`;return void ho(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=gr`${"[github]"} configuration option is not a valid URL? (${n}).`;return void ho(e)}if("https://github.com"!==t.origin){const e=gr`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void ho(e)}const[r,s]=t.pathname.split("/").filter((e=>e));if(!r||!s){const e=gr`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void ho(e)}const o=e.github.branch||"gh-pages",i=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:i,atRiskBase:i,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:s};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{ur("The `githubAPI` configuration option is private and should not be added manually.",po)}if(!e.excludeGithubLinks){const n={key:go.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:go.file_a_bug,href:c.issueBase},{value:go.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:o,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`,issuesURL:i,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",i).href,commitHistoryURL:a.href};fo(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class yo{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}static sectionClasses=new Set(["appendix","informative","notoc"]);findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t,this.processHeader(e,t)}processHeader(e,t){yo.sectionClasses.intersection(new Set(e.classList)).forEach((e=>{t.classList.add(e)}))}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(wo(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function wo(e){const t=new yo(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function vo(e){const t=wo(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var ko=Object.freeze({__proto__:null,name:"core/sections",restructure:vo,run:function(){vo(document.body)}});const $o="core/data-include";function xo(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=Bn(e,r.dataset.oninclude,n),o="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let s=t;"markdown"===r&&(s=Nr(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&vo(e),n&&e.replaceWith(...e.childNodes)}(r,s,{replace:o}),o||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function _o(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const s=await fetch(n);xo(await s.text(),r,n),t<3&&await _o(e,t+1)}catch(t){lr(`\`data-include\` failed: \`${n}\` (${t.message}).`,$o,{elements:[e],cause:t})}}));await Promise.all(r)}var Co=Object.freeze({__proto__:null,name:$o,run:async function(){await _o(document,1)}});var So=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=br(e.innerHTML)}});const Ro="core/title",Eo=Wn({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"},cs:{default_title:"Bez názvu"}});var Ao=Object.freeze({__proto__:null,name:Ro,run:function(e){const t=document.querySelector("h1#title")||kn`

      `;if(t.isConnected&&""===t.textContent.trim()){lr('The document is missing a title, so using a default title. To fix this, please give your document a ``. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',Ro,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${Eo.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=qn(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=kn` + Preview of PR <a href="${n}">#${e.prNumber}</a>: + `;t.prepend(...s),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const Lo="w3c/level",To=Wn({en:{level:"Level"},ja:{level:"レベル"},nl:{level:"Niveau"},de:{level:"Stufe"},zh:{level:"级别"}});var Po=Object.freeze({__proto__:null,name:Lo,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){lr(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,Lo,{title:"Invalid level config.",elements:[t]})}else t.append(` ${To.level} ${n}`),document.title=`${document.title} ${To.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const Io="w3c/abstract",Do=Wn({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"},cs:{abstract:"Abstrakt"}});var No=Object.freeze({__proto__:null,name:Io,run:async function(){const e=function(){const e=document.getElementById("abstract");if(e)switch(e.localName){case"section":return e;case"div":return Jn(e,"section");default:return lr("The abstract should be a `<section>` element.",Io,{elements:[e]}),e}const t=Do.abstract.toLocaleLowerCase(o);for(const e of document.querySelectorAll("h2, h3, h4, h5, h6"))if(qn(e.textContent).toLocaleLowerCase(o)===t)return e.closest("section");return e}();e?(e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(kn`<h2>${Do.abstract}</h2>`)):lr('Document must have one `<section id="abstract">`.',Io)}});var jo=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Bn(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Oo="core/dfn-abbr";function zo(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter((e=>e.trim())).concat(t).join("|")}var Mo=Object.freeze({__proto__:null,name:Oo,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)zo(t);else{lr(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Oo,{elements:[t],title:"Error: unsupported."})}}}});const qo=/^[a-z]+(\s+[a-z]+)+\??$/,Wo=/\B"([^"]*)"\B/,Uo=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Fo=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Bo=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ho=/^(?:\w+)\??$/,Vo=/^(\w+)\["([\w- ]*)"\]$/,Go=/\.?(\w+\(.*\)$)/,Yo=/\/(.+)/,Ko=/\[\[.+\]\]/;function Zo(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return kn`<a + data-xref-type="_IDL_" + data-link-type="idl" + data-lt="${t}" + ><code>${t+(r?"?":"")}</code></a + >`}function Jo(e){const{identifier:t,parent:n,slotType:r,renderParent:s,args:o}=e,{identifier:i}=n||{},a="method"===r,c=a?kn`(${Vn(o,Qo)})`:null,l=a?`(${o.join(", ")})`:"";return kn`${n&&s?".":""}<a + data-xref-type="${r}" + data-link-type="${r}" + data-link-for="${i}" + data-xref-for="${i}" + data-lt="${`[[${t}]]${l}`}" + ><code>[[${t}]]${c}</code></a + >`}function Qo(e,t,n){if(t<n.length-1)return kn`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),s=r.length>1,o=s?r[2]:r[0];return kn`${s?"...":null}<var>${o}</var>`}function Xo(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:s}=t||{};return kn`${r?".":""}<a + data-link-type="idl" + data-xref-type="attribute|dict-member|const" + data-link-for="${s}" + data-xref-for="${s}" + ><code>${n}</code></a + >`}function ei(e){const{args:t,identifier:n,type:r,parent:s,renderParent:o}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=s||{},l=Vn(a||t,Qo),u=`${n}(${t.join(", ")})`;return kn`${s&&o?".":""}<a + data-link-type="idl" + data-xref-type="${r}" + data-link-for="${c}" + data-xref-for="${c}" + data-lt="${u}" + ><code>${i||n}</code></a + >${!i||a?kn`<code>(${l})</code>`:""}`}function ti(e){const{identifier:t,enumValue:n,parent:r}=e,s=r?r.identifier:t;return kn`"<a + data-link-type="idl" + data-xref-type="enum-value" + data-link-for="${s}" + data-xref-for="${s}" + data-lt="${n?null:"the-empty-string"}" + ><code>${n}</code></a + >"`}function ni(e){const{identifier:t}=e;return kn`"<a + data-link-type="idl" + data-cite="webidl" + data-xref-type="exception" + ><code>${t}</code></a + >"`}function ri(e){const{identifier:t,nullable:n}=e;return kn`<a + data-link-type="idl" + data-cite="webidl" + data-xref-type="interface" + data-lt="${t}" + ><code>${t+(n?"?":"")}</code></a + >`}function si(e){let t;try{t=function(e){const t=Ko.test(e),n=t?Yo:Go,[r,s]=e.split(n);if(t&&r&&!s)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const o=r.split(/[./]/).concat(s).filter((e=>e&&e.trim())).map((e=>e.trim())),i=!e.includes("/"),a=[];for(;o.length;){const t=o.pop();if(Uo.test(t)){const[,e,n,r,s]=t.match(Uo),o=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=s?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:o,renderParent:i,renderText:c,renderArgs:l})}else if(Vo.test(t)){const[,e,n]=t.match(Vo);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(Wo.test(t)){const[,e]=t.match(Wo);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(Fo.test(t)){const[,e,n]=t.match(Fo),r=n?"method":"attribute",s=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:s,renderParent:i})}else if(Bo.test(t)&&o.length){const[,e]=t.match(Bo);a.push({type:"attribute",identifier:e,renderParent:i})}else if(qo.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:i,nullable:e})}else{if(!Ho.test(t)||0!==o.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:i,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=kn`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return lr(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=kn(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Zo(e);t&&r.push(t);break}case"attribute":r.push(Xo(e));break;case"internal-slot":r.push(Jo(e));break;case"method":r.push(ei(e));break;case"enum":r.push(ti(e));break;case"exception":r.push(ni(e));break;case"idl-primitive":r.push(ri(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const oi=new Set(["alias","reference"]),ii=async function(){const e=await $n.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map((t=>e.deleteObjectStore(t)));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...oi]){const r=e.transaction(n,"readwrite").store,s=IDBKeyRange.lowerBound(t);let o=await r.openCursor(s);for(;o?.value;){const e=o.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),o=await o.continue()}}return e}();const ai={get ready(){return ii},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!oi.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:null},async get(e,t){if(!oi.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),s=await n.openCursor(r);return s?s.value:null},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const s={id:r,...e[r],expires:t};s.aliasOf?n.alias.push(s):n.reference.push(s)}const r=[...oi].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!oi.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const s=await this.get(e,t.id);if(s?.expires<Date.now()){const{store:s}=n.transaction(e,"readwrite");await s.delete(t.id),r=!1}}const{store:s}=n.transaction(e,"readwrite");return r?await s.put(t):await s.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...oi],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},ci={},li=new URL("https://api.specref.org/bibrefs?refs="),ui=Pn({hint:"dns-prefetch",href:li.origin});let di;document.head.appendChild(ui);const pi=new Promise((e=>{di=e}));async function fi(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(li.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const s=await r.json(),o=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),o):o;await ai.addAll(s,e)}catch(e){console.error(e)}return s}async function hi(e){const t=await pi;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await hi(n.aliasOf):n}var mi=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=ci;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await ai.ready;const n=e.map((async e=>({id:e,data:await ai.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],s={hasData:[],noData:[]};r.forEach((e=>{(e.data?s.hasData:s.noData).push(e)})),s.hasData.forEach((e=>{ci[e.id]=e.data}));const o=s.noData.map((e=>e.id));if(o.length){const e=await fi(o,{forceUpdate:!0});Object.assign(ci,e)}Object.assign(ci,this.conf.localBiblio),(()=>{di(this.conf.biblio)})()}},biblio:ci,name:"core/biblio",resolveRef:hi,updateFromNetwork:fi});const gi="core/render-biblio",bi=Wn({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"},cs:{info_references:"Informativní odkazy",norm_references:"Normativní odkazy",references:"Odkazy",reference_not_found:"Odkaz nebyl nalezen."}}),yi=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),wi=(vi=".",e=>{const t=e.trim();return!t||t.endsWith(vi)?t:t+vi});var vi;function ki(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map($i)),s=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),o=s.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=kn`<section> + <h3>${t}</h3> + <dl class="bibliography">${o.map(_i)}</dl> + </section>`;Kn(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,s=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(s),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(s,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));lr(`Reference "[${t}]" not found.`,gi,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function $i(e){let t=ci[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;lr(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,gi)}else n=t.aliasOf,t=ci[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function xi(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,s=kn`<cite + ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite + >`;return t?s:kn`[${s}]`}function _i(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return kn` + <dt id="${r}">[${t}]</dt> + <dd> + ${n?{html:Ci(n)}:kn`<em class="respec-offending-element" + >${bi.reference_not_found}</em + >`} + </dd> + `}function Ci(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". ")),e.publisher&&(t=`${t} ${wi(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${yi.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Si=Object.freeze({__proto__:null,name:gi,renderInlineCitation:xi,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||kn`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(kn`<h1>${bi.references}</h1>`),r.classList.add("appendix"),n.length){const e=ki(n,bi.norm_references);r.appendChild(e)}if(t.length){const e=ki(t,bi.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Ri="core/inlines",Ei={},Ai=e=>new RegExp(e.map((e=>e.source)).join("|")),Li=Wn({en:{rfc2119Keywords:()=>Ai([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>Ai([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),Ti=/(?:`[^`]+`)(?!`)/,Pi=/(?:{{[^}]+\?*}})/,Ii=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,Di=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Ni=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,ji=/(?:\[=[^=]+=\])/,Oi=/(?:\[\^[^^]+\^\])/;function zi(e){const t=e.slice(2,-2).trim(),[n,r,s]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[o,i,a]=t.startsWith("/")?["element-attr",null,n]:s?["attr-value",`${n}/${r}`,s]:r?["element-attr",n,r]:["element",null,n];return kn`<code + ><a + data-xref-type="${o}" + data-xref-for="${i}" + data-link-type="${o}" + data-link-for="${i}" + >${a}</a + ></code + >`}function Mi(e){const t=qn(e),n=kn`<em class="rfc2119">${t}</em>`;return Ei[t]=!0,n}function qi(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?kn`<a href="${t}" data-matched-text="${e}"></a>`:kn`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Wi(e,t){const n=qn(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=si(n);return!!t.parentElement.closest("dfn,a")?Vi(`\`${r.textContent}\``):r}function Ui(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,o]=r.split("|").map(qn),{type:i,illegal:a}=Qn(s,t.parentElement),c=xi(s,o),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;ur("Normative references in informative sections are not allowed. ",Ri,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==i||a?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function Fi(e,t,n){return"ABBR"===t.parentElement.tagName?e:kn`<abbr title="${n.get(e)}">${e}</abbr>`}function Bi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return kn`<var data-type="${r}">${n}</var>`}function Hi(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(qn).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const s=n.substring(0,r),o=n.substring(r+1,n.length);return[t(s),t(o)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[s,o]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=Gi(o),a=n?qn(n):null;return kn`<a + data-link-type="dfn|abstract-op" + data-link-for="${a}" + data-xref-for="${a}" + data-lt="${s}" + >${i}</a + >`}function Vi(e){const t=e.slice(1,-1);return kn`<code>${t}</code>`}function Gi(e){return Ti.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?Vi(e):Gi(e))):document.createTextNode(e)}var Yi=Object.freeze({__proto__:null,name:Ri,rfc2119Usage:Ei,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new rr,e.informativeReferences=new rr,e.respecRFC2119||(e.respecRFC2119=Ei);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=qn(e),s=qn(r);t.set(n,s)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,s=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),s=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,(e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),o=[];let i;for(;i=s.nextNode();)o.push(i);return o}(document.body,["#respec-ui",".head","pre","svg","script","style"],{wsNodes:!1}),o=Li.rfc2119Keywords(),i=new RegExp(`(${Ai([o,Pi,Ii,Di,Ni,ji,Ti,Oi,...r?[r]:[]]).source})`);for(const n of s){const r=n.data.split(i);if(1===r.length)continue;const s=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):s.append(Wi(i,n));break;case i.startsWith("[[["):s.append(qi(i));break;case i.startsWith("[["):s.append(...Ui(i,n,e));break;case i.startsWith("|"):s.append(Bi(i));break;case i.startsWith("[="):s.append(Hi(i));break;case i.startsWith("`"):s.append(Vi(i));break;case i.startsWith("[^"):s.append(zi(i));break;case t.has(i):s.append(Fi(i,n,t));break;case o.test(i):s.append(Mi(i))}else s.append(i);n.replaceWith(s)}}});const Ki="w3c/conformance",Zi=Wn({en:{conformance:"Conformance",normativity:"As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.",keywordInterpretation:(e,t)=>kn`<p> + The key word${t?"s":""} ${e} in this document + ${t?"are":"is"} to be interpreted as described in + <a href="https://www.rfc-editor.org/info/bcp14">BCP 14</a> + ${xi("RFC2119")} ${xi("RFC8174")} + when, and only when, ${t?"they appear":"it appears"} in all + capitals, as shown here. + </p>`},de:{conformance:"Anforderungen",normativity:"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument nicht normativ. Alle anderen Angaben sind normativ.",keywordInterpretation:(e,t)=>kn`<p> + ${t?"Die Schlüsselwörter":"Das Schlüsselwort"} ${e} in + diesem Dokument ${t?"sind":"ist"} gemäß + <a href="https://www.rfc-editor.org/info/bcp14">BCP 14</a> + ${xi("RFC2119")} ${xi("RFC8174")} + und unter Berücksichtigung von + <a href="https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst" + >2119de</a + > + zu interpretieren, wenn und nur wenn ${t?"sie":"es"} wie hier + gezeigt durchgehend groß geschrieben wurde${t?"n":""}. + </p>`}});var Ji=Object.freeze({__proto__:null,name:Ki,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&function(e,t){const n=[...Object.keys(Ei)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=Gn(n.sort(),(e=>kn`<em class="rfc2119">${e}</em>`)),s=n.length>1,o=kn` + <h1>${Zi.conformance}</h1> + <p>${Zi.normativity}</p> + ${n.length?Zi.keywordInterpretation(r,s):null} + `;e.prepend(...o.childNodes)}(t,e),!t&&Object.keys(Ei).length){ur("Document uses RFC2119 keywords but lacks a conformance section.",Ki,{hint:'Please add a `<section id="conformance">`.'})}}});function Qi(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(s){lr(`Invalid ${t} name "${e}": ${s.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Xi(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return lr(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const ea=new ar;function ta(e,t){for(const n of t)ea.has(n)||ea.set(n,new Set),ea.get(n).add(e)}const na="core/dfn",ra=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Xi}],["element",{requiresFor:!1,validator:Qi}],["element-attr",{requiresFor:!1,validator:Qi}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Xi}],["event",{requiresFor:!1,validator:Xi}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new _n(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(s){return lr(`Invalid ${t} "${e}": ${s.message}.`,r,{hint:"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).",elements:[n]}),!1}return!0}}],["scheme",{requiresFor:!1,validator:Xi}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Xi(e.slice(1,-1),t,n,r):(lr(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),sa=[...ra.keys()];function oa(e,t){let n="";switch(!0){case sa.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>ra.has(e))),function(e,t,n){const r=ra.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=gr`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:s}=r,o=gr`Use a ${"[data-dfn-for]"} attribute to associate this with ${s}.`;lr(e,na,{hint:o,elements:[n]})}r.validator&&r.validator(e,t,n,na)}(t,n,e);break;case Fo.test(t):n=function(e,t){t.dataset.hasOwnProperty("idl")||(t.dataset.idl="");const n=t.closest("[data-dfn-for]");t!==n&&n?.dataset.dfnFor&&(t.dataset.dfnFor=n.dataset.dfnFor);if(!t.dataset.dfnFor){const n=gr`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;lr(`Internal slot "${e}" must be associated with a WebIDL interface.`,na,{hint:n,elements:[t]})}t.matches(".export, [data-export]")||(t.dataset.noexport="");const r=e.endsWith(")")?"method":"attribute";if(!t.dataset.dfnType)return r;const s=["attribute","method"],{dfnType:o}=t.dataset;if(!s.includes(o)||r!==o){const n=gr`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,o=`The only allowed types are: ${fr(s,{quotes:!0})}. The slot "${e}" seems to be a "${pr(r)}"?`;return lr(n,na,{hint:o,elements:[t]}),"dfn"}return o}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){const t=e.closest("[data-dfn-type]");n=t?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function ia(e){switch(!0){case e.matches(".export.no-export"):lr(gr`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,na,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){lr(gr`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,na,{elements:[e],hint:"Please chose only one."}),delete e.dataset.export}e.dataset.noexport="";break;case e.matches(":is(.export):not([data-noexport], .no-export)"):e.dataset.export=""}}var aa=Object.freeze({__proto__:null,name:na,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Zn(e);if(ta(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;oa(e,n),ia(e);const r=(e.dataset.localLt||"").split("|").map(qn),s=t.filter((e=>!r.includes(e)));(s.length>1||n!==qn(e.textContent))&&(e.dataset.lt=s.join("|"))}}});var ca=Object.freeze({__proto__:null,name:"core/pluralize",run:function(e){if(!e.pluralize)return;const t=function(){const e=new Set;document.querySelectorAll("a:not([href])").forEach((t=>{const n=qn(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set,n=document.querySelectorAll("dfn:not([data-lt-noDefault])");return n.forEach((e=>{const n=qn(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach((e=>t.add(e))),e.dataset.localLt&&e.dataset.localLt.split("|").forEach((e=>t.add(e)))})),function(n){const r=qn(n).toLowerCase(),s=Cn.isSingular(r)?Cn.plural(r):Cn.singular(r);return e.has(s)&&!t.has(s)?s:""}}();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach((e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|")),e.dataset.localLt&&n.push(...e.dataset.localLt.split("|"));const r=new Set(n.map(t).filter((e=>e)));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),ta(e,n)}}))}});var la=String.raw`span.example-title{text-transform:none} +:is(aside,div).example,div.illegal-example{padding:.5em;margin:1em 0;position:relative;clear:both} +div.illegal-example{color:red} +div.illegal-example p{color:#000} +aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const ua=Wn({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"},cs:{example:"Příklad"}});function da(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",s=n.title?kn`<span class="example-title">: ${n.title}</span>`:"";return kn`<div class="marker"> + <a class="self-link">${ua.example}<bdi>${r}</bdi></a + >${s} + </div>`}var pa=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;document.head.insertBefore(kn`<style> + ${la} + </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{e.classList.contains("illegal-example");const n={},{title:r}=e;if("aside"===e.localName){++t;const s=da(e,t,n);e.prepend(s);const o=Kn(e,"example",r||String(t));s.querySelector("a.self-link").href=`#${o}`}else{const s=!!e.closest("aside");s||++t,n.content=e.innerHTML,e.classList.remove("example","illegal-example");const o=e.id?e.id:null;o&&e.removeAttribute("id");const i=da(e,s?0:t,n),a=kn`<div class="example" id="${o}"> + ${i} ${e.cloneNode(!0)} + </div>`;Kn(a,"example",r||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var fa=String.raw`.issue-label{text-transform:initial} +.warning>p:first-child{margin-top:0} +.warning{padding:.5em;border-left-width:.5em;border-left-style:solid} +span.warning{padding:.1em .5em .15em} +.issue.closed span.issue-number{text-decoration:line-through} +.issue.closed span.issue-number::after{content:" (Closed)";font-size:smaller} +.warning{border-color:#f11;border-color:var(--warning-border,#f11);border-width:.2em;border-style:solid;background:#fbe9e9;background:var(--warning-bg,#fbe9e9);color:#000;color:var(--text,#000)} +.warning-title:before{content:"⚠";font-size:1.3em;float:left;padding-right:.3em;margin-top:-.3em} +li.task-list-item{list-style:none} +input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} +.issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const ha="core/issues-notes",ma=Wn({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"},cs:{editors_note:"Poznámka editora",feature_at_risk:"(Funkce v ohrožení) Problém",issue:"Problém",issue_summary:"Souhrn problémů",no_issues_in_spec:"V této specifikaci nejsou uvedeny žádné problémy.",note:"Poznámka",warning:"Varování"}});function ga(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),s=document.createElement("ul");e.forEach((e=>{const{type:o,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),s=e.classList.contains("atrisk"),o=t?"issue":n?"warning":r?"ednote":"note",i=t?s?ma.feature_at_risk:ma.issue:n?ma.warning:r?ma.editors_note:ma.note;return{type:o,displayType:i,isFeatureAtRisk:s}}(e),c="issue"===o,l="span"===e.localName,{number:u}=e.dataset,d={title:e.title,number:r(e)};if(!l){const r=kn`<div class="${a?`${o} atrisk`:o}" role="${"note"===o?"note":null}"></div>`,l=document.createElement("span"),p=kn`<div role="heading" class="${`${o}-title marker`}">${l}</div>`;Kn(p,"h",o);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):Kn(r,"issue-container",d.number?`number-${d.number}`:""),c){if(void 0!==d.number&&(h+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return kn`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return kn`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){ur(`Failed to fetch issue number ${u}.`,ha)}f&&!d.title&&(d.title=f.title)}s.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,s=t.title?kn`<span style="text-transform: none">: ${t.title}</span>`:"";return kn`<li><a href="${`#${n}`}">${r}</a>${s}</li>`}(ma.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},s=f?f.labels:[];f&&"CLOSED"===f.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map((e=>function(e,t){const{color:n,name:r}=e,s=new URL("./issues/",t);s.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const o=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[s,o,i]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*s+.7152*o+.0722*i>.179?"#000":"#fff"}(n),i=`background-color: #${n}; color: ${o}`,a=`GitHub label: ${r}`;return kn` <a + class="respec-gh-label" + style="${i}" + href="${s.href}" + aria-label="${a}" + >${r}</a + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return kn`<span class="issue-label">: ${t}${r}</span>`}(s,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(o),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=tr(p,"section").length+2;p.setAttribute("aria-level",g)}})),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(kn`<p>${ma.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${ma.issue_summary}</h1>`)}(s)}var ba=Object.freeze({__proto__:null,name:ha,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter((e=>e instanceof HTMLElement));if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map((e=>Number.parseInt(e.dataset.number,10))).filter((e=>e));if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return lr(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,ha),new Map;const s=await r.json();return new Map(Object.entries(s))}(e.github),{head:s}=document;s.insertBefore(kn`<style> + ${fa} + </style>`,s.querySelector("link")),ga(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const ya="core/best-practices",wa={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},va=Wn(wa),ka=o in wa?o:"en";var $a=Object.freeze({__proto__:null,name:ya,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=Kn(e,"bp"),s=kn`<a class="marker self-link" href="${`#${r}`}" + ><bdi lang="${ka}">${va.best_practice}${t+1}</bdi></a + >`;if(n){const t=kn`<li>${s}: ${sr(e)}</li>`;n.appendChild(t)}const o=e.closest("div");if(!o)return void e.classList.add("advisement");o.classList.add("advisement");const i=kn`${s.cloneNode(!0)}: ${e}`;o.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(kn`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){ur("Using best practices summary (#bp-summary) but no best practices found.",ya),t.remove()}}});const xa="core/figures",_a=Wn({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var Ca=Object.freeze({__proto__:null,name:xa,run:function(){const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;Kn(e,"fig",r),Xn(t,kn`<span class="fig-title"></span>`),t.prepend(kn`<a class="self-link" href="#${e.id}" + >${_a.fig}<bdi class="figno">${n+1}</bdi></a + >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Jn(e,"span").removeAttribute("href")})),kn`<li class="tofline"> + <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> + </li>`}(t.id,r));else{ur("Found a `<figure>` without a `<figcaption>`.",xa,{elements:[t]})}})),e}(),t=document.getElementById("tof");e.length&&t&&(!function(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=er(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(kn`<h1>${_a.list_of_figures}</h1>`,kn`<ul class="tof"> + ${e} + </ul>`))}});const Sa=Wn({en:{list_of_tables:"List of Tables",table:"Table "}});var Ra=Object.freeze({__proto__:null,name:"core/tables",run:function(){const e=function(){const e=[],t=document.querySelectorAll("table.numbered");return[...t].filter((e=>!!e.querySelector("caption"))).forEach(((t,n)=>{const r=t.querySelector("caption");!function(e,t,n){const r=t.textContent;Kn(e,"table",r),Xn(t,kn`<span class="table-title"></span>`),t.prepend(kn`<a class="self-link" href="#${e.id}" + >${Sa.table}<bdi class="tableno">${n+1}</bdi></a + >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);for(const e of n.querySelectorAll("a"))Jn(e,"span",{copyAttributes:!1});return kn`<li> + <a class="tocxref" href="${`#${e}`}" + >${n.childNodes}</a + > + </li>`}(t.id,r))})),e}(),t=document.querySelector("section#list-of-tables");e.length&&t&&(!function(e){if(e.matches(".appendix, .introductory")||e.closest("section"))return;const t=er(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(kn`<h1>${Sa.list_of_tables}</h1>`,kn`<ul class="list-of-tables"> + ${e} + </ul>`))}});const Ea=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function Aa(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return La(e,t,n);const r=`${n}()`;return La(e,t,r,n)}(e,n,t);default:return La(e,n,t)}}function La(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,s=Pa(n,t,e,r);if(0===s.length&&""!==t){n=`${t}.${n}`;const e=ea.get(n);e&&1===e.size&&(s=[...e],ta(s[0],[n]))}else n=e;if(s.length>1){lr(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:s})}if(s.length)return s[0]}}function Ta(e,t,n,r){if(!e.id){const t=n.toLowerCase(),s=t?`${t}-`:"";let o=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===o&&(o="the-empty-string",e.setAttribute("aria-label","the empty string")),e.id=`dom-${s}${o}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=Ia(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||Xn(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":!function(e,t){const{local:n,exportable:r}=t,s=e.dataset.lt?new Set(e.dataset.lt.split("|")):new Set;for(const e of r)s.add(e);n.filter((e=>s.has(e))).forEach((e=>s.delete(e))),e.dataset.lt=[...s].join("|"),e.dataset.localLt=n.join("|"),ta(e,[...n,...r])}(e,function(e,t,n){const{type:r}=e,s=`${t}.${n}`;switch(r){case"constructor":case"operation":{const t=`${n}()`,r=`${s}()`,o=function(e,t){const n=[];if(0===t.length)return n;const r=[],s=[];for(const{name:e,optional:n,variadic:o}of t)n||o?s.push(e):r.push(e);const o=r.join(", "),i=`${e}(${o})`;n.push(i);const a=s.map(((t,n)=>{const o=[...r,...s.slice(0,n+1)].join(", ");return`${e}(${o})`}));return n.push(...a),n}(n,e.arguments);return{local:[s,r,n],exportable:[t,...o]}}case"attribute":return{local:[s],exportable:[n]}}}(t,n,r))}return e}function Pa(e,t,n,r){const s=ea.get(e);if(!s||0===s.size)return[];const o=[...s],i=o.filter((e=>{if("dfn"===e.dataset.dfnType)return!1;const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t}));if(0===i.length&&""===t&&1===o.length)return o[0].textContent===n?o:[];if(Ea.has(r)&&o.length){const e=o.find((e=>e.textContent.trim()===n));if(e)return[e]}return i}function Ia(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(Ia).join("|"):Ia(t))}const Da=function(){const e=document.createElement("button");return e.innerHTML='<svg height="16" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg>',e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}();function Na(e){const t=e.closest("pre.idl").cloneNode(!0);t.querySelector(".idlHeader").remove();const{textContent:n}=t,r=Da.cloneNode(!0);r.addEventListener("click",(()=>{navigator.clipboard.writeText(n)})),e.append(r)}var ja=Object.freeze({__proto__:null,addCopyIDLButton:Na,name:"core/webidl-clipboard"});var Oa=String.raw`pre.idl{padding:1em;position:relative} +pre.idl>code{color:#000;color:var(--text,#000)} +@media print{ +pre.idl{white-space:pre-wrap} +} +.idlHeader{display:block;width:150px;background:#8ccbf2;background:var(--def-border,#8ccbf2);color:#fff;color:var(--defrow-border,#fff);font-family:sans-serif;font-weight:700;margin:-1em 0 1em -1em;height:28px;line-height:28px} +.idlHeader a.self-link{margin-left:.3cm;text-decoration:none;border-bottom:none;color:inherit} +.idlID{font-weight:700;color:#005a9c} +.idlType{color:#005a9c} +.idlName{color:#ff4500} +.idlName a{color:#ff4500;border-bottom:1px dotted #ff4500;text-decoration:none} +a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none} +.idlSuperclass{font-style:italic;color:#005a9c} +.idlDefaultValue,.idlParamName{font-style:italic} +.extAttr{color:#666} +.idlSectionComment{color:gray} +.idlIncludes a{font-weight:700} +.respec-button-copy-paste:focus{text-decoration:none;border-color:#51a7e8;outline:0;box-shadow:0 0 5px rgba(81,167,232,.5)} +.respec-button-copy-paste:is(:focus:hover,.selected:focus){border-color:#51a7e8} +.respec-button-copy-paste:is(:hover,:active,.zeroclipboard-is-hover,.zeroclipboard-is-active){text-decoration:none;background-color:#ddd;background-image:linear-gradient(#eee,#ddd);border-color:#ccc} +.respec-button-copy-paste:is(:active,.selected,.zeroclipboard-is-active){background-color:#dcdcdc;background-image:none;border-color:#b5b5b5;box-shadow:inset 0 2px 4px rgba(0,0,0,.15)} +.respec-button-copy-paste.selected:hover{background-color:#cfcfcf} +.respec-button-copy-paste:is(:disabled,:disabled:hover,.disabled,.disabled:hover){color:rgba(102,102,102,.5);cursor:default;background-color:rgba(229,229,229,.5);background-image:none;border-color:rgba(197,197,197,.5);box-shadow:none} +@media print{ +.respec-button-copy-paste{visibility:hidden} +}`;const za="core/webidl",Ma=za,qa={},Wa={},Ua={wrap:e=>e.flat().filter((e=>""!==e)).map((e=>"string"==typeof e?new Text(e):e)),trivia:e=>e.trim()?kn`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?kn`<a data-xref-type="interface" data-cite="WEBIDL">${e}</a>`:kn`<a data-xref-type="dfn" data-cite="WEBIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type)return e;let r="_IDL_",s=null;if("object"===t)r="interface",s="WEBIDL";return kn`<a + data-link-type="${"_IDL_"===r?"idl":r}" + data-xref-type="${r}" + data-cite="${s}" + data-lt="${undefined}" + >${e}</a + >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return kn`<span class="idlParamName">${e}</span>`;const r=Fa(e,t,n);if("enum-value"!==t.type){const e=n?"idlName":"idlID";r.classList.add(e)}return r},nameless(e,{data:t,parent:n}){switch(t.type){case"operation":case"constructor":return Fa(e,t,n);default:return e}},type:e=>kn`<span class="idlType">${e}</span>`,inheritance:e=>kn`<span class="idlSuperclass">${e}</span>`,definition(e,{data:t,parent:n}){const r=function(e){switch(e.type){case"callback interface":return"idlInterface";case"operation":return"idlMethod";case"field":return"idlMember";case"enum-value":return"idlEnumItem";case"callback function":return"idlCallback"}return`idl${e.type[0].toUpperCase()}${e.type.slice(1)}`}(t);switch(t.type){case"includes":case"enum-value":return kn`<span class="${r}">${e}</span>`}const s=n?n.name:"",{name:o,idlId:i}=Ha(t,s);return kn`<span + class="${r}" + id="${i}" + data-idl + data-title="${o}" + >${e}</span + >`},extendedAttribute:e=>kn`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>kn`<a data-xref-type="extended-attribute">${e}</a>`};function Fa(e,t,n){const r=n?n.name:"",{name:s}=Ha(t,r),o=Aa(t,s,{parent:r}),i=function(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}(t.type);if(o){t.partial||(o.matches("[data-noexport]")||(o.dataset.export=""),o.dataset.dfnType=i),Ta(o,t,r,s);const n=`#${o.id}`;return kn`<a + data-link-for="${r}" + data-link-type="${i}" + href="${n}" + class="internalDFN" + ><code>${e}</code></a + >`}const a="operation"===t.type&&"toJSON"===t.name&&t.extAttrs.some((({name:e})=>"Default"===e));if(a)return kn`<a data-link-type="dfn" data-lt="default toJSON steps" + >${e}</a + >`;if(!t.partial){const n=kn`<dfn data-export data-dfn-type="${i}" + >${e}</dfn + >`;return ta(n,[s]),Ta(n,t,r,s),n}const c=kn`<a + data-idl="${t.partial?"partial":null}" + data-link-type="${i}" + data-title="${t.name}" + data-xref-type="${i}" + >${e}</a + >`;if(s&&"typedef"!==t.type&&!(t.partial&&!o)){const e=gr`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;ur(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${s}()`:s}\` ${t.type}.`,Ma,{elements:[c],hint:e})}return c}const Ba=new WeakMap;function Ha(e,t=""){if(Ba.has(e))return Ba.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);const r=e.special&&""===e.name?"anonymous-":"";let s=function(e,t){if(!t)return`idl-def-${e.toLowerCase()}`;return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}(r+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":s+=function(e){if(!e.partial)return"";Wa[e.name]||(Wa[e.name]=0);return Wa[e.name]+=1,`-partial-${Wa[e.name]}`}(e);break;case"constructor":case"operation":{const r=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let s;qa[r]||(qa[r]=0);qa[n]?s=`!overload-${qa[n]}`:qa[n]=0;return qa[r]+=1,qa[n]+=1,s||""}(n,t);r?(n+=r,s+=r):e.arguments.length&&(s+=e.arguments.map((e=>`-${e.name.toLowerCase()}`)).join(""));break}}return{name:n,idlId:s}}(e,t);return Ba.set(e,n),n}const Va=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Ga(e,t){let n;try{n=Sn.parse(e.textContent,{sourceName:String(t)})}catch(t){return lr(`Failed to parse WebIDL: ${t.bareMessage}.`,Ma,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=Sn.write(n,{templates:Ua});kn.bind(e)`${r}`,Xn(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach((e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!Va.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&ta(e,[t])}));const s=e.closest("[data-cite], body"),{dataset:o}=s;if(o.cite||(o.cite="WEBIDL"),!/\bwebidl\b/i.test(o.cite)){const e=o.cite.trim().split(/\s+/);o.cite=["WEBIDL",...e].join(" ")}return Ya(e),n}function Ya(e){Yn(e,"webidl");const t=kn`<span class="idlHeader" + ><a class="self-link" href="${`#${e.id}`}">WebIDL</a></span + >`;e.prepend(t),Na(t)}var Ka=Object.freeze({__proto__:null,addIDLHeader:Ya,name:za,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=Oa,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Ga),r=Sn.validate(n);for(const t of r){let r=`<pre>${Mn(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${Mn(Sn.write(n[t.sourceName]))}</pre>`}lr(`WebIDL validation error: ${t.bareMessage}`,Ma,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const Za="core/data-cite",Ja="__SPEC__";async function Qa(e){const{key:t,frag:n,path:r,href:s}=e;let o="",i="";if(t===Ja)o=document.location.href;else{const e=await hi(t);if(!e)return null;o=e.href,i=e.title}if(s)o=s;else{if(r){const e=r.startsWith("/")?`.${r}`:r;o=new URL(e,o).href}n&&(o=new URL(n,o).href)}return{href:o,title:i}}function Xa(e,t,n){const{href:r,title:s}=t,o=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=s),t.href=r,o){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?Xn(e,t):(t.textContent=s,e.append(t)),o){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){lr("Exporting a linked external definition is not allowed.",Za,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function ec(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const tc=ec("#"),nc=ec("/");function rc(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:o}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:s,isNormative:o}=r?rc(r):{key:Ja,isNormative:!1};return t.cite=o?s:`?${s}`,t.citeFrag=n.replace("#",""),rc(e)}const i=r?`#${r}`:tc(n),a=s||nc(n).split("#")[0],{type:c}=Qn(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:i,path:a,href:o}}function sc(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach((e=>t.forEach((t=>e.removeAttribute(t)))))}var oc=Object.freeze({__proto__:null,THIS_SPEC:Ja,name:Za,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(rc).map((async e=>({entry:e,result:await hi(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await fi(n);r&&Object.assign(ci,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=rc(t),r=await Qa(n);if(r)Xa(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),ur(n,Za,{elements:[t]})}}vr("beforesave",sc)},toCiteDetails:rc});const ic="core/link-to-dfn",ac=[],cc={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"},cs:{duplicateMsg:e=>`Duplicitní definice '${e}'`,duplicateTitle:"Toto je v dokumentu definováno vícekrát."}},lc=Wn(cc);function uc(e){const t=new Map,n=[];for(const r of ea.get(e)){const{dfnType:s="dfn"}=r.dataset,o=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of o){if(t.has(i)&&t.get(i).has(s)){const e=t.get(i).get(s),o="dfn"===e.localName,a="dfn"===r.localName,c=s===(e.dataset.dfnType||"dfn"),l=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(o&&a&&c&&l){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(s,r),("idl"in r.dataset||"dfn"!==s)&&t.get(i).set("idl",r),Kn(r,"dfn",e)}}return{result:t,duplicates:n}}function dc(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Zn(e).reduce(((e,r)=>{const s=r.split(".");return 2===s.length&&e.push({for:s[0],title:s[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[]);return r}(e),r=n.find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!r)return;const s=t.get(r.title).get(r.for),{linkType:o}=e.dataset;if(o){for(const e of o.split("|"))if(s.get(e))return s.get(e);return s.get("dfn")}{const e=r.for?"idl":"dfn";return s.get(e)||s.get("idl")}}function pc(e,t,n){let r=!1;const{linkFor:s}=e.dataset,{dfnFor:o}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(s&&!n.get(s)&&o&&!o.split(",").map((e=>e.trim())).includes(s))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),s=fc(e)&&fc(t,n);r&&!s||Xn(e,document.createElement("code"))}(e,t),!r}function fc(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}return!1}function hc(e){e.forEach((e=>{ur(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,ic,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var mc=Object.freeze({__proto__:null,name:ic,possibleExternalLinks:ac,run:async function(e){const t=function(){const e=new ar;for(const t of ea.keys()){const{result:n,duplicates:r}=uc(t);e.set(t,n),r.length>0&&lr(lc.duplicateMsg(t),ic,{title:lc.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){ac.push(e);continue}const r=dc(e,t);if(r){pc(e,r,t)||ac.push(e)}else""===e.dataset.cite?n.push(e):ac.push(e)}hc(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,`$1${Ja}$2`);const{key:r,isNormative:s}=rc(t);r!==Ja&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||hc(ac)}});const gc="xrefs",bc=3e5;async function yc(){return await $n.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(gc,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function wc(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-t<bc)return!1;const r=new URL("meta/version",$c).href,s=await fetch(r);if(!s.ok)return!1;const o=await s.text();return localStorage.setItem(e,n.toString()),parseInt(o,10)>t}())return await async function(){try{await yc().then((e=>e.clear(gc)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await yc();let r=await e.transaction(gc).store.openCursor();for(;r;)n.has(r.key)&&t.set(r.key,r.value.result),r=await r.continue()}catch(e){console.error(e)}return t}const vc="core/xref",kc={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},$c="https://respec.org/xref/",xc=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Pn({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function _c(e){const t="xrefType"in e.dataset;let n=Cc(e);t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=n.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter((e=>e));if(r.length&&t.push(r),n===e)break;n=n.parentElement.closest("[data-cite]")}if(n!==e){const n=e.closest("section"),r=[...n?n.querySelectorAll("a.bibref"):[]].map((e=>e.textContent.toLowerCase()));r.length&&t.push(r)}const r=function(e){const t=[];for(const n of e){const e=t[t.length-1]||[],r=[...new Set(n)].filter((t=>!e.includes(t)));t.push(r.sort())}return t}(t);return r}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),o=function(e,t){if(e.dataset.xrefFor)return qn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return qn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof o&&{for:o}}}function Cc(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=qn(n),"the-empty-string"===n?"":n}function Sc(e,t,n,r){const{term:s,specs:o=[]}=t,{uri:i,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=o.flat().includes(c)?c:a,f=new URL(i,"https://partial");let{pathname:h}=f;"/"===h&&(h="");const m={cite:p,citePath:h,citeFrag:f.hash.slice(1),linkType:u};d&&(m.linkFor=d[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,s){const o=function(e){const t=e.closest(".normative"),n=e.closest(Tn);return!n||e===t||t&&n&&n.contains(t)}(e);if(!o)return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t):t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}xc.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function Rc(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Ec)}function Ec(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Ac(e){const t=e.querySelectorAll("a[data-xref-for], a[data-xref-type], a[data-link-for]"),n=["data-xref-for","data-xref-type","data-link-for"];t.forEach((e=>{n.forEach((t=>e.removeAttribute(t)))}))}var Lc=Object.freeze({__proto__:null,API_URL:$c,getTermFromElement:Cc,informativeRefsInNormative:xc,name:vc,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",$c).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in kc?Object.assign(n,{specs:kc[e.toLowerCase()]}):r(e);break;case"array":Object.assign(n,{specs:e});break;case"object":if(Object.assign(n,e),e.profile){const t=e.profile.toLowerCase();if(t in kc){const r=(e.specs??[]).concat(kc[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:lr(`Invalid value for \`xref\` configuration option. Received: "${e}".`,vc)}return n;function r(e){lr(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${zn(Object.keys(kc),(e=>`"${e}"`))}.`,vc)}}(e.xref);if(t.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(t.specs).join(" ")}const n=ac.concat(function(){const e=document.querySelectorAll(":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])"),t=document.querySelectorAll("dfn.externalDFN");return[...e].filter((e=>{if(""===e.textContent.trim())return!1;const t=e.closest("[data-cite]");return!t||""!==t.dataset.cite})).concat(...t)}());if(!n.length)return;const r=[];for(const e of n){const t=_c(e);t.id=await Rc(t),r.push(t)}const s=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),s=await wc(r),o=r.filter((e=>!s.get(e.id))),i=await async function(e,t){if(!e.length)return new Map;const n={method:"POST",body:JSON.stringify({queries:e}),headers:{"Content-Type":"application/json"}},r=await fetch(t,n),s=await r.json();return new Map(s.results.map((({id:e,result:t})=>[e,t])))}(o,t);i.size&&await async function(e,t){try{const n=(await yc()).transaction(gc,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(gc).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,i);return new Map([...s,...i])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let o=0,i=e.length;o<i;o++){if(e[o].closest("[data-no-xref]"))continue;const i=e[o],a=t[o],{id:c}=a,l=n.get(c);if(1===l.length)Sc(i,a,l[0],r);else{const e=s[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c).elems.push(i)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL($c);return r.searchParams.set("term",e),t.for&&r.searchParams.set("for",t.for),r.searchParams.set("types",t.types.join(",")),n.length&&r.searchParams.set("specs",n.join(",")),r.href},r=(e,t)=>gr`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:s}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],o=Cc(s[0]),i=n(o,e),a=On(t,(e=>`**[${e}]**`)),c=r(i,o);lr(`Couldn't find "**${o}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,vc,{title:"No matching definition found.",elements:s,hint:c})}for(const{query:t,elems:s,results:o}of e.values()){const e=[...new Set(o.map((e=>e.shortname)))].sort(),i=On(e,(e=>`**[${e}]**`)),a=Cc(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=r(c,a),d=gr`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${u}`;lr(`The term "**${a}**"${l} is ambiguous because it's defined in ${i}.`,vc,{title:"Definition is ambiguous.",elements:s,hint:d})}}(s)}(n,r,s,e),vr("beforesave",Ac)}});var Tc=String.raw`ul.index{columns:30ch;column-gap:1.5em} +ul.index li{list-style:inherit} +ul.index li span{color:inherit;cursor:pointer;white-space:normal} +#index-defined-here ul.index li{font-size:.9rem} +ul.index code{color:inherit} +#index-defined-here .print-only{display:none} +@media print{ +#index-defined-here .print-only{display:initial} +}`;const Pc=Wn({en:{heading:"Index",headingExternal:"Terms defined by reference",headingLocal:"Terms defined by this specification",dfnOf:"definition of",definesFollowing:"defines the following:"},cs:{heading:"Glosář",headingExternal:"Termíny definované odkazem",headingLocal:"Termíny definované touto specifikací",dfnOf:"definice",definesFollowing:"definuje následující:"},de:{heading:"Index",headingExternal:"Begriffe, die durch Verweis definiert sind",headingLocal:"Begriffe, die in dieser Spezifikation definiert sind",dfnOf:"Definition von",definesFollowing:"definiert Folgendes:"},es:{heading:"Índice",headingExternal:"Términos definidos por referencia",headingLocal:"Términos definidos por esta especificación",dfnOf:"definición de",definesFollowing:"define lo siguiente:"},ja:{heading:"索引",headingExternal:"参照によって定義された用語",headingLocal:"この仕様で定義された用語",dfnOf:"の定義",definesFollowing:"以下を定義します:"},ko:{heading:"색인",headingExternal:"참조로 정의된 용어",headingLocal:"이 명세서에서 정의된 용어",dfnOf:"정의",definesFollowing:"다음을 정의합니다:"},nl:{heading:"Index",headingExternal:"Termen gedefinieerd door verwijzing",headingLocal:"Termen gedefinieerd door deze specificatie",dfnOf:"definitie van",definesFollowing:"definieert het volgende:"},zh:{heading:"索引",headingExternal:"通过引用定义的术语",headingLocal:"由本规范定义的术语",dfnOf:"的定义",definesFollowing:"定义以下内容:"}}),Ic=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Dc(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Nc(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function jc(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${Nc(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${Nc(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${Nc(e)}</code>`;default:return""}}function Oc(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.append((e=>{const t=`§${document.getElementById(e).closest("section:not(.notoc)").querySelector(".secno").textContent.trim()}`;return kn`<span class="print-only">${t}</span>`})(e.dataset.id))))}function zc(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const{cite:n,citeFrag:s,xrefType:o,linkType:i}=r.dataset;if(!(o||i||n.includes("#")||s))continue;const a=r.href;if(e.has(a))continue;const{linkType:c,linkFor:l}=r.dataset,u=Cc(r);if(!u)continue;const d=rc(r).key.toUpperCase();(t.get(d)||t.set(d,[]).get(d)).push({term:u,type:c,linkFor:l,elem:r}),e.add(a)}return t}function Mc(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=Mn(t);Ic.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`<code>${s}</code>`);const o=Wc.has(t)?"type":qc.get(n);o&&(s+=` ${o}`);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return kn`<li> + <span class="index-term" data-href="${t.href}">${{html:n}}</span> + </li>`}const qc=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Wc=new Set(["boolean","byte","octet","short","unsigned short","long","unsigned long","long long","unsigned long long","float","unrestricted float","double","unrestricted double","undefined","any","object","symbol"]);function Uc(e){e.querySelectorAll("#index-defined-elsewhere li[data-spec]").forEach((e=>e.removeAttribute("data-spec"))),e.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.removeAttribute("data-id")))}var Fc=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void vr("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=Tc,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(kn`<h1>${Pc.heading}</h1>`);const n=kn`<section id="index-defined-here"> + <h3>${Pc.headingLocal}</h3> + ${function(){const e=function(){const e=new Map,t=document.querySelectorAll("dfn:not([data-cite])");for(const n of t){if(!n.id)continue;const t=qn(n.textContent);(e.get(t)||e.set(t,[]).get(t)).push(n)}const n=[...e].sort((([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/)))));return n}();return kn`<ul class="index"> + ${e.map((([e,t])=>function(e,t){const n=(e,t,n)=>{const r=`#${e.id}`;return kn`<li data-id=${e.id}> + <a class="index-term" href="${r}">${{html:t}}</a> ${n?{html:n}:""} + </li>`};if(1===t.length){const r=t[0],s=Dc(r),o=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(Ic.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,s,e),i=jc(r,s,e);return n(r,o,i)}return kn`<li> + ${e} + <ul> + ${t.map((t=>{const r=jc(t,Dc(t),e)||Pc.dfnOf;return n(t,r)}))} + </ul> + </li>`}(e,t)))} + </ul>`}()} + </section>`;e.append(n);const r=kn`<section id="index-defined-elsewhere"> + <h3>${Pc.headingExternal}</h3> + ${function(){const e=[...zc().entries()].sort((([e],[t])=>e.localeCompare(t))),t=document.querySelector("section#index"),n=!!t?.classList.contains("prefer-full-spec-title");return kn`<ul class="index"> + ${e.map((([e,t])=>{let r;return r=n&&ci[e]?.title?xi(e,ci[e].title):xi(e),kn`<li data-spec="${e}"> + ${r} ${Pc.definesFollowing} + <ul> + ${t.sort(((e,t)=>e.term.localeCompare(t.term))).map(Mc)} + </ul> + </li>`}))} + </ul>`}()} + </section>`;e.append(r);for(const e of r.querySelectorAll(".index-term"))Kn(e,"index-term");vr("toc",Oc,{once:!0}),vr("beforesave",Uc)}});const Bc="core/contrib";var Hc=Object.freeze({__proto__:null,name:Bc,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void lr(gr`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Bc)}const t=e.editors.map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await s();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void kn(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=On(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await Hn(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter((t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]")))}catch(e){return lr("Error loading contributors from GitHub.",Bc,{cause:e}),null}}}(t,n)}});var Vc=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map((e=>e.querySelector("h1, h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Jn(e,`h${t}`)}))}});var Gc=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map((e=>`h${e}:first-child`)).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.idl:not(.exclude) > code")).filter((e=>!e.closest(Tn)));if(0===n.length){const t="This specification doesn't normatively declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map((e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t})).forEach((e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)})),r.querySelectorAll("*[id]").forEach((e=>e.removeAttribute("id"))),e.appendChild(r),Xn(r,document.createElement("code")),Ya(r)}});const Yc=["h2","h3","h4","h5","h6"],Kc="core/structure",Zc=Wn({en:{toc:"Table of Contents",back_to_top:"Back to Top"},zh:{toc:"内容大纲",back_to_top:"返回顶部"},ko:{toc:"목차",back_to_top:"맨 위로"},ja:{toc:"目次",back_to_top:"先頭に戻る"},nl:{toc:"Inhoudsopgave",back_to_top:"Terug naar boven"},es:{toc:"Tabla de Contenidos",back_to_top:"Volver arriba"},de:{toc:"Inhaltsverzeichnis",back_to_top:"Zurück nach oben"},cs:{toc:"Obsah",back_to_top:"Zpět na začátek"}});function Jc(e,t,{prefix:n=""}={}){let r=!1,s=0,o=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=kn`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(s=o,r=!0);let e=a.isIntro?"":r?Qc(o-s+1):n+o;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(o+=1,a.header.prepend(kn`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=el(a.header,n),s=Jc(a.subsections,t,{prefix:e});s&&r.append(s),i.append(r)}}return i}function Qc(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Xc(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Yc.includes(r.localName))continue;const s=r.textContent;Kn(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Xc(e)})}return n}function el(e,t){const n=kn`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Jn(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Jn(e,"span").removeAttribute("id")})),kn`<li class="tocline">${n}</li>`}var tl=Object.freeze({__proto__:null,name:Kc,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter((e=>!e.closest("section.introductory")));if(!e.length)return;e.forEach((e=>{const t=`h${Math.min(tr(e,"section").length+1,6)}`;e.localName!==t&&Jn(e,t)}))}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){lr("`data-max-toc` must have a value between 0-6 (inclusive).",Kc,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},(()=>"section")).join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Jc(Xc(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=kn`<nav id="toc"></nav>`,n=kn`<h2 class="introductory">${Zc.toc}</h2>`;Kn(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const s=kn`<p role="navigation" id="back-to-top"> + <a href="#title"><abbr title="${Zc.back_to_top}">↑</abbr></a> + </p>`;document.body.append(s)}(t)}wr("toc")}});const nl=Wn({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"},cs:{informative:"Tato sekce není normativní."}});var rl=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map((e=>e.querySelector("h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{e.after(kn`<p><em>${nl.informative}</em></p>`)}))}});const sl=Wn({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${qn(t.textContent)}`),n}}});var ol=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(Kn(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=sl.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),s=kn`<div class="header-wrapper"></div>`;n.replaceWith(s);const o=kn`<a + href="#${t}" + class="self-link" + aria-label="${r}" + ></a>`;s.append(n,o)}}});var il=String.raw`.caniuse-stats{display:flex;column-gap:2em} +.caniuse-group{display:flex;flex:1;flex-direction:column;justify-content:flex-end;flex-basis:auto} +.caniuse-browsers{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;margin-top:.2em;column-gap:.4em;border-bottom:1px solid #ccc;row-gap:.4em;padding-bottom:.4cm} +.caniuse-type{align-self:center;border-top:none;text-transform:capitalize;font-size:.8em;margin-top:-.8em;font-weight:700} +.caniuse-type span{background-color:var(--bg,#fff);padding:0 .4em} +.caniuse-cell{align-items:center;border-radius:1cm;color:#fff;display:flex;font-size:90%;min-width:1.5cm;padding:.3rem;justify-content:space-evenly;--supported:#2a8436dd;--no-support:#c44230dd;--no-support-alt:#b43b2bdd;--partial:#807301dd;--partial-alt:#746c00dd;--unknown:#757575;background:repeating-linear-gradient(var(--caniuse-angle,45deg),var(--caniuse-bg) 0,var(--caniuse-bg-alt) 1px,var(--caniuse-bg-alt) .4em,var(--caniuse-bg) calc(.25em + 1px),var(--caniuse-bg) .75em)} +img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0} +.caniuse-cell span.browser-version{margin-left:.4em;text-shadow:0 0 .1em #fff;font-weight:100;font-size:.9em} +.caniuse-stats a[href]{white-space:nowrap;align-self:flex-end} +.caniuse-cell.y{background:var(--supported)} +.caniuse-cell:is(.n,.d){--caniuse-angle:45deg;--caniuse-bg:var(--no-support);--caniuse-bg-alt:var(--no-support-alt)} +.caniuse-cell.u{background:var(--unknown)} +.caniuse-cell.d{--caniuse-angle:180deg} +.caniuse-cell:is(.a,.x,.p){--caniuse-angle:90deg;--caniuse-bg:var(--partial);--caniuse-bg-alt:var(--partial-alt)} +@media print{ +.caniuse-cell.y::before{content:"✔️";padding:.5em} +.caniuse-cell.n::before{content:"❌";padding:.5em} +.caniuse-cell:is(.a,.d,.p,.x,.u)::before{content:"⚠️";padding:.5em} +}`;const al="core/caniuse",cl="https://respec.org/caniuse/",ll=new Map([["and_chr",{name:"Android Chrome",path:"chrome",type:"mobile"}],["and_ff",{name:"Android Firefox",path:"firefox",type:"mobile"}],["and_uc",{name:"Android UC",path:"uc",type:"mobile"}],["chrome",{name:"Chrome",type:"desktop"}],["edge",{name:"Edge",type:"desktop"}],["firefox",{name:"Firefox",type:"desktop"}],["ios_saf",{name:"iOS Safari",path:"safari-ios",type:"mobile"}],["op_mob",{name:"Opera Mobile",path:"opera",type:"mobile"}],["opera",{name:"Opera",type:"desktop"}],["safari",{name:"Safari",type:"desktop"}],["samsung",{name:"Samsung Internet",path:"samsung-internet",type:"mobile"}]]),ul=new Map([["a","almost supported (aka Partial support)"],["d","disabled by default"],["n","no support, or disabled by default"],["p","no support, but has Polyfill"],["u","unknown support"],["x","requires prefix to work"],["y","supported by default"]]);var dl=Object.freeze({__proto__:null,BROWSERS:ll,name:al,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set(ll.keys());t.delete("op_mob"),t.delete("opera");const n={removeOnSave:!0,browsers:[...t]};if("string"==typeof e.caniuse)return void(e.caniuse={feature:e.caniuse,...n});e.caniuse={...n,...e.caniuse}}(e),function({caniuse:e}){const{browsers:t}=e,n=t.filter((e=>!ll.has(e)));if(n.length){ur(gr`Invalid browser(s): (${hr(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,al)}}(e);const t=e.caniuse;t.feature&&document.head.appendChild(kn`<style + id="caniuse-stylesheet" + class="${t.removeOnSave?"removeOnSave":""}" + > + ${il} + </style>`)},run:async function(e){const t=e.caniuse;if(!t?.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,r=document.querySelector(".head dl"),s=async function(e){const{feature:t,browsers:n,apiURL:r}=e,s=new URL(r||`./${t}`,cl);n.forEach((e=>s.searchParams.append("browsers",e)));const o=await fetch(s);if(!o.ok){const{status:e,statusText:t}=o;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return o.json()}(e.caniuse).then((e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),s=function(e){return(t,{browser:n,version:r,caniuse:s})=>{const{name:o,type:i}=ll.get(n),a=`${o}${r?` version ${r}`:""}`,c=ul.get(s),l=`${e} is ${c} since ${a} on ${i}.`,u=`caniuse-cell ${s}`,d=(p=`${c} since ${a}.`).charAt(0).toUpperCase()+p.slice(1);var p;const f=r||"—",h=function(e){const t=ll.get(e).path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),m=kn` + <div class="${u}" title="${d}" aria-label="${l}"> + <img + class="caniuse-browser" + width="20" + height="20" + src="${h}" + alt="${o} logo" + /><span class="browser-version">${f}</span> + </div> + `;return t.get(i).push(m),t}}(t);n.reduce(s,r);const o=[...r].filter((([,e])=>e.length)).map((([e,t])=>kn`<div class="caniuse-group"> + <div class="caniuse-browsers">${t}</div> + <div class="caniuse-type"><span>${e}</div> + </div>`));return o.push(kn`<a class="caniuse-cell" href="https://caniuse.com/${t}" + >More info</a + >`),o}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,s=gr`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return lr(r,al,{hint:s,cause:e}),kn`<a href="${n}">caniuse.com</a>`}(e,t,n))),o=kn`<dt class="caniuse-title">Browser support:</dt> + <dd class="caniuse-stats"> + ${{any:s,placeholder:"Fetching data from caniuse.com..."}} + </dd>`;r.append(...o.childNodes),await s,wr("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(r.querySelectorAll(".caniuse-browser").forEach((e=>e.classList.add("removeOnSave"))),vr("beforesave",(e=>{kn.bind(e.querySelector(".caniuse-stats"))` + <a href="${n}">caniuse.com</a>`})))}});var pl=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3rem} +.mdn details{width:100%;margin:1px 0;position:relative;z-index:10;box-sizing:border-box;padding:.4em;padding-top:0} +.mdn details[open]{min-width:25ch;max-width:32ch;background:#fff;background:var(--indextable-hover-bg,#fff);color:#000;color:var(--indextable-hover-text,#000);box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);box-shadow:0 1em 3em -.4em var(--tocsidebar-shadow,rgba(0,0,0,.3)),0 0 1px 1px var(--tocsidebar-shadow,rgba(0,0,0,.05));border-radius:2px;z-index:11;margin-bottom:.4em} +.mdn summary{text-align:right;cursor:default;margin-right:-.4em} +.mdn summary span{font-family:zillaslab,Palatino,"Palatino Linotype",serif;color:#fff;color:var(--bg,#fff);background-color:#000;background-color:var(--text,#000);display:inline-block;padding:3px} +.mdn a{display:inline-block;word-break:break-all} +.mdn p{margin:0} +.mdn .engines-all{color:#058b00} +.mdn .engines-some{color:#b00} +.mdn table{width:100%;font-size:.9em} +.mdn td{border:none} +.mdn td:nth-child(2){text-align:right} +.mdn .nosupportdata{font-style:italic;margin:0} +.mdn tr::before{content:"";display:table-cell;width:1.5em;height:1.5em;background:no-repeat center center/contain;font-size:.75em} +.mdn .no,.mdn .unknown{color:#ccc;filter:grayscale(100%)} +.mdn .no::before,.mdn .unknown::before{opacity:.5} +.mdn .chrome::before,.mdn .chrome_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/chrome/chrome.svg)} +.mdn .edge::before,.mdn .edge_mobile::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/edge/edge.svg)} +.mdn .firefox::before,.mdn .firefox_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/firefox/firefox.svg)} +.mdn .opera::before,.mdn .opera_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/opera/opera.svg)} +.mdn .safari::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/safari/safari.svg)} +.mdn .safari_ios::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg)} +.mdn .samsunginternet_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg)} +.mdn .webview_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/android-webview/android-webview.png)}`;const fl="core/mdn-annotation",hl="https://w3c.github.io/mdn-spec-links/",ml="https://developer.mozilla.org/en-US/docs/Web/",gl={chrome:"Chrome",chrome_android:"Chrome Android",edge:"Edge",edge_mobile:"Edge Mobile",firefox:"Firefox",firefox_android:"Firefox Android",opera:"Opera",opera_android:"Opera Android",safari:"Safari",safari_ios:"Safari iOS",samsunginternet_android:"Samsung Internet",webview_android:"WebView Android"},bl=Wn({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"所有主要引擎均支持此特性。",inSomeEngines:"此功能支持有限。"},cs:{inAllEngines:"Tato funkce je podporována ve všech hlavních prohlížečích.",inSomeEngines:"Tato funkce má omezenou podporu."}});function yl(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=kn`<aside class="mdn"></aside>`;return t.before(r),r}function wl(e){const{name:t,slug:n,summary:r,support:s,engines:o}=e,i=n.slice(n.indexOf("/")+1),a=`${ml}${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return kn`<span title="${bl.inAllEngines}">✅</span>`;if(e.length<2)return kn`<span title="${bl.inSomeEngines}">🚫</span>`;return kn`<span> </span>`}(o);return kn`<details> + <summary aria-label="${c}"><span>MDN</span>${l}</summary> + <a title="${r}" href="${a}">${i}</a> + ${function(e){if(3===e.length)return kn`<p class="engines-all">${bl.inAllEngines}</p>`;if(e.length<2)return kn`<p class="engines-some">${bl.inSomeEngines}</p>`}(o)} + ${s?function(e){function t(e,t,n){const r="Unknown"===t?"?":t,s=`${e} ${t.toLowerCase()}`;return kn`<tr class="${s}"> + <td>${gl[e]}</td> + <td>${n||r}</td> + </tr>`}function n(e,n){if(n.version_removed)return t(e,"No","");const r=n.version_added;return"boolean"==typeof r?t(e,r?"Yes":"No",""):r?t(e,"Yes",`${r}+`):t(e,"Unknown","")}return kn`<table> + ${Object.keys(gl).map((r=>e[r]?n(r,e[r]):t(r,"Unknown","")))} + </table>`}(s):kn`<p class="nosupportdata">No support data.</p>`} + </details>`}var vl=Object.freeze({__proto__:null,name:fl,run:async function(e){const t=function(e){const{shortName:t,mdn:n}=e;if(!n)return;return"string"==typeof n?n:n.key||t}(e);if(!t)return;const n=await async function(e,t){const{baseJsonPath:n=hl,maxAge:r=864e5}=t,s=new URL(`${e}.json`,n).href,o=await Hn(s,r);if(404===o.status){return void lr(`Could not find MDN data associated with key "${e}".`,fl,{hint:"Please add a valid key to `respecConfig.mdn`"})}return await o.json()}(t,e.mdn);if(!n)return;const r=document.createElement("style");r.textContent=pl,document.head.append(r);for(const e of function(e){return[...document.body.querySelectorAll("[id]:not(script)")].filter((({id:t})=>Array.isArray(e[t])))}(n)){const t=n[e.id],r=yl(e);if(r)for(const e of t)r.append(wl(e))}}});const kl="ui/save-html",$l=Wn({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),xl=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return xr(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return xr(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];var _l=Object.freeze({__proto__:null,exportDocument:function(e,t){return ur("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",kl,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),xr(t)},name:kl,run:function(e){const t={async show(t){await document.respec.ready;const n=kn`<div class="respec-save-buttons"> + ${xl.map((t=>function(e,t){const{id:n,href:r,ext:s,title:o,type:i}=e,a=Fn(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return kn`<a + href="${r}" + id="${n}" + download="${c}.${s}" + type="${i}" + class="respec-save-button" + onclick=${()=>es.closeModal()} + >${o}</a + >`}(t,e)))} + </div>`;es.freshModal($l.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=es.addCommand($l.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Cl="https://respec.org/specref/",Sl=Wn({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"},cs:{search_specref:"Hledat ve Specref"}}),Rl=es.addCommand(Sl.search_specref,(function(){const e=kn` + <iframe class="respec-iframe" src="${Cl}" onload=${e=>e.target.classList.add("ready")}></iframe> + <a href="${Cl}" target="_blank">Open Search UI in a new tab</a> + `;es.freshModal(Sl.search_specref,e,Rl)}),"Ctrl+Shift+Alt+space","🔎");var El=Object.freeze({__proto__:null});const Al="https://respec.org/xref/",Ll=Wn({en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"},cs:{title:"Hledat definice"}}),Tl=es.addCommand(Ll.title,(function(){const e=kn` + <iframe class="respec-iframe" src="${Al}" onload="${e=>e.target.classList.add("ready")}"></iframe> + <a href="${Al}" target="_blank">Open Search UI in a new tab</a> + `;es.freshModal(Ll.title,e,Tl)}),"Ctrl+Shift+Alt+x","📚");var Pl=Object.freeze({__proto__:null});const Il=Wn({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"},cs:{about_respec:"O aplikaci"}});window.respecVersion=window.respecVersion||"Developer Edition";const Dl=document.createElement("div"),Nl=kn.bind(Dl),jl=es.addCommand(`${Il.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(Ol).forEach((t=>{e.push(t)}));Nl` + <p> + ReSpec is a document production toolchain, with a notable focus on W3C specifications. + </p> + <p> + <a href='https://respec.org/docs'>Documentation</a>, + <a href='https://github.com/speced/respec/issues'>Bugs</a>. + </p> + <table border="1" width="100%" hidden="${!e.length}"> + <caption> + Loaded plugins + </caption> + <thead> + <tr> + <th> + Plugin Name + </th> + <th> + Processing time + </th> + </tr> + </thead> + <tbody>${e}</tbody> + </table> +`,es.freshModal(`${Il.about_respec} - ${window.respecVersion}`,Dl,jl)}),"Ctrl+Shift+Alt+A","ℹ️");function Ol({name:e,duration:t}){return kn` + <tr> + <td><a href="${`https://github.com/speced/respec/blob/develop/src/${e}.js`}">${e}</a></td> + <td>${t}</td> + </tr> + `}var zl=Object.freeze({__proto__:null});var Ml=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=kn`<meta + name="revision" + content="${e.gitRevision}" + />`;document.head.appendChild(t)}const t=document.querySelector("#abstract p:first-of-type");if(!t)return;const n=t.textContent.replace(/\s+/," ").trim(),r=document.createElement("meta");r.name="description",r.content=n,document.head.appendChild(r)}});const ql="w3c/seo",Wl={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",RSCND:"w3p:RSCND"},Ul=new Set([...Os,...zs,...Ms,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Fl({name:e,url:t,mailto:n,company:r,companyURL:s}){const o={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||s)&&(o.worksFor={name:r,url:s}),o}function Bl(e){const{href:t,title:n,href:r}=e,s={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(s.creator=e.authors.map((e=>({name:e})))),e.rawDate&&(s.publishedDate=e.rawDate),e.isbn&&(s.identifier=e.isbn),e.publisher&&(s.publisher={name:e.publisher}),s}var Hl=Object.freeze({__proto__:null,name:ql,requiresCanonicalLink:Ul,run:async function(e){if((e.canonicalURI||Ul.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{ur("Canonical URI set to edDraft, but no edDraftURI is set in configuration",ql),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{ur("Canonical URI set to TR, but no shortName is set in configuration",ql),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=kn`<link rel="canonical" href="${e.canonicalURI}" />`;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Wl[e.specStatus],r=["TechArticle"];n&&r.push(n);const s={"@context":["http://schema.org",{"@vocab":"http://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:r,name:document.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo?.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];s.copyrightHolder=[s.copyrightHolder,...t.map((e=>({name:e})))]}const o=t.head.querySelector("meta[name=description]");o&&(s.description=o.content);e.editors&&(s.editor=e.editors.map(Fl));e.authors&&(s.contributor=e.authors.map(Fl));const i=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(i.map((e=>hi(e))));s.citation=a.filter((e=>"object"==typeof e)).map(Bl);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(s,null,2),t.head.appendChild(c)}(e,document)}}});var Vl=String.raw`.hljs{--base:#fafafa;--mono-1:#383a42;--mono-2:#686b77;--mono-3:#717277;--hue-1:#0b76c5;--hue-2:#336ae3;--hue-3:#a626a4;--hue-4:#42803c;--hue-5:#ca4706;--hue-5-2:#c91243;--hue-6:#986801;--hue-6-2:#9a6a01} +@media (prefers-color-scheme:dark){ +.hljs{--base:#282c34;--mono-1:#abb2bf;--mono-2:#818896;--mono-3:#5c6370;--hue-1:#56b6c2;--hue-2:#61aeee;--hue-3:#c678dd;--hue-4:#98c379;--hue-5:#e06c75;--hue-5-2:#be5046;--hue-6:#d19a66;--hue-6-2:#e6c07b} +} +.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;color:var(--mono-1,#383a42);background:#fafafa;background:var(--base,#fafafa)} +.hljs-comment,.hljs-quote{color:#717277;color:var(--mono-3,#717277);font-style:italic} +.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4;color:var(--hue-3,#a626a4)} +.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#ca4706;color:var(--hue-5,#ca4706);font-weight:700} +.hljs-literal{color:#0b76c5;color:var(--hue-1,#0b76c5)} +.hljs-addition,.hljs-attribute,.hljs-meta-string,.hljs-regexp,.hljs-string{color:#42803c;color:var(--hue-4,#42803c)} +.hljs-built_in,.hljs-class .hljs-title{color:#9a6a01;color:var(--hue-6-2,#9a6a01)} +.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801;color:var(--hue-6,#986801)} +.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3;color:var(--hue-2,#336ae3)} +.hljs-emphasis{font-style:italic} +.hljs-strong{font-weight:700} +.hljs-link{text-decoration:underline}`;async function Gl(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href));return await n.text()}const Yl=Pn({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Yl);const Kl=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return Pd}))).default}catch{return Gl("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",Kl.then((e=>({worker:e}))));const Zl=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Jl(e){e.setAttribute("aria-busy","true");const t=(n=e.classList,Array.from(n).filter((e=>"highlight"!==e&&"nolinks"!==e)).map((e=>e.toLowerCase())));var n;let r;try{r=await async function(e,t){const n={action:"highlight",code:e,id:Zl(),languages:t},r=await Kl;return r.postMessage(n),new Promise(((e,t)=>{const s=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(o){const{data:{id:i,language:a,value:c}}=o;i===n.id&&(r.removeEventListener("message",t),clearTimeout(s),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:s,value:o}=r;switch(e.localName){case"pre":e.classList.remove(s),e.innerHTML=`<code class="hljs${s?` ${s}`:""}">${o}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=o,e.classList.add("hljs"),s&&e.classList.add(s)}e.setAttribute("aria-busy","false")}var Ql=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n ")].filter((e=>"pre"!==e.localName||!e.querySelector("code")));if(!t.length)return;const n=t.filter((e=>e.textContent.trim())).map(Jl);document.head.appendChild(kn`<style> + ${Vl} + </style>`),await Promise.all(n)}});const Xl=Wn({en:{missing_test_suite_uri:gr`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:gr`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:gr`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:gr`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),eu="core/data-tests";function tu(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[s]=r;if(r.find((e=>"https"===e))){const e=document.createElement("span");e.textContent="🔒",e.setAttribute("aria-label","requires a secure connection"),e.setAttribute("title","Test requires HTTPS"),s=s.replace(".https",""),t.push(e)}if(s.split(".").join("-").split("-").find((e=>"manual"===e))){const e=document.createElement("span");e.textContent="💪",e.setAttribute("aria-label","the test must be run manually"),e.setAttribute("title","Manual test"),s=s.replace("-manual",""),t.push(e)}return kn` + <li> + <a href="${e}">${s}</a> + ${t} + </li> + `}function nu(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{ur(gr`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,eu,{elements:[n]})}})).filter((e=>e))}function ru(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=gr`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=gr`To fix, remove duplicates from ${"[data-tests]"}: ${hr(n,{quotes:!0})}.`;ur(e,eu,{hint:r,elements:[t]})}}function su(e){const t=[...new Set(e)];return kn` + <details class="respec-tests-details removeOnSave"> + <summary>tests: ${t.length}</summary> + <ul> + ${t.map(tu)} + </ul> + </details> + `}var ou=Object.freeze({__proto__:null,name:eu,run:function(e){const t=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));if(t.length)if(e.testSuiteURI)for(const n of t){const t=nu(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);ru(t,n);const r=su(t);n.append(r)}else lr(Xl.missing_test_suite_uri,eu)}});const iu="core/list-sorter";function au(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function cu(e,t){return[...e.querySelectorAll(":scope > li")].sort(au(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function lu(e,t){return[...e.querySelectorAll(":scope > dt")].sort(au(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,s=document.createDocumentFragment();let{nextSibling:o}=t;for(;o&&o.nextSibling;){s.appendChild(o.cloneNode(!0));const{nodeType:e,nodeName:t}=o.nextSibling;if(e===n&&t===r)break;o=o.nextSibling}return s.prepend(t.cloneNode(!0)),e.appendChild(s),e}),document.createDocumentFragment())}var uu=Object.freeze({__proto__:null,name:iu,run:function(){const e=document.querySelectorAll("[data-sort]");for(const t of e){let e;const n=t.dataset.sort||"ascending";switch(t.localName){case"dl":e=lu(t,n);break;case"ol":case"ul":e=cu(t,n);break;default:ur(`ReSpec can't sort ${t.localName} elements.`,iu,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:lu,sortListItems:cu});var du=String.raw`var:hover{text-decoration:underline;cursor:pointer} +var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)} +@media (prefers-color-scheme:dark){ +var.respec-hl{filter:saturate(.9) brightness(.9)} +} +var.respec-hl-c1{--bg-color:#f4d200} +var.respec-hl-c2{--bg-color:#ff87a2} +var.respec-hl-c3{--bg-color:#96e885} +var.respec-hl-c4{--bg-color:#3eeed2} +var.respec-hl-c5{--bg-color:#eacfb6} +var.respec-hl-c6{--bg-color:#82ddff} +var.respec-hl-c7{--bg-color:#ffbcf2} +@media print{ +var.respec-hl{background:0 0;color:#000;box-shadow:unset} +}`;var pu=Object.freeze({__proto__:null,name:"core/highlight-vars",run:async function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=du,document.head.appendChild(t);const n=document.createElement("script");n.id="respec-highlight-vars",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return Id}))).default}catch{return Gl("./src/core/highlight-vars.runtime.js")}}(),document.body.append(n),vr("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach((e=>{const t=[...e.classList.values()].filter((e=>e.startsWith("respec-hl")));e.classList.remove(...t),e.classList.length||e.removeAttribute("class")}))}))}});var fu=String.raw`var{position:relative;cursor:pointer} +var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none} +var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#222} +var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#222;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400} +var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var hu=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=fu,document.head.appendChild(t);let n=null;const r=new Map,s=document.querySelectorAll("section var");for(const e of s){const t=e.closest("section");if(n!==t&&(n=t,r.clear()),e.dataset.type){r.set(e.textContent.trim(),e.dataset.type);continue}const s=r.get(e.textContent.trim());s&&(e.dataset.type=s)}}});var mu=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black} +.assert{border-left:.5em solid #aaa;padding:.3em;border-color:#aaa;border-color:var(--assertion-border);background:#eee;background:var(--assertion-bg);color:#000;color:var(--assertion-text)} +@media (prefers-color-scheme:dark){ +:root{--assertion-border:#444;--assertion-bg:var(--borderedblock-bg);--assertion-text:var(--text)} +}`;var gu=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter((e=>e.textContent.trim().startsWith("Assert: ")));if(!e.length)return;for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(kn`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=mu,document.head.appendChild(t)}});const bu="core/anchor-expander";function yu(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void lr(`Found matching element "${t}", but it has no title or marker.`,bu,{title:"Missing title.",elements:[n]})}const s=sr(r);n.append(...s.childNodes),n.classList.add("box-ref")}function wu(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void lr(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,bu,{title:"Missing figcaption in referenced figure.",elements:[n]})}const s=[...sr(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...s),n.classList.add("fig-ref");const o=r.querySelector(".fig-title");!n.hasAttribute("title")&&o&&(n.title=qn(o.textContent))}function vu(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void lr(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,bu,{title:"Missing caption in referenced table.",elements:[n]})}const s=[...sr(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...s),n.classList.add("table-ref");const o=r.querySelector(".table-title");!n.hasAttribute("title")&&o&&(n.title=qn(o.textContent))}function ku(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)$u(r,n),xu(r,n);else{n.textContent=n.getAttribute("href");lr("Found matching section, but the section was lacking a heading element.",bu,{title:`No matching id in document: "${t}".`,elements:[n]})}}function $u(e,t){const n=e.querySelector(".self-link"),r=[...sr(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Jn(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function xu(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const s=t.closest(`[${n}]`);s&&s.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var _u=Object.freeze({__proto__:null,name:bu,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter((e=>""===e.textContent.trim()));for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":$u(n,t);break;case"section":ku(n,e,t);break;case"figure":wu(n,e,t);break;case"table":vu(n,e,t);break;case"aside":case"div":yu(n,e,t);break;default:t.textContent=t.getAttribute("href");lr("ReSpec doesn't support expanding this kind of reference.",bu,{title:`Can't expand "#${e}".`,elements:[t]})}xu(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");lr(`Couldn't expand inline reference. The id "${e}" is not in the document.`,bu,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Cu=String.raw`dfn{cursor:pointer} +.dfn-panel{position:absolute;z-index:35;min-width:300px;max-width:500px;padding:.5em .75em;margin-top:.6em;font-family:"Helvetica Neue",sans-serif;font-size:small;background:#fff;background:var(--indextable-hover-bg,#fff);color:#000;color:var(--text,#000);box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);box-shadow:0 1em 3em -.4em var(--tocsidebar-shadow,rgba(0,0,0,.3)),0 0 1px 1px var(--tocsidebar-shadow,rgba(0,0,0,.05));border-radius:2px} +.dfn-panel:not(.docked)>.caret{position:absolute;top:-9px} +.dfn-panel:not(.docked)>.caret::after,.dfn-panel:not(.docked)>.caret::before{content:"";position:absolute;border:10px solid transparent;border-top:0;border-bottom:10px solid #fff;border-bottom-color:var(--indextable-hover-bg,#fff);top:0} +.dfn-panel:not(.docked)>.caret::before{border-bottom:9px solid #a2a9b1;border-bottom-color:var(--indextable-hover-bg,#a2a9b1)} +.dfn-panel *{margin:0} +.dfn-panel b{display:block;color:#000;color:var(--text,#000);margin-top:.25em} +.dfn-panel ul a[href]{color:#333;color:var(--text,#333)} +.dfn-panel>div{display:flex} +.dfn-panel a.self-link{font-weight:700;margin-right:auto} +.dfn-panel .marker{padding:.1em;margin-left:.5em;border-radius:.2em;text-align:center;white-space:nowrap;font-size:90%;color:#040b1c} +.dfn-panel .marker.dfn-exported{background:#d1edfd;box-shadow:0 0 0 .125em #1ca5f940} +.dfn-panel .marker.idl-block{background:#8ccbf2;box-shadow:0 0 0 .125em #0670b161} +.dfn-panel a:not(:hover){text-decoration:none!important;border-bottom:none!important} +.dfn-panel a[href]:hover{border-bottom-width:1px} +.dfn-panel ul{padding:0} +.dfn-panel li{margin-left:1em} +.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function Su(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),s=`dfn-panel-for-${e.id}`,o=e.getAttribute("aria-label")||qn(e.textContent),i=kn` + <div + class="dfn-panel" + id="${s}" + hidden + role="dialog" + aria-modal="true" + aria-label="Links in this document to definition: ${o}" + > + <span class="caret"></span> + <div> + <a + class="self-link" + href="${n}" + aria-label="Permalink for definition: ${o}. Activate to close this dialog." + >Permalink</a + > + ${function(e){return e.matches("dfn[data-export]")?kn`<span + class="marker dfn-exported" + title="Definition can be referenced by other specifications" + >exported</span + >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return kn`<a + href="${e}" + class="marker idl-block" + title="Jump to IDL declaration" + >IDL</a + >`}}return null}(e,r)} + </div> + <p><b>Referenced in:</b></p> + ${function(e,t){if(!t.length)return kn`<ul> + <li>Not referenced in this document.</li> + </ul>`;const n=new Map;t.forEach(((t,r)=>{const s=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=s);const o=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`§ ${qn(n.textContent)}`:null}(t);(n.get(o)||n.set(o,[]).get(o)).push(s)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),s=e=>kn`<li> + ${r(e).map((e=>kn`<a href="#${e.id}" title="${e.title}">${e.text}</a + >${" "}`))} + </li>`;return kn`<ul> + ${[...n].map(s)} + </ul>`}(t,r)} + </div> + `;return i}var Ru=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(kn`<style> + ${Cu} + </style>`,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Su(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.querySelector("script")?document.body.querySelector("script").before(t):document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return Dd}))).default}catch{return Gl("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Eu="rs-changelog",Au=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;kn.bind(this)` + <ul> + ${{any:Lu(e,t,n).then((e=>async function(e){const{repoURL:t}=await mo;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,o=r&&kn` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return kn`<li><a href="${s}">${n.trim()}</a>${o}</li>`}))}(e))).catch((e=>lr(e.message,Eu,{elements:[this],cause:e}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} + </ul> + `}};async function Lu(e,t,n){let r;try{const s=await mo;if(!s)throw new Error("`respecConfig.github` is not set");const o=new URL("commits",`${s.apiBase}/${s.fullName}/`);o.searchParams.set("from",e),o.searchParams.set("to",t);const i=await fetch(o.href);if(!i.ok)throw new Error(`Request to ${o} failed with status code ${i.status}`);if(r=await i.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return r}const Tu=[Object.freeze({__proto__:null,element:Au,name:Eu})];var Pu=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Tu.forEach((e=>{customElements.define(e.name,e.element)}));const e=Tu.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});var Iu=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),s=n?"removeOnSave":null;document.head.append(kn`<meta + name="monetization" + content="${r}" + class="${s}" + />`)}});var Du=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const Nu="core/before-save";var ju=Object.freeze({__proto__:null,name:Nu,run:function(e){if(e.beforeSave)if(Array.isArray(e.beforeSave)&&!e.beforeSave.some((e=>"function"!=typeof e||"AsyncFunction"===e.constructor.name)))vr("beforesave",(t=>{!function(e,t){let n=0;for(const r of e)try{r(t)}catch(e){lr(gr`Function ${`\`${r.name}\``||`at position ${n}`}\` threw an error during processing of ${"[beforeSave]"}.`,Nu,{hint:"See developer console.",cause:e})}finally{n++}}(e.beforeSave,t.ownerDocument)}),{once:!0});else{lr(gr`${"[beforeSave]"} configuration option must be an array of synchronous JS functions.`,Nu)}}});const Ou="core/linter-rules/check-charset",zu=Wn({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'},cs:{msg:"Dokument smí obsahovat pouze jeden tag `<meta>` s charset nastaveným na 'utf-8'",hint:'Přidejte tento řádek do sekce `<head>` vašeho dokumentu - `<meta charset="utf-8">` nebo nastavte charset na "utf-8", pokud ještě není nastaven.'}});var Mu=Object.freeze({__proto__:null,name:Ou,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||ur(zu.msg,Ou,{hint:zu.hint,elements:[...t]})}});const qu="core/linter-rules/check-punctuation",Wu=[".",":","!","?"],Uu=Wu.map((e=>`"${e}"`)).join(", "),Fu=Wn({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Uu}.`},cs:{msg:"Elementy `p` by měly končit interpunkčním znaménkem.",hint:`Ujistěte se, že elementy \`p\` končí jedním z těchto znaků: ${Uu}.`}});var Bu=Object.freeze({__proto__:null,name:qu,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Wu.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&ur(Fu.msg,qu,{hint:Fu.hint,elements:n})}});const Hu="core/linter-rules/check-internal-slots",Vu=Wn({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."},cs:{msg:"Interní sloty by měly být uvedeny s tečkou '.' před názvem",hint:"Přidejte tečku '.' mezi uvedené prvky."}});var Gu=Object.freeze({__proto__:null,name:Hu,run:function(e){if(!e.lint?.["check-internal-slots"])return;const t=[...document.querySelectorAll("var+a")].filter((({previousSibling:{nodeName:e}})=>e&&"VAR"===e));t.length&&ur(Vu.msg,Hu,{hint:Vu.hint,elements:t})}});const Yu="core/linter-rules/local-refs-exist",Ku=Wn({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."},cs:{msg:"V dokumentu byla nalezena nefunkční lokální reference.",hint:"Opravte prosím uvedené odkazy."}});function Zu(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Ju=Object.freeze({__proto__:null,name:Yu,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Zu);t.length&&ur(Ku.msg,Yu,{hint:Ku.hint,elements:t})}});const Qu="core/linter-rules/no-captionless-tables",Xu=Wn({en:{msg:"All tables marked with class='numbered' must start with a caption element.",hint:"Add a `caption` to the offending table."},cs:{msg:"Všechny tabulky označené class='numbered' musí začínat elementem caption.",hint:"Přidejte k dané tabulce element `caption`."}});var ed=Object.freeze({__proto__:null,name:Qu,run:function(e){if(!e.lint?.["no-captionless-tables"])return;const t=[...document.querySelectorAll("table.numbered")].filter((e=>!(e.firstElementChild instanceof HTMLTableCaptionElement)));t.length&&ur(Xu.msg,Qu,{hint:Xu.hint,elements:t})}});const td="no-unused-dfns",nd="core/linter-rules/no-unused-dfns",rd=Wn({en:{msg:e=>`Found definition for "${e}", but nothing links to it. This is usually a spec bug!`,get hint(){return gr` + You can do one of the following... + + * Add a \`class="lint-ignore"\` attribute the definition. + * Either remove the definition or change \`<dfn>\` to another type of HTML element. + * If you meant to ${"[export|#data-export]"} the definition, add \`class="export"\` to the definition. + + To silence this warning entirely, set \`lint: { "no-unused-dfns": false }\` in your \`respecConfig\`.`}},cs:{msg:e=>`Nalezena definice pro "${e}", ale nic na ni neodkazuje. Toto je obvykle chyba ve specifikaci!`,get hint(){return gr` + Můžete udělat jedno z následujícího... + + * Přidejte k definici atribut \`class="lint-ignore"\`. + * Definici buď odstraňte, nebo změňte \`<dfn>\` na jiný typ HTML elementu. + * Pokud jste chtěli ${"[export|#data-export]"} tuto definici, přidejte k ní \`class="export"\`. + + Pro úplné potlačení tohoto varování nastavte \`lint: { "no-unused-dfns": false }\` ve vaší \`respecConfig\`.`}}});function sd(e){return!document.querySelector(`a[href="#${e.id}"]:not(.index-term, .self-link)`)}var od=Object.freeze({__proto__:null,name:nd,run:function(e){if(!e.lint?.[td])return;const t="error"===e.lint[td]?lr:ur;[...document.querySelectorAll("dfn:not(.lint-ignore, [data-export], [data-cite])")].filter(sd).forEach((e=>{const n=[e],r=qn(e.textContent);t(rd.msg(r),nd,{elements:n,hint:rd.hint})}))}});const id="core/linter-rules/no-headingless-sections",ad=Wn({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"},cs:{msg:"Všechny sekce musí začínat elementem `h2-6`.",hint:"Přidejte do problematické sekce `h2-6` nebo použijte `<div>`."}});var cd=Object.freeze({__proto__:null,name:id,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&ur(ad.msg,id,{hint:ad.hint,elements:t})}});const ld="core/linter-rules/no-unused-vars",ud=Wn({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."},cs:{msg:"Proměnná byla definována, ale nikdy nebyla použita.",hint:"Přidejte atribut `data-ignore-unused` k elementu `<var>`."}});var dd=Object.freeze({__proto__:null,name:ld,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const s=new Map;for(const e of r){const t=qn(e.textContent);(s.get(t)||s.set(t,[]).get(t)).push(e)}for(const e of s.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&ur(ud.msg,ld,{hint:ud.hint,elements:t})}});const pd="required-sections",fd="w3c/linter-rules/required-sections",hd={en:{msg:e=>`W3C Recommendation track documents require a separate "${e}" section.`,hint:e=>gr`Add a \`<section>\` with a "${e}" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). + If the document is not intended for the W3C Recommendation track, set ${"[noRecTrack]"} to \`true\` + or turn off the ${`[${pd}]`} linter rule.`,privacy_considerations:"Privacy Considerations",security_considerations:"Security Considerations"},es:{msg:e=>`Documentos que van a ser "W3C Recommendation" requieren una sección "${e}" separada.`,hint:e=>gr`Agrega una \`<section>\` con título "${e}". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). + Si el documento no está destinado a ser un W3C Recommendation, puedes poner ${"[noRecTrack]"} a \`true\` + o apaga la regla de linter ${`[${pd}]`}.`,privacy_considerations:"Consideraciones de privacidad",security_considerations:"Consideraciones de Seguridad"},cs:{msg:e=>`Dokumenty na "W3C Recommendation track" vyžadují samostatnou sekci "${e}".`,hint:e=>gr`Přidejte \`<section>\` s nadpisem "${e}". Viz [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). + Pokud dokument není určen pro "W3C Recommendation track", nastavte ${"[noRecTrack]"} na \`true\` + nebo vypněte linter pravidlo ${`[${pd}]`}. + `,privacy_considerations:"Zásady ochrany soukromí",security_considerations:"Zásady bezpečnosti"}},md=Wn(hd),gd=new Set([...zs]);gd.delete("DISC"),Os.forEach((e=>gd.delete(e)));var bd=Object.freeze({__proto__:null,name:fd,requiresSomeSectionStatus:gd,run:function(e){if(!e.lint?.[pd])return;if(!Un(hd,"privacy_considerations")){return void ur("Cannot check for required sections as translations are not available.",fd,{hint:"File an issue to add translations or use a supported language."})}if(e.noRecTrack||!gd.has(e.specStatus))return;const t="error"===e.lint[pd]?lr:ur,n=new rr([md.privacy_considerations,md.security_considerations]),r=document.querySelectorAll("h2, h3, h4, h5, h6");for(const e of r){const t=e.cloneNode(!0);t.querySelectorAll("bdi")?.forEach((e=>e.remove()));const r=qn(t.textContent);if(n.has(r)&&(n.delete(r),0===n.size))return}for(const e of n)t(md.msg(e),fd,{hint:md.hint(e)})}});const yd="core/linter-rules/wpt-tests-exist",wd=Wn({en:{msg:"The following test could not be found in Web Platform Tests:",hint:"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed."},cs:{msg:"Následující test nebyl nalezen ve Web Platform Tests:",hint:"Zkontrolujte [wpt.live](https://wpt.live), zda nebyl smazán nebo přejmenován."}});var vd=Object.freeze({__proto__:null,name:yd,run:async function(e){if(!e.lint?.["wpt-tests-exist"])return;const t=await async function(e,t){let n;try{const t=new URL(e);if(t.pathname.startsWith("/web-platform-tests/wpt/tree/master/")){const e=/web-platform-tests\/wpt\/tree\/master\/(.+)/;n=t.pathname.match(e)[1].replace(/\//g,"")}else n=t.pathname.replace(/\//g,"")}catch(e){return ur("Failed to parse WPT directory from testSuiteURI",`linter/${yd}`),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",`${t}/`);r.searchParams.set("path",n);const s=await fetch(r);if(!s.ok){return ur(`Failed to fetch files from WPT repository. Request failed with error: ${await s.text()} (${s.status})`,`linter/${yd}`),null}const{entries:o}=await s.json(),i=o.filter((e=>!e.endsWith("/")));return new Set(i)}(e.testSuiteURI,e.githubAPI);if(!t)return;const n=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));for(const e of n)e.dataset.tests.split(/,/gm).map((e=>e.trim().split(/\?|#/)[0])).filter((e=>e&&!t.has(e))).map((t=>{ur(`${wd.msg} \`${t}\`.`,yd,{hint:wd.hint,elements:[e]})}))}});const kd="core/linter-rules/no-http-props",$d=Wn({en:{msg:gr`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:gr`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"},cs:{msg:gr`V ${"[respecConfig]"} nejsou povoleny nezabezpečené URL adresy.`,hint:"Změňte prosím následující vlastnosti na 'https://': "}});var xd=Object.freeze({__proto__:null,name:kd,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=On(t,(e=>gr`${`[${e}]`}`));ur($d.msg,kd,{hint:$d.hint+e})}}});const _d="core/linter-rules/a11y",Cd=["color-contrast","landmark-one-main","landmark-unique","region"];function Sd(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),s=r.map((e=>`- ${e.trimEnd()}`)).join("\n");t.push(`${e}${s}`)}return t.join("\n\n")}var Rd=Object.freeze({__proto__:null,name:_d,run:async function(e){if(!e.lint?.a11y&&!e.a11y)return;const t=e.lint?.a11y||e.a11y,n=!0===t?{}:t,r=await async function(e){const{rules:t,...n}=e,r={rules:{...Object.fromEntries(Cd.map((e=>[e,{enabled:!1}]))),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let s;try{s=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://cdn.jsdelivr.net/npm/axe-core@4/axe.min.js",document.head.appendChild(e),new Promise(((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n}))}()}catch(e){return lr("Failed to load a11y linter.",_d),console.error(e),[]}try{return(await s.run(document,r)).violations}catch(e){return lr("Error while looking for a11y issues.",_d),console.error(e),[]}}(n);for(const e of r){const t=new Map;for(const n of e.nodes){const{failureSummary:e,element:r}=n;(t.get(e)||t.set(e,[]).get(e)).push(r)}const{id:n,help:r,description:s,helpUrl:o}=e,i=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=Sd(e);ur(i,_d,{details:`\n\n${s}.\n\n${t}. ([Learn more](${o}))`,elements:n})}}}});const Ed="informative-dfn",Ad="core/linter-rules/informative-dfn",Ld=Wn({en:{msg:(e,t)=>`Normative reference to "${e}" found but term is defined "informatively" in "${t}".`,get hint(){return gr` + You can do one of the following... + + * Get the source definition to be made normative + * Add a \`class="lint-ignore"\` attribute to the link. + * Use a local normative proxy for the definition à la \`<dfn data-cite="spec">term</dfn>\` + + To silence this warning entirely, set \`lint: { "${Ed}": false }\` in your \`respecConfig\`.`}},cs:{msg:(e,t)=>`Nalezen normativní odkaz na "${e}", ale pojem je definován pouze informativně v "${t}".`,get hint(){return gr` + Můžete udělat jedno z následujícího... + + * Požádejte o to, aby zdrojová definice byla normativní + * Přidejte atribut \`class=\"lint-ignore\"\` k odkazu. + * Použijte lokální normativní proxy pro definici, např. \`<dfn data-cite=\"spec\">term</dfn>\` + + Pro úplné potlačení tohoto varování nastavte \`lint: { \"${Ed}\": false }\` ve vaší \`respecConfig\`.`}}});var Td=Object.freeze({__proto__:null,name:Ad,run:function(e){if(!e.lint?.[Ed])return;const t="error"===e.lint[Ed]?lr:ur;xc.forEach((({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(Ld.msg(e,n),Ad,{title:"Normative reference to non-normative term.",elements:[r],hint:Ld.hint})}))}}),Pd=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),Id=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\n\nif (document.respec) {\n document.respec.ready.then(setupVarHighlighter);\n} else {\n setupVarHighlighter();\n}\n\nfunction setupVarHighlighter() {\n document\n .querySelectorAll("var")\n .forEach(varElem => varElem.addEventListener("click", highlightListener));\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener("click", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n ["respec-hl-c1", true],\n ["respec-hl-c2", true],\n ["respec-hl-c3", true],\n ["respec-hl-c4", true],\n ["respec-hl-c5", true],\n ["respec-hl-c6", true],\n ["respec-hl-c7", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get("respec-hl-c1") === true) return "respec-hl-c1";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || "respec-hl-c1";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(".algorithm, section");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll("var")].filter(\n el =>\n norm(el.textContent) === textContent &&\n el.closest(".algorithm, section") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains("respec-hl");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove("respec-hl", highlightColor);\n // clean up empty class attributes so they don\'t come in export\n if (!el.classList.length) el.removeAttribute("class");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add("respec-hl", highlightColor);\n}\n\n/**\n * Same as `norm` from src/core/utils, but our build process doesn\'t allow\n * imports in runtime scripts, so duplicated here.\n * @param {string} str\n */\nfunction norm(str) {\n return str.trim().replace(/\\s+/g, " ");\n}\n})()'}),Dd=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); +//# sourceMappingURL=respec-w3c.js.map diff --git a/rumgooglesyndicationpagead.js b/rumgooglesyndicationpagead.js new file mode 100644 index 0000000..abe90cf --- /dev/null +++ b/rumgooglesyndicationpagead.js @@ -0,0 +1,133 @@ +(function(){var aa,ca=typeof Object.create=="function"?Object.create:function(a){function b(){}b.prototype=a;return new b},ea=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a}; +function fa(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var ha=fa(this),ja=typeof Symbol==="function"&&typeof Symbol("x")==="symbol",q={},ka={};function r(a,b,c){if(!c||a!=null){c=ka[b];if(c==null)return a[b];c=a[c];return c!==void 0?c:a[b]}} +function t(a,b,c){if(b)a:{var d=a.split(".");a=d.length===1;var e=d[0],f;!a&&e in q?f=q:f=ha;for(e=0;e<d.length-1;e++){var g=d[e];if(!(g in f))break a;f=f[g]}d=d[d.length-1];c=ja&&c==="es6"?f[d]:null;b=b(c);b!=null&&(a?ea(q,d,{configurable:!0,writable:!0,value:b}):b!==c&&(ka[d]===void 0&&(a=Math.random()*1E9>>>0,ka[d]=ja?ha.Symbol(d):"$jscp$"+a+"$"+d),ea(f,ka[d],{configurable:!0,writable:!0,value:b})))}}var la; +if(ja&&typeof r(Object,"setPrototypeOf")=="function")la=r(Object,"setPrototypeOf");else{var ma;a:{var na={a:!0},oa={};try{oa.__proto__=na;ma=oa.a;break a}catch(a){}ma=!1}la=ma?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var pa=la; +function x(a,b){a.prototype=ca(b.prototype);a.prototype.constructor=a;if(pa)pa(a,b);else for(var c in b)if(c!="prototype")if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.La=b.prototype}function qa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}} +function y(a){var b=typeof q.Symbol!="undefined"&&r(q.Symbol,"iterator")&&a[r(q.Symbol,"iterator")];if(b)return b.call(a);if(typeof a.length=="number")return{next:qa(a)};throw Error(String(a)+" is not an iterable or ArrayLike");}function sa(a){if(!(a instanceof Array)){a=y(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}function ta(a){return ua(a,a)}function ua(a,b){a.raw=b;Object.freeze&&(Object.freeze(a),Object.freeze(b));return a} +function va(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function wa(){for(var a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b}t("globalThis",function(a){return a||ha},"es_2020");t("Reflect.setPrototypeOf",function(a){return a?a:pa?function(b,c){try{return pa(b,c),!0}catch(d){return!1}}:null},"es6"); +t("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.g=f;ea(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.g};var d="jscomp_symbol_"+(Math.random()*1E9>>>0)+"_",e=0;return b},"es6"); +t("Symbol.iterator",function(a){if(a)return a;a=(0,q.Symbol)("Symbol.iterator");ea(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return xa(qa(this))}});return a},"es6");function xa(a){a={next:a};a[r(q.Symbol,"iterator")]=function(){return this};return a}t("Object.setPrototypeOf",function(a){return a||pa},"es6"); +t("Array.prototype.find",function(a){return a?a:function(b,c){a:{var d=this;d instanceof String&&(d=String(d));for(var e=d.length,f=0;f<e;f++){var g=d[f];if(b.call(c,g,f,d)){b=g;break a}}b=void 0}return b}},"es6"); +t("WeakMap",function(a){function b(g){this.g=(f+=Math.random()+1).toString();if(g){g=y(g);for(var h;!(h=g.next()).done;)h=h.value,this.set(h[0],h[1])}}function c(){}function d(g){var h=typeof g;return h==="object"&&g!==null||h==="function"}if(function(){if(!a||!Object.seal)return!1;try{var g=Object.seal({}),h=Object.seal({}),k=new a([[g,2],[h,3]]);if(k.get(g)!=2||k.get(h)!=3)return!1;k.delete(g);k.set(h,4);return!k.has(g)&&k.get(h)==4}catch(l){return!1}}())return a;var e="$jscomp_hidden_"+Math.random(), +f=0;b.prototype.set=function(g,h){if(!d(g))throw Error("Invalid WeakMap key");if(!va(g,e)){var k=new c;ea(g,e,{value:k})}if(!va(g,e))throw Error("WeakMap key fail: "+g);g[e][this.g]=h;return this};b.prototype.get=function(g){return d(g)&&va(g,e)?g[e][this.g]:void 0};b.prototype.has=function(g){return d(g)&&va(g,e)&&va(g[e],this.g)};b.prototype.delete=function(g){return d(g)&&va(g,e)&&va(g[e],this.g)?delete g[e][this.g]:!1};return b},"es6"); +t("Map",function(a){function b(){var h={};return h.A=h.next=h.head=h}function c(h,k){var l=h[1];return xa(function(){if(l){for(;l.head!=h[1];)l=l.A;for(;l.next!=l.head;)return l=l.next,{done:!1,value:k(l)};l=null}return{done:!0,value:void 0}})}function d(h,k){var l=k&&typeof k;l=="object"||l=="function"?f.has(k)?l=f.get(k):(l=""+ ++g,f.set(k,l)):l="p_"+k;var m=h[0][l];if(m&&va(h[0],l))for(h=0;h<m.length;h++){var n=m[h];if(k!==k&&n.key!==n.key||k===n.key)return{id:l,list:m,index:h,entry:n}}return{id:l, +list:m,index:-1,entry:void 0}}function e(h){this[0]={};this[1]=b();this.size=0;if(h){h=y(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||typeof a!="function"||!a.prototype.entries||typeof Object.seal!="function")return!1;try{var h=Object.seal({x:4}),k=new a(y([[h,"s"]]));if(k.get(h)!="s"||k.size!=1||k.get({x:4})||k.set({x:4},"t")!=k||k.size!=2)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=h||m.value[1]!="s")return!1;m=l.next();return m.done||m.value[0].x!= +4||m.value[1]!="t"||!l.next().done?!1:!0}catch(n){return!1}}())return a;var f=new q.WeakMap;e.prototype.set=function(h,k){h=h===0?0:h;var l=d(this,h);l.list||(l.list=this[0][l.id]=[]);l.entry?l.entry.value=k:(l.entry={next:this[1],A:this[1].A,head:this[1],key:h,value:k},l.list.push(l.entry),this[1].A.next=l.entry,this[1].A=l.entry,this.size++);return this};e.prototype.delete=function(h){h=d(this,h);return h.entry&&h.list?(h.list.splice(h.index,1),h.list.length||delete this[0][h.id],h.entry.A.next= +h.entry.next,h.entry.next.A=h.entry.A,h.entry.head=null,this.size--,!0):!1};e.prototype.clear=function(){this[0]={};this[1]=this[1].A=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).entry};e.prototype.get=function(h){return(h=d(this,h).entry)&&h.value};e.prototype.entries=function(){return c(this,function(h){return[h.key,h.value]})};e.prototype.keys=function(){return c(this,function(h){return h.key})};e.prototype.values=function(){return c(this,function(h){return h.value})};e.prototype.forEach= +function(h,k){for(var l=this.entries(),m;!(m=l.next()).done;)m=m.value,h.call(k,m[1],m[0],this)};e.prototype[r(q.Symbol,"iterator")]=e.prototype.entries;var g=0;return e},"es6");t("Object.is",function(a){return a?a:function(b,c){return b===c?b!==0||1/b===1/c:b!==b&&c!==c}},"es6");t("Number.isFinite",function(a){return a?a:function(b){return typeof b!=="number"?!1:!isNaN(b)&&b!==Infinity&&b!==-Infinity}},"es6");t("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991},"es6"); +t("Number.MIN_SAFE_INTEGER",function(){return-9007199254740991},"es6");t("Number.isInteger",function(a){return a?a:function(b){return r(Number,"isFinite").call(Number,b)?b===Math.floor(b):!1}},"es6");t("Number.isSafeInteger",function(a){return a?a:function(b){return r(Number,"isInteger").call(Number,b)&&Math.abs(b)<=r(Number,"MAX_SAFE_INTEGER")}},"es6"); +function ya(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[r(q.Symbol,"iterator")]=function(){return e};return e}t("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||b===Infinity||b===-Infinity||b===0)return b;var c=Math.floor(Math.abs(b));return b<0?-c:c}},"es6");t("Number.isNaN",function(a){return a?a:function(b){return typeof b==="number"&&isNaN(b)}},"es6"); +t("Array.prototype.keys",function(a){return a?a:function(){return ya(this,function(b){return b})}},"es6");/* + + Copyright The Closure Library Authors. + SPDX-License-Identifier: Apache-2.0 +*/ +var A=this||self;function za(a,b){a:{var c=["CLOSURE_FLAGS"];for(var d=A,e=0;e<c.length;e++)if(d=d[c[e]],d==null){c=null;break a}c=d}a=c&&c[a];return a!=null?a:b}function Aa(a){var b=typeof a;return b!="object"?b:a?Array.isArray(a)?"array":b:"null"}function Ba(a){return a};var Ca;var Da,Ea=typeof String.prototype.isWellFormed==="function",Fa=typeof TextEncoder!=="undefined"; +function Ga(a){var b=!1;b=b===void 0?!1:b;if(Fa){if(b&&(Ea?!a.isWellFormed():/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(a)))throw Error("Found an unpaired surrogate");a=(Da||(Da=new TextEncoder)).encode(a)}else{for(var c=0,d=new Uint8Array(3*a.length),e=0;e<a.length;e++){var f=a.charCodeAt(e);if(f<128)d[c++]=f;else{if(f<2048)d[c++]=f>>6|192;else{if(f>=55296&&f<=57343){if(f<=56319&&e<a.length){var g=a.charCodeAt(++e);if(g>=56320&&g<=57343){f=(f-55296)*1024+g-56320+ +65536;d[c++]=f>>18|240;d[c++]=f>>12&63|128;d[c++]=f>>6&63|128;d[c++]=f&63|128;continue}else e--}if(b)throw Error("Found an unpaired surrogate");f=65533}d[c++]=f>>12|224;d[c++]=f>>6&63|128}d[c++]=f&63|128}}a=c===d.length?d:d.subarray(0,c)}return a};function Ha(a){A.setTimeout(function(){throw a;},0)};function Ia(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};var Ja=za(610401301,!1),Ka=za(748402147,!0),Ma=za(824656860,za(1,!0));function Na(){var a=A.navigator;return a&&(a=a.userAgent)?a:""}var Oa,Qa=A.navigator;Oa=Qa?Qa.userAgentData||null:null;function Ra(a){if(!Ja||!Oa)return!1;for(var b=0;b<Oa.brands.length;b++){var c=Oa.brands[b].brand;if(c&&c.indexOf(a)!=-1)return!0}return!1}function B(a){return Na().indexOf(a)!=-1};function Sa(){return Ja?!!Oa&&Oa.brands.length>0:!1};function Ta(a,b){if(typeof a==="string")return typeof b!=="string"||b.length!=1?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function Ua(a,b){for(var c=a.length,d=typeof a==="string"?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function Va(a,b){for(var c=a.length,d=[],e=0,f=typeof a==="string"?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d} +function Wa(a,b){for(var c=a.length,d=Array(c),e=typeof a==="string"?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function Xa(a,b){a:{for(var c=a.length,d=typeof a==="string"?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return b<0?null:typeof a==="string"?a.charAt(b):a[b]} +function Ya(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],e=Aa(d);if(e=="array"||e=="object"&&typeof d.length=="number"){e=a.length||0;var f=d.length||0;a.length=e+f;for(var g=0;g<f;g++)a[e+g]=d[g]}else a.push(d)}}function Za(a,b){a.sort(b||ab)}function ab(a,b){return a>b?1:a<b?-1:0};function bb(a){bb[" "](a);return a}bb[" "]=function(){};var cb=Na().toLowerCase().indexOf("webkit")!=-1&&!B("Edge");var db=B("Safari")&&!((Sa()?Ra("Chromium"):(B("Chrome")||B("CriOS"))&&(Sa()||!B("Edge"))||B("Silk"))||(Sa()?0:B("Coast"))||(Sa()?0:B("Opera"))||(Sa()?0:B("Edge"))||(Sa()?Ra("Microsoft Edge"):B("Edg/"))||(Sa()?Ra("Opera"):B("OPR"))||B("Firefox")||B("FxiOS")||B("Silk")||B("Android"))&&!(B("iPhone")&&!B("iPod")&&!B("iPad")||B("iPad")||B("iPod"));var eb={},fb=null,ib=B("Gecko")&&!(Na().toLowerCase().indexOf("webkit")!=-1&&!B("Edge"))&&!(B("Trident")||B("MSIE"))&&!B("Edge")||cb||!db&&typeof A.atob=="function";function jb(a){if(ib)return A.atob(a);var b="";kb(a,function(c){b+=String.fromCharCode(c)});return b} +function kb(a,b){function c(k){for(;d<a.length;){var l=a.charAt(d++),m=fb[l];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l);}return k}lb();for(var d=0;;){var e=c(-1),f=c(0),g=c(64),h=c(64);if(h===64&&e===-1)break;b(e<<2|f>>4);g!=64&&(b(f<<4&240|g>>2),h!=64&&b(g<<6&192|h))}} +function lb(){if(!fb){fb={};for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),b=["+/=","+/","-_=","-_.","-_"],c=0;c<5;c++){var d=a.concat(b[c].split(""));eb[c]=d;for(var e=0;e<d.length;e++){var f=d[e];fb[f]===void 0&&(fb[f]=e)}}}};function mb(a,b){a.__closure__error__context__984382||(a.__closure__error__context__984382={});a.__closure__error__context__984382.severity=b};var nb=void 0;function ob(a){a=Error(a);mb(a,"warning");return a}function pb(a,b){if(a!=null){var c;var d=(c=nb)!=null?c:nb={};c=d[a]||0;c>=b||(d[a]=c+1,a=Error(),mb(a,"incident"),Ha(a))}};function qb(){return typeof BigInt==="function"};var rb=typeof q.Symbol==="function"&&typeof(0,q.Symbol)()==="symbol";function sb(a,b,c){return typeof q.Symbol==="function"&&typeof(0,q.Symbol)()==="symbol"?(c===void 0?0:c)&&q.Symbol.for&&a?q.Symbol.for(a):a!=null?(0,q.Symbol)(a):(0,q.Symbol)():b}var tb=sb("jas",void 0,!0),ub=sb(void 0,"1oa"),vb=sb(void 0,"0ubsb"),wb=sb(void 0,"0actk"),xb=sb("m_m","Ka",!0);var yb={oa:{value:0,configurable:!0,writable:!0,enumerable:!1}},zb=Object.defineProperties,E=rb?tb:"oa",Ab,Bb=[];F(Bb,7);Ab=Object.freeze(Bb);function Cb(a,b){rb||E in a||zb(a,yb);a[E]|=b}function F(a,b){rb||E in a||zb(a,yb);a[E]=b};var Db={};function I(a,b){return b===void 0?a.g!==Eb&&!!(2&(a.j[E]|0)):!!(2&b)&&a.g!==Eb}var Eb={},Fb=Object.freeze({});function Gb(a,b,c){var d=b&128?0:-1,e=a.length,f;if(f=!!e)f=a[e-1],f=f!=null&&typeof f==="object"&&f.constructor===Object;var g=e+(f?-1:0);for(b=b&128?1:0;b<g;b++)c(b-d,a[b]);if(f){a=a[e-1];for(var h in a)Object.prototype.hasOwnProperty.call(a,h)&&!isNaN(h)&&c(+h,a[h])}};function Hb(a){a.Ja=!0;return a};var Ib=Hb(function(a){return typeof a==="number"}),Jb=Hb(function(a){return typeof a==="string"}),Kb=Hb(function(a){return typeof a==="boolean"});var Lb=typeof A.BigInt==="function"&&typeof A.BigInt(0)==="bigint";function Mb(a){var b=a;if(Jb(b)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(b))throw Error(String(b));}else if(Ib(b)&&!r(Number,"isSafeInteger").call(Number,b))throw Error(String(b));return Lb?BigInt(a):a=Kb(a)?a?"1":"0":Jb(a)?a.trim()||"0":String(a)}var Sb=Hb(function(a){return Lb?a>=Nb&&a<=Ob:a[0]==="-"?Pb(a,Qb):Pb(a,Rb)}),Qb=r(Number,"MIN_SAFE_INTEGER").toString(),Nb=Lb?BigInt(r(Number,"MIN_SAFE_INTEGER")):void 0,Rb=r(Number,"MAX_SAFE_INTEGER").toString(),Ob=Lb?BigInt(r(Number,"MAX_SAFE_INTEGER")):void 0; +function Pb(a,b){if(a.length>b.length)return!1;if(a.length<b.length||a===b)return!0;for(var c=0;c<a.length;c++){var d=a[c],e=b[c];if(d>e)return!1;if(d<e)return!0}};var J=0,K=0;function Tb(a){var b=a>>>0;J=b;K=(a-b)/4294967296>>>0}function Ub(a){if(a<0){Tb(-a);var b=y(Vb(J,K));a=b.next().value;b=b.next().value;J=a>>>0;K=b>>>0}else Tb(a)}function Wb(a,b){b>>>=0;a>>>=0;if(b<=2097151)var c=""+(4294967296*b+a);else qb()?c=""+(BigInt(b)<<BigInt(32)|BigInt(a)):(c=(a>>>24|b<<8)&16777215,b=b>>16&65535,a=(a&16777215)+c*6777216+b*6710656,c+=b*8147497,b*=2,a>=1E7&&(c+=a/1E7>>>0,a%=1E7),c>=1E7&&(b+=c/1E7>>>0,c%=1E7),c=b+Xb(c)+Xb(a));return c} +function Xb(a){a=String(a);return"0000000".slice(a.length)+a}function Yb(){var a=J,b=K;b&2147483648?qb()?a=""+(BigInt(b|0)<<BigInt(32)|BigInt(a>>>0)):(b=y(Vb(a,b)),a=b.next().value,b=b.next().value,a="-"+Wb(a,b)):a=Wb(a,b);return a} +function Zb(a){if(a.length<16)Ub(Number(a));else if(qb())a=BigInt(a),J=Number(a&BigInt(4294967295))>>>0,K=Number(a>>BigInt(32)&BigInt(4294967295));else{var b=+(a[0]==="-");K=J=0;for(var c=a.length,d=b,e=(c-b)%6+b;e<=c;d=e,e+=6)d=Number(a.slice(d,e)),K*=1E6,J=J*1E6+d,J>=4294967296&&(K+=r(Math,"trunc").call(Math,J/4294967296),K>>>=0,J>>>=0);b&&(b=y(Vb(J,K)),a=b.next().value,b=b.next().value,J=a,K=b)}}function Vb(a,b){b=~b;a?a=~a+1:b+=1;return[a,b]};function $b(a){return Array.prototype.slice.call(a)};var ac=typeof BigInt==="function"?BigInt.asIntN:void 0,bc=r(Number,"isSafeInteger"),cc=r(Number,"isFinite"),dc=r(Math,"trunc");function ec(a){if(a==null||typeof a==="boolean")return a;if(typeof a==="number")return!!a}var fc=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function hc(a){switch(typeof a){case "bigint":return!0;case "number":return cc(a);case "string":return fc.test(a);default:return!1}} +function ic(a){if(a==null)return a;if(typeof a==="string"&&a)a=+a;else if(typeof a!=="number")return;return cc(a)?a|0:void 0} +function jc(a){var b=void 0;b!=null||(b=Ma?1024:0);if(!hc(a))throw ob("int64");var c=typeof a;switch(b){case 512:switch(c){case "string":return kc(a);case "bigint":return String(ac(64,a));default:return lc(a)}case 1024:switch(c){case "string":return mc(a);case "bigint":return Mb(ac(64,a));default:return nc(a)}case 0:switch(c){case "string":return kc(a);case "bigint":return Mb(ac(64,a));default:return oc(a)}default:throw Error("Unknown format requested type for int64");}} +function pc(a){var b=a.length;if(a[0]==="-"?b<20||b===20&&a<="-9223372036854775808":b<19||b===19&&a<="9223372036854775807")return a;Zb(a);return Yb()}function oc(a){a=dc(a);if(!bc(a)){Ub(a);var b=J,c=K;if(a=c&2147483648)b=~b+1>>>0,c=~c>>>0,b==0&&(c=c+1>>>0);var d=c*4294967296+(b>>>0);b=r(Number,"isSafeInteger").call(Number,d)?d:Wb(b,c);a=typeof b==="number"?a?-b:b:a?"-"+b:b}return a}function lc(a){a=dc(a);bc(a)?a=String(a):(Ub(a),a=Yb());return a} +function kc(a){var b=dc(Number(a));if(bc(b))return String(b);b=a.indexOf(".");b!==-1&&(a=a.substring(0,b));return pc(a)}function mc(a){var b=dc(Number(a));if(bc(b))return Mb(b);b=a.indexOf(".");b!==-1&&(a=a.substring(0,b));return qb()?Mb(ac(64,BigInt(a))):Mb(pc(a))}function nc(a){return bc(a)?Mb(oc(a)):Mb(lc(a))}function qc(a){var b=typeof a;if(a==null)return a;if(b==="bigint")return Mb(ac(64,a));if(hc(a))return b==="string"?mc(a):nc(a)} +function rc(a){if(a==null)return a;var b=typeof a;if(b==="bigint")return String(ac(64,a));if(hc(a)){if(b==="string")return kc(a);if(b==="number")return oc(a)}}function sc(a){if(typeof a!=="string")throw Error();return a}function tc(a){return a==null||typeof a==="string"?a:void 0}function uc(a,b,c){if(a!=null&&a[xb]===Db)return a;if(Array.isArray(a)){var d=a[E]|0;c=d|c&32|c&2;c!==d&&F(a,c);return new b(a)}};function vc(a){return a};function wc(a,b,c,d){var e=d!==void 0;d=!!d;var f=[],g=a.length,h=4294967295,k=!1,l=!!(b&64),m=l?b&128?0:-1:void 0;if(!(b&1)){var n=g&&a[g-1];n!=null&&typeof n==="object"&&n.constructor===Object?(g--,h=g):n=void 0;if(l&&!(b&128)&&!e){k=!0;var p;h=((p=xc)!=null?p:vc)(h-m,m,a,n,void 0)+m}}b=void 0;for(e=0;e<g;e++)if(p=a[e],p!=null&&(p=c(p,d))!=null)if(l&&e>=h){var C=e-m,v=void 0;((v=b)!=null?v:b={})[C]=p}else f[e]=p;if(n)for(var D in n)Object.prototype.hasOwnProperty.call(n,D)&&(a=n[D],a!=null&&(a= +c(a,d))!=null&&(g=+D,e=void 0,l&&!r(Number,"isNaN").call(Number,g)&&(e=g+m)<h?f[e]=a:(g=void 0,((g=b)!=null?g:b={})[D]=a)));b&&(k?f.push(b):f[h]=b);return f}function yc(a){switch(typeof a){case "number":return r(Number,"isFinite").call(Number,a)?a:""+a;case "bigint":return Sb(a)?Number(a):""+a;case "boolean":return a?1:0;case "object":if(Array.isArray(a)){var b=a[E]|0;return a.length===0&&b&1?void 0:wc(a,b,yc)}if(a!=null&&a[xb]===Db)return zc(a);return}return a}var xc; +function zc(a){a=a.j;return wc(a,a[E]|0,yc)};var Ac,Bc;function Cc(a){switch(typeof a){case "boolean":return Ac||(Ac=[0,void 0,!0]);case "number":return a>0?void 0:a===0?Bc||(Bc=[0,void 0]):[-a,void 0];case "string":return[0,a];case "object":return a}} +function L(a,b,c,d){d=d===void 0?0:d;if(a==null){var e=32;c?(a=[c],e|=128):a=[];b&&(e=e&-16760833|(b&1023)<<14)}else{if(!Array.isArray(a))throw Error("narr");e=a[E]|0;if(Ka&&1&e)throw Error("rfarr");2048&e&&!(2&e)&&Dc();if(e&256)throw Error("farr");if(e&64)return(e|d)!==e&&F(a,e|d),a;if(c&&(e|=128,c!==a[0]))throw Error("mid");a:{c=a;e|=64;var f=c.length;if(f){var g=f-1,h=c[g];if(h!=null&&typeof h==="object"&&h.constructor===Object){b=e&128?0:-1;g-=b;if(g>=1024)throw Error("pvtlmt");for(var k in h)Object.prototype.hasOwnProperty.call(h, +k)&&(f=+k,f<g&&(c[f+b]=h[k],delete h[k]));e=e&-16760833|(g&1023)<<14;break a}}if(b){k=Math.max(b,f-(e&128?0:-1));if(k>1024)throw Error("spvt");e=e&-16760833|(k&1023)<<14}}}F(a,e|64|d);return a}function Dc(){if(Ka)throw Error("carr");pb(wb,5)};function Ec(a,b){if(typeof a!=="object")return a;if(Array.isArray(a)){var c=a[E]|0;a.length===0&&c&1?a=void 0:c&2||(!b||4096&c||16&c?a=Fc(a,c,!1,b&&!(c&16)):(Cb(a,34),c&4&&Object.freeze(a)));return a}if(a!=null&&a[xb]===Db)return b=a.j,c=b[E]|0,I(a,c)?a:Gc(a,b,c)?Hc(a,b):Fc(b,c)}function Hc(a,b,c){a=new a.constructor(b);c&&(a.g=Eb);a.i=Eb;return a}function Fc(a,b,c,d){d!=null||(d=!!(34&b));a=wc(a,b,Ec,d);d=32;c&&(d|=2);b=b&16769217|d;F(a,b);return a} +function Ic(a){if(a.g!==Eb)return!1;var b=a.j;b=Fc(b,b[E]|0);Cb(b,2048);a.j=b;a.g=void 0;a.i=void 0;return!0}function Jc(a){if(!Ic(a)&&I(a,a.j[E]|0))throw Error();}function Kc(a,b){b===void 0&&(b=a[E]|0);b&32&&!(b&4096)&&F(a,b|4096)}function Gc(a,b,c){return c&2?!0:c&32&&!(c&4096)?(F(b,c|2),a.g=Eb,!0):!1};var Lc=Mb(0);function Mc(a,b,c,d){a=Nc(a.j,b,c,d);if(a!==null)return a}function Nc(a,b,c,d){if(b===-1)return null;var e=b+(c?0:-1),f=a.length-1;if(!(f<1+(c?0:-1))){if(e>=f){var g=a[f];if(g!=null&&typeof g==="object"&&g.constructor===Object){c=g[b];var h=!0}else if(e===f)c=g;else return}else c=a[e];if(d&&c!=null){d=d(c);if(d==null)return d;if(!r(Object,"is").call(Object,d,c))return h?g[b]=d:a[e]=d,d}return c}} +function M(a,b,c,d){var e=c+-1,f=a.length-1;if(f>=0&&e>=f){var g=a[f];if(g!=null&&typeof g==="object"&&g.constructor===Object)return g[c]=d,b}if(e<=f)return a[e]=d,b;if(d!==void 0){var h;f=((h=b)!=null?h:b=a[E]|0)>>14&1023||536870912;c>=f?d!=null&&(e={},a[f+-1]=(e[c]=d,e)):a[e]=d}return b} +function Oc(a,b,c,d,e){var f=a.j,g=f[E]|0;d=I(a,g)?1:d;e=!!e||d===3;d===2&&Ic(a)&&(f=a.j,g=f[E]|0);a=Pc(f,b);var h=a===Ab?7:a[E]|0,k=Qc(h,g);var l=4&k?!1:!0;if(l){4&k&&(a=$b(a),h=0,k=Rc(k,g),g=M(f,g,b,a));for(var m=0,n=0;m<a.length;m++){var p=c(a[m]);p!=null&&(a[n++]=p)}n<m&&(a.length=n);c=(k|4)&-513;k=c&=-1025;k&=-4097}k!==h&&(F(a,k),2&k&&Object.freeze(a));return a=Sc(a,k,f,g,b,d,l,e)} +function Sc(a,b,c,d,e,f,g,h){var k=b;f===1||(f!==4?0:2&b||!(16&b)&&32&d)?Tc(b)||(b|=!a.length||g&&!(4096&b)||32&d&&!(4096&b||16&b)?2:256,b!==k&&F(a,b),Object.freeze(a)):(f===2&&Tc(b)&&(a=$b(a),k=0,b=Rc(b,d),d=M(c,d,e,a)),Tc(b)||(h||(b|=16),b!==k&&F(a,b)));2&b||!(4096&b||16&b)||Kc(c,d);return a}function Pc(a,b){a=Nc(a,b);return Array.isArray(a)?a:Ab}function Qc(a,b){2&b&&(a|=2);return a|1}function Tc(a){return!!(2&a)&&!!(4&a)||!!(256&a)} +function Uc(a,b,c,d){Jc(a);var e=a.j;M(e,e[E]|0,b,(d==="0"?Number(c)===0:c===d)?void 0:c);return a}function Vc(a){if(rb){var b;return(b=a[ub])!=null?b:a[ub]=new q.Map}if(ub in a)return a[ub];b=new q.Map;Object.defineProperty(a,ub,{value:b});return b}function Wc(a,b,c){var d=Xc,e=a.get(d);if(e!=null)return e;for(var f=e=0;f<d.length;f++){var g=d[f];Nc(b,g)!=null&&(e!==0&&(c=M(b,c,e)),e=g)}a.set(d,e);return e} +function Yc(a,b,c,d){var e=!1;d=Nc(a,d,void 0,function(f){var g=uc(f,c,b);e=g!==f&&g!=null;return g});if(d!=null)return e&&!I(d)&&Kc(a,b),d}function Zc(a,b,c){var d=a.j,e=d[E]|0;b=Yc(d,e,b,c);if(b==null)return b;e=d[E]|0;if(!I(a,e)){var f,g=b,h=g.j,k=h[E]|0;I(g,k)?Gc(g,h,k)?f=Hc(g,h,!0):f=new g.constructor(Fc(h,k,!1)):f=g;f!==b&&(Ic(a)&&(d=a.j,e=d[E]|0),b=f,e=M(d,e,c,b),Kc(d,e))}return b}function $c(a){a==null&&(a=void 0);return a} +function ad(a,b,c){var d=c=$c(c);Jc(a);var e=a.j;M(e,e[E]|0,b,d);c&&!I(c)&&Kc(a.j)}function Rc(a,b){return a=(2&b?a|2:a&-3)&-273} +function bd(a,b,c,d){Jc(a);var e=a.j,f=e,g=e[E]|0,h=I(a,g)?1:2;h===2&&Ic(a)&&(f=a.j,g=f[E]|0);a=Pc(f,b);var k=a===Ab?7:a[E]|0,l=Qc(k,g),m=!(4&l);if(m){var n=a,p=g,C=!!(2&l);C&&(p|=2);for(var v=!C,D=!0,T=0,P=0;T<n.length;T++){var ba=uc(n[T],c,p);if(ba instanceof c){if(!C){var ra=I(ba);v&&(v=!ra);D&&(D=ra)}n[P++]=ba}}P<T&&(n.length=P);l|=4;l=D?l&-4097:l|4096;l=v?l|8:l&-9}l!==k&&(F(a,l),2&l&&Object.freeze(a));b=a=Sc(a,l,f,g,b,h,m,!0);d=d!=null?d:new c;b.push(d);f=c=b===Ab?7:b[E]|0;(d=I(d))?(c&=-9,b.length=== +1&&(c&=-4097)):c|=4096;c!==f&&F(b,c);d||Kc(e)}function N(a,b){var c=c===void 0?!1:c;a=ec(Mc(a,b));return a!=null?a:c}function cd(a){var b=b===void 0?0:b;a=ic(Mc(a,3));return a!=null?a:b}function dd(a,b){var c=c===void 0?"":c;a=tc(Mc(a,b));return a!=null?a:c}function ed(a,b){var c=c===void 0?0:c;a=Mc(a,b);a=a==null?a:cc(a)?a|0:void 0;return a!=null?a:c}function fd(a,b,c){if(c!=null&&typeof c!=="boolean")throw Error("Expected boolean but got "+Aa(c)+": "+c);return Uc(a,b,c,!1)} +function R(a,b,c){return Uc(a,b,c==null?c:jc(c),"0")}function gd(a,b,c){if(c!=null&&typeof c!=="string")throw Error();return Uc(a,b,c,"")}function hd(a,b,c){if(c!=null){if(!cc(c))throw ob("enum");c|=0}return Uc(a,b,c,0)};function id(a,b){this.h=a>>>0;this.g=b>>>0}function jd(a){if(!a)return kd||(kd=new id(0,0));if(!/^-?\d+$/.test(a))return null;Zb(a);return new id(J,K)}var kd;function ld(){this.g=[]}ld.prototype.length=function(){return this.g.length};ld.prototype.end=function(){var a=this.g;this.g=[];return a};function md(a,b,c){for(;c>0||b>127;)a.g.push(b&127|128),b=(b>>>7|c<<25)>>>0,c>>>=7;a.g.push(b)}function nd(a,b){for(;b>127;)a.g.push(b&127|128),b>>>=7;a.g.push(b)};function od(){this.i=[];this.h=0;this.g=new ld}function pd(a,b){b.length!==0&&(a.i.push(b),a.h+=b.length)}function qd(a,b){nd(a.g,b*8+2);b=a.g.end();pd(a,b);b.push(a.h);return b}function rd(a,b){var c=b.pop();for(c=a.h+a.g.length()-c;c>127;)b.push(c&127|128),c>>>=7,a.h++;b.push(c);a.h++}function sd(a,b,c){nd(a.g,b*8+2);nd(a.g,c.length);pd(a,a.g.end());pd(a,c)};function td(){function a(){throw Error();}r(Object,"setPrototypeOf").call(Object,a,a.prototype);return a}var ud=td(),vd=td(),wd=td(),xd=td(),yd=td();function S(a,b,c){this.j=L(a,b,c,2048)}S.prototype.toJSON=function(){var a=zc(this);return a};S.prototype[xb]=Db;S.prototype.toString=function(){return this.j.toString()};function zd(a,b){this.g=a;a=Ba(ud);this.h=!!a&&b===a||!1}function Ad(a){var b=b===void 0?ud:b;return new zd(a,b)}function Bd(a,b,c,d,e){b=Cd(b,d);b!=null&&(c=qd(a,c),e(b,a),rd(a,c))}var Dd=Ad(Bd),Ed=Ad(Bd),Fd=(0,q.Symbol)(),Gd=(0,q.Symbol)(),Hd,Id; +function Jd(a){var b=Kd,c=Ld,d=a[Fd];if(d)return d;d={};d.za=a;d.S=Cc(a[0]);var e=a[1],f=1;e&&e.constructor===Object&&(d.ia=e,e=a[++f],typeof e==="function"&&(d.pa=!0,Hd!=null||(Hd=e),Id!=null||(Id=a[f+1]),e=a[f+=2]));for(var g={};e&&Array.isArray(e)&&e.length&&typeof e[0]==="number"&&e[0]>0;){for(var h=0;h<e.length;h++)g[e[h]]=e;e=a[++f]}for(h=1;e!==void 0;){typeof e==="number"&&(h+=e,e=a[++f]);var k=void 0;if(e instanceof zd)var l=e;else l=Dd,f--;e=void 0;if((e=l)==null?0:e.h){e=a[++f];k=a;var m= +f;typeof e==="function"&&(e=e(),k[m]=e);k=e}e=a[++f];m=h+1;typeof e==="number"&&e<0&&(m-=e,e=a[++f]);for(;h<m;h++){var n=g[h];k?c(d,h,l,k,n):b(d,h,l,n)}}return a[Fd]=d}function Cd(a,b){if(a instanceof S)return a.j;if(Array.isArray(a))return L(a,b[0],b[1])};function Kd(a,b,c){a[b]=c.g}function Ld(a,b,c,d){var e,f,g=c.g;a[b]=function(h,k,l){return g(h,k,l,f||(f=Jd(d).S),e||(e=Md(d)))}}function Md(a){var b=a[Gd];if(!b){var c=Jd(a);b=function(d,e){return Nd(d,e,c)};a[Gd]=b}return b}function Nd(a,b,c){Gb(a,a[E]|0,function(d,e){if(e!=null){var f=Od(c,d);f?f(b,e,d):d<500||pb(vb,3)}})} +function Od(a,b){var c=a[b];if(c)return c;if(c=a.ia)if(c=c[b]){c=Array.isArray(c)?c[0]instanceof zd?c:[Ed,c]:[c,void 0];var d=c[0].g;if(c=c[1]){var e=Md(c),f=Jd(c).S;c=a.pa?Id(f,e):function(g,h,k){return d(g,h,k,f,e)}}else c=d;return a[b]=c}};function Pd(a,b){var c=new od;Nd(a.j,c,Jd(b));pd(c,c.g.end());a=new Uint8Array(c.h);b=c.i;for(var d=b.length,e=0,f=0;f<d;f++){var g=b[f];a.set(g,e);e+=g.length}c.i=[a];return a}function Qd(a,b){return new zd(a,b)}function Rd(a,b,c,d,e){b=Cd(b,d);b!=null&&(c=qd(a,c),e(b,a),rd(a,c))} +var Sd=Qd(function(a,b,c){b=rc(b);if(b!=null){switch(typeof b){case "string":jd(b)}if(b!=null)switch(nd(a.g,c*8),typeof b){case "number":a=a.g;Ub(b);md(a,J,K);break;case "bigint":c=BigInt.asUintN(64,b);c=new id(Number(c&BigInt(4294967295)),Number(c>>BigInt(32)));md(a.g,c.h,c.g);break;default:c=jd(b),md(a.g,c.h,c.g)}}},xd),Td=Qd(function(a,b,c){b=ec(b);b!=null&&(nd(a.g,c*8),a.g.g.push(b?1:0))},vd),Ud; +Ud=new zd(function(a,b,c){if(Array.isArray(b)){var d=b[E]|0;if(!(d&4)){for(var e=0,f=0;e<b.length;e++){var g=tc(b[e]);g!=null&&(b[f++]=g)}f<e&&(b.length=f);e=(d|5)&-1537;e!==d&&F(b,e);e&2&&Object.freeze(b)}}else b=void 0;if(b!=null)for(d=0;d<b.length;d++)e=a,f=c,g=b[d],g!=null&&sd(e,f,Ga(g))},wd);var Vd=Qd(function(a,b,c){b=tc(b);b!=null&&sd(a,c,Ga(b))},wd),Wd,Xd=void 0;Xd=Xd===void 0?ud:Xd; +Wd=new zd(function(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)Rd(a,b[f],c,d,e);a=b[E]|0;a&1||F(b,a|1)}},Xd);var Yd=Ad(Rd),Zd=Qd(function(a,b,c){b=ic(b);if(b!=null)if(b=parseInt(b,10),nd(a.g,c*8),a=a.g,c=b,c>=0)nd(a,c);else{for(b=0;b<9;b++)a.g.push(c&127|128),c>>=7;a.g.push(1)}},yd);function $d(a){return function(){return Pd(this,a)}};function ae(a,b){if(a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b(a[c],c,a)}function be(a,b){if(a)return(aa=r(Object,"keys").call(Object,a),r(aa,"find")).call(aa,function(c){return Object.prototype.hasOwnProperty.call(a,c)&&b(a[c],c)})};function ce(a){try{var b;if(b=!!a&&a.location.href!=null)a:{try{bb(a.foo);b=!0;break a}catch(c){}b=!1}return b}catch(c){return!1}}function de(a){return ce(a.top)?a.top:null};function ee(a){var b=!1,c;return function(){b||(c=a(),b=!0);return c}}function fe(a){function b(){d=A.setTimeout(c,1E3);var g=f;f=[];a.apply(void 0,g)}function c(){d=0;e&&(e=!1,b())}var d=0,e=!1,f=[];return function(g){f=arguments;d?e=!0:b()}};/* + + Copyright Google LLC + SPDX-License-Identifier: Apache-2.0 +*/ +var ge=q.globalThis.trustedTypes,he;function ie(){var a=null;if(!ge)return a;try{var b=function(c){return c};a=ge.createPolicy("goog#html",{createHTML:b,createScript:b,createScriptURL:b})}catch(c){}return a};function je(a){this.g=a}je.prototype.toString=function(){return this.g+""};function ke(a){var b;he===void 0&&(he=ie());a=(b=he)?b.createScriptURL(a):a;return new je(a)};function le(a){var b=wa.apply(1,arguments);if(b.length===0)return ke(a[0]);for(var c=a[0],d=0;d<b.length;d++)c+=encodeURIComponent(b[d])+a[d+1];return ke(c)};function me(a,b){b=b===void 0?document:b;return b.createElement(String(a).toLowerCase())};function ne(a){a=a&&a.toString&&a.toString();return typeof a==="string"&&a.indexOf("[native code]")!=-1};function oe(a){return Array.prototype.reduce.call(arguments,function(b,c){return b+c},0)}function pe(a){return oe.apply(null,arguments)/arguments.length};function qe(a,b){this.x=a!==void 0?a:0;this.y=b!==void 0?b:0}qe.prototype.equals=function(a){return a instanceof qe&&(this==a?!0:this&&a?this.x==a.x&&this.y==a.y:!1)};qe.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};qe.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};qe.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function re(a,b){this.width=a;this.height=b}re.prototype.aspectRatio=function(){return this.width/this.height};re.prototype.isEmpty=function(){return!(this.width*this.height)};re.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};re.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};re.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function se(a){for(var b in a)delete a[b]};function te(a,b){for(;a&&a.nodeType!=1;)a=b?a.nextSibling:a.previousSibling;return a}function ue(a){return a.nodeType==9?a:a.ownerDocument||a.document}function ve(a){var b=we;a&&(a=a.parentNode);for(var c=0;a&&c<=6;){if(b(a))return a;a=a.parentNode;c++}return null}function xe(a){this.g=a||A.document||document};function ye(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}ye.prototype.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};ye.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this}; +ye.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function ze(a){try{return a.getBoundingClientRect()}catch(b){return{left:0,top:0,right:0,bottom:0}}}function Ae(a){var b=a.offsetWidth,c=a.offsetHeight,d=cb&&!b&&!c;return(b===void 0||d)&&a.getBoundingClientRect?(a=ze(a),new re(a.right-a.left,a.bottom-a.top)):new re(b,c)};var Be=ee(function(){var a=!1;try{var b=Object.defineProperty({},"passive",{get:function(){a=!0}});A.addEventListener("test",null,b)}catch(c){}return a});function Ce(a){return a?a.passive&&Be()?a:a.capture||!1:!1}function De(a,b,c,d){typeof a.addEventListener==="function"&&a.addEventListener(b,c,Ce(d))}function Ee(a,b,c){typeof a.removeEventListener==="function"&&a.removeEventListener(b,c,Ce())};function Fe(a,b){a.google_image_requests||(a.google_image_requests=[]);var c=me("IMG",a.document);c.src=b;a.google_image_requests.push(c)};function Ge(a,b){var c=c===void 0?{}:c;this.error=a;this.meta=c;this.context=b.context;this.msg=b.message||"";this.id=b.id||"jserror"};function He(a){var b=a.toString();a.name&&b.indexOf(a.name)==-1&&(b+=": "+a.name);a.message&&b.indexOf(a.message)==-1&&(b+=": "+a.message);if(a.stack)a:{a=a.stack;var c=b;try{a.indexOf(c)==-1&&(a=c+"\n"+a);for(var d;a!=d;)d=a,a=a.replace(RegExp("((https?:/..*/)[^/:]*:\\d+(?:.|\n)*)\\2"),"$1");b=a.replace(RegExp("\n *","g"),"\n");break a}catch(e){b=c;break a}b=void 0}return b};var Ie=RegExp("^https?://(\\w|-)+\\.cdn\\.ampproject\\.(net|org)(\\?|/|$)");function Ke(a,b){this.g=a;this.h=b}function Le(a,b){this.url=a;this.g=!!b;this.depth=null};var Me=null;function Ne(){var a=a===void 0?A:a;return(a=a.performance)&&a.now&&a.timing?Math.floor(a.now()+a.timing.navigationStart):Date.now()}function Oe(){var a=a===void 0?A:a;return(a=a.performance)&&a.now?a.now():null};function Pe(a,b,c,d){this.label=a;this.type=b;this.value=c;this.duration=d===void 0?0:d;this.taskId=this.slotId=void 0;this.uniqueId=Math.random()};var U=A.performance,Qe=!!(U&&U.mark&&U.measure&&U.clearMarks),Re=ee(function(){var a;if(a=Qe){var b=b===void 0?window:b;if(Me===null){Me="";try{a="";try{a=b.top.location.hash}catch(d){a=b.location.hash}if(a){var c=a.match(/\bdeid=([\d,]+)/);Me=c?c[1]:""}}catch(d){}}b=Me;a=!!b.indexOf&&b.indexOf("1337")>=0}return a}); +function Se(a,b){this.l=[];this.g=b||A;var c=null;b&&(b.google_js_reporting_queue=b.google_js_reporting_queue||[],this.l=b.google_js_reporting_queue,c=b.google_measure_js_timing);this.h=Re()||(c!=null?c:Math.random()<a)}Se.prototype.B=function(){this.h=!1;this.l!==this.g.google_js_reporting_queue&&(Re()&&Ua(this.l,Te),this.l.length=0)};Se.prototype.F=function(a){!this.h||this.l.length>2048||this.l.push(a)}; +function Te(a){a&&U&&Re()&&(U.clearMarks("goog_"+a.label+"_"+a.uniqueId+"_start"),U.clearMarks("goog_"+a.label+"_"+a.uniqueId+"_end"))}function Ue(a,b,c,d,e){a.h&&a.F(new Pe(b,c,d,e===void 0?0:e))}Se.prototype.start=function(a,b){if(!this.h)return null;a=new Pe(a,b,Oe()||Ne());b="goog_"+a.label+"_"+a.uniqueId+"_start";U&&Re()&&U.mark(b);return a}; +Se.prototype.end=function(a){if(this.h&&typeof a.value==="number"){a.duration=(Oe()||Ne())-a.value;var b="goog_"+a.label+"_"+a.uniqueId+"_end";U&&Re()&&U.mark(b);this.F(a)}};function Ve(a,b){if(a.h){var c=a.start("243",3);try{b()}catch(d){throw Te(c),d;}a.end(c)}else b()};function We(){this.i="&";this.h={};this.l=0;this.g=[]}function Xe(a,b){var c={};c[a]=b;return[c]}function Ye(a,b,c,d,e){var f=[];ae(a,function(g,h){(g=Ze(g,b,c,d,e))&&f.push(h+"="+g)});return f.join(b)} +function Ze(a,b,c,d,e){if(a==null)return"";b=b||"&";c=c||",$";typeof c==="string"&&(c=c.split(""));if(a instanceof Array){if(d||(d=0),d<c.length){for(var f=[],g=0;g<a.length;g++)f.push(Ze(a[g],b,c,d+1,e));return f.join(c[d])}}else if(typeof a==="object")return e||(e=0),e<2?encodeURIComponent(Ye(a,b,c,d,e+1)):"...";return encodeURIComponent(String(a))} +function $e(a,b,c){b="https://"+b+c;var d=af(a)-c.length;if(d<0)return"";a.g.sort(function(m,n){return m-n});c=null;for(var e="",f=0;f<a.g.length;f++)for(var g=a.g[f],h=a.h[g],k=0;k<h.length;k++){if(!d){c=c==null?g:c;break}var l=Ye(h[k],a.i,",$");if(l){l=e+l;if(d>=l.length){d-=l.length;b+=l;e=a.i;break}c=c==null?g:c}}a="";c!=null&&(a=e+"trn="+c);return b+a}function af(a){var b=1,c;for(c in a.h)c.length>b&&(b=c.length);return 3997-b-a.i.length-1};var bf=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function cf(a){return a?decodeURI(a):a};function df(){var a=ef;this.m=ff;this.h=a===void 0?null:a;this.i=null;this.l=!1;this.v=this.g}df.prototype.H=function(a,b){try{if(this.h&&this.h.h){var c=this.h.start(a.toString(),3);var d=b();this.h.end(c)}else d=b()}catch(g){b=!0;try{Te(c),b=this.v(a,new Ge(g,{message:He(g)}),void 0,void 0)}catch(h){this.g(217,h)}if(b){var e,f;(e=window.console)==null||(f=e.error)==null||f.call(e,g)}else throw g;}return d}; +df.prototype.T=function(a,b){var c=this;return function(){var d=wa.apply(0,arguments);return c.H(a,function(){return b.apply(void 0,d)})}}; +df.prototype.g=function(a,b,c,d,e){e=e||"jserror";var f=void 0;try{var g=new We;g.g.push(1);g.h[1]=Xe("context",a);b.error&&b.meta&&b.id||(b=new Ge(b,{message:He(b)}));if(b.msg){var h=b.msg.substring(0,512);g.g.push(2);g.h[2]=Xe("msg",h)}var k=b.meta||{};if(this.i)try{this.i(k)}catch(Q){}if(d)try{d(k)}catch(Q){}d=[k];g.g.push(3);g.h[3]=d;var l;if(!(l=v)){h=A;d=[];k=null;do{var m=h;if(ce(m)){var n=m.location.href;k=m.document&&m.document.referrer||null}else n=k,k=null;d.push(new Le(n||""));try{h=m.parent}catch(Q){h= +null}}while(h&&m!==h);n=0;for(var p=d.length-1;n<=p;++n)d[n].depth=p-n;m=A;if(m.location&&m.location.ancestorOrigins&&m.location.ancestorOrigins.length===d.length-1)for(p=1;p<d.length;++p){var C=d[p];C.url||(C.url=m.location.ancestorOrigins[p-1]||"",C.g=!0)}l=d}var v=l;var D=new Le(A.location.href,!1);l=null;var T=v.length-1;for(m=T;m>=0;--m){var P=v[m];!l&&Ie.test(P.url)&&(l=P);if(P.url&&!P.g){D=P;break}}P=null;var ba=v.length&&v[T].url;D.depth!==0&&ba&&(P=v[T]);f=new Ke(D,P);if(f.h){var ra=f.h.url|| +"";g.g.push(4);g.h[4]=Xe("top",ra)}var La={url:f.g.url||""};if(f.g.url){var da=f.g.url.match(bf),ia=da[1],$a=da[3],H=da[4];v="";ia&&(v+=ia+":");$a&&(v+="//",v+=$a,H&&(v+=":"+H));var G=v}else G="";La=[La,{url:G}];g.g.push(5);g.h[5]=La;gf(this.m,e,g,this.l,c)}catch(Q){try{var u,w;gf(this.m,e,{context:"ecmserr",rctx:a,msg:He(Q),url:(w=(u=f)==null?void 0:u.g.url)!=null?w:""},this.l,c)}catch(Je){}}return!0};function hf(a){this.j=L(a,void 0,void 0,2048)}x(hf,S);function jf(a){this.j=L(a,void 0,void 0,2048)}x(jf,S);function kf(a){this.j=L(a,void 0,void 0,2048)}x(kf,S);kf.prototype.getName=function(){return dd(this,1)};var Xc=[5];function lf(a){this.j=L(a,void 0,void 0,2048)}x(lf,S);function of(a){this.j=L(a,void 0,void 0,2048)}x(of,S);var pf=[0,Xc,Vd,Zd,Sd,-1,Yd,[0,Zd,Wd,[0,Zd,-1,Vd,-2,Td]]];of.prototype.h=$d([0,Zd,-2,Sd,-16,[0,Ud,Sd,Zd],Td,Zd,Sd,Td]);function qf(a){this.j=L(a,void 0,void 0,2048)}x(qf,S);qf.prototype.h=$d([0,Sd,Zd]);function rf(){};function sf(){this.domain="pagead2.googlesyndication.com";this.path="/pagead/gen_204?id=";this.g=Math.random()}function tf(){var a=ff,b=window.google_srt;b>=0&&b<=1&&(a.g=b)}function gf(a,b,c,d,e){if(((d===void 0?0:d)?a.g:Math.random())<(e||.01))try{if(c instanceof We)var f=c;else f=new We,ae(c,function(h,k){var l=f,m=l.l++;h=Xe(k,h);l.g.push(m);l.h[m]=h});var g=$e(f,a.domain,a.path+b+"&");g&&Fe(A,g)}catch(h){}};var ff,uf,ef=new Se(1,window);(function(a){ff=a!=null?a:new sf;typeof window.google_srt!=="number"&&(window.google_srt=Math.random());tf();uf=new df;uf.i=function(){};uf.l=!0;window.document.readyState==="complete"?window.google_measure_js_timing||ef.B():ef.h&&De(window,"load",function(){window.google_measure_js_timing||ef.B()})})();function vf(a,b){return uf.T(a,b)};function wf(a){this.j=L(a,void 0,void 0,2048)}x(wf,S);wf.prototype.h=$d([0,Wd,pf]);var xf=ta(["https://pagead2.googlesyndication.com/pagead/js/err_rep.js"]);function yf(){var a=a===void 0?"jserror":a;var b=b===void 0?.01:b;var c=c===void 0?le(xf):c;this.h=a;this.i=b;this.l=c} +yf.prototype.g=function(a,b,c,d){c=c===void 0?this.i:c;d=d===void 0?this.h:d;if(Math.random()>c)return!1;b.error&&b.meta&&b.id||(b=new Ge(b,{context:a,id:d}));A.google_js_errors=A.google_js_errors||[];A.google_js_errors.push(b);if(!A.error_rep_loaded){b=A.document;a=me("SCRIPT",b);c=this.l;if(c instanceof je)c=c.g;else throw Error("");a.src=c;var e;c=a.ownerDocument;c=c===void 0?document:c;var f;c=(f=(e=c).querySelector)==null?void 0:f.call(e,"script[nonce]");(e=c==null?"":c.nonce||c.getAttribute("nonce")|| +"")&&a.setAttribute("nonce",e);(e=b.getElementsByTagName("script")[0])&&e.parentNode&&e.parentNode.insertBefore(a,e);A.error_rep_loaded=!0}return!1};yf.prototype.H=function(a,b){try{return b()}catch(c){if(!this.g(a,c,this.i,this.h))throw c;}};yf.prototype.T=function(a,b){var c=this;return function(){var d=wa.apply(0,arguments);return c.H(a,function(){return b.apply(void 0,d)})}};function zf(a){var b;a.visibilityState?b="visibilitychange":a.mozVisibilityState?b="mozvisibilitychange":a.webkitVisibilityState&&(b="webkitvisibilitychange");return b};function Af(a){this.j=L(a,void 0,void 0,2048)}x(Af,S);function Bf(a){this.j=L(a,void 0,void 0,2048)}x(Bf,S);Bf.prototype.getCorrelator=function(){var a=a===void 0?Lc:a;var b=Ma?Mc(this,1,void 0,qc):qc(Mc(this,1));return b!=null?b:a};Bf.prototype.setCorrelator=function(a){return R(this,1,a)};function Cf(a){this.j=L(a,void 0,void 0,2048)}x(Cf,S);function Df(a){return a._google_rum_ns_=a._google_rum_ns_||{}}function Ef(a){a=Df(a);return a.pq=a.pq||[]};function Ff(){if(!A._google_rum_ns_)return!1;var a=Df(A);return!(!a.raf||!a.ric)}function Gf(){var a=Df(A);a.raf=a.raf||[];a.ric=a.ric||[];return{la:a.raf,ma:a.ric}};function Hf(a,b,c){ae(b,function(d,e){var f=c&&c[e];!d&&d!==0||f||(a+="&"+encodeURIComponent(e)+"="+encodeURIComponent(String(d)),c&&(c[e]=!0))});return a} +function If(a,b,c,d,e,f,g,h){function k(){var m=wa.apply(0,arguments)[0],n=m[0];m=m[1];var p=n.length+m.length+2;l.v+l.i+p>8E3&&Jf(l);l.J.push([n,m]);l.i+=p;l.v+l.i>=6E3&&Jf(l);return 0}f=f===void 0?Infinity:f;g=g===void 0?!1:g;Se.call(this,a,h);var l=this;this.U=b;this.domain=c;this.path=d;this.V=e;this.C=0;this.D={};this.K={};this.I=[];this.m={};this.i=0;this.J=[];this.N=f;a=this.g.navigator;this.M=!(this.domain!=="csi.gstatic.com"||!a||!a.sendBeacon);this.g.performance&&this.g.performance.now|| +V(this,"dat",1);a&&a.deviceMemory&&V(this,"dmc",a.deviceMemory);this.g===this.g.top&&V(this,"top",1);this.W=!g;this.O=function(){l.g.setTimeout(function(){Jf(l)},1100)};this.P=function(){for(var m=y(l.I),n=m.next();!n.done;n=m.next()){n=n.value;try{n()}catch(C){}}m=l.g;var p=p===void 0?{}:p;typeof window.CustomEvent==="function"?n=new CustomEvent("rum_blp",p):(n=document.createEvent("CustomEvent"),n.initCustomEvent("rum_blp",!!p.bubbles,!!p.cancelable,p.detail));m.dispatchEvent(n);Jf(l)};this.L=fe(function(){Jf(l)}); +this.X=function(){var m=l.g.document;(m.hidden!=null?m.hidden:m.mozHidden!=null?m.mozHidden:m.webkitHidden!=null&&m.webkitHidden)&&l.L()};this.G=this.g.setTimeout(function(){Jf(l)},5E3);this.v=b.length+c.length+d.length+e.length+3;Ua(this.l,function(m){Kf(l,m)});b=Ef(this.g);Ua(b,function(m){return k(m)});b.length=0;b.push=k;V(this,"puid",(this.C+1).toString(36)+"~"+Date.now().toString(36));Lf(this)}x(If,Se);function Mf(a,b){a.I.push(b)} +function Lf(a){a.g.document.readyState==="complete"?a.g.setTimeout(function(){Jf(a)},0):De(a.g,"load",a.O);var b=zf(a.g.document);typeof b!=="undefined"&&De(a.g,b,a.X);De(a.g,"pagehide",a.P)}function V(a,b,c){c=String(c);a.v=a.D[b]!=null?a.v+(c.length-a.D[b].length):a.v+(b.length+c.length+2);a.D[b]=c}function Nf(a,b){var c="ec="+b;a.K[c]||(Of(a,"ec",b,!1),c.length<1E3&&(a.K[c]=!0))} +function Of(a,b,c,d,e){e=e===void 0?"":e;var f=a.m[b]==null?b.length+c.length+2:d?c.length+(e===void 0?"":e).length:c.length-a.m[b].length;a.v+a.i+f>8E3&&(Jf(a),f=b.length+c.length+2);a.m[b]=d&&a.m[b]!=null?a.m[b]+((e===void 0?"":e)+c):c;a.i+=f;a.v+a.i>=6E3&&Jf(a)}function Jf(a){if(a.h&&a.W){try{a.i&&(a.sendBeacon(a.m),a.C===a.N&&a.B())}catch(b){(new yf).g(358,b)}a.m={};a.i=0;a.l.length=0;a.g.clearTimeout(a.G);a.G=0}} +function Pf(a,b){var c=a.U+"//"+a.domain+a.path+a.V,d={};c=Hf(c,a.D,d);c=Hf(c,b,d);b=a.g;b.google_timing_params&&(c=Hf(c,b.google_timing_params,d),b.google_timing_params=void 0);Ua(a.J,function(e){var f=y(e);e=f.next().value;f=f.next().value;var g={};c=Hf(c,(g[e]=f,g))});a.J.length=0;return c} +If.prototype.sendBeacon=function(a){this.C++;a=Pf(this,a);var b=!1;try{b=!!(this.M&&this.g.navigator&&this.g.navigator.sendBeacon(a,null))}catch(c){this.M=!1}b||Fe(this.g,a);V(this,"puid",(this.C+1).toString(36)+"~"+Date.now().toString(36))};function Qf(a,b,c,d,e){Of(a,"met."+b,c,d===void 0?!1:d,e===void 0?"~":e)}function Rf(a,b){var c=""+a;ae(b,function(d,e){d!=null&&(c+="."+e+"_"+d)});return c}function Sf(a,b,c){c=Rf(b,c);var d={};b=(d["met."+b]=c,d);a.sendBeacon(b)} +function Kf(a,b){var c="met."+b.type,d=typeof b.value==="number"?Math.round(b.value).toString(36):b.value,e=Math.round(b.duration);b=b.label+(b.slotId!=null?"_"+b.slotId:"")+("."+d)+(e>0?"_"+e.toString(36):"")+(b.taskId!=null?"__"+Math.round(b.taskId).toString(36):"");Of(a,c,b,!0,"~")}If.prototype.F=function(a){this.h&&this.C<this.N&&(Se.prototype.F.call(this,a),Kf(this,a))}; +If.prototype.B=function(){Se.prototype.B.call(this);this.g.clearTimeout(this.G);this.i=this.G=0;this.m={};se(this.K);se(this.D);Ee(this.g,"load",this.O);Ee(this.g,"pagehide",this.P)};function Tf(a){var b=4;b===void 0&&(b=0);lb();b=eb[b];for(var c=Array(Math.floor(a.length/3)),d=b[64]||"",e=0,f=0;e<a.length-2;e+=3){var g=a[e],h=a[e+1],k=a[e+2],l=b[g>>2];g=b[(g&3)<<4|h>>4];h=b[(h&15)<<2|k>>6];k=b[k&63];c[f++]=l+g+h+k}l=0;k=d;switch(a.length-e){case 2:l=a[e+1],k=b[(l&15)<<2]||d;case 1:a=a[e],c[f]=b[a>>2]+b[(a&3)<<4|l>>4]+k+d}return c.join("")};var Uf={self:1,"same-origin-ancestor":2,"same-origin-descendant":3,"same-origin":4,"cross-origin-ancestor":5,"cross-origin-descendant":6,"cross-origin-unreachable":7,"multiple-contexts":8},Vf={script:1,layout:2},Wf={iframe:1,embed:2,object:3};function Xf(a){var b=new jf;hd(b,1,Uf[a.name]);Ua(a.attribution,function(c){var d=new hf;hd(d,1,Vf[c.name]);hd(d,2,Wf[c.containerType]);typeof c.containerId==="string"&&fd(d,6,c.containerId.lastIndexOf("google_ads_iframe",0)==0);bd(b,2,hf,d)});return b} +function Yf(a,b){b=Tf(b.h());var c={};Sf(a,6,(c[1]=b,c))} +function Zf(a,b){if(b.PerformanceLongTaskTiming&&b.PerformanceObserver){var c=0;(new b.PerformanceObserver(vf(246,function(d,e){var f=new wf;Ua(d.getEntries(),function(g){var h=new kf;R(h,3,Math.round(g.startTime));R(h,4,Math.round(g.duration));g=Xf(g);g=$c(g);a:{var k=g;Jc(h);var l=h.j,m=l[E]|0;if(k==null){var n=Vc(l);if(Wc(n,l,m)===5)n.set(Xc,0);else break a}else{n=Vc(l);var p=Wc(n,l,m);p!==5&&(p&&(m=M(l,m,p)),n.set(Xc,5))}M(l,m,5,k)}g&&!I(g)&&Kc(h.j);bd(f,1,kf,h)});Yf(a,f);++c>=10&&e.disconnect()}))).observe({type:"longtask", +buffered:!0})}};function $f(a){this.j=L(a,void 0,void 0,2048)}x($f,S);var ag=[0,Vd,Sd];function bg(a){this.j=L(a,void 0,void 0,2048)}x(bg,S);var cg=function(a){return function(b){return Pd(b,a)}}([0,Vd,Td,Wd,ag,Sd]);function dg(a){var b=A;b=b===void 0?A:b;this.l=a;this.g=b;this.h=0;var c;this.i=((c=this.g.navigator)==null?void 0:c.sendBeacon)!=null} +function eg(a,b,c){c=c===void 0?0:c;var d=a.g!==a.g.top,e=b.slice(a.h);b=e.splice(0,250-a.h);if(d&&a.i&&b){d=new bg;d=gd(d,1,a.l);e=fd(d,2,!!e.length);d=b;Jc(e);var f=e.j,g=f[E]|0;if(d==null)M(f,g,3);else{for(var h=d===Ab?7:d[E]|0,k=h,l=Tc(h),m=l||Object.isFrozen(d),n=!0,p=!0,C=0;C<d.length;C++){var v=d[C];l||(v=I(v),n&&(n=!v),p&&(p=v))}l||(h=n?13:5,h=p?h&-4097:h|4096);m&&h===k||(d=$b(d),k=0,h=Rc(h,g));h!==k&&F(d,h);g=M(f,g,3,d);2&h||!(4096&h||16&h)||Kc(f,g)}c=R(e,4,c);c=Tf(cg(c));try{var D;a.i&& +((D=a.g.navigator)==null||D.sendBeacon("https://pagead2.googlesyndication.com/pagead/gen_204?id=urind",c))}catch(T){a.i=!1}a.h+=b.length}};function fg(a){var b=a.position;a=a.timestamp;return Math.round(b).toString(36)+"."+Math.round(a).toString(36)}function gg(a){var b=this;this.i=-1;this.l=-Infinity;this.g=[];this.h=a;this.m=0;this.B=vf(456,function(){return hg(b)});this.v=function(){return ig(b)}}gg.prototype.install=function(){A.performance&&(hg(this),De(A,"scroll",this.B,{passive:!0}),Mf(this.h,this.v))}; +function hg(a){var b=A.pageYOffset||0,c=Oe()||0;if(Math.abs(b-a.i)>100||c-a.l>200)a.i=b,a.l=c,a.g.push({position:b,timestamp:c})>=400&&(ig(a),a.m>=8&&(Ee(A,"scroll",a.B),b=a.h.I,a=Ta(b,a.v),a>=0&&Array.prototype.splice.call(b,a,1)))}function ig(a){a.g.length&&(Qf(a.h,12,Wa(a.g,fg).join("~")),a.g=[],a.m++)};function jg(a){return Sb(a)?Number(a):String(a)};var kg=void 0;kg=kg===void 0?A:kg;var lg=kg.context||kg.AMP_CONTEXT_DATA;if(!lg)try{lg=kg.parent.context||kg.parent.AMP_CONTEXT_DATA}catch(a){}var mg,ng,og=!!(((mg=lg)==null?0:mg.pageViewId)&&((ng=lg)==null?0:ng.canonicalUrl)&&lg)&&A!==A.top;function pg(a){var b;a=((b=a===void 0?null:a)!=null?b:window).googletag;return(a==null?0:a.apiReady)?a:void 0};function qg(a){var b=pg(a);return b?Va(Wa(b.pubads().getSlots(),function(c){return a.document.getElementById(c.getSlotElementId())}),function(c){return c!=null}):null}function W(a,b){a=a.document.querySelectorAll(b);b=a.length;if(b>0){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];a=c}else a=[];return a}function rg(a){return a.filter(function(b){return!b.querySelector('[data-google-ad-efd="true"]')})} +function sg(a){var b=[];a=y(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;for(var d=!0,e=0;e<b.length;e++){var f=b[e];if(f.contains(c)){d=!1;break}if(c.contains(f)){d=!1;b[e]=c;break}}d&&b.push(c)}return b};function tg(a){a=a.document;var b={};a&&(b=a.compatMode=="CSS1Compat"?a.documentElement:a.body);return b||{}}function ug(a){var b;return(b=tg(a).clientWidth)!=null?b:void 0};function vg(a,b){this.i=[];this.h=a;this.g=b} +function wg(a,b){var c=(Ja&&Oa?Oa.mobile:!(Ja&&Oa?!Oa.mobile&&(B("iPad")||B("Android")||B("Silk")):B("iPad")||B("Android")&&!B("Mobile")||B("Silk"))&&(B("iPod")||B("iPhone")||B("Android")||B("IEMobile")))&&!(ug(a.h)>=900),d=Va([],function(f){return Ta(a.i,f)>=0}).join(","),e;b={wpc:"",su:b,eid:d,doc:(e=a.g.ga)!=null?e:null,pg_h:X(a.g.va),pg_w:X(a.g.xa),pg_hs:X(a.g.wa),c:X(a.g.qa),aa_c:X(a.g.aa),av_h:X(a.g.ca),av_w:X(a.g.da),av_a:X(a.g.ba),s:X(a.g.ua),all_s:X(a.g.ta),b:X(a.g.sa),all_b:X(a.g.ra),d:X(a.g.fa), +all_d:X(a.g.ea),ard:X(a.g.Z),all_ard:X(a.g.Y),pd_h:X(a.g.ya),dt:c?"m":"d"};c={};e=y(r(Object,"keys").call(Object,b));for(d=e.next();!d.done;d=e.next())d=d.value,b[d]!==null&&(c[d]=b[d]);return c}function xg(a){return pe.apply(null,Va(a,function(b){return b>0}))||null}function yg(a,b){return a<=0?null:oe.apply(null,b)/a} +function zg(a){for(var b=Infinity,c=0;c<a.length-1;c++)for(var d=c+1;d<a.length;d++){var e=a[c],f=a[d];e=Math.max(Math.max(0,e.left-f.right,f.left-e.right),Math.max(0,e.top-f.bottom,f.top-e.bottom));e>0&&(b=Math.min(e,b))}return b!==Infinity?b:null}function X(a){return a==null?null:r(Number,"isInteger").call(Number,a)?a.toString():a.toFixed(3)};function Ag(a,b){var c=navigator;c=c.getBattery&&c.getBattery();c!=null&&c.then?c.then(function(d){var e=d.level,f=d.charging;setTimeout(function(){b(e*100|0,d.level*100|0,f||d.charging)},a)}):b()};function Bg(a){var b=a.length;if(b===0)return 0;for(var c=305419896,d=0;d<b;d++)c^=(c<<5)+(c>>2)+a.charCodeAt(d)&4294967295;return c>0?c:4294967296+c};var Cg=/^.+\.((googlesyndication|googletagservices)\.com|doubleclick\.net)$/,Dg=/^(aswift_\d+|google_ads_iframe_.+)$/,Eg=/^div-gpt-ad-.+$/,Fg=["ZGl2LnRhYm9vbGE=","ZGl2Lk9VVEJSQUlO"];function Gg(a){if(!a)return"";var b=Math.floor(Math.random()*a.length);return b.toString(36)+encodeURIComponent(a.charAt(b))+"."+Bg(a).toString(36)}function Hg(a){return(a=cf(Ia(a).match(bf)[3]||null))?a.toLowerCase():""}function Ig(a){return a.offsetWidth>=10&&a.offsetHeight>=10} +function we(a){return a&&a.nodeType===1&&a.nodeName==="DIV"?Eg.test(a.id)||a.hasAttribute("data-google-query-id"):!1} +function Jg(a){var b=[];if(!a.body)return b;var c=a.body;a=c.getElementsByTagName("script");for(var d=a.length,e=0;e<d;e++){var f=a[e],g=f.src;g&&(f=(f.nextElementSibling!==void 0?f.nextElementSibling:te(f.nextSibling,!0))||f.parentElement||null)&&f.nodeName==="DIV"&&Ig(f)&&(g=Hg(g))&&!Cg.test(g)&&b.push(new Kg(f,g))}if(!c.querySelectorAll)return b;Ua(Fg,function(h){for(var k=c.querySelectorAll(jb(h)),l=k.length,m=0;m<l;m++){var n=k[m];Ig(n)&&b.push(new Kg(n,h))}});return b} +function Kg(a,b,c){this.id=b;this.g=c===void 0?null:c;var d=ue(a);b=new qe(0,0);if(a!=(d?ue(d):document).documentElement){c=ze(a);var e=(d?new xe(ue(d)):Ca||(Ca=new xe)).g;d=e.scrollingElement?e.scrollingElement:cb||e.compatMode!="CSS1Compat"?e.body||e.documentElement:e.documentElement;e=e.defaultView;d=new qe((e==null?void 0:e.pageXOffset)||d.scrollLeft,(e==null?void 0:e.pageYOffset)||d.scrollTop);b.x=c.left+d.x;b.y=c.top+d.y}b:{c=ue(a);if(c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a, +null))){c=c.display||c.getPropertyValue("display")||"";break b}c=""}c||(c=a.currentStyle?a.currentStyle.display:null);if((c||a.style&&a.style.display)!="none")a=Ae(a);else{c=a.style;d=c.display;e=c.visibility;var f=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";a=Ae(a);c.display=d;c.position=f;c.visibility=e}b=new ye(b.x,b.y,a.width,a.height);this.top=b.top;this.left=b.left;this.width=b.width;this.height=b.height} +function Lg(a){a=de(a);if(!a)return null;var b=a.document;a=Jg(b);var c=[];Ya(c,b.getElementsByTagName("iframe"));for(b=0;b<Math.min(c.length,50);b++){var d=c[b],e=d.src?Ia(d.src):"",f=d.id||d.name||"";if(!Dg.test(f))try{var g=d.contentDocument||d.contentWindow.document;if(e&&d.src!=="about:blank")Ya(a,Jg(g)),Ya(c,g.getElementsByTagName("iframe"));else{var h=null,k=d.previousElementSibling!==void 0?d.previousElementSibling:te(d.previousSibling,!1);if(k&&k.nodeName==="SCRIPT"&&k.src){var l=Hg(k.src); +h=Cg.test(l)?null:l}((h=h||f)||!ve(d))&&Ig(d)&&a.push(new Kg(d,h))}}catch(n){h=Hg(e),e=(e=cf(e.match(bf)[5]||null))&&e.charAt(0)==="/"?e.split("/",2)[1]:"",Ig(d)&&!Cg.test(h)&&a.push(new Kg(d,h||f,e))}}Za(a,function(n,p){return n.top!==p.top?n.top-p.top:n.left-p.left});var m=null;return Va(a,function(n){if(m!=null&&n.top+n.height<=m.top+m.height&&n.left+n.width<=m.left+m.width)return!1;m=n;return!0})};var Mg=!1;function Ng(a,b,c){function d(m){Mg&&(b.push(m-f),f=m,l&&(c.push(g||0),h||(g=0,h=l(k))),e(d))}if(!Mg){Mg=!0;var e=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;if(ne(e)){var f,g,h,k,l=a.requestIdleCallback;l&&(k=function(m){g=m.timeRemaining();h=0});e(function(m){f=m;l&&(h=l(k));e(d)})}}};function Og(a){var b=0,c=0,d,e,f;a=(f=(d=a.performance)==null?void 0:(e=d.getEntriesByType)==null?void 0:e.call(d,"paint"))!=null?f:[];d=y(a);for(e=d.next();!e.done;e=d.next())switch(e=e.value,f=e.startTime,e.name){case "first-paint":b=f;break;case "first-contentful-paint":c=f}return{ka:b,ja:c}};function Pg(a){return new RegExp("/pagead/js/(r\\d+|dev)/r\\d+/(.*/)?"+a+"(_fy20\\d\\d)?\\.js")} +var Y={},Qg={},Z={},Rg={},Sg={},Tg={},Ug={},Vg={},Wg={},Xg={},Yg={},Zg=[{u:RegExp("^https?://((tpc|pagead2)\\.googlesyndication\\.com|static\\.googleadsserving\\.cn)/pagead/"),resources:(Y[1]=/adsbygoogle\.js/,Y[83]=/adsbygoogle_direct\.js/,Y[2]=/show_ads\.js/,Y[3]=/show_ads_impl(_with_ama)?(_fy20\d\d)?\.js/,Y[21]=/js\/r\d+\/r\d+\/osd\.js/,Y[22]=/\/osd\.js/,Y[7]=/activeview\/osd_listener\.js/,Y[8]=/lidar\.js/,Y[4]=/imgad\?id=/,Y[24]=/js\/(r\d+|dev)\/r\d+\/rum\.js/,Y[25]=/js\/rum\.js/,Y[33]=/\/pagead\/adview\?ai=/, +Y[60]=/\/pagead\/ppub_config/,Y[67]=/pagead\/managed\/js\/gpt\/m\d+\/pubads_impl(_fy\d+)?\.js/,Y[82]=/\/pagead\/managed\/dict\//,Y[10]=Pg("m_js_controller"),Y[9]=Pg("abg_lite"),Y[65]=Pg("spam_signals_bundle"),Y[66]=Pg("bgl"),Y[30]=Pg("window_focus"),Y[75]=Pg("interstitial_ad_frame"),Y[76]=Pg("fullscreen_api_adapter"),Y),o:28},{u:/^https?:\/\/(tpc|pagead2)\.googlesyndication\.com\//,resources:(Qg[4]=/pageadimg(\/imgad)?\?id=/,Qg[23]=/(daca_images\/)?simgad\/\d+/,Qg[29]=/icore_images\/\d+/,Qg[11]=/pub-config\/r\d+\/ca-pub-\d+\.js/, +Qg[16]=/\/safeframe\/\d+-\d+-\d+\/html\/container\.html/,Qg[17]=/\/safeframe\/\d+-\d+-\d+\/js\/ext\.js/,Qg[31]=/\/sadbundle\//,Qg[32]=/(\/pcs)?\/activeview\?(xai|avi)=/,Qg[80]=/\/tag\/js\/gpt\.js/,Qg),o:39},{u:/^https?:\/\/\w+\.g\.doubleclick\.net/,resources:(Z[59]=/\/tag\/js\/gpt\.js/,Z[14]=/\/gpt\/pubads_impl_\d+\.js/,Z[67]=/pagead\/managed\/js\/gpt\/m\d+\/pubads_impl(_fy\d+)?\.js/,Z[43]=/\/gpt\/pubads_impl_core_\d+\.js/,Z[15]=/\/gampad\/ads\?/,Z[34]=/\/pcs\/view\?xai=/,Z[36]=/^https?:\/\/cm\.g\./, +Z[5]=/pagead\/ads\?/,Z[12]=/pagead\/html\/.*\/zrt_lookup\.html/,Z[33]=/\/pagead\/adview\?ai=/,Z[61]=/\/pagead\/managed\/js\/config_2_5__\d+\.json\?domain=/,Z[62]=/\/pagead\/managed\/js\/config_12_5__\d+\.json\?domain=/,Z[60]=/\/pagead\/ppub_config/,Z[70]=/\/td\/sts/,Z[71]=/\/td\/sjs/,Z[72]=/\/td\/bts/,Z[73]=/\/td\/bjs/,Z[74]=/\/td\/adfetch\/gda\?/,Z[82]=/\/pagead\/managed\/dict\//,Z),o:40},{u:/^https?:\/\/www\.googletagservices\.com/,resources:(Rg[13]=/\/tag\/js\/gpt\.js/,Rg[37]=/\/dcmads\.js/,Rg[38]= +/\/dcm\/impl_v\d+\.js/,Rg[77]=/\/activeview\/js\/current\/rx_lidar\.js/,Rg[81]=/\/activeview\/js\/current\/ufs_web_display\.js/,Rg),o:42},{u:/^https?:\/\/fonts\.googleapis\.com\/css/,resources:(Sg[18]=/[?&]family=/,Sg),o:27},{u:/^https?:\/\/fonts\.gstatic\.com/,resources:(Tg[19]=/\/s\//,Tg[20]=/\/l\//,Tg),o:27},{u:/^https:\/\/[\w.]+.2mdn.net/,resources:(Ug[31]=/\/sadbundle\//,Ug),o:41},{u:/^https?:\/\/cdn\.ampproject\.org/,resources:(Vg[49]=/\/rtv\/\d{15,20}\/amp4ads-host-v0\.js\b/,Vg[50]=/\.org\/amp4ads-host-v0\.js\b/, +Vg),o:51},{u:/^https?:\/\/imasdk.googleapis.com/,resources:(Wg[54]=/js\/sdkloader\/ima3.js/,Wg[55]=/js\/core\/bridge3.*html/,Wg[56]=/js\/sdkloader\/loader.js/,Wg[57]=/js\/sdkloader\/vpaid_adapter.js/,Wg),o:58},{u:/^https?:\/\/fundingchoicesmessages\.google\.com/,resources:(Xg[64]=/\/i\/.*\?ers=\d.*/,Xg),o:63},{u:/^https?:\/\/.*\.googlevideo\.com/,resources:(Yg[78]=/\/videoplayback/,Yg),o:79},{u:/./,resources:{},o:27}],$g={},ah=[{u:/^https?:\/\//,resources:($g[26]=function(a){return og&&!/^https:\/\/d-\d+\.ampproject\.net\/\d+\/frame\.html$/.test(a)}, +$g),o:27}];function bh(a){switch(a){case "audio":return 15;case "beacon":return 1;case "css":return 2;case "fetch":return 4;case "iframe":return 5;case "img":return 6;case "link":return 7;case "navigation":return 8;case "object":return 9;case "script":return 10;case "subdocument":return 11;case "svg":return 12;case "track":return 16;case "video":return 14;case "xmlhttprequest":return 13;default:return 0}} +var ch={woff:1,woff2:2,eot:3,ttf:4},dh=/^https?:\/\/[^/?#]*\b(google(adservices|tag(manager|services)|apis|usercontent|syndication|video)?|doubleclick|gstatic|2mdn|cdn.ampproject)\./,eh={},fh=(eh[1]=!0,eh[4]=!0,eh[13]=!0,eh); +function gh(a,b,c,d){d=d===void 0?!1:d;var e=dh.test(a)?1:0,f=e!==1,g=Xa(f?ah:Zg,function(h){return h.u.test(a)});if(!g)return null;g=be(g.resources,function(h){return typeof h==="function"?h(a):h.test(a)})||g.o;return!g||f&&b!==2&&fh[c]&&(!d||c!==13)?null:{ha:e,id:Number(g)}} +function hh(a,b,c,d,e,f){var g=bh(a.initiatorType),h=gh((f===void 0?"":f)||a.name,d,g,e);if(h){d=b.push;f=h.id;h=h.ha;var k=new of;k=hd(k,1,f);k=hd(k,3,h);g=hd(k,2,g);g=R(g,4,Math.round(a.startTime));g=R(g,7,Math.round(a.duration));k=a.name;try{if(e){e=125;var l=/[\?#;]/.exec(k);l&&l.index!==-1&&l.index<e&&(e=l.index);R(g,24,Bg(k.substr(0,e)))}}catch(D){}if(h===1||f===26){l=R(g,5,Math.round(a.fetchStart));R(l,6,Math.round(a.responseEnd));b:{e=a.name;f=ed(g,1);l=new lf;switch(f){case 18:if(e=e.match(/[?&]family=([^&]+)/))if(e= +A.decodeURIComponent(e[1]).split("|"),Jc(l),f=l.j,h=f[E]|0,e==null)M(f,h,1);else{var m=k=e===Ab?7:e[E]|0,n=Tc(k),p=n||Object.isFrozen(e);n||(k=0);p||(e=$b(e),m=0,k=Rc(k,h),p=!1);k|=5;n=4&k?512&k?512:1024&k?1024:0:void 0;k|=n!=null?n:Ma?1024:0;for(n=0;n<e.length;n++){var C=e[n],v=sc(C);r(Object,"is").call(Object,C,v)||(p&&(e=$b(e),m=0,k=Rc(k,h),p=!1),e[n]=v)}k!==m&&(p&&(e=$b(e),k=Rc(k,h)),F(e,k));M(f,h,1,e)}break;case 19:if(e=e.match(/\/s\/(\w+)\/v(\d+)\/[^.\/]+\.(\w+)$/))f=A.parseInt(e[2],10),f=R(l, +2,f),f=hd(f,3,ch[e[3]]||0),e=e[1],Jc(f),Oc(f,1,tc,2,!0).push(sc(e));break;case 20:if(f=e.match(/[?&]skey=([^&]+)/))f=f[1],Jc(l),Oc(l,1,tc,2,!0).push(sc(f));if(e=e.match(/[?&]v=v(\d+)/))e=A.parseInt(e[1],10),R(l,2,e);break;default:break b}ad(g,21,l)}a.responseStart&&(fd(g,22,!0),a.domainLookupStart!==a.domainLookupEnd&&(l=R(g,8,Math.round(a.domainLookupStart)),R(l,9,Math.round(a.domainLookupEnd))),a.connectStart!==a.connectEnd&&(l=R(g,10,Math.round(a.connectStart)),R(l,11,Math.round(a.connectEnd)), +a.secureConnectionStart&&R(g,12,Math.round(a.secureConnectionStart))),l=R(g,13,Math.round(a.requestStart)),R(l,14,Math.round(a.responseStart)),a.transferSize!==void 0&&(l=R(g,15,a.transferSize),l=R(l,17,a.decodedBodySize||0),R(l,16,a.encodedBodySize||0),a.transferSize>0?hd(g,23,a.transferSize>(a.encodedBodySize||0)?3:2):hd(g,23,1)),a.redirectStart&&(l=R(g,18,Math.round(a.redirectStart)),R(l,19,Math.round(a.redirectEnd))),c&&window.performance.timing&&R(g,20,c))}d.call(b,g)}} +function ih(a){return a.performance&&a.performance.timing&&a!==A&&A.performance!=null&&A.performance.timing!=null?a.performance.timing.navigationStart-A.performance.timing.navigationStart:0}function jh(a,b,c,d,e){if(d&&d.length){var f=[],g=!1;d=y(d);for(var h=d.next();!h.done;h=d.next())h=h.value,h.entryType==="resource"?hh(h,f,ih(b),c,e):h.entryType!=="navigation"||g||(hh(h,f,ih(b),c,e,b.location?b.location.href:""),g=!0);b=Wa(f,function(k){return Tf(k.h())}).join("~");Qf(a,7,b,!0)}} +function kh(a){return Wa(a.performance&&a.performance.getEntriesByType?a.performance.getEntriesByType("resource"):[],function(b){var c=(b&&b.name||"").replace(/\?.*$/,""),d=new $f;c=gd(d,1,c);return R(c,2,b.startTime)})};var lh=window==window.top?32:16,mh={unloadEventStart:2,unloadEventEnd:3,redirectStart:4,redirectEnd:5,fetchStart:6,domainLookupStart:7,domainLookupEnd:8,connectStart:9,connectEnd:10,secureConnectionStart:11,requestStart:12,responseStart:13,responseEnd:14,domLoading:15,domInteractive:16,domContentLoadedEventStart:17,domContentLoadedEventEnd:18,domComplete:19,loadEventStart:20,loadEventEnd:21};function nh(a){return(a=Zc(a,Bf,1))?ed(a,2):0} +function oh(a){var b=Zc(a,Af,2);b||(b=new Af,ad(a,2,b));nh(a)==2&&(a=fd(b,7,!0),a=fd(a,9,!0),fd(a,10,!0));return b}function ph(a,b){ed(b,2)!==2||Df(A).chp||V(a,"chm",1);jg(b.getCorrelator())&&V(a,"c",jg(b.getCorrelator()));dd(b,5)&&V(a,"e",dd(b,5));V(a,"ctx",ed(b,2));V(a,"gqid",dd(b,3));V(a,"qqid",dd(b,4))} +function qh(a){var b=new Cf(A.google_rum_config||null),c=oh(b),d=Oc(c,15,ic,void 0===Fb?2:4),e=Zc(b,Bf,1)||new Bf;d.length&&gd(e,5,d.join());ph(a,e);d=new dg(dd(e,4));if(e=A.google_js_reporting_queue){var f=function(g){a.F(g);Te(g)};e.push=f;Ua(e,f);e.length=0}Mf(a,function(){var g=Oe();g&&Ue(a,"24",1,g,0)});rh(A,a,b,c,d);nh(b)===2&&sh()&&rh(A.parent,a,b,c,d)}function sh(){var a=A.parent;return ce(a)&&a!==a.top&&a.document.querySelector("iframe#ad_iframe")!=null} +function rh(a,b,c,d,e){(N(d,12)||N(d,9)&&Math.random()<.1)&&Zf(b,a);var f=nh(c),g=null;if(N(d,7)&&a.PerformanceObserver){g=new a.PerformanceObserver(function(h){jh(b,a,f,h==null?void 0:h.getEntries(),N(d,13))});try{try{g.observe({type:"resource",buffered:!0}),g.observe({type:"navigation",buffered:!0})}catch(h){g.observe({entryTypes:["resource","navigation"]})}Mf(b,function(){var h,k;jh(b,a,f,(k=(h=g).takeRecords)==null?void 0:k.call(h),N(d,13))});f==1&&th(a,b,d,f,g)}catch(h){}}Mf(b,function(){if(N(d, +18)&&N(d,19)){var h;eg(e,kh(a),(h=Oe())!=null?h:0)}else N(d,18)&&eg(e,kh(a))});a==a.top&&N(d,14)&&(new gg(b)).install();uh(b,a,d,f,g,e)} +function uh(a,b,c,d,e,f){var g=vf(113,function(){N(c,10)&&vh(a,b);wh(a,b);xh(a,b,c,d,e,f);if(d==1&&N(c,16)){var h=tg(b);h=h.scrollHeight===tg(b).clientHeight?h.offsetHeight:h.scrollHeight;var k=tg(b).scrollWidth,l=tg(b).scrollHeight,m="unknown";b&&b.document&&b.document.readyState&&(m=b.document.readyState);var n=b.pageYOffset===void 0?(b.document.documentElement||b.document.body.parentNode||b.document.body).scrollTop:b.pageYOffset,p=[],C=[],v=[],D=[],T=[],P=[],ba=[],ra=0,La=0,da=Infinity,ia=Infinity, +$a=null;var H={na:!1};var G=W(b,".google-auto-placed"),u=W(b,"ins.adsbygoogle[data-anchor-status]"),w=W(b,"ins.adsbygoogle[data-ad-format=autorelaxed]");var Q=(qg(b)||W(b,"div[id^=div-gpt-ad]")).concat(W(b,"iframe[id^=google_ads_iframe]"));var Je=W(b,"div.trc_related_container,div.OUTBRAIN,div[id^=rcjsload],div[id^=ligatusframe],div[id^=crt-],iframe[id^=cto_iframe],div[id^=yandex_], div[id^=Ya_sync],iframe[src*=adnxs],div.advertisement--appnexus,div[id^=apn-ad],div[id^=amzn-native-ad],iframe[src*=amazon-adsystem],iframe[id^=ox_],iframe[src*=openx],img[src*=openx],div[class*=adtech],div[id^=adtech],iframe[src*=adtech],div[data-content-ad-placement=true],div.wpcnt div[id^=atatags-]"), +zh=W(b,"ins.adsbygoogle-ablated-ad-slot"),Ah=W(b,"div.googlepublisherpluginad"),Bh=W(b,"html > ins.adsbygoogle"),O=[].concat.apply([],[].concat(sa(W(b,"iframe[id^=aswift_],iframe[id^=google_ads_frame]")),sa(W(b,"body ins.adsbygoogle")))),z=[];H.Ba&&(z=z.concat(W(b,"ins.adsbygoogle[data-ad-hi]")));G=y([[H.Da,G],[H.na,u],[H.Ga,w],[H.Ea,Q],[H.Ha,Je],[H.Ca,zh],[H.Fa,Ah],[H.Ia,Bh]]);for(u=G.next();!u.done;u=G.next())w=y(u.value),u=w.next().value,w=w.next().value,u===!1?z=z.concat(w):O=O.concat(w);O=sg(O); +G=sg(z);z=O.slice(0);O=y(G);for(G=O.next();!G.done;G=O.next())for(G=G.value,u=0;u<z.length;u++)(G.contains(z[u])||z[u].contains(G))&&z.splice(u,1);H=H.Aa?rg(z):z;H=y(H);for(z=H.next();!z.done;z=H.next()){z=z.value;O=z.getBoundingClientRect();G=h-(O.bottom+n);if(z.className&&z.className.indexOf("adsbygoogle-ablated-ad-slot")!=-1){w=z.getAttribute("google_element_uid");u=void 0;if(Q=b.fqjyf){if(w&&Q[w]&&(u=Q[w].LmpfC),!u)continue}else continue;a:{w=Number(u.google_ad_width);Q=Number(u.google_ad_height); +if(!(w>0&&Q>0)){b:{try{var gb=String(u.google_ad_format);if(gb&&gb.match){var hb=gb.match(/(\d+)x(\d+)/i);if(hb){var mf=parseInt(hb[1],10),nf=parseInt(hb[2],10);if(mf>0&&nf>0){var Pa={width:mf,height:nf};break b}}}}catch(Hh){}Pa=null}if(!Pa){u=null;break a}w=w>0?w:Pa.width;Q=Q>0?Q:Pa.height}u={width:w,height:Q}}u=(w=u)?w.height:0;w=w?w.width:0}else if(u=O.bottom-O.top,w=O.right-O.left,u<=1||w<=1)continue;p.push(u);v.push(w);D.push(u*w);z.className&&z.className.indexOf("google-auto-placed")!=-1?(La+= +1,z.className&&z.className.indexOf("pedestal_container")!=-1&&($a=u)):(da=Math.min(da,G),P.push(O),ra+=1,C.push(u),T.push(u*w));ia=Math.min(ia,G);ba.push(O)}da=da===Infinity?null:da;ia=ia===Infinity?null:ia;Pa=zg(P);ba=zg(ba);C=yg(h,C);gb=yg(h,p);T=yg(h*k,T);hb=yg(h*k,D);h=new vg(b,{ga:m,va:h,xa:k,wa:l,qa:ra,aa:La,ca:xg(p),da:xg(v),ba:xg(D),ua:Pa,ta:ba,sa:da,ra:ia,fa:C,ea:gb,Z:T,Y:hb,ya:$a});h=wg(h,b.location.hostname);k="R";rf.R&&rf.hasOwnProperty(k)||(k=new rf,rf.R=k);k=[];!h.eid&&k.length&&(h.eid= +k.toString());gf(ff,"ama_stats",h,!0,1)}});b.document.readyState!="complete"?De(b,"load",function(){b.setTimeout(g,0)}):g()}function wh(a,b){var c=b.google_rum_values||Df(b).rv;b.google_rum_values=void 0;Df(b).rv=void 0;if(c&&!(c.dt<0)&&(b=b.performance&&b.performance.timing)){var d=c.dt-b.navigationStart;ae(c,function(e,f){if(e!=-1&&typeof e==="number"){switch(f){case "dt":e=d;break;case "bdt":e=d-e;break;default:e=d+e}Ue(a,f,4,e)}})}} +function xh(a,b,c,d,e,f){N(c,1)&&yh(a,b);N(c,2)&&cd(c)>0&&Ch(a,cd(c));N(c,7)&&Dh(a,b,c,d,e);N(c,8)&&Math.random()<.1&&Ve(a,function(){return Eh(a,b)});N(c,18)&&eg(f,kh(b))}function Dh(a,b,c,d,e){var f;jh(a,b,d,(f=e.takeRecords)==null?void 0:f.call(e),N(c,13))} +function Fh(a,b,c){var d=Oe();if(d&&(b.length||c.length)){var e={};d=(e[3]=d.toString(36),e);b.length&&(d[1]=Wa(b,function(f){f=Math.min(Math.max(f,0),4095);return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_."[f>>6]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_."[f&63]}).join(""));c.length&&(d[2]=Wa(c,function(f){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_."[Math.min(Math.max(f,0),63)|0]}).join(""));Qf(a,5,Rf(5,d),!0,".")}} +function Gh(a){if(Ff()){var b=Gf(),c=b.la,d=b.ma,e=vf(400,function(){c.length||d.length?(Fh(a,c,d),c.length=0,d.length=0,A.setTimeout(e,1E4)):(c.push=function(){return 0},d.push=function(){return 0})});A.setTimeout(e,1E4)}}function yh(a,b){var c=[],d=[];Ng(b,c,d);b.setTimeout(vf(400,function(){Mg=!1;Fh(a,c,d)}),1E4)}function Ch(a,b){Ag(b,function(c,d,e){if(c!=null&&d!=null&&e!=null){var f={};f[1]=b;f[2]=c;f[3]=d;f[4]=e;Sf(a,8,f)}})} +function vh(a,b){var c=b.performance&&b.performance.timing;if(c){var d=c.navigationStart;d>0&&(Ue(a,"1",1,d),ae(mh,function(f,g){g=c[g];g>0&&Ue(a,String(f),1,g-d)}));var e=Og(b);b=e.ka;e=e.ja;b&&Ue(a,"22",1,b);e&&Ue(a,"23",1,e)}} +function Eh(a,b){if(b=Lg(b))10<b.length&&(b.length=10),Nf(a,Wa(b,function(c){var d=Gg(c.id)+(c.g?"_"+Gg(c.g):""),e=Math.floor(c.top).toString(36),f=Math.floor(c.left).toString(36),g=Math.floor(c.width).toString(36);c=Math.floor(c.height).toString(36);return d+"_"+e+"_"+f+"_"+g+"_"+c}).join("~"))} +function th(a,b,c,d,e){var f=zf(a.document);f&&De(a,f,function(){var g=Oe();if(g){var h=a.document;if(h.prerendering)h=3;else{var k;h=(k={visible:1,hidden:2,prerender:3,preview:4,unloaded:5,"":0}[h.visibilityState||h.webkitVisibilityState||h.mozVisibilityState||""])!=null?k:0}k=h;if(k==1||k==2){h=new qf;g=R(h,1,Math.round(g));g=hd(g,2,k);g=Tf(g.h());if(N(c,7)){var l;jh(b,a,d,(l=e.takeRecords)==null?void 0:l.call(e),N(c,13))}Ue(b,"1",11,g);k==2&&typeof b.L==="function"&&b.L()}}})};uf.H(112,function(){var a=new If(1,"https:","csi.gstatic.com","/csi?v=2&s=pagead&action=","csi_pagead",lh);a.h=!0;qh(a);Gh(a)});}).call(this); diff --git a/runtime-environment.ts b/runtime-environment.ts new file mode 100644 index 0000000..77b6053 --- /dev/null +++ b/runtime-environment.ts @@ -0,0 +1,19 @@ +import memoize from '@github/memoize' +import {ssrSafeDocument} from '@github-ui/ssr-utils' + +const runtimeEnvironment = memoize(githubEnvironment) + +// return the github instance environment +// if dotcom, returns 'dotcom' +// if enterprise, returns 'enterprise' +function githubEnvironment(): string { + return ssrSafeDocument?.head?.querySelector<HTMLMetaElement>('meta[name="runtime-environment"]')?.content || '' +} + +export const isEnterprise = memoize(isEnterpriseEnvironment) +function isEnterpriseEnvironment(): boolean { + return runtimeEnvironment() === 'enterprise' +} + +// This is the "bundler" that built the client-side assets, e.g. "webpack" +export const bundler = typeof BUNDLER !== 'undefined' ? BUNDLER : undefined diff --git a/safe-storage.ts b/safe-storage.ts new file mode 100644 index 0000000..1ead3b9 --- /dev/null +++ b/safe-storage.ts @@ -0,0 +1,157 @@ +import {ssrSafeWindow} from '@github-ui/ssr-utils' +import {sendStats} from '@github-ui/stats' + +type StorageBackend = 'sessionStorage' | 'localStorage' + +/** + * An implementation of the Storage API that throws away all data. Used in + * cases when the requested Storage backend is not available. + */ +class NoOpStorage { + getItem() { + return null + } + + setItem() { + return undefined + } + + removeItem() { + return undefined + } + + clear() { + return undefined + } + + key() { + return null + } + + get length() { + return 0 + } +} + +type SafeStorageOptions = { + /** Callers may opt not to suppress quota errors thrown on set in case they rely on recieving them. */ + throwQuotaErrorsOnSet: boolean + /** The amount of time the value should remain in storage, in milliseconds */ + ttl?: number + /** Don't send stats in CI */ + sendCacheStats?: boolean +} + +/** + * Safely access Storage items by wrapping a Storage instance + * (localStorage or sessionStorage) with safe versions of its API + * methods. Callers may opt not to suppress quota errors thrown on + * set in case they rely on recieving them. + */ +export default function safeStorage<T = string>( + storageKey: StorageBackend, + options: SafeStorageOptions = {throwQuotaErrorsOnSet: false}, + global = ssrSafeWindow, + deserialize: (value: string) => T = value => value as unknown as T, + serialize: (value: T) => string = (value: T) => value as unknown as string, +) { + let storage: Storage + try { + if (!global) { + // in an SSR environment, use noop storage + throw new Error() + } + + storage = global[storageKey] || new NoOpStorage() + } catch { + storage = new NoOpStorage() + } + + const {throwQuotaErrorsOnSet} = options + + function emitStats(key: PlatformBrowserIncrementKey) { + if (options.sendCacheStats) { + sendStats({incrementKey: key}) + } + } + + /** Safely get storage item. Returns `null` if the item is older than the provided ttl */ + function getItem(key: string, now: number = Date.now()): T | null { + try { + const value = storage.getItem(key) + if (!value) { + return null + } + const expiryKey = `${key}:expiry` + const expiry = Number(storage.getItem(expiryKey)) + if (expiry && now > expiry) { + removeItem(key) + removeItem(expiryKey) + emitStats('SAFE_STORAGE_VALUE_EXPIRED') + return null + } else { + emitStats('SAFE_STORAGE_VALUE_WITHIN_TTL') + return deserialize(value) + } + } catch { + // Ignore browser private mode error. + return null + } + } + + /** + * Safely set storage item. + * If `ttl` is provided, set an expiry time for the item under the key `${key}:expiry` + * This function will be called + */ + function setItem(key: string, value: T, now: number = Date.now()) { + try { + storage.setItem(key, serialize(value) as unknown as string) + if (options.ttl) { + const expiryKey = `${key}:expiry` + const expiry = now + options.ttl + storage.setItem(expiryKey, expiry.toString()) + } + } catch (error) { + if (throwQuotaErrorsOnSet && error instanceof Error && error.message.toLowerCase().includes('quota')) throw error + } + } + + // Safely remove storage item. + function removeItem(key: string) { + try { + storage.removeItem(key) + if (options.ttl) { + const expiryKey = `${key}:expiry` + storage.removeItem(expiryKey) + } + } catch { + // Ignore browser private mode error. + } + } + + function getKeys() { + return Object.keys(storage) + } + + return { + getItem, + setItem, + removeItem, + clear: () => storage.clear(), + getKeys, + get length() { + return storage.length + }, + } +} + +export function jsonSafeStorage<T>(storageBackend: StorageBackend) { + return safeStorage<T>( + storageBackend, + {throwQuotaErrorsOnSet: false}, + ssrSafeWindow, + JSON.parse as (value: string) => T, + JSON.stringify as (obj: T) => string, + ) +} diff --git a/session-storage.ts b/session-storage.ts new file mode 100644 index 0000000..4663bb5 --- /dev/null +++ b/session-storage.ts @@ -0,0 +1,3 @@ +import safeStorage from './safe-storage' + +export const {getItem, setItem, removeItem} = safeStorage('sessionStorage') diff --git a/socketworker/_class_extract_field_descriptor.js b/socketworker/_class_extract_field_descriptor.js new file mode 100644 index 0000000..44ca9e7 --- /dev/null +++ b/socketworker/_class_extract_field_descriptor.js @@ -0,0 +1,6 @@ +function _class_extract_field_descriptor(receiver, privateMap, action) { + if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance"); + + return privateMap.get(receiver); +} +export { _class_extract_field_descriptor as _ }; diff --git a/socketworker/_class_private_field_get.js b/socketworker/_class_private_field_get.js new file mode 100644 index 0000000..078d320 --- /dev/null +++ b/socketworker/_class_private_field_get.js @@ -0,0 +1,8 @@ +import { _ as _class_apply_descriptor_get } from "./_class_apply_descriptor_get.js"; +import { _ as _class_extract_field_descriptor } from "./_class_extract_field_descriptor.js"; + +function _class_private_field_get(receiver, privateMap) { + var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get"); + return _class_apply_descriptor_get(receiver, descriptor); +} +export { _class_private_field_get as _ }; diff --git a/socketworker/_class_private_field_init.js b/socketworker/_class_private_field_init.js new file mode 100644 index 0000000..3daa81a --- /dev/null +++ b/socketworker/_class_private_field_init.js @@ -0,0 +1,7 @@ +import { _ as _check_private_redeclaration } from "./_check_private_redeclaration.js"; + +function _class_private_field_init(obj, privateMap, value) { + _check_private_redeclaration(obj, privateMap); + privateMap.set(obj, value); +} +export { _class_private_field_init as _ }; diff --git a/socketworker/alive-session.js b/socketworker/alive-session.js new file mode 100644 index 0000000..6aa9c34 --- /dev/null +++ b/socketworker/alive-session.js @@ -0,0 +1,289 @@ +import { AlivePresence, getPresenceKey, isPresenceChannel } from './presence.js'; +import { IDLE_METADATA_KEY, PresenceMetadataSet } from './presence-metadata.js'; +import { StableSocket } from '@github/stable-socket'; +import { SubscriptionSet } from './subscription-set.js'; +import { eachSlice } from './iterables.js'; +import { retry } from './eventloop-tasks.js'; +var SocketDisconnectReasons; +(function (SocketDisconnectReasons) { + SocketDisconnectReasons["Deploy"] = "Alive Redeploy"; + SocketDisconnectReasons["Reconnect"] = "Alive Reconnect"; +})(SocketDisconnectReasons || (SocketDisconnectReasons = {})); +function generatePresenceId() { + return `${Math.round(Math.random() * (Math.pow(2, 31) - 1))}_${Math.round(Date.now() / 1000)}`; +} +function getUserIdFromSocketUrl(url) { + const match = url.match(/\/u\/(\d+)\/ws/); + return match ? +match[1] : 0; +} +export class AliveSession { + constructor(url, getUrl, inSharedWorker, notify, maxReconnectBackoff = 600000, options = {}) { + this.url = url; + this.getUrl = getUrl; + this.inSharedWorker = inSharedWorker; + this.notify = notify; + this.maxReconnectBackoff = maxReconnectBackoff; + this.options = options; + this.subscriptions = new SubscriptionSet(); + this.state = 'online'; + this.retrying = null; + this.connectionCount = 0; + this.presence = new AlivePresence(); + this.presenceMetadata = new PresenceMetadataSet(); + this.intentionallyDisconnected = false; + this.lastCameOnline = 0; + this.userId = getUserIdFromSocketUrl(url); + this.presenceId = generatePresenceId(); + this.presenceKey = getPresenceKey(this.userId, this.presenceId); + this.socket = this.connect(); + } + subscribe(subscriptions) { + const added = this.subscriptions.add(...subscriptions); + this.sendSubscribe(added); + for (const subscription of subscriptions) { + const channel = subscription.topic.name; + if (!isPresenceChannel(channel)) { + continue; + } + this.notifyCachedPresence(subscription.subscriber, channel); + } + } + unsubscribe(subscriptions) { + const removed = this.subscriptions.delete(...subscriptions); + this.sendUnsubscribe(removed); + } + unsubscribeAll(...subscribers) { + const removed = this.subscriptions.drain(...subscribers); + this.sendUnsubscribe(removed); + const updatedPresenceChannels = this.presenceMetadata.removeSubscribers(subscribers); + this.sendPresenceMetadataUpdate(updatedPresenceChannels); + } + requestPresence(subscriber, channels) { + for (const channel of channels) { + this.notifyCachedPresence(subscriber, channel); + } + } + notifyCachedPresence(subscriber, channel) { + const presenceItems = this.presence.getChannelItems(channel); + if (presenceItems.length === 0) { + return; + } + this.notifyPresenceChannel(channel, presenceItems); + } + updatePresenceMetadata(metadataUpdates) { + const updatedChannels = new Set(); + for (const update of metadataUpdates) { + this.presenceMetadata.setMetadata(update); + updatedChannels.add(update.channelName); + } + this.sendPresenceMetadataUpdate(updatedChannels); + } + sendPresenceMetadataUpdate(channelNames) { + if (!channelNames.size) { + return; + } + const topics = []; + for (const channelName of channelNames) { + const topic = this.subscriptions.topic(channelName); + if (topic) { + topics.push(topic); + } + } + this.sendSubscribe(topics); + } + online() { + var _a; + this.lastCameOnline = Date.now(); + this.state = 'online'; + (_a = this.retrying) === null || _a === void 0 ? void 0 : _a.abort(); + this.socket.open(); + } + offline() { + var _a; + this.state = 'offline'; + (_a = this.retrying) === null || _a === void 0 ? void 0 : _a.abort(); + this.socket.close(); + } + shutdown() { + if (this.inSharedWorker) { + self.close(); + } + } + get reconnectWindow() { + const wasRecentlyOffline = Date.now() - this.lastCameOnline < 60 * 1000; + if (this.connectionCount === 0 || this.intentionallyDisconnected || wasRecentlyOffline) { + return 0; + } + return 10 * 1000; + } + socketDidOpen() { + this.intentionallyDisconnected = false; + this.connectionCount++; + this.socket.url = this.getUrlWithPresenceId(); + this.sendSubscribe(this.subscriptions.topics()); + } + socketDidClose(socket, code, reason) { + if (this.redeployEarlyReconnectTimeout !== undefined) { + clearTimeout(this.redeployEarlyReconnectTimeout); + } + if (reason === "Alive Reconnect") { + this.intentionallyDisconnected = true; + } + else if (reason === "Alive Redeploy") { + this.intentionallyDisconnected = true; + const reconnectDelayMinutes = 3 + Math.random() * 22; + const reconnectDelay = reconnectDelayMinutes * 60 * 1000; + this.redeployEarlyReconnectTimeout = setTimeout(() => { + this.intentionallyDisconnected = true; + this.socket.close(1000, 'Alive Redeploy Early Client Reconnect'); + }, reconnectDelay); + } + } + socketDidFinish() { + if (this.state === 'offline') + return; + this.reconnect(); + } + socketDidReceiveMessage(_, message) { + const payload = JSON.parse(message); + switch (payload.e) { + case 'ack': { + this.handleAck(payload); + break; + } + case 'msg': { + this.handleMessage(payload); + break; + } + } + } + handleAck(ack) { + for (const topic of this.subscriptions.topics()) { + topic.offset = ack.off; + } + } + handleMessage(msg) { + const channel = msg.ch; + const topic = this.subscriptions.topic(channel); + if (!topic) + return; + topic.offset = msg.off; + if ('e' in msg.data) { + const presenceItems = this.presence.handleMessage(channel, msg.data); + this.notifyPresenceChannel(channel, presenceItems); + return; + } + if (!msg.data.wait) + msg.data.wait = 0; + this.notify(this.subscriptions.subscribers(channel), { + channel, + type: 'message', + data: msg.data + }); + } + notifyPresenceChannel(channel, presenceItems) { + var _a, _b; + const userPresenceById = new Map(); + for (const presenceItem of presenceItems) { + const { userId, metadata, presenceKey } = presenceItem; + const userPresence = userPresenceById.get(userId) || { userId, isOwnUser: userId === this.userId, metadata: [] }; + if (presenceKey === this.presenceKey) { + continue; + } + for (const data of metadata) { + if (IDLE_METADATA_KEY in data) { + if (userPresence.isIdle !== false) { + userPresence.isIdle = Boolean(data[IDLE_METADATA_KEY]); + } + continue; + } + userPresence.metadata.push(data); + } + userPresenceById.set(userId, userPresence); + } + for (const subscriber of this.subscriptions.subscribers(channel)) { + const userId = this.userId; + const otherUsers = Array.from(userPresenceById.values()).filter(user => user.userId !== userId); + const ownUserRemoteMetadata = (_b = (_a = userPresenceById.get(this.userId)) === null || _a === void 0 ? void 0 : _a.metadata) !== null && _b !== void 0 ? _b : []; + const ownUserLocalMetadata = this.presenceMetadata.getChannelMetadata(channel, { + subscriber, + markAllAsLocal: !this.inSharedWorker + }); + this.notify([subscriber], { + channel, + type: 'presence', + data: [ + { + userId, + isOwnUser: true, + metadata: [...ownUserRemoteMetadata, ...ownUserLocalMetadata] + }, + ...otherUsers + ] + }); + } + } + async reconnect() { + if (this.retrying) + return; + try { + this.retrying = new AbortController(); + const url = await retry(this.getUrl, Infinity, this.maxReconnectBackoff, this.retrying.signal); + if (url) { + this.url = url; + this.socket = this.connect(); + } + else { + this.shutdown(); + } + } + catch (e) { + if (e.name !== 'AbortError') + throw e; + } + finally { + this.retrying = null; + } + } + getUrlWithPresenceId() { + const liveUrl = new URL(this.url, self.location.origin); + liveUrl.searchParams.set('shared', this.inSharedWorker.toString()); + liveUrl.searchParams.set('p', `${this.presenceId}.${this.connectionCount}`); + return liveUrl.toString(); + } + connect() { + const socket = new StableSocket(this.getUrlWithPresenceId(), this, this.options.socketPolicy || { + timeout: 4000, + attempts: 16, + maxDelay: 512000 + }); + socket.open(); + return socket; + } + sendSubscribe(topics) { + const entries = Array.from(topics); + for (const slice of eachSlice(entries, 25)) { + const subscribe = {}; + for (const topic of slice) { + if (isPresenceChannel(topic.name)) { + subscribe[topic.signed] = JSON.stringify(this.presenceMetadata.getChannelMetadata(topic.name)); + } + else { + subscribe[topic.signed] = topic.offset; + } + } + this.socket.send(JSON.stringify({ subscribe })); + } + } + sendUnsubscribe(topics) { + const signed = Array.from(topics, t => t.signed); + for (const slice of eachSlice(signed, 25)) { + this.socket.send(JSON.stringify({ unsubscribe: slice })); + } + for (const topic of topics) { + if (isPresenceChannel(topic.name)) { + this.presence.clearChannel(topic.name); + } + } + } +} diff --git a/socketworker/compat b/socketworker/compat new file mode 100644 index 0000000..1a88faa --- /dev/null +++ b/socketworker/compat @@ -0,0 +1,45 @@ +(() => { + if (typeof __webpack_require__ !== 'undefined') { + var oldGetScript = __webpack_require__.u; + var oldLoadScript = __webpack_require__.e; + var queryMap = {}; + var countMap = {}; + var getRetryDelay = function () { + return 0; + }; + __webpack_require__.u = function (chunkId) { + var result = oldGetScript(chunkId); + return ( + result + + (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '') + ); + }; + __webpack_require__.e = function (chunkId) { + var result = oldLoadScript(chunkId); + return result.catch(function (error) { + var retries = countMap.hasOwnProperty(chunkId) ? countMap[chunkId] : 3; + if (retries < 1) { + var realSrc = oldGetScript(chunkId); + error.message = + 'Loading chunk ' + + chunkId + + ' failed after 3 retries.\n(' + + realSrc + + ')'; + error.request = realSrc; + throw error; + } + return new Promise(function (resolve) { + var retryAttempt = 3 - retries + 1; + setTimeout(function () { + var retryAttemptString = '&retry-attempt=' + retryAttempt; + var cacheBust = 'cache-bust=true' + retryAttemptString; + queryMap[chunkId] = cacheBust; + countMap[chunkId] = retries - 1; + resolve(__webpack_require__.e(chunkId)); + }, getRetryDelay(retryAttempt)); + }); + }); + }; + } +})(); diff --git a/socketworker/eventloop-tasks.js b/socketworker/eventloop-tasks.js new file mode 100644 index 0000000..13199a1 --- /dev/null +++ b/socketworker/eventloop-tasks.js @@ -0,0 +1,49 @@ +function whenAborted(signal) { + return new Promise((resolve, reject) => { + const error = new Error('aborted'); + error.name = 'AbortError'; + if (signal.aborted) { + reject(error); + } + else { + signal.addEventListener('abort', () => reject(error)); + } + }); +} +export async function wait(ms, signal) { + let id; + const done = new Promise(resolve => { + id = self.setTimeout(resolve, ms); + }); + if (!signal) + return done; + try { + await Promise.race([done, whenAborted(signal)]); + } + catch (e) { + self.clearTimeout(id); + throw e; + } +} +function rand(max) { + return Math.floor(Math.random() * Math.floor(max)); +} +export async function retry(fn, attempts, maxDelay = Infinity, signal) { + const aborted = signal ? whenAborted(signal) : null; + for (let i = 0; i < attempts; i++) { + try { + const op = aborted ? Promise.race([fn(), aborted]) : fn(); + return await op; + } + catch (e) { + if (e.name === 'AbortError') + throw e; + if (i === attempts - 1) + throw e; + const ms = Math.pow(2, i) * 1000; + const vary = rand(ms * 0.1); + await wait(Math.min(maxDelay, ms + vary), signal); + } + } + throw new Error('retry failed'); +} diff --git a/socketworker/multimapindex.js b/socketworker/multimapindex.js new file mode 100644 index 0000000..9fb6db7 --- /dev/null +++ b/socketworker/multimapindex.js @@ -0,0 +1,64 @@ +export default class MultiMap { + constructor(iterable) { + this.map = new Map(); + if (iterable) { + for (const [k, v] of iterable) { + this.set(k, v); + } + } + } + get(key) { + const values = this.map.get(key); + return values ? values : new Set(); + } + set(key, value) { + let values = this.map.get(key); + if (!values) { + values = new Set(); + this.map.set(key, values); + } + values.add(value); + return this; + } + has(key) { + return this.map.has(key); + } + delete(key, value) { + const values = this.map.get(key); + if (!values) + return false; + if (!value) + return this.map.delete(key); + const deleted = values.delete(value); + if (!values.size) + this.map.delete(key); + return deleted; + } + drain(value) { + const empty = []; + for (const key of this.keys()) { + if (this.delete(key, value) && !this.has(key)) { + empty.push(key); + } + } + return empty; + } + keys() { + return this.map.keys(); + } + values() { + return this.map.values(); + } + entries() { + return this.map.entries(); + } + [Symbol.iterator]() { + return this.entries(); + } + clear() { + this.map.clear(); + } + get size() { + return this.map.size; + } +} diff --git a/socketworker/presence-metadata.js b/socketworker/presence-metadata.js new file mode 100644 index 0000000..3f9ff46 --- /dev/null +++ b/socketworker/presence-metadata.js @@ -0,0 +1,81 @@ +export const IDLE_METADATA_KEY = '_i'; +function markMetadataAsLocal(metadata) { + return Object.assign(Object.assign({}, metadata), { isLocal: true }); +} +class PresenceMetadataForChannel { + constructor() { + this.subscriberMetadata = new Map(); + } + setMetadata(subscriber, value) { + this.subscriberMetadata.set(subscriber, value); + } + removeSubscribers(subscribers) { + let found = false; + for (const subscriber of subscribers) { + found = this.subscriberMetadata.delete(subscriber) || found; + } + return found; + } + getMetadata(localizationOptions) { + if (!localizationOptions) { + const allMetadata = []; + let idle; + for (const subscriberMetadata of this.subscriberMetadata.values()) { + for (const metadata of subscriberMetadata) { + if (IDLE_METADATA_KEY in metadata) { + const subscriberIsIdle = Boolean(metadata[IDLE_METADATA_KEY]); + idle = idle === undefined ? subscriberIsIdle : subscriberIsIdle && idle; + } + else { + allMetadata.push(metadata); + } + } + } + if (idle !== undefined) { + allMetadata.push({ [IDLE_METADATA_KEY]: idle ? 1 : 0 }); + } + return allMetadata; + } + const metadata = []; + const { subscriber, markAllAsLocal } = localizationOptions; + for (const [fromSubscriber, subscriberMetadata] of this.subscriberMetadata) { + const shouldLocalizeMetadata = markAllAsLocal || fromSubscriber === subscriber; + const metadataToAdd = shouldLocalizeMetadata ? subscriberMetadata.map(markMetadataAsLocal) : subscriberMetadata; + metadata.push(...metadataToAdd); + } + return metadata; + } + hasSubscribers() { + return this.subscriberMetadata.size > 0; + } +} +export class PresenceMetadataSet { + constructor() { + this.metadataByChannel = new Map(); + } + setMetadata({ subscriber, channelName, metadata }) { + let channelMetadata = this.metadataByChannel.get(channelName); + if (!channelMetadata) { + channelMetadata = new PresenceMetadataForChannel(); + this.metadataByChannel.set(channelName, channelMetadata); + } + channelMetadata.setMetadata(subscriber, metadata); + } + removeSubscribers(subscribers) { + const channelsWithSubscribers = new Set(); + for (const [channelName, channelMetadata] of this.metadataByChannel) { + const channelHadSubscriber = channelMetadata.removeSubscribers(subscribers); + if (channelHadSubscriber) { + channelsWithSubscribers.add(channelName); + } + if (!channelMetadata.hasSubscribers()) { + this.metadataByChannel.delete(channelName); + } + } + return channelsWithSubscribers; + } + getChannelMetadata(channelName, localizationOptions) { + const channelMetadata = this.metadataByChannel.get(channelName); + return (channelMetadata === null || channelMetadata === void 0 ? void 0 : channelMetadata.getMetadata(localizationOptions)) || []; + } +} diff --git a/socketworker/presence.js b/socketworker/presence.js new file mode 100644 index 0000000..5bdb087 --- /dev/null +++ b/socketworker/presence.js @@ -0,0 +1,78 @@ +export function getPresenceKey(userId, presenceId) { + return `${userId}:${presenceId}`; +} +export function decompressItem(data) { + const [presenceId, connectionCount] = data.p.split('.'); + return { + userId: data.u, + presenceKey: getPresenceKey(data.u, presenceId), + connectionCount: Number(connectionCount), + metadata: data.m || [] + }; +} +const presenceChannelPrefix = 'presence-'; +export function isPresenceChannel(channelName) { + return channelName.startsWith(presenceChannelPrefix); +} +class PresenceChannel { + constructor() { + this.presenceItems = new Map(); + } + shouldUsePresenceItem(item) { + const existingItem = this.presenceItems.get(item.presenceKey); + return !existingItem || existingItem.connectionCount <= item.connectionCount; + } + addPresenceItem(item) { + if (!this.shouldUsePresenceItem(item)) { + return; + } + this.presenceItems.set(item.presenceKey, item); + } + removePresenceItem(item) { + if (!this.shouldUsePresenceItem(item)) { + return; + } + this.presenceItems.delete(item.presenceKey); + } + replacePresenceItems(items) { + this.presenceItems.clear(); + for (const item of items) { + this.addPresenceItem(item); + } + } + getPresenceItems() { + return Array.from(this.presenceItems.values()); + } +} +export class AlivePresence { + constructor() { + this.presenceChannels = new Map(); + } + getPresenceChannel(channelName) { + const channel = this.presenceChannels.get(channelName) || new PresenceChannel(); + this.presenceChannels.set(channelName, channel); + return channel; + } + handleMessage(channelName, data) { + const channel = this.getPresenceChannel(channelName); + switch (data.e) { + case 'pf': + channel.replacePresenceItems(data.d.map(decompressItem)); + break; + case 'pa': + channel.addPresenceItem(decompressItem(data.d)); + break; + case 'pr': + channel.removePresenceItem(decompressItem(data.d)); + break; + } + return this.getChannelItems(channelName); + } + getChannelItems(channelName) { + const channel = this.getPresenceChannel(channelName); + return channel.getPresenceItems(); + } + clearChannel(channelName) { + this.presenceChannels.delete(channelName); + } +} diff --git a/socketworker/session.ts b/socketworker/session.ts new file mode 100644 index 0000000..5ed7537 --- /dev/null +++ b/socketworker/session.ts @@ -0,0 +1,45 @@ +import {AliveSession as BaseAliveSession} from '@github/alive-client' +import type {AliveSessionOptions, Notifier} from '@github/alive-client' +export class AliveSession<T> extends BaseAliveSession<T> { + #refreshUrl: string + constructor(url: string, refreshUrl: string, shared: boolean, notify: Notifier<T>, options: AliveSessionOptions) { + super(url, () => this.#getUrlFromRefreshUrl(), shared, notify, undefined, options) + this.#refreshUrl = refreshUrl + } + + #getUrlFromRefreshUrl() { + return fetchRefreshUrl(this.#refreshUrl) + } +} + +type PostUrl = {url?: string; token?: string} +async function fetchRefreshUrl(url: string): Promise<string | null> { + const data = await fetchJSON<PostUrl>(url) + return data && data.url && data.token ? post(data.url, data.token) : null +} + +async function fetchJSON<T>(url: string): Promise<T | null> { + const response = await fetch(url, {headers: {Accept: 'application/json'}}) + if (response.ok) { + return response.json() + } else if (response.status === 404) { + return null + } else { + throw new Error('fetch error') + } +} + +async function post(url: string, csrf: string): Promise<string> { + const response = await fetch(url, { + method: 'POST', + mode: 'same-origin', + headers: { + 'Scoped-CSRF-Token': csrf, + }, + }) + if (response.ok) { + return response.text() + } else { + throw new Error('fetch error') + } +} diff --git a/socketworker/socket-worker-15d0549033ee.js b/socketworker/socket-worker-15d0549033ee.js new file mode 100644 index 0000000..bbb0fbd --- /dev/null +++ b/socketworker/socket-worker-15d0549033ee.js @@ -0,0 +1,3 @@ +(()=>{"use strict";let e;if("undefined"!=typeof __webpack_require__){var t=__webpack_require__.u,s=__webpack_require__.e,n={},r={};__webpack_require__.u=function(e){return t(e)+(n.hasOwnProperty(e)?"?"+n[e]:"")},__webpack_require__.e=function(e){return s(e).catch(function(s){var i=r.hasOwnProperty(e)?r[e]:3;if(i<1){var a=t(e);throw s.message="Loading chunk "+e+` failed after 3 retries. +(`+a+")",s.request=a,s}return new Promise(function(t){var s=3-i+1;setTimeout(function(){n[e]="cache-bust=true&retry-attempt="+s,r[e]=i-1,t(__webpack_require__.e(e))},0)})})}}function i(e,t,s){if(!t.has(e))throw TypeError("attempted to "+s+" private field on non-instance");return t.get(e)}function a(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function o(e){var t;let[s,n]=e.p.split(".");return{userId:e.u,presenceKey:(t=e.u,`${t}:${s}`),connectionCount:Number(n),metadata:e.m||[]}}function c(e){return e.startsWith("presence-")}let PresenceChannel=class PresenceChannel{constructor(){this.presenceItems=new Map}shouldUsePresenceItem(e){let t=this.presenceItems.get(e.presenceKey);return!t||t.connectionCount<=e.connectionCount}addPresenceItem(e){this.shouldUsePresenceItem(e)&&this.presenceItems.set(e.presenceKey,e)}removePresenceItem(e){this.shouldUsePresenceItem(e)&&this.presenceItems.delete(e.presenceKey)}replacePresenceItems(e){for(let t of(this.presenceItems.clear(),e))this.addPresenceItem(t)}getPresenceItems(){return Array.from(this.presenceItems.values())}};let AlivePresence=class AlivePresence{constructor(){this.presenceChannels=new Map}getPresenceChannel(e){let t=this.presenceChannels.get(e)||new PresenceChannel;return this.presenceChannels.set(e,t),t}handleMessage(e,t){let s=this.getPresenceChannel(e);switch(t.e){case"pf":s.replacePresenceItems(t.d.map(o));break;case"pa":s.addPresenceItem(o(t.d));break;case"pr":s.removePresenceItem(o(t.d))}return this.getChannelItems(e)}getChannelItems(e){return this.getPresenceChannel(e).getPresenceItems()}clearChannel(e){this.presenceChannels.delete(e)}};function l(e){return Object.assign(Object.assign({},e),{isLocal:!0})}let PresenceMetadataForChannel=class PresenceMetadataForChannel{constructor(){this.subscriberMetadata=new Map}setMetadata(e,t){this.subscriberMetadata.set(e,t)}removeSubscribers(e){let t=!1;for(let s of e)t=this.subscriberMetadata.delete(s)||t;return t}getMetadata(e){if(!e){let e,t=[];for(let s of this.subscriberMetadata.values())for(let n of s)if("_i"in n){let t=!!n._i;e=void 0===e?t:t&&e}else t.push(n);return void 0!==e&&t.push({_i:+!!e}),t}let t=[],{subscriber:s,markAllAsLocal:n}=e;for(let[e,r]of this.subscriberMetadata){let i=n||e===s?r.map(l):r;t.push(...i)}return t}hasSubscribers(){return this.subscriberMetadata.size>0}};let PresenceMetadataSet=class PresenceMetadataSet{constructor(){this.metadataByChannel=new Map}setMetadata({subscriber:e,channelName:t,metadata:s}){let n=this.metadataByChannel.get(t);n||(n=new PresenceMetadataForChannel,this.metadataByChannel.set(t,n)),n.setMetadata(e,s)}removeSubscribers(e){let t=new Set;for(let[s,n]of this.metadataByChannel)n.removeSubscribers(e)&&t.add(s),n.hasSubscribers()||this.metadataByChannel.delete(s);return t}getChannelMetadata(e,t){let s=this.metadataByChannel.get(e);return(null==s?void 0:s.getMetadata(t))||[]}};async function h(e,t){let s,n=new Promise((t,n)=>{s=self.setTimeout(()=>n(Error("timeout")),e)});if(!t)return n;try{await Promise.race([n,f(t)])}catch(e){throw self.clearTimeout(s),e}}async function u(e,t){let s,n=new Promise(t=>{s=self.setTimeout(t,e)});if(!t)return n;try{await Promise.race([n,f(t)])}catch(e){throw self.clearTimeout(s),e}}async function d(e,t,s=1/0,n){let r=n?f(n):null;for(let i=0;i<t;i++)try{let t=r?Promise.race([e(),r]):e();return await t}catch(a){if("AbortError"===a.name||i===t-1)throw a;let e=1e3*Math.pow(2,i),r=Math.floor(Math.random()*Math.floor(.1*e));await u(Math.min(s,e+r),n)}throw Error("retry failed")}function f(e){return new Promise((t,s)=>{let n=Error("aborted");n.name="AbortError",e.aborted?s(n):e.addEventListener("abort",()=>s(n))})}async function p(e,t,s){var n;let r=new WebSocket(e),i=(n=r,new Promise((e,t)=>{n.readyState===WebSocket.OPEN?e(n):(n.onerror=()=>{n.onerror=null,n.onopen=null,t(Error("connect failed"))},n.onopen=()=>{n.onerror=null,n.onopen=null,e(n)})}));try{return await Promise.race([i,h(t,s)]),r}catch(e){throw m(i),e}}async function m(e){try{(await e).close()}catch(e){}}let StableSocket=class StableSocket{constructor(e,t,s){this.socket=null,this.opening=null,this.url=e,this.delegate=t,this.policy=s}async open(){if(this.opening||this.socket)return;this.opening=new AbortController;let e=Object.assign(Object.assign({},this.policy),{signal:this.opening.signal});try{var t;this.socket=await (t=this.url,d(()=>p(t,e.timeout,e.signal),e.attempts,e.maxDelay,e.signal))}catch(e){this.delegate.socketDidFinish(this);return}finally{this.opening=null}this.socket.onclose=e=>{var t;this.socket=null,this.delegate.socketDidClose(this,e.code,e.reason),(this.delegate.socketShouldRetry?this.delegate.socketShouldRetry(this,e.code):(t=e.code)!==b&&t!==g)?setTimeout(()=>this.open(),Math.random()*(100+(this.delegate.reconnectWindow||50)-100)+100):this.delegate.socketDidFinish(this)},this.socket.onmessage=e=>{this.delegate.socketDidReceiveMessage(this,e.data)},this.delegate.socketDidOpen(this)}close(e,t){this.opening?(this.opening.abort(),this.opening=null):this.socket&&(this.socket.onclose=null,this.socket.close(e,t),this.socket=null,this.delegate.socketDidClose(this,e,t),this.delegate.socketDidFinish(this))}send(e){this.socket&&this.socket.send(e)}isOpen(){return!!this.socket}};let b=1008,g=1011;let MultiMap=class MultiMap{constructor(e){if(this.map=new Map,e)for(const[t,s]of e)this.set(t,s)}get(e){return this.map.get(e)||new Set}set(e,t){let s=this.map.get(e);return s||(s=new Set,this.map.set(e,s)),s.add(t),this}has(e){return this.map.has(e)}delete(e,t){let s=this.map.get(e);if(!s)return!1;if(!t)return this.map.delete(e);let n=s.delete(t);return s.size||this.map.delete(e),n}drain(e){let t=[];for(let s of this.keys())this.delete(s,e)&&!this.has(s)&&t.push(s);return t}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.entries()}clear(){this.map.clear()}get size(){return this.map.size}};let SubscriptionSet=class SubscriptionSet{constructor(){this.subscriptions=new MultiMap,this.signatures=new Map}add(...e){let t=[];for(let{subscriber:s,topic:n}of e)this.subscriptions.has(n.name)||(t.push(n),this.signatures.set(n.name,n)),this.subscriptions.set(n.name,s);return t}delete(...e){let t=[];for(let{subscriber:s,topic:n}of e)this.subscriptions.delete(n.name,s)&&!this.subscriptions.has(n.name)&&(t.push(n),this.signatures.delete(n.name));return t}drain(...e){let t=[];for(let s of e)for(let e of this.subscriptions.drain(s)){let s=this.signatures.get(e);this.signatures.delete(e),t.push(s)}return t}topics(){return this.signatures.values()}topic(e){return this.signatures.get(e)||null}subscribers(e){return this.subscriptions.get(e).values()}};function*y(e,t){for(let s=0;s<e.length;s+=t)yield e.slice(s,s+t)}function w(e){return new Promise((t,s)=>{let n=Error("aborted");n.name="AbortError",e.aborted?s(n):e.addEventListener("abort",()=>s(n))})}async function k(e,t){let s,n=new Promise(t=>{s=self.setTimeout(t,e)});if(!t)return n;try{await Promise.race([n,w(t)])}catch(e){throw self.clearTimeout(s),e}}async function M(e,t,s=1/0,n){let r=n?w(n):null;for(let i=0;i<t;i++)try{let t=r?Promise.race([e(),r]):e();return await t}catch(a){if("AbortError"===a.name||i===t-1)throw a;let e=1e3*Math.pow(2,i),r=Math.floor(Math.random()*Math.floor(.1*e));await k(Math.min(s,e+r),n)}throw Error("retry failed")}(P=v||(v={})).Deploy="Alive Redeploy",P.Reconnect="Alive Reconnect";let alive_session_AliveSession=class alive_session_AliveSession{constructor(e,t,s,n,r=6e5,i={}){var a,o;this.url=e,this.getUrl=t,this.inSharedWorker=s,this.notify=n,this.maxReconnectBackoff=r,this.options=i,this.subscriptions=new SubscriptionSet,this.state="online",this.retrying=null,this.connectionCount=0,this.presence=new AlivePresence,this.presenceMetadata=new PresenceMetadataSet,this.intentionallyDisconnected=!1,this.lastCameOnline=0,this.userId=function(e){let t=e.match(/\/u\/(\d+)\/ws/);return t?+t[1]:0}(e),this.presenceId=`${Math.round(0x7fffffff*Math.random())}_${Math.round(Date.now()/1e3)}`,this.presenceKey=(a=this.userId,o=this.presenceId,`${a}:${o}`),this.socket=this.connect()}subscribe(e){let t=this.subscriptions.add(...e);for(let s of(this.sendSubscribe(t),e)){let e=s.topic.name;c(e)&&this.notifyCachedPresence(s.subscriber,e)}}unsubscribe(e){let t=this.subscriptions.delete(...e);this.sendUnsubscribe(t)}unsubscribeAll(...e){let t=this.subscriptions.drain(...e);this.sendUnsubscribe(t);let s=this.presenceMetadata.removeSubscribers(e);this.sendPresenceMetadataUpdate(s)}requestPresence(e,t){for(let s of t)this.notifyCachedPresence(e,s)}notifyCachedPresence(e,t){let s=this.presence.getChannelItems(t);0!==s.length&&this.notifyPresenceChannel(t,s)}updatePresenceMetadata(e){let t=new Set;for(let s of e)this.presenceMetadata.setMetadata(s),t.add(s.channelName);this.sendPresenceMetadataUpdate(t)}sendPresenceMetadataUpdate(e){if(!e.size)return;let t=[];for(let s of e){let e=this.subscriptions.topic(s);e&&t.push(e)}this.sendSubscribe(t)}online(){var e;this.lastCameOnline=Date.now(),this.state="online",null==(e=this.retrying)||e.abort(),this.socket.open()}offline(){var e;this.state="offline",null==(e=this.retrying)||e.abort(),this.socket.close()}shutdown(){this.inSharedWorker&&self.close()}get reconnectWindow(){let e=Date.now()-this.lastCameOnline<6e4;return 0===this.connectionCount||this.intentionallyDisconnected||e?0:1e4}socketDidOpen(){this.intentionallyDisconnected=!1,this.connectionCount++,this.socket.url=this.getUrlWithPresenceId(),this.sendSubscribe(this.subscriptions.topics())}socketDidClose(e,t,s){if(void 0!==this.redeployEarlyReconnectTimeout&&clearTimeout(this.redeployEarlyReconnectTimeout),"Alive Reconnect"===s)this.intentionallyDisconnected=!0;else if("Alive Redeploy"===s){this.intentionallyDisconnected=!0;let e=3+22*Math.random();this.redeployEarlyReconnectTimeout=setTimeout(()=>{this.intentionallyDisconnected=!0,this.socket.close(1e3,"Alive Redeploy Early Client Reconnect")},60*e*1e3)}}socketDidFinish(){"offline"!==this.state&&this.reconnect()}socketDidReceiveMessage(e,t){let s=JSON.parse(t);switch(s.e){case"ack":this.handleAck(s);break;case"msg":this.handleMessage(s)}}handleAck(e){for(let t of this.subscriptions.topics())t.offset=e.off}handleMessage(e){let t=e.ch,s=this.subscriptions.topic(t);if(s){if(s.offset=e.off,"e"in e.data){let s=this.presence.handleMessage(t,e.data);this.notifyPresenceChannel(t,s);return}e.data.wait||(e.data.wait=0),this.notify(this.subscriptions.subscribers(t),{channel:t,type:"message",data:e.data})}}notifyPresenceChannel(e,t){var s,n;let r=new Map;for(let e of t){let{userId:t,metadata:s,presenceKey:n}=e,i=r.get(t)||{userId:t,isOwnUser:t===this.userId,metadata:[]};if(n!==this.presenceKey){for(let e of s){if("_i"in e){!1!==i.isIdle&&(i.isIdle=!!e._i);continue}i.metadata.push(e)}r.set(t,i)}}for(let t of this.subscriptions.subscribers(e)){let i=this.userId,a=Array.from(r.values()).filter(e=>e.userId!==i),o=null!=(n=null==(s=r.get(this.userId))?void 0:s.metadata)?n:[],c=this.presenceMetadata.getChannelMetadata(e,{subscriber:t,markAllAsLocal:!this.inSharedWorker});this.notify([t],{channel:e,type:"presence",data:[{userId:i,isOwnUser:!0,metadata:[...o,...c]},...a]})}}async reconnect(){if(!this.retrying)try{this.retrying=new AbortController;let e=await M(this.getUrl,1/0,this.maxReconnectBackoff,this.retrying.signal);e?(this.url=e,this.socket=this.connect()):this.shutdown()}catch(e){if("AbortError"!==e.name)throw e}finally{this.retrying=null}}getUrlWithPresenceId(){let e=new URL(this.url,self.location.origin);return e.searchParams.set("shared",this.inSharedWorker.toString()),e.searchParams.set("p",`${this.presenceId}.${this.connectionCount}`),e.toString()}connect(){let e=new StableSocket(this.getUrlWithPresenceId(),this,this.options.socketPolicy||{timeout:4e3,attempts:16,maxDelay:512e3});return e.open(),e}sendSubscribe(e){for(let t of y(Array.from(e),25)){let e={};for(let s of t)c(s.name)?e[s.signed]=JSON.stringify(this.presenceMetadata.getChannelMetadata(s.name)):e[s.signed]=s.offset;this.socket.send(JSON.stringify({subscribe:e}))}}sendUnsubscribe(e){for(let t of y(Array.from(e,e=>e.signed),25))this.socket.send(JSON.stringify({unsubscribe:t}));for(let t of e)c(t.name)&&this.presence.clearChannel(t.name)}};var P,v,C=new WeakMap,S=new WeakSet;let AliveSession=class AliveSession extends alive_session_AliveSession{constructor(e,t,s,n,r){super(e,()=>(function(e,t,s){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return s})(this,S,_).call(this),s,n,void 0,r),function(e,t){a(e,t),t.add(e)}(this,S),function(e,t,s){a(e,t),t.set(e,s)}(this,C,{writable:!0,value:void 0}),function(e,t,s){var n=i(e,t,"set");if(n.set)n.set.call(e,s);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=s}}(this,C,t)}};function _(){var e;return I((e=i(this,C,"get"),e.get?e.get.call(this):e.value))}async function I(e){let t=await A(e);return t&&t.url&&t.token?E(t.url,t.token):null}async function A(e){let t=await fetch(e,{headers:{Accept:"application/json"}});if(t.ok)return t.json();if(404===t.status)return null;throw Error("fetch error")}async function E(e,t){let s=await fetch(e,{method:"POST",mode:"same-origin",headers:{"Scoped-CSRF-Token":t}});if(s.ok)return s.text();throw Error("fetch error")}function D(e,t){for(let s of e)s.postMessage(t)}let O=(e=null,function(t){let s=t.target,n=t.data;n.connect&&!e?e=new AliveSession(n.connect.url,n.connect.refreshUrl,!0,D,n.connect.options):e&&function(e,t,s){let n=e=>({subscriber:t,topic:e});if(s.subscribe&&e.subscribe(s.subscribe.map(n)),s.unsubscribe&&e.unsubscribe(s.unsubscribe.map(n)),s.requestPresence&&e.requestPresence(t,s.requestPresence),s.updatePresenceMetadata){for(let e of s.updatePresenceMetadata)e.subscriber=t;e.updatePresenceMetadata(s.updatePresenceMetadata)}null!=s.online&&(s.online?e.online():e.offline()),s.hangup&&e.unsubscribeAll(t)}(e,s,n)});if(self.onconnect=e=>{let t=e.ports[0];t&&(t.onmessage=O)},"function"==typeof BroadcastChannel){let e=new BroadcastChannel("shared-worker-error");self.addEventListener("error",t=>{let{error:{name:s,message:n,stack:r}}=t;e.postMessage({error:{name:s,message:n,stack:r}})})}})(); +//# sourceMappingURL=socket-worker-eacb6da07a42.js.map \ No newline at end of file diff --git a/socketworker/socket-worker.ts b/socketworker/socket-worker.ts new file mode 100644 index 0000000..dbf83d6 --- /dev/null +++ b/socketworker/socket-worker.ts @@ -0,0 +1,93 @@ +import type {AliveEvent, AliveSessionOptions, MetadataUpdate, Topic} from '@github/alive-client' +import {AliveSession} from '@github-ui/alive/session' + +declare const self: SharedWorkerGlobalScope + +type Command = { + connect?: {url: string; refreshUrl: string; options: AliveSessionOptions} + subscribe?: Topic[] + unsubscribe?: Topic[] + requestPresence?: string[] + updatePresenceMetadata?: Array<MetadataUpdate<MessagePort>> + hangup?: boolean + online?: boolean +} + +function notify(subscribers: Iterable<MessagePort>, event: AliveEvent) { + for (const port of subscribers) { + port.postMessage(event) + } +} + +function fromPort(session: AliveSession<MessagePort>, port: MessagePort, data: Command) { + const toSub = (topic: Topic) => ({subscriber: port, topic}) + + if (data.subscribe) { + session.subscribe(data.subscribe.map(toSub)) + } + + if (data.unsubscribe) { + session.unsubscribe(data.unsubscribe.map(toSub)) + } + + if (data.requestPresence) { + session.requestPresence(port, data.requestPresence) + } + + if (data.updatePresenceMetadata) { + for (const update of data.updatePresenceMetadata) { + // Set the subscriber for the update + // This is used to track where the metadata originated + update.subscriber = port + } + session.updatePresenceMetadata(data.updatePresenceMetadata) + } + + if (data.online != null) { + if (data.online) { + session.online() + } else { + session.offline() + } + } + + if (data.hangup) { + session.unsubscribeAll(port) + } +} + +function withSocket(): (event: MessageEvent) => void { + let session: AliveSession<MessagePort> | null = null + return function (event: MessageEvent) { + const port = event.target as MessagePort + const data = event.data as Command + if (data.connect && !session) { + session = new AliveSession(data.connect.url, data.connect.refreshUrl, true, notify, data.connect.options) + } else if (session) { + fromPort(session, port, data) + } + } +} + +const process = withSocket() + +self.onconnect = (event: MessageEvent) => { + const port = event.ports[0] + if (port) { + port.onmessage = process + } +} + +if (typeof BroadcastChannel === 'function') { + // Broadcast errors to all tabs. The tabs will then forward the error Sentry. + const errorChannel = new BroadcastChannel('shared-worker-error') + self.addEventListener('error', event => { + const { + error: {name, message, stack}, + } = event + + errorChannel.postMessage({ + error: {name, message, stack}, + }) + }) +} diff --git a/socketworker/stablesocketindex.js b/socketworker/stablesocketindex.js new file mode 100644 index 0000000..c4cbe2c --- /dev/null +++ b/socketworker/stablesocketindex.js @@ -0,0 +1,231 @@ +async function timeout(ms, signal) { + let id; + const done = new Promise((resolve, reject) => { + id = self.setTimeout(() => reject(new Error('timeout')), ms); + }); + if (!signal) + return done; + try { + await Promise.race([done, whenAborted(signal)]); + } + catch (e) { + self.clearTimeout(id); + throw e; + } +} +async function wait(ms, signal) { + let id; + const done = new Promise(resolve => { + id = self.setTimeout(resolve, ms); + }); + if (!signal) + return done; + try { + await Promise.race([done, whenAborted(signal)]); + } + catch (e) { + self.clearTimeout(id); + throw e; + } +} +async function retry(fn, attempts, maxDelay = Infinity, signal) { + const aborted = signal ? whenAborted(signal) : null; + for (let i = 0; i < attempts; i++) { + try { + const op = aborted ? Promise.race([fn(), aborted]) : fn(); + return await op; + } + catch (e) { + if (e.name === 'AbortError') + throw e; + if (i === attempts - 1) + throw e; + const ms = Math.pow(2, i) * 1000; + const vary = rand(ms * 0.1); + await wait(Math.min(maxDelay, ms + vary), signal); + } + } + throw new Error('retry failed'); +} +function whenAborted(signal) { + return new Promise((resolve, reject) => { + const error = new Error('aborted'); + error.name = 'AbortError'; + if (signal.aborted) { + reject(error); + } + else { + signal.addEventListener('abort', () => reject(error)); + } + }); +} +function rand(max) { + return Math.floor(Math.random() * Math.floor(max)); +} + +async function connect(url, ms, signal) { + const socket = new WebSocket(url); + const opened = whenOpen(socket); + try { + await Promise.race([opened, timeout(ms, signal)]); + return socket; + } + catch (e) { + shutdown(opened); + throw e; + } +} +async function shutdown(opened) { + try { + const socket = await opened; + socket.close(); + } + catch (_a) { + } +} +function connectWithRetry(url, policy) { + const fn = () => connect(url, policy.timeout, policy.signal); + return retry(fn, policy.attempts, policy.maxDelay, policy.signal); +} +function whenOpen(socket) { + return new Promise((resolve, reject) => { + if (socket.readyState === WebSocket.OPEN) { + resolve(socket); + } + else { + socket.onerror = () => { + socket.onerror = null; + socket.onopen = null; + reject(new Error('connect failed')); + }; + socket.onopen = () => { + socket.onerror = null; + socket.onopen = null; + resolve(socket); + }; + } + }); +} + +class StableSocket { + constructor(url, delegate, policy) { + this.socket = null; + this.opening = null; + this.url = url; + this.delegate = delegate; + this.policy = policy; + } + async open() { + if (this.opening || this.socket) + return; + this.opening = new AbortController(); + const policy = Object.assign(Object.assign({}, this.policy), { signal: this.opening.signal }); + try { + this.socket = await connectWithRetry(this.url, policy); + } + catch (_a) { + this.delegate.socketDidFinish(this); + return; + } + finally { + this.opening = null; + } + this.socket.onclose = (event) => { + this.socket = null; + this.delegate.socketDidClose(this, event.code, event.reason); + const fatal = this.delegate.socketShouldRetry + ? !this.delegate.socketShouldRetry(this, event.code) + : isFatal(event.code); + if (fatal) { + this.delegate.socketDidFinish(this); + } + else { + setTimeout(() => this.open(), rand$1(100, 100 + (this.delegate.reconnectWindow || 50))); + } + }; + this.socket.onmessage = (event) => { + this.delegate.socketDidReceiveMessage(this, event.data); + }; + this.delegate.socketDidOpen(this); + } + close(code, reason) { + if (this.opening) { + this.opening.abort(); + this.opening = null; + } + else if (this.socket) { + this.socket.onclose = null; + this.socket.close(code, reason); + this.socket = null; + this.delegate.socketDidClose(this, code, reason); + this.delegate.socketDidFinish(this); + } + } + send(data) { + if (this.socket) { + this.socket.send(data); + } + } + isOpen() { + return !!this.socket; + } +} +function rand$1(min, max) { + return Math.random() * (max - min) + min; +} +function isFatal(code) { + return code === POLICY_VIOLATION || code === INTERNAL_ERROR; +} +const POLICY_VIOLATION = 1008; +const INTERNAL_ERROR = 1011; + +class BufferedSocket { + constructor(socket) { + this.buf = []; + this.socket = socket; + this.delegate = socket.delegate; + socket.delegate = this; + } + open() { + return this.socket.open(); + } + close(code, reason) { + this.socket.close(code, reason); + } + send(data) { + if (this.socket.isOpen()) { + this.flush(); + this.socket.send(data); + } + else { + this.buf.push(data); + } + } + isOpen() { + return this.socket.isOpen(); + } + flush() { + for (const data of this.buf) { + this.socket.send(data); + } + this.buf.length = 0; + } + socketDidOpen(socket) { + this.flush(); + this.delegate.socketDidOpen(socket); + } + socketDidClose(socket, code, reason) { + this.delegate.socketDidClose(socket, code, reason); + } + socketDidFinish(socket) { + this.delegate.socketDidFinish(socket); + } + socketDidReceiveMessage(socket, message) { + this.delegate.socketDidReceiveMessage(socket, message); + } + socketShouldRetry(socket, code) { + return this.delegate.socketShouldRetry ? this.delegate.socketShouldRetry(socket, code) : !isFatal(code); + } +} + +export { BufferedSocket, StableSocket, connect, connectWithRetry }; diff --git a/socketworker/subscription-set.js b/socketworker/subscription-set.js new file mode 100644 index 0000000..f2fe0c3 --- /dev/null +++ b/socketworker/subscription-set.js @@ -0,0 +1,49 @@ +import MultiMap from '@github/multimap'; +export class SubscriptionSet { + constructor() { + this.subscriptions = new MultiMap(); + this.signatures = new Map(); + } + add(...subscriptions) { + const added = []; + for (const { subscriber, topic } of subscriptions) { + if (!this.subscriptions.has(topic.name)) { + added.push(topic); + this.signatures.set(topic.name, topic); + } + this.subscriptions.set(topic.name, subscriber); + } + return added; + } + delete(...subscriptions) { + const removed = []; + for (const { subscriber, topic } of subscriptions) { + const deleted = this.subscriptions.delete(topic.name, subscriber); + if (deleted && !this.subscriptions.has(topic.name)) { + removed.push(topic); + this.signatures.delete(topic.name); + } + } + return removed; + } + drain(...subscribers) { + const removed = []; + for (const subscriber of subscribers) { + for (const name of this.subscriptions.drain(subscriber)) { + const topic = this.signatures.get(name); + this.signatures.delete(name); + removed.push(topic); + } + } + return removed; + } + topics() { + return this.signatures.values(); + } + topic(name) { + return this.signatures.get(name) || null; + } + subscribers(topic) { + return this.subscriptions.get(topic).values(); + } +} diff --git a/ssr-globals.ts b/ssr-globals.ts new file mode 100644 index 0000000..175e82b --- /dev/null +++ b/ssr-globals.ts @@ -0,0 +1,61 @@ +// When using SSR, browser globals are not available. If you try to use them, Node.js will throw an error +type SSRSafeLocation = Pick<Location, 'pathname' | 'origin' | 'search' | 'hash' | 'href'> + +// In some cases, we want to force the server environment to be used in the browser. This is useful for testing/profiling +const forceServer = typeof FORCE_SERVER_ENV !== 'undefined' ? FORCE_SERVER_ENV : false + +// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope +export const ssrSafeDocument = typeof document === 'undefined' || forceServer ? undefined : document +// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope +export const ssrSafeWindow = typeof window === 'undefined' || forceServer ? undefined : window +// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope, no-restricted-globals +export const ssrSafeHistory = typeof history === 'undefined' || forceServer ? undefined : history + +// Fallback location object that can be set via setLocation +let fallbackLocation: SSRSafeLocation = {pathname: '', origin: '', search: '', hash: '', href: ''} + +// Server-specific getter that can be overridden by the server module +let getServerLocation: (() => URL | undefined) | null = null + +// Create a location object with getters that check server getter first, then fallback +function createSSRSafeLocation(): SSRSafeLocation { + return { + get pathname() { + const serverUrl = getServerLocation ? getServerLocation() : undefined + return serverUrl?.pathname ?? fallbackLocation.pathname + }, + get origin() { + const serverUrl = getServerLocation ? getServerLocation() : undefined + return serverUrl?.origin ?? fallbackLocation.origin + }, + get search() { + const serverUrl = getServerLocation ? getServerLocation() : undefined + return serverUrl?.search ?? fallbackLocation.search + }, + get hash() { + const serverUrl = getServerLocation ? getServerLocation() : undefined + return serverUrl?.hash ?? fallbackLocation.hash + }, + get href() { + const serverUrl = getServerLocation ? getServerLocation() : undefined + return serverUrl?.href ?? fallbackLocation.href + }, + } +} + +export const ssrSafeLocation: SSRSafeLocation = + // eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope + typeof location === 'undefined' || forceServer ? createSSRSafeLocation() : location + +export function setLocation(url: string) { + // eslint-disable-next-line no-restricted-syntax + const parsedURL: SSRSafeLocation = new URL(url) + const {pathname, origin, search, hash, href} = parsedURL + + fallbackLocation = {pathname, origin, search, hash, href} +} + +// This is a special helper method for setting the location getter in the SSR environment only +export function setServerLocationGetter(getter: () => URL | undefined) { + getServerLocation = getter +} diff --git a/ssr.ts b/ssr.ts new file mode 100644 index 0000000..f51469d --- /dev/null +++ b/ssr.ts @@ -0,0 +1,27 @@ +import {ssrSafeDocument} from './ssr-globals' + +/*** + * Are we rendering on the server? + */ +export const IS_SERVER = typeof ssrSafeDocument === 'undefined' + +/*** + * Are we rendering on the client? + */ +export const IS_BROWSER = !IS_SERVER + +/*** + * This helper returns `true` if: + * - we are rendering on the server + * - we are on the client, and the app has been hydrated from a server-render + */ +export function wasServerRendered() { + if (IS_SERVER || !ssrSafeDocument) { + return true + } + + return Boolean( + ssrSafeDocument.querySelector('react-app[data-ssr="true"]') || + ssrSafeDocument.querySelector('react-partial[data-ssr="true"][partial-name="repos-overview"]'), + ) +} diff --git a/stack-trace-parser.esm.js b/stack-trace-parser.esm.js new file mode 100644 index 0000000..d3f9db4 --- /dev/null +++ b/stack-trace-parser.esm.js @@ -0,0 +1,136 @@ +var UNKNOWN_FUNCTION = '<unknown>'; +/** + * This parses the different stack traces and puts them into one format + * This borrows heavily from TraceKit (https://github.com/csnover/TraceKit) + */ + +function parse(stackString) { + var lines = stackString.split('\n'); + return lines.reduce(function (stack, line) { + var parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line); + + if (parseResult) { + stack.push(parseResult); + } + + return stack; + }, []); +} +var chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; +var chromeEvalRe = /\((\S*)(?::(\d+))(?::(\d+))\)/; + +function parseChrome(line) { + var parts = chromeRe.exec(line); + + if (!parts) { + return null; + } + + var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line + + var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line + + var submatch = chromeEvalRe.exec(parts[2]); + + if (isEval && submatch != null) { + // throw out eval line/column and use top-most line/column number + parts[2] = submatch[1]; // url + + parts[3] = submatch[2]; // line + + parts[4] = submatch[3]; // column + } + + return { + file: !isNative ? parts[2] : null, + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: isNative ? [parts[2]] : [], + lineNumber: parts[3] ? +parts[3] : null, + column: parts[4] ? +parts[4] : null + }; +} + +var winjsRe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i; + +function parseWinjs(line) { + var parts = winjsRe.exec(line); + + if (!parts) { + return null; + } + + return { + file: parts[2], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[3], + column: parts[4] ? +parts[4] : null + }; +} + +var geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i; +var geckoEvalRe = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; + +function parseGecko(line) { + var parts = geckoRe.exec(line); + + if (!parts) { + return null; + } + + var isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + var submatch = geckoEvalRe.exec(parts[3]); + + if (isEval && submatch != null) { + // throw out eval line/column and use top-most line number + parts[3] = submatch[1]; + parts[4] = submatch[2]; + parts[5] = null; // no column when eval + } + + return { + file: parts[3], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: parts[2] ? parts[2].split(',') : [], + lineNumber: parts[4] ? +parts[4] : null, + column: parts[5] ? +parts[5] : null + }; +} + +var javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i; + +function parseJSC(line) { + var parts = javaScriptCoreRe.exec(line); + + if (!parts) { + return null; + } + + return { + file: parts[3], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[4], + column: parts[5] ? +parts[5] : null + }; +} + +var nodeRe = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i; + +function parseNode(line) { + var parts = nodeRe.exec(line); + + if (!parts) { + return null; + } + + return { + file: parts[2], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[3], + column: parts[4] ? +parts[4] : null + }; +} + +export { parse }; diff --git a/stats.ts b/stats.ts new file mode 100644 index 0000000..84ec700 --- /dev/null +++ b/stats.ts @@ -0,0 +1,144 @@ +import {ssrSafeDocument, IS_SERVER} from '@github-ui/ssr-utils' +import {loaded} from '@github-ui/document-ready' +import {bundler} from '@github-ui/runtime-environment' +import {isFeatureEnabled} from '@github-ui/feature-flags' +import {isLoggedIn} from '@github-ui/client-env' +import {throttle} from '@github/mini-throttle' +import {CUSTOM_METRIC_REGISTRY, type CustomMetricKey} from './registry' + +// eslint-disable-next-line no-barrel-files/no-barrel-files +export type {CustomMetricKey} + +let stats: PlatformBrowserStat[] = [] +const chunkSize = 64 * 1024 + +export function sendCustomMetric({ + name, + value, + tags, +}: { + name: CustomMetricKey + value: number + tags?: PlatformBrowserCustomMetricTags +}): void { + const customMetric = CUSTOM_METRIC_REGISTRY[name] + sendStats({ + customMetric: { + ...customMetric, + value, + tags, + }, + ui: bundler === 'vite-tss' ? true : false, + }) +} + +export function sendStats(stat: PlatformBrowserStat, flushImmediately = false, samplingProbability = 0.5): void { + if (IS_SERVER || isFeatureEnabled('browser_stats_disabled') === true) { + return + } + if (samplingProbability < 0 || samplingProbability > 1) { + throw new RangeError('Sampling probability must be between 0 and 1') + } + + if (stat.timestamp === undefined) stat.timestamp = Date.now() + stat.loggedIn = isLoggedIn() + stat.staff = isStaff() + stat.bundler = bundler + stat.ui = bundler === 'vite-tss' ? true : false + if (Math.random() < samplingProbability) { + stats.push(stat) + } + + if (flushImmediately) { + flushStats() + } else { + throttledScheduleSendStats() + } +} + +let queued: number | null = null + +const throttledScheduleSendStats = throttle(async function scheduleSendStats() { + await loaded + if (queued == null) { + queued = window.requestIdleCallback(flushStats) + } +}, 5000) + +function flushStats() { + queued = null + if (!stats.length) { + return + } + + const url = ssrSafeDocument?.head?.querySelector<HTMLMetaElement>('meta[name="browser-stats-url"]')?.content + if (!url) { + return + } + + const batches = getBatches(stats) + + for (const batch of batches) { + safeSend(url, `{"stats": [${batch.join(',')}], "target": "${getUITarget()}"}`) + } + + stats = [] +} + +// getBatches breaks up the list of stats into smaller batches +// that are less than 64kb in size. This is to avoid hitting the +// size limit of the beacon API. +function getBatches(items: PlatformBrowserStat[]): string[][] { + const batches: string[][] = [] + const itemStrings = items.map(item => JSON.stringify(item)) + + while (itemStrings.length > 0) { + batches.push(makeBatch(itemStrings)) + } + + return batches +} + +// makeBatch walks the items and collects batches of items that are within +// the 64kb limit. If an item is too big to fit in a batch, it is sent alone. +function makeBatch(itemStrings: string[]): string[] { + const firstItem = itemStrings.shift()! + const batch: string[] = [firstItem] + let size = firstItem.length + + while (itemStrings.length > 0 && size <= chunkSize) { + const nextItemSize = itemStrings[0]!.length + + if (size + nextItemSize <= chunkSize) { + const itemString = itemStrings.shift()! + batch.push(itemString) + size += nextItemSize + } else { + break + } + } + + return batch +} + +function safeSend(url: string, data: string) { + try { + if (navigator.sendBeacon) { + navigator.sendBeacon(url, data) + } + } catch { + // Silently ignore errors: https://github.com/github/github/issues/178088#issuecomment-829936461 + } +} + +export function isStaff(): boolean { + return !!ssrSafeDocument?.head?.querySelector<HTMLMetaElement>('meta[name="user-staff"]')?.content +} + +function getUITarget() { + return ssrSafeDocument?.head?.querySelector<HTMLMetaElement>('meta[name="ui-target"]')?.content || 'full' +} + +// Flush stats before users navigate away from the page +ssrSafeDocument?.addEventListener('pagehide', flushStats) +ssrSafeDocument?.addEventListener('visibilitychange', flushStats) diff --git a/suiteux..js b/suiteux..js new file mode 100644 index 0000000..2035dda --- /dev/null +++ b/suiteux..js @@ -0,0 +1,69 @@ +var shellPerformance=window.performance,HighResolutionTimingSupported=!!shellPerformance&&"function"==typeof shellPerformance.mark;HighResolutionTimingSupported&&shellPerformance.mark("shell_core_start"),function(){var e,t,n,o,r,i={57556:function(e,t,n){"use strict";var o;n.d(t,{f:function(){return o}}),function(e){e.depth0="0 0 0 0 transparent",e.depth4="0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108)",e.depth8="0 3.2px 7.2px 0 rgba(0, 0, 0, 0.132), 0 0.6px 1.8px 0 rgba(0, 0, 0, 0.108)",e.depth16="0 6.4px 14.4px 0 rgba(0, 0, 0, 0.132), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.108)",e.depth64="0 25.6px 57.6px 0 rgba(0, 0, 0, 0.22), 0 4.8px 14.4px 0 rgba(0, 0, 0, 0.18)"}(o||(o={}))},71250:function(e,t,n){"use strict";var o;n.d(t,{d:function(){return o}}),function(e){e.USGOV_DOD="https://pf.events.data.microsoft.com/OneCollector/1.0/",e.USGOV_DOJ="https://tb.events.data.microsoft.com/OneCollector/1.0/",e.PUBLIC="https://browser.events.data.microsoft.com/OneCollector/1.0/",e.CUSTOMER_CONTENT="",e.EUDB="https://eu-office.events.data.microsoft.com/OneCollector/1.0/"}(o||(o={}))},32104:function(e){e.exports="data:font/woff;charset=utf-8;base64,d09GRgABAAAAAEkgAA4AAAAAdUgABKj2AAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEgAAABgLuB/9WNtYXAAAAGMAAAB/wAABFqFlGebY3Z0IAAAA4wAAAAgAAAAKgnZCa9mcGdtAAADrAAAAPAAAAFZ/J7mjmdhc3AAAAScAAAADAAAAAwACAAbZ2x5ZgAABKgAAD3tAABgCCt0btFoZWFkAABCmAAAADYAAAA2LRkCQWhoZWEAAELQAAAAHQAAACQ3yjBmaG10eAAAQvAAAACNAAABsE2rJ4xsb2NhAABDgAAAAOgAAADowm7aXG1heHAAAERoAAAAHQAAACAApwNgbmFtZQAARIgAAAP3AAAJ+pKX8lVwb3N0AABIgAAAABQAAAAg/1EA6nByZXAAAEiUAAAAiQAAANN4vfIOeJxjYOEIYpzAwMrAwDqL1ZiBgVEaQjNfZEhjEuJgZeViZGIEAwYgEGBAAN9gBQUGhyezfmRygPkQkgGsjgXCU2BgAADSqwh+eJxjYGBgZoBgGQZGBhAzBMhjBPNZmC2A9CmGBgY2Bq8ns57cfPL9OcNz7udCz4WfizwXfS72XPy50nPt53bPfZ/nPM97XvK8+nn7813PDz4//ELmhcOLKS+mv9j9kuGl5Ev5l44v3V4WvZz5Su6V9avAVw2v+l9Ne53zOv+N0BuRN4vfMr2VfJv1tvBt9duat61vj789/fbM27NvL747/r70fe37uvf1H/o+TPzw56P2R4OP9z4+/vj04/OPLz++/lT9qe5Tw6emT8s/7fn08NPLz5qf47+YfKn70vSl7UvPl2lfNn3Z8+XBt5LvAt/dv0d/L/1+8Efm//8MDDj8ovhcC+yXbLBfqtD8Mg3FL4Vofsl+nUdTv0z6shHqF35kv0hfk54hXS3JKPFL4ovEe4nPEu8k/kh8lPgkcV/iusRJiQUS0yRmSkyRmCARJxEhES7+Rfy2eId4u3iKuKA4uziT2EOxu2KbxXrF+ETfid4UXS06Q3SSyCGRgyLyInLCE4SNhGWELgidENortFtoo1CpUJFQvlChUJ5gpcBZgWMChwWO8u/g38LvzS/LL8mXA4RpfKlAmMR7lfcy7yXei7xreWfzlvDm8urz/OJR477LfYv7Ovcl7rPcm7lXcbdzfuGM4lThFOT4wbGWgw2S9oYLYGQbaBcMPAAAB2RfLQB4nGPQYghlKGBoYFjFyMDYwOzAeIDBAYsIEAAAqhwHlXicXY+/TsNADMZzJLSEJ0A6IZ11KkOViJ3phksk1CUlDOelgNRKpO+AlIXFA8/ibhnzYgjMEf4utr/P+ny/c6f5yXx2nKVHKilWnDfhoNQLDurtmf35IU/vNmVhTNV5VvdlwWoJomtOF/VNsGjI0PWWTG0eH7acLWKXxY7w0nDShk7qbQB2qL/HHeJVPJLFI4QS30/xfYxL+rUsVobTiyasA/des/OoAUzFYxN49BoQf8ikP3VnE+NsOWXbwE5zgkSfygL3RJqE+0uPf/Wgkv+G+23Iv6tB9U3c9Bb0h2HBgrChl2fbUAkaYPkOhPxkxgABAAIACAAK//8AD3icrXwJeBvF2f/OnpIPyav7sC7LOizbsi1Zku34kO04vuLEjpOQ2DnJfd8JuTeQhEAuEsJZICkhUOCDQrgJFNGPFtomlCvAV2hLC7Sl0K8cH21iaTf/mVnJFg7H0+f5W97d2d2Z2Tneed/f+847Q5DEvQRB72Y2EhTBEUSMd/EeF++6l/pD6knySbGLYDYOXX+MnkDAP4oggKAgWJiAUBIqooQ4g59SBF36NEEUPEPkE+z/PUPkEBQ8K3CYgeHKKuCKuPT88ElBXCBGDkYQhBQhCCTYuRPmzBIsN8QNETFiHXEt8SP4TZ1Br2P1DOVhOS1DFbHuIq+b8mi9Pvio2hupjkY8WiYag49C0XDIEIaRDEaPFjSCSLXXF/MxQeDT+rggcBexnI/TqgDn4YwqoNcZjJzRYwdGyhizg3AoGjPGqEYQY2IgZCf1OhXpLgqSkepGUhtqhNcgvFfB53aS/TcAgDouvWOyjJV2/VipUcL/H0u7xlpM0jvHAQWAJB4HJfAt2Jl5C3bCt6DkuLSPpGnys6nSF45mb9Nrx4yVRlOF6cbXmrxxp/TF1M/kt0B9+Vugnpo6OuG6hWPGLLxuQuYam9NRUtIxJ5a+0sX/WWHE7IpIv4ffgl8c/txn3yxq9tvLikouzS4WuopCVsHwdZiGBBhiiVx4BynOqARaXgl4RA+HqTXUGnVKSAmskITkI0jt4JkUQV0lNYMXUvsQHTLopIA/Qkv4iFZiNrEB5pPuqXC651yj7kGItpMavY5UkbS7qDhIwreaRrIY9iwNexY+U9GwZ2nU0zGjikI974vZKVKwBt06nTtoTV/Jj0c9kBYcBOxHZ/Z0du4585E0dPCgNJS5A8yhrR+/fM+GeHzDPS9/vHUk/NG2zus2znatK7nq2IODMx44dlXJOtfsjftoISvfb71Swrd+JV2CC4Kc+eUfBYK/a2lzXd/uGaHQjN19dc1Lu/zymBYIgYM/OPI4OH5RfwAenSAX4F0c7AOJIAnpCeY3Q/AKIwkX4ZUhLj4Bumk4biWcBwVzoAXcH2NgHqNGj+sH7gExqqrU6Lpf9uCHW2r0VeZfFyDtKWBNcwk1QSiBHtZRDxh4BoyeUcDaDEGyJAkR0x6stwAEcAEQF2gCnveJBPnMi5+/CNuNRI3HXYI0OIbYjGpscAA75CisGiDaKQNBMgegujVBNhTOvEUkZgSGMKQ5CtFZFFGez4toDzI1HwiiJJAcfUHGXcSpKEiQLNte1ud43+FyOVTRgSuv6t8uXZCSyT8+t2+8rbY/WuDoLZff28siZXYr6bN6LeVlwZo2X8fcCV2VVluwNlaRb/VZysoqatrKYFzxfzKR80vDtdEqjdda2R2xdu565LW//uNTqtUFc+tDEVXRybX2Cdf/7E9JwAB6S//GK6fD7xUVye/baoJl5RavVfwfK85NbLCGx1davZqqaG24NF9+6HKQPjlyRVmZxWfNr4jVBm3Wyq4Jc9tX/+///vXVh3e2EwA2ZT/k+Q+hIa0EPiQtQIwbSvUPUNoLQxyb+scATeA7gdIOwPgs0Q87EccHLsApgRG4IPMYgm9T/dRDA6l/cCyVgMmoh/AdjAZOERQjciLiHh6YQAmYkymSkgZSs6i7KUqkxIHUzNRM1K2AhDKNHRyOG1PCJ9TdqVkDlJQiZ1InqZMDKSpFobg5w7zISniJENFMTCQGiaWQIwnEfkQX3851QJDy2SkjqPa5MNVwriiARBFz2Zm02HLJ8gnojC5EFdGYiwWQTDhXkGFUFOdqpADMAGYDGqmYS0XRxPdwIeop7/Ldt08urit35oF7PNJNCvgHlnlSQtWUjtoyu0KcoLCX1XZMAScUSqVCLMLnf3rAMhRRuslDZSKSp+WI0gOTb9+93At68pzldZJzJHsK4BfSY+iFgvg+biUKfYc3zrCFVm/aUi8Je7bGdzY374xvFZnotFVrl/p8S9eumhYlBfmxfAbEcDQymR2tyjZj4+G++i2bVifnZeU68phAqAWN2V9yv4R8ykGUEvMu51QUlO0IBwAVYFA/IInPcnhI+zg3MCKUEAMs7BkHgH2IX+p9gIMkEsPj3Ai8KJ8Yk5h5csu4cVtOzkxfPwxdsaGlYsAntVmsZLfFGr5iPboln3Q1tU4MFTn2PgkMOcagKVYl8ZZcjpJ0JjhirbXLg+DDhPjKvnKyVtpRPu7peb4eL9jK6r0xFyVk5Y+vUrxlwxUhqwWc8Q380TdQ0bL+irDVQna6Yl49ey0wUFyuBfyzKmYKGnMkfY4mj3M5JduTL4ovl+8ja8DV5eO68vPAVkdR1cSxTS4C8zkBthmU2LC9mmB7IWp2V5PeYiwv3ZCYQSxIfUPQ4iYcgUtMaN97t00SNrwq/fWeZb98cP+8qDD59veunbDtior5D3+yZ88nD8+vuGJralff/meXLn12f1/mSvVU3P8H6cLhe4D51Q3Refsf/OWyGwD3/k+qAlfdeN80lAwln3bv0c2kMjsdvGb4Mx6XDNGGpBrgAM9AIMmx6Ae70wt/EBjG7CQdHsEAJOeCMiHMw2pFY9HicMhoMBpoAqwYkFbQlb29Ew4deirx24fvvuuaq2dWtBm2+u/7CBhuzpa3V//fm/fHQIlECLzfMGvHbhA8+dvEU4cOsYT4nnR0ABwlB9ckfosfTeitjS1YcF3bzX1FR758eE627O7c+/x6Acqf/3U22LYPzroSfViuEsZPEKqrIb8JEEHIc6JEHdGI6ogIGeMehKncvA4hZRRGPeJCXYI4K0LgmR8S8uhQECVts6ovXgwPtvo5CMW9Fot3iNC6yswsh2SnhMUhBgLpQxREgRQkWBhJYImUEJnZVuJvHQzT114iBDFu8XotVCJ50Vzm0iIBDCFCSsB/MNk1ogiuGcEesErjiAFiJaIuCpJUBmWzXPatG40qLB9JNMwQ2YERsmPBKIA+mgrZ+c1LuvxCw+IDEyceWNzQ3/mNWwiOljR39qPbwXui3o3dchjHTL5ZPautBLUPqmNJ20wyAk+R7IdMt2vupus6UfR0Ft+477xu01xX9J5B+cPdG73psBw3dWl0djSR/lLm6Tfo2Q01I8S3aAQnMGrA3VwdS6OH0aoKE5/7+B27EOzbdcfjc7d/PCf1Ty3sXi1VMHGy/GzTG3cMDt7xxqb0VUHIj+VkkyemPtdCetBS/JyPt8vPkkRWdHxFkhLA0kEcyUHKRGVslbG9K+YyMi6fi0Ok9gNaFURReploq6NIFyA9AvmkAE5JHkF8UpA8HCS0pWf29/buP7M0c800ZPoqHkakBw8OIzlMckmCFrKToGtKyEqErxSmenRgDEC8CU5x5Ww5qpmShPydK0++Kb45AN6k3mTeTL5BBgekIPUGistiHon6xgFrXk5UERGiFmbhzhqQbjjcELUi6GsDJSQeezoDvIfaq5sPg/QBR5+9epw/RfjHVdshA0CDB2AVhCRSeLRRRBKWlCYsXhFWD6QPVhiKoyQoMZMQhpUWQbhEDOHhmIAQipAP+MfDQ8D0RKXRsJYwQgyDauCDvL6CCOM+nEj0w5qE9e7M4YEHk756fuAe938krEcHg8J62AzwQM8pVHBBPqSsg/6Be1a4AJtBoAlhCBYcMpsUARnQRaQpigLUQ77jD0XhZHK4RAAcGIJkkRTSuEDmQ0ixUSItyONSQmCp5d1mVGdOuCBQCVHN/FlUx1FSpAQxf5bsiAeKqPcJCoFYnAdKz6dpn3ejmsIDYF0qlS6iKDCYfXKoS+GhgPUQYceKiLHKfFGmpxGdjHdpYZFwnhxxUaAHPcAjvQfpAQ4J5r0hD1JdgOfiIFJaLg7rJwjrFBMtMAeMYGQdhIR4eRiwZPAKSMMaYwbVyOgHJeF+mYYo0p78PEvVuDJpxwgeeWLepO40HAGHMHbJV0g6M4Yuy4Lkj51FXL4mB3xqqWJ0GIVIe7y9/uals6aUgauzYId5GHWIYzBEKayyZBCKODu4rMZaUV5mBp8pUHNAWtVy/+D+gewHSgT/fRikG+lB6uhAakVqxQB1NLVygLqRuhEpDtm3qZUwCmofAOmaLcf0nwf7G9KlFmYCoOgHABJduXijeCMc7AJ4ExIL9aZ4iFw7IAWY+4euAG/j9AIa+Dh9FUwPqUQr82TWBtywSdlIluSiEV3GJ94oLO0uKeuYMWdGR5mQvrZvRtBtc7tQ0r1UuFGAFIQDEyfvWzNnYPr89R2JBAzOHhiAQRQPxZczwnqTLBNGt8MRatWRFPzBKz7BW9gO2bcpFGXElgL5NoN1l3nEGtjAGAJluDWHqIbkjJyPRTqMj/PFvCTSSEZwn1HGvo0Ugzl5WjyDUHFUE5HBIs3C5xoDDUZQtR0wkHwFcnX/0eVNpmBLidm0ZukrA69skV6/+27p9S0wuHSNyVzSEjQ1LT/aXzVnape1/Wh399F2a9fU2clJNfO6SiOV8Z9v864iQ8eB8fXNm1+XPjl+XPoEhYCRerYyUto1r6ZxlXfbz2EHILhCEyir0Gw5q+GvyN8FFXenMw+NFEkugDCcUbwyclFA2R8f9Un6Tu+qxkyZsvrGiiyYo/W/MNYLoXq098yHsnr04Zm9negOsAeheoTuoEb3bY/lJGk7GLalnSCKIApsIjqIKTKGGhY7aGTDrgg3UqiXPLjRjUwMY3Yl8CCLKO4vBqo8SjjUw55ohmw5dtukg0vqW9bcMjV5AuHqyKzdvZ52LyjbeP1tfSt+dWqj+NM1Zzu8bS5w6yfGCot5zq7bU0upCdIzoZV1E65fVO9nnq6c5hVvSR0pXxRl5jpCU9Y2FbePbXHSLzDjVh+dNPWWNS0Is0++fddcc24O2bqs29e+89F/z7wix6H7vytz1EzvNbOqU5vBgpfszsYlB3rqt/7KbgNrpEOF9rsax7Ys7y7hLQ7VN/i3FcqsMUhP8RQFaQSGwmmcRKWtexmkT4Uha4Zjlkrs+frtn24fO3b7T9/+ek92eN1bz9y6vL5++a3PvLVu7flM+PxpLEIujy6HOQJHWjuSIJMY4WVIg5AuzKSZ+yu7GZnRlSQcsBy3MnU0dXQz9Vfqr5tJM7USh1PmzSguuJb7K/NXHBePbACHsXkztZJauTkFX8IUqaM4LGOWjC1Pi+wisIZKUi+rM0rSFWEgnBDEBBQ1cRbKL4FMAAJ8LL3HYtEhvggIsckDZdLQIPkClJF/EYi0XIPPYJ4OogwjT70rg+CgWOczbQw/luF3PMbiLojnOJizf9zMSGTmOD8c6cH+DYfumTbtnkMb+oNCRl0jse3vEgI6sHgoJkoBhaEcT04jQi6b0fFEAkdO2/RYIiN3sxEMqj0Eki5Z/QGyMROMOlg4eircF4uLKgGEUCQ8UohHCMjmB2FW+soSQ/3uyqoi5iHYWvDTCD0MYSBG4rOUFcZ94CSc3AfcB2jca7MoELYY7Wzf9cT70nXXSe8/sas9O0wTlz/D4cvkjFsfTtMylDNhSMrssBIUhnQNYdH/fzmDsQ2L2thLVBLtGe2D5VRAnwVxq5E+LWsg0QbggmwlDLl9LMPwZcGAJlsScx+/U5gRWrmwfzqCq5cw1p3ev3BlaIZw5+N/snglCHBBa/7Sgf7pGQVjev/A0nykmcAYc49cWDDp1xvldCgHQGz89aQFF47I+V6AqRMJixcIu94YnPzyiJ7y8uTBN3YN24FQfTyQb7YSV6TtQNl1QVA96wxg7eArVo8x+/ANbnfeM+oeYnr2U0fUbzL5o46LDziiJUZjSdQBlo2cpWX5SvFBRX6+gl6WrxAfUOQvdcT8JkqQb5ah1GCZAtYY5xHI5EG+Lb8ZOV8QyL8rYT5iQJFPf4pylG4y+WMO0aBn387cRh1JfT4BMC19Bes9AckkloupKC490wF7jq9Gs2eoh3wheNbzXCwSLcbCAviClC/IRFAMFMFOwTP71fgOg3Fsz0RXZMGSNc1Lzxydk0+SlUUqfW7zjjgJQLgGgGOg6MZcY179znp3wKZX0bxOr8ktdRWoC2PWogWLZlqnziD/sPTnPVZnbbhc54yHnd3XnF6ca8plbi2q5LiSyQEAihc3JRUAkFMevoLL58xFZnW4caxDWRKKhXxKZzmbV6jiw7V1pgnnES6Lw74NwDq2EKux5OVUDCRU94g4RCMSVQJVy4trDrFMI4PrThkNOk8G96gAZwwPNxGi7BimZ/hPf1ZRYSytqu9d2l5+ZXXNpKi1evLyGi5PwRSVV1d4lSqrirZUm/f9V3G+FgDK4I11zagpn+rrWNbhgS3zb0Ohmo3PXVPpnhSlBnLMgeYqpcXmyEePbcHamip1+eIuW2sRH2PG3ST98XD79ddsWTmvxOLwtEyPtN6wd7WbZvL1ZqOWZjlGofMbNgDTI81Xt8DPViyaN32s32oM7PvxwxNVhVfq7F5N308fuL2hrE3Djd28ZklYadDmmz0B3r32uhuvW1+89Ny0oiabyoTajiBqIK//JUYTyJ4Ec0dN5/V5cCtBymfwmGfVstEBkkxMnt8wMnaKQiwAxvTxnkbAEeObxPO55lxntVW6SWescoO3peOl1X73fUajvyZSRk7WBY28tYAsdYQ9OsGil/7pjDvBEb2FXZYMNC/QHIcZqs/leozuKnrjDvX4cnGDv1U7mFfjp24KzTCD/tw8hrlN6a4ak8yh3za42G6lVnHx1XWsC+s/cSLOPcwloCaLZgdlzQdVBdMCjfFrljVJZtMsk8VQjYZwKJoxCyKGmzFdQPCaxhIkt9DtmXbr2fXdR5otUcuWD39xcl2cZYq90247u37CLS2mCpP8jBG/Lm0fnD3YXlpYFjZZy0tLTWZDaZUrMrat2Tj2wNrO9FuLv9pcMa4uai+r9TZMmNBp6TywvIXa1bS/Y/3ZW6b5vRTdtO7Hv/hwi7PZ2XQQPystISn5maNhe3xOR6Sk2FNmt3mNOWwen5NTE3BVuHQ5tKtj9cSm2e2RgMdX4XD4DUqj1RguL454jPmMo3090hfJoIJg3iD0UPsfsYsPT6MOG9hcaWNNmA3OeWBHV9eOB+Yk78mE6Bk9+xaMGbNgX0/ynkyIeQO9ycRA19SzYxZc29NzLXovX0fh5e+YNaG5w4D989PXtHfufvbPUurAAWno4+f3dXftfe5jwKG5huc+koYOHZBSHz63pwujZvrgYcB99OyezrT/QtrmkYuRAiHPccoGCjksGyhQmIXSP2NpSEKpn7E1oNBFPAuKzQkyIEDWBDT/idT2jD5lICyEnXBB/duHW1THoTHjA9hUBwnOhSYLDMBFIVODVkmji88F3ApCnYprHA5NKq5WQnxv52mBtyuAoEzdJL19lvx56hrpHJh/VvwbuUL6A/gMzBPryHIYfgKA+dI5kU4YNUnBaKQFjVGjJgUVz6tEQU0Gs0y3BvLvqTXUYXQVsKUA64FG7i3uE6KGmEUsglrgNajMmAtiAYH4IEDld8njPuwCGXFh0CL9AnFPDxSERZA5+LCvhV5n1NqBDegMsiUWmfVi2ihSNGxI+dB6EIhAGMEjz3mxNMfq9IUwR5p7i8ktyGOsOmXd2IZ8fevUxbVKbZ5BLXnEEnco5CbfAb9TG/J5paVc/1+dmoamWJ7OyuTxuXSyPuDQuXOu3pFXYnIElI+SVLjIZCtgaZJ5PIc0SQ9rjaTPu+OU+K5RC/qnX10MtPl5efmvSQteA+A18CPqUmDhkvl+jVGl1VAT7jt+tFahVIPfhdzUVHcIflShtMRsH0n/ZDSafKOmZN6iBX9wBPSar782FsAPF0i/oPOYO7xujd1nsFQbVHoFqNWQfdJDuT7j32889GXy/LG/GX250kMrhvaNaT/Y0XFwXM2KmgJ7QYFDXbNctiViGpVt4juJA8QNoyzjP2AK56AUcyMrDjaig8xwTY/f0YZxhITDmdQ2UDKC1tAooOYhRwGhfsmBib37l9RjJ4Ku/vol+3tnnIx6N3XL4YkHltRP7amY2h4t2GvomrOqDsXtB29m0Hz6mvxN1g2+slArig9rCBCBZ4A9iCP0TXa75lyF7OhL6lEJOq+7ao4renIGuu/v6t7kiclh9G7WvVFz2+S54WqYUf3iAxNnnKQvjf5aihhVIKkbjYcRpWPYaopGNZIh10HdZxMcywFiZgYjuoeVZiNAxM5lVGaW8/EZRhkLy1gSaGU4CYcGmlVkdKyezTQ/Mq2xn9rCXsNFvr3MVu0z5Cqlf7tKvHGd9BPG4Ku2lXcUvGTwhm30x9ZKj5n6AoXFJeKnxdJplOx52uytsNiiOrAIAKO/uhDloQVKvpgTUFTp3yWVKButu0B6Ve91PqrhUYwwRFR/QunFn2hd5VZxMQqjdkBpQAJYypwak/5pAIAt7DMYvNU2rwOEc3IRPghA/Hge0mYZtiliSwPtpoAMoSLhRiqGZq1xDaGE9Y7yyaGZMbNuWVbXs/fJ1z9cc5f0rr5Ikw9AgU7HKhQNy49dMf2Je29Y1jBb3FTV3+Du3nxLd9XkhiJ3fd+shQpCNWn73bPXffDy/VvbxLnUrc1728onBUBOaUUg19HknH54fjR25bV3PTpj6aPiXntNX6jnyOqx9tq+UHj+9O6YA/G3ONHK/Y17nsghyolaooHolvmbOwILx3A+BPY4Hwtv02MjEo4ZkbkEng16D56WcEcQUAAe3gOMvAGzNNTvjKBzV1iwjX5x01u8x9D1rlDf1LFzViw2a2cHM/ELqzVkfG77ffnJt8a35pvy4YjbITYh4zNYdlP3tfPHXL25ZW8rTVgqoCKsKwqu+aLQUqVP7PiJ+g2UQcfO2bF3H4+f40uMHe/sGtP8aEcdSAIS/OLchb0vg/0a4CSN8dXTtgi5dKaeH6XrieYhmv+jeiL0DxmKXMeYg6Q4ZiccERYLqt2Cpjdg7TrfFuobO3bMikZn7YC1+9xqrTKe2XZvfrKZ92pv0Xp58V1cN91e/5tld3xwF3XJEizSSbCNVn5eaKk0vLD9PvXr0dk7Otp3zIq9c7rpLO83tr+9c0zzhd47e8mJd04ESVyzHymOcw/kkBJ2saCgmJrGCty9aRs9oQQ8wytJHlDLpWPoe+TnYgHdQ69M/p1hysSHxc3UJ2A1+Fp8CuqvUCdgEwoknVVQLsu+YrxLi8jSxWB7hotKoCllUhDQBYpIghHQ/DKyPKArCTkVuuLXWM7HibFQXj5HFBA6qEeiGdg2Ymq6rSHM5DGmJHFDIq+BDMeFAg9PC0SyfiGDXoumbBFfCRszUfVuOJLIi5pAR1RTrNH5dOG2AC+247atqV1bO3VTl8vSum5aw9Z65iPJthmckdoyBxnmTVeJX38Z6Iw5f+0PdEadzmhn4FfwRJvLZk8IQx1EAmR5xzTywXMX9r0MttK5PVtu7hx/eFWrmpGmSjZysO+qvs29m428SImnyMFeR6wz8CXKBGX2K3SCenQHbIinFQCGFEQeRjnIgZTx8HiuAkQNNsChkVMBABwmLAYAHoDsxjHq/g+lGvE28K7kp59FZ/IWmi2lSY6akOplc1IX8jUq2PnUA3Shw6Skev+U/C1V1d+U+pA+A16/uF5BACjRPyEZqjc1gyUXk5q8XBW5mLqTtjqsFEfK83IJqAPEoQ5ggzjMQ5TguTnkq6XH1qH0aUTpj4axJxjvMpNZZqJPEd6Q9PCYkm90aKSlGocxH8KBZUhEpRJQVCUoKK6ohAQ/FXKnAu6QdB4eb8N4KhVMwcI7ASMvSEwX8TwPQBNHMDklpATsYyHb7RhIn4TWw8AmhA0IFSnA8cgDDVulaAKlRCZzKp5ISEQiwcLPpghJiJMfACIOTnxjntgKR/93+x+lRdCI0Q7JMwN2IhoxMn/TLg1eNfjsvFP6I2/zG4w+G1+gBs3O77dhD/XzEAeVO4GLzDP4bTxKKr6sL1FLCSesbSI9Lothv9RBapoqS1mjnYHiAtAcHCjeYtmoFGuEAJRBwsUI4SbS3fkQhkEImfKNFMKPMEQlCoLBQN7YG/Zuml698BkpdadwlyQ+s7B6+qa9h9vyAsHyiqa9wtorQpNuPn+NUDl3oNfV9fD8jpsPbCm1jPV7BheuiF5z/uZJ6tzQriO3dSoIXaE9J3Lg7sfOPD9wQnpsASeJgOIWPCadGHj+zGN3H4jk2At1ifJtR+6+/4G+Pb890sdRj1K2YKN77uMdqatsddPrW7bW+dqqnXTqv7i+G3671x1z1vZFLIAY1Vd1391X2hBWsofZB/YXJLELkh18b4+ZDH41eEhdgFodtfmJjc5yg9/O8+r/Vpf8QMc9z6Okfj3qtQKcFPUkzOW/1fyoslf9EJ1la43fT2KvDRPJFkRhvM1n/P5yJo+hOJlUKA2UgZdSRC53gfuKCEI5P5tYQVwt27vAsC6D/SYwOwIynzbKKowSamQ6eEYiEDYzVNm0PjlaFA0XGGzC7c+lJ0sNyB3M61Oi2/RdNco5HSP9KMpd4HlxjGFMkSscKNZqi3xVRUWNevEKZ0EBeb++we0K+dwabXEg7CoaYwC3gvKi5AIG1AOvQpsrvcTm5LDSW0ztLUU8D5ppWnqhqOiWbjY3lxWnMRRJ/gQFyeOGAul30ksMA8pQAvLXFCm9xSpzWek8fFbK5uSyoJShJEulLnW3xWb2Icdyj9FuoQb9EXOljhqw2o0e5ODtM9ssUoF0NACeZznI5BbmFLBQEVVIN3FDl57yxyxVOrCHUSoYsDcQiQSemsNxqVMcyzBU6pRCAbaptGChJHAcTHxMoaBWkhwJVnAK6Rh8wiHfQ7CMlecr8PwVg3zBCTS9DckpBX+MIDspUMM0FiaWET/LWHHob7Hi0N+w4mSozodHDY1GTUYfgj2NISqN8LidQtqQIwNk03ZQGbDSGZHt8wzPc9JpC5DsKPaEx1vSvVg4OrH7huZAf2DPv95+ZHsbx33rU4mbdsf61jy9XavMq1t205OvrQnNrnKNaWj2fcdzcb8nWm/6n+aVveXe1oEla2vrdmxc5OYNGkeJ0V3u9dVNbS7qairROksM0vtNCzt9vcKP+9wz583uDupcpQZbSbGvpm+MsyXioqY339A98aiwuLvE6+G4tu2PvP2vPbBk3/pUVLeuv2Oar7lhjKtqdmjNa0/etKwuT6m16/O+6zm90VFayDOV6vDE5eNaFvfVFvN8SWvYXOsw+QrVjopohUPrHeM3+2watqsg1LVw7KxreotV1tK6rnKzx5xn9pR5zCpHtdzf2IeIIPREERy7eJ4Be8zoedkMbwMuzPQpN+NCPtNQWpNzypvD/pIKB/UBQuAXZI+ZD0zFdsQS7MUmxplyOipK/OHmcsnJwdy1hUWF2CktCSkNpREEJW9Uq428UsDvUt/gbxTRK3tgDFMVsoWDbCthA6j2DRPYsJkQ8QnWBtmJnULOTNRj0x7cOykybV1DQaDUl6fjnVUNNk9rU4OTplRKW+eE8Y4pJ7aPL+0YnDXYUeqqbrIHJ4xr89A0o+Rc4/v65MUyF68rnnJg0fi1U1vsCr3Jkq8L2twVtjylxqohVe8r6fyCHDow/brZ45b0NYTKQ3W+4kpbrqrQZyE59jMFrTGr2axxFSGmwJE1an4amXWy50plfyx5xhqkwxk0K9/JtkIqE5Q9uPDrYQfgQ1ISufwi96rRayE+3orck9I+wSkC3WTm+lA47en5C68F6ekoA9R3Fi9NpPPETsXsQRR320ej1z2g+HIRUl+hcGbaEYUz7qdU3OJF+j/KAdGDN+3XLWA7nvkbXpYtxDiiKwtD4hnGjEUMnShjmNK60dwBhCZuLRWWcaSb1+Lj8mlI7kGEL4cegIhxCgqBB0PuKZuf+s3LP11NUqS1pvDZn7/1NNUgJkiI+hIJMcEQKDxycELIffEBnLQ0baUqdYdS2g9BFxh7juLo2IqY9Kz0tNSL5i8hmoSAFSTSZ/gkSXz7czy3mmmDjFdY0/fWXYum1Snkyjaqkq5hzP3tFX7ty1uPffLjY0zyklwYfMCClWLsfR4tL/nWSp6XZpB3Sf3gIfFKaWK6Gtln4RIBETlMd4nA5lls55Tr5IQ1isKxPZjtTQlH7XCNGikj7wpSAMMXPhxBVC876fMszQ3XCAoRNF5UZCmI0MK2j18+iSjw5Msfb1v5xvMnm6THcaHHN518/o2HyefzNpz5l/i4b+yMqPTFnUurZnaVg13znz11/eK4IvXSMWloHliEq3xb7Jqjd4k/r6rTO/2aGZwg5yjnXj3v8IDcBgOH51VfI7Ye+PrMBnFvXX+1SZz7d1tsUuqFqsGddz45j6rPu2alXP+G2S1F1DlftdGm4X4C2yBvuB20RDVRQ9TDnm0l2onxRD+xiFhFrM1osiMWHObbOx02hA3wxrAdDHe43jMSNMYiQI+kc2S0i67WhVY+uF0MD8gTGm9jaaDeq9H4GkvL6j0FzJwa/1DCXyOTCFla7aXHe6uXAmWeNEIhtFiPyRUer64VhQeZXEZq7LlqUmmgd33XxC2TS8smbTxLu8TZiIYYQlJQoq+9xuWu7fB4O2vdxXWd7tQH/poaP3Cmacrrra72esUrG1gd+QT6iiTI5zvuoIjs+4eEsZ9QRIIkX0p+Fpm5o6t9y0A4PFMY37FlWkiaDO6Z6A59TS6V0v6hI+NoxGf7+8eR1p0L0L/2sqH0bcNn0tYDew/2rtl0Ve+New8wEnLWTmHdkhKSxHcMnZek5eQJaR3ULXeAw+Kc7+IO6TmNOCz/g3jdxGRiMbGa2EUcuHzNHYVs/vKsmVfLZ+bbqG8OK292ChRBDynoMit1OOLSh/kw8hrVsaUA2U8bSQ+8k20p7AcVfQ1ud0NfRXASuk4Kom6ExwW0zMI70WWes+uOyVc+dO30fInHFPR7W0XfisbGFX0V6FrgLKBO+GtScXcTMjg3ud2NFVZrRaP4j4T4QeIEtVqKh9x/yW+bt6MDWZhBQkpYWoqRvwETz/4qKgWI4y/DQ3JKxWgBhkbbt2d29dir7pkjt3dDa+a76EpTM2rIefBj7uyPi3tOnJCI1ZChn3eH2jZOqaxfsv8t8Jz4lMVsrx6XteYxSLQRG2Hrn8qMUF9mfjoay+JdmckAZIPCyxoQtUElGq85I9Njkc7MIUSG4Qs93C2GYcCDhykre2hnj2F5wlxBIKHa3Kzsuer2qch1BCoevZjcgnnzb//FSuR/QZJLnzvYl0z037JxYh641x3SaMbOXNusaN98UvxHcPq40vKxE8aWm1zFeeEJAVOJv9RSNqO7Aj/UO92q+pmVC0k3Ws3iHTurBo7m91jYz+TVGev/xP1LGgCo6G0qy22lBCTf+Sk3Lm9APiywp+VOWHHm+gnIDQQ+6L3+DHVT3aKDk2BOA1R83cyxmlIfKnkyrC3riEY7Kh1QF+IhuLVYbuVyOEpX1lEdHlvpsjmNWkMe5Xed8IvnEKXVLu6vyzvlDjmdqN+BkJkNaViyf2KuIdfY3DcrbCHS9sIaLsG9QuRDyVNM+IkyohLbZjNcQO/hPXogYy6s6ENS9+BJycxiTN7FyMpqpos4AUEWMZ4UaEG8o3awrcqpSlsEa9dSd2bkKKRebEICwtAmrUdXPS6g4QPjolqPliO8liGYySu/Yi789pXkquKG/lnzK2UrYOoLJpeXEkgZI+OpOAMzqCPJ8vZpZaWzJ4YBQH40I3UyEeWwPlm2NVgbnnGzJOclfYiLufhvlh1WysdnV0D61V22Goe7vfiu9++hnxDjgfUt9UsmlJdPWFLfsj5AJqRHPmdhcVMQrElXofJKNbsOSH8/cD1Q7xWVVLt0PlyDIqNENWHpPPjgRul3srznkI2pBHLdBqKPmCt7Nrhd38KYYmhOEyrteh0aL0pgDCPhpgRadwbPDY+JjOznXSqG08NxgGx/Uj/bu+v+WZPv2DFNLXXhMfAoawb7zW43OrPgUch4ndJp50XIhINi0aV7A1P9JZMCDyTJcKcwJxaauqEV5vIRH5+2nLpDonLDrZ3xKkXvkfW9BcyDqb+7Q7NPbm6rW3iwX6ZpNY/zNUsbzG5eHQInYNYh9zMgmLqBPLH1y21bv9qKOHtsjtDZumVOPSPd4g7VzBrrBQkykRtp7WosoxRU46J9E+S58bQPpQNi3GxMhD0ptW59WIscZajh8R/OmtqxgTCV2P2v8z/d3ta2/afn/7V7JPz1LwRBobL5xjd4qqdvGjt20/TqG2yhVq+3NWTz1rbUem9QEJel2SOHhwQBlHhabL72CTPGoJQoB5QQZVASH1PfMdgQJzCeycyb5kBqdEFaHAPRzFRiHrEUSqtNxA7k049W++Ilv8i3//K1KHTMbWe0yGbgcyPjjQcyuDCiCtj7eO1lOMho0QoVLoznqysAJAk7MHogcYSjFAzBezhEcXw80U4Pkh4RimGaQN76QmbRWuaqd5r5PI78C8nla0yOIwBQQxQlbVcovqKorxQKktDaTZo8BfknUqHSGO2fUQB8iRZkRkqv7tUbOalnwq7AK/nnA8IEvZ4Fz/ZsD/yS0SPXPvG9Qbx22SO+l/09dE0Ktoq62qoCVai2rsIOBGfc2dTc3BSPo1A83tTsjIMP7JUwiiq/qnZMpV0SmpvgK/lf6F7trF5V8zvn6q5V4pHO1c7wqtg7zlUd4Q1If6cEAg5k7jvXgV/W5qPwAz16HfgPXcFlq8ApYvQT8rInBPYBzNjckV6DEBkBwrAfkY8GmgvAzg7etE+cA2DrA+QMCOQyLg8PKOBiuJ0A6DVJpcWu9xXyn7IFCpPDYVIUsJ/yhT693UJf0GqHXgQ85RvaB84dpKtTv5f+SRN6b27qHb6g0GMAL93N0MVG6npjMc3cDX5h8FgL+NTv8rzk25L6OVHcCxpELfnQc4Tsm0WwAiMQSkKDyoq9VdCyEKhx4SXTLCEMyT7uaJXdQwPkJGmQxEtNhKQAdUYBnBIfHiD7BTRI0ngUrf2xQq2uk5hEzCAWyB4xsXDEPbpnqNH47DuxqxYDDVQweW4LLSTg01MtTByKoriQSMzJcPbM1VVXZjaX1bnSV7D0coxbilArwrO9kggMUs+dzGMpASuHcZQnSGTnh64gkZUjvoL4tyFhCeVyE5lInd53aJ84B5DiBChtbkI6YzZ2z8FU0gy1/35ZzskqHxjdDGNAWitC7qCoKSC6RSznG2okVprCeK5Jj/AtDz5Pq3rs6pA7Casv3oTKCetN3ewOfZouKfbfSV3KVh+lXSR8k0gl0CrMkHsZnVHyxD9IgdFVTc9j6UPgSykONo1ojOAFmBQkkGNzKa44withKNvPQW7aRHQTVxILoU64MSM79bDEGLdXy0ZYvPEKRJF4ixW8bwEt24HgOECuD6ieYb0bH4gcZGs7CAM5oNW7IhnTEmKw6J5LZJABmbB4k9d7alpqPE4Lo6ArWt22Bqc+oCuJlxqKI42R4qCzqs9mLAkECxdtoKMiNpSQCTHOllaWMLkKFkwTpLdZndGo4PKZFyFjNNkDZYW2QKBbEtgEQkDnQA6zF+Sc86a2jemt8XkCDqclh7Tan8jPpWlFaWO3v6Yn5vcEbJ7C2uJn1bp8dpPURxJCHP7IE+QH4m8Yb4lLzUo3ASdnsehYRnw/Hif/HLDDr9hspalZ8fg3caAjPR/ZTAxCfRu1K4fGFD5BihiGhIiSYKsAnkOzgUa0T0rGmOSOYCYg/3gfFAl6NXDrfVzEXQEivlikCYRjxrCRG6V5QzwE/7yWOGzhBG5hCKrgf/LFG6Q/H10HwvRtcfgniAmQ9oIn4wu93pAtb+5MlS1UXByy1YVCdbbrtMWWggJLsVZXbC0osBazMKZGpdJkzhZvBlrCQPILUlKIEviSERtZkhX/Ln2Gc09kzhBkwtZMUIlXYOa1ttAnU6Z8ErLVog+hT37MW4u1WrdFrba4tdpiKw/HZqYt3en1ilPwmv7slkRjdFRTQi2G53QFxm9rzRjEcphuGwDny2pbxhgbFlxy6/FWF1+U3X5FvMvKJ188AkY1IdSl46g5ElmNKRGCYA+U5ueXBuyo0QrgX+ZsMOfTI81G55uTX8OG23WJ2PU9TSet6xEsv1RpNKqHenqksNyOJ8PhmVqTmmXVJi2R9omVeVkAz7QaNMMAj8/ogq4QbYzJo5CjquXFxfJMWTjkAMBbDHmdHm9mwqdNxNzUyVOzrVOFpaHSQr0nVEg9fR+o2r6+ECrGhX1jW8QuGCqUXiqEmnLhBXLLMunSoVSHglxX7IvNP/DgS0uXvvTggfkxVrVO+r/D2WY08BtnuDwQrHYVhjz6Das24AzETRt+PwdmWQjq8QdghrPmKJh1xbPCUkTOCecq1xvJ+oVcIaGHow55YirlmTwE9pUA18xA8TG84Y2L5xYqUrvFo8rcG3PU6lxwjHwql8/LvUv1F+GiwFTNTz7Gbs/LSe4mjyvVBbn7cnKlHmq7SrE1b2gdFbon+QCLfEEhvkgQt3Bx2NZ5REFa09O7MiJVtuXAxueCTATPY8tO1EifcGdGqg24eRqqbmiFA7I8QN4vkETLhuPP/Gbhol8/c3xDS/feHduaO49dMe1YV3zbjj3SfiGzhBxK/UQivTxCNCGpS30ste3+29nH79rf2Lj/rsfP/m03OJNTGC4JlpYFS0KFOcn3yHgiswo9ISYwrxKIpyFGihNqqLOiOkyDtXoFtWDa/1tuQ4Mv6x5XZHQEaiSIt8hhgbwMNbNyPe0ro5OJTXYdBfJa8NH3Xp/sbzfsdTcyMy5f1CAzXwcFTMYdDS1vM4CYnAV1p+lFk9tdKZ/PmQ6biuDNoVxngbsSTDefxu8eM7uKQsth4FozfKvK3WuiTgQnLKoRT0vv2P0ltTbwX13PLV723P4+6fNKd5FJOsfl5RYoQK+5Ct09Au/U8M5U6bY4+Ry9u9KK8KeFUTIUjdzF9FCDLKqwmis1O+uXTgz2H3xuydzTHdI8KKR8EZstogNKstkkPrNKUenWUEQRLGyF2w3PlW1u0yEcPpybXymddcECo7vT5iqpsRIG9ppD7gJ77rUmete0PWsW1ZF90v8U1paU2MADnT2TDj0v1sFagWpOlZejkB5BtTOBXk6di+5Q1Y0afaG1wq11eOFZB0CuPhd5pqny0K1WIzQsWbdvBrKxtDVLC3URm73aZzTogEJ8ziT+fJVG464k0Er4vWB3xTn2c4ww0eyBzKGnQ/17I3Ed8SPip8RzsHtKQDmoAjHQA/rAIfAceBv8DnwCvgYXgUgCEq1wlJeMu2KZxeMIVcpLyqEuh9ZXuyMevJWFfIOYNtrmQuuCaF5euxKDmhnS3uED+O9rpGIwF5B+qMWPQAxmE0bGRcgBgmB4uUAwPR/GfQP/ejmkE7h9kBjdsEThENIJY9XeCCRVBHJCUY+dMiKtkEO6oYvz2Bl06wsyyEcFfhXt2RNDqqIrhvbwgQFYHLStD37HoE3oIOnCJJCsKTcqYySmdcdcHBNzc0Y3F4Z1gLUDsLQsCT8AmyfmwpnCyssH5VIxNmCnxgCZv8RQkShUEXcRVnJ8sMBoHjOmRY3hACzN4c9yRTQuItRjobIPM02XDiC1F3gol9ZNwS/C4hi1RiqsDeMDqkPhGIgWp8vNojyQro07jYfwzsWXkLIlCy2Ir7hveupoD63zSvcPSF+Pl34Cpo0HuQPgitQbA+Qj0yUKiBJFThVnTqemTBdnkieTF8VryO3jpYnlg9F5L80rilibmldXj1eZ8zZ+ulFXrPMW1UcqDF9S+pSzfFp5T9nEwM5AizPs7/Ye+Lh88zjysFfc3X+t1JtnNZfGIFv06MfH3aEphqDHaPKW65F/Y6eDYRhzngViRIs5HDagtey5rMWSqxOvNwZKyy3+ad6zFumOnCItuMUr/chq0ZnCUzvKJvm1wZZQsaOQL1++/WCPKWCcs3/51ID0Ey9YkOdRSfeb381RF+jUVbMqNRUmm8fuNIHGghJdYdDvF6O3OltsCqYgN9dWWxg/O371H1ZNPz3dQv7TIv3c+4L3ttPenzWZT4fDC1J/TF0YIFfPPDEBvBO++HyY2tIj9tUuW7KsRpoRZvYkbwT3TJc2JuvEJ31U0W3i+7TWXGhU84GyMu3aaGtFkY6kyIKyyiq9prQyWmgoLSszuMcHqpctnu0DVA44TRaLAVPUFN4nXbh2yetLTaWGO6Vf/UjB5fYf676kzGGApryyQte+fUz57PCs5+bfW7M8pZNeXSvOXPfCAXpOeOjMC1+Gvxj4YsEL479c+O70LxeCptQf4mebqKL/BtueVxv5fOUJ6aUTOeavD8CCivQ0cBI8Kj0BukUadMPro+i8UHqC9h048O7C8fAvPh3+iU+agUn6mzm+Vnw9Dq6Q7gem26iO6dI1fXePz+UUgYGgt/v45LihzMjxKjIH9LgnT59RNg0siK6INkVWRFNHnb0lC+3NTrBjumSLNkzPradPm6ps9lip2VIWtcXHazmNI2DUl3tMiD/X1u6nleGwgomfCusMipBSoWSYsHazyqgpYCNzorflj1lTe29+dGB8S13YXNzjVxdFKkLxKfXj1s7scnh6vKrWhXsm3ps/ZtWY2/IdkXDYroJq8YZKjsvValVaprC+ofGEOFaRq1U7eFO1pSBH+i3I5YuNp/Ip/W333nbvvTsPSL899YJCQ27beUr66UOnzx6YeM/Jk72nxaWnQfdp8cGc1oFFg215NOoSnb8hQHM0b9Zqcj31kbCVU3IAQkbItUGuI5chyZOgCtJj3pI3l2iMuSX9gYDBN95bsjyK6YJ3OBx84+4uqy93yn0TKwelJ/OlGeBR8ZOfkedP54MF+XBYor6Bx6lLX4r/0nVWqL1GbYXR2+2vmEodPpvaE49TW89K70l/AyZxE+opdGD7CgcI7iOIf2yEB2KHOnkFjAqkVxTFlPLGE+llMB7gkteLuJRAAbBzFaiugPwNe0995BEf1Nc7kyfRMkgPuCQBD1oMSc901uvJKZ6hO0h1Kl+ZxxSA31OPS19I74tPSe8xeezrzO9Td4PzSo6cytDxmoA4xWRFayNrAmQH2RGoQUsurSZxSqCEnJ2vZLmhk3QpiEqPiHOlRzlWmU8mOC6VinLkg1zaZgSQzYjA+kYt3uHm29aNNiKeayeNHjzvEqTcYHjlKKj2QmUfzZCxGXjmHxKG17G2sKGeK2NC7MqeECtdWVgdsLHgWdYWqC4Ec5IJZCun4yC9vJUlUBJxeBEshUPRWW0+X9usqKAtqigsrCjSXiKgkkJYvMjJIQWTyr4taT8bvOcrJJm0hyla85TEa57lVdBoNXRSQKtGkcd12j4s2/bQThGbiP3EceIx+OiH9ne8bC/O/3B/yP8w/nDTpq+U/4ceXHz3P04y9IMxLnugILJuvvU6gva/+8kPXcUf/Mroq6wjYdreBHs6jrzrIXam1HhKH+lE2Ewj718pg6DMFql4TS2U9zAe/RfSukm6zRLwlxa+Sw5dJBjdruQ/rC3t7Y6yMbzFYeEN3ogjumiwy7KieO76vV118ztLNDaPtn5NlCWYWaQZpS4PBEwLwJvJMiYuSC+qnFZNKGitqqioijqc1R5d9cRZgbFj1s+q83dcOaa8tX5MMV9rF49Qb6X9BT1Yv80ndHh9Hw/0I/vwyJsAuNAksssYQS4iEl7NJwxBxYohLhHSKXEQbWlKDp6iCOk9QDwJB8F7aN8zgJ4SKUE6BQax5/apU2kfMU96zytV2kds5DscgYbSJViqTN4c2q3nlJwnmhVAuY32A+74Hl9abEHMzL+wHHDLW0SGQXqhKulD3nHIwZb5SHaU/UhKHjyIvKTkO8CQT/J2v0Hcpm2qL0UhvV8tPQxUGjUPwCRHsKKhvL5RQ+5GTsLY7/ayDA6mM08RyBlcW13fWmTwFyIP4YdUXp0xwEsPOZoqHC2N1Rre7kN9Mki8BduoDPvge5HVQS/LgSJ5u9NYWgtP755ojPnQDqBG7q9mc3JXnoN3m8Xd+XlmUGF1uc2Ap7T5jgLekT8U+fKrr0AP3fJV8gWO+Qi9TO6C8chtOA2oNJulf1J4ZV/q6JdffpV6lW75MvkzLuMDlNkbUN6tyZbZrynTh2gdAIUMP3ilBh+mCQrtASWI2AefxVfMNDGfFNDWTim8KBS9prCLP4zDEvJrIGStPaWw9CCAvP1e9pZ97uyt+tA+2WhfUBhmnkhepDmxmyFqrry6a+hs19VX1nALzw6FTYGYExBQnJnpcOp2XkN+DsMmJnxOFKSFKBaKz1pSFso89JgzFjCZoMw7d84/wQ1Tyu3gxmVCLdAA9ftuyMvlaYWMigXxO8B6VXplLCwSS+D9E3HvNcnWExBNb3ELYj4O+GAMqDBECTzEACGgtiKgJIGjTED7ZXEEr3pNWvy6s7TULi1QFzgedZQGHCfIuL1UV6J6RMUnNxy+4TB95IaXpU2vFLcXvwKuZ1A6Jr2DIPbrwqtuxbE6H8xq/qt2O7hd5dOXwqxgRk32AtWjKp/4/OEbbgAnbnhF2vBycUfxy2B/1loLeR6Fz0yk4FU5aCIFMgTcjQLqRkEsHyDfEN9D+4OIMq9AnU96xOAA+SYmowwtqdMrfouwj09VBhsAuXcBUnrQjhhpAlOCbK8etH8E4LAzqkQMpbd7K5UEswZMkW2GzD4gDL3KCEOCfJg1QyclSFBoTmsI8hV0RRu8XJgCYz+oMUNF+gFpKkmgcyqA7YRZT+B5isaMNixBK3emcxe4+yBCW0ocIV7AOC292DftKo+2KIYDNbP3wbC7vJ02GkBI3gcqGsts9UGPbF5sMNqZ7DljljPi6VM8QYCtMj6oJKJ9Q8hivCMUJe8qwsku2jB1OITWfVwImydeua5BX2rRtna26tSNPVP9i86+8NDBJbaScPmd8zVenb4MvusY9S75qcqi2vrO8RklJZHDs7i8HLWGzyMZf6whXAxYavKBhbVajXnGtpvvffRkNNC6Ynxg/O5HFxQ4C5oY+bZnz+kFBXZ1E0lRXVqN574/SkN7UJbvHp8RyM6S9Ucbqt0kQ00+uLCGeu/4sc4jezdV8AU6q1VRHjLSpZM23vzYwqM3n7jpmj/N4ovVBbzOWshlvUktBIBZcO/7W/vuGDdjczmVpyB9dS315Syp1hu1+dTYu58+u7Jlb3za7cLCcR5we2WHzjG47tru+ad395DkPwy8/GBf94LTu8eT5P/maMD61j3x3edvnYQyvk/OeFOQyocZ1+KMC3Qo4/YTT/waUvD/A9h7lUgAAAAAAQAAAASo9jZtQxxfDzz1AAsIAAAAAAC//cGAAAAAAN4wSsz//AAAL80IAQAAAAkAAgAAAAAAAHicY2BkYOBgAAEDhv9/GBj0zzIwMqCCVABIDAOXAAAAeJxj1WJYxsHAwADEbFAahBugmAEJA+UZl3IwMDGjqcPGvozKZ0SWFwbyg4EY3XwYloTiBqg+EFaAqIfxwWwHKN8Bhzkg8zuBarSgaoCYiQGiD8z3AOIDSO46gND7/w8OM/FhBzS3AM1lbkDzB7I6GG6AucOAgaENSLMzNDCAAIRkYIiG0iA+BwANzBmXAAAAAAAAFgBIATgBWgIAAiICdgKcA0IDWgN0A4oDoAR2BRAFbAXYBj4G1AckB4wHogf8CIIIpAjKCOwJWgl8CZwJ3goACqwK3gtiC7gLzgvmDBAMYAyoDNANEg16DfYOaA8GD2wQBBBEEHYQqBEEEcgSjhMWE3QT6BRUFHIUnBUeFW4VwhXoFj4WvhccF2oYPhhOGUYZjBn6GowbDht4G/wcsh0SHdQetB8eH3AgBCBkISYhfCHUIfoikCMMI7gkXiT2JXIlrCYOJywqLCqWKvorFCwELGYsnizCLTAtei20Lf4ueC6gLwAwBHicY2BkYGAoZmJjkGcAAUYwyQXCjJEgJgASewELAAAAeJy1VD+LHDcUf3u79l1wfARDwKWKEM7HMmtfzJnY1WHHla85mwM3Ae2MdkZ4diQkjYcxLlK6yMdIY8inCAmkTJ1PkDpVyrz3pNnb827MJZAdRvPT0/v7e08LALdHX8II4u8rfCMewS3cRbwDu/BNwmOUP0t4gvjbhK/Bp2ATvg6fwduEd+Fr+D7hPfgcfkn4BhzC7wnfHP08miS8D4c7v2KU0eQT3BU7fyY8gi/G5wnvwP74TcJjlL9LeIL4x4Svwe3xbwlfBzH+I+FdcJO9hPfgcDL4uQEvJj8kfHP8bvJXwvvwYu+7n96Lo7v3HohTnTvjzSKIx8ZZ42TQpsnESV2LM11WwYsz5ZV7rYrsqZw7nYvTJ8+OxIn3KvgzVba1dJsHm5Jz5Tx6Fvez4+N4Sofx7LkqjRLaCymCk4VaSvdKmIUIlVrLr3SmtSTOzdLKRiufbU2+CsE+nM26rsuWw3mGNrPQW1M6aat+tjBN8LMLc99aW2tVCDrIxEvTiqXsResVJoGJkVgEI3KnZFBTUWhva9lPhWwKYZ3G0xxVFH6lF1a5pQ4B3c17LqLWuWrIFx54YdwAFhRhulmqdaZo8zAVxDzaTslmCKAb0VU6r9Yy6zCobvK6LbBNq+xNU/fiQN8RajnHXC7U0cPHsmX1QjelcMoH7BSxehGAzFe+HjEDBxqjBLWkFjiNUQvTNbWRxWX2ZKRKOSrHYChc22DbIApFZZJOpWp7mVEcxqZP6tQQdIj8VHquMefs6t2G9yDgCO7CPXiA6BQ05ODAgMd3AQFljxE5vPO0SpRoRA1keHICNT4CzlBWQoVnnncKvwq1X+NaoOZTtJvjnnxTjCf4z3LE9p41yY6sSmjRn0TNq1hcReec8/ApZwH3MZtjfNZtB8t1u+ecjcFVoA5VJfENzECB0iVn+QplxBKdVKy7jb+S9y0yOGjn+F3iXmJOmtnK/gXzxHNA6UOY4dPxk6G/D+2zFGeGuGcvJfux6KFH6YK9UbWzrdE952yxI5r7KFYW1PuXXJNgJnr8tsxdZCIyNmiTzHDVDjWoDgVT3BesZ7njPUuID4pjuTPRNk9eVNpL9m25r1Rz4DOymnMeQydqroishryihecuuA3JYlXD9Epdtbwv0CbH/ZT5ijMf405XcT6sQPMkdsxTjut2zrpUKWnnWE3Lc1ds5Z5sakYHqH8HvzSh88TLNu8xh//K7YX3gj2VKHM8xyHdqWFWt1UwRN/M69HaDFAlsZbA8YZbQP5jrQVKOq7c8K382OzJS1OluC8mrbGqiFu+WS1bUrZDNwc/pFnzTf7nGY3/jE3qzIX34YboxDLND+U7Z6Zjb/+Hu/03hsc4mgB4nGNgZgCD/34M5QyYoBgAKZ0CO3ic28CgzbCJkZNJm3ETF4jcztWaG2qrysChvZ07NdhBTwbE4onwsNCQBLF4nc215YVBLD4dFRkRHhCLX05CmI8DxBLg4+FkZwGxBMEAxBLaMKEgwADIYtjOCDeaCW40M9xoFrjRrHCj2eQkoUazw43mgBvNCTd6kzAju/YGBgXX2kwJFwDEASgaAAAA"},37875:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,".EsS594twlMdbEJOPJo6UDg\\=\\={position:absolute;z-index:1000000;background-color:#fff;width:320px;min-width:320px;max-width:320px;box-sizing:border-box;outline:none;overflow-y:auto;visibility:visible;pointer-events:auto;border:1px solid #f4f4f4;border-radius:2px;box-shadow:0 8px 16px 0 rgba(0,0,0,.1);animation-duration:.15s;animation-name:contextMenu-slideIn;animation-timing-function:cubic-bezier(0,0,0,1);transform-origin:top;display:block;min-width:180px!important;outline-width:0;outline-color:invert}.u10sUHK1gkyWPJAvhySBrw\\=\\={margin:0;padding:0;list-style:none}.o365cs-base .gL7YLFs55DBFHGm0aAlvaw\\=\\={width:100%;height:100%;padding-right:40px;overflow-y:auto;overflow-x:hidden;box-sizing:content-box;position:relative}@keyframes contextMenu-slideIn{0%{opacity:0;transform:scaleY(.93)}to{opacity:1;transform:scaleY(1)}}",""]),t.locals={contextMenu:"EsS594twlMdbEJOPJo6UDg==",defaultList:"u10sUHK1gkyWPJAvhySBrw==",innerScroll:"gL7YLFs55DBFHGm0aAlvaw=="}},79928:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,".o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\={font-size:14px;display:block;box-sizing:border-box;margin:1px;padding:6px;text-align:left;height:32px;line-height:normal;animation-name:contextMenuItem-slideIn;animation-timing-function:linear;transition:background-color 83ms linear;border-style:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;align-content:center}.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover{outline:none;transition:background-color .167s linear}.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover:focus{background-color:#e0dfdd}.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active:focus:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus:focus:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover:focus:focus{outline:1px dotted;outline:1px auto -webkit-focus-ring-color;outline-style:auto}@media (forced-colors:active),screen and (-ms-high-contrast:active){.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover{-ms-high-contrast-adjust:none;forced-color-adjust:none}}@media (forced-colors:active)and (prefers-color-scheme:dark),screen and (-ms-high-contrast:white-on-black){.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover{-ms-high-contrast-adjust:none;forced-color-adjust:none;color:#fff}.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active:hover,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus:hover,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover:hover{color:#000;background-color:#1aebff}}@media (forced-colors:active)and (prefers-color-scheme:light),screen and (-ms-high-contrast:black-on-white){.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover{-ms-high-contrast-adjust:none;forced-color-adjust:none;color:#000}.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:active:hover,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus:hover,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:hover:hover{color:#fff;background-color:#37006e}}@media(hover:none),(pointer:coarse){.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus,.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:focus-visible{border:2px solid highlight;padding:4px}}.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:nth-child(2){animation-duration:.05s}.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:nth-child(3){animation-duration:67ms}.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=:nth-child(n+4){animation-duration:83ms}.o365cs-base .qLbnXrrpb1JPt\\+x0quZ\\+QQ\\=\\=>label{font-weight:400;margin:0;padding:0;font-size:14px;line-height:normal;color:currentColor!important}.o365cs-base .qqcB4nWgri26vFLL0yHLHw\\=\\={transition:color 83ms linear;display:inline-block;vertical-align:middle;padding-right:6px;padding-bottom:2px;width:20px;height:20px}@keyframes contextMenuItem-slideIn{0%{opacity:0}to{opacity:1}}",""]),t.locals={contextMenuItem:"qLbnXrrpb1JPt+x0quZ+QQ==",imgIcon:"qqcB4nWgri26vFLL0yHLHw=="}},18587:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,".o365cs-base .rSDngy50C4hLvjN77R3dbA\\=\\={height:100%}",""]),t.locals={entrypointContainer:"rSDngy50C4hLvjN77R3dbA=="}},48643:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,".eGE08z8aIfAkGe8BvkfeSw\\=\\={position:absolute;z-index:1000000;background-color:#fff;width:320px;min-width:320px;max-width:320px;box-sizing:border-box;outline:none;overflow-y:auto;visibility:visible;pointer-events:auto}.JPdZa9r8EHVwO2nsUxqScA\\=\\={z-index:1000001;position:fixed}",""]),t.locals={popup:"eGE08z8aIfAkGe8BvkfeSw==",react15Css:"JPdZa9r8EHVwO2nsUxqScA=="}},82819:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,'.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\={display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;border:1px solid hsla(0,0%,100%,0);box-shadow:0 1px 2px 0 rgba(0,0,0,.1);box-sizing:border-box;width:276px;padding-left:0;align-items:flex-start;margin:0 0 17px 16px}html[dir=rtl] .o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\={margin-left:0;margin-right:16px}.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\=:hover{-webkit-box-shadow:0 8px 16px 0 rgba(0,0,0,.1);box-shadow:0 8px 16px 0 rgba(0,0,0,.1)}.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\=>button{min-width:30px;width:30px;height:36px;padding-left:10px;padding-right:10px;background-color:transparent;border:none;align-items:flex-start}.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\=>input::-ms-clear{display:none}.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\=>input::-webkit-search-cancel-button,.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\=>input::-webkit-search-decoration,.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\=>input::-webkit-search-results-button,.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\=>input::-webkit-search-results-decoration{-webkit-appearance:none;display:none}.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\= .j6BvNpCF90XiKxu0F7sZzw\\=\\={width:250px;height:32px;background:transparent;align-items:flex-start;border:none;display:block;font:13px SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;text-overflow:ellipsis;padding-left:5px;outline:none;margin:.1em}.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\= .j6BvNpCF90XiKxu0F7sZzw\\=\\=:-internal-autofill-selected{background-color:transparent!important}.o365cs-base .oxbF2LyKwVB\\/a5\\+4gTMkFg\\=\\=:focus{cursor:text}.o365cs-base .nHk7LESAfIWtWyD9f7IM9g\\=\\={margin:0 0 5px 16px}',""]),t.locals={SearchControl:"oxbF2LyKwVB/a5+4gTMkFg==",inputBox:"j6BvNpCF90XiKxu0F7sZzw==",SearchControlZoomMargin:"nHk7LESAfIWtWyD9f7IM9g=="}},4377:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,"html[dir=rtl] ._7PGqXIlT8jItdB8fOBmFkg\\=\\={transform:scaleX(-1);-moz-transform:scaleX(-1);-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1)}",""]),t.locals={iconFontRTL:"_7PGqXIlT8jItdB8fOBmFkg=="}},59663:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,'.o365cs-base .TlAdlUrWd0Z6\\/TteKJSQig\\=\\={position:absolute}.o365cs-base .TlAdlUrWd0Z6\\/TteKJSQig\\=\\= ._1ZqUEbZKjUMrjQWoZseg6g\\=\\={font-family:SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;font-size:10px;position:absolute;width:16px;height:16px;line-height:15px;border-radius:1em;box-sizing:border-box;text-align:center;left:0}@media(-ms-high-contrast:active),(forced-colors:active){.o365cs-base .TlAdlUrWd0Z6\\/TteKJSQig\\=\\= ._1ZqUEbZKjUMrjQWoZseg6g\\=\\={-ms-high-contrast-adjust:none;forced-color-adjust:none;background-color:Highlight!important;color:highlightText!important}}.o365cs-base .TlAdlUrWd0Z6\\/TteKJSQig\\=\\= ._56EuyMD2soE1\\/gKXBY0q9g\\=\\={top:7px;width:8px;height:8px;border:1px solid #fff;border-radius:4px}.o365cs-base .TlAdlUrWd0Z6\\/TteKJSQig\\=\\= .\\+OLPNIF6B5kKoA97J3vVpw\\=\\={border-color:#000}',""]),t.locals={unseenitems:"TlAdlUrWd0Z6/TteKJSQig==",unseenCount:"_1ZqUEbZKjUMrjQWoZseg6g==",emptyBadge:"_56EuyMD2soE1/gKXBY0q9g==",emptyBadgeDarkMode:"+OLPNIF6B5kKoA97J3vVpw=="}},73966:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,'.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar{width:8px}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-button,.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-corner,.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-track{background-color:transparent}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-button{background-repeat:no-repeat;cursor:pointer}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-button:vertical{background-position:50%;width:18px;height:18px}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-button:vertical:increment{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAUUlEQVQ4T6XLMQ6AMAwEwfz/bXRIfOeQCxckK8iKYgqvfCPJLxgNjAZGA6OB0VjCcV55M/8/jkbDMv+VJbSdccHYvsYFo4HRwGhgNDAaGPdl3LNlBnofQ4+bAAAAAElFTkSuQmCC)}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-button:vertical:increment:hover{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAUklEQVQ4T6XLsQ2AMAwF0ey/A1swAnt95MIFyQlyoniFT/4jyS8YDYwGRgOjgdFYwnFeeTP/P45GwzL/lSW0nXHB2L7GBaOB0cBoYDQwGhj3Zdx8sf7rjOGQqwAAAABJRU5ErkJggg==)}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-button:vertical:decrement{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAVUlEQVQ4T6XMMQoAIQxEUe9/NrsFrzOSIqDxgzu7xSv8ZGySfsHowOjA6MDowOjAmPozFGpfYQw5vn2CsY5TvQtHoOGq3m+PLzA6MDowOjA6ML6nNgFW+wZ6kTk6FAAAAABJRU5ErkJggg==)}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-button:vertical:decrement:hover{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAVklEQVQ4T6XMwQ3AIAwEQfrvgS5SAn0d8sMSmJXIJY95sPLRJP2C0YHRgdGB0YHRgTH1ZyjUvsIYcnz7BGMdp3oXjkDDVb3fHl9gdGB0YHRgdGB8T20CB+X+675uLU0AAAAASUVORK5CYII=)}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-thumb{border-radius:9px;border:3px solid transparent;background-color:#ccd3d6}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-thumb:vertical{min-height:50px}.o365cs-base .XNCq\\+l4QufHtwDhOGdcrEA\\=\\=::-webkit-scrollbar-thumb:hover{background-color:#9db4c4}.o365cs-base .oDjNsKgU0LouSL2Cszjoaw\\=\\={display:flex;font-family:SegoeUI-SemiBold-final,Segoe UI Semibold,SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif!important;font-weight:600;background:transparent!important;border:0;padding:0;min-width:0;height:auto;text-decoration:none!important;cursor:pointer}.o365cs-base .oDjNsKgU0LouSL2Cszjoaw\\=\\=>span{padding-bottom:2px;transition:border-bottom-color 83ms linear}.o365cs-base .oDjNsKgU0LouSL2Cszjoaw\\=\\=:hover>span{border-bottom:1px solid;padding-bottom:1px}',""]),t.locals={scrollbar:"XNCq+l4QufHtwDhOGdcrEA==",fluentLink:"oDjNsKgU0LouSL2Cszjoaw=="}},41306:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,'.NszUgtzDfx0t1PQrucmvnA\\=\\={display:block}.c6QE6q0imyqZPiHyLPm9YA\\=\\={font-family:SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif}.uGAx4CbRh\\+jEaMdf4Etv7w\\=\\={font-family:SegoeUI-SemiBold-final,Segoe UI Semibold,SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;font-weight:600}.vmO5rYvtVrmsybm3QJFJUw\\=\\={font-family:SegoeUI-Light-final,Segoe UI Light,SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif}.Q8qHkqThZ3HCwPmk\\+m2bFQ\\=\\={font-family:SegoeUI-SemiLight-final,Segoe UI Semilight,SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif}.iDm2WTqpMgwzbBSSRlbuog\\=\\={font-family:Arial,SegoeUI-Regular-final,Segoe UI,Segoe,Tahoma,Helvetica,sans-serif}',""]),t.locals={displayBlock:"NszUgtzDfx0t1PQrucmvnA==",segoeRegular:"c6QE6q0imyqZPiHyLPm9YA==",segoeSemibold:"uGAx4CbRh+jEaMdf4Etv7w==",segoeLight:"vmO5rYvtVrmsybm3QJFJUw==",segoeSemiLight:"Q8qHkqThZ3HCwPmk+m2bFQ==",arialRegular:"iDm2WTqpMgwzbBSSRlbuog=="}},35843:function(e,t,n){t=e.exports=n(63585)(!1);var o=n(80268)(n(32104));t.push([e.id,"@font-face{font-family:ShellFabricMDL2Icons;src:url("+o+');font-weight:400;font-style:normal}.o365cs-base .ms-Icon--Settings:before{content:""}.o365cs-base .ms-Icon--Ringer:before{content:""}.o365cs-base .ms-Icon--Help:before{content:""}.o365cs-base .ms-Icon--BookingsDoDLogo:before,.o365cs-base .ms-Icon--BusinessCentralLogo:before,.o365cs-base .ms-Icon--ClipchampLogo:before,.o365cs-base .ms-Icon--CloudPCLogo:before,.o365cs-base .ms-Icon--CopilotLogo:before,.o365cs-base .ms-Icon--DefenderLogo:before,.o365cs-base .ms-Icon--DesignerLogo:before,.o365cs-base .ms-Icon--EditorLogo:before,.o365cs-base .ms-Icon--FamilySafetyLogo:before,.o365cs-base .ms-Icon--LearningActivitiesLogo:before,.o365cs-base .ms-Icon--LighthouseLogo:before,.o365cs-base .ms-Icon--LoopLogo:before,.o365cs-base .ms-Icon--M365CopilotNewLogo:before,.o365cs-base .ms-Icon--MeshLogo:before,.o365cs-base .ms-Icon--Microsoft365Logo:before,.o365cs-base .ms-Icon--MicrosoftReflectLogo:before,.o365cs-base .ms-Icon--MoreAppsDarkLogo:before,.o365cs-base .ms-Icon--MoreAppsLogo:before,.o365cs-base .ms-Icon--PowerPagesLogo:before,.o365cs-base .ms-Icon--PrivacyLogo:before,.o365cs-base .ms-Icon--PurviewLogo:before,.o365cs-base .ms-Icon--ReadingCoachLogo:before,.o365cs-base .ms-Icon--RewardsLogo:before,.o365cs-base .ms-Icon--VivaAmplifyLogo:before,.o365cs-base .ms-Icon--VivaConnectionsLogo:before,.o365cs-base .ms-Icon--VivaEngageLogo:before,.o365cs-base .ms-Icon--VivaGlintLogo:before,.o365cs-base .ms-Icon--VivaGoalsLogo:before,.o365cs-base .ms-Icon--VivaHomeLogo:before,.o365cs-base .ms-Icon--VivaInsightsLogo:before,.o365cs-base .ms-Icon--VivaLearningLogo:before,.o365cs-base .ms-Icon--VivaPulseLogo:before,.o365cs-base .ms-Icon--VivaTopicsLogo:before,.o365cs-base .ms-Icon--WaffleOffice365:before{content:""}.o365cs-base .ms-Icon--Search:before{content:""}.o365cs-base .ms-Icon--Contact:before{content:""}.o365cs-base .ms-Icon--CustomerVoiceLogo:before{content:""}.o365cs-base .ms-Icon--ListsLogo:before{content:""}.o365cs-base .ms-Icon--AddIn:before{content:""}.o365cs-base .ms-Icon--AdminALogo:before{content:""}.o365cs-base .ms-Icon--AdminPLogo:before{content:""}.o365cs-base .ms-Icon--AnalyticsLogo:before{content:""}.o365cs-base .ms-Icon--AlarmClock:before{content:""}.o365cs-base .ms-Icon--Back:before{content:""}.o365cs-base .ms-Icon--BingLogo:before{content:""}.o365cs-base .ms-Icon--BookingsLogo:before{content:""}.o365cs-base .ms-Icon--BusinessCenterLogo:before{content:""}.o365cs-base .ms-Icon--Calendar:before{content:""}.o365cs-base .ms-Icon--Camera:before{content:""}.o365cs-base .ms-Icon--CaretSolidDown:before{content:""}.o365cs-base .ms-Icon--Chart:before{content:""}.o365cs-base .ms-Icon--ChatCircleArrow:before{content:""}.o365cs-base .ms-Icon--ChatCircleCheck:before{content:""}.o365cs-base .ms-Icon--ChatCircleClock:before{content:""}.o365cs-base .ms-Icon--ChatCircleMinus:before{content:""}.o365cs-base .ms-Icon--CheckMark:before{content:""}.o365cs-base .ms-Icon--ChevronDownMed:before{content:""}.o365cs-base .ms-Icon--ChevronLeft:before{content:""}.o365cs-base .ms-Icon--ChevronRight:before{content:""}.o365cs-base .ms-Icon--ChevronUpMed:before{content:""}.o365cs-base .ms-Icon--ChromeClose:before{content:""}.o365cs-base .ms-Icon--CircleFill:before{content:""}.o365cs-base .ms-Icon--ClassNotebookLogo32:before{content:""}.o365cs-base .ms-Icon--ClassroomLogo:before{content:""}.o365cs-base .ms-Icon--Clear:before{content:""}.o365cs-base .ms-Icon--Delete:before{content:""}.o365cs-base .ms-Icon--Diamond:before{content:""}.o365cs-base .ms-Icon--DocsLogoInverse:before{content:""}.o365cs-base .ms-Icon--Download:before{content:""}.o365cs-base .ms-Icon--DynamicSMBLogo:before{content:""}.o365cs-base .ms-Icon--Dynamics365Logo:before{content:""}.o365cs-base .ms-Icon--Emoji2:before{content:""}.o365cs-base .ms-Icon--ExcelLogo:before{content:""}.o365cs-base .ms-Icon--Event:before{content:""}.o365cs-base .ms-Icon--EventToDoLogo:before{content:""}.o365cs-base .ms-Icon--FeatureFlagsLogo:before{content:""}.o365cs-base .ms-Icon--FolderHorizontal:before{content:""}.o365cs-base .ms-Icon--FileASPX:before{content:""}.o365cs-base .ms-Icon--Forward:before{content:""}.o365cs-base .ms-Icon--FullCircleMask:before{content:""}.o365cs-base .ms-Icon--GallatinLogo:before{content:""}.o365cs-base .ms-Icon--GlobalNavButton:before{content:""}.o365cs-base .ms-Icon--Globe:before{content:""}.o365cs-base .ms-Icon--HelpMirrored:before{content:""}.o365cs-base .ms-Icon--History:before{content:""}.o365cs-base .ms-Icon--Info:before{content:""}.o365cs-base .ms-Icon--KaizalaLogo:before{content:""}.o365cs-base .ms-Icon--Lightbulb:before{content:""}.o365cs-base .ms-Icon--MSNLogo:before{content:""}.o365cs-base .ms-Icon--Mail:before{content:""}.o365cs-base .ms-Icon--MicrosoftFlowLogo:before{content:""}.o365cs-base .ms-Icon--MicrosoftStaffhubLogo:before{content:""}.o365cs-base .ms-Icon--More:before{content:""}.o365cs-base .ms-Icon--MoreVertical:before{content:""}.o365cs-base .ms-Icon--M365InvoicingLogo:before{content:""}.o365cs-base .ms-Icon--NavigateExternalInline:before{content:""}.o365cs-base .ms-Icon--News:before{content:""}.o365cs-base .ms-Icon--NonprofitLogo32:before{content:""}.o365cs-base .ms-Icon--OfficeAddinsLogo:before{content:""}.o365cs-base .ms-Icon--OfficeChat:before{content:""}.o365cs-base .ms-Icon--OfficeChatSolid:before{content:""}.o365cs-base .ms-Icon--OfficeFormsLogo:before{content:""}.o365cs-base .ms-Icon--OfficeLogo:before{content:""}.o365cs-base .ms-Icon--OfficeVideoLogo:before{content:""}.o365cs-base .ms-Icon--OneDrive:before{content:""}.o365cs-base .ms-Icon--OneNoteLogo:before{content:""}.o365cs-base .ms-Icon--OutlookLogo:before{content:""}.o365cs-base .ms-Icon--Page:before{content:""}.o365cs-base .ms-Icon--ParatureLogo:before{content:""}.o365cs-base .ms-Icon--People:before{content:""}.o365cs-base .ms-Icon--Phone:before{content:""}.o365cs-base .ms-Icon--Pinned:before{content:""}.o365cs-base .ms-Icon--PlannerLogo:before{content:""}.o365cs-base .ms-Icon--PopExpand:before{content:""}.o365cs-base .ms-Icon--PowerAppsLogo:before{content:""}.o365cs-base .ms-Icon--PowerBILogo:before{content:""}.o365cs-base .ms-Icon--PowerPointLogo:before{content:""}.o365cs-base .ms-Icon--ProjectLogo32:before{content:""}.o365cs-base .ms-Icon--ProtectionCenterLogo32:before{content:""}.o365cs-base .ms-Icon--QuickNote:before{content:""}.o365cs-base .ms-Icon--SecurityLogo:before{content:""}.o365cs-base .ms-Icon--SharepointLogo:before{content:""}.o365cs-base .ms-Icon--SkypeForBusinessLogo:before{content:""}.o365cs-base .ms-Icon--SkypeLogo:before{content:""}.o365cs-base .ms-Icon--SocialListeningLogo:before{content:""}.o365cs-base .ms-Icon--StaffNotebookLogo32:before{content:""}.o365cs-base .ms-Icon--StoreLogo:before{content:""}.o365cs-base .ms-Icon--StreamLogo:before{content:""}.o365cs-base .ms-Icon--SwayLogo32:before{content:""}.o365cs-base .ms-Icon--TaskLogo:before{content:""}.o365cs-base .ms-Icon--TeamsLogo:before{content:""}.o365cs-base .ms-Icon--ToDoLogoInverse:before{content:""}.o365cs-base .ms-Icon--ToDoLogoOutline:before{content:""}.o365cs-base .ms-Icon--ToggleBorder:before{content:""}.o365cs-base .ms-Icon--ToggleThumb:before{content:""}.o365cs-base .ms-Icon--UnknownSolid:before{content:""}.o365cs-base .ms-Icon--Unpin:before{content:""}.o365cs-base .ms-Icon--Video:before{content:""}.o365cs-base .ms-Icon--VisioLogo:before{content:""}.o365cs-base .ms-Icon--Warning:before{content:""}.o365cs-base .ms-Icon--WhiteboardLogo:before{content:""}.o365cs-base .ms-Icon--WordLogo:before{content:""}.o365cs-base .ms-Icon--YammerLogo:before{content:""}',""])},72189:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,".o365cs-base ._8kgf\\/hwnaG6yDp7ROaUTXQ\\=\\={height:100%}.o365cs-base .al\\+TT2aHbwgQ07YKgWsrZw\\=\\={width:100%}.o365cs-base .v02KEC8zreNUdRsgFKjILA\\=\\={float:left}.o365cs-base ._8oKR2YgB\\/Xftf\\+UcYXBF8w\\=\\={float:right}.o365cs-base .VzNFGH0cG\\+njOb21wXfhhA\\=\\={display:table}.o365cs-base .vcfp76jyih\\+ENVqQ\\/8DFnw\\=\\={display:table-cell;vertical-align:top}.o365cs-base .JalJSTN5KL5K7CcIcQkzbA\\=\\={display:table-cell;vertical-align:bottom}.o365cs-base .DjQ3\\+qKHwG9bQOOkLpHAlw\\=\\={display:table-cell;vertical-align:middle}.o365cs-base .Eke7MaGTyd6e99459bb4rg\\=\\={display:none}.o365cs-base .TgJAsY26sVHapvCKU8XENA\\=\\={position:absolute;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0}",""]),t.locals={maxHeight:"_8kgf/hwnaG6yDp7ROaUTXQ==",maxWidth:"al+TT2aHbwgQ07YKgWsrZw==",floatLeft:"v02KEC8zreNUdRsgFKjILA==",floatRight:"_8oKR2YgB/Xftf+UcYXBF8w==",table:"VzNFGH0cG+njOb21wXfhhA==",tableCellTop:"vcfp76jyih+ENVqQ/8DFnw==",tableCellBottom:"JalJSTN5KL5K7CcIcQkzbA==",tableCellMiddle:"DjQ3+qKHwG9bQOOkLpHAlw==",hidden:"Eke7MaGTyd6e99459bb4rg==",visuallyHidden:"TgJAsY26sVHapvCKU8XENA=="}},86258:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,".LOH65mHND5UuJ9b5MOPIyg\\=\\={height:calc(100vh - 115px)}.EjkBtpEVGYQK1q\\/td6mhdg\\=\\={height:calc(100vh - 113px)}.sbU\\+9csU7o21SILr6MJmgw\\=\\={height:calc(100vh - 73px)}",""]),t.locals={flexPaneContentContainer:"LOH65mHND5UuJ9b5MOPIyg==",flexPaneContentContainerForThinHeader:"EjkBtpEVGYQK1q/td6mhdg==",flexPaneContentContainerForShyHeader:"sbU+9csU7o21SILr6MJmgw=="}},16832:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,'.TaSuqlyJ5MSqTQbXTeS3tQ\\=\\={font-family:ShellFabricMDL2IconsLite,ShellFabricMDL2Icons;line-height:1}.TaSuqlyJ5MSqTQbXTeS3tQ\\=\\= .o365cs-base [class*=" ms-Icon--"]:before,.TaSuqlyJ5MSqTQbXTeS3tQ\\=\\= .o365cs-base [class^=ms-Icon--]:before{font-family:inherit}.HKHsnwPD9asgCY\\/1RHVuQw\\=\\=,.I4nj8afMLjWpJ2UOud88zg\\=\\={height:100%}',""]),t.locals={customHeaderButton:"TaSuqlyJ5MSqTQbXTeS3tQ==",customHeaderButtonsContainer:"HKHsnwPD9asgCY/1RHVuQw==",customHeaderButtonWrapper:"I4nj8afMLjWpJ2UOud88zg=="}},76193:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,"._9i5RwVv0f00JLPQL7I\\+Y8Q\\=\\={width:360px;height:calc(100vh - 50px);overflow:hidden;position:fixed;z-index:1000000;top:50px;right:0;pointer-events:none}.X6jmOJbtPxrdLcpMF7gbRg\\=\\= iframe{height:1000px!important;overflow:hidden;position:absolute}.mdn3zwUjEpxe5XhvWdUUVg\\=\\={height:calc(100vh - 48px);top:48px}.f3ZNvJ3t0PnWAgoWv5LY2g\\=\\={height:calc(100vh - 8px);top:8px}@-moz-document url-prefix(){.XlKf\\+hNIUsKJ42S9ybY7rg\\=\\=:focus{outline:1px dotted}}.o365cs-base .fHsS8WIbhHVDlPRycq1MWw\\=\\={height:100%;position:absolute;right:0;z-index:1000000;width:320px;border-style:solid;pointer-events:all;border-width:0 0 0 1px;box-sizing:content-box}.o365cs-base .xRFEaPmwULXdFRg6xb0jHA\\=\\={border-color:#000;border-left-width:1px!important}.o365cs-base ._0um\\+0lXKfaqA\\+25RpmAufw\\=\\={height:100%}.o365cs-base .Pq9Aph\\+WaJhC6xHpxryKyw\\=\\={position:relative;overflow-y:auto;overflow-x:hidden}.o365cs-base .WtohaYWvzS3cfEoZF4BuZA\\=\\={-ms-flex:1;flex:1;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;height:100%}.o365cs-base .WtohaYWvzS3cfEoZF4BuZA\\=\\=:not(:-webkit-any-link){box-sizing:border-box}.o365cs-base .XlKf\\+hNIUsKJ42S9ybY7rg\\=\\={margin:0 auto 1px}.o365cs-base .ABsUeIawNiAydZM8TZ9GHg\\=\\={height:40px;width:40px;min-width:0;position:absolute;top:12px;left:calc(100% - 44px);padding:5px;border-width:0;background-color:transparent;text-align:center;cursor:pointer}.o365cs-base .ABsUeIawNiAydZM8TZ9GHg\\=\\=:focus{outline:1px dotted;outline:1px auto -webkit-focus-ring-color;outline-style:auto}.o365cs-base .jt1UvlCr1DTxe8MYybrikA\\=\\={-webkit-animation-name:flexPane-fadeIn,flexPane-slideRightIn;animation-name:flexPane-fadeIn,flexPane-slideRightIn;-webkit-animation-duration:.28s;animation-duration:.28s;-webkit-animation-timing-function:cubic-bezier(.8,0,.2,1);animation-timing-function:cubic-bezier(.8,0,.2,1)}.o365cs-base ._8OLH5zBoaL4dWYE73YqcfA\\=\\={-webkit-animation-name:flexPane-fadeOut,flexPane-slideRightOut;animation-name:flexPane-fadeOut,flexPane-slideRightOut;-webkit-animation-duration:.16s;animation-duration:.16s;-webkit-animation-timing-function:cubic-bezier(.8,0,.2,1);animation-timing-function:cubic-bezier(.8,0,.2,1);-webkit-animation-fill-mode:both;animation-fill-mode:both}.o365cs-base ._2\\/XVFgy7oOJ2PRdV0nb7xg\\=\\={visibility:hidden}@-webkit-keyframes flexPane-fadeIn{0%{visibility:hidden;opacity:0;-webkit-animation-timing-function:linear;animation-timing-function:linear}to{visibility:visible;opacity:1}}@keyframes flexPane-fadeIn{0%{visibility:hidden;opacity:0;-webkit-animation-timing-function:linear;animation-timing-function:linear}to{visibility:visible;opacity:1}}@-webkit-keyframes flexPane-fadeOut{0%{visibility:visible;opacity:1;-webkit-animation-timing-function:linear;animation-timing-function:linear}to{visibility:hidden;opacity:0}}@keyframes flexPane-fadeOut{0%{visibility:visible;opacity:1;-webkit-animation-timing-function:linear;animation-timing-function:linear}to{visibility:hidden;opacity:0}}@-webkit-keyframes flexPane-slideRightIn{0%{-webkit-transform:translate(80px);-ms-transform:translate(80px);transform:translate(80px)}to{-webkit-transform:translate(0);-ms-transform:translate(0);transform:translate(0)}}@keyframes flexPane-slideRightIn{0%{-webkit-transform:translate(80px);-ms-transform:translate(80px);transform:translate(80px)}to{-webkit-transform:translate(0);-ms-transform:translate(0);transform:translate(0)}}@-webkit-keyframes flexPane-slideRightOut{0%{-webkit-transform:translate(0);-ms-transform:translate(0);transform:translate(0)}to{-webkit-transform:translate(80px);-ms-transform:translate(80px);transform:translate(80px)}}@keyframes flexPane-slideRightOut{0%{-webkit-transform:translate(0);-ms-transform:translate(0);transform:translate(0)}to{-webkit-transform:translate(80px);-ms-transform:translate(80px);transform:translate(80px)}}.o365cs-base .JQUzjR1BqzgYWBFcHEPQkQ\\=\\={-webkit-animation-name:flexPaneItem-slideContentIn;animation-name:flexPaneItem-slideContentIn;-webkit-animation-duration:.28s;animation-duration:.28s;-webkit-animation-timing-function:cubic-bezier(.8,0,.2,1);animation-timing-function:cubic-bezier(.8,0,.2,1);-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;-webkit-animation-delay:.04s;animation-delay:.04s}.o365cs-base .hjnv9tRBywIVLOVT0rwOpA\\=\\={-webkit-animation-name:flexPane-fadeOut,flexPane-slideRightOut;animation-name:flexPane-fadeOut,flexPane-slideRightOut;-webkit-animation-duration:.16s;animation-duration:.16s;-webkit-animation-timing-function:cubic-bezier(.8,0,.2,1);animation-timing-function:cubic-bezier(.8,0,.2,1);-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards}@-webkit-keyframes flexPaneItem-slideContentIn{0%{opacity:0;-webkit-transform:translate(80px);-ms-transform:translate(80px);transform:translate(80px)}to{opacity:1;-webkit-transform:translate(0);-ms-transform:translate(0);transform:translate(0)}}@keyframes flexPaneItem-slideContentIn{0%{opacity:0;-webkit-transform:translate(80px);-ms-transform:translate(80px);transform:translate(80px)}to{opacity:1;-webkit-transform:translate(0);-ms-transform:translate(0);transform:translate(0)}}",""]),t.locals={flexPaneOverflowWidth:"360px",flexPaneWidth:"320px",thinFlexPaneOverflowWidth:"310px",thinFlexPaneWidth:"270px",flexPaneOverflowContainer:"_9i5RwVv0f00JLPQL7I+Y8Q==",flexPaneZoomIFrameHeight:"X6jmOJbtPxrdLcpMF7gbRg==",flexPaneHeightForThinHeader:"mdn3zwUjEpxe5XhvWdUUVg==",flexPaneHeightForShyHeader:"f3ZNvJ3t0PnWAgoWv5LY2g==",closeIcon:"XlKf+hNIUsKJ42S9ybY7rg==",flexPaneOverlay:"fHsS8WIbhHVDlPRycq1MWw==",darkBorder:"xRFEaPmwULXdFRg6xb0jHA==",flexPaneComponent:"_0um+0lXKfaqA+25RpmAufw==",flexPaneContainer:"Pq9Aph+WaJhC6xHpxryKyw==",verticalScrollRegion:"WtohaYWvzS3cfEoZF4BuZA==",closeButton:"ABsUeIawNiAydZM8TZ9GHg==",flexPaneShowRight:"jt1UvlCr1DTxe8MYybrikA==",flexPaneHideRight:"_8OLH5zBoaL4dWYE73YqcfA==",flexPaneHidden:"_2/XVFgy7oOJ2PRdV0nb7xg==",itemShow:"JQUzjR1BqzgYWBFcHEPQkQ==",itemHide:"hjnv9tRBywIVLOVT0rwOpA=="}},58984:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,'.o365cs-base .f5ba\\/8qghSGxJEKWPtai6A\\=\\={padding-left:16px;padding-right:16px}.o365cs-base ._6993O\\+eOvKnD2lo\\+d3S\\/KQ\\=\\={font:600 20px SegoeUI-SemiBold-final,Segoe UI Semibold,SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;display:inline-block;margin:0;line-height:27px;padding-left:16px;padding-top:20px;padding-bottom:18px;vertical-align:middle}.o365cs-base .\\/qOktybF63BhiAEUFHIu8A\\=\\={display:flex;font-family:SegoeUI-SemiBold-final,Segoe UI Semibold,SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif!important;font-weight:600;background:transparent!important;border:0;min-width:0;height:auto;text-decoration:none!important;cursor:pointer;display:inline-block;font-size:12px;vertical-align:middle;padding:10px 0 0 16px;width:auto}.o365cs-base .\\/qOktybF63BhiAEUFHIu8A\\=\\=>span{padding-bottom:2px;transition:border-bottom-color 83ms linear}.o365cs-base .\\/qOktybF63BhiAEUFHIu8A\\=\\=:hover>span{border-bottom:1px solid;padding-bottom:1px}.o365cs-base .N\\+CwwxeyNQqLhH2xWvWJ8w\\=\\={font-family:SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;font-size:14px;font-weight:600;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}',""]),t.locals={flexPaneSidePadding:"f5ba/8qghSGxJEKWPtai6A==",itemTitle:"_6993O+eOvKnD2lo+d3S/KQ==",backButton:"/qOktybF63BhiAEUFHIu8A==",backIcon:"N+CwwxeyNQqLhH2xWvWJ8w=="}},17168:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,'.o365cs-base.oxqgTC3pSRhOfrgHfYUrfw\\=\\={padding-bottom:2px;width:auto}.o365cs-base .MP9y\\+OCUQ0Dsy6Z6A0P7qg\\=\\={padding:12px 20px 12px 8px;font-family:SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;font-weight:400;line-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.o365cs-base .U3BBQu\\+2xhg0uuDXS\\/n8\\+g\\=\\={display:"inline-block";font-size:16px;padding-right:16px;vertical-align:middle}.o365cs-base .Si\\+F1NEyl39azkbswg7g8w\\=\\={padding-left:16px}.o365cs-base ._21b4kBzHkdpWCgCgA\\+VRlQ\\=\\={left:16px;top:8px}.o365cs-base .FdC5CgNe2qQBXGbOKlNuew\\=\\={justify-content:flex-end;max-width:48px}',""]),t.locals={affordanceContextMenu:"oxqgTC3pSRhOfrgHfYUrfw==",affordanceContextMenuItem:"MP9y+OCUQ0Dsy6Z6A0P7qg==",affordanceContextMenuItemIcon:"U3BBQu+2xhg0uuDXS/n8+g==",affordanceContextMenuItemNoIcon:"Si+F1NEyl39azkbswg7g8w==",affordanceContextMenuItemBadgePosition:"_21b4kBzHkdpWCgCgA+VRlQ==",affordanceMenuContainer:"FdC5CgNe2qQBXGbOKlNuew=="}},35910:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,'.dQ8XLMIyNxl8MAYqMsUZFQ\\=\\={width:100%;height:50px;display:flex;border-spacing:0;white-space:nowrap;line-height:normal}.dQ8XLMIyNxl8MAYqMsUZFQ\\=\\= .hpyHhmSe9hmk5gopLr9a5Q\\=\\=,.dQ8XLMIyNxl8MAYqMsUZFQ\\=\\= a.rOy\\+Hn8kiD5J9v5VDCE3Dg\\=\\={vertical-align:top}.aU8N30IM3GcKO4KKz8lgNA\\=\\={display:none!important}.removeFocusOutline :focus{outline:none;box-shadow:none!important}.clgiLVKPzugZZns0LiPTqw\\=\\=,.SXGDf\\/jjzN5Yzn8eL0wHjg\\=\\={display:block;position:relative;margin:0;padding:0;min-width:48px;text-align:center;cursor:pointer;outline-offset:-1px}@media(-ms-high-contrast:active),(forced-colors:active){.clgiLVKPzugZZns0LiPTqw\\=\\=:focus,.clgiLVKPzugZZns0LiPTqw\\=\\=:hover+.icon,.SXGDf\\/jjzN5Yzn8eL0wHjg\\=\\=:focus,.SXGDf\\/jjzN5Yzn8eL0wHjg\\=\\=:hover+.icon{-ms-high-contrast-adjust:none;forced-color-adjust:none;background-color:Highlight!important;color:highlightText!important}}.clgiLVKPzugZZns0LiPTqw\\=\\=:hover,.SXGDf\\/jjzN5Yzn8eL0wHjg\\=\\=:hover{-webkit-transition:background-color .467s cubic-bezier(.1,.9,.2,1) 34ms;transition:background-color .467s cubic-bezier(.1,.9,.2,1) 34ms}.SXGDf\\/jjzN5Yzn8eL0wHjg\\=\\=,.BiD096xkmK8Uxwc5MTuOlw\\=\\={display:block;position:relative;margin:0;padding:0;min-width:48px;text-align:center;cursor:default}@media(-ms-high-contrast:active),(forced-colors:active){.SXGDf\\/jjzN5Yzn8eL0wHjg\\=\\=:focus,.SXGDf\\/jjzN5Yzn8eL0wHjg\\=\\=:hover+.icon,.BiD096xkmK8Uxwc5MTuOlw\\=\\=:focus,.BiD096xkmK8Uxwc5MTuOlw\\=\\=:hover+.icon{-ms-high-contrast-adjust:none;forced-color-adjust:none}}.clgiLVKPzugZZns0LiPTqw\\=\\={background:transparent;border-width:0;width:auto;height:100%;box-sizing:border-box;line-height:48px;overflow:hidden}.clgiLVKPzugZZns0LiPTqw\\=\\=>.o365cs-base{height:100%;display:flex;align-items:center;justify-content:center}.clgiLVKPzugZZns0LiPTqw\\=\\= span[class*=" ms-Icon--"],.clgiLVKPzugZZns0LiPTqw\\=\\= span[class^=ms-Icon--]{line-height:48px}@media(-ms-high-contrast:active),(forced-colors:active){.clgiLVKPzugZZns0LiPTqw\\=\\=:focus+.icon,.clgiLVKPzugZZns0LiPTqw\\=\\=:hover{-ms-high-contrast-adjust:none;forced-color-adjust:none;background-color:Highlight!important;color:highlightText!important}}.BiD096xkmK8Uxwc5MTuOlw\\=\\={background:transparent;border-width:0;width:auto;height:100%;box-sizing:border-box;line-height:48px;overflow:hidden;cursor:default}.BiD096xkmK8Uxwc5MTuOlw\\=\\=>.o365cs-base{height:100%;display:flex;align-items:center;justify-content:center}.BiD096xkmK8Uxwc5MTuOlw\\=\\= span[class*=" ms-Icon--"],.BiD096xkmK8Uxwc5MTuOlw\\=\\= span[class^=ms-Icon--]{line-height:48px}@media(-ms-high-contrast:active),(forced-colors:active){.BiD096xkmK8Uxwc5MTuOlw\\=\\=:focus+.icon,.BiD096xkmK8Uxwc5MTuOlw\\=\\=:hover{-ms-high-contrast-adjust:none;forced-color-adjust:none}}.RGSb\\/1c4ex9CM0as0oaLQA\\=\\={display:inherit}.\\/l2PApUbI5EhJK0cmfHXqg\\=\\={min-width:68px}.SXGDf\\/jjzN5Yzn8eL0wHjg\\=\\={line-height:48px}.bfWNEPs24dESqyqDnh\\/7tA\\=\\={display:inline-block;vertical-align:middle;align-self:center;background-color:currentColor;margin-left:16px;margin-right:8px;height:28px;width:1px}html[dir=rtl] .bfWNEPs24dESqyqDnh\\/7tA\\=\\={margin-right:16px;margin-left:8px}.hpyHhmSe9hmk5gopLr9a5Q\\=\\={display:inline-block;font-weight:600;font-family:SegoeUI-SemiBold-final,Segoe UI Semibold,SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;font-size:16px;line-height:48px;-webkit-font-smoothing:antialiased}.AzzTpbJF15SioND4vylW8A\\=\\={box-shadow:none!important}.yvHsK6IvuQovPfJmcAYOOg\\=\\={display:flex;flex-direction:row;justify-content:center;align-items:center;padding:0;width:48px;height:48px}.yvHsK6IvuQovPfJmcAYOOg\\=\\= a:focus-visible{outline-offset:11px}.yvHsK6IvuQovPfJmcAYOOg\\=\\= img{width:24px;height:24px;top:12px;left:12px}.UbbNU\\+CJSypYHluHed61kg\\=\\={display:inline-block;vertical-align:top;font-size:24px;margin-top:13px;margin-left:6px}.UbbNU\\+CJSypYHluHed61kg\\=\\=:before{vertical-align:top}.q8AbQOBpuy93yBfTeGfNaw\\=\\={margin-left:14px;margin-right:14px;height:25px;margin-top:12px;border-right:1px solid}html[dir=rtl] .UbbNU\\+CJSypYHluHed61kg\\=\\={margin-left:0;margin-right:6px}.e\\/Vl0j0zHQMhZT1vQ6J\\+SQ\\=\\={height:100%;display:flex;vertical-align:middle;outline-offset:-1px;padding:0 12px 0 8px;text-decoration:none}.e\\/Vl0j0zHQMhZT1vQ6J\\+SQ\\=\\= a{display:flex;text-decoration:none;color:inherit}html[dir=rtl] .e\\/Vl0j0zHQMhZT1vQ6J\\+SQ\\=\\={padding:0 8px 0 12px}._3rJAyyAtPSCl0uoYr\\+wuLA\\=\\={line-height:48px;height:100%;display:inline-block;vertical-align:top;padding-left:8px}html[dir=rtl] ._3rJAyyAtPSCl0uoYr\\+wuLA\\=\\={padding-right:8px;padding-left:0}.rOy\\+Hn8kiD5J9v5VDCE3Dg\\=\\={max-width:200px;max-height:48px;overflow:hidden;display:flex;align-items:center;justify-content:center;line-height:48px;font-size:0;height:100%}.rOy\\+Hn8kiD5J9v5VDCE3Dg\\=\\=:focus-visible{outline-offset:-2px}.rOy\\+Hn8kiD5J9v5VDCE3Dg\\=\\= img{max-width:200px;max-height:48px;border-style:none!important;vertical-align:middle}.tP6UdQAxefBu0rqv2chMeg\\=\\= img{width:auto;height:24px}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.tP6UdQAxefBu0rqv2chMeg\\=\\= img{max-width:200px;max-height:none;min-width:160px;width:100%;height:24px}}@media(min-width:640px){.H7wt1\\/T7kbyfSRNZ2JzVLA\\=\\={max-width:176px;text-decoration:none}}.\\/B1n\\/h6ibI5wVz7jdDIP0A\\=\\={height:100%;max-width:176px;display:flex}.HcKMEYhmL4uLyG\\+K4hy8pg\\=\\={text-align:right;vertical-align:middle;display:table-cell;overflow:hidden;max-width:120px;font-size:14px;font-family:SegoeUI-SemiLight-final,Segoe UI Semilight,SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;text-overflow:ellipsis;word-break:break-all;white-space:nowrap;margin-left:4px}.HcKMEYhmL4uLyG\\+K4hy8pg\\=\\=>span{padding-left:4px;display:none}.U6Cnfo0RjXJ8UEwXhZV8mQ\\=\\={text-align:left;display:block;overflow:hidden;max-width:160px;font-size:13px;font-family:SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;text-overflow:ellipsis;word-break:break-all;white-space:nowrap;line-height:48px}.U6Cnfo0RjXJ8UEwXhZV8mQ\\=\\=>span{padding-left:12px;padding-right:4px;display:none}html[dir=rtl] .HcKMEYhmL4uLyG\\+K4hy8pg\\=\\={text-align:left}html[dir=rtl] .HcKMEYhmL4uLyG\\+K4hy8pg\\=\\=>span{padding-left:0;padding-right:4px}html[dir=rtl] .U6Cnfo0RjXJ8UEwXhZV8mQ\\=\\=>span{padding-left:4px;padding-right:12px}.NK6YQ060InuEH1W1LbFJ4Q\\=\\={display:flex;align-items:center;justify-content:center;border-left-width:0!important}html[dir=rtl] .NK6YQ060InuEH1W1LbFJ4Q\\=\\={border-right-width:0!important}.x03Rvs3MQ7Id948TyiIkCQ\\=\\={overflow:hidden;display:inline-block;border-radius:50%;vertical-align:middle;font-size:6px}.x03Rvs3MQ7Id948TyiIkCQ\\=\\= .ms-Persona{right:2px;top:-2px}.x03Rvs3MQ7Id948TyiIkCQ\\=\\= .ms-Persona .ms-Image-image{overflow:hidden;top:0}html[dir=rtl] .x03Rvs3MQ7Id948TyiIkCQ\\=\\= .ms-Persona{left:2px;right:0}.\\+gKDxCURR5euwhVW2NK21g\\=\\={overflow:hidden;display:inline-block;border:thin solid;border-radius:50%;vertical-align:middle;font-size:6px}.u85SIhgERLuqcMUbt2s66A\\=\\={border-radius:50%;line-height:1!important}.u85SIhgERLuqcMUbt2s66A\\=\\=:before{margin-top:.4em}.SPrdsmCpZYS0tgvvd0cRgQ\\=\\={width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-size:13px;font-family:SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;border:1px solid;box-sizing:border-box;border-radius:50%;line-height:1!important}.SPrdsmCpZYS0tgvvd0cRgQ\\=\\=:before{margin-top:.4em}.x03Rvs3MQ7Id948TyiIkCQ\\=\\=,.u85SIhgERLuqcMUbt2s66A\\=\\=,.\\+gKDxCURR5euwhVW2NK21g\\=\\={width:32px;height:32px}.ieRo\\/OqPYB7kffRFKx2c9w\\=\\={align-items:center;justify-content:space-between;margin:0;padding:0;text-align:center;height:100%}._25CqRVKwE38X5RHExD4IyA\\=\\={display:flex;flex:1 0 auto;height:100%}._1tJrEjbv1Qkvxc\\/P7r3tZg\\=\\={display:flex;justify-content:flex-start}.S3TWafQDKD\\+3UQM7Jnziug\\=\\={display:flex;flex:1 0 auto;justify-content:center}._16lUvVUJZw68Zc4vFo8oMQ\\=\\={display:flex;justify-content:flex-end}.HV6lC9J8OUFpKJjfAr1Asw\\=\\={display:flex;flex:0 0 auto}.Bh46b1rd8BrU4zolL9RzUg\\=\\={height:100%;line-height:48px;display:flex}.hdkWCzc6sRQuamFV07Y3xQ\\=\\={right:24px;top:8px}html[dir=rtl] .hdkWCzc6sRQuamFV07Y3xQ\\=\\={right:0;left:24px}@-moz-document url-prefix(){.clgiLVKPzugZZns0LiPTqw\\=\\=:focus{outline:1px dotted}}#O365_NavHeader abbr,#O365_NavHeader address,#O365_NavHeader article,#O365_NavHeader aside,#O365_NavHeader audio,#O365_NavHeader b,#O365_NavHeader blockquote,#O365_NavHeader body,#O365_NavHeader body :focus,#O365_NavHeader body div,#O365_NavHeader caption,#O365_NavHeader cite,#O365_NavHeader code,#O365_NavHeader dd,#O365_NavHeader del,#O365_NavHeader details,#O365_NavHeader dfn,#O365_NavHeader dl,#O365_NavHeader dt,#O365_NavHeader em,#O365_NavHeader fieldset,#O365_NavHeader figure,#O365_NavHeader footer,#O365_NavHeader form,#O365_NavHeader h1,#O365_NavHeader h2,#O365_NavHeader h3,#O365_NavHeader h4,#O365_NavHeader h5,#O365_NavHeader h6,#O365_NavHeader header,#O365_NavHeader html,#O365_NavHeader i,#O365_NavHeader iframe,#O365_NavHeader img,#O365_NavHeader ins,#O365_NavHeader kbd,#O365_NavHeader label,#O365_NavHeader legend,#O365_NavHeader li,#O365_NavHeader mark,#O365_NavHeader menu,#O365_NavHeader nav,#O365_NavHeader object,#O365_NavHeader ol,#O365_NavHeader p,#O365_NavHeader pre,#O365_NavHeader q,#O365_NavHeader samp,#O365_NavHeader section,#O365_NavHeader small,#O365_NavHeader strong,#O365_NavHeader sub,#O365_NavHeader summary,#O365_NavHeader sup,#O365_NavHeader table,#O365_NavHeader tbody,#O365_NavHeader td,#O365_NavHeader tfoot,#O365_NavHeader th,#O365_NavHeader thead,#O365_NavHeader time,#O365_NavHeader tr,#O365_NavHeader ul,#O365_NavHeader var,#O365_NavHeader video,#O365fpcontainerid abbr,#O365fpcontainerid address,#O365fpcontainerid article,#O365fpcontainerid aside,#O365fpcontainerid audio,#O365fpcontainerid b,#O365fpcontainerid blockquote,#O365fpcontainerid body,#O365fpcontainerid body :focus,#O365fpcontainerid body div,#O365fpcontainerid caption,#O365fpcontainerid cite,#O365fpcontainerid code,#O365fpcontainerid dd,#O365fpcontainerid del,#O365fpcontainerid details,#O365fpcontainerid dfn,#O365fpcontainerid dl,#O365fpcontainerid dt,#O365fpcontainerid em,#O365fpcontainerid fieldset,#O365fpcontainerid figure,#O365fpcontainerid footer,#O365fpcontainerid form,#O365fpcontainerid h1,#O365fpcontainerid h2,#O365fpcontainerid h3,#O365fpcontainerid h4,#O365fpcontainerid h5,#O365fpcontainerid h6,#O365fpcontainerid header,#O365fpcontainerid html,#O365fpcontainerid i,#O365fpcontainerid iframe,#O365fpcontainerid img,#O365fpcontainerid ins,#O365fpcontainerid kbd,#O365fpcontainerid label,#O365fpcontainerid legend,#O365fpcontainerid li,#O365fpcontainerid mark,#O365fpcontainerid menu,#O365fpcontainerid nav,#O365fpcontainerid object,#O365fpcontainerid ol,#O365fpcontainerid p,#O365fpcontainerid pre,#O365fpcontainerid q,#O365fpcontainerid samp,#O365fpcontainerid section,#O365fpcontainerid small,#O365fpcontainerid strong,#O365fpcontainerid sub,#O365fpcontainerid summary,#O365fpcontainerid sup,#O365fpcontainerid table,#O365fpcontainerid tbody,#O365fpcontainerid td,#O365fpcontainerid tfoot,#O365fpcontainerid th,#O365fpcontainerid thead,#O365fpcontainerid time,#O365fpcontainerid tr,#O365fpcontainerid ul,#O365fpcontainerid var,#O365fpcontainerid video,.o365shell-popup abbr,.o365shell-popup address,.o365shell-popup article,.o365shell-popup aside,.o365shell-popup audio,.o365shell-popup b,.o365shell-popup blockquote,.o365shell-popup body,.o365shell-popup body :focus,.o365shell-popup body div,.o365shell-popup caption,.o365shell-popup cite,.o365shell-popup code,.o365shell-popup dd,.o365shell-popup del,.o365shell-popup details,.o365shell-popup dfn,.o365shell-popup dl,.o365shell-popup dt,.o365shell-popup em,.o365shell-popup fieldset,.o365shell-popup figure,.o365shell-popup footer,.o365shell-popup form,.o365shell-popup h1,.o365shell-popup h2,.o365shell-popup h3,.o365shell-popup h4,.o365shell-popup h5,.o365shell-popup h6,.o365shell-popup header,.o365shell-popup html,.o365shell-popup i,.o365shell-popup iframe,.o365shell-popup img,.o365shell-popup ins,.o365shell-popup kbd,.o365shell-popup label,.o365shell-popup legend,.o365shell-popup li,.o365shell-popup mark,.o365shell-popup menu,.o365shell-popup nav,.o365shell-popup object,.o365shell-popup ol,.o365shell-popup p,.o365shell-popup pre,.o365shell-popup q,.o365shell-popup samp,.o365shell-popup section,.o365shell-popup small,.o365shell-popup strong,.o365shell-popup sub,.o365shell-popup summary,.o365shell-popup sup,.o365shell-popup table,.o365shell-popup tbody,.o365shell-popup td,.o365shell-popup tfoot,.o365shell-popup th,.o365shell-popup thead,.o365shell-popup time,.o365shell-popup tr,.o365shell-popup ul,.o365shell-popup var,.o365shell-popup video{box-sizing:content-box}',""]),t.locals={header:"dQ8XLMIyNxl8MAYqMsUZFQ==",brandingText:"hpyHhmSe9hmk5gopLr9a5Q==",tenantLogo:"rOy+Hn8kiD5J9v5VDCE3Dg==",displayNone:"aU8N30IM3GcKO4KKz8lgNA==",button:"clgiLVKPzugZZns0LiPTqw==",link:"SXGDf/jjzN5Yzn8eL0wHjg==",nonInteractiveButton:"BiD096xkmK8Uxwc5MTuOlw==",icon:"RGSb/1c4ex9CM0as0oaLQA==",wideWaffle:"/l2PApUbI5EhJK0cmfHXqg==",appTitleLine:"bfWNEPs24dESqyqDnh/7tA==",brandingLink:"AzzTpbJF15SioND4vylW8A==",appBrandIcon:"yvHsK6IvuQovPfJmcAYOOg==",gallatinLogo:"UbbNU+CJSypYHluHed61kg==",separator:"q8AbQOBpuy93yBfTeGfNaw==",appTitle:"e/Vl0j0zHQMhZT1vQ6J+SQ==",tenantBranding:"_3rJAyyAtPSCl0uoYr+wuLA==",tenantLogoSVG:"tP6UdQAxefBu0rqv2chMeg==",rightHeaderButton:"H7wt1/T7kbyfSRNZ2JzVLA==",rightHeaderContainer:"/B1n/h6ibI5wVz7jdDIP0A==",rightHeaderTextContent:"HcKMEYhmL4uLyG+K4hy8pg==",rightHeaderTextContentMeControl:"U6Cnfo0RjXJ8UEwXhZV8mQ==",rightHeaderImg:"NK6YQ060InuEH1W1LbFJ4Q==",meHeaderPhotoContainer:"x03Rvs3MQ7Id948TyiIkCQ==",signInDoughboyContainer:"+gKDxCURR5euwhVW2NK21g==",rightHeaderDoughboy:"u85SIhgERLuqcMUbt2s66A==",rightHeaderThemedInitials:"SPrdsmCpZYS0tgvvd0cRgQ==",leftRegion:"ieRo/OqPYB7kffRFKx2c9w==",extensibleRegion:"_25CqRVKwE38X5RHExD4IyA==",leftExtensibleRegion:"_1tJrEjbv1Qkvxc/P7r3tZg==",centerExtensibleRegion:"S3TWafQDKD+3UQM7Jnziug==",rightExtensibleRegion:"_16lUvVUJZw68Zc4vFo8oMQ==",rightRegion:"HV6lC9J8OUFpKJjfAr1Asw==",control:"Bh46b1rd8BrU4zolL9RzUg==",headerButtonBadgePosition:"hdkWCzc6sRQuamFV07Y3xQ=="}},37948:function(e,t,n){(t=e.exports=n(63585)(!1)).push([e.id,'.M3pcB5evSAtYMozck1WU7A\\=\\={height:100%;line-height:48px;display:flex}._1QSK5lUhw5Gkh7SDz97ZPQ\\=\\={height:48px;display:flex}.siUMOJwnumycxvszBe3uzQ\\=\\={display:inherit;flex:inherit;justify-content:inherit;order:inherit;align-self:inherit;min-width:inherit}.\\/DyMYj2gNfPrYNbEWoV2\\/w\\=\\={font-size:14px;font-family:SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif;text-align:left;height:48px;line-height:48px;vertical-align:top;padding-left:8px;text-overflow:ellipsis!important;overflow:hidden!important;max-width:220px;cursor:pointer}@media(-ms-high-contrast:active),(forced-colors:active){.\\/DyMYj2gNfPrYNbEWoV2\\/w\\=\\=:focus,.\\/DyMYj2gNfPrYNbEWoV2\\/w\\=\\=:hover{-ms-high-contrast-adjust:none;forced-color-adjust:none;background-color:Highlight!important;color:highlightText!important}}.N9B5\\/L\\/KHHvT9WOBAb1beA\\=\\={padding-left:12px!important;padding-right:12px!important;justify-content:right!important;display:flex}',""]),t.locals={thinHeaderControlContainer:"M3pcB5evSAtYMozck1WU7A==",thinHeaderLayoutRegion:"_1QSK5lUhw5Gkh7SDz97ZPQ==",customControlContainer:"siUMOJwnumycxvszBe3uzQ==",buttonText:"/DyMYj2gNfPrYNbEWoV2/w==",buttonWithTextPadding:"N9B5/L/KHHvT9WOBAb1beA=="}},63585:function(e){"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(a=o,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(c," */")),i=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot).concat(e," */")}));return[n].concat(i).concat([r]).join("\n")}// Adapted from convert-source-map (MIT) +var a,s,c;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2],"{").concat(n,"}"):n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r<this.length;r++){var i=this[r][0];null!=i&&(o[i]=!0)}for(var a=0;a<e.length;a++){var s=e[a];null!=s[0]&&o[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="(".concat(s[2],") and (").concat(n,")")),t.push(s))}},t}},80268:function(e){"use strict";e.exports=function(e,t){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),/["'() \t\n]/.test(e)||t?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},58722:function(e,t,n){"use strict";var o=n(45353),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={}; +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */function c(e){return o.isMemo(e)?a:s[e.$$typeof]||r}s[o.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[o.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,o){if("string"!=typeof n){if(h){var r=f(n);r&&r!==h&&e(t,r,o)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=c(t),m=c(n),g=0;g<a.length;++g){var b=a[g];if(!(i[b]||o&&o[b]||m&&m[b]||s&&s[b])){var v=p(n,b);try{l(t,b,v)}catch(e){}}}}return t}},33804:function(e,t,n){"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var o=n(77179);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,a){if(a!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},81578:function(e,t,n){e.exports=n(33804)()},77179:function(e){"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},99061:function(e,t){"use strict"; +/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var n,o=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case i:case s:case a:case p:case f:return e;default:switch(e=e&&e.$$typeof){case u:case l:case d:case m:case h:case c:return e;default:return t}}case r:return t}}}n=Symbol.for("react.module.reference"),t.ContextConsumer=l,t.ContextProvider=c,t.Element=o,t.ForwardRef=d,t.Fragment=i,t.Lazy=m,t.Memo=h,t.Portal=r,t.Profiler=s,t.StrictMode=a,t.Suspense=p,t.SuspenseList=f,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return b(e)===l},t.isContextProvider=function(e){return b(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===i},t.isLazy=function(e){return b(e)===m},t.isMemo=function(e){return b(e)===h},t.isPortal=function(e){return b(e)===r},t.isProfiler=function(e){return b(e)===s},t.isStrictMode=function(e){return b(e)===a},t.isSuspense=function(e){return b(e)===p},t.isSuspenseList=function(e){return b(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===p||e===f||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d||e.$$typeof===n||void 0!==e.getModuleId)},t.typeOf=b},45353:function(e,t,n){"use strict";e.exports=n(99061)},80126:function(e,t,n){"use strict";t.__esModule=!0,t.default=t.ReactReduxContext=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n(90872));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}const i=Symbol.for("react-redux-context"),a="undefined"!=typeof globalThis?globalThis:{};function s(){var e;if(!o.createContext)return{};const t=null!=(e=a[i])?e:a[i]=new Map;let n=t.get(o.createContext);return n||(n=o.createContext(null),t.set(o.createContext,n)),n}const c=s();t.ReactReduxContext=c;var l=c;t.default=l},25548:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(90872)),r=n(80126),i=n(93961),a=n(19823);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}var c=function({store:e,context:t,children:n,serverState:s,stabilityCheck:c="once",noopCheck:l="once"}){const u=o.useMemo((()=>{const t=(0,i.createSubscription)(e);return{store:e,subscription:t,getServerState:s?()=>s:void 0,stabilityCheck:c,noopCheck:l}}),[e,s,c,l]),d=o.useMemo((()=>e.getState()),[e]);(0,a.useIsomorphicLayoutEffect)((()=>{const{subscription:t}=u;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),d!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[u,d]);const p=t||r.ReactReduxContext;return o.createElement(p.Provider,{value:u},n)};t.default=c},81903:function(e,t,n){"use strict";var o=n(75720);t.__esModule=!0,t.default=t.initializeConnect=void 0;var r=o(n(93288)),i=o(n(13739)),a=o(n(58722)),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(90872)),c=n(45353),l=o(n(84904)),u=n(94236),d=n(76857),p=n(431),f=n(93961),h=n(19823),m=o(n(85824)),g=(o(n(80662)),n(80126)),b=n(8340);const v=["reactReduxForwardedRef"];function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}let x=b.notInitialized;t.initializeConnect=e=>{x=e};const A=[null,null];function C(e,t,n,o,r,i){e.current=o,n.current=!1,r.current&&(r.current=null,i())}function S(e,t){return e===t}var w=function(e,t,n,{pure:o,areStatesEqual:b=S,areOwnPropsEqual:y=m.default,areStatePropsEqual:w=m.default,areMergedPropsEqual:k=m.default,forwardRef:P=!1,context:O=g.ReactReduxContext}={}){const I=O,D=(0,d.mapStateToPropsFactory)(e),T=(0,u.mapDispatchToPropsFactory)(t),E=(0,p.mergePropsFactory)(n),L=Boolean(e);return e=>{const t=e.displayName||e.name||"Component",n=`Connect(${t})`,o={shouldHandleStateChanges:L,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:D,initMapDispatchToProps:T,initMergeProps:E,areStatesEqual:b,areStatePropsEqual:w,areOwnPropsEqual:y,areMergedPropsEqual:k};function u(t){const[n,a,u]=s.useMemo((()=>{const{reactReduxForwardedRef:e}=t,n=(0,i.default)(t,v);return[t.context,e,n]}),[t]),d=s.useMemo((()=>n&&n.Consumer&&(0,c.isContextConsumer)(s.createElement(n.Consumer,null))?n:I),[n,I]),p=s.useContext(d),m=Boolean(t.store)&&Boolean(t.store.getState)&&Boolean(t.store.dispatch),g=Boolean(p)&&Boolean(p.store);const b=m?t.store:p.store,y=g?p.getServerState:b.getState,S=s.useMemo((()=>(0,l.default)(b.dispatch,o)),[b]),[w,k]=s.useMemo((()=>{if(!L)return A;const e=(0,f.createSubscription)(b,m?void 0:p.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[b,m,p]),P=s.useMemo((()=>m?p:(0,r.default)({},p,{subscription:w})),[m,p,w]),O=s.useRef(),D=s.useRef(u),T=s.useRef(),E=s.useRef(!1),M=(s.useRef(!1),s.useRef(!1)),F=s.useRef();(0,h.useIsomorphicLayoutEffect)((()=>(M.current=!0,()=>{M.current=!1})),[]);const N=s.useMemo((()=>()=>T.current&&u===D.current?T.current:S(b.getState(),u)),[b,u]),B=s.useMemo((()=>e=>w?function(e,t,n,o,r,i,a,s,c,l,u){if(!e)return()=>{};let d=!1,p=null;const f=()=>{if(d||!s.current)return;const e=t.getState();let n,f;try{n=o(e,r.current)}catch(e){f=e,p=e}f||(p=null),n===i.current?a.current||l():(i.current=n,c.current=n,a.current=!0,u())};return n.onStateChange=f,n.trySubscribe(),f(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,p)throw p}}(L,b,w,S,D,O,E,M,T,k,e):()=>{}),[w]);var H,j,U;let R;H=C,j=[D,O,E,u,T,k],(0,h.useIsomorphicLayoutEffect)((()=>H(...j)),U);try{R=x(B,N,y?()=>S(y(),u):N)}catch(e){throw F.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${F.current.stack}\n\n`),e}(0,h.useIsomorphicLayoutEffect)((()=>{F.current=void 0,T.current=void 0,O.current=R}));const _=s.useMemo((()=>s.createElement(e,(0,r.default)({},R,{ref:a}))),[a,e,R]);return s.useMemo((()=>L?s.createElement(d.Provider,{value:P},_):_),[d,_,P])}const d=s.memo(u);if(d.WrappedComponent=e,d.displayName=u.displayName=n,P){const t=s.forwardRef((function(e,t){return s.createElement(d,(0,r.default)({},e,{reactReduxForwardedRef:t}))}));return t.displayName=n,t.WrappedComponent=e,(0,a.default)(t,e)}return(0,a.default)(d,e)}};t.default=w},93876:function(e,t){"use strict";t.__esModule=!0,t.createInvalidArgFactory=function(e,t){return(n,o)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${o.wrappedComponentName}.`)}}},94236:function(e,t,n){"use strict";var o=n(75720);t.__esModule=!0,t.mapDispatchToPropsFactory=function(e){return e&&"object"==typeof e?(0,i.wrapMapToPropsConstant)((t=>(0,r.default)(e,t))):e?"function"==typeof e?(0,i.wrapMapToPropsFunc)(e,"mapDispatchToProps"):(0,a.createInvalidArgFactory)(e,"mapDispatchToProps"):(0,i.wrapMapToPropsConstant)((e=>({dispatch:e})))};var r=o(n(86120)),i=n(77542),a=n(93876)},76857:function(e,t,n){"use strict";t.__esModule=!0,t.mapStateToPropsFactory=function(e){return e?"function"==typeof e?(0,o.wrapMapToPropsFunc)(e,"mapStateToProps"):(0,r.createInvalidArgFactory)(e,"mapStateToProps"):(0,o.wrapMapToPropsConstant)((()=>({})))};var o=n(77542),r=n(93876)},431:function(e,t,n){"use strict";var o=n(75720);t.__esModule=!0,t.defaultMergeProps=a,t.wrapMergePropsFunc=s,t.mergePropsFactory=function(e){return e?"function"==typeof e?s(e):(0,i.createInvalidArgFactory)(e,"mergeProps"):()=>a};var r=o(n(93288)),i=(o(n(84026)),n(93876));function a(e,t,n){return(0,r.default)({},n,e,t)}function s(e){return function(t,{displayName:n,areMergedPropsEqual:o}){let r,i=!1;return function(t,n,a){const s=e(t,n,a);return i?o(s,r)||(r=s):(i=!0,r=s),r}}}},84904:function(e,t,n){"use strict";var o=n(75720);t.__esModule=!0,t.pureFinalPropsSelectorFactory=a,t.default=function(e,t){let{initMapStateToProps:n,initMapDispatchToProps:o,initMergeProps:s}=t,c=(0,r.default)(t,i);const l=n(e,c),u=o(e,c),d=s(e,c);0;return a(l,u,d,e,c)};var r=o(n(13739));o(n(55932));const i=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function a(e,t,n,o,{areStatesEqual:r,areOwnPropsEqual:i,areStatePropsEqual:a}){let s,c,l,u,d,p=!1;function f(p,f){const h=!i(f,c),m=!r(p,s,f,c);return s=p,c=f,h&&m?(l=e(s,c),t.dependsOnOwnProps&&(u=t(o,c)),d=n(l,u,c),d):h?(e.dependsOnOwnProps&&(l=e(s,c)),t.dependsOnOwnProps&&(u=t(o,c)),d=n(l,u,c),d):m?function(){const t=e(s,c),o=!a(t,l);return l=t,o&&(d=n(l,u,c)),d}():d}return function(r,i){return p?f(r,i):(s=r,c=i,l=e(s,c),u=t(o,c),d=n(l,u,c),p=!0,d)}}},55932:function(e,t,n){"use strict";var o=n(75720);t.__esModule=!0,t.default=function(e,t,n){i(e,"mapStateToProps"),i(t,"mapDispatchToProps"),i(n,"mergeProps")};var r=o(n(80662));function i(e,t){if(!e)throw new Error(`Unexpected value for ${t} in connect.`);"mapStateToProps"!==t&&"mapDispatchToProps"!==t||Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||(0,r.default)(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`)}},77542:function(e,t,n){"use strict";var o=n(75720);t.__esModule=!0,t.wrapMapToPropsConstant=function(e){return function(t){const n=e(t);function o(){return n}return o.dependsOnOwnProps=!1,o}},t.getDependsOnOwnProps=r,t.wrapMapToPropsFunc=function(e,t){return function(t,{displayName:n}){const o=function(e,t){return o.dependsOnOwnProps?o.mapToProps(e,t):o.mapToProps(e,void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(t,n){o.mapToProps=e,o.dependsOnOwnProps=r(e);let i=o(t,n);return"function"==typeof i&&(o.mapToProps=i,o.dependsOnOwnProps=r(i),i=o(t,n)),i},o}};o(n(84026));function r(e){return e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}},65367:function(e,t,n){"use strict";var o=n(75720);t.__esModule=!0;var r={Provider:!0,connect:!0,ReactReduxContext:!0,useDispatch:!0,createDispatchHook:!0,useSelector:!0,createSelectorHook:!0,useStore:!0,createStoreHook:!0,shallowEqual:!0};Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"ReactReduxContext",{enumerable:!0,get:function(){return s.ReactReduxContext}}),Object.defineProperty(t,"useDispatch",{enumerable:!0,get:function(){return c.useDispatch}}),Object.defineProperty(t,"createDispatchHook",{enumerable:!0,get:function(){return c.createDispatchHook}}),Object.defineProperty(t,"useSelector",{enumerable:!0,get:function(){return l.useSelector}}),Object.defineProperty(t,"createSelectorHook",{enumerable:!0,get:function(){return l.createSelectorHook}}),Object.defineProperty(t,"useStore",{enumerable:!0,get:function(){return u.useStore}}),Object.defineProperty(t,"createStoreHook",{enumerable:!0,get:function(){return u.createStoreHook}}),Object.defineProperty(t,"shallowEqual",{enumerable:!0,get:function(){return d.default}});var i=o(n(25548)),a=o(n(81903)),s=n(80126),c=n(94870),l=n(91801),u=n(40359),d=o(n(85824)),p=n(91853);Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===p[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}}))}))},94870:function(e,t,n){"use strict";t.__esModule=!0,t.createDispatchHook=i,t.useDispatch=void 0;var o=n(80126),r=n(40359);function i(e=o.ReactReduxContext){const t=e===o.ReactReduxContext?r.useStore:(0,r.createStoreHook)(e);return function(){return t().dispatch}}const a=i();t.useDispatch=a},58541:function(e,t,n){"use strict";t.__esModule=!0,t.createReduxContextHook=i,t.useReduxContext=void 0;var o=n(90872),r=n(80126);function i(e=r.ReactReduxContext){return function(){return(0,o.useContext)(e)}}const a=i();t.useReduxContext=a},91801:function(e,t,n){"use strict";t.__esModule=!0,t.createSelectorHook=c,t.useSelector=t.initializeUseSelector=void 0;var o=n(90872),r=n(58541),i=n(80126);let a=n(8340).notInitialized;t.initializeUseSelector=e=>{a=e};const s=(e,t)=>e===t;function c(e=i.ReactReduxContext){const t=e===i.ReactReduxContext?r.useReduxContext:(0,r.createReduxContextHook)(e);return function(e,n={}){const{equalityFn:r=s,stabilityCheck:i,noopCheck:c}="function"==typeof n?{equalityFn:n}:n;const{store:l,subscription:u,getServerState:d,stabilityCheck:p,noopCheck:f}=t(),h=((0,o.useRef)(!0),(0,o.useCallback)({[e.name](t){return e(t)}}[e.name],[e,p,i])),m=a(u.addNestedSub,l.getState,d||l.getState,h,r);return(0,o.useDebugValue)(m),m}}const l=c();t.useSelector=l},40359:function(e,t,n){"use strict";t.__esModule=!0,t.createStoreHook=i,t.useStore=void 0;var o=n(80126),r=n(58541);function i(e=o.ReactReduxContext){const t=e===o.ReactReduxContext?r.useReduxContext:(0,r.createReduxContextHook)(e);return function(){const{store:e}=t();return e}}const a=i();t.useStore=a},91112:function(e,t,n){"use strict";t.__esModule=!0;var o={batch:!0};Object.defineProperty(t,"batch",{enumerable:!0,get:function(){return a.unstable_batchedUpdates}});var r=n(71536),i=n(63770),a=n(40536),s=n(46766),c=n(91801),l=n(81903),u=n(65367);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(o,e)||e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))})),(0,c.initializeUseSelector)(i.useSyncExternalStoreWithSelector),(0,l.initializeConnect)(r.useSyncExternalStore),(0,s.setBatch)(a.unstable_batchedUpdates)},91853:function(){},93961:function(e,t,n){"use strict";t.__esModule=!0,t.createSubscription=function(e,t){let n,i=r,a=0,s=!1;function c(){d.onStateChange&&d.onStateChange()}function l(){a++,n||(n=t?t.addNestedSub(c):e.subscribe(c),i=function(){const e=(0,o.getBatch)();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let o=!0,r=n={callback:e,next:null,prev:n};return r.prev?r.prev.next=r:t=r,function(){o&&null!==t&&(o=!1,r.next?r.next.prev=r.prev:n=r.prev,r.prev?r.prev.next=r.next:t=r.next)}}}}())}function u(){a--,n&&0===a&&(n(),n=void 0,i.clear(),i=r)}const d={addNestedSub:function(e){l();const t=i.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),u())}},notifyNestedSubs:function(){i.notify()},handleChangeWrapper:c,isSubscribed:function(){return s},trySubscribe:function(){s||(s=!0,l())},tryUnsubscribe:function(){s&&(s=!1,u())},getListeners:()=>i};return d};var o=n(46766);const r={notify(){},get:()=>[]}},46766:function(e,t){"use strict";t.__esModule=!0,t.getBatch=t.setBatch=void 0;let n=function(e){e()};t.setBatch=e=>n=e;t.getBatch=()=>n},86120:function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){const n={};for(const o in e){const r=e[o];"function"==typeof r&&(n[o]=(...e)=>t(r(...e)))}return n}},18865:function(e,t){"use strict";t.__esModule=!0,t.default=function(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}},40536:function(e,t,n){"use strict";t.__esModule=!0,Object.defineProperty(t,"unstable_batchedUpdates",{enumerable:!0,get:function(){return o.unstable_batchedUpdates}});var o=n(9028)},85824:function(e,t){"use strict";function n(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}t.__esModule=!0,t.default=function(e,t){if(n(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;for(let r=0;r<o.length;r++)if(!Object.prototype.hasOwnProperty.call(t,o[r])||!n(e[o[r]],t[o[r]]))return!1;return!0}},19823:function(e,t,n){"use strict";t.__esModule=!0,t.useIsomorphicLayoutEffect=t.canUseDOM=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n(90872));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}const i=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement);t.canUseDOM=i;const a=i?o.useLayoutEffect:o.useEffect;t.useIsomorphicLayoutEffect=a},8340:function(e,t){"use strict";t.__esModule=!0,t.notInitialized=void 0;t.notInitialized=()=>{throw new Error("uSES not initialized!")}},84026:function(e,t,n){"use strict";var o=n(75720);t.__esModule=!0,t.default=function(e,t,n){(0,r.default)(e)||(0,i.default)(`${n}() in ${t} must return a plain object. Instead received ${e}.`)};var r=o(n(18865)),i=o(n(80662))},80662:function(e,t){"use strict";t.__esModule=!0,t.default=function(e){"undefined"!=typeof console&&console.error;try{throw new Error(e)}catch(e){}}},71052:function(e,t,n){"use strict";function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}n.d(t,{Tw:function(){return g},HY:function(){return h},Zz:function(){return m},y$:function(){return f}});var l="function"==typeof Symbol&&Symbol.observable||"@@observable",u=function(){return Math.random().toString(36).substring(7).split("").join(".")},d={INIT:"@@redux/INIT"+u(),REPLACE:"@@redux/REPLACE"+u(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+u()}};function p(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function f(e,t,n){var o;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(c(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(c(1));return n(f)(e,t)}if("function"!=typeof e)throw new Error(c(2));var r=e,i=t,a=[],s=a,u=!1;function h(){s===a&&(s=a.slice())}function m(){if(u)throw new Error(c(3));return i}function g(e){if("function"!=typeof e)throw new Error(c(4));if(u)throw new Error(c(5));var t=!0;return h(),s.push(e),function(){if(t){if(u)throw new Error(c(6));t=!1,h();var n=s.indexOf(e);s.splice(n,1),a=null}}}function b(e){if(!p(e))throw new Error(c(7));if(void 0===e.type)throw new Error(c(8));if(u)throw new Error(c(9));try{u=!0,i=r(i,e)}finally{u=!1}for(var t=a=s,n=0;n<t.length;n++){(0,t[n])()}return e}return b({type:d.INIT}),(o={dispatch:b,subscribe:g,getState:m,replaceReducer:function(e){if("function"!=typeof e)throw new Error(c(10));r=e,b({type:d.REPLACE})}})[l]=function(){var e,t=g;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(c(11));function n(){e.next&&e.next(m())}return n(),{unsubscribe:t(n)}}})[l]=function(){return this},e},o}function h(e){for(var t=Object.keys(e),n={},o=0;o<t.length;o++){var r=t[o];0,"function"==typeof e[r]&&(n[r]=e[r])}var i,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:d.INIT}))throw new Error(c(12));if(void 0===n(void 0,{type:d.PROBE_UNKNOWN_ACTION()}))throw new Error(c(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var o=!1,r={},s=0;s<a.length;s++){var l=a[s],u=n[l],d=e[l],p=u(d,t);if(void 0===p){t&&t.type;throw new Error(c(14))}r[l]=p,o=o||p!==d}return(o=o||a.length!==Object.keys(e).length)?r:e}}function m(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function g(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),o=function(){throw new Error(c(15))},r={getState:n.getState,dispatch:function(){return o.apply(void 0,arguments)}},i=t.map((function(e){return e(r)}));return o=m.apply(void 0,i)(n.dispatch),s(s({},n),{},{dispatch:o})}}}},36764:function(e,t,n){var o=n(37875);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},87871:function(e,t,n){var o=n(79928);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},24584:function(e,t,n){var o=n(18587);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},17628:function(e,t,n){var o=n(48643);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},31556:function(e,t,n){var o=n(82819);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},65874:function(e,t,n){var o=n(4377);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},12424:function(e,t,n){var o=n(59663);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},13825:function(e,t,n){var o=n(73966);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},31689:function(e,t,n){var o=n(41306);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},48358:function(e,t,n){var o=n(35843);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},28942:function(e,t,n){var o=n(72189);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},4963:function(e,t,n){var o=n(86258);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},83379:function(e,t,n){var o=n(16832);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},40192:function(e,t,n){var o=n(76193);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},50791:function(e,t,n){var o=n(58984);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},69663:function(e,t,n){var o=n(17168);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},82871:function(e,t,n){var o=n(35910);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},2667:function(e,t,n){var o=n(37948);"string"==typeof o&&(o=[[e.id,o,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};n(79128)(o,r);o.locals&&(e.exports=o.locals)},79128:function(e,t,n){ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var o,r,i={},a=(o=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=o.apply(this,arguments)),r}),s=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var o=s.call(this,t,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}e[t]=o}return e[t]}}(),l=null,u=0,d=[],p=n(4383);function f(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=i[o.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](o.parts[a]);for(;a<o.parts.length;a++)r.parts.push(y(o.parts[a],t))}else{var s=[];for(a=0;a<o.parts.length;a++)s.push(y(o.parts[a],t));i[o.id]={id:o.id,refs:1,parts:s}}}}function h(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],a=t.base?i[0]+t.base:i[0],s={css:i[1],media:i[2],sourceMap:i[3]};o[a]?o[a].parts.push(s):n.push(o[a]={id:a,parts:[s]})}return n}function m(e,t){var n=c(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=d[d.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),d.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=c(e.insertAt.before,n);n.insertBefore(t,r)}}function g(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=d.indexOf(e);t>=0&&d.splice(t,1)}function b(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return v(t,e.attrs),m(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var a=u++;n=l||(l=b(t)),o=C.bind(null,n,a,!1),r=C.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),m(e,t),t}(t),o=w.bind(null,n,t),r=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(t),o=S.bind(null,n),r=function(){g(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return f(n,t),function(e){for(var o=[],r=0;r<n.length;r++){var a=n[r];(s=i[a.id]).refs--,o.push(s)}e&&f(h(e,t),t);for(r=0;r<o.length;r++){var s;if(0===(s=o[r]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete i[s.id]}}}};var x,A=(x=[],function(e,t){return x[e]=t,x.filter(Boolean).join("\n")});function C(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=A(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function S(e,t){var n=t.css,o=t.media;if(o&&e.setAttribute("media",o),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function w(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=p(o)),r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([o],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}},4383:function(e){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}},51805:function(e,t,n){"use strict"; +/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var o=n(90872);var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useState,a=o.useEffect,s=o.useLayoutEffect,c=o.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),o=i({inst:{value:n,getSnapshot:t}}),r=o[0].inst,u=o[1];return s((function(){r.value=n,r.getSnapshot=t,l(r)&&u({inst:r})}),[e,n,t]),a((function(){return l(r)&&u({inst:r}),e((function(){l(r)&&u({inst:r})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:u},19186:function(e,t,n){"use strict"; +/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var o=n(90872),r=n(71536);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useSyncExternalStore,s=o.useRef,c=o.useEffect,l=o.useMemo,u=o.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,o,r){var d=s(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=l((function(){function e(e){if(!c){if(c=!0,a=e,e=o(e),void 0!==r&&p.hasValue){var t=p.value;if(r(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var n=o(e);return void 0!==r&&r(t,n)?(a=e,t):(a=e,s=n)}var a,s,c=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,n,o,r]);var f=a(e,d[0],d[1]);return c((function(){p.hasValue=!0,p.value=f}),[f]),u(f),f}},71536:function(e,t,n){"use strict";e.exports=n(51805)},63770:function(e,t,n){"use strict";e.exports=n(19186)},22331:function(e,t,n){"use strict";n.d(t,{J9:function(){return S.J9},Qg:function(){return M},ic:function(){return S.ic},J8:function(){return S.J8}});var o=n(90872),r=n(9028),i=n(91112),a=n(53512),s=n(25793),c=n(82453),l=n(16968),u=n(33680),d=n(98499),p=n(71173),f=n(7102),h=n(84862),m=n(79627),g=n(54888),b=n(91497);function v(e,t,n){var o,r,i;if(t&&n){let a,s=e.appsPinnedData&&(null===(o=e.appsPinnedData.apps)||void 0===o?void 0:o.length)>0?e.appsPinnedData:g.bL(n);if(e.isInitialized){const e=(0,m.kx)(t,n);if(e){const t=e.filter(g.pf);a=t.map(g.sF),s=y(s,t),(null===(r=n.PrePinnedApps)||void 0===r?void 0:r.length)>0&&x(n.PrePinnedApps,e,s,"PrePinnedApp"),(null===(i=n.PromotedApps)||void 0===i?void 0:i.length)>0&&x(n.PromotedApps,e,s,"PromotedApp")}}s&&void 0===s.apps&&(s.apps=[]);const c=e.pinnedAppTiles&&e.pinnedAppTiles.length>0?e.pinnedAppTiles:s&&(0,m.Wb)(s.apps).map(g.sF),l=g.DD(n);return Object.assign(Object.assign({},e),{appsPinnedData:s,prePinnedApps:n.PrePinnedApps,promotedApps:n.PromotedApps,pinnedAppTiles:c,homeUrl:t.LogoNavigationUrl,environment:n.Environment,appGalleryUrl:n.AppGalleryUrl,showM365Experience:l,blockUnsafeUrls:n.BlockUnsafeUrls,coreAndSegmentAppTiles:a||e.coreAndSegmentAppTiles,waffleAllAppsViewDisabled:n.WaffleAllAppsViewDisabled})}return e}function y(e,t){let n;const o=null!=t?t:[];return e?(n=e,e.hasSegmentApps||(n.apps=o.concat(...e.apps))):n={apps:null!=o?o:[]},n.hasSegmentApps=!0,n}function x(e,t,n,o){e.forEach((e=>{if(null==(0,m.J0)(n.apps,e.CollectorId,e.Id)&&null==(0,m.J0)(n.unpinnedApps,e.CollectorId,e.Id)){const r=(0,m.J0)(t,e.CollectorId,e.Id);r?n.apps.push(r):(0,l.tZ)().tag("AppLauncher_Missing"+o,6,e.CollectorId,e.Id)}}))}const A={appLauncherState:function(e,t){if(!e){const n=t.shellInitData.shellInitDataState;e=v(h.P,n.navBarData,n.clientData)}switch(t.type){case b.ii:return function(e,t){var n;let o=t.appsPinnedData;const r=null===(n=t.appsData)||void 0===n?void 0:n.filter(g.pf);r&&(o=y(o,r));t.prePinnedApps&&x(t.prePinnedApps,t.appsData,o,"PrePinnedApp");t.promotedApps&&x(t.promotedApps,t.appsData,o,"PromotedApp");const i=o&&(0,m.Wb)(o.apps).map(g.sF);return Object.assign(Object.assign({},e),{isHidden:!1,isInitialized:!0,openedByTouchOrKeyPress:t.isTouchOrKeyPressed,openedTime:t.timestamp,appsPinnedData:o,coreAndSegmentAppTiles:r.map(g.sF),pinnedAppTiles:i,isStandalone:t.isStandalone,isNTP:t.isNTP})}(e,t);case b.dP:const n=t;return Object.assign(Object.assign({},e),{isHidden:!e.isHidden,openedByTouchOrKeyPress:e.isHidden?n.isTouchOrKeyPressed:null,openedTime:e.isHidden?n.timestamp:null,showAllView:!1});case b.kD:return Object.assign(Object.assign({},e),{isHidden:!0,openedTime:null,showAllView:!1,appDataDetails:null,statusAnnouncement:null});case b.O0:return Object.assign(Object.assign({},e),{showAllView:!0});case b.R7:return Object.assign(Object.assign({},e),{showAllView:!1});case f.nv:return function(e,t){const n=t.appsData&&t.appsData.filter(g.pf).map(g.sF);return Object.assign(Object.assign({},e),{coreAndSegmentAppTiles:n})}(e,t);case b.yk:return function(e,t){const n=t.appsPinnedData&&(0,m.Wb)(t.appsPinnedData.apps).map(g.sF);return Object.assign(Object.assign({},e),{appsPinnedData:t.appsPinnedData,pinnedAppTiles:n})}(e,t);case b.YH:return Object.assign(Object.assign({},e),{isCustomizable:!0});case b.Ul:return function(e,t){let n=e.appsPinnedData,o=e.pinnedAppTiles,r=t.appData;"LineOfBusiness"===r.CollectorId&&(r={CollectorId:r.CollectorId,Id:r.Id});if(n){if(null==(0,m.J0)(n.apps,r.CollectorId,r.Id)){let e=n.unpinnedApps;void 0!==e&&(e=e.filter((e=>e.Id!==r.Id||e.CollectorId!==r.CollectorId))),n=Object.assign(Object.assign({},n),{unpinnedApps:e,apps:n.apps.concat(r)}),o=o.concat(g.sF(r))}}else n={apps:[r]},o=[g.sF(r)];return Object.assign(Object.assign({},e),{appsPinnedData:n,pinnedAppTiles:o,statusAnnouncement:t.statusAnnouncement})}(e,t);case b.Tf:return function(e,t){let n=e.appsPinnedData,o=e.pinnedAppTiles;if(n){let e=n.unpinnedApps;void 0===e?e=[{Id:t.id,CollectorId:t.collectorId}]:0===e.filter((e=>e.Id===t.id&&e.CollectorId===t.collectorId)).length&&(e=e.concat({Id:t.id,CollectorId:t.collectorId})),n=Object.assign(Object.assign({},n),{unpinnedApps:e,apps:n.apps.filter((e=>e.CollectorId!==t.collectorId||e.Id!==t.id))}),o=o.filter((e=>e.collectorId!==t.collectorId||e.id!==t.id))}return Object.assign(Object.assign({},e),{appsPinnedData:n,pinnedAppTiles:o,statusAnnouncement:t.statusAnnouncement})}(e,t);case b.eE:return function(e,t){const n={CollectorId:t.collectorId,Id:t.id};return Object.assign(Object.assign({},e),{appDataDetails:n})}(e,t);case b.Sj:return function(e,t){const n={CollectorId:t.collectorId,Id:t.id};return Object.assign(Object.assign({},e),{appDataDetails:n})}(e,t);case b.JV:return Object.assign(Object.assign({},e),{appDataDetails:null});case b.bP:return function(e,t){let n=e.appDataDetails;n&&n.CollectorId===t.appDataDetails.CollectorId&&n.Id===t.appDataDetails.Id&&(n=t.appDataDetails);return Object.assign(Object.assign({},e),{appDataDetails:n})}(e,t);case b.a5:return Object.assign(Object.assign({},e),{hamburgerEnabled:!0});case f.l5:const o=t;return v(e,o.navBarData,o.shellClientData);case b.Qq:return function(e,t){const n=t.searchText;return Object.assign(Object.assign({},e),{searchText:n})}(e,t);default:return e}}};var C=n(99542),S=n(26335);class w{OnLinkClick(e){return(0,l.NP)().subscribe("LinkClick",e)}RemoveOnLinkClick(e){(0,l.NP)().unsubscribe("LinkClick",e)}OnHamburgerButtonClick(e){let t=document.getElementById(C.B2);t&&(t.style.display=""),(0,l.NP)().subscribe("HamburgerButtonClick",e),(0,c.O)().dispatch((0,S.XZ)())}EnterAccessibilityLoopInShell(){}ReverseEnterAccessibilityLoopInShell(){}SetForwardAccessibilityLoopOutsideHeaderElementId(e){}SetReverseAccessibilityLoopOutsideHeaderElementId(e){}}let k,P,O,I,D=!1,T=!1,E=!0;n.nc=window.oneShellUxNonce;const L=(0,a._)((()=>Promise.all([n.e("plus"),n.e("m365start")]).then(n.bind(n,1049)).then((e=>e.AppLauncherConnector))));(0,a._)((()=>n.e("applauncher").then(n.bind(n,80551)).then((e=>e.AppLauncherConnector))));function M(){s.h.register(A),(0,l.vm)().shouldRenderAppLauncher&&H(!1,!1),function(){let e=new w,t=window.O365Shell.Navigation;window.O365Shell.Navigation=e,t.applyCalls(e)}(),(0,l.NP)().subscribe("ShellDataUpdated",F,!0)}function F(e,t){try{(0,d.l)().getConfig().then((e=>{var n;e&&(e.M365CopilotRebrandingEnabled&&void 0===P&&(P=e.M365CopilotRebrandingEnabled),e.M365CopilotBannerEnabled&&void 0===O&&(O=e.M365CopilotBannerEnabled),e.M365CopilotBannerSelfHostInternalEnabled&&void 0===I&&(I=e.M365CopilotBannerSelfHostInternalEnabled)),t.IsConsumerShell?e&&e.DisableM365StartIntentsModule&&void 0===k&&(k=e.DisableM365StartIntentsModule):k=null!==(n=null==t?void 0:t.DisableM365StartIntentsModule)&&void 0!==n&&n}))}catch(e){}(0,l.NP)().unsubscribe("ShellDataUpdated",F)}function N(e){D=!1,"touchstart"===e.type&&(D=!0),"pointerdown"===e.type&&"touch"===e.pointerType&&(D=!0)}function B(e){E="mouseenter"===e.type}function H(e,t){const n=document.getElementById((0,l.GJ)().top),a=document.createElement("div");n.appendChild(a),(0,u.Wg)([p.ng,p.oB],"click keydown",j),(0,u.Wg)([p.ng,p.oB],"touchstart pointerdown",N),(0,u.Wg)([p.ng,p.oB],"mouseenter mouseleave",B);const s=()=>{(0,l.NP)().unsubscribe("InitialAppDataLoaded",s);const n=(0,c.O)();r.render(o.createElement(i.Provider,{store:n},o.createElement(L,{openedByTouchOrKeyPress:e,showFocusOutline:t,disableIntentsModule:k,m365CopilotRebrandingEnabled:P,m365CopilotBannerEnabled:O,m365CopilotBannerSelfHostInternalEnabled:I})),a,(()=>{}))};(0,l.NP)().subscribe("InitialAppDataLoaded",s,!0)}function j(e){if(e instanceof KeyboardEvent){if(T=!0,D=!0,"keydown"===e.type&&13!==e.which&&32!==e.which)return}else"click"===e.type&&(D=!E,T=!E);e.preventDefault(),H(D,T)}(0,u.lQ)([p.ng,p.oB],"click keydown",j),(0,u.lQ)([p.ng,p.oB],"touchstart pointerdown",N),(0,u.lQ)([p.ng,p.oB],"mouseenter mouseleave",B)},26335:function(e,t,n){"use strict";n.d(t,{Ee:function(){return c},H1:function(){return l},J8:function(){return d},J9:function(){return p},L4:function(){return f},Qg:function(){return r},RC:function(){return u},Ud:function(){return h},W4:function(){return a},XZ:function(){return i},YR:function(){return g},ib:function(){return s},ic:function(){return b},p6:function(){return m}});var o=n(91497);function r(e,t,n,r,i,a,s,c){return{type:o.ii,appsData:e,appsPinnedData:t,prePinnedApps:n,promotedApps:r,timestamp:i,isTouchOrKeyPressed:a,isStandalone:s,isNTP:c}}function i(){return{type:o.a5}}function a(e,t){return{type:o.dP,timestamp:e,isTouchOrKeyPressed:t}}function s(){return{type:o.kD}}function c(){return{type:o.O0}}function l(){return{type:o.R7}}function u(e){return{type:o.Qq,searchText:e}}function d(e){return{type:o.yk,appsPinnedData:e}}function p(){return{type:o.YH}}function f(e,t){return{type:o.Ul,appData:e,statusAnnouncement:t}}function h(e,t,n){return{type:o.Tf,collectorId:e,id:t,statusAnnouncement:n}}function m(e,t){return{type:o.eE,collectorId:e,id:t}}function g(){return{type:o.JV}}function b(e){return{type:o.bP,appDataDetails:e}}},91497:function(e,t,n){"use strict";n.d(t,{JV:function(){return h},O0:function(){return a},Qq:function(){return g},R7:function(){return s},Sj:function(){return f},Tf:function(){return d},Ul:function(){return u},YH:function(){return l},a5:function(){return b},bP:function(){return m},dP:function(){return r},eE:function(){return p},ii:function(){return o},kD:function(){return i},yk:function(){return c}});const o="suiteux-app-launcher.INIT_APP_LAUNCHER",r="suiteux-app-launcher.TOGGLE_APP_LAUNCHER_VISIBILITY",i="suiteux-app-launcher.CLOSE_APP_LAUNCHER",a="suiteux-app-launcher.SHOW_ALL_VIEW",s="suiteux-app-launcher.HIDE_ALL_VIEW",c="suiteux-app-launcher.SET_APPS_PINNED_DATA",l="suiteux-app-launcher.ENABLE_CUSTOMIZATION",u="suiteux-app-launcher.PIN_APP",d="suiteux-app-launcher.UNPIN_APP",p="suiteux-app-launcher.SHOW_APP_DETAILS_PANE",f="suiteux-app-launcher.SHOW_LEARN_MORE_POPUP",h="suiteux-app-launcher.HIDE_APP_DETAILS_PANE",m="suiteux-app-launcher.SET_APP_DATA_DETAILS",g="suiteux-app-launcher.ON_SEARCH_TEXT_CHANGED",b="suiteux-app-launcher.ENABLE_HAMBURGER"},54888:function(e,t,n){"use strict";n.d(t,{DD:function(){return u},LP:function(){return c},Ro:function(){return l},bL:function(){return s},kj:function(){return i},pf:function(){return r},sF:function(){return a}});var o=n(7667);function r(e){return"FirstParty"===e.CollectorId&&!e.IsAutoPinnedDisabled}function i(e){if(e.DateInstalled){let t=(0,o._)(e.DateInstalled);if(Date.now()-t.getTime()<6048e5)return!0}return!1}function a(e){return{collectorId:e.CollectorId,id:e.Id}}function s(e){let t=null;return null!=e.AppsPinnedData&&(t="string"==typeof e.AppsPinnedData?JSON.parse(e.AppsPinnedData):e.AppsPinnedData),t}function c(e){return e.sort(((e,t)=>null!=e.Title?e.Title.localeCompare(t.Title):1))}function l(e,t,n){if(e)for(let o of e)if(o.collectorId===t&&o.id===n)return o;return null}function u(e){let t=-1!==(e.ActiveExperiences||"").toLowerCase().split(",").indexOf("smb"),n=e.IsConsumerShell;return t||n}},18435:function(e,t,n){"use strict";var o;n.d(t,{B:function(){return o}}),function(e){e.KEYDOWN="keydown",e.KEYUP="keyup",e.KEYPRESS="keypress",e.CLICK="click",e.MOUSEDOWN="mousedown",e.MOUSEENTER="mouseenter",e.MOUSELEAVE="mouseleave",e.FOCUS="focus",e.BLUR="blur",e.RESIZE="resize",e.SCROLL="scroll",e.CONTEXTMENU="contextmenu",e.FOCUSIN="focusin",e.FOCUSOUT="focusout",e.MESSAGE="message"}(o||(o={}))},40141:function(e,t,n){"use strict";function o(){return window.O365ShellContext.ThemeManager.getThemeClassNames()}n.d(t,{e:function(){return o}})},39038:function(e,t,n){"use strict";n.d(t,{t:function(){return c}});var o=n(90872),r=n(22461),i=n(83694),a=n(36649),s=n(36764);class c extends o.Component{constructor(e){super(e),this.setRef=e=>this.contextMenu=e}componentWillMount(){this.props.scrollContainerId&&(this.virtualParent=document.getElementById(this.props.scrollContainerId),this.virtualParent.addEventListener("scroll",this.props.onDismiss)),this.previouslyFocusedElement=document.activeElement}render(){var e;const t=(0,r.A)(s.contextMenu,this.props.className);return o.createElement(i.z,{id:this.props.id,onDismiss:this.props.onDismiss,className:t,target:this.props.target,popupPosition:this.props.popupPosition,renderHost:this.props.renderHost,skipDismissForElement:this.props.skipDismissForElement,focusTrapSelector:"li",ariaLabel:this.props.ariaLabel,isArrowUpDownFocus:!0,skipTabFocus:null===(e=this.props.skipTabFocus)||void 0===e||e,isRtl:this.props.isRtl,skipAdjustPostion:this.props.skipAdjustPostion,shouldFocusPreviouslyFocusedElement:this.props.setFocusOnPreviouslyFocusedElement,elementToFocusOnClose:this.props.elementToFocusOnClose},o.createElement("ul",{className:(0,r.A)({[s.innerScroll]:this.props.isScrollHidden},s.defaultList,this.props.listClassName),ref:this.setRef,role:"menu"},this.props.children))}componentWillUnmount(){this.props.scrollContainerId&&document.getElementById(this.props.scrollContainerId).removeEventListener("scroll",this.props.onDismiss),this.props.elementToFocusOnClose?this.props.elementToFocusOnClose.focus():this.props.setFocusOnPreviouslyFocusedElement&&this.previouslyFocusedElement.focus()}componentDidMount(){this.props.scrollContainerId&&(0,a.g)(this.contextMenu,document.getElementById(this.props.scrollContainerId)),this.props.isKeyboardNavigation&&null!=this.contextMenu.children&&this.contextMenu.childElementCount>0&&this.contextMenu.children[0].focus()}}},79649:function(e,t,n){"use strict";n.d(t,{k:function(){return a}});var o=n(90872),r=n(22461),i=n(87871);class a extends o.Component{constructor(){super(...arguments),this.handleKeyDown=e=>{13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.props.onclick&&this.props.onclick(e))}}render(){return o.createElement("li",{className:(0,r.A)(i.contextMenuItem,this.props.className),onClick:this.props.onclick,ref:this.props.setClickableElement,id:this.props.itemId,title:this.props.title?this.props.title:this.props.displayText,"aria-label":this.props.displayText,role:this.props.role,tabIndex:-1,onKeyDown:this.handleKeyDown,"aria-hidden":this.props.isAriaHidden},this.props.icon&&o.createElement("img",{src:this.props.icon,className:i.imgIcon,alt:"",role:"presentation","aria-hidden":!0}),this.props.customIcon,o.createElement("label",{"aria-hidden":!0},this.props.displayText),this.props.children)}}},10806:function(e,t,n){"use strict";n.d(t,{e:function(){return s}});var o=n(90872),r=n(61304),i=n(87948),a=n(24584);class s extends o.Component{constructor(e){super(e),this.isEndFocus=!1,this.resetEndFocus=!1,this.controlEndReference=null,this.setEventListeners=()=>{this.props.isActive&&this.props.controlElement&&(this.props.controlElement.addEventListener("keydown",this.onKeyDown),this.props.controlElement.addEventListener("blur",this.onControlBlur),this.props.controlElement.addEventListener("focus",this.onControlFocus))},this.onKeyDown=e=>{if(9===e.keyCode){if(!this.props.isActive)return;if(!this.isEndFocus){if(e.shiftKey)return;let t=document.getElementById("O365fp_firstFocusable");return t?void t.focus():(this.resetEndFocus=!0,void this.controlEndReference.focus())}if(e.shiftKey){let t=document.getElementById("flexPaneCloseButton");return t?(t.focus(),e.stopPropagation(),void e.preventDefault()):void 0}this.resetEndFocus=!0,this.controlEndReference.focus()}},this.onEndFocus=()=>{if(this.resetEndFocus)return this.isEndFocus=!1,void(this.resetEndFocus=!1);this.isEndFocus=!0,this.updateAccessibilityText(),this.props.controlElement.focus()},this.onControlBlur=()=>{this.isEndFocus=!1},this.onControlFocus=()=>{this.updateAccessibilityText()},this.setControlEndRef=e=>{this.controlEndReference=e}}componentDidUpdate(e,t){!e.isActive&&this.props.isActive&&this.props.controlElement&&(this.isEndFocus=!1,this.props.controlElement.addEventListener("keydown",this.onKeyDown),this.props.controlElement.addEventListener("blur",this.onControlBlur),this.props.controlElement.addEventListener("focus",this.onControlFocus)),e.isActive&&!this.props.isActive&&this.props.controlElement&&(this.props.controlElement.removeEventListener("keydown",this.onKeyDown),this.props.controlElement.removeEventListener("blur",this.onControlBlur),this.props.controlElement.removeEventListener("focus",this.onControlFocus))}componentWillUnmount(){this.props.isActive&&this.props.controlElement&&(this.props.controlElement.removeEventListener("keydown",this.onKeyDown),this.props.controlElement.removeEventListener("blur",this.onControlBlur),this.props.controlElement.removeEventListener("focus",this.onControlFocus))}render(){return this.updateAccessibilityText(),o.createElement("div",{className:a.entrypointContainer,onFocus:this.setEventListeners},this.props.children,this.props.isActive&&o.createElement("div",{id:this.props.controlID+"_end",tabIndex:-1,"aria-hidden":!0,onFocus:this.onEndFocus,ref:this.setControlEndRef}))}updateAccessibilityText(){if(this.props.controlElement&&this.props.isActive&&!this.isEndFocus){let e;this.controlAriaLabel||(this.controlAriaLabel=this.props.controlElement.getAttribute("aria-label")),e=(0,i.vQ)(this.controlAriaLabel)?r.D.FlexpaneEntrypointAriaLabelFallback:(0,i.JT)(r.D.FlexpaneEntrypointAriaLabel,this.controlAriaLabel),this.props.controlElement.setAttribute("aria-label",e)}!this.props.controlElement||this.props.isActive&&!this.isEndFocus||this.controlAriaLabel&&this.props.controlElement.setAttribute("aria-label",this.controlAriaLabel)}}},53512:function(e,t,n){"use strict";n.d(t,{_:function(){return i}});var o=n(90872),r=n(88242);function i(e){let t;const n=new Promise(((e,n)=>{t=e}));class i extends o.PureComponent{constructor(e){super(e),this.componentCancellablePromise=null,this.onFail=e=>{this.setState({failed:!0}),this.props.onLazyFailure&&this.props.onLazyFailure(e)},this.state={Component:i.Component,failed:!1}}componentDidMount(){if(!this.state.Component){let t;this.componentCancellablePromise=(0,r.l)(e?e():n),this.props.lazyTimeout&&(t=window.setTimeout((()=>{this.onFail(new Error("Component load timed out."))}),this.props.lazyTimeout)),this.componentCancellablePromise.promise.then((e=>{i.Component=e,this.setState({Component:e})})).catch((e=>{e&&e.isCancelled||this.onFail(e),window.clearTimeout(t)}))}}componentWillUnmount(){this.componentCancellablePromise&&this.componentCancellablePromise.cancel()}render(){const{Component:e,failed:t}=this.state;return e?o.createElement(e,Object.assign({},this.props)):t&&this.props.lazyFallbackComponent?this.props.lazyFallbackComponent():this.props.intermediateRenderComponent?this.props.intermediateRenderComponent(this.props):null}}return i.Component=null,i.setComponent=t,i}},93884:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var o=n(90872),r=n(90241);class i extends o.Component{constructor(){super(...arguments),this.onClick=e=>{const{link:t}=this.props;return this.props.onClick&&this.props.onClick(e,t),(0,r.onNavBarLinkClicked)(e,t)}}render(){const{link:e,className:t}=this.props;return o.createElement("a",{role:"link",href:e.Url,id:e.Id,tabIndex:0,target:e.TargetWindow||"_top",onClick:this.onClick,onKeyDown:this.props.onKeyDown,title:e.Title,"aria-label":e.Title||e.Text,className:t},e.Text)}componentDidMount(){this.props.shouldFocus&&window.setTimeout((()=>{let e=document.getElementById(this.props.link.Id);e&&e.focus()}),150)}}},83694:function(e,t,n){"use strict";n.d(t,{z:function(){return d}});var o=n(90872),r=n(9028),i=n(1742),a=n(18435),s=n(16968),c=n(22461),l=n(36649),u=n(17628);class d extends o.Component{constructor(e){super(e),this.setRootRef=e=>this.root=e,this.handleKeydown=e=>{let t=!1;switch(e.keyCode){case 9:this.props.skipTabFocus?t=!0:this.handleKey(e,e.shiftKey);break;case 27:t=!0;break;case 38:t=e.altKey,this.props.isArrowUpDownFocus&&this.handleKey(e,!0);break;case 40:this.props.isArrowUpDownFocus&&this.handleKey(e,!1)}t&&(e.stopPropagation(),e.preventDefault(),this.hidePopup(e),this.props.target instanceof HTMLElement&&!this.props.shouldFocusPreviouslyFocusedElement&&!this.props.elementToFocusOnClose&&this.props.target.focus())},this.handleBodyClick=e=>{if(null!==this.props.onDismiss&&!(this.root===document.activeElement||this.root.contains(document.activeElement)||this.root.contains(e.target)||(0,l.I)(this.root,e.target,!0)||this.props.skipDismissForElement&&this.props.skipDismissForElement===document.activeElement))try{"click"===e.type&&e instanceof PointerEvent&&"mouse"!==e.pointerType&&!("click"===e.type&&e instanceof PointerEvent&&"touch"===e.pointerType)||this.props.onDismiss(e)}catch(t){this.props.onDismiss(e)}},this.state={inlineStyle:{}}}componentDidMount(){this.setInlineStyles(),this.props.isPersistant||this.onOpened()}componentDidUpdate(){if(this.props.isPersistant){if(void 0===this.props.isVisible)return;this.props.isVisible?this.onOpened():this.onClosed()}}componentWillUnmount(){this.props.isPersistant||this.onClosed()}onOpened(){this.root?(this.root.addEventListener(a.B.KEYDOWN,this.handleKeydown),null!==this.props.onDismiss&&(document.body.addEventListener(a.B.CLICK,this.handleBodyClick),document.body.addEventListener(a.B.CONTEXTMENU,this.handleBodyClick)),(0,s.NP)().invoke("ContextMenuPopup",!0,this.props.id),this.props.noFocusOnRender||this.root.focus(),null!=this.props.onDisplay&&this.props.onDisplay()):(0,s.tZ)().tag("Popup_OnOpened_NoRootFound",4,this.props.id,this.props.isVisible)}onClosed(){this.root?(this.root.removeEventListener(a.B.KEYDOWN,this.handleKeydown),null!==this.props.onDismiss&&(document.body.removeEventListener(a.B.CLICK,this.handleBodyClick),document.body.removeEventListener(a.B.CONTEXTMENU,this.handleBodyClick)),(0,s.NP)().invoke("ContextMenuPopup",!1,this.props.id)):(0,s.tZ)().tag("Popup_OnClosed_NoRootFound",4,this.props.id,this.props.isVisible)}setInlineStyles(){if(!this.root)return;let e={},t=!1;if(!this.props.popupPosition&&this.props.target instanceof Element){const n={top:0,bottom:window.innerHeight,left:0,right:window.innerWidth},o=this.props.target.getBoundingClientRect();t=!this.props.skipAdjustPostion&&o.bottom+this.root.clientHeight>n.bottom&&o.top-this.root.clientHeight>n.top,e=this.props.isRtl?{right:o.right-this.root.clientWidth<n.left&&o.left+this.root.clientWidth<n.right?n.right-(o.left+this.root.clientWidth):n.right-o.right,top:t?o.top-this.root.clientHeight:o.top+o.height}:{left:o.left+this.root.clientWidth>n.right&&o.right-this.root.clientWidth>n.left?o.right-this.root.clientWidth:o.left,top:t?o.top-this.root.clientHeight:o.top+o.height},r.createPortal&&(e.position="fixed"),e=Object.assign(Object.assign({},e),this.props.style),this.setState({inlineStyle:e})}if(!this.props.skipAdjustPostion){const n=40,o={top:0,bottom:window.innerHeight};if(this.props.popupPosition&&this.props.popupPosition.top)this.root.style.maxHeight=o.bottom-this.props.popupPosition.top-n+"px";else if(e&&e.top&&!t){const t=this.props.target.getBoundingClientRect(),r=this.props.style&&this.props.style.top?parseFloat(e.top):e.top,i=o.bottom-r-n,a=t.top-o.top;i<n&&a>i?(e.maxHeight=a,e.top=0):e.maxHeight=i,this.setState({inlineStyle:e})}}}render(){const{id:e,role:t,className:n,ariaLabel:a,ariaLabelledBy:s,ariaDescribedBy:l,renderHost:d,popupPosition:p}=this.props;let f={};p&&(f={left:p.left,right:p.right,top:p.top,bottom:p.bottom},r.createPortal&&(f.position="fixed"),f=Object.assign(Object.assign({},f),this.props.style));const h=o.createElement("div",{id:e,ref:this.setRootRef,tabIndex:0,className:(0,c.A)(i.WB,n||u.popup,{[u.react15Css]:!r.createPortal}),role:t,"aria-label":a,"aria-labelledby":s,"aria-describedby":l,style:p?f:this.state.inlineStyle,onAnimationEnd:this.props.onAnimationEnd},this.props.children);return r.createPortal?o.createElement("div",null,r.createPortal(h,d||document.body)):h}handleKey(e,t){let n,o=-1;const r=document.activeElement;if(this.props.focusTrapSelector){const e=this.root.querySelectorAll(this.props.focusTrapSelector),i=Array.prototype.slice.call(e);t?r===this.root||r===i[0]?n=i[i.length-1]:this.props.isArrowUpDownFocus&&(o=i.indexOf(r),n=i[o-1]):r===i[i.length-1]?n=i[0]:this.props.isArrowUpDownFocus&&(o=i.indexOf(r),n=i[o+1])}n&&(n.focus(),e.stopPropagation(),e.preventDefault())}hidePopup(e){null!=this.props.onDismiss&&this.props.onDismiss(e),e.preventDefault(),e.stopPropagation()}}},36649:function(e,t,n){"use strict";function o(e,t){let n=e,o=t;n.virtual||(n.virtual={children:[]});let r=n.virtual.parent;if(r&&r!==t){let e=r.virtual.children.indexOf(n);e>-1&&r.virtual.children.splice(e,1)}n.virtual.parent=o||void 0,o&&(o.virtual||(o.virtual={children:[]}),o.virtual.children.push(n))}function r(e,t,n){if(e&&t)if(n)for(;t;){let n=i(t);if(n===e)return!0;t=n}else if(e.contains)return e.contains(t);return!1}function i(e,t=!0){return e&&(t&&function(e){let t;var n;return e&&(n=e)&&n.virtual&&(t=e.virtual.parent),t}(e)||e.parentNode&&e.parentNode)}n.d(t,{I:function(){return r},g:function(){return o}})},46340:function(e,t,n){"use strict";n.d(t,{r:function(){return a}});var o=n(90872),r=n(22461),i=n(65874);class a extends o.PureComponent{constructor(e){super(e)}render(){let{fontSize:e,fontIconCss:t,className:n,fontFamily:a,fontValue:s}=this.props;const c={display:"inline-block"};return e&&(c.fontSize=e+"px"),t?n=(0,r.A)(t,n):a&&s&&(c.fontFamily=a),o.createElement("div",{className:"o365cs-base","aria-hidden":this.props.isAriaHidden},o.createElement("span",{className:(0,r.A)(n,{[i.iconFontRTL]:this.props.reverseIconInRtl}),style:c,role:"presentation"},s))}}},43246:function(e,t,n){"use strict";n.d(t,{r:function(){return o.r}});var o=n(46340)},95144:function(e,t,n){"use strict";n.d(t,{bS:function(){return C.bS},tz:function(){return r.t},kt:function(){return i.k},Bx:function(){return o.B},rP:function(){return s.r},z6:function(){return a.z},zD:function(){return c.z},l5:function(){return C.l5},zM:function(){return C.zM},qz:function(){return h},BE:function(){return C.BE},QR:function(){return C.QR},ui:function(){return C.ui},xw:function(){return v},B3:function(){return H},lQ:function(){return M.lQ},wk:function(){return B.wk},Rz:function(){return k},P3:function(){return P},AH:function(){return T.A},Fg:function(){return A.Fg},Wq:function(){return B.Wq},Oi:function(){return E},nQ:function(){return L},Jg:function(){return O},mD:function(){return F.mD},K$:function(){return D},_R:function(){return y},JT:function(){return g.JT},OU:function(){return I.O},YZ:function(){return g.YZ},vQ:function(){return g.vQ},BW:function(){return x},X7:function(){return w},Wg:function(){return M.Wg},lN:function(){return M.lN},j$:function(){return M.j$},h5:function(){return S.h},x_:function(){return N},qd:function(){return A.qd},ad:function(){return A.ad}});var o=n(18435),r=n(39038),i=n(79649),a=(n(10806),n(93884)),s=n(46340),c=n(83694),l=n(90872),u=n(61304),d=n(40141),p=n(49152),f=n(31556);class h extends l.Component{constructor(e){super(e),this.setRef=e=>this.searchControl=e,this.SearchBarKey=e=>{let t=e.currentTarget.value;this.setState((()=>({currentSearchText:t,showDismissButton:!0}))),this.props.onSearch(t)},this.DismissDefaultText=()=>{this.state.clearTextOnFocus?this.setState((()=>({currentSearchText:"",showDismissButton:!1}))):this.setState((()=>({showDismissButton:!0,clearTextOnFocus:!0})))},this.DefaultSearchText=()=>{""===this.state.currentSearchText?this.setState((()=>({currentSearchText:this.props.defaultText,showDismissButton:!1}))):this.setState((()=>({clearTextOnFocus:!1})))},this.ButtonClearText=()=>{this.searchControl.focus(),this.searchControl.placeholder="",this.setState((()=>({currentSearchText:"",showDismissButton:!1}))),this.props.onSearch("")},this.moveCursor=()=>{this.searchControl.focus()},this.props.currentSearchText?this.state={currentSearchText:this.props.currentSearchText,showDismissButton:!0,clearTextOnFocus:!1}:this.state={currentSearchText:this.props.defaultText,showDismissButton:!1,clearTextOnFocus:!0}}getSearchResultAriaLabel(){return(0,g.vQ)(this.state.currentSearchText)?"":(0,g.JT)(u.D.SearchBoxResultAriaLabel,`${this.props.searchResultCount}`)}render(){let e=(0,d.e)(),t=(0,p.g)();return l.createElement("div",{className:(0,T.A)(f.SearchControl,t?f.SearchControlZoomMargin:null,e.neutral.foregroundAlt.background)},l.createElement("div",{"aria-live":"polite",style:{position:"absolute",left:"-999em",top:"0em"}},this.getSearchResultAriaLabel()),this.state.showDismissButton?l.createElement("button",{onClick:this.ButtonClearText,"aria-label":u.D.SearchBoxClearButtonText,title:u.D.SearchBoxClearButtonText},l.createElement(s.r,{className:e.neutral.dark.font,fontIconCss:"ms-Icon--ChromeClose",fontSize:"12"})):l.createElement("button",{onClick:this.moveCursor,tabIndex:-1,"aria-hidden":!0},l.createElement(s.r,{className:e.neutral.dark.font,fontIconCss:"ms-Icon--Search",fontSize:"12"})),l.createElement("input",{className:(0,T.A)(f.inputBox,e.neutral.dark.font),type:"text",onFocus:this.DismissDefaultText,value:this.state.currentSearchText,onChange:this.SearchBarKey,onBlur:this.DefaultSearchText,ref:this.setRef,placeholder:this.props.defaultText,id:"appLauncherSearch",autoComplete:"off","aria-label":this.props.ariaLabel||this.props.defaultText}))}}var m=n(16968),g=n(87948),b=n(12424);class v extends l.Component{render(){var e,t,n,o,r;let i=(0,d.e)();if(null!=this.props.unseenItemCount&&0!==this.props.unseenItemCount){const a=null!==(e=this.props.badgeCharacter)&&void 0!==e?e:(0,g.d1)(this.props.unseenItemCount);let s=(0,T.A)(b.unseenCount,i.accent.border,{[i.badge]:!this.props.isParentHovered},{[b.emptyBadge]:""===this.props.badgeCharacter},{[b.emptyBadgeDarkMode]:""===this.props.badgeCharacter&&this.props.isDarkMode}),c={};return(null===(t=this.props.badgeColors)||void 0===t?void 0:t.badgeColor)&&(c.backgroundColor=this.props.badgeColors.badgeColor),(null===(n=this.props.badgeColors)||void 0===n?void 0:n.badgeFontColor)&&(c.color=this.props.badgeColors.badgeFontColor),this.props.isParentHovered&&(c.boxSizing="border-box",c.border="1px solid",(null===(o=this.props.badgeColors)||void 0===o?void 0:o.badgeHoverColor)?c.backgroundColor=this.props.badgeColors.badgeHoverColor:c.backgroundColor=(0,m.Vz)().getThemeData().AccentHover||"white",(null===(r=this.props.badgeColors)||void 0===r?void 0:r.badgeFontHoverColor)?c.color=this.props.badgeColors.badgeFontHoverColor:c.color="#106EBE"),l.createElement("div",{className:(0,T.A)(b.unseenitems,this.props.badgeStyles)},l.createElement("span",{style:c,className:s},a,this.props.children))}return null}}var y=n(31689),x=n(28942),A=n(93814),C=n(7102),S=n(25793);let w={notificationsEnabled:!1,toastsMuted:!1,bellHeaderButtonInLayout:!0,isSubscriptionReady:!1,systemNotificationsDisabled:!0,notifications:[]};n(84862);let k={timestamp:null,appsUpdateTimeSpan:null,appDataCache:null,moreAppDataAvailable:null,doNotCallGetAllAppsUntil:null,ShowConditionalAccessError:null};const P={isChatAPIInitialized:null,isChatRecentsPaneInitialized:!1,isChatAPIPreAuthCompleted:!1,unreadBadgeValue:0,chatEnabled:!1,chatWebLink:null,webChatSDKUrl:null,isTeamsChatActivated:!1,isTeamsChatAuthFailed:!1,chatButtonRenderedCallback:null,isConsumerShell:!1};let O={activeButtonId:"",customFlexPanes:{},customFlexPaneHash:void 0,customHeaderButtonFlexPaneTriggers:{},customHeaderButtons:[],badgeValues:{},badgeColors:{},badgeLabels:{},badgeCharacters:{},customFlexpaneWidth:void 0};n(82366),n(6062);var I=n(82453);n(31418);function D(e,t,n=0){let o=-1;for(let r=n;r<e.length;r++)if(t(e[r])){o=r;break}return o}var T=n(22461),E=n(90241),L=n(87894),M=n(33680),F=n(94361);function N(e,t,n=","){return e=e?e.toLowerCase().trim():"",(t?t.toLowerCase().split(n):[]).some((t=>t.trim()===e))}var B=n(50286),H=n(94190)},93814:function(e,t,n){"use strict";n.d(t,{Fg:function(){return p},Rm:function(){return u},UD:function(){return g},Zd:function(){return l},ad:function(){return c},mA:function(){return f},qd:function(){return d},rl:function(){return s},rv:function(){return h},vx:function(){return i},wZ:function(){return a},zh:function(){return m}});var o=n(16968),r=n(7102);function i(e,t,n){return{type:r.l5,navBarData:e,shellClientData:t,renderSettings:n}}function a(e){return{type:r.uU,shellStrings:e}}function s(e){return{type:r.zM,shellLayout:e}}function c(e){return(t,n,i)=>{t({type:r.QR,buttonId:e}),(0,o.NP)().invoke("ShellInteraction")}}function l(e,t){return{type:r.nv,appsData:e,appDataSource:t}}function u(e,t,n){return{type:r.c5,collectorId:e,id:t,imageDataUrl:n}}function d(e){return{type:r.BE,themeData:e}}function p(e){return{type:r.bS,themeInfo:e}}function f(e,t){return{type:r.j4,customFlexpane:e,customFlexpaneWidth:t}}function h(e){return{type:r.GY,customFlexpaneID:e}}function m(e){return{type:r.pL,m365CopilotBannerData:e}}function g(e){return{type:r.nJ,isCopilotBannerClicked:e}}},7102:function(e,t,n){"use strict";n.d(t,{BE:function(){return h},GY:function(){return c},QR:function(){return d},ZH:function(){return i},bS:function(){return m},c5:function(){return f},j4:function(){return s},l5:function(){return o},nJ:function(){return u},nv:function(){return p},pL:function(){return l},uU:function(){return a},ui:function(){return g},zM:function(){return r}});const o="suiteux-common.SHELL_INITDATA_CHANGED",r="suiteux-common.SHELL_LAYOUT_CHANGED",i="suiteux-common.RENDERSETTINGS_CHANGED",a="suiteux-common.SHELL_STRINGS_LOADED",s="suiteux-common.SHELL_FLEXPANES_CHANGED",c="suiteux-common.SHELL_FLEXPANE_REMOVE",l="suiteux-common.SET_M365COPILOT_BANNER_DATA",u="suiteux-common.SET_COPILOT_BANNER_CLICKED",d="suiteux-common.TOGGLE_ACTIVE_HEADERBUTTON",p="suiteux-common.SET_APPS_DATA",f="suiteux-common.SET_IMAGE_DATA_URL",h="suiteux-settings.THEMEDATA_CHANGED",m="suiteux-common.CURRENT_THEME_CHANGED",g="suiteux-common.UPDATE_IS_CHAT_RECENTS_OPEN"},25793:function(e,t,n){"use strict";n.d(t,{h:function(){return m}});var o=n(79627),r=n(87948),i=n(7102);let a={apps:[],imageDataUrls:{},source:0,m365CopilotBannerData:null,isCopilotBannerClicked:!1};function s(e,t){if(!e){let n=t.shellInitData.shellInitDataState;e=c(a,n.navBarData,n.clientData)}switch(t.type){case i.l5:let n=t;return c(e,n.navBarData,n.shellClientData);case i.nv:return function(e,t){let n=[...t.appsData];return Object.assign(Object.assign({},e),{apps:n,hash:(0,r.YZ)(JSON.stringify(n)),source:t.appDataSource})}(e,t);case i.c5:return function(e,t){let n=Object.assign({},e.imageDataUrls);return n[o.qH(t.collectorId,t.id)]=t.imageDataUrl,Object.assign(Object.assign({},e),{imageDataUrls:n})}(e,t);case i.pL:return function(e,t){return Object.assign(Object.assign({},e),{m365CopilotBannerData:t.m365CopilotBannerData})}(e,t);case i.nJ:return function(e,t){return Object.assign(Object.assign({},e),{isCopilotBannerClicked:t.isCopilotBannerClicked})}(e,t);default:return e}}function c(e,t,n){if(0!==e.source&&5!==e.source&&4!==e.source)return e;let i=o.kx(t,n);return Object.assign(Object.assign({},e),{apps:i,hash:(0,r.YZ)(JSON.stringify(i)),source:n&&n.MoreAppDataAvailable?5:4})}var l=n(94361);function u(e={},t){switch(t.type){case i.ZH:let n=t;return Object.assign(Object.assign({},e),{renderSettings:n.renderSettings});case i.l5:let o=t;return Object.assign(Object.assign({},e),{navBarData:o.navBarData,clientData:o.shellClientData});case i.zM:let r=t;return r.shellLayout&&r.shellLayout.centerCustomizationRegion&&d(r.shellLayout.centerCustomizationRegion,0),Object.assign(Object.assign({},e),{layout:r.shellLayout});default:return e}}function d(e,t){if((0,l.A6)(e)){e.regionID=e.regionID||`Region_${t}`,t++;for(let n of e.children)t=d(n,t)}else e.id=e.id||`Control_${t}`,t++;return t}var p=n(1742);function f(e,t){return e||(e={ThemeId:p.ux}),t.type===i.bS?function(e,t){const n=t.themeInfo||{};return n.DarkAccent=null!=n.DarkAccent&&""!==n.DarkAccent?n.DarkAccent:null,Object.assign(Object.assign({},e),n)}(e||{},t):e}function h(e={},t){if(t.type===i.l5){let n=t;return function(e,t,n){return Object.assign(Object.assign({},e),{cultureName:t.CultureName,isConsumer:n.IsConsumerShell,notManagedEmailAddress:n.NotManagedEmailAddress,truncatedUserDisplayName:t.TruncatedUserDisplayName,upn:n.UPN,userDisplayName:t.UserDisplayName,firstName:t.FirstName,lastName:t.LastName,isRtl:n.IsRTL,hasMailboxInCloud:n.HasMailboxInCloud,lcid:n.LCID,puid:n.PUID,tid:n.TID,uid:n.UID,emailAddress:n.EmailAddress})}(e,n.navBarData,n.shellClientData)}return e}let m=new class{constructor(){this.shellReducers={shellInitDataState:u,userState:h,appsDataState:s,themeState:f},this.reducerUpdatedCallback=null}register(e){Object.keys(e).forEach((t=>{this.shellReducers[t]=e[t]})),this.reducerUpdatedCallback&&this.reducerUpdatedCallback(this.getReducers())}getReducers(){return this.shellReducers}}},84862:function(e,t,n){"use strict";n.d(t,{P:function(){return o}});const o={isHidden:!1,isInitialized:!1,openedByTouchOrKeyPress:null,openedTime:null,coreAndSegmentAppTiles:[],isCustomizable:!1,showAllView:!1,hamburgerEnabled:!1,showM365Experience:!1,isStandalone:!1,isNTP:!1}},82366:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});let o={isOpen:!1,activeProviderKey:null,activeProviderWidth:0,activeProviderTrigger:null,registeredProviders:[]}},6062:function(e,t,n){"use strict";n.d(t,{X:function(){return o}});const o={}},82453:function(e,t,n){"use strict";n.d(t,{O:function(){return b}});var o=n(71052);function r(e){return function(t){var n=t.dispatch,o=t.getState;return function(t){return function(r){return"function"==typeof r?r(n,o,e):t(r)}}}}var i=r();i.withExtraArgument=r;var a=i,s=n(16968),c=n(93814),l=n(25793);let u,d={shellInitDataState:{renderSettings:(0,s.GJ)()}},p=null;function f(){p||(p=b());let e=p.getState();e.appsDataState&&e.appsDataState.hash!==u&&(u=e.appsDataState.hash,function(e,t){let n={Apps:e,DataSource:t,FailureReason:0};(0,s.NP)().invoke("AppsRetrievalSucceeded",n)}(e.appsDataState.apps,e.appsDataState.source))}let h=null;const m=new Promise(((e,t)=>{(0,s.NP)().subscribe("SuiteAPILoaded",(t=>{e(t)}),!0)}));function g(e,t){const n=Object.keys(e).filter((t=>"function"==typeof e[t]));return(o={},r)=>{let i=!1;const a=n.reduce(((n,a)=>{if(a in n)throw Error(`Attempt to run reducer for key:${a} more than once. It should only be registered once.`);let s;if(s=void 0===o[a]?e[a](o[a],Object.assign(Object.assign({},r),t)):e[a](o[a],r),void 0===s)throw Error(`Reducer for key ${a} returned an undefined state.`);return n[a]=s,i=i||o[a]!==n[a],n}),{});return i?a:o}}function b(){if(h)return h;const e=g(l.h.getReducers(),{shellInitData:d}),t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,n=t&&t({name:"SuiteUX"})||o.Zz;try{h=(0,o.y$)(e,d,n((0,o.Tw)(a.withExtraArgument(m))))}catch(e){(0,s.tZ)().exception("GetShellStore_CreateStoreFailure",6,e)}const r=(0,s.NP)();return r.subscribe("ShellDataUpdated",((e,t)=>{h.dispatch((0,c.vx)(e,t,(0,s.GJ)()))}),!0),r.subscribe("StringsLoaded",(e=>{h.dispatch((0,c.wZ)(e))}),!0),r.subscribe("ShellLayoutUpdated",(e=>{h.dispatch((0,c.rl)(e))}),!0),h.subscribe(f),l.h.reducerUpdatedCallback=e=>{h.replaceReducer(g(e,{shellInitData:h.getState()}))},h}},31418:function(e,t,n){"use strict";n.d(t,{i:function(){return s}});var o=n(16968),r=n(93814),i=n(82453);const a=e=>{(0,i.O)().dispatch((0,r.Fg)(e))};function s(){(0,o.NP)().subscribe("ThemeChanged",a,!0)}},79627:function(e,t,n){"use strict";n.d(t,{J0:function(){return i},Wb:function(){return a},kx:function(){return r},qH:function(){return u},w:function(){return l}});var o=n(61304);function r(e,t){let n=[];for(let o of function(e){let t=[];e&&(e.WorkloadLinks&&t.push(...e.WorkloadLinks),null!=e.AppsLinks&&t.push(...e.AppsLinks),null!=e.AdminLink&&t.push(e.AdminLink),null!=e.PartnerLink&&t.push(e.PartnerLink));return t}(e)){let r=s(o,e,t);if(t&&t.AppDataCache){let e=i(t.AppDataCache,r.CollectorId,r.Id);e&&(r.AlternateNames=e.AlternateNames,r.DateInstalled=e.DateInstalled)}n.push(r)}return t&&t.AppDataCache&&n.push(...t.AppDataCache.filter((e=>"FirstParty"!==e.CollectorId))),n}function i(e,t,n){if(e)for(let o of e)if(o.CollectorId===t&&o.Id===n)return o;return null}function a(e){return null==e?e:e.filter(((e,t,n)=>{for(let o=0;o<t;o++){let t=n[o];if(t.Id===e.Id&&t.CollectorId===e.CollectorId)return!1}return!0}))}function s(e,t,n,r="FirstParty"){return{CollectorId:r,Id:l(e.Id,"remove"),Title:e.Text,BrandBarText:e.BrandBarText,AriaLabel:e.Title,Publisher:o.D.Microsoft,FontIconCss:e.FontIconCss,BackgroundColor:e.BackgroundColor,LaunchFullUrl:e.Url,IsAutoPinnedDisabled:!c(e,t,n),CustomActions:[{ActionVerb:1},{ActionVerb:2}]}}function c(e,t,n){return null!=t.WorkloadLinks&&t.WorkloadLinks.some((t=>t.Id===e.Id))||null!=t.AdminLink&&t.AdminLink.Id===e.Id||null!=t.PartnerLink&&t.PartnerLink.Id===e.Id}function l(e,t){return"remove"===t&&0===e.indexOf("Shell")?e.substr(5):"add"===t&&-1===e.indexOf("Shell")?"Shell"+e:e}function u(e,t){return`${e}.${t}`}},16968:function(e,t,n){"use strict";function o(){return window.O365ShellContext&&window.O365ShellContext.RenderSettings}function r(){return window.O365ShellContext&&window.O365ShellContext.CallbackManager}function i(){return window.O365ShellContext&&window.O365ShellContext.Logger}function a(){return window.O365ShellContext&&window.O365ShellContext.ChunkLoader}function s(){return window.O365ShellContext&&window.O365ShellContext.ThemeManager}function c(){return window.O365ShellContext&&window.O365ShellContext.LayoutManager}function l(){return window.O365ShellContext&&window.O365ShellContext.BootHeaderState}function u(){return window.O365ShellContext&&window.O365ShellContext.Aria}function d(){return window.O365ShellContext&&window.O365ShellContext.SearchBoxContext}function p(){var e,t;return null!==(t=null===(e=window.O365ShellContext)||void 0===e?void 0:e.IsEcsInitialized)&&void 0!==t&&t}function f(e){window.O365ShellContext&&(window.O365ShellContext.IsEcsInitialized=e)}n.d(t,{GD:function(){return f},GJ:function(){return o},NP:function(){return r},Vz:function(){return s},YF:function(){return c},l3:function(){return a},m5:function(){return u},mf:function(){return p},tZ:function(){return i},vk:function(){return d},vm:function(){return l}})},73637:function(e,t,n){"use strict";function o(e){let t=document.cookie.split(";"),n=null;for(let o=0;o<t.length;o++){const r=t[o],i=r.indexOf("=");if(-1!==i&&r.substring(0,i).trim()===e){n=r.substr(i+1);break}}return n}n.d(t,{R:function(){return o}})},22461:function(e,t,n){"use strict";function o(...e){let t=[];return e.forEach((e=>{if(e)if("string"==typeof e)t.push(e);else{let n=Object.keys(e).filter((t=>!0===e[t]));n.length>0&&t.push(n)}})),t.join(" ")}n.d(t,{A:function(){return o}})},7667:function(e,t,n){"use strict";function o(e){let t;return t="string"==typeof e?0===e.indexOf("/Date(")?new Date(parseInt(e.match(/\d+/g)[0])):new Date(e):"number"==typeof e?new Date(e):new Date(e.getTime()),t}n.d(t,{_:function(){return o}})},90241:function(e,t,n){"use strict";n.r(t),n.d(t,{onNavBarLinkClicked:function(){return r}});var o=n(16968);function r(e,t){const n={Target:t.TargetWindow,Id:t.Id,Text:t.Text,Url:t.Url};return(0,o.NP)().invoke("LinkClick",n),!(null!=t.Action&&!1===t.Action()||n.Cancel)||(e&&e.preventDefault(),!1)}},87894:function(e,t,n){"use strict";function o(e,t){if(null===e)throw new Error(`Error: ${t} is null.`)}function r(e,t){if(void 0===e)throw new Error(`Error: ${t} is undefined.`)}function i(e,t){o(e,t),r(e,t)}function a(e,t){if(i(e,t),0===e.length)throw new Error(`Error: ${t} is an empty string.`)}function s(e,t){if(i(e,t),0===e.length)throw new Error(`Error: ${t} is a null or empty array.`)}n.r(t),n.d(t,{throwOnNull:function(){return o},throwOnNullOrEmpty:function(){return a},throwOnNullOrEmptyArray:function(){return s},throwOnNullOrUndefined:function(){return i},throwOnUndefined:function(){return r}})},33680:function(e,t,n){"use strict";n.d(t,{Fb:function(){return c},Wg:function(){return i},j$:function(){return s},lN:function(){return a},lQ:function(){return r}});var o=n(40141);function r(e,t,n){e=e instanceof Array?e:[e];for(let o of t.split(" "))for(let t of e)t=t instanceof HTMLElement?t:document.getElementById(t),t&&t.addEventListener(o,n)}function i(e,t,n){e=e instanceof Array?e:[e];for(let o of t.split(" "))for(let t of e)t=t instanceof HTMLElement?t:document.getElementById(t),t&&t.removeEventListener(o,n)}function a(e,t){if(e=e instanceof HTMLElement?e:document.getElementById(e)){c(e,(0,o.e)().activeHeaderButton,t)}}function s(e,t){let n=document.getElementById(e);if(n){let e=(0,o.e)();c(n,e.activeHeaderButton,t),c(n,e.headerButton,!t)}}function c(e,t,n){n?function(e,...t){if(e.classList)for(let n of t)e.classList.add(n);else for(let n of t)e.className.split(" ").some((e=>e===n))||(e.className+=" "+n)}(e,t):function(e,...t){if(e.classList)for(let n of t)e.classList.remove(n);else for(let n of t)e.className=e.className.split(" ").filter((e=>e!==n)).join(" ")}(e,t)}},94361:function(e,t,n){"use strict";function o(e,t){let n=null;if(t)for(let i of t){if(r(i))n=o(e,i.children);else{let t=i;t&&t.nativeControlID===e&&(n=t)}if(n)break}return n}function r(e){return e&&void 0!==e.children}n.d(t,{A6:function(){return r},mD:function(){return o}})},88242:function(e,t,n){"use strict";function o(e){let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCancelled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel:()=>{t=!0}}}function r(e,t){return new Promise(((n,o)=>{e().then(n).catch((i=>{0===t?o(i):r(e,--t).then(n).catch(o)}))}))}n.d(t,{L:function(){return r},l:function(){return o}})},21622:function(e,t,n){"use strict";let o,r,i;function a(){const e=c();o=e.selectionStart,r=e.selectionEnd,i=e===document.activeElement}function s(){if(i){const e=c();e.focus(),e.selectionStart=o,e.selectionEnd=r,l()}}function c(){const e=document.getElementById("sbcId");if(e){const t=e.getElementsByTagName("input");if(t.length)return t[0]}return{selectionStart:0,selectionEnd:0,focus:()=>{}}}function l(){o=0,r=0,i=!1}n.d(t,{I7:function(){return a},KW:function(){return c},zi:function(){return s}}),l()},58059:function(e,t,n){"use strict";n.d(t,{b:function(){return a},n:function(){return i}});var o=n(87948);const r=/[0-9a-fA-F]{16}/;function i(e){return null!=e.SHSID}function a(e){if((0,o.vQ)(e))return!1;if(16!==e.length)return!1;if(!e.startsWith("0")&&!e.startsWith("1")&&!e.startsWith("2"))return!1;return!!e.match(r)}},87948:function(e,t,n){"use strict";function o(e,t){let n=e.lastIndexOf(t);return-1!==n&&n===e.length-t.length}function r(e,...t){return e?e.replace(/\{(\d+)\}/g,((e,n)=>void 0===t[n]?e:t[n])):""}function i(e){const t=e.length;let n=5381,o=0;for(;o<t;)n=(n<<5)+n+e.charCodeAt(o++);return n}function a(e){return""===e||null==e}function s(e){return e&&e>0?e<100?e.toString():"99+":null}n.d(t,{JT:function(){return r},YZ:function(){return i},d1:function(){return s},d5:function(){return o},vQ:function(){return a}})},6936:function(e,t,n){"use strict";n.d(t,{Gj:function(){return i},I9:function(){return o},Q:function(){return r}});const o=6e4,r=60*o,i=24*r},50286:function(e,t,n){"use strict";n.d(t,{FY:function(){return a},Wq:function(){return i},wk:function(){return r}});var o=n(16968);function r(e,t,n){let o="?";return e.indexOf(o)>-1&&(o="&"),e+o+t+"="+n}function i(e){if(!e)return"";return encodeURI(e).replace(/#/g,"%23")}function a(e,t){if(null==e)return!0;if((e=(e=e.toLowerCase()).trim()).startsWith("https://")||!0===e.startsWith("http://"))return!0;{let n=e.indexOf("://"),r=null;return-1!==n&&(r=e.substring(0,n)),(0,o.tZ)().tag("Unsafe URL: "+{beforeColonUrl:r},6),!t}}},94190:function(e,t,n){"use strict";function o(){if(null!=navigator&&navigator.userAgent){let e=navigator.userAgent.toLowerCase(),t=navigator.maxTouchPoints||0;return e.indexOf("phone")>=0||e.indexOf("android")>=0||e.indexOf("mobile")>=0||e.indexOf("mowa")>=0||t>0&&e.indexOf("macintosh")>=0}return!1}function r(){return window.navigator.userAgent.indexOf("MSIE ")>0||!!navigator.userAgent.match(/Trident.*rv\:11\./)}function i(){return window.navigator.userAgent.indexOf("Edge")>-1}n.r(t),n.d(t,{isBrowserEdge:function(){return i},isBrowserIE:function(){return r},isMobileClient:function(){return o}})},66164:function(e,t,n){"use strict";function o(e){return"ShellMail"===e||"Exchange"===e}function r(e,t){return t?"shellofficepwa"===t.toLowerCase():"officepwa"===(e&&e.toLowerCase())}function i(e,t,n){let o="Unknown";switch(t?(o=t.replace(/^shell/i,""),"none"===o.toLowerCase()&&(o=e||"")):e&&(o=e),o.toLowerCase()){case"admin":switch(e.toLowerCase()){case"adminportal":o="AdminPortal";break;case"exchange":o="ExchangeAdmin";break;case"forefront":o="ForefrontAdmin";break;case"lync":o="SkypeAdmin";break;case"sharepoint":o="SharePointAdmin";break;case"sissync":o="Homeroom";break;default:o=e}break;case"documents":if("odbadmin"===e.toLowerCase())o="ODBAdmin";break;case"o365settings":if("aadux"===e.toLowerCase())o="AADUXAdmin";break;case"outlook":switch(e.toLowerCase()){case"forefront":o="Forefront";break;default:{let e=n.toLowerCase();o=e.indexOf("path=/option")>=0||e.indexOf("path=%2foption")>=0||e.indexOf("/ecp/")>=0?"OWASettings":e.indexOf("path=/bookings")>=0||e.indexOf("path=%2fbookings")>=0?"Bookings":e.indexOf("path=/calendar")>=0||e.indexOf("path=%2fcalendar")>=0?e.indexOf("path=/?nativeversion")>=0?"Monarch":"Calendar":e.indexOf("path=/group")>=0||e.indexOf("path=%2fgroup")>=0||e.indexOf("path=/people")>=0||e.indexOf("path=%2fpeople")>=0?e.indexOf("path=/?nativeversion")>=0?"Monarch":"People":e.indexOf("path=/tasks")>=0||e.indexOf("path=%2ftasks")>=0?"Tasks":e.indexOf("path=/mail/?nativeversion")>=0||e.indexOf("path=%2fmail/?nativeversion")>=0?"Monarch":e.indexOf("path=/mail")>=0||e.indexOf("path=%2fmail")>=0?"Mail":e.indexOf("modurl=1")>=0?"Calendar":e.indexOf("modurl=2")>=0?"People":e.indexOf("modurl=3")>=0?"Tasks":e.indexOf("modurl=4")>=0?"OWASettings":"Mail";break}}break;case"sites":case"sharepoint":o="SharePoint";break;case"iwapp":case"officedotcom":case"officepwa":case"office":o="officepwa"===o.toLowerCase()||"officepwa"===e.toLowerCase()?"OfficePWA":(o.toLowerCase(),"OfficeDotCom")}return o}n.d(t,{Uc:function(){return o},bi:function(){return r},ic:function(){return i}})},98499:function(e,t,n){"use strict";n.d(t,{l:function(){return f}});var o,r,i,a,s=n(16533);!function(e){e.Int_ClientApps="https://config.edge.skype.net",e.Int_InternalServices="https://s2s.config.skype.net",e.Prod_M365ClientApps="https://ecs.office.com",e.Prod_ConsumerClientApps="https://config.edge.skype.com",e.Prod_TeamsClientApps="https://config.teams.microsoft.com",e.Prod_InternalServices="https://s2s.config.skype.com"}(o||(o={})),function(e){e[e.Valid=0]="Valid",e[e.Invalid=1]="Invalid",e[e.Expired=2]="Expired",e[e.NoData=3]="NoData",e[e.NoCache=4]="NoCache"}(r||(r={})),function(e){e.Filters="Filters",e.None="None",e.ConsumerKey="ConsumerKey"}(i||(i={})),function(e){e.OnExpiry="OnExpiry",e.Never="Never"}(a||(a={}));var c=n(16968);const l="OneShellECSClient";class u{constructor(){this._settled=!1,this.promise=new Promise(((e,t)=>{this.resolve=e}))}createResolvedPromise(e){this.promise=new Promise(((t,n)=>{t(e)}))}set(e){this._settled?this.createResolvedPromise(e):(this._settled=!0,this.resolve(e))}get getPromise(){return this.promise}}class d{constructor(){this.ecsConfig=new u,this.parameters={client:"Oneshell",version:"1.0.0.0",domain:o.Prod_M365ClientApps}}setParameters(e){return(0,s.__awaiter)(this,void 0,void 0,(function*(){this.parameters=e;try{yield this.updateClient(),this.client.startFetchSchedule(window,this.updateEcsConfig.bind(this));const e=this.client.get();if(this.client.cacheState===r.Valid&&e)return void this.updateEcsConfig(e);const t=yield this.client.fetch();this.updateEcsConfig(t)}catch(e){(0,c.tZ)().exception("ECSClient_SetEcsConfig_Failed",6,e)}}))}updateEcsConfig(e){var t;(null===(t=e.ecsConfiguration)||void 0===t?void 0:t.OneShell)?this.ecsConfig.set(e.ecsConfiguration.OneShell):(0,c.tZ)().exception("ECSClient_UpdateEcsConfig_Failed",6,new Error("OneShell config not found in ECS data"))}updateClient(){return(0,s.__awaiter)(this,void 0,void 0,(function*(){if(this.client)return void this.client.updateParameters(this.parameters);const e=(0,c.l3)();if(!e||"function"!=typeof e.loadChunk)throw new Error("Chunk loader is not available to load ecsclient chunk");yield e.loadChunk("ecsclient"),this.client=yield window.createClient(this.parameters)}))}getConfig(e=2e3){const t=new Promise(((t,n)=>{setTimeout((()=>{n(new Error(`ECSClient_GetConfig timedout after ${e}`))}),e)}));return Promise.race([this.ecsConfig.getPromise,t]).then((e=>e)).catch((e=>((0,c.tZ)().exception("ECSClient_GetConfig_Failed",6,e),{})))}}const p=e=>!(!e.EnableClientECSFetch&&!e.IsConsumerShell)||!e.Environment,f=()=>((0,c.mf)()||((0,c.GD)(!0),(()=>{if(!localStorage)return void(0,c.tZ)().exception("ECS_InitECS_Failed",4,new Error("Localstorage is not available"));const e=(t,n)=>{if(p(n)){const{TID:t,UPN:r,IsConsumerShell:i,WorkloadId:a,UID:s}=n,u={client:"Oneshell",version:"1.0.0.0",domain:o.Prod_M365ClientApps,filters:{IsConsumer:i?"true":"false",WorkloadId:a,TenantId:t,UserId:i?r:s,UPN:r}};(0,c.tZ)().tag("ECS_Initialized",1,`Initialized ECS for ${a}`),window[l].setParameters(u),(0,c.NP)().unsubscribe("ShellDataUpdated",e)}};window[l]=new d,(0,c.NP)().subscribe("ShellDataUpdated",e,!0)})()),window[l])},6330:function(e,t,n){"use strict";n.d(t,{q:function(){return i}});var o=n(90872),r=n(22461);class i extends o.Component{constructor(e){super(e)}componentDidMount(){this.OnFlexPaneFocus=()=>{if(null==this.initialFocusElement&&(this.initialFocusElement=document.getElementById("O365fp_firstFocusable")),this.initialFocusElement){let e=this.initialFocusElement;window.setTimeout((()=>e.focus()),100)}},this.props.isActive&&this.onComponentVisible()}componentWillUnmount(){this.props.isActive&&this.onComponentHide()}componentDidUpdate(e,t){this.props.isActive!==e.isActive&&(this.props.isActive?this.onComponentVisible():this.onComponentHide())}render(){return o.createElement("div",{id:`FlexPane_${this.props.flexPaneProviderID}`,className:(0,r.A)(this.props.className),style:{display:this.props.isActive?"":"none"}},this.props.children)}onComponentVisible(){let e=document.getElementById("O365fp_lastFocusable");e&&this.OnFlexPaneFocus&&e.addEventListener("focus",this.OnFlexPaneFocus)}onComponentHide(){let e=document.getElementById("O365fp_lastFocusable");e&&this.OnFlexPaneFocus&&e.removeEventListener("focus",this.OnFlexPaneFocus)}}},8428:function(e,t,n){"use strict";n.d(t,{E:function(){return C},x:function(){return A}});var o=n(57556),r=n(90872),i=n(9028),a=n(40141),s=n(46340),c=n(16968),l=n(22461),u=n(33680),d=n(98499),p=n(99542),f=n(49152),h=n(45557),m=n(1742),g=n(53644),b=n(61304),v=n(13825),y=n(40192),x=n(7818);const A=320;class C extends r.Component{constructor(e){super(e),this.boundListeners={},this.scrollListeners={},this.secondFocussableSkipOnFocusBehavior=!1,this.focusTrapInFlexPane=!1,this.setScrollRegion=e=>{this.flexPaneRegion=e},this.setFocusRegion=e=>{this.flexPaneFocusRegion=e},this.setFirstFocusable=e=>{this.flexPaneFirstFocussable=e},this.setSecondFocusable=e=>{this.flexPaneSecondFocussable=e},this.setFocusSkipperStart=e=>{this.flexPaneFocusSkipperStart=e},this.setFocusSkipperEnd=e=>{this.flexPaneFocusSkipperEnd=e},this.setCloseButton=e=>{this.flexPaneCloseButton=e},this.flexPaneHandleKeydown=e=>{let t=!1;switch(e.keyCode){case 27:t=!0;break;case 38:t=e.altKey}t&&(this.closeFlexPane(e),e.preventDefault())},this.handleKeyClose=e=>{switch(e.keyCode){case 13:case 32:this.closeFlexPane(e),e.preventDefault();break;case 9:if(e.shiftKey)break;if(!0===this.focusTrapInFlexPane&&this.flexPaneFirstFocussable){this.flexPaneFirstFocussable.focus(),e.preventDefault();break}if(!this.props.activeHeaderButtonId||!document.getElementById(this.props.activeHeaderButtonId+"_end")){this.secondFocussableSkipOnFocusBehavior=!0,this.flexPaneSecondFocussable.focus();break}if(this.props.activeHeaderButtonId){let e=document.getElementById(this.props.activeHeaderButtonId);e&&e.focus();break}break;default:return}},this.focusSkipperStartOnKeyDown=e=>{if(9===e.keyCode)if(e.shiftKey){const e=document.getElementById(this.props.activeHeaderButtonId);e&&e.focus()}else{if(!0===this.focusTrapInFlexPane){if(!this.flexPaneCloseButton)return;this.flexPaneCloseButton.focus()}this.flexPaneFocusSkipperEnd.focus()}},this.focusSkipperStartOnFocus=()=>{if(this.focusTrapInFlexPane){const e=document.activeElement;e&&this.flexPaneFocusRegion&&!this.flexPaneFocusRegion.contains(e)&&this.flexPaneFirstFocussable&&this.flexPaneFirstFocussable.focus()}else{if(!this.flexPaneCloseButton)return;this.flexPaneCloseButton.focus()}},this.focusSkipperEndOnKeyDown=e=>{9===e.keyCode&&e.shiftKey&&this.flexPaneFocusSkipperStart.focus()},this.firstFocusableOnFocus=()=>{this.flexPaneSecondFocussable&&(this.secondFocussableSkipOnFocusBehavior=!0,this.flexPaneSecondFocussable.focus()),this.setState({showFocusOutline:!0})},this.secondFocusableOnFocus=()=>{if(this.secondFocussableSkipOnFocusBehavior)this.secondFocussableSkipOnFocusBehavior=!1;else if(this.props.activeHeaderButtonId&&document.getElementById(this.props.activeHeaderButtonId+"_end")){if(this.props.activeHeaderButtonId){let e=document.getElementById(this.props.activeHeaderButtonId);e&&e.focus()}}else this.flexPaneCloseButton.focus()},this.registerScrollListener=(e,t)=>(this.scrollListeners[e]=(this.scrollListeners[e]||[]).concat([t]),this.flexPaneRegion&&this.flexPaneRegion.addEventListener("scroll",t,{passive:!0}),()=>{this.flexPaneRegion&&this.flexPaneRegion.removeEventListener("scroll",t)}),this.closeFlexPane=e=>{var t,n;let o=null;if(this.props.registeredProviders.some((e=>this.props.activeProviderKey===e.key&&(o=e,!0))),o){(0,c.tZ)().click("Close",this.props.activeProviderKey+"Pane",e&&e.currentTarget?e.currentTarget.id:"",null,this.props.activeProviderKey);let r=o.btnId?o.btnId:(0,p.nO)(o.nativeControlID),i=document.getElementById(r)||document.getElementById(g.Hp);"Feedback"===o.key&&(i=null!==(n=null!==(t=document.getElementById(p.cQ))&&void 0!==t?t:document.getElementById(p.Pn))&&void 0!==n?n:document.getElementById(p.a_)),i&&e&&e&&i.focus()}this.props.toggle(null,null),(0,x.f1)()},this.state={isOpenStateTransitioning:!1,showFocusOutline:!1,isShyHeaderActive:!1,isFourHundredPercentZoomed:(0,f.g)()},(0,c.NP)().subscribe("ShyHeaderActivated",(e=>{this.setState({isShyHeaderActive:e})}),!0),(0,c.NP)().subscribe("FlexPane400ZoomActivated",(e=>{this.setState({isFourHundredPercentZoomed:e})}),!0);try{(0,d.l)().getConfig().then((e=>{e&&void 0!==e.FocusTrapInFlexPane&&!0===e.FocusTrapInFlexPane&&(this.focusTrapInFlexPane=!0)}))}catch(e){}}componentWillUnmount(){for(let e of this.props.registeredProviders)(0,u.Wg)(e.btnId,"click keydown",this.boundListeners[e.key]);this.focusBehavior.remove(),this.focusBehavior=null}registerListener(e){e.btnId&&(this.boundListeners[e.key]={handleEvent:t=>{if(!!e.overrideOnClick&&e.overrideOnClick())(0,c.tZ)().click(e.key,e.key+"Pane");else{if("keydown"===t.type){switch(t.which){case 13:case 32:t.preventDefault();break;case 40:break;default:return}this.setState({showFocusOutline:!0})}else this.setState({showFocusOutline:!1});this.props.toggle(e.key,e.btnId)}}},(0,u.lQ)(e.btnId,"click keydown",this.boundListeners[e.key]))}componentWillReceiveProps(e){this.props.isOpen!==e.isOpen&&this.setState({isOpenStateTransitioning:!0},(()=>{setTimeout((()=>{this.setState({isOpenStateTransitioning:!1},(()=>{this.props.isOpen&&this.flexPaneRegion&&this.focusOnFlexPane()}))}),280)}))}componentDidUpdate(e){e.registeredProviders.forEach((e=>{!this.props.registeredProviders.some((t=>t.key===e.key))&&this.boundListeners[e.key]&&(0,u.Wg)(e.btnId,"click keydown",this.boundListeners[e.key])})),this.props.registeredProviders.forEach((t=>{let n=e.registeredProviders.filter((e=>e.key===t.key));if(0===n.length)this.registerListener(t);else{let e=n[0];n.length,t.btnId!==e.btnId&&((0,u.Wg)(e.btnId,"click keydown",this.boundListeners[e.key]),this.registerListener(t))}})),e.registeredProviders.forEach((e=>{this.props.registeredProviders.some((t=>t.key===e.key))||this.unregisterListener(e)}));let t=this.props.activeProviderWidth||A,n=e.activeProviderWidth||A;this.props.isOpen===e.isOpen&&t===n&&this.props.activeProviderKey===e.activeProviderKey||(0,c.NP)().invoke("FlexPaneVisibilityChanged",this.props.isOpen,{width:t,providerId:this.props.activeProviderKey}),this.props.isOpen&&this.props.activeProviderKey!==e.activeProviderKey&&this.onShowNewPane(this.props.activeProviderKey,e.activeProviderKey)}onShowNewPane(e,t){(0,c.tZ)().impression(`${e}Pane`,"FlexPane"),this.flexPaneRegion&&(t&&((this.scrollListeners[t]||[]).forEach((e=>this.flexPaneRegion.removeEventListener("scroll",e))),this.scrollListeners[t]=[]),(this.scrollListeners[e]||[]).forEach((e=>this.flexPaneRegion.addEventListener("scroll",e,{passive:!0}))),this.focusBehavior&&this.focusBehavior.remove(),this.focusBehavior=new h.J(this.flexPaneFocusRegion).attach(),this.focusBehavior.onShowFocusHighlight((()=>this.setState({showFocusOutline:!0}))),this.focusBehavior.onHideFocusHighlight((()=>this.setState({showFocusOutline:!1}))),window.setTimeout((()=>this.focusOnFlexPane()),300)),(0,x.Z_)()}focusOnFlexPane(){null==this.flexPaneFirstFocussable||this.props.activeHeaderButtonId&&""!==this.props.activeHeaderButtonId||this.flexPaneFirstFocussable.focus()}componentDidCatch(e,t){(0,c.tZ)().exception("FlexPaneGenericError",6,e,e.name,e.message,t.componentStack)}render(){let e=null;this.props.registeredProviders.forEach((t=>{const n=t.component;(0,u.lN)(t.btnId,this.props.activeProviderKey===t.key);const o=this.props.activeProviderKey===t.key;let i=(0,l.A)({[y.flexPaneComponent]:o},{[y.itemShow]:o},{[y.itemHide]:!o});o&&(e=r.createElement("div",{key:t.key,className:i},r.createElement(n,{isActive:o,showBackButton:!1,flexPaneProviderID:t.key,closeFlexPane:this.closeFlexPane,registerScrollListener:this.registerScrollListener})))}));const t=this.state.isOpenStateTransitioning&&!this.props.isOpen,n=this.state.isOpenStateTransitioning&&this.props.isOpen,c=this.props.hideFlexPane||!this.state.isOpenStateTransitioning&&!this.props.isOpen;let d=(0,a.e)(),f=(0,l.A)(y.flexPaneOverlay,d.neutral.lighterAlt.background,d.neutral.lightAlt.border,{[y.darkBorder]:this.props.isDarkMode,[y.flexPaneHideRight]:t,[y.flexPaneShowRight]:n,[y.flexPaneHidden]:c}),g=r.createElement("div",{id:p.$t,className:(0,l.A)(m.WB,y.flexPaneOverflowContainer,y.flexPaneHeightForThinHeader,{[y.flexPaneHeightForShyHeader]:this.state.isShyHeaderActive},{[y.flexPaneZoomIFrameHeight]:this.state.isFourHundredPercentZoomed}),role:"region",style:{width:this.props.activeProviderWidth?`${this.props.activeProviderWidth+60}px`:null,display:c?"none":null}},r.createElement("div",{id:"O365fp_focusSkipperStart",tabIndex:0,onKeyDown:this.focusSkipperStartOnKeyDown,onFocus:this.focusSkipperStartOnFocus,ref:this.setFocusSkipperStart,role:"region"}),r.createElement("div",{id:p.Cu,className:f,onKeyDown:this.flexPaneHandleKeydown,style:{width:this.props.activeProviderWidth?`${this.props.activeProviderWidth}px`:null,boxShadow:o.f.depth4},role:"region",ref:this.setFocusRegion},r.createElement("div",{id:"O365fp_firstFocusable",tabIndex:-1,onFocus:this.firstFocusableOnFocus,ref:this.setFirstFocusable,"aria-hidden":!0}),r.createElement("div",{id:"O365fp_secondFocusable",tabIndex:-1,onFocus:this.secondFocusableOnFocus,ref:this.setSecondFocusable,"aria-hidden":!0}),r.createElement("div",{id:"flexPaneScrollRegion",role:"region",className:(0,l.A)(y.flexPaneContainer,y.verticalScrollRegion,v.scrollbar,d.neutral.lighterAlt.background,{[h.J.RemoveFocusOutlineClassName]:!this.state.showFocusOutline}),ref:this.setScrollRegion},e,r.createElement("button",{id:"flexPaneCloseButton",type:"button",role:"button",tabIndex:0,className:(0,l.A)(y.closeButton,d.neutral.light.hover.background,d.neutral.secondary.font),title:b.D.FlexpaneCloseButton,"aria-label":b.D.FlexpaneCloseButton,onClick:this.closeFlexPane,onKeyDown:this.handleKeyClose,ref:this.setCloseButton},r.createElement(s.r,{className:y.closeIcon,fontSize:"12",fontIconCss:"ms-Icon--ChromeClose"}))),r.createElement("div",{id:"O365fp_lastFocusable",tabIndex:0})),r.createElement("div",{id:"O365fp_focusSkipperEnd",tabIndex:0,onKeyDown:this.focusSkipperEndOnKeyDown,ref:this.setFocusSkipperEnd,role:"region"}));return null!=i.createPortal?null!=e||t?r.createElement("div",null,i.createPortal(g,this.props.renderHost||document.body)):null:g}unregisterListener(e){e.btnId&&this.boundListeners[e.key]&&(0,u.Wg)(e.btnId,"click keydown",this.boundListeners[e.key])}}},7818:function(e,t,n){"use strict";n.d(t,{Z_:function(){return d},f1:function(){return p},oB:function(){return u}});var o=n(18435),r=n(99542),i=n(40192);let a,s,c,l;function u(){a=window.matchMedia("(max-width: 320px)"),window.addEventListener(o.B.RESIZE,d),d()}function d(){a.matches&&!s?(c=document.getElementById(r.$t),l=document.getElementById(r.Cu),c&&l&&(c.style.width=i.thinFlexPaneOverflowWidth,l.style.width=i.thinFlexPaneWidth,s=!0)):!a.matches&&s&&(c=document.getElementById(r.$t),l=document.getElementById(r.Cu),c&&l&&(c.style.width=i.flexPaneOverflowWidth,l.style.width=i.flexPaneWidth,s=!1))}function p(){s=!1}},28370:function(e,t,n){"use strict";n.d(t,{qs:function(){return y.q},xk:function(){return d.x},eb:function(){return P},M8:function(){return I},ZM:function(){return p.ZM},IZ:function(){return p.IZ}});var o=n(90872),r=n(9028),i=n(91112),a=n(25793),s=n(82453),c=n(16968),l=n(7818),u=n(93814),d=n(8428),p=n(95422);const f=(0,i.connect)(((e,t)=>{var n,o;return{isOpen:e.flexPaneState.isOpen,isDarkMode:e.themeState.IsDarkMode,activeProviderKey:e.flexPaneState.activeProviderKey,activeProviderWidth:e.flexPaneState.activeProviderWidth,registeredProviders:e.flexPaneState.registeredProviders,activeHeaderButtonId:null!==(o=null===(n=e.extensibilityState)||void 0===n?void 0:n.activeButtonId)&&void 0!==o?o:"",renderHost:t.renderHost,hideFlexPane:e.flexPaneState.hideFlexPane}}),(e=>({toggle:(t,n)=>{e((0,u.ad)(n)),e((0,p.IZ)(t))}})))(d.E);var h=n(82366),m=n(6806);function g(e,t){let n=t.providerKey,o=null!==n&&e.activeProviderKey!==n,r=null;if(o)for(let t of e.registeredProviders)t.key===n&&(r=t);return o&&null==r&&null==e.activeProviderKey?Object.assign(Object.assign({},e),{pendingProviderKey:n}):Object.assign(Object.assign({},e),{isOpen:null!=r,hideFlexPane:r?r.hideFlexPane:e.hideFlexPane,activeProviderKey:r?r.key:null,activeProviderWidth:r?r.width:e.activeProviderWidth,activeProviderTrigger:r&&(r.btnId||r.nativeControlID),pendingProviderKey:r?void 0:e.pendingProviderKey})}let b={flexPaneState:function(e=h.R,t){switch(t.type){case m.w1:return g(e,t);case m.vG:return function(e,t){let n=Object.assign(Object.assign({},e),{registeredProviders:e.registeredProviders.concat(t.newProvider),hideFlexPane:t.newProvider.hideFlexPane});return t.newProvider.key===e.pendingProviderKey?g(n,{providerKey:t.newProvider.key}):n}(e,t);case m.YO:return function(e,t){let n=Object.assign(Object.assign({},e),{registeredProviders:e.registeredProviders.filter((e=>e.key!==t.providerKey)),hideFlexPane:!1});return n}(e,t);default:return e}}};class v{OpenFlexPaneForProvider(e){let t=(0,s.O)(),n=t.getState().flexPaneState;const o=n.registeredProviders.filter((t=>t.key.toLowerCase()===e.toLowerCase()))[0],r=n.activeProviderKey;return!(!o||r!==o.key)||(t.dispatch((0,p.IZ)(e)),null!=o&&t.dispatch((0,u.ad)(o.btnId)),null!=o)}CloseFlexPaneForProvider(e){const t=(0,s.O)().getState().flexPaneState;return!(!t.isOpen||t.activeProviderKey!==e&&null!==e)&&((0,s.O)().dispatch((0,p.IZ)(null)),!0)}OnFlexPaneVisibilityChanged(e){return(0,c.NP)().subscribe("FlexPaneVisibilityChanged",e,!1)}RemoveOnFlexPaneVisibilityChanged(e){(0,c.NP)().unsubscribe("FlexPaneVisibilityChanged",e)}OnFlexPaneZoomChanged(e){return(0,c.NP)().subscribe("FlexPane400ZoomActivated",e,!1)}RemoveOnFlexPaneZoomChanged(e){(0,c.NP)().unsubscribe("FlexPane400ZoomActivated",e)}}var y=n(6330),x=n(40141),A=n(46340),C=n(22461),S=n(87948),w=n(61304),k=n(50791);class P extends y.q{constructor(){super(...arguments),this.FlexpaneBackButton="FlexpaneBackButton"}onComponentVisible(){super.onComponentVisible(),this.customTitleContainer&&this.props.customTitle&&this.props.customTitle(this.customTitleContainer)}componentWillUnmount(){this.customTitleContainer&&r.unmountComponentAtNode(this.customTitleContainer),super.componentWillUnmount()}render(){let e=(0,x.e)(),t=this.props.title?(0,S.JT)(w.D.FlexpaneBackWithTitle,this.props.title.toLowerCase()):w.D.FlexpaneBack;return o.createElement(y.q,{isActive:this.props.isActive,showBackButton:this.props.showBackButton,flexPaneProviderID:this.props.flexPaneProviderID},this.props.showBackButton&&o.createElement("button",{id:this.FlexpaneBackButton,className:k.backButton,title:t,"aria-label":t,tabIndex:0,onClick:this.props.onBackButtonClicked},o.createElement(A.r,{className:(0,C.A)(k.backIcon,e.neutral.accent.font),fontIconCss:"ms-Icon--Back"})),!this.props.hideTitle&&this.renderTitleArea(),o.createElement("div",{className:(0,C.A)(k.flexPaneSidePadding,this.props.className||"")},this.props.children))}renderTitleArea(){let e=(0,x.e)(),t=(0,C.A)(k.itemTitle,e.neutral.dark.font);return this.props.customTitleClassName&&(t=this.props.customTitleClassName),this.props.customTitle?o.createElement("div",{className:t,ref:e=>this.customTitleContainer=e}):o.createElement("h2",{className:(0,C.A)(k.itemTitle,e.neutral.dark.font)},this.props.title)}}let O=!1;function I(){a.h.register(b),function(){let e=new v,t=window.O365Shell.FlexPane;window.O365Shell.FlexPane=e,t.applyCalls(e)}(),function(){let e=(0,s.O)(),t=(0,c.GJ)();if(t){let n=document.getElementById(t.top);if(n){let t=document.createElement("div");t.id="o365cs-flexpane-overlay",n.appendChild(t),r.render(o.createElement(i.Provider,{store:e},o.createElement(f,null)),t)}}}(),O||((0,l.oB)(),O=!0)}},95422:function(e,t,n){"use strict";n.d(t,{IZ:function(){return r},Ig:function(){return a},ZM:function(){return i}});var o=n(6806);function r(e){return{type:o.w1,providerKey:e}}function i(e){return{type:o.vG,newProvider:e}}function a(e){return{type:o.YO,providerKey:e}}},6806:function(e,t,n){"use strict";n.d(t,{YO:function(){return i},vG:function(){return r},w1:function(){return o}});const o="suiteux-flexpane.TOGGLE_FLEX_PANE",r="suiteux-flexpane.REGISTER_FLEX_PANE_PROVIDER",i="suiteux-flexpane.UNREGISTER_FLEX_PANE_PROVIDER"},85348:function(e,t,n){"use strict";n.d(t,{v:function(){return l}});var o=n(90872),r=n(40141),i=n(79649),a=n(22461),s=n(69663),c=n(72720);class l extends o.Component{render(){let e=(0,r.e)();return this.props.isVisible&&!this.props.hideButton&&o.createElement("div",{style:{position:"relative"},role:"presentation",onClick:this.props.onClick,title:this.props.ariaLabel,"aria-label":this.props.ariaLabel,id:`${this.props.controlID}_div`},o.createElement(i.k,{itemId:this.props.controlID,title:this.props.ariaLabel,displayText:this.props.affordanceMenuItemText,className:(0,a.A)(s.affordanceContextMenuItem,e.neutral.foreground.background,e.neutral.dark.font,e.neutral.light.hover.background),customIcon:this.renderIcon(),onclick:this.props.onClick,setClickableElement:this.props.setClickableElement,isAriaHidden:!1,role:"menuitem"},this.props.children))}renderIcon(){const e=this.props.iconData;return(0,c.j)(e)?this.renderJsxIconData(e):this.renderFontIcon(null!=e?e:this.props)}renderJsxIconData(e){const t=e.shouldShellAddAffordanceMenuItemIconPadding,n=e.element,o=(0,a.A)(s.affordanceContextMenuItemIcon),r=this.cloneElement(n,o);return t?r:n}cloneElement(e,t){var n;const r=t+" "+(null!==(n=e.props.className)&&void 0!==n?n:"");return o.cloneElement(e,{className:r})}renderFontIcon(e){let t=e.iconID?`ms-Icon--${e.iconID}`:e.iconCssClass;return t||e.iconFontFamily&&e.iconFontName||(t=s.affordanceContextMenuItemNoIcon),o.createElement("span",{style:{fontFamily:e.iconFontFamily},className:(0,a.A)(t,s.affordanceContextMenuItemIcon),role:"presentation","aria-hidden":"true"},e.iconFontName)}}},72720:function(e,t,n){"use strict";function o(e){return!!e&&"element"in e}n.d(t,{j:function(){return o}})},83496:function(e,t,n){"use strict";n.d(t,{h:function(){return d}});var o=n(90872),r=n(40141),i=n(10806),a=n(43246),s=n(22461),c=n(82871),l=n(2667),u=n(72720);class d extends o.PureComponent{constructor(){super(...arguments),this.buttonReference=null,this.onKeyDown=e=>{40===e.keyCode&&e.altKey&&e.currentTarget.click()},this.onMouseEnter=()=>{this.props.onHoverStateChanged&&this.props.onHoverStateChanged(!0)},this.onMouseLeave=()=>{this.props.onHoverStateChanged&&this.props.onHoverStateChanged(!1)},this.setButtonRef=e=>{this.buttonReference=e,this.props.setClickableElement&&this.props.setClickableElement(e)}}componentDidMount(){this.props.onDimensionsChanged&&this.props.onDimensionsChanged(this.props.isVisible.toString())}componentDidUpdate(e){null!=this.props.hideButton?this.props.onDimensionsChanged&&(e.hideButton&&e.isVisible)!==(this.props.hideButton&&this.props.isVisible)&&this.props.onDimensionsChanged((this.props.isVisible&&this.props.hideButton).toString()):this.props.onDimensionsChanged&&e.isVisible!==this.props.isVisible&&this.props.onDimensionsChanged(this.props.isVisible.toString())}render(){let e=(0,r.e)();return this.props.isNoninteractive?this.props.isVisible&&!this.props.hideButton&&o.createElement(i.e,{controlID:this.props.controlID,isActive:this.props.isActive,controlElement:this.buttonReference},o.createElement("span",{className:(0,s.A)(c.nonInteractiveButton,e.nonInteractiveButton,{[e.activeHeaderButton]:this.props.isActive},{[l.buttonWithTextPadding]:!!this.props.buttonText}),id:this.props.controlID,onClick:null,onKeyDown:this.onKeyDown,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,"aria-label":this.props.onlyUseTitle?void 0:this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,role:"presentation",ref:this.setButtonRef,title:this.props.ariaLabel,"aria-expanded":this.props.isActive},this.renderIcon(),this.props.buttonText&&2===this.props.responsiveStep&&o.createElement("label",{className:(0,s.A)(l.buttonText)},this.props.buttonText),this.props.children)):this.props.isVisible&&!this.props.hideButton&&o.createElement(i.e,{controlID:this.props.controlID,isActive:this.props.isActive,controlElement:this.buttonReference},o.createElement("button",{className:(0,s.A)(c.button,e.headerButton,{[e.activeHeaderButton]:this.props.isActive},{[l.buttonWithTextPadding]:!!this.props.buttonText}),id:this.props.controlID,onClick:this.props.onClick,onKeyDown:this.onKeyDown,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,"aria-label":this.props.onlyUseTitle?void 0:this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,role:"button",type:"button",ref:this.setButtonRef,title:this.props.ariaLabel,"aria-expanded":this.props.isActive,accessKey:this.props.accessKey},this.renderIcon(),this.props.buttonText&&2===this.props.responsiveStep&&o.createElement("label",{className:(0,s.A)(l.buttonText)},this.props.buttonText),this.props.children))}renderIcon(){var e;if((0,u.j)(this.props.iconData))return this.props.iconData.element;{const{iconID:t,iconCssClass:n,iconFontFamily:r,iconFontName:i,iconFontSize:l}=null!==(e=this.props.iconData)&&void 0!==e?e:this.props;return o.createElement(a.r,{fontIconCss:t&&`ms-Icon--${t}`,fontFamily:r,fontValue:i,className:(0,s.A)(n,c.icon),fontSize:l,isAriaHidden:!0})}}}},79028:function(e,t,n){"use strict";n.d(t,{vO:function(){return ie.v},hp:function(){return Z.h},Nv:function(){return ae}});var o=n(90872),r=n(91112),i=n(25793),a=n(82453),s=n(31418),c=n(16968),l=n(21622),u=n(66309),d=n(28569);const p="LazyAffordanceMenu";(0,d.E)(p);var f=n(40141),h=n(43246);const m=()=>o.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 576 265.91",style:{enableBackground:"0 0 576 265.91"},xmlSpace:"preserve"},o.createElement("style",{type:"text/css"},".st0{fill:none;}.st1{fill:currentcolor;}"),o.createElement("g",{id:"Clear_x5F_Space"},o.createElement("rect",{className:"st0",width:"575.99",height:"265.91"})),o.createElement("g",{id:"Logo"},o.createElement("g",null,o.createElement("path",{className:"st1",d:"M109.11,181.29h7.21v26.23h16.35v6.56h-23.56V181.29L109.11,181.29z"}),o.createElement("path",{className:"st1",d:"M152.65,197.78v-0.09c0-9.32,7.35-16.95,17.47-16.95s17.38,7.54,17.38,16.86v0.09\n\t\t\tc0,9.32-7.35,16.95-17.47,16.95S152.65,207.1,152.65,197.78z M179.96,197.78v-0.09c0-5.62-4.12-10.31-9.93-10.31\n\t\t\tc-5.81,0-9.84,4.59-9.84,10.21v0.09c0,5.62,4.12,10.31,9.93,10.31C175.94,207.99,179.96,203.4,179.96,197.78L179.96,197.78z"}),o.createElement("path",{className:"st1",d:"M215.23,200.03v-18.74h7.21v18.55c0,5.34,2.67,8.1,7.07,8.1s7.07-2.67,7.07-7.87v-18.79h7.21v18.5\n\t\t\tc0,9.93-5.58,14.8-14.38,14.8S215.23,209.67,215.23,200.03L215.23,200.03z"}),o.createElement("path",{className:"st1",d:"M276.06,181.29h12.79c10.31,0,17.42,7.07,17.42,16.3v0.09c0,9.23-7.12,16.4-17.42,16.4h-12.79V181.29\n\t\t\tL276.06,181.29z M283.27,187.79v19.77h5.58c5.9,0,9.88-3.98,9.88-9.79v-0.09c0-5.81-3.98-9.88-9.88-9.88L283.27,187.79\n\t\t\tL283.27,187.79z"}),o.createElement("path",{className:"st1",d:"M78.16,207.57h-9.14c-5.9,0-9.88-4.07-9.88-9.88v-0.09c0-5.81,3.98-9.79,9.88-9.79h9.14v-6.51h-9.14\n\t\t\tc-10.31,0-17.42,7.17-17.42,16.4v0.09c0,9.23,7.12,16.3,17.42,16.3h9.14v-6.51V207.57z"})),o.createElement("g",null,o.createElement("path",{className:"st1",d:"M524.16,125.5c0-36.54-53.17-24.95-53.17-45.74c0-8.46,6.09-12.47,14.26-12.18\n\t\t\tc8.91,0.15,14.4,5.49,14.85,12.33h22.87c-1.34-18.71-15.89-29.55-37.13-29.55s-36.54,11.29-36.54,30\n\t\t\tc-0.15,37.57,53.32,24.06,53.32,46.48c0,7.42-5.79,12.62-15.59,12.62s-15.15-5.49-15.74-13.81h-22.28\n\t\t\tc0.3,19.6,16.93,30.89,38.47,30.89C511.09,156.53,524.16,141.83,524.16,125.5"}),o.createElement("polygon",{className:"st1",points:"275.87,51.83 275.87,155.5 330.81,155.5 330.81,139.01 296.66,139.01 296.66,51.83 275.86,51.83\n\t\t\t"}),o.createElement("path",{className:"st1",d:"M260.57,100.92c0-30.23-20.72-50.57-50.02-50.57s-51.32,20.71-51.32,53s21.83,53.19,51.32,53.19\n\t\t\tc25.2,0,41.43-14.37,47.21-32.29h-22.95c-3.92,8.02-11.2,14.37-24.26,14.37c-15.68,0-27.81-10.27-29.3-27.24h78.56\n\t\t\tc0.56-3.54,0.75-6.9,0.75-10.45L260.57,100.92z M181.44,94.2c2.24-16.23,13.81-25.94,28.18-25.94c15.86,0,28.37,10.08,28.74,25.94\n\t\t\tH181.44z"}),o.createElement("path",{className:"st1",d:"M72.62,137.82V69.36h20.45c21.83,0,34.16,12.92,34.16,34.45s-12.33,34.01-34.16,34.01H72.62z M93.81,51.83\n\t\t\tH51.83v103.66h41.98c33.12,0,54.65-20.35,54.65-51.68S126.93,51.83,93.81,51.83"})),o.createElement("path",{className:"st1",d:"M384.71,50.35c-29.26,0-53.16,21.98-53.16,53.01s23.91,53.16,53.16,53.16s53.01-21.98,53.01-53.16\n\t\tS414.27,50.35,384.71,50.35z M384.71,137.96c-18.86,0-31.78-13.52-31.78-34.6s12.92-34.3,31.78-34.3\n\t\tc18.86,0,31.63,13.22,31.63,34.3S403.43,137.96,384.71,137.96z"}))),g=()=>o.createElement("svg",{version:"1.1",id:"Calque_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 784 352",style:{enableBackground:"new 0 0 784 352"},xmlSpace:"preserve"},o.createElement("style",{type:"text/css"},".st0{fill:currentcolor;}"),o.createElement("g",null,o.createElement("g",null,o.createElement("g",null,o.createElement("path",{className:"st0",d:"M338.3,116.1l58.8,0.2c20.7,0.1,34.2,12,34.1,30.2c0,11.5-5.4,20.4-13.9,24.2l0,0.3\n c10.8,3.9,18.2,14.1,18.1,27.9c-0.1,22.4-14.3,34.4-41.3,34.3L338,233L338.3,116.1z M391.6,220c20.4,0.1,29.2-6.4,29.3-21\n c0-14.9-8.3-20.9-28.6-21l-39.7-0.1l-0.1,41.9L391.6,220z M393.8,165.7c15.4,0,22.9-6.1,22.9-18.6c0-11.4-7.8-17.6-22.8-17.6\n l-41.2-0.1l-0.1,36.2L393.8,165.7z"}),o.createElement("path",{className:"st0",d:"M458.5,111.5l13.7,0l-0.4,121.9l-13.7,0L458.5,111.5z"}),o.createElement("path",{className:"st0",d:"M491.3,189.8c0.1-28.4,19.5-47.2,47.2-47.1c26.2,0.1,46,19.4,45.9,46.7l0,5l-79.3-0.3\n c0.1,17.9,14.9,30.3,33.3,30.3c13.9,0,24.9-6.1,32.4-18.8l10.8,7.2c-9.4,15.5-24.4,23.3-43.3,23.2\n C510.1,236.1,491.2,217.8,491.3,189.8z M570.5,183.3c-1.1-16.2-14.9-28.9-32-29c-18.5-0.1-32.1,12.4-33.1,28.8L570.5,183.3z"}),o.createElement("path",{className:"st0",d:"M602.1,198.1l0.2-52.8l13.7,0l-0.2,50.1c-0.1,18.2,10.1,28.9,28.1,29c17.2,0.1,29.6-11.9,29.6-29l0.2-49.9\n l13.7,0l-0.3,88.5l-13.4,0l0-11l-0.3,0c-6.7,8.5-18.4,13.5-32.8,13.4C617.1,236.4,602.1,221.5,602.1,198.1z"}))),o.createElement("g",null,o.createElement("g",null,o.createElement("ellipse",{transform:"matrix(0.9732 -0.2298 0.2298 0.9732 -34.6215 54.6505)",className:"st0",cx:"217.4",cy:"176",rx:"79",ry:"79"}),o.createElement("path",{className:"st0",d:"M97,177c0,27.7,8.9,53.2,24,74l0-148C105.9,123.8,97,149.3,97,177z"})))));var b=n(87948),v=n(99542),y=n(1742),x=n(61304);let A=window.O365ShellContext.ControlRenderer.GetHeaderClassName;class C extends o.PureComponent{constructor(){super(...arguments),this.onAppTitleLinkClick=e=>{(0,c.tZ)().click("O365BrandingLogo","NavBar",null,this.props.appTitleRefId),null!=this.props.appTitleLinkAction&&(this.props.appTitleLinkAction(),e.preventDefault())}}componentDidMount(){if(null!=this.props.controlDimensionsChanged)return this.props.controlDimensionsChanged((0,b.YZ)(JSON.stringify(this.props)).toString())}componentDidUpdate(e){null==this.props.controlDimensionsChanged||e.appTitleText===this.props.appTitleText&&e.brandLogoID===this.props.brandLogoID&&e.showAppBrandIcon===this.props.showAppBrandIcon&&e.appBrandIconUrl===this.props.appBrandIconUrl||this.props.controlDimensionsChanged((0,b.YZ)(JSON.stringify(this.props)).toString())}render(){const e=(0,f.e)(),t=!this.props.shouldDisableGallatin&&/^o365gallatinlogo/.test(this.props.brandLogoID),n=/^o365frlogo/.test(this.props.brandLogoID),r=/^o365delogo/.test(this.props.brandLogoID),i=this.getStyleForElementBetweenComponentAndAppTitle();return o.createElement("div",{className:`${A(y.f7.appTitle)} ${e.appName}`,style:i},t&&this.renderSuiteBrand(),t&&o.createElement("span",{className:A(y.f7.separator)}),n&&this.renderFrLogo(),n&&o.createElement("span",{className:A(y.f7.separator)}),r&&this.renderDeLogo(),r&&o.createElement("span",{className:A(y.f7.separator)}),this.props.showAppBrandIcon&&this.renderAppBrandIcon(),this.renderAppTitle())}getStyleForElementBetweenComponentAndAppTitle(){return this.props.truncateAppTitleOnOverflow?{minWidth:"0"}:{}}renderGallatinLogo(){return o.createElement(h.r,{fontIconCss:"ms-Icon--GallatinLogo",className:A(y.f7.gallatinLogo)})}renderFrLogo(){return o.createElement("a",{href:"https://www.bleucloud.fr/",role:"link",id:"O365_BrandingLogo"},o.createElement(g,null))}renderDeLogo(){return o.createElement("a",{href:"https://www.deloscloud.de/",role:"link",id:"O365_BrandingLogo"},o.createElement(m,null))}renderAppTitleText(){let e,t={};return this.props.truncateAppTitleOnOverflow&&(t={textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},e=this.props.appTitleText),o.createElement("span",{title:e,className:A(y.f7.brandingText),style:t},this.props.appTitleText)}renderAppTitle(){let e=null,t=(0,f.e)(),n=this.props.appTitleLinkUrl?this.props.appTitleLinkUrl:"";return""!==this.props.appTitleText&&(e=this.props.appTitleLinkUrl||this.props.appTitleLinkAction?o.createElement("a",{href:n,role:"link",id:"O365_AppName",style:this.getStyleForElementBetweenComponentAndAppTitle(),"aria-label":this.props.appTitleAriaLabel,onClick:this.onAppTitleLinkClick,className:`${A(y.f7.brandingLink)} ${t.appBrandLink}`},this.renderAppTitleText()):this.renderAppTitleText()),e}renderAppBrandIcon(){let e=null,t=(0,f.e)();return e=this.props.appTitleLinkUrl?o.createElement("div",{className:`${A(y.f7.appBrandIcon)}`},o.createElement("a",{href:this.props.appTitleLinkUrl,role:"link",id:"O365_AppBrandIcon","aria-label":this.props.appTitleAriaLabel,onClick:this.onAppTitleLinkClick,title:x.D.App_Brand_Icon_Title,className:`${A(y.f7.brandingLink)} ${t.appBrandLink}`},this.renderAppBrandIconImage())):o.createElement("div",{className:`${A(y.f7.appBrandIcon)}`},this.renderAppBrandIconImage()),e}renderAppBrandIconImage(){return o.createElement("img",{className:`${A(y.f7.appBrandIcon)}`,id:v.wB,src:this.props.appBrandIconUrl,title:x.D.App_Brand_Icon_Title})}renderSuiteBrand(){const e=(0,c.GJ)();let t=this.props.suiteBrandNavigationUrl;const n=e&&e.m365CopilotRebrandingEnabled?null===x.D||void 0===x.D?void 0:x.D.Microsoft365Copilot:null===x.D||void 0===x.D?void 0:x.D.Microsoft365;let r=this.props.showResellerExperience?x.D.Microsoft:n;return null!=t&&this.props.isAuthenticated?o.createElement("a",{"aria-label":r,href:t,role:"link",id:"O365_BrandingLogo"},o.createElement("span",{className:A(y.f7.brandingText)},r),this.renderGallatinLogo()):o.createElement("div",null,o.createElement("span",{className:A(y.f7.brandingText)},r," "),this.renderGallatinLogo())}}const S="LazySuiteBranding";(0,d.E)(S);var w=n(81578),k=n.n(w);var P=n(22461),O=n(53644);let I=window.O365ShellContext.ControlRenderer.GetHeaderClassName;class D extends o.Component{constructor(e){super(e),this.updateDimensions=()=>{if(null!=this.props.controlDimensionsChanged){const e=Object.assign(Object.assign({},this.props),this.state),t=(0,b.YZ)(JSON.stringify(e)).toString();this.props.controlDimensionsChanged(t)}},this.handleClick=()=>{(0,c.tZ)().click("TenantBranding","NavBar","NavLink","CompanyInternet")},this.onImageLoad=()=>{if(this.tenantLogoImgElement){let e=D.tenantLogoWidths[this.props.tenantLogoImageUrl];null!=e&&this.state.imageWidth!==e?this.setState({imageWidth:e}):(e=this.tenantLogoImgElement.clientWidth,e>0&&this.tenantLogoImgElement.clientWidth!==D.tenantLogoWidths[this.props.tenantLogoImageUrl]&&(D.tenantLogoWidths[this.props.tenantLogoImageUrl]=e,null!=e&&this.state.imageWidth!==e&&this.setState({imageWidth:e})))}},this.setTenantLogoImgElement=e=>{null!=e&&null==this.tenantLogoImgElement&&(this.tenantLogoImgElement=e,this.tenantLogoImgElement.addEventListener("load",this.onImageLoad),window.requestAnimationFrame(this.updateDimensions))},this.state={imageWidth:D.tenantLogoWidths[e.tenantLogoImageUrl]||0}}componentDidMount(){this.updateDimensions()}componentDidUpdate(e,t){e.showTenantBranding===this.props.showTenantBranding&&e.tenantLogoImageUrl===this.props.tenantLogoImageUrl&&t.imageWidth===this.state.imageWidth||this.updateDimensions()}render(){let e=(0,f.e)();const t=!!this.props.tenantLogoImageUrl&&(this.props.tenantLogoImageUrl.indexOf("image/svg+xml")>-1||this.props.tenantLogoImageUrl.indexOf(".svg")>-1),n=this.context,r=(0,O.X3)(n),i=this.props.tenantName?this.props.tenantName:x.D.Tenant_Logo_Title;return this.props.showTenantBranding&&(a=[o.createElement("div",{key:"TenantItem1",className:(0,P.A)(I(y.f7.tenantBranding),e.primary.font)},o.createElement("a",{id:v.RO,className:(0,P.A)(I(y.f7.tenantLogo),{[I(y.f7.tenantLogoSVG)]:t},e.appBrandLink),target:this.props.tenantLogoTargetWindow,title:i,"aria-label":i,href:this.props.tenantLogoNavigationUrl,onClick:this.handleClick},o.createElement("img",{ref:this.setTenantLogoImgElement,id:v.oI,alt:i,title:i,src:this.props.tenantLogoImageUrl,style:{minWidth:r&&null!=this.state.imageWidth?`${this.state.imageWidth}px`:void 0}}))),o.createElement("div",{key:"TenantItem2",className:(0,P.A)(I(y.f7.appTitleLine),e.appName)})],o.version>="16.2"?o.createElement(o.Fragment,null,a):o.createElement("div",null,a));var a}}D.contextTypes={isMeasured:k().bool},D.tenantLogoWidths={};const T="LazyTenantBranding";(0,d.E)(T);var E=n(39038),L=n(79649),M=n(94190),F=n(57530),N=n(49852),B=n(89959),H=n(70238),j=n(71936),U=n(21226),R=n(36558),_=n(98052),Q=n(2667),z=n.n(Q),W=n(69663),Z=n(83496);class K extends o.Component{constructor(e){super(e),this.setContainer=e=>{this.affordanceHeaderButtonContainer=e},this.controlDimensionsChanged=()=>{if(null!=this.affordanceHeaderButtonContainer){let e=this.shouldShowAffordanceMenu().toString();(0,c.NP)().invoke("CenterBufferingRecalc",O.Hp,e,this.affordanceHeaderButtonContainer),(0,c.NP)().invoke("ResizeGroupRecalc",O.Hp,e)}},this.toggleContextMenu=e=>{e.stopPropagation(),e.preventDefault(),(0,c.tZ)().click("Affordance","NavBar",null,null,`affordanceMenuOpen: ${this.state.affordanceMenuOpen}`),this.setState({affordanceMenuOpen:!this.state.affordanceMenuOpen})},this.dismissContextMenu=e=>{if(this.state.affordanceMenuOpen){if(e&&e.target){if(document.getElementById(O.Hp).contains(e.target))return}this.setState({affordanceMenuOpen:!1})}},this.onMouseEnter=()=>{this.isMouseActivated=!0},this.onMouseLeave=()=>{this.isMouseActivated=!1},this.state={affordanceMenuOpen:!1}}componentDidUpdate(e){e.affordanceMenu.length!==this.props.affordanceMenu.length&&0===this.props.affordanceMenu.length&&this.setState({affordanceMenuOpen:!1})}render(){let e=(0,f.e)(),t=(0,M.isMobileClient)();return o.createElement("div",{className:(0,P.A)(z().thinHeaderControlContainer,W.affordanceMenuContainer),onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},o.createElement(Z.h,{controlID:O.Hp,isVisible:this.shouldShowAffordanceMenu(),ariaLabel:x.D.Affordance_Title,onlyUseTitle:!0,iconID:"More",iconFontSize:F.LV.toString(),isActive:this.state.affordanceMenuOpen||this.props.hasActiveFlexPaneButton,isDarkModeEnabled:this.props.isDarkModeEnabled,onClick:this.toggleContextMenu,onDimensionsChanged:this.controlDimensionsChanged}),o.createElement("div",{ref:this.setContainer}),this.shouldShowAffordanceMenu()&&this.state.affordanceMenuOpen&&this.affordanceHeaderButtonContainer&&o.createElement(E.t,{className:(0,P.A)(y.WB,W.affordanceContextMenu),onDismiss:this.dismissContextMenu,isKeyboardNavigation:!this.isMouseActivated,renderHost:this.affordanceHeaderButtonContainer,setFocusOnPreviouslyFocusedElement:!0,ariaLabel:x.D.Affordance_Title,skipTabFocus:!t,popupPosition:this.props.isRtl?{top:48,left:0}:{top:48,right:0}},this.props.affordanceMenu.map((t=>{let n=null;if(this.isCustomAffordanceBehavior(t)){let r=e=>{t.onAffordanceMenuItemClicked(),this.toggleContextMenu(e)},i="function"==typeof t.affordanceMenuItemText?t.affordanceMenuItemText():t.affordanceMenuItemText;n=o.createElement(L.k,{key:t.affordanceMenuItemId,title:i,displayText:i,className:(0,P.A)(W.affordanceContextMenuItem,e.neutral.foreground.background,e.neutral.dark.font,e.neutral.light.hover.background),onclick:r,role:"menuitem",customIcon:o.createElement("span",{className:(0,P.A)(t.affordanceMenuItemIconCss||W.affordanceContextMenuItemNoIcon,W.affordanceContextMenuItemIcon),role:"presentation"})})}else if(this.isNativeAffordanceBehavior(t)){let e=`${(0,v.nO)(t.nativeControlID)}_Affordance`,r={id:e,key:e,isAvailable:!1,renderContext:1,isActive:!1,isDarkModeEnabled:this.props.isDarkModeEnabled,onClick:this.toggleContextMenu,controlDimensionsChanged:null};switch(t.nativeControlID){case"ChatIcon":n=o.createElement(B.e,Object.assign({},r));break;case"NotificationBellIcon":n=o.createElement(N.P,Object.assign({},r));break;case"SettingsIcon":n=o.createElement(U.s,Object.assign({},r));break;case"HelpIcon":n=o.createElement(R.z,Object.assign({},r,{flipHelpIcon:!1}));break;case"FeatureFlags":n=o.createElement(j.r,Object.assign({},r));break;case"MyDay":n=o.createElement(_.M,Object.assign({},r));break;default:(0,c.tZ)().tag("UnknownNativeControlSpecified",6,t.nativeControlID,"AffordanceMenu")}}else{let e=t.customButtonRenderData.id+"_Affordance";n=o.createElement(H.F,Object.assign({id:e,key:e,isAvailable:!0,renderContext:1,isActive:!1,isDarkModeEnabled:this.props.isDarkModeEnabled,onClick:this.toggleContextMenu,controlDimensionsChanged:null},t.customButtonRenderData))}return n}))))}isCustomAffordanceBehavior(e){return e&&void 0!==e.affordanceMenuItemText}isNativeAffordanceBehavior(e){return e&&void 0!==e.nativeControlID}shouldShowAffordanceMenu(){return this.props.affordanceMenu.length>0}}const V=(0,r.connect)(((e,t)=>{let n=!1,o=null;return o=e.headerState.appBrandIconUrl||t.appBrandIconUrl,n=o&&(0,c.Vz)().shouldUseAppBrandIcon(),{brandLogoID:e.headerState.brandLogoID,appTitleText:e.headerState.useCurrentMainLinkForTitle?e.headerState.appTitleText:e.headerState.customAppTitleText,appTitleLinkUrl:e.headerState.useCurrentMainLinkForTitle?e.headerState.appTitleLinkUrl:e.headerState.customAppTitleLinkUrl,appTitleLinkAction:e.headerState.customAppTitleLinkAction,appBrandIconUrl:o,showAppBrandIcon:n,appTitleRefId:t.appTitleRefId,appTitleAriaLabel:e.headerState.appTitleAriaLabel,showResellerExperience:e.headerState.showResellerExperience,suiteBrandNavigationUrl:e.headerState.suiteBrandNavigationUrl,isAuthenticated:e.headerState.isAuthenticated,controlDimensionsChanged:t.controlDimensionsChanged,shouldDisableGallatin:e.headerState.disableGallatinBranding,truncateAppTitleOnOverflow:t.truncateAppTitleOnOverflow}}))(C);var q=n(66164);const G=(0,r.connect)(((e,t)=>({showTenantBranding:(0,c.Vz)().shouldUseTenantBranding(),tenantLogoTargetWindow:(0,q.bi)(e.shellInitDataState.clientData.WorkloadId,e.shellInitDataState.navBarData.CurrentMainLinkElementID)?"_blank":void 0,tenantLogoImageUrl:e.headerState.tenantLogoImageUrl,tenantLogoNavigationUrl:e.headerState.tenantLogoNavigationUrl,tenantName:e.shellInitDataState.navBarData.CompanyDisplayName,controlDimensionsChanged:t.controlDimensionsChanged})))(D),J="suiteux-header-redux.SET_APPLINK_DATA",Y="suiteux-header-redux.SET_TENANTBRANDING_DATA",X="suiteux-header-redux.SET_NAVBARDATA_UNAVAILABLE";var $=n(7102),ee=n(6062),te=n(79627);const ne={headerState:function(e,t){let n=[];if(!e){const o=t.shellInitData;n=o.appsDataState&&o.appsDataState.apps,e=oe(ee.X,n||[],o.shellInitDataState.navBarData,o.shellInitDataState.clientData,o.shellInitDataState.renderSettings)}switch(t.type){case $.l5:const c=t;return oe(e,n,c.navBarData,c.shellClientData,c.renderSettings);case $.nv:const l=t;return e.useCurrentMainLinkForTitle?re(e,l.appsData):e;case J:const u=t;return o=e,r=u.headerAppLinkText,i=u.headerAppLinkUrl,a=u.headerAppLinkUrlAction,s=u.appBrandIconUrl,Object.assign(Object.assign({},o),{useCurrentMainLinkForTitle:null===i&&null===r,customAppTitleText:r,customAppTitleLinkUrl:i,customAppTitleLinkAction:a,appBrandIconUrl:s,appTitleAriaLabel:(0,b.JT)(x.D.GoTo,r)});case Y:const d=t;return function(e,t,n,o){return Object.assign(Object.assign({},e),{tenantBrandingSpecified:null!=t?t:e.tenantBrandingSpecified,tenantLogoImageUrl:n||e.tenantLogoImageUrl,tenantLogoNavigationUrl:o||e.tenantLogoNavigationUrl})}(e,d.showBranding,d.logoUrl,d.logoNavigationUrl);case X:return function(e){return Object.assign(Object.assign({},e),{isNavBarDataUnavailable:!0})}(e);default:return e}var o,r,i,a,s}};function oe(e,t,n,o,r){var i;let a=e;return n&&o&&(a=Object.assign(Object.assign({},e),{flipHelpIcon:n.FlipHelpIcon,brandLogoID:n.LogoIconID,currentMainLinkID:n.CurrentMainLinkElementID,tenantBrandingSpecified:n.HasTenantBranding,tenantLogoNavigationUrl:n.TenantLogoNavigationUrl?n.TenantLogoNavigationUrl.Url:n.LogoNavigationUrl,tenantLogoImageUrl:n.TenantLogoUrl&&n.TenantLogoUrl.Url,appBrandIconUrl:o.AppBrandIconUrl,showResellerExperience:o.IsPartnerResellerPage,suiteBrandNavigationUrl:n.LogoNavigationUrl,isAuthenticated:!o.IsThirdPartyShell&&n.IsAuthenticated,disableGallatinBranding:r.disableGallatinBranding}),o.AppHeaderLinkUrl||o.AppHeaderLinkText||a.customAppTitleLinkUrl||a.customAppTitleText?(a.useCurrentMainLinkForTitle=!1,o.AppHeaderLinkUrl&&(a.customAppTitleLinkUrl=o.AppHeaderLinkUrl),o.AppHeaderLinkText&&(a.customAppTitleText=o.AppHeaderLinkText),o.AppHeaderLinkAction&&(a.customAppTitleLinkAction=o.AppHeaderLinkAction),a.appTitleAriaLabel=(0,b.JT)(x.D.GoTo,null!==(i=a.appTitleText)&&void 0!==i?i:a.customAppTitleText)):(0===t.length&&(t=(0,te.kx)(n,o)),a=re(a,t),a.useCurrentMainLinkForTitle=!0,a.appTitleText&&a.appTitleText!==o.AppHeaderLinkText&&(0,c.NP)().invoke("AppNameChanged",a.appTitleText))),a}function re(e,t){let n=e,o=null;if(e.currentMainLinkID&&t){const n=t.filter((t=>"Shell"+t.Id===e.currentMainLinkID));if(n.length>0){const e=n[0],t=e.BrandBarText||e.Title;o={appTitleLinkUrl:e.LaunchFullUrl,appTitleText:t,appTitleAriaLabel:(0,b.JT)(x.D.GoTo,t)}}}return o&&(n=Object.assign(Object.assign({},e),o)),n}var ie=n(85348);function ae(){if((0,s.i)(),i.h.register(ne),!u.QJ.useLegacyHeader){const e=(0,a.O)();(0,l.I7)(),window.O365ShellContext.ControlRenderer.ConnectResizeGroupToStore((t=>o.createElement(r.Provider,{store:e},t))),(0,l.zi)();const t=(0,c.NP)();t.invoke("LazyComponentLoaded",T,G),t.invoke("LazyComponentLoaded",S,V),t.invoke("LazyComponentLoaded",p,K),t.subscribe("HeaderBrandingDataUpdated",((t,n,o,r)=>{e.dispatch(function(e,t,n,o){return{type:J,headerAppLinkText:e,headerAppLinkUrl:t,headerAppLinkUrlAction:n,appBrandIconUrl:o}}(t,n,o,r))}),!0),t.subscribe("TenantBrandingChanged",(t=>{var n,o,r;e.dispatch((n=t.isLogoVisible,o=t.logoUrl,r=t.logoNavigationUrl,{type:Y,showBranding:n,logoUrl:o,logoNavigationUrl:r}))}),!0),t.subscribe("NavBarDataUnavailable",(()=>{e.dispatch({type:X})}),!0)}}},99542:function(e,t,n){"use strict";n.d(t,{$t:function(){return y},B2:function(){return f},Cu:function(){return x},DP:function(){return b},On:function(){return i},Pn:function(){return S},RO:function(){return u},Xf:function(){return c},Xv:function(){return m},YZ:function(){return g},a_:function(){return C},cQ:function(){return A},dK:function(){return h},hl:function(){return a},nO:function(){return w},oI:function(){return d},rv:function(){return l},wB:function(){return p},yG:function(){return r}});var o=n(16968);const r="O365_NavHeader",i="O365_HeaderRightRegion",a="O365_MainLink_Help",s="O365_MainLink_Day",c="O365_MainLink_Settings",l="O365_SearchBoxContainer",u="O365_MainLink_TenantLogo",d="O365_MainLink_TenantLogoImg",p="O365_MainLink_APPBrandIconImg",f="O365_MainLink_HamburgerButton",h="O365_MainLink_Chat_Container",m="O365_MainLink_Bell",g="O365_MainLink_Chat",b="O365_Feature_Flags",v="O365_DocTitle",y="FlexPane_Overflow_Container",x="O365fpcontainerid",A="feedbackContainer",C="ShellFeedback",S="GiveFeedbackButton";function w(e){switch(e){case"O365Branding":return"O365_SuiteBranding";case"TenantLogo":return u;case"SearchBox":return l;case"HelpIcon":return a;case"SettingsIcon":return c;case"NotificationBellIcon":return m;case"ChatIcon":return g;case"FeatureFlags":return b;case"MyDay":return s;case"DocumentTitle":return v;default:return(0,o.tZ)().tag("UnknownNativeControlSpecified",6,e,"DeriveDomControlID"),null}}},57530:function(e,t,n){"use strict";n.d(t,{Fb:function(){return c},LV:function(){return o},Lu:function(){return s},Ux:function(){return r},YV:function(){return a}});const o=16;function r(e,t,n){let o=i("div",e,t);return n&&o.setAttribute("role",n),o}function i(e,t,n,o){let r=document.createElement(e);return n&&(r.id=n),t&&(r.className=t),o&&r.setAttribute("role",o),r}function a(e,...t){if(e.classList)for(let n of t)e.classList.add(n);else for(let n of t)e.className.split(" ").some((e=>e===n))||(e.className+=" "+n)}function s(e,...t){if(e.classList)for(let n of t)e.classList.remove(n);else for(let n of t)e.className=e.className.split(" ").filter((e=>e!==n)).join(" ")}function c(e,t,n){n?a(e,t):s(e,t)}},84107:function(e,t,n){"use strict";function o(e){return null!=e&&0!==e.length&&e.some((e=>r(e)))}function r(e){return!(null==e||i(e.Id)||i(e.Text)||i(e.Url)&&null==e.Action)}function i(e){return""===e||null==e}n.d(t,{l:function(){return r},v:function(){return o}})},49152:function(e,t,n){"use strict";n.d(t,{C:function(){return r},g:function(){return i}});var o=n(16968);let r=240;function i(){let e=(0,o.GJ)(),t=e&&e.shyHeaderActivationHeight?e.shyHeaderActivationHeight:r;return window.matchMedia(`(max-height: ${t}px)`).matches}},45557:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});var o=n(57530);class r{constructor(e){this.attachedNode=e,this.showFocusHighlight=()=>{(0,o.Lu)(this.attachedNode,r.RemoveFocusOutlineClassName)},this.hideFocusHighlight=()=>{(0,o.YV)(this.attachedNode,r.RemoveFocusOutlineClassName)},this.handleMouseDown=e=>{this.hideFocusHighlight()},this.handleKeyDown=e=>{e instanceof KeyboardEvent&&(9===e.which||40===e.which||38===e.which||37===e.which||39===e.which||117===e.which&&e.ctrlKey)&&this.showFocusHighlight()}}onShowFocusHighlight(e){this.showFocusHighlight=e}onHideFocusHighlight(e){this.hideFocusHighlight=e}attach(){return this.attachedNode.addEventListener("mousedown",this.handleMouseDown),this.attachedNode.addEventListener("keydown",this.handleKeyDown),this}remove(){this.attachedNode.removeEventListener("mousedown",this.handleMouseDown),this.attachedNode.removeEventListener("keydown",this.handleKeyDown)}}r.RemoveFocusOutlineClassName="removeFocusOutline"},5232:function(e,t,n){"use strict";n.d(t,{i1:function(){return s},kT:function(){return r},qg:function(){return i},yd:function(){return c},zA:function(){return a}});var o=n(94190);n(82871),n(66309);const r="O365_MainLink_Me",i="O365_MainLink_MePhoto",a="O365_UniversalMeContainer",s="mectrl_main_trigger",c="mectrl_currentAccount_picture";(0,o.isMobileClient)()},71173:function(e,t,n){"use strict";n.d(t,{ng:function(){return o},oB:function(){return r}});n(82871),n(66309);const o="O365_MainLink_NavMenu",r="O365_MainLink_NavMenu_Responsive"},66309:function(e,t,n){"use strict";var o;n.d(t,{QJ:function(){return r},om:function(){return i}}),function(e){e.CenterRegion="CenterRegion"}(o||(o={}));n(1742),n(45557),n(5232),n(82871);n(71173);let r={appHeaderLinkUrl:"",appHeaderLinkText:"",appHeaderLinkAction:void 0,appBrandIconUrl:"",signInLink:void 0,meDisplayName:"",isMeControlEnabled:!0,userEmail:"",useFullName:!1,isThirdParty:!1,isAuthenticated:!0,useLegacyHeader:!1,showWaffle:!1,searchUXEnabled:!1,vanillaSearchBoxEnabled:!1,SearchBox2Enabled:!1,shouldRenderAppLauncher:!1,roundedCornersSearchBoxEnabled:!1};function i(e,t){return null==e.UserDisplayName?t.NotManagedEmailAddress||t.UPN:e.TruncatedUserDisplayName||e.UserDisplayName||t.UPN}},1742:function(e,t,n){"use strict";var o;n.d(t,{Fx:function(){return c},D5:function(){return i},f7:function(){return o},Mm:function(){return s},ux:function(){return r},$5:function(){return l},WB:function(){return a},I_:function(){return u}}),function(e){e[e.gallatinLogo=0]="gallatinLogo",e[e.brandingText=1]="brandingText",e[e.brandingLink=2]="brandingLink",e[e.appTitle=3]="appTitle",e[e.appBrandIcon=4]="appBrandIcon",e[e.tenantBranding=5]="tenantBranding",e[e.tenantLogo=6]="tenantLogo",e[e.tenantLogoSVG=7]="tenantLogoSVG",e[e.appTitleLine=8]="appTitleLine",e[e.separator=9]="separator"}(o||(o={}));const r="base",i="contrast",a="o365cs-base",s="office",c="basewithofficethemepreferred";var l;function u(e){switch((e||"").toUpperCase()){case"banner":case"SPAN1X5":default:return l.SPAN1X5;case"card":case"SPAN2X3":return l.SPAN2X3}}!function(e){e.SPAN1X5="SPAN1X5",e.SPAN2X3="SPAN2X3"}(l||(l={})),n.nc=window.oneShellUxNonce},45011:function(e,t,n){"use strict";n.d(t,{AL:function(){return i},Gp:function(){return d},J9:function(){return c},Ph:function(){return b},Ru:function(){return u},ZR:function(){return m},eh:function(){return l},i5:function(){return g},zj:function(){return f}});var o=n(71250),r=n(89682);const i=1e3,a=new RegExp("[a-zA-Z0-9_\\-\\.#]+(@|%40|%2540)[a-zA-Z0-9_\\-\\.]+\\.[a-zA-Z]{2,5}","g"),s="email_removed";function c(e,t){if(null==e)return"";if(e===r.Rh)return"Microsoft365";if(e===r.sE)return"AppsModule";let n=e.replace(/^shell/i,"");switch(t&&"FirstParty"!==t&&(n=t+"App_"+n),n.toLowerCase()){case"admin":n="AdminPortal";break;case"iwapp":n="OfficeDotCom"}return n}function l(e,t=""){if(null===e)return"";let n=c(e,t);const o=new RegExp("^([a-zA-Z0-9_]+App)_","g").exec(n);return null!=o&&o.length>1&&(n=o[1]),n}function u(e){return e&&(e=e.replace(a,s)),e}function d(e){return p(e,"?")}function p(e,t){if(e){const n=e.indexOf(t);if(n>=0)return e.substring(0,n)}return e}function f(e){let t="";switch(e){case 0:t="Trace";break;case 1:t="Info";break;case 4:t="Warning";break;case 6:t="Error"}return t}const h=/suiteux\.shell\.(\w+)\.?([\w\d]*)\.(js|css)$/;function m(e){if(!e)return null;const t=e.match(h);return null==t?null:{name:t[1],hash:t[2]}}function g(e,t){if(t)return"DogFood";if(!e)return null;const n=e.toLowerCase();return-1!==n.indexOf("worldwide")?"Production":-1!==n.indexOf("msit")||-1!==n.indexOf("preview")||-1!==n.indexOf("compass")||-1!==n.indexOf("stagedrolloutone")||-1!==n.indexOf("firstrelease")?"Microsoft":-1!==n.indexOf("dogfood")?"DogFood":null}function b(e,t,n){if(t&&t.length>0)return t;if(e){const t=e.toLowerCase();if(-1!==t.indexOf("tbprod"))return o.d.USGOV_DOJ;if(-1!==t.indexOf("pfprod"))return o.d.USGOV_DOD}return n?o.d.EUDB:o.d.PUBLIC}},98981:function(e,t,n){"use strict";n.d(t,{KA:function(){return o},Mq:function(){return a},XC:function(){return i},FY:function(){return r},IJ:function(){return g}});var o,r,i={};n.r(i),n.d(i,{getNewID:function(){return c},getSessionId:function(){return l}});class a{constructor(e,t,n=0,o=0){this.name=e,this.value=t,this.piiKind=n,this.type=o}}!function(e){e[e.Monitoring=0]="Monitoring",e[e.Click=1]="Click",e[e.Impression=2]="Impression",e[e.ServerRequest=3]="ServerRequest",e[e.Performance=4]="Performance",e[e.Timer=5]="Timer",e[e.Resource=6]="Resource"}(o||(o={})),function(e){e[e.TagID=0]="TagID",e[e.Exception=1]="Exception",e[e.Message=2]="Message",e[e.Click=3]="Click",e[e.Impression=4]="Impression",e[e.ServerRequest=5]="ServerRequest",e[e.Performance=6]="Performance",e[e.Timer=7]="Timer",e[e.Resource=8]="Resource"}(r||(r={}));var s=n(73637);function c(){return(new Date).getTime()+"_"+Math.random()}function l(){const e="ShCLSessionID";let t=(0,s.R)(e);return t||(t=c(),document.cookie=`${e}=${t};path=/`),t}var u=n(16533),d=n(16968),p=n(45011);class f{constructor(e,t,n=(new Date).getTime(),o){this.properties=[],this.timestamp=n,this.name=e,this.type=t,this.elementName=o}SetProperty(e,t,n=0,o=0){this.properties.push(new a(e,t,o,n))}SetAdHocProperties(e,t){for(let n=0;n<t.length;n++){let o=t[n],r=0,i=0;o instanceof a&&(o=o.value,r=o.piiKind,i=o.type),this.SetProperty(e+n,"string"==typeof o?(0,p.Ru)(o):o,i,r)}}}const h=!!window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.now;class m{constructor(){this.IsConsumer=!1,this.logServices=[],this.logContext=[],this.logPerformanceMarkers={},this.defaultPerfMarkerTimeout=6e4,this.isPerformanceMarkerWritten=!1,this.performanceTimeoutID=0,this.eventBuffer=[],this.resourceLoaded=(e,t)=>{let n;if(this.isPerformanceMarkerWritten&&null==t){if(!window.performance)return;if(null==t){const t=window.performance.getEntriesByType("resource").filter((e=>null!=(0,p.ZR)(e.name)));let o={};t.forEach((t=>{t.name.indexOf(e)>-1&&(o=t)})),n=`${o.name||e}|${o.encodedBodySize||""}|${Math.round(o.startTime)}|${Math.round(o.duration)}`}}else null!=t&&(n=`${e}|ERROR|${JSON.stringify(t)}|${window.performance.now()}`);if(n){const e=new f(o.Resource,r.Resource);e.SetProperty("ResourceTiming",n),this.writeEvent(e)}},this.writeNavPerfMarker=()=>{this.perfMarker("NavigationAway")},this.writePerfMarkerEvent=()=>(0,u.__awaiter)(this,void 0,void 0,(function*(){if(!this.isPerformanceMarkerWritten){0!==this.performanceTimeoutID&&(window.clearTimeout(this.performanceTimeoutID),this.performanceTimeoutID=0),window.removeEventListener("beforeunload",this.writeNavPerfMarker),this.logPerformanceMarkers.BootStrapperLoadingStarted=this.getPerfMarkerStartTime("shell_bootstrapper_start"),this.logPerformanceMarkers.BootStrapperLoadingComplete=this.getPerfMarkerStartTime("shell_bootstrapper_end"),this.logPerformanceMarkers.HeaderLoadingStarted=this.getPerfMarkerStartTime("shell_header_start"),this.logPerformanceMarkers.HeaderLoadingComplete=this.getPerfMarkerStartTime("shell_header_end"),this.logPerformanceMarkers.LegacyHeaderLoadingStarted=this.getPerfMarkerStartTime("shell_legacyheader_start"),this.logPerformanceMarkers.LegacyHeaderLoadingComplete=this.getPerfMarkerStartTime("shell_legacyheader_end"),this.logPerformanceMarkers.ResponsiveLoadingStarted=this.getPerfMarkerStartTime("shell_responsive_start"),this.logPerformanceMarkers.ResponsiveLoadingComplete=this.getPerfMarkerStartTime("shell_responsive_end"),this.logPerformanceMarkers.shell_string_download_started=this.getPerfMarkerStartTime("shell_string_download_started"),this.logPerformanceMarkers.shell_string_download_ended=this.getPerfMarkerStartTime("shell_string_download_ended"),this.logPerformanceMarkers.SearchLoadingStarted=this.getPerfMarkerStartTime("shell_searchbox_start"),this.logPerformanceMarkers.SearchLoadingComplete=this.getPerfMarkerStartTime("shell_searchbox_end"),this.logPerformanceMarkers.CoreLoadingStarted=this.getPerfMarkerStartTime("shell_core_start"),this.logPerformanceMarkers.CoreLoadingComplete=this.getPerfMarkerStartTime("shell_core_end"),this.logPerformanceMarkers.PlusLoadingStarted=this.getPerfMarkerStartTime("shell_plus_start"),this.logPerformanceMarkers.PlusLoadingComplete=this.getPerfMarkerStartTime("shell_plus_end"),this.logPerformanceMarkers.shell_bootinfo_request_start=this.getPerfMarkerStartTime("shell_bootinfo_request_start"),this.logPerformanceMarkers.shell_bootinfo_request_end=this.getPerfMarkerStartTime("shell_bootinfo_request_end"),this.logPerformanceMarkers.PlusRenderComplete=this.getPerfMarkerStartTime("PlusRenderComplete"),this.logPerformanceMarkers.RenderImplementationStart=this.getPerfMarkerStartTime("RenderImplementationStart"),this.logPerformanceMarkers.RenderAsync=this.getPerfMarkerStartTime("RenderAsync"),this.logPerformanceMarkers.FirstContentfulPaint=this.getPerfMarkerStartTime("FirstContentfulPaint"),this.logPerformanceMarkers.shell_render_headerresizegroup_start=this.getPerfMarkerStartTime("shell_render_headerresizegroup_start"),this.logPerformanceMarkers.shell_render_headerresizegroup_end=this.getPerfMarkerStartTime("shell_render_headerresizegroup_end"),this.logPerformanceMarkers.SearchRenderComplete=this.getPerfMarkerStartTime("SearchRenderComplete"),this.logPerformanceMarkers.SearchFastPathTriggered=this.getPerfMarkerStartTime("SearchFastPathTriggered"),this.logPerformanceMarkers.shell_applauncher_start=this.getPerfMarkerStartTime("shell_applauncher_start"),this.logPerformanceMarkers.shell_applauncher_end=this.getPerfMarkerStartTime("shell_applauncher_end"),this.logPerformanceMarkers.shell_ecs_fetch_start=this.getPerfMarkerStartTime("shell_ecs_fetch_start"),this.logPerformanceMarkers.shell_ecs_fetch_end=this.getPerfMarkerStartTime("shell_ecs_fetch_end"),this.logPerformanceMarkers.shell_m365start_start=this.getPerfMarkerStartTime("shell_m365start_start"),this.logPerformanceMarkers.shell_m365start_end=this.getPerfMarkerStartTime("shell_m365start_end"),this.logPerformanceMarkers.shell_bootstrapper_executioncomplete=this.getPerfMarkerStartTime("shell_bootstrapper_executioncomplete"),this.logPerformanceMarkers.shell_legacyheader_executioncomplete=this.getPerfMarkerStartTime("shell_legacyheader_executioncomplete"),this.logPerformanceMarkers.shell_responsive_executioncomplete=this.getPerfMarkerStartTime("shell_responsive_executioncomplete"),this.logPerformanceMarkers.shell_core_executioncomplete=this.getPerfMarkerStartTime("shell_core_executioncomplete"),this.logPerformanceMarkers.shell_plus_executioncomplete=this.getPerfMarkerStartTime("shell_plus_executioncomplete"),this.getHeaderTTI(),this.isPerformanceMarkerWritten=!0;const e=Object.keys(this.logPerformanceMarkers);if(e.length>0){const t=new f(o.Performance,r.Performance);e.forEach((e=>{"BeginningOfTime"===e?t.SetProperty(e,Math.round(this.logPerformanceMarkers[e])):this.logPerformanceMarkers[e]>0?t.SetProperty(e,Math.round(this.logPerformanceMarkers[e]-this.logPerformanceMarkers.BeginningOfTime)):t.SetProperty(e,Math.round(this.logPerformanceMarkers[e]))}));const n=window.performance?window.performance.getEntriesByType("resource").filter((e=>null!=(0,p.ZR)(e.name))):[];if(n.length){const e=n.map((e=>`${e.name}|${e.encodedBodySize||""}|${Math.round(e.startTime)}|${Math.round(e.duration)}`)).join(";");t.SetProperty("ResourceTiming",e)}this.writeEvent(t)}}}))}init(){this.performanceTimeoutID=window.setTimeout((()=>{this.perfMarker("Timeout")}),this.defaultPerfMarkerTimeout),h&&window.addEventListener("beforeunload",this.writeNavPerfMarker),(0,d.l3)().registerChunkLoadedCallback(this.resourceLoaded)}registerService(e){if(null!=e&&-1===this.logServices.indexOf(e)){this.logContext.forEach((t=>{e.registerContextParam(t.name,t.value,t.piiKind,t.type)})),this.logServices.push(e);const t=this.eventBuffer.length;for(let n=0;n<t;n++)e.writeEvent(this.eventBuffer[n])}}registerContextParam(e,t,n=0,o=0){this.logContext.push(new a(e,t,n,o));for(const r of this.logServices)r.registerContextParam(e,t,n,o)}tag(e,t,...n){this.tagImp((new Date).getTime(),e,t,...n)}tagImp(e,t,n,...i){const a=new f(o.Monitoring,r.TagID,e);a.SetProperty("Monitoring_Name",t.toString()),a.SetProperty("Monitoring_Severity",(0,p.zj)(n)),a.SetAdHocProperties("Monitoring_AdHoc",i),this.writeEvent(a)}exception(e,t,n,...o){this.exceptionImp((new Date).getTime(),e,t,n,...o)}exceptionImp(e,t,n,i,...a){const s=new f(o.Monitoring,r.Exception,e);let c="";i&&(i.name&&(c=i.name),i.message&&(c=""===c?i.message:c+" "+i.message),i.stack&&(c=""===c?i.stack:c+" "+i.stack)),s.SetProperty("Monitoring_Name",t.toString()),s.SetProperty("Monitoring_Severity",(0,p.zj)(n)),s.SetProperty("Monitoring_Exception",(0,p.Ru)(c)),s.SetAdHocProperties("Monitoring_AdHoc",a),this.writeEvent(s)}click(e,t,n=null,o=null,r=null,i=1,a=1){this.clickImp((new Date).getTime(),e,t,n,o,r,i,a)}clickImp(e,t,n,i=null,a=null,s=null,c=1,l=1){const u=new f(o.Click,r.Click,e,t);let d=t;"AppTile"===i&&(d=this.getAppTileLabel(t)),u.SetProperty("Click_Name",t),u.SetProperty("Click_Label",d),u.SetProperty("Click_Area",n),u.SetProperty("Click_Category",i),u.SetProperty("Click_Referral",a),u.SetProperty("Click_Context",(0,p.Ru)(s)),u.SetProperty("Click_ListCount",c,2),u.SetProperty("Click_ListIndex",l,2),this.writeEvent(u)}impression(e,t=null,n=0,o=null,r=null){this.impressionImp((new Date).getTime(),e,t,n,o,r)}impressionImp(e,t,n=null,i=0,a=null,s=null){const c=new f(o.Impression,r.Impression,e,t);c.SetProperty("Impression_Name",t),c.SetProperty("Impression_Category",n),c.SetProperty("Impression_Context",s),c.SetProperty("Impression_ItemCount",i);let l="";null!=a&&a.length>0&&(l=a.join(",")),c.SetProperty("Impression_Inventory",l),this.writeEvent(c)}timer(e,t,...n){this.timerImp((new Date).getTime(),e,t,...n)}timerImp(e,t,n,...i){const a=new f(o.Timer,r.Timer,e);a.SetProperty("Timer_Name",t),a.SetProperty("Timer_Value",Math.round(n)),a.SetAdHocProperties("Timer_AdHoc",i),this.writeEvent(a)}serverRequest(e,t,n,o,r,i=!1,a=-1,s=-1){this.serverRequestImp((new Date).getTime(),e,t,n,o,r,i,a,s)}serverRequestImp(e,t,n,i,a,s,c=!1,l=-1,u=-1){1223===s&&(s=204);const d=new f(o.ServerRequest,r.ServerRequest,e),h=this.parseRequestAction(t,a);d.SetProperty("ServerRequest_Name",t),d.SetProperty("ServerRequest_Method",n),d.SetProperty("ServerRequest_IFrame",i),d.SetProperty("ServerRequest_Url",(0,p.Ru)(a)),d.SetProperty("ServerRequest_Action",h),d.SetProperty("ServerRequest_Status",s),d.SetProperty("ServerRequest_IsTokenGeneratedFromWorkload",c),d.SetProperty("ServerRequest_Latency",Math.round(l)),d.SetProperty("ServerRequest_Size",Math.round(u)),this.writeEvent(d)}perfMarker(e){return(0,u.__awaiter)(this,arguments,void 0,(function*(e,t=-1){if(void 0===this.logPerformanceMarkers[e]&&h){const n=e;-1===t&&window.performance.mark(n),this.logPerformanceMarkers[n]=-1===t?this.getPerfMarkerStartTime(n):t,void 0===this.logPerformanceMarkers.BeginningOfTime&&(this.logPerformanceMarkers.BeginningOfTime=this.getPerfMarkerStartTime("shell_bootstrapper_start")),"FirstContentfulPaint"===e&&-1!==this.getPerfMarkerStartTime("shell_bootstrapper_start")&&-1!==this.getPerfMarkerStartTime("FirstContentfulPaint")&&window.performance.measure("Shell_FCP","shell_bootstrapper_start","FirstContentfulPaint"),"NavigationAway"!==e&&"Timeout"!==e||(yield this.writePerfMarkerEvent())}}))}perfMeasure(e,t,n){try{h&&window.performance.measure(e,t,n)}catch(e){}}getAppTileLabel(e){if(null==e)return"";let t=e;if(0===t.toLowerCase().indexOf("shell"))t=t.substr(5);else{const e=new RegExp("^([a-zA-Z0-9_]+App)_").exec(t);null!=e&&e.length>1&&(t=e[1])}return t}parseRequestAction(e,t){let n=null;if("Query"===e&&null!=t){const e=["action=([_0-9a-zA-Z]+)","/api/([/_0-9a-zA-Z]+)","ev=([_0-9a-zA-Z]+)",".([_0-9a-zA-Z]+).model","/ocs/([/_0-9a-zA-Z]+)"];let o=0;for(let r=0;r<e.length;r++){const i=new RegExp(e[r],"g").exec(t);if(null!=i&&i.length>1){n=i[1];break}o++}null!=n&&(1===o&&0===n.indexOf("Notifications")&&(n="Notifications"),"/"===n.charAt(n.length-1)&&(n=n.substring(0,n.length-1)))}return n}writeEvent(e){this.logServices.forEach((t=>{t.writeEvent(e)})),window.O365ShellContext.DiagnosticsEnabled&&window.O365ShellContext.Diagnostics.push(JSON.stringify(e)),this.eventBuffer.length<p.AL&&this.eventBuffer.push(e)}getPerfMarkerStartTime(e){try{if(e){const t=window.performance.getEntriesByName(e);if(null!=t&&t.length>0)return Math.round(t[0].startTime)}}catch(e){}return-1}getHeaderTTI(){const e=this.getMarker("HelpTimeToInteractive"),t=this.getMarker("ChatTimeToInteractive"),n=this.getMarker("BellTimeToInteractive"),o=this.getMarker("SettingsTimeToInteractive"),r=this.getMarker("SearchRenderComplete");let i=e>t?e:t;return i=n>i?n:i,i=o>i?o:i,i=r>i?r:i,this.perfMarker("TimeToInteractive",i),i>0&&window.performance.measure("Shell_TTI","shell_bootstrapper_start"),i}getMarker(e){if(e){const t=this.logPerformanceMarkers[e];if(void 0!==t)return t}return 0}}function g(){let e=new m,t=window.O365ShellContext.Logger;(function(e){return void 0!==e.applyCalls})(t)&&(e.init(),t.applyCalls(e),window.O365ShellContext.Logger=e)}},89682:function(e,t,n){"use strict";n.d(t,{AG:function(){return d},C$:function(){return c},G4:function(){return l},Ii:function(){return f},Rh:function(){return i},Zy:function(){return r},bT:function(){return u},lX:function(){return o},sE:function(){return a},uI:function(){return p},wu:function(){return s}});const o="createHomepage",r="intentTile_",i="Microsoft365Tile",a="MoreAppsTile",s="O365_AppTile_",c="88001254",l="88001253",u=5,d=20,p=100,f=450},91016:function(e,t,n){"use strict";var o,r,i,a,s,c,l,u,d,p,f,h;n.d(t,{CS:function(){return p},P1:function(){return l},_e:function(){return r},sO:function(){return c}}),function(e){e.Smile="Smile",e.Frown="Frown",e.Idea="Idea",e.Unclassified="Unclassified",e.Survey="Survey",e.ThumbsUp="ThumbsUp",e.ThumbsDown="ThumbsDown"}(o||(o={})),function(e){e.Undefined="Undefined",e.MinorWithoutParentalConsent="MinorWithoutParentalConsent",e.MinorWithParentalConsent="MinorWithParentalConsent",e.NotAdult="NotAdult",e.Adult="Adult",e.MinorNoParentalConsentRequired="MinorNoParentalConsentRequired"}(r||(r={})),function(e){e.DropDown="DropDown",e.MultiSelect="MultiSelect",e.Rating="Rating",e.SingleSelect="SingleSelect",e.SingleSelectHorizontal="SingleSelectHorizontal"}(i||(i={})),function(e){e.FeatureArea="FeatureArea",e.ResponsibleAI="ResponsibleAI",e.Experience="Experience",e.ProductSatisfaction="ProductSatisfaction",e.CrashImpact="CrashImpact",e.Custom="Custom",e.AIThumbsDown="AIThumbsDown",e.AIThumbsUp="AIThumbsUp",e.PromptSuggestion="PromptSuggestion"}(a||(a={})),function(e){e.QuestionNotRequired="QuestionNotRequired",e.CommentNotRequired="CommentNotRequired",e.CommentRequiredWithLastOption="CommentRequiredWithLastOption"}(s||(s={})),function(e){e.MSA="MSA",e.AAD="AAD",e.Unauthenticated="Unauthenticated"}(c||(c={})),function(e){e.Enabled="Enabled",e.Disabled="Disabled",e.NotConfigured="Not Configured"}(l||(l={})),function(e){e.JPEG="jpeg",e.PNG="png"}(u||(u={})),function(e){e.AutoCapture="AutoCapture",e.AutoCaptureWithHtml2Canvas="AutoCaptureWithHtml2Canvas",e.ProvidedAtInitialization="ProvidedAtInitialization",e.DynamicallyProvided="DynamicallyProvided"}(d||(d={})),function(e){e.SidePane="SidePane",e.Modal="Modal",e.NoSurface="NoSurface",e.CallOut="CallOut",e.NoSurfaceWithoutTitle="NoSurfaceWithoutTitle"}(p||(p={})),function(e){e.Windows="Windows",e.Android="Android",e.WacTaskPane="WacTaskPane",e.MacOS="MacOS",e.Web="Web"}(f||(f={})),function(e){e.Success="Success",e.Error="Error",e.Warning="Warning"}(h||(h={}))},51545:function(e,t,n){"use strict";n.d(t,{k:function(){return r},m:function(){return i}});var o=n(91016);function r(e){if(!e)return null;const t=e.trim().toLowerCase();return{sidepane:o.CS.SidePane,modal:o.CS.Modal,nosurface:o.CS.NoSurface,callout:o.CS.CallOut,nosurfacewithouttitle:o.CS.NoSurfaceWithoutTitle}[t]||null}function i(e){return null!=e&&(e===o.CS.NoSurface||e===o.CS.NoSurfaceWithoutTitle)}},49852:function(e,t,n){"use strict";n.d(t,{B:function(){return r},P:function(){return i}});var o=n(28569);const r="LazyBellHeaderButton",i=(0,o.E)(r)},89959:function(e,t,n){"use strict";n.d(t,{Y:function(){return r},e:function(){return i}});var o=n(28569);const r="LazyChatHeaderButton",i=(0,o.E)(r)},70238:function(e,t,n){"use strict";n.d(t,{F:function(){return i},J:function(){return r}});var o=n(28569);const r="LazyCustomHeaderButton",i=(0,o.E)(r)},71936:function(e,t,n){"use strict";n.d(t,{p:function(){return r},r:function(){return i}});var o=n(28569);const r="LazyFeatureFlagsHeaderButton",i=(0,o.E)(r)},21226:function(e,t,n){"use strict";n.d(t,{$:function(){return r},s:function(){return i}});var o=n(28569);const r="LazyGearHeaderButton",i=(0,o.E)(r)},36558:function(e,t,n){"use strict";n.d(t,{V:function(){return r},z:function(){return i}});var o=n(28569);const r="LazyHelpHeaderButton",i=(0,o.E)(r)},98052:function(e,t,n){"use strict";n.d(t,{M:function(){return i},q:function(){return r}});var o=n(28569);const r="LazyMyDayHeaderButton",i=(0,o.E)(r)},28569:function(e,t,n){"use strict";n.d(t,{E:function(){return i}});var o=n(53512),r=n(16968);function i(e){let t=(0,o._)();return(0,r.NP)().subscribe("LazyComponentLoaded",((n,o)=>{n===e&&t.setComponent(o)}),!0),t}},53644:function(e,t,n){"use strict";n.d(t,{Hp:function(){return o},X3:function(){return r}});n(90872);const o="O365_MainLink_Affordance";function r(e){return null!=e&&e.isMeasured}},13780:function(e,t,n){"use strict";var o;n.d(t,{c:function(){return o}}),function(e){e.Theme="theme",e.LanguageAndRegion="languageandregion",e.NavBarDataLinks="navbardatalinks",e.ChangePassword="changepassword",e.ContactPreferences="contactpreferences",e.AboutBase="aboutbase",e.About="about",e.DarkMode="darkmode",e.CPNIPin="cpnipin",e.Copilot="copilot",e.Feedback="feedback",e.AppLaunch="applaunch",e.FileOpenSettings="fileopensettings"}(o||(o={}))},33106:function(e,t,n){"use strict";n.d(t,{EU:function(){return g},G4:function(){return i},Gf:function(){return f},H5:function(){return x},Jy:function(){return m},M9:function(){return l},MQ:function(){return A},S:function(){return a},Xm:function(){return r},bs:function(){return v},hK:function(){return u},ii:function(){return b},l4:function(){return h},ty:function(){return s},vJ:function(){return p},vo:function(){return c},wb:function(){return y},zH:function(){return d}});var o=n(42970);function r(e){return{type:o.cj,newWorkloadSettingLink:e}}function i(e){return{type:o.XL,settingLinkID:e}}function a(e){return{type:o.Rq,newWorkloadSettingsLinks:e}}function s(e){return{type:o._f,cardData:e}}function c(e){return{type:o.Eh,selectedLanguage:e}}function l(e){return{type:o.T9,languageChoices:e}}function u(e){return{type:o.u4,selectedTimeZone:e}}function d(e,t,n){return{type:o.wS,timeZoneChoice:e,dateFormatChoice:t,timeFormatChoice:n}}function p(e){return{type:o.Kt,timeZoneChoices:e}}function f(e){return{type:o.nf,selectedLanguage:e}}function h(e){return{type:o.Ul,selectedDateFormat:e}}function m(e){return{type:o.uT,dateFormatChoices:e}}function g(e){return{type:o.nt,selectedTimeFormat:e}}function b(e){return{type:o.jj,timeFormatChoices:e}}function v(){return{type:o.ar}}function y(){return{type:o.Xu}}function x(e){return{type:o.dE,cardId:e}}function A(e){return{type:o.oc,isExpanded:e}}},42970:function(e,t,n){"use strict";n.d(t,{Eh:function(){return l},Kt:function(){return f},Rq:function(){return s},T9:function(){return u},Ul:function(){return m},XL:function(){return a},Xu:function(){return r},_f:function(){return c},ar:function(){return o},cj:function(){return i},dE:function(){return y},jj:function(){return v},nf:function(){return h},nt:function(){return b},oc:function(){return x},u4:function(){return d},uT:function(){return g},wS:function(){return p}});const o="suiteux-settings.SAVE_SELECTIONS",r="suiteux-settings.CANCEL_SELECTIONS",i="suiteux-settings.ADDORUPDATE_WORKLOADSETTINGLINK",a="suiteux-settings.REMOVE_WORKLOADSETTINGLINK",s="suiteux-settings.SET_WORKLOADSETTINGSLINKS",c="suiteux-settings.INITIALCARDS_AVAILABLE",l="suiteux-settings.LANGUAGECHOICE_AVAILABLE",u="suiteux-settings.LANGUAGECHOICES_AVAILABLE",d="suiteux-settings.SELECTEDTIMEZONE_CHANGED",p="suiteux-settings.TIMEZONEANDFORMATSCHOICE_AVAILABLE",f="suiteux-settings.TIMEZONECHOICES_AVAILABLE",h="suiteux-settings.SELECTEDLANGUAGE_CHANGED",m="suiteux-settings.SELECTEDDATEFORMAT_CHANGED",g="suiteux-settings.DATEFORMATCHOICES_AVAILABLE",b="suiteux-settings.SELECTEDTIMEFORMAT_CHANGED",v="suiteux-settings.TIMEFORMATCHOICES_AVAILABLE",y="suiteux-settings.NAVIGATE_TO_CARD",x="suiteux-settings.O365_SETTINGS_EXPANDED"},92720:function(e,t,n){"use strict";n.d(t,{S:function(){return b}});var o=n(13780);const r=[o.c.LanguageAndRegion,o.c.ChangePassword,o.c.ContactPreferences,o.c.NavBarDataLinks],i=[o.c.NavBarDataLinks,o.c.Theme,o.c.LanguageAndRegion,o.c.ChangePassword,o.c.ContactPreferences],a={default:[o.c.NavBarDataLinks,o.c.Theme,o.c.LanguageAndRegion,o.c.DarkMode,o.c.ChangePassword,o.c.ContactPreferences],iwapp:[o.c.NavBarDataLinks,o.c.Theme,o.c.Copilot,o.c.LanguageAndRegion,o.c.DarkMode,o.c.ChangePassword,o.c.ContactPreferences,o.c.Feedback],exchange:[],exchangeadmin:i,officepwa:[o.c.Theme,o.c.Copilot,o.c.AppLaunch,o.c.FileOpenSettings,o.c.DarkMode,o.c.AboutBase,o.c.NavBarDataLinks],officepwamac:[o.c.Theme,o.c.Copilot,o.c.AboutBase,o.c.NavBarDataLinks],botdesigner:[o.c.NavBarDataLinks,o.c.Theme,o.c.ChangePassword,o.c.ContactPreferences],dynamics365:i,dynamics365ci:[o.c.NavBarDataLinks,o.c.Theme,o.c.ChangePassword,o.c.ContactPreferences],dynamics365fraudprotection:[o.c.NavBarDataLinks,o.c.Theme,o.c.ChangePassword,o.c.ContactPreferences],dynamics365powerplatform:[o.c.NavBarDataLinks,o.c.Theme,o.c.ChangePassword,o.c.ContactPreferences],dynamics365productinsights:[o.c.NavBarDataLinks,o.c.ChangePassword,o.c.ContactPreferences],adminportal:[o.c.NavBarDataLinks,o.c.Theme,o.c.LanguageAndRegion,o.c.ChangePassword,o.c.ContactPreferences],flow:[o.c.NavBarDataLinks,o.c.Theme,o.c.ChangePassword,o.c.ContactPreferences],teamsappstudio:[o.c.NavBarDataLinks,o.c.LanguageAndRegion,o.c.ChangePassword,o.c.ContactPreferences],microsoftstream:[o.c.NavBarDataLinks,o.c.LanguageAndRegion,o.c.DarkMode,o.c.ChangePassword,o.c.ContactPreferences],todo:[o.c.NavBarDataLinks,o.c.LanguageAndRegion,o.c.DarkMode,o.c.ChangePassword,o.c.ContactPreferences],microsoftclipchamp:[o.c.NavBarDataLinks,o.c.LanguageAndRegion,o.c.ChangePassword,o.c.ContactPreferences],powerappsportal:[o.c.NavBarDataLinks,o.c.Theme,o.c.ChangePassword,o.c.ContactPreferences],vivagoals:[],promptlibbie:[],vivaglint:[o.c.NavBarDataLinks,o.c.Theme,o.c.DarkMode,o.c.ChangePassword,o.c.ContactPreferences],vivalearning:[o.c.NavBarDataLinks,o.c.Theme,o.c.DarkMode],protectioncenter:i,wordonline:r,powerpointonline:r,excelonline:r,visioonline:r,onenoteonline:r,wac:r,officeonline:r};var s=n(61304);let c={[o.c.NavBarDataLinks]:{EnableConsumer:!0},[o.c.Theme]:{Title:s.D.Themes||"Themes",EnableConsumer:!0},[o.c.Copilot]:{EnableConsumer:!1},[o.c.ChangePassword]:{Title:s.D.Password,Description:s.D.PasswordDescription||"Change your password",EnableConsumer:!1,ChangePasswordCardData:[{WorkloadId:"dynamics365businesscentral",QueryStringData:[{Key:"ru",Value:"https://businesscentral.dynamics.com?redirectedfromsignup=1"}]}]},[o.c.ContactPreferences]:{Title:s.D.ContactPreferences,Description:s.D.ContactPreferencesDescription||"Update contact preferences",EnableConsumer:!1},[o.c.LanguageAndRegion]:{Title:s.D.LanguageAndTimeZone,Description:s.D.LanguageAndTimeZoneDescription||"Change your language",EnableConsumer:!1},[o.c.Feedback]:{Title:s.D.FeedbackButtonTitle||"Feedback",EnableConsumer:!1},[o.c.AppLaunch]:{Title:s.D.AppLaunchCardTitle||"App Launch",EnableConsumer:!0},[o.c.FileOpenSettings]:{Title:s.D.FileOpenSettingsCardTitle||"File Opening",EnableConsumer:!0},[o.c.AboutBase]:{Title:s.D.About,EnableConsumer:!0,ChildCardIds:[o.c.About]},[o.c.About]:{Title:s.D.About,EnableConsumer:!0},[o.c.DarkMode]:{Title:s.D.DarkThemeTitle||"Dark Mode",EnableConsumer:!1},[o.c.CPNIPin]:{Title:s.D.CPNIPinCardTitle,EnableConsumer:!1}};var l=n(16968),u=n(66164),d=n(84107);function p(e){return!e.UseSimplifiedLanguageCard&&!(1&~e.UserType||(0,u.Uc)(e.WorkloadId))}function f(e){return!e.ShowContactPreferencesCard}function h(e){return!(0,d.v)(e)}function m(e){const t=(0,l.Vz)().getThemeState().disableTheming;return e.IsConsumerShell?!(e.CSSExperiencesEnabled&&e.ConsumerThemingEnabled):!!t}const g="default";function b(e,t,n){var r;const i={[o.c.LanguageAndRegion]:p(e),[o.c.NavBarDataLinks]:h(n),[o.c.Theme]:m(e),[o.c.ContactPreferences]:f(e)};let s;const l=null!==(r=window.isMacApp)&&void 0!==r&&r;s=e.CurrentMainLinkElementID&&"shellofficedotcom"===e.CurrentMainLinkElementID.toLowerCase()?"iwapp":e.CurrentMainLinkElementID&&"shellofficepwa"===e.CurrentMainLinkElementID.toLowerCase()?l?"officepwamac":"officepwa":e.CurrentMainLinkElementID&&"shellstream"===e.CurrentMainLinkElementID.toLowerCase()?"microsoftstream":e.CurrentMainLinkElementID&&"clipchamp"===e.CurrentMainLinkElementID.toLowerCase()?"microsoftclipchamp":e.WorkloadId.toLowerCase();let u=null!=t?c[t].ChildCardIds:a[s]?a[s]:a[g],d=e.IsConsumerShell;return u?u.filter((t=>!e.IsGuestMode||t===o.c.NavBarDataLinks)).filter((e=>!d||c[e].EnableConsumer)).filter((e=>!i[e])).map((e=>Object.assign({Id:e},c[e]))):[]}},61304:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var o=n(16968);let r={};const i={};let a;const s=e=>{!function(e){r=Object.assign(Object.assign({},r),e),Object.getOwnPropertyNames(e).forEach((e=>{i.hasOwnProperty(e)||Object.defineProperty(i,e,{get:()=>r[e]})}))}(e),a&&(0,o.NP)().unsubscribe("StringsLoaded",a)};let c=(0,o.NP)();c&&(a=c.subscribe("StringsLoaded",s,!0))},67172:function(e,t,n){"use strict";n.d(t,{jI:function(){return v},Gy:function(){return m},cv:function(){return b}});var o=n(16968),r=n(1742);const i=[[0,-.362790697674419],[0,-.186046511627907],[0,-.186046511627907],[0,0],[-.270491803278688,.230508474576271],[-.442857142857143,.583050847457627],[-.275862068965518,.861016949152542],[-.333333333333334,.955932203389831],[-.333333333333334,.955932203389831]],a=/^#((?:[0-9a-fA-F]{3}){1,2})$/,s=/rgba?\((\d{0,3})\s?,\s?(\d{0,3})\s?,\s?(\d{0,3})\s?,?(\s?(\d?\.\d+))?\)/;function c(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}function l(e){let t=1;9===e.length&&(t=c(parseInt(e.substring(7),16)/255,2),e=e.substr(0,7));let n=a.exec(e),o="";return null!=n&&n.length>1?(o=6===n[1].length?n[1]:n[1].split("").map((e=>e.concat(e))).join(""),[parseInt(o.substr(0,2),16),parseInt(o.substr(2,2),16),parseInt(o.substr(4,2),16),t]):[0,0,0,0]}function u(e,t=!1){return e.some((e=>e<0||e>255))?"#00000000":(null!=e[3]&&e[3]<1&&!t?e[3]=Math.round(255*e[3]):e.splice(3,1),"#"+e.map((e=>{let t=e.toString(16);return 1===t.length?"0"+t:t})).join(""))}function d(e,t,n){let[o,r,i,a]=function([e,t,n,o]){if([e,t,n].some((e=>e<0||e>255)))return[0,0,0,0];[e,t,n]=[e,t,n].map((e=>e/255));let r=Math.max(e,t,n),i=Math.min(e,t,n),a=r-i,s=0,l=0,u=(i+r)/2;if(0!==a){switch(l=a/(1-Math.abs(2*u-1)),r){case e:s=(t-n)/a%6;break;case t:s=(n-e)/a+2;break;case n:s=(e-t)/a+4}s*=60,s=(s+360)%360}return[Math.round(s),c(l,2),c(u,2),o]}(l(e));return r=Math.min(1,r*(1+t)),i=n>0?(1-i)*n+i:i*(1+n),u(function([e,t,n,o]){let r=(1-Math.abs(2*n-1))*t,i=(e=(e%360+360)%360)/60,a=r*(1-Math.abs(i%2-1)),[s,c,l]=[0,0,0];i>0&&i<=1?[s,c,l]=[r,a,0]:i>1&&i<=2?[s,c,l]=[a,r,0]:i>2&&i<=3?[s,c,l]=[0,r,a]:i>3&&i<=4?[s,c,l]=[0,a,r]:i>4&&i<=5?[s,c,l]=[a,0,r]:i>5&&i<=6&&([s,c,l]=[r,0,a]);let u=n-r/2;return[s,c,l].map((e=>Math.min(255,Math.round(255*(e+u))))).concat([o])}([o,r,i,a]),!0)}function p(e){let t=e.Primary;const n=t.match(s);return null!=n&&(t=u(n.slice(1,5).map((e=>parseFloat(e)||1)),!0)),{Darker:e.Darker||d(t,i[0][0],i[0][1]),Dark:e.Dark||d(t,i[1][0],i[1][1]),DarkAlt:e.DarkAlt||d(t,i[2][0],i[2][1]),Primary:t,Secondary:e.Secondary||d(t,i[4][0],i[4][1]),Tertiary:e.Tertiary||d(t,i[5][0],i[5][1]),Light:e.Light||d(t,i[6][0],i[6][1]),Lighter:e.Lighter||d(t,i[7][0],i[7][1]),LighterAlt:e.LighterAlt||d(t,i[8][0],i[8][1])}}var f=n(87529);function h(e,t,n,o){const r=p(e),i=(0,f.er)(e,t),a=(0,f.Ve)(t);return e=n?{NavBar:a.NavBar,AppName:e.AppName,DefaultText:a.Darker,DefaultBackground:a.NavBar,SelectedBackground:a.Lighter,SelectedText:a.Darker,Accent:r.Dark,HoverBackground:r.Dark,HoverText:i.white,PressedText:i.white,DarkAlt:r.DarkAlt,Primary:e.Primary,Secondary:e.Secondary,Tertiary:e.Tertiary}:Object.assign({NavBar:e.Primary,AppName:i.white,DefaultText:i.white,DefaultBackground:e.NavBar||e.Primary,SelectedBackground:i.lighter,SelectedText:i.dark,Accent:r.Dark,HoverBackground:r.Darker,HoverText:i.white,PressedText:i.white,PressedBackground:r.Darker,DarkAlt:r.DarkAlt},e),o?null!=e.FullBleedImages&&(e.DefaultBackground=e.NavBar):delete e.FullBleedImages,e=Object.assign({SearchNavBar:e.NavBar===e.Primary?r.Dark:p({Primary:e.NavBar}).Dark,SearchHoverBackground:p({Primary:e.HoverBackground}).Dark,SearchAccent:p({Primary:e.Accent}).Dark,SearchDefaultText:i.white,WaffleBackground:e.DefaultBackground,WaffleIcon:e.DefaultText,FlexPaneAccent:e.Accent,BackgroundImageRepeat:!0,BadgeText:i.foreground,BadgeBackground:e.Accent},e)}function m(){(0,o.NP)().subscribe("ThemeUpdated",g),(0,o.Vz)().updateThemeCss(!1)}function g(e=!1){let t=(0,o.Vz)(),n=t.getThemeClassNames();const r=t.getThemeData();let i={[`.${n.highContrastButton}`]:{"@media screen and (-ms-high-contrast: black-on-white), (forced-colors: active) and (prefers-color-scheme: light)":{color:"black","-ms-high-contrast-adjust":"none","forced-color-adjust":"none","background-color":"white"},"@media screen and (-ms-high-contrast: white-on-black), (forced-colors: active) and (prefers-color-scheme: dark)":{color:"white","-ms-high-contrast-adjust":"none","forced-color-adjust":"none","background-color":"black"},"&:hover, &:focus":{"@media screen and (-ms-high-contrast: white-on-black), (forced-colors: active) and (prefers-color-scheme: dark)":{"background-color":"#1AEBFF"},"@media screen and (-ms-high-contrast: black-on-white), (forced-colors: active) and (prefers-color-scheme: light)":{"background-color":"#37006E"}}},[`.${n.activeHeaderButton}`]:{color:`${r.SelectedText}`,backgroundColor:`${r.SelectedBackground}`,"&:focus":{outline:`${r.Primary} 1px solid`}},[`.${n.accent.link}`]:{backgroundColor:r.Accent},[`.${n.accent.font}`]:{backgroundColor:r.Accent},[`.${n.accent.background}`]:{backgroundColor:r.Accent},[`.${n.accent.border}`]:{borderColor:r.Accent},[`.${n.searchNav}.${n.navbar}`]:e?{backgroundColor:r.SearchNavBar,backgroundImage:"none",[`& .${n.appName}, & .${n.appName}:hover, & .${n.appName}:visited, & .${n.appName}:focus`]:{color:r.SearchDefaultText,backgroundColor:r.SearchNavBar},[`& .${n.appBrandLink}`]:{"&:focus":{outline:`${r.DefaultText} 1px solid`}},[`& .${n.headerButton}`]:{color:r.SearchDefaultText,backgroundColor:r.SearchNavBar,"&:hover, &:focus":{backgroundColor:r.SearchHoverBackground},"&:focus":{outline:`${r.DefaultText} 1px solid`}},[`& .${n.nonInteractiveButton}`]:{color:r.SearchDefaultText,backgroundColor:r.SearchNavBar,"&:hover, &:focus":{backgroundColor:null},"&:focus":{outline:null}},[`& .${n.activeHeaderButton}, & .${n.activeHeaderButton}:hover, & .${n.activeHeaderButton}:focus`]:{color:`${r.SelectedText}`,backgroundColor:`${r.SelectedBackground}`},[`& .${n.accent.font}`]:{backgroundColor:r.SearchAccent},[`& .${n.accent.background}`]:{backgroundColor:r.SearchAccent},[`& .${n.accent.border}`]:{borderColor:r.SearchAccent}}:null},a=JSON.stringify(i).replace("{",",");t.setState({additionalStyles:a})}function b(e,t,n,i){const a={};if(e.forEach(((e,t)=>{a[e.Id.toLowerCase()]=t})),i){let i=JSON.parse(JSON.stringify(e));(0,o.Vz)().getThemeState().tenantTheme&&(i.push({Id:r.Mm,Order:20}),a[r.Mm]=i.length-1),t=t===r.ux&&n?r.Mm:t;let s=i.splice(a[t],1)[0],c=i.sort(((e,t)=>e.Order-t.Order));return c.unshift(s),c}return[e[a[r.ux]],e[a[r.D5]]]}function v(e,t,n,o){var i,a;const s=e.Id.toLowerCase();return e=Object.assign(Object.assign({},e),{ThemeType:"User",Name:null!==(i=t[`ThemeName_${s}`])&&void 0!==i?i:e.Name}),s===r.ux&&n.tenantTheme?e=Object.assign(Object.assign(Object.assign({},e),h(n.tenantTheme,!1,!1,!1)),{ThemeType:"Tenant"}):s!==r.Mm&&s!==r.ux||(o?e=Object.assign(Object.assign(Object.assign({},e),h(o,!1,n.isMicaEnabled,!1)),{Name:null!==(a=t.NeutralTheme)&&void 0!==a?a:"Neutral theme",Order:20,ThemeType:"App"}):e.ThemeType=null),e}},87529:function(e,t,n){"use strict";n.d(t,{Ve:function(){return r},_Q:function(){return i},er:function(){return o}});function o(e,t){return t?{white:"#FFFFFF",black:"#000000",foreground:"#212121",foregroundAlt:"#555555",accent:e.Dark||e.DarkAccent||"#B3D6F2",staticAccent:e.Dark||e.DarkAccent||"#106EBE",light:"#555555",lightAlt:"#999999",lighter:"#3C3C3C",lighterAlt:"#212121",dark:"#FFFFFF",primary:"#797775",secondary:"#FFFFFF",tertiary:"#FFFFFF",darkRed:"#F4ABBA"}:{white:"#FFFFFF",black:"#000000",foreground:"#FFFFFF",foregroundAlt:"#FFFFFF",staticAccent:e.FlexPaneAccent,accent:e.FlexPaneAccent,light:"#E1DFDD",lightAlt:"#EDEBE9",lighter:"#F3F2F1",lighterAlt:"#FAF9F8",dark:"#252423",primary:"#BEBBB8",secondary:"#484644",tertiary:"#605E5C",darkRed:"#A80000"}}function r(e){return e?{NavBar:"transparent",Dark:"#ffffff80",Darker:"#ffffffb3",DarkAlt:"#ffffffb3",Light:"#24242480",Lighter:"#242424cc",LighterAlt:"#242424cc"}:{NavBar:"transparent",Dark:"#24242480",Darker:"#242424cc",DarkAlt:"#242424cc",Light:"#ffffff80",Lighter:"#ffffffb3",LighterAlt:"#ffffffb3"}}function i(e="#B3D6F2"){return{NavBar:"#1B1A19",Dark:e,Darker:e,DarkAlt:e,Primary:e,Secondary:e,DefaultBackground:"#1B1A19",HoverBackground:"#252423",SelectedBackground:"#252423",Tertiary:e,Light:e,Lighter:e,LighterAlt:e,Disabled:!0}}},90872:function(e){"use strict";e.exports=O365ShellContext.React},9028:function(e){"use strict";e.exports=O365ShellContext.ReactDOM},93288:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},75720:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},13739:function(e){e.exports=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n},e.exports.__esModule=!0,e.exports.default=e.exports},16533:function(e,t,n){"use strict";n.r(t),n.d(t,{__addDisposableResource:function(){return F},__assign:function(){return i},__asyncDelegator:function(){return k},__asyncGenerator:function(){return w},__asyncValues:function(){return P},__await:function(){return S},__awaiter:function(){return h},__classPrivateFieldGet:function(){return E},__classPrivateFieldIn:function(){return M},__classPrivateFieldSet:function(){return L},__createBinding:function(){return g},__decorate:function(){return s},__disposeResources:function(){return B},__esDecorate:function(){return l},__exportStar:function(){return b},__extends:function(){return r},__generator:function(){return m},__importDefault:function(){return T},__importStar:function(){return D},__makeTemplateObject:function(){return O},__metadata:function(){return f},__param:function(){return c},__propKey:function(){return d},__read:function(){return y},__rest:function(){return a},__runInitializers:function(){return u},__setFunctionName:function(){return p},__spread:function(){return x},__spreadArray:function(){return C},__spreadArrays:function(){return A},__values:function(){return v}}); +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};function a(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function s(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function c(e,t){return function(n,o){t(n,o,e)}}function l(e,t,n,o,r,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=o.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?o.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),p=!1,f=n.length-1;f>=0;f--){var h={};for(var m in o)h[m]="access"===m?{}:o[m];for(var m in o.access)h.access[m]=o.access[m];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[f])("accessor"===c?{get:d.get,set:d.set}:d[l],h);if("accessor"===c){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(d.get=s),(s=a(g.set))&&(d.set=s),(s=a(g.init))&&r.unshift(s)}else(s=a(g))&&("field"===c?r.unshift(s):d[l]=s)}u&&Object.defineProperty(u,o.name,d),p=!0}function u(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function m(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var g=Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]};function b(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||g(t,e,n)}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function x(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}function A(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o}function C(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function S(e){return this instanceof S?(this.v=e,this):new S(e)}function w(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(e){r[e]&&(o[e]=function(t){return new Promise((function(n,o){i.push([e,t,n,o])>1||s(e,t)}))})}function s(e,t){try{(n=r[e](t)).value instanceof S?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function k(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:S(e[o](t)),done:!1}:r?r(t):t}:r}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=v(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,r,(t=e[n](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function D(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&g(t,e,n);return I(t,e),t}function T(e){return e&&e.__esModule?e:{default:e}}function E(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function L(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n}function M(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function F(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=t[Symbol.asyncDispose]}if(void 0===o){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=t[Symbol.dispose]}if("function"!=typeof o)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:o,async:n})}else n&&e.stack.push({async:!0});return t}var N="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var o=new Error(n);return o.name="SuppressedError",o.error=e,o.suppressed=t,o};function B(e){function t(t){e.error=e.hasError?new N(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var o=e.stack.pop();try{var r=o.dispose&&o.dispose.call(o.value);if(o.async)return Promise.resolve(r).then(n,(function(e){return t(e),n()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:r,__assign:i,__rest:a,__decorate:s,__param:c,__metadata:f,__awaiter:h,__generator:m,__createBinding:g,__exportStar:b,__values:v,__read:y,__spread:x,__spreadArrays:A,__spreadArray:C,__await:S,__asyncGenerator:w,__asyncDelegator:k,__asyncValues:P,__makeTemplateObject:O,__importStar:D,__importDefault:T,__classPrivateFieldGet:E,__classPrivateFieldSet:L,__classPrivateFieldIn:M,__addDisposableResource:F,__disposeResources:B}}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return i[e].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=i,e=[],s.O=function(t,n,o,r){if(!n){var i=1/0;for(u=0;u<e.length;u++){n=e[u][0],o=e[u][1],r=e[u][2];for(var a=!0,c=0;c<n.length;c++)(!1&r||i>=r)&&Object.keys(s.O).every((function(e){return s.O[e](n[c])}))?n.splice(c--,1):(a=!1,r<i&&(i=r));if(a){e.splice(u--,1);var l=o();void 0!==l&&(t=l)}}return t}r=r||0;for(var u=e.length;u>0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[n,o,r]},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var r=Object.create(null);s.r(r);var i={};t=t||[null,n({}),n([]),n(n)];for(var a=2&o&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach((function(t){i[t]=function(){return e[t]}}));return i.default=function(){return e},s.d(r,i),r},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce((function(t,n){return s.f[n](e,t),t}),[]))},s.u=function(e){return"suiteux.shell."+e+"."+{search:"72374ded6a4436e6d5a3",plus:"347d8a006b7d18a62075",m365start:"d031742c5a4998c8f1e0",applauncher:"70ca3eb00d24d2dfd80b",featureflags:"0516a3d130550c98fe9b",myday:"32e29826618934c45028",extraflexpane:"7683686474028a0ae015",searchbox:"e3cf4f28b9f7615d3151",msrcrypto:"ef97e77ffce8e3a34924",abt:"c51492c889ed696ce727",abtprompt:"f10eaf4f716be14c2cae",exchangedata:"bcc9747a23eb8b33ad69",chat:"865271a68f42a8a868d7",diagnostics:"dffef2692eec12b139c1",dtt:"89a0192524c23814c05a",mast:"75247141eba989d40b6d",mastprompt:"8bbc3c2b11b47f5f3ab3",notifications:"17728645f935f656385f",otellogging:"2bb510bca5cad7db54a6",npm_mecontrol:"81346e124bdb0aabf33e",umc_mecontrol:"663e3f8156b95d75a796",changephoto:"84a52346b300fb3c0016",docsmodule:"9966cf4d9dfd018114bf",searchux:"1b0ce5930fd142388c50","sb-strings":"951aed60066ec47a4686",chatbase:"5635bed000a93a8e6b4c",notificationflex:"b4d65b513bf46c7f7934","oneds-analytics-js":"81344a1a3a3a2fd695aa","_store_mecontrol-fluent-web_3_28_4-preview_4-5af2d876fcb7dd9a55e8_node_modules_mecontrol_flue-994e90":"d3ea95f756b137caa632",chaterror:"197d4b97606ddf47ab47","_store_mecontrol-fluent-web_3_28_4-preview_4-5af2d876fcb7dd9a55e8_node_modules_mecontrol_flue-bb9c4f":"6ebe459ea8786a0b0950"}[e]+".js"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o={},r="@1js/suiteux-shell:",s.l=function(e,t,n,i){if(o[e])o[e].push(t);else{var a,c;if(void 0!==n)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+n){a=d;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",r+n),a.src=e),o[e]=[t];var p=function(t,n){a.onerror=a.onload=null,clearTimeout(f);var r=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((function(e){return e(n)})),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),c&&document.head.appendChild(a)}},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},s.p="",function(){var e={core:0};s.f.j=function(t,n){var o=s.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise((function(n,r){o=e[t]=[n,r]}));n.push(o[2]=r);var i=s.p+s.u(t),a=new Error;s.l(i,(function(n){if(s.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",a.name="ChunkLoadError",a.type=r,a.request=i,o[1](a)}}),"chunk-"+t,t)}},s.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,r,i=n[0],a=n[1],c=n[2],l=0;if(i.some((function(t){return 0!==e[t]}))){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);if(c)var u=c(s)}for(t&&t(n);l<i.length;l++)r=i[l],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return s.O(u)},n=self["suiteux_shell_webpackJsonp_suiteux-main"]=self["suiteux_shell_webpackJsonp_suiteux-main"]||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),s.nc=void 0;var c={};!function(){"use strict";var e=s(16533),t=s(22331);let n=null;function o(e,...t){const o=document.createElement("img");let r=`&version=${encodeURIComponent("1.20260127.2.0")}`,i="";n||(n=(new Date).getTime()+"_"+Math.random());for(let e=0;e<t.length&&e<3;e++)i+=`&adhoc${e+1}=${encodeURIComponent((t[e]||"").toString())}`;i+=`&adhoc4=${n}`,o.setAttribute("src",`https://webshell.suite.office.com/api/bootlog/bootfailure?eventName=${e}${r}${i}`)}var r=s(16968);var i=s(98499),a=s(79028),c=s(98981),l=s(58059),u=s(87948);let d=!1;function p(){let e=(0,r.NP)().subscribe("ShellDataUpdated",((t,n)=>{(n.IsConsumerShell||(0,l.n)(n)&&t.SessionID)&&(d||(d=!0,(0,r.tZ)().impression("NavBarFull","NavBar",0,null,function(e,t,n){var o,i;let a="";if(t&&e){n&&n.testTraffic&&(a+="TestTraffic:1;"),e.HasTenantBranding&&(e.TenantLogoUrl&&(a+="TenantLogo:1;"),t.TenantThemeColors&&(a+=`TenantThemeColors:${t.TenantThemeColors.join(",")};`)),t.UserPersonalizationAllowed||(a+="UserThemeDisabled:1;");let o="UserTheme:{0};";t.UserThemeId&&(t.UserPersonalizationAllowed||"contrast"===t.UserThemeId.toLowerCase())&&"base"!==t.UserThemeId.toLowerCase()?a+=(0,u.JT)(o,t.UserThemeId):t.UserThemeId&&"base"===t.UserThemeId.toLowerCase()&&(t.PreferOfficeTheme&&t.UserPersonalizationAllowed?a+=(0,u.JT)(o,"Office"):e.HasTenantBranding&&(a+=(0,u.JT)(o,"Tenant"))),n&&(n.isDarkMode||t.IsDarkMode)&&n.darkAccent&&(a+="DarkMode:1;"),n&&(n.initialRenderData.UPN||(a+="UPNSupplied:0;"),n.initialRenderData.UserID||(a+="UserIDSupplied:0;"))}t&&t.AuthAbtEnabled&&n&&n.abtTimeout&&(a+="AbtEnabled:",n.abtSessionId&&(a+=n.abtSessionId),a+=";"),t&&t.AriaViewportLoggingEnabled&&(document.documentElement.clientWidth&&(a+="ViewportWidth:"+document.documentElement.clientWidth.toString()+";"),document.documentElement.clientHeight&&(a+="ViewportHeight:"+document.documentElement.clientHeight.toString()+";"));let s=window.O365ShellContext.React;if(a+="ReactVersion:"+(s&&s.version)+";",n.enableDelayLoading&&(a+="DelayLoad:1;"),n.isThinHeader&&(a+="ThinHeader:1;"),(0,r.YF)().CustomLayoutSpecified&&(a+="CustomLayout:1;"),t&&t.SearchUXAvailable&&n&&n.enableSearchUX&&(a+="SearchUXEnabled:1;"),(null===(o=null==n?void 0:n.initialRenderData)||void 0===o?void 0:o.ShellAssetsContainerOverride)&&(a+="IsNPM:1;"),(null===(i=null==n?void 0:n.initialRenderData)||void 0===i?void 0:i.ShellBootHost)&&(a+=`ShellBootHost:${n.initialRenderData.ShellBootHost};`),t&&"IWApp"===t.WorkloadId&&document.referrer)try{a+="Referrer:"+document.referrer.replace("http://","").replace("https://","").split(/[/?#]/)[0]+";"}catch(e){}return a}(t,n,(0,r.GJ)())),(0,r.NP)().unsubscribe("ShellDataUpdated",e)))}),!0)}var f=s(95144),h=s(28370),m=s(70238),g=s(91112),b=s(90872),v=s(9028),y=s(4963);class x extends h.qs{constructor(e){super(e),this.preventEscPropagation=e=>{27===e.keyCode&&e.stopPropagation()},this.state={isShyHeaderActive:!1},(0,r.NP)().subscribe("ShyHeaderActivated",(e=>{this.setState({isShyHeaderActive:e})}),!0)}onComponentVisible(){super.onComponentVisible(),(0,r.tZ)().impression("CustomFlexPane","FlexPane",0,void 0,"Loaded"),this.props.onFlexPaneOpen&&this.props.onFlexPaneOpen(),this.customRenderContainer&&this.props.render&&this.props.render(this.customRenderContainer)}onComponentHide(){super.onComponentHide(),this.props.onFlexPaneClose&&this.props.onFlexPaneClose()}componentWillUnmount(){this.customRenderContainer&&v.unmountComponentAtNode(this.customRenderContainer),super.componentWillUnmount()}render(){return b.createElement(h.eb,{isActive:this.props.isActive,title:this.props.flexPaneTitle(),customTitle:this.props.customTitle,customTitleClassName:this.props.customTitleClassName,flexPaneProviderID:this.props.flexPaneProviderID,className:this.props.className},b.createElement("div",{id:`CustomFlexPane_${this.props.flexPaneProviderID}`,role:"region",className:(0,f.AH)(y.flexPaneContentContainer,y.flexPaneContentContainerForThinHeader,{[y.flexPaneContentContainerForShyHeader]:this.state.isShyHeaderActive}),onKeyDown:this.props.customEscapeKeyHandling&&this.preventEscPropagation,ref:e=>this.customRenderContainer=e}))}}const A=(0,g.connect)(((e,t)=>{let n=e.extensibilityState.customFlexPanes[t.flexPaneProviderID];return n?Object.assign(Object.assign({},t),{className:n.containerClassName,flexPaneTitle:()=>"function"==typeof n.flexPaneTitle?n.flexPaneTitle():n.flexPaneTitle,customTitle:n.customTitle,customTitleClassName:n.customTitleClassName,render:n.render,customEscapeKeyHandling:n.customEscapeKeyHandling,onFlexPaneOpen:n.onFlexPaneOpen,onFlexPaneClose:n.onFlexPaneClose,triggerControlID:n.triggerControlID}):((0,r.tZ)().tag("UnrecognizedCustomFlexPane",6,t.flexPaneProviderID),null)}))(x);var C=s(69663),S=s.n(C),w=s(57530),k=s(82871),P=s.n(k),O=s(61304);function I(e){return!!e&&"iconFontName"in e}const D="ShellFabricMDL2IconsLite,ShellFabricMDL2Icons";class T extends b.Component{constructor(e){super(e),this.setClickableElement=e=>{this.headerButtonElement=e},this.onClick=e=>{this.props.isStateless&&this.props.onShow&&this.props.onShow(e.currentTarget.getBoundingClientRect()),this.props.onClick&&this.props.onClick(e)},this.state={isHovered:!1}}componentDidUpdate(e,t){this.props.isActive&&!e.isActive&&null!=this.headerButtonElement?this.props.onShow&&this.props.onShow(this.headerButtonElement.getBoundingClientRect()):!this.props.isActive&&e.isActive&&this.props.onHide&&this.props.onHide()}getArialLabel(){var e,t;const n="function"==typeof this.props.ariaLabel?this.props.ariaLabel():this.props.ariaLabel;if(void 0!==this.props.badgeValue&&0!==this.props.badgeValue){if(!this.props.badgeLabel||this.props.badgeLabel.includes("{1}"))return(0,f.JT)(null!==(e=this.props.badgeLabel)&&void 0!==e?e:O.D.UnreadBadge_Count,`${n}`,`${this.props.badgeValue}`);if(null===(t=this.props.badgeLabel)||void 0===t?void 0:t.includes("{0}"))return(0,f.JT)(this.props.badgeLabel,`${this.props.badgeValue}`)}return n}render(){const e={controlID:this.props.id,isVisible:this.props.isAvailable,ariaLabel:this.getArialLabel(),affordanceMenuItemText:"function"==typeof this.props.affordanceMenuItemText?this.props.affordanceMenuItemText():this.props.affordanceMenuItemText,iconData:this.props.iconData?I(this.props.iconData)?{iconFontName:this.props.iconData.iconFontName,iconFontFamily:this.props.iconData.iconFontFamily||D,iconFontSize:w.LV.toString()}:this.props.iconData:{iconFontName:this.props.iconFontName,iconFontFamily:this.props.iconFontFamily||D,iconFontSize:w.LV.toString()},isActive:this.props.isActive,isDarkModeEnabled:!!this.props.isDarkMode,onClick:this.onClick,onHoverStateChanged:e=>{this.setState({isHovered:e})},onDimensionsChanged:this.props.controlDimensionsChanged,setClickableElement:this.setClickableElement,buttonText:this.props.buttonText,responsiveStep:this.props.responsiveStep,hideButton:this.props.hideButton,isNoninteractive:this.props.isNoninteractive,badgeLabel:this.props.badgeLabel};return 0===this.props.renderContext?b.createElement(a.hp,Object.assign({},e),b.createElement(f.xw,{unseenItemCount:this.props.badgeValue,isParentHovered:this.state.isHovered,badgeStyles:P().headerButtonBadgePosition,badgeColors:this.props.badgeColors,badgeCharacter:this.props.badgeCharacter,isDarkMode:!!this.props.isDarkMode})):b.createElement(a.vO,Object.assign({},e),b.createElement(f.xw,{unseenItemCount:this.props.badgeValue,isParentHovered:this.state.isHovered,badgeStyles:S().affordanceContextMenuItemBadgePosition,badgeColors:this.props.badgeColors,badgeCharacter:this.props.badgeCharacter,isDarkMode:!!this.props.isDarkMode}))}}const E=(0,g.connect)(((e,t)=>Object.assign(Object.assign({},t),{badgeValue:e.extensibilityState.badgeValues[t.id],badgeColors:e.extensibilityState.badgeColors[t.id],isActive:!!e.extensibilityState&&t.id===e.extensibilityState.activeButtonId,flexPaneProviderID:e.extensibilityState.customHeaderButtonFlexPaneTriggers[t.id],badgeLabel:e.extensibilityState.badgeLabels[t.id],isDarkMode:e.themeState.IsDarkMode,badgeCharacter:e.extensibilityState.badgeCharacters[t.id]})),((e,t)=>({onClickDispatch:(n,o)=>{o.stopPropagation(),t.onClick&&t.onClick(o),t.isStateless||e((0,f.ad)(o.currentTarget&&o.currentTarget.id)),n&&e((0,h.IZ)(n))}})),((e,t)=>Object.assign(Object.assign(Object.assign({},e),t),{onClick:n=>{t.onClickDispatch(e.flexPaneProviderID,n)}})))(T);var L=s(7102),M=s(6806);const F="suiteux-extensibility.SET_BADGE_VALUE",N="suiteux-extensibility.SET_BADGE_COLOR",B="suiteux-extensibility.SET_BADGE_LABEL",H="suiteux-extensibility.SET_BADGE_CHARACTER";function j(e,t,n,o){let r=Object.assign({},e);t&&t.flexPaneCollection&&t.flexPaneCollection.forEach((e=>{let t=e;t.render&&(r.customFlexPanes[t.flexPaneID]=t)})),n&&(r.customFlexPanes[n.flexPaneID]=n),o&&(r.customFlexpaneWidth=o);let i=Object.keys(r.customFlexPanes).sort();return r.customFlexPaneHash=(0,f.YZ)(JSON.stringify(i)),r}let U={extensibilityState:function(e,t){if(!e){let n=t.shellInitData.shellInitDataState;e=j(f.Jg,n.layout)}switch(t.type){case f.QR:return function(e,t){let n=t.buttonId;e.activeButtonId===n&&(n="");return Object.assign(Object.assign({},e),{activeButtonId:n})}(e,t);case f.zM:return j(e,t.shellLayout);case"suiteux-extensibility.UPDATE_CUSTOMHEADERBUTTON":return function(e,t){let n=Object.assign({},e);for(let o=0;o<t.buttonData.length;o++){const r=t.buttonData[o];let i=(0,f.K$)(e.customHeaderButtons,(e=>e.id===r.id));i>=0?n.customHeaderButtons=[...e.customHeaderButtons.slice(0,i),r,...e.customHeaderButtons.slice(i+1)]:(n.customHeaderButtons=[...e.customHeaderButtons],n.customHeaderButtons.unshift(r))}return n}(e,t);case L.j4:let n=t;return j(e,null,n.customFlexpane,n.customFlexpaneWidth);case L.GY:return function(e,t){let n=Object.assign({},e);delete n.customFlexPanes[t];let o=Object.keys(n.customFlexPanes).sort();return n.customFlexPaneHash=(0,f.YZ)(JSON.stringify(o)),n}(e,t.customFlexpaneID);case M.vG:return function(e,t){let n=e;t.newProvider.shellControlID&&e.customHeaderButtonFlexPaneTriggers[t.newProvider.shellControlID]!==t.newProvider.key&&(n=Object.assign(Object.assign({},e),{customHeaderButtonFlexPaneTriggers:Object.assign({},e.customHeaderButtonFlexPaneTriggers)}),n.customHeaderButtonFlexPaneTriggers[t.newProvider.shellControlID]=t.newProvider.key);return n}(e,t);case F:return function(e,t){let n=e;e.badgeValues[t.buttonID]!==t.badgeValue&&(n=Object.assign(Object.assign({},e),{badgeValues:Object.assign({},e.badgeValues)}),n.badgeValues[t.buttonID]=t.badgeValue);return n}(e,t);case B:return function(e,t){let n=Object.assign({},e);e.badgeLabels[t.buttonID]!==t.badgeLabel&&(n.badgeLabels[t.buttonID]=t.badgeLabel);return n}(e,t);case N:return function(e,t){let n=e;e.badgeColors[t.buttonID]!==t.badgeColors&&(n=Object.assign(Object.assign({},e),{badgeColors:Object.assign({},e.badgeColors)}),n.badgeColors[t.buttonID]=t.badgeColors);return n}(e,t);case H:return function(e,t){let n=e;e.badgeCharacters[t.buttonID]!==t.badgeCharacter&&(n=Object.assign(Object.assign({},e),{badgeCharacters:Object.assign({},e.badgeCharacters)}),n.badgeCharacters[t.buttonID]=t.badgeCharacter);return n}(e,t);default:return e}}};var R=s(93814),_=s(95422),Q=s(40141),z=s(10806),W=s(83379);class Z extends b.Component{constructor(e){super(e),this.onEntryPointClick=()=>{this.props.isStateless?this.props.onShow(this.buttonElement.getBoundingClientRect()):this.props.onToggleButtonState(this.props.id)}}componentDidUpdate(e,t){this.props.isActive&&!e.isActive&&this.buttonElement?this.props.onShow(this.buttonElement.getBoundingClientRect()):!this.props.isActive&&e.isActive&&this.props.onHide()}render(){let e=(0,Q.e)(),t=(0,f.AH)(this.props.isNoninteractive?P().nonInteractiveButton:P().button,W.customHeaderButton,this.props.isNoninteractive?e.nonInteractiveButton:e.headerButton,{[e.activeHeaderButton]:this.props.isActive});const{iconData:n}=this.props;return this.props.isNoninteractive?b.createElement(z.e,{controlID:this.props.id,isActive:this.props.isActive,controlElement:this.buttonElement},b.createElement("div",{className:W.customHeaderButtonWrapper},b.createElement("span",{className:(0,f.AH)(t),role:"presentation",id:`CustomHeader_${this.props.id}`,ref:e=>this.buttonElement=e,onClick:null,"aria-label":this.props.ariaLabel,style:I(n)?{fontFamily:n.iconFontFamily}:void 0,title:this.props.ariaLabel,"aria-expanded":this.props.isActive},I(n)?b.createElement(f.rP,{fontSize:"16",fontValue:n.iconFontName}):n.element))):b.createElement(z.e,{controlID:this.props.id,isActive:this.props.isActive,controlElement:this.buttonElement},b.createElement("div",{className:W.customHeaderButtonWrapper},b.createElement("button",{className:(0,f.AH)(t),type:"button",role:"button",id:`CustomHeader_${this.props.id}`,ref:e=>this.buttonElement=e,onClick:this.onEntryPointClick,"aria-label":this.props.ariaLabel,style:I(n)?{fontFamily:n.iconFontFamily}:void 0,title:this.props.ariaLabel,"aria-expanded":this.props.isActive},I(n)?b.createElement(f.rP,{fontSize:"16",fontValue:n.iconFontName}):n.element)))}}const K=(0,g.connect)(((e,t)=>Object.assign(Object.assign({},t),{isActive:!!e.extensibilityState&&t.id===e.extensibilityState.activeButtonId})),(e=>({onToggleButtonState:t=>{e((0,f.ad)(t))}})))(Z);let V=[];let q=(0,f.OU)();class G{AddOrUpdateCustomHeaderButton(...e){for(let t=0;t<e.length;t++){const n=e[t];(0,r.tZ)().tag("AddOrUpdateCustomHeaderButton",1,n.id,n.iconData?I(n.iconData)?n.iconData.iconFontName:"SVG element":n.iconFontName)}!function(...e){const t=(0,f.OU)();for(let t=0;t<e.length;t++){const n=e[t];if("object"!=typeof n||Array.isArray(n))continue;const o=(0,f.K$)(V,(e=>e.id===n.id));o>=0?V=[...V.slice(0,o),n,...V.slice(o+1)]:V.push(n)}let n=t.getState().shellInitDataState;if(n.layout){const e=(0,r.YF)();e.DefaultLayoutState.CustomHeaderButtons=V,e.ConfigureCustomHeaderButtons(n.layout,V),(0,r.NP)().invoke("ShellLayoutUpdated",n.layout)}else{const e=[...V].reverse().map((e=>{var t;return b.createElement(K,{key:e.id,id:e.id,iconData:null!==(t=e.iconData)&&void 0!==t?t:{iconFontName:e.iconFontName,iconFontFamily:e.iconFontFamily},onHide:e.onHide,onShow:e.onShow,isStateless:e.isStateless,ariaLabel:"function"==typeof e.ariaLabel?e.ariaLabel():e.ariaLabel})})),n=document.getElementById("O365_CustomHeaderButtonsContainer");if(!n)return;n.style.height="48px",v.render(b.createElement(g.Provider,{store:t},b.createElement("div",{className:W.customHeaderButtonsContainer},e)),n)}}(...e)}AddOrUpdateCustomFlexpane(e,t){let n=(0,f.OU)();n.dispatch((0,_.Ig)(e.flexPaneID)),null!=n.getState().extensibilityState.customFlexPanes[e.flexPaneID]&&n.dispatch((0,R.rv)(e.flexPaneID)),n.dispatch((0,R.mA)(e,t))}UpdateButtonState(e,t){const n=(0,f.OU)(),o=n.getState().extensibilityState;o.activeButtonId!==e||t?o.activeButtonId!==e&&t&&n.dispatch((0,f.ad)(e)):n.dispatch((0,f.ad)(""))}SetCustomHeaderButtonBadgeValue(e,t){q.dispatch(function(e,t){return{type:F,buttonID:e,badgeValue:t}}(e,t))}SetCustomHeaderButtonBadgeColor(e,t){q.dispatch(function(e,t){return{type:N,buttonID:e,badgeColors:t}}(e,t))}SetCustomHeaderButtonBadgeLabel(e,t){q.dispatch({type:B,buttonID:e,badgeLabel:t})}SetCustomHeaderButtonBadgeCharacter(e,t){q.dispatch(function(e,t){return{type:H,buttonID:e,badgeCharacter:t}}(e,t))}}function J(){f.h5.register(U),function(){let e=new G,t=window.O365Shell.Extensibility;window.O365Shell.Extensibility=e,t.applyCalls(e)}();let e,t=(0,f.OU)();function n(){let n=t.getState();if(e!==n.extensibilityState.customFlexPaneHash){Object.keys(n.extensibilityState.customFlexPanes).forEach((e=>{if(!n.flexPaneState.registeredProviders.some((t=>t.key===e))){const o=n.extensibilityState.customFlexPanes[e],r=n.extensibilityState.customFlexpaneWidth?n.extensibilityState.customFlexpaneWidth:h.xk;t.dispatch((0,h.ZM)({component:A,btnId:o.triggerControlID,shellControlID:o.triggerControlID,key:e,width:r}))}}))}e=n.extensibilityState.customFlexPaneHash}n(),(0,r.NP)().invoke("LazyComponentLoaded",m.J,E),t.subscribe(n)}var Y=s(53512),X=s(99542),$=s(71936);class ee extends b.Component{render(){let e={controlID:this.props.id,isVisible:this.props.isAvailable,ariaLabel:O.D.FeatureFlags_Title,affordanceMenuItemText:O.D.FeatureFlags_Title,iconID:"FeatureFlagsLogo",iconFontSize:w.LV.toString(),isActive:this.props.isActive,isDarkModeEnabled:this.props.isDarkModeEnabled,onClick:this.props.onClick,onDimensionsChanged:this.props.controlDimensionsChanged};return 0===this.props.renderContext?b.createElement(a.hp,Object.assign({},e)):b.createElement(a.vO,Object.assign({},e))}}const te=(0,g.connect)(((e,t)=>({id:t&&t.id,isAvailable:!0,isActive:e.flexPaneState&&"FeatureFlags"===e.flexPaneState.activeProviderKey,controlDimensionsChanged:t.controlDimensionsChanged})),(e=>({onClick:(t,n)=>{t.stopPropagation(),n.onClick&&n.onClick(t),e((0,f.ad)(t.currentTarget&&t.currentTarget.id)),e((0,h.IZ)("FeatureFlags"))}})),((e,t,n)=>{let o=Object.assign(Object.assign({},n),e);return Object.assign(Object.assign(Object.assign({},o),t),{onClick:e=>t.onClick(e,o),onDimensionsChanged:()=>t.onDimensionsChanged(o)})}))(ee),ne="suiteux-mecontrol.UPDATE_WORKLOAD_FEATURE_FLAG_LIST";let oe={featureFlagsState:function(e,t){return e||(e={enabled:!1,workloadFeatureFlagList:{}}),t.type===ne?function(e,t){let n=t;return Object.assign(Object.assign({},e),{workloadFeatureFlagList:n.workloadFeatureFlagList})}(e,t):e}};class re{AddFeatureFlags(e){e?(0,f.OU)().dispatch(function(e){return{type:ne,workloadFeatureFlagList:e}}(e)):(0,r.tZ)().tag("FeatureFlags_Shim_FeatureFlags_Param_Invalid",6)}SubscribeToFeatureFlagStatusChange(e){return(0,r.NP)().subscribe("FeatureFlagChanged",e,!1)}}function ie(){f.h5.register(oe),function(){let e=new re,t=window.O365Shell.FeatureFlags;window.O365Shell.FeatureFlags=e,t.applyCalls(e)}(),(0,r.NP)().subscribe("ShellDataUpdated",ae,!0)}function ae(e,t){if(t.FeatureFlagsEnabled){const e=(0,Y._)((()=>s.e("featureflags").then(s.bind(s,72848)).then((e=>e.FeatureFlagsFlexPanePanelConnector))));let t=(0,r.GJ)().layout,n={component:e,key:"FeatureFlags",width:h.xk};if(t){(0,r.NP)().invoke("LazyComponentLoaded",$.p,te),n.nativeControlID="FeatureFlags"}else n.btnId=X.DP;(0,f.OU)().dispatch((0,h.ZM)(n))}}var se=s(82453),ce=s(94361),le=s(66164),ue=s(8428),de=s(98052),pe=s(85348),fe=s(83496);class he extends b.Component{componentDidMount(){this.props.isAvailable&&(0,r.tZ)().perfMarker("MyDayTimeToInteractive")}render(){let e={controlID:this.props.id,isVisible:this.props.isAvailable,ariaLabel:O.D.MyDay,affordanceMenuItemText:O.D.MyDay,iconID:"EventToDoLogo",iconFontSize:w.LV.toString(),isActive:this.props.isActive,isDarkModeEnabled:this.props.isDarkModeEnabled,onClick:this.props.onClick,onDimensionsChanged:this.props.controlDimensionsChanged};return 0===this.props.renderContext?b.createElement(fe.h,Object.assign({},e)):b.createElement(pe.v,Object.assign({},e))}}const me=(0,g.connect)(((e,t)=>{var n;return{isAvailable:e.shellInitDataState.clientData.OpxEnabled&&e.shellInitDataState.clientData.MyDayOpxEnabled,id:null==t?void 0:t.id,isActive:"MyDay"===(null===(n=e.flexPaneState)||void 0===n?void 0:n.activeProviderKey),controlDimensionsChanged:t.controlDimensionsChanged}}),(e=>({onClick:(t,n)=>{var o;t.stopPropagation(),(0,r.tZ)().click("MyDay","NavBar",null,null,`Active state: ${n.isActive}, Render context: ${n.renderContext}`),e((0,f.ad)(null===(o=t.currentTarget)||void 0===o?void 0:o.id)),e((0,_.IZ)("MyDay")),n.onClick&&n.onClick(t)}})),((e,t,n)=>{let o=Object.assign(Object.assign({},n),e);return Object.assign(Object.assign(Object.assign({},o),t),{onClick:e=>t.onClick(e,o),onDimensionsChanged:()=>t.onDimensionsChanged(o)})}))(he);function ge(e,t){if(t.OpxEnabled&&t.MyDayOpxEnabled&&!(0,le.bi)(t.WorkloadId,e.CurrentMainLinkElementID)){(0,r.NP)().unsubscribe("ShellDataUpdated",ge);const e=()=>Promise.all([s.e("plus"),s.e("myday")]).then(s.bind(s,74386));let t={component:(0,Y._)((()=>e().then((e=>e.MyDayFlexPaneConnector)))),key:"MyDay",width:ue.x};(0,r.NP)().invoke("LazyComponentLoaded",de.q,me),t.nativeControlID="MyDay",(0,se.O)().dispatch((0,_.ZM)(t))}}var be=s(36558);class ve extends b.Component{componentDidMount(){this.props.isAvailable&&(0,r.tZ)().perfMarker("HelpTimeToInteractive")}render(){let e={controlID:this.props.id,isVisible:this.props.isAvailable,ariaLabel:O.D.Help_Title,affordanceMenuItemText:O.D.Help,iconID:this.props.flipHelpIcon?"HelpMirrored":"Help",iconFontSize:w.LV.toString(),isActive:this.props.isActive,isDarkModeEnabled:this.props.isDarkModeEnabled,onClick:this.props.onClick,onDimensionsChanged:this.props.controlDimensionsChanged};return 0===this.props.renderContext?b.createElement(a.hp,Object.assign({},e)):b.createElement(a.vO,Object.assign({},e))}}const ye=(0,g.connect)(((e,t)=>{var n,o;return{isAvailable:!(null===(o=null===(n=e.shellInitDataState)||void 0===n?void 0:n.clientData)||void 0===o?void 0:o.HelpPaneDisabled),id:t&&t.id,isActive:e.flexPaneState&&"Help"===e.flexPaneState.activeProviderKey,flipHelpIcon:e.headerState&&e.headerState.flipHelpIcon,controlDimensionsChanged:t.controlDimensionsChanged}}),(e=>({onClick:(t,n)=>{t.stopPropagation(),(0,r.tZ)().click("Help","NavBar",null,null,`Active state: ${n.isActive}, Render context: ${n.renderContext}`),e((0,f.ad)(t&&t.currentTarget&&t.currentTarget.id));let o=(0,r.GJ)();!o||null!=o.OnHelpButtonClick&&o.OnHelpButtonClick()||e((0,h.IZ)("Help")),n.onClick&&n.onClick(t)}})),((e,t,n)=>{let o=Object.assign(Object.assign({},n),e);return Object.assign(Object.assign(Object.assign({},o),t),{onClick:e=>t.onClick(e,o),onDimensionsChanged:()=>t.onDimensionsChanged(o)})}))(ve);var xe=s(51545);let Ae=null;function Ce(e,t){let n;n=t.EnableVNextFeedback?(0,Y._)((()=>Ae().then((e=>e.FeedbackButtonPanelConnector)))):(0,Y._)((()=>Ae().then((e=>e.FeedbackFlexPaneConnector))));const o=(0,r.GJ)(),i=!(!o.feedbackUiType||(0,xe.m)((0,xe.k)(o.feedbackUiType)));(0,f.OU)().dispatch((0,h.ZM)({component:n,key:"Feedback",width:h.xk,hideFlexPane:i}))}var Se=s(21226);class we extends b.Component{componentDidMount(){this.props.isAvailable&&(0,r.tZ)().perfMarker("SettingsTimeToInteractive")}render(){let e={controlID:this.props.id,isVisible:this.props.isAvailable,ariaLabel:O.D.Settings,affordanceMenuItemText:O.D.Settings,iconID:"Settings",iconFontSize:w.LV.toString(),isActive:this.props.isActive,isDarkModeEnabled:this.props.isDarkModeEnabled,onClick:this.props.onClick,onDimensionsChanged:this.props.controlDimensionsChanged};return 0===this.props.renderContext?b.createElement(a.hp,Object.assign({},e)):b.createElement(a.vO,Object.assign({},e))}}var ke=s(92720);const Pe=(0,g.connect)(((e,t)=>{let n=!1;if(e.shellInitDataState.layout)if(e.shellInitDataState.clientData.SettingsPaneEnabled){n=(0,ke.S)(Object.assign(Object.assign({},e.shellInitDataState.clientData),{CurrentMainLinkElementID:e.shellInitDataState.navBarData.CurrentMainLinkElementID}),null,e.settingsFlexPaneState.workloadSettingLinks).length>0}else n=!1;return{isAvailable:n,id:t&&t.id,isActive:e.flexPaneState&&"Settings"===e.flexPaneState.activeProviderKey,controlDimensionsChanged:t.controlDimensionsChanged}}),(e=>({onClick:(t,n)=>{t.stopPropagation(),(0,r.tZ)().click("Settings","NavBar",null,null,`Active state: ${n.isActive}, Render context: ${n.renderContext}`),n.onClick&&n.onClick(t),e((0,f.ad)(t.currentTarget&&t.currentTarget.id)),e((0,h.IZ)("Settings"))}})),((e,t,n)=>{let o=Object.assign(Object.assign({},n),e);return Object.assign(Object.assign(Object.assign({},o),t),{onClick:e=>t.onClick(e,o),onDimensionsChanged:()=>t.onDimensionsChanged(o)})}))(we);var Oe=s(84107),Ie=s(1742),De=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Te=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Ee=/[^-+\dA-Z]/g;function Le(e,t,n,o){if(1!==arguments.length||"string"!=typeof e||/\d/.test(e)||(t=e,e=void 0),(e=e||0===e?e:new Date)instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");var r=(t=String(Me[t]||t||Me.default)).slice(0,4);"UTC:"!==r&&"GMT:"!==r||(t=t.slice(4),n=!0,"GMT:"===r&&(o=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},s=function(){return e[i()+"Day"]()},c=function(){return e[i()+"Month"]()},l=function(){return e[i()+"FullYear"]()},u=function(){return e[i()+"Hours"]()},d=function(){return e[i()+"Minutes"]()},p=function(){return e[i()+"Seconds"]()},f=function(){return e[i()+"Milliseconds"]()},h=function(){return n?0:e.getTimezoneOffset()},m=function(){return He(e)},g={d:function(){return a()},dd:function(){return Ne(a())},ddd:function(){return Fe.dayNames[s()]},DDD:function(){return Be({y:l(),m:c(),d:a(),_:i(),dayName:Fe.dayNames[s()],short:!0})},dddd:function(){return Fe.dayNames[s()+7]},DDDD:function(){return Be({y:l(),m:c(),d:a(),_:i(),dayName:Fe.dayNames[s()+7]})},m:function(){return c()+1},mm:function(){return Ne(c()+1)},mmm:function(){return Fe.monthNames[c()]},mmmm:function(){return Fe.monthNames[c()+12]},yy:function(){return String(l()).slice(2)},yyyy:function(){return Ne(l(),4)},h:function(){return u()%12||12},hh:function(){return Ne(u()%12||12)},H:function(){return u()},HH:function(){return Ne(u())},M:function(){return d()},MM:function(){return Ne(d())},s:function(){return p()},ss:function(){return Ne(p())},l:function(){return Ne(f(),3)},L:function(){return Ne(Math.floor(f()/10))},t:function(){return u()<12?Fe.timeNames[0]:Fe.timeNames[1]},tt:function(){return u()<12?Fe.timeNames[2]:Fe.timeNames[3]},T:function(){return u()<12?Fe.timeNames[4]:Fe.timeNames[5]},TT:function(){return u()<12?Fe.timeNames[6]:Fe.timeNames[7]},Z:function(){return o?"GMT":n?"UTC":Ue(e)},o:function(){return(h()>0?"-":"+")+Ne(100*Math.floor(Math.abs(h())/60)+Math.abs(h())%60,4)},p:function(){return(h()>0?"-":"+")+Ne(Math.floor(Math.abs(h())/60),2)+":"+Ne(Math.floor(Math.abs(h())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return m()},WW:function(){return Ne(m())},N:function(){return je(e)}};return t.replace(De,(function(e){return e in g?g[e]():e.slice(1,e.length-1)}))}var Me={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Fe={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Ne=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")},Be=function(e){var t=e.y,n=e.m,o=e.d,r=e._,i=e.dayName,a=e.short,s=void 0!==a&&a,c=new Date,l=new Date;l.setDate(l[r+"Date"]()-1);var u=new Date;u.setDate(u[r+"Date"]()+1);return c[r+"FullYear"]()===t&&c[r+"Month"]()===n&&c[r+"Date"]()===o?s?"Tdy":"Today":l[r+"FullYear"]()===t&&l[r+"Month"]()===n&&l[r+"Date"]()===o?s?"Ysd":"Yesterday":u[r+"FullYear"]()===t&&u[r+"Month"]()===n&&u[r+"Date"]()===o?s?"Tmw":"Tomorrow":i},He=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var o=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-o);var r=(t-n)/6048e5;return 1+Math.floor(r)},je=function(e){var t=e.getDay();return 0===t&&(t=7),t},Ue=function(e){return(String(e).match(Te)||[""]).pop().replace(Ee,"").replace(/GMT\+0000/g,"UTC")},Re=s(87894),_e=s(6936);const Qe="UTC",ze="tzone://Microsoft/Utc";class We{constructor(){this.timeZones=null,this.timeZoneOffsets=[]}get isInitialized(){return null!=this.timeZones&&this.timeZoneOffsets.length>0}initializeTimeZoneConverter(e){this.timeZoneOffsets=e,this.timeZones={}}convert(e,t,n){if(null===this.timeZones)throw Error("LoadTimeZoneOffsets must be called before convert.");if(e===ze&&(e=Qe),t===ze&&(t=Qe),null==n||e===t)return n;let o=qe.parseISO8601DateTime(n),r=0;e===Qe?(r=this.findOffsetInUTC(t,o),o=o.addMinutes(r)):t===Qe?(r=this.findOffsetInLocal(e,o),o=o.addMinutes(0-r)):(r=this.findOffsetInLocal(e,o),o=o.addMinutes(0-r),r=this.findOffsetInUTC(t,o),o=o.addMinutes(r));let i=-1===n.indexOf(".")?qe.generateISO8601DateTimeString(o):qe.generateISO8601DateTimeMsString(o);if(t===Qe)i+="Z";else{let e=Math.abs(r),t=Math.floor(e/60),n=e%60;i+=(r<0?"-":"+")+(t<10?"0"+t:t.toString())+":"+(n<10?"0"+n:n.toString())}return i}findOffsetInLocal(e,t){let n=this.getTimeZoneRanges(e);if(null==n)throw Error("Unknown time zone specified: "+e);for(let e of n)if(t.compare(e.localStart)>=0&&t.compare(e.localEnd)<0)return e.offset;throw new Error("Could not find an offset for this time stamp")}findOffsetInUTC(e,t){let n=this.getTimeZoneRanges(e);if(null==n)throw Error("Unknown time zone specified: "+e);for(let e of n)if(t.compare(e.utcStart)>=0&&t.compare(e.utcEnd)<0)return e.offset;throw new Error("Could not find an offset for this time stamp")}ConvertDateTimeMembersTimeZone(e,t,n,o,r,i){throw new Error("Unimplemented.")}getTimeZoneRanges(e){let t=this.timeZones[e];return null==t&&(this.loadOffsetsForTimezone(e),t=this.timeZones[e]),t}loadOffsetsForTimezone(e){let t;for(let n of this.timeZoneOffsets)if(e===n.TimeZoneId){t=n.OffsetRanges;break}if(!t||0===t.length)return void(0,r.tZ)().tag("TimeZoneConverter_NoIncomingOffsetRanges",6,e);let n=t.map((e=>({utcStart:qe.parseISO8601DateTime(e.UtcTime),offset:e.Offset})));n.forEach(((e,t)=>{if(0===t?(e.utcStart=qe.MinValue,e.localStart=qe.MinValue):e.localStart=e.utcStart.addMinutes(e.offset),t+1===n.length)e.utcEnd=qe.MaxValue,e.localEnd=qe.MaxValue;else{let o=n[t+1];e.utcEnd=o.utcStart,e.localEnd=e.utcEnd.addMinutes(Math.max(e.offset,o.offset))}})),this.timeZones[e]=n}}const Ze={TimeFormat:"hh:mm tt",DateFormat:"MM/dd/yyyy",TimeZone:"Pacific Standard Time",UserCulture:"default",WeekStartDay:0,FirstWeekOfYear:0,get TimeZoneOffsets(){return[{TimeZoneId:this.TimeZone,OffsetRanges:[{UtcTime:"1970-01-01T00:00:00Z",Offset:-180}]}]}};class Ke{constructor(e){let t=e.UserOptions||{},n=t.MailboxTimeZoneOffset;this.timeFormat=t.TimeFormat||Ze.TimeFormat,this.dateFormat=t.DateFormat||Ze.DateFormat,this.timeZone=t.TimeZone||Ze.TimeZone,this.userCulture=null!=e.SessionSettings?e.SessionSettings.UserCulture:Ze.UserCulture,this.weekStartDay=null!=t.WeekStartDay?t.WeekStartDay:Ze.WeekStartDay,this.firstWeekOfYear=null!=t.FirstWeekOfYear?t.FirstWeekOfYear:Ze.FirstWeekOfYear,this.timeZoneConverter=new We,this.timeZoneConverter.initializeTimeZoneConverter(null!=n?n:Ze.TimeZoneOffsets)}static get Instance(){return null==Ke.instance&&(Ke.instance=new Ke({})),Ke.instance}static populate(e){Ke.instance=new Ke(e)}}const Ve=864e13;class qe{constructor(e,t,n,o=0,r=0,i=0,a=0,s=0){if(t<0||t>11||n<0||n>31||o<0||o>23||r<0||r>59||i<0||i>59||a<0||a>999)throw new Error("Date part out of range.");this.localTime=new Date(Date.UTC(e,t,n,o,r,i,a)),this.utcOffsetInMinutes=null==s?qe.timeZoneConverter.findOffsetInLocal(qe.timeZone,qe.fromNativeDateTime(this.localTime)):s,qe.throwIfDateOutOfRange(this)}get date(){return this.localTime.getUTCDate()}get month(){return this.localTime.getUTCMonth()}get year(){return this.localTime.getUTCFullYear()}get hour(){return this.localTime.getUTCHours()}get second(){return this.localTime.getUTCSeconds()}get minute(){return this.localTime.getUTCMinutes()}get millisecond(){return this.localTime.getUTCMilliseconds()}static get timeZone(){return Ke.Instance.timeZone}static get Now(){let e=qe.timeZoneConverter.convert(Qe,qe.timeZone,qe.generateISO8601DateTimeMsStringWithOffset(qe.UTCNow));return qe.parseISO8601DateTime(e)}static get timeZoneConverter(){return Ke.Instance.timeZoneConverter}static get UTCNow(){return qe.fromNativeDateTime(new Date).toUTC()}static get now(){let e=qe.timeZoneConverter.convert(Qe,qe.timeZone,qe.generateISO8601DateTimeMsStringWithOffset(qe.UTCNow));return qe.parseISO8601DateTime(e)}static fromNativeDateTime(e){return new qe(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds(),-e.getTimezoneOffset())}format(e){return Le(this.localTime,qe.getDateFormatMask(e),!0)}static parseISO8601DateTime(e=""){let t=qe.isoRegex.exec(e);if(null==t||15!==t.length)throw new Error((0,u.JT)("Unexpected datetime format (value: {0}).",e));let n=parseInt(t[1],10),o=parseInt(t[2],10),r=parseInt(t[3],10),i=0,a=0,s=0,c=0,l=0;return null!=t[5]&&null!=t[6]&&null!=t[7]&&(i=parseInt(t[5],10),a=parseInt(t[6],10),s=parseInt(t[7],10),null!=t[9]&&(c=parseInt(t[9],10))),null!=t[10]&&"Z"!==t[10].toUpperCase()&&(l+=60*parseInt(t[13],10),l+=parseInt(t[14],10),"-"===t[12]&&(l=-l)),new qe(n,o-1,r,i,a,s,c,l)}static generateISO8601DateTimeString(e){return qe.generateISO8601DateTimeMsString(e,!1)}static generateISO8601DateTimeMsString(e,t=!0){const n="yyyy-MM-dd'T'HH:mm:ss"+(t?".l":"");return e.format(n)}static generateISO8601DateTimeMsStringWithOffset(e){return qe.generateISO8601DateTimeMsString(e)+e.getUtcOffsetDisplayString()}getUtcOffsetDisplayString(){if(0===this.utcOffsetInMinutes)return"Z";const e=Math.floor(Math.abs(this.utcOffsetInMinutes)/60),t=Math.abs(this.utcOffsetInMinutes)%60,n=this.utcOffsetInMinutes<0?"-":"+";return(0,u.JT)("{0}{1}:{2}",n,Ge(e,2),Ge(t,2))}static areDatePartsEqual(e,t){return null===e&&null===t||null!==e&&null!=t&&0===e.compareDatePart(t)}compare(e){return Re.throwOnNullOrUndefined(e,"other"),this.localTime.getTime()-e.localTime.getTime()}clone(){let e=new qe(0,0,0,0,0,0,0,0);return e.localTime.setTime(this.localTime.getTime()),e.utcOffsetInMinutes=this.utcOffsetInMinutes,e}addMilliseconds(e){qe.throwIfNotNumber(e);let t=this.clone();const n=t.localTime.getTime()+e;return t.localTime.setTime(n),qe.throwIfDateOutOfRange(t),t}Subtract(e){return Re.throwOnNullOrUndefined(e,"value"),this.localTime.getTime()-e.localTime.getTime()}addSeconds(e){return qe.throwIfNotNumber(e),this.addMilliseconds(1e3*e)}addMinutes(e){return qe.throwIfNotNumber(e),this.addMilliseconds(e*_e.I9)}addHours(e){return qe.throwIfNotNumber(e),this.addMilliseconds(e*_e.Q)}addDays(e){return qe.throwIfNotNumber(e),this.addMilliseconds(e*_e.Gj)}toUTC(){if(0===this.utcOffsetInMinutes)return this;let e=this.addMinutes(-this.utcOffsetInMinutes);return e.utcOffsetInMinutes=0,e}getNativeDateTime(){return new Date(this.toUTC().getUTCMilliseconds())}getUTCMilliseconds(){return this.toUTC().localTime.getTime()}GetMilliseconds(){return this.localTime.getTime()}compareDatePart(e){return qe.getDatePartHashValue(this)-qe.getDatePartHashValue(e)}static throwIfNotNumber(e){if("number"!=typeof e)throw Error("Argument must be of type number, but is type "+typeof e)}static throwIfDateOutOfRange(e){if(!qe.isValidDate(e))throw new Error("The resulting DateTime is less than MinValue or greater than MaxValue")}static isValidDate(e){return null!=e&&!isNaN(e.localTime.getTime())&&e.localTime.getTime()>=-864e13&&e.localTime.getTime()<=Ve}static getDatePartHashValue(e){return e.date+(e.month<<5)+(e.year<<9)}static getDateFormatMask(e){let t=!1;return e.replace(/[mMtT']/g,(e=>{if(t)return t="'"!==e,e;switch(e){case"'":return t=!0,e;case"m":return"M";case"M":return"m";case"t":return"T";case"T":return"t";default:return e}}))}}function Ge(e,t){let n=e.toString();for(;n.length<t;)n="0"+n;return n}qe.isoRegex=/^(\d{4})-(\d{2})-(\d{2})(T(\d{2}):(\d{2}):(\d{2})([,\.](\d{3})\d*){0,1}){0,1}(Z|(([-\+])(\d{2}):?(\d{2}))){0,1}$/,qe.MaxValue=new qe(275760,8,13,0,0,0,0,0),qe.MinValue=new qe(-271821,3,20,0,0,0,0,0);var Je=s(67172),Ye=s(42970);function Xe(e,t,n,o){return e?Object.assign(Object.assign({},e),{workloadData:n,workloadSettingLinksTitle:e.workloadSettingLinksTitle||o&&o.workloadSettingsSubLinksTitle||(null==t?void 0:t.CurrentWorkloadSettingsSubLinksTitle)||(null==n?void 0:n.AppHeaderLinkText),workloadSettingLinks:[...(null==t?void 0:t.CurrentWorkloadSettingsSubLinks)||[],...o&&o.workloadSettingsSubLinks||[]]}):Object.assign(Object.assign({},e),{themeCardState:{selectedThemeId:(0,r.Vz)().getCurrentThemeId(),themeData:[],preferOfficeTheme:(0,r.Vz)().getThemeState().preferOfficeTheme,fullBleedThemesEnabled:n&&n.EduThemingEnabled&&(n.ActiveExperiences||"").split(",").some((e=>"edu"===e.toLowerCase())),showMonarchColorThemes:n&&n.ShowMonarchColorThemes},languageAndRegionCardState:{selectedLanguage:"",selectedDateFormat:"",selectedTimeFormat:"",selectedTimeZone:"",languageChoices:[],timeZoneChoices:[],dateFormatChoices:[],timeFormatChoices:[],savedLanguage:"",savedDateFormat:"",savedTimeFormat:"",savedTimeZone:""},aboutCardState:{correlationID:o&&o.correlationID?o.correlationID:O.D.NotAvailable,sessionID:o&&o.sessionID?o.sessionID:O.D.NotAvailable,version:(null==o?void 0:o.version)?o.version:O.D.NotAvailable},workloadData:n,workloadId:n&&n.WorkloadId?n.WorkloadId:"",expandO365Settings:!1,workloadSettingLinksTitle:o&&o.workloadSettingsSubLinksTitle||(null==t?void 0:t.CurrentWorkloadSettingsSubLinksTitle)||(null==n?void 0:n.AppHeaderLinkText),workloadSettingLinks:[...(null==t?void 0:t.CurrentWorkloadSettingsSubLinks)||[],...o&&o.workloadSettingsSubLinks||[]],cards:[]})}function $e(e){const t=-1!==e.indexOf("HH");return new qe(2018,8,1,t?21:9,5).format(e).replace("Sep",O.D.SeptemberAbbrev).replace("September",O.D.September)}const et={settingsFlexPaneState:function(e,t){if(!e){const n=t.shellInitData.shellInitDataState;e=Xe(null,n.navBarData,n.clientData,n.renderSettings)}switch(t.type){case f.l5:const n=t;return Xe(e,n.navBarData,n.shellClientData,n.renderSettings);case Ye.cj:return function(e,t){const n=t,o=(0,f.K$)(e.workloadSettingLinks,(e=>e.Id===n.newWorkloadSettingLink.Id));if(!(0,Oe.l)(n.newWorkloadSettingLink))return e;const r=o>=0?Object.assign(Object.assign({},e),{workloadSettingLinks:[...e.workloadSettingLinks.slice(0,o),n.newWorkloadSettingLink,...e.workloadSettingLinks.slice(o+1)]}):Object.assign(Object.assign({},e),{workloadSettingLinks:e.workloadSettingLinks.concat(n.newWorkloadSettingLink)});return r}(e,t);case Ye.XL:return function(e,t){const n=t,o=(0,f.K$)(e.workloadSettingLinks,(e=>e.Id===n.settingLinkID));if(o>=0)return Object.assign(Object.assign({},e),{workloadSettingLinks:[...e.workloadSettingLinks.slice(0,o),...e.workloadSettingLinks.slice(o+1)]});return e}(e,t);case Ye.Rq:return function(e,t){const n=t,o=n.newWorkloadSettingsLinks.filter((e=>(0,Oe.l)(e)));if(0===o.length)return e;return Object.assign(Object.assign({},e),{workloadSettingLinks:o})}(e,t);case Ye._f:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{cards:n.cardData})}(e,t);case f.BE:return function(e,t){const n=t,o=(0,r.Vz)().getUserPersonalizationAllowed(),i=(0,Je.cv)(n.themeData||[],e.themeCardState.selectedThemeId,e.themeCardState.preferOfficeTheme,o);return Object.assign(Object.assign({},e),{themeCardState:Object.assign(Object.assign({},e.themeCardState),{themeData:i})})}(e,t);case f.bS:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{themeCardState:Object.assign(Object.assign({},e.themeCardState),{selectedThemeId:n.themeInfo.ThemeId||Ie.ux,preferOfficeTheme:n.themeInfo.PreferOfficeTheme})})}(e,t);case Ye.Eh:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{selectedLanguage:n.selectedLanguage,savedLanguage:n.selectedLanguage})})}(e,t);case Ye.T9:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{languageChoices:n.languageChoices.map((e=>({id:e.Locale,text:e.DisplayName,language:e.Locale})))})})}(e,t);case Ye.nf:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{selectedLanguage:n.selectedLanguage})})}(e,t);case Ye.wS:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{selectedTimeZone:n.timeZoneChoice,selectedDateFormat:n.dateFormatChoice,selectedTimeFormat:n.timeFormatChoice,savedTimeZone:n.timeZoneChoice,savedDateFormat:n.dateFormatChoice,savedTimeFormat:n.timeFormatChoice})})}(e,t);case Ye.Kt:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{timeZoneChoices:n.timeZoneChoices.map((e=>({id:e.alias,text:e.displayName})))})})}(e,t);case Ye.u4:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{selectedTimeZone:n.selectedTimeZone})})}(e,t);case Ye.uT:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{dateFormatChoices:n.dateFormatChoices.map((e=>({id:e,text:$e(e)})))})})}(e,t);case Ye.Ul:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{selectedDateFormat:n.selectedDateFormat})})}(e,t);case Ye.jj:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{timeFormatChoices:n.timeFormatChoices.map((e=>({id:e,text:$e(e)})))})})}(e,t);case Ye.nt:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},e.languageAndRegionCardState),{selectedTimeFormat:n.selectedTimeFormat})})}(e,t);case Ye.ar:return function(e){const t=e.languageAndRegionCardState;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},t),{savedLanguage:t.selectedLanguage,savedTimeZone:t.selectedTimeZone,savedDateFormat:t.selectedDateFormat,savedTimeFormat:t.selectedTimeFormat})})}(e);case Ye.Xu:return function(e){const t=e.languageAndRegionCardState;return Object.assign(Object.assign({},e),{languageAndRegionCardState:Object.assign(Object.assign({},t),{selectedLanguage:t.savedLanguage,selectedTimeZone:t.savedTimeZone,selectedDateFormat:t.savedDateFormat,selectedTimeFormat:t.savedTimeFormat})})}(e);case Ye.dE:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{parentCardId:n.cardId})}(e,t);case Ye.oc:return function(e,t){const n=t;return Object.assign(Object.assign({},e),{expandO365Settings:n.isExpanded})}(e,t);default:return e}}};var tt=s(33106);class nt{AddOrUpdateWorkloadSettingLink(e){(0,f.OU)().dispatch((0,tt.Xm)(e))}RemoveWorkloadSettingLink(e){(0,f.OU)().dispatch((0,tt.G4)(e))}SetWorkloadSettingsLinks(e){(0,f.OU)().dispatch((0,tt.S)(e))}}function ot(e,t){let n=(0,r.GJ)().layout;const o=(0,f.OU)().getState().settingsFlexPaneState.workloadSettingLinks;if(!n){let n=t.SettingsPaneEnabled&&(0,ke.S)(Object.assign(Object.assign({},t),{CurrentMainLinkElementID:e.CurrentMainLinkElementID}),null,o).length>0,r=document.getElementById(X.Xf);r&&n&&(r.style.display="block")}}function rt(){const e=(0,r.GJ)();if(e.disableSettings)return;f.h5.register(et),function(){let e=new nt,t=window.O365Shell.Settings;window.O365Shell.Settings=e,t.applyCalls(e)}();const t=(0,Y._)((()=>Promise.all([s.e("plus"),s.e("extraflexpane")]).then(s.bind(s,324)).then((e=>e.SettingsFlexPanePanelConnector))));(0,r.NP)().subscribe("ShellDataUpdated",ot,!0);let n=e.layout,o={component:t,key:"Settings",width:h.xk};if(n){(0,r.NP)().invoke("LazyComponentLoaded",Se.$,Pe),o.nativeControlID="SettingsIcon"}else o.btnId=X.Xf;(0,f.OU)().dispatch((0,h.ZM)(o))}let it;s.nc=window.oneShellUxNonce,function(){let e=(0,r.l3)();s.e=e.loadChunk.bind(e)}(),(0,c.IJ)(),setTimeout((()=>(0,a.Nv)()));let at=!1,st=(0,r.NP)(),ct=(0,r.GJ)();const lt=()=>{if(!at){at=!0;try{(0,i.l)()}catch(e){(0,r.tZ)().exception("Init_ECS_Failed",6,e)}(0,h.M8)(),function(){let e=(0,r.GJ)();if(e.disableHelp)return;Ae=()=>Promise.all([s.e("plus"),s.e("extraflexpane")]).then(s.bind(s,96510));let t=window.O365Shell.NFD;t.registerShimCallback&&t.registerShimCallback((()=>{Ae()}),["OpenHelp","OpenFeedback"]);let n={component:(0,Y._)((()=>Ae().then((e=>e.HelpFlexPanePanelConnector)))),key:"Help",width:h.xk,overrideOnClick:e.OnHelpButtonClick};e.layout?((0,r.NP)().invoke("LazyComponentLoaded",be.V,ye),n.nativeControlID="HelpIcon"):n.btnId=X.hl;(0,f.OU)().dispatch((0,h.ZM)(n)),(0,r.NP)().subscribe("ShellDataUpdated",Ce,!0)}(),rt(),ie(),function(){let e=(0,r.GJ)();e&&e.layout&&e.layout.centerCustomizationRegion&&(0,ce.mD)("MyDay",e.layout.centerCustomizationRegion.children)&&(0,r.NP)().subscribe("ShellDataUpdated",ge,!0)}(),J();try{(0,i.l)().getConfig().then((e=>{}))}catch(e){(0,r.tZ)().exception("ECS_Config_Fetch_Failed",6,e)}!function(){(0,e.__awaiter)(this,void 0,void 0,(function*(){try{if(ct&&ct.enableSearchUX&&!0===ct.enableSearchUX){const e=yield s.e("search").then(s.bind(s,40374)).catch((e=>{var t;o(18,null===(t=ct.initialRenderData)||void 0===t?void 0:t.WorkloadId,e.ResourceName,e.Details)}));e&&e.initSearch&&e.initSearch()}}catch(e){}}))}(),(0,t.Qg)(),it=s.e("plus").then(s.bind(s,70796)).catch((e=>{var t;o(16,null===(t=ct.initialRenderData)||void 0===t?void 0:t.WorkloadId,e.ResourceName,e.Details)})),p(),(0,Je.Gy)(),(0,r.tZ)().perfMarker("shell_core_executioncomplete"),st.unsubscribe("StringsLoaded",lt),st.unsubscribe("StringsLoadedFailed",lt)}};setTimeout((()=>{st.subscribe("StringsLoadedFailed",lt,!0),st.subscribe("StringsLoaded",lt,!0)})),s(48358)}(),c=s.O(c)}(),HighResolutionTimingSupported&&(shellPerformance.mark("shell_core_end"),shellPerformance.measure("shell_core","shell_core_start","shell_core_end")); \ No newline at end of file diff --git a/utils.js b/utils.js index ec046a4..6960de4 100644 --- a/utils.js +++ b/utils.js @@ -1,280 +1,16 @@ -// src/utils.ts -import { timeoutManager } from "./timeoutManager.js"; -var isServer = typeof window === "undefined" || "Deno" in globalThis; -function noop() { -} -function functionalUpdate(updater, input) { - return typeof updater === "function" ? updater(input) : updater; -} -function isValidTimeout(value) { - return typeof value === "number" && value >= 0 && value !== Infinity; -} -function timeUntilStale(updatedAt, staleTime) { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); -} -function resolveStaleTime(staleTime, query) { - return typeof staleTime === "function" ? staleTime(query) : staleTime; -} -function resolveEnabled(enabled, query) { - return typeof enabled === "function" ? enabled(query) : enabled; -} -function matchQuery(filters, query) { - const { - type = "all", - exact, - fetchStatus, - predicate, - queryKey, - stale - } = filters; - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false; - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false; +// Waits for condition to return true. If it returns false initially, this function creates a +// MutationObserver that calls body() whenever the contents of the component change. +export const observeMutationsUntilConditionMet = (element, condition, body) => { + if (condition()) { + body(); + } + else { + const mutationObserver = new MutationObserver(() => { + if (condition()) { + body(); + mutationObserver.disconnect(); + } + }); + mutationObserver.observe(element, { childList: true, subtree: true }); } - } - if (type !== "all") { - const isActive = query.isActive(); - if (type === "active" && !isActive) { - return false; - } - if (type === "inactive" && isActive) { - return false; - } - } - if (typeof stale === "boolean" && query.isStale() !== stale) { - return false; - } - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false; - } - if (predicate && !predicate(query)) { - return false; - } - return true; -} -function matchMutation(filters, mutation) { - const { exact, status, predicate, mutationKey } = filters; - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false; - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false; - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false; - } - } - if (status && mutation.state.status !== status) { - return false; - } - if (predicate && !predicate(mutation)) { - return false; - } - return true; -} -function hashQueryKeyByOptions(queryKey, options) { - const hashFn = options?.queryKeyHashFn || hashKey; - return hashFn(queryKey); -} -function hashKey(queryKey) { - return JSON.stringify( - queryKey, - (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { - result[key] = val[key]; - return result; - }, {}) : val - ); -} -function partialMatchKey(a, b) { - if (a === b) { - return true; - } - if (typeof a !== typeof b) { - return false; - } - if (a && b && typeof a === "object" && typeof b === "object") { - return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); - } - return false; -} -var hasOwn = Object.prototype.hasOwnProperty; -function replaceEqualDeep(a, b) { - if (a === b) { - return a; - } - const array = isPlainArray(a) && isPlainArray(b); - if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; - const aItems = array ? a : Object.keys(a); - const aSize = aItems.length; - const bItems = array ? b : Object.keys(b); - const bSize = bItems.length; - const copy = array ? new Array(bSize) : {}; - let equalItems = 0; - for (let i = 0; i < bSize; i++) { - const key = array ? i : bItems[i]; - const aItem = a[key]; - const bItem = b[key]; - if (aItem === bItem) { - copy[key] = aItem; - if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; - continue; - } - if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { - copy[key] = bItem; - continue; - } - const v = replaceEqualDeep(aItem, bItem); - copy[key] = v; - if (v === aItem) equalItems++; - } - return aSize === bSize && equalItems === aSize ? a : copy; -} -function shallowEqualObjects(a, b) { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false; - } - for (const key in a) { - if (a[key] !== b[key]) { - return false; - } - } - return true; -} -function isPlainArray(value) { - return Array.isArray(value) && value.length === Object.keys(value).length; -} -function isPlainObject(o) { - if (!hasObjectPrototype(o)) { - return false; - } - const ctor = o.constructor; - if (ctor === void 0) { - return true; - } - const prot = ctor.prototype; - if (!hasObjectPrototype(prot)) { - return false; - } - if (!prot.hasOwnProperty("isPrototypeOf")) { - return false; - } - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false; - } - return true; -} -function hasObjectPrototype(o) { - return Object.prototype.toString.call(o) === "[object Object]"; -} -function sleep(timeout) { - return new Promise((resolve) => { - timeoutManager.setTimeout(resolve, timeout); - }); -} -function replaceData(prevData, data, options) { - if (typeof options.structuralSharing === "function") { - return options.structuralSharing(prevData, data); - } else if (options.structuralSharing !== false) { - if (process.env.NODE_ENV !== "production") { - try { - return replaceEqualDeep(prevData, data); - } catch (error) { - console.error( - `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` - ); - throw error; - } - } - return replaceEqualDeep(prevData, data); - } - return data; -} -function keepPreviousData(previousData) { - return previousData; -} -function addToEnd(items, item, max = 0) { - const newItems = [...items, item]; - return max && newItems.length > max ? newItems.slice(1) : newItems; -} -function addToStart(items, item, max = 0) { - const newItems = [item, ...items]; - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; -} -var skipToken = Symbol(); -function ensureQueryFn(options, fetchOptions) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` - ); - } - } - if (!options.queryFn && fetchOptions?.initialPromise) { - return () => fetchOptions.initialPromise; - } - if (!options.queryFn || options.queryFn === skipToken) { - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); - } - return options.queryFn; -} -function shouldThrowError(throwOnError, params) { - if (typeof throwOnError === "function") { - return throwOnError(...params); - } - return !!throwOnError; -} -function addConsumeAwareSignal(object, getSignal, onCancelled) { - let consumed = false; - let signal; - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - signal ??= getSignal(); - if (consumed) { - return signal; - } - consumed = true; - if (signal.aborted) { - onCancelled(); - } else { - signal.addEventListener("abort", onCancelled, { once: true }); - } - return signal; - } - }); - return object; -} -export { - addConsumeAwareSignal, - addToEnd, - addToStart, - ensureQueryFn, - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - isPlainArray, - isPlainObject, - isServer, - isValidTimeout, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceData, - replaceEqualDeep, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - shouldThrowError, - skipToken, - sleep, - timeUntilStale }; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/view-source_https___chromestatus.com_static_dist_components.js b/view-source_https___chromestatus.com_static_dist_components.js new file mode 100644 index 0000000..5b6e82b --- /dev/null +++ b/view-source_https___chromestatus.com_static_dist_components.js @@ -0,0 +1,16665 @@ +import{FeatureNotFoundError}from"./cs-client.js";const t$5=globalThis,e$a=t$5.ShadowRoot&&(void 0===t$5.ShadyCSS||t$5.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$4=Symbol(),o$c=new WeakMap;let n$8=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==s$4)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e$a&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$c.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$c.set(s,t))}return t}toString(){return this.cssText}};const r$a=t=>new n$8("string"==typeof t?t:t+"",void 0,s$4),i$7=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new n$8(o,t,s$4)},S$2=(s,o)=>{if(e$a)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$5.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o)}},c$4=e$a?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$a(e)})(t):t,{is:i$6,defineProperty:e$9,getOwnPropertyDescriptor:h$4,getOwnPropertyNames:r$9,getOwnPropertySymbols:o$b,getPrototypeOf:n$7}=Object,a$2=globalThis,c$3=a$2.trustedTypes,l$3=c$3?c$3.emptyScript:"",p$2=a$2.reactiveElementPolyfillSupport,d$2=t=>t,u$4={toAttribute(t,s){return s===Boolean?t=t?l$3:null:s===Object||s===Array?t=null==t?t:JSON.stringify(t):void 0,t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:+t;break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f$3=(t,s)=>!i$6(t,s),b$1={attribute:!0,type:String,converter:u$4,reflect:!1,useDefault:!1,hasChanged:f$3};Symbol.metadata??=Symbol("metadata"),a$2.litPropertyMetadata??=new WeakMap;let y$2=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b$1){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$9(this.prototype,t,h)}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$4(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b$1}static _$Ei(){if(!this.hasOwnProperty(d$2("elementProperties"))){const t=n$7(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}}static finalize(){if(!this.hasOwnProperty(d$2("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d$2("properties"))){const t=this.properties,s=[...r$9(t),...o$b(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$4(s))}else void 0!==s&&i.push(c$4(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.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(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);0<t.size&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$2(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0===i.converter?.toAttribute?u$4:i.converter).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0===t.converter?.fromAttribute?u$4:t.converter;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$3)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&(await t),!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(0<t.size)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(){return!0}update(){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(){}firstUpdated(){}};y$2.elementStyles=[],y$2.shadowRootOptions={mode:"open"},y$2[d$2("elementProperties")]=new Map,y$2[d$2("finalized")]=new Map,p$2?.({ReactiveElement:y$2}),(a$2.reactiveElementVersions??=[]).push("2.1.1");const t$4=globalThis,i$5=t$4.trustedTypes,s$3=i$5?i$5.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$8="$lit$",h$3=`lit$${Math.random().toFixed(9).slice(2)}$`,o$a="?"+h$3,n$6=`<${o$a}>`,r$8=document,l$2=()=>r$8.createComment(""),c$2=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a$1=Array.isArray,u$3=t=>a$1(t)||"function"==typeof t?.[Symbol.iterator],d$1="[ \t\n\f\r]",f$2=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v$2=/-->/g,_$1=/>/g,m$2=/>|[ \n\f\r](?:([^\s"'>=/]+)([ \n\f\r]*=[ \n\f\r]*(?:[^ \n\f\r"'`<>=]|("|')|))|$)/g,p$1=/'/g,g=/"/g,$$1=/^(?:script|style|textarea|title)$/i,y$1=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x$1=y$1(1),T$1=Symbol.for("lit-noChange"),E$1=Symbol.for("lit-nothing"),A=new WeakMap,C$1=r$8.createTreeWalker(r$8,129);function P$1(t,i){if(!a$1(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0===s$3?i:s$3.createHTML(i)}const V=(t,i)=>{const s=t.length-1,o=[];let l=2===i?"<svg>":3===i?"<math>":"",c=f$2,r;for(let i=0;i<s;i++){const s=t[i];let d=-1,y=0,a,u;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f$2?"!--"===u[1]?c=v$2:void 0===u[1]?void 0===u[2]?void 0!==u[3]&&(c=m$2):($$1.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m$2):c=_$1:c===m$2?">"===u[0]?(c=r??f$2,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m$2:"\""===u[3]?g:p$1):c===g||c===p$1?c=m$2:c===v$2||c===_$1?c=f$2:(c=m$2,r=void 0);const x=c===m$2&&t[i+1].startsWith("/>")?" ":"";l+=c===f$2?s+n$6:0<=d?(o.push(a),s.slice(0,d)+e$8+s.slice(d)+h$3+x):s+h$3+(-2===d?i:x)}return[P$1(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};let N$1=class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C$1.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C$1.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$8)){const i=v[a++],s=r.getAttribute(t).split(h$3),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H$1:"?"===e[1]?I$1:"@"===e[1]?L$1:k$1}),r.removeAttribute(t)}else t.startsWith(h$3)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($$1.test(r.tagName)){const t=r.textContent.split(h$3),s=t.length-1;if(0<s){r.textContent=i$5?i$5.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l$2()),C$1.nextNode(),d.push({type:2,index:++c});r.append(t[s],l$2())}}}else if(8===r.nodeType)if(r.data===o$a)d.push({type:2,index:c});else for(let t=-1;-1!==(t=r.data.indexOf(h$3,t+1));)d.push({type:7,index:c}),t+=h$3.length-1;c++}}static createElement(t){const s=r$8.createElement("template");return s.innerHTML=t,s}};function S$1(t,i,s=t,e){if(i===T$1)return i;let h=void 0===e?s._$Cl:s._$Co?.[e];const o=c$2(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0===e?s._$Cl=h:(s._$Co??=[])[e]=h),void 0!==h&&(i=S$1(t,h._$AS(t,i.values),h,e)),i}let M$2=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r$8).importNode(i,!0);C$1.currentNode=e;for(let h=C$1.nextNode(),o=0,n=0,l=s[0];void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z$1(h,this,t)),this._$AV.push(i),l=s[++n]}o!==l?.index&&(h=C$1.nextNode(),o++)}return C$1.currentNode=r$8,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0===s.strings?s._$AI(t[i]):(s._$AI(t,s,i),i+=s.strings.length-2)),i++}};class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E$1,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S$1(this,t,i),c$2(t)?t===E$1||null==t||""===t?(this._$AH!==E$1&&this._$AR(),this._$AH=E$1):t!==this._$AH&&t!==T$1&&this._(t):void 0===t._$litType$?void 0===t.nodeType?u$3(t)?this.k(t):this._(t):this.T(t):this.$(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==E$1&&c$2(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$8.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N$1.createElement(P$1(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new M$2(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N$1(t)),i}k(t){a$1(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e=0,s;for(const h of t)e===i.length?i.push(s=new R(this.O(l$2()),this.O(l$2()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}let k$1=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E$1,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,2<s.length||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E$1}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S$1(this,t,i,0),o=!c$2(t)||t!==this._$AH&&t!==T$1,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S$1(this,e[s+n],i,n),r===T$1&&(r=this._$AH[n]),o||=!c$2(r)||r!==this._$AH[n],r===E$1?t=E$1:t!==E$1&&(t+=(r??"")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===E$1?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},H$1=class extends k$1{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E$1?void 0:t}},I$1=class extends k$1{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E$1)}},L$1=class extends k$1{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=S$1(this,t,i,0)??E$1)!==T$1){const s=this._$AH,e=t===E$1&&s!==E$1||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E$1&&(s===E$1||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},z$1=class{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S$1(this,t)}};const Z$1={I:R},j$1=t$4.litHtmlPolyfillSupport;j$1?.(N$1,R),(t$4.litHtmlVersions??=[]).push("3.3.1");const B$1=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l$2(),t),t,void 0,s??{})}return h._$AI(t),h},s$2=globalThis;let i$4=class extends y$2{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B$1(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return T$1}};i$4._$litElement$=!0,i$4.finalized=!0,s$2.litElementHydrateSupport?.({LitElement:i$4});const o$9=s$2.litElementPolyfillSupport;o$9?.({LitElement:i$4}),(s$2.litElementVersions??=[]).push("4.2.1");var spinner_styles_default=i$7` + :host { + --track-width: 2px; + --track-color: rgb(128 128 128 / 25%); + --indicator-color: var(--sl-color-primary-600); + --speed: 2s; + + display: inline-flex; + width: 1em; + height: 1em; + flex: none; + } + + .spinner { + flex: 1 1 auto; + height: 100%; + width: 100%; + } + + .spinner__track, + .spinner__indicator { + fill: none; + stroke-width: var(--track-width); + r: calc(0.5em - var(--track-width) / 2); + cx: 0.5em; + cy: 0.5em; + transform-origin: 50% 50%; + } + + .spinner__track { + stroke: var(--track-color); + transform-origin: 0% 0%; + } + + .spinner__indicator { + stroke: var(--indicator-color); + stroke-linecap: round; + stroke-dasharray: 150% 75%; + animation: spin var(--speed) linear infinite; + } + + @keyframes spin { + 0% { + transform: rotate(0deg); + stroke-dasharray: 0.05em, 3em; + } + + 50% { + transform: rotate(450deg); + stroke-dasharray: 1.375em, 1.375em; + } + + 100% { + transform: rotate(1080deg); + stroke-dasharray: 0.05em, 3em; + } + } +`;const connectedElements=new Set,translations=new Map;let documentDirection="ltr",documentLanguage="en",fallback;const isClient="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&"undefined"!=typeof document.documentElement;if(isClient){const documentElementObserver=new MutationObserver(update);documentDirection=document.documentElement.dir||"ltr",documentLanguage=document.documentElement.lang||navigator.language,documentElementObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function registerTranslation(...translation){translation.map(t=>{const code=t.$code.toLowerCase();translations.has(code)?translations.set(code,Object.assign(Object.assign({},translations.get(code)),t)):translations.set(code,t),fallback||(fallback=t)}),update()}function update(){isClient&&(documentDirection=document.documentElement.dir||"ltr",documentLanguage=document.documentElement.lang||navigator.language),[...connectedElements.keys()].map(el=>{"function"==typeof el.requestUpdate&&el.requestUpdate()})}let LocalizeController$1=class{constructor(host){this.host=host,this.host.addController(this)}hostConnected(){connectedElements.add(this.host)}hostDisconnected(){connectedElements.delete(this.host)}dir(){return`${this.host.dir||documentDirection}`.toLowerCase()}lang(){return`${this.host.lang||documentLanguage}`.toLowerCase()}getTranslationData(lang){var _a,_b;const locale=new Intl.Locale(lang.replace(/_/g,"-")),language=null===locale||void 0===locale?void 0:locale.language.toLowerCase(),region=null!==(_b=null===(_a=null===locale||void 0===locale?void 0:locale.region)||void 0===_a?void 0:_a.toLowerCase())&&void 0!==_b?_b:"",primary=translations.get(`${language}-${region}`),secondary=translations.get(language);return{locale,language,region,primary,secondary}}exists(key,options){var _a;const{primary,secondary}=this.getTranslationData(null!==(_a=options.lang)&&void 0!==_a?_a:this.lang());return options=Object.assign({includeFallback:!1},options),!!(primary&&primary[key]||secondary&&secondary[key]||options.includeFallback&&fallback&&fallback[key])}term(key,...args){const{primary,secondary}=this.getTranslationData(this.lang());let term;if(primary&&primary[key])term=primary[key];else if(secondary&&secondary[key])term=secondary[key];else if(fallback&&fallback[key])term=fallback[key];else return console.error(`No translation found for: ${key+""}`),key+"";return"function"==typeof term?term(...args):term}date(dateToFormat,options){return dateToFormat=new Date(dateToFormat),new Intl.DateTimeFormat(this.lang(),options).format(dateToFormat)}number(numberToFormat,options){return numberToFormat=+numberToFormat,isNaN(numberToFormat)?"":new Intl.NumberFormat(this.lang(),options).format(numberToFormat)}relativeTime(value,unit,options){return new Intl.RelativeTimeFormat(this.lang(),options).format(value,unit)}};var translation={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(slide,count)=>`Go to slide ${slide} of ${count}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:num=>0===num?"No options selected":1===num?"1 option selected":`${num} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:slide=>`Slide ${slide}`,toggleColorFormat:"Toggle color format"};registerTranslation(translation);var en_default=translation,LocalizeController=class extends LocalizeController$1{};registerTranslation(en_default);var component_styles_default=i$7` + :host { + box-sizing: border-box; + } + + :host *, + :host *::before, + :host *::after { + box-sizing: inherit; + } + + [hidden] { + display: none !important; + } +`,__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__knownSymbol=(name,symbol)=>(symbol=Symbol[name])?symbol:Symbol.for("Symbol."+name),__typeError=msg=>{throw TypeError(msg)},__defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__decorateClass=(decorators,target,key,kind)=>{for(var result=1<kind?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;0<=i;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp(target,key,result),result},__accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg),__privateGet=(obj,member)=>(__accessCheck(obj,member,"read from private field"),member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value)=>(__accessCheck(obj,member,"write to private field"),member.set(obj,value),value),__await=function(promise,isYieldStar){this[0]=promise,this[1]=isYieldStar},__yieldStar=value=>{var obj=value[__knownSymbol("asyncIterator")],isAwait=!1,it={},method;return null==obj?(obj=value[__knownSymbol("iterator")](),method=k=>it[k]=x=>obj[k](x)):(obj=obj.call(value),method=k=>it[k]=v=>{if(isAwait){if(isAwait=!1,"throw"===k)throw v;return v}return isAwait=!0,{done:!1,value:new __await(new Promise(resolve=>{var x=obj[k](v);x instanceof Object||__typeError("Object expected"),resolve(x)}),1)}}),it[__knownSymbol("iterator")]=()=>it,method("next"),"throw"in obj?method("throw"):it.throw=x=>{throw x},"return"in obj&&method("return"),it};const t$3=t=>(e,o)=>{void 0===o?customElements.define(t,e):o.addInitializer(()=>{customElements.define(t,e)})},o$8={attribute:!0,type:String,converter:u$4,reflect:!1,hasChanged:f$3},r$7=(t=o$8,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),"accessor"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+n)};function n$5(t){return(e,o)=>"object"==typeof o?r$7(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}function r$6(r){return n$5({...r,state:!0,attribute:!1})}function t$2(t){return(n,o)=>{const c="function"==typeof n?n:n[o];Object.assign(c,t)}}const e$7=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);function e$6(e){return(n,s)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$7(n,s,{get(){return o(this)}})}}let e$5;function r$5(r){return(n,o)=>e$7(n,o,{get(){return(this.renderRoot??(e$5??=document.createDocumentFragment())).querySelectorAll(r)}})}function r$4(r){return(n,e)=>e$7(n,e,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(r)??null}})}var ShoelaceElement=class extends i$4{constructor(){super(),__privateAdd(this,_hasRecordedInitialProperties,!1),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach(([name,component])=>{this.constructor.define(name,component)})}emit(name,options){const event=new CustomEvent(name,__spreadValues({bubbles:!0,cancelable:!1,composed:!0,detail:{}},options));return this.dispatchEvent(event),event}static define(name,elementConstructor=this,options={}){const currentlyRegisteredConstructor=customElements.get(name);if(!currentlyRegisteredConstructor){try{customElements.define(name,elementConstructor,options)}catch(_err){customElements.define(name,class extends elementConstructor{},options)}return}let newVersion=" (unknown version)",existingVersion=newVersion;"version"in elementConstructor&&elementConstructor.version&&(newVersion=" v"+elementConstructor.version),"version"in currentlyRegisteredConstructor&¤tlyRegisteredConstructor.version&&(existingVersion=" v"+currentlyRegisteredConstructor.version);newVersion&&existingVersion&&newVersion===existingVersion||console.warn(`Attempted to register <${name}>${newVersion}, but <${name}>${existingVersion} has already been registered.`)}attributeChangedCallback(name,oldValue,newValue){__privateGet(this,_hasRecordedInitialProperties)||(this.constructor.elementProperties.forEach((obj,prop)=>{obj.reflect&&null!=this[prop]&&this.initialReflectedProperties.set(prop,this[prop])}),__privateSet(this,_hasRecordedInitialProperties,!0)),super.attributeChangedCallback(name,oldValue,newValue)}willUpdate(changedProperties){super.willUpdate(changedProperties),this.initialReflectedProperties.forEach((value,prop)=>{changedProperties.has(prop)&&null==this[prop]&&(this[prop]=value)})}},_hasRecordedInitialProperties;_hasRecordedInitialProperties=new WeakMap,ShoelaceElement.version="2.20.1",ShoelaceElement.dependencies={},__decorateClass([n$5()],ShoelaceElement.prototype,"dir",2),__decorateClass([n$5()],ShoelaceElement.prototype,"lang",2);var SlSpinner=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this)}render(){return x$1` + <svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}> + <circle class="spinner__track"></circle> + <circle class="spinner__indicator"></circle> + </svg> + `}};SlSpinner.styles=[component_styles_default,spinner_styles_default];var formCollections=new WeakMap,reportValidityOverloads=new WeakMap,checkValidityOverloads=new WeakMap,userInteractedControls=new WeakSet,interactions=new WeakMap,FormControlController=class{constructor(host,options){this.handleFormData=event=>{const disabled=this.options.disabled(this.host),name=this.options.name(this.host),value=this.options.value(this.host),isButton="sl-button"===this.host.tagName.toLowerCase();this.host.isConnected&&!disabled&&!isButton&&"string"==typeof name&&0<name.length&&"undefined"!=typeof value&&(Array.isArray(value)?value.forEach(val=>{event.formData.append(name,val.toString())}):event.formData.append(name,value.toString()))},this.handleFormSubmit=event=>{var _a;const disabled=this.options.disabled(this.host),reportValidity=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(_a=formCollections.get(this.form))?void 0:_a.forEach(control=>{this.setUserInteracted(control,!0)})),!this.form||this.form.noValidate||disabled||reportValidity(this.host)||(event.preventDefault(),event.stopImmediatePropagation())},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),interactions.set(this.host,[])},this.handleInteraction=event=>{const emittedEvents=interactions.get(this.host);emittedEvents.includes(event.type)||emittedEvents.push(event.type),emittedEvents.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.checkFormValidity=()=>{if(this.form&&!this.form.noValidate){const elements=this.form.querySelectorAll("*");for(const element of elements)if("function"==typeof element.checkValidity&&!element.checkValidity())return!1}return!0},this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){const elements=this.form.querySelectorAll("*");for(const element of elements)if("function"==typeof element.reportValidity&&!element.reportValidity())return!1}return!0},(this.host=host).addController(this),this.options=__spreadValues({form:input=>{const formId=input.form;if(formId){const root=input.getRootNode(),form=root.querySelector(`#${formId}`);if(form)return form}return input.closest("form")},name:input=>input.name,value:input=>input.value,defaultValue:input=>input.defaultValue,disabled:input=>{var _a;return null!=(_a=input.disabled)&&_a},reportValidity:input=>"function"!=typeof input.reportValidity||input.reportValidity(),checkValidity:input=>"function"!=typeof input.checkValidity||input.checkValidity(),setValue:(input,value)=>input.value=value,assumeInteractionOn:["sl-input"]},options)}hostConnected(){const form=this.options.form(this.host);form&&this.attachForm(form),interactions.set(this.host,[]),this.options.assumeInteractionOn.forEach(event=>{this.host.addEventListener(event,this.handleInteraction)})}hostDisconnected(){this.detachForm(),interactions.delete(this.host),this.options.assumeInteractionOn.forEach(event=>{this.host.removeEventListener(event,this.handleInteraction)})}hostUpdated(){const form=this.options.form(this.host);form||this.detachForm(),form&&this.form!==form&&(this.detachForm(),this.attachForm(form)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(form){form?(this.form=form,formCollections.has(this.form)?formCollections.get(this.form).add(this.host):formCollections.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),!reportValidityOverloads.has(this.form)&&(reportValidityOverloads.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),!checkValidityOverloads.has(this.form)&&(checkValidityOverloads.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())):this.form=void 0}detachForm(){if(this.form){const formCollection=formCollections.get(this.form);formCollection&&(formCollection.delete(this.host),0>=formCollection.size&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),reportValidityOverloads.has(this.form)&&(this.form.reportValidity=reportValidityOverloads.get(this.form),reportValidityOverloads.delete(this.form)),checkValidityOverloads.has(this.form)&&(this.form.checkValidity=checkValidityOverloads.get(this.form),checkValidityOverloads.delete(this.form)),this.form=void 0))}}setUserInteracted(el,hasInteracted){hasInteracted?userInteractedControls.add(el):userInteractedControls.delete(el),el.requestUpdate()}doAction(type,submitter){if(this.form){const button=document.createElement("button");button.type=type,button.style.position="absolute",button.style.width="0",button.style.height="0",button.style.clipPath="inset(50%)",button.style.overflow="hidden",button.style.whiteSpace="nowrap",submitter&&(button.name=submitter.name,button.value=submitter.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(attr=>{submitter.hasAttribute(attr)&&button.setAttribute(attr,submitter.getAttribute(attr))})),this.form.append(button),button.click(),button.remove()}}getForm(){var _a;return null==(_a=this.form)?null:_a}reset(submitter){this.doAction("reset",submitter)}submit(submitter){this.doAction("submit",submitter)}setValidity(isValid){const host=this.host,hasInteracted=!!userInteractedControls.has(host),required=!!host.required;host.toggleAttribute("data-required",required),host.toggleAttribute("data-optional",!required),host.toggleAttribute("data-invalid",!isValid),host.toggleAttribute("data-valid",isValid),host.toggleAttribute("data-user-invalid",!isValid&&hasInteracted),host.toggleAttribute("data-user-valid",isValid&&hasInteracted)}updateValidity(){const host=this.host;this.setValidity(host.validity.valid)}emitInvalidEvent(originalInvalidEvent){const slInvalidEvent=new CustomEvent("sl-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});originalInvalidEvent||slInvalidEvent.preventDefault(),this.host.dispatchEvent(slInvalidEvent)||(null==originalInvalidEvent?void 0:originalInvalidEvent.preventDefault())}},validValidityState=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),valueMissingValidityState=Object.freeze(__spreadProps(__spreadValues({},validValidityState),{valid:!1,valueMissing:!0})),customErrorValidityState=Object.freeze(__spreadProps(__spreadValues({},validValidityState),{valid:!1,customError:!0})),button_styles_default=i$7` + :host { + display: inline-block; + position: relative; + width: auto; + cursor: pointer; + } + + .button { + display: inline-flex; + align-items: stretch; + justify-content: center; + width: 100%; + border-style: solid; + border-width: var(--sl-input-border-width); + font-family: var(--sl-input-font-family); + font-weight: var(--sl-font-weight-semibold); + text-decoration: none; + user-select: none; + -webkit-user-select: none; + white-space: nowrap; + vertical-align: middle; + padding: 0; + transition: + var(--sl-transition-x-fast) background-color, + var(--sl-transition-x-fast) color, + var(--sl-transition-x-fast) border, + var(--sl-transition-x-fast) box-shadow; + cursor: inherit; + } + + .button::-moz-focus-inner { + border: 0; + } + + .button:focus { + outline: none; + } + + .button:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .button--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + /* When disabled, prevent mouse events from bubbling up from children */ + .button--disabled * { + pointer-events: none; + } + + .button__prefix, + .button__suffix { + flex: 0 0 auto; + display: flex; + align-items: center; + pointer-events: none; + } + + .button__label { + display: inline-block; + } + + .button__label::slotted(sl-icon) { + vertical-align: -2px; + } + + /* + * Standard buttons + */ + + /* Default */ + .button--standard.button--default { + background-color: var(--sl-color-neutral-0); + border-color: var(--sl-input-border-color); + color: var(--sl-color-neutral-700); + } + + .button--standard.button--default:hover:not(.button--disabled) { + background-color: var(--sl-color-primary-50); + border-color: var(--sl-color-primary-300); + color: var(--sl-color-primary-700); + } + + .button--standard.button--default:active:not(.button--disabled) { + background-color: var(--sl-color-primary-100); + border-color: var(--sl-color-primary-400); + color: var(--sl-color-primary-700); + } + + /* Primary */ + .button--standard.button--primary { + background-color: var(--sl-color-primary-600); + border-color: var(--sl-color-primary-600); + color: var(--sl-color-neutral-0); + } + + .button--standard.button--primary:hover:not(.button--disabled) { + background-color: var(--sl-color-primary-500); + border-color: var(--sl-color-primary-500); + color: var(--sl-color-neutral-0); + } + + .button--standard.button--primary:active:not(.button--disabled) { + background-color: var(--sl-color-primary-600); + border-color: var(--sl-color-primary-600); + color: var(--sl-color-neutral-0); + } + + /* Success */ + .button--standard.button--success { + background-color: var(--sl-color-success-600); + border-color: var(--sl-color-success-600); + color: var(--sl-color-neutral-0); + } + + .button--standard.button--success:hover:not(.button--disabled) { + background-color: var(--sl-color-success-500); + border-color: var(--sl-color-success-500); + color: var(--sl-color-neutral-0); + } + + .button--standard.button--success:active:not(.button--disabled) { + background-color: var(--sl-color-success-600); + border-color: var(--sl-color-success-600); + color: var(--sl-color-neutral-0); + } + + /* Neutral */ + .button--standard.button--neutral { + background-color: var(--sl-color-neutral-600); + border-color: var(--sl-color-neutral-600); + color: var(--sl-color-neutral-0); + } + + .button--standard.button--neutral:hover:not(.button--disabled) { + background-color: var(--sl-color-neutral-500); + border-color: var(--sl-color-neutral-500); + color: var(--sl-color-neutral-0); + } + + .button--standard.button--neutral:active:not(.button--disabled) { + background-color: var(--sl-color-neutral-600); + border-color: var(--sl-color-neutral-600); + color: var(--sl-color-neutral-0); + } + + /* Warning */ + .button--standard.button--warning { + background-color: var(--sl-color-warning-600); + border-color: var(--sl-color-warning-600); + color: var(--sl-color-neutral-0); + } + .button--standard.button--warning:hover:not(.button--disabled) { + background-color: var(--sl-color-warning-500); + border-color: var(--sl-color-warning-500); + color: var(--sl-color-neutral-0); + } + + .button--standard.button--warning:active:not(.button--disabled) { + background-color: var(--sl-color-warning-600); + border-color: var(--sl-color-warning-600); + color: var(--sl-color-neutral-0); + } + + /* Danger */ + .button--standard.button--danger { + background-color: var(--sl-color-danger-600); + border-color: var(--sl-color-danger-600); + color: var(--sl-color-neutral-0); + } + + .button--standard.button--danger:hover:not(.button--disabled) { + background-color: var(--sl-color-danger-500); + border-color: var(--sl-color-danger-500); + color: var(--sl-color-neutral-0); + } + + .button--standard.button--danger:active:not(.button--disabled) { + background-color: var(--sl-color-danger-600); + border-color: var(--sl-color-danger-600); + color: var(--sl-color-neutral-0); + } + + /* + * Outline buttons + */ + + .button--outline { + background: none; + border: solid 1px; + } + + /* Default */ + .button--outline.button--default { + border-color: var(--sl-input-border-color); + color: var(--sl-color-neutral-700); + } + + .button--outline.button--default:hover:not(.button--disabled), + .button--outline.button--default.button--checked:not(.button--disabled) { + border-color: var(--sl-color-primary-600); + background-color: var(--sl-color-primary-600); + color: var(--sl-color-neutral-0); + } + + .button--outline.button--default:active:not(.button--disabled) { + border-color: var(--sl-color-primary-700); + background-color: var(--sl-color-primary-700); + color: var(--sl-color-neutral-0); + } + + /* Primary */ + .button--outline.button--primary { + border-color: var(--sl-color-primary-600); + color: var(--sl-color-primary-600); + } + + .button--outline.button--primary:hover:not(.button--disabled), + .button--outline.button--primary.button--checked:not(.button--disabled) { + background-color: var(--sl-color-primary-600); + color: var(--sl-color-neutral-0); + } + + .button--outline.button--primary:active:not(.button--disabled) { + border-color: var(--sl-color-primary-700); + background-color: var(--sl-color-primary-700); + color: var(--sl-color-neutral-0); + } + + /* Success */ + .button--outline.button--success { + border-color: var(--sl-color-success-600); + color: var(--sl-color-success-600); + } + + .button--outline.button--success:hover:not(.button--disabled), + .button--outline.button--success.button--checked:not(.button--disabled) { + background-color: var(--sl-color-success-600); + color: var(--sl-color-neutral-0); + } + + .button--outline.button--success:active:not(.button--disabled) { + border-color: var(--sl-color-success-700); + background-color: var(--sl-color-success-700); + color: var(--sl-color-neutral-0); + } + + /* Neutral */ + .button--outline.button--neutral { + border-color: var(--sl-color-neutral-600); + color: var(--sl-color-neutral-600); + } + + .button--outline.button--neutral:hover:not(.button--disabled), + .button--outline.button--neutral.button--checked:not(.button--disabled) { + background-color: var(--sl-color-neutral-600); + color: var(--sl-color-neutral-0); + } + + .button--outline.button--neutral:active:not(.button--disabled) { + border-color: var(--sl-color-neutral-700); + background-color: var(--sl-color-neutral-700); + color: var(--sl-color-neutral-0); + } + + /* Warning */ + .button--outline.button--warning { + border-color: var(--sl-color-warning-600); + color: var(--sl-color-warning-600); + } + + .button--outline.button--warning:hover:not(.button--disabled), + .button--outline.button--warning.button--checked:not(.button--disabled) { + background-color: var(--sl-color-warning-600); + color: var(--sl-color-neutral-0); + } + + .button--outline.button--warning:active:not(.button--disabled) { + border-color: var(--sl-color-warning-700); + background-color: var(--sl-color-warning-700); + color: var(--sl-color-neutral-0); + } + + /* Danger */ + .button--outline.button--danger { + border-color: var(--sl-color-danger-600); + color: var(--sl-color-danger-600); + } + + .button--outline.button--danger:hover:not(.button--disabled), + .button--outline.button--danger.button--checked:not(.button--disabled) { + background-color: var(--sl-color-danger-600); + color: var(--sl-color-neutral-0); + } + + .button--outline.button--danger:active:not(.button--disabled) { + border-color: var(--sl-color-danger-700); + background-color: var(--sl-color-danger-700); + color: var(--sl-color-neutral-0); + } + + @media (forced-colors: active) { + .button.button--outline.button--checked:not(.button--disabled) { + outline: solid 2px transparent; + } + } + + /* + * Text buttons + */ + + .button--text { + background-color: transparent; + border-color: transparent; + color: var(--sl-color-primary-600); + } + + .button--text:hover:not(.button--disabled) { + background-color: transparent; + border-color: transparent; + color: var(--sl-color-primary-500); + } + + .button--text:focus-visible:not(.button--disabled) { + background-color: transparent; + border-color: transparent; + color: var(--sl-color-primary-500); + } + + .button--text:active:not(.button--disabled) { + background-color: transparent; + border-color: transparent; + color: var(--sl-color-primary-700); + } + + /* + * Size modifiers + */ + + .button--small { + height: auto; + min-height: var(--sl-input-height-small); + font-size: var(--sl-button-font-size-small); + line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2); + border-radius: var(--sl-input-border-radius-small); + } + + .button--medium { + height: auto; + min-height: var(--sl-input-height-medium); + font-size: var(--sl-button-font-size-medium); + line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2); + border-radius: var(--sl-input-border-radius-medium); + } + + .button--large { + height: auto; + min-height: var(--sl-input-height-large); + font-size: var(--sl-button-font-size-large); + line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2); + border-radius: var(--sl-input-border-radius-large); + } + + /* + * Pill modifier + */ + + .button--pill.button--small { + border-radius: var(--sl-input-height-small); + } + + .button--pill.button--medium { + border-radius: var(--sl-input-height-medium); + } + + .button--pill.button--large { + border-radius: var(--sl-input-height-large); + } + + /* + * Circle modifier + */ + + .button--circle { + padding-left: 0; + padding-right: 0; + } + + .button--circle.button--small { + width: var(--sl-input-height-small); + border-radius: 50%; + } + + .button--circle.button--medium { + width: var(--sl-input-height-medium); + border-radius: 50%; + } + + .button--circle.button--large { + width: var(--sl-input-height-large); + border-radius: 50%; + } + + .button--circle .button__prefix, + .button--circle .button__suffix, + .button--circle .button__caret { + display: none; + } + + /* + * Caret modifier + */ + + .button--caret .button__suffix { + display: none; + } + + .button--caret .button__caret { + height: auto; + } + + /* + * Loading modifier + */ + + .button--loading { + position: relative; + cursor: wait; + } + + .button--loading .button__prefix, + .button--loading .button__label, + .button--loading .button__suffix, + .button--loading .button__caret { + visibility: hidden; + } + + .button--loading sl-spinner { + --indicator-color: currentColor; + position: absolute; + font-size: 1em; + height: 1em; + width: 1em; + top: calc(50% - 0.5em); + left: calc(50% - 0.5em); + } + + /* + * Badges + */ + + .button ::slotted(sl-badge) { + position: absolute; + top: 0; + right: 0; + translate: 50% -50%; + pointer-events: none; + } + + .button--rtl ::slotted(sl-badge) { + right: auto; + left: 0; + translate: -50% -50%; + } + + /* + * Button spacing + */ + + .button--has-label.button--small .button__label { + padding: 0 var(--sl-spacing-small); + } + + .button--has-label.button--medium .button__label { + padding: 0 var(--sl-spacing-medium); + } + + .button--has-label.button--large .button__label { + padding: 0 var(--sl-spacing-large); + } + + .button--has-prefix.button--small { + padding-inline-start: var(--sl-spacing-x-small); + } + + .button--has-prefix.button--small .button__label { + padding-inline-start: var(--sl-spacing-x-small); + } + + .button--has-prefix.button--medium { + padding-inline-start: var(--sl-spacing-small); + } + + .button--has-prefix.button--medium .button__label { + padding-inline-start: var(--sl-spacing-small); + } + + .button--has-prefix.button--large { + padding-inline-start: var(--sl-spacing-small); + } + + .button--has-prefix.button--large .button__label { + padding-inline-start: var(--sl-spacing-small); + } + + .button--has-suffix.button--small, + .button--caret.button--small { + padding-inline-end: var(--sl-spacing-x-small); + } + + .button--has-suffix.button--small .button__label, + .button--caret.button--small .button__label { + padding-inline-end: var(--sl-spacing-x-small); + } + + .button--has-suffix.button--medium, + .button--caret.button--medium { + padding-inline-end: var(--sl-spacing-small); + } + + .button--has-suffix.button--medium .button__label, + .button--caret.button--medium .button__label { + padding-inline-end: var(--sl-spacing-small); + } + + .button--has-suffix.button--large, + .button--caret.button--large { + padding-inline-end: var(--sl-spacing-small); + } + + .button--has-suffix.button--large .button__label, + .button--caret.button--large .button__label { + padding-inline-end: var(--sl-spacing-small); + } + + /* + * Button groups support a variety of button types (e.g. buttons with tooltips, buttons as dropdown triggers, etc.). + * This means buttons aren't always direct descendants of the button group, thus we can't target them with the + * ::slotted selector. To work around this, the button group component does some magic to add these special classes to + * buttons and we style them here instead. + */ + + :host([data-sl-button-group__button--first]:not([data-sl-button-group__button--last])) .button { + border-start-end-radius: 0; + border-end-end-radius: 0; + } + + :host([data-sl-button-group__button--inner]) .button { + border-radius: 0; + } + + :host([data-sl-button-group__button--last]:not([data-sl-button-group__button--first])) .button { + border-start-start-radius: 0; + border-end-start-radius: 0; + } + + /* All except the first */ + :host([data-sl-button-group__button]:not([data-sl-button-group__button--first])) { + margin-inline-start: calc(-1 * var(--sl-input-border-width)); + } + + /* Add a visual separator between solid buttons */ + :host( + [data-sl-button-group__button]:not( + [data-sl-button-group__button--first], + [data-sl-button-group__button--radio], + [variant='default'] + ):not(:hover) + ) + .button:after { + content: ''; + position: absolute; + top: 0; + inset-inline-start: 0; + bottom: 0; + border-left: solid 1px rgb(128 128 128 / 33%); + mix-blend-mode: multiply; + } + + /* Bump hovered, focused, and checked buttons up so their focus ring isn't clipped */ + :host([data-sl-button-group__button--hover]) { + z-index: 1; + } + + /* Focus and checked are always on top */ + :host([data-sl-button-group__button--focus]), + :host([data-sl-button-group__button][checked]) { + z-index: 2; + } +`,HasSlotController=class{constructor(host,...slotNames){this.slotNames=[],this.handleSlotChange=event=>{const slot=event.target;(this.slotNames.includes("[default]")&&!slot.name||slot.name&&this.slotNames.includes(slot.name))&&this.host.requestUpdate()},(this.host=host).addController(this),this.slotNames=slotNames}hasDefaultSlot(){return[...this.host.childNodes].some(node=>{if(node.nodeType===node.TEXT_NODE&&""!==node.textContent.trim())return!0;if(node.nodeType===node.ELEMENT_NODE){const el=node,tagName=el.tagName.toLowerCase();if("sl-visually-hidden"===tagName)return!1;if(!el.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(name){return null!==this.host.querySelector(`:scope > [slot="${name}"]`)}test(slotName){return"[default]"===slotName?this.hasDefaultSlot():this.hasNamedSlot(slotName)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}};function getTextContent(slot){if(!slot)return"";const nodes=slot.assignedNodes({flatten:!0});let text="";return[...nodes].forEach(node=>{node.nodeType===Node.TEXT_NODE&&(text+=node.textContent)}),text}var basePath="";function setBasePath(path){basePath=path}function getBasePath(subpath=""){if(!basePath){const scripts=[...document.getElementsByTagName("script")],configScript=scripts.find(script=>script.hasAttribute("data-shoelace"));if(configScript)setBasePath(configScript.getAttribute("data-shoelace"));else{const fallbackScript=scripts.find(s=>/shoelace(\.min)?\.js($|\?)/.test(s.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(s.src));let path="";fallbackScript&&(path=fallbackScript.getAttribute("src")),setBasePath(path.split("/").slice(0,-1).join("/"))}}return basePath.replace(/\/$/,"")+(subpath?`/${subpath.replace(/^\//,"")}`:``)}var library={name:"default",resolver:name=>getBasePath(`assets/icons/${name}.svg`)},library_default_default=library,icons={caret:` + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <polyline points="6 9 12 15 18 9"></polyline> + </svg> + `,check:` + <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16"> + <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round"> + <g stroke="currentColor"> + <g transform="translate(3.428571, 3.428571)"> + <path d="M0,5.71428571 L3.42857143,9.14285714"></path> + <path d="M9.14285714,0 L3.42857143,9.14285714"></path> + </g> + </g> + </g> + </svg> + `,"chevron-down":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16"> + <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/> + </svg> + `,"chevron-left":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16"> + <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/> + </svg> + `,"chevron-right":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16"> + <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/> + </svg> + `,copy:` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16"> + <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/> + </svg> + `,eye:` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> + <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> + <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> + </svg> + `,"eye-slash":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16"> + <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/> + <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/> + <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/> + </svg> + `,eyedropper:` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16"> + <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path> + </svg> + `,"grip-vertical":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16"> + <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path> + </svg> + `,indeterminate:` + <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16"> + <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round"> + <g stroke="currentColor" stroke-width="2"> + <g transform="translate(2.285714, 6.857143)"> + <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path> + </g> + </g> + </g> + </svg> + `,"person-fill":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16"> + <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/> + </svg> + `,"play-fill":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16"> + <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path> + </svg> + `,"pause-fill":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16"> + <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path> + </svg> + `,radio:` + <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16"> + <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g fill="currentColor"> + <circle cx="8" cy="8" r="3.42857143"></circle> + </g> + </g> + </svg> + `,"star-fill":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16"> + <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/> + </svg> + `,"x-lg":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16"> + <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/> + </svg> + `,"x-circle-fill":` + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16"> + <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path> + </svg> + `},systemLibrary={name:"system",resolver:name=>name in icons?`data:image/svg+xml,${encodeURIComponent(icons[name])}`:""},library_system_default=systemLibrary,registry=[library_default_default,library_system_default],watchedIcons=[];function watchIcon(icon){watchedIcons.push(icon)}function unwatchIcon(icon){watchedIcons=watchedIcons.filter(el=>el!==icon)}function getIconLibrary(name){return registry.find(lib=>lib.name===name)}function registerIconLibrary(name,options){unregisterIconLibrary(name),registry.push({name,resolver:options.resolver,mutator:options.mutator,spriteSheet:options.spriteSheet}),watchedIcons.forEach(icon=>{icon.library===name&&icon.setIcon()})}function unregisterIconLibrary(name){registry=registry.filter(lib=>lib.name!==name)}var icon_styles_default=i$7` + :host { + display: inline-block; + width: 1em; + height: 1em; + box-sizing: content-box !important; + } + + svg { + display: block; + height: 100%; + width: 100%; + } +`;function watch(propertyName,options){const resolvedOptions=__spreadValues({waitUntilFirstUpdate:!1},options);return(proto,decoratedFnName)=>{const{update}=proto,watchedProperties=Array.isArray(propertyName)?propertyName:[propertyName];proto.update=function(changedProps){watchedProperties.forEach(property=>{const key=property;if(changedProps.has(key)){const oldValue=changedProps.get(key),newValue=this[key];oldValue!==newValue&&(!resolvedOptions.waitUntilFirstUpdate||this.hasUpdated)&&this[decoratedFnName](oldValue,newValue)}}),update.call(this,changedProps)}}}const{I:t$1}=Z$1,e$4=o=>void 0!==o?._$litType$,f$1=o=>void 0===o.strings,r$3=()=>document.createComment(""),s$1=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(r$3(),l),d=e.insertBefore(r$3(),l);n=new t$1(i,d,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,d=i!==o;if(d){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||d)for(let o=n._$AA;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}return n},v$1=(o,t,i=o)=>(o._$AI(t,i),o),u$2={},m$1=(o,t=u$2)=>o._$AH=t,p=o=>o._$AH,M$1=o=>{o._$AR(),o._$AA.remove()};var CACHEABLE_ERROR=Symbol(),RETRYABLE_ERROR=Symbol(),iconCache=new Map,SlIcon=class extends ShoelaceElement{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(url,library){var _a;let fileData;if(null==library?void 0:library.spriteSheet)return this.svg=x$1`<svg part="svg"> + <use part="use" href="${url}"></use> + </svg>`,this.svg;try{if(fileData=await fetch(url,{mode:"cors"}),!fileData.ok)return 410===fileData.status?CACHEABLE_ERROR:RETRYABLE_ERROR}catch(e){return RETRYABLE_ERROR}try{const div=document.createElement("div");div.innerHTML=await fileData.text();const svg=div.firstElementChild;if("svg"!==(null==(_a=null==svg?void 0:svg.tagName)?void 0:_a.toLowerCase()))return CACHEABLE_ERROR;parser||(parser=new DOMParser);const doc=parser.parseFromString(svg.outerHTML,"text/html"),svgEl=doc.body.querySelector("svg");return svgEl?(svgEl.part.add("svg"),document.adoptNode(svgEl)):CACHEABLE_ERROR}catch(e){return CACHEABLE_ERROR}}connectedCallback(){super.connectedCallback(),watchIcon(this)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),unwatchIcon(this)}getIconSource(){const library=getIconLibrary(this.library);return this.name&&library?{url:library.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){const hasLabel="string"==typeof this.label&&0<this.label.length;hasLabel?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var _a;const{url,fromLibrary}=this.getIconSource(),library=fromLibrary?getIconLibrary(this.library):void 0;if(!url)return void(this.svg=null);let iconResolver=iconCache.get(url);if(iconResolver||(iconResolver=this.resolveIcon(url,library),iconCache.set(url,iconResolver)),!!this.initialRender){const svg=await iconResolver;if(svg===RETRYABLE_ERROR&&iconCache.delete(url),url===this.getIconSource().url){if(e$4(svg)){if(this.svg=svg,library){await this.updateComplete;const shadowSVG=this.shadowRoot.querySelector("[part='svg']");"function"==typeof library.mutator&&shadowSVG&&library.mutator(shadowSVG)}return}svg===RETRYABLE_ERROR||svg===CACHEABLE_ERROR?(this.svg=null,this.emit("sl-error")):(this.svg=svg.cloneNode(!0),null==(_a=null==library?void 0:library.mutator)?void 0:_a.call(library,this.svg),this.emit("sl-load"))}}}render(){return this.svg}},parser;SlIcon.styles=[component_styles_default,icon_styles_default],__decorateClass([r$6()],SlIcon.prototype,"svg",2),__decorateClass([n$5({reflect:!0})],SlIcon.prototype,"name",2),__decorateClass([n$5()],SlIcon.prototype,"src",2),__decorateClass([n$5()],SlIcon.prototype,"label",2),__decorateClass([n$5({reflect:!0})],SlIcon.prototype,"library",2),__decorateClass([watch("label")],SlIcon.prototype,"handleLabelChange",1),__decorateClass([watch(["name","src","library"])],SlIcon.prototype,"setIcon",1);const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},e$3=t=>(...e)=>({_$litDirective$:t,values:e});let i$3=class{constructor(){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};const e$2=e$3(class extends i$3{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||2<t$1.strings?.length)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(s=>t[s]).join(" ")+" "}update(s,[i]){if(void 0===this.st){for(const t in this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>""!==t))),i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return T$1}}),a=Symbol.for(""),o$7=t=>{if(t?.r===a)return t?._$litStatic$},i$2=(t,...r)=>({_$litStatic$:r.reduce((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1],t[0]),r:a}),l$1=new Map,n$4=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let $=0,f=!1,c;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$7(i));)c+=s+r[++$],f=!0;$!==a&&u.push(i),n.push(c),$++}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l$1.get(t))&&(n.raw=n,l$1.set(t,r=n)),e=u}return t(r,...e)},u$1=n$4(x$1),o$6=o=>o??E$1;var SlButton=class extends ShoelaceElement{constructor(){super(...arguments),this.formControlController=new FormControlController(this,{assumeInteractionOn:["click"]}),this.hasSlotController=new HasSlotController(this,"[default]","prefix","suffix"),this.localize=new LocalizeController(this),this.hasFocus=!1,this.invalid=!1,this.title="",this.variant="default",this.size="medium",this.caret=!1,this.disabled=!1,this.loading=!1,this.outline=!1,this.pill=!1,this.circle=!1,this.type="button",this.name="",this.value="",this.href="",this.rel="noreferrer noopener"}get validity(){return this.isButton()?this.button.validity:validValidityState}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(){"submit"===this.type&&this.formControlController.submit(this),"reset"===this.type&&this.formControlController.reset(this)}handleInvalid(event){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(event)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(options){this.button.focus(options)}blur(){this.button.blur()}checkValidity(){return!this.isButton()||this.button.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return!this.isButton()||this.button.reportValidity()}setCustomValidity(message){this.isButton()&&(this.button.setCustomValidity(message),this.formControlController.updateValidity())}render(){const isLink=this.isLink(),tag=isLink?i$2`a`:i$2`button`;return u$1` + <${tag} + part="base" + class=${e$2({button:!0,"button--default":"default"===this.variant,"button--primary":"primary"===this.variant,"button--success":"success"===this.variant,"button--neutral":"neutral"===this.variant,"button--warning":"warning"===this.variant,"button--danger":"danger"===this.variant,"button--text":"text"===this.variant,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--caret":this.caret,"button--circle":this.circle,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--loading":this.loading,"button--standard":!this.outline,"button--outline":this.outline,"button--pill":this.pill,"button--rtl":"rtl"===this.localize.dir(),"button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")})} + ?disabled=${o$6(isLink?void 0:this.disabled)} + type=${o$6(isLink?void 0:this.type)} + title=${this.title} + name=${o$6(isLink?void 0:this.name)} + value=${o$6(isLink?void 0:this.value)} + href=${o$6(isLink&&!this.disabled?this.href:void 0)} + target=${o$6(isLink?this.target:void 0)} + download=${o$6(isLink?this.download:void 0)} + rel=${o$6(isLink?this.rel:void 0)} + role=${o$6(isLink?void 0:"button")} + aria-disabled=${this.disabled?"true":"false"} + tabindex=${this.disabled?"-1":"0"} + @blur=${this.handleBlur} + @focus=${this.handleFocus} + @invalid=${this.isButton()?this.handleInvalid:null} + @click=${this.handleClick} + > + <slot name="prefix" part="prefix" class="button__prefix"></slot> + <slot part="label" class="button__label"></slot> + <slot name="suffix" part="suffix" class="button__suffix"></slot> + ${this.caret?u$1` <sl-icon part="caret" class="button__caret" library="system" name="caret"></sl-icon> `:""} + ${this.loading?u$1`<sl-spinner part="spinner"></sl-spinner>`:""} + </${tag}> + `}};SlButton.styles=[component_styles_default,button_styles_default],SlButton.dependencies={"sl-icon":SlIcon,"sl-spinner":SlSpinner},__decorateClass([e$6(".button")],SlButton.prototype,"button",2),__decorateClass([r$6()],SlButton.prototype,"hasFocus",2),__decorateClass([r$6()],SlButton.prototype,"invalid",2),__decorateClass([n$5()],SlButton.prototype,"title",2),__decorateClass([n$5({reflect:!0})],SlButton.prototype,"variant",2),__decorateClass([n$5({reflect:!0})],SlButton.prototype,"size",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlButton.prototype,"caret",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlButton.prototype,"disabled",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlButton.prototype,"loading",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlButton.prototype,"outline",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlButton.prototype,"pill",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlButton.prototype,"circle",2),__decorateClass([n$5()],SlButton.prototype,"type",2),__decorateClass([n$5()],SlButton.prototype,"name",2),__decorateClass([n$5()],SlButton.prototype,"value",2),__decorateClass([n$5()],SlButton.prototype,"href",2),__decorateClass([n$5()],SlButton.prototype,"target",2),__decorateClass([n$5()],SlButton.prototype,"rel",2),__decorateClass([n$5()],SlButton.prototype,"download",2),__decorateClass([n$5()],SlButton.prototype,"form",2),__decorateClass([n$5({attribute:"formaction"})],SlButton.prototype,"formAction",2),__decorateClass([n$5({attribute:"formenctype"})],SlButton.prototype,"formEnctype",2),__decorateClass([n$5({attribute:"formmethod"})],SlButton.prototype,"formMethod",2),__decorateClass([n$5({attribute:"formnovalidate",type:Boolean})],SlButton.prototype,"formNoValidate",2),__decorateClass([n$5({attribute:"formtarget"})],SlButton.prototype,"formTarget",2),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlButton.prototype,"handleDisabledChange",1),SlButton.define("sl-button");var checkbox_styles_default=i$7` + :host { + display: inline-block; + } + + .checkbox { + position: relative; + display: inline-flex; + align-items: flex-start; + font-family: var(--sl-input-font-family); + font-weight: var(--sl-input-font-weight); + color: var(--sl-input-label-color); + vertical-align: middle; + cursor: pointer; + } + + .checkbox--small { + --toggle-size: var(--sl-toggle-size-small); + font-size: var(--sl-input-font-size-small); + } + + .checkbox--medium { + --toggle-size: var(--sl-toggle-size-medium); + font-size: var(--sl-input-font-size-medium); + } + + .checkbox--large { + --toggle-size: var(--sl-toggle-size-large); + font-size: var(--sl-input-font-size-large); + } + + .checkbox__control { + flex: 0 0 auto; + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + width: var(--toggle-size); + height: var(--toggle-size); + border: solid var(--sl-input-border-width) var(--sl-input-border-color); + border-radius: 2px; + background-color: var(--sl-input-background-color); + color: var(--sl-color-neutral-0); + transition: + var(--sl-transition-fast) border-color, + var(--sl-transition-fast) background-color, + var(--sl-transition-fast) color, + var(--sl-transition-fast) box-shadow; + } + + .checkbox__input { + position: absolute; + opacity: 0; + padding: 0; + margin: 0; + pointer-events: none; + } + + .checkbox__checked-icon, + .checkbox__indeterminate-icon { + display: inline-flex; + width: var(--toggle-size); + height: var(--toggle-size); + } + + /* Hover */ + .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover { + border-color: var(--sl-input-border-color-hover); + background-color: var(--sl-input-background-color-hover); + } + + /* Focus */ + .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + /* Checked/indeterminate */ + .checkbox--checked .checkbox__control, + .checkbox--indeterminate .checkbox__control { + border-color: var(--sl-color-primary-600); + background-color: var(--sl-color-primary-600); + } + + /* Checked/indeterminate + hover */ + .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover, + .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover { + border-color: var(--sl-color-primary-500); + background-color: var(--sl-color-primary-500); + } + + /* Checked/indeterminate + focus */ + .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control, + .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + /* Disabled */ + .checkbox--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .checkbox__label { + display: inline-block; + color: var(--sl-input-label-color); + line-height: var(--toggle-size); + margin-inline-start: 0.5em; + user-select: none; + -webkit-user-select: none; + } + + :host([required]) .checkbox__label::after { + content: var(--sl-input-required-content); + color: var(--sl-input-required-content-color); + margin-inline-start: var(--sl-input-required-content-offset); + } +`,defaultValue=(propertyName="value")=>(proto,key)=>{const ctor=proto.constructor,attributeChangedCallback=ctor.prototype.attributeChangedCallback;ctor.prototype.attributeChangedCallback=function(name,old,value){var _a;const options=ctor.getPropertyOptions(propertyName),attributeName="string"==typeof options.attribute?options.attribute:propertyName;if(name===attributeName){const converter=options.converter||u$4,fromAttribute="function"==typeof converter?converter:null==(_a=null==converter?void 0:converter.fromAttribute)?u$4.fromAttribute:_a,newValue=fromAttribute(value,options.type);this[propertyName]!==newValue&&(this[key]=newValue)}attributeChangedCallback.call(this,name,old,value)}},form_control_styles_default=i$7` + .form-control .form-control__label { + display: none; + } + + .form-control .form-control__help-text { + display: none; + } + + /* Label */ + .form-control--has-label .form-control__label { + display: inline-block; + color: var(--sl-input-label-color); + margin-bottom: var(--sl-spacing-3x-small); + } + + .form-control--has-label.form-control--small .form-control__label { + font-size: var(--sl-input-label-font-size-small); + } + + .form-control--has-label.form-control--medium .form-control__label { + font-size: var(--sl-input-label-font-size-medium); + } + + .form-control--has-label.form-control--large .form-control__label { + font-size: var(--sl-input-label-font-size-large); + } + + :host([required]) .form-control--has-label .form-control__label::after { + content: var(--sl-input-required-content); + margin-inline-start: var(--sl-input-required-content-offset); + color: var(--sl-input-required-content-color); + } + + /* Help text */ + .form-control--has-help-text .form-control__help-text { + display: block; + color: var(--sl-input-help-text-color); + margin-top: var(--sl-spacing-3x-small); + } + + .form-control--has-help-text.form-control--small .form-control__help-text { + font-size: var(--sl-input-help-text-font-size-small); + } + + .form-control--has-help-text.form-control--medium .form-control__help-text { + font-size: var(--sl-input-help-text-font-size-medium); + } + + .form-control--has-help-text.form-control--large .form-control__help-text { + font-size: var(--sl-input-help-text-font-size-large); + } + + .form-control--has-help-text.form-control--radio-group .form-control__help-text { + margin-top: var(--sl-spacing-2x-small); + } +`;const l=e$3(class extends i$3{constructor(r){if(super(r),r.type!==t.PROPERTY&&r.type!==t.ATTRIBUTE&&r.type!==t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!f$1(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(i,[t$1]){if(t$1===T$1||t$1===E$1)return t$1;const o=i.element,l=i.name;if(i.type===t.PROPERTY){if(t$1===o[l])return T$1;}else if(i.type===t.BOOLEAN_ATTRIBUTE){if(!!t$1===o.hasAttribute(l))return T$1;}else if(i.type===t.ATTRIBUTE&&o.getAttribute(l)===t$1+"")return T$1;return m$1(i),t$1}});var SlCheckbox=class extends ShoelaceElement{constructor(){super(...arguments),this.formControlController=new FormControlController(this,{value:control=>control.checked?control.value||"on":void 0,defaultValue:control=>control.defaultChecked,setValue:(control,checked)=>control.checked=checked}),this.hasSlotController=new HasSlotController(this,"help-text"),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.indeterminate=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.helpText=""}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("sl-change")}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleInput(){this.emit("sl-input")}handleInvalid(event){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(event)}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(options){this.input.focus(options)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(message){this.input.setCustomValidity(message),this.formControlController.updateValidity()}render(){const hasHelpTextSlot=this.hasSlotController.test("help-text"),hasHelpText=!!this.helpText||!!hasHelpTextSlot;return x$1` + <div + class=${e$2({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-help-text":hasHelpText})} + > + <label + part="base" + class=${e$2({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--small":"small"===this.size,"checkbox--medium":"medium"===this.size,"checkbox--large":"large"===this.size})} + > + <input + class="checkbox__input" + type="checkbox" + title=${this.title} + name=${this.name} + value=${o$6(this.value)} + .indeterminate=${l(this.indeterminate)} + .checked=${l(this.checked)} + .disabled=${this.disabled} + .required=${this.required} + aria-checked=${this.checked?"true":"false"} + aria-describedby="help-text" + @click=${this.handleClick} + @input=${this.handleInput} + @invalid=${this.handleInvalid} + @blur=${this.handleBlur} + @focus=${this.handleFocus} + /> + + <span + part="control${this.checked?" control--checked":""}${this.indeterminate?" control--indeterminate":""}" + class="checkbox__control" + > + ${this.checked?x$1` + <sl-icon part="checked-icon" class="checkbox__checked-icon" library="system" name="check"></sl-icon> + `:""} + ${!this.checked&&this.indeterminate?x$1` + <sl-icon + part="indeterminate-icon" + class="checkbox__indeterminate-icon" + library="system" + name="indeterminate" + ></sl-icon> + `:""} + </span> + + <div part="label" class="checkbox__label"> + <slot></slot> + </div> + </label> + + <div + aria-hidden=${hasHelpText?"false":"true"} + class="form-control__help-text" + id="help-text" + part="form-control-help-text" + > + <slot name="help-text">${this.helpText}</slot> + </div> + </div> + `}};SlCheckbox.styles=[component_styles_default,form_control_styles_default,checkbox_styles_default],SlCheckbox.dependencies={"sl-icon":SlIcon},__decorateClass([e$6("input[type=\"checkbox\"]")],SlCheckbox.prototype,"input",2),__decorateClass([r$6()],SlCheckbox.prototype,"hasFocus",2),__decorateClass([n$5()],SlCheckbox.prototype,"title",2),__decorateClass([n$5()],SlCheckbox.prototype,"name",2),__decorateClass([n$5()],SlCheckbox.prototype,"value",2),__decorateClass([n$5({reflect:!0})],SlCheckbox.prototype,"size",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlCheckbox.prototype,"disabled",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlCheckbox.prototype,"checked",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlCheckbox.prototype,"indeterminate",2),__decorateClass([defaultValue("checked")],SlCheckbox.prototype,"defaultChecked",2),__decorateClass([n$5({reflect:!0})],SlCheckbox.prototype,"form",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlCheckbox.prototype,"required",2),__decorateClass([n$5({attribute:"help-text"})],SlCheckbox.prototype,"helpText",2),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlCheckbox.prototype,"handleDisabledChange",1),__decorateClass([watch(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],SlCheckbox.prototype,"handleStateChange",1),SlCheckbox.define("sl-checkbox");function*activeElements(activeElement=document.activeElement){null===activeElement||void 0===activeElement||(yield activeElement,"shadowRoot"in activeElement&&activeElement.shadowRoot&&"closed"!==activeElement.shadowRoot.mode&&(yield*__yieldStar(activeElements(activeElement.shadowRoot.activeElement))))}function getDeepestActiveElement(){return[...activeElements()].pop()}var computedStyleMap=new WeakMap;function getCachedComputedStyle(el){let computedStyle=computedStyleMap.get(el);return computedStyle||(computedStyle=window.getComputedStyle(el,null),computedStyleMap.set(el,computedStyle)),computedStyle}function isVisible(el){if("function"==typeof el.checkVisibility)return el.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});const computedStyle=getCachedComputedStyle(el);return"hidden"!==computedStyle.visibility&&"none"!==computedStyle.display}function isOverflowingAndTabbable(el){const computedStyle=getCachedComputedStyle(el),{overflowY,overflowX}=computedStyle;if("scroll"===overflowY||"scroll"===overflowX)return!0;if("auto"!==overflowY||"auto"!==overflowX)return!1;const isOverflowingY=el.scrollHeight>el.clientHeight;if(isOverflowingY&&"auto"===overflowY)return!0;const isOverflowingX=el.scrollWidth>el.clientWidth;return!!(isOverflowingX&&"auto"===overflowX)}function isTabbable(el){const tag=el.tagName.toLowerCase(),tabindex=+el.getAttribute("tabindex"),hasTabindex=el.hasAttribute("tabindex");if(hasTabindex&&(isNaN(tabindex)||-1>=tabindex))return!1;if(el.hasAttribute("disabled"))return!1;if(el.closest("[inert]"))return!1;if("input"===tag&&"radio"===el.getAttribute("type")){const rootNode=el.getRootNode(),findRadios=`input[type='radio'][name="${el.getAttribute("name")}"]`,firstChecked=rootNode.querySelector(`${findRadios}:checked`);if(firstChecked)return firstChecked===el;const firstRadio=rootNode.querySelector(findRadios);return firstRadio===el}if(!isVisible(el))return!1;if(("audio"===tag||"video"===tag)&&el.hasAttribute("controls"))return!0;if(el.hasAttribute("tabindex"))return!0;if(el.hasAttribute("contenteditable")&&"false"!==el.getAttribute("contenteditable"))return!0;const isNativelyTabbable=["button","input","select","textarea","a","audio","video","summary","iframe"].includes(tag);return!!isNativelyTabbable||isOverflowingAndTabbable(el)}function getTabbableBoundary(root){var _a,_b;const tabbableElements=getTabbableElements(root),start=null==(_a=tabbableElements[0])?null:_a,end=null==(_b=tabbableElements[tabbableElements.length-1])?null:_b;return{start,end}}function getSlottedChildrenOutsideRootElement(slotElement,root){var _a;return(null==(_a=slotElement.getRootNode({composed:!0}))?void 0:_a.host)!==root}function getTabbableElements(root){function walk(el){if(el instanceof Element){if(el.hasAttribute("inert")||el.closest("[inert]"))return;if(walkedEls.has(el))return;walkedEls.set(el,!0),!tabbableElements.includes(el)&&isTabbable(el)&&tabbableElements.push(el),el instanceof HTMLSlotElement&&getSlottedChildrenOutsideRootElement(el,root)&&el.assignedElements({flatten:!0}).forEach(assignedEl=>{walk(assignedEl)}),null!==el.shadowRoot&&"open"===el.shadowRoot.mode&&walk(el.shadowRoot)}for(const e of el.children)walk(e)}const walkedEls=new WeakMap,tabbableElements=[];return walk(root),tabbableElements.sort((a,b)=>{const aTabindex=+a.getAttribute("tabindex")||0,bTabindex=+b.getAttribute("tabindex")||0;return bTabindex-aTabindex})}var activeModals=[],Modal=class{constructor(element){this.tabDirection="forward",this.handleFocusIn=()=>{this.isActive()&&this.checkFocus()},this.handleKeyDown=event=>{var _a;if("Tab"!==event.key||this.isExternalActivated)return;if(!this.isActive())return;const currentActiveElement=getDeepestActiveElement();if(this.previousFocus=currentActiveElement,this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;this.tabDirection=event.shiftKey?"backward":"forward";const tabbableElements=getTabbableElements(this.element);let currentFocusIndex=tabbableElements.findIndex(el=>el===currentActiveElement);this.previousFocus=this.currentFocus;for(const addition="forward"===this.tabDirection?1:-1;;){currentFocusIndex+addition>=tabbableElements.length?currentFocusIndex=0:0>currentFocusIndex+addition?currentFocusIndex=tabbableElements.length-1:currentFocusIndex+=addition,this.previousFocus=this.currentFocus;const nextFocus=tabbableElements[currentFocusIndex];if("backward"===this.tabDirection&&this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;if(nextFocus&&this.possiblyHasTabbableChildren(nextFocus))return;event.preventDefault(),this.currentFocus=nextFocus,null==(_a=this.currentFocus)?void 0:_a.focus({preventScroll:!1});const allActiveElements=[...activeElements()];if(allActiveElements.includes(this.currentFocus)||!allActiveElements.includes(this.previousFocus))break}setTimeout(()=>this.checkFocus())},this.handleKeyUp=()=>{this.tabDirection="forward"},this.element=element,this.elementsWithTabbableControls=["iframe"]}activate(){activeModals.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){activeModals=activeModals.filter(modal=>modal!==this.element),this.currentFocus=null,document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return activeModals[activeModals.length-1]===this.element}activateExternal(){this.isExternalActivated=!0}deactivateExternal(){this.isExternalActivated=!1}checkFocus(){if(this.isActive()&&!this.isExternalActivated){const tabbableElements=getTabbableElements(this.element);if(!this.element.matches(":focus-within")){const start=tabbableElements[0],end=tabbableElements[tabbableElements.length-1],target="forward"===this.tabDirection?start:end;"function"==typeof(null==target?void 0:target.focus)&&(this.currentFocus=target,target.focus({preventScroll:!1}))}}}possiblyHasTabbableChildren(element){return this.elementsWithTabbableControls.includes(element.tagName.toLowerCase())||element.hasAttribute("controls")}};function getOffset(element,parent){var _Mathround=Math.round;return{top:_Mathround(element.getBoundingClientRect().top-parent.getBoundingClientRect().top),left:_Mathround(element.getBoundingClientRect().left-parent.getBoundingClientRect().left)}}var locks=new Set;function getScrollbarWidth(){const documentWidth=document.documentElement.clientWidth;return Math.abs(window.innerWidth-documentWidth)}function getExistingBodyPadding(){const padding=+getComputedStyle(document.body).paddingRight.replace(/px/,"");return isNaN(padding)||!padding?0:padding}function lockBodyScrolling(lockingEl){if(locks.add(lockingEl),!document.documentElement.classList.contains("sl-scroll-lock")){const scrollbarWidth=getScrollbarWidth()+getExistingBodyPadding();let scrollbarGutterProperty=getComputedStyle(document.documentElement).scrollbarGutter;scrollbarGutterProperty&&"auto"!==scrollbarGutterProperty||(scrollbarGutterProperty="stable"),2>scrollbarWidth&&(scrollbarGutterProperty=""),document.documentElement.style.setProperty("--sl-scroll-lock-gutter",scrollbarGutterProperty),document.documentElement.classList.add("sl-scroll-lock"),document.documentElement.style.setProperty("--sl-scroll-lock-size",`${scrollbarWidth}px`)}}function unlockBodyScrolling(lockingEl){locks.delete(lockingEl),0===locks.size&&(document.documentElement.classList.remove("sl-scroll-lock"),document.documentElement.style.removeProperty("--sl-scroll-lock-size"))}function scrollIntoView(element,container,direction="vertical",behavior="smooth"){const offset=getOffset(element,container),offsetTop=offset.top+container.scrollTop,offsetLeft=offset.left+container.scrollLeft,minX=container.scrollLeft,maxX=container.scrollLeft+container.offsetWidth,minY=container.scrollTop,maxY=container.scrollTop+container.offsetHeight;("horizontal"===direction||"both"===direction)&&(offsetLeft<minX?container.scrollTo({left:offsetLeft,behavior}):offsetLeft+element.clientWidth>maxX&&container.scrollTo({left:offsetLeft-container.offsetWidth+element.clientWidth,behavior})),("vertical"===direction||"both"===direction)&&(offsetTop<minY?container.scrollTo({top:offsetTop,behavior}):offsetTop+element.clientHeight>maxY&&container.scrollTo({top:offsetTop-container.offsetHeight+element.clientHeight,behavior}))}var dialog_styles_default=i$7` + :host { + --width: 31rem; + --header-spacing: var(--sl-spacing-large); + --body-spacing: var(--sl-spacing-large); + --footer-spacing: var(--sl-spacing-large); + + display: contents; + } + + .dialog { + display: flex; + align-items: center; + justify-content: center; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: var(--sl-z-index-dialog); + } + + .dialog__panel { + display: flex; + flex-direction: column; + z-index: 2; + width: var(--width); + max-width: calc(100% - var(--sl-spacing-2x-large)); + max-height: calc(100% - var(--sl-spacing-2x-large)); + background-color: var(--sl-panel-background-color); + border-radius: var(--sl-border-radius-medium); + box-shadow: var(--sl-shadow-x-large); + } + + .dialog__panel:focus { + outline: none; + } + + /* Ensure there's enough vertical padding for phones that don't update vh when chrome appears (e.g. iPhone) */ + @media screen and (max-width: 420px) { + .dialog__panel { + max-height: 80vh; + } + } + + .dialog--open .dialog__panel { + display: flex; + opacity: 1; + } + + .dialog__header { + flex: 0 0 auto; + display: flex; + } + + .dialog__title { + flex: 1 1 auto; + font: inherit; + font-size: var(--sl-font-size-large); + line-height: var(--sl-line-height-dense); + padding: var(--header-spacing); + margin: 0; + } + + .dialog__header-actions { + flex-shrink: 0; + display: flex; + flex-wrap: wrap; + justify-content: end; + gap: var(--sl-spacing-2x-small); + padding: 0 var(--header-spacing); + } + + .dialog__header-actions sl-icon-button, + .dialog__header-actions ::slotted(sl-icon-button) { + flex: 0 0 auto; + display: flex; + align-items: center; + font-size: var(--sl-font-size-medium); + } + + .dialog__body { + flex: 1 1 auto; + display: block; + padding: var(--body-spacing); + overflow: auto; + -webkit-overflow-scrolling: touch; + } + + .dialog__footer { + flex: 0 0 auto; + text-align: right; + padding: var(--footer-spacing); + } + + .dialog__footer ::slotted(sl-button:not(:first-of-type)) { + margin-inline-start: var(--sl-spacing-x-small); + } + + .dialog:not(.dialog--has-footer) .dialog__footer { + display: none; + } + + .dialog__overlay { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: var(--sl-overlay-background-color); + } + + @media (forced-colors: active) { + .dialog__panel { + border: solid 1px var(--sl-color-neutral-0); + } + } +`,blurActiveElement=elm=>{var _a;const{activeElement}=document;activeElement&&elm.contains(activeElement)&&(null==(_a=document.activeElement)?void 0:_a.blur())},icon_button_styles_default=i$7` + :host { + display: inline-block; + color: var(--sl-color-neutral-600); + } + + .icon-button { + flex: 0 0 auto; + display: flex; + align-items: center; + background: none; + border: none; + border-radius: var(--sl-border-radius-medium); + font-size: inherit; + color: inherit; + padding: var(--sl-spacing-x-small); + cursor: pointer; + transition: var(--sl-transition-x-fast) color; + -webkit-appearance: none; + } + + .icon-button:hover:not(.icon-button--disabled), + .icon-button:focus-visible:not(.icon-button--disabled) { + color: var(--sl-color-primary-600); + } + + .icon-button:active:not(.icon-button--disabled) { + color: var(--sl-color-primary-700); + } + + .icon-button:focus { + outline: none; + } + + .icon-button--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .icon-button:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .icon-button__icon { + pointer-events: none; + } +`,SlIconButton=class extends ShoelaceElement{constructor(){super(...arguments),this.hasFocus=!1,this.label="",this.disabled=!1}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(event){this.disabled&&(event.preventDefault(),event.stopPropagation())}click(){this.button.click()}focus(options){this.button.focus(options)}blur(){this.button.blur()}render(){const isLink=!!this.href,tag=isLink?i$2`a`:i$2`button`;return u$1` + <${tag} + part="base" + class=${e$2({"icon-button":!0,"icon-button--disabled":!isLink&&this.disabled,"icon-button--focused":this.hasFocus})} + ?disabled=${o$6(isLink?void 0:this.disabled)} + type=${o$6(isLink?void 0:"button")} + href=${o$6(isLink?this.href:void 0)} + target=${o$6(isLink?this.target:void 0)} + download=${o$6(isLink?this.download:void 0)} + rel=${o$6(isLink&&this.target?"noreferrer noopener":void 0)} + role=${o$6(isLink?void 0:"button")} + aria-disabled=${this.disabled?"true":"false"} + aria-label="${this.label}" + tabindex=${this.disabled?"-1":"0"} + @blur=${this.handleBlur} + @focus=${this.handleFocus} + @click=${this.handleClick} + > + <sl-icon + class="icon-button__icon" + name=${o$6(this.name)} + library=${o$6(this.library)} + src=${o$6(this.src)} + aria-hidden="true" + ></sl-icon> + </${tag}> + `}};SlIconButton.styles=[component_styles_default,icon_button_styles_default],SlIconButton.dependencies={"sl-icon":SlIcon},__decorateClass([e$6(".icon-button")],SlIconButton.prototype,"button",2),__decorateClass([r$6()],SlIconButton.prototype,"hasFocus",2),__decorateClass([n$5()],SlIconButton.prototype,"name",2),__decorateClass([n$5()],SlIconButton.prototype,"library",2),__decorateClass([n$5()],SlIconButton.prototype,"src",2),__decorateClass([n$5()],SlIconButton.prototype,"href",2),__decorateClass([n$5()],SlIconButton.prototype,"target",2),__decorateClass([n$5()],SlIconButton.prototype,"download",2),__decorateClass([n$5()],SlIconButton.prototype,"label",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlIconButton.prototype,"disabled",2);var defaultAnimationRegistry=new Map,customAnimationRegistry=new WeakMap;function ensureAnimation(animation){return null==animation?{keyframes:[],options:{duration:0}}:animation}function getLogicalAnimation(animation,dir){return"rtl"===dir.toLowerCase()?{keyframes:animation.rtlKeyframes||animation.keyframes,options:animation.options}:animation}function setDefaultAnimation(animationName,animation){defaultAnimationRegistry.set(animationName,ensureAnimation(animation))}function getAnimation(el,animationName,options){const customAnimation=customAnimationRegistry.get(el);if(null==customAnimation?void 0:customAnimation[animationName])return getLogicalAnimation(customAnimation[animationName],options.dir);const defaultAnimation=defaultAnimationRegistry.get(animationName);return defaultAnimation?getLogicalAnimation(defaultAnimation,options.dir):{keyframes:[],options:{duration:0}}}function waitForEvent(el,eventName){return new Promise(resolve=>{function done(event){event.target===el&&(el.removeEventListener(eventName,done),resolve())}el.addEventListener(eventName,done)})}function animateTo(el,keyframes,options){return new Promise(resolve=>{if((null==options?void 0:options.duration)===1/0)throw new Error("Promise-based animations must be finite.");const animation=el.animate(keyframes,__spreadProps(__spreadValues({},options),{duration:prefersReducedMotion()?0:options.duration}));animation.addEventListener("cancel",resolve,{once:!0}),animation.addEventListener("finish",resolve,{once:!0})})}function parseDuration(delay){return delay=delay.toString().toLowerCase(),-1<delay.indexOf("ms")?parseFloat(delay):-1<delay.indexOf("s")?1e3*parseFloat(delay):parseFloat(delay)}function prefersReducedMotion(){const query=window.matchMedia("(prefers-reduced-motion: reduce)");return query.matches}function stopAnimations(el){return Promise.all(el.getAnimations().map(animation=>new Promise(resolve=>{animation.cancel(),requestAnimationFrame(resolve)})))}function shimKeyframesHeightAuto(keyframes,calculatedHeight){return keyframes.map(keyframe=>__spreadProps(__spreadValues({},keyframe),{height:"auto"===keyframe.height?`${calculatedHeight}px`:keyframe.height}))}var SlDialog=class extends ShoelaceElement{constructor(){super(...arguments),this.hasSlotController=new HasSlotController(this,"footer"),this.localize=new LocalizeController(this),this.modal=new Modal(this),this.open=!1,this.label="",this.noHeader=!1,this.handleDocumentKeyDown=event=>{"Escape"===event.key&&this.modal.isActive()&&this.open&&(event.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),lockBodyScrolling(this))}disconnectedCallback(){super.disconnectedCallback(),this.modal.deactivate(),unlockBodyScrolling(this),this.removeOpenListeners()}requestClose(source){const slRequestClose=this.emit("sl-request-close",{cancelable:!0,detail:{source}});if(slRequestClose.defaultPrevented){const animation=getAnimation(this,"dialog.denyClose",{dir:this.localize.dir()});return void animateTo(this.panel,animation.keyframes,animation.options)}this.hide()}addOpenListeners(){var _a;"CloseWatcher"in window?(null==(_a=this.closeWatcher)?void 0:_a.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>this.requestClose("keyboard")):document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){var _a;null==(_a=this.closeWatcher)?void 0:_a.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.modal.activate(),lockBodyScrolling(this);const autoFocusTarget=this.querySelector("[autofocus]");autoFocusTarget&&autoFocusTarget.removeAttribute("autofocus"),await Promise.all([stopAnimations(this.dialog),stopAnimations(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame(()=>{const slInitialFocus=this.emit("sl-initial-focus",{cancelable:!0});slInitialFocus.defaultPrevented||(autoFocusTarget?autoFocusTarget.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),autoFocusTarget&&autoFocusTarget.setAttribute("autofocus","")});const panelAnimation=getAnimation(this,"dialog.show",{dir:this.localize.dir()}),overlayAnimation=getAnimation(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([animateTo(this.panel,panelAnimation.keyframes,panelAnimation.options),animateTo(this.overlay,overlayAnimation.keyframes,overlayAnimation.options)]),this.emit("sl-after-show")}else{blurActiveElement(this),this.emit("sl-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([stopAnimations(this.dialog),stopAnimations(this.overlay)]);const panelAnimation=getAnimation(this,"dialog.hide",{dir:this.localize.dir()}),overlayAnimation=getAnimation(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([animateTo(this.overlay,overlayAnimation.keyframes,overlayAnimation.options).then(()=>{this.overlay.hidden=!0}),animateTo(this.panel,panelAnimation.keyframes,panelAnimation.options).then(()=>{this.panel.hidden=!0})]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,unlockBodyScrolling(this);const trigger=this.originalTrigger;"function"==typeof(null==trigger?void 0:trigger.focus)&&setTimeout(()=>trigger.focus()),this.emit("sl-after-hide")}}async show(){if(!this.open)return this.open=!0,waitForEvent(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,waitForEvent(this,"sl-after-hide")}render(){return x$1` + <div + part="base" + class=${e$2({dialog:!0,"dialog--open":this.open,"dialog--has-footer":this.hasSlotController.test("footer")})} + > + <div part="overlay" class="dialog__overlay" @click=${()=>this.requestClose("overlay")} tabindex="-1"></div> + + <div + part="panel" + class="dialog__panel" + role="dialog" + aria-modal="true" + aria-hidden=${this.open?"false":"true"} + aria-label=${o$6(this.noHeader?this.label:void 0)} + aria-labelledby=${o$6(this.noHeader?void 0:"title")} + tabindex="-1" + > + ${this.noHeader?"":x$1` + <header part="header" class="dialog__header"> + <h2 part="title" class="dialog__title" id="title"> + <slot name="label"> ${0<this.label.length?this.label:String.fromCharCode(65279)} </slot> + </h2> + <div part="header-actions" class="dialog__header-actions"> + <slot name="header-actions"></slot> + <sl-icon-button + part="close-button" + exportparts="base:close-button__base" + class="dialog__close" + name="x-lg" + label=${this.localize.term("close")} + library="system" + @click="${()=>this.requestClose("close-button")}" + ></sl-icon-button> + </div> + </header> + `} + ${""} + <div part="body" class="dialog__body" tabindex="-1"><slot></slot></div> + + <footer part="footer" class="dialog__footer"> + <slot name="footer"></slot> + </footer> + </div> + </div> + `}};SlDialog.styles=[component_styles_default,dialog_styles_default],SlDialog.dependencies={"sl-icon-button":SlIconButton},__decorateClass([e$6(".dialog")],SlDialog.prototype,"dialog",2),__decorateClass([e$6(".dialog__panel")],SlDialog.prototype,"panel",2),__decorateClass([e$6(".dialog__overlay")],SlDialog.prototype,"overlay",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlDialog.prototype,"open",2),__decorateClass([n$5({reflect:!0})],SlDialog.prototype,"label",2),__decorateClass([n$5({attribute:"no-header",type:Boolean,reflect:!0})],SlDialog.prototype,"noHeader",2),__decorateClass([watch("open",{waitUntilFirstUpdate:!0})],SlDialog.prototype,"handleOpenChange",1),setDefaultAnimation("dialog.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("dialog.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}}),setDefaultAnimation("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),setDefaultAnimation("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}}),SlDialog.define("sl-dialog");var drawer_styles_default=i$7` + :host { + --size: 25rem; + --header-spacing: var(--sl-spacing-large); + --body-spacing: var(--sl-spacing-large); + --footer-spacing: var(--sl-spacing-large); + + display: contents; + } + + .drawer { + top: 0; + inset-inline-start: 0; + width: 100%; + height: 100%; + pointer-events: none; + overflow: hidden; + } + + .drawer--contained { + position: absolute; + z-index: initial; + } + + .drawer--fixed { + position: fixed; + z-index: var(--sl-z-index-drawer); + } + + .drawer__panel { + position: absolute; + display: flex; + flex-direction: column; + z-index: 2; + max-width: 100%; + max-height: 100%; + background-color: var(--sl-panel-background-color); + box-shadow: var(--sl-shadow-x-large); + overflow: auto; + pointer-events: all; + } + + .drawer__panel:focus { + outline: none; + } + + .drawer--top .drawer__panel { + top: 0; + inset-inline-end: auto; + bottom: auto; + inset-inline-start: 0; + width: 100%; + height: var(--size); + } + + .drawer--end .drawer__panel { + top: 0; + inset-inline-end: 0; + bottom: auto; + inset-inline-start: auto; + width: var(--size); + height: 100%; + } + + .drawer--bottom .drawer__panel { + top: auto; + inset-inline-end: auto; + bottom: 0; + inset-inline-start: 0; + width: 100%; + height: var(--size); + } + + .drawer--start .drawer__panel { + top: 0; + inset-inline-end: auto; + bottom: auto; + inset-inline-start: 0; + width: var(--size); + height: 100%; + } + + .drawer__header { + display: flex; + } + + .drawer__title { + flex: 1 1 auto; + font: inherit; + font-size: var(--sl-font-size-large); + line-height: var(--sl-line-height-dense); + padding: var(--header-spacing); + margin: 0; + } + + .drawer__header-actions { + flex-shrink: 0; + display: flex; + flex-wrap: wrap; + justify-content: end; + gap: var(--sl-spacing-2x-small); + padding: 0 var(--header-spacing); + } + + .drawer__header-actions sl-icon-button, + .drawer__header-actions ::slotted(sl-icon-button) { + flex: 0 0 auto; + display: flex; + align-items: center; + font-size: var(--sl-font-size-medium); + } + + .drawer__body { + flex: 1 1 auto; + display: block; + padding: var(--body-spacing); + overflow: auto; + -webkit-overflow-scrolling: touch; + } + + .drawer__footer { + text-align: right; + padding: var(--footer-spacing); + } + + .drawer__footer ::slotted(sl-button:not(:last-of-type)) { + margin-inline-end: var(--sl-spacing-x-small); + } + + .drawer:not(.drawer--has-footer) .drawer__footer { + display: none; + } + + .drawer__overlay { + display: block; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: var(--sl-overlay-background-color); + pointer-events: all; + } + + .drawer--contained .drawer__overlay { + display: none; + } + + @media (forced-colors: active) { + .drawer__panel { + border: solid 1px var(--sl-color-neutral-0); + } + } +`;function uppercaseFirstLetter(string){return string.charAt(0).toUpperCase()+string.slice(1)}var SlDrawer=class extends ShoelaceElement{constructor(){super(...arguments),this.hasSlotController=new HasSlotController(this,"footer"),this.localize=new LocalizeController(this),this.modal=new Modal(this),this.open=!1,this.label="",this.placement="end",this.contained=!1,this.noHeader=!1,this.handleDocumentKeyDown=event=>{this.contained||"Escape"===event.key&&this.modal.isActive()&&this.open&&(event.stopImmediatePropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),!this.contained&&(this.modal.activate(),lockBodyScrolling(this)))}disconnectedCallback(){super.disconnectedCallback(),unlockBodyScrolling(this),this.removeOpenListeners()}requestClose(source){const slRequestClose=this.emit("sl-request-close",{cancelable:!0,detail:{source}});if(slRequestClose.defaultPrevented){const animation=getAnimation(this,"drawer.denyClose",{dir:this.localize.dir()});return void animateTo(this.panel,animation.keyframes,animation.options)}this.hide()}addOpenListeners(){var _a;"CloseWatcher"in window?(null==(_a=this.closeWatcher)?void 0:_a.destroy(),!this.contained&&(this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>this.requestClose("keyboard"))):document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){var _a;document.removeEventListener("keydown",this.handleDocumentKeyDown),null==(_a=this.closeWatcher)?void 0:_a.destroy()}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||(this.modal.activate(),lockBodyScrolling(this));const autoFocusTarget=this.querySelector("[autofocus]");autoFocusTarget&&autoFocusTarget.removeAttribute("autofocus"),await Promise.all([stopAnimations(this.drawer),stopAnimations(this.overlay)]),this.drawer.hidden=!1,requestAnimationFrame(()=>{const slInitialFocus=this.emit("sl-initial-focus",{cancelable:!0});slInitialFocus.defaultPrevented||(autoFocusTarget?autoFocusTarget.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),autoFocusTarget&&autoFocusTarget.setAttribute("autofocus","")});const panelAnimation=getAnimation(this,`drawer.show${uppercaseFirstLetter(this.placement)}`,{dir:this.localize.dir()}),overlayAnimation=getAnimation(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([animateTo(this.panel,panelAnimation.keyframes,panelAnimation.options),animateTo(this.overlay,overlayAnimation.keyframes,overlayAnimation.options)]),this.emit("sl-after-show")}else{blurActiveElement(this),this.emit("sl-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),unlockBodyScrolling(this)),await Promise.all([stopAnimations(this.drawer),stopAnimations(this.overlay)]);const panelAnimation=getAnimation(this,`drawer.hide${uppercaseFirstLetter(this.placement)}`,{dir:this.localize.dir()}),overlayAnimation=getAnimation(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([animateTo(this.overlay,overlayAnimation.keyframes,overlayAnimation.options).then(()=>{this.overlay.hidden=!0}),animateTo(this.panel,panelAnimation.keyframes,panelAnimation.options).then(()=>{this.panel.hidden=!0})]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;const trigger=this.originalTrigger;"function"==typeof(null==trigger?void 0:trigger.focus)&&setTimeout(()=>trigger.focus()),this.emit("sl-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),lockBodyScrolling(this)),this.open&&this.contained&&(this.modal.deactivate(),unlockBodyScrolling(this))}async show(){if(!this.open)return this.open=!0,waitForEvent(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,waitForEvent(this,"sl-after-hide")}render(){return x$1` + <div + part="base" + class=${e$2({drawer:!0,"drawer--open":this.open,"drawer--top":"top"===this.placement,"drawer--end":"end"===this.placement,"drawer--bottom":"bottom"===this.placement,"drawer--start":"start"===this.placement,"drawer--contained":this.contained,"drawer--fixed":!this.contained,"drawer--rtl":"rtl"===this.localize.dir(),"drawer--has-footer":this.hasSlotController.test("footer")})} + > + <div part="overlay" class="drawer__overlay" @click=${()=>this.requestClose("overlay")} tabindex="-1"></div> + + <div + part="panel" + class="drawer__panel" + role="dialog" + aria-modal="true" + aria-hidden=${this.open?"false":"true"} + aria-label=${o$6(this.noHeader?this.label:void 0)} + aria-labelledby=${o$6(this.noHeader?void 0:"title")} + tabindex="0" + > + ${this.noHeader?"":x$1` + <header part="header" class="drawer__header"> + <h2 part="title" class="drawer__title" id="title"> + <!-- If there's no label, use an invisible character to prevent the header from collapsing --> + <slot name="label"> ${0<this.label.length?this.label:String.fromCharCode(65279)} </slot> + </h2> + <div part="header-actions" class="drawer__header-actions"> + <slot name="header-actions"></slot> + <sl-icon-button + part="close-button" + exportparts="base:close-button__base" + class="drawer__close" + name="x-lg" + label=${this.localize.term("close")} + library="system" + @click=${()=>this.requestClose("close-button")} + ></sl-icon-button> + </div> + </header> + `} + + <slot part="body" class="drawer__body"></slot> + + <footer part="footer" class="drawer__footer"> + <slot name="footer"></slot> + </footer> + </div> + </div> + `}};SlDrawer.styles=[component_styles_default,drawer_styles_default],SlDrawer.dependencies={"sl-icon-button":SlIconButton},__decorateClass([e$6(".drawer")],SlDrawer.prototype,"drawer",2),__decorateClass([e$6(".drawer__panel")],SlDrawer.prototype,"panel",2),__decorateClass([e$6(".drawer__overlay")],SlDrawer.prototype,"overlay",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlDrawer.prototype,"open",2),__decorateClass([n$5({reflect:!0})],SlDrawer.prototype,"label",2),__decorateClass([n$5({reflect:!0})],SlDrawer.prototype,"placement",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlDrawer.prototype,"contained",2),__decorateClass([n$5({attribute:"no-header",type:Boolean,reflect:!0})],SlDrawer.prototype,"noHeader",2),__decorateClass([watch("open",{waitUntilFirstUpdate:!0})],SlDrawer.prototype,"handleOpenChange",1),__decorateClass([watch("contained",{waitUntilFirstUpdate:!0})],SlDrawer.prototype,"handleNoModalChange",1),setDefaultAnimation("drawer.showTop",{keyframes:[{opacity:0,translate:"0 -100%"},{opacity:1,translate:"0 0"}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("drawer.hideTop",{keyframes:[{opacity:1,translate:"0 0"},{opacity:0,translate:"0 -100%"}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("drawer.showBottom",{keyframes:[{opacity:0,translate:"0 100%"},{opacity:1,translate:"0 0"}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("drawer.hideBottom",{keyframes:[{opacity:1,translate:"0 0"},{opacity:0,translate:"0 100%"}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}}),setDefaultAnimation("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),setDefaultAnimation("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}}),SlDrawer.define("sl-drawer");var details_styles_default=i$7` + :host { + display: block; + } + + .details { + border: solid 1px var(--sl-color-neutral-200); + border-radius: var(--sl-border-radius-medium); + background-color: var(--sl-color-neutral-0); + overflow-anchor: none; + } + + .details--disabled { + opacity: 0.5; + } + + .details__header { + display: flex; + align-items: center; + border-radius: inherit; + padding: var(--sl-spacing-medium); + user-select: none; + -webkit-user-select: none; + cursor: pointer; + } + + .details__header::-webkit-details-marker { + display: none; + } + + .details__header:focus { + outline: none; + } + + .details__header:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: calc(1px + var(--sl-focus-ring-offset)); + } + + .details--disabled .details__header { + cursor: not-allowed; + } + + .details--disabled .details__header:focus-visible { + outline: none; + box-shadow: none; + } + + .details__summary { + flex: 1 1 auto; + display: flex; + align-items: center; + } + + .details__summary-icon { + flex: 0 0 auto; + display: flex; + align-items: center; + transition: var(--sl-transition-medium) rotate ease; + } + + .details--open .details__summary-icon { + rotate: 90deg; + } + + .details--open.details--rtl .details__summary-icon { + rotate: -90deg; + } + + .details--open slot[name='expand-icon'], + .details:not(.details--open) slot[name='collapse-icon'] { + display: none; + } + + .details__body { + overflow: hidden; + } + + .details__content { + display: block; + padding: var(--sl-spacing-medium); + } +`,SlDetails=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.open=!1,this.disabled=!1}firstUpdated(){this.body.style.height=this.open?"auto":"0",this.open&&(this.details.open=!0),this.detailsObserver=new MutationObserver(changes=>{for(const change of changes)"attributes"===change.type&&"open"===change.attributeName&&(this.details.open?this.show():this.hide())}),this.detailsObserver.observe(this.details,{attributes:!0})}disconnectedCallback(){var _a;super.disconnectedCallback(),null==(_a=this.detailsObserver)?void 0:_a.disconnect()}handleSummaryClick(event){event.preventDefault(),this.disabled||(this.open?this.hide():this.show(),this.header.focus())}handleSummaryKeyDown(event){("Enter"===event.key||" "===event.key)&&(event.preventDefault(),this.open?this.hide():this.show()),("ArrowUp"===event.key||"ArrowLeft"===event.key)&&(event.preventDefault(),this.hide()),("ArrowDown"===event.key||"ArrowRight"===event.key)&&(event.preventDefault(),this.show())}async handleOpenChange(){if(this.open){this.details.open=!0;const slShow=this.emit("sl-show",{cancelable:!0});if(slShow.defaultPrevented)return this.open=!1,void(this.details.open=!1);await stopAnimations(this.body);const{keyframes,options}=getAnimation(this,"details.show",{dir:this.localize.dir()});await animateTo(this.body,shimKeyframesHeightAuto(keyframes,this.body.scrollHeight),options),this.body.style.height="auto",this.emit("sl-after-show")}else{const slHide=this.emit("sl-hide",{cancelable:!0});if(slHide.defaultPrevented)return this.details.open=!0,void(this.open=!0);await stopAnimations(this.body);const{keyframes,options}=getAnimation(this,"details.hide",{dir:this.localize.dir()});await animateTo(this.body,shimKeyframesHeightAuto(keyframes,this.body.scrollHeight),options),this.body.style.height="auto",this.details.open=!1,this.emit("sl-after-hide")}}async show(){if(!(this.open||this.disabled))return this.open=!0,waitForEvent(this,"sl-after-show")}async hide(){if(this.open&&!this.disabled)return this.open=!1,waitForEvent(this,"sl-after-hide")}render(){const isRtl="rtl"===this.localize.dir();return x$1` + <details + part="base" + class=${e$2({details:!0,"details--open":this.open,"details--disabled":this.disabled,"details--rtl":isRtl})} + > + <summary + part="header" + id="header" + class="details__header" + role="button" + aria-expanded=${this.open?"true":"false"} + aria-controls="content" + aria-disabled=${this.disabled?"true":"false"} + tabindex=${this.disabled?"-1":"0"} + @click=${this.handleSummaryClick} + @keydown=${this.handleSummaryKeyDown} + > + <slot name="summary" part="summary" class="details__summary">${this.summary}</slot> + + <span part="summary-icon" class="details__summary-icon"> + <slot name="expand-icon"> + <sl-icon library="system" name=${isRtl?"chevron-left":"chevron-right"}></sl-icon> + </slot> + <slot name="collapse-icon"> + <sl-icon library="system" name=${isRtl?"chevron-left":"chevron-right"}></sl-icon> + </slot> + </span> + </summary> + + <div class="details__body" role="region" aria-labelledby="header"> + <slot part="content" id="content" class="details__content"></slot> + </div> + </details> + `}};SlDetails.styles=[component_styles_default,details_styles_default],SlDetails.dependencies={"sl-icon":SlIcon},__decorateClass([e$6(".details")],SlDetails.prototype,"details",2),__decorateClass([e$6(".details__header")],SlDetails.prototype,"header",2),__decorateClass([e$6(".details__body")],SlDetails.prototype,"body",2),__decorateClass([e$6(".details__expand-icon-slot")],SlDetails.prototype,"expandIconSlot",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlDetails.prototype,"open",2),__decorateClass([n$5()],SlDetails.prototype,"summary",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlDetails.prototype,"disabled",2),__decorateClass([watch("open",{waitUntilFirstUpdate:!0})],SlDetails.prototype,"handleOpenChange",1),setDefaultAnimation("details.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:250,easing:"linear"}}),setDefaultAnimation("details.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:250,easing:"linear"}}),SlDetails.define("sl-details");var dropdown_styles_default=i$7` + :host { + display: inline-block; + } + + .dropdown::part(popup) { + z-index: var(--sl-z-index-dropdown); + } + + .dropdown[data-current-placement^='top']::part(popup) { + transform-origin: bottom; + } + + .dropdown[data-current-placement^='bottom']::part(popup) { + transform-origin: top; + } + + .dropdown[data-current-placement^='left']::part(popup) { + transform-origin: right; + } + + .dropdown[data-current-placement^='right']::part(popup) { + transform-origin: left; + } + + .dropdown__trigger { + display: block; + } + + .dropdown__panel { + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-medium); + font-weight: var(--sl-font-weight-normal); + box-shadow: var(--sl-shadow-large); + border-radius: var(--sl-border-radius-medium); + pointer-events: none; + } + + .dropdown--open .dropdown__panel { + display: block; + pointer-events: all; + } + + /* When users slot a menu, make sure it conforms to the popup's auto-size */ + ::slotted(sl-menu) { + max-width: var(--auto-size-available-width) !important; + max-height: var(--auto-size-available-height) !important; + } +`,popup_styles_default=i$7` + :host { + --arrow-color: var(--sl-color-neutral-1000); + --arrow-size: 6px; + + /* + * These properties are computed to account for the arrow's dimensions after being rotated 45º. The constant + * 0.7071 is derived from sin(45), which is the diagonal size of the arrow's container after rotating. + */ + --arrow-size-diagonal: calc(var(--arrow-size) * 0.7071); + --arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size)); + + display: contents; + } + + .popup { + position: absolute; + isolation: isolate; + max-width: var(--auto-size-available-width, none); + max-height: var(--auto-size-available-height, none); + } + + .popup--fixed { + position: fixed; + } + + .popup:not(.popup--active) { + display: none; + } + + .popup__arrow { + position: absolute; + width: calc(var(--arrow-size-diagonal) * 2); + height: calc(var(--arrow-size-diagonal) * 2); + rotate: 45deg; + background: var(--arrow-color); + z-index: -1; + } + + /* Hover bridge */ + .popup-hover-bridge:not(.popup-hover-bridge--visible) { + display: none; + } + + .popup-hover-bridge { + position: fixed; + z-index: calc(var(--sl-z-index-dropdown) - 1); + top: 0; + right: 0; + bottom: 0; + left: 0; + clip-path: polygon( + var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0), + var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0), + var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0), + var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0) + ); + } +`;const min=Math.min,max=Math.max,round=Math.round,floor=Math.floor,createCoords=v=>({x:v,y:v}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$1(start,value,end){return max(start,min(value,end))}function evaluate(value,param){return"function"==typeof value?value(param):value}function getSide(placement){return placement.split("-")[0]}function getAlignment(placement){return placement.split("-")[1]}function getOppositeAxis(axis){return"x"===axis?"y":"x"}function getAxisLength(axis){return"y"===axis?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(placement){return yAxisSides.has(getSide(placement))?"y":"x"}function getAlignmentAxis(placement){return getOppositeAxis(getSideAxis(placement))}function getAlignmentSides(placement,rects,rtl){void 0===rtl&&(rtl=!1);const alignment=getAlignment(placement),alignmentAxis=getAlignmentAxis(placement),length=getAxisLength(alignmentAxis);let mainAlignmentSide="x"===alignmentAxis?alignment===(rtl?"end":"start")?"right":"left":"start"===alignment?"bottom":"top";return rects.reference[length]>rects.floating[length]&&(mainAlignmentSide=getOppositePlacement(mainAlignmentSide)),[mainAlignmentSide,getOppositePlacement(mainAlignmentSide)]}function getExpandedPlacements(placement){const oppositePlacement=getOppositePlacement(placement);return[getOppositeAlignmentPlacement(placement),oppositePlacement,getOppositeAlignmentPlacement(oppositePlacement)]}function getOppositeAlignmentPlacement(placement){return placement.replace(/start|end/g,alignment=>oppositeAlignmentMap[alignment])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(side,isStart,rtl){return"top"===side||"bottom"===side?rtl?isStart?rlPlacement:lrPlacement:isStart?lrPlacement:rlPlacement:"left"===side||"right"===side?isStart?tbPlacement:btPlacement:[]}function getOppositeAxisPlacements(placement,flipAlignment,direction,rtl){const alignment=getAlignment(placement);let list=getSideList(getSide(placement),"start"===direction,rtl);return alignment&&(list=list.map(side=>side+"-"+alignment),flipAlignment&&(list=list.concat(list.map(getOppositeAlignmentPlacement)))),list}function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,side=>oppositeSideMap[side])}function expandPaddingObject(padding){return{top:0,right:0,bottom:0,left:0,...padding}}function getPaddingObject(padding){return"number"==typeof padding?{top:padding,right:padding,bottom:padding,left:padding}:expandPaddingObject(padding)}function rectToClientRect(rect){const{x,y,width,height}=rect;return{width,height,top:y,left:x,right:x+width,bottom:y+height,x,y}}function computeCoordsFromPlacement(_ref,placement,rtl){let{reference,floating}=_ref;const sideAxis=getSideAxis(placement),alignmentAxis=getAlignmentAxis(placement),alignLength=getAxisLength(alignmentAxis),side=getSide(placement),isVertical="y"===sideAxis,commonX=reference.x+reference.width/2-floating.width/2,commonY=reference.y+reference.height/2-floating.height/2,commonAlign=reference[alignLength]/2-floating[alignLength]/2;let coords;switch(coords="top"===side?{x:commonX,y:reference.y-floating.height}:"bottom"===side?{x:commonX,y:reference.y+reference.height}:"right"===side?{x:reference.x+reference.width,y:commonY}:"left"===side?{x:reference.x-floating.width,y:commonY}:{x:reference.x,y:reference.y},getAlignment(placement)){case"start":coords[alignmentAxis]-=commonAlign*(rtl&&isVertical?-1:1);break;case"end":coords[alignmentAxis]+=commonAlign*(rtl&&isVertical?-1:1)}return coords}const computePosition$1=async(reference,floating,config)=>{const{placement="bottom",strategy="absolute",middleware=[],platform}=config,validMiddleware=middleware.filter(Boolean),rtl=await(null==platform.isRTL?void 0:platform.isRTL(floating));let rects=await platform.getElementRects({reference,floating,strategy}),{x,y}=computeCoordsFromPlacement(rects,placement,rtl),statefulPlacement=placement,middlewareData={},resetCount=0;for(let i=0;i<validMiddleware.length;i++){const{name,fn}=validMiddleware[i],{x:nextX,y:nextY,data,reset}=await fn({x,y,initialPlacement:placement,placement:statefulPlacement,strategy,middlewareData,rects,platform,elements:{reference,floating}});x=null==nextX?x:nextX,y=null==nextY?y:nextY,middlewareData={...middlewareData,[name]:{...middlewareData[name],...data}},reset&&50>=resetCount&&(resetCount++,"object"==typeof reset&&(reset.placement&&(statefulPlacement=reset.placement),reset.rects&&(rects=!0===reset.rects?await platform.getElementRects({reference,floating,strategy}):reset.rects),{x,y}=computeCoordsFromPlacement(rects,statefulPlacement,rtl)),i=-1)}return{x,y,placement:statefulPlacement,strategy,middlewareData}};async function detectOverflow(state,options){var _await$platform$isEle;void 0===options&&(options={});const{x,y,platform,rects,elements,strategy}=state,{boundary="clippingAncestors",rootBoundary="viewport",elementContext="floating",altBoundary=!1,padding=0}=evaluate(options,state),paddingObject=getPaddingObject(padding),altContext="floating"===elementContext?"reference":"floating",element=elements[altBoundary?altContext:elementContext],clippingClientRect=rectToClientRect(await platform.getClippingRect({element:!(null!=(_await$platform$isEle=await(null==platform.isElement?void 0:platform.isElement(element))))||_await$platform$isEle?element:element.contextElement||(await(null==platform.getDocumentElement?void 0:platform.getDocumentElement(elements.floating))),boundary,rootBoundary,strategy})),rect="floating"===elementContext?{x,y,width:rects.floating.width,height:rects.floating.height}:rects.reference,offsetParent=await(null==platform.getOffsetParent?void 0:platform.getOffsetParent(elements.floating)),offsetScale=(await(null==platform.isElement?void 0:platform.isElement(offsetParent)))?(await(null==platform.getScale?void 0:platform.getScale(offsetParent)))||{x:1,y:1}:{x:1,y:1},elementClientRect=rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect?await platform.convertOffsetParentRelativeRectToViewportRelativeRect({elements,rect,offsetParent,strategy}):rect);return{top:(clippingClientRect.top-elementClientRect.top+paddingObject.top)/offsetScale.y,bottom:(elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom)/offsetScale.y,left:(clippingClientRect.left-elementClientRect.left+paddingObject.left)/offsetScale.x,right:(elementClientRect.right-clippingClientRect.right+paddingObject.right)/offsetScale.x}}const arrow$1=options=>({name:"arrow",options,async fn(state){const{x,y,placement,rects,platform,elements,middlewareData}=state,{element,padding=0}=evaluate(options,state)||{};if(null==element)return{};const paddingObject=getPaddingObject(padding),coords={x,y},axis=getAlignmentAxis(placement),length=getAxisLength(axis),arrowDimensions=await platform.getDimensions(element),isYAxis="y"===axis,minProp=isYAxis?"top":"left",maxProp=isYAxis?"bottom":"right",clientProp=isYAxis?"clientHeight":"clientWidth",endDiff=rects.reference[length]+rects.reference[axis]-coords[axis]-rects.floating[length],startDiff=coords[axis]-rects.reference[axis],arrowOffsetParent=await(null==platform.getOffsetParent?void 0:platform.getOffsetParent(element));let clientSize=arrowOffsetParent?arrowOffsetParent[clientProp]:0;clientSize&&(await(null==platform.isElement?void 0:platform.isElement(arrowOffsetParent)))||(clientSize=elements.floating[clientProp]||rects.floating[length]);const largestPossiblePadding=clientSize/2-arrowDimensions[length]/2-1,minPadding=min(paddingObject[minProp],largestPossiblePadding),maxPadding=min(paddingObject[maxProp],largestPossiblePadding),min$1=minPadding,max=clientSize-arrowDimensions[length]-maxPadding,center=clientSize/2-arrowDimensions[length]/2+(endDiff/2-startDiff/2),offset=clamp$1(min$1,center,max),shouldAddOffset=!middlewareData.arrow&&null!=getAlignment(placement)&¢er!==offset&&0>rects.reference[length]/2-(center<min$1?minPadding:maxPadding)-arrowDimensions[length]/2,alignmentOffset=shouldAddOffset?center<min$1?center-min$1:center-max:0;return{[axis]:coords[axis]+alignmentOffset,data:{[axis]:offset,centerOffset:center-offset-alignmentOffset,...(shouldAddOffset&&{alignmentOffset})},reset:shouldAddOffset}}}),flip$2=function(options){return void 0===options&&(options={}),{name:"flip",options,async fn(state){var _middlewareData$arrow,_middlewareData$flip;const{placement,middlewareData,rects,initialPlacement,platform,elements}=state,{mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!0,fallbackPlacements:specifiedFallbackPlacements,fallbackStrategy="bestFit",fallbackAxisSideDirection="none",flipAlignment=!0,...detectOverflowOptions}=evaluate(options,state);if(null!=(_middlewareData$arrow=middlewareData.arrow)&&_middlewareData$arrow.alignmentOffset)return{};const side=getSide(placement),initialSideAxis=getSideAxis(initialPlacement),isBasePlacement=getSide(initialPlacement)===initialPlacement,rtl=await(null==platform.isRTL?void 0:platform.isRTL(elements.floating)),fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipAlignment?[getOppositePlacement(initialPlacement)]:getExpandedPlacements(initialPlacement)),hasFallbackAxisSideDirection="none"!==fallbackAxisSideDirection;!specifiedFallbackPlacements&&hasFallbackAxisSideDirection&&fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement,flipAlignment,fallbackAxisSideDirection,rtl));const placements=[initialPlacement,...fallbackPlacements],overflow=await detectOverflow(state,detectOverflowOptions),overflows=[];let overflowsData=(null==(_middlewareData$flip=middlewareData.flip)?void 0:_middlewareData$flip.overflows)||[];if(checkMainAxis&&overflows.push(overflow[side]),checkCrossAxis){const sides=getAlignmentSides(placement,rects,rtl);overflows.push(overflow[sides[0]],overflow[sides[1]])}if(overflowsData=[...overflowsData,{placement,overflows}],!overflows.every(side=>0>=side)){var _middlewareData$flip2,_overflowsData$filter;const nextIndex=((null==(_middlewareData$flip2=middlewareData.flip)?void 0:_middlewareData$flip2.index)||0)+1,nextPlacement=placements[nextIndex];if(nextPlacement){const ignoreCrossAxisOverflow="alignment"===checkCrossAxis&&initialSideAxis!==getSideAxis(nextPlacement);if(!ignoreCrossAxisOverflow||overflowsData.every(d=>getSideAxis(d.placement)!==initialSideAxis||0<d.overflows[0]))return{data:{index:nextIndex,overflows:overflowsData},reset:{placement:nextPlacement}}}let resetPlacement=null==(_overflowsData$filter=overflowsData.filter(d=>0>=d.overflows[0]).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:_overflowsData$filter.placement;if(!resetPlacement)switch(fallbackStrategy){case"bestFit":{var _overflowsData$filter2;const placement=null==(_overflowsData$filter2=overflowsData.filter(d=>{if(hasFallbackAxisSideDirection){const currentSideAxis=getSideAxis(d.placement);return currentSideAxis===initialSideAxis||"y"===currentSideAxis}return!0}).map(d=>[d.placement,d.overflows.filter(overflow=>0<overflow).reduce((acc,overflow)=>acc+overflow,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:_overflowsData$filter2[0];placement&&(resetPlacement=placement);break}case"initialPlacement":resetPlacement=initialPlacement}if(placement!==resetPlacement)return{reset:{placement:resetPlacement}}}return{}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(state,options){const{placement,platform,elements}=state,rtl=await(null==platform.isRTL?void 0:platform.isRTL(elements.floating)),side=getSide(placement),alignment=getAlignment(placement),isVertical="y"===getSideAxis(placement),mainAxisMulti=originSides.has(side)?-1:1,crossAxisMulti=rtl&&isVertical?-1:1,rawValue=evaluate(options,state);let{mainAxis,crossAxis,alignmentAxis}="number"==typeof rawValue?{mainAxis:rawValue,crossAxis:0,alignmentAxis:null}:{mainAxis:rawValue.mainAxis||0,crossAxis:rawValue.crossAxis||0,alignmentAxis:rawValue.alignmentAxis};return alignment&&"number"==typeof alignmentAxis&&(crossAxis="end"===alignment?-1*alignmentAxis:alignmentAxis),isVertical?{x:crossAxis*crossAxisMulti,y:mainAxis*mainAxisMulti}:{x:mainAxis*mainAxisMulti,y:crossAxis*crossAxisMulti}}const offset$1=function(options){return void 0===options&&(options=0),{name:"offset",options,async fn(state){var _middlewareData$offse,_middlewareData$arrow;const{x,y,placement,middlewareData}=state,diffCoords=await convertValueToCoords(state,options);return placement===(null==(_middlewareData$offse=middlewareData.offset)?void 0:_middlewareData$offse.placement)&&null!=(_middlewareData$arrow=middlewareData.arrow)&&_middlewareData$arrow.alignmentOffset?{}:{x:x+diffCoords.x,y:y+diffCoords.y,data:{...diffCoords,placement}}}}},shift$1=function(options){return void 0===options&&(options={}),{name:"shift",options,async fn(state){const{x,y,placement}=state,{mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!1,limiter={fn:_ref=>{let{x,y}=_ref;return{x,y}}},...detectOverflowOptions}=evaluate(options,state),coords={x,y},overflow=await detectOverflow(state,detectOverflowOptions),crossAxis=getSideAxis(getSide(placement)),mainAxis=getOppositeAxis(crossAxis);let mainAxisCoord=coords[mainAxis],crossAxisCoord=coords[crossAxis];if(checkMainAxis){const minSide="y"===mainAxis?"top":"left",maxSide="y"===mainAxis?"bottom":"right",min=mainAxisCoord+overflow[minSide],max=mainAxisCoord-overflow[maxSide];mainAxisCoord=clamp$1(min,mainAxisCoord,max)}if(checkCrossAxis){const minSide="y"===crossAxis?"top":"left",maxSide="y"===crossAxis?"bottom":"right",min=crossAxisCoord+overflow[minSide],max=crossAxisCoord-overflow[maxSide];crossAxisCoord=clamp$1(min,crossAxisCoord,max)}const limitedCoords=limiter.fn({...state,[mainAxis]:mainAxisCoord,[crossAxis]:crossAxisCoord});return{...limitedCoords,data:{x:limitedCoords.x-x,y:limitedCoords.y-y,enabled:{[mainAxis]:checkMainAxis,[crossAxis]:checkCrossAxis}}}}}},size$1=function(options){return void 0===options&&(options={}),{name:"size",options,async fn(state){var _state$middlewareData,_state$middlewareData2;const{placement,rects,platform,elements}=state,{apply=()=>{},...detectOverflowOptions}=evaluate(options,state),overflow=await detectOverflow(state,detectOverflowOptions),side=getSide(placement),alignment=getAlignment(placement),isYAxis="y"===getSideAxis(placement),{width,height}=rects.floating;let heightSide,widthSide;"top"===side||"bottom"===side?(heightSide=side,widthSide=alignment===((await(null==platform.isRTL?void 0:platform.isRTL(elements.floating)))?"start":"end")?"left":"right"):(widthSide=side,heightSide="end"===alignment?"top":"bottom");const maximumClippingHeight=height-overflow.top-overflow.bottom,maximumClippingWidth=width-overflow.left-overflow.right,overflowAvailableHeight=min(height-overflow[heightSide],maximumClippingHeight),overflowAvailableWidth=min(width-overflow[widthSide],maximumClippingWidth),noShift=!state.middlewareData.shift;let availableHeight=overflowAvailableHeight,availableWidth=overflowAvailableWidth;if(null!=(_state$middlewareData=state.middlewareData.shift)&&_state$middlewareData.enabled.x&&(availableWidth=maximumClippingWidth),null!=(_state$middlewareData2=state.middlewareData.shift)&&_state$middlewareData2.enabled.y&&(availableHeight=maximumClippingHeight),noShift&&!alignment){const xMin=max(overflow.left,0),xMax=max(overflow.right,0),yMin=max(overflow.top,0),yMax=max(overflow.bottom,0);isYAxis?availableWidth=width-2*(0!==xMin||0!==xMax?xMin+xMax:max(overflow.left,overflow.right)):availableHeight=height-2*(0!==yMin||0!==yMax?yMin+yMax:max(overflow.top,overflow.bottom))}await apply({...state,availableWidth,availableHeight});const nextDimensions=await platform.getDimensions(elements.floating);return width!==nextDimensions.width||height!==nextDimensions.height?{reset:{rects:!0}}:{}}}};function hasWindow$1(){return"undefined"!=typeof window}function getNodeName(node){return isNode(node)?(node.nodeName||"").toLowerCase():"#document"}function getWindow(node){var _node$ownerDocument;return(null==node||null==(_node$ownerDocument=node.ownerDocument)?void 0:_node$ownerDocument.defaultView)||window}function getDocumentElement(node){var _ref;return null==(_ref=(isNode(node)?node.ownerDocument:node.document)||window.document)?void 0:_ref.documentElement}function isNode(value){return!!hasWindow$1()&&(value instanceof Node||value instanceof getWindow(value).Node)}function isElement(value){return!!hasWindow$1()&&(value instanceof Element||value instanceof getWindow(value).Element)}function isHTMLElement(value){return!!hasWindow$1()&&(value instanceof HTMLElement||value instanceof getWindow(value).HTMLElement)}function isShadowRoot(value){return!!(hasWindow$1()&&"undefined"!=typeof ShadowRoot)&&(value instanceof ShadowRoot||value instanceof getWindow(value).ShadowRoot)}const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(element){const{overflow,overflowX,overflowY,display}=getComputedStyle$1(element);return /auto|scroll|overlay|hidden|clip/.test(overflow+overflowY+overflowX)&&!invalidOverflowDisplayValues.has(display)}const tableElements=new Set(["table","td","th"]);function isTableElement(element){return tableElements.has(getNodeName(element))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(element){return topLayerSelectors.some(selector=>{try{return element.matches(selector)}catch(_e){return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(elementOrCss){const webkit=isWebKit(),css=isElement(elementOrCss)?getComputedStyle$1(elementOrCss):elementOrCss;return transformProperties.some(value=>!!css[value]&&"none"!==css[value])||!!css.containerType&&"normal"!==css.containerType||!webkit&&!!css.backdropFilter&&"none"!==css.backdropFilter||!webkit&&!!css.filter&&"none"!==css.filter||willChangeValues.some(value=>(css.willChange||"").includes(value))||containValues.some(value=>(css.contain||"").includes(value))}function getContainingBlock(element){for(let currentNode=getParentNode(element);isHTMLElement(currentNode)&&!isLastTraversableNode(currentNode);){if(isContainingBlock(currentNode))return currentNode;if(isTopLayer(currentNode))return null;currentNode=getParentNode(currentNode)}return null}function isWebKit(){return!!("undefined"!=typeof CSS&&CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(node){return lastTraversableNodeNames.has(getNodeName(node))}function getComputedStyle$1(element){return getWindow(element).getComputedStyle(element)}function getNodeScroll(element){return isElement(element)?{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop}:{scrollLeft:element.scrollX,scrollTop:element.scrollY}}function getParentNode(node){if("html"===getNodeName(node))return node;const result=node.assignedSlot||node.parentNode||isShadowRoot(node)&&node.host||getDocumentElement(node);return isShadowRoot(result)?result.host:result}function getNearestOverflowAncestor(node){const parentNode=getParentNode(node);return isLastTraversableNode(parentNode)?node.ownerDocument?node.ownerDocument.body:node.body:isHTMLElement(parentNode)&&isOverflowElement(parentNode)?parentNode:getNearestOverflowAncestor(parentNode)}function getOverflowAncestors(node,list,traverseIframes){var _node$ownerDocument2;void 0===list&&(list=[]),void 0===traverseIframes&&(traverseIframes=!0);const scrollableAncestor=getNearestOverflowAncestor(node),isBody=scrollableAncestor===(null==(_node$ownerDocument2=node.ownerDocument)?void 0:_node$ownerDocument2.body),win=getWindow(scrollableAncestor);if(isBody){const frameElement=getFrameElement(win);return list.concat(win,win.visualViewport||[],isOverflowElement(scrollableAncestor)?scrollableAncestor:[],frameElement&&traverseIframes?getOverflowAncestors(frameElement):[])}return list.concat(scrollableAncestor,getOverflowAncestors(scrollableAncestor,[],traverseIframes))}function getFrameElement(win){return win.parent&&Object.getPrototypeOf(win.parent)?win.frameElement:null}function getCssDimensions(element){const css=getComputedStyle$1(element);let width=parseFloat(css.width)||0,height=parseFloat(css.height)||0;const hasOffset=isHTMLElement(element),offsetWidth=hasOffset?element.offsetWidth:width,offsetHeight=hasOffset?element.offsetHeight:height,shouldFallback=round(width)!==offsetWidth||round(height)!==offsetHeight;return shouldFallback&&(width=offsetWidth,height=offsetHeight),{width,height,$:shouldFallback}}function unwrapElement(element){return isElement(element)?element:element.contextElement}function getScale(element){var _NumberisFinite=Number.isFinite;const domElement=unwrapElement(element);if(!isHTMLElement(domElement))return createCoords(1);const rect=domElement.getBoundingClientRect(),{width,height,$}=getCssDimensions(domElement);let x=($?round(rect.width):rect.width)/width,y=($?round(rect.height):rect.height)/height;return x&&_NumberisFinite(x)||(x=1),y&&_NumberisFinite(y)||(y=1),{x,y}}const noOffsets=createCoords(0);function getVisualOffsets(element){const win=getWindow(element);return isWebKit()&&win.visualViewport?{x:win.visualViewport.offsetLeft,y:win.visualViewport.offsetTop}:noOffsets}function shouldAddVisualOffsets(element,isFixed,floatingOffsetParent){return void 0===isFixed&&(isFixed=!1),floatingOffsetParent&&(!isFixed||floatingOffsetParent===getWindow(element))&&isFixed}function getBoundingClientRect(element,includeScale,isFixedStrategy,offsetParent){void 0===includeScale&&(includeScale=!1),void 0===isFixedStrategy&&(isFixedStrategy=!1);const clientRect=element.getBoundingClientRect(),domElement=unwrapElement(element);let scale=createCoords(1);includeScale&&(offsetParent?isElement(offsetParent)&&(scale=getScale(offsetParent)):scale=getScale(element));const visualOffsets=shouldAddVisualOffsets(domElement,isFixedStrategy,offsetParent)?getVisualOffsets(domElement):createCoords(0);let x=(clientRect.left+visualOffsets.x)/scale.x,y=(clientRect.top+visualOffsets.y)/scale.y,width=clientRect.width/scale.x,height=clientRect.height/scale.y;if(domElement){const win=getWindow(domElement),offsetWin=offsetParent&&isElement(offsetParent)?getWindow(offsetParent):offsetParent;let currentWin=win,currentIFrame=getFrameElement(currentWin);for(;currentIFrame&&offsetParent&&offsetWin!==currentWin;){const iframeScale=getScale(currentIFrame),iframeRect=currentIFrame.getBoundingClientRect(),css=getComputedStyle$1(currentIFrame),left=iframeRect.left+(currentIFrame.clientLeft+parseFloat(css.paddingLeft))*iframeScale.x,top=iframeRect.top+(currentIFrame.clientTop+parseFloat(css.paddingTop))*iframeScale.y;x*=iframeScale.x,y*=iframeScale.y,width*=iframeScale.x,height*=iframeScale.y,x+=left,y+=top,currentWin=getWindow(currentIFrame),currentIFrame=getFrameElement(currentWin)}}return rectToClientRect({width,height,x,y})}function getWindowScrollBarX(element,rect){const leftScroll=getNodeScroll(element).scrollLeft;return rect?rect.left+leftScroll:getBoundingClientRect(getDocumentElement(element)).left+leftScroll}function getHTMLOffset(documentElement,scroll){const htmlRect=documentElement.getBoundingClientRect(),x=htmlRect.left+scroll.scrollLeft-getWindowScrollBarX(documentElement,htmlRect),y=htmlRect.top+scroll.scrollTop;return{x,y}}function convertOffsetParentRelativeRectToViewportRelativeRect(_ref){let{elements,rect,offsetParent,strategy}=_ref;const isFixed="fixed"===strategy,documentElement=getDocumentElement(offsetParent),topLayer=!!elements&&isTopLayer(elements.floating);if(offsetParent===documentElement||topLayer&&isFixed)return rect;let scroll={scrollLeft:0,scrollTop:0},scale=createCoords(1);const offsets=createCoords(0),isOffsetParentAnElement=isHTMLElement(offsetParent);if((isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)&&(("body"!==getNodeName(offsetParent)||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isHTMLElement(offsetParent))){const offsetRect=getBoundingClientRect(offsetParent);scale=getScale(offsetParent),offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}const htmlOffset=!documentElement||isOffsetParentAnElement||isFixed?createCoords(0):getHTMLOffset(documentElement,scroll);return{width:rect.width*scale.x,height:rect.height*scale.y,x:rect.x*scale.x-scroll.scrollLeft*scale.x+offsets.x+htmlOffset.x,y:rect.y*scale.y-scroll.scrollTop*scale.y+offsets.y+htmlOffset.y}}function getClientRects(element){return Array.from(element.getClientRects())}function getDocumentRect(element){const html=getDocumentElement(element),scroll=getNodeScroll(element),body=element.ownerDocument.body,width=max(html.scrollWidth,html.clientWidth,body.scrollWidth,body.clientWidth),height=max(html.scrollHeight,html.clientHeight,body.scrollHeight,body.clientHeight);let x=-scroll.scrollLeft+getWindowScrollBarX(element);const y=-scroll.scrollTop;return"rtl"===getComputedStyle$1(body).direction&&(x+=max(html.clientWidth,body.clientWidth)-width),{width,height,x,y}}const SCROLLBAR_MAX=25;function getViewportRect(element,strategy){const win=getWindow(element),html=getDocumentElement(element),visualViewport=win.visualViewport;let width=html.clientWidth,height=html.clientHeight,x=0,y=0;if(visualViewport){width=visualViewport.width,height=visualViewport.height;const visualViewportBased=isWebKit();(!visualViewportBased||visualViewportBased&&"fixed"===strategy)&&(x=visualViewport.offsetLeft,y=visualViewport.offsetTop)}const windowScrollbarX=getWindowScrollBarX(html);if(0>=windowScrollbarX){const doc=html.ownerDocument,body=doc.body,bodyStyles=getComputedStyle(body),bodyMarginInline="CSS1Compat"===doc.compatMode?parseFloat(bodyStyles.marginLeft)+parseFloat(bodyStyles.marginRight)||0:0,clippingStableScrollbarWidth=Math.abs(html.clientWidth-body.clientWidth-bodyMarginInline);clippingStableScrollbarWidth<=SCROLLBAR_MAX&&(width-=clippingStableScrollbarWidth)}else windowScrollbarX<=SCROLLBAR_MAX&&(width+=windowScrollbarX);return{width,height,x,y}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(element,strategy){const clientRect=getBoundingClientRect(element,!0,"fixed"===strategy),top=clientRect.top+element.clientTop,left=clientRect.left+element.clientLeft,scale=isHTMLElement(element)?getScale(element):createCoords(1),width=element.clientWidth*scale.x,height=element.clientHeight*scale.y,x=left*scale.x,y=top*scale.y;return{width,height,x,y}}function getClientRectFromClippingAncestor(element,clippingAncestor,strategy){let rect;if("viewport"===clippingAncestor)rect=getViewportRect(element,strategy);else if("document"===clippingAncestor)rect=getDocumentRect(getDocumentElement(element));else if(isElement(clippingAncestor))rect=getInnerBoundingClientRect(clippingAncestor,strategy);else{const visualOffsets=getVisualOffsets(element);rect={x:clippingAncestor.x-visualOffsets.x,y:clippingAncestor.y-visualOffsets.y,width:clippingAncestor.width,height:clippingAncestor.height}}return rectToClientRect(rect)}function hasFixedPositionAncestor(element,stopNode){const parentNode=getParentNode(element);return parentNode!==stopNode&&isElement(parentNode)&&!isLastTraversableNode(parentNode)&&("fixed"===getComputedStyle$1(parentNode).position||hasFixedPositionAncestor(parentNode,stopNode))}function getClippingElementAncestors(element,cache){const cachedResult=cache.get(element);if(cachedResult)return cachedResult;let result=getOverflowAncestors(element,[],!1).filter(el=>isElement(el)&&"body"!==getNodeName(el)),currentContainingBlockComputedStyle=null;const elementIsFixed="fixed"===getComputedStyle$1(element).position;for(let currentNode=elementIsFixed?getParentNode(element):element;isElement(currentNode)&&!isLastTraversableNode(currentNode);){const computedStyle=getComputedStyle$1(currentNode),currentNodeIsContaining=isContainingBlock(currentNode);currentNodeIsContaining||"fixed"!==computedStyle.position||(currentContainingBlockComputedStyle=null);const shouldDropCurrentNode=elementIsFixed?!currentNodeIsContaining&&!currentContainingBlockComputedStyle:!currentNodeIsContaining&&"static"===computedStyle.position&&!!currentContainingBlockComputedStyle&&absoluteOrFixed.has(currentContainingBlockComputedStyle.position)||isOverflowElement(currentNode)&&!currentNodeIsContaining&&hasFixedPositionAncestor(element,currentNode);shouldDropCurrentNode?result=result.filter(ancestor=>ancestor!==currentNode):currentContainingBlockComputedStyle=computedStyle,currentNode=getParentNode(currentNode)}return cache.set(element,result),result}function getClippingRect(_ref){let{element,boundary,rootBoundary,strategy}=_ref;const elementClippingAncestors="clippingAncestors"===boundary?isTopLayer(element)?[]:getClippingElementAncestors(element,this._c):[].concat(boundary),clippingAncestors=[...elementClippingAncestors,rootBoundary],firstClippingAncestor=clippingAncestors[0],clippingRect=clippingAncestors.reduce((accRect,clippingAncestor)=>{const rect=getClientRectFromClippingAncestor(element,clippingAncestor,strategy);return accRect.top=max(rect.top,accRect.top),accRect.right=min(rect.right,accRect.right),accRect.bottom=min(rect.bottom,accRect.bottom),accRect.left=max(rect.left,accRect.left),accRect},getClientRectFromClippingAncestor(element,firstClippingAncestor,strategy));return{width:clippingRect.right-clippingRect.left,height:clippingRect.bottom-clippingRect.top,x:clippingRect.left,y:clippingRect.top}}function getDimensions(element){const{width,height}=getCssDimensions(element);return{width,height}}function getRectRelativeToOffsetParent(element,offsetParent,strategy){function setLeftRTLScrollbarOffset(){offsets.x=getWindowScrollBarX(documentElement)}const isOffsetParentAnElement=isHTMLElement(offsetParent),documentElement=getDocumentElement(offsetParent),isFixed="fixed"===strategy,rect=getBoundingClientRect(element,!0,isFixed,offsetParent);let scroll={scrollLeft:0,scrollTop:0};const offsets=createCoords(0);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)if(("body"!==getNodeName(offsetParent)||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isOffsetParentAnElement){const offsetRect=getBoundingClientRect(offsetParent,!0,isFixed,offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}else documentElement&&setLeftRTLScrollbarOffset();isFixed&&!isOffsetParentAnElement&&documentElement&&setLeftRTLScrollbarOffset();const htmlOffset=!documentElement||isOffsetParentAnElement||isFixed?createCoords(0):getHTMLOffset(documentElement,scroll),x=rect.left+scroll.scrollLeft-offsets.x-htmlOffset.x,y=rect.top+scroll.scrollTop-offsets.y-htmlOffset.y;return{x,y,width:rect.width,height:rect.height}}function isStaticPositioned(element){return"static"===getComputedStyle$1(element).position}function getTrueOffsetParent(element,polyfill){if(!isHTMLElement(element)||"fixed"===getComputedStyle$1(element).position)return null;if(polyfill)return polyfill(element);let rawOffsetParent=element.offsetParent;return getDocumentElement(element)===rawOffsetParent&&(rawOffsetParent=rawOffsetParent.ownerDocument.body),rawOffsetParent}function getOffsetParent(element,polyfill){const win=getWindow(element);if(isTopLayer(element))return win;if(!isHTMLElement(element)){for(let svgOffsetParent=getParentNode(element);svgOffsetParent&&!isLastTraversableNode(svgOffsetParent);){if(isElement(svgOffsetParent)&&!isStaticPositioned(svgOffsetParent))return svgOffsetParent;svgOffsetParent=getParentNode(svgOffsetParent)}return win}let offsetParent=getTrueOffsetParent(element,polyfill);for(;offsetParent&&isTableElement(offsetParent)&&isStaticPositioned(offsetParent);)offsetParent=getTrueOffsetParent(offsetParent,polyfill);return offsetParent&&isLastTraversableNode(offsetParent)&&isStaticPositioned(offsetParent)&&!isContainingBlock(offsetParent)?win:offsetParent||getContainingBlock(element)||win}const getElementRects=async function(data){const getOffsetParentFn=this.getOffsetParent||getOffsetParent,getDimensionsFn=this.getDimensions,floatingDimensions=await getDimensionsFn(data.floating);return{reference:getRectRelativeToOffsetParent(data.reference,await getOffsetParentFn(data.floating),data.strategy),floating:{x:0,y:0,width:floatingDimensions.width,height:floatingDimensions.height}}};function isRTL(element){return"rtl"===getComputedStyle$1(element).direction}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function rectsAreEqual(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}function observeMove(element,onMove){function cleanup(){var _io;clearTimeout(timeoutId),null==(_io=io)||_io.disconnect(),io=null}function refresh(skip,threshold){function handleObserve(entries){const ratio=entries[0].intersectionRatio;if(ratio!==threshold){if(!isFirstUpdate)return refresh();ratio?refresh(!1,ratio):timeoutId=setTimeout(()=>{refresh(!1,1e-7)},1e3)}1!==ratio||rectsAreEqual(elementRectForRootMargin,element.getBoundingClientRect())||refresh(),isFirstUpdate=!1}void 0===skip&&(skip=!1),void 0===threshold&&(threshold=1),cleanup();const elementRectForRootMargin=element.getBoundingClientRect(),{left,top,width,height}=elementRectForRootMargin;if(skip||onMove(),!width||!height)return;const insetTop=floor(top),insetRight=floor(root.clientWidth-(left+width)),insetBottom=floor(root.clientHeight-(top+height)),insetLeft=floor(left),options={rootMargin:-insetTop+"px "+-insetRight+"px "+-insetBottom+"px "+-insetLeft+"px",threshold:max(0,min(1,threshold))||1};let isFirstUpdate=!0;try{io=new IntersectionObserver(handleObserve,{...options,root:root.ownerDocument})}catch(_e){io=new IntersectionObserver(handleObserve,options)}io.observe(element)}let io=null,timeoutId;const root=getDocumentElement(element);return refresh(!0),cleanup}function autoUpdate(reference,floating,update,options){function frameLoop(){const nextRefRect=getBoundingClientRect(reference);prevRefRect&&!rectsAreEqual(prevRefRect,nextRefRect)&&update(),prevRefRect=nextRefRect,frameId=requestAnimationFrame(frameLoop)}void 0===options&&(options={});const{ancestorScroll=!0,ancestorResize=!0,elementResize="function"==typeof ResizeObserver,layoutShift="function"==typeof IntersectionObserver,animationFrame=!1}=options,referenceEl=unwrapElement(reference),ancestors=ancestorScroll||ancestorResize?[...(referenceEl?getOverflowAncestors(referenceEl):[]),...getOverflowAncestors(floating)]:[];ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.addEventListener("scroll",update,{passive:!0}),ancestorResize&&ancestor.addEventListener("resize",update)});const cleanupIo=referenceEl&&layoutShift?observeMove(referenceEl,update):null;let reobserveFrame=-1,resizeObserver=null;elementResize&&(resizeObserver=new ResizeObserver(_ref=>{let[firstEntry]=_ref;firstEntry&&firstEntry.target===referenceEl&&resizeObserver&&(resizeObserver.unobserve(floating),cancelAnimationFrame(reobserveFrame),reobserveFrame=requestAnimationFrame(()=>{var _resizeObserver;null==(_resizeObserver=resizeObserver)||_resizeObserver.observe(floating)})),update()}),referenceEl&&!animationFrame&&resizeObserver.observe(referenceEl),resizeObserver.observe(floating));let prevRefRect=animationFrame?getBoundingClientRect(reference):null,frameId;return animationFrame&&frameLoop(),update(),()=>{var _resizeObserver2;ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.removeEventListener("scroll",update),ancestorResize&&ancestor.removeEventListener("resize",update)}),null==cleanupIo||cleanupIo(),null==(_resizeObserver2=resizeObserver)||_resizeObserver2.disconnect(),resizeObserver=null,animationFrame&&cancelAnimationFrame(frameId)}}const offset=offset$1,shift=shift$1,flip$1=flip$2,size=size$1,arrow=arrow$1,computePosition=(reference,floating,options)=>{const cache=new Map,mergedOptions={platform,...options},platformWithCache={...mergedOptions.platform,_c:cache};return computePosition$1(reference,floating,{...mergedOptions,platform:platformWithCache})};function offsetParent(element){return offsetParentPolyfill(element)}function flatTreeParent(element){return element.assignedSlot?element.assignedSlot:element.parentNode instanceof ShadowRoot?element.parentNode.host:element.parentNode}function offsetParentPolyfill(element){for(let ancestor=element;ancestor;ancestor=flatTreeParent(ancestor))if(ancestor instanceof Element&&"none"===getComputedStyle(ancestor).display)return null;for(let ancestor=flatTreeParent(element);ancestor;ancestor=flatTreeParent(ancestor)){if(!(ancestor instanceof Element))continue;const style=getComputedStyle(ancestor);if("contents"!==style.display){if("static"!==style.position||isContainingBlock(style))return ancestor;if("BODY"===ancestor.tagName)return ancestor}}return null}function isVirtualElement(e){return null!==e&&"object"==typeof e&&"getBoundingClientRect"in e&&(!("contextElement"in e)||e.contextElement instanceof Element)}var SlPopup=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const anchorRect=this.anchorEl.getBoundingClientRect(),popupRect=this.popup.getBoundingClientRect(),isVertical=this.placement.includes("top")||this.placement.includes("bottom");let topLeftX=0,topLeftY=0,topRightX=0,topRightY=0,bottomLeftX=0,bottomLeftY=0,bottomRightX=0,bottomRightY=0;isVertical?anchorRect.top<popupRect.top?(topLeftX=anchorRect.left,topLeftY=anchorRect.bottom,topRightX=anchorRect.right,topRightY=anchorRect.bottom,bottomLeftX=popupRect.left,bottomLeftY=popupRect.top,bottomRightX=popupRect.right,bottomRightY=popupRect.top):(topLeftX=popupRect.left,topLeftY=popupRect.bottom,topRightX=popupRect.right,topRightY=popupRect.bottom,bottomLeftX=anchorRect.left,bottomLeftY=anchorRect.top,bottomRightX=anchorRect.right,bottomRightY=anchorRect.top):anchorRect.left<popupRect.left?(topLeftX=anchorRect.right,topLeftY=anchorRect.top,topRightX=popupRect.left,topRightY=popupRect.top,bottomLeftX=anchorRect.right,bottomLeftY=anchorRect.bottom,bottomRightX=popupRect.left,bottomRightY=popupRect.bottom):(topLeftX=popupRect.right,topLeftY=popupRect.top,topRightX=anchorRect.left,topRightY=anchorRect.top,bottomLeftX=popupRect.right,bottomLeftY=popupRect.bottom,bottomRightX=anchorRect.left,bottomRightY=anchorRect.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${topLeftX}px`),this.style.setProperty("--hover-bridge-top-left-y",`${topLeftY}px`),this.style.setProperty("--hover-bridge-top-right-x",`${topRightX}px`),this.style.setProperty("--hover-bridge-top-right-y",`${topRightY}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${bottomLeftX}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${bottomLeftY}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${bottomRightX}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${bottomRightY}px`)}}}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(changedProps){super.updated(changedProps),changedProps.has("active")&&(this.active?this.start():this.stop()),changedProps.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const root=this.getRootNode();this.anchorEl=root.getElementById(this.anchor)}else this.anchorEl=this.anchor instanceof Element||isVirtualElement(this.anchor)?this.anchor:this.querySelector("[slot=\"anchor\"]");this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.active&&this.start()}start(){this.anchorEl&&this.active&&(this.cleanup=autoUpdate(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(resolve=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>resolve())):resolve()})}reposition(){if(this.active&&this.anchorEl){const middleware=[offset({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?middleware.push(size({apply:({rects})=>{const syncWidth="width"===this.sync||"both"===this.sync,syncHeight="height"===this.sync||"both"===this.sync;this.popup.style.width=syncWidth?`${rects.reference.width}px`:"",this.popup.style.height=syncHeight?`${rects.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&middleware.push(flip$1({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&middleware.push(shift({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?middleware.push(size({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth,availableHeight})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${availableHeight}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${availableWidth}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&middleware.push(arrow({element:this.arrowEl,padding:this.arrowPadding}));const getOffsetParent="absolute"===this.strategy?element=>platform.getOffsetParent(element,offsetParent):platform.getOffsetParent;computePosition(this.anchorEl,this.popup,{placement:this.placement,middleware,strategy:this.strategy,platform:__spreadProps(__spreadValues({},platform),{getOffsetParent})}).then(({x,y,middlewareData,placement})=>{const isRtl="rtl"===this.localize.dir(),staticSide={top:"bottom",right:"left",bottom:"top",left:"right"}[placement.split("-")[0]];if(this.setAttribute("data-current-placement",placement),Object.assign(this.popup.style,{left:`${x}px`,top:`${y}px`}),this.arrow){const arrowX=middlewareData.arrow.x,arrowY=middlewareData.arrow.y;let top="",right="",bottom="",left="";if("start"===this.arrowPlacement){const value="number"==typeof arrowX?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";top="number"==typeof arrowY?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",right=isRtl?value:"",left=isRtl?"":value}else if("end"===this.arrowPlacement){const value="number"==typeof arrowX?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";right=isRtl?"":value,left=isRtl?value:"",bottom="number"==typeof arrowY?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(left="number"==typeof arrowX?`calc(50% - var(--arrow-size-diagonal))`:"",top="number"==typeof arrowY?`calc(50% - var(--arrow-size-diagonal))`:""):(left="number"==typeof arrowX?`${arrowX}px`:"",top="number"==typeof arrowY?`${arrowY}px`:"");Object.assign(this.arrowEl.style,{top,right,bottom,left,[staticSide]:"calc(var(--arrow-size-diagonal) * -1)"})}}),requestAnimationFrame(()=>this.updateHoverBridge()),this.emit("sl-reposition")}}render(){return x$1` + <slot name="anchor" @slotchange=${this.handleAnchorChange}></slot> + + <span + part="hover-bridge" + class=${e$2({"popup-hover-bridge":!0,"popup-hover-bridge--visible":this.hoverBridge&&this.active})} + ></span> + + <div + part="popup" + class=${e$2({popup:!0,"popup--active":this.active,"popup--fixed":"fixed"===this.strategy,"popup--has-arrow":this.arrow})} + > + <slot></slot> + ${this.arrow?x$1`<div part="arrow" class="popup__arrow" role="presentation"></div>`:""} + </div> + `}};SlPopup.styles=[component_styles_default,popup_styles_default],__decorateClass([e$6(".popup")],SlPopup.prototype,"popup",2),__decorateClass([e$6(".popup__arrow")],SlPopup.prototype,"arrowEl",2),__decorateClass([n$5()],SlPopup.prototype,"anchor",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlPopup.prototype,"active",2),__decorateClass([n$5({reflect:!0})],SlPopup.prototype,"placement",2),__decorateClass([n$5({reflect:!0})],SlPopup.prototype,"strategy",2),__decorateClass([n$5({type:Number})],SlPopup.prototype,"distance",2),__decorateClass([n$5({type:Number})],SlPopup.prototype,"skidding",2),__decorateClass([n$5({type:Boolean})],SlPopup.prototype,"arrow",2),__decorateClass([n$5({attribute:"arrow-placement"})],SlPopup.prototype,"arrowPlacement",2),__decorateClass([n$5({attribute:"arrow-padding",type:Number})],SlPopup.prototype,"arrowPadding",2),__decorateClass([n$5({type:Boolean})],SlPopup.prototype,"flip",2),__decorateClass([n$5({attribute:"flip-fallback-placements",converter:{fromAttribute:value=>value.split(" ").map(p=>p.trim()).filter(p=>""!==p),toAttribute:value=>value.join(" ")}})],SlPopup.prototype,"flipFallbackPlacements",2),__decorateClass([n$5({attribute:"flip-fallback-strategy"})],SlPopup.prototype,"flipFallbackStrategy",2),__decorateClass([n$5({type:Object})],SlPopup.prototype,"flipBoundary",2),__decorateClass([n$5({attribute:"flip-padding",type:Number})],SlPopup.prototype,"flipPadding",2),__decorateClass([n$5({type:Boolean})],SlPopup.prototype,"shift",2),__decorateClass([n$5({type:Object})],SlPopup.prototype,"shiftBoundary",2),__decorateClass([n$5({attribute:"shift-padding",type:Number})],SlPopup.prototype,"shiftPadding",2),__decorateClass([n$5({attribute:"auto-size"})],SlPopup.prototype,"autoSize",2),__decorateClass([n$5()],SlPopup.prototype,"sync",2),__decorateClass([n$5({type:Object})],SlPopup.prototype,"autoSizeBoundary",2),__decorateClass([n$5({attribute:"auto-size-padding",type:Number})],SlPopup.prototype,"autoSizePadding",2),__decorateClass([n$5({attribute:"hover-bridge",type:Boolean})],SlPopup.prototype,"hoverBridge",2);var SlDropdown=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.sync=void 0,this.handleKeyDown=event=>{this.open&&"Escape"===event.key&&(event.stopPropagation(),this.hide(),this.focusOnTrigger())},this.handleDocumentKeyDown=event=>{var _a;if("Escape"===event.key&&this.open&&!this.closeWatcher)return event.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===event.key){if(this.open&&"sl-menu-item"===(null==(_a=document.activeElement)?void 0:_a.tagName.toLowerCase()))return event.preventDefault(),this.hide(),void this.focusOnTrigger();const computeClosestContaining=(element,tagName)=>{if(!element)return null;const closest=element.closest(tagName);if(closest)return closest;const rootNode=element.getRootNode();return rootNode instanceof ShadowRoot?computeClosestContaining(rootNode.host,tagName):null};setTimeout(()=>{var _a2;const activeElement=(null==(_a2=this.containingElement)?void 0:_a2.getRootNode())instanceof ShadowRoot?getDeepestActiveElement():document.activeElement;this.containingElement&&computeClosestContaining(activeElement,this.containingElement.tagName.toLowerCase())===this.containingElement||this.hide()})}},this.handleDocumentMouseDown=event=>{const path=event.composedPath();this.containingElement&&!path.includes(this.containingElement)&&this.hide()},this.handlePanelSelect=event=>{const target=event.target;this.stayOpenOnSelect||"sl-menu"!==target.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}}connectedCallback(){super.connectedCallback(),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}focusOnTrigger(){const trigger=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(null==trigger?void 0:trigger.focus)&&trigger.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find(el=>"sl-menu"===el.tagName.toLowerCase())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}async handleTriggerKeyDown(event){if([" ","Enter"].includes(event.key))return event.preventDefault(),void this.handleTriggerClick();const menu=this.getMenu();if(menu){const menuItems=menu.getAllItems(),firstMenuItem=menuItems[0],lastMenuItem=menuItems[menuItems.length-1];["ArrowDown","ArrowUp","Home","End"].includes(event.key)&&(event.preventDefault(),!this.open&&(this.show(),await this.updateComplete),0<menuItems.length&&this.updateComplete.then(()=>{("ArrowDown"===event.key||"Home"===event.key)&&(menu.setCurrentItem(firstMenuItem),firstMenuItem.focus()),("ArrowUp"===event.key||"End"===event.key)&&(menu.setCurrentItem(lastMenuItem),lastMenuItem.focus())}))}}handleTriggerKeyUp(event){" "===event.key&&event.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const assignedElements=this.trigger.assignedElements({flatten:!0}),accessibleTrigger=assignedElements.find(el=>getTabbableBoundary(el).start);let target;if(accessibleTrigger){switch(accessibleTrigger.tagName.toLowerCase()){case"sl-button":case"sl-icon-button":target=accessibleTrigger.button;break;default:target=accessibleTrigger}target.setAttribute("aria-haspopup","true"),target.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,waitForEvent(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,waitForEvent(this,"sl-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){var _a;this.panel.addEventListener("sl-select",this.handlePanelSelect),"CloseWatcher"in window?(null==(_a=this.closeWatcher)?void 0:_a.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide(),this.focusOnTrigger()}):this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){var _a;this.panel&&(this.panel.removeEventListener("sl-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),null==(_a=this.closeWatcher)?void 0:_a.destroy()}async handleOpenChange(){if(this.disabled)return void(this.open=!1);if(this.updateAccessibleTrigger(),this.open){this.emit("sl-show"),this.addOpenListeners(),await stopAnimations(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes,options}=getAnimation(this,"dropdown.show",{dir:this.localize.dir()});await animateTo(this.popup.popup,keyframes,options),this.emit("sl-after-show")}else{this.emit("sl-hide"),this.removeOpenListeners(),await stopAnimations(this);const{keyframes,options}=getAnimation(this,"dropdown.hide",{dir:this.localize.dir()});await animateTo(this.popup.popup,keyframes,options),this.panel.hidden=!0,this.popup.active=!1,this.emit("sl-after-hide")}}render(){return x$1` + <sl-popup + part="base" + exportparts="popup:base__popup" + id="dropdown" + placement=${this.placement} + distance=${this.distance} + skidding=${this.skidding} + strategy=${this.hoist?"fixed":"absolute"} + flip + shift + auto-size="vertical" + auto-size-padding="10" + sync=${o$6(this.sync?this.sync:void 0)} + class=${e$2({dropdown:!0,"dropdown--open":this.open})} + > + <slot + name="trigger" + slot="anchor" + part="trigger" + class="dropdown__trigger" + @click=${this.handleTriggerClick} + @keydown=${this.handleTriggerKeyDown} + @keyup=${this.handleTriggerKeyUp} + @slotchange=${this.handleTriggerSlotChange} + ></slot> + + <div aria-hidden=${this.open?"false":"true"} aria-labelledby="dropdown"> + <slot part="panel" class="dropdown__panel"></slot> + </div> + </sl-popup> + `}};SlDropdown.styles=[component_styles_default,dropdown_styles_default],SlDropdown.dependencies={"sl-popup":SlPopup},__decorateClass([e$6(".dropdown")],SlDropdown.prototype,"popup",2),__decorateClass([e$6(".dropdown__trigger")],SlDropdown.prototype,"trigger",2),__decorateClass([e$6(".dropdown__panel")],SlDropdown.prototype,"panel",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlDropdown.prototype,"open",2),__decorateClass([n$5({reflect:!0})],SlDropdown.prototype,"placement",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlDropdown.prototype,"disabled",2),__decorateClass([n$5({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],SlDropdown.prototype,"stayOpenOnSelect",2),__decorateClass([n$5({attribute:!1})],SlDropdown.prototype,"containingElement",2),__decorateClass([n$5({type:Number})],SlDropdown.prototype,"distance",2),__decorateClass([n$5({type:Number})],SlDropdown.prototype,"skidding",2),__decorateClass([n$5({type:Boolean})],SlDropdown.prototype,"hoist",2),__decorateClass([n$5({reflect:!0})],SlDropdown.prototype,"sync",2),__decorateClass([watch("open",{waitUntilFirstUpdate:!0})],SlDropdown.prototype,"handleOpenChange",1),setDefaultAnimation("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),setDefaultAnimation("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});var dropdown_default=SlDropdown;SlDropdown.define("sl-dropdown"),SlIcon.define("sl-icon"),SlIconButton.define("sl-icon-button");var input_styles_default=i$7` + :host { + display: block; + } + + .input { + flex: 1 1 auto; + display: inline-flex; + align-items: stretch; + justify-content: start; + position: relative; + width: 100%; + font-family: var(--sl-input-font-family); + font-weight: var(--sl-input-font-weight); + letter-spacing: var(--sl-input-letter-spacing); + vertical-align: middle; + overflow: hidden; + cursor: text; + transition: + var(--sl-transition-fast) color, + var(--sl-transition-fast) border, + var(--sl-transition-fast) box-shadow, + var(--sl-transition-fast) background-color; + } + + /* Standard inputs */ + .input--standard { + background-color: var(--sl-input-background-color); + border: solid var(--sl-input-border-width) var(--sl-input-border-color); + } + + .input--standard:hover:not(.input--disabled) { + background-color: var(--sl-input-background-color-hover); + border-color: var(--sl-input-border-color-hover); + } + + .input--standard.input--focused:not(.input--disabled) { + background-color: var(--sl-input-background-color-focus); + border-color: var(--sl-input-border-color-focus); + box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color); + } + + .input--standard.input--focused:not(.input--disabled) .input__control { + color: var(--sl-input-color-focus); + } + + .input--standard.input--disabled { + background-color: var(--sl-input-background-color-disabled); + border-color: var(--sl-input-border-color-disabled); + opacity: 0.5; + cursor: not-allowed; + } + + .input--standard.input--disabled .input__control { + color: var(--sl-input-color-disabled); + } + + .input--standard.input--disabled .input__control::placeholder { + color: var(--sl-input-placeholder-color-disabled); + } + + /* Filled inputs */ + .input--filled { + border: none; + background-color: var(--sl-input-filled-background-color); + color: var(--sl-input-color); + } + + .input--filled:hover:not(.input--disabled) { + background-color: var(--sl-input-filled-background-color-hover); + } + + .input--filled.input--focused:not(.input--disabled) { + background-color: var(--sl-input-filled-background-color-focus); + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .input--filled.input--disabled { + background-color: var(--sl-input-filled-background-color-disabled); + opacity: 0.5; + cursor: not-allowed; + } + + .input__control { + flex: 1 1 auto; + font-family: inherit; + font-size: inherit; + font-weight: inherit; + min-width: 0; + height: 100%; + color: var(--sl-input-color); + border: none; + background: inherit; + box-shadow: none; + padding: 0; + margin: 0; + cursor: inherit; + -webkit-appearance: none; + } + + .input__control::-webkit-search-decoration, + .input__control::-webkit-search-cancel-button, + .input__control::-webkit-search-results-button, + .input__control::-webkit-search-results-decoration { + -webkit-appearance: none; + } + + .input__control:-webkit-autofill, + .input__control:-webkit-autofill:hover, + .input__control:-webkit-autofill:focus, + .input__control:-webkit-autofill:active { + box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-background-color-hover) inset !important; + -webkit-text-fill-color: var(--sl-color-primary-500); + caret-color: var(--sl-input-color); + } + + .input--filled .input__control:-webkit-autofill, + .input--filled .input__control:-webkit-autofill:hover, + .input--filled .input__control:-webkit-autofill:focus, + .input--filled .input__control:-webkit-autofill:active { + box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-filled-background-color) inset !important; + } + + .input__control::placeholder { + color: var(--sl-input-placeholder-color); + user-select: none; + -webkit-user-select: none; + } + + .input:hover:not(.input--disabled) .input__control { + color: var(--sl-input-color-hover); + } + + .input__control:focus { + outline: none; + } + + .input__prefix, + .input__suffix { + display: inline-flex; + flex: 0 0 auto; + align-items: center; + cursor: default; + } + + .input__prefix ::slotted(sl-icon), + .input__suffix ::slotted(sl-icon) { + color: var(--sl-input-icon-color); + } + + /* + * Size modifiers + */ + + .input--small { + border-radius: var(--sl-input-border-radius-small); + font-size: var(--sl-input-font-size-small); + height: var(--sl-input-height-small); + } + + .input--small .input__control { + height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2); + padding: 0 var(--sl-input-spacing-small); + } + + .input--small .input__clear, + .input--small .input__password-toggle { + width: calc(1em + var(--sl-input-spacing-small) * 2); + } + + .input--small .input__prefix ::slotted(*) { + margin-inline-start: var(--sl-input-spacing-small); + } + + .input--small .input__suffix ::slotted(*) { + margin-inline-end: var(--sl-input-spacing-small); + } + + .input--medium { + border-radius: var(--sl-input-border-radius-medium); + font-size: var(--sl-input-font-size-medium); + height: var(--sl-input-height-medium); + } + + .input--medium .input__control { + height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2); + padding: 0 var(--sl-input-spacing-medium); + } + + .input--medium .input__clear, + .input--medium .input__password-toggle { + width: calc(1em + var(--sl-input-spacing-medium) * 2); + } + + .input--medium .input__prefix ::slotted(*) { + margin-inline-start: var(--sl-input-spacing-medium); + } + + .input--medium .input__suffix ::slotted(*) { + margin-inline-end: var(--sl-input-spacing-medium); + } + + .input--large { + border-radius: var(--sl-input-border-radius-large); + font-size: var(--sl-input-font-size-large); + height: var(--sl-input-height-large); + } + + .input--large .input__control { + height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2); + padding: 0 var(--sl-input-spacing-large); + } + + .input--large .input__clear, + .input--large .input__password-toggle { + width: calc(1em + var(--sl-input-spacing-large) * 2); + } + + .input--large .input__prefix ::slotted(*) { + margin-inline-start: var(--sl-input-spacing-large); + } + + .input--large .input__suffix ::slotted(*) { + margin-inline-end: var(--sl-input-spacing-large); + } + + /* + * Pill modifier + */ + + .input--pill.input--small { + border-radius: var(--sl-input-height-small); + } + + .input--pill.input--medium { + border-radius: var(--sl-input-height-medium); + } + + .input--pill.input--large { + border-radius: var(--sl-input-height-large); + } + + /* + * Clearable + Password Toggle + */ + + .input__clear, + .input__password-toggle { + display: inline-flex; + align-items: center; + justify-content: center; + font-size: inherit; + color: var(--sl-input-icon-color); + border: none; + background: none; + padding: 0; + transition: var(--sl-transition-fast) color; + cursor: pointer; + } + + .input__clear:hover, + .input__password-toggle:hover { + color: var(--sl-input-icon-color-hover); + } + + .input__clear:focus, + .input__password-toggle:focus { + outline: none; + } + + /* Don't show the browser's password toggle in Edge */ + ::-ms-reveal { + display: none; + } + + /* Hide the built-in number spinner */ + .input--no-spin-buttons input[type='number']::-webkit-outer-spin-button, + .input--no-spin-buttons input[type='number']::-webkit-inner-spin-button { + -webkit-appearance: none; + display: none; + } + + .input--no-spin-buttons input[type='number'] { + -moz-appearance: textfield; + } +`,SlInput=class extends ShoelaceElement{constructor(){super(...arguments),this.formControlController=new FormControlController(this,{assumeInteractionOn:["sl-blur","sl-input"]}),this.hasSlotController=new HasSlotController(this,"help-text","label"),this.localize=new LocalizeController(this),this.hasFocus=!1,this.title="",this.__numberInput=Object.assign(document.createElement("input"),{type:"number"}),this.__dateInput=Object.assign(document.createElement("input"),{type:"date"}),this.type="text",this.name="",this.value="",this.defaultValue="",this.size="medium",this.filled=!1,this.pill=!1,this.label="",this.helpText="",this.clearable=!1,this.disabled=!1,this.placeholder="",this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.noSpinButtons=!1,this.form="",this.required=!1,this.spellcheck=!0}get valueAsDate(){var _a;return this.__dateInput.type=this.type,this.__dateInput.value=this.value,(null==(_a=this.input)?void 0:_a.valueAsDate)||this.__dateInput.valueAsDate}set valueAsDate(newValue){this.__dateInput.type=this.type,this.__dateInput.valueAsDate=newValue,this.value=this.__dateInput.value}get valueAsNumber(){var _a;return this.__numberInput.value=this.value,(null==(_a=this.input)?void 0:_a.valueAsNumber)||this.__numberInput.valueAsNumber}set valueAsNumber(newValue){this.__numberInput.valueAsNumber=newValue,this.value=this.__numberInput.value}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleChange(){this.value=this.input.value,this.emit("sl-change")}handleClearClick(event){event.preventDefault(),""!==this.value&&(this.value="",this.emit("sl-clear"),this.emit("sl-input"),this.emit("sl-change")),this.input.focus()}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleInput(){this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sl-input")}handleInvalid(event){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(event)}handleKeyDown(event){const hasModifier=event.metaKey||event.ctrlKey||event.shiftKey||event.altKey;"Enter"!==event.key||hasModifier||setTimeout(()=>{event.defaultPrevented||event.isComposing||this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=this.step+"",this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(options){this.input.focus(options)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(selectionStart,selectionEnd,selectionDirection="none"){this.input.setSelectionRange(selectionStart,selectionEnd,selectionDirection)}setRangeText(replacement,start,end,selectMode="preserve"){const selectionStart=null==start?this.input.selectionStart:start,selectionEnd=null==end?this.input.selectionEnd:end;this.input.setRangeText(replacement,selectionStart,selectionEnd,selectMode),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(message){this.input.setCustomValidity(message),this.formControlController.updateValidity()}render(){const hasLabelSlot=this.hasSlotController.test("label"),hasHelpTextSlot=this.hasSlotController.test("help-text"),hasLabel=!!this.label||!!hasLabelSlot,hasHelpText=!!this.helpText||!!hasHelpTextSlot,hasClearIcon=this.clearable&&!this.disabled&&!this.readonly,isClearIconVisible=hasClearIcon&&("number"==typeof this.value||0<this.value.length);return x$1` + <div + part="form-control" + class=${e$2({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-label":hasLabel,"form-control--has-help-text":hasHelpText})} + > + <label + part="form-control-label" + class="form-control__label" + for="input" + aria-hidden=${hasLabel?"false":"true"} + > + <slot name="label">${this.label}</slot> + </label> + + <div part="form-control-input" class="form-control-input"> + <div + part="base" + class=${e$2({input:!0,"input--small":"small"===this.size,"input--medium":"medium"===this.size,"input--large":"large"===this.size,"input--pill":this.pill,"input--standard":!this.filled,"input--filled":this.filled,"input--disabled":this.disabled,"input--focused":this.hasFocus,"input--empty":!this.value,"input--no-spin-buttons":this.noSpinButtons})} + > + <span part="prefix" class="input__prefix"> + <slot name="prefix"></slot> + </span> + + <input + part="input" + id="input" + class="input__control" + type=${"password"===this.type&&this.passwordVisible?"text":this.type} + title=${this.title} + name=${o$6(this.name)} + ?disabled=${this.disabled} + ?readonly=${this.readonly} + ?required=${this.required} + placeholder=${o$6(this.placeholder)} + minlength=${o$6(this.minlength)} + maxlength=${o$6(this.maxlength)} + min=${o$6(this.min)} + max=${o$6(this.max)} + step=${o$6(this.step)} + .value=${l(this.value)} + autocapitalize=${o$6(this.autocapitalize)} + autocomplete=${o$6(this.autocomplete)} + autocorrect=${o$6(this.autocorrect)} + ?autofocus=${this.autofocus} + spellcheck=${this.spellcheck} + pattern=${o$6(this.pattern)} + enterkeyhint=${o$6(this.enterkeyhint)} + inputmode=${o$6(this.inputmode)} + aria-describedby="help-text" + @change=${this.handleChange} + @input=${this.handleInput} + @invalid=${this.handleInvalid} + @keydown=${this.handleKeyDown} + @focus=${this.handleFocus} + @blur=${this.handleBlur} + /> + + ${isClearIconVisible?x$1` + <button + part="clear-button" + class="input__clear" + type="button" + aria-label=${this.localize.term("clearEntry")} + @click=${this.handleClearClick} + tabindex="-1" + > + <slot name="clear-icon"> + <sl-icon name="x-circle-fill" library="system"></sl-icon> + </slot> + </button> + `:""} + ${this.passwordToggle&&!this.disabled?x$1` + <button + part="password-toggle-button" + class="input__password-toggle" + type="button" + aria-label=${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")} + @click=${this.handlePasswordToggle} + tabindex="-1" + > + ${this.passwordVisible?x$1` + <slot name="show-password-icon"> + <sl-icon name="eye-slash" library="system"></sl-icon> + </slot> + `:x$1` + <slot name="hide-password-icon"> + <sl-icon name="eye" library="system"></sl-icon> + </slot> + `} + </button> + `:""} + + <span part="suffix" class="input__suffix"> + <slot name="suffix"></slot> + </span> + </div> + </div> + + <div + part="form-control-help-text" + id="help-text" + class="form-control__help-text" + aria-hidden=${hasHelpText?"false":"true"} + > + <slot name="help-text">${this.helpText}</slot> + </div> + </div> + `}};SlInput.styles=[component_styles_default,form_control_styles_default,input_styles_default],SlInput.dependencies={"sl-icon":SlIcon},__decorateClass([e$6(".input__control")],SlInput.prototype,"input",2),__decorateClass([r$6()],SlInput.prototype,"hasFocus",2),__decorateClass([n$5()],SlInput.prototype,"title",2),__decorateClass([n$5({reflect:!0})],SlInput.prototype,"type",2),__decorateClass([n$5()],SlInput.prototype,"name",2),__decorateClass([n$5()],SlInput.prototype,"value",2),__decorateClass([defaultValue()],SlInput.prototype,"defaultValue",2),__decorateClass([n$5({reflect:!0})],SlInput.prototype,"size",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlInput.prototype,"filled",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlInput.prototype,"pill",2),__decorateClass([n$5()],SlInput.prototype,"label",2),__decorateClass([n$5({attribute:"help-text"})],SlInput.prototype,"helpText",2),__decorateClass([n$5({type:Boolean})],SlInput.prototype,"clearable",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlInput.prototype,"disabled",2),__decorateClass([n$5()],SlInput.prototype,"placeholder",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlInput.prototype,"readonly",2),__decorateClass([n$5({attribute:"password-toggle",type:Boolean})],SlInput.prototype,"passwordToggle",2),__decorateClass([n$5({attribute:"password-visible",type:Boolean})],SlInput.prototype,"passwordVisible",2),__decorateClass([n$5({attribute:"no-spin-buttons",type:Boolean})],SlInput.prototype,"noSpinButtons",2),__decorateClass([n$5({reflect:!0})],SlInput.prototype,"form",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlInput.prototype,"required",2),__decorateClass([n$5()],SlInput.prototype,"pattern",2),__decorateClass([n$5({type:Number})],SlInput.prototype,"minlength",2),__decorateClass([n$5({type:Number})],SlInput.prototype,"maxlength",2),__decorateClass([n$5()],SlInput.prototype,"min",2),__decorateClass([n$5()],SlInput.prototype,"max",2),__decorateClass([n$5()],SlInput.prototype,"step",2),__decorateClass([n$5()],SlInput.prototype,"autocapitalize",2),__decorateClass([n$5()],SlInput.prototype,"autocorrect",2),__decorateClass([n$5()],SlInput.prototype,"autocomplete",2),__decorateClass([n$5({type:Boolean})],SlInput.prototype,"autofocus",2),__decorateClass([n$5()],SlInput.prototype,"enterkeyhint",2),__decorateClass([n$5({type:Boolean,converter:{fromAttribute:value=>!!(value&&"false"!==value),toAttribute:value=>value?"true":"false"}})],SlInput.prototype,"spellcheck",2),__decorateClass([n$5()],SlInput.prototype,"inputmode",2),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlInput.prototype,"handleDisabledChange",1),__decorateClass([watch("step",{waitUntilFirstUpdate:!0})],SlInput.prototype,"handleStepChange",1),__decorateClass([watch("value",{waitUntilFirstUpdate:!0})],SlInput.prototype,"handleValueChange",1),SlInput.define("sl-input");var menu_styles_default=i$7` + :host { + display: block; + position: relative; + background: var(--sl-panel-background-color); + border: solid var(--sl-panel-border-width) var(--sl-panel-border-color); + border-radius: var(--sl-border-radius-medium); + padding: var(--sl-spacing-x-small) 0; + overflow: auto; + overscroll-behavior: none; + } + + ::slotted(sl-divider) { + --spacing: var(--sl-spacing-x-small); + } +`,SlMenu=class extends ShoelaceElement{connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(event){const menuItemTypes=["menuitem","menuitemcheckbox"],composedPath=event.composedPath(),target=composedPath.find(el=>{var _a;return menuItemTypes.includes((null==(_a=null==el?void 0:el.getAttribute)?void 0:_a.call(el,"role"))||"")});if(!target)return;const closestMenu=composedPath.find(el=>{var _a;return"menu"===(null==(_a=null==el?void 0:el.getAttribute)?void 0:_a.call(el,"role"))}),clickHasSubmenu=closestMenu!==this;if(!clickHasSubmenu){const item=target;"checkbox"===item.type&&(item.checked=!item.checked),this.emit("sl-select",{detail:{item}})}}handleKeyDown(event){if("Enter"===event.key||" "===event.key){const item=this.getCurrentItem();event.preventDefault(),event.stopPropagation(),null==item?void 0:item.click()}else if(["ArrowDown","ArrowUp","Home","End"].includes(event.key)){const items=this.getAllItems(),activeItem=this.getCurrentItem();let index=activeItem?items.indexOf(activeItem):0;0<items.length&&(event.preventDefault(),event.stopPropagation(),"ArrowDown"===event.key?index++:"ArrowUp"===event.key?index--:"Home"===event.key?index=0:"End"===event.key&&(index=items.length-1),0>index&&(index=items.length-1),index>items.length-1&&(index=0),this.setCurrentItem(items[index]),items[index].focus())}}handleMouseDown(event){const target=event.target;this.isMenuItem(target)&&this.setCurrentItem(target)}handleSlotChange(){const items=this.getAllItems();0<items.length&&this.setCurrentItem(items[0])}isMenuItem(item){var _a;return"sl-menu-item"===item.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes(null==(_a=item.getAttribute("role"))?"":_a)}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:!0})].filter(el=>!el.inert&&this.isMenuItem(el))}getCurrentItem(){return this.getAllItems().find(i=>"0"===i.getAttribute("tabindex"))}setCurrentItem(item){const items=this.getAllItems();items.forEach(i=>{i.setAttribute("tabindex",i===item?"0":"-1")})}render(){return x$1` + <slot + @slotchange=${this.handleSlotChange} + @click=${this.handleClick} + @keydown=${this.handleKeyDown} + @mousedown=${this.handleMouseDown} + ></slot> + `}};SlMenu.styles=[component_styles_default,menu_styles_default],__decorateClass([e$6("slot")],SlMenu.prototype,"defaultSlot",2),SlMenu.define("sl-menu");var menu_item_styles_default=i$7` + :host { + --submenu-offset: -2px; + + display: block; + } + + :host([inert]) { + display: none; + } + + .menu-item { + position: relative; + display: flex; + align-items: stretch; + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-medium); + font-weight: var(--sl-font-weight-normal); + line-height: var(--sl-line-height-normal); + letter-spacing: var(--sl-letter-spacing-normal); + color: var(--sl-color-neutral-700); + padding: var(--sl-spacing-2x-small) var(--sl-spacing-2x-small); + transition: var(--sl-transition-fast) fill; + user-select: none; + -webkit-user-select: none; + white-space: nowrap; + cursor: pointer; + } + + .menu-item.menu-item--disabled { + outline: none; + opacity: 0.5; + cursor: not-allowed; + } + + .menu-item.menu-item--loading { + outline: none; + cursor: wait; + } + + .menu-item.menu-item--loading *:not(sl-spinner) { + opacity: 0.5; + } + + .menu-item--loading sl-spinner { + --indicator-color: currentColor; + --track-width: 1px; + position: absolute; + font-size: 0.75em; + top: calc(50% - 0.5em); + left: 0.65rem; + opacity: 1; + } + + .menu-item .menu-item__label { + flex: 1 1 auto; + display: inline-block; + text-overflow: ellipsis; + overflow: hidden; + } + + .menu-item .menu-item__prefix { + flex: 0 0 auto; + display: flex; + align-items: center; + } + + .menu-item .menu-item__prefix::slotted(*) { + margin-inline-end: var(--sl-spacing-x-small); + } + + .menu-item .menu-item__suffix { + flex: 0 0 auto; + display: flex; + align-items: center; + } + + .menu-item .menu-item__suffix::slotted(*) { + margin-inline-start: var(--sl-spacing-x-small); + } + + /* Safe triangle */ + .menu-item--submenu-expanded::after { + content: ''; + position: fixed; + z-index: calc(var(--sl-z-index-dropdown) - 1); + top: 0; + right: 0; + bottom: 0; + left: 0; + clip-path: polygon( + var(--safe-triangle-cursor-x, 0) var(--safe-triangle-cursor-y, 0), + var(--safe-triangle-submenu-start-x, 0) var(--safe-triangle-submenu-start-y, 0), + var(--safe-triangle-submenu-end-x, 0) var(--safe-triangle-submenu-end-y, 0) + ); + } + + :host(:focus-visible) { + outline: none; + } + + :host(:hover:not([aria-disabled='true'], :focus-visible)) .menu-item, + .menu-item--submenu-expanded { + background-color: var(--sl-color-neutral-100); + color: var(--sl-color-neutral-1000); + } + + :host(:focus-visible) .menu-item { + outline: none; + background-color: var(--sl-color-primary-600); + color: var(--sl-color-neutral-0); + opacity: 1; + } + + .menu-item .menu-item__check, + .menu-item .menu-item__chevron { + flex: 0 0 auto; + display: flex; + align-items: center; + justify-content: center; + width: 1.5em; + visibility: hidden; + } + + .menu-item--checked .menu-item__check, + .menu-item--has-submenu .menu-item__chevron { + visibility: visible; + } + + /* Add elevation and z-index to submenus */ + sl-popup::part(popup) { + box-shadow: var(--sl-shadow-large); + z-index: var(--sl-z-index-dropdown); + margin-left: var(--submenu-offset); + } + + .menu-item--rtl sl-popup::part(popup) { + margin-left: calc(-1 * var(--submenu-offset)); + } + + @media (forced-colors: active) { + :host(:hover:not([aria-disabled='true'])) .menu-item, + :host(:focus-visible) .menu-item { + outline: dashed 1px SelectedItem; + outline-offset: -1px; + } + } + + ::slotted(sl-menu) { + max-width: var(--auto-size-available-width) !important; + max-height: var(--auto-size-available-height) !important; + } +`;const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o$5=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r$2=i=>{for(let t,e;t=i._$AM;i=t){if(e=t._$AN,void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c$1(t)}};function h$2(i){void 0===this._$AN?this._$AM=i:(o$5(this),this._$AM=i,r$2(this))}function n$3(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(!t)s(this,i);else if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],!1),o$5(r[i]);else null!=r&&(s(r,!1),o$5(r))}const c$1=i=>{i.type==t.CHILD&&(i._$AP??=n$3,i._$AQ??=h$2)};class f extends i$3{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r$2(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o$5(this))}setValue(t){if(f$1(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}const e$1=()=>new h$1;let h$1=class{};const o$4=new WeakMap,n$2=e$3(class extends f{render(){return E$1}update(i,[s]){const e=s!==this.G;return e&&void 0!==this.G&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=s,this.ht=i.options?.host,this.rt(this.ct=i.element)),E$1}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){const i=this.ht??globalThis;let s=o$4.get(i);void 0===s&&(s=new WeakMap,o$4.set(i,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?o$4.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var SubmenuController=class{constructor(host,hasSlotController){this.popupRef=e$1(),this.enableSubmenuTimer=-1,this.isConnected=!1,this.isPopupConnected=!1,this.skidding=0,this.submenuOpenDelay=100,this.handleMouseMove=event=>{this.host.style.setProperty("--safe-triangle-cursor-x",`${event.clientX}px`),this.host.style.setProperty("--safe-triangle-cursor-y",`${event.clientY}px`)},this.handleMouseOver=()=>{this.hasSlotController.test("submenu")&&this.enableSubmenu()},this.handleKeyDown=event=>{switch(event.key){case"Escape":case"Tab":this.disableSubmenu();break;case"ArrowLeft":event.target!==this.host&&(event.preventDefault(),event.stopPropagation(),this.host.focus(),this.disableSubmenu());break;case"ArrowRight":case"Enter":case" ":this.handleSubmenuEntry(event)}},this.handleClick=event=>{var _a;event.target===this.host?(event.preventDefault(),event.stopPropagation()):event.target instanceof Element&&("sl-menu-item"===event.target.tagName||(null==(_a=event.target.role)?void 0:_a.startsWith("menuitem")))&&this.disableSubmenu()},this.handleFocusOut=event=>{event.relatedTarget&&event.relatedTarget instanceof Element&&this.host.contains(event.relatedTarget)||this.disableSubmenu()},this.handlePopupMouseover=event=>{event.stopPropagation()},this.handlePopupReposition=()=>{const submenuSlot=this.host.renderRoot.querySelector("slot[name='submenu']"),menu=null==submenuSlot?void 0:submenuSlot.assignedElements({flatten:!0}).filter(el=>"sl-menu"===el.localName)[0],isRtl="rtl"===getComputedStyle(this.host).direction;if(menu){const{left,top,width,height}=menu.getBoundingClientRect();this.host.style.setProperty("--safe-triangle-submenu-start-x",`${isRtl?left+width:left}px`),this.host.style.setProperty("--safe-triangle-submenu-start-y",`${top}px`),this.host.style.setProperty("--safe-triangle-submenu-end-x",`${isRtl?left+width:left}px`),this.host.style.setProperty("--safe-triangle-submenu-end-y",`${top+height}px`)}},(this.host=host).addController(this),this.hasSlotController=hasSlotController}hostConnected(){this.hasSlotController.test("submenu")&&!this.host.disabled&&this.addListeners()}hostDisconnected(){this.removeListeners()}hostUpdated(){this.hasSlotController.test("submenu")&&!this.host.disabled?(this.addListeners(),this.updateSkidding()):this.removeListeners()}addListeners(){this.isConnected||(this.host.addEventListener("mousemove",this.handleMouseMove),this.host.addEventListener("mouseover",this.handleMouseOver),this.host.addEventListener("keydown",this.handleKeyDown),this.host.addEventListener("click",this.handleClick),this.host.addEventListener("focusout",this.handleFocusOut),this.isConnected=!0),!this.isPopupConnected&&this.popupRef.value&&(this.popupRef.value.addEventListener("mouseover",this.handlePopupMouseover),this.popupRef.value.addEventListener("sl-reposition",this.handlePopupReposition),this.isPopupConnected=!0)}removeListeners(){this.isConnected&&(this.host.removeEventListener("mousemove",this.handleMouseMove),this.host.removeEventListener("mouseover",this.handleMouseOver),this.host.removeEventListener("keydown",this.handleKeyDown),this.host.removeEventListener("click",this.handleClick),this.host.removeEventListener("focusout",this.handleFocusOut),this.isConnected=!1),this.isPopupConnected&&this.popupRef.value&&(this.popupRef.value.removeEventListener("mouseover",this.handlePopupMouseover),this.popupRef.value.removeEventListener("sl-reposition",this.handlePopupReposition),this.isPopupConnected=!1)}handleSubmenuEntry(event){const submenuSlot=this.host.renderRoot.querySelector("slot[name='submenu']");if(!submenuSlot)return void console.error("Cannot activate a submenu if no corresponding menuitem can be found.",this);let menuItems=null;for(const elt of submenuSlot.assignedElements())if(menuItems=elt.querySelectorAll("sl-menu-item, [role^='menuitem']"),0!==menuItems.length)break;if(menuItems&&0!==menuItems.length){menuItems[0].setAttribute("tabindex","0");for(let i=1;i!==menuItems.length;++i)menuItems[i].setAttribute("tabindex","-1");this.popupRef.value&&(event.preventDefault(),event.stopPropagation(),this.popupRef.value.active?menuItems[0]instanceof HTMLElement&&menuItems[0].focus():(this.enableSubmenu(!1),this.host.updateComplete.then(()=>{menuItems[0]instanceof HTMLElement&&menuItems[0].focus()}),this.host.requestUpdate()))}}setSubmenuState(state){this.popupRef.value&&this.popupRef.value.active!==state&&(this.popupRef.value.active=state,this.host.requestUpdate())}enableSubmenu(delay=!0){delay?(window.clearTimeout(this.enableSubmenuTimer),this.enableSubmenuTimer=window.setTimeout(()=>{this.setSubmenuState(!0)},this.submenuOpenDelay)):this.setSubmenuState(!0)}disableSubmenu(){window.clearTimeout(this.enableSubmenuTimer),this.setSubmenuState(!1)}updateSkidding(){var _a;if(null==(_a=this.host.parentElement)||!_a.computedStyleMap)return;const styleMap=this.host.parentElement.computedStyleMap(),skidding=["padding-top","border-top-width","margin-top"].reduce((accumulator,attr)=>{var _a2;const styleValue=null==(_a2=styleMap.get(attr))?new CSSUnitValue(0,"px"):_a2,unitValue=styleValue instanceof CSSUnitValue?styleValue:new CSSUnitValue(0,"px"),pxValue=unitValue.to("px");return accumulator-pxValue.value},0);this.skidding=skidding}isExpanded(){return!!this.popupRef.value&&this.popupRef.value.active}renderSubmenu(){const isRtl="rtl"===getComputedStyle(this.host).direction;return this.isConnected?x$1` + <sl-popup + ${n$2(this.popupRef)} + placement=${isRtl?"left-start":"right-start"} + anchor="anchor" + flip + flip-fallback-strategy="best-fit" + skidding="${this.skidding}" + strategy="fixed" + auto-size="vertical" + auto-size-padding="10" + > + <slot name="submenu"></slot> + </sl-popup> + `:x$1` <slot name="submenu" hidden></slot> `}},SlMenuItem=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.type="normal",this.checked=!1,this.value="",this.loading=!1,this.disabled=!1,this.hasSlotController=new HasSlotController(this,"submenu"),this.submenuController=new SubmenuController(this,this.hasSlotController),this.handleHostClick=event=>{this.disabled&&(event.preventDefault(),event.stopImmediatePropagation())},this.handleMouseOver=event=>{this.focus(),event.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleHostClick),this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){const textLabel=this.getTextLabel();return"undefined"==typeof this.cachedTextLabel?void(this.cachedTextLabel=textLabel):void(textLabel!==this.cachedTextLabel&&(this.cachedTextLabel=textLabel,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1})))}handleCheckedChange(){return this.checked&&"checkbox"!==this.type?(this.checked=!1,void console.error("The checked attribute can only be used on menu items with type=\"checkbox\"",this)):void("checkbox"===this.type?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked"))}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleTypeChange(){"checkbox"===this.type?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return getTextContent(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){const isRtl="rtl"===this.localize.dir(),isSubmenuExpanded=this.submenuController.isExpanded();return x$1` + <div + id="anchor" + part="base" + class=${e$2({"menu-item":!0,"menu-item--rtl":isRtl,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--loading":this.loading,"menu-item--has-submenu":this.isSubmenu(),"menu-item--submenu-expanded":isSubmenuExpanded})} + ?aria-haspopup="${this.isSubmenu()}" + ?aria-expanded="${!!isSubmenuExpanded}" + > + <span part="checked-icon" class="menu-item__check"> + <sl-icon name="check" library="system" aria-hidden="true"></sl-icon> + </span> + + <slot name="prefix" part="prefix" class="menu-item__prefix"></slot> + + <slot part="label" class="menu-item__label" @slotchange=${this.handleDefaultSlotChange}></slot> + + <slot name="suffix" part="suffix" class="menu-item__suffix"></slot> + + <span part="submenu-icon" class="menu-item__chevron"> + <sl-icon name=${isRtl?"chevron-left":"chevron-right"} library="system" aria-hidden="true"></sl-icon> + </span> + + ${this.submenuController.renderSubmenu()} + ${this.loading?x$1` <sl-spinner part="spinner" exportparts="base:spinner__base"></sl-spinner> `:""} + </div> + `}};SlMenuItem.styles=[component_styles_default,menu_item_styles_default],SlMenuItem.dependencies={"sl-icon":SlIcon,"sl-popup":SlPopup,"sl-spinner":SlSpinner},__decorateClass([e$6("slot:not([name])")],SlMenuItem.prototype,"defaultSlot",2),__decorateClass([e$6(".menu-item")],SlMenuItem.prototype,"menuItem",2),__decorateClass([n$5()],SlMenuItem.prototype,"type",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlMenuItem.prototype,"checked",2),__decorateClass([n$5()],SlMenuItem.prototype,"value",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlMenuItem.prototype,"loading",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlMenuItem.prototype,"disabled",2),__decorateClass([watch("checked")],SlMenuItem.prototype,"handleCheckedChange",1),__decorateClass([watch("disabled")],SlMenuItem.prototype,"handleDisabledChange",1),__decorateClass([watch("type")],SlMenuItem.prototype,"handleTypeChange",1),SlMenuItem.define("sl-menu-item");var option_styles_default=i$7` + :host { + display: block; + user-select: none; + -webkit-user-select: none; + } + + :host(:focus) { + outline: none; + } + + .option { + position: relative; + display: flex; + align-items: center; + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-medium); + font-weight: var(--sl-font-weight-normal); + line-height: var(--sl-line-height-normal); + letter-spacing: var(--sl-letter-spacing-normal); + color: var(--sl-color-neutral-700); + padding: var(--sl-spacing-x-small) var(--sl-spacing-medium) var(--sl-spacing-x-small) var(--sl-spacing-x-small); + transition: var(--sl-transition-fast) fill; + cursor: pointer; + } + + .option--hover:not(.option--current):not(.option--disabled) { + background-color: var(--sl-color-neutral-100); + color: var(--sl-color-neutral-1000); + } + + .option--current, + .option--current.option--disabled { + background-color: var(--sl-color-primary-600); + color: var(--sl-color-neutral-0); + opacity: 1; + } + + .option--disabled { + outline: none; + opacity: 0.5; + cursor: not-allowed; + } + + .option__label { + flex: 1 1 auto; + display: inline-block; + line-height: var(--sl-line-height-dense); + } + + .option .option__check { + flex: 0 0 auto; + display: flex; + align-items: center; + justify-content: center; + visibility: hidden; + padding-inline-end: var(--sl-spacing-2x-small); + } + + .option--selected .option__check { + visibility: visible; + } + + .option__prefix, + .option__suffix { + flex: 0 0 auto; + display: flex; + align-items: center; + } + + .option__prefix::slotted(*) { + margin-inline-end: var(--sl-spacing-x-small); + } + + .option__suffix::slotted(*) { + margin-inline-start: var(--sl-spacing-x-small); + } + + @media (forced-colors: active) { + :host(:hover:not([aria-disabled='true'])) .option { + outline: dashed 1px SelectedItem; + outline-offset: -1px; + } + } +`,SlOption=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.isInitialized=!1,this.current=!1,this.selected=!1,this.hasHover=!1,this.value="",this.disabled=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false")}handleDefaultSlotChange(){this.isInitialized?customElements.whenDefined("sl-select").then(()=>{const controller=this.closest("sl-select");controller&&controller.handleDefaultSlotChange()}):this.isInitialized=!0}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){"string"!=typeof this.value&&(this.value=this.value+""),this.value.includes(" ")&&(console.error(`Option values cannot include a space. All spaces have been replaced with underscores.`,this),this.value=this.value.replace(/ /g,"_"))}getTextLabel(){const nodes=this.childNodes;let label="";return[...nodes].forEach(node=>{node.nodeType!==Node.ELEMENT_NODE||node.hasAttribute("slot")||(label+=node.textContent),node.nodeType===Node.TEXT_NODE&&(label+=node.textContent)}),label.trim()}render(){return x$1` + <div + part="base" + class=${e$2({option:!0,"option--current":this.current,"option--disabled":this.disabled,"option--selected":this.selected,"option--hover":this.hasHover})} + @mouseenter=${this.handleMouseEnter} + @mouseleave=${this.handleMouseLeave} + > + <sl-icon part="checked-icon" class="option__check" name="check" library="system" aria-hidden="true"></sl-icon> + <slot part="prefix" name="prefix" class="option__prefix"></slot> + <slot part="label" class="option__label" @slotchange=${this.handleDefaultSlotChange}></slot> + <slot part="suffix" name="suffix" class="option__suffix"></slot> + </div> + `}};SlOption.styles=[component_styles_default,option_styles_default],SlOption.dependencies={"sl-icon":SlIcon},__decorateClass([e$6(".option__label")],SlOption.prototype,"defaultSlot",2),__decorateClass([r$6()],SlOption.prototype,"current",2),__decorateClass([r$6()],SlOption.prototype,"selected",2),__decorateClass([r$6()],SlOption.prototype,"hasHover",2),__decorateClass([n$5({reflect:!0})],SlOption.prototype,"value",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlOption.prototype,"disabled",2),__decorateClass([watch("disabled")],SlOption.prototype,"handleDisabledChange",1),__decorateClass([watch("selected")],SlOption.prototype,"handleSelectedChange",1),__decorateClass([watch("value")],SlOption.prototype,"handleValueChange",1),SlOption.define("sl-option"),SlPopup.define("sl-popup");var progress_bar_styles_default=i$7` + :host { + --height: 1rem; + --track-color: var(--sl-color-neutral-200); + --indicator-color: var(--sl-color-primary-600); + --label-color: var(--sl-color-neutral-0); + + display: block; + } + + .progress-bar { + position: relative; + background-color: var(--track-color); + height: var(--height); + border-radius: var(--sl-border-radius-pill); + box-shadow: inset var(--sl-shadow-small); + overflow: hidden; + } + + .progress-bar__indicator { + height: 100%; + font-family: var(--sl-font-sans); + font-size: 12px; + font-weight: var(--sl-font-weight-normal); + background-color: var(--indicator-color); + color: var(--label-color); + text-align: center; + line-height: var(--height); + white-space: nowrap; + overflow: hidden; + transition: + 400ms width, + 400ms background-color; + user-select: none; + -webkit-user-select: none; + } + + /* Indeterminate */ + .progress-bar--indeterminate .progress-bar__indicator { + position: absolute; + animation: indeterminate 2.5s infinite cubic-bezier(0.37, 0, 0.63, 1); + } + + .progress-bar--indeterminate.progress-bar--rtl .progress-bar__indicator { + animation-name: indeterminate-rtl; + } + + @media (forced-colors: active) { + .progress-bar { + outline: solid 1px SelectedItem; + background-color: var(--sl-color-neutral-0); + } + + .progress-bar__indicator { + outline: solid 1px SelectedItem; + background-color: SelectedItem; + } + } + + @keyframes indeterminate { + 0% { + left: -50%; + width: 50%; + } + 75%, + 100% { + left: 100%; + width: 50%; + } + } + + @keyframes indeterminate-rtl { + 0% { + right: -50%; + width: 50%; + } + 75%, + 100% { + right: 100%; + width: 50%; + } + } +`;const n$1="important",i$1=" !important",o$3=e$3(class extends i$3{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"style"!==t$1.name||2<t$1.strings?.length)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r="string"==typeof e&&e.endsWith(i$1);t.includes("-")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n$1:""):s[t]=e}}return T$1}});var SlProgressBar=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.value=0,this.indeterminate=!1,this.label=""}render(){return x$1` + <div + part="base" + class=${e$2({"progress-bar":!0,"progress-bar--indeterminate":this.indeterminate,"progress-bar--rtl":"rtl"===this.localize.dir()})} + role="progressbar" + title=${o$6(this.title)} + aria-label=${0<this.label.length?this.label:this.localize.term("progress")} + aria-valuemin="0" + aria-valuemax="100" + aria-valuenow=${this.indeterminate?0:this.value} + > + <div part="indicator" class="progress-bar__indicator" style=${o$3({width:`${this.value}%`})}> + ${this.indeterminate?"":x$1` <slot part="label" class="progress-bar__label"></slot> `} + </div> + </div> + `}};SlProgressBar.styles=[component_styles_default,progress_bar_styles_default],__decorateClass([n$5({type:Number,reflect:!0})],SlProgressBar.prototype,"value",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlProgressBar.prototype,"indeterminate",2),__decorateClass([n$5()],SlProgressBar.prototype,"label",2),SlProgressBar.define("sl-progress-bar");var radio_group_styles_default=i$7` + :host { + display: block; + } + + .form-control { + position: relative; + border: none; + padding: 0; + margin: 0; + } + + .form-control__label { + padding: 0; + } + + .radio-group--required .radio-group__label::after { + content: var(--sl-input-required-content); + margin-inline-start: var(--sl-input-required-content-offset); + } + + .visually-hidden { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; + } +`,button_group_styles_default=i$7` + :host { + display: inline-block; + } + + .button-group { + display: flex; + flex-wrap: nowrap; + } +`,SlButtonGroup=class extends ShoelaceElement{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(event){const button=findButton(event.target);null==button?void 0:button.toggleAttribute("data-sl-button-group__button--focus",!0)}handleBlur(event){const button=findButton(event.target);null==button?void 0:button.toggleAttribute("data-sl-button-group__button--focus",!1)}handleMouseOver(event){const button=findButton(event.target);null==button?void 0:button.toggleAttribute("data-sl-button-group__button--hover",!0)}handleMouseOut(event){const button=findButton(event.target);null==button?void 0:button.toggleAttribute("data-sl-button-group__button--hover",!1)}handleSlotChange(){const slottedElements=[...this.defaultSlot.assignedElements({flatten:!0})];slottedElements.forEach(el=>{const index=slottedElements.indexOf(el),button=findButton(el);button&&(button.toggleAttribute("data-sl-button-group__button",!0),button.toggleAttribute("data-sl-button-group__button--first",0===index),button.toggleAttribute("data-sl-button-group__button--inner",0<index&&index<slottedElements.length-1),button.toggleAttribute("data-sl-button-group__button--last",index===slottedElements.length-1),button.toggleAttribute("data-sl-button-group__button--radio","sl-radio-button"===button.tagName.toLowerCase()))})}render(){return x$1` + <div + part="base" + class="button-group" + role="${this.disableRole?"presentation":"group"}" + aria-label=${this.label} + @focusout=${this.handleBlur} + @focusin=${this.handleFocus} + @mouseover=${this.handleMouseOver} + @mouseout=${this.handleMouseOut} + > + <slot @slotchange=${this.handleSlotChange}></slot> + </div> + `}};SlButtonGroup.styles=[component_styles_default,button_group_styles_default],__decorateClass([e$6("slot")],SlButtonGroup.prototype,"defaultSlot",2),__decorateClass([r$6()],SlButtonGroup.prototype,"disableRole",2),__decorateClass([n$5()],SlButtonGroup.prototype,"label",2);function findButton(el){var _a;return null==(_a=el.closest("sl-button, sl-radio-button"))?el.querySelector("sl-button, sl-radio-button"):_a}var SlRadioGroup=class extends ShoelaceElement{constructor(){super(...arguments),this.formControlController=new FormControlController(this),this.hasSlotController=new HasSlotController(this,"help-text","label"),this.customValidityMessage="",this.hasButtonGroup=!1,this.errorMessage="",this.defaultValue="",this.label="",this.helpText="",this.name="option",this.value="",this.size="medium",this.form="",this.required=!1}get validity(){const isRequiredAndEmpty=this.required&&!this.value,hasCustomValidityMessage=""!==this.customValidityMessage;if(hasCustomValidityMessage)return customErrorValidityState;return isRequiredAndEmpty?valueMissingValidityState:validValidityState}get validationMessage(){const isRequiredAndEmpty=this.required&&!this.value,hasCustomValidityMessage=""!==this.customValidityMessage;if(hasCustomValidityMessage)return this.customValidityMessage;return isRequiredAndEmpty?this.validationInput.validationMessage:""}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value}firstUpdated(){this.formControlController.updateValidity()}getAllRadios(){return[...this.querySelectorAll("sl-radio, sl-radio-button")]}handleRadioClick(event){const target=event.target.closest("sl-radio, sl-radio-button"),radios=this.getAllRadios(),oldValue=this.value;!target||target.disabled||(this.value=target.value,radios.forEach(radio=>radio.checked=radio===target),this.value!==oldValue&&(this.emit("sl-change"),this.emit("sl-input")))}handleKeyDown(event){var _a;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(event.key))return;const radios=this.getAllRadios().filter(radio=>!radio.disabled),checkedRadio=null==(_a=radios.find(radio=>radio.checked))?radios[0]:_a,incr=" "===event.key?0:["ArrowUp","ArrowLeft"].includes(event.key)?-1:1,oldValue=this.value;let index=radios.indexOf(checkedRadio)+incr;0>index&&(index=radios.length-1),index>radios.length-1&&(index=0),this.getAllRadios().forEach(radio=>{radio.checked=!1,this.hasButtonGroup||radio.setAttribute("tabindex","-1")}),this.value=radios[index].value,radios[index].checked=!0,this.hasButtonGroup?radios[index].shadowRoot.querySelector("button").focus():(radios[index].setAttribute("tabindex","0"),radios[index].focus()),this.value!==oldValue&&(this.emit("sl-change"),this.emit("sl-input")),event.preventDefault()}handleLabelClick(){this.focus()}handleInvalid(event){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(event)}async syncRadioElements(){var _a,_b;const radios=this.getAllRadios();if(await Promise.all(radios.map(async radio=>{await radio.updateComplete,radio.checked=radio.value===this.value,radio.size=this.size})),this.hasButtonGroup=radios.some(radio=>"sl-radio-button"===radio.tagName.toLowerCase()),0<radios.length&&!radios.some(radio=>radio.checked))if(this.hasButtonGroup){const buttonRadio=null==(_a=radios[0].shadowRoot)?void 0:_a.querySelector("button");buttonRadio&&buttonRadio.setAttribute("tabindex","0")}else radios[0].setAttribute("tabindex","0");if(this.hasButtonGroup){const buttonGroup=null==(_b=this.shadowRoot)?void 0:_b.querySelector("sl-button-group");buttonGroup&&(buttonGroup.disableRole=!0)}}syncRadios(){return customElements.get("sl-radio")&&customElements.get("sl-radio-button")?void this.syncRadioElements():void(customElements.get("sl-radio")?this.syncRadioElements():customElements.whenDefined("sl-radio").then(()=>this.syncRadios()),customElements.get("sl-radio-button")?this.syncRadioElements():customElements.whenDefined("sl-radio-button").then(()=>this.syncRadios()))}updateCheckedRadio(){const radios=this.getAllRadios();radios.forEach(radio=>radio.checked=radio.value===this.value),this.formControlController.setValidity(this.validity.valid)}handleSizeChange(){this.syncRadios()}handleValueChange(){this.hasUpdated&&this.updateCheckedRadio()}checkValidity(){const isRequiredAndEmpty=this.required&&!this.value,hasCustomValidityMessage=""!==this.customValidityMessage;return!(isRequiredAndEmpty||hasCustomValidityMessage)||(this.formControlController.emitInvalidEvent(),!1)}getForm(){return this.formControlController.getForm()}reportValidity(){const isValid=this.validity.valid;return this.errorMessage=this.customValidityMessage||isValid?"":this.validationInput.validationMessage,this.formControlController.setValidity(isValid),this.validationInput.hidden=!0,clearTimeout(this.validationTimeout),isValid||(this.validationInput.hidden=!1,this.validationInput.reportValidity(),this.validationTimeout=setTimeout(()=>this.validationInput.hidden=!0,1e4)),isValid}setCustomValidity(message=""){this.customValidityMessage=message,this.errorMessage=message,this.validationInput.setCustomValidity(message),this.formControlController.updateValidity()}focus(options){const radios=this.getAllRadios(),checked=radios.find(radio=>radio.checked),firstEnabledRadio=radios.find(radio=>!radio.disabled),radioToFocus=checked||firstEnabledRadio;radioToFocus&&radioToFocus.focus(options)}render(){const hasLabelSlot=this.hasSlotController.test("label"),hasHelpTextSlot=this.hasSlotController.test("help-text"),hasLabel=!!this.label||!!hasLabelSlot,hasHelpText=!!this.helpText||!!hasHelpTextSlot,defaultSlot=x$1` + <slot @slotchange=${this.syncRadios} @click=${this.handleRadioClick} @keydown=${this.handleKeyDown}></slot> + `;return x$1` + <fieldset + part="form-control" + class=${e$2({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--radio-group":!0,"form-control--has-label":hasLabel,"form-control--has-help-text":hasHelpText})} + role="radiogroup" + aria-labelledby="label" + aria-describedby="help-text" + aria-errormessage="error-message" + > + <label + part="form-control-label" + id="label" + class="form-control__label" + aria-hidden=${hasLabel?"false":"true"} + @click=${this.handleLabelClick} + > + <slot name="label">${this.label}</slot> + </label> + + <div part="form-control-input" class="form-control-input"> + <div class="visually-hidden"> + <div id="error-message" aria-live="assertive">${this.errorMessage}</div> + <label class="radio-group__validation"> + <input + type="text" + class="radio-group__validation-input" + ?required=${this.required} + tabindex="-1" + hidden + @invalid=${this.handleInvalid} + /> + </label> + </div> + + ${this.hasButtonGroup?x$1` + <sl-button-group part="button-group" exportparts="base:button-group__base" role="presentation"> + ${defaultSlot} + </sl-button-group> + `:defaultSlot} + </div> + + <div + part="form-control-help-text" + id="help-text" + class="form-control__help-text" + aria-hidden=${hasHelpText?"false":"true"} + > + <slot name="help-text">${this.helpText}</slot> + </div> + </fieldset> + `}};SlRadioGroup.styles=[component_styles_default,form_control_styles_default,radio_group_styles_default],SlRadioGroup.dependencies={"sl-button-group":SlButtonGroup},__decorateClass([e$6("slot:not([name])")],SlRadioGroup.prototype,"defaultSlot",2),__decorateClass([e$6(".radio-group__validation-input")],SlRadioGroup.prototype,"validationInput",2),__decorateClass([r$6()],SlRadioGroup.prototype,"hasButtonGroup",2),__decorateClass([r$6()],SlRadioGroup.prototype,"errorMessage",2),__decorateClass([r$6()],SlRadioGroup.prototype,"defaultValue",2),__decorateClass([n$5()],SlRadioGroup.prototype,"label",2),__decorateClass([n$5({attribute:"help-text"})],SlRadioGroup.prototype,"helpText",2),__decorateClass([n$5()],SlRadioGroup.prototype,"name",2),__decorateClass([n$5({reflect:!0})],SlRadioGroup.prototype,"value",2),__decorateClass([n$5({reflect:!0})],SlRadioGroup.prototype,"size",2),__decorateClass([n$5({reflect:!0})],SlRadioGroup.prototype,"form",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlRadioGroup.prototype,"required",2),__decorateClass([watch("size",{waitUntilFirstUpdate:!0})],SlRadioGroup.prototype,"handleSizeChange",1),__decorateClass([watch("value")],SlRadioGroup.prototype,"handleValueChange",1),SlRadioGroup.define("sl-radio-group");var radio_styles_default=i$7` + :host { + display: block; + } + + :host(:focus-visible) { + outline: 0px; + } + + .radio { + display: inline-flex; + align-items: top; + font-family: var(--sl-input-font-family); + font-size: var(--sl-input-font-size-medium); + font-weight: var(--sl-input-font-weight); + color: var(--sl-input-label-color); + vertical-align: middle; + cursor: pointer; + } + + .radio--small { + --toggle-size: var(--sl-toggle-size-small); + font-size: var(--sl-input-font-size-small); + } + + .radio--medium { + --toggle-size: var(--sl-toggle-size-medium); + font-size: var(--sl-input-font-size-medium); + } + + .radio--large { + --toggle-size: var(--sl-toggle-size-large); + font-size: var(--sl-input-font-size-large); + } + + .radio__checked-icon { + display: inline-flex; + width: var(--toggle-size); + height: var(--toggle-size); + } + + .radio__control { + flex: 0 0 auto; + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + width: var(--toggle-size); + height: var(--toggle-size); + border: solid var(--sl-input-border-width) var(--sl-input-border-color); + border-radius: 50%; + background-color: var(--sl-input-background-color); + color: transparent; + transition: + var(--sl-transition-fast) border-color, + var(--sl-transition-fast) background-color, + var(--sl-transition-fast) color, + var(--sl-transition-fast) box-shadow; + } + + .radio__input { + position: absolute; + opacity: 0; + padding: 0; + margin: 0; + pointer-events: none; + } + + /* Hover */ + .radio:not(.radio--checked):not(.radio--disabled) .radio__control:hover { + border-color: var(--sl-input-border-color-hover); + background-color: var(--sl-input-background-color-hover); + } + + /* Checked */ + .radio--checked .radio__control { + color: var(--sl-color-neutral-0); + border-color: var(--sl-color-primary-600); + background-color: var(--sl-color-primary-600); + } + + /* Checked + hover */ + .radio.radio--checked:not(.radio--disabled) .radio__control:hover { + border-color: var(--sl-color-primary-500); + background-color: var(--sl-color-primary-500); + } + + /* Checked + focus */ + :host(:focus-visible) .radio__control { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + /* Disabled */ + .radio--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + /* When the control isn't checked, hide the circle for Windows High Contrast mode a11y */ + .radio:not(.radio--checked) svg circle { + opacity: 0; + } + + .radio__label { + display: inline-block; + color: var(--sl-input-label-color); + line-height: var(--toggle-size); + margin-inline-start: 0.5em; + user-select: none; + -webkit-user-select: none; + } +`,SlRadio=class extends ShoelaceElement{constructor(){super(),this.checked=!1,this.hasFocus=!1,this.size="medium",this.disabled=!1,this.handleBlur=()=>{this.hasFocus=!1,this.emit("sl-blur")},this.handleClick=()=>{this.disabled||(this.checked=!0)},this.handleFocus=()=>{this.hasFocus=!0,this.emit("sl-focus")},this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}connectedCallback(){super.connectedCallback(),this.setInitialAttributes()}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return x$1` + <span + part="base" + class=${e$2({radio:!0,"radio--checked":this.checked,"radio--disabled":this.disabled,"radio--focused":this.hasFocus,"radio--small":"small"===this.size,"radio--medium":"medium"===this.size,"radio--large":"large"===this.size})} + > + <span part="${`control${this.checked?" control--checked":""}`}" class="radio__control"> + ${this.checked?x$1` <sl-icon part="checked-icon" class="radio__checked-icon" library="system" name="radio"></sl-icon> `:""} + </span> + + <slot part="label" class="radio__label"></slot> + </span> + `}};SlRadio.styles=[component_styles_default,radio_styles_default],SlRadio.dependencies={"sl-icon":SlIcon},__decorateClass([r$6()],SlRadio.prototype,"checked",2),__decorateClass([r$6()],SlRadio.prototype,"hasFocus",2),__decorateClass([n$5()],SlRadio.prototype,"value",2),__decorateClass([n$5({reflect:!0})],SlRadio.prototype,"size",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlRadio.prototype,"disabled",2),__decorateClass([watch("checked")],SlRadio.prototype,"handleCheckedChange",1),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlRadio.prototype,"handleDisabledChange",1),SlRadio.define("sl-radio");var availableUnits=[{max:276e4,value:6e4,unit:"minute"},{max:72e6,value:36e5,unit:"hour"},{max:5184e5,value:864e5,unit:"day"},{max:24192e5,value:6048e5,unit:"week"},{max:28512e6,value:2592e6,unit:"month"},{max:1/0,value:31536e6,unit:"year"}],SlRelativeTime=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.isoTime="",this.relativeTime="",this.date=new Date,this.format="long",this.numeric="auto",this.sync=!1}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.updateTimeout)}render(){var _Mathabs=Math.abs,_Mathround2=Math.round;const now=new Date,then=new Date(this.date);if(isNaN(then.getMilliseconds()))return this.relativeTime="",this.isoTime="","";const diff=then.getTime()-now.getTime(),{unit,value}=availableUnits.find(singleUnit=>_Mathabs(diff)<singleUnit.max);if(this.isoTime=then.toISOString(),this.relativeTime=this.localize.relativeTime(_Mathround2(diff/value),unit,{numeric:this.numeric,style:this.format}),clearTimeout(this.updateTimeout),this.sync){let nextInterval;nextInterval="minute"===unit?getTimeUntilNextUnit("second"):"hour"===unit?getTimeUntilNextUnit("minute"):"day"===unit?getTimeUntilNextUnit("hour"):getTimeUntilNextUnit("day"),this.updateTimeout=window.setTimeout(()=>this.requestUpdate(),nextInterval)}return x$1` <time datetime=${this.isoTime}>${this.relativeTime}</time> `}};__decorateClass([r$6()],SlRelativeTime.prototype,"isoTime",2),__decorateClass([r$6()],SlRelativeTime.prototype,"relativeTime",2),__decorateClass([n$5()],SlRelativeTime.prototype,"date",2),__decorateClass([n$5()],SlRelativeTime.prototype,"format",2),__decorateClass([n$5()],SlRelativeTime.prototype,"numeric",2),__decorateClass([n$5({type:Boolean})],SlRelativeTime.prototype,"sync",2);function getTimeUntilNextUnit(unit){const value={second:1e3,minute:6e4,hour:36e5,day:864e5}[unit];return value-Date.now()%value}SlRelativeTime.define("sl-relative-time");var skeleton_styles_default=i$7` + :host { + --border-radius: var(--sl-border-radius-pill); + --color: var(--sl-color-neutral-200); + --sheen-color: var(--sl-color-neutral-300); + + display: block; + position: relative; + } + + .skeleton { + display: flex; + width: 100%; + height: 100%; + min-height: 1rem; + } + + .skeleton__indicator { + flex: 1 1 auto; + background: var(--color); + border-radius: var(--border-radius); + } + + .skeleton--sheen .skeleton__indicator { + background: linear-gradient(270deg, var(--sheen-color), var(--color), var(--color), var(--sheen-color)); + background-size: 400% 100%; + animation: sheen 8s ease-in-out infinite; + } + + .skeleton--pulse .skeleton__indicator { + animation: pulse 2s ease-in-out 0.5s infinite; + } + + /* Forced colors mode */ + @media (forced-colors: active) { + :host { + --color: GrayText; + } + } + + @keyframes sheen { + 0% { + background-position: 200% 0; + } + to { + background-position: -200% 0; + } + } + + @keyframes pulse { + 0% { + opacity: 1; + } + 50% { + opacity: 0.4; + } + 100% { + opacity: 1; + } + } +`,SlSkeleton=class extends ShoelaceElement{constructor(){super(...arguments),this.effect="none"}render(){return x$1` + <div + part="base" + class=${e$2({skeleton:!0,"skeleton--pulse":"pulse"===this.effect,"skeleton--sheen":"sheen"===this.effect})} + > + <div part="indicator" class="skeleton__indicator"></div> + </div> + `}};SlSkeleton.styles=[component_styles_default,skeleton_styles_default],__decorateClass([n$5()],SlSkeleton.prototype,"effect",2),SlSkeleton.define("sl-skeleton");var tag_styles_default=i$7` + :host { + display: inline-block; + } + + .tag { + display: flex; + align-items: center; + border: solid 1px; + line-height: 1; + white-space: nowrap; + user-select: none; + -webkit-user-select: none; + } + + .tag__remove::part(base) { + color: inherit; + padding: 0; + } + + /* + * Variant modifiers + */ + + .tag--primary { + background-color: var(--sl-color-primary-50); + border-color: var(--sl-color-primary-200); + color: var(--sl-color-primary-800); + } + + .tag--primary:active > sl-icon-button { + color: var(--sl-color-primary-600); + } + + .tag--success { + background-color: var(--sl-color-success-50); + border-color: var(--sl-color-success-200); + color: var(--sl-color-success-800); + } + + .tag--success:active > sl-icon-button { + color: var(--sl-color-success-600); + } + + .tag--neutral { + background-color: var(--sl-color-neutral-50); + border-color: var(--sl-color-neutral-200); + color: var(--sl-color-neutral-800); + } + + .tag--neutral:active > sl-icon-button { + color: var(--sl-color-neutral-600); + } + + .tag--warning { + background-color: var(--sl-color-warning-50); + border-color: var(--sl-color-warning-200); + color: var(--sl-color-warning-800); + } + + .tag--warning:active > sl-icon-button { + color: var(--sl-color-warning-600); + } + + .tag--danger { + background-color: var(--sl-color-danger-50); + border-color: var(--sl-color-danger-200); + color: var(--sl-color-danger-800); + } + + .tag--danger:active > sl-icon-button { + color: var(--sl-color-danger-600); + } + + /* + * Size modifiers + */ + + .tag--small { + font-size: var(--sl-button-font-size-small); + height: calc(var(--sl-input-height-small) * 0.8); + line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2); + border-radius: var(--sl-input-border-radius-small); + padding: 0 var(--sl-spacing-x-small); + } + + .tag--medium { + font-size: var(--sl-button-font-size-medium); + height: calc(var(--sl-input-height-medium) * 0.8); + line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2); + border-radius: var(--sl-input-border-radius-medium); + padding: 0 var(--sl-spacing-small); + } + + .tag--large { + font-size: var(--sl-button-font-size-large); + height: calc(var(--sl-input-height-large) * 0.8); + line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2); + border-radius: var(--sl-input-border-radius-large); + padding: 0 var(--sl-spacing-medium); + } + + .tag__remove { + margin-inline-start: var(--sl-spacing-x-small); + } + + /* + * Pill modifier + */ + + .tag--pill { + border-radius: var(--sl-border-radius-pill); + } +`,SlTag=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.variant="neutral",this.size="medium",this.pill=!1,this.removable=!1}handleRemoveClick(){this.emit("sl-remove")}render(){return x$1` + <span + part="base" + class=${e$2({tag:!0,"tag--primary":"primary"===this.variant,"tag--success":"success"===this.variant,"tag--neutral":"neutral"===this.variant,"tag--warning":"warning"===this.variant,"tag--danger":"danger"===this.variant,"tag--text":"text"===this.variant,"tag--small":"small"===this.size,"tag--medium":"medium"===this.size,"tag--large":"large"===this.size,"tag--pill":this.pill,"tag--removable":this.removable})} + > + <slot part="content" class="tag__content"></slot> + + ${this.removable?x$1` + <sl-icon-button + part="remove-button" + exportparts="base:remove-button__base" + name="x-lg" + library="system" + label=${this.localize.term("remove")} + class="tag__remove" + @click=${this.handleRemoveClick} + tabindex="-1" + ></sl-icon-button> + `:""} + </span> + `}};SlTag.styles=[component_styles_default,tag_styles_default],SlTag.dependencies={"sl-icon-button":SlIconButton},__decorateClass([n$5({reflect:!0})],SlTag.prototype,"variant",2),__decorateClass([n$5({reflect:!0})],SlTag.prototype,"size",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTag.prototype,"pill",2),__decorateClass([n$5({type:Boolean})],SlTag.prototype,"removable",2);var select_styles_default=i$7` + :host { + display: block; + } + + /** The popup */ + .select { + flex: 1 1 auto; + display: inline-flex; + width: 100%; + position: relative; + vertical-align: middle; + } + + .select::part(popup) { + z-index: var(--sl-z-index-dropdown); + } + + .select[data-current-placement^='top']::part(popup) { + transform-origin: bottom; + } + + .select[data-current-placement^='bottom']::part(popup) { + transform-origin: top; + } + + /* Combobox */ + .select__combobox { + flex: 1; + display: flex; + width: 100%; + min-width: 0; + position: relative; + align-items: center; + justify-content: start; + font-family: var(--sl-input-font-family); + font-weight: var(--sl-input-font-weight); + letter-spacing: var(--sl-input-letter-spacing); + vertical-align: middle; + overflow: hidden; + cursor: pointer; + transition: + var(--sl-transition-fast) color, + var(--sl-transition-fast) border, + var(--sl-transition-fast) box-shadow, + var(--sl-transition-fast) background-color; + } + + .select__display-input { + position: relative; + width: 100%; + font: inherit; + border: none; + background: none; + color: var(--sl-input-color); + cursor: inherit; + overflow: hidden; + padding: 0; + margin: 0; + -webkit-appearance: none; + } + + .select__display-input::placeholder { + color: var(--sl-input-placeholder-color); + } + + .select:not(.select--disabled):hover .select__display-input { + color: var(--sl-input-color-hover); + } + + .select__display-input:focus { + outline: none; + } + + /* Visually hide the display input when multiple is enabled */ + .select--multiple:not(.select--placeholder-visible) .select__display-input { + position: absolute; + z-index: -1; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + } + + .select__value-input { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + padding: 0; + margin: 0; + opacity: 0; + z-index: -1; + } + + .select__tags { + display: flex; + flex: 1; + align-items: center; + flex-wrap: wrap; + margin-inline-start: var(--sl-spacing-2x-small); + } + + .select__tags::slotted(sl-tag) { + cursor: pointer !important; + } + + .select--disabled .select__tags, + .select--disabled .select__tags::slotted(sl-tag) { + cursor: not-allowed !important; + } + + /* Standard selects */ + .select--standard .select__combobox { + background-color: var(--sl-input-background-color); + border: solid var(--sl-input-border-width) var(--sl-input-border-color); + } + + .select--standard.select--disabled .select__combobox { + background-color: var(--sl-input-background-color-disabled); + border-color: var(--sl-input-border-color-disabled); + color: var(--sl-input-color-disabled); + opacity: 0.5; + cursor: not-allowed; + outline: none; + } + + .select--standard:not(.select--disabled).select--open .select__combobox, + .select--standard:not(.select--disabled).select--focused .select__combobox { + background-color: var(--sl-input-background-color-focus); + border-color: var(--sl-input-border-color-focus); + box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color); + } + + /* Filled selects */ + .select--filled .select__combobox { + border: none; + background-color: var(--sl-input-filled-background-color); + color: var(--sl-input-color); + } + + .select--filled:hover:not(.select--disabled) .select__combobox { + background-color: var(--sl-input-filled-background-color-hover); + } + + .select--filled.select--disabled .select__combobox { + background-color: var(--sl-input-filled-background-color-disabled); + opacity: 0.5; + cursor: not-allowed; + } + + .select--filled:not(.select--disabled).select--open .select__combobox, + .select--filled:not(.select--disabled).select--focused .select__combobox { + background-color: var(--sl-input-filled-background-color-focus); + outline: var(--sl-focus-ring); + } + + /* Sizes */ + .select--small .select__combobox { + border-radius: var(--sl-input-border-radius-small); + font-size: var(--sl-input-font-size-small); + min-height: var(--sl-input-height-small); + padding-block: 0; + padding-inline: var(--sl-input-spacing-small); + } + + .select--small .select__clear { + margin-inline-start: var(--sl-input-spacing-small); + } + + .select--small .select__prefix::slotted(*) { + margin-inline-end: var(--sl-input-spacing-small); + } + + .select--small.select--multiple:not(.select--placeholder-visible) .select__prefix::slotted(*) { + margin-inline-start: var(--sl-input-spacing-small); + } + + .select--small.select--multiple:not(.select--placeholder-visible) .select__combobox { + padding-block: 2px; + padding-inline-start: 0; + } + + .select--small .select__tags { + gap: 2px; + } + + .select--medium .select__combobox { + border-radius: var(--sl-input-border-radius-medium); + font-size: var(--sl-input-font-size-medium); + min-height: var(--sl-input-height-medium); + padding-block: 0; + padding-inline: var(--sl-input-spacing-medium); + } + + .select--medium .select__clear { + margin-inline-start: var(--sl-input-spacing-medium); + } + + .select--medium .select__prefix::slotted(*) { + margin-inline-end: var(--sl-input-spacing-medium); + } + + .select--medium.select--multiple:not(.select--placeholder-visible) .select__prefix::slotted(*) { + margin-inline-start: var(--sl-input-spacing-medium); + } + + .select--medium.select--multiple:not(.select--placeholder-visible) .select__combobox { + padding-inline-start: 0; + padding-block: 3px; + } + + .select--medium .select__tags { + gap: 3px; + } + + .select--large .select__combobox { + border-radius: var(--sl-input-border-radius-large); + font-size: var(--sl-input-font-size-large); + min-height: var(--sl-input-height-large); + padding-block: 0; + padding-inline: var(--sl-input-spacing-large); + } + + .select--large .select__clear { + margin-inline-start: var(--sl-input-spacing-large); + } + + .select--large .select__prefix::slotted(*) { + margin-inline-end: var(--sl-input-spacing-large); + } + + .select--large.select--multiple:not(.select--placeholder-visible) .select__prefix::slotted(*) { + margin-inline-start: var(--sl-input-spacing-large); + } + + .select--large.select--multiple:not(.select--placeholder-visible) .select__combobox { + padding-inline-start: 0; + padding-block: 4px; + } + + .select--large .select__tags { + gap: 4px; + } + + /* Pills */ + .select--pill.select--small .select__combobox { + border-radius: var(--sl-input-height-small); + } + + .select--pill.select--medium .select__combobox { + border-radius: var(--sl-input-height-medium); + } + + .select--pill.select--large .select__combobox { + border-radius: var(--sl-input-height-large); + } + + /* Prefix and Suffix */ + .select__prefix, + .select__suffix { + flex: 0; + display: inline-flex; + align-items: center; + color: var(--sl-input-placeholder-color); + } + + .select__suffix::slotted(*) { + margin-inline-start: var(--sl-spacing-small); + } + + /* Clear button */ + .select__clear { + display: inline-flex; + align-items: center; + justify-content: center; + font-size: inherit; + color: var(--sl-input-icon-color); + border: none; + background: none; + padding: 0; + transition: var(--sl-transition-fast) color; + cursor: pointer; + } + + .select__clear:hover { + color: var(--sl-input-icon-color-hover); + } + + .select__clear:focus { + outline: none; + } + + /* Expand icon */ + .select__expand-icon { + flex: 0 0 auto; + display: flex; + align-items: center; + transition: var(--sl-transition-medium) rotate ease; + rotate: 0; + margin-inline-start: var(--sl-spacing-small); + } + + .select--open .select__expand-icon { + rotate: -180deg; + } + + /* Listbox */ + .select__listbox { + display: block; + position: relative; + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-medium); + font-weight: var(--sl-font-weight-normal); + box-shadow: var(--sl-shadow-large); + background: var(--sl-panel-background-color); + border: solid var(--sl-panel-border-width) var(--sl-panel-border-color); + border-radius: var(--sl-border-radius-medium); + padding-block: var(--sl-spacing-x-small); + padding-inline: 0; + overflow: auto; + overscroll-behavior: none; + + /* Make sure it adheres to the popup's auto size */ + max-width: var(--auto-size-available-width); + max-height: var(--auto-size-available-height); + } + + .select__listbox ::slotted(sl-divider) { + --spacing: var(--sl-spacing-x-small); + } + + .select__listbox ::slotted(small) { + display: block; + font-size: var(--sl-font-size-small); + font-weight: var(--sl-font-weight-semibold); + color: var(--sl-color-neutral-500); + padding-block: var(--sl-spacing-2x-small); + padding-inline: var(--sl-spacing-x-large); + } +`;class e extends i$3{constructor(i){if(super(i),this.it=E$1,i.type!==t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===E$1||null==r)return this._t=void 0,this.it=r;if(r===T$1)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName="unsafeHTML",e.resultType=1;const o$2=e$3(e);var SlSelect=class extends ShoelaceElement{constructor(){var _Mathmax=Math.max;super(...arguments),this.formControlController=new FormControlController(this,{assumeInteractionOn:["sl-blur","sl-input"]}),this.hasSlotController=new HasSlotController(this,"help-text","label"),this.localize=new LocalizeController(this),this.typeToSelectString="",this.hasFocus=!1,this.displayLabel="",this.selectedOptions=[],this.valueHasChanged=!1,this.name="",this._value="",this.defaultValue="",this.size="medium",this.placeholder="",this.multiple=!1,this.maxOptionsVisible=3,this.disabled=!1,this.clearable=!1,this.open=!1,this.hoist=!1,this.filled=!1,this.pill=!1,this.label="",this.placement="bottom",this.helpText="",this.form="",this.required=!1,this.getTag=option=>x$1` + <sl-tag + part="tag" + exportparts=" + base:tag__base, + content:tag__content, + remove-button:tag__remove-button, + remove-button__base:tag__remove-button__base + " + ?pill=${this.pill} + size=${this.size} + removable + @sl-remove=${event=>this.handleTagRemove(event,option)} + > + ${option.getTextLabel()} + </sl-tag> + `,this.handleDocumentFocusIn=event=>{const path=event.composedPath();this&&!path.includes(this)&&this.hide()},this.handleDocumentKeyDown=event=>{const target=event.target,isClearButton=null!==target.closest(".select__clear"),isIconButton=null!==target.closest("sl-icon-button");if(!(isClearButton||isIconButton)){if("Escape"===event.key&&this.open&&!this.closeWatcher&&(event.preventDefault(),event.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===event.key||" "===event.key&&""===this.typeToSelectString)return(event.preventDefault(),event.stopImmediatePropagation(),!this.open)?void this.show():void(this.currentOption&&!this.currentOption.disabled&&(this.valueHasChanged=!0,this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sl-input"),this.emit("sl-change")}),!this.multiple&&(this.hide(),this.displayInput.focus({preventScroll:!0}))));if(["ArrowUp","ArrowDown","Home","End"].includes(event.key)){const allOptions=this.getAllOptions(),currentIndex=allOptions.indexOf(this.currentOption);let newIndex=_Mathmax(0,currentIndex);if(event.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===event.key?(newIndex=currentIndex+1,newIndex>allOptions.length-1&&(newIndex=0)):"ArrowUp"===event.key?(newIndex=currentIndex-1,0>newIndex&&(newIndex=allOptions.length-1)):"Home"===event.key?newIndex=0:"End"===event.key&&(newIndex=allOptions.length-1),this.setCurrentOption(allOptions[newIndex])}if(event.key&&1===event.key.length||"Backspace"===event.key){const allOptions=this.getAllOptions();if(event.metaKey||event.ctrlKey||event.altKey)return;if(!this.open){if("Backspace"===event.key)return;this.show()}event.stopPropagation(),event.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),"Backspace"===event.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=event.key.toLowerCase();for(const option of allOptions){const label=option.getTextLabel().toLowerCase();if(label.startsWith(this.typeToSelectString)){this.setCurrentOption(option);break}}}}},this.handleDocumentMouseDown=event=>{const path=event.composedPath();this&&!path.includes(this)&&this.hide()}}get value(){return this._value}set value(val){val=this.multiple?Array.isArray(val)?val:val.split(" "):Array.isArray(val)?val.join(" "):val;this._value===val||(this.valueHasChanged=!0,this._value=val)}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.handleDefaultSlotChange()}),this.open=!1}addOpenListeners(){var _a;document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn),"CloseWatcher"in window&&(null==(_a=this.closeWatcher)?void 0:_a.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.open&&(this.hide(),this.displayInput.focus({preventScroll:!0}))})}removeOpenListeners(){var _a;document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn),null==(_a=this.closeWatcher)?void 0:_a.destroy()}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sl-focus")}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(event){const path=event.composedPath(),isIconButton=path.some(el=>el instanceof Element&&"sl-icon-button"===el.tagName.toLowerCase());this.disabled||isIconButton||(event.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(event){"Tab"===event.key||(event.stopPropagation(),this.handleDocumentKeyDown(event))}handleClearClick(event){event.stopPropagation(),this.valueHasChanged=!0,""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sl-clear"),this.emit("sl-input"),this.emit("sl-change")}))}handleClearMouseDown(event){event.stopPropagation(),event.preventDefault()}handleOptionClick(event){const target=event.target,option=target.closest("sl-option"),oldValue=this.value;option&&!option.disabled&&(this.valueHasChanged=!0,this.multiple?this.toggleOptionSelection(option):this.setSelectedOptions(option),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})),this.value!==oldValue&&this.updateComplete.then(()=>{this.emit("sl-input"),this.emit("sl-change")}),!this.multiple&&(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){customElements.get("sl-option")||customElements.whenDefined("sl-option").then(()=>this.handleDefaultSlotChange());const allOptions=this.getAllOptions(),val=this.valueHasChanged?this.value:this.defaultValue,value=Array.isArray(val)?val:[val],values=[];allOptions.forEach(option=>values.push(option.value)),this.setSelectedOptions(allOptions.filter(el=>value.includes(el.value)))}handleTagRemove(event,option){event.stopPropagation(),this.valueHasChanged=!0,this.disabled||(this.toggleOptionSelection(option,!1),this.updateComplete.then(()=>{this.emit("sl-input"),this.emit("sl-change")}))}getAllOptions(){return[...this.querySelectorAll("sl-option")]}getFirstOption(){return this.querySelector("sl-option")}setCurrentOption(option){const allOptions=this.getAllOptions();allOptions.forEach(el=>{el.current=!1,el.tabIndex=-1}),option&&(this.currentOption=option,option.current=!0,option.tabIndex=0,option.focus())}setSelectedOptions(option){const allOptions=this.getAllOptions(),newSelectedOptions=Array.isArray(option)?option:[option];allOptions.forEach(el=>el.selected=!1),newSelectedOptions.length&&newSelectedOptions.forEach(el=>el.selected=!0),this.selectionChanged()}toggleOptionSelection(option,force){option.selected=!0===force||!1===force?force:!option.selected,this.selectionChanged()}selectionChanged(){var _a,_b,_c;const options=this.getAllOptions();this.selectedOptions=options.filter(el=>el.selected);const cachedValueHasChanged=this.valueHasChanged;if(this.multiple)this.value=this.selectedOptions.map(el=>el.value),this.displayLabel=this.placeholder&&0===this.value.length?"":this.localize.term("numOptionsSelected",this.selectedOptions.length);else{const selectedOption=this.selectedOptions[0];this.value=null==(_a=null==selectedOption?void 0:selectedOption.value)?"":_a,this.displayLabel=null==(_c=null==(_b=null==selectedOption?void 0:selectedOption.getTextLabel)?void 0:_b.call(selectedOption))?"":_c}this.valueHasChanged=cachedValueHasChanged,this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.map((option,index)=>{if(index<this.maxOptionsVisible||0>=this.maxOptionsVisible){const tag=this.getTag(option,index);return x$1`<div @sl-remove=${e=>this.handleTagRemove(e,option)}> + ${"string"==typeof tag?o$2(tag):tag} + </div>`}return index===this.maxOptionsVisible?x$1`<sl-tag size=${this.size}>+${this.selectedOptions.length-index}</sl-tag>`:x$1``})}handleInvalid(event){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(event)}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}attributeChangedCallback(name,oldVal,newVal){if(super.attributeChangedCallback(name,oldVal,newVal),"value"===name){const cachedValueHasChanged=this.valueHasChanged;this.value=this.defaultValue,this.valueHasChanged=cachedValueHasChanged}}handleValueChange(){if(!this.valueHasChanged){const cachedValueHasChanged=this.valueHasChanged;this.value=this.defaultValue,this.valueHasChanged=cachedValueHasChanged}const allOptions=this.getAllOptions(),value=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(allOptions.filter(el=>value.includes(el.value)))}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sl-show"),this.addOpenListeners(),await stopAnimations(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});const{keyframes,options}=getAnimation(this,"select.show",{dir:this.localize.dir()});await animateTo(this.popup.popup,keyframes,options),this.currentOption&&scrollIntoView(this.currentOption,this.listbox,"vertical","auto"),this.emit("sl-after-show")}else{this.emit("sl-hide"),this.removeOpenListeners(),await stopAnimations(this);const{keyframes,options}=getAnimation(this,"select.hide",{dir:this.localize.dir()});await animateTo(this.popup.popup,keyframes,options),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sl-after-hide")}}async show(){return this.open||this.disabled?void(this.open=!1):(this.open=!0,waitForEvent(this,"sl-after-show"))}async hide(){return!this.open||this.disabled?void(this.open=!1):(this.open=!1,waitForEvent(this,"sl-after-hide"))}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.valueInput.reportValidity()}setCustomValidity(message){this.valueInput.setCustomValidity(message),this.formControlController.updateValidity()}focus(options){this.displayInput.focus(options)}blur(){this.displayInput.blur()}render(){const hasLabelSlot=this.hasSlotController.test("label"),hasHelpTextSlot=this.hasSlotController.test("help-text"),hasLabel=!!this.label||!!hasLabelSlot,hasHelpText=!!this.helpText||!!hasHelpTextSlot,hasClearIcon=this.clearable&&!this.disabled&&0<this.value.length,isPlaceholderVisible=this.placeholder&&this.value&&0>=this.value.length;return x$1` + <div + part="form-control" + class=${e$2({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-label":hasLabel,"form-control--has-help-text":hasHelpText})} + > + <label + id="label" + part="form-control-label" + class="form-control__label" + aria-hidden=${hasLabel?"false":"true"} + @click=${this.handleLabelClick} + > + <slot name="label">${this.label}</slot> + </label> + + <div part="form-control-input" class="form-control-input"> + <sl-popup + class=${e$2({select:!0,"select--standard":!0,"select--filled":this.filled,"select--pill":this.pill,"select--open":this.open,"select--disabled":this.disabled,"select--multiple":this.multiple,"select--focused":this.hasFocus,"select--placeholder-visible":isPlaceholderVisible,"select--top":"top"===this.placement,"select--bottom":"bottom"===this.placement,"select--small":"small"===this.size,"select--medium":"medium"===this.size,"select--large":"large"===this.size})} + placement=${this.placement} + strategy=${this.hoist?"fixed":"absolute"} + flip + shift + sync="width" + auto-size="vertical" + auto-size-padding="10" + > + <div + part="combobox" + class="select__combobox" + slot="anchor" + @keydown=${this.handleComboboxKeyDown} + @mousedown=${this.handleComboboxMouseDown} + > + <slot part="prefix" name="prefix" class="select__prefix"></slot> + + <input + part="display-input" + class="select__display-input" + type="text" + placeholder=${this.placeholder} + .disabled=${this.disabled} + .value=${this.displayLabel} + autocomplete="off" + spellcheck="false" + autocapitalize="off" + readonly + aria-controls="listbox" + aria-expanded=${this.open?"true":"false"} + aria-haspopup="listbox" + aria-labelledby="label" + aria-disabled=${this.disabled?"true":"false"} + aria-describedby="help-text" + role="combobox" + tabindex="0" + @focus=${this.handleFocus} + @blur=${this.handleBlur} + /> + + ${this.multiple?x$1`<div part="tags" class="select__tags">${this.tags}</div>`:""} + + <input + class="select__value-input" + type="text" + ?disabled=${this.disabled} + ?required=${this.required} + .value=${Array.isArray(this.value)?this.value.join(", "):this.value} + tabindex="-1" + aria-hidden="true" + @focus=${()=>this.focus()} + @invalid=${this.handleInvalid} + /> + + ${hasClearIcon?x$1` + <button + part="clear-button" + class="select__clear" + type="button" + aria-label=${this.localize.term("clearEntry")} + @mousedown=${this.handleClearMouseDown} + @click=${this.handleClearClick} + tabindex="-1" + > + <slot name="clear-icon"> + <sl-icon name="x-circle-fill" library="system"></sl-icon> + </slot> + </button> + `:""} + + <slot name="suffix" part="suffix" class="select__suffix"></slot> + + <slot name="expand-icon" part="expand-icon" class="select__expand-icon"> + <sl-icon library="system" name="chevron-down"></sl-icon> + </slot> + </div> + + <div + id="listbox" + role="listbox" + aria-expanded=${this.open?"true":"false"} + aria-multiselectable=${this.multiple?"true":"false"} + aria-labelledby="label" + part="listbox" + class="select__listbox" + tabindex="-1" + @mouseup=${this.handleOptionClick} + @slotchange=${this.handleDefaultSlotChange} + > + <slot></slot> + </div> + </sl-popup> + </div> + + <div + part="form-control-help-text" + id="help-text" + class="form-control__help-text" + aria-hidden=${hasHelpText?"false":"true"} + > + <slot name="help-text">${this.helpText}</slot> + </div> + </div> + `}};SlSelect.styles=[component_styles_default,form_control_styles_default,select_styles_default],SlSelect.dependencies={"sl-icon":SlIcon,"sl-popup":SlPopup,"sl-tag":SlTag},__decorateClass([e$6(".select")],SlSelect.prototype,"popup",2),__decorateClass([e$6(".select__combobox")],SlSelect.prototype,"combobox",2),__decorateClass([e$6(".select__display-input")],SlSelect.prototype,"displayInput",2),__decorateClass([e$6(".select__value-input")],SlSelect.prototype,"valueInput",2),__decorateClass([e$6(".select__listbox")],SlSelect.prototype,"listbox",2),__decorateClass([r$6()],SlSelect.prototype,"hasFocus",2),__decorateClass([r$6()],SlSelect.prototype,"displayLabel",2),__decorateClass([r$6()],SlSelect.prototype,"currentOption",2),__decorateClass([r$6()],SlSelect.prototype,"selectedOptions",2),__decorateClass([r$6()],SlSelect.prototype,"valueHasChanged",2),__decorateClass([n$5()],SlSelect.prototype,"name",2),__decorateClass([r$6()],SlSelect.prototype,"value",1),__decorateClass([n$5({attribute:"value"})],SlSelect.prototype,"defaultValue",2),__decorateClass([n$5({reflect:!0})],SlSelect.prototype,"size",2),__decorateClass([n$5()],SlSelect.prototype,"placeholder",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSelect.prototype,"multiple",2),__decorateClass([n$5({attribute:"max-options-visible",type:Number})],SlSelect.prototype,"maxOptionsVisible",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSelect.prototype,"disabled",2),__decorateClass([n$5({type:Boolean})],SlSelect.prototype,"clearable",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSelect.prototype,"open",2),__decorateClass([n$5({type:Boolean})],SlSelect.prototype,"hoist",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSelect.prototype,"filled",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSelect.prototype,"pill",2),__decorateClass([n$5()],SlSelect.prototype,"label",2),__decorateClass([n$5({reflect:!0})],SlSelect.prototype,"placement",2),__decorateClass([n$5({attribute:"help-text"})],SlSelect.prototype,"helpText",2),__decorateClass([n$5({reflect:!0})],SlSelect.prototype,"form",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSelect.prototype,"required",2),__decorateClass([n$5()],SlSelect.prototype,"getTag",2),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlSelect.prototype,"handleDisabledChange",1),__decorateClass([watch(["defaultValue","value"],{waitUntilFirstUpdate:!0})],SlSelect.prototype,"handleValueChange",1),__decorateClass([watch("open",{waitUntilFirstUpdate:!0})],SlSelect.prototype,"handleOpenChange",1),setDefaultAnimation("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),setDefaultAnimation("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}}),SlSelect.define("sl-select");var textarea_styles_default=i$7` + :host { + display: block; + } + + .textarea { + display: grid; + align-items: center; + position: relative; + width: 100%; + font-family: var(--sl-input-font-family); + font-weight: var(--sl-input-font-weight); + line-height: var(--sl-line-height-normal); + letter-spacing: var(--sl-input-letter-spacing); + vertical-align: middle; + transition: + var(--sl-transition-fast) color, + var(--sl-transition-fast) border, + var(--sl-transition-fast) box-shadow, + var(--sl-transition-fast) background-color; + cursor: text; + } + + /* Standard textareas */ + .textarea--standard { + background-color: var(--sl-input-background-color); + border: solid var(--sl-input-border-width) var(--sl-input-border-color); + } + + .textarea--standard:hover:not(.textarea--disabled) { + background-color: var(--sl-input-background-color-hover); + border-color: var(--sl-input-border-color-hover); + } + .textarea--standard:hover:not(.textarea--disabled) .textarea__control { + color: var(--sl-input-color-hover); + } + + .textarea--standard.textarea--focused:not(.textarea--disabled) { + background-color: var(--sl-input-background-color-focus); + border-color: var(--sl-input-border-color-focus); + color: var(--sl-input-color-focus); + box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color); + } + + .textarea--standard.textarea--focused:not(.textarea--disabled) .textarea__control { + color: var(--sl-input-color-focus); + } + + .textarea--standard.textarea--disabled { + background-color: var(--sl-input-background-color-disabled); + border-color: var(--sl-input-border-color-disabled); + opacity: 0.5; + cursor: not-allowed; + } + + .textarea__control, + .textarea__size-adjuster { + grid-area: 1 / 1 / 2 / 2; + } + + .textarea__size-adjuster { + visibility: hidden; + pointer-events: none; + opacity: 0; + } + + .textarea--standard.textarea--disabled .textarea__control { + color: var(--sl-input-color-disabled); + } + + .textarea--standard.textarea--disabled .textarea__control::placeholder { + color: var(--sl-input-placeholder-color-disabled); + } + + /* Filled textareas */ + .textarea--filled { + border: none; + background-color: var(--sl-input-filled-background-color); + color: var(--sl-input-color); + } + + .textarea--filled:hover:not(.textarea--disabled) { + background-color: var(--sl-input-filled-background-color-hover); + } + + .textarea--filled.textarea--focused:not(.textarea--disabled) { + background-color: var(--sl-input-filled-background-color-focus); + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .textarea--filled.textarea--disabled { + background-color: var(--sl-input-filled-background-color-disabled); + opacity: 0.5; + cursor: not-allowed; + } + + .textarea__control { + font-family: inherit; + font-size: inherit; + font-weight: inherit; + line-height: 1.4; + color: var(--sl-input-color); + border: none; + background: none; + box-shadow: none; + cursor: inherit; + -webkit-appearance: none; + } + + .textarea__control::-webkit-search-decoration, + .textarea__control::-webkit-search-cancel-button, + .textarea__control::-webkit-search-results-button, + .textarea__control::-webkit-search-results-decoration { + -webkit-appearance: none; + } + + .textarea__control::placeholder { + color: var(--sl-input-placeholder-color); + user-select: none; + -webkit-user-select: none; + } + + .textarea__control:focus { + outline: none; + } + + /* + * Size modifiers + */ + + .textarea--small { + border-radius: var(--sl-input-border-radius-small); + font-size: var(--sl-input-font-size-small); + } + + .textarea--small .textarea__control { + padding: 0.5em var(--sl-input-spacing-small); + } + + .textarea--medium { + border-radius: var(--sl-input-border-radius-medium); + font-size: var(--sl-input-font-size-medium); + } + + .textarea--medium .textarea__control { + padding: 0.5em var(--sl-input-spacing-medium); + } + + .textarea--large { + border-radius: var(--sl-input-border-radius-large); + font-size: var(--sl-input-font-size-large); + } + + .textarea--large .textarea__control { + padding: 0.5em var(--sl-input-spacing-large); + } + + /* + * Resize types + */ + + .textarea--resize-none .textarea__control { + resize: none; + } + + .textarea--resize-vertical .textarea__control { + resize: vertical; + } + + .textarea--resize-auto .textarea__control { + height: auto; + resize: none; + overflow-y: hidden; + } +`,SlTextarea=class extends ShoelaceElement{constructor(){super(...arguments),this.formControlController=new FormControlController(this,{assumeInteractionOn:["sl-blur","sl-input"]}),this.hasSlotController=new HasSlotController(this,"help-text","label"),this.hasFocus=!1,this.title="",this.name="",this.value="",this.size="medium",this.filled=!1,this.label="",this.helpText="",this.placeholder="",this.rows=4,this.resize="vertical",this.disabled=!1,this.readonly=!1,this.form="",this.required=!1,this.spellcheck=!0,this.defaultValue=""}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>this.setTextareaHeight()),this.updateComplete.then(()=>{this.setTextareaHeight(),this.resizeObserver.observe(this.input)})}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){var _a;super.disconnectedCallback(),this.input&&(null==(_a=this.resizeObserver)?void 0:_a.unobserve(this.input))}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleChange(){this.value=this.input.value,this.setTextareaHeight(),this.emit("sl-change")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleInput(){this.value=this.input.value,this.emit("sl-input")}handleInvalid(event){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(event)}setTextareaHeight(){"auto"===this.resize?(this.sizeAdjuster.style.height=`${this.input.clientHeight}px`,this.input.style.height="auto",this.input.style.height=`${this.input.scrollHeight}px`):this.input.style.height=""}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(options){this.input.focus(options)}blur(){this.input.blur()}select(){this.input.select()}scrollPosition(position){return position?("number"==typeof position.top&&(this.input.scrollTop=position.top),void("number"==typeof position.left&&(this.input.scrollLeft=position.left))):{top:this.input.scrollTop,left:this.input.scrollTop}}setSelectionRange(selectionStart,selectionEnd,selectionDirection="none"){this.input.setSelectionRange(selectionStart,selectionEnd,selectionDirection)}setRangeText(replacement,start,end,selectMode="preserve"){const selectionStart=null==start?this.input.selectionStart:start,selectionEnd=null==end?this.input.selectionEnd:end;this.input.setRangeText(replacement,selectionStart,selectionEnd,selectMode),this.value!==this.input.value&&(this.value=this.input.value,this.setTextareaHeight())}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(message){this.input.setCustomValidity(message),this.formControlController.updateValidity()}render(){const hasLabelSlot=this.hasSlotController.test("label"),hasHelpTextSlot=this.hasSlotController.test("help-text"),hasLabel=!!this.label||!!hasLabelSlot,hasHelpText=!!this.helpText||!!hasHelpTextSlot;return x$1` + <div + part="form-control" + class=${e$2({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-label":hasLabel,"form-control--has-help-text":hasHelpText})} + > + <label + part="form-control-label" + class="form-control__label" + for="input" + aria-hidden=${hasLabel?"false":"true"} + > + <slot name="label">${this.label}</slot> + </label> + + <div part="form-control-input" class="form-control-input"> + <div + part="base" + class=${e$2({textarea:!0,"textarea--small":"small"===this.size,"textarea--medium":"medium"===this.size,"textarea--large":"large"===this.size,"textarea--standard":!this.filled,"textarea--filled":this.filled,"textarea--disabled":this.disabled,"textarea--focused":this.hasFocus,"textarea--empty":!this.value,"textarea--resize-none":"none"===this.resize,"textarea--resize-vertical":"vertical"===this.resize,"textarea--resize-auto":"auto"===this.resize})} + > + <textarea + part="textarea" + id="input" + class="textarea__control" + title=${this.title} + name=${o$6(this.name)} + .value=${l(this.value)} + ?disabled=${this.disabled} + ?readonly=${this.readonly} + ?required=${this.required} + placeholder=${o$6(this.placeholder)} + rows=${o$6(this.rows)} + minlength=${o$6(this.minlength)} + maxlength=${o$6(this.maxlength)} + autocapitalize=${o$6(this.autocapitalize)} + autocorrect=${o$6(this.autocorrect)} + ?autofocus=${this.autofocus} + spellcheck=${o$6(this.spellcheck)} + enterkeyhint=${o$6(this.enterkeyhint)} + inputmode=${o$6(this.inputmode)} + aria-describedby="help-text" + @change=${this.handleChange} + @input=${this.handleInput} + @invalid=${this.handleInvalid} + @focus=${this.handleFocus} + @blur=${this.handleBlur} + ></textarea> + <!-- This "adjuster" exists to prevent layout shifting. https://github.com/shoelace-style/shoelace/issues/2180 --> + <div part="textarea-adjuster" class="textarea__size-adjuster" ?hidden=${"auto"!==this.resize}></div> + </div> + </div> + + <div + part="form-control-help-text" + id="help-text" + class="form-control__help-text" + aria-hidden=${hasHelpText?"false":"true"} + > + <slot name="help-text">${this.helpText}</slot> + </div> + </div> + `}};SlTextarea.styles=[component_styles_default,form_control_styles_default,textarea_styles_default],__decorateClass([e$6(".textarea__control")],SlTextarea.prototype,"input",2),__decorateClass([e$6(".textarea__size-adjuster")],SlTextarea.prototype,"sizeAdjuster",2),__decorateClass([r$6()],SlTextarea.prototype,"hasFocus",2),__decorateClass([n$5()],SlTextarea.prototype,"title",2),__decorateClass([n$5()],SlTextarea.prototype,"name",2),__decorateClass([n$5()],SlTextarea.prototype,"value",2),__decorateClass([n$5({reflect:!0})],SlTextarea.prototype,"size",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTextarea.prototype,"filled",2),__decorateClass([n$5()],SlTextarea.prototype,"label",2),__decorateClass([n$5({attribute:"help-text"})],SlTextarea.prototype,"helpText",2),__decorateClass([n$5()],SlTextarea.prototype,"placeholder",2),__decorateClass([n$5({type:Number})],SlTextarea.prototype,"rows",2),__decorateClass([n$5()],SlTextarea.prototype,"resize",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTextarea.prototype,"disabled",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTextarea.prototype,"readonly",2),__decorateClass([n$5({reflect:!0})],SlTextarea.prototype,"form",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTextarea.prototype,"required",2),__decorateClass([n$5({type:Number})],SlTextarea.prototype,"minlength",2),__decorateClass([n$5({type:Number})],SlTextarea.prototype,"maxlength",2),__decorateClass([n$5()],SlTextarea.prototype,"autocapitalize",2),__decorateClass([n$5()],SlTextarea.prototype,"autocorrect",2),__decorateClass([n$5()],SlTextarea.prototype,"autocomplete",2),__decorateClass([n$5({type:Boolean})],SlTextarea.prototype,"autofocus",2),__decorateClass([n$5()],SlTextarea.prototype,"enterkeyhint",2),__decorateClass([n$5({type:Boolean,converter:{fromAttribute:value=>!!(value&&"false"!==value),toAttribute:value=>value?"true":"false"}})],SlTextarea.prototype,"spellcheck",2),__decorateClass([n$5()],SlTextarea.prototype,"inputmode",2),__decorateClass([defaultValue()],SlTextarea.prototype,"defaultValue",2),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlTextarea.prototype,"handleDisabledChange",1),__decorateClass([watch("rows",{waitUntilFirstUpdate:!0})],SlTextarea.prototype,"handleRowsChange",1),__decorateClass([watch("value",{waitUntilFirstUpdate:!0})],SlTextarea.prototype,"handleValueChange",1);var textarea_default=SlTextarea;SlTextarea.define("sl-textarea");var badge_styles_default=i$7` + :host { + display: inline-flex; + } + + .badge { + display: inline-flex; + align-items: center; + justify-content: center; + font-size: max(12px, 0.75em); + font-weight: var(--sl-font-weight-semibold); + letter-spacing: var(--sl-letter-spacing-normal); + line-height: 1; + border-radius: var(--sl-border-radius-small); + border: solid 1px var(--sl-color-neutral-0); + white-space: nowrap; + padding: 0.35em 0.6em; + user-select: none; + -webkit-user-select: none; + cursor: inherit; + } + + /* Variant modifiers */ + .badge--primary { + background-color: var(--sl-color-primary-600); + color: var(--sl-color-neutral-0); + } + + .badge--success { + background-color: var(--sl-color-success-600); + color: var(--sl-color-neutral-0); + } + + .badge--neutral { + background-color: var(--sl-color-neutral-600); + color: var(--sl-color-neutral-0); + } + + .badge--warning { + background-color: var(--sl-color-warning-600); + color: var(--sl-color-neutral-0); + } + + .badge--danger { + background-color: var(--sl-color-danger-600); + color: var(--sl-color-neutral-0); + } + + /* Pill modifier */ + .badge--pill { + border-radius: var(--sl-border-radius-pill); + } + + /* Pulse modifier */ + .badge--pulse { + animation: pulse 1.5s infinite; + } + + .badge--pulse.badge--primary { + --pulse-color: var(--sl-color-primary-600); + } + + .badge--pulse.badge--success { + --pulse-color: var(--sl-color-success-600); + } + + .badge--pulse.badge--neutral { + --pulse-color: var(--sl-color-neutral-600); + } + + .badge--pulse.badge--warning { + --pulse-color: var(--sl-color-warning-600); + } + + .badge--pulse.badge--danger { + --pulse-color: var(--sl-color-danger-600); + } + + @keyframes pulse { + 0% { + box-shadow: 0 0 0 0 var(--pulse-color); + } + 70% { + box-shadow: 0 0 0 0.5rem transparent; + } + 100% { + box-shadow: 0 0 0 0 transparent; + } + } +`,SlBadge=class extends ShoelaceElement{constructor(){super(...arguments),this.variant="primary",this.pill=!1,this.pulse=!1}render(){return x$1` + <span + part="base" + class=${e$2({badge:!0,"badge--primary":"primary"===this.variant,"badge--success":"success"===this.variant,"badge--neutral":"neutral"===this.variant,"badge--warning":"warning"===this.variant,"badge--danger":"danger"===this.variant,"badge--pill":this.pill,"badge--pulse":this.pulse})} + role="status" + > + <slot></slot> + </span> + `}};SlBadge.styles=[component_styles_default,badge_styles_default],__decorateClass([n$5({reflect:!0})],SlBadge.prototype,"variant",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlBadge.prototype,"pill",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlBadge.prototype,"pulse",2),SlBadge.define("sl-badge"),SlTag.define("sl-tag");var tooltip_styles_default=i$7` + :host { + --max-width: 20rem; + --hide-delay: 0ms; + --show-delay: 150ms; + + display: contents; + } + + .tooltip { + --arrow-size: var(--sl-tooltip-arrow-size); + --arrow-color: var(--sl-tooltip-background-color); + } + + .tooltip::part(popup) { + z-index: var(--sl-z-index-tooltip); + } + + .tooltip[placement^='top']::part(popup) { + transform-origin: bottom; + } + + .tooltip[placement^='bottom']::part(popup) { + transform-origin: top; + } + + .tooltip[placement^='left']::part(popup) { + transform-origin: right; + } + + .tooltip[placement^='right']::part(popup) { + transform-origin: left; + } + + .tooltip__body { + display: block; + width: max-content; + max-width: var(--max-width); + border-radius: var(--sl-tooltip-border-radius); + background-color: var(--sl-tooltip-background-color); + font-family: var(--sl-tooltip-font-family); + font-size: var(--sl-tooltip-font-size); + font-weight: var(--sl-tooltip-font-weight); + line-height: var(--sl-tooltip-line-height); + text-align: start; + white-space: normal; + color: var(--sl-tooltip-color); + padding: var(--sl-tooltip-padding); + pointer-events: none; + user-select: none; + -webkit-user-select: none; + } +`,SlTooltip=class extends ShoelaceElement{constructor(){super(),this.localize=new LocalizeController(this),this.content="",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=event=>{"Escape"===event.key&&(event.stopPropagation(),this.hide())},this.handleMouseOver=()=>{if(this.hasTrigger("hover")){const delay=parseDuration(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),delay)}},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){const delay=parseDuration(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.hide(),delay)}},this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}disconnectedCallback(){var _a;super.disconnectedCallback(),null==(_a=this.closeWatcher)?void 0:_a.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(triggerType){const triggers=this.trigger.split(" ");return triggers.includes(triggerType)}async handleOpenChange(){var _a,_b;if(this.open){if(this.disabled)return;this.emit("sl-show"),"CloseWatcher"in window?(null==(_a=this.closeWatcher)?void 0:_a.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide()}):document.addEventListener("keydown",this.handleDocumentKeyDown),await stopAnimations(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes,options}=getAnimation(this,"tooltip.show",{dir:this.localize.dir()});await animateTo(this.popup.popup,keyframes,options),this.popup.reposition(),this.emit("sl-after-show")}else{this.emit("sl-hide"),null==(_b=this.closeWatcher)?void 0:_b.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown),await stopAnimations(this.body);const{keyframes,options}=getAnimation(this,"tooltip.hide",{dir:this.localize.dir()});await animateTo(this.popup.popup,keyframes,options),this.popup.active=!1,this.body.hidden=!0,this.emit("sl-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,waitForEvent(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,waitForEvent(this,"sl-after-hide")}render(){return x$1` + <sl-popup + part="base" + exportparts=" + popup:base__popup, + arrow:base__arrow + " + class=${e$2({tooltip:!0,"tooltip--open":this.open})} + placement=${this.placement} + distance=${this.distance} + skidding=${this.skidding} + strategy=${this.hoist?"fixed":"absolute"} + flip + shift + arrow + hover-bridge + > + ${""} + <slot slot="anchor" aria-describedby="tooltip"></slot> + + ${""} + <div part="body" id="tooltip" class="tooltip__body" role="tooltip" aria-live=${this.open?"polite":"off"}> + <slot name="content">${this.content}</slot> + </div> + </sl-popup> + `}};SlTooltip.styles=[component_styles_default,tooltip_styles_default],SlTooltip.dependencies={"sl-popup":SlPopup},__decorateClass([e$6("slot:not([name])")],SlTooltip.prototype,"defaultSlot",2),__decorateClass([e$6(".tooltip__body")],SlTooltip.prototype,"body",2),__decorateClass([e$6("sl-popup")],SlTooltip.prototype,"popup",2),__decorateClass([n$5()],SlTooltip.prototype,"content",2),__decorateClass([n$5()],SlTooltip.prototype,"placement",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTooltip.prototype,"disabled",2),__decorateClass([n$5({type:Number})],SlTooltip.prototype,"distance",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTooltip.prototype,"open",2),__decorateClass([n$5({type:Number})],SlTooltip.prototype,"skidding",2),__decorateClass([n$5()],SlTooltip.prototype,"trigger",2),__decorateClass([n$5({type:Boolean})],SlTooltip.prototype,"hoist",2),__decorateClass([watch("open",{waitUntilFirstUpdate:!0})],SlTooltip.prototype,"handleOpenChange",1),__decorateClass([watch(["content","distance","hoist","placement","skidding"])],SlTooltip.prototype,"handleOptionsChange",1),__decorateClass([watch("disabled")],SlTooltip.prototype,"handleDisabledChange",1),setDefaultAnimation("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),setDefaultAnimation("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}}),SlTooltip.define("sl-tooltip");const VARS=i$7` +:host { + --default-font-color: #222; + --page-background: #fafafa; + + --light-grey: #eee; + + --gray-1: #e6e6e6; + --gray-2: #a9a9a9; + --gray-3: #797979; + --gray-4: #515151; + + --nav-link-color: #444; + + --bar-shadow-color: rgba(0, 0, 0, .065); + --bar-border-color: #D4D4D4; + --error-border-color: #FF0000; + + --chromium-color-dark: #366597; + --chromium-color-medium: #85b4df; + --chromium-color-light: #bdd6ed; + --chromium-color-center: #4580c0; + + --material-primary-button: #58f; + + --card-background: white; + --card-border: 1px solid #ddd; + --card-box-shadow: rgba(0, 0, 0, 0.067) 1px 1px 4px; + + /* App specific */ + --invalid-color: rgba(255,0,0,0.75); + --content-padding: 16px; + --content-padding-half: 8px; + --content-padding-negative: -16px; + --content-padding-huge: 80px; + --default-border-radius: 3px; + + --max-content-width: 860px; +}`,RESET=i$7` +html, body { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, +pre, a, abbr, acronym, address, code, del, dfn, em, img, +dl, dt, dd, ol, ul, li, fieldset, form, label, legend, caption, tbody, tfoot, thead, tr { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +ol, ul { + padding: revert; +} + +blockquote, q { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; + quotes: "" ""; +} + +blockquote { + margin-left: 1em; + border-left: 2px solid #999; + padding-left: 1em; +} + +blockquote:before, q:before, +blockquote:after, q:after { + content: ""; +} + +th, td, caption { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; + text-align: left; + font-weight: normal; + vertical-align: middle; +} + +table { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; + border-collapse: separate; + border-spacing: 0; + vertical-align: middle; +} + +a img { + border: none; +} +`,FLEX_BOX=i$7` + .hbox, + .vbox { + display: flex; + align-items: center; + } + + .hbox { + flex-direction: row; + } + .hbox.align-top { + align-items: flex-start; + } + .vbox { + flex-direction: column; + } + + .hbox > .spacer, + .vbox > .spacer { + flex-grow: 1; + visibility: hidden; + } +`,SHARED_STYLES=[VARS,RESET,FLEX_BOX,i$7` + + * { + box-sizing: border-box; + /* font: inherit; */ + text-decoration: inherit; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + + .conditional-comma:last-child { + display: none; + } + + .data-table { + width: 100%; + border: var(--default-border); + border-radius: var(--border-radius); + } + .data-table th { + text-align: left; + background: var(--table-header-background); + padding: var(--content-padding-half) var(--content-padding); + } + .data-table td { + vertical-align: top; + border-top: var(--default-border); + padding: var(--content-padding-half) var(--content-padding); + } + + h1, + h2, + h3, + h4 { + font-weight: 300; + } + + h1 { + font-size: 30px; + } + + h2, + h3, + h4 { + background: var(--heading-background); + color: var(--heading-color); + } + + h2 { + font-size: 25px; + } + + h3 { + font-size: 20px; + } + + a { + text-decoration: none; + color: var(--link-color); + } + a:hover { + text-decoration: underline; + color: var(--link-hover-color); + cursor: pointer; + } + + input:not([type="submit"]), + textarea { + border: 1px solid var(--bar-border-color); + } + + input:not([type="submit"])[disabled], + textarea[disabled], + button[disabled] { + opacity: 0.5; + } + + button, + input[type="submit"], + .button { + display: inline-block; + padding: 4px 16px; + background: var(--button-background); + border: var(--button-border); + border-radius: var(--button-border-radius); + color: var(--button-color); + white-space: nowrap; + user-select: none; + cursor: pointer; + font-size: var(--button-font-size); + } + + button.primary, + input[type="submit"], + .button.primary { + background: var(--primary-button-background); + color: var(--primary-button-color); + font-weight: bold; + } + + button.primary:disabled, + input[type="submit"]:disabled, + .button.primary:disabled { + background: var(--gray-4); + } + + .button.secondary { + margin: var(--content-padding); + border: var(--default-border); + border-color: var(--primary-border-background); + border-radius: var(--border-radius); + } + + button:not(:disabled):hover { + border-color: var(--gray-4); + } + + #subheader { + display: flex; + align-items: center; + margin: var(--content-padding) 0; + max-width: var(--max-content-width); + width: 100%; + } + #subheader div.search { + min-width: 350px; + } + #subheader div input { + width: 280px; + padding: 10px 7px; + } + + code { + font-family: monospace; + } + + .description { + line-height: 1.4; + } + + .comma::after { + content: ","; + margin-right: 0.2em; + } + + details { + padding: var(--content-padding-quarter); + } + + details summary { + white-space: nowrap; + box-sizing: border-box; + contain: content; + overflow: hidden; + cursor: pointer; + transition: margin 250ms ease-out; + } + + details summary:hover { + color: var(--link-hover-color); + } + + details[open] #preview { + display: none; + } + + details[open] summary { + margin-bottom: var(--content-padding-quarter); + } + + details > div { + padding: var(--content-padding-quarter); + padding-left: var(--content-padding); + } + + .no-web-share { + display: none; + } + + .preformatted { + white-space: pre-wrap; + } + + .warning { + margin: var(--content-padding); + padding: var(--content-padding); + background: var(--warning-background); + color: var(--warning-color); + } + + #breadcrumbs { + display: flex; + align-items: center; + } + + #breadcrumbs a { + text-decoration: none; + color: inherit; + display: flex; + align-items: center; + } + + #breadcrumbs a sl-icon { + padding-right: var(--content-padding-half); + } + + sl-dialog::part(title) { + padding-top: calc(var(--header-spacing) / 2); + padding-bottom: calc(var(--header-spacing) / 2); + } + + sl-dialog::part(close-button) { + padding-right: 0; + } + + sl-dialog::part(body) { + padding-top: 0; + padding-bottom: calc(var(--body-spacing) / 2); + } + + sl-details::part(base) { + margin: var(--content-padding-half) 0 0 0; + color: var(--accordion-color); + border: none; + border-radius: 0; + background-color: transparent; + } + + sl-details::part(header) { + border-radius: var(--accordion-border-radius); + background: var(--accordion-background); + font-weight: 300; + font-size: 20px; + padding: var(--content-padding-quarter) var(--content-padding-half) + } + + sl-details::part(content) { + padding: 0; + } + + sl-skeleton { + --color: #eee; + --sheen-color: #ccc; + } + + sl-relative-time { + margin: 0 -3px; // Mitigate spacing from unknown cause. + } + + sl-relative-time.no-squeeze { + margin: 0 0; + } + + @media only screen and (max-width: 700px) { + h1 { + font-size: 24px; + } + h2 { + font-size: 20px; + } + h3 { + font-size: 15px; + } + + #subheader div:not(.search):not(.actionlinks):not(.tooltips) { + display: none; + } + + #subheader div.search { + text-align: center; + min-width: 0; + margin: 0; + } + #subheader div.search input { + width: auto; + } + } +`],LAYOUT_CSS=i$7` +.layout { + display: flex; +} +.layout.wrap { + flex-wrap: wrap; +} +.layout.center { + align-items: center; +} +.layout.center-center { + align-items: center; + justify-content: center; +} +.layout.vertical { + flex-direction: column; +}`;var __decorate$1a=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashAdminBlinkComponentListing=class extends i$4{constructor(){super(...arguments),this.editing=!1,this.component={},this.index=0,this.usersMap=new Map,this.componentId=0,this.name="",this.subscriberIds=[],this.ownerIds=[],this._client=window.csOpenApiClient}static get styles(){return[SHARED_STYLES,VARS,LAYOUT_CSS,i$7` + :host { + display: flex; + } + + :host([editing]) .owners_list_add_remove { + opacity: 1; + pointer-events: all; + } + + :host([editing]) .owners_list select[multiple] { + background-color: #fff; + border-color: rgba(0, 0, 0, 0); + } + + :host([editing]) .owners_list select[multiple] option { + padding-left: 4px; + } + + .component_name { + flex: 1 0 130px; + margin-right: var(--content-padding); + } + + .component_name h3 { + color: initial; + padding-top: 4px; + } + + .column_header { + margin-bottom: calc(var(--content-padding) / 2); + } + + .owners_list { + flex: 1 0 auto; + } + + .component_owner { + font-weight: 600; + } + + .owners_list_add_remove { + margin-left: calc(var(--content-padding) / 2); + opacity: 0; + transition: 200ms opacity cubic-bezier(0, 0, 0.2, 1); + pointer-events: none; + } + + .owners_list_add_remove button[disabled] { + pointer-events: none; + opacity: 0.5; + } + + .remove_owner_button { + color: darkred; + } + + select[multiple] { + min-width: 275px; + background-color: #eee; + border: none; + transition: 200ms background-color cubic-bezier(0, 0, 0.2, 1); + font-size: inherit; + } + + select[multiple]:disabled option { + color: initial; + padding: 4px 0; + } + `]}getOwnerListElement(){return this.shadowRoot?.querySelector(`#owner_list_${this.index}`)}_getOptionsElement(){return this._ownerCandidates}_findSelectedOptionElement(){return this._getOptionsElement().selectedOptions[0]}_isOwnerCheckboxChecked(){return this._isPrimaryCheckbox.checked}_isUserInOwnerList(userId){const ownersList=this.getOwnerListElement();return Array.from(ownersList.options).find(option=>parseInt(option.value)===userId)}_addUser(){const toggleAsOwner=this._isOwnerCheckboxChecked(),selectedCandidate=this._findSelectedOptionElement(),userId=parseInt(selectedCandidate.value);if(selectedCandidate.disabled)return void alert("Please select a user before trying to add");if(this._isUserInOwnerList(userId)&&!toggleAsOwner)return;let isError=!1;this._client.addUserToComponent({componentId:this.componentId,userId:userId,componentUsersRequest:{owner:toggleAsOwner}}).then(()=>{}).catch(()=>{isError=!0}).finally(()=>{this.dispatchEvent(new CustomEvent("adminAddComponentUser",{detail:{userId:userId,toggleAsOwner:toggleAsOwner,index:this.index,isError:isError},bubbles:!0,composed:!0}))})}_removeUser(){const toggleAsOwner=this._isOwnerCheckboxChecked(),selectedCandidate=this._findSelectedOptionElement(),userId=parseInt(selectedCandidate.value);if(selectedCandidate.disabled)return void alert("Please select a user before trying to remove");if(!this._isUserInOwnerList(userId))return;let isError=!1;this._client.removeUserFromComponent({componentId:this.componentId,userId:userId,componentUsersRequest:{owner:toggleAsOwner}}).then(()=>{}).catch(()=>{isError=!0}).finally(()=>{this.dispatchEvent(new CustomEvent("adminRemoveComponentUser",{detail:{userId:userId,toggleAsOwner:toggleAsOwner,index:this.index,isError:isError},bubbles:!0,composed:!0}))})}_printUserDetails(userId){return x$1`${this.usersMap.get(userId).name}: + ${this.usersMap.get(userId).email}`}render(){const userListTemplate=[];for(const user of this.usersMap.values())userListTemplate.push(x$1`<option + class="owner_name" + value="${user.id}" + data-email="${user.email}" + data-name="${user.name}" + > + ${user.name}: ${user.email} + </option>`);return x$1` + <div class="component_name"> + <div class="column_header">Component</div> + <h3>${this.name}</h3> + </div> + <div class="owners_list layout horizontal center"> + <div> + <div class="column_header">Receives email updates:</div> + <select + multiple + disabled + id="owner_list_${this.index}" + size="${this.subscriberIds.length}" + > + ${this.subscriberIds.map(subscriberId=>this.ownerIds.includes(subscriberId)?x$1`<option + class="owner_name component_owner" + value="${subscriberId}" + > + ${this._printUserDetails(subscriberId)} + </option>`:x$1`<option class="owner_name" value="${subscriberId}"> + ${this._printUserDetails(subscriberId)} + </option>`)}; + </select> + </div> + <div class="owners_list_add_remove"> + <div> + <select class="owner_candidates"> + <option selected disabled data-placeholder="true"> + Select owner to add/remove + </option> + ${userListTemplate}</select + ><br /> + <label + title="Toggles the user as an owner. If you click 'Remove' ans this is not checked, the user is removed from the component." + >Owner? <input type="checkbox" class="is_primary_checkbox" + /></label> + </div> + <button + @click="${this._addUser}" + class="add_owner_button" + data-component-name="${this.name}" + > + Add + </button> + <button + @click="${this._removeUser}" + class="remove_owner_button" + data-component-name="${this.name}" + > + Remove + </button> + </div> + </div> + `}};__decorate$1a([n$5({type:Boolean,reflect:!0})],ChromedashAdminBlinkComponentListing.prototype,"editing",void 0),__decorate$1a([n$5({type:Object})],ChromedashAdminBlinkComponentListing.prototype,"component",void 0),__decorate$1a([n$5({type:Number})],ChromedashAdminBlinkComponentListing.prototype,"index",void 0),__decorate$1a([n$5({type:Object})],ChromedashAdminBlinkComponentListing.prototype,"usersMap",void 0),__decorate$1a([n$5({type:Number})],ChromedashAdminBlinkComponentListing.prototype,"componentId",void 0),__decorate$1a([n$5({type:String})],ChromedashAdminBlinkComponentListing.prototype,"name",void 0),__decorate$1a([n$5({type:Array})],ChromedashAdminBlinkComponentListing.prototype,"subscriberIds",void 0),__decorate$1a([n$5({type:Array})],ChromedashAdminBlinkComponentListing.prototype,"ownerIds",void 0),__decorate$1a([e$6(".owner_candidates")],ChromedashAdminBlinkComponentListing.prototype,"_ownerCandidates",void 0),__decorate$1a([e$6(".is_primary_checkbox")],ChromedashAdminBlinkComponentListing.prototype,"_isPrimaryCheckbox",void 0),ChromedashAdminBlinkComponentListing=__decorate$1a([t$3("chromedash-admin-blink-component-listing")],ChromedashAdminBlinkComponentListing);const{entries,setPrototypeOf,isFrozen,getPrototypeOf,getOwnPropertyDescriptor}=Object;let{freeze,seal,create}=Object,{apply,construct}="undefined"!=typeof Reflect&&Reflect;freeze||(freeze=function(x){return x}),seal||(seal=function(x){return x}),apply||(apply=function(func,thisArg){for(var _len=arguments.length,args=Array(2<_len?_len-2:0),_key=2;_key<_len;_key++)args[_key-2]=arguments[_key];return func.apply(thisArg,args)}),construct||(construct=function(Func){for(var _len2=arguments.length,args=Array(1<_len2?_len2-1:0),_key2=1;_key2<_len2;_key2++)args[_key2-1]=arguments[_key2];return new Func(...args)});const arrayForEach=unapply(Array.prototype.forEach),arrayLastIndexOf=unapply(Array.prototype.lastIndexOf),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),arraySplice=unapply(Array.prototype.splice),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(func){return function(thisArg){thisArg instanceof RegExp&&(thisArg.lastIndex=0);for(var _len3=arguments.length,args=Array(1<_len3?_len3-1:0),_key3=1;_key3<_len3;_key3++)args[_key3-1]=arguments[_key3];return apply(func,thisArg,args)}}function unconstruct(Func){return function(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4<_len4;_key4++)args[_key4]=arguments[_key4];return construct(Func,args)}}function addToSet(set,array){let transformCaseFunc=2<arguments.length&&arguments[2]!==void 0?arguments[2]:stringToLowerCase;setPrototypeOf&&setPrototypeOf(set,null);for(let l=array.length;l--;){let element=array[l];if("string"==typeof element){const lcElement=transformCaseFunc(element);lcElement!==element&&(!isFrozen(array)&&(array[l]=lcElement),element=lcElement)}set[element]=!0}return set}function cleanArray(array){for(let index=0;index<array.length;index++){const isPropertyExist=objectHasOwnProperty(array,index);isPropertyExist||(array[index]=null)}return array}function clone(object){const newObject=create(null);for(const[property,value]of entries(object)){const isPropertyExist=objectHasOwnProperty(object,property);isPropertyExist&&(Array.isArray(value)?newObject[property]=cleanArray(value):value&&"object"==typeof value&&value.constructor===Object?newObject[property]=clone(value):newObject[property]=value)}return newObject}function lookupGetter(object,prop){for(;null!==object;){const desc=getOwnPropertyDescriptor(object,prop);if(desc){if(desc.get)return unapply(desc.get);if("function"==typeof desc.value)return unapply(desc.value)}object=getPrototypeOf(object)}return function(){return null}}const html$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\$\{[\w\W]*/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i);var EXPRESSIONS=Object.freeze({__proto__:null,ARIA_ATTR:ARIA_ATTR,ATTR_WHITESPACE:ATTR_WHITESPACE,CUSTOM_ELEMENT:CUSTOM_ELEMENT,DATA_ATTR:DATA_ATTR,DOCTYPE_NAME:DOCTYPE_NAME,ERB_EXPR:ERB_EXPR,IS_ALLOWED_URI:IS_ALLOWED_URI,IS_SCRIPT_OR_DATA:IS_SCRIPT_OR_DATA,MUSTACHE_EXPR:MUSTACHE_EXPR,TMPLIT_EXPR:TMPLIT_EXPR});const NODE_TYPE={element:1,text:3,progressingInstruction:7,comment:8,document:9},getGlobal=function(){return"undefined"==typeof window?null:window},_createTrustedTypesPolicy=function(trustedTypes,purifyHostElement){if("object"!=typeof trustedTypes||"function"!=typeof trustedTypes.createPolicy)return null;let suffix=null;purifyHostElement&&purifyHostElement.hasAttribute("data-tt-policy-suffix")&&(suffix=purifyHostElement.getAttribute("data-tt-policy-suffix"));const policyName="dompurify"+(suffix?"#"+suffix:"");try{return trustedTypes.createPolicy(policyName,{createHTML(html){return html},createScriptURL(scriptUrl){return scriptUrl}})}catch(_){return console.warn("TrustedTypes policy "+policyName+" could not be created."),null}},_createHooksMap=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function createDOMPurify(){function _executeHooks(hooks,currentNode,data){arrayForEach(hooks,hook=>{hook.call(DOMPurify,currentNode,data,CONFIG)})}let window=0<arguments.length&&void 0!==arguments[0]?arguments[0]:getGlobal();const DOMPurify=root=>createDOMPurify(root);if(DOMPurify.version="3.3.1",DOMPurify.removed=[],!window||!window.document||window.document.nodeType!==NODE_TYPE.document||!window.Element)return DOMPurify.isSupported=!1,DOMPurify;let{document}=window;const originalDocument=document,currentScript=originalDocument.currentScript,{DocumentFragment,HTMLTemplateElement,Node,Element,NodeFilter,NamedNodeMap=window.NamedNodeMap||window.MozNamedAttrMap,HTMLFormElement,DOMParser,trustedTypes}=window,ElementPrototype=Element.prototype,cloneNode=lookupGetter(ElementPrototype,"cloneNode"),remove=lookupGetter(ElementPrototype,"remove"),getNextSibling=lookupGetter(ElementPrototype,"nextSibling"),getChildNodes=lookupGetter(ElementPrototype,"childNodes"),getParentNode=lookupGetter(ElementPrototype,"parentNode");if("function"==typeof HTMLTemplateElement){const template=document.createElement("template");template.content&&template.content.ownerDocument&&(document=template.content.ownerDocument)}let emptyHTML="",trustedTypesPolicy;const{implementation,createNodeIterator,createDocumentFragment,getElementsByTagName}=document,{importNode}=originalDocument;let hooks=_createHooksMap();DOMPurify.isSupported="function"==typeof entries&&"function"==typeof getParentNode&&implementation&&void 0!==implementation.createHTMLDocument;const{MUSTACHE_EXPR,ERB_EXPR,TMPLIT_EXPR,DATA_ATTR,ARIA_ATTR,IS_SCRIPT_OR_DATA,ATTR_WHITESPACE,CUSTOM_ELEMENT}=EXPRESSIONS;let{IS_ALLOWED_URI:IS_ALLOWED_URI$1}=EXPRESSIONS,ALLOWED_TAGS=null;const DEFAULT_ALLOWED_TAGS=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text]);let ALLOWED_ATTR=null;const DEFAULT_ALLOWED_ATTR=addToSet({},[...html,...svg,...mathMl,...xml]);let CUSTOM_ELEMENT_HANDLING=Object.seal(create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),FORBID_TAGS=null,FORBID_ATTR=null;const EXTRA_ELEMENT_HANDLING=Object.seal(create(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ALLOW_ARIA_ATTR=!0,ALLOW_DATA_ATTR=!0,ALLOW_UNKNOWN_PROTOCOLS=!1,ALLOW_SELF_CLOSE_IN_ATTR=!0,SAFE_FOR_TEMPLATES=!1,SAFE_FOR_XML=!0,WHOLE_DOCUMENT=!1,SET_CONFIG=!1,FORCE_BODY=!1,RETURN_DOM=!1,RETURN_DOM_FRAGMENT=!1,RETURN_TRUSTED_TYPE=!1,SANITIZE_DOM=!0,SANITIZE_NAMED_PROPS=!1;let KEEP_CONTENT=!0,IN_PLACE=!1,USE_PROFILES={},FORBID_CONTENTS=null;const DEFAULT_FORBID_CONTENTS=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let DATA_URI_TAGS=null;const DEFAULT_DATA_URI_TAGS=addToSet({},["audio","video","img","source","image","track"]);let URI_SAFE_ATTRIBUTES=null;const DEFAULT_URI_SAFE_ATTRIBUTES=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),MATHML_NAMESPACE="http://www.w3.org/1998/Math/MathML",SVG_NAMESPACE="http://www.w3.org/2000/svg",HTML_NAMESPACE="http://www.w3.org/1999/xhtml";let NAMESPACE=HTML_NAMESPACE,IS_EMPTY_INPUT=!1,ALLOWED_NAMESPACES=null;const DEFAULT_ALLOWED_NAMESPACES=addToSet({},[MATHML_NAMESPACE,SVG_NAMESPACE,HTML_NAMESPACE],stringToString);let MATHML_TEXT_INTEGRATION_POINTS=addToSet({},["mi","mo","mn","ms","mtext"]),HTML_INTEGRATION_POINTS=addToSet({},["annotation-xml"]);const COMMON_SVG_AND_HTML_ELEMENTS=addToSet({},["title","style","font","a","script"]);let PARSER_MEDIA_TYPE=null;const SUPPORTED_PARSER_MEDIA_TYPES=["application/xhtml+xml","text/html"];let transformCaseFunc=null,CONFIG=null;const formElement=document.createElement("form"),isRegexOrFunction=function isRegexOrFunction(testValue){return testValue instanceof RegExp||testValue instanceof Function},_parseConfig=function _parseConfig(){let cfg=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(!(CONFIG&&CONFIG===cfg)){if(cfg&&"object"==typeof cfg||(cfg={}),cfg=clone(cfg),PARSER_MEDIA_TYPE=-1===SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE)?"text/html":cfg.PARSER_MEDIA_TYPE,transformCaseFunc="application/xhtml+xml"===PARSER_MEDIA_TYPE?stringToString:stringToLowerCase,ALLOWED_TAGS=objectHasOwnProperty(cfg,"ALLOWED_TAGS")?addToSet({},cfg.ALLOWED_TAGS,transformCaseFunc):DEFAULT_ALLOWED_TAGS,ALLOWED_ATTR=objectHasOwnProperty(cfg,"ALLOWED_ATTR")?addToSet({},cfg.ALLOWED_ATTR,transformCaseFunc):DEFAULT_ALLOWED_ATTR,ALLOWED_NAMESPACES=objectHasOwnProperty(cfg,"ALLOWED_NAMESPACES")?addToSet({},cfg.ALLOWED_NAMESPACES,stringToString):DEFAULT_ALLOWED_NAMESPACES,URI_SAFE_ATTRIBUTES=objectHasOwnProperty(cfg,"ADD_URI_SAFE_ATTR")?addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),cfg.ADD_URI_SAFE_ATTR,transformCaseFunc):DEFAULT_URI_SAFE_ATTRIBUTES,DATA_URI_TAGS=objectHasOwnProperty(cfg,"ADD_DATA_URI_TAGS")?addToSet(clone(DEFAULT_DATA_URI_TAGS),cfg.ADD_DATA_URI_TAGS,transformCaseFunc):DEFAULT_DATA_URI_TAGS,FORBID_CONTENTS=objectHasOwnProperty(cfg,"FORBID_CONTENTS")?addToSet({},cfg.FORBID_CONTENTS,transformCaseFunc):DEFAULT_FORBID_CONTENTS,FORBID_TAGS=objectHasOwnProperty(cfg,"FORBID_TAGS")?addToSet({},cfg.FORBID_TAGS,transformCaseFunc):clone({}),FORBID_ATTR=objectHasOwnProperty(cfg,"FORBID_ATTR")?addToSet({},cfg.FORBID_ATTR,transformCaseFunc):clone({}),USE_PROFILES=!!objectHasOwnProperty(cfg,"USE_PROFILES")&&cfg.USE_PROFILES,ALLOW_ARIA_ATTR=!1!==cfg.ALLOW_ARIA_ATTR,ALLOW_DATA_ATTR=!1!==cfg.ALLOW_DATA_ATTR,ALLOW_UNKNOWN_PROTOCOLS=cfg.ALLOW_UNKNOWN_PROTOCOLS||!1,ALLOW_SELF_CLOSE_IN_ATTR=!1!==cfg.ALLOW_SELF_CLOSE_IN_ATTR,SAFE_FOR_TEMPLATES=cfg.SAFE_FOR_TEMPLATES||!1,SAFE_FOR_XML=!1!==cfg.SAFE_FOR_XML,WHOLE_DOCUMENT=cfg.WHOLE_DOCUMENT||!1,RETURN_DOM=cfg.RETURN_DOM||!1,RETURN_DOM_FRAGMENT=cfg.RETURN_DOM_FRAGMENT||!1,RETURN_TRUSTED_TYPE=cfg.RETURN_TRUSTED_TYPE||!1,FORCE_BODY=cfg.FORCE_BODY||!1,SANITIZE_DOM=!1!==cfg.SANITIZE_DOM,SANITIZE_NAMED_PROPS=cfg.SANITIZE_NAMED_PROPS||!1,KEEP_CONTENT=!1!==cfg.KEEP_CONTENT,IN_PLACE=cfg.IN_PLACE||!1,IS_ALLOWED_URI$1=cfg.ALLOWED_URI_REGEXP||IS_ALLOWED_URI,NAMESPACE=cfg.NAMESPACE||HTML_NAMESPACE,MATHML_TEXT_INTEGRATION_POINTS=cfg.MATHML_TEXT_INTEGRATION_POINTS||MATHML_TEXT_INTEGRATION_POINTS,HTML_INTEGRATION_POINTS=cfg.HTML_INTEGRATION_POINTS||HTML_INTEGRATION_POINTS,CUSTOM_ELEMENT_HANDLING=cfg.CUSTOM_ELEMENT_HANDLING||{},cfg.CUSTOM_ELEMENT_HANDLING&&isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(CUSTOM_ELEMENT_HANDLING.tagNameCheck=cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck),cfg.CUSTOM_ELEMENT_HANDLING&&isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(CUSTOM_ELEMENT_HANDLING.attributeNameCheck=cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),cfg.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),SAFE_FOR_TEMPLATES&&(ALLOW_DATA_ATTR=!1),RETURN_DOM_FRAGMENT&&(RETURN_DOM=!0),USE_PROFILES&&(ALLOWED_TAGS=addToSet({},text),ALLOWED_ATTR=[],!0===USE_PROFILES.html&&(addToSet(ALLOWED_TAGS,html$1),addToSet(ALLOWED_ATTR,html)),!0===USE_PROFILES.svg&&(addToSet(ALLOWED_TAGS,svg$1),addToSet(ALLOWED_ATTR,svg),addToSet(ALLOWED_ATTR,xml)),!0===USE_PROFILES.svgFilters&&(addToSet(ALLOWED_TAGS,svgFilters),addToSet(ALLOWED_ATTR,svg),addToSet(ALLOWED_ATTR,xml)),!0===USE_PROFILES.mathMl&&(addToSet(ALLOWED_TAGS,mathMl$1),addToSet(ALLOWED_ATTR,mathMl),addToSet(ALLOWED_ATTR,xml))),cfg.ADD_TAGS&&("function"==typeof cfg.ADD_TAGS?EXTRA_ELEMENT_HANDLING.tagCheck=cfg.ADD_TAGS:(ALLOWED_TAGS===DEFAULT_ALLOWED_TAGS&&(ALLOWED_TAGS=clone(ALLOWED_TAGS)),addToSet(ALLOWED_TAGS,cfg.ADD_TAGS,transformCaseFunc))),cfg.ADD_ATTR&&("function"==typeof cfg.ADD_ATTR?EXTRA_ELEMENT_HANDLING.attributeCheck=cfg.ADD_ATTR:(ALLOWED_ATTR===DEFAULT_ALLOWED_ATTR&&(ALLOWED_ATTR=clone(ALLOWED_ATTR)),addToSet(ALLOWED_ATTR,cfg.ADD_ATTR,transformCaseFunc))),cfg.ADD_URI_SAFE_ATTR&&addToSet(URI_SAFE_ATTRIBUTES,cfg.ADD_URI_SAFE_ATTR,transformCaseFunc),cfg.FORBID_CONTENTS&&(FORBID_CONTENTS===DEFAULT_FORBID_CONTENTS&&(FORBID_CONTENTS=clone(FORBID_CONTENTS)),addToSet(FORBID_CONTENTS,cfg.FORBID_CONTENTS,transformCaseFunc)),cfg.ADD_FORBID_CONTENTS&&(FORBID_CONTENTS===DEFAULT_FORBID_CONTENTS&&(FORBID_CONTENTS=clone(FORBID_CONTENTS)),addToSet(FORBID_CONTENTS,cfg.ADD_FORBID_CONTENTS,transformCaseFunc)),KEEP_CONTENT&&(ALLOWED_TAGS["#text"]=!0),WHOLE_DOCUMENT&&addToSet(ALLOWED_TAGS,["html","head","body"]),ALLOWED_TAGS.table&&(addToSet(ALLOWED_TAGS,["tbody"]),delete FORBID_TAGS.tbody),cfg.TRUSTED_TYPES_POLICY){if("function"!=typeof cfg.TRUSTED_TYPES_POLICY.createHTML)throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");if("function"!=typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL)throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");trustedTypesPolicy=cfg.TRUSTED_TYPES_POLICY,emptyHTML=trustedTypesPolicy.createHTML("")}else void 0===trustedTypesPolicy&&(trustedTypesPolicy=_createTrustedTypesPolicy(trustedTypes,currentScript)),null!==trustedTypesPolicy&&"string"==typeof emptyHTML&&(emptyHTML=trustedTypesPolicy.createHTML(""));freeze&&freeze(cfg),CONFIG=cfg}},ALL_SVG_TAGS=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]),ALL_MATHML_TAGS=addToSet({},[...mathMl$1,...mathMlDisallowed]),_checkValidNamespace=function _checkValidNamespace(element){let parent=getParentNode(element);parent&&parent.tagName||(parent={namespaceURI:NAMESPACE,tagName:"template"});const tagName=stringToLowerCase(element.tagName),parentTagName=stringToLowerCase(parent.tagName);return!!ALLOWED_NAMESPACES[element.namespaceURI]&&(element.namespaceURI===SVG_NAMESPACE?parent.namespaceURI===HTML_NAMESPACE?"svg"===tagName:parent.namespaceURI===MATHML_NAMESPACE?"svg"===tagName&&("annotation-xml"===parentTagName||MATHML_TEXT_INTEGRATION_POINTS[parentTagName]):!!ALL_SVG_TAGS[tagName]:element.namespaceURI===MATHML_NAMESPACE?parent.namespaceURI===HTML_NAMESPACE?"math"===tagName:parent.namespaceURI===SVG_NAMESPACE?"math"===tagName&&HTML_INTEGRATION_POINTS[parentTagName]:!!ALL_MATHML_TAGS[tagName]:element.namespaceURI===HTML_NAMESPACE?!!(parent.namespaceURI!==SVG_NAMESPACE||HTML_INTEGRATION_POINTS[parentTagName])&&!!(parent.namespaceURI!==MATHML_NAMESPACE||MATHML_TEXT_INTEGRATION_POINTS[parentTagName])&&!ALL_MATHML_TAGS[tagName]&&(COMMON_SVG_AND_HTML_ELEMENTS[tagName]||!ALL_SVG_TAGS[tagName]):!!("application/xhtml+xml"===PARSER_MEDIA_TYPE&&ALLOWED_NAMESPACES[element.namespaceURI]))},_forceRemove=function _forceRemove(node){arrayPush(DOMPurify.removed,{element:node});try{getParentNode(node).removeChild(node)}catch(_){remove(node)}},_removeAttribute=function _removeAttribute(name,element){try{arrayPush(DOMPurify.removed,{attribute:element.getAttributeNode(name),from:element})}catch(_){arrayPush(DOMPurify.removed,{attribute:null,from:element})}if(element.removeAttribute(name),"is"===name)if(RETURN_DOM||RETURN_DOM_FRAGMENT)try{_forceRemove(element)}catch(_){}else try{element.setAttribute(name,"")}catch(_){}},_initDocument=function _initDocument(dirty){let doc=null,leadingWhitespace=null;if(FORCE_BODY)dirty="<remove></remove>"+dirty;else{const matches=stringMatch(dirty,/^[\r\n\t ]+/);leadingWhitespace=matches&&matches[0]}"application/xhtml+xml"===PARSER_MEDIA_TYPE&&NAMESPACE===HTML_NAMESPACE&&(dirty="<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>"+dirty+"</body></html>");const dirtyPayload=trustedTypesPolicy?trustedTypesPolicy.createHTML(dirty):dirty;if(NAMESPACE===HTML_NAMESPACE)try{doc=new DOMParser().parseFromString(dirtyPayload,PARSER_MEDIA_TYPE)}catch(_){}if(!doc||!doc.documentElement){doc=implementation.createDocument(NAMESPACE,"template",null);try{doc.documentElement.innerHTML=IS_EMPTY_INPUT?emptyHTML:dirtyPayload}catch(_){}}const body=doc.body||doc.documentElement;return dirty&&leadingWhitespace&&body.insertBefore(document.createTextNode(leadingWhitespace),body.childNodes[0]||null),NAMESPACE===HTML_NAMESPACE?getElementsByTagName.call(doc,WHOLE_DOCUMENT?"html":"body")[0]:WHOLE_DOCUMENT?doc.documentElement:body},_createNodeIterator=function _createNodeIterator(root){return createNodeIterator.call(root.ownerDocument||root,root,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_PROCESSING_INSTRUCTION|NodeFilter.SHOW_CDATA_SECTION,null)},_isClobbered=function _isClobbered(element){return element instanceof HTMLFormElement&&("string"!=typeof element.nodeName||"string"!=typeof element.textContent||"function"!=typeof element.removeChild||!(element.attributes instanceof NamedNodeMap)||"function"!=typeof element.removeAttribute||"function"!=typeof element.setAttribute||"string"!=typeof element.namespaceURI||"function"!=typeof element.insertBefore||"function"!=typeof element.hasChildNodes)},_isNode=function _isNode(value){return"function"==typeof Node&&value instanceof Node},_sanitizeElements=function _sanitizeElements(currentNode){let content=null;if(_executeHooks(hooks.beforeSanitizeElements,currentNode,null),_isClobbered(currentNode))return _forceRemove(currentNode),!0;const tagName=transformCaseFunc(currentNode.nodeName);if(_executeHooks(hooks.uponSanitizeElement,currentNode,{tagName,allowedTags:ALLOWED_TAGS}),SAFE_FOR_XML&¤tNode.hasChildNodes()&&!_isNode(currentNode.firstElementChild)&®ExpTest(/<[/\w!]/g,currentNode.innerHTML)&®ExpTest(/<[/\w!]/g,currentNode.textContent))return _forceRemove(currentNode),!0;if(currentNode.nodeType===NODE_TYPE.progressingInstruction)return _forceRemove(currentNode),!0;if(SAFE_FOR_XML&¤tNode.nodeType===NODE_TYPE.comment&®ExpTest(/<[/\w]/g,currentNode.data))return _forceRemove(currentNode),!0;if(!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function&&EXTRA_ELEMENT_HANDLING.tagCheck(tagName))&&(!ALLOWED_TAGS[tagName]||FORBID_TAGS[tagName])){if(!FORBID_TAGS[tagName]&&_isBasicCustomElement(tagName)){if(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp&®ExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck,tagName))return!1;if(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName))return!1}if(KEEP_CONTENT&&!FORBID_CONTENTS[tagName]){const parentNode=getParentNode(currentNode)||currentNode.parentNode,childNodes=getChildNodes(currentNode)||currentNode.childNodes;if(childNodes&&parentNode){const childCount=childNodes.length;for(let i=childCount-1;0<=i;--i){const childClone=cloneNode(childNodes[i],!0);childClone.__removalCount=(currentNode.__removalCount||0)+1,parentNode.insertBefore(childClone,getNextSibling(currentNode))}}}return _forceRemove(currentNode),!0}return currentNode instanceof Element&&!_checkValidNamespace(currentNode)?(_forceRemove(currentNode),!0):("noscript"===tagName||"noembed"===tagName||"noframes"===tagName)&®ExpTest(/<\/no(script|embed|frames)/i,currentNode.innerHTML)?(_forceRemove(currentNode),!0):(SAFE_FOR_TEMPLATES&¤tNode.nodeType===NODE_TYPE.text&&(content=currentNode.textContent,arrayForEach([MUSTACHE_EXPR,ERB_EXPR,TMPLIT_EXPR],expr=>{content=stringReplace(content,expr," ")}),currentNode.textContent!==content&&(arrayPush(DOMPurify.removed,{element:currentNode.cloneNode()}),currentNode.textContent=content)),_executeHooks(hooks.afterSanitizeElements,currentNode,null),!1)},_isValidAttribute=function _isValidAttribute(lcTag,lcName,value){if(SANITIZE_DOM&&("id"===lcName||"name"===lcName)&&(value in document||value in formElement))return!1;if(ALLOW_DATA_ATTR&&!FORBID_ATTR[lcName]&®ExpTest(DATA_ATTR,lcName));else if(ALLOW_ARIA_ATTR&®ExpTest(ARIA_ATTR,lcName));else if(EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function&&EXTRA_ELEMENT_HANDLING.attributeCheck(lcName,lcTag));else if(!ALLOWED_ATTR[lcName]||FORBID_ATTR[lcName]){if(_isBasicCustomElement(lcTag)&&(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp&®ExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck,lcTag)||CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))&&(CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp&®ExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck,lcName)||CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName,lcTag))||"is"===lcName&&CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp&®ExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck,value)||CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)));else return!1;}else if(URI_SAFE_ATTRIBUTES[lcName]);else if(regExpTest(IS_ALLOWED_URI$1,stringReplace(value,ATTR_WHITESPACE,"")));else if(("src"===lcName||"xlink:href"===lcName||"href"===lcName)&&"script"!==lcTag&&0===stringIndexOf(value,"data:")&&DATA_URI_TAGS[lcTag]);else if(ALLOW_UNKNOWN_PROTOCOLS&&!regExpTest(IS_SCRIPT_OR_DATA,stringReplace(value,ATTR_WHITESPACE,"")));else if(value)return!1;return!0},_isBasicCustomElement=function _isBasicCustomElement(tagName){return"annotation-xml"!==tagName&&stringMatch(tagName,CUSTOM_ELEMENT)},_sanitizeAttributes=function _sanitizeAttributes(currentNode){_executeHooks(hooks.beforeSanitizeAttributes,currentNode,null);const{attributes}=currentNode;if(attributes&&!_isClobbered(currentNode)){const hookEvent={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ALLOWED_ATTR,forceKeepAttr:void 0};for(let l=attributes.length;l--;){const attr=attributes[l],{name,namespaceURI,value:attrValue}=attr,lcName=transformCaseFunc(name),initValue=attrValue;let value="value"===name?initValue:stringTrim(initValue);if(hookEvent.attrName=lcName,hookEvent.attrValue=value,hookEvent.keepAttr=!0,hookEvent.forceKeepAttr=void 0,_executeHooks(hooks.uponSanitizeAttribute,currentNode,hookEvent),value=hookEvent.attrValue,SANITIZE_NAMED_PROPS&&("id"===lcName||"name"===lcName)&&(_removeAttribute(name,currentNode),value="user-content-"+value),SAFE_FOR_XML&®ExpTest(/((--!?|])>)|<\/(style|title|textarea)/i,value)){_removeAttribute(name,currentNode);continue}if("attributename"===lcName&&stringMatch(value,"href")){_removeAttribute(name,currentNode);continue}if(hookEvent.forceKeepAttr)continue;if(!hookEvent.keepAttr){_removeAttribute(name,currentNode);continue}if(!ALLOW_SELF_CLOSE_IN_ATTR&®ExpTest(/\/>/i,value)){_removeAttribute(name,currentNode);continue}SAFE_FOR_TEMPLATES&&arrayForEach([MUSTACHE_EXPR,ERB_EXPR,TMPLIT_EXPR],expr=>{value=stringReplace(value,expr," ")});const lcTag=transformCaseFunc(currentNode.nodeName);if(!_isValidAttribute(lcTag,lcName,value)){_removeAttribute(name,currentNode);continue}if(trustedTypesPolicy&&"object"==typeof trustedTypes&&"function"==typeof trustedTypes.getAttributeType)if(namespaceURI);else switch(trustedTypes.getAttributeType(lcTag,lcName)){case"TrustedHTML":{value=trustedTypesPolicy.createHTML(value);break}case"TrustedScriptURL":{value=trustedTypesPolicy.createScriptURL(value);break}}if(value!==initValue)try{namespaceURI?currentNode.setAttributeNS(namespaceURI,name,value):currentNode.setAttribute(name,value),_isClobbered(currentNode)?_forceRemove(currentNode):arrayPop(DOMPurify.removed)}catch(_){_removeAttribute(name,currentNode)}}_executeHooks(hooks.afterSanitizeAttributes,currentNode,null)}},_sanitizeShadowDOM=function _sanitizeShadowDOM(fragment){let shadowNode=null;const shadowIterator=_createNodeIterator(fragment);for(_executeHooks(hooks.beforeSanitizeShadowDOM,fragment,null);shadowNode=shadowIterator.nextNode();)_executeHooks(hooks.uponSanitizeShadowNode,shadowNode,null),_sanitizeElements(shadowNode),_sanitizeAttributes(shadowNode),shadowNode.content instanceof DocumentFragment&&_sanitizeShadowDOM(shadowNode.content);_executeHooks(hooks.afterSanitizeShadowDOM,fragment,null)};return DOMPurify.sanitize=function(dirty){let cfg=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},body=null,importedNode=null,currentNode=null,returnNode=null;if(IS_EMPTY_INPUT=!dirty,IS_EMPTY_INPUT&&(dirty="<!-->"),"string"!=typeof dirty&&!_isNode(dirty))if("function"!=typeof dirty.toString)throw typeErrorCreate("toString is not a function");else if(dirty=dirty.toString(),"string"!=typeof dirty)throw typeErrorCreate("dirty is not a string, aborting");if(!DOMPurify.isSupported)return dirty;if(SET_CONFIG||_parseConfig(cfg),DOMPurify.removed=[],"string"==typeof dirty&&(IN_PLACE=!1),IN_PLACE){if(dirty.nodeName){const tagName=transformCaseFunc(dirty.nodeName);if(!ALLOWED_TAGS[tagName]||FORBID_TAGS[tagName])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(dirty instanceof Node)body=_initDocument("<!---->"),importedNode=body.ownerDocument.importNode(dirty,!0),importedNode.nodeType===NODE_TYPE.element&&"BODY"===importedNode.nodeName?body=importedNode:"HTML"===importedNode.nodeName?body=importedNode:body.appendChild(importedNode);else{if(!RETURN_DOM&&!SAFE_FOR_TEMPLATES&&!WHOLE_DOCUMENT&&-1===dirty.indexOf("<"))return trustedTypesPolicy&&RETURN_TRUSTED_TYPE?trustedTypesPolicy.createHTML(dirty):dirty;if(body=_initDocument(dirty),!body)return RETURN_DOM?null:RETURN_TRUSTED_TYPE?emptyHTML:""}body&&FORCE_BODY&&_forceRemove(body.firstChild);for(const nodeIterator=_createNodeIterator(IN_PLACE?dirty:body);currentNode=nodeIterator.nextNode();)_sanitizeElements(currentNode),_sanitizeAttributes(currentNode),currentNode.content instanceof DocumentFragment&&_sanitizeShadowDOM(currentNode.content);if(IN_PLACE)return dirty;if(RETURN_DOM){if(RETURN_DOM_FRAGMENT)for(returnNode=createDocumentFragment.call(body.ownerDocument);body.firstChild;)returnNode.appendChild(body.firstChild);else returnNode=body;return(ALLOWED_ATTR.shadowroot||ALLOWED_ATTR.shadowrootmode)&&(returnNode=importNode.call(originalDocument,returnNode,!0)),returnNode}let serializedHTML=WHOLE_DOCUMENT?body.outerHTML:body.innerHTML;return WHOLE_DOCUMENT&&ALLOWED_TAGS["!doctype"]&&body.ownerDocument&&body.ownerDocument.doctype&&body.ownerDocument.doctype.name&®ExpTest(DOCTYPE_NAME,body.ownerDocument.doctype.name)&&(serializedHTML="<!DOCTYPE "+body.ownerDocument.doctype.name+">\n"+serializedHTML),SAFE_FOR_TEMPLATES&&arrayForEach([MUSTACHE_EXPR,ERB_EXPR,TMPLIT_EXPR],expr=>{serializedHTML=stringReplace(serializedHTML,expr," ")}),trustedTypesPolicy&&RETURN_TRUSTED_TYPE?trustedTypesPolicy.createHTML(serializedHTML):serializedHTML},DOMPurify.setConfig=function(){let cfg=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};_parseConfig(cfg),SET_CONFIG=!0},DOMPurify.clearConfig=function(){CONFIG=null,SET_CONFIG=!1},DOMPurify.isValidAttribute=function(tag,attr,value){CONFIG||_parseConfig({});const lcTag=transformCaseFunc(tag),lcName=transformCaseFunc(attr);return _isValidAttribute(lcTag,lcName,value)},DOMPurify.addHook=function(entryPoint,hookFunction){"function"!=typeof hookFunction||arrayPush(hooks[entryPoint],hookFunction)},DOMPurify.removeHook=function(entryPoint,hookFunction){if(void 0!==hookFunction){const index=arrayLastIndexOf(hooks[entryPoint],hookFunction);return-1===index?void 0:arraySplice(hooks[entryPoint],index,1)[0]}return arrayPop(hooks[entryPoint])},DOMPurify.removeHooks=function(entryPoint){hooks[entryPoint]=[]},DOMPurify.removeAllHooks=function(){hooks=_createHooksMap()},DOMPurify}var purify=createDOMPurify();function L(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T=L();function Z(u){T=u}var C={exec:()=>null};function k(u,e=""){let t="string"==typeof u?u:u.source,n={replace:(r,i)=>{let s="string"==typeof i?i:i.source;return s=s.replace(m.caret,"$1"),t=t.replace(r,s),n},getRegex:()=>new RegExp(t,e)};return n}var me=(()=>{try{return!!/(?<=1)(?<!1)/}catch{return!1}})(),m={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:u=>new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}#`),htmlBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}<(?:[a-z].*>|!--)`,"i")},xe=/^(?:[ \t]*(?:\n|$))+/,be=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Re=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,I=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Te=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,N=/(?:[*+-]|\d{1,9}[.)])/,re=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,se=k(re).replace(/bull/g,N).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Oe=k(re).replace(/bull/g,N).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Q=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,we=/^[^\n]+/,F=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ye=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",F).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pe=k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,N).getRegex(),v="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",j=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Se=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",j).replace("tag","address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul").replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ie=k(Q).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag","address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul").getRegex(),$e=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ie).getRegex(),U={blockquote:$e,code:be,def:ye,fences:Re,heading:Te,hr:I,html:Se,lheading:se,list:Pe,newline:xe,paragraph:ie,table:C,text:we},te=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag","address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul").getRegex(),_e={...U,lheading:Oe,table:te,paragraph:k(Q).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",te).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag","address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul").getRegex()},Le={...U,html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",j).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:C,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(Q).replace("hr",I).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",se).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Me=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ze=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,oe=/^( {2,}|\\)\n(?!\s*$)/,Ae=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,D=/[\p{P}\p{S}]/u,K=/[\s\p{P}\p{S}]/u,ae=/[^\s\p{P}\p{S}]/u,Ce=k(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,K).getRegex(),le=/(?!~)[\p{P}\p{S}]/u,Ie=/(?!~)[\s\p{P}\p{S}]/u,Ee=/(?:[^\s\p{P}\p{S}]|~)/u,Be=k(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",me?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ue=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qe=k(ue,"u").replace(/punct/g,D).getRegex(),ve=k(ue,"u").replace(/punct/g,le).getRegex(),pe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",De=k("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,K).replace(/punct/g,D).getRegex(),He=k("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Ee).replace(/punctSpace/g,Ie).replace(/punct/g,le).getRegex(),Ze=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,K).replace(/punct/g,D).getRegex(),Ge=k(/\\(punct)/,"gu").replace(/punct/g,D).getRegex(),Ne=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Qe=k(j).replace("(?:-->|$)","-->").getRegex(),Fe=k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Qe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,je=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ce=k(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",F).getRegex(),he=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",F).getRegex(),Ue=k("reflink|nolink(?!\\()","g").replace("reflink",ce).replace("nolink",he).getRegex(),ne=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,W={_backpedal:C,anyPunctuation:Ge,autolink:Ne,blockSkip:Be,br:oe,code:ze,del:C,emStrongLDelim:qe,emStrongRDelimAst:De,emStrongRDelimUnd:Ze,escape:Me,link:je,nolink:he,punctuation:Ce,reflink:ce,reflinkSearch:Ue,tag:Fe,text:Ae,url:C},Ke={...W,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()},G$1={...W,emStrongRDelimAst:He,emStrongLDelim:ve,url:k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ne).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ne).getRegex()},We={...G$1,br:k(oe).replace("{2,}","*").getRegex(),text:k(G$1.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},E={normal:U,gfm:_e,pedantic:Le},M={normal:W,gfm:G$1,breaks:We,pedantic:Ke},Xe={"&":"&","<":"<",">":">",'"':""","'":"'"},ke=u=>Xe[u];function w(u,e){if(e){if(m.escapeTest.test(u))return u.replace(m.escapeReplace,ke);}else if(m.escapeTestNoEncode.test(u))return u.replace(m.escapeReplaceNoEncode,ke);return u}function X(u){try{u=encodeURI(u).replace(m.percentDecode,"%")}catch{return null}return u}function J(u,e){let t=u.replace(m.findPipe,(i,s,a)=>{let o=!1,l=s;for(;0<=--l&&"\\"===a[l];)o=!o;return o?"|":" |"}),n=t.split(m.splitPipe),r=0;if(n[0].trim()||n.shift(),0<n.length&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(m.slashPipe,"|");return n}function z(u,e,t){let n=u.length;if(0===n)return"";let r=0;for(;r<n;){let i=u.charAt(n-r-1);if(i===e&&!0)r++;else break}return u.slice(0,n-r)}function de(u,e){if(-1===u.indexOf(e[1]))return-1;let t=0;for(let n=0;n<u.length;n++)if("\\"===u[n])n++;else if(u[n]===e[0])t++;else if(u[n]===e[1]&&(t--,0>t))return n;return 0<t?-2:-1}function ge(u,e,t,n,r){let i=e.href,s=e.title||null,a=u[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let o={type:"!"===u[0].charAt(0)?"image":"link",raw:t,href:i,title:s,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,o}function Je(u,e,t){let n=u.match(t.other.indentCodeCompensation);if(null===n)return e;let r=n[1];return e.split(` +`).map(i=>{let s=i.match(t.other.beginningSpace);if(null===s)return i;let[a]=s;return a.length>=r.length?i.slice(r.length):i}).join(` +`)}var y=class{options;rules;lexer;constructor(e){this.options=e||T}space(e){let t=this.rules.block.newline.exec(e);if(t&&0<t[0].length)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:z(n,` +`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Je(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=z(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:z(t[0],` +`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=z(t[0],` +`).split(` +`),r="",i="",s=[];for(;0<n.length;){let a=!1,o=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))o.push(n[l]),a=!0;else if(!a)o.push(n[l]);else break;n=n.slice(l);let p=o.join(` +`),c=p.replace(this.rules.other.blockquoteSetextReplace,` + $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r} +${p}`:p,i=i?`${i} +${c}`:c;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,s,!0),this.lexer.state.top=g,0===n.length)break;let h=s.at(-1);if("code"===h?.type)break;if("blockquote"===h?.type){let R=h,f=R.raw+` +`+n.join(` +`),O=this.blockquote(f);s[s.length-1]=O,r=r.substring(0,r.length-R.raw.length)+O.raw,i=i.substring(0,i.length-R.text.length)+O.text;break}else if("list"===h?.type){let R=h,f=R.raw+` +`+n.join(` +`),O=this.list(f);s[s.length-1]=O,r=r.substring(0,r.length-h.raw.length)+O.raw,i=i.substring(0,i.length-R.raw.length)+O.raw,n=f.substring(s.at(-1).raw.length).split(` +`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=1<n.length,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");for(let s=this.rules.other.listItemRegex(n),a=!1;e;){let l=!1,p="",c="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let g=t[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,O=>" ".repeat(3*O.length)),h=e.split(` +`,1)[0],R=!g.trim(),f=0;if(this.options.pedantic?(f=2,c=g.trimStart()):R?f=t[1].length+1:(f=t[2].search(this.rules.other.nonSpaceChar),f=4<f?1:f,c=g.slice(f),f+=t[1].length),R&&this.rules.other.blankLine.test(h)&&(p+=h+` +`,e=e.substring(h.length+1),l=!0),!l)for(let O=this.rules.other.nextBulletRegex(f),V=this.rules.other.hrRegex(f),Y=this.rules.other.fencesBeginRegex(f),ee=this.rules.other.headingBeginRegex(f),fe=this.rules.other.htmlBeginRegex(f);e;){let H=e.split(` +`,1)[0],A;if(h=H,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),A=h):A=h.replace(this.rules.other.tabCharGlobal," "),Y.test(h)||ee.test(h)||fe.test(h)||O.test(h)||V.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=f||!h.trim())c+=` +`+A.slice(f);else{if(R||4<=g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)||Y.test(g)||ee.test(g)||V.test(g))break;c+=` +`+h}R||h.trim()||(R=!0),p+=H+` +`,e=e.substring(H.length+1),g=A.slice(f)}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0)),i.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),i.raw+=p}let o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),"text"===l.tokens[0]?.type||"paragraph"===l.tokens[0]?.type){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;0<=c;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let c={type:"checkbox",raw:p[0]+" ",checked:"[ ]"!==p[0]};l.checked=c.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!i.loose){let p=l.tokens.filter(g=>"space"===g.type),c=0<p.length&&p.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=c}}if(i.loose)for(let l of i.items){l.loose=!0;for(let p of l.tokens)"text"===p.type&&(p.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=J(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(` +`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(J(a,s.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[l]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=` +`===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=z(n.slice(0,-1),"\\");if(0==(n.length-s.length)%2)return}else{let s=de(t[2],"()");if(-2===s)return;if(-1<s){let o=(0===t[0].indexOf("!")?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),ge(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return ge(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){var _Mathmin=Math.min;let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,l=s,p=0,c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,a,o;for(c.lastIndex=0,t=t.slice(-1*e.length+s);null!=(r=c.exec(t));){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){p+=o;continue}if(l-=o,0<l)continue;o=_Mathmin(o,o+l+p);let g=[...r[0]][0].length,h=e.slice(0,s+r.index+g+o);if(_Mathmin(s,o)%2){let f=h.slice(1,-1);return{type:"em",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}let R=h.slice(2,-2);return{type:"strong",raw:h,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return"@"===t[2]?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if("@"===t[2])n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},x=class u{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new y,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:m,block:E.normal,inline:M.normal};this.options.pedantic?(t.block=E.pedantic,t.inline=M.pedantic):this.options.gfm&&(t.block=E.gfm,t.inline=this.options.breaks?M.breaks:M.gfm),this.tokenizer.rules=t}static get rules(){return{block:E,inline:M}}static lex(e,t){return new u(t).lex(e)}static lexInline(e,t){return new u(t).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let t=0,n;t<this.inlineQueue.length;t++)n=this.inlineQueue[t],this.inlineTokens(n.src,n.tokens);return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(m.tabCharGlobal," ").replace(m.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(s=>!!(r=s.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let s=t.at(-1);1===r.raw.length&&void 0!==s?s.raw+=` +`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let s=t.at(-1);"paragraph"===s?.type||"text"===s?.type?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let s=t.at(-1);"paragraph"===s?.type||"text"===s?.type?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let s=1/0,a=e.slice(1),o;this.options.extensions.startBlock.forEach(l=>{o=l.call({lexer:this},a),"number"==typeof o&&0<=o&&(s=Math.min(s,o))}),s<1/0&&0<=s&&(i=e.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let s=t.at(-1);"text"===s?.type?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(e){let s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(0<o.length)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(let i;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;for(let s=!1,a="";e;){s||(a=""),s=!1;let o;if(this.options.extensions?.inline?.some(p=>!!(o=p.call({lexer:this},e,t))&&(e=e.substring(o.raw.length),t.push(o),!0)))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let p=t.at(-1);"text"===o.type&&"text"===p?.type?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,a)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let l=e;if(this.options.extensions?.startInline){let p=1/0,c=e.slice(1),g;this.options.extensions.startInline.forEach(h=>{g=h.call({lexer:this},c),"number"==typeof g&&0<=g&&(p=Math.min(p,g))}),p<1/0&&0<=p&&(l=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(l)){e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(a=o.raw.slice(-1)),s=!0;let p=t.at(-1);"text"===p?.type?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}},P=class{options;parser;constructor(e){this.options=e||T}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(m.notSpaceStart)?.[0],i=e.replace(m.endingNewline,"")+` +`;return r?"<pre><code class=\"language-"+w(r)+"\">"+(n?i:w(i,!0))+`</code></pre> +`:"<pre><code>"+(n?i:w(i,!0))+`</code></pre> +`}blockquote({tokens:e}){return`<blockquote> +${this.parser.parse(e)}</blockquote> +`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}> +`}hr(e){return`<hr> +`}list(e){let t=e.ordered,n=e.start,r="";for(let a=0,o;a<e.items.length;a++)o=e.items[a],r+=this.listitem(o);let i=t?"ol":"ul",s=t&&1!==n?" start=\""+n+"\"":"";return"<"+i+s+`> +`+r+"</"+i+`> +`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li> +`}checkbox({checked:e}){return"<input "+(e?"checked=\"\" ":"")+"disabled=\"\" type=\"checkbox\"> "}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p> +`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0,s;i<e.rows.length;i++){s=e.rows[i],n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table> +<thead> +`+t+`</thead> +`+r+`</table> +`}tablerow({text:e}){return`<tr> +${e}</tr> +`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}> +`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${w(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=X(e);if(null===i)return r;e=i;let s="<a href=\""+e+"\"";return t&&(s+=" title=\""+w(t)+"\""),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=X(e);if(null===i)return w(n);e=i;let s=`<img src="${e}" alt="${n}"`;return t&&(s+=` title="${w(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:w(e.text)}},$=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},b=class u{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $}static parse(e,t){return new u(t).parse(e)}static parseInline(e,t){return new u(t).parseInline(e)}parse(e){let t="";for(let n=0,r;n<e.length;n++){if(r=e[n],this.options.extensions?.renderers?.[r.type]){let s=r,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==a||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){t+=a||"";continue}}let i=r;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let s="Token with \""+i.type+"\" type was not found.";if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return t}parseInline(e,t=this.renderer){let n="";for(let r=0,i;r<e.length;r++){if(i=e[r],this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let s=i;switch(s.type){case"escape":{n+=t.text(s);break}case"html":{n+=t.html(s);break}case"link":{n+=t.link(s);break}case"image":{n+=t.image(s);break}case"checkbox":{n+=t.checkbox(s);break}case"strong":{n+=t.strong(s);break}case"em":{n+=t.em(s);break}case"codespan":{n+=t.codespan(s);break}case"br":{n+=t.br(s);break}case"del":{n+=t.del(s);break}case"text":{n+=t.text(s);break}default:{let a="Token with \""+s.type+"\" type was not found.";if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},S=class{options;block;constructor(e){this.options=e||T}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?x.lex:x.lexInline}provideParser(){return this.block?b.parse:b.parseInline}},B=class{defaults=L();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=b;Renderer=P;TextRenderer=$;Lexer=x;Tokenizer=y;Hooks=S;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{let i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];t.renderers[i.name]=s?function(...a){let o=i.renderer.apply(this,a);return!1===o&&(o=s.apply(this,a)),o}:i.renderer}if("tokenizer"in i){if(!i.level||"block"!==i.level&&"inline"!==i.level)throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&("block"===i.level?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:"inline"===i.level&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new P(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return!1===c&&(c=l.apply(i,p)),c||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new y(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return!1===c&&(c=l.apply(i,p)),c}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new S;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];i[a]=S.passThroughHooks.has(s)?p=>{if(this.defaults.async&&S.passThroughHooksRespectAsync.has(s))return(async()=>{let g=await o.call(i,p);return l.call(i,g)})();let c=o.call(i,p);return l.call(i,c)}:(...p)=>{if(this.defaults.async)return(async()=>{let g=await o.apply(i,p);return!1===g&&(g=await l.apply(i,p)),g})();let c=o.apply(i,p);return!1===c&&(c=l.apply(i,p)),c}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===i.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if("u"<typeof n||null===n)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(n):n,p=await(s.hooks?await s.hooks.provideLexer():e?x.lex:x.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(p):p;s.walkTokens&&(await Promise.all(this.walkTokens(c,s.walkTokens)));let h=await(s.hooks?await s.hooks.provideParser():e?b.parse:b.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=(s.hooks?s.hooks.provideLexer():e?x.lex:x.lexInline)(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=(s.hooks?s.hooks.provideParser():e?b.parse:b.parseInline)(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+w(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},_=new B;function d(u,e){return _.parse(u,e)}d.options=d.setOptions=function(u){return _.setOptions(u),d.defaults=_.defaults,Z(d.defaults),d},d.getDefaults=L,d.defaults=T,d.use=function(...u){return _.use(...u),d.defaults=_.defaults,Z(d.defaults),d},d.walkTokens=function(u,e){return _.walkTokens(u,e)},d.parseInline=_.parseInline,d.Parser=b,d.parser=b.parse,d.Renderer=P,d.TextRenderer=$,d.Lexer=x,d.lexer=x.lex,d.Tokenizer=y,d.Hooks=S,d.parse=d,d.options,d.setOptions,d.use,d.walkTokens,d.parseInline,b.parse,x.lex;class ExternalReviewer{static get(repo){return"mozilla/standards-positions"===repo?new ExternalReviewer("https://avatars.githubusercontent.com/u/131524?s=48&v=4",{"position: defer":{description:"Defer",variant:"neutral"},"position: negative":{description:"Negative",variant:"danger"},"position: neutral":{description:"Neutral",variant:"neutral"},"position: positive":{description:"Positive",variant:"success"},"position: under consideration":{description:"Under Consideration",variant:"neutral"}}):"WebKit/standards-positions"===repo?new ExternalReviewer("https://avatars.githubusercontent.com/u/6458?s=48&v=4",{"position: oppose":{description:"Oppose",variant:"danger"},"position: neutral":{description:"Neutral",variant:"neutral"},"position: support":{description:"Support",variant:"success"}}):"w3ctag/design-reviews"===repo?new ExternalReviewer("https://avatars.githubusercontent.com/u/3874462?s=48&v=4",{"Resolution: ambivalent":{description:"Ambivalent",variant:"neutral"},"Resolution: decline":{description:"Decline",variant:"neutral"},"Resolution: lack of consensus":{description:"Lack of Consensus",variant:"neutral"},"Resolution: object":{description:"Object",variant:"danger"},"Resolution: out of scope":{description:"Out of Scope",variant:"neutral"},"Resolution: overtaken":{description:"Overtaken",variant:"warning"},"Resolution: satisfied with concerns":{description:"Satisfied with Concerns",variant:"warning"},"Resolution: satisfied":{description:"Satisfied",variant:"success"},"Resolution: timed out":{description:"Timed Out",variant:"warning"},"Resolution: too early":{description:"Too Early",variant:"warning"},"Resolution: unsatisfied":{description:"Unsatisfied",variant:"danger"},"Resolution: validated":{description:"Early Review Validated",variant:"warning"},"Resolution: withdrawn":{description:"Withdrawn",variant:"warning"}}):void 0}label(name){return this._labels[name]}constructor(icon,labels){this.icon=icon,this._labels=labels}}var __decorate$19=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const LINK_TYPE_CHROMIUM_BUG="chromium_bug",LINK_TYPE_GITHUB_ISSUE="github_issue",LINK_TYPE_GITHUB_PULL_REQUEST="github_pull_request",LINK_TYPE_GITHUB_MARKDOWN="github_markdown",LINK_TYPE_MDN_DOCS="mdn_docs",LINK_TYPE_GOOGLE_DOCS="google_docs",LINK_TYPE_MOZILLA_BUG="mozilla_bug",LINK_TYPE_WEBKIT_BUG="webkit_bug",LINK_TYPE_SPECS="specs";function _formatLongText(text,maxLength=50){return text.length>maxLength?text.substring(0,35)+"..."+text.substring(text.length-15,text.length):text}const _dateTimeFormat=new Intl.DateTimeFormat("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"});function enhanceChromeStatusLink(featureLink,text){function _formatTimestamp(timestamp){return _dateTimeFormat.format(new Date(1e3*timestamp))}function renderTooltipContent(){return x$1`<div class="tooltip"> + ${summary&&x$1` + <div> + <strong>Summary:</strong> + <span>${summary}</span> + </div> + `} + ${openedTimestamp&&x$1` + <div> + <strong>Opened:</strong> + <span>${_formatTimestamp(openedTimestamp)}</span> + </div> + `} + ${closedTimestamp&&x$1` + <div> + <strong>Closed:</strong> + <span>${_formatTimestamp(closedTimestamp)}</span> + </div> + `} + ${reporterRef&&x$1` + <div> + <strong>Reporter:</strong> + <span>${reporterRef.displayName}</span> + </div> + `} + ${ownerRef&&x$1` + <div> + <strong>Owner:</strong> + <span>${ownerRef.displayName}</span> + </div> + `} + </div>`}const information=featureLink.information,summary=information.summary,statusRef=information.statusRef,reporterRef=information.reporterRef,ownerRef=information.ownerRef,openedTimestamp=information.openedTimestamp,closedTimestamp=information.closedTimestamp;return text||(text=summary),x$1`<a + href="${featureLink.url}" + target="_blank" + rel="noopener noreferrer" + > + <sl-tooltip style="--sl-tooltip-arrow-size: 0;--max-width: 50vw;"> + <div slot="content">${renderTooltipContent()}</div> + <sl-tag> + <img + src="https://bugs.chromium.org/static/images/monorail.ico" + alt="icon" + class="icon" + /> + <sl-badge + size="small" + variant="${statusRef.meansOpen?"success":"neutral"}" + >${statusRef.status}</sl-badge + > + ${_formatLongText(text)} + </sl-tag> + </sl-tooltip> + </a>`}function enhanceGithubIssueLink(featureLink,text){function _formatISOTime(dateString){return _dateTimeFormat.format(new Date(dateString))}function renderTooltipContent(){return x$1`<div class="tooltip"> + ${title&&x$1` + <div> + <strong>Title:</strong> + <span>${title}</span> + </div> + `} + ${repo&&x$1` + <div> + <strong>Repo:</strong> + <span>${repo}</span> + </div> + `} + ${type&&x$1` + <div> + <strong>Type:</strong> + <span>${type}</span> + </div> + `} + ${createdAt&&x$1` + <div> + <strong>Opened:</strong> + <span>${_formatISOTime(createdAt)}</span> + </div> + `} + ${updatedAt&&x$1` + <div> + <strong>Updated:</strong> + <span>${_formatISOTime(updatedAt)}</span> + </div> + `} + ${closedAt&&x$1` + <div> + <strong>Closed:</strong> + <span>${_formatISOTime(closedAt)}</span> + </div> + `} + ${assignee&&x$1` + <div> + <strong>Assignee:</strong> + <span>${assignee}</span> + </div> + `} + ${owner&&x$1` + <div> + <strong>Owner:</strong> + <span>${owner}</span> + </div> + `} + </div>`}const information=featureLink.information,assignee=information.assignee_login,createdAt=new Date(information.created_at),closedAt=information.closed_at,updatedAt=information.updated_at,state=information.state,title=information.title,owner=information.user_login,number=information.number,repo=information.url.split("/").slice(4,6).join("/"),typePath=featureLink.url.split("/").slice(-2)[0],type="issues"===typePath?"Issue":"pull"===typePath?"Pull Request":typePath,externalReviewer=ExternalReviewer.get(repo);let stateDescription=x$1``,stateVariant;if(externalReviewer)for(const label of information.labels){const labelInfo=externalReviewer.label(label);if(labelInfo){({description:stateDescription,variant:stateVariant}=labelInfo);break}}if(void 0===stateVariant)if("open"===state){const age=Date.now()-createdAt.getTime();stateDescription=x$1`Opened + <sl-relative-time date=${createdAt.toISOString()} + >on ${_dateTimeFormat.format(createdAt)}</sl-relative-time + >`;const week=604800000;stateVariant="success",externalReviewer&&(2419200000>age?stateVariant="warning":stateVariant="neutral")}else console.assert("closed"===state),stateDescription="Closed",stateVariant="neutral";return text||(text=title),x$1`<a + href="${featureLink.url}" + target="_blank" + rel="noopener noreferrer" + > + <sl-tooltip style="--sl-tooltip-arrow-size: 0;--max-width: 50vw;"> + <div slot="content">${renderTooltipContent()}</div> + <sl-tag> + <img + src=${externalReviewer?.icon??"https://docs.github.com/assets/cb-600/images/site/favicon.png"} + alt="icon" + class="icon" + /> + <sl-badge size="small" variant=${stateVariant} + >${stateDescription}</sl-badge + > + ${_formatLongText(`#${number} `+text)} + </sl-tag> + </sl-tooltip> + </a>`}function enhanceGithubMarkdownLink(featureLink,text){function renderTooltipContent(){return x$1`<div class="tooltip"> + ${title&&x$1` + <div> + <strong>Title:</strong> + <span>${title}</span> + </div> + `} + ${path&&x$1` + <div> + <strong>File:</strong> + <span>${path}</span> + </div> + `} + ${size&&x$1` + <div> + <strong>Size:</strong> + <span>${readableSize}</span> + </div> + `} + </div>`}const information=featureLink.information,path=information.path,title=information._parsed_title,size=information.size,readableSize=(size/1024).toFixed(2)+" KB";return text||(text=title),x$1`<a + href="${featureLink.url}" + target="_blank" + rel="noopener noreferrer" + > + <sl-tooltip style="--sl-tooltip-arrow-size: 0;--max-width: 50vw;"> + <div slot="content">${renderTooltipContent()}</div> + <sl-tag> + <img + src="https://docs.github.com/assets/cb-600/images/site/favicon.png" + alt="icon" + class="icon" + /> + ${_formatLongText("Markdown: "+text)} + </sl-tag> + </sl-tooltip> + </a>`}function _enhanceLinkWithTitleAndDescription(featureLink,iconUrl){function renderTooltipContent(){return x$1`<div class="tooltip"> + ${title&&x$1` + <div> + <strong>Title:</strong> + <span>${title}</span> + </div> + `} + ${description&&x$1` + <div> + <strong>Description:</strong> + <span>${description}</span> + </div> + `} + </div>`}const information=featureLink.information,title=information.title,description=information.description;return x$1`<a + href="${featureLink.url}" + target="_blank" + rel="noopener noreferrer" + > + <sl-tooltip style="--sl-tooltip-arrow-size: 0;--max-width: 50vw;"> + <div slot="content">${renderTooltipContent()}</div> + <sl-tag> + <img src="${iconUrl}" alt="icon" class="icon" /> + ${_formatLongText(title)} + </sl-tag> + </sl-tooltip> + </a>`}function enhanceSpecsLink(featureLink){function renderTooltipContent(){return x$1`<div class="tooltip"> + ${title&&x$1` + <div> + <strong>Title:</strong> + <span>${title}</span> + </div> + `} + ${description&&x$1` + <div> + <strong>Description:</strong> + <span>${description}</span> + </div> + `} + ${hashtag&&x$1` + <div> + <strong>Hashtag:</strong> + <span>#${hashtag}</span> + </div> + `} + </div>`}const url=featureLink.url,iconUrl=`https://www.google.com/s2/favicons?domain_url=${url}`,hashtag=url.split("#")[1],information=featureLink.information,title=information.title,description=information.description;return x$1`<a + href="${featureLink.url}" + target="_blank" + rel="noopener noreferrer" + > + <sl-tooltip style="--sl-tooltip-arrow-size: 0;--max-width: 50vw;"> + <div slot="content">${renderTooltipContent()}</div> + <sl-tag> + <img src="${iconUrl}" alt="icon" class="icon" /> + Spec: ${_formatLongText(title)} + </sl-tag> + </sl-tooltip> + </a>`}function enhanceMDNDocsLink(featureLink){return _enhanceLinkWithTitleAndDescription(featureLink,"https://developer.mozilla.org/favicon-48x48.png")}function enhanceMozillaBugLink(featureLink){return _enhanceLinkWithTitleAndDescription(featureLink,"https://bugzilla.mozilla.org/favicon.ico")}function enhanceWebKitBugLink(featureLink){return _enhanceLinkWithTitleAndDescription(featureLink,"https://bugs.webkit.org/images/favicon.ico")}function enhanceGoogleDocsLink(featureLink){const url=featureLink.url,type=url.split("/")[3];let iconUrl="https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico";return"spreadsheets"===type?iconUrl="https://ssl.gstatic.com/docs/spreadsheets/favicon3.ico":"presentation"===type?iconUrl="https://ssl.gstatic.com/docs/presentations/images/favicon5.ico":"forms"===type&&(iconUrl="https://ssl.gstatic.com/docs/spreadsheets/forms/favicon_qp2.png"),_enhanceLinkWithTitleAndDescription(featureLink,iconUrl)}let ChromedashLink=class ChromedashLink extends i$4{constructor(){super(...arguments),this.showContentAsLabel=!1,this.class="",this.featureLinks=[],this.ignoreHttpErrorCodes=[],this.alwaysInTag=!1}static{this.styles=[...SHARED_STYLES,i$7` + :host { + display: inline; + white-space: normal; + line-break: anywhere; + color: var(--default-font-color); + } + + a:hover { + text-decoration: none; + } + + sl-badge::part(base) { + display: inline; + padding: 0 4px; + border-width: 0; + text-transform: capitalize; + font-weight: 400; + } + + sl-tag::part(base) { + vertical-align: middle; + height: 18px; + background-color: rgb(232, 234, 237); + color: var(--default-font-color); + border: none; + border-radius: 500px; + display: inline-flex; + align-items: center; + column-gap: 0.3em; + padding: 1px 5px; + margin: 1px 0; + } + + sl-tag::part(base):hover { + background-color: rgb(209, 211, 213); + } + + sl-relative-time { + margin: 0; + } + + .icon { + display: block; + width: 12px; + height: 12px; + } + + .tooltip { + display: flex; + flex-direction: column; + row-gap: 0.5em; + } + `]}willUpdate(changedProperties){(changedProperties.has("href")||changedProperties.has("featureLinks"))&&(this._featureLink=this.featureLinks.find(fe=>fe.url===this.href))}fallback(){const slot=x$1`<slot>${this.href}</slot>`;return x$1`<a + href=${o$6(this.href)} + target="_blank" + rel="noopener noreferrer" + class=${this.class} + >${this.alwaysInTag?x$1`<sl-tag>${slot}</sl-tag>`:slot}</a + >`}withLabel(link){return this.showContentAsLabel?x$1`<slot></slot>: ${link}`:link}render(){if(!this.href)return console.error("Missing [href] attribute in",this),x$1`<slot></slot>`;const featureLink=this._featureLink;if(!featureLink)return this.fallback();if(!featureLink.information)return featureLink.http_error_code&&!this.ignoreHttpErrorCodes.includes(featureLink.http_error_code)?x$1`<sl-tag> + <sl-icon library="material" name="link"></sl-icon> + <sl-badge + size="small" + variant="${500<=featureLink.http_error_code?"danger":"warning"}" + > + ${featureLink.http_error_code} + </sl-badge> + ${this.fallback()} + </sl-tag>`:this.fallback();try{switch(featureLink.type){case LINK_TYPE_CHROMIUM_BUG:return this.withLabel(enhanceChromeStatusLink(featureLink));case LINK_TYPE_GITHUB_ISSUE:return this.withLabel(enhanceGithubIssueLink(featureLink));case LINK_TYPE_GITHUB_PULL_REQUEST:return this.withLabel(enhanceGithubIssueLink(featureLink));case LINK_TYPE_GITHUB_MARKDOWN:return this.withLabel(enhanceGithubMarkdownLink(featureLink));case LINK_TYPE_MDN_DOCS:return this.withLabel(enhanceMDNDocsLink(featureLink));case LINK_TYPE_GOOGLE_DOCS:return this.withLabel(enhanceGoogleDocsLink(featureLink));case LINK_TYPE_MOZILLA_BUG:return this.withLabel(enhanceMozillaBugLink(featureLink));case LINK_TYPE_WEBKIT_BUG:return this.withLabel(enhanceWebKitBugLink(featureLink));case LINK_TYPE_SPECS:return this.withLabel(enhanceSpecsLink(featureLink));default:return this.fallback()}}catch(e){return console.log("feature link render error:",this,e),this.fallback()}}};__decorate$19([n$5({type:String})],ChromedashLink.prototype,"href",void 0),__decorate$19([n$5({type:Boolean})],ChromedashLink.prototype,"showContentAsLabel",void 0),__decorate$19([n$5({type:String})],ChromedashLink.prototype,"class",void 0),__decorate$19([n$5({type:Array})],ChromedashLink.prototype,"featureLinks",void 0),__decorate$19([n$5({type:Array})],ChromedashLink.prototype,"ignoreHttpErrorCodes",void 0),__decorate$19([n$5({type:Boolean})],ChromedashLink.prototype,"alwaysInTag",void 0),__decorate$19([r$6()],ChromedashLink.prototype,"_featureLink",void 0),ChromedashLink=__decorate$19([t$3("chromedash-link")],ChromedashLink);function enhanceUrl(url,featureLinks=[],text){return x$1`<chromedash-link href=${url} .featureLinks=${featureLinks} + >${url}</chromedash-link + >`}function enhanceAutolink(part,featureLinks){return x$1`<chromedash-link href=${part.href} .featureLinks=${featureLinks} .ignoreHttpErrorCodes=${[404]}>${part.content}</chromedash-link>`}const CRBUG_DEFAULT_PROJECT="chromium",CRBUG_URL="https://bugs.chromium.org",ISSUE_TRACKER_RE=/(\b(issues?|bugs?)[ \t]*(:|=|\b)|\bfixed[ \t]*:)([ \t]*((\b[-a-z0-9]+)[:\#])?(\#?)(\d+)\b(,?[ \t]*(and|or)?)?)+/gi,PROJECT_LOCALID_RE=/((\b(issue|bug)[ \t]*(:|=)?[ \t]*|\bfixed[ \t]*:[ \t]*)?((\b[-a-z0-9]+)[:\#])?(\#?)(\d+))/gi,PROJECT_COMMENT_BUG_RE=/(((\b(issue|bug)[ \t]*(:|=)?[ \t]*)(\#?)(\d+)[ \t*])?((\b((comment)[ \t]*(:|=)?[ \t]*(\#?))|(\B((\#))(c)))(\d+)))/gi,PROJECT_LOCALID_RE_PROJECT_GROUP=6,PROJECT_LOCALID_RE_ID_GROUP=8,SHORT_LINK_RE=/(^|[^-\/._])\b(https?:\/\/|ftp:\/\/|mailto:)?(go|g|shortn|who|teams)\/([^\s<]+)/gi,NUMERIC_SHORT_LINK_RE=/(^|[^-\/._])\b(https?:\/\/|ftp:\/\/)?(b|t|o|omg|cl|cr|fxr|fxrev|fxb|tqr)\/([0-9]+)/gi,IMPLIED_LINK_RE=/(?!@)(^|[^-\/._])\b[a-z]((-|\.)?[a-z0-9])+\.(com|net|org|edu|dev)\b(\/[^\s<]*)?/gi,IS_LINK_RE=/()\b(https?:\/\/|ftp:\/\/|mailto:)([^\s<]+)/gi,LINK_TRAILING_CHARS=[[null,":"],[null,"."],[null,","],[null,">"],["(",")"],["[","]"],["{","}"],["'","'"],["\"","\""]],GOOG_SHORT_LINK_RE=/^(b|t|o|omg|cl|cr|go|g|shortn|who|teams|fxr|fxrev|fxb|tqr)\/.*/gi,Components=new Map;Components.set("00-commentbug",{refRegs:[PROJECT_COMMENT_BUG_RE],replacer:replaceCommentBugRef}),Components.set("02-full-urls",{refRegs:[IS_LINK_RE],replacer:replaceLinkRef}),Components.set("04-tracker-regular",{refRegs:[ISSUE_TRACKER_RE],replacer:replaceTrackerIssueRef}),Components.set("05-linkify-shorthand",{refRegs:[SHORT_LINK_RE,NUMERIC_SHORT_LINK_RE,IMPLIED_LINK_RE],replacer:replaceLinkRef});function replaceIssueRef(stringMatch,projectName,localId,commentId){return createIssueRefRun(projectName,localId,stringMatch,commentId)}function replaceTrackerIssueRef(match,currentProjectName=CRBUG_DEFAULT_PROJECT){const issueRefRE=PROJECT_LOCALID_RE,commentId="",textRuns=[];let pos=0,refMatch;for(;null!==(refMatch=issueRefRE.exec(match[0]));)refMatch.index>pos&&textRuns.push({content:match[0].slice(pos,refMatch.index)}),refMatch[PROJECT_LOCALID_RE_PROJECT_GROUP]&&(currentProjectName=refMatch[PROJECT_LOCALID_RE_PROJECT_GROUP]),textRuns.push(replaceIssueRef(refMatch[0],currentProjectName,refMatch[PROJECT_LOCALID_RE_ID_GROUP],commentId)),pos=refMatch.index+refMatch[0].length;return""!==match[0].slice(pos)&&textRuns.push({content:match[0].slice(pos)}),textRuns}function replaceCommentBugRef(match){let textRun;const issueNum=match[7],commentNum=match[18];if(issueNum&&commentNum){const href=`${CRBUG_URL}/p/${CRBUG_DEFAULT_PROJECT}/issues/detail?id=${issueNum}#c${commentNum}`;textRun={content:match[0],tag:"a",href}}else if(commentNum){const href=`${CRBUG_URL}/p/${CRBUG_DEFAULT_PROJECT}/issues/detail#c${commentNum}`;textRun={content:match[0],tag:"a",href}}else textRun={content:match[0]};return[textRun]}function replaceLinkRef(match){const textRuns=[];let content=match[0],trailing="";match[1]&&(textRuns.push({content:match[1]}),content=content.slice(match[1].length)),LINK_TRAILING_CHARS.forEach(([begin,end])=>{!content.endsWith(end)||begin&&content.slice(0,-end.length).includes(begin)||(trailing=end+trailing,content=content.slice(0,-end.length))});let href=content;const lowerHref=href.toLowerCase();return lowerHref.startsWith("http")||lowerHref.startsWith("ftp")||lowerHref.startsWith("mailto")||(href=GOOG_SHORT_LINK_RE.test(lowerHref)?"http://"+href:"https://"+href,GOOG_SHORT_LINK_RE.lastIndex=0),textRuns.push({content:content,tag:"a",href:href}),trailing.length&&textRuns.push({content:trailing}),textRuns}function createIssueRefRun(projectName,localId,content,commentId){return{tag:"a",content:content,href:`${CRBUG_URL}/p/${projectName}/issues/detail?id=${localId}${commentId}`}}function markupAutolinks(plainString,featureLinks=[]){plainString=plainString||"";const chunks=[plainString.trim()],textRuns=[];chunks.filter(Boolean).forEach(chunk=>{textRuns.push(...autolinkChunk(chunk))});const result=textRuns.map(part=>"a"===part.tag?enhanceAutolink(part,featureLinks):x$1`${part.content}`);return result}function autolinkChunk(chunk){let textRuns=[{content:chunk}];return Components.forEach(({refRegs,replacer})=>{refRegs.forEach(re=>{textRuns=applyLinks(textRuns,replacer,re)})}),textRuns}function applyLinks(textRuns,replacer,re){const resultRuns=[];return textRuns.forEach(textRun=>{if(textRun.tag)resultRuns.push(textRun);else{const content=textRun.content;let pos=0,match;for(;null!==(match=re.exec(content));)match.index>pos&&resultRuns.push({content:content.slice(pos,match.index)}),resultRuns.push(...replacer(match)),pos=match.index+match[0].length;""!==content.slice(pos)&&resultRuns.push({content:content.slice(pos)})}}),resultRuns}const FEATURE_CATEGORIES={WEBCOMPONENTS:[1,"Web Components"],MISC:[2,"Miscellaneous"],SECURITY:[3,"Security"],MULTIMEDIA:[4,"Multimedia"],DOM:[5,"DOM"],FILE:[6,"File APIs"],OFFLINE:[7,"Offline / Storage"],DEVICE:[8,"Device"],COMMUNICATION:[9,"Realtime / Communication"],JAVASCRIPT:[10,"JavaScript"],NETWORKING:[11,"Network / Connectivity"],INPUT:[12,"User input"],PERFORMANCE:[13,"Performance"],GRAPHICS:[14,"Graphics"],CSS:[15,"CSS"],HOUDINI:[16,"Houdini"],SERVICEWORKER:[17,"Service Worker"],WEBRTC:[18,"WebRTC"],LAYERED:[19,"Layered APIs"],WEBASSEMBLY:[20,"WebAssembly"],CAPABILITIES:[21,"Capabilities (Fugu)"],IWA:[22,"Isolated Web Apps-specific API"]},ENTERPRISE_FEATURE_CATEGORIES={SECURITYANDPRIVACY:[1,"Security / Privacy"],USERPRODUCTIVITYANDAPPS:[2,"User Productivity / Apps"],MANAGEMENT:[3,"Management"]},ENTERPRISE_FEATURE_CATEGORIES_DISPLAYNAME={1:"Security/Privacy",2:"User Productivity/Apps",3:"Management"},PLATFORM_CATEGORIES={PLATFORM_ANDROID:[1,"Android"],PLATFORM_IOS:[2,"iOS"],PLATFORM_CHROMEOS:[3,"ChromeOS"],PLATFORM_LACROS:[4,"LaCrOS",!0],PLATFORM_LINUX:[5,"Linux"],PLATFORM_MAC:[6,"MacOS"],PLATFORM_WINDOWS:[7,"Windows"],PLATFORM_FUCHSIA:[8,"Fuchsia"]},PLATFORMS_DISPLAYNAME={1:"Android",2:"iOS",3:"ChromeOS",4:"LaCrOS",5:"Linux",6:"MacOS",7:"Windows",8:"Fuchsia"},ROLLOUT_STAGE_PLAN_CATEGORIES={ROLLOUT_STAGE_PLAN_SLOW:[0,"Feature rolls out gradually"],ROLLOUT_STAGE_PLAN_TRUSTED_TESTERS:[1,"Early preview available to Chrome Enterprise Truster Testers"],ROLLOUT_STAGE_PLAN_CUSTOM:[2,"Custom rollout (explain in Rollout details field)"]},ROLLOUT_STAGE_PLAN_DISPLAYNAME={0:"Feature rolls out gradually",1:"Early preview available to Chrome Enterprise Truster Testers",2:"Custom rollout (explain in Rollout details field)"},ENTERPRISE_IMPACT_DISPLAYNAME={1:"None",2:"Low",3:"Medium",4:"High"},ENTERPRISE_IMPACT={IMPACT_NONE:[1,"None"],IMPACT_LOW:[2,"Low"],IMPACT_MEDIUM:[3,"Medium"],IMPACT_HIGH:[4,"High"]},ROLLOUT_PLAN={ROLLOUT_100:[0,"Will ship enabled for all users"],ROLLOUT_0_THEN_100:[1,"(RARE) Ships disabled, then flips on for all users"],ROLLOUT_GRADUAL:[2,"(RARE) Experiment users ramp up over time"],ROLLOUT_OTHER:[3,"(RARE) It's complicated or unusual"]},ROLLOUT_PLAN_DISPLAYNAME={0:ROLLOUT_PLAN.ROLLOUT_100[1],1:ROLLOUT_PLAN.ROLLOUT_0_THEN_100[1],2:ROLLOUT_PLAN.ROLLOUT_GRADUAL[1],3:ROLLOUT_PLAN.ROLLOUT_OTHER[1]},USE_COUNTER_TYPE_WEBFEATURE=0,USE_COUNTER_TYPE_WEBDXFEATURE=1,USE_COUNTER_TYPE_CSS_PROPERTY_ID=2,WEBFEATURE_USE_COUNTER_TYPES={WEBFEATURE:[USE_COUNTER_TYPE_WEBFEATURE,"WebFeature",x$1`The feature's use counter has been added to + <a + target="_blank" + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom" + >web_feature.mojom</a + >.`],WEBDXFEATURE:[USE_COUNTER_TYPE_WEBDXFEATURE,"WebDXFeature",x$1`The feature's use counter has been added to + <a + target="_blank" + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom" + >webdx_feature.mojom</a + >.`],CSS:[USE_COUNTER_TYPE_CSS_PROPERTY_ID,"CSSSampleID",x$1`The feature's use counter has been added to + <a + target="_blank" + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom" + >css_property_id.mojom</a + >.`]};var FeatureType;(function(FeatureType){FeatureType[FeatureType.Incubate=0]="Incubate",FeatureType[FeatureType.Existing=1]="Existing",FeatureType[FeatureType.CodeChange=2]="CodeChange",FeatureType[FeatureType.Deprecation=3]="Deprecation",FeatureType[FeatureType.Enterprise=4]="Enterprise"})(FeatureType||(FeatureType={}));var AITestEvaluationStatus;(function(AITestEvaluationStatus){AITestEvaluationStatus[AITestEvaluationStatus.COMPLETE=1]="COMPLETE",AITestEvaluationStatus[AITestEvaluationStatus.IN_PROGRESS=2]="IN_PROGRESS",AITestEvaluationStatus[AITestEvaluationStatus.FAILED=3]="FAILED"})(AITestEvaluationStatus||(AITestEvaluationStatus={}));const FEATURE_TYPES_WITHOUT_ENTERPRISE={FEATURE_TYPE_INCUBATE_ID:[0,"New or changed feature",x$1`Choose this if you're still working on the design of a feature and + might need to send an Intent to Prototype or request a TAG review. Note + that backward-incompatible changes sometimes need to be implemented as a + pair of adding the new behavior and a separate entry to remove the old + behavior. This feature type follows the + <a + href="https://www.chromium.org/blink/launching-features/#new-feature-process" + target="_blank" + >New Feature Incubation</a + > + process.`],FEATURE_TYPE_EXISTING_ID:[1,"Chromium catches up",x$1`Choose this if a standards body already has consensus for a feature, or + it's already shipped in another implementation. This feature type omits + some options that the "New feature" type includes. It follows the + <a + href="https://www.chromium.org/blink/launching-features/#process-existing-standard" + target="_blank" + >Implementations of already-defined consensus-based standards</a + > + process.`],FEATURE_TYPE_CODE_CHANGE_ID:[2,"No developer-visible change",x$1`Choose this if you're hoping that nobody notices the change you're + going to make, but there's a chance that a bug will make it visible. This + feature type follows the + <a + href="https://www.chromium.org/blink/launching-features/#behavior-changes" + target="_blank" + >Web-developer-facing change to existing behavior</a + > + process.`],FEATURE_TYPE_DEPRECATION_ID:[3,"Feature removal",x$1`Choose this if you are deprecating and then removing an existing + feature. This feature type follows the + <a + href="https://www.chromium.org/blink/launching-features/#feature-deprecations" + target="_blank" + >Feature deprecations</a + > + process.`]},FEATURE_TYPES={...FEATURE_TYPES_WITHOUT_ENTERPRISE,FEATURE_TYPE_ENTERPRISE_ID:[4,"New Feature or removal affecting enterprises","For features or changes that need to be communicated to enterprises or schools."]},ENTERPRISE_PRODUCT_CATEGORY={CHROME_BROWSER_UPDATE:[0,"Chrome Browser update","New features, performance improvements, security fixes and minor updates addressing security vulnerabilities and bugs. These features apply to both consumers and enterprises."],CHROME_ENTERPRISE_CORE:[1,"Chrome Enterprise Core (CEC)","These features allow IT administrators to manage Chrome browser settings, policies, apps and extensions across an organization from a central location (Admin Console)."],CHROME_ENTERPRISE_PREMIUM:[2,"Chrome Enterprise Premium (CEP, paid SKU)","These features add advanced security and enhanced controls for organizations with more custom needs e.g. data masking functionality."]},ENTERPRISE_PRODUCT_CATEGORY_DISPLAYNAME={0:"Chrome Browser update",1:"Chrome Enterprise Core (CEC)",2:"Chrome Enterprise Premium (CEP, paid SKU)"},STAGE_BLINK_INCUBATE=110,STAGE_BLINK_PROTOTYPE=120,STAGE_BLINK_DEV_TRIAL=130,STAGE_BLINK_EVAL_READINESS=140,STAGE_BLINK_ORIGIN_TRIAL=150,STAGE_BLINK_EXTEND_ORIGIN_TRIAL=151,STAGE_BLINK_SHIPPING=160,STAGE_FAST_PROTOTYPE=220,STAGE_FAST_DEV_TRIAL=230,STAGE_FAST_ORIGIN_TRIAL=250,STAGE_FAST_EXTEND_ORIGIN_TRIAL=251,STAGE_FAST_SHIPPING=260,STAGE_PSA_IMPLEMENT_FIELDS=320,STAGE_PSA_DEV_TRIAL=330,STAGE_PSA_SHIPPING=360,STAGE_DEP_PLAN=410,STAGE_DEP_DEV_TRIAL=430,STAGE_DEP_DEPRECATION_TRIAL=450,STAGE_DEP_EXTEND_DEPRECATION_TRIAL=451,STAGE_DEP_SHIPPING=460,STAGE_ENT_ROLLOUT=1061,STAGE_ENT_SHIPPED=1070,STAGE_TYPES_DEV_TRIAL=new Set([STAGE_BLINK_DEV_TRIAL,STAGE_FAST_DEV_TRIAL,STAGE_PSA_DEV_TRIAL,STAGE_DEP_DEV_TRIAL]),STAGE_TYPES_ORIGIN_TRIAL=new Set([STAGE_BLINK_ORIGIN_TRIAL,STAGE_FAST_ORIGIN_TRIAL,STAGE_DEP_DEPRECATION_TRIAL]),STAGE_TYPES_SHIPPING=new Set([STAGE_BLINK_SHIPPING,STAGE_FAST_SHIPPING,STAGE_PSA_SHIPPING,STAGE_DEP_SHIPPING]),OT_EXTENSION_STAGE_MAPPING={[STAGE_BLINK_ORIGIN_TRIAL]:STAGE_BLINK_EXTEND_ORIGIN_TRIAL,[STAGE_FAST_ORIGIN_TRIAL]:STAGE_FAST_EXTEND_ORIGIN_TRIAL,[STAGE_DEP_DEPRECATION_TRIAL]:STAGE_DEP_EXTEND_DEPRECATION_TRIAL},STAGE_SHORT_NAMES={[STAGE_BLINK_INCUBATE]:"Incubate",[STAGE_BLINK_PROTOTYPE]:"Prototype",[STAGE_BLINK_DEV_TRIAL]:"DevTrial",[STAGE_BLINK_EVAL_READINESS]:"Eval readiness",[STAGE_BLINK_ORIGIN_TRIAL]:"OT",[STAGE_BLINK_EXTEND_ORIGIN_TRIAL]:"Extend OT",[STAGE_BLINK_SHIPPING]:"Ship",[STAGE_FAST_PROTOTYPE]:"Prototype",[STAGE_FAST_DEV_TRIAL]:"DevTrial",[STAGE_FAST_ORIGIN_TRIAL]:"OT",[STAGE_FAST_EXTEND_ORIGIN_TRIAL]:"Extend OT",[STAGE_FAST_SHIPPING]:"Ship",[STAGE_PSA_IMPLEMENT_FIELDS]:"Implement",[STAGE_PSA_DEV_TRIAL]:"DevTrial",[STAGE_PSA_SHIPPING]:"Ship",[STAGE_DEP_PLAN]:"Plan",[STAGE_DEP_DEV_TRIAL]:"DevTrial",[STAGE_DEP_DEPRECATION_TRIAL]:"Dep Trial",[STAGE_DEP_EXTEND_DEPRECATION_TRIAL]:"Extend Dep Trial",[STAGE_DEP_SHIPPING]:"Ship",[STAGE_ENT_ROLLOUT]:"Rollout",[STAGE_ENT_SHIPPED]:"Ship"},INTENT_STAGES={INTENT_NONE:[0,"None"],INTENT_INCUBATE:[7,"Start incubating"],INTENT_IMPLEMENT:[1,"Start prototyping"],INTENT_EXPERIMENT:[2,"Dev trials"],INTENT_IMPLEMENT_SHIP:[4,"Evaluate readiness to ship"],INTENT_ORIGIN_TRIAL:[3,"Origin Trial"],INTENT_EXTEND_ORIGIN_TRIAL:[11,"Extend Trial"],INTENT_SHIP:[5,"Prepare to ship"],INTENT_REMOVED:[6,"Removed"],INTENT_SHIPPED:[8,"Shipped"],INTENT_PARKED:[9,"Parked"],INTENT_ROLLOUT:[10,"Rollout"]},DT_MILESTONE_FIELDS=new Set(["dt_milestone_desktop_start","dt_milestone_android_start","dt_milestone_ios_start","dt_milestone_webview_start"]),OT_MILESTONE_START_FIELDS=new Set(["ot_milestone_desktop_start","ot_milestone_android_start","ot_milestone_webview_start"]),SHIPPED_MILESTONE_FIELDS=new Set(["shipped_milestone","shipped_android_milestone","shipped_ios_milestone","shipped_webview_milestone"]);var UsageType;(function(UsageType){UsageType[UsageType.Prototype=0]="Prototype",UsageType[UsageType.DeveloperTesting=1]="DeveloperTesting",UsageType[UsageType.Experiment=2]="Experiment",UsageType[UsageType.Ship=3]="Ship",UsageType[UsageType.PSA=4]="PSA",UsageType[UsageType.DeprecateAndRemove=5]="DeprecateAndRemove",UsageType[UsageType.CrossFunctionReview=6]="CrossFunctionReview",UsageType[UsageType.ReleaseNotes=7]="ReleaseNotes"})(UsageType||(UsageType={}));const ALL_FEATURE_TYPE_INCUBATE_INTENTS=new Set([UsageType.Prototype,UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),ALL_FEATURE_TYPE_EXISTING_INTENTS=new Set([UsageType.Prototype,UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),ALL_FEATURE_TYPE_CODE_CHANGE_INTENTS=new Set([UsageType.DeveloperTesting,UsageType.PSA]),ALL_FEATURE_TYPE_DEPRECATION_INTENTS=new Set([UsageType.DeprecateAndRemove,UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),ALL_INTENT_USAGE_BY_FEATURE_TYPE={[FeatureType.Incubate]:ALL_FEATURE_TYPE_INCUBATE_INTENTS,[FeatureType.Existing]:ALL_FEATURE_TYPE_EXISTING_INTENTS,[FeatureType.CodeChange]:ALL_FEATURE_TYPE_CODE_CHANGE_INTENTS,[FeatureType.Deprecation]:ALL_FEATURE_TYPE_DEPRECATION_INTENTS},STAGE_SPECIFIC_FIELDS=new Set(["shipped_milestone","shipped_android_milestone","shipped_ios_milestone","shipped_webview_milestone","ot_milestone_desktop_start","ot_milestone_desktop_end","ot_milestone_android_start","ot_milestone_android_end","ot_milestone_webview_start","ot_milestone_webview_end","dt_milestone_desktop_start","dt_milestone_android_start","dt_milestone_ios_start","dt_milestone_webview_start","extension_desktop_last","extension_android_last","extension_webview_last","intent_to_implement_url","intent_to_ship_url","intent_to_experiment_url","intent_to_extend_experiment_url","intent_thread_url","ot_creation__intent_to_experiment_url","ot_extension__intent_to_extend_experiment_url","r4dt_url","display_name","ot_display_name","ot_owner_email","origin_trial_feedback_url","ot_chromium_trial_name","ot_description","ot_emails","ot_feedback_submission_url","ot_request_note","ot_webfeature_use_counter","ot_documentation_url","ot_creation__bypass_file_checks","ot_creation__ot_documentation_url","ot_is_deprecation_trial","ot_has_third_party_support","ot_is_critical_trial","ot_creation__milestone_desktop_first","ot_creation__milestone_desktop_last","ot_extension__milestone_desktop_last","ot_require_approvals","ot_approval_buganizer_component","ot_approval_buganizer_custom_field_id","ot_approval_group_email","ot_approval_criteria_url","finch_url","experiment_goals","experiment_risks","experiment_extension_reason","rollout_milestone","rollout_platforms","rollout_details","rollout_stage_plan","enterprise_policies","announcement_url"]),STAGE_FIELD_NAME_MAPPING={shipped_milestone:"desktop_first",shipped_android_milestone:"android_first",shipped_ios_milestone:"ios_first",shipped_webview_milestone:"webview_first",ot_milestone_desktop_start:"desktop_first",ot_milestone_desktop_end:"desktop_last",ot_milestone_android_start:"android_first",ot_milestone_android_end:"android_last",ot_milestone_webview_start:"webview_first",ot_milestone_webview_end:"webview_last",ot_creation__milestone_desktop_first:"desktop_first",ot_creation__milestone_desktop_last:"desktop_last",ot_creation__ot_documentation_url:"ot_documentation_url",ot_extension__milestone_desktop_last:"desktop_last",dt_milestone_desktop_start:"desktop_first",dt_milestone_android_start:"android_first",dt_milestone_ios_start:"ios_first",dt_milestone_webview_start:"webview_first",extension_desktop_last:"desktop_last",extension_android_last:"android_last",extension_webview_last:"webview_last",rollout_milestone:"desktop_first",intent_to_implement_url:"intent_thread_url",intent_to_ship_url:"intent_thread_url",intent_to_experiment_url:"intent_thread_url",intent_to_extend_experiment_url:"intent_thread_url",ot_creation__intent_to_experiment_url:"intent_thread_url",ot_extension__intent_to_extend_experiment_url:"intent_thread_url",r4dt_url:"intent_thread_url"},GATE_TYPES={API_PROTOTYPE:1,API_ORIGIN_TRIAL:2,API_EXTEND_ORIGIN_TRIAL:3,API_SHIP:4,API_PLAN:5,PRIVACY_ORIGIN_TRIAL:32,PRIVACY_SHIP:34,SECURITY_ORIGIN_TRIAL:42,SECURITY_SHIP:44,ENTERPRISE_SHIP:54,ENTERPRISE_PLAN:55,DEBUGGABILITY_ORIGIN_TRIAL:62,DEBUGGABILITY_SHIP:64,DEBUGGABILITY_PLAN:65,TESTING_SHIP:74,TESTING_PLAN:75},GATE_PREPARING=0,GATE_REVIEW_REQUESTED=2,GATE_NA_REQUESTED=9,VOTE_OPTIONS={NO_RESPONSE:[7,"No response"],NA:[1,"N/a or Ack"],REVIEW_STARTED:[3,"Review started"],NEEDS_WORK:[4,"Needs work"],INTERNAL_REVIEW:[8,"Internal review"],APPROVED:[5,"Approved"],DENIED:[6,"Denied"]},VOTE_NA_SELF=10,VOTE_NA_VERIFIED=11,GATE_ACTIVE_REVIEW_STATES=[GATE_REVIEW_REQUESTED,VOTE_OPTIONS.REVIEW_STARTED[0],VOTE_OPTIONS.NEEDS_WORK[0],VOTE_OPTIONS.INTERNAL_REVIEW[0],GATE_NA_REQUESTED],GATE_FINISHED_REVIEW_STATES=[VOTE_OPTIONS.NA[0],VOTE_OPTIONS.APPROVED[0],VOTE_OPTIONS.DENIED[0],VOTE_NA_SELF,VOTE_NA_VERIFIED],GATE_APPROVED_REVIEW_STATES=[VOTE_OPTIONS.APPROVED[0],VOTE_OPTIONS.NA[0],VOTE_NA_SELF,VOTE_NA_VERIFIED],GATE_TEAM_ORDER=["Privacy","WP Security","Enterprise","Debuggability","Testing","API Owners"],OT_MILESTONE_END_FIELDS={ot_milestone_desktop_end:"desktop_last",ot_milestone_android_end:"android_last",ot_milestone_webview_end:"webview_last"},OT_SETUP_STATUS_OPTIONS={OT_NOT_CREATED:1,OT_READY_FOR_CREATION:2,OT_CREATION_FAILED:3,OT_ACTIVATION_FAILED:4},IMPLEMENTATION_STATUS={NO_ACTIVE_DEV:[1,"No active development"],PROPOSED:[2,"Proposed"],IN_DEVELOPMENT:[3,"In development"],BEHIND_A_FLAG:[4,"In developer trial (Behind a flag)"],ENABLED_BY_DEFAULT:[5,"Enabled by default"],DEPRECATED:[6,"Deprecated"],REMOVED:[7,"Removed"],ORIGIN_TRIAL:[8,"Origin trial"],ON_HOLD:[10,"On hold"],NO_LONGER_PURSUING:[1e3,"No longer pursuing"]},STANDARD_MATURITY_CHOICES={UNKNOWN_STD:[1,"Unknown standards status - check spec link for status"],PROPOSAL_STD:[2,"Proposal in a personal repository, no adoption from community"],INCUBATION_STD:[3,"Specification being incubated in a Community Group"],WORKINGDRAFT_STD:[4,"Specification currently under development in a Working Group"],STANDARD_STD:[5,"Final published standard: Recommendation, Living Standard, Candidate Recommendation, or similar final form"]},REVIEW_STATUS_CHOICES={REVIEW_PENDING:[1,"Pending"],REVIEW_ISSUES_OPEN:[2,"Issues open"],REVIEW_ISSUES_ADDRESSED:[3,"Issues addressed"],REVIEW_NA:[4,"Not applicable"]},VENDOR_VIEWS_COMMON={SHIPPED:[1,"Shipped/Shipping"],IN_DEV:[2,"In development"],PUBLIC_SUPPORT:[3,"Positive"],NO_PUBLIC_SIGNALS:[5,"No signal"],OPPOSED:[7,"Negative"],NEUTRAL:[8,"Neutral"],SIGNALS_NA:[9,"N/A"]},VENDOR_VIEWS_GECKO={NO_PUBLIC_SIGNALS:[5,"No signal"],SIGNALS_NA:[9,"N/A"],GECKO_UNDER_CONSIDERATION:[10,"Under consideration"],GECKO_DEFER:[14,"Defer"],PUBLIC_SUPPORT:[3,"Positive"],OPPOSED:[7,"Negative"],NEUTRAL:[8,"Neutral"],SHIPPED:[1,"Shipped/Shipping"]},WEB_DEV_VIEWS={DEV_STRONG_POSITIVE:[1,"Strongly positive"],DEV_POSITIVE:[2,"Positive"],DEV_MIXED_SIGNALS:[3,"Mixed signals"],DEV_NO_SIGNALS:[4,"No signals"],DEV_NEGATIVE:[5,"Negative"],DEV_STRONG_NEGATIVE:[6,"Strongly negative"]},COMMA_SEPARATED_FIELDS=["owner","editors","cc_recipients","spec_mentors","search_tags","devrel","i2e_lgtms","i2s_lgtms"],LINE_SEPARATED_FIELDS=["explainer_links","doc_links","sample_links","screenshot_links"];function formatFeatureForEdit(feature){const formattedFeature={...feature,category:feature.category_int,enterprise_feature_categories:Array.from(new Set(feature.enterprise_feature_categories||[])).map(x=>parseInt(x).toString()),enterprise_product_category:feature.enterprise_product_category,feature_type:feature.feature_type_int,intent_stage:feature.intent_stage_int,accurate_as_of:!0,spec_link:feature.standards.spec,standard_maturity:feature.standards.maturity.val,tag_review_status:feature.tag_review_status_int,security_review_status:feature.security_review_status_int,privacy_review_status:feature.privacy_review_status_int,sample_links:feature.resources.samples,doc_links:feature.resources.docs,search_tags:feature.tags,blink_components:feature.browsers.chrome.blink_components?.[0],bug_url:feature.browsers.chrome.bug,devrel:feature.browsers.chrome.devrel,owner:feature.browsers.chrome.owners,prefixed:feature.browsers.chrome.prefixed,impl_status_chrome:feature.browsers.chrome.status.val,shipped_milestone:feature.browsers.chrome.desktop,shipped_android_milestone:feature.browsers.chrome.android,shipped_webview_milestone:feature.browsers.chrome.webview,shipped_ios_milestone:feature.browsers.chrome.ios,ff_views:feature.browsers.ff.view?.val,ff_views_link:feature.browsers.ff.view?.url,ff_views_notes:feature.browsers.ff.view?.notes,safari_views:feature.browsers.safari.view?.val,safari_views_link:feature.browsers.safari.view?.url,safari_views_notes:feature.browsers.safari.view?.notes,web_dev_views:feature.browsers.webdev.view?.val,web_dev_views_link:feature.browsers.webdev.view?.url,web_dev_views_notes:feature.browsers.webdev.view?.notes,other_views_notes:feature.browsers.other.view?.notes};return COMMA_SEPARATED_FIELDS.map(field=>{formattedFeature[field]&&(formattedFeature[field]=formattedFeature[field].join(", "))}),LINE_SEPARATED_FIELDS.map(field=>{formattedFeature[field]&&(formattedFeature[field]=formattedFeature[field].join("\r\n"))}),formattedFeature}const NEW_FEATURE_FORM_FIELDS=["name","summary","unlisted","enterprise_impact","enterprise_feature_categories","shipping_year","owner","editors","cc_recipients","blink_components","category","web_feature"],ENTERPRISE_NEW_FEATURE_FORM_FIELDS=["name","summary","owner","editors","enterprise_feature_categories","enterprise_product_category","first_enterprise_notification_milestone","enterprise_impact","confidential"],FLAT_METADATA_FIELDS={name:"Feature metadata",sections:[{name:"Feature metadata",fields:["name","summary","unlisted","enterprise_impact","enterprise_feature_categories","shipping_year","owner","editors","cc_recipients","devrel","category","feature_type","active_stage_id","search_tags","web_feature"]},{name:"Implementation in Chromium",fields:["blink_components","bug_url","launch_bug_url","comments"]}]},FLAT_ENTERPRISE_METADATA_FIELDS={sections:[{name:"Feature metadata",fields:["name","summary","owner","editors","enterprise_feature_categories","enterprise_product_category","enterprise_impact","confidential","first_enterprise_notification_milestone","screenshot_links"]}]},FLAT_INCUBATE_FIELDS={name:"Identify the need",sections:[{name:"Identify the need",fields:["motivation","initial_public_proposal_url","explainer_links"]},{name:"Implementation in Chromium",fields:["requires_embedder_support"]}]},FLAT_PROTOTYPE_FIELDS={name:"Prototype a solution",sections:[{name:"Prototype a solution",fields:["motivation","spec_link","standard_maturity","api_spec","automation_spec","spec_mentors","intent_to_implement_url"]}]},FLAT_DEV_TRIAL_FIELDS={name:"Dev trials and iterate on design",sections:[{name:"Dev trial",fields:["devtrial_instructions","doc_links","interop_compat_risks","safari_views","safari_views_link","safari_views_notes","ff_views","ff_views_link","ff_views_notes","web_dev_views","web_dev_views_link","web_dev_views_notes","other_views_notes","security_review_status","privacy_review_status","ergonomics_risks","activation_risks","security_risks","debuggability","measurement","all_platforms","all_platforms_descr","wpt","wpt_descr","sample_links"]},{name:"Implementation in Chromium",fields:["flag_name","finch_name","non_finch_justification","dt_milestone_desktop_start","dt_milestone_android_start","dt_milestone_ios_start","announcement_url"]}]},FLAT_ORIGIN_TRIAL_FIELDS={name:"Origin trial",sections:[{name:"Origin trial",fields:["display_name","experiment_goals","experiment_risks","ongoing_constraints","i2e_lgtms","ot_documentation_url","intent_to_experiment_url","origin_trial_feedback_url"]},{name:"Implementation in Chromium",fields:["ot_milestone_desktop_start","ot_milestone_desktop_end","ot_milestone_android_start","ot_milestone_android_end","ot_milestone_webview_start","ot_milestone_webview_end","experiment_timeline"]}]},FLAT_TRIAL_EXTENSION_FIELDS={name:"Trial extension",sections:[{name:"Trial extension",fields:["experiment_extension_reason","intent_to_extend_experiment_url","extension_desktop_last"]}]},FLAT_EVAL_READINESS_TO_SHIP_FIELDS={name:"Evaluate readiness to ship",sections:[{name:"Evaluate readiness to ship",fields:["prefixed","tag_review"]}]},FLAT_PREPARE_TO_SHIP_FIELDS={name:"Prepare to ship",sections:[{name:"Prepare to ship",fields:["display_name","tag_review_status","webview_risks","anticipated_spec_changes","i2s_lgtms","availability_expectation","adoption_expectation","adoption_plan","non_oss_deps","finch_url","intent_to_ship_url"]},{name:"Implementation in Chromium",fields:["rollout_plan","shipped_milestone","shipped_android_milestone","shipped_ios_milestone","shipped_webview_milestone"]}]},FLAT_ENTERPRISE_PREPARE_TO_SHIP_FIELDS={name:"Rollout step",sections:[{name:"Rollout step",fields:["rollout_milestone","rollout_platforms","rollout_details","rollout_stage_plan","enterprise_policies"]}]},PSA_IMPLEMENT_FIELDS={name:"Start prototyping",sections:[{name:"Start prototyping",fields:["motivation","spec_link","standard_maturity"]}]},PSA_PREPARE_TO_SHIP_FIELDS={name:"Prepare to ship",sections:[{name:"Prepare to ship",fields:["intent_to_ship_url"]},{name:"Implementation in Chromium",fields:["rollout_plan","shipped_milestone","shipped_android_milestone","shipped_ios_milestone","shipped_webview_milestone"]}]},DEPRECATION_PLAN_FIELDS={name:"Write up deprecation plan",sections:[{name:"Write up deprecation plan",fields:["deprecation_motivation","spec_link"]}]},DEPRECATION_DEV_TRIAL_FIELDS={name:"Dev trial of deprecation",sections:[{name:"Dev trial of deprecation",fields:["devtrial_instructions","doc_links","interop_compat_risks","safari_views","safari_views_link","safari_views_notes","ff_views","ff_views_link","ff_views_notes","web_dev_views","web_dev_views_link","web_dev_views_notes","other_views_notes","security_review_status","privacy_review_status","ergonomics_risks","activation_risks","security_risks","webview_risks","debuggability","measurement","all_platforms","all_platforms_descr","wpt","wpt_descr","sample_links"]},{name:"Implementation in Chromium",fields:["flag_name","finch_name","non_finch_justification","dt_milestone_desktop_start","dt_milestone_android_start","dt_milestone_ios_start","announcement_url"]}]},ORIGIN_TRIAL_CREATION_FIELDS={sections:[{fields:["ot_display_name","ot_description","ot_owner_email","ot_emails","ot_creation__milestone_desktop_first","ot_creation__milestone_desktop_last","ot_creation__intent_to_experiment_url","ot_creation__ot_documentation_url","ot_feedback_submission_url","ot_chromium_trial_name","ot_is_deprecation_trial","ot_webfeature_use_counter","ot_has_third_party_support","ot_is_critical_trial","ot_require_approvals"]}]},ORIGIN_TRIAL_EXTENSION_FIELDS={sections:[{fields:["ot_extension__milestone_desktop_last","experiment_extension_reason"]}]},DEPRECATION_ORIGIN_TRIAL_FIELDS={name:"Prepare for Deprecation Trial",sections:[{name:"Prepare for Deprecation Trial",fields:["display_name","experiment_goals","experiment_risks","ongoing_constraints","r4dt_url","r4dt_lgtms","origin_trial_feedback_url"]},{name:"Implementation in Chromium",fields:["ot_milestone_desktop_start","ot_milestone_desktop_end","ot_milestone_android_start","ot_milestone_android_end","ot_milestone_webview_start","ot_milestone_webview_end","experiment_timeline"]}]},DEPRECATION_PREPARE_TO_SHIP_FIELDS={name:"Prepare to ship",sections:[{name:"Prepare to ship",fields:["display_name","intent_to_ship_url","i2s_lgtms"]},{name:"Implementation in Chromium",fields:["rollout_plan","shipped_milestone","shipped_android_milestone","shipped_ios_milestone","shipped_webview_milestone"]}]},VERIFY_ACCURACY_METADATA_FIELDS={name:"Important fields",sections:[{name:"Feature Metadata",fields:["summary","owner","finch_name","non_finch_justification","bug_url"]}]},VERIFY_ACCURACY_PREPARE_TO_SHIP_FIELDS={name:"Prepare to ship",sections:[{name:"Shipping milestones",fields:["shipped_milestone","shipped_android_milestone","shipped_ios_milestone","shipped_webview_milestone"]}]},VERIFY_ACCURACY_ENTERPRISE_PREPARE_TO_SHIP_FIELDS={name:"Rollout step",sections:[{name:"Rollout milestones",fields:["rollout_milestone","rollout_platforms","rollout_details","rollout_stage_plan","enterprise_policies"]}]},VERIFY_ACCURACY_CONFIRMATION_FIELD={name:"Verify Accuracy",sections:[{name:"Verify Accuracy",fields:["accurate_as_of"]}]},FORMS_BY_STAGE_TYPE={[STAGE_BLINK_INCUBATE]:FLAT_INCUBATE_FIELDS,[STAGE_BLINK_PROTOTYPE]:FLAT_PROTOTYPE_FIELDS,[STAGE_BLINK_DEV_TRIAL]:FLAT_DEV_TRIAL_FIELDS,[STAGE_BLINK_EVAL_READINESS]:FLAT_EVAL_READINESS_TO_SHIP_FIELDS,[STAGE_BLINK_ORIGIN_TRIAL]:FLAT_ORIGIN_TRIAL_FIELDS,[STAGE_BLINK_EXTEND_ORIGIN_TRIAL]:FLAT_TRIAL_EXTENSION_FIELDS,[STAGE_BLINK_SHIPPING]:FLAT_PREPARE_TO_SHIP_FIELDS,[STAGE_FAST_PROTOTYPE]:FLAT_PROTOTYPE_FIELDS,[STAGE_FAST_DEV_TRIAL]:FLAT_DEV_TRIAL_FIELDS,[STAGE_FAST_ORIGIN_TRIAL]:FLAT_ORIGIN_TRIAL_FIELDS,[STAGE_FAST_EXTEND_ORIGIN_TRIAL]:FLAT_TRIAL_EXTENSION_FIELDS,[STAGE_FAST_SHIPPING]:FLAT_PREPARE_TO_SHIP_FIELDS,[STAGE_PSA_IMPLEMENT_FIELDS]:PSA_IMPLEMENT_FIELDS,[STAGE_PSA_DEV_TRIAL]:FLAT_DEV_TRIAL_FIELDS,[STAGE_PSA_SHIPPING]:PSA_PREPARE_TO_SHIP_FIELDS,[STAGE_DEP_PLAN]:DEPRECATION_PLAN_FIELDS,[STAGE_DEP_DEV_TRIAL]:DEPRECATION_DEV_TRIAL_FIELDS,[STAGE_DEP_DEPRECATION_TRIAL]:DEPRECATION_ORIGIN_TRIAL_FIELDS,[STAGE_DEP_EXTEND_DEPRECATION_TRIAL]:FLAT_TRIAL_EXTENSION_FIELDS,[STAGE_DEP_SHIPPING]:DEPRECATION_PREPARE_TO_SHIP_FIELDS,[STAGE_ENT_ROLLOUT]:FLAT_ENTERPRISE_PREPARE_TO_SHIP_FIELDS,[STAGE_ENT_SHIPPED]:FLAT_PREPARE_TO_SHIP_FIELDS},CREATEABLE_STAGES={[FEATURE_TYPES.FEATURE_TYPE_INCUBATE_ID[0]]:[STAGE_BLINK_ORIGIN_TRIAL,STAGE_BLINK_SHIPPING,STAGE_ENT_ROLLOUT],[FEATURE_TYPES.FEATURE_TYPE_EXISTING_ID[0]]:[STAGE_FAST_ORIGIN_TRIAL,STAGE_FAST_SHIPPING,STAGE_ENT_ROLLOUT],[FEATURE_TYPES.FEATURE_TYPE_CODE_CHANGE_ID[0]]:[STAGE_PSA_SHIPPING,STAGE_ENT_ROLLOUT],[FEATURE_TYPES.FEATURE_TYPE_DEPRECATION_ID[0]]:[STAGE_DEP_DEPRECATION_TRIAL,STAGE_DEP_SHIPPING,STAGE_ENT_ROLLOUT],[FEATURE_TYPES.FEATURE_TYPE_ENTERPRISE_ID[0]]:[STAGE_ENT_ROLLOUT]},VERIFY_ACCURACY_FORMS_BY_STAGE_TYPE={[STAGE_BLINK_SHIPPING]:VERIFY_ACCURACY_PREPARE_TO_SHIP_FIELDS,[STAGE_FAST_SHIPPING]:VERIFY_ACCURACY_PREPARE_TO_SHIP_FIELDS,[STAGE_PSA_SHIPPING]:VERIFY_ACCURACY_PREPARE_TO_SHIP_FIELDS,[STAGE_DEP_SHIPPING]:VERIFY_ACCURACY_PREPARE_TO_SHIP_FIELDS,[STAGE_ENT_ROLLOUT]:VERIFY_ACCURACY_ENTERPRISE_PREPARE_TO_SHIP_FIELDS,[STAGE_ENT_SHIPPED]:VERIFY_ACCURACY_PREPARE_TO_SHIP_FIELDS};let toastEl;const NARROW_WINDOW_MAX_WIDTH=700,ACCURACY_GRACE_PERIOD=2419200000,SHIPPED_FEATURE_OUTDATED_GRACE_PERIOD=5443200000,IS_MOBILE=(()=>{const width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;return width<=NARROW_WINDOW_MAX_WIDTH})();function autolink(s,featureLinks=[],isMarkdown=!1){if(s=s??"",isMarkdown){const rendered=d.parse(s),sanitized=purify.sanitize(rendered),markup=x$1`${o$2(sanitized)}`;return[markup]}else{const withLinks=markupAutolinks(s,featureLinks);return withLinks}}function showToastMessage(msg){toastEl||(toastEl=document.querySelector("chromedash-toast")),toastEl?.showMessage&&toastEl.showMessage(msg)}function findProcessStage(feStage,process){for(const processStage of process.stages)if(feStage.stage_type==processStage.stage_type)return processStage;return null}function shouldShowDisplayNameField(feStages,stageType){let matchingStageCount=0;for(let i=0;i<feStages.length;i++)if(feStages[i].stage_type===stageType&&(matchingStageCount++,1<matchingStageCount))return!0;return!1}function findFirstFeatureStage(intentStage,currentStage,fe){if(intentStage==currentStage.intent_stage)return currentStage;for(const feStage of fe.stages)if(intentStage==feStage.intent_stage)return feStage;return null}function unambiguousStageName(stage,feature){const processStageName=FORMS_BY_STAGE_TYPE[stage.stage_type]?.name;if(!processStageName)return void console.error(`Unexpected stage type ${stage.stage_type} in stage ${stage.id}.`);if(stage.display_name)return`${processStageName}: ${stage.display_name}`;const index=feature.stages.filter(s=>s.stage_type===stage.stage_type).findIndex(s=>s.id===stage.id);return 0<index?`${processStageName} ${index+1}`:processStageName}function getStageValue(stage,fieldName){return stage?fieldName in STAGE_FIELD_NAME_MAPPING?stage[STAGE_FIELD_NAME_MAPPING[fieldName]]:stage[fieldName]:void 0}function calcMaxMilestone(feStage,fieldName){if(!feStage)return;if(feStage[`max_${fieldName}`]||!feStage.extensions)return;let maxMilestone=getStageValue(feStage,fieldName)||0;for(const extension of feStage.extensions)for(const otMilestoneField of Object.values(OT_MILESTONE_END_FIELDS)){const extensionValue=getStageValue(extension,otMilestoneField);extensionValue&&(maxMilestone=Math.max(maxMilestone,extensionValue))}feStage[`max_${fieldName}`]=maxMilestone}function _getMilestoneExtensionValue(feStage,fieldName){if(feStage){const milestoneValue=getStageValue(feStage,fieldName);calcMaxMilestone(feStage,fieldName);const maxMilestoneFieldName=`max_${fieldName}`;return feStage[maxMilestoneFieldName]&&!milestoneValue?`Extended to ${feStage[maxMilestoneFieldName]}`:feStage[maxMilestoneFieldName]&&feStage[maxMilestoneFieldName]>milestoneValue?`${feStage[maxMilestoneFieldName]} (extended from ${milestoneValue})`:milestoneValue}}function isDefinedValue(value){return value!==void 0&&null!==value&&0!=value.length}function hasFieldValue(fieldName,feStage,feature){const value=getFieldValueFromFeature(fieldName,feStage,feature);return isDefinedValue(value)}function getFieldValueFromFeature(fieldName,feStage,feature){if(STAGE_SPECIFIC_FIELDS.has(fieldName)){const value=getStageValue(feStage,fieldName);return"rollout_platforms"===fieldName&&value?value.map(platformId=>PLATFORMS_DISPLAYNAME[platformId]):"rollout_stage_plan"===fieldName?ROLLOUT_STAGE_PLAN_DISPLAYNAME[value]:fieldName in OT_MILESTONE_END_FIELDS?_getMilestoneExtensionValue(feStage,fieldName):value}if(!feature)return null;const fieldNameMapping={owner:"browsers.chrome.owners",editors:"editors",search_tags:"tags",spec_link:"standards.spec",standard_maturity:"standards.maturity.text",sample_links:"resources.samples",docs_links:"resources.docs",bug_url:"browsers.chrome.bug",blink_components:"browsers.chrome.blink_components",devrel:"browsers.chrome.devrel",prefixed:"browsers.chrome.prefixed",impl_status_chrome:"browsers.chrome.status.text",shipped_milestone:"browsers.chrome.desktop",shipped_android_milestone:"browsers.chrome.android",shipped_webview_milestone:"browsers.chrome.webview",shipped_ios_milestone:"browsers.chrome.ios",ff_views:"browsers.ff.view.text",ff_views_link:"browsers.ff.view.url",ff_views_notes:"browsers.ff.view.notes",safari_views:"browsers.safari.view.text",safari_views_link:"browsers.safari.view.url",safari_views_notes:"browsers.safari.view.notes",web_dev_views:"browsers.webdev.view.text",web_dev_views_link:"browsers.webdev.view.url",web_dev_views_notes:"browsers.webdev.view.notes",other_views_notes:"browsers.other.view.notes"};let value;if(fieldNameMapping[fieldName]){let propertyValue=feature;for(const step of fieldNameMapping[fieldName].split("."))propertyValue&&(propertyValue=propertyValue[step]);value=propertyValue}else value=feature[fieldName];if("enterprise_product_category"===fieldName&&void 0!==value)return ENTERPRISE_PRODUCT_CATEGORY_DISPLAYNAME[value];if("enterprise_feature_categories"===fieldName&&value)return value.map(categoryId=>ENTERPRISE_FEATURE_CATEGORIES_DISPLAYNAME[categoryId]);if("enterprise_impact"===fieldName&&value)return ENTERPRISE_IMPACT_DISPLAYNAME[value];if("rollout_plan"===fieldName&&void 0!==value)return ROLLOUT_PLAN_DISPLAYNAME[value];if("active_stage_id"===fieldName&&value){for(const stage of feature.stages)if(stage.id===value)return unambiguousStageName(stage,feature);return}return value}function flattenSections(stage){return stage.sections.reduce((combined,section)=>[...combined,...section.fields],[])}function setupScrollToHash(pageElement){const scrollToElement=hash=>{if(hash){const el=pageElement.shadowRoot.querySelector(hash);if(el){el.input?el.focus():setTimeout(()=>{el.focus()},100);const fieldRowSelector=`chromedash-form-field[name="${el.name}"] tr + tr`,fieldRow=pageElement.shadowRoot.querySelector(fieldRowSelector);fieldRow?fieldRow.scrollIntoView({block:"center",behavior:"smooth"}):el.scrollIntoView({behavior:"smooth"})}}};if(window.scrollToElement=hash=>{scrollToElement(hash)},location.hash){const hash=decodeURIComponent(location.hash);scrollToElement(hash)}}function redirectToCurrentPage(){const url=window.location.href.split("?")[0];window.location.href=url}function renderHTMLIf(condition,originalHTML){return condition?originalHTML:E$1}function _parseDateStr(dateStr){dateStr=dateStr||"",dateStr=dateStr.replace(" ","T");const dateObj=new Date(`${dateStr}Z`);return isNaN(+dateObj)?null:dateObj}function renderAbsoluteDate(dateStr,includeTime=!1){return dateStr?includeTime?dateStr.split(".")[0]:dateStr.split(" ")[0]:""}function renderRelativeDate(dateStr){const dateObj=_parseDateStr(dateStr);return dateObj?x$1` <span class="relative_date"> + (<sl-relative-time date="${dateObj.toISOString()}"> </sl-relative-time>) + </span>`:E$1}function isoDateString(date){return date.toISOString().slice(0,10)}function parseRawQuery(rawQuery){const params=new URLSearchParams(rawQuery),result={};for(const param of params.keys()){const values=params.getAll(param);values.length&&(result[param]=values[0])}return result}function getNewLocation(params,location){const url=new URL(location);if(url.search="",params)for(const[k,v]of Object.entries(params))v&&url.searchParams.append(k,v.toString());return url}function getDisabledHelpText(field,feStage){return("ot_milestone_desktop_start"===field||"ot_milestone_desktop_end"===field)&&(feStage?.ot_setup_status===OT_SETUP_STATUS_OPTIONS.OT_READY_FOR_CREATION||feStage?.ot_setup_status===OT_SETUP_STATUS_OPTIONS.OT_CREATION_FAILED||feStage?.ot_setup_status===OT_SETUP_STATUS_OPTIONS.OT_ACTIVATION_FAILED)?"Origin trial milestone cannot be edited while a creation request is in progress":""}function updateURLParams(key,val){const newURL=formatURLParams(key,val);newURL.toString()===window.location.toString()||window.history.pushState({path:newURL.toString()},"",newURL)}function formatURLParams(key,val){const rawQuery=parseRawQuery(window.location.search);rawQuery[key]=encodeURIComponent(val);const newURL=getNewLocation(rawQuery,window.location);return newURL.hash="",newURL}function formatUrlForRelativeOffset(start,delta,pageSize,totalCount){const offset=start+delta;return void 0===totalCount||offset<=-pageSize||offset>=totalCount?void 0:formatUrlForOffset(Math.max(0,offset))}function formatUrlForOffset(offset){return formatURLParams("start",offset).toString()}function clearURLParams(key){const rawQuery=parseRawQuery(window.location.search);delete rawQuery[key];const newURL=getNewLocation(rawQuery,window.location);newURL.hash="";newURL.toString()===window.location.toString()||window.history.pushState({path:newURL.toString()},"",newURL)}function formatFeatureChanges(fieldValues,featureId,formStageId){let hasChanges=!1;const featureChanges={id:featureId},stages={};formStageId&&(stages[formStageId]={id:formStageId});for(const{name,touched,value,stageId,implicitValue,isMarkdown}of fieldValues){if(!touched)continue;let formattedValue=value;if(Array.isArray(formattedValue)&&(formattedValue=formattedValue.join(",")),void 0!==implicitValue){if(!formattedValue)continue;featureChanges[name]=implicitValue}else stageId?(stageId in stages||(stages[stageId]={id:stageId}),stages[stageId][STAGE_FIELD_NAME_MAPPING[name]||name]={form_field_name:name,value:formattedValue}):(featureChanges[name]=formattedValue,void 0!==isMarkdown&&(featureChanges[name+"_is_markdown"]=isMarkdown));hasChanges=!0}return{feature_changes:featureChanges,stages:Object.values(stages),has_changes:hasChanges}}function handleSaveChangesResponse(response){const app=document.querySelector("chromedash-app");app.setUnsavedChanges(""!==response)}function extensionMilestoneIsValid(value,currentMilestone){if(isNaN(value))return!1;for(let i=0;i<value.length;i++)if("0">value[i]||"9"<value[i])return!1;const intValue=parseInt(value);return!(1e3<=intValue)&&parseInt(currentMilestone)<=intValue}function userCanEdit(user,featureId){return!!(user&&(user.can_edit_all||user.editable_features.includes(featureId)))}function isVerifiedWithinGracePeriod(accurateAsOf,currentDate,gracePeriod=ACCURACY_GRACE_PERIOD){if(!accurateAsOf)return!1;const accurateDate=Date.parse(accurateAsOf);return!(accurateDate+gracePeriod<currentDate)}const METRICS_TYPE_AND_VIEW_TO_SUBTITLE={csspopularity:"CSS usage metrics > all properties",cssanimated:"CSS usage metrics > animated properties",featurepopularity:"HTML & JavaScript usage metrics > all features",webfeaturepopularity:"Web features usage metrics > all features"};function isShippedFeatureOutdated(feature,hasShipped,closestShippingDate){return!!hasShipped&&!!(feature.accurate_as_of&&closestShippingDate)&&Date.parse(feature.accurate_as_of)<Date.parse(closestShippingDate)}function isShippedFeatureOutdatedForAuthor(feature,userCanEdit,hasShipped,closestShippingDate){return userCanEdit&&isShippedFeatureOutdated(feature,hasShipped,closestShippingDate)}function isShippedFeatureOutdatedForAll(feature,hasShipped,currentDate,closestShippingDate){if(!isShippedFeatureOutdated(feature,hasShipped,closestShippingDate))return!1;const isVerified=isVerifiedWithinGracePeriod(feature.accurate_as_of,currentDate,SHIPPED_FEATURE_OUTDATED_GRACE_PERIOD);return!isVerified}async function fetchClosestShippingDate(milestone){if(0===milestone)return"";try{const newMilestonesInfo=await window.csClient.getSpecifiedChannels(milestone,milestone);return newMilestonesInfo[milestone]?.final_beta}catch{return showToastMessage("Some errors occurred. Please refresh the page or try again later."),""}}async function findClosestShippingDate(channels,stages){var _Mathmax2=Math.max;const latestStableVersion=channels?.stable?.version;if(!latestStableVersion||!stages)return{closestShippingDate:"",isUpcoming:!1,hasShipped:!1};let closestShippingDate="",isUpcoming=!1,hasShipped=!1;const shippingTypeMilestones=new Set;for(const stage of stages)(STAGE_TYPES_SHIPPING.has(stage.stage_type)||stage.stage_type===STAGE_ENT_ROLLOUT)&&(shippingTypeMilestones.add(stage.desktop_first),shippingTypeMilestones.add(stage.android_first),shippingTypeMilestones.add(stage.ios_first),shippingTypeMilestones.add(stage.webview_first));const upcomingMilestonesTarget=new Set([...shippingTypeMilestones]);let foundMilestone=0;if(upcomingMilestonesTarget.has(latestStableVersion+1)?(foundMilestone=latestStableVersion+1,isUpcoming=!0):upcomingMilestonesTarget.has(latestStableVersion+2)&&(foundMilestone=latestStableVersion+2,isUpcoming=!0),isUpcoming)Object.keys(channels).forEach(key=>{channels[key].version===foundMilestone&&(closestShippingDate=channels[key].final_beta||"")});else{const shippedMilestonesTarget=shippingTypeMilestones;let latestMilestone=0;for(const ms of shippedMilestonesTarget)ms&&ms<=latestStableVersion&&(latestMilestone=_Mathmax2(latestMilestone,ms));latestMilestone===latestStableVersion?(closestShippingDate=channels.stable?.final_beta||"",hasShipped=!0):(closestShippingDate=await fetchClosestShippingDate(latestMilestone),hasShipped=!0)}return{closestShippingDate,isUpcoming,hasShipped}}function isUpcomingFeatureOutdated(feature,isUpcoming,currentDate){return isUpcoming&&!isVerifiedWithinGracePeriod(feature.accurate_as_of,currentDate)}function getFeatureOutdatedBanner(feature,shippingInfo,currentDate,userCanEdit){currentDate||(currentDate=Date.now());const{closestShippingDate,hasShipped,isUpcoming}=shippingInfo;if(isUpcomingFeatureOutdated(feature,isUpcoming,currentDate))return userCanEdit?x$1` + <div class="warning layout horizontal center"> + <span class="tooltip" id="outdated-icon" title="Feature outdated "> + <sl-icon name="exclamation-circle-fill" data-tooltip></sl-icon> + </span> + <span> + Your feature hasn't been verified as accurate since  + <sl-relative-time + date=${feature.accurate_as_of??""} + ></sl-relative-time + >, but it is scheduled to ship  + <sl-relative-time date=${closestShippingDate}></sl-relative-time>. + Please + <a href="/guide/verify_accuracy/${feature.id}" + >verify that your feature is accurate</a + >. + </span> + </div> + `:x$1` + <div class="warning layout horizontal center"> + <span class="tooltip" id="outdated-icon" title="Feature outdated "> + <sl-icon name="exclamation-circle-fill" data-tooltip></sl-icon> + </span> + <span> + This feature hasn't been verified as accurate since  + <sl-relative-time + date=${feature.accurate_as_of??""} + ></sl-relative-time + >, but it is scheduled to ship  + <sl-relative-time date=${closestShippingDate}></sl-relative-time>. + </span> + </div> + `;if(isShippedFeatureOutdated(feature,hasShipped,closestShippingDate)){if(isShippedFeatureOutdatedForAuthor(feature,userCanEdit,hasShipped,closestShippingDate))return x$1` + <div class="warning layout horizontal center"> + <span + class="tooltip" + id="shipped-outdated-author" + title="Feature outdated " + > + <sl-icon name="exclamation-circle-fill" data-tooltip></sl-icon> + </span> + <span> + Your feature hasn't been verified as accurate since  + <sl-relative-time + date=${feature.accurate_as_of??""} + ></sl-relative-time + >, but it claims to have shipped  + <sl-relative-time date=${closestShippingDate}></sl-relative-time>. + Please + <a href="/guide/verify_accuracy/${feature.id}" + >verify that your feature is accurate</a + >. + </span> + </div> + `;if(isShippedFeatureOutdatedForAll(feature,hasShipped,currentDate,closestShippingDate))return x$1` + <div class="warning layout horizontal center"> + <span + class="tooltip" + id="shipped-outdated-all" + title="Feature outdated " + > + <sl-icon name="exclamation-circle-fill" data-tooltip></sl-icon> + </span> + <span> + This feature hasn't been verified as accurate since  + <sl-relative-time + date=${feature.accurate_as_of??""} + ></sl-relative-time + >, but it claims to have shipped  + <sl-relative-time date=${closestShippingDate}></sl-relative-time>. + </span> + </div> + `}return null}var __decorate$18=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashAdminBlinkPage=class ChromedashAdminBlinkPage extends i$4{constructor(){super(...arguments),this.loading=!0,this.user=null,this._editMode=!1,this._client=window.csOpenApiClient}static get styles(){return[SHARED_STYLES,VARS,LAYOUT_CSS,i$7` + body { + scroll-behavior: smooth; + } + + #spinner { + display: none !important; + } + + #subheader .subheader_toggles { + display: flex !important; + justify-content: flex-end; + flex: 1 0 auto; + } + + #subheader ul { + list-style-type: none; + margin-left: var(--content-padding); + } + + #subheader ul li { + text-align: center; + border-radius: var(--default-border-radius); + box-shadow: 1px 1px 4px var(--bar-shadow-color); + padding: 0.5em; + background: var(--chromium-color-dark); + color: #fff; + font-weight: 500; + text-transform: uppercase; + } + + #subheader ul li a { + color: inherit; + text-decoration: none; + } + + #subheader .view_owners_linke { + margin-left: var(--content-padding); + } + + #components_list { + list-style: none; + margin-bottom: calc(var(--content-padding) * 4); + } + + #components_list li { + padding: var(--content-padding) 0; + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}fetchData(){this.loading=!0,this._client.listComponentUsers().then(response=>{this.usersMap=new Map(response.users.map(user=>[user.id,user])),this.components=response.components,this.loading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}_onEditModeToggle(){this._editMode=!this._editMode}_addComponentUserListener(e){const component=Object.assign({},this.components[e.detail.index]);return e.detail.isError?void showToastMessage(`"Unable to add ${this.usersMap.get(e.detail.userId).name} to ${component.name}".`):void(!component.subscriber_ids?.includes(e.detail.userId)&&(component.subscriber_ids=[...(component.subscriber_ids??[]),e.detail.userId]),e.detail.toggleAsOwner&&(component.owner_ids=[...(component.owner_ids??[]),e.detail.userId]),showToastMessage(`"${this.usersMap.get(e.detail.userId).name} added to ${component.name}".`),this.components[e.detail.index]=component,this.requestUpdate())}_removeComponentUserListener(e){const component=Object.assign({},this.components[e.detail.index]);return e.detail.isError?void showToastMessage(`"Unable to remove ${this.usersMap.get(e.detail.userId).name} from ${component.name}".`):void(component.subscriber_ids=component.subscriber_ids.filter(currentUserId=>e.detail.userId!==currentUserId),e.detail.toggleAsOwner&&(component.owner_ids=component.owner_ids.filter(currentUserId=>e.detail.userId!==currentUserId)),showToastMessage(`"${this.usersMap.get(e.detail.userId).name} removed from ${component.name}".`),this.components[e.detail.index]=component,this.requestUpdate())}renderSubheader(){return x$1` + <div id="subheader"> + <div class="layout horizontal center"> + <div> + <h2>Blink components</h2> + ${this.loading?x$1`<div>loading components</div>`:x$1`<div id="component-count"> + listing ${this.components.length} components + </div>`} + </div> + </div> + <div class="layout horizontal subheader_toggles"> + <label + ><input + type="checkbox" + ?checked="${this._editMode}" + @change="${this._onEditModeToggle}" + />Edit mode</label + > + </div> + </div> + `}scrollToPosition(){if(location.hash){const hash=decodeURIComponent(location.hash);if(hash){const el=this.shadowRoot.querySelector(hash);el.scrollIntoView({behavior:"smooth"})}}}renderComponents(){return x$1` + <ul id="components_list"> + ${this.components.map((component,index)=>x$1` + <li class="layout horizontal" id="${component.name}"> + <chromedash-admin-blink-component-listing + .componentId=${component.id} + .name=${component.name} + .subscriberIds=${component.subscriber_ids??[]} + .ownerIds=${component.owner_ids??[]} + .index=${index} + .usersMap=${this.usersMap} + ?editing=${this._editMode} + @adminRemoveComponentUser=${this._removeComponentUserListener} + @adminAddComponentUser=${this._addComponentUserListener} + ></chromedash-admin-blink-component-listing> + </li> + `)} + </ul> + `}render(){return x$1` + ${this.renderSubheader()} + ${this.loading?x$1``:this.renderComponents()} + `}};__decorate$18([n$5({type:Boolean})],ChromedashAdminBlinkPage.prototype,"loading",void 0),__decorate$18([n$5({type:Object})],ChromedashAdminBlinkPage.prototype,"user",void 0),__decorate$18([n$5({type:Boolean})],ChromedashAdminBlinkPage.prototype,"_editMode",void 0),__decorate$18([r$6()],ChromedashAdminBlinkPage.prototype,"components",void 0),__decorate$18([r$6()],ChromedashAdminBlinkPage.prototype,"usersMap",void 0),ChromedashAdminBlinkPage=__decorate$18([t$3("chromedash-admin-blink-page")],ChromedashAdminBlinkPage);var __decorate$17=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashAdminFeatureLinksPage=class ChromedashAdminFeatureLinksPage extends i$4{constructor(){super(...arguments),this.sampleId="",this.samplesLoading=!1,this.loading=!0,this.featureLinksSamples=[]}static get styles(){return[SHARED_STYLES,VARS,LAYOUT_CSS,i$7` + .feature-links-summary .line { + padding: var(--content-padding-half); + display: flex; + align-items: center; + justify-content: space-between; + font-size: 16px; + } + .feature-links-samples .line { + background: rgb(232, 234, 237); + } + sl-icon-button::part(base) { + padding: 0; + margin-left: 8px; + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}async fetchData(){try{this.loading=!0,this.featureLinksSummary=await window.csClient.getFeatureLinksSummary()}catch{showToastMessage("Some errors occurred. Please refresh the page or try again later.")}finally{this.loading=!1}}calcSampleId(domain,type,isError){return`domain=${domain}&type=${type}&isError=${isError}`}async fetchLinkSamples(domain,type,isError){this.sampleId=this.calcSampleId(domain,type,isError),this.featureLinksSamples=[],this.samplesLoading=!0;try{this.featureLinksSamples=await window.csClient.getFeatureLinksSamples(domain,type,isError)}catch{showToastMessage("Some errors occurred. Please refresh the page or try again later.")}finally{this.samplesLoading=!1}}renderSamples(){return this.samplesLoading?x$1`<sl-spinner></sl-spinner>`:x$1` + <div class="feature-links-samples"> + ${this.featureLinksSamples.map(sample=>x$1` + <div class="line"> + <div> + <a href=${sample.url}><i>${sample.url}</i></a> + ${sample.http_error_code?x$1`<i>(${sample.http_error_code})</i>`:E$1} + </div> + <a + href=${`/feature/${sample.feature_ids}`} + target="_blank" + rel="noopener" + > + <sl-icon + library="material" + name="link" + slot="prefix" + title="linked feature" + ></sl-icon> + </a> + </div> + `)} + </div> + `}renderComponents(){return x$1` + <div class="feature-links-summary"> + <sl-details summary="Link Summary" open> + <div class="line"> + All Links <b>${this.featureLinksSummary.total_count}</b> + </div> + <div class="line"> + Covered Links <b>${this.featureLinksSummary.covered_count}</b> + </div> + <div class="line"> + Uncovered (aka "web") Links + <b>${this.featureLinksSummary.uncovered_count}</b> + </div> + <div class="line"> + All Error Links<b>${this.featureLinksSummary.error_count}</b> + </div> + <div class="line"> + HTTP Error Links<b>${this.featureLinksSummary.http_error_count}</b> + </div> + </sl-details> + <sl-details summary="Link Types" open> + ${this.featureLinksSummary.link_types.map(linkType=>x$1` + <div class="line"> + ${linkType.key.toUpperCase()} <b>${linkType.count}</b> + </div> + `)} + </sl-details> + <sl-details summary="Uncovered Link Domains" open> + ${this.featureLinksSummary.uncovered_link_domains.map(domain=>x$1` + <div class="line"> + <div> + <a href=${domain.key}>${domain.key}</a> + <sl-icon-button + library="material" + name="search" + slot="prefix" + title="Samples" + @click=${()=>this.fetchLinkSamples(domain.key,"web",void 0)} + > + ></sl-icon-button + > + </div> + <b>${domain.count}</b> + </div> + ${this.sampleId===this.calcSampleId(domain.key,"web",void 0)?this.renderSamples():E$1} + `)} + </sl-details> + <sl-details summary="Error Link Domains" open> + ${this.featureLinksSummary.error_link_domains.map(domain=>x$1` + <div class="line"> + <div> + <a href=${domain.key}>${domain.key}</a> + <sl-icon-button + library="material" + name="search" + slot="prefix" + title="Samples" + @click=${()=>this.fetchLinkSamples(domain.key,void 0,!0)} + > + ></sl-icon-button + > + </div> + <b>${domain.count}</b> + </div> + ${this.sampleId===this.calcSampleId(domain.key,void 0,!0)?this.renderSamples():E$1} + `)} + </sl-details> + </div> + `}render(){return x$1` ${this.loading?x$1``:this.renderComponents()} `}};__decorate$17([r$6()],ChromedashAdminFeatureLinksPage.prototype,"sampleId",void 0),__decorate$17([r$6()],ChromedashAdminFeatureLinksPage.prototype,"samplesLoading",void 0),__decorate$17([r$6()],ChromedashAdminFeatureLinksPage.prototype,"loading",void 0),__decorate$17([r$6()],ChromedashAdminFeatureLinksPage.prototype,"featureLinksSamples",void 0),__decorate$17([r$6()],ChromedashAdminFeatureLinksPage.prototype,"featureLinksSummary",void 0),ChromedashAdminFeatureLinksPage=__decorate$17([t$3("chromedash-admin-feature-links-page")],ChromedashAdminFeatureLinksPage);const TEXT_KIND="text",NUM_KIND="number",MILESTONE_KIND="milestone",DATE_KIND="YYYY-MM-DD",EMAIL_KIND="user@example.com",ENUM_KIND="enum",QUERIABLE_FIELDS=[{name:"created.when",kind:DATE_KIND,doc:"Date that the feature entry was created"},{name:"updated.when",kind:DATE_KIND,doc:"Date that the feature was most recently edited"},{name:"name",kind:"text",doc:"The name of the feature"},{name:"tag",kind:"text",doc:"Search tags for finding feature entries"},{name:"web_feature_id",kind:"text",doc:"String ID of a related WebDX feature"},{name:"owner",kind:EMAIL_KIND,doc:"One of the feature owners"},{name:"shipping_year",kind:NUM_KIND,doc:"Estimated shipping year"},{name:"browsers.chrome.devrel",kind:EMAIL_KIND,doc:"Developer relations contact"},{name:"browsers.chrome.desktop",kind:MILESTONE_KIND,doc:"Desktop shipping milestone"},{name:"browsers.chrome.android",kind:MILESTONE_KIND,doc:"Android shipping milestone"},{name:"browsers.chrome.ios",kind:MILESTONE_KIND,doc:"iOS shipping milestone"},{name:"browsers.chrome.webview",kind:MILESTONE_KIND,doc:"Webview shipping milestone"},{name:"browsers.chrome.flag_name",kind:"text",doc:"Flag name that allows developers to enable the feature"},{name:"browsers.chrome.finch_name",kind:"text",doc:"Finch name"},{name:"browsers.chrome.devtrial.desktop.start",kind:MILESTONE_KIND,doc:"Desktop DevTrial start"},{name:"browsers.chrome.devtrial.android.start",kind:MILESTONE_KIND,doc:"Android DevTrial start"},{name:"browsers.chrome.devtrial.ios.start",kind:MILESTONE_KIND,doc:"iOS DevTrial start"},{name:"browsers.chrome.devtrial.webview.start",kind:MILESTONE_KIND,doc:"WebView DevTrial start"},{name:"browsers.chrome.ot.desktop.start",kind:MILESTONE_KIND,doc:"Desktop Origin Trial start"},{name:"browsers.chrome.ot.desktop.end",kind:MILESTONE_KIND,doc:"Desktop Origin Trial end"},{name:"browsers.chrome.ot.android.start",kind:MILESTONE_KIND,doc:"Android Origin Trial start"},{name:"browsers.chrome.ot.android.end",kind:MILESTONE_KIND,doc:"Android Origin Trial end"},{name:"browsers.chrome.ot.webview.start",kind:MILESTONE_KIND,doc:"WebView Origin Trial start"},{name:"browsers.chrome.ot.webview.end",kind:MILESTONE_KIND,doc:"WebView Origin Trial end"},{name:"rollout_milestone",kind:MILESTONE_KIND,doc:"Stable rollout milestone"},{name:"rollout_stage_plan",kind:ENUM_KIND,doc:"Stage rollout plan"},{name:"any_start_milestone",kind:MILESTONE_KIND,doc:"A milestone in which the feature is scheduled to ship or start an origin trial or dev trial, on any platform"},{name:"category",kind:ENUM_KIND,doc:"Feature category",choices:FEATURE_CATEGORIES},{name:"enterprise_product_category",kind:ENUM_KIND,doc:"Enterprise product category",choices:ENTERPRISE_PRODUCT_CATEGORY},{name:"feature_type",kind:ENUM_KIND,doc:"Feature type",choices:FEATURE_TYPES},{name:"impl_status_chrome",kind:ENUM_KIND,doc:"Implementation status",choices:IMPLEMENTATION_STATUS},{name:"intent_stage",kind:ENUM_KIND,doc:"Spec process stage",choices:INTENT_STAGES},{name:"security_review_status",kind:ENUM_KIND,doc:"Security review status",choices:REVIEW_STATUS_CHOICES},{name:"privacy_review_status",kind:ENUM_KIND,doc:"Privacy review status",choices:REVIEW_STATUS_CHOICES},{name:"tag_review_status",kind:ENUM_KIND,doc:"TAG Specification Review Status",choices:REVIEW_STATUS_CHOICES},{name:"browsers.webkit.view",kind:ENUM_KIND,doc:"WebKit views",choices:VENDOR_VIEWS_COMMON},{name:"browsers.ff.view",kind:ENUM_KIND,doc:"Firefox views",choices:VENDOR_VIEWS_GECKO},{name:"browsers.webdev.view",kind:ENUM_KIND,doc:"Web / Framework developer views",choices:WEB_DEV_VIEWS},{name:"accurate_as_of",kind:DATE_KIND,doc:"When the feature's fields were last verified"}];var __decorate$16=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let searchHelpDialogEl;async function openSearchHelpDialog(){searchHelpDialogEl||(searchHelpDialogEl=document.createElement("chromedash-search-help-dialog"),document.body.appendChild(searchHelpDialogEl),await searchHelpDialogEl.updateComplete),searchHelpDialogEl.show()}let ChromedashSearchHelpDialog=class ChromedashSearchHelpDialog extends i$4{static get styles(){return[...SHARED_STYLES,i$7` + h3 { + margin: var(--content-padding-large) 0; + } + section { + margin-left: var(--content-padding); + } + p { + margin: var(--content-padding-half) 0; + } + #dialog-content { + max-width: 60rem; + } + li { + margin-left: var(--content-padding); + } + `]}show(){this.renderRoot.querySelector("sl-dialog")?.show()}hide(){this.renderRoot.querySelector("sl-dialog")?.hide()}renderExampleRow(terms,explanation){return x$1` + <tr> + <td>${terms.map(term=>x$1`<div><code>${term}</code></div>`)}</td> + <td>${explanation}</td> + </tr> + `}renderCommonSearchExamples(){return x$1` + <h3>Common search examples</h3> + <section> + <table class="data-table"> + ${this.renderExampleRow(["memory","memory pool","memory -pool"],"Features that include or exclude words in any field.")} + ${this.renderExampleRow(["browsers.chrome.desktop:123","browsers.chrome.desktop:current_stable+1"],"Features shipping in the specified milestone.")} + ${this.renderExampleRow(["browsers.chrome.desktop:120..122","browsers.chrome.desktop:current_stable-1..current_stable+1"],"Features shipping in a milestone range.")} + ${this.renderExampleRow(["owner:user@example.com"],"Features with the specified owner.")} + ${this.renderExampleRow(["created.when>2024-01-01","created.when<now-8w","updated.when:2023-01-01..2023-12-31"],"Features created or modified before or after a date.")} + ${this.renderExampleRow(["feature_type:\"Feature deprecation\"","feature_type!=\"Feature deprecation\"","-feature_type:\"Feature deprecation\""],"Features of a specific type or excluding a type.")} + ${this.renderExampleRow(["category:CSS,DOM"],"Features that have a value in a comma-separated list.")} + ${this.renderExampleRow(["category:CSS OR category:DOM"],"Combine two query clauses with a logical-OR.")} + </table> + </section> + `}renderSearchSyntax(){return x$1` + <h3>Search syntax</h3> + <section> + <p> + A search query consists of a series of terms that are separated by + spaces. Terms can be single words or conditions. + </p> + + <p> + When searching for words, the results will include features that + include those words in any field of the feature entry. We do not + support searching for wildcards, partial words, punctuation, or quoted + phrases. + </p> + + <p> + When searching using conditions, each condition consists of three + parts: FIELD OPERATOR VALUE(S) + </p> + + <ul> + <li>FIELD: One of the fields listed below.</li> + <li> + OPERATOR: Usually a colon, but it can be an inequality for numeric, + date, or enum fields. The colon operator does case-insensitive + matching of words within a text field, while an equals-sign does + exact matching of an entire string value. + </li> + <li> + VALUE(S): A single word, number, date, or enum value listed below. + If the value contains spaces, it must be inside double quotes. + <ul> + <li> + Use the equals operator with a comma-separated list to match any + value in that list. + </li> + <li> + Use the equals operator with two number or date values separated + by "<code>..</code>" to find any value between or including + those endpoints. The left value must be less than the right + value. + </li> + <li> + For dates, you can compute a date a certain number of days or + weeks before or after now. "<code>now-3d</code>" is 3 days ago, + and "<code>now+2w</code>" is 2 weeks from now. + </li> + <li> + For milestones, you can compute a milestone relative to the + current stable version of Chrome. + "<code>current_stable+1</code>" is 1 version after the current + stable version. + </li> + </ul> + </li> + </ul> + + <p> + You may negate any search term by prefixing it with a minus sign. + Search terms are implicitly joined together by a logical-AND. However, + you may type the keyword <code>OR</code> between terms as a logical-OR + operator. We do not support parenthesis in queries. + </p> + </section> + `}renderFieldRow(queryField){if(queryField.choices){const choiceItems=Object.values(queryField.choices).map(c=>x$1` <div>${queryField.name}:"${c[1]}"</div> `);return x$1` + <tr> + <td> + <code>${choiceItems}</code> + </td> + <td>${queryField.doc}</td> + </tr> + `}return x$1` + <tr> + <td> + <code>${queryField.name}:<i>${queryField.kind}</i></code> + </td> + <td>${queryField.doc}</td> + </tr> + `}renderFieldList(){return x$1` + <h3>Available search fields</h3> + <section> + <table class="data-table"> + ${QUERIABLE_FIELDS.map(qf=>this.renderFieldRow(qf))} + </table> + </section> + `}renderDialogContent(){return x$1` + <div id="dialog-content"> + ${this.renderCommonSearchExamples()} ${this.renderSearchSyntax()} + ${this.renderFieldList()} + </div> + `}render(){return x$1` + <sl-dialog + class="missing-prereqs" + label="Feature Search Help" + style="--width:fit-content" + > + ${this.renderDialogContent()} + </sl-dialog> + `}};ChromedashSearchHelpDialog=__decorate$16([t$3("chromedash-search-help-dialog")],ChromedashSearchHelpDialog);var __decorate$15=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};function convertQueriableFieldToVocabularyItems(qf){if(qf.choices===void 0)return[{group:qf.name,name:qf.name+":",doc:qf.doc}];const result=[];for(const ch in qf.choices){const label=qf.choices[ch][1];result.push({group:qf.name,name:qf.name+":\""+label+"\"",doc:qf.doc})}return result}const VOCABULARY=QUERIABLE_FIELDS.map(convertQueriableFieldToVocabularyItems).flat();let ChromedashFeatureFilter=class ChromedashFeatureFilter extends i$4{constructor(){super(...arguments),this.typeaheadRef=e$1(),this.query="",this.handleDocumentKeyUp=e=>{const inInputContext=e.composedPath().some(el=>["INPUT","TEXTAREA","SL-POPUP","SL-DIALOG"].includes(el.tagName));"/"!==e.key||inInputContext||(e.preventDefault(),e.stopPropagation(),(this.typeaheadRef?.value).focus())}}_fireEvent(eventName,detail){const event=new CustomEvent(eventName,{bubbles:!0,composed:!0,detail});this.dispatchEvent(event)}connectedCallback(){super.connectedCallback(),document.addEventListener("keyup",this.handleDocumentKeyUp)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keyup",this.handleDocumentKeyUp)}handleSearchClick(){const typeahead=this.typeaheadRef.value;if(typeahead){typeahead.hide();const newQuery=typeahead.value.trim();this._fireEvent("search",{query:newQuery})}}static get styles(){return[...SHARED_STYLES,i$7` + sl-icon-button { + font-size: 1.6rem; + margin: 0 !important; + } + `]}showHelp(event){event.stopPropagation();const typeahead=this.typeaheadRef.value;typeahead&&(typeahead.hide(),openSearchHelpDialog())}render(){return x$1` + <chromedash-typeahead + ${n$2(this.typeaheadRef)} + value=${this.query} + placeholder="Search" + .vocabulary=${VOCABULARY} + @sl-change=${this.handleSearchClick} + > + <sl-icon-button + library="material" + name="search" + slot="prefix" + @click="${this.handleSearchClick}" + > + </sl-icon-button> + <sl-icon-button + library="material" + name="help_20px" + slot="suffix" + @click="${this.showHelp}" + > + </sl-icon-button> + </chromedash-typeahead> + `}};__decorate$15([n$5({type:String})],ChromedashFeatureFilter.prototype,"query",void 0),ChromedashFeatureFilter=__decorate$15([t$3("chromedash-feature-filter")],ChromedashFeatureFilter);function*o$1(o,t,e=1){const i=void 0===t?0:o;t??=o;for(let o=i;0<e?o<t:t<o;o+=e)yield o}function*o(o,f){if(void 0!==o){let i=0;for(const t of o)yield f(t,i++)}}var __decorate$14=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashFeaturePagination=class ChromedashFeaturePagination extends i$4{constructor(){super(...arguments),this.totalCount=0,this.start=0,this.pageSize=100}static get styles(){return[SHARED_STYLES,i$7` + .active { + background: var(--light-grey); + } + .stepper { + width: 7em; + } + .pagination { + padding: var(--content-padding-half) 0; + min-height: 50px; + } + .pagination span { + color: var(--unimportant-text-color); + margin-right: var(--content-padding); + } + sl-button::part(base):hover { + background: var(--sl-color-blue-100); + } + .pagination sl-icon-button { + font-size: 1.6rem; + } + .pagination sl-icon-button::part(base) { + padding: 0; + } + #items-per-page { + align-self: center; + color: var(--unimportant-text-color); + font-size: var(--sl-input-font-size-small); + } + sl-select { + align-self: center; + display: inline-block; + margin: 0 var(--content-padding-quarter) 0 var(--content-padding); + width: 7em; + } + `]}renderPageButtons(){var _Mathceil=Math.ceil,_Mathfloor=Math.floor;if(void 0===this.totalCount||0===this.totalCount)return x$1``;const currentPage=_Mathfloor(this.start/this.pageSize),numPages=_Mathceil(this.totalCount/this.pageSize);let missingFront=!1,missingBack=!1,hasLastPage=1<numPages,displayPages=[];const displaySet=new Set;for(const digit of o$1(numPages))if(0!==digit&&digit!==numPages-1){if(10>=numPages){displaySet.add(digit);continue}if(digit<currentPage-4){missingFront=!0;continue}if(digit>currentPage+4){missingBack=!0;continue}displaySet.add(digit)}return displayPages=Array.from(displaySet),x$1` + <sl-button + variant="text" + id="jump_1" + class="page-button ${0===currentPage?"active":""}" + href=${formatUrlForOffset(0)} + > + ${1} + </sl-button> + ${missingFront?x$1`<div>...</div>`:E$1} + ${o(displayPages,i=>x$1` + <sl-button + variant="text" + id="jump_${i+1}" + class="page-button ${i===currentPage?"active":""}" + href=${formatUrlForOffset(i*this.pageSize)} + > + ${i+1} + </sl-button> + `)} + ${missingBack?x$1`<div>...</div>`:E$1} + ${hasLastPage?x$1`<sl-button + variant="text" + id="jump_${numPages}" + class="page-button ${numPages-1===currentPage?"active":""}" + href=${formatUrlForOffset((numPages-1)*this.pageSize)} + > + ${numPages} + </sl-button>`:E$1} + `}setItemsPerPage(event){const target=event.target,newSize=parseInt(target.value),newURL=formatURLParams("num",newSize).toString();window.location.href=newURL}renderItemsPerPage(){const options=[25,50,100];return options.includes(this.pageSize)||(options.push(this.pageSize),options.sort((a,b)=>a-b)),x$1` + <sl-select + value="${this.pageSize}" + size="small" + @sl-change=${this.setItemsPerPage} + > + ${options.map(opt=>x$1` + <sl-option id="opt_${opt}" value=${opt}>${opt}</sl-option> + `)} + </sl-select> + <span id="items-per-page"> items per page </span> + `}render(){if(this.totalCount===void 0||0===this.totalCount)return x$1``;const prevUrl=formatUrlForRelativeOffset(this.start,-this.pageSize,this.pageSize,this.totalCount),nextUrl=formatUrlForRelativeOffset(this.start,this.pageSize,this.pageSize,this.totalCount);return x$1` + <div id="main" class="pagination hbox halign-items-space-between"> + <div class="spacer"></div> + <sl-button + variant="text" + id="previous" + class="stepper" + href=${o$6(prevUrl)} + ?disabled=${prevUrl===void 0} + >Previous</sl-button + > + + ${this.renderPageButtons()} + + <sl-button + variant="text" + id="next" + class="stepper" + href=${o$6(nextUrl)} + ?disabled=${nextUrl===void 0} + >Next</sl-button + > + + ${this.renderItemsPerPage()} + + <div class="spacer"></div> + </div> + `}};__decorate$14([n$5({type:Number})],ChromedashFeaturePagination.prototype,"totalCount",void 0),__decorate$14([n$5({type:Number})],ChromedashFeaturePagination.prototype,"start",void 0),__decorate$14([n$5({type:Number})],ChromedashFeaturePagination.prototype,"pageSize",void 0),ChromedashFeaturePagination=__decorate$14([t$3("chromedash-feature-pagination")],ChromedashFeaturePagination);var __decorate$13=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashFeatureRow=class ChromedashFeatureRow extends i$4{constructor(){super(...arguments),this.columns=void 0,this.canEdit=!1,this.signedIn=!1,this.starredFeatures=new Set,this.gates={},this.selectedGateId=0}static get styles(){return[...SHARED_STYLES,i$7` + :host { + display: table-row; + background: var(--table-row-background); + } + td { + padding: var(--content-padding-half); + border-bottom: var(--table-divider); + } + td.name_col { + width: 100%; + } + td.icon_col { + white-space: nowrap; + vertical-align: top; + } + td.icon_col a { + padding: 2px 4px; + } + td.icon_col a:hover { + text-decoration: none; + } + .quick_actions { + white-space: nowrap; + float: right; + } + .highlights { + padding-left: var(--content-padding); + } + .highlights div { + color: var(--unimportant-text-color); + padding: var(--content-padding-quarter); + } + sl-icon-button { + font-size: 1.3rem; + } + sl-icon-button::part(base) { + color: var(--link-color); + } + `]}_fireEvent(eventName,detail){const event=new CustomEvent(eventName,{bubbles:!0,composed:!0,detail});this.dispatchEvent(event)}toggleStar(e){e.preventDefault(),e.stopPropagation();const iconEl=e.target,featureId=+iconEl.dataset.featureId,newStarred=!this.starredFeatures.has(featureId);this._fireEvent("star-toggle-event",{featureId:featureId,doStar:newStarred})}renderStarIcon(feature){return x$1` + <sl-icon-button + @click=${this.toggleStar} + title="Receive an email notification when there are updates" + library="material" + name="${this.starredFeatures.has(+feature.id)?"star":"star_border"}" + data-feature-id="${feature.id}" + ></sl-icon-button> + `}renderIcons(feature){return this.signedIn?x$1` ${this.renderStarIcon(feature)} `:E$1}renderQuickActions(feature){if("approvals"==this.columns){const threadLinks=feature?[]:[];return x$1` <span class="quick_actions"> ${threadLinks} </span> `}return E$1}isActiveGate(gate){return GATE_ACTIVE_REVIEW_STATES.includes(gate.state)}getActiveStages(feature){const featureGates=this.gates[feature.id]||[],activeGates=featureGates.filter(g=>this.isActiveGate(g)),activeStageIds=new Set(activeGates.map(g=>g.stage_id)),activeStagesAndTheirGates=[];for(const stage of feature.stages){activeStageIds.has(stage.id)&&activeStagesAndTheirGates.push({stage:stage,gates:featureGates.filter(g=>g.stage_id==stage.id)});for(const extension of stage.extensions||[])activeStageIds.has(extension.id)&&activeStagesAndTheirGates.push({stage:extension,gates:featureGates.filter(g=>g.stage_id==extension.id)})}return activeStagesAndTheirGates}getStageShortName(stage){return STAGE_SHORT_NAMES[stage.stage_type]?`${STAGE_SHORT_NAMES[stage.stage_type]}: `:E$1}renderActiveStageAndGates(stageAndGates){const sortedGates=stageAndGates.gates;return sortedGates.sort((g1,g2)=>GATE_TEAM_ORDER.indexOf(g1.team_name)-GATE_TEAM_ORDER.indexOf(g2.team_name)),x$1` + <div> + ${this.getStageShortName(stageAndGates.stage)} + ${sortedGates.map(gate=>x$1` + <chromedash-gate-chip + .feature=${this.feature} + .stage=${stageAndGates.stage} + .gate=${gate} + selectedGateId=${this.selectedGateId} + ></chromedash-gate-chip> + `)} + </div> + `}renderHighlights(feature){if("approvals"==this.columns){const activeStages=this.getActiveStages(feature);return x$1` + <div class="highlights"> + ${0<activeStages.length?x$1` + <div> + ${activeStages.map(stageAndGates=>this.renderActiveStageAndGates(stageAndGates))} + </div> + `:E$1} + ${this.renderQuickActions(feature)} + </div> + `}return E$1}render(){const feature=this.feature;return x$1` + <td class="name_col"> + <a href="/feature/${feature.id}">${feature.name}</a> + ${this.renderHighlights(feature)} + </td> + <td class="icon_col">${this.renderIcons(feature)}</td> + `}};__decorate$13([n$5({attribute:!1})],ChromedashFeatureRow.prototype,"feature",void 0),__decorate$13([n$5({type:String})],ChromedashFeatureRow.prototype,"columns",void 0),__decorate$13([n$5({type:Boolean})],ChromedashFeatureRow.prototype,"canEdit",void 0),__decorate$13([n$5({type:Boolean})],ChromedashFeatureRow.prototype,"signedIn",void 0),__decorate$13([n$5({attribute:!1})],ChromedashFeatureRow.prototype,"starredFeatures",void 0),__decorate$13([n$5({attribute:!1})],ChromedashFeatureRow.prototype,"gates",void 0),__decorate$13([n$5({type:Number})],ChromedashFeatureRow.prototype,"selectedGateId",void 0),ChromedashFeatureRow=__decorate$13([t$3("chromedash-feature-row")],ChromedashFeatureRow);var __decorate$12=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashFeatureTable=class ChromedashFeatureTable extends i$4{constructor(){super(...arguments),this.loading=!0,this.reloading=!1,this.features=[],this.totalCount=0,this.start=0,this.query="",this.showEnterprise=!1,this.sortSpec="",this.showQuery=!1,this.starredFeatures=new Set,this.num=100,this.alwaysOfferPagination=!1,this.noResultsMessage="No results",this.noPaginatedResultsMessage="No results on this pagination page",this.canEdit=!1,this.gates={},this.selectedGateId=0,this.nameOnly=!1}connectedCallback(){super.connectedCallback(),this.fetchFeatures(!0)}fetchFeatures(isInitialLoad=!1){this.loading=isInitialLoad,this.reloading=!isInitialLoad,window.csClient.searchFeatures(this.query,this.showEnterprise,this.sortSpec,this.start,this.num,this.nameOnly).then(resp=>{this.features=resp.features,this.totalCount=resp.total_count,this.loading=!1,this.reloading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")}),"approvals"==this.columns&&this.loadGateData()}refetch(){this.fetchFeatures()}loadGateData(){window.csClient.getPendingGates().then(res=>{const gatesByFID={};for(const g of res.gates)gatesByFID.hasOwnProperty(g.feature_id)||(gatesByFID[g.feature_id]=[]),gatesByFID[g.feature_id].push(g);this.gates=gatesByFID}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}updated(changedProperties){"starred-by:me"==this.query&&!this.loading&&changedProperties.has("starredFeatures")&&this.fetchFeatures()}handleSearch(event){this.loading=!0,this.query=event.detail.query,this.start=0,this.fetchFeatures()}static get styles(){return[...SHARED_STYLES,i$7` + .status-and-count { + padding: var(--content-padding-half) 0; + min-height: 50px; + } + .status-and-count span { + color: var(--unimportant-text-color); + margin-right: var(--content-padding); + } + .status-and-count sl-icon-button { + font-size: 1.6rem; + } + .status-and-count sl-icon-button::part(base) { + padding: 0; + } + table { + width: 100%; + } + .skel td { + background: white; + padding: 14px; + border-bottom: var(--table-divider); + } + sl-skeleton { + height: 24px; + } + .message { + padding: var(--content-padding); + } + `]}renderMessages(){return this.loading?x$1` + <tr class="skel"> + <td> + <sl-skeleton effect="sheen" style="width: 50%"></sl-skeleton> + </td> + </tr> + <tr class="skel"> + <td> + <sl-skeleton effect="sheen" style="width: 65%"></sl-skeleton> + </td> + </tr> + <tr class="skel"> + <td> + <sl-skeleton effect="sheen" style="width: 40%"></sl-skeleton> + </td> + </tr> + <tr class="skel"> + <td> + <sl-skeleton effect="sheen" style="width: 50%"></sl-skeleton> + </td> + </tr> + `:0==this.totalCount?x$1` + <tr> + <td class="message">${this.noResultsMessage}</td> + </tr> + `:!!(0==this.features.length&&0<this.start)&&x$1` + <tr> + <td class="message">${this.noPaginatedResultsMessage}</td> + </tr> + `}renderSearch(){return this.showQuery?x$1` + <chromedash-feature-filter + .query=${this.query} + @search="${this.handleSearch}" + ></chromedash-feature-filter> + `:E$1}renderLoadingStatusAndCount(){const firstShown=this.start+1,lastShown=this.start+this.features.length,prevUrl=formatUrlForRelativeOffset(this.start,-this.num,this.num,this.totalCount),nextUrl=formatUrlForRelativeOffset(this.start,this.num,this.num,this.totalCount);if(this.alwaysOfferPagination){if(this.loading)return x$1` <div class="status-and-count"> + <sl-skeleton effect="sheen" style="float: right; width: 12em"> + </sl-skeleton> + </div>`;}else if(this.loading||1==firstShown&&lastShown==this.totalCount)return E$1;return 0===this.features.length?E$1:x$1` + <div class="status-and-count hbox"> + <span>${this.reloading?"Reloading...":E$1}</span> + <div class="spacer"></div> + <span>${firstShown} - ${lastShown} of ${this.totalCount}</span> + <sl-icon-button + library="material" + name="navigate_before" + title="Previous page" + href=${o$6(prevUrl)} + ?disabled=${void 0===prevUrl} + ></sl-icon-button> + <sl-icon-button + library="material" + name="navigate_next" + title="Next page" + href=${o$6(nextUrl)} + ?disabled=${void 0===nextUrl} + ></sl-icon-button> + </div> + `}renderPagination(features){const firstShown=this.start+1,lastShown=this.start+features.length;if(this.alwaysOfferPagination){if(this.loading)return x$1` <div class="pagination"> + <sl-skeleton effect="sheen" style="float: right; width: 12em"> + </sl-skeleton> + </div>`;}else if(this.loading||1==firstShown&&lastShown==this.totalCount)return E$1;return 0===features.length?E$1:x$1` + <chromedash-feature-pagination + pageSize=${this.num} + start=${this.start} + totalCount=${this.totalCount} + > + </chromedash-feature-pagination> + `}renderFeature(feature){return x$1` + <chromedash-feature-row + .feature=${feature} + columns=${this.columns} + ?signedIn=${this.signedIn} + ?canEdit=${this.canEdit} + .starredFeatures=${this.starredFeatures} + .gates=${this.gates} + selectedGateId=${this.selectedGateId} + ></chromedash-feature-row> + `}render(){return x$1` + ${this.renderSearch()} ${this.renderLoadingStatusAndCount()} + <table> + ${this.renderMessages()||this.features.map(feature=>this.renderFeature(feature))} + </table> + ${this.renderPagination(this.features)} + `}};__decorate$12([r$6()],ChromedashFeatureTable.prototype,"loading",void 0),__decorate$12([r$6()],ChromedashFeatureTable.prototype,"reloading",void 0),__decorate$12([r$6()],ChromedashFeatureTable.prototype,"features",void 0),__decorate$12([r$6()],ChromedashFeatureTable.prototype,"totalCount",void 0),__decorate$12([n$5({type:Number,attribute:!1})],ChromedashFeatureTable.prototype,"start",void 0),__decorate$12([n$5({type:String})],ChromedashFeatureTable.prototype,"query",void 0),__decorate$12([n$5({type:Boolean})],ChromedashFeatureTable.prototype,"showEnterprise",void 0),__decorate$12([n$5({type:String,attribute:!1})],ChromedashFeatureTable.prototype,"sortSpec",void 0),__decorate$12([n$5({type:Boolean})],ChromedashFeatureTable.prototype,"showQuery",void 0),__decorate$12([n$5({type:Object,attribute:!1})],ChromedashFeatureTable.prototype,"starredFeatures",void 0),__decorate$12([n$5({type:Number,attribute:!1})],ChromedashFeatureTable.prototype,"num",void 0),__decorate$12([n$5({type:Boolean})],ChromedashFeatureTable.prototype,"alwaysOfferPagination",void 0),__decorate$12([n$5({type:String})],ChromedashFeatureTable.prototype,"noResultsMessage",void 0),__decorate$12([n$5({type:String})],ChromedashFeatureTable.prototype,"noPaginatedResultsMessage",void 0),__decorate$12([n$5({type:Boolean})],ChromedashFeatureTable.prototype,"canEdit",void 0),__decorate$12([n$5({type:Object})],ChromedashFeatureTable.prototype,"gates",void 0),__decorate$12([n$5({type:Number})],ChromedashFeatureTable.prototype,"selectedGateId",void 0),__decorate$12([n$5({type:String})],ChromedashFeatureTable.prototype,"columns",void 0),__decorate$12([n$5({type:Boolean})],ChromedashFeatureTable.prototype,"signedIn",void 0),__decorate$12([n$5({type:Boolean})],ChromedashFeatureTable.prototype,"nameOnly",void 0),ChromedashFeatureTable=__decorate$12([t$3("chromedash-feature-table")],ChromedashFeatureTable);var __decorate$11=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashAllFeaturesPage=class ChromedashAllFeaturesPage extends i$4{constructor(){super(...arguments),this.title="Features",this.showQuery=!0,this.selectedGateId=0,this.rawQuery={},this.query="",this.columns="normal",this.showEnterprise=!1,this.sortSpec="",this.start=0,this.num=100,this.starredFeatures=new Set,this.isNewfeaturesPage=!1,this.nameOnly=!1}static get styles(){return[SHARED_STYLES,i$7` + #content-title { + padding-top: var(--content-padding); + } + `]}connectedCallback(){super.connectedCallback(),this.initializeParams(),this.fetchData()}initializeParams(){var _NumberisNaN=Number.isNaN;this.rawQuery&&(null!=this.rawQuery.q&&(this.query=this.rawQuery.q),null!=this.rawQuery.columns&&(this.columns=this.rawQuery.columns),null!=this.rawQuery.enterprise&&(this.showEnterprise=!0),null!=this.rawQuery.sort&&(this.sortSpec=this.rawQuery.sort),null!=this.rawQuery.start&&!_NumberisNaN(parseInt(this.rawQuery.start))&&(this.start=parseInt(this.rawQuery.start)),null!=this.rawQuery.num&&!_NumberisNaN(parseInt(this.rawQuery.num))&&(this.num=parseInt(this.rawQuery.num),this.num=Math.max(1,Math.min(this.num,1e3))),this.isNewfeaturesPage&&(this.nameOnly=!0))}fetchData(){window.csClient.getStars().then(starredFeatures=>{this.starredFeatures=new Set(starredFeatures)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}refetch(){const tables=this.chromedashFeatureTables;for(const table of tables)table.refetch()}handleStarToggle(e){const newStarredFeatures=new Set(this.starredFeatures);window.csClient.setStar(e.detail.featureId,e.detail.doStar).then(()=>{e.detail.doStar?newStarredFeatures.add(e.detail.featureId):newStarredFeatures.delete(e.detail.featureId),this.starredFeatures=newStarredFeatures}).catch(()=>{alert("Unable to star the Feature. Please Try Again.")})}renderFeatureList(){return x$1` + <chromedash-feature-table + .query=${this.query} + ?showEnterprise=${this.showEnterprise} + .sortSpec=${this.sortSpec} + .start=${this.start} + .num=${this.num} + .nameOnly=${this.nameOnly} + ?showQuery=${this.showQuery} + ?signedIn=${!!this.user} + ?canEdit=${this.user&&this.user.can_edit_all} + .starredFeatures=${this.starredFeatures} + @star-toggle-event=${this.handleStarToggle} + selectedGateId=${this.selectedGateId} + alwaysOfferPagination + columns=${this.columns} + > + </chromedash-feature-table> + `}render(){const adminNotice=this.user?.is_admin&&"approvals"===this.columns?x$1`<p> + You see all pending approvals because you're a site admin. + </p>`:E$1;return x$1` + <div id="content-title"> + <h2>${this.title}</h2> + </div> + ${adminNotice} ${this.renderFeatureList()} + `}};__decorate$11([n$5({type:String})],ChromedashAllFeaturesPage.prototype,"title",void 0),__decorate$11([n$5({type:Boolean})],ChromedashAllFeaturesPage.prototype,"showQuery",void 0),__decorate$11([n$5({type:Object})],ChromedashAllFeaturesPage.prototype,"user",void 0),__decorate$11([n$5({type:Number})],ChromedashAllFeaturesPage.prototype,"selectedGateId",void 0),__decorate$11([n$5({type:Object})],ChromedashAllFeaturesPage.prototype,"rawQuery",void 0),__decorate$11([r$6()],ChromedashAllFeaturesPage.prototype,"query",void 0),__decorate$11([r$6()],ChromedashAllFeaturesPage.prototype,"columns",void 0),__decorate$11([r$6()],ChromedashAllFeaturesPage.prototype,"showEnterprise",void 0),__decorate$11([r$6()],ChromedashAllFeaturesPage.prototype,"sortSpec",void 0),__decorate$11([r$6()],ChromedashAllFeaturesPage.prototype,"start",void 0),__decorate$11([r$6()],ChromedashAllFeaturesPage.prototype,"num",void 0),__decorate$11([r$6()],ChromedashAllFeaturesPage.prototype,"starredFeatures",void 0),__decorate$11([r$6()],ChromedashAllFeaturesPage.prototype,"isNewfeaturesPage",void 0),__decorate$11([r$6()],ChromedashAllFeaturesPage.prototype,"nameOnly",void 0),__decorate$11([r$5("chromedash-feature-table")],ChromedashAllFeaturesPage.prototype,"chromedashFeatureTables",void 0),ChromedashAllFeaturesPage=__decorate$11([t$3("chromedash-all-features-page")],ChromedashAllFeaturesPage);var __decorate$10=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};class ChromedashAmendment extends i$4{constructor(){super(...arguments),this.amendment={field_name:"",old_value:"",new_value:""}}static get styles(){return[...SHARED_STYLES,i$7` + details { + color: var(--unimportant-text-color); + } + `]}render(){return x$1` + <details> + <summary> + <b>${this.amendment.field_name}</b>: + <span id="preview">${this.amendment.new_value}</span> + </summary> + + <div> + <b>Old</b>: + <div>${this.amendment.old_value}</div> + </div> + + <div> + <b>New</b>: + <div>${this.amendment.new_value}</div> + </div> + </details> + `}}__decorate$10([n$5({type:Object})],ChromedashAmendment.prototype,"amendment",void 0),customElements.define("chromedash-amendment",ChromedashAmendment);class ChromedashActivity extends i$4{constructor(){super(...arguments),this.user=null,this.featureId=0,this.activity=null,this.narrow=!1}static get styles(){return[...SHARED_STYLES,i$7` + .comment_header { + min-height: 24px; + } + + .comment_header.narrow .author { + font-weight: 500; + } + .comment_header.narrow .preposition { + display: none; + } + .comment_header.narrow .date { + display: block; + padding-bottom: var(--content-padding); + } + + .comment { + background: var(--accordion-background); + border-radius: var(--large-border-radius); + padding: var(--content-padding-half); + margin-bottom: var(--content-padding); + margin-right: var(--content-padding); + } + + .comment-menu-icon { + float: right; + margin-right: 8px; + cursor: pointer; + } + + .comment_body { + padding: var(--content-padding-half); + white-space: pre-wrap; + } + + p { + padding: 1em; + } + `]}isEditable(){return!!this.user&&(this.activity.deleted_by?this.user.is_admin||this.activity.deleted_by===this.user.email:this.user.email===this.activity.author||this.user.is_admin)}renderDeletedPreface(){return this.isEditable()&&this.activity.deleted_by?x$1`<div style="color: darkred"> + [Deleted] (comment hidden for other users) + </div>`:E$1}formatEditMenu(){if(!this.isEditable())return E$1;let menuItem=x$1` <sl-menu-item + @click="${()=>this.handleDelete(!1)}" + >Delete Comment</sl-menu-item + >`;return this.activity.deleted_by&&(menuItem=x$1` <sl-menu-item @click="${()=>this.handleDelete(!0)}" + >Undelete Comment</sl-menu-item + >`),x$1` <sl-dropdown class="comment-menu-icon"> + <sl-icon-button + library="material" + name="more_vert_24px" + label="Comment menu" + slot="trigger" + ></sl-icon-button> + <sl-menu>${menuItem}</sl-menu> + </sl-dropdown>`}render(){if(!this.activity)return E$1;const preface=this.renderDeletedPreface();return x$1` + <div class="comment"> + <div class="comment_header ${this.narrow?"narrow":""}"> + ${this.formatEditMenu()} + <span class="author">${this.activity.author}</span> + <span class="preposition">on</span> + <span class="date"> + ${renderAbsoluteDate(this.activity.created,!0)} + ${renderRelativeDate(this.activity.created)} + </span> + </div> + <div id="amendments"> + ${this.activity.amendments.map(a=>x$1` + <chromedash-amendment .amendment=${a}></chromedash-amendment> + `)} + </div> + <!-- prettier-ignore --> + <div class="comment_body">${preface}${autolink(this.activity.content)}</div> + </div> + `}async handleDelete(isUndelete){let resp;resp=isUndelete?await window.csClient.undeleteComment(this.featureId,this.activity.comment_id):await window.csClient.deleteComment(this.featureId,this.activity.comment_id),resp&&"Done"===resp.message&&(this.activity.deleted_by=isUndelete?null:this.user.email,this.requestUpdate())}}__decorate$10([n$5({type:Object})],ChromedashActivity.prototype,"user",void 0),__decorate$10([n$5({type:Number})],ChromedashActivity.prototype,"featureId",void 0),__decorate$10([n$5({type:Object})],ChromedashActivity.prototype,"activity",void 0),__decorate$10([n$5({type:Boolean})],ChromedashActivity.prototype,"narrow",void 0),customElements.define("chromedash-activity",ChromedashActivity);class ChromedashActivityLog extends i$4{constructor(){super(...arguments),this.user=null,this.featureId=0,this.comments=[],this.narrow=!1,this.reverse=!1,this.loading=!1}static get styles(){return[...SHARED_STYLES,i$7` + p { + padding: var(--content-padding); + } + `]}render(){if(this.loading)return x$1`<p>Loading...</p>`;if(void 0===this.comments||0===this.comments.length)return x$1`<p>No comments yet.</p>`;const orderedComments=this.reverse?this.comments.slice(0).reverse():this.comments;return orderedComments.map(activity=>x$1` + <chromedash-activity + .user=${this.user} + .featureId=${this.featureId} + .narrow=${this.narrow} + .activity=${activity} + > + </chromedash-activity> + `)}}__decorate$10([n$5({type:Object})],ChromedashActivityLog.prototype,"user",void 0),__decorate$10([n$5({type:Number})],ChromedashActivityLog.prototype,"featureId",void 0),__decorate$10([n$5({type:Array})],ChromedashActivityLog.prototype,"comments",void 0),__decorate$10([n$5({type:Boolean})],ChromedashActivityLog.prototype,"narrow",void 0),__decorate$10([r$6()],ChromedashActivityLog.prototype,"reverse",void 0),__decorate$10([r$6()],ChromedashActivityLog.prototype,"loading",void 0),customElements.define("chromedash-activity-log",ChromedashActivityLog);var __decorate$$=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashActivityPage=class ChromedashActivityPage extends i$4{constructor(){super(...arguments),this.commentAreaRef=e$1(),this.featureId=0,this.comments=[],this.loading=!0,this.needsPost=!1,this.contextLink=""}static get styles(){return[...SHARED_STYLES,i$7` + .instructions { + padding: var(--content-padding-half); + margin-bottom: var(--content-padding-large); + margin-left: 10px; + } + + #comment_area { + margin: 0 var(--content-padding); + } + #header { + margin-bottom: 10px; + margin-left: 15px; + } + #controls { + padding: var(--content-padding); + text-align: right; + display: flex; + justify-content: space-between; + align-items: center; + } + #controls * + * { + padding-left: var(--content-padding); + } + `]}connectedCallback(){super.connectedCallback(),this.fetchComments()}fetchComments(){this.loading=!0,Promise.all([window.csClient.getComments(this.featureId,null)]).then(([commentRes])=>{this.comments=commentRes.comments,this.needsPost=!1,this.loading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}reloadComments(){const commentArea=this.commentAreaRef.value;commentArea.value="",this.needsPost=!1,Promise.all([window.csClient.getComments(this.featureId,null)]).then(([commentRes])=>{this.comments=commentRes.comments}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}checkNeedsPost(){let newNeedsPost=!1;const commentArea=this.commentAreaRef.value,newVal=commentArea&&commentArea.value.trim()||"";""!=newVal&&(newNeedsPost=!0),this.needsPost=newNeedsPost}handlePost(){const commentArea=this.commentAreaRef.value,commentText=commentArea.value.trim();""!=commentText&&window.csClient.postComment(this.featureId,null,commentText,0).then(()=>{this.reloadComments()}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}renderCommentsSkeleton(){return x$1` + <h2>Comments</h2> + <sl-skeleton effect="sheen"></sl-skeleton> + `}renderControls(){if(!this.user||!this.user.can_comment)return E$1;const postButton=x$1` + <sl-button + variant="primary" + @click=${this.handlePost} + ?disabled=${!this.needsPost} + size="small" + >Post</sl-button + > + `;return x$1` + <sl-textarea + id="comment_area" + rows="2" + cols="40" + resize="auto" + ${n$2(this.commentAreaRef)} + @sl-change=${this.checkNeedsPost} + @keypress=${this.checkNeedsPost} + placeholder="Add a comment" + ></sl-textarea> + <div class="instructions"> + Comments will be visible publicly. Only reviewers will be notified when + a comment is posted. + </div> + <div id="controls">${postButton}</div> + `}renderComments(){return x$1` + <div id="header"> + <h2 id="breadcrumbs"> + <a href="/feature/${this.featureId}"> + <sl-icon name="arrow-left"></sl-icon> + Comments & Activity + </a> + </h2> + </div> + ${this.renderControls()} + <chromedash-activity-log + .user=${this.user} + .featureId=${this.featureId} + .narrow=${!0} + .reverse=${!0} + .comments=${this.comments} + > + </chromedash-activity-log> + `}render(){return x$1` + ${this.loading?this.renderCommentsSkeleton():this.renderComments()} + `}};__decorate$$([n$5({type:Object})],ChromedashActivityPage.prototype,"user",void 0),__decorate$$([n$5({type:Number})],ChromedashActivityPage.prototype,"featureId",void 0),__decorate$$([n$5({type:Array})],ChromedashActivityPage.prototype,"comments",void 0),__decorate$$([r$6()],ChromedashActivityPage.prototype,"loading",void 0),__decorate$$([n$5({type:Boolean})],ChromedashActivityPage.prototype,"needsPost",void 0),__decorate$$([n$5({type:String})],ChromedashActivityPage.prototype,"contextLink",void 0),ChromedashActivityPage=__decorate$$([t$3("chromedash-activity-page")],ChromedashActivityPage);var isarray=Array.isArray||function(arr){return"[object Array]"==Object.prototype.toString.call(arr)},pathToRegexp_1=pathToRegexp,parse_1=parse$1,compile_1=compile,tokensToFunction_1=tokensToFunction,tokensToRegExp_1=tokensToRegExp,PATH_REGEXP=new RegExp("(\\\\.)|([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))","g");function parse$1(str){for(var tokens=[],key=0,index=0,path="",res;null!=(res=PATH_REGEXP.exec(str));){var m=res[0],escaped=res[1],offset=res.index;if(path+=str.slice(index,offset),index=offset+m.length,escaped){path+=escaped[1];continue}path&&(tokens.push(path),path="");var prefix=res[2],name=res[3],capture=res[4],group=res[5],suffix=res[6],asterisk=res[7],repeat="+"===suffix||"*"===suffix,optional="?"===suffix||"*"===suffix,delimiter=prefix||"/",pattern=capture||group||(asterisk?".*":"[^"+delimiter+"]+?");tokens.push({name:name||key++,prefix:prefix||"",delimiter:delimiter,optional:optional,repeat:repeat,pattern:escapeGroup(pattern)})}return index<str.length&&(path+=str.substr(index)),path&&tokens.push(path),tokens}function compile(str){return tokensToFunction(parse$1(str))}function tokensToFunction(tokens){for(var matches=Array(tokens.length),i=0;i<tokens.length;i++)"object"==typeof tokens[i]&&(matches[i]=new RegExp("^"+tokens[i].pattern+"$"));return function(obj){for(var path="",data=obj||{},i=0,token;i<tokens.length;i++){if(token=tokens[i],"string"==typeof token){path+=token;continue}var value=data[token.name],segment;if(null==value)if(token.optional)continue;else throw new TypeError("Expected \""+token.name+"\" to be defined");if(isarray(value)){if(!token.repeat)throw new TypeError("Expected \""+token.name+"\" to not repeat, but received \""+value+"\"");if(0===value.length)if(token.optional)continue;else throw new TypeError("Expected \""+token.name+"\" to not be empty");for(var j=0;j<value.length;j++){if(segment=encodeURIComponent(value[j]),!matches[i].test(segment))throw new TypeError("Expected all \""+token.name+"\" to match \""+token.pattern+"\", but received \""+segment+"\"");path+=(0==j?token.prefix:token.delimiter)+segment}continue}if(segment=encodeURIComponent(value),!matches[i].test(segment))throw new TypeError("Expected \""+token.name+"\" to match \""+token.pattern+"\", but received \""+segment+"\"");path+=token.prefix+segment}return path}}function escapeString(str){return str.replace(/([.+*?=^!:${}()[\]|\/])/g,"\\$1")}function escapeGroup(group){return group.replace(/([=!:$\/()])/g,"\\$1")}function attachKeys(re,keys){return re.keys=keys,re}function flags(options){return options.sensitive?"":"i"}function regexpToRegexp(path,keys){var groups=path.source.match(/\((?!\?)/g);if(groups)for(var i=0;i<groups.length;i++)keys.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return attachKeys(path,keys)}function arrayToRegexp(path,keys,options){for(var parts=[],i=0;i<path.length;i++)parts.push(pathToRegexp(path[i],keys,options).source);var regexp=new RegExp("(?:"+parts.join("|")+")",flags(options));return attachKeys(regexp,keys)}function stringToRegexp(path,keys,options){for(var tokens=parse$1(path),re=tokensToRegExp(tokens,options),i=0;i<tokens.length;i++)"string"!=typeof tokens[i]&&keys.push(tokens[i]);return attachKeys(re,keys)}function tokensToRegExp(tokens,options){options=options||{};for(var strict=options.strict,end=!1!==options.end,route="",lastToken=tokens[tokens.length-1],endsWithSlash="string"==typeof lastToken&&/\/$/.test(lastToken),i=0,token;i<tokens.length;i++)if(token=tokens[i],"string"==typeof token)route+=escapeString(token);else{var prefix=escapeString(token.prefix),capture=token.pattern;token.repeat&&(capture+="(?:"+prefix+capture+")*"),capture=token.optional?prefix?"(?:"+prefix+"("+capture+"))?":"("+capture+")?":prefix+"("+capture+")",route+=capture}return strict||(route=(endsWithSlash?route.slice(0,-2):route)+"(?:\\/(?=$))?"),route+=end?"$":strict&&endsWithSlash?"":"(?=\\/|$)",new RegExp("^"+route,flags(options))}function pathToRegexp(path,keys,options){return keys=keys||[],isarray(keys)?!options&&(options={}):(options=keys,keys=[]),path instanceof RegExp?regexpToRegexp(path,keys):isarray(path)?arrayToRegexp(path,keys,options):stringToRegexp(path,keys,options)}pathToRegexp_1.parse=parse_1,pathToRegexp_1.compile=compile_1,pathToRegexp_1.tokensToFunction=tokensToFunction_1,pathToRegexp_1.tokensToRegExp=tokensToRegExp_1;var hasDocument="undefined"!=typeof document,hasWindow="undefined"!=typeof window,hasHistory="undefined"!=typeof history,hasProcess="undefined"!=typeof process,clickEvent=hasDocument&&document.ontouchstart?"touchstart":"click",isLocation=hasWindow&&!!(window.history.location||window.location);function Page(){this.callbacks=[],this.exits=[],this.current="",this.len=0,this._decodeURLComponents=!0,this._base="",this._strict=!1,this._running=!1,this._hashbang=!1,this.clickHandler=this.clickHandler.bind(this),this._onpopstate=this._onpopstate.bind(this)}Page.prototype.configure=function(options){var opts=options||{};this._window=opts.window||hasWindow&&window,this._decodeURLComponents=!1!==opts.decodeURLComponents,this._popstate=!1!==opts.popstate&&hasWindow,this._click=!1!==opts.click&&hasDocument,this._hashbang=!!opts.hashbang;var _window=this._window;this._popstate?_window.addEventListener("popstate",this._onpopstate,!1):hasWindow&&_window.removeEventListener("popstate",this._onpopstate,!1),this._click?_window.document.addEventListener(clickEvent,this.clickHandler,!1):hasDocument&&_window.document.removeEventListener(clickEvent,this.clickHandler,!1),this._hashbang&&hasWindow&&!hasHistory?_window.addEventListener("hashchange",this._onpopstate,!1):hasWindow&&_window.removeEventListener("hashchange",this._onpopstate,!1)},Page.prototype.base=function(path){return 0===arguments.length?this._base:void(this._base=path)},Page.prototype._getBase=function(){var base=this._base;if(!!base)return base;var loc=hasWindow&&this._window&&this._window.location;return hasWindow&&this._hashbang&&loc&&"file:"===loc.protocol&&(base=loc.pathname),base},Page.prototype.strict=function(enable){return 0===arguments.length?this._strict:void(this._strict=enable)},Page.prototype.start=function(options){var opts=options||{};if(this.configure(opts),!1!==opts.dispatch){this._running=!0;var url;if(isLocation){var window=this._window,loc=window.location;url=this._hashbang&&~loc.hash.indexOf("#!")?loc.hash.substr(2)+loc.search:this._hashbang?loc.search+loc.hash:loc.pathname+loc.search+loc.hash}this.replace(url,null,!0,opts.dispatch)}},Page.prototype.stop=function(){if(this._running){this.current="",this.len=0,this._running=!1;var window=this._window;this._click&&window.document.removeEventListener(clickEvent,this.clickHandler,!1),hasWindow&&window.removeEventListener("popstate",this._onpopstate,!1),hasWindow&&window.removeEventListener("hashchange",this._onpopstate,!1)}},Page.prototype.show=function(path,state,dispatch,push){var ctx=new Context(path,state,this),prev=this.prevContext;return this.prevContext=ctx,this.current=ctx.path,!1!==dispatch&&this.dispatch(ctx,prev),!1!==ctx.handled&&!1!==push&&ctx.pushState(),ctx},Page.prototype.back=function(path,state){var page=this;if(0<this.len){var window=this._window;hasHistory&&window.history.back(),this.len--}else path?setTimeout(function(){page.show(path,state)}):setTimeout(function(){page.show(page._getBase(),state)})},Page.prototype.redirect=function(from,to){var inst=this;"string"==typeof from&&"string"==typeof to&&page.call(this,from,function(e){setTimeout(function(){inst.replace(to)},0)}),"string"==typeof from&&"undefined"==typeof to&&setTimeout(function(){inst.replace(from)},0)},Page.prototype.replace=function(path,state,init,dispatch){var ctx=new Context(path,state,this),prev=this.prevContext;return this.prevContext=ctx,this.current=ctx.path,ctx.init=init,ctx.save(),!1!==dispatch&&this.dispatch(ctx,prev),ctx},Page.prototype.dispatch=function(ctx,prev){function nextExit(){var fn=page.exits[j++];return fn?void fn(prev,nextExit):nextEnter()}function nextEnter(){var fn=page.callbacks[i++];return ctx.path===page.current?fn?void fn(ctx,nextEnter):unhandled.call(page,ctx):void(ctx.handled=!1)}var i=0,j=0,page=this;prev?nextExit():nextEnter()},Page.prototype.exit=function(path,fn){if("function"==typeof path)return this.exit("*",path);for(var route=new Route(path,null,this),i=1;i<arguments.length;++i)this.exits.push(route.middleware(arguments[i]))},Page.prototype.clickHandler=function(e){if(1===this._which(e)&&!(e.metaKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented){var el=e.target,eventPath=e.path||(e.composedPath?e.composedPath():null);if(eventPath)for(var i=0;i<eventPath.length;i++)if(eventPath[i].nodeName&&"A"===eventPath[i].nodeName.toUpperCase()&&eventPath[i].href){el=eventPath[i];break}for(;el&&"A"!==el.nodeName.toUpperCase();)el=el.parentNode;if(el&&"A"===el.nodeName.toUpperCase()){var svg="object"==typeof el.href&&"SVGAnimatedString"===el.href.constructor.name;if(!(el.hasAttribute("download")||"external"===el.getAttribute("rel"))){var link=el.getAttribute("href");if(!(!this._hashbang&&this._samePath(el)&&(el.hash||"#"===link))&&!(link&&-1<link.indexOf("mailto:"))&&(svg?!el.target.baseVal:!el.target)&&(svg||this.sameOrigin(el.href))){var path=svg?el.href.baseVal:el.pathname+el.search+(el.hash||"");path="/"===path[0]?path:"/"+path,hasProcess&&path.match(/^\/[a-zA-Z]:\//)&&(path=path.replace(/^\/[a-zA-Z]:\//,"/"));var orig=path,pageBase=this._getBase();0===path.indexOf(pageBase)&&(path=path.substr(pageBase.length)),this._hashbang&&(path=path.replace("#!","")),pageBase&&orig===path&&(!isLocation||"file:"!==this._window.location.protocol)||(e.preventDefault(),this.show(orig))}}}}},Page.prototype._onpopstate=function(){var loaded=!1;return hasWindow?(hasDocument&&"complete"===document.readyState?loaded=!0:window.addEventListener("load",function(){setTimeout(function(){loaded=!0},0)}),function onpopstate(e){if(loaded){var page=this;if(e.state){var path=e.state.path;page.replace(path,e.state)}else if(isLocation){var loc=page._window.location;page.show(loc.pathname+loc.search+loc.hash,void 0,void 0,!1)}}}):function(){}}(),Page.prototype._which=function(e){return e=e||hasWindow&&this._window.event,null==e.which?e.button:e.which},Page.prototype._toURL=function(href){var window=this._window;if("function"==typeof URL&&isLocation)return new URL(href,window.location.toString());if(hasDocument){var anc=window.document.createElement("a");return anc.href=href,anc}},Page.prototype.sameOrigin=function(href){if(!href||!isLocation)return!1;var url=this._toURL(href),window=this._window,loc=window.location;return loc.protocol===url.protocol&&loc.hostname===url.hostname&&(loc.port===url.port||""===loc.port&&(80==url.port||443==url.port))},Page.prototype._samePath=function(url){if(!isLocation)return!1;var window=this._window,loc=window.location;return url.pathname===loc.pathname&&url.search===loc.search},Page.prototype._decodeURLEncodedURIComponent=function(val){return"string"==typeof val?this._decodeURLComponents?decodeURIComponent(val.replace(/\+/g," ")):val:val};function createPage(){function pageFn(){return page.apply(pageInstance,arguments)}var pageInstance=new Page;return pageFn.callbacks=pageInstance.callbacks,pageFn.exits=pageInstance.exits,pageFn.base=pageInstance.base.bind(pageInstance),pageFn.strict=pageInstance.strict.bind(pageInstance),pageFn.start=pageInstance.start.bind(pageInstance),pageFn.stop=pageInstance.stop.bind(pageInstance),pageFn.show=pageInstance.show.bind(pageInstance),pageFn.back=pageInstance.back.bind(pageInstance),pageFn.redirect=pageInstance.redirect.bind(pageInstance),pageFn.replace=pageInstance.replace.bind(pageInstance),pageFn.dispatch=pageInstance.dispatch.bind(pageInstance),pageFn.exit=pageInstance.exit.bind(pageInstance),pageFn.configure=pageInstance.configure.bind(pageInstance),pageFn.sameOrigin=pageInstance.sameOrigin.bind(pageInstance),pageFn.clickHandler=pageInstance.clickHandler.bind(pageInstance),pageFn.create=createPage,Object.defineProperty(pageFn,"len",{get:function(){return pageInstance.len},set:function(val){pageInstance.len=val}}),Object.defineProperty(pageFn,"current",{get:function(){return pageInstance.current},set:function(val){pageInstance.current=val}}),pageFn.Context=Context,pageFn.Route=Route,pageFn}function page(path,fn){if("function"==typeof path)return page.call(this,"*",path);if("function"==typeof fn)for(var route=new Route(path,null,this),i=1;i<arguments.length;++i)this.callbacks.push(route.middleware(arguments[i]));else"string"==typeof path?this["string"==typeof fn?"redirect":"show"](path,fn):this.start(path)}function unhandled(ctx){if(!ctx.handled){var page=this,window=page._window,current;current=page._hashbang?isLocation&&this._getBase()+window.location.hash.replace("#!",""):isLocation&&window.location.pathname+window.location.search,current===ctx.canonicalPath||(page.stop(),ctx.handled=!1,isLocation&&(window.location.href=ctx.canonicalPath))}}function escapeRegExp(s){return s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Context(path,state,pageInstance){var _page=this.page=pageInstance||page,window=_page._window,hashbang=_page._hashbang,pageBase=_page._getBase();"/"===path[0]&&0!==path.indexOf(pageBase)&&(path=pageBase+(hashbang?"#!":"")+path);var i=path.indexOf("?");this.canonicalPath=path;var re=new RegExp("^"+escapeRegExp(pageBase));if(this.path=path.replace(re,"")||"/",hashbang&&(this.path=this.path.replace("#!","")||"/"),this.title=hasDocument&&window.document.title,this.state=state||{},this.state.path=path,this.querystring=~i?_page._decodeURLEncodedURIComponent(path.slice(i+1)):"",this.pathname=_page._decodeURLEncodedURIComponent(~i?path.slice(0,i):path),this.params={},this.hash="",!hashbang){if(!~this.path.indexOf("#"))return;var parts=this.path.split("#");this.path=this.pathname=parts[0],this.hash=_page._decodeURLEncodedURIComponent(parts[1])||"",this.querystring=this.querystring.split("#")[0]}}Context.prototype.pushState=function(){var page=this.page,window=page._window,hashbang=page._hashbang;page.len++,hasHistory&&window.history.pushState(this.state,this.title,hashbang&&"/"!==this.path?"#!"+this.path:this.canonicalPath)},Context.prototype.save=function(){var page=this.page;hasHistory&&page._window.history.replaceState(this.state,this.title,page._hashbang&&"/"!==this.path?"#!"+this.path:this.canonicalPath)};function Route(path,options,page){var _page=this.page=page||globalPage,opts=options||{};opts.strict=opts.strict||_page._strict,this.path="*"===path?"(.*)":path,this.method="GET",this.regexp=pathToRegexp_1(this.path,this.keys=[],opts)}Route.prototype.middleware=function(fn){var self=this;return function(ctx,next){return self.match(ctx.path,ctx.params)?(ctx.routePath=self.path,fn(ctx,next)):void next()}},Route.prototype.match=function(path,params){var keys=this.keys,qsIndex=path.indexOf("?"),pathname=~qsIndex?path.slice(0,qsIndex):path,m=this.regexp.exec(decodeURIComponent(pathname));if(!m)return!1;delete params[0];for(var i=1,len=m.length;i<len;++i){var key=keys[i-1],val=this.page._decodeURLEncodedURIComponent(m[i]);val===void 0&&hasOwnProperty.call(params,key.name)||(params[key.name]=val)}return!0};var globalPage=createPage(),page_js=globalPage,default_1=globalPage;page_js.default=default_1;var __decorate$_=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const DRAWER_WIDTH_PX=200;let ChromedashDrawer=class ChromedashDrawer extends i$4{constructor(){super(...arguments),this.currentPage="",this.devMode="False",this.googleSignInClientId="",this.defaultOpen=!1,this.loading=!1}static get styles(){return[...SHARED_STYLES,i$7` + :host { + --nav-link-color: var(--sl-color-neutral-700); + --nav-link-font-size: 16px; + --nav-link-hover-background: var(--sl-color-neutral-100); + --nav-link-active-color: var(--sl-color-primary-900); + --nav-link-active-background: var(--light-accent-color); + } + nav { + display: flex; + flex: 1; + align-items: baseline; + user-select: none; + background: var(--card-background); + border: none; + align-items: center; + margin: 0 var(--content-padding-half); + -webkit-font-smoothing: initial; + } + nav a { + text-decoration: none !important; + cursor: pointer; + font-size: var(--nav-link-font-size); + text-align: left; + padding: var(--content-padding-half); + color: var(--nav-link-color); + white-space: nowrap; + border-radius: var(--pill-border-radius); + } + nav a:hover { + color: black; + background: var(--nav-link-hover-background); + } + nav a.disabled { + opacity: 0.5; + pointer-events: none; + } + nav [active] { + color: var(--nav-link-active-color); + background: var(--nav-link-active-background); + } + nav [active]:hover { + background: var(--sl-color-neutral-100); + } + hr { + margin: 15px var(--content-padding-half); + } + + .section-header { + margin: 0px var(--content-padding-half) 10px; + font-weight: bold; + } + sl-drawer a { + display: block; + } + sl-drawer::part(header) { + display: none; + } + sl-button { + margin-left: 10px; + } + @media only screen and (max-width: 700px) { + header { + --logoSize: 24px; + + margin: 0; + display: block; + } + sl-drawer a { + display: block; + } + sl-drawer::part(header) { + display: none; + } + } + `]}connectedCallback(){super.connectedCallback();this.user&&this.user.email||(this.loading=!0,window.csClient.getPermissions().then(user=>{this.user=user,!this.user&&IS_MOBILE&&(!window.isPlaywright&&this.initializeGoogleSignIn(),"True"==this.devMode&&this.initializeTestingSignIn())}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")}).finally(()=>{this.loading=!1}))}initializeGoogleSignIn(){google.accounts.id.initialize({client_id:this.googleSignInClientId,callback:this.handleCredentialResponse}),google.accounts.id.prompt();const signInButton=document.createElement("div");google.accounts.id.renderButton(signInButton,{type:"standard"}),this.insertAdjacentElement("afterbegin",signInButton)}initializeTestingSignIn(){const signInTestingButton=document.createElement("button");signInTestingButton.innerText="Sign in as example@chromium.org",signInTestingButton.setAttribute("type","button"),signInTestingButton.setAttribute("data-testid","dev-mode-sign-in-button"),signInTestingButton.setAttribute("style","position:fixed; right:0; z-index:1000; background: lightblue; border: 1px solid blue;"),signInTestingButton.addEventListener("click",()=>{fetch("/dev/mock_login",{method:"POST"}).then(response=>{if(!response.ok)throw new Error(`Sign in failed! Response: ${response.status}`)}).then(()=>{setTimeout(()=>{const url=window.location.href.split("?")[0];window.location.href=url},1e3)}).catch(error=>{console.error("Sign in failed.",error)})});const signInButtonContainer=document.querySelector("body");signInButtonContainer&&signInButtonContainer.insertAdjacentElement("afterbegin",signInTestingButton)}handleCredentialResponse(credentialResponse){window.csClient.signIn(credentialResponse).then(()=>{setTimeout(()=>{const url=window.location.href.split("?")[0];window.location.href=url},1e3)}).catch(()=>{console.error("Sign in failed, so signing out to allow retry"),this.signOut()})}handleSignOutClick(e){e.preventDefault(),this.signOut()}signOut(){window.csClient.signOut().then(()=>{window.location.reload()})}userCanApprove(){return this.user&&(this.user.is_admin||0<this.user.approvable_gate_types?.length)}isCurrentPage(href){return this.currentPage===href}toggleDrawerActions(){const drawer=this.shadowRoot.querySelector(".drawer-placement-start");return drawer.open?drawer.hide():drawer.show(),drawer.open}renderNavItem(url,label){return x$1`<a href="${url}" ?active=${this.isCurrentPage(url)} + >${label}</a + >`}renderDrawer(){let accountMenu=E$1;IS_MOBILE&&!this.loading&&(accountMenu=this.renderAccountMenu());const myFeaturesMenu=this.renderMyFeaturesMenu(),adminMenu=this.renderAdminMenu(),now=new Date,year=now.getFullYear(),shippingThisYear=this.renderNavItem("/features?q=shipping_year:"+year,"Shipping "+year),nextYear=year+1;let shippingNextYear=this.renderNavItem("/features?q=shipping_year:"+nextYear,"Shipping "+nextYear);return 8>now.getMonth()&&(shippingNextYear=x$1``),x$1` + <sl-drawer + label="Menu" + placement="start" + class="drawer-placement-start" + style="--size: ${DRAWER_WIDTH_PX}px;" + contained + noHeader + ?open=${!IS_MOBILE&&this.defaultOpen} + > + ${accountMenu} ${this.renderNavItem("/roadmap","Roadmap")} + ${this.renderNavItem("/features","All features")} ${shippingThisYear} + ${shippingNextYear} ${myFeaturesMenu} + <hr /> + <div class="section-header">Stats</div> + ${this.renderNavItem("/metrics/css/popularity","CSS")} + ${this.renderNavItem("/metrics/css/animated","CSS Animation")} + ${this.renderNavItem("/metrics/feature/popularity","JS/HTML")} + ${this.renderNavItem("/metrics/webfeature/popularity","Web Features")} + <hr /> + <div class="section-header">Reports</div> + ${this.renderNavItem("/reports/spec_mentors","Spec Mentors")} + ${this.renderNavItem("/reports/external_reviews","External Reviews")} + ${adminMenu} + </sl-drawer> + `}renderAccountMenu(){return this.user?x$1` + <div class="section-header">${this.user.email}</div> + <a href="/settings">Settings</a> + <a + href="#" + id="sign-out-link" + data-testid="sign-out-link" + @click=${this.handleSignOutClick} + >Sign out</a + > + ${this.user.can_create_feature&&!this.isCurrentPage("/guide/new")?x$1` + <sl-button + data-testid="create-feature-button" + href="/guide/new" + variant="primary" + size="small" + > + Create feature + </sl-button> + `:E$1} + <hr /> + `:E$1}renderMyFeaturesMenu(){return this.user?.email?x$1` + <hr /> + <div class="section-header">My features</div> + ${this.userCanApprove()?this.renderNavItem("/myfeatures/review","Pending review"):E$1} + ${this.renderNavItem("/myfeatures/starred","Starred")} + ${this.renderNavItem("/myfeatures/editable","Owner / editor")} + `:E$1}renderAdminMenu(){return this.user?.is_admin?x$1` + <hr /> + <div class="section-header">Admin</div> + ${this.renderNavItem("/admin/users/new","Users")} + ${this.renderNavItem("/admin/ot_requests","OT requests")} + ${this.renderNavItem("/admin/bulk_edit","Bulk edit")} + ${this.renderNavItem("/admin/feature_links","Feature links")} + ${this.renderNavItem("/reports/feature-latency","Feature latency")} + ${this.renderNavItem("/reports/review-latency","Review latency")} + ${this.renderNavItem("/admin/blink","Subscriptions")} + ${this.renderNavItem("/admin/find_stop_words","Find stop words JSON")} + ${this.renderNavItem("/features/stale","Stale features")} + `:E$1}render(){return x$1` <nav>${this.renderDrawer()}</nav> `}};__decorate$_([n$5({type:String})],ChromedashDrawer.prototype,"currentPage",void 0),__decorate$_([n$5({type:String})],ChromedashDrawer.prototype,"devMode",void 0),__decorate$_([n$5({type:String})],ChromedashDrawer.prototype,"googleSignInClientId",void 0),__decorate$_([n$5({type:Boolean})],ChromedashDrawer.prototype,"defaultOpen",void 0),__decorate$_([r$6()],ChromedashDrawer.prototype,"user",void 0),__decorate$_([r$6()],ChromedashDrawer.prototype,"loading",void 0),ChromedashDrawer=__decorate$_([t$3("chromedash-drawer")],ChromedashDrawer);var __decorate$Z=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashApp=class ChromedashApp extends i$4{constructor(){super(...arguments),this.gateColumnRef=e$1(),this.paired_user=void 0,this.appTitle="",this.googleSignInClientId="",this.devMode="",this.bannerMessage="",this.bannerTime=null,this.loading=!0,this.currentPage="",this.pageComponent=null,this.contextLink="/features",this.sidebarHidden=!0,this.selectedGateId=0,this.beforeUnloadHandler=null,this.drawerOpen=!IS_MOBILE}static get styles(){return[...SHARED_STYLES,i$7` + .main-toolbar { + display: flex; + position: relative; + padding: 0; + } + .main-toolbar .toolbar-content { + width: 100%; + } + + #rollout { + width: 100%; + text-align: center; + padding: 1em; + color: black; + background: lightgrey; + } + + #app-content-container { + display: flex; + flex-direction: column; + height: 100%; + } + + #content { + margin: 0; + position: relative; + flex: 1; + } + + #content-flex-wrapper { + display: flex; + justify-content: center; + width: 100%; + } + + #content-component-wrapper { + width: var(--max-content-width); + max-width: 95%; + } + #content-component-wrapper[wide] { + width: 100%; + } + + #content-sidebar-space { + position: sticky; + flex-shrink: 100; + width: var(--sidebar-space); + } + + #sidebar { + position: absolute; + top: 0; + right: 0; + width: var(--sidebar-width); + max-width: var(--sidebar-max-width); + bottom: 0; + } + #sidebar[hidden] { + display: none; + } + #sidebar-content { + position: sticky; + top: 10px; + height: 85vh; + overflow-y: auto; + border: var(--sidebar-border); + border-radius: var(--sidebar-radius); + background: var(--sidebar-bg); + padding: var(--content-padding); + } + + @media only screen and (max-width: 700px) { + #content { + margin-left: 0; + margin-right: 0; + } + } + `]}firstUpdated(){const toastEl=document.createElement("chromedash-toast");document.body.appendChild(toastEl)}connectedCallback(){super.connectedCallback(),this.loading=!0,window.csClient.getPermissions().then(user=>{this.user=user}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")}).finally(()=>{this.setUpRoutes(),this.loading=!1})}fetchPairedUser(){return void 0!==this.paired_user&&this.pageComponent?void(this.pageComponent.paired_user=this.paired_user):void window.csClient.getPermissions(!0).then(pu=>{this.paired_user=pu,this.pageComponent&&(this.pageComponent.paired_user=pu)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}removeBeforeUnloadHandler(){this.beforeUnloadHandler&&(window.removeEventListener("beforeunload",this.beforeUnloadHandler),this.beforeUnloadHandler=null)}addBeforeUnloadHandler(){this.removeBeforeUnloadHandler(),this.beforeUnloadHandler=event=>{this.getUnsavedChanges()&&(event.preventDefault(),event.returnValue=`You made changes that have not been saved. + Are you sure you want to leave?`)},window.addEventListener("beforeunload",this.beforeUnloadHandler)}getUnsavedChanges(){return this.pageComponent?this.pageComponent.unsavedChanges:void 0}setUnsavedChanges(flag){this.pageComponent&&(this.pageComponent.unsavedChanges=flag)}handleFormSubmit(){const currentPageComponent=this.pageComponent,currentUnsavedChanges=this.pageComponent.unsavedChanges;this.setUnsavedChanges(!1),this.removeBeforeUnloadHandler(),window.setTimeout(()=>{this.pageComponent==currentPageComponent&&this.getUnsavedChanges()&&(this.setUnsavedChanges(currentUnsavedChanges),this.addBeforeUnloadHandler())},1e3)}setupNewPage(ctx,componentName,shouldSetContext=!1,shouldHideSidebar=!0){if(this.currentPage==ctx.path&&ctx.hash)return window.scrollToElement&&window.scrollToElement(`#${ctx.hash}`),!1;if(this.pageComponent&&this.getUnsavedChanges()&&!confirm("You will lose unsaved changes. Proceed anyway?"))return ctx.handled=!1,!1;const signinRequired=-1<ctx.querystring.search("loginStatus=False");return this.pageComponent=document.createElement(signinRequired?"chromedash-login-required-page":componentName),this.setUnsavedChanges(!1),this.removeBeforeUnloadHandler(),this.pageComponent.allFormFieldComponentsList=[],window.setTimeout(()=>{const form=this.pageComponent.shadowRoot?.querySelector("form");form&&(this.addBeforeUnloadHandler(),this.pageComponent.addEventListener("sl-change",()=>{this.setUnsavedChanges(!0)}),form.addEventListener("submit",()=>{this.handleFormSubmit()}))},1e3),this.pageComponent.contextLink=this.contextLink,shouldSetContext&&(this.contextLink=ctx.path),this.currentPage=ctx.path,shouldHideSidebar&&this.hideSidebar(),!0}setUpRoutes(){page_js.strict(!0),page_js("/",()=>page_js.redirect("/roadmap")),page_js("/roadmap",ctx=>{this.setupNewPage(ctx,"chromedash-roadmap-page",!0)&&(this.pageComponent.user=this.user)}),page_js("/myfeatures",ctx=>{this.setupNewPage(ctx,"chromedash-myfeatures-page",!0)&&(this.pageComponent.user=this.user,this.pageComponent.selectedGateId=this.selectedGateId)}),page_js("/myfeatures/review",ctx=>{this.setupNewPage(ctx,"chromedash-all-features-page",!0)&&(this.pageComponent.user=this.user,this.pageComponent.title="Features pending my review",this.pageComponent.query="pending-approval-by:me",this.pageComponent.columns="approvals",this.pageComponent.sortSpec="gate.requested_on",this.pageComponent.showEnterprise=!0,this.pageComponent.showQuery=!1,this.pageComponent.rawQuery=parseRawQuery(ctx.querystring))}),page_js("/myfeatures/starred",ctx=>{this.setupNewPage(ctx,"chromedash-all-features-page",!0)&&(this.pageComponent.user=this.user,this.pageComponent.title="Features I starred",this.pageComponent.query="starred-by:me",this.pageComponent.showEnterprise=!0,this.pageComponent.showQuery=!1,this.pageComponent.rawQuery=parseRawQuery(ctx.querystring))}),page_js("/myfeatures/editable",ctx=>{this.setupNewPage(ctx,"chromedash-all-features-page",!0)&&(this.pageComponent.user=this.user,this.pageComponent.title="Features I can edit",this.pageComponent.query="can_edit:me",this.pageComponent.showEnterprise=!0,this.pageComponent.showQuery=!1,this.pageComponent.rawQuery=parseRawQuery(ctx.querystring))}),page_js("/features",ctx=>{this.setupNewPage(ctx,"chromedash-all-features-page",!0)&&(this.pageComponent.user=this.user,this.pageComponent.rawQuery=parseRawQuery(ctx.querystring),this.pageComponent.isNewfeaturesPage=!0,this.pageComponent.addEventListener("search",this.handleSearchQuery.bind(this)))}),page_js("/feature/:featureId(\\d+)",ctx=>{this.setupNewPage(ctx,"chromedash-feature-page",!0,!1)&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.user=this.user,this.fetchPairedUser(),this.pageComponent.selectedGateId=this.selectedGateId,this.pageComponent.appTitle=this.appTitle,this.pageComponent.featureId!=this.gateColumnRef.value?.feature?.id&&this.hideSidebar())}),page_js("/feature/:featureId(\\d+)/activity",ctx=>{this.setupNewPage(ctx,"chromedash-activity-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.user=this.user)}),page_js("/feature/:featureId(\\d+)/ai-coverage-evaluation",ctx=>{this.setupNewPage(ctx,"chromedash-wpt-eval-page",!0,!1)&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.user=this.user,this.pageComponent.appTitle=this.appTitle)}),page_js("/guide/new",ctx=>{this.setupNewPage(ctx,"chromedash-guide-new-page")&&(-1!=ctx.querystring.search("loginStatus=False")||(this.pageComponent.userEmail=this.user.email))}),page_js("/guide/enterprise/new",ctx=>{this.setupNewPage(ctx,"chromedash-guide-new-page")&&(-1==ctx.querystring.search("loginStatus=False")&&(this.pageComponent.userEmail=this.user.email),this.pageComponent.isEnterpriseFeature=!0)}),page_js("/guide/editall/:featureId(\\d+)",ctx=>{this.setupNewPage(ctx,"chromedash-guide-editall-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.user=this.user,this.pageComponent.appTitle=this.appTitle)}),page_js("/guide/verify_accuracy/:featureId(\\d+)",ctx=>{this.setupNewPage(ctx,"chromedash-guide-verify-accuracy-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.appTitle=this.appTitle)}),page_js("/guide/stage/:featureId(\\d+)/:stageId(\\d+)",ctx=>{this.setupNewPage(ctx,"chromedash-guide-stage-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.stageId=parseInt(ctx.params.stageId),this.pageComponent.appTitle=this.appTitle)}),page_js("/guide/stage/:featureId(\\d+)/:intentStage(\\d+)/:stageId(\\d+)",ctx=>{this.setupNewPage(ctx,"chromedash-guide-stage-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.stageId=parseInt(ctx.params.stageId),this.pageComponent.appTitle=this.appTitle)}),page_js("/feature/:featureId(\\d+)/gate/:gateId(\\d+/intent)",ctx=>{this.setupNewPage(ctx,"chromedash-intent-preview-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.gateId=parseInt(ctx.params.gateId),this.pageComponent.appTitle=this.appTitle,this.hideSidebar())}),page_js("/feature/:featureId(\\d+)/stage/:stageId(\\d+/intent)",ctx=>{this.setupNewPage(ctx,"chromedash-intent-preview-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.stageId=parseInt(ctx.params.stageId),this.pageComponent.appTitle=this.appTitle,this.hideSidebar())}),page_js("/ot_creation_request/:featureId(\\d+)/:stageId(\\d+)",ctx=>{this.setupNewPage(ctx,"chromedash-ot-creation-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.stageId=parseInt(ctx.params.stageId),this.pageComponent.appTitle=this.appTitle,this.pageComponent.userEmail=this.user.email)}),page_js("/ot_extension_request/:featureId(\\d+)/:stageId(\\d+)",ctx=>{this.setupNewPage(ctx,"chromedash-ot-extension-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.stageId=parseInt(ctx.params.stageId),this.pageComponent.appTitle=this.appTitle,this.pageComponent.userEmail=this.user.email)}),page_js("/guide/stage/:featureId(\\d+)/metadata",ctx=>{this.setupNewPage(ctx,"chromedash-guide-metadata-page")&&(this.pageComponent.featureId=parseInt(ctx.params.featureId),this.pageComponent.appTitle=this.appTitle)}),page_js("/settings",ctx=>{!this.setupNewPage(ctx,"chromedash-settings-page")}),page_js("/metrics/:type/:view",ctx=>{this.setupNewPage(ctx,"chromedash-stack-rank-page")&&(this.pageComponent.type=ctx.params.type,this.pageComponent.view=ctx.params.view)}),page_js("/metrics/:type/timeline/:view/:bucketId",ctx=>{this.setupNewPage(ctx,"chromedash-timeline-page")&&(this.pageComponent.type=ctx.params.type,this.pageComponent.view=ctx.params.view,this.pageComponent.selectedBucketId=ctx.params.bucketId)}),page_js("/features/stale",ctx=>{!this.setupNewPage(ctx,"chromedash-stale-features-page")}),page_js("/metrics",()=>page_js.redirect("/metrics/css/popularity")),page_js("/metrics/css",()=>page_js.redirect("/metrics/css/popularity")),page_js("/metrics/css/timeline/popularity",()=>page_js.redirect("/metrics/css/popularity")),page_js("/metrics/css/timeline/animated",()=>page_js.redirect("/metrics/css/animated")),page_js("/metrics/feature/timeline/popularity",()=>page_js.redirect("/metrics/feature/popularity")),page_js("/metrics/webfeature/timeline/popularity",()=>page_js.redirect("/metrics/webfeature/popularity")),page_js("/reports/external_reviews",ctx=>{!this.setupNewPage(ctx,"chromedash-report-external-reviews-dispatch-page")}),page_js("/reports/external_reviews/:reviewer",ctx=>["tag","gecko","webkit"].includes(ctx.params.reviewer)?void(!this.setupNewPage(ctx,"chromedash-report-external-reviews-page")||(this.pageComponent.reviewer=ctx.params.reviewer)):void page_js.redirect("/reports/external_reviews")),page_js("/reports/spec_mentors",ctx=>{this.setupNewPage(ctx,"chromedash-report-spec-mentors-page")&&(this.pageComponent.rawQuery=parseRawQuery(ctx.querystring),this.pageComponent.addEventListener("afterchanged",e=>updateURLParams("after",isoDateString(e.detail.after))))}),page_js("/reports/feature-latency",ctx=>{this.setupNewPage(ctx,"chromedash-report-feature-latency-page")&&(this.pageComponent.rawQuery=parseRawQuery(ctx.querystring),this.pageComponent.addEventListener("afterchanged",e=>updateURLParams("after",isoDateString(e.detail.after))))}),page_js("/reports/review-latency",ctx=>{!this.setupNewPage(ctx,"chromedash-report-review-latency-page")}),page_js("/enterprise",ctx=>{this.setupNewPage(ctx,"chromedash-enterprise-page",!0)&&(this.pageComponent.user=this.user)}),page_js("/admin/blink",ctx=>{this.pageComponent=document.createElement("chromedash-admin-blink-page"),this.pageComponent.user=this.user,this.currentPage=ctx.path,this.hideSidebar()}),page_js("/admin/feature_links",ctx=>{this.setupNewPage(ctx,"chromedash-admin-feature-links-page")&&(this.pageComponent.user=this.user)}),page_js("/admin/bulk_edit",ctx=>{this.pageComponent=document.createElement("chromedash-bulk-edit-page"),this.pageComponent.user=this.user,this.currentPage=ctx.path}),page_js("/enterprise/releasenotes",ctx=>{this.setupNewPage(ctx,"chromedash-enterprise-release-notes-page",!0)&&(this.pageComponent.user=this.user)}),page_js.start()}handleSearchQuery(e){updateURLParams("q",e.detail.query),clearURLParams("start")}showSidebar(){this.sidebarHidden=!1}hideSidebar(){this.sidebarHidden=!0,this.selectedGateId=0,this.pageComponent.selectedGateId=0}showGateColumn(feature,stageId,gate){this.gateColumnRef.value?.setContext(feature,stageId,gate),this.selectedGateId=gate.id,this.pageComponent.selectedGateId=gate.id,this.showSidebar()}handleShowGateColumn(e){this.showGateColumn(e.detail.feature,e.detail.stage.id,e.detail.gate)}handleShowDrawer(){const drawer=this.renderRoot.querySelector("chromedash-drawer");this.drawerOpen=drawer.toggleDrawerActions()}refetch(){this.pageComponent?.refetch&&this.pageComponent.refetch(),this.gateColumnRef.value?.refetch&&this.gateColumnRef.value.refetch()}renderContentAndSidebar(){const wide=this.pageComponent&&"CHROMEDASH-ROADMAP-PAGE"==this.pageComponent.tagName;return wide?x$1` + <div id="content-component-wrapper" wide>${this.pageComponent}</div> + `:x$1` + <div + id="content-component-wrapper" + @show-gate-column=${this.handleShowGateColumn} + @refetch-needed=${this.refetch} + > + ${this.pageComponent} + </div> + <div id="content-sidebar-space"> + <div id="sidebar" ?hidden=${this.sidebarHidden}> + <div id="sidebar-content"> + <chromedash-gate-column + .user=${this.user} + ${n$2(this.gateColumnRef)} + @close=${this.hideSidebar} + @refetch-needed=${this.refetch} + > + </chromedash-gate-column> + </div> + </div> + </div> + `}renderRolloutBanner(currentPage){return E$1}render(){let styleMargin={"margin-left":"20px"};return!IS_MOBILE&&this.drawerOpen&&(styleMargin={"margin-left":"210px"}),this.loading?E$1:x$1` + <div id="app-content-container"> + <div class="main-toolbar"> + <div class="toolbar-content"> + <chromedash-header + .user=${this.user} + .appTitle=${this.appTitle} + .devMode=${this.devMode} + .googleSignInClientId=${this.googleSignInClientId} + .currentPage=${this.currentPage} + @drawer-clicked=${this.handleShowDrawer} + > + <slot></slot> + </chromedash-header> + </div> + </div> + + <div id="content"> + <div> + <chromedash-drawer + .user=${this.user} + .currentPage=${this.currentPage} + ?defaultOpen=${!0} + .devMode=${this.devMode} + .googleSignInClientId=${this.googleSignInClientId} + > + </chromedash-drawer> + </div> + <div style=${o$3(styleMargin)}> + <chromedash-banner + .message=${this.bannerMessage} + .timestamp=${this.bannerTime} + > + </chromedash-banner> + <div id="content-flex-wrapper"> + ${this.renderContentAndSidebar()} + </div> + ${this.renderRolloutBanner(this.currentPage)} + </div> + </div> + <chromedash-footer></chromedash-footer> + </div> + `}};__decorate$Z([n$5({attribute:!1})],ChromedashApp.prototype,"user",void 0),__decorate$Z([n$5({attribute:!1})],ChromedashApp.prototype,"paired_user",void 0),__decorate$Z([n$5({type:String})],ChromedashApp.prototype,"appTitle",void 0),__decorate$Z([n$5({type:String})],ChromedashApp.prototype,"googleSignInClientId",void 0),__decorate$Z([n$5({type:String})],ChromedashApp.prototype,"devMode",void 0),__decorate$Z([n$5({type:String})],ChromedashApp.prototype,"bannerMessage",void 0),__decorate$Z([n$5({type:Number})],ChromedashApp.prototype,"bannerTime",void 0),__decorate$Z([r$6()],ChromedashApp.prototype,"loading",void 0),__decorate$Z([r$6()],ChromedashApp.prototype,"currentPage",void 0),__decorate$Z([r$6()],ChromedashApp.prototype,"pageComponent",void 0),__decorate$Z([r$6()],ChromedashApp.prototype,"contextLink",void 0),__decorate$Z([r$6()],ChromedashApp.prototype,"sidebarHidden",void 0),__decorate$Z([r$6()],ChromedashApp.prototype,"selectedGateId",void 0),__decorate$Z([r$6()],ChromedashApp.prototype,"beforeUnloadHandler",void 0),__decorate$Z([r$6()],ChromedashApp.prototype,"drawerOpen",void 0),ChromedashApp=__decorate$Z([t$3("chromedash-app")],ChromedashApp);var __decorate$Y=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashBanner=class ChromedashBanner extends i$4{constructor(){super(...arguments),this.timestamp=null,this.message=""}static get styles(){return[...SHARED_STYLES,i$7` + div { + display: inline-block; + background: var(--warning-background); + color: var(--warning-color); + border-radius: var(--border-radius); + padding: var(--content-padding); + width: 100%; + } + `]}computeLocalDateString(){if(!this.timestamp)return E$1;const date=new Date(1e3*this.timestamp),formatOptions={weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"};return date.toLocaleString(void 0,formatOptions)}render(){return this.message?x$1` <div>${this.message} ${this.computeLocalDateString()}</div> `:E$1}};__decorate$Y([n$5({type:Number})],ChromedashBanner.prototype,"timestamp",void 0),__decorate$Y([n$5({type:String})],ChromedashBanner.prototype,"message",void 0),ChromedashBanner=__decorate$Y([t$3("chromedash-banner")],ChromedashBanner);const FORM_STYLES=[VARS,i$7` + table tr[hidden] th, table tr[hidden] td { + padding: 0; + } + + table th { + padding: 12px 10px 5px 0; + vertical-align: top; + } + + table td { + padding: 6px 10px; + vertical-align: top; + } + + table td:first-of-type { + width: 60%; + } + + table .helptext { + display: block; + font-size: small; + margin-top: 2px; + } + + table input[type="text"], table input[type="url"], + table input[type="email"], table textarea { + width: 100%; + font: var(--form-element-font); + } + + table select { + max-width: 350px; + } + + table:required { + border: 1px solid $chromium-color-dark; + } + + table .interacted:valid { + border: 1px solid green; + } + + table .interacted:invalid { + border: 1px solid $invalid-color; + } + + table input:not([type="submit"]):not([type="search"]) { + outline: 1px dotted var(--error-border-color); + background-color: #FFEDF5; + } + + input, textarea { + padding: 7px; + } + + form[name="feature_form"] h3 { + margin: var(--content-padding-half) 0; + } + form[name="feature_form"] input[type="submit"] { + margin-top: var(--content-padding); + } + + form[name="feature_form"] .stage_form { + margin-bottom: 2em; + } + + form section.flat_form + h3, .final_buttons { + margin-top: 2em; + } + + .fade-in { + animation:fadeIn 0.5s linear; + } + + @keyframes fadeIn { + 0% { + opacity:0 + } + 100% { + opacity:1; + } + } + + #metadata, .stage_form, .flat_form, .final_buttons { + max-width: 67em; + padding: 1em; + } + + #metadata, .stage_form, .flat_form { + color: #444; + background: white; + border: 1px solid #ccc; + box-shadow: rgba(0, 0, 0, 0.067) 1px 1px 4px; + } + + #metadata-readonly div + div { + margin-top: 4px; + } + + sl-input::part(base) { + overflow: visible; + } + + sl-input[invalid]::part(input), + sl-checkbox[invalid]::part(input), + chromedash-textarea[invalid]::part(textarea) + { + outline: 1px dotted red; + background-color: #FFEDF5; + } + + sl-select[size="small"] sl-menu-item::part(base) { + font-size: var(--sl-font-size-x-small); + padding: 0px; + } + + /* Hide select until loading is done and the component is defined. */ + :not(:defined) { + visibility: hidden; + } + + /* menu items for selects should not be displayed at all, until defined */ + sl-select sl-menu-item:not(:defined) { + display: none; + } + + chromedash-form-field { + display: table-row-group; + } + + chromedash-form-field tr[hidden] th, + chromedash-form-field tr[hidden] td { + padding: 0; + } + + chromedash-form-field th, + chromedash-form-field td { + text-align: left; + vertical-align: top; + } + + chromedash-form-field th { + padding: 12px 10px 5px 0; + } + + chromedash-form-field td { + padding: 6px 10px; + } + + chromedash-form-field td:first-of-type { + width: 60%; + max-width: 35em; + } + + chromedash-form-field .check-warning { + color: orange; + } + + chromedash-form-field .check-error { + color: red; + } + + chromedash-form-field .helptext { + display: block; + font-size: small; + margin-top: 2px; + } + + chromedash-form-field .helptext > *:first-child { + margin-top: 0; + } + chromedash-form-field .helptext > *:last-child { + margin-bottom: 0; + } + + chromedash-form-field .helptext p { + margin: 1em 0; + } + + chromedash-form-field .helptext ul { + margin: 1em 0; + } + + chromedash-form-field .helptext blockquote { + margin: 1em; + border: 1px solid lightgrey; + padding: 0.5em; + } + + chromedash-form-field .errorlist { + color: red; + } + + chromedash-form-field sl-input[data-user-invalid]::part(base), + chromedash-form-field chromedash-textarea[data-user-invalid]::part(base) { + border-color: red; + } + + chromedash-form-field sl-details::part(base) { + border-width: 0; + } + + chromedash-form-field sl-details::part(header) { + padding: 0; + display: none; + } + + chromedash-form-field sl-details::part(content) { + padding-top: 0; + } + + chromedash-form-field sl-icon-button::part(base) { + font-size: 16px; + color: var(--link-color); + padding: 0; + margin: 4px; + } + + chromedash-form-field td.extrahelp { + padding-left: 2em; + } + chromedash-form-field .extrahelp > span, chromedash-form-field .webdx > span { + margin: 0; + } + + chromedash-form-field .datalist-input { + width: 100%; + height: 30px; + border-radius: 4px; + padding-left: 12px; + font-family: inherit; + font-size: inherit; + color: #27272a; + } + chromedash-form-field .datalist-input:hover { + border-color: #aaa; + } + chromedash-form-field .datalist-input:focus { + outline: none; + border-color: #0ea5e9; + } + + chromedash-form-field .datalist-input-wrapper { + border-radius: 4px; + } + chromedash-form-field .datalist-input-wrapper:focus-within { + box-shadow: 0 0 0 3px #0ea5e966; + } + + chromedash-form-field .form-field-header { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + } + chromedash-form-field .usage-tag { + padding: 2px 6px; + margin-inline-start: 4px; + border-radius: 12px; + font-size: 0.85em; + font-weight: 700; + text-align: center; + white-space: nowrap; + vertical-align: middle; + cursor: help; + color: #424242; + background-color: #f5f5f5; + border: 1px solid #bdbdbd; + } + + sl-skeleton { + margin-bottom: 1em; + width: 60%; + } + sl-skeleton:nth-of-type(even) { + width: 50%; + } + + h3 sl-skeleton { + margin-top: 1em; + width: 30%; + height: 1.5em; + } + + .choices label { + font-weight: bold; + } + .choices div { + margin-top: 1em; + } + .choices p { + margin: 0.5em 1.5em 1em; + } + `];var global$1="undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,lookup=[],revLookup=[],Arr="undefined"==typeof Uint8Array?Array:Uint8Array,inited=!1;function init(){inited=!0;for(var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62,revLookup[95]=63}function toByteArray(b64){inited||init();var len=b64.length,i,j,l,tmp,placeHolders,arr;if(0<len%4)throw new Error("Invalid string. Length must be a multiple of 4");placeHolders="="===b64[len-2]?2:"="===b64[len-1]?1:0,arr=new Arr(3*len/4-placeHolders),l=0<placeHolders?len-4:len;var L=0;for(i=0,j=0;i<l;i+=4,j+=3)tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)],arr[L++]=255&tmp>>16,arr[L++]=255&tmp>>8,arr[L++]=255&tmp;return 2===placeHolders?(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[L++]=255&tmp):1==placeHolders&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[L++]=255&tmp>>8,arr[L++]=255&tmp),arr}function tripletToBase64(num){return lookup[63&num>>18]+lookup[63&num>>12]+lookup[63&num>>6]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var output=[],i=start,tmp;i<end;i+=3)tmp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2],output.push(tripletToBase64(tmp));return output.join("")}function fromByteArray(uint8){inited||init();for(var len=uint8.length,extraBytes=len%3,output="",parts=[],maxChunkLength=16383,i=0,len2=len-extraBytes,tmp;i<len2;i+=maxChunkLength)parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength));return 1===extraBytes?(tmp=uint8[len-1],output+=lookup[tmp>>2],output+=lookup[63&tmp<<4],output+="=="):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],output+=lookup[tmp>>10],output+=lookup[63&tmp>>4],output+=lookup[63&tmp<<2],output+="="),parts.push(output),parts.join("")}function read(buffer,offset,isLE,mLen,nBytes){var _Mathpow=Math.pow,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i],e,m;for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;0<nBits;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;0<nBits;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:(s?-1:1)*(1/0);m+=_Mathpow(2,mLen),e-=eBias}return(s?-1:1)*m*_Mathpow(2,e-mLen)}function write(buffer,value,offset,isLE,mLen,nBytes){var _MathLN=Math.LN2,_Mathlog=Math.log,_Mathpow2=Math.pow,_Mathfloor2=Math.floor,_Mathabs2=Math.abs,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=23===mLen?_Mathpow2(2,-24)-_Mathpow2(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=0>value||0===value&&0>1/value?1:0,e,m,c;for(value=_Mathabs2(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=_Mathfloor2(_Mathlog(value)/_MathLN),1>value*(c=_Mathpow2(2,-e))&&(e--,c*=2),value+=1<=e+eBias?rt/c:rt*_Mathpow2(2,1-eBias),2<=value*c&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):1<=e+eBias?(m=(value*c-1)*_Mathpow2(2,mLen),e+=eBias):(m=value*_Mathpow2(2,eBias-1)*_Mathpow2(2,mLen),e=0));8<=mLen;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<<mLen|m,eLen+=mLen;0<eLen;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}var toString={}.toString,isArray=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)},INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=!(global$1.TYPED_ARRAY_SUPPORT!==void 0)||global$1.TYPED_ARRAY_SUPPORT,kMaxLength();function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()<length)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(that=new Uint8Array(length),that.__proto__=Buffer.prototype):(null===that&&(that=new Buffer(length)),that.length=length),that}function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer))return new Buffer(arg,encodingOrOffset,length);if("number"==typeof arg){if("string"==typeof encodingOrOffset)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,arg)}return from(this,arg,encodingOrOffset,length)}Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr};function from(that,value,encodingOrOffset,length){if("number"==typeof value)throw new TypeError("\"value\" argument must not be a number");return"undefined"!=typeof ArrayBuffer&&value instanceof ArrayBuffer?fromArrayBuffer(that,value,encodingOrOffset,length):"string"==typeof value?fromString(that,value,encodingOrOffset):fromObject(that,value)}if(Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer));function assertSize(size){if("number"!=typeof size)throw new TypeError("\"size\" argument must be a number");else if(0>size)throw new RangeError("\"size\" argument must not be negative")}function alloc(that,size,fill,encoding){return assertSize(size),0>=size?createBuffer(that,size):void 0===fill?createBuffer(that,size):"string"==typeof encoding?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill)}Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)};function allocUnsafe(that,size){if(assertSize(size),that=createBuffer(that,0>size?0:0|checked(size)),!Buffer.TYPED_ARRAY_SUPPORT)for(var i=0;i<size;++i)that[i]=0;return that}Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)};function fromString(that,string,encoding){if(("string"!=typeof encoding||""===encoding)&&(encoding="utf8"),!Buffer.isEncoding(encoding))throw new TypeError("\"encoding\" must be a valid string encoding");var length=0|byteLength(string,encoding);that=createBuffer(that,length);var actual=that.write(string,encoding);return actual!==length&&(that=that.slice(0,actual)),that}function fromArrayLike(that,array){var length=0>array.length?0:0|checked(array.length);that=createBuffer(that,length);for(var i=0;i<length;i+=1)that[i]=255&array[i];return that}function fromArrayBuffer(that,array,byteOffset,length){if(array.byteLength,0>byteOffset||array.byteLength<byteOffset)throw new RangeError("'offset' is out of bounds");if(array.byteLength<byteOffset+(length||0))throw new RangeError("'length' is out of bounds");return array=void 0===byteOffset&&void 0===length?new Uint8Array(array):void 0===length?new Uint8Array(array,byteOffset):new Uint8Array(array,byteOffset,length),Buffer.TYPED_ARRAY_SUPPORT?(that=array,that.__proto__=Buffer.prototype):that=fromArrayLike(that,array),that}function fromObject(that,obj){if(internalIsBuffer(obj)){var len=0|checked(obj.length);return(that=createBuffer(that,len),0===that.length)?that:(obj.copy(that,0,0,len),that)}if(obj){if("undefined"!=typeof ArrayBuffer&&obj.buffer instanceof ArrayBuffer||"length"in obj)return"number"!=typeof obj.length||isnan(obj.length)?createBuffer(that,0):fromArrayLike(that,obj);if("Buffer"===obj.type&&isArray(obj.data))return fromArrayLike(that,obj.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(length){if(length>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}Buffer.isBuffer=isBuffer;function internalIsBuffer(b){return!!(null!=b&&b._isBuffer)}Buffer.compare=function compare(a,b){if(!internalIsBuffer(a)||!internalIsBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0},Buffer.isEncoding=function isEncoding(encoding){switch((encoding+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function concat(list,length){if(!isArray(list))throw new TypeError("\"list\" argument must be an Array of Buffers");if(0===list.length)return Buffer.alloc(0);var i;if(length===void 0)for(length=0,i=0;i<list.length;++i)length+=list[i].length;var buffer=Buffer.allocUnsafe(length),pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!internalIsBuffer(buf))throw new TypeError("\"list\" argument must be an Array of Buffers");buf.copy(buffer,pos),pos+=buf.length}return buffer};function byteLength(string,encoding){if(internalIsBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||0>start)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),0>=end)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");!0;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}Buffer.prototype._isBuffer=!0;function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}Buffer.prototype.swap16=function swap16(){var len=this.length;if(0!=len%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<len;i+=2)swap(this,i,i+1);return this},Buffer.prototype.swap32=function swap32(){var len=this.length;if(0!=len%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<len;i+=4)swap(this,i,i+3),swap(this,i+1,i+2);return this},Buffer.prototype.swap64=function swap64(){var len=this.length;if(0!=len%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<len;i+=8)swap(this,i,i+7),swap(this,i+1,i+6),swap(this,i+2,i+5),swap(this,i+3,i+4);return this},Buffer.prototype.toString=function toString(){var length=0|this.length;return 0==length?"":0===arguments.length?utf8Slice(this,0,length):slowToString.apply(this,arguments)},Buffer.prototype.equals=function equals(b){if(!internalIsBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function inspect(){var str="",max=INSPECT_MAX_BYTES;return 0<this.length&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),"<Buffer "+str+">"},Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){var _Mathmin2=Math.min;if(!internalIsBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),0>start||end>target.length||0>thisStart||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=_Mathmin2(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;i<len;++i)if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i],y=targetCopy[i];break}return x<y?-1:y<x?1:0};function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):2147483647<byteOffset?byteOffset=2147483647:-2147483648>byteOffset&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),0>byteOffset&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(0>byteOffset)if(dir)byteOffset=0;else return-1;if("string"==typeof val&&(val=Buffer.from(val,encoding)),internalIsBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&(encoding=(encoding+"").toLowerCase(),"ucs2"===encoding||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(2>arr.length||2>val.length)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++)if(read(arr,i)!==read(val,-1===foundIndex?0:i-foundIndex))-1!==foundIndex&&(i-=i-foundIndex),foundIndex=-1;else if(-1===foundIndex&&(foundIndex=i),i-foundIndex+1===valLength)return foundIndex*indexSize}else for(byteOffset+valLength>arrLength&&(byteOffset=arrLength-valLength),i=byteOffset;0<=i;i--){for(var found=!0,j=0;j<valLength;j++)if(read(arr,i+j)!==read(val,j)){found=!1;break}if(found)return i}return-1}Buffer.prototype.includes=function includes(val,byteOffset,encoding){return-1!==this.indexOf(val,byteOffset,encoding)},Buffer.prototype.indexOf=function indexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!0)},Buffer.prototype.lastIndexOf=function lastIndexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!1)};function hexWrite(buf,string,offset,length){offset=+offset||0;var remaining=buf.length-offset;length?(length=+length,length>remaining&&(length=remaining)):length=remaining;var strLen=string.length;if(0!=strLen%2)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0,parsed;i<length;++i){if(parsed=parseInt(string.substr(2*i,2),16),isNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(asciiToBytes(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length)}Buffer.prototype.write=function write(string,offset,length,encoding){if(void 0===offset)encoding="utf8",length=this.length,offset=0;else if(void 0===length&&"string"==typeof offset)encoding=offset,length=this.length,offset=0;else if(isFinite(offset))offset|=0,isFinite(length)?(length|=0,void 0===encoding&&(encoding="utf8")):(encoding=length,length=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var remaining=this.length-offset;if((void 0===length||length>remaining)&&(length=remaining),0<string.length&&(0>length||0>offset)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){return 0===start&&end===buf.length?fromByteArray(buf):fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i<end;){var firstByte=buf[i],codePoint=null,bytesPerSequence=239<firstByte?4:223<firstByte?3:191<firstByte?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;1===bytesPerSequence?128>firstByte&&(codePoint=firstByte):2===bytesPerSequence?(secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte,127<tempCodePoint&&(codePoint=tempCodePoint))):3===bytesPerSequence?(secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte,2047<tempCodePoint&&(55296>tempCodePoint||57343<tempCodePoint)&&(codePoint=tempCodePoint))):4===bytesPerSequence?(secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte,65535<tempCodePoint&&1114112>tempCodePoint&&(codePoint=tempCodePoint))):void 0}null===codePoint?(codePoint=65533,bytesPerSequence=1):65535<codePoint&&(codePoint-=65536,res.push(55296|1023&codePoint>>>10),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){var _StringfromCharCode=String.fromCharCode,len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return _StringfromCharCode.apply(String,codePoints);for(var res="",i=0;i<len;)res+=_StringfromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH));return res}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(127&buf[i]);return ret}function latin1Slice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(buf[i]);return ret}function hexSlice(buf,start,end){var len=buf.length;(!start||0>start)&&(start=0),(!end||0>end||end>len)&&(end=len);for(var out="",i=start;i<end;++i)out+=toHex(buf[i]);return out}function utf16leSlice(buf,start,end){for(var bytes=buf.slice(start,end),res="",i=0;i<bytes.length;i+=2)res+=String.fromCharCode(bytes[i]+256*bytes[i+1]);return res}Buffer.prototype.slice=function slice(start,end){var len=this.length;start=~~start,end=end===void 0?len:~~end,0>start?(start+=len,0>start&&(start=0)):start>len&&(start=len),0>end?(end+=len,0>end&&(end=0)):end>len&&(end=len),end<start&&(end=start);var newBuf;if(Buffer.TYPED_ARRAY_SUPPORT)newBuf=this.subarray(start,end),newBuf.__proto__=Buffer.prototype;else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,void 0);for(var i=0;i<sliceLen;++i)newBuf[i]=this[i+start]}return newBuf};function checkOffset(offset,ext,length){if(0!=offset%1||0>offset)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return val},Buffer.prototype.readUIntBE=function readUIntBE(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset+--byteLength],mul=1;0<byteLength&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){var _Mathpow3=Math.pow;offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return mul*=128,val>=mul&&(val-=_Mathpow3(2,8*byteLength)),val},Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){var _Mathpow4=Math.pow;offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];0<i&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=_Mathpow4(2,8*byteLength)),val},Buffer.prototype.readInt8=function readInt8(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?-1*(255-this[offset]+1):this[offset]},Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),read(this,offset,!1,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!internalIsBuffer(buf))throw new TypeError("\"buffer\" argument must be a Buffer instance");if(value>max||value<min)throw new RangeError("\"value\" argument is out of bounds");if(offset+ext>buf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){var _Mathpow5=Math.pow;if(value=+value,offset|=0,byteLength|=0,!noAssert){var maxBytes=_Mathpow5(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1,i=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)this[offset+i]=255&value/mul;return offset+byteLength},Buffer.prototype.writeUIntBE=function writeUIntBE(value,offset,byteLength,noAssert){var _Mathpow6=Math.pow;if(value=+value,offset|=0,byteLength|=0,!noAssert){var maxBytes=_Mathpow6(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1,mul=1;for(this[offset+i]=255&value;0<=--i&&(mul*=256);)this[offset+i]=255&value/mul;return offset+byteLength},Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){var _Mathfloor3=Math.floor;return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=_Mathfloor3(value)),this[offset]=255&value,offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){0>value&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i<j;++i)buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>8*(littleEndian?i:1-i)}Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){0>value&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i<j;++i)buf[offset+i]=255&value>>>8*(littleEndian?i:3-i)}Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){var _Mathpow7=Math.pow;if(value=+value,offset|=0,!noAssert){var limit=_Mathpow7(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)0>value&&0===sub&&0!==this[offset+i-1]&&(sub=1),this[offset+i]=255&(value/mul>>0)-sub;return offset+byteLength},Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){var _Mathpow8=Math.pow;if(value=+value,offset|=0,!noAssert){var limit=_Mathpow8(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;0<=--i&&(mul*=256);)0>value&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=255&(value/mul>>0)-sub;return offset+byteLength},Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){var _Mathfloor4=Math.floor;return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=_Mathfloor4(value)),0>value&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),0>value&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(0>offset)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4),write(buf,value,offset,littleEndian,23,4),offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8),write(buf,value,offset,littleEndian,52,8),offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function copy(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),0<end&&end<start&&(end=start),end===start)return 0;if(0===target.length||0===this.length)return 0;if(0>targetStart)throw new RangeError("targetStart out of bounds");if(0>start||start>=this.length)throw new RangeError("sourceStart out of bounds");if(0>end)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart<end-start&&(end=target.length-targetStart+start);var len=end-start,i;if(this===target&&start<targetStart&&targetStart<end)for(i=len-1;0<=i;--i)target[i+targetStart]=this[i+start];else if(1e3>len||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<len;++i)target[i+targetStart]=this[i+start];else Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart);return len},Buffer.prototype.fill=function fill(val,start,end,encoding){if("string"==typeof val){if("string"==typeof start?(encoding=start,start=0,end=this.length):"string"==typeof end&&(encoding=end,end=this.length),1===val.length){var code=val.charCodeAt(0);256>code&&(val=code)}if(void 0!==encoding&&"string"!=typeof encoding)throw new TypeError("encoding must be a string");if("string"==typeof encoding&&!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding)}else"number"==typeof val&&(val&=255);if(0>start||this.length<start||this.length<end)throw new RangeError("Out of range index");if(end<=start)return this;start>>>=0,end=end===void 0?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i<end;++i)this[i]=val;else{var bytes=internalIsBuffer(val)?val:utf8ToBytes(new Buffer(val,encoding).toString()),len=bytes.length;for(i=0;i<end-start;++i)this[i+start]=bytes[i%len]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(str){if(str=stringtrim(str).replace(INVALID_BASE64_RE,""),2>str.length)return"";for(;0!=str.length%4;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function toHex(n){return 16>n?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||1/0;for(var length=string.length,leadSurrogate=null,bytes=[],i=0,codePoint;i<length;++i){if(codePoint=string.charCodeAt(i),55295<codePoint&&57344>codePoint){if(!leadSurrogate){if(56319<codePoint){-1<(units-=3)&&bytes.push(239,191,189);continue}else if(i+1===length){-1<(units-=3)&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(56320>codePoint){-1<(units-=3)&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else leadSurrogate&&-1<(units-=3)&&bytes.push(239,191,189);if(leadSurrogate=null,128>codePoint){if(0>(units-=1))break;bytes.push(codePoint)}else if(2048>codePoint){if(0>(units-=2))break;bytes.push(192|codePoint>>6,128|63&codePoint)}else if(65536>codePoint){if(0>(units-=3))break;bytes.push(224|codePoint>>12,128|63&codePoint>>6,128|63&codePoint)}else if(1114112>codePoint){if(0>(units-=4))break;bytes.push(240|codePoint>>18,128|63&codePoint>>12,128|63&codePoint>>6,128|63&codePoint)}else throw new Error("Invalid code point")}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i<str.length;++i)byteArray.push(255&str.charCodeAt(i));return byteArray}function utf16leToBytes(str,units){for(var byteArray=[],i=0,c,hi,lo;i<str.length&&!(0>(units-=2));++i)c=str.charCodeAt(i),hi=c>>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length&&!(i+offset>=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isnan(val){return val!==val}function isBuffer(obj){return null!=obj&&(!!obj._isBuffer||isFastBuffer(obj)||isSlowBuffer(obj))}function isFastBuffer(obj){return!!obj.constructor&&"function"==typeof obj.constructor.isBuffer&&obj.constructor.isBuffer(obj)}function isSlowBuffer(obj){return"function"==typeof obj.readFloatLE&&"function"==typeof obj.slice&&isFastBuffer(obj.slice(0,0))}class CsvError extends Error{constructor(code,message,options,...contexts){Array.isArray(message)&&(message=message.join(" ").trim()),super(message),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,CsvError),this.code=code;for(const context of contexts)for(const key in context){const value=context[key];this[key]=isBuffer(value)?value.toString(options.encoding):null==value?value:JSON.parse(JSON.stringify(value))}}}const is_object=function(obj){return"object"==typeof obj&&null!==obj&&!Array.isArray(obj)},normalize_columns_array=function(columns){const normalizedColumns=[];for(let i=0,l=columns.length;i<l;i++){const column=columns[i];if(column===void 0||null===column||!1===column)normalizedColumns[i]={disabled:!0};else if("string"==typeof column)normalizedColumns[i]={name:column};else if(is_object(column)){if("string"!=typeof column.name)throw new CsvError("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${i}`,"when column is an object literal"]);normalizedColumns[i]=column}else throw new CsvError("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(column)} at position ${i}`])}return normalizedColumns};class ResizeableBuffer{constructor(size=100){this.size=size,this.length=0,this.buf=Buffer.allocUnsafe(size)}prepend(val){if(isBuffer(val)){const length=this.length+val.length;if(length>=this.size&&(this.resize(),length>=this.size))throw Error("INVALID_BUFFER_STATE");const buf=this.buf;this.buf=Buffer.allocUnsafe(this.size),val.copy(this.buf,0),buf.copy(this.buf,val.length),this.length+=val.length}else{const length=this.length++;length===this.size&&this.resize();const buf=this.clone();this.buf[0]=val,buf.copy(this.buf,1,0,length)}}append(val){const length=this.length++;length===this.size&&this.resize(),this.buf[length]=val}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){const length=this.length;this.size*=2;const buf=Buffer.allocUnsafe(this.size);this.buf.copy(buf,0,0,length),this.buf=buf}toString(encoding){return encoding?this.buf.slice(0,this.length).toString(encoding):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}}const np=12,cr$1=13,nl$1=10,space=32,tab=9,init_state=function(options){var _Mathmax3=Math.max;return{bomSkipped:!1,bufBytesStart:0,castField:options.cast_function,commenting:!1,error:void 0,enabled:1===options.from_line,escaping:!1,escapeIsQuote:isBuffer(options.escape)&&isBuffer(options.quote)&&0===Buffer.compare(options.escape,options.quote),expectedRecordLength:Array.isArray(options.columns)?options.columns.length:void 0,field:new ResizeableBuffer(20),firstLineToHeaders:options.cast_first_line_to_header,needMoreDataSize:_Mathmax3(null===options.comment?0:options.comment.length,...options.delimiter.map(delimiter=>delimiter.length),null===options.quote?0:options.quote.length),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new ResizeableBuffer(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:0===options.record_delimiter.length?0:_Mathmax3(...options.record_delimiter.map(v=>v.length)),trimChars:[Buffer.from(" ",options.encoding)[0],Buffer.from("\t",options.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:[Buffer.from(Buffer.from([cr$1],"utf8").toString(),options.encoding),Buffer.from(Buffer.from([nl$1],"utf8").toString(),options.encoding),Buffer.from(Buffer.from([np],"utf8").toString(),options.encoding),Buffer.from(Buffer.from([space],"utf8").toString(),options.encoding),Buffer.from(Buffer.from([tab],"utf8").toString(),options.encoding)]}},underscore=function(str){return str.replace(/([A-Z])/g,function(_,match){return"_"+match.toLowerCase()})},normalize_options=function(opts){var _NumberisInteger=Number.isInteger,_Mathfloor5=Math.floor;const options={};for(const opt in opts)options[underscore(opt)]=opts[opt];if(void 0===options.encoding||!0===options.encoding)options.encoding="utf8";else if(null===options.encoding||!1===options.encoding)options.encoding=null;else if("string"!=typeof options.encoding&&null!==options.encoding)throw new CsvError("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(options.encoding)}`],options);if(void 0===options.bom||null===options.bom||!1===options.bom)options.bom=!1;else if(!0!==options.bom)throw new CsvError("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(options.bom)}`],options);if(options.cast_function=null,void 0===options.cast||null===options.cast||!1===options.cast||""===options.cast)options.cast=void 0;else if("function"==typeof options.cast)options.cast_function=options.cast,options.cast=!0;else if(!0!==options.cast)throw new CsvError("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(options.cast)}`],options);if(void 0===options.cast_date||null===options.cast_date||!1===options.cast_date||""===options.cast_date)options.cast_date=!1;else if(!0===options.cast_date)options.cast_date=function(value){const date=Date.parse(value);return isNaN(date)?value:new Date(date)};else if("function"!=typeof options.cast_date)throw new CsvError("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(options.cast_date)}`],options);if(options.cast_first_line_to_header=void 0,!0===options.columns)options.cast_first_line_to_header=void 0;else if("function"==typeof options.columns)options.cast_first_line_to_header=options.columns,options.columns=!0;else if(Array.isArray(options.columns))options.columns=normalize_columns_array(options.columns);else if(void 0===options.columns||null===options.columns||!1===options.columns)options.columns=!1;else throw new CsvError("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(options.columns)}`],options);if(void 0===options.group_columns_by_name||null===options.group_columns_by_name||!1===options.group_columns_by_name)options.group_columns_by_name=!1;else if(!0!==options.group_columns_by_name)throw new CsvError("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(options.group_columns_by_name)}`],options);else if(!1===options.columns)throw new CsvError("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],options);if(void 0===options.comment||null===options.comment||!1===options.comment||""===options.comment)options.comment=null;else if("string"==typeof options.comment&&(options.comment=Buffer.from(options.comment,options.encoding)),!isBuffer(options.comment))throw new CsvError("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(options.comment)}`],options);if(void 0===options.comment_no_infix||null===options.comment_no_infix||!1===options.comment_no_infix)options.comment_no_infix=!1;else if(!0!==options.comment_no_infix)throw new CsvError("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(options.comment_no_infix)}`],options);const delimiter_json=JSON.stringify(options.delimiter);if(Array.isArray(options.delimiter)||(options.delimiter=[options.delimiter]),0===options.delimiter.length)throw new CsvError("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${delimiter_json}`],options);if(options.delimiter=options.delimiter.map(function(delimiter){if(void 0===delimiter||null===delimiter||!1===delimiter)return Buffer.from(",",options.encoding);if("string"==typeof delimiter&&(delimiter=Buffer.from(delimiter,options.encoding)),!isBuffer(delimiter)||0===delimiter.length)throw new CsvError("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${delimiter_json}`],options);return delimiter}),void 0===options.escape||!0===options.escape?options.escape=Buffer.from("\"",options.encoding):"string"==typeof options.escape?options.escape=Buffer.from(options.escape,options.encoding):(null===options.escape||!1===options.escape)&&(options.escape=null),null!==options.escape&&!isBuffer(options.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(options.escape)}`);if(void 0===options.from||null===options.from)options.from=1;else if("string"==typeof options.from&&/\d+/.test(options.from)&&(options.from=parseInt(options.from)),!_NumberisInteger(options.from))throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(options.from)}`);else if(0>options.from)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(opts.from)}`);if(void 0===options.from_line||null===options.from_line)options.from_line=1;else if("string"==typeof options.from_line&&/\d+/.test(options.from_line)&&(options.from_line=parseInt(options.from_line)),!_NumberisInteger(options.from_line))throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(opts.from_line)}`);else if(0>=options.from_line)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(opts.from_line)}`);if(void 0===options.ignore_last_delimiters||null===options.ignore_last_delimiters)options.ignore_last_delimiters=!1;else if("number"==typeof options.ignore_last_delimiters)options.ignore_last_delimiters=_Mathfloor5(options.ignore_last_delimiters),0===options.ignore_last_delimiters&&(options.ignore_last_delimiters=!1);else if("boolean"!=typeof options.ignore_last_delimiters)throw new CsvError("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(options.ignore_last_delimiters)}`],options);if(!0===options.ignore_last_delimiters&&!1===options.columns)throw new CsvError("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],options);if(void 0===options.info||null===options.info||!1===options.info)options.info=!1;else if(!0!==options.info)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(options.info)}`);if(void 0===options.max_record_size||null===options.max_record_size||!1===options.max_record_size)options.max_record_size=0;else if(_NumberisInteger(options.max_record_size)&&0<=options.max_record_size);else if("string"==typeof options.max_record_size&&/\d+/.test(options.max_record_size))options.max_record_size=parseInt(options.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(options.max_record_size)}`);if(void 0===options.objname||null===options.objname||!1===options.objname)options.objname=void 0;else if(isBuffer(options.objname)){if(0===options.objname.length)throw new Error(`Invalid Option: objname must be a non empty buffer`);if(null===options.encoding);else options.objname=options.objname.toString(options.encoding)}else if("string"==typeof options.objname){if(0===options.objname.length)throw new Error(`Invalid Option: objname must be a non empty string`);}else if("number"==typeof options.objname);else throw new Error(`Invalid Option: objname must be a string or a buffer, got ${options.objname}`);if(void 0!==options.objname)if("number"==typeof options.objname){if(!1!==options.columns)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field");}else if(!1===options.columns)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index");if(void 0===options.on_record||null===options.on_record)options.on_record=void 0;else if("function"!=typeof options.on_record)throw new CsvError("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(options.on_record)}`],options);if(void 0!==options.on_skip&&null!==options.on_skip&&"function"!=typeof options.on_skip)throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(options.on_skip)}`);if(null===options.quote||!1===options.quote||""===options.quote)options.quote=null;else if(void 0===options.quote||!0===options.quote?options.quote=Buffer.from("\"",options.encoding):"string"==typeof options.quote&&(options.quote=Buffer.from(options.quote,options.encoding)),!isBuffer(options.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(options.quote)}`);if(void 0===options.raw||null===options.raw||!1===options.raw)options.raw=!1;else if(!0!==options.raw)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(options.raw)}`);if(void 0===options.record_delimiter)options.record_delimiter=[];else if("string"==typeof options.record_delimiter||isBuffer(options.record_delimiter)){if(0===options.record_delimiter.length)throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(options.record_delimiter)}`],options);options.record_delimiter=[options.record_delimiter]}else if(!Array.isArray(options.record_delimiter))throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(options.record_delimiter)}`],options);if(options.record_delimiter=options.record_delimiter.map(function(rd,i){if("string"!=typeof rd&&!isBuffer(rd))throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${i},`,`got ${JSON.stringify(rd)}`],options);else if(0===rd.length)throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${i},`,`got ${JSON.stringify(rd)}`],options);return"string"==typeof rd&&(rd=Buffer.from(rd,options.encoding)),rd}),"boolean"==typeof options.relax_column_count);else if(void 0===options.relax_column_count||null===options.relax_column_count)options.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(options.relax_column_count)}`);if("boolean"==typeof options.relax_column_count_less);else if(void 0===options.relax_column_count_less||null===options.relax_column_count_less)options.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(options.relax_column_count_less)}`);if("boolean"==typeof options.relax_column_count_more);else if(void 0===options.relax_column_count_more||null===options.relax_column_count_more)options.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(options.relax_column_count_more)}`);if("boolean"==typeof options.relax_quotes);else if(void 0===options.relax_quotes||null===options.relax_quotes)options.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(options.relax_quotes)}`);if("boolean"==typeof options.skip_empty_lines);else if(void 0===options.skip_empty_lines||null===options.skip_empty_lines)options.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(options.skip_empty_lines)}`);if("boolean"==typeof options.skip_records_with_empty_values);else if(void 0===options.skip_records_with_empty_values||null===options.skip_records_with_empty_values)options.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(options.skip_records_with_empty_values)}`);if("boolean"==typeof options.skip_records_with_error);else if(void 0===options.skip_records_with_error||null===options.skip_records_with_error)options.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(options.skip_records_with_error)}`);if(void 0===options.rtrim||null===options.rtrim||!1===options.rtrim)options.rtrim=!1;else if(!0!==options.rtrim)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(options.rtrim)}`);if(void 0===options.ltrim||null===options.ltrim||!1===options.ltrim)options.ltrim=!1;else if(!0!==options.ltrim)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(options.ltrim)}`);if(void 0===options.trim||null===options.trim||!1===options.trim)options.trim=!1;else if(!0!==options.trim)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(options.trim)}`);if(!0===options.trim&&!1!==opts.ltrim?options.ltrim=!0:!0!==options.ltrim&&(options.ltrim=!1),!0===options.trim&&!1!==opts.rtrim?options.rtrim=!0:!0!==options.rtrim&&(options.rtrim=!1),void 0===options.to||null===options.to)options.to=-1;else if(-1!==options.to)if("string"==typeof options.to&&/\d+/.test(options.to)&&(options.to=parseInt(options.to)),!_NumberisInteger(options.to))throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(opts.to)}`);else if(0>=options.to)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(opts.to)}`);if(void 0===options.to_line||null===options.to_line)options.to_line=-1;else if(-1!==options.to_line)if("string"==typeof options.to_line&&/\d+/.test(options.to_line)&&(options.to_line=parseInt(options.to_line)),!_NumberisInteger(options.to_line))throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(opts.to_line)}`);else if(0>=options.to_line)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(opts.to_line)}`);return options},isRecordEmpty=function(record){return record.every(field=>null==field||field.toString&&""===field.toString().trim())},cr=13,nl=10,boms={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},transform=function(original_options={}){var _StringfromCharCode2=String.fromCharCode;const info={bytes:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},options=normalize_options(original_options);return{info:info,original_options:original_options,options:options,state:init_state(options),__needMoreData:function(i,bufLen,end){if(end)return!1;const{encoding,escape,quote}=this.options,{quoting,needMoreDataSize,recordDelimiterMaxLength}=this.state,numOfCharLeft=bufLen-i-1,requiredLength=Math.max(needMoreDataSize,0===recordDelimiterMaxLength?Buffer.from("\r\n",encoding).length:recordDelimiterMaxLength,quoting?(null===escape?0:escape.length)+quote.length:0,quoting?quote.length+recordDelimiterMaxLength:0);return numOfCharLeft<requiredLength},parse:function(nextBuf,end,push,close){const{bom,comment_no_infix,encoding,from_line,ltrim,max_record_size,raw,relax_quotes,rtrim,skip_empty_lines,to,to_line}=this.options;let{comment,escape,quote,record_delimiter}=this.options;const{bomSkipped,previousBuf,rawBuffer,escapeIsQuote}=this.state;let buf;if(previousBuf===void 0){if(void 0===nextBuf)return void close();buf=nextBuf}else buf=void 0!==previousBuf&&void 0===nextBuf?previousBuf:Buffer.concat([previousBuf,nextBuf]);if(!1===bomSkipped)if(!1===bom)this.state.bomSkipped=!0;else if(!(3>buf.length)){for(const encoding in boms)if(0===boms[encoding].compare(buf,0,boms[encoding].length)){const bomLength=boms[encoding].length;this.state.bufBytesStart+=bomLength,buf=buf.slice(bomLength);const options=normalize_options({...this.original_options,encoding:encoding});for(const key in options)this.options[key]=options[key];({comment,escape,quote}=this.options);break}this.state.bomSkipped=!0}else if(!1===end)return void(this.state.previousBuf=buf);const bufLen=buf.length;let pos;for(pos=0;pos<bufLen&&!this.__needMoreData(pos,bufLen,end);pos++){if(!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1),-1!==to_line&&this.info.lines>to_line)return this.state.stop=!0,void close();if(!1===this.state.quoting&&0===record_delimiter.length){const record_delimiterCount=this.__autoDiscoverRecordDelimiter(buf,pos);record_delimiterCount&&(record_delimiter=this.options.record_delimiter)}const chr=buf[pos];if(!0===raw&&rawBuffer.append(chr),(chr===cr||chr===nl)&&!1===this.state.wasRowDelimiter&&(this.state.wasRowDelimiter=!0),!0===this.state.escaping)this.state.escaping=!1;else{if(null!==escape&&!0===this.state.quoting&&this.__isEscape(buf,pos,chr)&&pos+escape.length<bufLen)if(!escapeIsQuote){this.state.escaping=!0,pos+=escape.length-1;continue}else if(this.__isQuote(buf,pos+escape.length)){this.state.escaping=!0,pos+=escape.length-1;continue}if(!1===this.state.commenting&&this.__isQuote(buf,pos))if(!0===this.state.quoting){const nextChr=buf[pos+quote.length],isNextChrTrimable=rtrim&&this.__isCharTrimable(buf,pos+quote.length),isNextChrComment=null!==comment&&this.__compareBytes(comment,buf,pos+quote.length,nextChr),isNextChrDelimiter=this.__isDelimiter(buf,pos+quote.length,nextChr),isNextChrRecordDelimiter=0===record_delimiter.length?this.__autoDiscoverRecordDelimiter(buf,pos+quote.length):this.__isRecordDelimiter(nextChr,buf,pos+quote.length);if(null!==escape&&this.__isEscape(buf,pos,chr)&&this.__isQuote(buf,pos+escape.length))pos+=escape.length-1;else if(!nextChr||isNextChrDelimiter||isNextChrRecordDelimiter||isNextChrComment||isNextChrTrimable){this.state.quoting=!1,this.state.wasQuoting=!0,pos+=quote.length-1;continue}else if(!1===relax_quotes){const err=this.__error(new CsvError("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${_StringfromCharCode2(nextChr)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(void 0!==err)return err}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(quote),pos+=quote.length-1}else if(0===this.state.field.length){this.state.quoting=!0,pos+=quote.length-1;continue}else if(!1===relax_quotes){const info=this.__infoField(),bom=Object.keys(boms).map(b=>!!boms[b].equals(this.state.field.toString())&&b).filter(Boolean)[0],err=this.__error(new CsvError("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(info.column)} at line ${info.lines}, value is ${JSON.stringify(this.state.field.toString(encoding))}`,bom?`(${bom} bom)`:void 0],this.options,info,{field:this.state.field}));if(void 0!==err)return err}if(!1===this.state.quoting){const recordDelimiterLength=this.__isRecordDelimiter(chr,buf,pos);if(0!==recordDelimiterLength){const skipCommentLine=this.state.commenting&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length;if(skipCommentLine)this.info.comment_lines++;else{if(!1===this.state.enabled&&this.info.lines+(!0===this.state.wasRowDelimiter?1:0)>=from_line){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),pos+=recordDelimiterLength-1;continue}if(!0===skip_empty_lines&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length){this.info.empty_lines++,pos+=recordDelimiterLength-1;continue}this.info.bytes=this.state.bufBytesStart+pos;const errField=this.__onField();if(void 0!==errField)return errField;this.info.bytes=this.state.bufBytesStart+pos+recordDelimiterLength;const errRecord=this.__onRecord(push);if(void 0!==errRecord)return errRecord;if(-1!==to&&this.info.records>=to)return this.state.stop=!0,void close()}this.state.commenting=!1,pos+=recordDelimiterLength-1;continue}if(this.state.commenting)continue;if(null!==comment&&(!1===comment_no_infix||0===this.state.record.length&&0===this.state.field.length)){const commentCount=this.__compareBytes(comment,buf,pos,chr);if(0!==commentCount){this.state.commenting=!0;continue}}const delimiterLength=this.__isDelimiter(buf,pos,chr);if(0!==delimiterLength){this.info.bytes=this.state.bufBytesStart+pos;const errField=this.__onField();if(void 0!==errField)return errField;pos+=delimiterLength-1;continue}}}if(!1===this.state.commenting&&0!==max_record_size&&this.state.record_length+this.state.field.length>max_record_size)return this.__error(new CsvError("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${max_record_size}`,`at line ${this.info.lines}`],this.options,this.__infoField()));const lappend=!1===ltrim||!0===this.state.quoting||0!==this.state.field.length||!this.__isCharTrimable(buf,pos),rappend=!1===rtrim||!1===this.state.wasQuoting;if(!0==lappend&&!0===rappend)this.state.field.append(chr);else{if(!0===rtrim&&!this.__isCharTrimable(buf,pos))return this.__error(new CsvError("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));!1===lappend&&(pos+=this.__isCharTrimable(buf,pos)-1);continue}}if(!(!0===end))this.state.bufBytesStart+=pos,this.state.previousBuf=buf.slice(pos);else if(!0===this.state.quoting){const err=this.__error(new CsvError("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(void 0!==err)return err}else if(!0===this.state.wasQuoting||0!==this.state.record.length||0!==this.state.field.length){this.info.bytes=this.state.bufBytesStart+pos;const errField=this.__onField();if(void 0!==errField)return errField;const errRecord=this.__onRecord(push);if(void 0!==errRecord)return errRecord}else!0===this.state.wasRowDelimiter?this.info.empty_lines++:!0===this.state.commenting&&this.info.comment_lines++;!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(push){const{columns,group_columns_by_name,encoding,info,from,relax_column_count,relax_column_count_less,relax_column_count_more,raw,skip_records_with_empty_values}=this.options,{enabled,record}=this.state;if(!1===enabled)return this.__resetRecord();const recordLength=record.length;if(!0===columns)return!0===skip_records_with_empty_values&&isRecordEmpty(record)?void this.__resetRecord():this.__firstLineToColumns(record);if(!1===columns&&0===this.info.records&&(this.state.expectedRecordLength=recordLength),recordLength!==this.state.expectedRecordLength){const err=!1===columns?new CsvError("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${recordLength} on line ${this.info.lines}`],this.options,this.__infoField(),{record:record}):new CsvError("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${columns.length},`,`got ${recordLength} on line ${this.info.lines}`],this.options,this.__infoField(),{record:record});if(!0===relax_column_count||!0===relax_column_count_less&&recordLength<this.state.expectedRecordLength||!0===relax_column_count_more&&recordLength>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=err;else{const finalErr=this.__error(err);if(finalErr)return finalErr}}if(!0===skip_records_with_empty_values&&isRecordEmpty(record))return void this.__resetRecord();if(!0===this.state.recordHasError)return this.__resetRecord(),void(this.state.recordHasError=!1);if(this.info.records++,1===from||this.info.records>=from){const{objname}=this.options;if(!1!==columns){const obj={};for(let i=0,l=record.length;i<l;i++)void 0===columns[i]||columns[i].disabled||(obj[columns[i].name]=!0===group_columns_by_name&&void 0!==obj[columns[i].name]?Array.isArray(obj[columns[i].name])?obj[columns[i].name].concat(record[i]):[obj[columns[i].name],record[i]]:record[i]);if(!0===raw||!0===info){const extRecord=Object.assign({record:obj},!0===raw?{raw:this.state.rawBuffer.toString(encoding)}:{},!0===info?{info:this.__infoRecord()}:{}),err=this.__push(void 0===objname?extRecord:[obj[objname],extRecord],push);if(err)return err}else{const err=this.__push(void 0===objname?obj:[obj[objname],obj],push);if(err)return err}}else if(!0===raw||!0===info){const extRecord=Object.assign({record:record},!0===raw?{raw:this.state.rawBuffer.toString(encoding)}:{},!0===info?{info:this.__infoRecord()}:{}),err=this.__push(void 0===objname?extRecord:[record[objname],extRecord],push);if(err)return err}else{const err=this.__push(void 0===objname?record:[record[objname],record],push);if(err)return err}}this.__resetRecord()},__firstLineToColumns:function(record){const{firstLineToHeaders}=this.state;try{const headers=void 0===firstLineToHeaders?record:firstLineToHeaders.call(null,record);if(!Array.isArray(headers))return this.__error(new CsvError("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(headers)}`],this.options,this.__infoField(),{headers:headers}));const normalizedHeaders=normalize_columns_array(headers);return this.state.expectedRecordLength=normalizedHeaders.length,this.options.columns=normalizedHeaders,void this.__resetRecord()}catch(err){return err}},__resetRecord:function(){!0===this.options.raw&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){const{cast,encoding,rtrim,max_record_size}=this.options,{enabled,wasQuoting}=this.state;if(!1===enabled)return this.__resetField();let field=this.state.field.toString(encoding);if(!0===rtrim&&!1===wasQuoting&&(field=field.trimRight()),!0===cast){const[err,f]=this.__cast(field);if(void 0!==err)return err;field=f}this.state.record.push(field),0!==max_record_size&&"string"==typeof field&&(this.state.record_length+=field.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(record,push){const{on_record}=this.options;if(on_record!==void 0){const info=this.__infoRecord();try{record=on_record.call(null,record,info)}catch(err){return err}if(record===void 0||null===record)return}push(record)},__cast:function(field){const{columns,relax_column_count}=this.options,isColumns=Array.isArray(columns);if(!0===isColumns&&relax_column_count&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(null!==this.state.castField)try{const info=this.__infoField();return[void 0,this.state.castField.call(null,field,info)]}catch(err){return[err]}if(this.__isFloat(field))return[void 0,parseFloat(field)];if(!1!==this.options.cast_date){const info=this.__infoField();return[void 0,this.options.cast_date.call(null,field,info)]}return[void 0,field]},__isCharTrimable:function(buf,pos){const isTrim=(buf,pos)=>{const{timchars}=this.state;loop1:for(let i=0;i<timchars.length;i++){const timchar=timchars[i];for(let j=0;j<timchar.length;j++)if(timchar[j]!==buf[pos+j])continue loop1;return timchar.length}return 0};return isTrim(buf,pos)},__isFloat:function(value){return 0<=value-parseFloat(value)+1},__compareBytes:function(sourceBuf,targetBuf,targetPos,firstByte){if(sourceBuf[0]!==firstByte)return 0;const sourceLength=sourceBuf.length;for(let i=1;i<sourceLength;i++)if(sourceBuf[i]!==targetBuf[targetPos+i])return 0;return sourceLength},__isDelimiter:function(buf,pos,chr){const{delimiter,ignore_last_delimiters}=this.options;if(!0===ignore_last_delimiters&&this.state.record.length===this.options.columns.length-1)return 0;if(!1!==ignore_last_delimiters&&"number"==typeof ignore_last_delimiters&&this.state.record.length===ignore_last_delimiters-1)return 0;loop1:for(let i=0;i<delimiter.length;i++){const del=delimiter[i];if(del[0]===chr){for(let j=1;j<del.length;j++)if(del[j]!==buf[pos+j])continue loop1;return del.length}}return 0},__isRecordDelimiter:function(chr,buf,pos){const{record_delimiter}=this.options,recordDelimiterLength=record_delimiter.length;loop1:for(let i=0;i<recordDelimiterLength;i++){const rd=record_delimiter[i],rdLength=rd.length;if(rd[0]===chr){for(let j=1;j<rdLength;j++)if(rd[j]!==buf[pos+j])continue loop1;return rd.length}}return 0},__isEscape:function(buf,pos,chr){const{escape}=this.options;if(null===escape)return!1;const l=escape.length;if(escape[0]===chr){for(let i=0;i<l;i++)if(escape[i]!==buf[pos+i])return!1;return!0}return!1},__isQuote:function(buf,pos){const{quote}=this.options;if(null===quote)return!1;const l=quote.length;for(let i=0;i<l;i++)if(quote[i]!==buf[pos+i])return!1;return!0},__autoDiscoverRecordDelimiter:function(buf,pos){const{encoding}=this.options,rds=[Buffer.from("\r\n",encoding),Buffer.from("\n",encoding),Buffer.from("\r",encoding)];loop:for(let i=0;i<rds.length;i++){const l=rds[i].length;for(let j=0;j<l;j++)if(rds[i][j]!==buf[pos+j])continue loop;return this.options.record_delimiter.push(rds[i]),this.state.recordDelimiterMaxLength=rds[i].length,rds[i].length}return 0},__error:function(msg){const{encoding,raw,skip_records_with_error}=this.options,err="string"==typeof msg?new Error(msg):msg;if(skip_records_with_error){if(this.state.recordHasError=!0,void 0!==this.options.on_skip)try{this.options.on_skip(err,raw?this.state.rawBuffer.toString(encoding):void 0)}catch(err){return err}return}return err},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){const{columns,raw,encoding}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:!0===columns,index:this.state.record.length,raw:raw?this.state.rawBuffer.toString(encoding):void 0}},__infoField:function(){const{columns}=this.options,isColumns=Array.isArray(columns);return{...this.__infoRecord(),column:!0===isColumns?columns.length>this.state.record.length?columns[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}},parse=function(data,opts={}){"string"==typeof data&&(data=Buffer.from(data));const records=opts&&opts.objname?{}:[],parser=transform(opts),push=record=>{parser.options.objname===void 0?records.push(record):records[record[0]]=record[1]},close=()=>{},error=parser.parse(data,!0,push,close);if(error!==void 0)throw error;return records};var __decorate$X=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const WEB_FEATURE_ID_RE=/^[a-z0-9]+(-[a-z0-9]+)*$/,CHROMESTATUS_URL_RE=/https:\/\/(wwww.)?chromestatus.com\/feature\/(?<id>[0-9]+)/;let ChromedashBulkEditPage=class ChromedashBulkEditPage extends i$4{constructor(){super(...arguments),this.parsing=!1,this.cells=[],this.featureIdIndex=-1,this.chromestatusUrlIndex=-1,this.items=[],this.submitting=!1}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7` + section { + margin: var(--content-padding); + } + .diff.old { + background: #fdd; + } + .diff.new { + background: #dfd; + } + `]}parseChromestatusIdFromURL(url){const match=url.match(CHROMESTATUS_URL_RE);if(match)return+match.groups?.id;try{return+url}catch{}return 0}isFeatureIdHeader(header,index){const headerOk="feature id"===header||"web-features"===header||header.includes("feature")&&!header.includes("chrome"),firstValueOk=1<this.cells.length&&this.cells[1][index].match(WEB_FEATURE_ID_RE);return headerOk&&firstValueOk}isChromestatusURL(header,index){const headerOk=header.includes("chromestatus")||header.includes("chrome")&&header.includes("status")||"id"===header,firstValueOk=1<this.cells.length&&this.parseChromestatusIdFromURL(this.cells[1][index]);return headerOk&&firstValueOk}detectColumns(){if(this.cells.length){const headerCells=this.cells[0].map(header=>header.toLowerCase());this.featureIdIndex=headerCells.findIndex(this.isFeatureIdHeader.bind(this)),this.chromestatusUrlIndex=headerCells.findIndex(this.isChromestatusURL.bind(this))}}selectItems(){if(this.items=[],-1!==this.featureIdIndex&&-1!==this.chromestatusUrlIndex)for(let i=1;i<this.cells.length;i++){const row=this.cells[i],webFeatureId=row[this.featureIdIndex],csUrl=row[this.chromestatusUrlIndex],csFid=this.parseChromestatusIdFromURL(csUrl);if(0<csFid){const item={row:i+1,csFid:csFid,existing:"Loading...",desired:webFeatureId};this.items.push(item)}}}fetchFeature(item){return window.csClient.getFeature(item.csFid).then(fe=>{item.entryName=fe.name,item.existing=fe.web_feature,this.requestUpdate()})}parseFileContent(fileContent){try{this.cells=parse(fileContent)}catch(error){showToastMessage(`An error occurred in parsing CSV file. ${JSON.stringify(error)}`)}try{this.detectColumns()}catch(error){showToastMessage(`An error occurred while detecting columns. ${JSON.stringify(error)}`)}try{this.selectItems()}catch(error){showToastMessage(`An error occurred while converting cells. ${JSON.stringify(error)}`)}}async getFileAndParse(){const fileField=this.shadowRoot.querySelector("#id_file_form_field");if(!fileField?.files?.length)return this.cells=[],this.featureIdIndex=-1,this.chromestatusUrlIndex=-1,this.items=[],void(this.parsing=!1);try{const file=fileField.files[0],fileContent=await file.text();this.parseFileContent(fileContent),await Promise.all(this.items.map(item=>this.fetchFeature(item)))}catch(error){showToastMessage(`An error occurred while processing the file. ${JSON.stringify(error)}`)}finally{this.parsing=!1}}saveFeature(item){const submitBody={feature_changes:{id:item.csFid,web_feature:item.desired},stages:[],has_changes:!0};return window.csClient.updateFeature(submitBody).then(resp=>{this.fetchFeature(item)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}async handleSubmit(e){e.preventDefault(),this.submitting=!0;for(const item of this.items)item.existing!=item.desired&&(await this.saveFeature(item));this.submitting=!1}async handleChange(){this.parsing=!0,await this.getFileAndParse()}renderForm(){return x$1` + <form name="bulk_edit_form"> + <table cellspacing="6"> + <tbody> + <tr> + <th> + <label for="id_file_form_field">CSV file:</label> + </th> + <td> + <input + id="id_file_form_field" + name="file_form_field" + type="file" + accept="text/csv" + @change=${this.handleChange} + /> + </td> + </tr> + </tbody> + </table> + </form> + `}isDifferent(item){return"Loading..."!=item.existing&&item.existing!=item.desired}renderItemRow(item){const different=this.isDifferent(item),differentClass=different?"diff":"";return x$1` + <tr> + <td style="text-align: right; width: 4em">${item.row}</td> + <td> + <a href="/feature/${item.csFid}" target="_blank" + >${item.entryName||item.csFid}</a + > + </td> + <td class="${differentClass} old">${item.existing||"Not set"}</td> + <td>${different?x$1`←`:"=="}</td> + <td class="${differentClass} new">${item.desired}</td> + </tr> + `}renderPreview(){if(0==this.items.length)return x$1` + <p id="instructions"> + Select a CSV file to see the preview. The CSV file should have one + column labeled "Chrome Status Entry" and one column labled "Feature + ID", although some variations may work. Once the file is parsed, the + table below will preview changes that will be made. + </p> + `;const totalCount=this.items.length,matchCount=this.items.filter(item=>!this.isDifferent(item)).length,updateCount=this.items.filter(item=>this.isDifferent(item)).length;return x$1` + <table class="data-table"> + <tr> + <th>Row</th> + <th>ChromeStatus feature</th> + <th>Existing web feature ID</th> + <th></th> + <th>Desired web feature ID</th> + </tr> + ${this.items.map(item=>this.renderItemRow(item))} + </table> + <p> + ${totalCount} rows: ${matchCount} already matching and ${updateCount} to + be updated. + </p> + `}renderControls(){return x$1` + <sl-button + ?disabled=${this.parsing||this.submitting||0==this.items.length} + @click=${this.handleSubmit} + size="small" + variant="primary" + > + Update all + </sl-button> + `}render(){return x$1` + <div id="subheader"> + <h2>Bulk edit</h2> + </div> + <section>${this.renderForm()}</section> + <section> + <h3>Preview</h3> + ${this.renderPreview()} + </section> + <section>${this.renderControls()}</section> + ${this.parsing||this.submitting?x$1` <div class="loading"> + <div id="spinner"><img src="/static/img/ring.svg" /></div> + </div>`:E$1} + `}};__decorate$X([r$6()],ChromedashBulkEditPage.prototype,"parsing",void 0),__decorate$X([r$6()],ChromedashBulkEditPage.prototype,"cells",void 0),__decorate$X([r$6()],ChromedashBulkEditPage.prototype,"featureIdIndex",void 0),__decorate$X([r$6()],ChromedashBulkEditPage.prototype,"chromestatusUrlIndex",void 0),__decorate$X([r$6()],ChromedashBulkEditPage.prototype,"items",void 0),__decorate$X([r$6()],ChromedashBulkEditPage.prototype,"submitting",void 0),ChromedashBulkEditPage=__decorate$X([t$3("chromedash-bulk-edit-page")],ChromedashBulkEditPage);var __decorate$W=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashCallout=class ChromedashCallout extends i$4{constructor(){super(...arguments),this.targetId="",this.side="south",this.cue="",this.dismissedCues=[],this.signedIn=!1,this.hidden=!0,this.top=0,this.left=0}connectedCallback(){if(super.connectedCallback(),!this.dismissedCues.includes(this.cue))try{this.attachToTarget(this.parentNode.querySelector("#"+this.targetId))}catch(error){console.error("Failed to attach target",error)}}static get styles(){return[...SHARED_STYLES,i$7` + #bubble { + position: absolute; + display: inline-block; + background: var(--callout-bg-color); + border-radius: var(--large-border-radius); + padding: var(--content-padding-half); + max-width: 24em; + color: var(--callout-text-color); + font-weight: bold; + } + #bubble[hidden] { + display: none; + } + #bubble:after { + content: ''; + position: absolute; + border: 20px solid transparent; + } + /* Bubble will be located on the south side of target element. */ + #bubble.south:after { + top: -20px; + left: 20px; + width: 0; + height: 0; + border-bottom-color: var(--callout-bg-color); + border-top: 0; + } + #closebox { + float: right; + margin-left: var(--content-padding-half); + color: var(--light-icon-fill-color); + } + #cue-content-container { + margin: var(--content-padding-quarter); + } + `]}contentOffsetTop(el){let offset=0;for(;el.offsetParent&&el!=this.offsetParent;)offset+=el.offsetTop,el=el.offsetParent;return offset}contentOffsetLeft(el){let offset=0;for(;el.offsetParent&&el!=this.offsetParent;)offset+=el.offsetLeft,el=el.offsetParent;return offset}attachToTarget(el){if("south"==this.side){const targetBottom=this.contentOffsetTop(el)+el.offsetHeight;this.top=targetBottom+20,this.left=Math.max(this.contentOffsetLeft(el)-20,0)}this.hidden=!1}dismiss(){this.hidden=!0,this.signedIn&&window.csClient.dismissCue(this.cue)}render(){return x$1` + <div + id="bubble" + class="${this.side}" + ?hidden=${this.hidden} + style="top:${this.top}px; left:${this.left}px;" + > + <sl-icon id="closebox" name="x" @click=${this.dismiss}></sl-icon> + <div id="cue-content-container"> + <slot></slot> + </div> + </div> + `}};__decorate$W([n$5({type:String})],ChromedashCallout.prototype,"targetId",void 0),__decorate$W([n$5({type:String})],ChromedashCallout.prototype,"side",void 0),__decorate$W([n$5({type:String})],ChromedashCallout.prototype,"cue",void 0),__decorate$W([n$5({attribute:!1,type:Array})],ChromedashCallout.prototype,"dismissedCues",void 0),__decorate$W([n$5({type:Boolean})],ChromedashCallout.prototype,"signedIn",void 0),__decorate$W([n$5({type:Boolean})],ChromedashCallout.prototype,"hidden",void 0),__decorate$W([r$6()],ChromedashCallout.prototype,"top",void 0),__decorate$W([r$6()],ChromedashCallout.prototype,"left",void 0),ChromedashCallout=__decorate$W([t$3("chromedash-callout")],ChromedashCallout);var __decorate$V=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let addStageDialogEl,currentFeatureId$1;async function openAddStageDialog(featureId,featureType,onSubmitCustomHandler){addStageDialogEl&¤tFeatureId$1===featureId&&onSubmitCustomHandler===addStageDialogEl.onSubmitCustomHandler||(addStageDialogEl=document.createElement("chromedash-add-stage-dialog"),addStageDialogEl.featureId=featureId,addStageDialogEl.featureType=featureType,addStageDialogEl.onSubmitCustomHandler=onSubmitCustomHandler,document.body.appendChild(addStageDialogEl),await addStageDialogEl.updateComplete),currentFeatureId$1=featureId,addStageDialogEl.show()}let ChromedashAddStageDialog=class ChromedashAddStageDialog extends i$4{constructor(){super(...arguments),this.featureId=0,this.featureType=0,this.canSubmit=!1,this.onSubmitCustomHandler=null}static get styles(){return[...SHARED_STYLES,i$7` + #controls { + padding: var(--content-padding); + text-align: right; + display: flex; + justify-content: space-between; + align-items: center; + } + #controls * + * { + padding-left: var(--content-padding); + } + `]}show(){this.dialog.show()}renderSelectMenuItems(){const menuItems=[];for(const stageType of CREATEABLE_STAGES[this.featureType]){const stageInfo=FORMS_BY_STAGE_TYPE[stageType];menuItems.push(x$1` + <sl-option value="${stageType}"> ${stageInfo.name} </sl-option> + `)}return menuItems}getStageSelectValue(){return this.stageCreateSelect.value}handleStageCreate(){return this.onSubmitCustomHandler?(this.onSubmitCustomHandler({stage_type:+this.getStageSelectValue()}),this.onSubmitCustomHandler=null,void this.dialog.hide()):void window.csClient.createStage(this.featureId,{stage_type:{form_field_name:"stage_type",value:this.getStageSelectValue()}}).then(()=>{this.dialog.hide(),location.reload()})}checkCanSubmit(){this.canSubmit=0!==this.getStageSelectValue()}renderStageSelect(){return x$1` + <div id="controls"> + <sl-select + placement="top" + hoist + value="0" + id="stage_create_select" + size="small" + @sl-change=${this.checkCanSubmit} + style="width:16rem" + > + <sl-option value="0" disabled>Select a stage to create</sl-option> + ${this.renderSelectMenuItems()} + </sl-select> + <sl-button + variant="primary" + @click=${this.handleStageCreate} + ?disabled=${!this.canSubmit} + size="small" + >Create stage</sl-button + > + </div> + `}render(){return x$1` + <sl-dialog label="Create a new stage"> + <p>Here, you can add additional stages to your feature as needed.</p> + ${this.renderStageSelect()} + </sl-dialog> + `}};__decorate$V([n$5({type:Number})],ChromedashAddStageDialog.prototype,"featureId",void 0),__decorate$V([n$5({type:Number})],ChromedashAddStageDialog.prototype,"featureType",void 0),__decorate$V([n$5({type:Boolean})],ChromedashAddStageDialog.prototype,"canSubmit",void 0),__decorate$V([n$5({attribute:!1})],ChromedashAddStageDialog.prototype,"onSubmitCustomHandler",void 0),__decorate$V([e$6("#stage_create_select")],ChromedashAddStageDialog.prototype,"stageCreateSelect",void 0),__decorate$V([e$6("sl-dialog")],ChromedashAddStageDialog.prototype,"dialog",void 0),ChromedashAddStageDialog=__decorate$V([t$3("chromedash-add-stage-dialog")],ChromedashAddStageDialog);var __decorate$U=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let dialogEl$1,currentFeatureId,currentStageId;const dialogTypes={CREATION:1,EXTENSION:2,END_MILESTONE_EXPLANATION:3,FINALIZE_EXTENSION:4};async function openPrereqsDialog(featureId,stage,dialogType){dialogEl$1&¤tFeatureId===featureId&¤tStageId===stage.id||(dialogEl$1=document.createElement("chromedash-ot-prereqs-dialog"),dialogEl$1.featureId=featureId,dialogEl$1.stage=stage,dialogEl$1.dialogType=dialogType,document.body.appendChild(dialogEl$1),await dialogEl$1.updateComplete),currentFeatureId=featureId,currentStageId=stage.id,dialogEl$1.show()}async function openInfoDialog(dialogType){dialogEl$1||(dialogEl$1=document.createElement("chromedash-ot-prereqs-dialog"),dialogEl$1.dialogType=dialogType,document.body.appendChild(dialogEl$1),await dialogEl$1.updateComplete),dialogEl$1.show()}async function openFinalizeExtensionDialog(featureId,stage,milestone,dialogType){dialogEl$1&¤tFeatureId===featureId&¤tStageId===stage.id||(dialogEl$1=document.createElement("chromedash-ot-prereqs-dialog"),dialogEl$1.featureId=featureId,dialogEl$1.stage=stage,dialogEl$1.dialogType=dialogType,dialogEl$1.milestone=milestone,document.body.appendChild(dialogEl$1),await dialogEl$1.updateComplete),dialogEl$1.dialogType=dialogType,currentFeatureId=featureId,currentStageId=stage.id,dialogEl$1.show()}let ChromedashOTPrereqsDialog=class ChromedashOTPrereqsDialog extends i$4{constructor(){super(...arguments),this.featureId=0,this.milestone=0,this.dialogType=0}static get styles(){return[...SHARED_STYLES,i$7` + #prereqs-list li { + margin-left: 8px; + margin-bottom: 8px; + } + #prereqs-header { + margin-bottom: 8px; + } + #update-button { + margin-right: 8px; + } + .float-right { + float: right; + } + `]}show(){this.renderRoot.querySelector("sl-dialog")?.show()}renderEndMilestoneExplanationDialog(){return x$1` <sl-dialog label="End milestone date"> + <p> + When a specific milestone is approved by API owners, the trial's end + date is set based on the stable release date of (end milestone +2). Most + of the time when a trial ends, the feature will be enabled by default + within the next Chrome release. This additional trial time window + ensures users don't see breakage before upgrading to the version with + the feature enabled by default. + </p> + </sl-dialog>`}submitTrialExtension(){window.csClient.extendOriginTrial(this.featureId,this.stage.id).then(()=>{showToastMessage("Extension processed!"),setTimeout(()=>{location.assign(`/feature/${this.featureId}`)},1e3)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}renderThreadMissingDialog(){return x$1`<sl-dialog label="Intent thread not found"> + <p> + LGTMs have been detected for this trial extension, but + <strong>no intent thread link has been detected or provided</strong>. + All extension proposals must be discussed publicly on blink-dev. Please + add the value to the "Intent to Extend Experiment link" field by + selecting "Edit fields" button on your feature's "Origin Trial" section. + </p> + </sl-dialog>`}renderFinalizeExtensionDialog(){return this.stage.intent_thread_url?x$1` <sl-dialog label="Finalize trial extension"> + <p> + LGTMs have been detected for this trial extension. This origin trial + will be extended <strong>through milestone ${this.milestone}</strong>. + Is this correct? + </p> + <br /> + <sl-button + class="float-right" + variant="primary" + size="small" + @click=${()=>this.submitTrialExtension()} + >Proceed</sl-button + > + <sl-button + class="float-right" + id="update-button" + variant="info" + size="small" + @click=${()=>location.assign(`/guide/stage/${this.featureId}/${this.stage.id}?updateExtension`)} + >Change milestone</sl-button + > + </sl-dialog>`:this.renderThreadMissingDialog()}renderExtensionPrereqs(){return x$1` <sl-dialog label="Origin trial extension prerequisites"> + <div id="prereqs-header"> + <strong>Before submitting an extension request</strong>, please ensure + that your Intent to Extend Experiment has been drafted, and the required + LGTMs have been received. + <br /> + <a + target="_blank" + href="https://www.chromium.org/blink/origin-trials/running-an-origin-trial/#what-is-the-process-to-extend-an-origin-trial" + > + View documentation on the trial extension process + </a> + </div> + <br /> + <sl-button + id="continue-button" + variant="primary" + @click=${()=>location.assign(`/ot_extension_request/${this.featureId}/${this.stage.id}`)} + size="small" + >Proceed</sl-button + > + </sl-dialog>`}renderCreationPrereqs(){return x$1` <sl-dialog label="Origin trial creation prerequisites"> + <div id="prereqs-header"> + <strong>Before submitting a creation request</strong>, please ensure the + following prerequisite steps have been completed: + </div> + <br /> + <ul id="prereqs-list"> + <li> + The trial's UseCounter has landed on + <a + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom" + target="_blank" + > + web_feature.mojom + </a> + and is being properly used. + </li> + <li> + A Chromium trial name has landed on + <a + href="https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/runtime_enabled_features.json5" + target="_blank" + > + runtime_enabled_features.json5 + </a> + <strong>that has not been used for any previous trials</strong>. No + trial names can be reused, even if used for the same feature! + </li> + <li> + For a third-party trial, the feature entry in + <a + href="https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/runtime_enabled_features.json5" + target="_blank" + > + runtime_enabled_features.json5 + </a> + contains the key "origin_trial_allows_third_party: true". + </li> + <li> + For a critical trial, the feature name has been added to the + <a + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/common/origin_trials/manual_completion_origin_trial_features.cc;l=17" + target="_blank" + > + kHasExpiryGracePeriod array </a + >. + </li> + </ul> + <br /> + <p> + If you haven't already, please review the docs for + <a + href="https://www.chromium.org/blink/origin-trials/running-an-origin-trial/" + > + running an origin trial </a + >. If you have any further questions, contact us at + origin-trials-support@google.com. + </p> + <br /> + <sl-button + class="float-right" + variant="primary" + @click=${()=>location.assign(`/ot_creation_request/${this.featureId}/${this.stage.id}`)} + size="small" + >Proceed</sl-button + > + </sl-dialog>`}render(){return this.dialogType===dialogTypes.END_MILESTONE_EXPLANATION?this.renderEndMilestoneExplanationDialog():this.dialogType===dialogTypes.FINALIZE_EXTENSION?this.renderFinalizeExtensionDialog():this.dialogType===dialogTypes.EXTENSION?this.renderExtensionPrereqs():this.renderCreationPrereqs()}};__decorate$U([n$5({type:Number})],ChromedashOTPrereqsDialog.prototype,"featureId",void 0),__decorate$U([n$5({attribute:!1})],ChromedashOTPrereqsDialog.prototype,"stage",void 0),__decorate$U([n$5({type:Number})],ChromedashOTPrereqsDialog.prototype,"milestone",void 0),__decorate$U([n$5({type:Number})],ChromedashOTPrereqsDialog.prototype,"dialogType",void 0),ChromedashOTPrereqsDialog=__decorate$U([t$3("chromedash-ot-prereqs-dialog")],ChromedashOTPrereqsDialog);var __decorate$T=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let preflightDialogEl;async function openPreflightDialog(feature,progress,process,action,stage,feStage,featureGates,url){preflightDialogEl||(preflightDialogEl=document.createElement("chromedash-preflight-dialog"),document.body.appendChild(preflightDialogEl),await preflightDialogEl.updateComplete),preflightDialogEl.openWithContext(feature,progress,process,action,stage,feStage,featureGates,url)}function somePendingPrereqs(action,progress){return action.prerequisites.some(itemName=>!progress.hasOwnProperty(itemName))}function somePendingGates(featureGates,feStage){return 0<findPendingGates(featureGates,feStage).length}function findPendingGates(featureGates,feStage){const gatesForStage=featureGates.filter(g=>g.stage_id==feStage.id),otherGates=gatesForStage.filter(g=>"API Owners"!=g.team_name),pendingGates=otherGates.filter(g=>!GATE_FINISHED_REVIEW_STATES.includes(g.state));return pendingGates.sort((g1,g2)=>GATE_TEAM_ORDER.indexOf(g1.team_name)-GATE_TEAM_ORDER.indexOf(g2.team_name)),pendingGates}let ChromedashPreflightDialog=class ChromedashPreflightDialog extends i$4{static get styles(){return[...SHARED_STYLES,i$7` + li { + margin-top: 0.5em; + } + + .missing-prereqs-list { + padding-bottom: 1em; + } + + .edit-progress-item { + visibility: hidden; + margin-left: var(--content-padding-half); + } + + .active .edit-progress-item, + .missing-prereqs .edit-progress-item, + .pending:hover .edit-progress-item, + .done:hover .edit-progress-item { + visibility: visible; + } + + sl-button { + float: right; + margin: var(--content-padding-half); + } + `]}openWithContext(feature,progress,process,action,stage,feStage,featureGates,url){this._feature=feature,this._progress=progress,this._process=process,this._action=action,this._stage=stage,this._feStage=feStage,this._featureGates=featureGates,this._url=url,this.renderRoot.querySelector("sl-dialog")?.show()}hide(){this.renderRoot.querySelector("sl-dialog")?.hide()}handleCancel(){this.hide()}handleProceed(){this.hide()}renderEditLink(stage,feStage,pi){if(!pi.field)return E$1;const pathSegment=stage?`${stage.outgoing_stage}/${feStage.id}`:"metadata";return x$1` + <a + class="edit-progress-item" + href="/guide/stage/${this._feature.id}/${pathSegment}#id_${pi.field}" + @click=${this.hide} + > + Edit + </a> + `}makePrereqItem(itemName){if("Web feature"===itemName)return{name:itemName,field:"web_feature",stage:null};if("Tracking bug URL"===itemName)return{name:itemName,field:"bug_url",stage:null};for(const s of this._process.stages||[])for(const pi of s.progress_items)if(itemName==pi.name)return{...pi,stage:s};throw new Error("prerequiste is not a defined progress item: "+itemName)}renderDialogContent(){if(null==this._feature)return E$1;const prereqItems=[];for(const itemName of this._action.prerequisites||[])this._progress.hasOwnProperty(itemName)||prereqItems.push(this.makePrereqItem(itemName));const pendingGates=findPendingGates(this._featureGates,this._feStage);return x$1` + Before you ${this._action.name}, it is strongly recommended that you do + the following: + <ul class="missing-prereqs-list"> + ${prereqItems.map(item=>x$1` <li class="pending"> + ${item.stage?.name||"Metadata"}: ${item.name} + ${this.renderEditLink(item.stage,findFirstFeatureStage(item.stage?.outgoing_stage,this._stage,this._feature),item)} + </li>`)} + ${pendingGates.map(g=>x$1` + <li class="pending"> + Get approval or NA from the + <a + href="/feature/${this._feature.id}?gate=${g.id}" + @click=${this.hide} + >${g.team_name}</a + > + team + </li> + `)} + </ul> + + <sl-button + href="${this._url}" + target="_blank" + size="small" + @click=${this.handleProceed} + >Proceed anyway + </sl-button> + <sl-button size="small" variant="warning" @click=${this.handleCancel} + >Don't draft email yet</sl-button + > + `}render(){return x$1` + <sl-dialog + class="missing-prereqs" + label="Missing Prerequisites" + style="--width:fit-content" + > + ${this.renderDialogContent()} + </sl-dialog> + `}};__decorate$T([r$6()],ChromedashPreflightDialog.prototype,"_feature",void 0),__decorate$T([r$6()],ChromedashPreflightDialog.prototype,"_featureGates",void 0),__decorate$T([r$6()],ChromedashPreflightDialog.prototype,"_progress",void 0),__decorate$T([r$6()],ChromedashPreflightDialog.prototype,"_process",void 0),__decorate$T([r$6()],ChromedashPreflightDialog.prototype,"_action",void 0),__decorate$T([r$6()],ChromedashPreflightDialog.prototype,"_stage",void 0),__decorate$T([r$6()],ChromedashPreflightDialog.prototype,"_feStage",void 0),__decorate$T([r$6()],ChromedashPreflightDialog.prototype,"_url",void 0),ChromedashPreflightDialog=__decorate$T([t$3("chromedash-preflight-dialog")],ChromedashPreflightDialog);function resolveFieldForFeature(field,feature){const result={...field};return field.computedChoices&&(result.choices=field.computedChoices(feature)),result}const USER_REGEX="[A-Za-z0-9_#$&*+\\/=?\\{\\}~^.\\-]+",DOMAIN_NAME_REGEX="(([A-Za-z0-9\\-]+\\.)+[A-Za-z]{2,6})",LOCALHOST_REGEX="(localhost|127\\.0\\.0\\.1)",DOMAIN_REGEX="("+DOMAIN_NAME_REGEX+"|"+LOCALHOST_REGEX+")",FINCH_NAMES_REGEX="[\\-_a-zA-Z0-9,]*",EMAIL_ADDRESS_REGEX="[A-Za-z0-9_#$&*+\\/=?\\{\\}~^.\\-]+@"+DOMAIN_NAME_REGEX,GOOGLE_EMAIL_ADDRESS_REGEX=`${"[A-Za-z0-9_#$&*+\\/=?\\{\\}~^.\\-]+"}@google.com`,EMAIL_ADDRESSES_REGEX=EMAIL_ADDRESS_REGEX+"([ ]*,[ ]*"+EMAIL_ADDRESS_REGEX+")*",PORTNUM_REGEX="(:[0-9]+)?",URL_REGEX="(https?)://"+DOMAIN_REGEX+PORTNUM_REGEX+"(/\\S*)?",URL_PADDED_REGEX="\\s*"+URL_REGEX+"\\s*",URL_FIELD_ATTRS={title:"Enter a full URL https://...",type:"url",placeholder:"https://...",pattern:URL_PADDED_REGEX},MULTI_STRING_FIELD_ATTRS={title:"Enter one or more comma-separated complete words.",type:"text",multiple:!0,placeholder:"EnableFeature1, Feature1Policy"},MULTI_EMAIL_FIELD_ATTRS={title:"Enter one or more comma-separated complete email addresses.",type:"text",multiple:!0,placeholder:"user1@domain.com, user2@chromium.org",pattern:EMAIL_ADDRESSES_REGEX},TEXT_FIELD_ATTRS={type:"text"},MILESTONE_NUMBER_FIELD_ATTRS={type:"number",placeholder:"Milestone number"},OT_MILESTONE_DESKTOP_RANGE={earlier:"ot_milestone_desktop_start",later:"ot_milestone_desktop_end"},OT_MILESTONE_ANDROID_RANGE={earlier:"ot_milestone_android_start",later:"ot_milestone_android_end"},OT_MILESTONE_WEBVIEW_RANGE={earlier:"ot_milestone_webview_start",later:"ot_milestone_webview_end"},OT_ALL_SHIPPED_MILESTONE_DESKTOP_RANGE={earlier:"ot_milestone_desktop_start",allLater:"shipped_milestone",warning:"Origin trial starting milestone should be before all feature shipping milestones."},ALL_OT_SHIPPED_MILESTONE_DESKTOP_RANGE={allEarlier:"ot_milestone_desktop_start",later:"shipped_milestone",warning:"All origin trials starting milestones should be before feature shipping milestone."},OT_ALL_SHIPPED_MILESTONE_WEBVIEW_RANGE={earlier:"ot_milestone_webview_start",allLater:"shipped_webview_milestone",warning:"Origin trial starting milestone should be before all feature shipping milestones."},ALL_OT_SHIPPED_MILESTONE_WEBVIEW_RANGE={allEarlier:"ot_milestone_webview_start",later:"shipped_webview_milestone",warning:"All origin trials starting milestones should be before feature shipping milestone."},OT_ALL_SHIPPED_MILESTONE_ANDROID_RANGE={earlier:"ot_milestone_android_start",allLater:"shipped_android_milestone",warning:"Origin trial starting milestone should be before all feature shipping milestones."},ALL_OT_SHIPPED_MILESTONE_ANDROID_RANGE={allEarlier:"ot_milestone_android_start",later:"shipped_android_milestone",warning:"All origin trials starting milestones should be before feature shipping milestone."},DT_ALL_SHIPPED_MILESTONE_DESKTOP_RANGE={earlier:"dt_milestone_desktop_start",allLater:"shipped_milestone",warning:"Shipped milestone should be later than dev trial."},ALL_DT_SHIPPED_MILESTONE_DESKTOP_RANGE={allEarlier:"dt_milestone_desktop_start",later:"shipped_milestone",warning:"Shipped milestone should be later than dev trial."},DT_ALL_SHIPPED_MILESTONE_ANDROID_RANGE={earlier:"dt_milestone_android_start",allLater:"shipped_android_milestone",warning:"Shipped milestone should be later than dev trial start milestone."},ALL_DT_SHIPPED_MILESTONE_ANDROID_RANGE={allEarlier:"dt_milestone_android_start",later:"shipped_android_milestone",warning:"Shipped milestone should be later than dev trial start milestone."},DT_ALL_SHIPPED_MILESTONE_IOS_RANGE={earlier:"dt_milestone_ios_start",allLater:"shipped_ios_milestone",warning:"Shipped milestone should be later than dev trial start milestone."},ALL_DT_SHIPPED_MILESTONE_IOS_RANGE={allEarlier:"dt_milestone_ios_start",later:"shipped_ios_milestone",warning:"Shipped milestone should be later than dev trial start milestone."},MULTI_URL_FIELD_ATTRS={title:"Enter one or more full URLs, one per line:\nhttps://...\nhttps://...",multiple:!0,placeholder:"https://...\nhttps://...",rows:4,cols:50,maxlength:5e3,chromedash_single_pattern:URL_REGEX,chromedash_split_pattern:"\\s+"},SHIPPED_HELP_TXT=x$1` First milestone to ship with this status. Applies +to: Enabled by default, Deprecated, and Removed.`,SHIPPED_WEBVIEW_HELP_TXT=x$1` First milestone to ship with this status. +Applies to Enabled by default, Deprecated, and Removed.`,ALL_FIELDS={name:{type:"input",attrs:TEXT_FIELD_ATTRS,required:!0,label:"Feature name",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` <p> + Capitalize only the first letter and the beginnings of proper nouns. + </p>`,extra_help:x$1` <p> + Each feature should have a unique name that is written as a noun phrase. + </p> + <ul> + <li> + Capitalize only the first letter and the beginnings of proper nouns. + </li> + <li> + Avoid using verbs such as "add", "enhance", "deprecate", or "delete". + Instead, simply name the feature itself and use the feature type and + stage fields to indicate the intent of change. + </li> + <li> + Do not include markup or markdown because they will not be rendered.. + </li> + <li> + Write keywords and identifiers as they would appear to a web + developer, not as they are in source code. In particular, do not use + static method/property syntax for instance methods/properties. For + example, for an instance method doStuff() on an interface + NewInterface, write "NewInterface's doStuff() method" (not + "NewInterface.doStuff() method"). Or for a method on a well-known + global like Document, write "document.doStuff()" (not + "Document.doStuff()"). + </li> + </ul> + + <h4>Examples</h4> + <ul> + <li>Conversion Measurement API</li> + <li>CSS Flexbox: intrinsic size algorithm</li> + <li>Permissions-Policy header</li> + </ul>`,check:(_value,getFieldValue)=>checkFeatureNameAndType(getFieldValue)},summary:{type:"textarea",required:!0,label:"Summary",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,enterprise_offer_markdown:!0,enterprise_help_text:x$1` <p> + This text will be used in the + <a + href="https://support.google.com/chrome/a/answer/7679408" + target="_blank" + >enterprise release notes</a + >, which are publicly visible and primarily written for IT admins. All + Enterprise policies must be included in this summary section. + </p> + <p> + Explain what's changing from the point of view of an end-user, + developer, or administrator. Indicate what the motivation is for this + change, especially if there’s security or privacy benefits to the + change. If an admin should do something (like test or set a flag or an + enterprise policy), please explain. Finally, if the change has a + user-visible benefit (eg. better security or privacy), explain that + motivation. If there are already publicly visible comms (e.g. blog + posts), you should link to them here as well. + </p> + <p> + See + <a + href="https://docs.google.com/document/d/1SdQ-DKeA5O7I8ju5Cb8zSM5S4NPwUACNJ9qbEhz-AYU" + target="_blank" + >go/releasenotes-examples</a + > + for examples. + </p>`,help_text:x$1` + <p> + Text in the beta release post, the enterprise release notes, and other + external sources will be based on this text. + </p> + <p> + Write from a web developer's point of view. Begin with one line + explaining what the feature does. Add one or two lines explaining how + this feature helps developers. Write in a matter-of-fact manner and in + the present tense. (This summary will be visible long after your project + is finished.) Avoid language such as "a new feature" and "we propose". + </p> + `,extra_help:x$1` + <p> + Provide a one sentence description followed by one or two lines + explaining how this feature works and how it helps web developers. + </p> + + <p> + Note: This text communicates with more than just the rest of Chromium + development. It's the part most visible to external readers and is used + in the beta release announcement, enterprise release notes, and other + communications. + </p> + + <ul> + <li> + Write from a web developer's point of view, not a browser developer's + </li> + <li> + Do not use markup or markdown because they will not be rendered. + </li> + <li> + Do not use hard or soft returns because they will not be rendered. + </li> + <li> + Avoid phrases such as "a new feature". Every feature on the site was + new when it was created. You don't need to repeat that information. + </li> + + <li> + The first line should be a sentence fragment beginning with a verb. + (See below.) This is the rare exception to the requirement to always + use complete sentences. + </li> + + <li> + "Conformance with spec" is not adequate. Most if not all features are + in conformance to spec. + </li> + </ul> + + <h4>Example</h4> + <blockquote> + Splits the HTTP cache using the top frame origin (and possibly subframe + origin) to prevent documents from one origin from knowing whether a + resource from another origin was cached. The HTTP cache is currently one + per profile, with a single namespace for all resources and subresources + regardless of origin or renderer process. Splitting the cache on top + frame origins helps the browser deflect side-channel attacks where one + site can detect resources in another site's cache. + </blockquote> + `,enterprise_extra_help:"",check:value=>value&&"string"==typeof value&&0<value.length&&(100>value.length||5e3<value.length)?{warning:"Feature summary should be between 100 and 5000 characters long."}:void 0},owner:{type:"input",name:"owner_emails",attrs:MULTI_EMAIL_FIELD_ATTRS,required:!0,label:"Feature owners",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Comma separated list of full email addresses.`},editors:{type:"input",name:"editor_emails",attrs:MULTI_EMAIL_FIELD_ATTRS,required:!1,label:"Feature editors",usage:{},help_text:x$1` Comma separated list of full email addresses. These users + will be allowed to edit this feature, but will not be listed as feature + owners. User groups are not supported.`},cc_recipients:{type:"input",name:"cc_emails",attrs:MULTI_EMAIL_FIELD_ATTRS,required:!1,label:"CC",usage:{},help_text:x$1` Comma separated list of full email addresses. These users + will be notified of any changes to the feature, but do not gain permission + to edit. User groups must allow posting from + admin@cr-status.appspotmail.com.`},unlisted:{type:"checkbox",label:"Unlisted",initial:!1,usage:{},help_text:x$1` Check this box to hide draft features in list views. Anyone + with a link will be able to view the feature's detail page.`},accurate_as_of:{type:"checkbox",label:"Confirm accuracy",initial:!0,usage:{},help_text:x$1` Check this box to indicate that feature information is + accurate as of today. (Selecting this avoids reminder emails for four + weeks.)`},blink_components:{type:"datalist",required:!0,choices:void 0,label:"Blink component",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,attrs:{placeholder:"Please select a Blink component"},help_text:x$1` Select the most specific component. If unsure, leave as + "Blink".`},web_feature:{type:"datalist",required:!1,choices:void 0,label:"Web Feature ID",attrs:{placeholder:"Please select a Web feature ID"},usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Select the web feature this belongs to in the + <a href="https://github.com/web-platform-dx/web-features" target="_blank" + >web-features project</a + >. If your feature is not listed, + <a + href="https://github.com/web-platform-dx/web-features/issues/new?template=new-feature.yml" + target="_blank" + >propose a new web feature ID</a + >, then return to this tab and choose "Missing feature".`},category:{type:"select",choices:FEATURE_CATEGORIES,initial:FEATURE_CATEGORIES.MISC[0],label:"Category",usage:{},help_text:x$1` Select the most specific category. If unsure, leave as + "Miscellaneous".`},enterprise_product_category:{type:"radios",name:"enterprise_product_category",choices:ENTERPRISE_PRODUCT_CATEGORY,label:"Enterprise product category",usage:{},help_text:x$1` Select the appropriate category.`},feature_type:{type:"select",disabled:!0,choices:FEATURE_TYPES,label:"Feature type",usage:{},help_text:x$1` Feature type chosen at time of creation. + <br /> + <p style="color: red"> + <strong>Note:</strong> The feature type field cannot be changed. If this + field needs to be modified, a new feature would need to be created. + </p>`,check:(_value,getFieldValue)=>checkFeatureNameAndType(getFieldValue)},feature_type_radio_group:{name:"feature_type",type:"radios",choices:FEATURE_TYPES_WITHOUT_ENTERPRISE,label:"Feature type",usage:{},help_text:x$1`If all goes well, how will developers experience the change + you're planning to make to Chromium? + <br /> + <p style="color: red"> + <strong>Note:</strong> The feature type field cannot be changed. If this + field needs to be modified, a new feature would need to be created. + </p>`,check:(_value,getFieldValue)=>checkFeatureNameAndType(getFieldValue)},active_stage_id:{type:"select",computedChoices(formattedFeature){const result={};for(const stage of formattedFeature.stages){const name=unambiguousStageName(stage,formattedFeature);name&&(result[stage.id]=[stage.id,name])}return result},label:"Active stage",usage:{},help_text:x$1`The active stage opens by default in this feature's page. + And, it roughly indicates progress in the process.`},search_tags:{type:"input",attrs:TEXT_FIELD_ATTRS,required:!1,label:"Search tags",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Comma separated keywords used only in search.`},bug_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Tracking bug URL",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Tracking bug url (https://bugs.chromium.org/...). This bug + should have "Type=Feature" set and be world readable. Note: This field + only accepts one URL. + <br /><br /> + <a + target="_blank" + href="https://bugs.chromium.org/p/chromium/issues/entry" + > + Create tracking bug</a + >`},launch_bug_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Launch URL",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Launch URL (https://launch.corp.google.com/...) to track + internal approvals, if any. + <br /><br /> + <a target="_blank" href="https://launch.corp.google.com/"> + Create a launch</a + >.`},screenshot_links:{type:"attachments",attrs:MULTI_URL_FIELD_ATTRS,required:!1,label:"Screenshot link(s)",usage:{[FeatureType.Incubate]:new Set([UsageType.ReleaseNotes]),[FeatureType.Existing]:new Set([UsageType.ReleaseNotes]),[FeatureType.CodeChange]:new Set([UsageType.ReleaseNotes]),[FeatureType.Deprecation]:new Set([UsageType.ReleaseNotes]),[FeatureType.Enterprise]:new Set([UsageType.ReleaseNotes])},help_text:x$1` Optional: Links to screenshots showcasing this feature (one + URL per line). Be sure to link directly to the image with a URL ending in + .png, .gif, or .jpg, rather than linking to an HTML page that contains the + image. Or, use the upload button to upload an image to be served from + chromestatus.com. These will be shared publicly.`,check:async value=>{const warning={warning:`One or more urls are not actual images or requires the consumer some kind + of authentication to access them. Use a valid link to an actual image free + of authentication or upload your image.`},urls=value.split("\n").filter(x=>!!x).map(x=>x.trim());if(urls.length){if(urls.some(x=>{try{return new URL(x),!1}catch{return!0}}))return warning;const urlTypes=await Promise.all(urls.map(url=>fetch(url,{method:"HEAD"}).then(response=>response.blob()).then(blob=>blob.type).catch(()=>"error")));return urlTypes.some(type=>!type.startsWith("image"))?warning:void 0}}},first_enterprise_notification_milestone:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"First notification milestone",usage:{},help_text:x$1` Optional: Unless you're sure you need to use this, leave it + blank. + <br /><br /> + If you leave this blank, we will automatically find the right milestone. + <br /><br /> + If you're not ready to communicate this feature to enterprises yet, what + is the earliest milestone that you expect to be ready to communicate it? + You can change this later. In general, you should provide enterprises + notice at least 3 milestones before making an impactful change.`,check:(value,_,initialValue)=>checkFirstEnterpriseNotice(value,initialValue)},motivation:{type:"textarea",required:!1,label:"Motivation",usage:{[FeatureType.Incubate]:new Set([UsageType.Prototype]),[FeatureType.Existing]:new Set([UsageType.Prototype]),[FeatureType.Deprecation]:new Set([UsageType.DeprecateAndRemove])},help_text:x$1` Explain why the web needs this change. It may be useful to + describe what web developers are forced to do without it. When possible, + add links to your explainer (under + <a href="#id_explainer_links">Explainer link(s)</a>) backing up your + claims. <br /><br /> + This text is sometimes included with the summary in the beta post, + enterprise release notes and other external documents. Write in a + matter-of-fact manner and in the present tense. + <br /><br /> + <a + target="_blank" + href="https://github.com/GoogleChrome/chromium-dashboard/wiki/EditingHelp#motivation-example" + > + Example</a + >`},deprecation_motivation:{name:"motivation",type:"textarea",required:!1,label:"Motivation",usage:{[FeatureType.Deprecation]:new Set([UsageType.DeprecateAndRemove])},help_text:x$1` Deprecations and removals must have strong reasons, backed + up by measurements. There must be clear and actionable paths forward for + developers. + <br /><br /> + This text is sometimes included with the summary in the beta post, + enterprise release notes and other external documents. Write in a + matter-of-fact manner and in the present tense. + <br /><br /> + Please see + <a + target="_blank" + href="https://docs.google.com/a/chromium.org/document/d/1LdqUfUILyzM5WEcOgeAWGupQILKrZHidEXrUxevyi_Y/edit?usp=sharing" + > + Removal guidelines</a + >.`},initial_public_proposal_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Initial public proposal URL",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Link to the first public proposal to create this feature.`,extra_help:x$1` If there isn't another obvious place to propose your + feature, create a + <a + target="_blank" + href="https://github.com/WICG/proposals#what-does-a-proposal-look-like" + > + WICG proposal</a + >. You can use your proposal document to help you socialize the problem + with other vendors and developers.`},explainer_links:{type:"textarea",attrs:MULTI_URL_FIELD_ATTRS,required:!1,label:"Explainer link(s)",usage:{[FeatureType.Incubate]:ALL_FEATURE_TYPE_INCUBATE_INTENTS,[FeatureType.Deprecation]:ALL_FEATURE_TYPE_DEPRECATION_INTENTS},help_text:x$1`Link to explainer(s) (one URL per line). See the + <a + target="_blank" + href="https://www.chromium.org/blink/launching-features/#start-incubating" + >launch process</a + > + for detailed advice, or expand the extra help here for a summary.`,extra_help:x$1`<p> + Host your explainer somewhere like Github (and <i>not</i> Google Docs) + that makes it easy to file issues. Your organization may recommend a + <a + target="_blank" + href="https://www.chromium.org/blink/launching-features/#start-incubating" + >particular place</a + >. + </p> + <p> + See the TAG guide to writing + <a target="_blank" href="https://tag.w3.org/explainers/">Explainers</a> + for several examples of good explainers and tips for effective + explainers. + </p> + <p> + If you've already made an initial public proposal (see above), post your + explainer to that thread. Otherwise, make an initial proposal based on + your explainer. + </p> + <p> + Once a second organization is interested in the WICG proposal, you can + move the explainer into the WICG. The + <a href="https://wicg.github.io/admin/charter.html#chairs" + >WICG co-chairs</a + > + can help you. + </p> + <p> + If you want help, ask for a + <a + target="_blank" + href="https://sites.google.com/a/chromium.org/dev/blink/spec-mentors" + >specification mentor</a + >. + </p>`,check:value=>checkNotGoogleDocs(value,"Explainers should not be hosted on Google Docs.")},spec_link:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Spec link",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Link to the spec, if and when available. When implementing + a spec update, please link to a heading in a published spec rather than a + pull request when possible.`,extra_help:x$1`<p> + Specifications should be written in the format and hosted in the URL space + expected by your target standards body. For example, the W3C expects + <a href="https://respec.org/" target="_blank">Respec</a> or + <a href="https://speced.github.io/bikeshed/" target="_blank">Bikeshed</a> + hosted on w3.org or in Github Pages. The IETF expects an + <a href="https://authors.ietf.org/" target="_blank">Internet-Draft</a> + hosted in the + <a href="https://datatracker.ietf.org/" target="_blank">Datatracker</a>. + </p>`,check:value=>checkNotGoogleDocs(value,"Specifications should not be hosted on Google Docs.")},comments:{type:"textarea",name:"feature_notes",attrs:{rows:4},required:!1,label:"Comments",usage:{},help_text:x$1` Additional comments, caveats, info...`},standard_maturity:{type:"select",choices:STANDARD_MATURITY_CHOICES,initial:STANDARD_MATURITY_CHOICES.PROPOSAL_STD[0],label:"Standard maturity",usage:{},help_text:x$1` How far along is the standard that this feature implements?`},api_spec:{type:"checkbox",initial:!1,label:"API spec",usage:{},help_text:x$1` The spec document has details in a specification language + such as Web IDL, or there is an existing MDN page.`},automation_spec:{type:"checkbox",initial:!1,label:"Automation spec",usage:{},help_text:x$1` The platform has sufficient automation features for website + authors to test use of this new feature. These automation features can + include new automation APIs, like WebDriver BiDi modules, that are defined + in this feature's specification.`},spec_mentors:{type:"input",name:"spec_mentor_emails",attrs:MULTI_EMAIL_FIELD_ATTRS,required:!1,label:"Spec mentors",usage:{},help_text:x$1` Experienced + <a target="_blank" href="https://www.chromium.org/blink/spec-mentors"> + spec mentors</a + > + are available to help you improve your feature spec.`},intent_to_implement_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Intent to Prototype link",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` After you have started the "Intent to Prototype" discussion + thread, link to it here.`},doc_links:{type:"textarea",attrs:MULTI_URL_FIELD_ATTRS,required:!1,label:"Doc link(s)",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Links to design doc(s) (one URL per line), if and when + available. [This is not required to send out an Intent to Prototype. Please + update the intent thread with the design doc when ready]. An explainer + and/or design doc is sufficient to start this process. [Note: Please include + links and data, where possible, to support any claims.`},measurement:{type:"textarea",attrs:{rows:4},required:!1,label:"Measurement",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` It's important to measure the adoption and success of + web-exposed features. Note here what measurements you have added to track + the success of this feature, such as a link to the UseCounter(s) you have + set up.`},availability_expectation:{type:"textarea",attrs:{rows:4},required:!1,label:"Availability expectation",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` What is your availability expectation for this feature? + Examples:`,extra_help:x$1` + <ul> + <li> + Feature is available on Web Platform Baseline within 12 months of + launch in Chrome. + </li> + + <li> + Feature is available only in Chromium browsers for the foreseeable + future. + </li> + </ul> + `},adoption_expectation:{type:"textarea",attrs:{rows:4},required:!1,label:"Adoption expectation",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` What is your adoption expectation for this feature? + Examples:`,extra_help:x$1` + <ul> + <li> + Feature is considered a best practice for some use case within 12 + months of reaching Web Platform baseline. + </li> + + <li> + Feature is used by specific partner(s) to provide functionality within + 12 months of launch in Chrome. + </li> + + <li> + At least 3 major abstractions replace their use of an existing feature + with this feature within 24 months of reaching mainline. + </li> + </ul> + `},adoption_plan:{type:"textarea",attrs:{rows:4},required:!1,label:"Adoption plan",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` What is the plan to achieve the stated expectations? Please + provide a plan that covers availability and adoption for the feature.`},security_review_status:{type:"select",choices:REVIEW_STATUS_CHOICES,initial:REVIEW_STATUS_CHOICES.REVIEW_PENDING[0],label:"Security review status",usage:{},help_text:x$1` Status of the security review.`},privacy_review_status:{type:"select",choices:REVIEW_STATUS_CHOICES,initial:REVIEW_STATUS_CHOICES.REVIEW_PENDING[0],label:"Privacy review status",usage:{},help_text:x$1`Status of the privacy review.`},tag_review:{type:"textarea",attrs:{rows:2},required:!1,label:"TAG specification review",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Link(s) to TAG specification review(s), or explanation why + this is not needed.`,extra_help:x$1` <p> + The + <a target="_blank" href="https://www.w3.org/2001/tag/" + >W3C Technical Architecture Group</a + > + (TAG) is a special working group of the W3C that consists of a few + appointed and elected members, all of whom are experienced members of + the web standards community. The Blink launch process has a + <a + target="_blank" + href="https://www.chromium.org/blink/launching-features/wide-review/#tag" + >formal requirement for requesting a TAG specification review</a + > + for all features. The review happens publicly on a GitHub issue. + </p> + <p> + You will likely have asked for an "<a + target="_blank" + href="https://github.com/w3ctag/design-reviews/issues/new?template=000-incubation-review.yaml" + >Early design/incubation review</a + >" earlier in the process to get the TAG familiar with your feature. + This isn't that. + </p> + <p> + It's recommended that you file a TAG specification review as soon as + your specification is written, and at least a month ahead of sending an + Intent to Ship. There may be some work involved in preparing your + feature for review. See the + <a + target="_blank" + href="https://www.chromium.org/blink/launching-features/wide-review/#tag" + >launch process</a + > + for help picking which kind of specification review to file, and then + look through that template to find what data to collect. + </p> + <p> + A large number of Intents to Ship are delayed because a TAG + specification review was only recently filed and engagement from the TAG + can take multiple weeks to multiple months. Note that the API owners can + approve shipping even if the TAG hasn't replied to your review request, + as long as you've made a reasonable effort to obtain their review with + enough time for them to give feedback. + </p>`},tag_review_status:{type:"select",choices:REVIEW_STATUS_CHOICES,initial:REVIEW_STATUS_CHOICES.REVIEW_PENDING[0],label:"TAG specification review status",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1`Status of the TAG specification review.`},intent_to_ship_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Intent to Ship link",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1`After you have started the "Intent to Ship" discussion + thread, link to it here.`},announcement_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Ready for Developer Testing link",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1`After you have started the "Ready for Developer Testing" + discussion thread, link to it here.`},intent_to_experiment_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Intent to Experiment link",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1`After you have started the "Intent to Experiment" discussion + thread, link to it here.`},intent_to_extend_experiment_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Intent to Extend Experiment link",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1`If this feature has an "Intent to Extend Experiment" + discussion thread, link to it here.`},ot_extension__intent_to_extend_experiment_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!0,label:"Intent to Extend Experiment link",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Link to the approved Intent to Extend Experiment, as per + <a + target="_blank" + href="https://www.chromium.org/blink/origin-trials/running-an-origin-trial/#what-is-the-process-to-extend-an-origin-trial" + > + the trial extension process </a + >.`},r4dt_url:{name:"intent_to_experiment_url",type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Request for Deprecation Trial link",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1`After you have started the "Request for Deprecation Trial" + discussion thread, link to it here.`},interop_compat_risks:{type:"textarea",required:!1,label:"Interoperability and compatibility risks",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Describe the degree of + <a + target="_blank" + href="https://www.chromium.org/blink/guidelines/web-platform-changes-guidelines#finding-balance" + > + interoperability risk</a + >. For a new feature, the main risk is that it fails to become an + interoperable part of the web platform if other browsers do not implement + it. For a removal, please review our + <a + target="_blank" + href="https://docs.google.com/document/d/1RC-pBBvsazYfCNNUSkPqAVpSpNJ96U8trhNkfV0v9fk/edit" + > + principles of web compatibility</a + >.<br /> + <br /> + Please include citation links below where possible. Examples include + resolutions from relevant standards bodies (e.g. W3C working group), + tracking bugs, or links to online conversations. + <a + target="_blank" + href="https://github.com/GoogleChrome/chromium-dashboard/wiki/EditingHelp#interoperability-and-compatibility-risks-example" + > + Example</a + >.`},safari_views:{type:"select",choices:VENDOR_VIEWS_COMMON,initial:VENDOR_VIEWS_COMMON.NO_PUBLIC_SIGNALS[0],label:"WebKit views",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` See + <a + target="_blank" + href="https://www.chromium.org/blink/launching-features/wide-review/" + > + chromium.org/blink/launching-features/wide-review + </a>`},safari_views_link:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"",displayLabel:"WebKit views link",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1`Citation link.`},safari_views_notes:{type:"textarea",attrs:{rows:2,placeholder:"Notes"},required:!1,label:"",displayLabel:"WebKit views notes",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:""},ff_views:{type:"select",choices:VENDOR_VIEWS_GECKO,initial:VENDOR_VIEWS_GECKO.NO_PUBLIC_SIGNALS[0],label:"Firefox views",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` See + <a + target="_blank" + href="https://www.chromium.org/blink/launching-features/wide-review/" + > + chromium.org/blink/launching-features/wide-review + </a>`},ff_views_link:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"",displayLabel:"Firefox views link",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Citation link.`},ff_views_notes:{type:"textarea",attrs:{rows:2,placeholder:"Notes"},required:!1,label:"",displayLabel:"Firefox views notes",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:""},web_dev_views:{type:"select",choices:WEB_DEV_VIEWS,initial:WEB_DEV_VIEWS.DEV_NO_SIGNALS[0],label:"Web / Framework developer views",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` If unsure, default to "No signals". See + <a target="_blank" href="https://goo.gle/developer-signals"> + https://goo.gle/developer-signals</a + >`},web_dev_views_link:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"",displayLabel:"Web / Framework developer views link",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Citation link.`},web_dev_views_notes:{type:"textarea",attrs:{rows:2,placeholder:"Notes"},required:!1,label:"",displayLabel:"Web / Framework developer views notes",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Reference known representative examples of opinions, both + positive and negative.`},other_views_notes:{type:"textarea",attrs:{rows:4,placeholder:"Notes"},required:!1,label:"Other views",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` For example, other browsers.`},ergonomics_risks:{type:"textarea",required:!1,label:"Ergonomics risks",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Are there any other platform APIs this feature will + frequently be used in tandem with? Could the default usage of this API make + it hard for Chrome to maintain good performance (i.e. synchronous return, + must run on a certain thread, guaranteed return timing)?`},activation_risks:{type:"textarea",required:!1,label:"Activation risks",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Will it be challenging for developers to take advantage of + this feature immediately, as-is? Would this feature benefit from having + polyfills, significant documentation and outreach, and/or libraries built on + top of it to make it easier to use?`},security_risks:{type:"textarea",required:!1,label:"Security Risks",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` List any security considerations that were taken into + account when designing this feature.`},webview_risks:{type:"textarea",required:!1,label:"WebView application risks",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Does this feature deprecate or change behavior of existing + APIs, such that it has potentially high risk for Android WebView-based + applications? (See + <a + target="_blank" + href="https://new.chromium.org/developers/webview-changes/" + > + here</a + > + for a definition of "potentially high risk", information on why changes to + this platform carry higher risk, and general rules of thumb for which + changes have higher or lower risk) If so: + <ul> + <li> + Please use a base::Feature killswitch (<a + target="_blank" + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/common/features.h" + >examples here</a + >) that can be flipped off in case of compat issues + </li> + <li>Consider contacting android-webview-dev@chromium.org for advice</li> + <li> + If you are not sure, just put "not sure" as the answer and the API + owners can help during the review of your Intent to Ship + </li> + </ul>`},experiment_goals:{type:"textarea",required:!1,label:"Experiment goals",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Which pieces of the API surface are you looking to gain + insight on? What metrics/measurement/feedback will you be using to + validate designs? Double check that your experiment makes sense given that + a large developer (e.g. a Google product or Facebook) likely can't use it + in production due to the limits enforced by origin trials. + <br /><br /> + If you send an Intent to Extend Origin Trial, highlight areas for + experimentation. They should not be an exact copy of the goals from the + first Intent to Experiment.`},experiment_timeline:{type:"textarea",attrs:{rows:2,placeholder:"This field is deprecated",disabled:!0},required:!1,label:"Experiment timeline",usage:{[FeatureType.Incubate]:new Set([UsageType.Experiment]),[FeatureType.Existing]:new Set([UsageType.Experiment]),[FeatureType.Deprecation]:new Set([UsageType.Experiment])},help_text:x$1` When does the experiment start and expire? Deprecated: + Please use the numeric fields above instead.`,deprecated:!0},ot_milestone_desktop_start:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"OT desktop start",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` First desktop milestone that will support an origin trial + of this feature.`,check:(_value,getFieldValue)=>checkMilestoneRanges([OT_MILESTONE_DESKTOP_RANGE,OT_ALL_SHIPPED_MILESTONE_DESKTOP_RANGE],getFieldValue)},ot_milestone_desktop_end:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"OT desktop end",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Last desktop milestone that will support an origin trial of + this feature.`,check:(_value,getFieldValue)=>checkMilestoneRanges([OT_MILESTONE_DESKTOP_RANGE],getFieldValue)},ot_milestone_android_start:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"OT Android start",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` First android milestone that will support an origin trial + of this feature.`,check:(_value,getFieldValue)=>checkMilestoneRanges([OT_MILESTONE_ANDROID_RANGE,OT_ALL_SHIPPED_MILESTONE_ANDROID_RANGE],getFieldValue)},ot_milestone_android_end:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"OT Android end",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Last android milestone that will support an origin trial of + this feature.`,check:(_value,getFieldValue)=>checkMilestoneRanges([OT_MILESTONE_ANDROID_RANGE],getFieldValue)},ot_milestone_webview_start:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"OT WebView start",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` First WebView milestone that will support an origin trial + of this feature.`,check:(_value,getFieldValue)=>checkMilestoneRanges([OT_MILESTONE_WEBVIEW_RANGE,OT_ALL_SHIPPED_MILESTONE_WEBVIEW_RANGE],getFieldValue)},ot_milestone_webview_end:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"OT WebView end",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Last WebView milestone that will support an origin trial of + this feature.`,check:(_value,getFieldValue)=>checkMilestoneRanges([OT_MILESTONE_WEBVIEW_RANGE],getFieldValue)},experiment_risks:{type:"textarea",required:!1,label:"Experiment risks",usage:{},help_text:x$1` When this experiment comes to an end are there any risks to + the sites that were using it, for example losing access to important storage + due to an experimental storage API?`},experiment_extension_reason:{type:"textarea",required:!1,label:"Experiment extension reason",usage:{[FeatureType.Incubate]:new Set([UsageType.Experiment]),[FeatureType.Existing]:new Set([UsageType.Experiment]),[FeatureType.Deprecation]:new Set([UsageType.Experiment])},help_text:x$1` If this is a repeated or extended experiment, explain why + it's being repeated or extended. Also, fill in discussion link fields below.`},extension_desktop_last:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!0,label:"Trial extension end milestone",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` The last desktop milestone in which the trial will be + available after extension.`},extension_android_last:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"Trial extension Android end",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` The last android milestone in which the trial will be + available after extension.`},extension_webview_last:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"Trial extension WebView end",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` The last WebView milestone in which the trial will be + available after extension.`},ot_extension__milestone_desktop_last:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!0,label:"Trial extension end milestone",usage:{},help_text:x$1` The last milestone in which the trial will be available + after extension.`,check:_value=>checkExtensionMilestoneIsValid(_value)},ongoing_constraints:{type:"textarea",required:!1,label:"Ongoing Constraints",usage:{[FeatureType.Incubate]:new Set([UsageType.Experiment]),[FeatureType.Existing]:new Set([UsageType.Experiment]),[FeatureType.Deprecation]:new Set([UsageType.Experiment])},help_text:x$1` Do you anticipate adding any ongoing technical constraints + to the codebase while implementing this feature? We prefer to avoid features + that require or assume a specific architecture. For most features, the + answer is "None."`},rollout_plan:{type:"select",choices:ROLLOUT_PLAN,initial:ROLLOUT_PLAN.ROLLOUT_100[0],label:"Rollout plan",usage:{[FeatureType.Incubate]:new Set([UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.Experiment,UsageType.Ship])},help_text:x$1`Normally, WP features that ship in a milestone go to all + users of that milestone. If your feature needs to roll out in any other way, + mark that here.`},origin_trial_feedback_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Origin trial feedback summary",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` If your feature was available as an origin trial, link to a + summary of usage and developer feedback. If not, leave this empty. DO NOT + USE FEEDBACK VERBATIM without prior consultation with the Origin Trials + team.`},ot_chromium_trial_name:{type:"input",attrs:TEXT_FIELD_ATTRS,required:!0,label:"Chromium trial name",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Name for the trial, given as the value of the property + "origin_trial_feature_name" as specified in + <a + target="_blank" + href="https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/runtime_enabled_features.json5" + >runtime_enabled_features.json5</a + >. + <br /> + <p style="color: red"> + <strong>Note:</strong> This name should be unique and should not be used + by any previous origin trials! + </p>`},ot_documentation_url:{type:"input",attrs:URL_FIELD_ATTRS,label:"Documentation link",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Link to more information to help developers use the trial's + feature (e.g. blog post, Github explainer, etc.).`},ot_creation__ot_documentation_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!0,label:"Documentation link",usage:{},help_text:x$1` Link to more information to help developers use the trial's + feature (e.g. blog post, Github explainer, etc.).`},ot_emails:{type:"input",attrs:MULTI_EMAIL_FIELD_ATTRS,required:!1,label:"Origin trial contacts",usage:{},help_text:x$1` List any other individuals or groups to include on the + contact list (e.g. for reminders on trial milestones). Mailing list emails + can be used here, but only email addresses of individuals will receive + access to view registrant data on + <a target="_blank" href="http://go/ot-registrants-dashboard" + >go/ot-registrants-dashboard</a + >. + <p> + <strong> + Please prefer using "@google.com" domain email addresses for any + contacts that have one. + </strong> + </p>`},ot_has_third_party_support:{type:"checkbox",initial:!1,label:"Origin trial supports third party origins",usage:{},help_text:x$1` Whether this trial supports third party origins. See + <a href="https://web.dev/third-party-origin-trials/">this article</a> + for more information. The feature should have + "origin_trial_allows_third_party" set to "true" in + <a + target="_blank" + href="https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/runtime_enabled_features.json5" + >runtime_enabled_features.json5</a + >`},ot_is_critical_trial:{type:"checkbox",initial:!1,label:"Critical origin trial",usage:{},help_text:x$1` See + <a href="https://goto.google.com/running-an-origin-trial" + >go/running-an-origin-trial</a + > + for criteria and additional process requirements. The feature name must be + added to the "kHasExpiryGracePeriod" array in + <a + target="_blank" + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/common/origin_trials/manual_completion_origin_trial_features.cc" + >manual_completion_origin_trial_features.cc</a + >`},ot_is_deprecation_trial:{type:"checkbox",initial:!1,label:"Deprecation trial",usage:{},help_text:x$1` Is this a deprecation trial? See the + <a + href="https://www.chromium.org/blink/launching-features/#deprecation-trial" + >deprecation trial section</a + > + for more information.`},ot_request_note:{type:"textarea",required:!1,label:"Anything else?",usage:{},help_text:x$1`<p> + Let us know if you have any further questions or comments. + </p>`},ot_webfeature_use_counter:{type:"input",attrs:{...TEXT_FIELD_ATTRS,placeholder:"e.g. \"kWebFeature\"",pattern:"k\\S*"},label:"UseCounter name",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` For measuring usage, this must be a single named value from + the WebFeature, WebDXFeature, or CSSSampleId enum, e.g. kWorkerStart. The + use counter must be landed in either + <a + target="_blank" + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom" + >web_feature.mojom</a + >, + <a + target="_blank" + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom" + >webdx_feature.mojom</a + >, or + <a + target="_blank" + href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom" + >css_property_id.mojom</a + >. Not required for deprecation trials.`},ot_webfeature_use_counter__type:{type:"radios",label:"Use counter type",choices:WEBFEATURE_USE_COUNTER_TYPES,usage:{},help_text:x$1`Which type of use counter the feature is using. This can be + determined by which file the use counter is defined in.`},ot_require_approvals:{type:"checkbox",initial:!1,label:"Trial participation requires approval",usage:{},help_text:x$1` <p> + Will this trial require registrants to receive approval before + participating? Please reach out to origin-trials-support@google.com + beforehand to discuss options here. + </p>`},ot_approval_buganizer_component:{type:"input",attrs:{type:"number"},required:!0,label:"Approvals Buganizer component ID",usage:{},help_text:x$1`Buganizer component ID used for approvals requests.`},ot_approval_buganizer_custom_field_id:{type:"input",attrs:{type:"number"},required:!0,label:"Approvals Buganizer custom field ID",usage:{},help_text:x$1`The Buganizer custom field ID for trial registration + approval. This custom field in Buganizer provides approval/rejection + rationales for registration requests under ot_approval_buganizer_component.`},ot_approval_group_email:{type:"input",required:!0,attrs:{...TEXT_FIELD_ATTRS,pattern:GOOGLE_EMAIL_ADDRESS_REGEX,placeholder:"ex. \"approval-requests@google.com\""},label:"Registration request notifications group",usage:{},help_text:x$1` <p> + Google group email to be used for new registration request notifications. + Please supply a '@google.com' domain email address only. + </p>`},ot_approval_criteria_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!0,label:"Approval criteria link",usage:{},help_text:x$1` <p> + Link to public documentation describing the requirements to be approved + for trial participation. + </p>`},ot_creation__intent_to_experiment_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!0,label:"Intent to Experiment link",usage:{},help_text:x$1`Your "Intent to Experiment" discussion thread. The necessary + LGTMs should already have been received.`},ot_creation__milestone_desktop_first:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!0,label:"Trial milestone start",usage:{},help_text:x$1` First milestone that will support an origin trial of this + feature.`,check:(_value,getFieldValue)=>checkMilestoneRanges([OT_MILESTONE_DESKTOP_RANGE,OT_ALL_SHIPPED_MILESTONE_DESKTOP_RANGE],getFieldValue)},ot_creation__milestone_desktop_last:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!0,label:"Trial milestone end",usage:{},help_text:x$1` Last milestone that will support an origin trial of this + feature.`,check:(_value,getFieldValue)=>checkMilestoneRanges([OT_MILESTONE_DESKTOP_RANGE],getFieldValue)},ot_creation__bypass_file_checks:{type:"checkbox",initial:!1,label:"Bypass Chromium file checks (staging testing)",usage:{},help_text:x$1`This option should only be visible in ChromeStatus staging + environments. Allow this form to be submitted without verifying Chromium + code has landed.`},anticipated_spec_changes:{type:"textarea",attrs:{rows:4},required:!1,label:"Anticipated spec changes",usage:{[FeatureType.Incubate]:ALL_FEATURE_TYPE_INCUBATE_INTENTS,[FeatureType.Existing]:ALL_FEATURE_TYPE_EXISTING_INTENTS,[FeatureType.Deprecation]:ALL_FEATURE_TYPE_DEPRECATION_INTENTS},help_text:x$1` Open questions about a feature may be a source of future + web compat or interop issues. Please list open issues (e.g. links to known + github issues in the repo for the feature specification) whose resolution + may introduce web compat/interop risk (e.g., changing the naming or + structure of the API in a non-backward-compatible way).`},finch_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"Finch experiment",usage:{},help_text:x$1` If your feature will roll out gradually via a + <a target="_blank" href="http://go/finch">Finch experiment</a>, link to it + here.`},i2e_lgtms:{type:"input",attrs:{...MULTI_EMAIL_FIELD_ATTRS,placeholder:"This field is deprecated",disabled:!0},required:!1,label:"Intent to Experiment LGTM by",usage:{},help_text:x$1` Full email address of API owner who LGTM'd the Intent to + Experiment email thread.`,deprecated:!0},i2s_lgtms:{type:"input",attrs:{...MULTI_EMAIL_FIELD_ATTRS,placeholder:"This field is deprecated",disabled:!0},required:!1,label:"Intent to Ship LGTMs by",usage:{},help_text:x$1` + Comma separated list of email addresses of API owners who LGTM'd the + Intent to Ship email thread. + `,deprecated:!0},r4dt_lgtms:{name:"i2e_lgtms",type:"input",attrs:{...MULTI_EMAIL_FIELD_ATTRS,placeholder:"This field is deprecated",disabled:!0},required:!1,label:"Request for Deprecation Trial LGTM by",usage:{},help_text:x$1` Full email addresses of API owners who LGTM'd the Request + for Deprecation Trial email thread.`,deprecated:!0},debuggability:{type:"textarea",required:!1,label:"Debuggability",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Description of the DevTools debugging support for your + feature. Please follow the + <a target="_blank" href="https://goo.gle/devtools-checklist"> + DevTools support checklist</a + > + for guidance.`},all_platforms:{type:"checkbox",initial:!1,label:"Supported on all platforms?",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Will this feature be supported on all six Blink platforms + (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?`},all_platforms_descr:{type:"textarea",attrs:{rows:2},required:!1,label:"Platform support explanation",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Explain why this feature is, or is not, supported on all + platforms.`},wpt:{type:"checkbox",initial:!1,label:"Web Platform Tests",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Is this feature fully tested in Web Platform Tests?`},wpt_descr:{type:"textarea",required:!1,label:"Web Platform Tests or other automated test description",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Please link to the + <a target="_blank" href="https://wpt.fyi/results">results on wpt.fyi</a>. + If any part of the feature is not tested by web-platform-tests, please + include links to other automated tests or links to issues, e.g. a + web-platform-tests issue with the "infra" label explaining why a certain + thing cannot be tested (<a + target="_blank" + href="https://github.com/w3c/web-platform-tests/issues/3867" + >example</a + >), a spec issue for some change that would make it possible to test. (<a + target="_blank" + href="https://github.com/whatwg/fullscreen/issues/70" + >example</a + >), or a Chromium issue to upstream some existing tests (<a + target="_blank" + href="https://bugs.chromium.org/p/chromium/issues/detail?id=695486" + >example</a + >).`},sample_links:{type:"textarea",attrs:MULTI_URL_FIELD_ATTRS,required:!1,label:"Demo and sample links",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Links to demos and samples (one URL per line).`},non_oss_deps:{type:"textarea",required:!1,label:"Non-OSS dependencies",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Does the feature depend on any code or APIs outside the + Chromium open source repository and its open-source dependencies to + function? (e.g. server-side APIs, operating system APIs tailored to this + feature or closed-source code bundles) Yes or no. If yes, explain why this + is necessary.`},devrel:{type:"input",name:"devrel_emails",attrs:MULTI_EMAIL_FIELD_ATTRS,required:!1,label:"Developer relations emails",usage:{},help_text:x$1` Comma separated list of full email addresses.`},shipped_milestone:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"Chrome for desktop",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:SHIPPED_HELP_TXT,check:(_value,getFieldValue)=>checkMilestoneRanges([ALL_OT_SHIPPED_MILESTONE_DESKTOP_RANGE,ALL_DT_SHIPPED_MILESTONE_DESKTOP_RANGE],getFieldValue)},shipped_android_milestone:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"Chrome for Android",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:SHIPPED_HELP_TXT,check:(_value,getFieldValue)=>checkMilestoneRanges([ALL_OT_SHIPPED_MILESTONE_ANDROID_RANGE,ALL_DT_SHIPPED_MILESTONE_ANDROID_RANGE],getFieldValue)},shipped_ios_milestone:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"Chrome for iOS (RARE)",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:SHIPPED_HELP_TXT,check:(_value,getFieldValue)=>checkMilestoneRanges([ALL_DT_SHIPPED_MILESTONE_IOS_RANGE],getFieldValue)},shipped_webview_milestone:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"Android Webview",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:SHIPPED_WEBVIEW_HELP_TXT,check:(_value,getFieldValue)=>checkMilestoneRanges([ALL_OT_SHIPPED_MILESTONE_WEBVIEW_RANGE],getFieldValue)},requires_embedder_support:{type:"checkbox",initial:!1,label:"Requires embedder support",usage:{[FeatureType.Incubate]:ALL_FEATURE_TYPE_INCUBATE_INTENTS,[FeatureType.Existing]:ALL_FEATURE_TYPE_EXISTING_INTENTS,[FeatureType.Deprecation]:ALL_FEATURE_TYPE_DEPRECATION_INTENTS},help_text:x$1` Will this feature require support in //chrome? That + includes any code in //chrome, even if that is for functionality on top of + the spec. Other //content embedders will need to be aware of that + functionality. Please add a row to this + <a + target="_blank" + href="https://docs.google.com/spreadsheets/d/1QV4SW4JBG3IyLzaonohUhim7nzncwK4ioop2cgUYevw/edit#gid=0" + > + tracking spreadsheet</a + >.`},devtrial_instructions:{type:"input",attrs:URL_FIELD_ATTRS,required:!1,label:"DevTrial instructions",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` Link to a HOWTO or FAQ describing how developers can get + started using this feature in a DevTrial. + <br /><br /> + <a + target="_blank" + href="https://github.com/samuelgoto/WebID/blob/master/HOWTO.md" + > + Example 1</a + >. + <a + target="_blank" + href="https://github.com/WICG/idle-detection/blob/main/HOWTO.md" + > + Example 2</a + >.`},dt_milestone_desktop_start:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"DevTrial on desktop",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` First milestone that allows web developers to try this + feature on desktop platforms by setting a flag. When flags are enabled by + default in preparation for shipping or removal, please use the fields in the + ship stage.`,check:(_value,getFieldValue)=>checkMilestoneRanges([DT_ALL_SHIPPED_MILESTONE_DESKTOP_RANGE],getFieldValue)},dt_milestone_android_start:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"DevTrial on Android",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` First milestone that allows web developers to try this + feature on Android by setting a flag. When flags are enabled by default in + preparation for shipping or removal, please use the fields in the ship + stage.`,check:(_value,getFieldValue)=>checkMilestoneRanges([DT_ALL_SHIPPED_MILESTONE_ANDROID_RANGE],getFieldValue)},dt_milestone_ios_start:{type:"input",attrs:MILESTONE_NUMBER_FIELD_ATTRS,required:!1,label:"DevTrial on iOS (RARE)",usage:ALL_INTENT_USAGE_BY_FEATURE_TYPE,help_text:x$1` First milestone that allows web developers to try this + feature on iOS by setting a flag. When flags are enabled by default in + preparation for shipping or removal, please use the fields in the ship + stage.`,check:(_value,getFieldValue)=>checkMilestoneRanges([DT_ALL_SHIPPED_MILESTONE_IOS_RANGE],getFieldValue)},flag_name:{type:"input",attrs:TEXT_FIELD_ATTRS,required:!1,label:"Flag name on about://flags",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` Name of the flag on about://flags that allows a web + developer to enable this feature in their own browser to try it out. E.g., + "storage-buckets". These are defined in + <a + target="_blank" + href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/about_flags.cc" + >about_flags.cc</a + >.`},finch_name:{type:"input",attrs:{...TEXT_FIELD_ATTRS,placeholder:"e.g. \"StorageBuckets\"",pattern:FINCH_NAMES_REGEX},required:!1,label:"Finch feature name",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` String name of the <code>base::Feature</code> defined via + the <code>BASE_FEATURE</code> macro in your feature implementation code. + E.g., "StorageBuckets". These names are used in + <a + target="_blank" + href="https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/runtime_enabled_features.json5" + >runtime_enabled_features.json5</a + > + (or + <a + target="_blank" + href="https://chromium.googlesource.com/chromium/src/+/main/content/public/common/content_features.cc" + >content_features.cc</a + >), and finch GCL files`},non_finch_justification:{type:"textarea",required:!1,label:"Non-finch justification",usage:{[FeatureType.Incubate]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.Existing]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship]),[FeatureType.CodeChange]:new Set([UsageType.DeveloperTesting,UsageType.PSA]),[FeatureType.Deprecation]:new Set([UsageType.DeveloperTesting,UsageType.Experiment,UsageType.Ship])},help_text:x$1` The + <a + target="_blank" + href="https://chromium.googlesource.com/chromium/src/+/main/docs/flag_guarding_guidelines.md" + >Flag Guarding Guidelines</a + > + require new features to have a finch flag. If your feature does not have a + finch flag, explain why.`},prefixed:{type:"checkbox",label:"Prefixed?",initial:!1,usage:{},help_text:""},display_name:{type:"input",attrs:TEXT_FIELD_ATTRS,required:!1,label:"Stage display name",usage:{},help_text:x$1` <p> + Optional. Stage name to display on the feature detail page. + </p>`,extra_help:x$1` <p> + This name is only used for displaying stages on this site. Use this to + differentiate stages of the same type. + </p> + <h4>Examples</h4> + <ul> + <li>Extended deprecation trial</li> + <li>Second origin trial run</li> + <li>Delayed ship for Android</li> + </ul>`},ot_display_name:{type:"input",attrs:TEXT_FIELD_ATTRS,required:!0,label:"Origin trial display name",usage:{},help_text:x$1` <p> + Name shown in the + <a href="https://developer.chrome.com/origintrials/" target="_blank"> + Origin Trials Console + </a> + and included in reminder emails. + </p>`},ot_description:{type:"textarea",required:!0,label:"Trial description",usage:{},help_text:x$1` <p> + A brief description of the feature to interest web developers in joining + the trial (1-2 sentences). Shown as the trial description in the + <a href="https://developer.chrome.com/origintrials/" target="_blank"> + Origin Trials Console </a + >. + </p>`},ot_owner_email:{type:"input",required:!0,attrs:{...TEXT_FIELD_ATTRS,pattern:GOOGLE_EMAIL_ADDRESS_REGEX},usage:{},label:"Google point of contact",help_text:x$1` <p> + A Googler contact for this origin trial. Please supply a '@google.com' + domain email address only. + </p>`},ot_feedback_submission_url:{type:"input",attrs:URL_FIELD_ATTRS,required:!0,label:"Feature feedback link",usage:{},help_text:x$1` Link for developers to file feedback on the feature (e.g. + GitHub issues, or WICG page).`},shipping_year:{type:"input",attrs:{type:"number",min:2e3,max:2050},required:!0,label:"Estimated shipping year",usage:{},help_text:x$1` Estimate of the calendar year in which this will first ship + on any platform. E.g., 2024.`},enterprise_policies:{type:"input",attrs:MULTI_STRING_FIELD_ATTRS,required:!1,label:"Enterprise policies",usage:{[FeatureType.Incubate]:new Set([UsageType.CrossFunctionReview]),[FeatureType.Existing]:new Set([UsageType.CrossFunctionReview]),[FeatureType.CodeChange]:new Set([UsageType.CrossFunctionReview]),[FeatureType.Deprecation]:new Set([UsageType.CrossFunctionReview]),[FeatureType.Enterprise]:new Set([UsageType.CrossFunctionReview])},help_text:x$1` List the policies that are being introduced, removed, or + can be used to control the feature at this stage, if any.`,disabled:!0,deprecated:!0},enterprise_feature_categories:{type:"multiselect",choices:ENTERPRISE_FEATURE_CATEGORIES,required:!1,label:"Enterprise feature categories",usage:{},help_text:x$1` If your feature impacts enterprise users, select at least + one.`,enterprise_help_text:x$1` Select at least one.`},enterprise_impact:{type:"select",choices:ENTERPRISE_IMPACT,initial:ENTERPRISE_IMPACT.IMPACT_NONE[0],enterprise_initial:ENTERPRISE_IMPACT.IMPACT_MEDIUM[0],label:"Enterprise impact / risk",usage:{},help_text:x$1` + <b>Low Risk:</b> Important for Admin Awareness. Negligible disruption, but + provides value (new APIs, optional features, strictly additive) or + requires minor internal documentation updates. Select this to ensure the + feature is published in the Release Notes. + <br /> + <b>Med Risk:</b>Noticeable impact. Potential to alter some workflows or + cause minor confusion/help desk calls. Admins may want to review and set a + policy. An escape hatch is often recommended. + <br /> + <b>High Risk:</b> Significant disruption. Intentional "breaking changes" + or major new functionality that will require mandatory preparation, + testing, and communication from IT admins. Requires an escape hatch or + permanent policy. + `},rollout_milestone:{type:"input",attrs:{...MILESTONE_NUMBER_FIELD_ATTRS,min:100},required:!0,label:"Chrome milestone",usage:{},help_text:x$1` The milestone in which this stage rolls out to the stable + channel (even a 1% rollout). If you don't yet know which milestone it will + be, put in your best estimate. You can always change this later.`},rollout_platforms:{type:"multiselect",choices:PLATFORM_CATEGORIES,required:!0,label:"Rollout platforms",usage:{},help_text:x$1` The platform(s) affected by this stage`},rollout_details:{type:"textarea",always_markdown:!0,attrs:{rows:4},required:!1,label:"Rollout details (optional)",usage:{},help_text:x$1` Explain what specifically is changing in this milestone, + for the given platforms. Many features are composed of multiple stages on + different milestones. For example, you may have a stage that introduces a + change and a temporary policy to control it, then another stage on a + subsequent milestone that removes the policy. Alternatively, you may ship + the feature to different platforms in different milestones.`},rollout_stage_plan:{type:"select",choices:ROLLOUT_STAGE_PLAN_CATEGORIES,initial:ROLLOUT_STAGE_PLAN_CATEGORIES.ROLLOUT_STAGE_PLAN_SLOW[0],required:!0,label:"Rollout plan",usage:{},help_text:x$1` Select the type of rollout that matches what will happen in + the stage`},breaking_change:{type:"checkbox",label:"Breaking change",initial:!1,usage:{},help_text:x$1` This is a breaking change: customers or developers must + take action to continue using some existing functionaity.`},confidential:{type:"checkbox",label:"Confidential",initial:!0,usage:{},help_text:x$1`Most enterprise feature entries should be marked + confidential until they have been reviewed for publication. Confidential + entrys are only visible to admins, chromium contributors and the feature's + owners, contributors and creator.`},intent_cc_emails:{type:"input",attrs:MULTI_EMAIL_FIELD_ATTRS,required:!1,label:"Intent email CC list",usage:{},help_text:x$1`Add emails to the CC list of the intent email.<br /> + Comma separated list of full email addresses.`}};function categorizeFieldType(field){if(field.attrs===MULTI_URL_FIELD_ATTRS)return"multi-url";return field.attrs===URL_FIELD_ATTRS?"url":"checkbox"===field.type?"checkbox":"text"}function makeHumanReadable(fieldName){return fieldName=fieldName.replace("_"," "),fieldName.charAt(0).toUpperCase()+fieldName.slice(1)}function makeDisplaySpec(fieldName){const fieldProps=ALL_FIELDS[fieldName],displayName=fieldProps.label||fieldProps.displayLabel||makeHumanReadable(fieldName),fieldType=categorizeFieldType(fieldProps),deprecated=fieldProps.deprecated,alwaysMarkdown=fieldProps.always_markdown;return[fieldName,displayName,fieldType,deprecated,alwaysMarkdown]}function makeDisplaySpecs(fieldNames){return fieldNames.map(fieldName=>makeDisplaySpec(fieldName))}function findMinMilestone(fieldName,stageTypes,getFieldValue){let minMilestone=1/0;const feature=getFieldValue.feature;for(const stage of feature.stages)if(stageTypes.has(stage.stage_type)){const milestone=getFieldValue(fieldName,stage);null!=milestone&&""!==milestone&&(minMilestone=Math.min(minMilestone,milestone))}return minMilestone===1/0?void 0:minMilestone}function findMaxMilestone(fieldName,stageTypes,getFieldValue){let maxMilestone=-Infinity;const feature=getFieldValue.feature;for(const stage of feature.stages)if(stageTypes.has(stage.stage_type)){const milestone=getFieldValue(fieldName,stage);null!=milestone&&""!==milestone&&(maxMilestone=Math.max(maxMilestone,milestone))}return maxMilestone===-Infinity?void 0:maxMilestone}function checkEarlierBeforeAllLaterMilestones(fieldPair,getFieldValue){const{earlier,allLater,warning}=fieldPair,stageTypes=allLater&&SHIPPED_MILESTONE_FIELDS.has(allLater)?STAGE_TYPES_SHIPPING:null,earlierValue=getNumericValue(earlier,getFieldValue);if(stageTypes&&allLater){const laterValue=findMinMilestone(allLater,stageTypes,getFieldValue);if(null!=earlierValue&&null!=laterValue&&+earlierValue>=laterValue)return warning?{warning}:{error:`Earlier milestone #${earlierValue} should be before shipped milestone #${laterValue}.`}}}function checkAllEarlierBeforeLaterMilestone(fieldPair,getFieldValue){const{allEarlier,later,warning,error}=fieldPair,stageTypes=allEarlier&&OT_MILESTONE_START_FIELDS.has(allEarlier)?STAGE_TYPES_ORIGIN_TRIAL:allEarlier&&DT_MILESTONE_FIELDS.has(allEarlier)?STAGE_TYPES_DEV_TRIAL:null;if(stageTypes&&allEarlier){const earlierValue=findMaxMilestone(allEarlier,stageTypes,getFieldValue),laterValue=getNumericValue(later,getFieldValue);if(null!=earlierValue&&null!=laterValue&&earlierValue>=+laterValue)return warning?{warning}:{error:error||`Earlier milestone #${earlierValue} should be before shipped milestone #${laterValue}.`}}}function getNumericValue(name,getFieldValue){const value=getFieldValue(name,"current stage");return"string"==typeof value?""===value?void 0:+value:value}function checkMilestoneRanges(ranges,getFieldValue){let result;for(const range of ranges){const{earlier,allEarlier,later,allLater,warning,error}=range;if(allLater)result=checkEarlierBeforeAllLaterMilestones(range,getFieldValue);else if(allEarlier)result=checkAllEarlierBeforeLaterMilestone(range,getFieldValue);else{const earlierMilestone=getNumericValue(earlier,getFieldValue),laterMilestone=getNumericValue(later,getFieldValue);null!=earlierMilestone&&null!=laterMilestone&&laterMilestone<=earlierMilestone&&(result=warning?{warning}:{error:error||"Start milestone must be before end milestone"})}if(result)return result}}function checkFeatureNameAndType(getFieldValue){const name=((getFieldValue("name")||"")+"").toLowerCase(),featureType=+(getFieldValue("feature_type")||"0"),isdeprecationName=name.includes("deprecat")||name.includes("remov"),isdeprecationType=featureType===FEATURE_TYPES.FEATURE_TYPE_DEPRECATION_ID[0];if(isdeprecationName!==isdeprecationType)return isdeprecationName?{warning:`If the feature name contains "deprecate" or "remove", + the feature type should be "Feature deprecation"`}:{warning:`If the feature type is "Feature deprecation", + the feature name should contain "deprecate" or "remove"`}}async function checkFirstEnterpriseNotice(value,initialValue){if(!value)return;const newChannelStableDate=await window.csClient.getSpecifiedChannels(value,value).then(channels=>channels[value]?.stable_date),previousChannelStableDate=initialValue?await window.csClient.getSpecifiedChannels(initialValue,initialValue).then(channels=>channels[value]?.stable_date):void 0;return newChannelStableDate?previousChannelStableDate&&Date.parse(previousChannelStableDate)<Date.now()?{warning:`Feature was already shown in milestone ${initialValue}, this cannot be changed`}:Date.parse(newChannelStableDate)<=Date.now()?{warning:`Milestone ${value} was already released, choose a future milestone`}:void 0:{error:`Unknown milestone ${value}`}}async function checkExtensionMilestoneIsValid(value){if("number"==typeof value&&isNaN(value))return{error:"Invalid milestone format."};for(let i=0;i<value.length;i++)if("0">value[i]||"9"<value[i])return{error:"Invalid milestone format."};const intValue=parseInt(value);if(1e3<=intValue)return{error:"Milestone is too distant."};const resp=await fetch("https://chromiumdash.appspot.com/fetch_milestone_schedule"),json=await resp.json();return parseInt(json.mstones[0].mstone)>intValue?{error:"End milestone cannot be in the past."}:void 0}function checkNotGoogleDocs(value,warning="Avoid using Google Docs"){return /docs\.google\.com\/document/.test(value)?{warning}:void 0}var __decorate$S=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const GATE_STATE_TO_NAME={0:"Preparing",1:"Not applicable",2:"Pending",3:"Pending",4:"Needs work",5:"Approved",6:"Denied",8:"Internal review",9:"N/A requested",10:"N/A (self-certified)",11:"N/A (self-certified then verified)"},GATE_STATE_TO_ICON={0:"arrow_circle_right_20px",2:"pending_20px",3:"pending_20px",4:"autorenew_20px",5:"check_circle_filled_20px",6:"block_20px"},GATE_STATE_TO_ABBREV={1:"N/A",8:"INT",9:"N/A?",10:"N/A (self)",11:"N/A (ver)"};let ChromedashGateChip=class ChromedashGateChip extends i$4{constructor(){super(...arguments),this.selectedGateId=0}static get styles(){return[...SHARED_STYLES,i$7` + sl-icon { + font-size: 1.2rem; + } + + sl-button::part(label) { + padding: 0 4px; + } + + sl-button::part(suffix) { + padding-right: 4px; + } + + sl-button::part(base) { + border: var(--chip-border); + padding: 0 0 0 4px; + align-items: center; + } + + sl-button.selected::part(base) { + box-shadow: 0 0 0 2px var(--dark-spot-color); + } + + sl-button:hover .teamname { + text-decoration: underline; + } + + sl-button.not_applicable::part(base), + sl-button.na_self-certified::part(base) { + background: var(--gate-not-applicable-background); + color: var(--gate-not-applicable-color); + } + sl-button.na_self-certified_then_verified::part(base) { + background: var(--gate-not-applicable-background); + color: var(--gate-not-applicable-color); + } + sl-button.not_applicable::part(prefix), + sl-button.na_self-certified::part(prefix) { + align-items: baseline; + } + + sl-button.preparing::part(base) { + background: var(--gate-preparing-background); + color: var(--gate-preparing-color); + } + .preparing sl-icon { + color: var(--gate-preparing-icon-color); + } + + sl-button.pending::part(base) { + background: var(--gate-pending-background); + color: var(--gate-pending-color); + } + .pending sl-icon { + color: var(--gate-pending-icon-color); + } + + sl-button.needs_work::part(base) { + background: var(--gate-needs-work-background); + color: var(--gate-needs-work-color); + } + .needs_work sl-icon { + color: var(--gate-needs-work-icon-color); + } + + sl-button.approved::part(base) { + background: var(--gate-approved-background); + color: var(--gate-approved-color); + } + .approved sl-icon { + color: var(--gate-approved-icon-color); + } + + sl-button.denied::part(base) { + background: var(--gate-denied-background); + color: var(--gate-denied-color); + } + .denied sl-icon { + color: var(--gate-denied-icon-color); + } + + sl-button.internal_review::part(base) { + background: var(--gate-pending-background); + color: var(--gate-pending-color); + } + sl-button.internal_review::part(prefix) { + align-items: baseline; + } + + sl-button.na_requested::part(base) { + background: var(--gate-pending-background); + color: var(--gate-pending-color); + } + sl-button.na_requested::part(prefix) { + align-items: baseline; + } + + .abbrev { + padding-left: var(--content-padding-quarter); + font-weight: 900; + } + + sl-button sl-icon.overdue { + color: var(--slo-overdue-color); + } + `]}_fireEvent(eventName,detail){const event=new CustomEvent(eventName,{bubbles:!0,composed:!0,detail});this.dispatchEvent(event)}handleClick(){updateURLParams("gate",this.gate.id),this._fireEvent("show-gate-column",{feature:this.feature,stage:this.stage,gate:this.gate})}render(){if(this.gate===void 0||null==this.gate)return E$1;const teamName=this.gate.team_name,stateName=GATE_STATE_TO_NAME[this.gate.state],className=stateName.toLowerCase().replaceAll(" ","_").replaceAll("(","").replaceAll(")","").replaceAll("/",""),selected=this.gate.id==this.selectedGateId?"selected":"",statusIconName=GATE_STATE_TO_ICON[this.gate.state],abbrev=GATE_STATE_TO_ABBREV[this.gate.state]||stateName;let statusIcon=x$1`<b class="abbrev" slot="prefix">${abbrev}</b>`;statusIconName&&(statusIcon=x$1` + <sl-icon + slot="prefix" + library="material" + name=${statusIconName} + ></sl-icon> + `);const overdue=0>this.gate.slo_initial_response_remaining,overdueIcon=overdue?x$1`<sl-icon + slot="suffix" + library="material" + class="overdue" + name="clock_loader_60_20px" + ></sl-icon>`:E$1,overdueTitle=overdue?". Overdue.":"";return x$1` + <sl-button + pill + size="small" + class="${className} ${selected}" + title="${teamName}: ${stateName}${overdueTitle}" + @click=${this.handleClick} + > + ${statusIcon} + <span class="teamname">${teamName}</span> + ${overdueIcon} + </sl-button> + `}};__decorate$S([n$5({type:Object})],ChromedashGateChip.prototype,"feature",void 0),__decorate$S([n$5({type:Object})],ChromedashGateChip.prototype,"stage",void 0),__decorate$S([n$5({type:Object})],ChromedashGateChip.prototype,"gate",void 0),__decorate$S([n$5({type:Number})],ChromedashGateChip.prototype,"selectedGateId",void 0),ChromedashGateChip=__decorate$S([t$3("chromedash-gate-chip")],ChromedashGateChip);var __decorate$R=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashWPTEvalButton=class ChromedashWPTEvalButton extends i$4{constructor(){super(...arguments),this.featureId=0}static{this.styles=i$7` + :host { + display: inline-block; + } + + .gemini-icon { + width: 1.5em; + height: 1.5em; + transform-origin: center center; + transition: transform 0.7s ease-in-out; + } + + sl-button:hover .gemini-icon { + transform: rotate(360deg); + } + `}render(){return x$1` + <sl-button href="/feature/${this.featureId}/ai-coverage-evaluation"> + <img + slot="prefix" + class="gemini-icon" + src="https://www.gstatic.com/images/branding/productlogos/gemini_2025/v1/192px.svg" + alt="Gemini AI Logo" + /> + Evaluate test coverage + </sl-button> + `}};__decorate$R([n$5({type:Number})],ChromedashWPTEvalButton.prototype,"featureId",void 0),ChromedashWPTEvalButton=__decorate$R([t$3("chromedash-wpt-eval-button")],ChromedashWPTEvalButton);var __decorate$Q=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const DETAILS_STYLES=[i$7` + sl-details { + border: var(--card-border); + box-shadow: var(--card-box-shadow); + margin: var(--content-padding-half); + border-radius: 4px; + background: var(--card-background); + } + sl-details::part(base), + sl-details::part(header) { + background: transparent; + } + sl-details::part(header) { + padding-bottom: 8px; + } + + .card { + background: var(--card-background); + max-width: var(--max-content-width); + padding: 16px; + } + `],LONG_TEXT=60;class ChromedashFeatureDetail extends i$4{constructor(){super(...arguments),this.appTitle="",this.canEdit=!1,this.selectedGateId=0,this.anyCollapsed=!0,this.openStage=0,this.previousStageTypeRendered=0,this.sameTypeRendered=0}static get styles(){const ICON_WIDTH=18,GAP=10,CONTENT_PADDING=16;return[...SHARED_STYLES,...DETAILS_STYLES,i$7` + :host { + display: block; + position: relative; + box-sizing: border-box; + contain: content; + overflow: hidden; + background: inherit; + } + + h2 { + margin-top: var(--content-padding); + display: flex; + } + h2 span { + flex: 1; + } + + .description, + .gates { + padding: 8px 16px; + } + + sl-details sl-button, + sl-details sl-dropdown { + float: right; + margin-right: 4px; + } + sl-details sl-dropdown sl-icon-button { + font-size: 1.4rem; + } + + sl-details sl-button[variant='default']::part(base) { + color: var(--sl-color-primary-600); + border: 1px solid var(--sl-color-primary-600); + } + + dl { + padding: 0 var(--content-padding-half); + } + + dt { + font-weight: 500; + display: flex; + gap: ${GAP}px; + align-items: center; + } + dt sl-icon { + color: var(--gate-approved-color); + font-size: 1.3em; + } + + dd { + padding: var(--content-padding-half); + padding-left: ${18+GAP+CONTENT_PADDING}px; + padding-bottom: var(--content-padding-large); + } + + .inline-list { + display: inline-block; + padding: 0; + } + + .longtext { + display: block; + white-space: pre-wrap; + } + + .longurl { + display: block; + padding: var(--content-padding-half); + } + + #new-stage { + margin-left: 8px; + margin-bottom: 4px; + } + + #footnote { + margin-left: 8px; + margin-bottom: 4px; + margin-top: 4px; + } + `]}_fireEvent(eventName,detail){const event=new CustomEvent(eventName,{bubbles:!0,composed:!0,detail});this.dispatchEvent(event)}connectedCallback(){super.connectedCallback(),this.intializeGateColumn()}initializeExtensionDialog(rawQuery){if(!("initiateExtension"in rawQuery))return;const gateId=parseInt(rawQuery.gate),extensionGate=this.gates.find(g=>g.id===gateId);if(!extensionGate||!GATE_APPROVED_REVIEW_STATES.includes(extensionGate.state))return;let extensionStage;for(const stage of this.feature.stages){const foundStage=stage.extensions.find(s=>s.id===extensionGate.stage_id);if(foundStage){extensionStage=foundStage;break}}extensionStage&&extensionStage.ot_action_requested&&openFinalizeExtensionDialog(this.feature.id,extensionStage,extensionStage.desktop_last,dialogTypes.FINALIZE_EXTENSION)}intializeGateColumn(){const rawQuery=parseRawQuery(window.location.search);if(!rawQuery.hasOwnProperty("gate"))return;const gateVal=+rawQuery.gate,foundGates=this.gates.filter(g=>g.id==gateVal);if(!foundGates.length)return;const gate=foundGates[0],foundStages=this.feature.stages.filter(s=>s.id===gate.stage_id||s.extensions.some(e=>e.id===gate.stage_id));if(!foundStages.length)return;let stage=foundStages[0];this.openStage=stage.id,gate.gate_type===GATE_TYPES.API_EXTEND_ORIGIN_TRIAL&&(stage=stage.extensions.find(e=>e.id===gate.stage_id)),this._fireEvent("show-gate-column",{feature:this.feature,stage:stage,gate:gate}),this.initializeExtensionDialog(rawQuery)}isAnyCollapsed(){const sections=this.renderRoot.querySelectorAll(".stage"),open=this.renderRoot.querySelectorAll(".stage[open]");return open.length<sections.length}updateCollapsed(){this.anyCollapsed=this.isAnyCollapsed()}toggleAll(){const shouldOpen=this.anyCollapsed;this.renderRoot.querySelectorAll(".stage").forEach(el=>{el.open=shouldOpen})}handleAddXfnGates(feStage){const prompt="Would you like to add gates for Privacy, Security, etc.? \n\nThis is needed if the API Owners ask you to add them, or if you send an \"Intent to Ship\" rather than a PSA.";confirm("Would you like to add gates for Privacy, Security, etc.? \n\nThis is needed if the API Owners ask you to add them, or if you send an \"Intent to Ship\" rather than a PSA.")&&window.csClient.addXfnGates(feStage.feature_id,feStage.id).then(()=>{this._fireEvent("refetch-needed",{})})}renderControls(){const editAllButton=x$1` + <sl-button variant="text" href="/guide/editall/${this.feature.id}"> + Edit all fields + </sl-button> + `,toggleLabel=this.anyCollapsed?"Expand all":"Collapse all";return x$1` + <!-- Enterprise features don't provide spec URLs or Web Platform Tests info. --> + ${this.canEdit&&this.feature.feature_type_int!==FEATURE_TYPES.FEATURE_TYPE_ENTERPRISE_ID[0]?E$1:E$1} + ${this.canEdit?editAllButton:E$1} + <sl-button + variant="text" + title="Expand or collapse all sections" + @click=${this.toggleAll} + > + ${toggleLabel} + </sl-button> + `}renderText(value,isMarkdown=!1){value=value+"";const markup=autolink(value,this.featureLinks,isMarkdown);return isMarkdown?x$1`${markup}`:value.length>LONG_TEXT||value.includes("\n")?x$1`<span class="longtext">${markup}</span>`:x$1`<span class="text">${markup}</span>`}renderUrl(value){return value.startsWith("http")?x$1`<chromedash-link + href=${value} + class="url ${value.length>LONG_TEXT?"longurl":""}" + .featureLinks=${this.featureLinks} + ></chromedash-link>`:this.renderText(value)}renderValue(fieldType,value,isMarkdown){if("checkbox"==fieldType)return this.renderText(value?"True":"False");return"url"==fieldType?this.renderUrl(value):"multi-url"==fieldType?x$1` + <ul class="inline-list"> + ${value.map(url=>x$1`<li>${this.renderUrl(url)}</li>`)} + </ul> + `:this.renderText(value,isMarkdown)}renderField(fieldDef,feStage){const[fieldId,fieldDisplayName,fieldType,deprecated,alwaysMarkdown]=fieldDef,value=getFieldValueFromFeature(fieldId,feStage,this.feature),isDefined=isDefinedValue(value);if(!isDefined&&deprecated)return E$1;const isMarkdown=(this.feature.markdown_fields||[]).includes(fieldId)||alwaysMarkdown,icon=isDefined?x$1`<sl-icon library="material" name="check_circle_20px"></sl-icon>`:x$1`<sl-icon library="material" name="blank_20px"></sl-icon>`;return x$1` + <dt id=${fieldId}>${icon} ${fieldDisplayName}</dt> + <dd> + ${isDefined?this.renderValue(fieldType,value,isMarkdown):x$1`<i>No information provided yet</i>`} + </dd> + `}stageHasAnyFilledFields(fields,feStage){return fields.some(fieldDef=>hasFieldValue(fieldDef[0],feStage,this.feature))}renderExtensionFields(extensionStages){const extensionFields=[],fieldNames=flattenSections(FLAT_TRIAL_EXTENSION_FIELDS),fields=makeDisplaySpecs(fieldNames);return extensionStages.forEach((extensionStage,i)=>{this.stageHasAnyFilledFields(fields,extensionStage)&&extensionFields.push(x$1` + <div> + <h3>Trial extension ${0===i?E$1:i+1}</h3> + <br /> + ${fields.map(fieldDef=>this.renderField(fieldDef,extensionStage))} + </div> + `)}),extensionFields}renderSectionFields(fields,feStage){if(this.stageHasAnyFilledFields(fields,feStage)){const extensionFields=feStage.extensions?this.renderExtensionFields(feStage.extensions):[];return x$1` <dl> + ${fields.map(fieldDef=>this.renderField(fieldDef,feStage))} + ${extensionFields} + </dl>`}return x$1`<p>No relevant fields have been filled in.</p>`}renderSection(summary,content,isActive=!1,defaultOpen=!1,isStage=!0){return x$1` + <sl-details + summary=${summary} + @sl-after-show=${this.updateCollapsed} + @sl-after-hide=${this.updateCollapsed} + ?open=${isActive||defaultOpen} + class="${isStage?"stage":""}" + > + ${content} + </sl-details> + `}getStageForm(stageType){return FORMS_BY_STAGE_TYPE[stageType]||null}renderMetadataSection(){const fieldNames=flattenSections(this.feature.is_enterprise_feature?FLAT_ENTERPRISE_METADATA_FIELDS:FLAT_METADATA_FIELDS);if(fieldNames===void 0||0===fieldNames.length)return E$1;const fields=makeDisplaySpecs(fieldNames),editButton=x$1` + <sl-button + size="small" + style="float:right" + href="/guide/stage/${this.feature.id}/metadata" + >Edit fields</sl-button + > + `,content=x$1` + <p class="description">${this.canEdit?editButton:E$1}</p> + <section class="card">${this.renderSectionFields(fields,{})}</section> + `;return this.renderSection("Metadata",content,!1,this.feature.is_enterprise_feature,!1)}renderGateChip(feStage,gate){return x$1` + <chromedash-gate-chip + .feature=${this.feature} + .stage=${feStage} + .gate=${gate} + selectedGateId=${this.selectedGateId} + > + </chromedash-gate-chip> + `}hasActiveGates(feStage){const gatesForStage=this.gates.filter(g=>g.stage_id==feStage.id);return gatesForStage.some(g=>GATE_ACTIVE_REVIEW_STATES.includes(g.state))}hasMixedGates(feStage){const gatesForStage=this.gates.filter(g=>g.stage_id==feStage.id);return gatesForStage.some(g=>GATE_FINISHED_REVIEW_STATES.includes(g.state))&&gatesForStage.some(g=>GATE_PREPARING==g.state)}renderGateChips(feStage){const gatesForStage=this.gates.filter(g=>(this.feature.feature_type_int!==FEATURE_TYPES.FEATURE_TYPE_CODE_CHANGE_ID[0]||g.gate_type!==GATE_TYPES.API_SHIP)&&g.stage_id===feStage.id);return gatesForStage.sort((g1,g2)=>GATE_TEAM_ORDER.indexOf(g1.team_name)-GATE_TEAM_ORDER.indexOf(g2.team_name)),gatesForStage.map(g=>this.renderGateChip(feStage,g))}hasStageActions(stage,feStage){if(0<stage?.actions?.length&&this.feature.feature_type_int===FEATURE_TYPES.FEATURE_TYPE_CODE_CHANGE_ID[0])return!0;const hasOwnersGate=this.gates.some(g=>"API Owners"===g.team_name&&g.stage_id===feStage.id);return!(!(0<stage?.actions?.length)||hasOwnersGate)}renderStageAction(action,stage,feStage){const label=action.name,url=action.url.replace("{feature_id}",this.feature.id).replace("{stage_id}",feStage.id).replace("{gate_id}","0"),gatesForStage=this.gates.filter(g=>g.stage_id==feStage.id),checkCompletion=()=>{if(somePendingPrereqs(action,this.progress)||somePendingGates(gatesForStage,feStage))return void openPreflightDialog(this.feature,this.progress,this.process,action,stage,feStage,gatesForStage,url);else{const draftWindow=window.open(url,"_blank");draftWindow?.focus()}};return x$1` + <sl-button size="small" @click=${checkCompletion}>${label}</sl-button> + `}renderStageActions(stage,feStage){return this.canEdit?x$1` + ${stage.actions.map(act=>this.renderStageAction(act,stage,feStage))} + `:E$1}renderProcessStage(feStage){const stageForm=this.getStageForm(feStage.stage_type),fieldNames=null===stageForm?[]:flattenSections(stageForm);if(fieldNames===void 0||0==fieldNames.length)return E$1;const fields=makeDisplaySpecs(fieldNames),processStage=findProcessStage(feStage,this.process);if(!processStage)return E$1;let numberDifferentiation="";this.previousStageTypeRendered===feStage.stage_type?(this.sameTypeRendered+=1,numberDifferentiation=` ${this.sameTypeRendered}`):(this.previousStageTypeRendered=feStage.stage_type,this.sameTypeRendered=1);let name=`${processStage.name}${numberDifferentiation}`;feStage.display_name&&(name=`${processStage.name}: ${feStage.display_name}`);const isActive=this.feature.active_stage_id===feStage.id,stageMenu=this.renderStageMenu(feStage),addExtensionButton=this.renderExtensionButton(feStage),editButton=this.renderEditButton(feStage,processStage),trialButton=this.renderOriginTrialButton(feStage),registrantsDashboardButton=this.renderRegistrantsDashboardButton(feStage),extensionGateChips=feStage.extensions?.map(extension=>x$1` <div class="gates"> + ${STAGE_SHORT_NAMES[extension.stage_type]}: + ${this.renderGateChips(extension)} + </div>`);let gatesPrefix="";0<extensionGateChips.length&&(gatesPrefix=`${STAGE_SHORT_NAMES[feStage.stage_type]}: `);const content=x$1` + <p class="description"> + ${stageMenu} ${trialButton} ${registrantsDashboardButton} + ${this.hasStageActions(processStage,feStage)?this.renderStageActions(processStage,feStage):E$1} + ${editButton} ${addExtensionButton} ${processStage.description} + </p> + <div class="gates">${gatesPrefix}${this.renderGateChips(feStage)}</div> + ${extensionGateChips} + <section class="card"> + ${this.renderSectionFields(fields,feStage)} + </section> + `,defaultOpen=this.feature.is_enterprise_feature||feStage.id==this.openStage||this.hasActiveGates(feStage)||this.hasMixedGates(feStage);return this.renderSection(name,content,isActive,defaultOpen)}renderEditButton(feStage,processStage){return this.canEdit?x$1` <sl-button + size="small" + href="/guide/stage/${this.feature.id}/${processStage.outgoing_stage}/${feStage.id}" + >Edit fields</sl-button + >`:E$1}renderFinalizeExtensionButton(extensionStage){return x$1` <sl-button + size="small" + variant="primary" + @click=${()=>openFinalizeExtensionDialog(this.feature.id,extensionStage,extensionStage.desktop_last,dialogTypes.FINALIZE_EXTENSION)} + >Finalize Extension</sl-button + >`}renderDisabledExtensionButton(){const tooltipText="A pending extension request exists. Follow the process for obtaining extension approval, or contact origin-trials-support@google.com for help.";return x$1` <sl-tooltip content=${"A pending extension request exists. Follow the process for obtaining extension approval, or contact origin-trials-support@google.com for help."}> + <sl-button size="small" disabled>Trial Extension Pending</sl-button> + </sl-tooltip>`}renderExtensionButton(feStage){const userCannotViewOTControls=!this.user||!this.user.email.endsWith("@chromium.org")&&!this.user.email.endsWith("@google.com"),isNotOriginTrialStage=!STAGE_TYPES_ORIGIN_TRIAL.has(feStage.stage_type),originTrialNotCreatedYet=!feStage.origin_trial_id;if(userCannotViewOTControls||isNotOriginTrialStage||originTrialNotCreatedYet)return E$1;const extensionReadyForFinalize=feStage.extensions.find(e=>{const extensionGate=this.gates.find(g=>g.stage_id===e.id);return e.ot_action_requested&&extensionGate&&GATE_APPROVED_REVIEW_STATES.includes(extensionGate.state)});if(extensionReadyForFinalize)return this.renderFinalizeExtensionButton(extensionReadyForFinalize);const extensionInProgress=feStage.extensions&&feStage.extensions.some(e=>e.ot_action_requested);if(extensionInProgress)return this.renderDisabledExtensionButton();let extensionButtonText="Request a trial extension";feStage.extensions&&0<feStage.extensions.length&&(extensionButtonText="Request another trial extension");const stageId=feStage.id;return x$1` <sl-button + size="small" + @click=${()=>location.assign(`/ot_extension_request/${this.feature.id}/${stageId}`)} + >${extensionButtonText}</sl-button + >`}renderOriginTrialButton(feStage){if(!STAGE_TYPES_ORIGIN_TRIAL.has(feStage.stage_type))return E$1;if(feStage.origin_trial_id){let originTrialsURL=`https://origintrials-staging.corp.google.com/origintrials/#/view_trial/${feStage.origin_trial_id}`;return"Chrome Platform Status"===this.appTitle&&(originTrialsURL=`https://developer.chrome.com/origintrials/#/view_trial/${feStage.origin_trial_id}`),x$1` <sl-button + size="small" + variant="primary" + href=${originTrialsURL} + target="_blank" + >View Origin Trial</sl-button + >`}const canSeeOTControls=this.user&&(this.user.email.endsWith("@chromium.org")||this.user.email.endsWith("@google.com"));if(!canSeeOTControls)return E$1;const trialIsApproved=this.gates.every(g=>g.stage_id!==feStage.id||GATE_APPROVED_REVIEW_STATES.includes(g.state));if(feStage.ot_setup_status&&feStage.ot_setup_status!==OT_SETUP_STATUS_OPTIONS.OT_NOT_CREATED)return x$1` <sl-tooltip + content="Action already requested. For further inquiries, contact origin-trials-support@google.com." + > + <sl-button size="small" variant="primary" disabled + >Request Trial Creation</sl-button + > + </sl-tooltip>`;return trialIsApproved?x$1` <sl-button + size="small" + variant="primary" + @click="${()=>openPrereqsDialog(this.feature.id,feStage,dialogTypes.CREATION)}" + >Request Trial Creation</sl-button + >`:x$1` <sl-tooltip + content="Approvals must be obtained before submission. For questions, contact origin-trials-support@google.com." + > + <sl-button size="small" variant="primary" disabled + >Request Trial Creation</sl-button + > + </sl-tooltip>`}renderRegistrantsDashboardButton(feStage){return STAGE_TYPES_ORIGIN_TRIAL.has(feStage.stage_type)&&this.canEdit&&feStage.origin_trial_id?this.user&&(this.user.email.endsWith("@chromium.org")||this.user.email.endsWith("@google.com"))?x$1` <sl-button + size="small" + style="float:right" + href="http://go/ot-registrants-dashboard?f=trial_id:in:${feStage.origin_trial_id}" + >Registrant data</sl-button + >`:E$1:E$1}offerAddXfnGates(feStage){const stageGates=this.gates.filter(g=>g.stage_id==feStage.id);return feStage.stage_type==STAGE_PSA_SHIPPING&&6>stageGates.length}renderFootnote(){return x$1` + <section id="footnote"> + Please see the + <a + href="https://www.chromium.org/blink/launching-features" + target="_blank" + rel="noopener" + > + Launching features + </a> + page for process instructions. + </section> + `}renderStageMenu(feStage){const items=[];return this.offerAddXfnGates(feStage)&&items.push(x$1` + <sl-menu-item @click=${()=>this.handleAddXfnGates(feStage)}> + Add cross-functional gates + </sl-menu-item> + `),0===items.length?E$1:x$1` + <sl-dropdown> + <sl-icon-button + library="material" + name="more_vert_24px" + label="Stage menu" + slot="trigger" + ></sl-icon-button> + <sl-menu>${items}</sl-menu> + </sl-dropdown> + `}renderAddStageButton(){if(!this.canEdit)return E$1;const text=this.feature.is_enterprise_feature?"Add Step":"Add Stage";return x$1` <sl-button + id="new-stage" + size="small" + @click="${()=>openAddStageDialog(this.feature.id,this.feature.feature_type_int)}" + > + ${text} + </sl-button>`}renderSectionHeader(){const text=this.feature.is_enterprise_feature?"Rollout steps":"Development stages";return x$1` <span + >${text} + <sl-icon-button + name="info-circle" + href="https://www.chromium.org/blink/launching-features" + style="font-size: 0.8rem;" + target="_blank" + label="Launching feature guide" + > + </sl-icon-button> + </span>`}render(){return x$1` + ${this.renderMetadataSection()} + <h2>${this.renderSectionHeader()} ${this.renderControls()}</h2> + ${this.feature.stages.map(feStage=>this.renderProcessStage(feStage))} + ${this.renderAddStageButton()} ${this.renderFootnote()} + `}}__decorate$Q([n$5({type:String})],ChromedashFeatureDetail.prototype,"appTitle",void 0),__decorate$Q([n$5({attribute:!1})],ChromedashFeatureDetail.prototype,"featureLinks",void 0),__decorate$Q([n$5({attribute:!1})],ChromedashFeatureDetail.prototype,"user",void 0),__decorate$Q([n$5({type:Boolean})],ChromedashFeatureDetail.prototype,"canEdit",void 0),__decorate$Q([n$5({attribute:!1})],ChromedashFeatureDetail.prototype,"feature",void 0),__decorate$Q([n$5({attribute:!1})],ChromedashFeatureDetail.prototype,"gates",void 0),__decorate$Q([n$5({attribute:!1})],ChromedashFeatureDetail.prototype,"process",void 0),__decorate$Q([n$5({attribute:!1})],ChromedashFeatureDetail.prototype,"progress",void 0),__decorate$Q([n$5({type:Number})],ChromedashFeatureDetail.prototype,"selectedGateId",void 0),__decorate$Q([r$6()],ChromedashFeatureDetail.prototype,"anyCollapsed",void 0),__decorate$Q([r$6()],ChromedashFeatureDetail.prototype,"openStage",void 0),__decorate$Q([r$6()],ChromedashFeatureDetail.prototype,"previousStageTypeRendered",void 0),__decorate$Q([r$6()],ChromedashFeatureDetail.prototype,"sameTypeRendered",void 0),customElements.define("chromedash-feature-detail",ChromedashFeatureDetail);var __decorate$P=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashGantt=class ChromedashGantt extends i$4{static get styles(){return[...SHARED_STYLES,i$7` + :host { + width: 600px; + } + ul { + padding: 0; + } + + label { + display: block; + font-weight: 500; + margin-right: 5px; + padding-top: var(--content-padding); + } + + .platform-row { + margin: var(--content-padding) 0; + list-style: none; + } + + .platform { + display: inline-block; + padding-top: 7px; + vertical-align: top; + width: 100px; + } + + /* On small displays, show milestones as a bullet list. */ + .chart li { + margin-left: var(--content-padding); + } + + .empty { + display: none; + } + + /* On large displays, show milestones as a gantt chart. */ + @media only screen and (min-width: 701px) { + .chart { + display: inline-grid; + grid-auto-columns: 50px; + grid-auto-rows: 30px; + gap: 2px; + } + + .chart li { + list-style: none; + margin-left: 0; + height: 30px; + overflow: visible; + white-space: nowrap; + padding: 4px; + line-height: 22px; + } + + .empty { + display: block; + background: #eee; + } + + .chart .dev_trial { + background: #cfe2f3ff; + } + + .chart .origin_trial { + background: #6fa8dcff; + } + + .chart .shipping { + background: #0b5394ff; + color: white; + } + } + `]}_isInactive(){const status=this.feature.browsers.chrome.status.text;return"No active development"===status||"On hold"===status||"No longer pursuing"===status}renderChartRow(gridRow,first,last,sortedMilestones,cssClass,label){var _Mathmax4=Math.max;const cellsOnRow=[];for(let col=0;col<sortedMilestones.length;col++){const m=sortedMilestones[col];(m<first||m>last)&&cellsOnRow.push(x$1` + <li + style="grid-row: ${gridRow}; + grid-column: ${col+1}" + class="empty" + ></li> + `)}const firstCol=sortedMilestones.indexOf(first),lastCol=sortedMilestones.indexOf(last),span=_Mathmax4(0,lastCol-firstCol)+1;return cellsOnRow.push(x$1` + <li + style="grid-row: ${gridRow}; + grid-column: ${firstCol+1} / span ${span}" + class="${cssClass}" + > + ${label} + </li> + `),cellsOnRow}getByStageType(){const dtStages=[],otStages=[],shipStages=[];for(const stage of this.feature.stages)STAGE_TYPES_DEV_TRIAL.has(stage.stage_type)?dtStages.push(stage):STAGE_TYPES_ORIGIN_TRIAL.has(stage.stage_type)?otStages.push(stage):STAGE_TYPES_SHIPPING.has(stage.stage_type)&&shipStages.push(stage);return[dtStages,otStages,shipStages]}renderPlatform(platform,platformParam,dtStages,otStages,shipStages,sortedMilestones){var _Mathmax5=Math.max;const dtStartMilestones=dtStages.map(s=>s[`${platformParam}_first`]),otStartMilestones=otStages.map(s=>s[`${platformParam}_first`]),otEndMilestones=otStages.map(s=>{let maxEnd=s[`${platformParam}_last`];for(const e of s.extensions)e.desktop_last&&!maxEnd?maxEnd=e.desktop_last:e.desktop_last&&maxEnd&&(maxEnd=_Mathmax5(maxEnd,e.desktop_last));return maxEnd}),shipStartMilestones=shipStages.map(s=>s[`${platformParam}_first`]);if(0===dtStartMilestones.length&&0===otStartMilestones.length&&0===shipStartMilestones.length)return E$1;const maxMilestone=_Mathmax5(...sortedMilestones);let currentRow=1;const validShipMilestones=shipStartMilestones.filter(x=>x),dtChartRows=[];for(const dtMilestone of dtStartMilestones){if(!dtMilestone)continue;let devTrialMilestoneLast=maxMilestone;if(0<validShipMilestones.length){const shippingIndex=sortedMilestones.indexOf(Math.min(...validShipMilestones));devTrialMilestoneLast=sortedMilestones[shippingIndex-1]}dtChartRows.push(this.renderChartRow(currentRow,dtMilestone,devTrialMilestoneLast,sortedMilestones,"dev_trial","Dev Trial: "+dtMilestone)),currentRow++}const otChartRows=[];for(let i=0;i<otStartMilestones.length;i++){const otStartMilestone=otStartMilestones[i],otEndMilestone=otEndMilestones[i];otStartMilestone&&otEndMilestone&&(otChartRows.push(this.renderChartRow(currentRow,otStartMilestone,otEndMilestone,sortedMilestones,"origin_trial",`Origin Trial: ${otStartMilestone} to ${otEndMilestone}`)),currentRow++)}const shipChartRows=[];for(const shipMilestone of shipStartMilestones)shipMilestone&&(shipChartRows.push(this.renderChartRow(currentRow,shipMilestone,maxMilestone,sortedMilestones,"shipping",`Shipping: ${shipMilestone}`)),currentRow++);return x$1` + <li class="platform-row"> + <div class="platform">${platform}</div> + + <ul class="chart" id="${platformParam}-chart"> + ${dtChartRows} ${otChartRows} ${shipChartRows} + </ul> + </li> + `}concatAllMilestones(allMilestones,stage){return stage?allMilestones.concat([stage.desktop_first,stage.desktop_last,stage.android_first,stage.android_last,stage.ios_first,stage.ios_last,stage.webview_first,stage.webview_last]):allMilestones}render(){var _Mathmin3=Math.min,_Mathmax6=Math.max;if(!this.feature||this._isInactive())return E$1;const[dtStages,otStages,shipStages]=this.getByStageType();let allMilestones=[];for(const stage of[...dtStages,...otStages,...shipStages]){if(stage.extensions)for(const extension of stage.extensions)allMilestones=this.concatAllMilestones(allMilestones,extension);allMilestones=this.concatAllMilestones(allMilestones,stage)}if(allMilestones=allMilestones.filter(x=>x),0==allMilestones.length)return x$1`<p>No milestones specified</p>`;const allValidMilestones=allMilestones.filter(x=>void 0!==x),minMilestone=_Mathmin3(...allValidMilestones),maxMilestone=_Mathmax6(...allValidMilestones),milestoneRange=maxMilestone-minMilestone+1+1;let sortedMilestones;if(12>=milestoneRange)sortedMilestones=Array(milestoneRange).fill(minMilestone).map((x,y)=>x+y);else{const augmentedMilestoneSet=new Set(allValidMilestones);for(const m of allValidMilestones)augmentedMilestoneSet.add(m+1);if(sortedMilestones=Array.from(augmentedMilestoneSet).sort((a,b)=>a-b),12<sortedMilestones.length){const milestoneSet=new Set(allValidMilestones);sortedMilestones=Array.from(milestoneSet).sort((a,b)=>a-b),sortedMilestones.push(maxMilestone+1)}}return x$1` + <label>Estimated milestones:</label> + <ul> + ${this.renderPlatform("Desktop","desktop",dtStages,otStages,shipStages,sortedMilestones)} + ${this.renderPlatform("Android","android",dtStages,otStages,shipStages,sortedMilestones)} + ${this.renderPlatform("iOS","ios",dtStages,otStages,shipStages,sortedMilestones)} + ${this.renderPlatform("Webview","webview",dtStages,otStages,shipStages,sortedMilestones)} + </ul> + `}};__decorate$P([n$5({type:Object})],ChromedashGantt.prototype,"feature",void 0),ChromedashGantt=__decorate$P([t$3("chromedash-gantt")],ChromedashGantt);var __decorate$O=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashVendorViews=class ChromedashVendorViews extends i$4{constructor(){super(...arguments),this.featureLinks=[]}urlIsStandardsPosition(url){return /github.com\/(mozilla|WebKit)\/standards-positions\/issues/.test(url)}render(){return this.href?x$1`<chromedash-link + href=${this.href} + ?showContentAsLabel=${!this.urlIsStandardsPosition(this.href)} + .featureLinks=${this.featureLinks} + ><slot></slot + ></chromedash-link>`:x$1`<slot></slot>`}};__decorate$O([n$5({type:String})],ChromedashVendorViews.prototype,"href",void 0),__decorate$O([n$5({attribute:!1})],ChromedashVendorViews.prototype,"featureLinks",void 0),ChromedashVendorViews=__decorate$O([t$3("chromedash-vendor-views")],ChromedashVendorViews);var __decorate$N=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashFeatureHighlights=class ChromedashFeatureHighlights extends i$4{constructor(){super(...arguments),this.feature={},this.featureLinks=[],this.canDeleteFeature=!1,this.canEditFeature=!1}static get styles(){return[...SHARED_STYLES,...DETAILS_STYLES,i$7` + section { + margin-bottom: 1em; + } + section h3 { + margin: 24px 0 12px; + } + section label { + font-weight: 500; + margin-right: 5px; + } + + #consensus li { + display: flex; + } + #consensus li label { + width: 125px; + } + + #history p { + margin-top: var(--content-padding-half); + } + + sl-dropdown { + float: right; + margin-right: -16px; + margin-top: -20px; + } + #archive-feature::part(base) { + color: var(--error-color); + } + .suspended { + background: var(--table-header-background); + } + `]}isSuspended(){return this.feature?.browsers.chrome.status.val===IMPLEMENTATION_STATUS.ON_HOLD[0]}handleArchiveFeature(){this.dispatchEvent(new Event("archive",{bubbles:!0,composed:!0}))}handleSuspend(){this.dispatchEvent(new Event("suspend",{bubbles:!0,composed:!0}))}handleResume(){this.dispatchEvent(new Event("resume",{bubbles:!0,composed:!0}))}renderSummary(){if(this.feature.summary){const isMarkdown=(this.feature.markdown_fields||[]).includes("summary"),markup=autolink(this.feature.summary,this.featureLinks,isMarkdown);return x$1` + <section id="summary"> + ${isMarkdown?markup:x$1`<p class="preformatted">${markup}</p>`} + </section> + `}return x$1``}renderEnterpriseFeatureContent(){return this.renderSummary()}renderFeatureContent(){return x$1` + ${this.renderSummary()} + ${this.feature.motivation?x$1` + <section id="motivation"> + <h3>Motivation</h3> + <!-- prettier-ignore --> + <p class="preformatted">${autolink(this.feature.motivation,this.featureLinks)}</p> + </section> + `:E$1} + ${this.feature.resources?.samples?.length?x$1` + <section id="demo"> + <h3>Demos and samples</h3> + <ul> + ${this.feature.resources.samples.map(sampleLink=>x$1` + <li>${enhanceUrl(sampleLink,this.featureLinks)}</li> + `)} + </ul> + </section> + `:E$1} + ${this.feature.resources?.docs?.length?x$1` + <section id="documentation"> + <h3>Documentation</h3> + <ul> + ${this.feature.resources.docs.map(docLink=>x$1` + <li>${enhanceUrl(docLink,this.featureLinks)}</li> + `)} + </ul> + </section> + `:E$1} + ${this.feature.standards.spec?x$1` + <section id="specification"> + <h3>Specification</h3> + <p> + ${enhanceUrl(this.feature.standards.spec,this.featureLinks)} + </p> + <p>Spec status: ${this.feature.standards.maturity.text}</p> + </section> + `:this.feature.explainer_links?.length?x$1` + <section id="specification"> + <h3>Explainer(s)</h3> + <ul> + ${this.feature.explainer_links?.map(link=>x$1`<li>${enhanceUrl(link,this.featureLinks)}</li>`)} + </ul> + </section> + `:E$1} + `}renderEnterpriseFeatureStatus(){return x$1` + ${this.feature.browsers.chrome.owners?x$1` + <section id="owner"> + <h3> + ${1==this.feature.browsers.chrome.owners.length?"Owner":"Owners"} + </h3> + <ul> + ${this.feature.browsers.chrome.owners.map(owner=>x$1` + <li><a href="mailto:${owner}">${owner}</a></li> + `)} + </ul> + </section> + `:E$1} + `}renderFeatureStatus(){return x$1` + <section id="status"> + <h3>Status in Chromium</h3> + <p> + ${this.isSuspended()?x$1` <label>Implementation status:</label> + <b>Development work is on hold</b>`:E$1} + ${this.feature.browsers.chrome.bug?x$1`<chromedash-link + href=${this.feature.browsers.chrome.bug} + .featureLinks=${this.featureLinks} + alwaysInTag + >tracking bug</chromedash-link + >`:E$1} + <chromedash-gantt .feature=${this.feature}></chromedash-gantt> + </p> + </section> + + <section id="consensus"> + <h3>Consensus & Standardization</h3> + <div style="font-size:smaller;"> + After a feature ships in Chrome, the values listed here are not + guaranteed to be up to date. + </div> + <br /> + <ul> + ${this.feature.browsers.ff.view.val?x$1` + <li> + <label>Firefox:</label> + <chromedash-vendor-views + href=${this.feature.browsers.ff.view.url||E$1} + .featureLinks=${this.featureLinks} + >${this.feature.browsers.ff.view.text}</chromedash-vendor-views + > + </li> + `:E$1} + ${this.feature.browsers.safari.view.val?x$1` + <li> + <label>WebKit:</label> + <chromedash-vendor-views + href=${this.feature.browsers.safari.view.url||E$1} + .featureLinks=${this.featureLinks} + >${this.feature.browsers.safari.view.text}</chromedash-vendor-views + > + </li> + `:E$1} + <li> + <label>Web Developers:</label> ${this.feature.browsers.webdev.view.text} + </li> + </ul> + </section> + + ${this.feature.browsers.chrome.owners?x$1` + <section id="owner"> + <h3> + ${1==this.feature.browsers.chrome.owners.length?"Owner":"Owners"} + </h3> + <ul> + ${this.feature.browsers.chrome.owners.map(owner=>x$1` + <li><a href="mailto:${owner}">${owner}</a></li> + `)} + </ul> + </section> + `:E$1} + ${this.feature.intent_to_implement_url?x$1` + <section id="intent_to_implement_url"> + <h3>Intent to Prototype url</h3> + <a href=${this.feature.intent_to_implement_url} + >Intent to Prototype thread</a + > + </section> + `:E$1} + ${this.feature.comments?x$1` + <section id="comments"> + <h3>Comments</h3> + <!-- prettier-ignore --> + <p class="preformatted">${autolink(this.feature.comments,this.featureLinks)}</p> + </section> + `:E$1} + <section id="metadata"> + <h3>Metadata</h3> + <p> + <label>Feature type:</label> + ${this.feature.feature_type} + </p> + <p> + <label>Web feature ID:</label> + ${this.feature.web_feature} + </p> + <p> + <label>Blink components:</label> + ${this.feature.browsers.chrome.blink_components.map(c=>x$1` + <a + href="https://issues.chromium.org/issues?q=customfield1222907:%22${c}%22" + target="_blank" + rel="noopener" + >${c}</a + > + `)} + </p> + ${this.feature.tags?.length?x$1` <p> + <label>Search tags:</label> + ${this.feature.tags.map(tag=>x$1` + <a href="/features?q=tag:${tag}">${tag}</a + ><span class="conditional-comma">, </span> + `)} + </p>`:E$1} + </section> + `}renderHistory(){return x$1` + <section id="history"> + <h3>History</h3> + <p> + Entry created on + ${renderAbsoluteDate(this.feature.created?.when,!0)} + ${renderRelativeDate(this.feature.created?.when)} + </p> + <p> + Last updated on + ${renderAbsoluteDate(this.feature.updated?.when,!0)} + ${renderRelativeDate(this.feature.updated?.when)} + </p> + + <p> + <a href="/feature/${this.feature.id}/activity"> + All comments & activity + </a> + </p> + </section> + `}renderDotDotDotMenu(){if(!this.canDeleteFeature&&!this.canEditFeature)return E$1;let archiveItem=x$1``,suspendItem=x$1``,resumeItem=x$1``;return this.canDeleteFeature&&(archiveItem=x$1` + <sl-menu-item id="archive-feature" @click=${this.handleArchiveFeature}> + Archive feature + </sl-menu-item> + `),this.canEditFeature&&(this.isSuspended()?resumeItem=x$1` + <sl-menu-item @click=${this.handleResume}> + Resume active development + </sl-menu-item> + `:suspendItem=x$1` + <sl-menu-item @click=${this.handleSuspend}> + Suspend development + </sl-menu-item> + `),x$1` + <sl-dropdown placement="left-start"> + <sl-icon-button + library="material" + name="more_vert_24px" + label="Feature menu" + style="font-size: 1.3rem;" + slot="trigger" + ></sl-icon-button> + <sl-menu> ${suspendItem} ${resumeItem} ${archiveItem} </sl-menu> + </sl-dropdown> + `}render(){return x$1` + <sl-details summary="Overview" ?open=${!0}> + <section class="card ${this.isSuspended()?"suspended":""}"> + ${this.renderDotDotDotMenu()} + ${this.feature.is_enterprise_featqcure?this.renderEnterpriseFeatureContent():this.renderFeatureContent()} + ${this.feature.is_enterprise_feature?this.renderEnterpriseFeatureStatus():this.renderFeatureStatus()} + ${this.renderHistory()} + </section> + </sl-details> + `}};__decorate$N([n$5({attribute:!1})],ChromedashFeatureHighlights.prototype,"feature",void 0),__decorate$N([n$5({attribute:!1})],ChromedashFeatureHighlights.prototype,"featureLinks",void 0),__decorate$N([n$5({type:Boolean})],ChromedashFeatureHighlights.prototype,"canDeleteFeature",void 0),__decorate$N([n$5({type:Boolean})],ChromedashFeatureHighlights.prototype,"canEditFeature",void 0),ChromedashFeatureHighlights=__decorate$N([t$3("chromedash-feature-highlights")],ChromedashFeatureHighlights);var __decorate$M=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const INACTIVE_STATES=["No longer pursuing","Deprecated","Removed"];let ChromedashFeaturePage=class ChromedashFeaturePage extends i$4{constructor(){super(...arguments),this.featureId=0,this.featureLinks=[],this.gates=[],this.comments=[],this.contextLink="",this.appTitle="",this.selectedGateId=0,this.starred=!1,this.loading=!0,this.currentDate=Date.now(),this.shippingInfo={closestShippingDate:"",hasShipped:!1,isUpcoming:!1}}static get styles(){return[...SHARED_STYLES,...DETAILS_STYLES,i$7` + #feature { + background: var(--card-background); + border-radius: var(--default-border-radius); + border: var(--card-border); + box-shadow: var(--card-box-shadow); + + box-sizing: border-box; + word-wrap: break-word; + margin-bottom: var(--content-padding); + max-width: var(--max-content-width); + } + #feature ul { + list-style-position: inside; + list-style: none; + } + section { + margin-bottom: 1em; + } + section h3 { + margin: 24px 0 12px; + } + section label { + font-weight: 500; + margin-right: 5px; + } + + sl-skeleton { + margin-bottom: 1em; + width: 60%; + } + + sl-skeleton:nth-of-type(even) { + width: 50%; + } + + h3 sl-skeleton { + width: 30%; + height: 1.5em; + } + + @media only screen and (max-width: 700px) { + #feature { + border-radius: 0 !important; + margin: 7px initial !important; + } + } + + @media only screen and (min-width: 701px) { + #feature { + padding: 30px 40px; + } + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}isFeatureLoaded(){return this.feature&&0!==Object.keys(this.feature).length}fetchData(){this.loading=!0,Promise.all([window.csClient.getFeature(this.featureId),window.csClient.getGates(this.featureId),window.csClient.getComments(this.featureId,null),window.csClient.getFeatureProcess(this.featureId),window.csClient.getStars(),window.csClient.getFeatureProgress(this.featureId),window.csClient.getChannels()]).then(async([feature,gatesRes,commentRes,process,starredFeatures,progress,channels])=>{this.feature=feature,this.gates=gatesRes.gates,this.comments=commentRes.comments,this.process=process,this.progress=progress,starredFeatures.includes(this.featureId)&&(this.starred=!0),this.feature.name&&(document.title=`${this.feature.name} - ${this.appTitle}`),this.shippingInfo=await findClosestShippingDate(channels,feature.stages),this.loading=!1}).catch(error=>{error instanceof FeatureNotFoundError?this.loading=!1:showToastMessage("Some errors occurred. Please refresh the page or try again later.")}),window.csClient.getFeatureLinks(this.featureId).then(featureLinks=>{this.featureLinks=featureLinks?.data||[],featureLinks?.has_stale_links&&setTimeout(this.refetchFeatureLinks.bind(this),1e4)})}async refetchFeatureLinks(){const featureLinks=await window.csClient.getFeatureLinks(this.featureId,!1);this.featureLinks=featureLinks?.data||[]}refetch(){Promise.all([window.csClient.getFeature(this.featureId),window.csClient.getGates(this.featureId),window.csClient.getComments(this.featureId,null)]).then(([feature,gatesRes,commentRes])=>{this.feature=feature,this.gates=gatesRes.gates,this.comments=commentRes.comments}).catch(error=>{error instanceof FeatureNotFoundError?this.loading=!1:showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}disconnectedCallback(){super.disconnectedCallback(),document.title=this.appTitle}handleStarClick(e){e.preventDefault(),window.csClient.setStar(this.featureId,!this.starred).then(()=>{this.starred=!this.starred})}handleShareClick(e){if(e.preventDefault(),navigator.share){const url="/feature/"+this.featureId;navigator.share({title:this.feature.name,text:this.feature.summary,url:url}).then(()=>{ga("send","social",{socialNetwork:"web",socialAction:"share",socialTarget:url})})}}handleCopyLinkClick(e){e.preventDefault();const url=e.currentTarget.href;navigator.clipboard.writeText(url).then(()=>{showToastMessage("Link copied")})}canDeleteFeature(){return this.user?.is_admin||userCanEdit(this.user,this.featureId)}handleArchiveFeature(){confirm("Archive feature? It will only be visible to users who can edit it")&&window.csClient.doDelete(`/features/${this.feature.id}`).then(resp=>{"Done"===resp.message&&(location.href="/features")})}handleSuspend(){if(confirm("Suspend development of this feature? It will not appear on the roadmap.")){const submitBody={feature_changes:{id:this.feature.id,impl_status_chrome:IMPLEMENTATION_STATUS.ON_HOLD[0]},stages:[],has_changes:!0};window.csClient.updateFeature(submitBody).then(resp=>{window.location.reload()})}}handleResume(){if(confirm("Resume active development of this feature? It will appear on the roadmap if it has milestones set.")){const submitBody={feature_changes:{id:this.feature.id,impl_status_chrome:IMPLEMENTATION_STATUS.PROPOSED[0]},stages:[],has_changes:!0};window.csClient.updateFeature(submitBody).then(resp=>{window.location.reload()})}}renderSkeletonSection(){return x$1` + <section> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}renderSkeletons(){return x$1` + <div id="feature" style="margin-top: 65px;"> + ${this.renderSkeletonSection()} ${this.renderSkeletonSection()} + ${this.renderSkeletonSection()} ${this.renderSkeletonSection()} + </div> + `}featureIsInactive(){const status=this.feature&&this.feature.browsers.chrome.status.text||"";return INACTIVE_STATES.includes(status)}pairedUserCanEdit(){return this.paired_user?.can_edit_all||this.paired_user?.editable_features.includes(this.featureId)}renderSubHeader(){const canShare="function"==typeof navigator.share;return x$1` + <div id="subheader" style="display:block"> + <div class="tooltips" style="float:right; font-size:1.1rem"> + ${this.user?x$1` + <span + class="tooltip" + title="Receive an email notification when there are updates" + > + <a + href="#" + data-tooltip + id="star-when-signed-in" + @click=${this.handleStarClick} + > + <sl-icon + name=${this.starred?"star-fill":"star"} + class="pushicon" + ></sl-icon> + </a> + </span> + `:E$1} + <span class="tooltip" title="File a bug against this feature"> + <a + href=${o$6(this.feature.new_crbug_url)} + class="newbug" + data-tooltip + target="_blank" + rel="noopener" + > + <sl-icon name="bug"></sl-icon> + </a> + </span> + <span + class="tooltip ${canShare?"":"no-web-share"}" + title="Share this feature" + > + <a + href="#" + data-tooltip + id="share-feature" + @click=${this.handleShareClick} + > + <sl-icon name="share"></sl-icon> + </a> + </span> + <span + class="tooltip copy-to-clipboard" + title="Copy link to clipboard" + > + <a + href="/feature/${this.featureId}" + data-tooltip + id="copy-link" + @click=${this.handleCopyLinkClick} + > + <sl-icon library="material" name="link"></sl-icon> + </a> + </span> + </div> + <h2 id="breadcrumbs"> + <a href="${this.contextLink}"> + <sl-icon name="arrow-left"></sl-icon> + </a> + <a href="/feature/${this.featureId}"> + Feature: ${this.feature.name} + </a> + ${this.featureIsInactive()?x$1`(${this.feature.browsers.chrome.status.text})`:E$1} + </h2> + </div> + `}renderWarnings(){const warnings=[];this.feature.deleted&&warnings.push(x$1` + <div id="archived" class="warning"> + This feature is archived. It does not appear in feature lists and is + only viewable by users who can edit it. + </div> + `),this.feature.unlisted&&warnings.push(x$1` + <div id="access" class="warning"> + This feature is only shown in the feature list to users with access to + edit this feature. + </div> + `);const canEdit=userCanEdit(this.user,this.featureId);!canEdit&&this.pairedUserCanEdit()&&warnings.push(x$1` + <div id="switch_to_edit" class="warning"> + User ${this.user.email} cannot edit this feature or request reviews. + But, ${this.paired_user.email} can do that. + <br /> + To switch users: sign out and then sign in again. + </div> + `),0==this.user?.approvable_gate_types.length&&0<this.paired_user?.approvable_gate_types.length&&warnings.push(x$1` + <div id="switch_to_review" class="warning"> + User ${this.user.email} cannot review this feature. But, + ${this.paired_user.email} can do that. + <br /> + To switch users: sign out and then sign in again. + </div> + `);const featureOutdatedBanner=getFeatureOutdatedBanner(this.feature,this.shippingInfo,this.currentDate,canEdit);return featureOutdatedBanner&&warnings.push(featureOutdatedBanner),warnings}renderFeatureDetails(){return x$1` + <chromedash-feature-detail + appTitle=${this.appTitle} + .user=${this.user} + ?canEdit=${userCanEdit(this.user,this.featureId)} + .feature=${this.feature} + .gates=${this.gates} + .comments=${this.comments} + .process=${this.process} + .progress=${this.progress} + .featureLinks=${this.featureLinks} + selectedGateId=${this.selectedGateId} + > + </chromedash-feature-detail> + `}render(){return this.loading?this.renderSkeletons():this.isFeatureLoaded()?x$1` + ${this.renderSubHeader()} ${this.renderWarnings()} + <chromedash-feature-highlights + .feature=${this.feature} + .featureLinks=${this.featureLinks} + ?canDeleteFeature=${this.canDeleteFeature()} + ?canEditFeature=${userCanEdit(this.user,this.featureId)} + @archive=${this.handleArchiveFeature} + @suspend=${this.handleSuspend} + @resume=${this.handleResume} + ></chromedash-feature-highlights> + ${this.renderFeatureDetails()} + `:x$1`Feature not found.`}};__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"user",void 0),__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"paired_user",void 0),__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"featureId",void 0),__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"feature",void 0),__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"featureLinks",void 0),__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"gates",void 0),__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"comments",void 0),__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"process",void 0),__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"progress",void 0),__decorate$M([n$5({attribute:!1})],ChromedashFeaturePage.prototype,"contextLink",void 0),__decorate$M([n$5({type:String})],ChromedashFeaturePage.prototype,"appTitle",void 0),__decorate$M([n$5({type:Number})],ChromedashFeaturePage.prototype,"selectedGateId",void 0),__decorate$M([r$6()],ChromedashFeaturePage.prototype,"starred",void 0),__decorate$M([r$6()],ChromedashFeaturePage.prototype,"loading",void 0),__decorate$M([r$6()],ChromedashFeaturePage.prototype,"currentDate",void 0),__decorate$M([r$6()],ChromedashFeaturePage.prototype,"shippingInfo",void 0),ChromedashFeaturePage=__decorate$M([t$3("chromedash-feature-page")],ChromedashFeaturePage);var __decorate$L=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashFooter=class ChromedashFooter extends i$4{static get styles(){return[...SHARED_STYLES,i$7` + footer { + background: var(--page-background); + box-shadow: 0 -2px 5px var(--shadow-color); + display: flex; + flex-direction: column; + justify-content: center; + text-align: center; + align-items: center; + padding: var(--content-padding-half); + position: relative; /* Ensure the z-index has an effect so the box-shadow appears. */ + z-index: 800; + } + + footer div > * + * { + margin-left: var(--content-padding); + padding-left: var(--content-padding); + } + + #footer-spacer { + display: none; + height: calc(28px + var(--content-padding-half)); + } + + @media only screen and (min-width: 601px) and (min-height: 601px) { + footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + } + + #footer-spacer { + display: block; + } + } + `]}render(){return x$1` + <div id="footer-spacer"></div> + <footer> + <div> + <a + href="https://github.com/GoogleChrome/chromium-dashboard/wiki/" + target="_blank" + rel="noopener" + >Help</a + > + <a + href="https://groups.google.com/a/chromium.org/forum/#!newtopic/blink-dev" + target="_blank" + rel="noopener" + >Discuss</a + > + <a + href="https://github.com/GoogleChrome/chromium-dashboard/issues" + target="_blank" + rel="noopener" + >File an issue</a + > + <a + href="https://policies.google.com/privacy" + target="_blank" + rel="noopener" + >Privacy</a + > + </div> + </footer> + `}};ChromedashFooter=__decorate$L([t$3("chromedash-footer")],ChromedashFooter);var __decorate$K=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const DEFAULT_PLACEHOLDER="https://...\nhttps://...",DEFAULT_SPLIT_PATTERN="\\s+";let ChromedashAttachments=class ChromedashAttachments extends i$4{constructor(){super(...arguments),this.textareaRef=e$1(),this.fileInputRef=e$1(),this.chromedash_single_pattern=URL_REGEX,this.chromedash_split_pattern=DEFAULT_SPLIT_PATTERN}createRenderRoot(){return this}validate(){this.textareaRef?.value?.validate&&this.textareaRef.value.validate()}handleFieldUpdated(e){let fieldValue=e.target.value;this.value=fieldValue,this.dispatchEvent(new CustomEvent("sl-change"))}handleFileSelected(e){let inputEl=e.target;if(inputEl.files?.[0]){const file=inputEl.files?.[0];window.csClient.addAttachment(this.featureId,inputEl.name,file).then(resp=>{this.value+="\n"+resp.attachment_url,this.dispatchEvent(new CustomEvent("sl-change"))})}}renderOneThumbnail(url){if(""==url)return E$1;const linkStyles={display:"inline-block",padding:"var(--content-padding-quarter)",margin:"var(--content-padding-half)",border:`2px solid var(--link-color)`,cursor:`zoom-in`},imgStyles={maxHeight:"150px",maxWidth:"200px"};var imgSrc=url;return url.includes("/feature/"+this.featureId+"/attachment/")&&(imgSrc+="/thumbnail"),x$1` + <a href=${url} target="_blank" style=${o$3(linkStyles)}> + <img style=${o$3(imgStyles)} src=${imgSrc}></img> + </a> + `}renderThumbnails(){if(!this.value?.length)return E$1;const items=this.value.split(new RegExp(this.chromedash_split_pattern));return items.map(url=>this.renderOneThumbnail(url))}renderUploadButton(){const buttonContainerStyles={display:"inline-block",margin:"var(--content-padding-half)"};return x$1` + <input + ${n$2(this.fileInputRef)} + id="file-field" + type="file" + name="screenshots" + @change=${e=>this.handleFileSelected(e)} + accept="image/png, image/jpeg, image/png, image/wepb, text/plain" + style="display:none" + /> + <div style=${o$3(buttonContainerStyles)}> + <sl-button + id="upload-button" + @click=${e=>this.fileInputRef?.value?.click()} + > + <sl-icon slot="prefix" name="upload"></sl-icon> + Upload image + </sl-button> + <div>Max size: 1MB</div> + </div> + `}render(){return x$1` + <chromedash-textarea + ${n$2(this.textareaRef)} + size="small" + name=${this.name} + value=${this.value} + multiple + placeholder=${DEFAULT_PLACEHOLDER} + pattern=${this.pattern} + chromedash_single_pattern=${this.chromedash_single_pattern} + chromedash_split_pattern=${this.chromedash_split_pattern} + @sl-change=${this.handleFieldUpdated} + @keyup=${this.handleFieldUpdated} + ></chromedash-textarea> + <div>${this.renderThumbnails()} ${this.renderUploadButton()}</div> + `}firstUpdated(){this.validate()}updated(){this.validate()}};__decorate$K([n$5({type:String})],ChromedashAttachments.prototype,"name",void 0),__decorate$K([n$5({type:String})],ChromedashAttachments.prototype,"value",void 0),__decorate$K([n$5({type:String})],ChromedashAttachments.prototype,"pattern",void 0),__decorate$K([n$5({type:String})],ChromedashAttachments.prototype,"chromedash_single_pattern",void 0),__decorate$K([n$5({type:String})],ChromedashAttachments.prototype,"chromedash_split_pattern",void 0),__decorate$K([n$5({type:Number})],ChromedashAttachments.prototype,"featureId",void 0),ChromedashAttachments=__decorate$K([t$3("chromedash-attachments")],ChromedashAttachments);var __decorate$J=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashTextarea=class ChromedashTextarea extends textarea_default{constructor(){super(...arguments),this.cols=50,this.rows=10,this.offerMarkdown=!1,this.isMarkdown=!1,this.alwaysMarkdown=!1,this.index=-1,this.maxlength=1400,this.showPreview=!1}customCheckValidity(value){if(this.multiple&&this.chromedash_split_pattern&&this.chromedash_single_pattern){const items=value.split(new RegExp(this.chromedash_split_pattern)),singleItemRegex=new RegExp("^"+this.chromedash_single_pattern+"$",""),valid=items.every(item=>{if(!item)return!0;const itemValid=singleItemRegex.test(item);return itemValid});if(!valid)return!1}if(this.pattern){const valueRegex=new RegExp("^"+this.pattern+"$","");return valueRegex.test(value)}return!0}validate(){if(null!==this.input){const invalidMsg=this.customCheckValidity(this.input.value)?"":"invalid";this.setCustomValidity&&this.setCustomValidity(invalidMsg)}}firstUpdated(){this.validate()}updated(){this.input&&this.validate()}handleMarkdownChecked(e){this.isMarkdown=!!e.target?.checked,this.isMarkdown||(this.showPreview=!1)}handlePreviewChecked(e){this.showPreview=!!e.target?.checked,e.stopPropagation()}render(){const editor=super.render();if(!this.offerMarkdown&&!this.alwaysMarkdown)return editor;const preview=x$1` + <div style="display:none">${editor}</div> + <div + id="preview" + style="border:var(--card-border); padding:0 var(--content-padding); min-height:14em; background:var(--table-alternate-background)" + > + ${autolink(this.value,[],!0)} + </div> + `;return x$1` + ${this.showPreview?preview:editor} + <sl-checkbox + id="use-markdown" + name="${this.name}_is_markdown" + ?checked=${this.isMarkdown||this.alwaysMarkdown} + ?disabled=${this.alwaysMarkdown} + @sl-change=${this.handleMarkdownChecked} + > + Use markdown + </sl-checkbox> + <sl-icon-button + name="info-circle" + id="info-button" + title="GitHub flavored markdown docs" + href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax" + target="_blank" + ></sl-icon-button> + ${this.isMarkdown||this.alwaysMarkdown?x$1` <sl-checkbox + id="show-preview" + ?checked=${this.showPreview} + @sl-change=${this.handlePreviewChecked} + > + Preview + </sl-checkbox>`:E$1} + `}};__decorate$J([n$5({type:Boolean})],ChromedashTextarea.prototype,"multiple",void 0),__decorate$J([n$5({type:String})],ChromedashTextarea.prototype,"pattern",void 0),__decorate$J([n$5({type:String})],ChromedashTextarea.prototype,"chromedash_single_pattern",void 0),__decorate$J([n$5({type:String})],ChromedashTextarea.prototype,"chromedash_split_pattern",void 0),__decorate$J([n$5({type:Number})],ChromedashTextarea.prototype,"cols",void 0),__decorate$J([n$5({type:Number})],ChromedashTextarea.prototype,"rows",void 0),__decorate$J([n$5({type:Boolean})],ChromedashTextarea.prototype,"offerMarkdown",void 0),__decorate$J([n$5({type:Boolean})],ChromedashTextarea.prototype,"isMarkdown",void 0),__decorate$J([n$5({type:Boolean})],ChromedashTextarea.prototype,"alwaysMarkdown",void 0),__decorate$J([n$5({type:Number})],ChromedashTextarea.prototype,"index",void 0),__decorate$J([n$5({type:Number})],ChromedashTextarea.prototype,"maxlength",void 0),__decorate$J([r$6()],ChromedashTextarea.prototype,"showPreview",void 0),ChromedashTextarea=__decorate$J([t$3("chromedash-textarea")],ChromedashTextarea);var __decorate$I=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const USAGE_TYPE_DETAILS={[UsageType.Prototype]:{abbreviation:"I2P",className:"usage-tag--prototype",title:"Intent to Prototype"},[UsageType.DeveloperTesting]:{abbreviation:"R4DT",className:"usage-tag--dev-testing",title:"Ready for Developer Testing"},[UsageType.Experiment]:{abbreviation:"I2E",className:"usage-tag--experiment",title:"Intent to Experiment"},[UsageType.Ship]:{abbreviation:"I2S",className:"usage-tag--ship",title:"Intent to Ship"},[UsageType.PSA]:{abbreviation:"PSA",className:"usage-tag--psa",title:"Web-Facing Change PSA"},[UsageType.DeprecateAndRemove]:{abbreviation:"I2D",className:"usage-tag--deprecate",title:"Intent to Deprecate and Remove"},[UsageType.ReleaseNotes]:{abbreviation:"RN",className:"usage-tag--rn",title:"Release Notes"},[UsageType.CrossFunctionReview]:{abbreviation:"XFN",className:"usage-tag-xfn",title:"Cross-Functional Review"}};let ChromedashFormField=class ChromedashFormField extends i$4{constructor(){super(...arguments),this.name="",this.index=-1,this.checkboxLabel="",this.disabled=!1,this.shouldFadeIn=!1,this.forEnterprise=!1,this.disabledReason="",this.forceRequired=!1,this.value="",this.initialValue="",this.loading=!1,this.fetchedChoices={},this.checkMessage=""}getValue(){const useEnterpriseDefault=this.forEnterprise&&this.fieldProps.enterprise_initial!==void 0,initialValue=useEnterpriseDefault?this.fieldProps.enterprise_initial:this.fieldProps.initial;return!this.value&&initialValue?initialValue:this.value}connectedCallback(){super.connectedCallback(),this.fieldProps=resolveFieldForFeature(ALL_FIELDS[this.name]||{},this.feature);const app=document.querySelector("chromedash-app");app?.pageComponent&&app.pageComponent.allFormFieldComponentsList.push(this),"blink_components"===this.name?this.fetchChoices(window.csClient.getBlinkComponents(),"Error fetching Blink Components. Please refresh the page or try again later."):"web_feature"===this.name&&this.fetchChoices(window.csClient.getWebFeatureIDs().then(feature_ids=>{let choices={missing_feature:["Missing feature","Missing feature"]};for(let id of feature_ids)choices[id]=[id,id];return choices}),"Error fetching Web feature IDs. Please refresh the page or try again later.")}fetchChoices(fetchPromise,errorMessage){this.loading=!0,fetchPromise.then(choices=>{this.fetchedChoices=choices,this.loading=!1}).catch(()=>{showToastMessage(errorMessage)})}firstUpdated(){this.initialValue=JSON.parse(JSON.stringify(this.value)),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>setTimeout(()=>{this.doSemanticCheck()})):this.doSemanticCheck()}updateAttributes(el){if(!el)return;const attrs=this.fieldProps.attrs||{};Object.keys(attrs).map(attr=>{el.setAttribute(attr,attrs[attr])})}toggleExtraHelp(){const details=this.renderRoot.querySelector("sl-details");details.open=!details.open;const button=this.renderRoot.querySelector("sl-icon-button");button.name=details.open?"dash-square":"plus-square"}shouldDisplayFeatureLink(field_name,feature_value){return!("web_feature"!==field_name)&&!!feature_value&&"Missing feature"!==feature_value&&"TBD"!=feature_value}createRenderRoot(){return this}handleFieldUpdated(e){const type=this.fieldProps.type;let fieldValue;fieldValue="checkbox"===type?e.target.checked:"multiselect"===type?e.target.value.join(","):e.target.value,this.value=fieldValue;let isMarkdown;e.target.offerMarkdown&&(isMarkdown=e.target.isMarkdown);const eventOptions={detail:{value:fieldValue,index:this.index,isMarkdown}};this.dispatchEvent(new CustomEvent("form-field-update",eventOptions));const app=document.querySelector("chromedash-app");app?.pageComponent?app.pageComponent.allFormFieldComponentsList.forEach(formFieldComponent=>formFieldComponent.doSemanticCheck()):this.doSemanticCheck()}async doSemanticCheck(){const getFieldValue=(fieldName,stageOrId)=>("current stage"===stageOrId&&(stageOrId=this.stageId),getFieldValueWithStage(fieldName,stageOrId,this.fieldValues||[]));getFieldValue.feature=this.fieldValues?.feature;const checkFunctionWrapper=async checkFunction=>{const fieldValue=this.getValue(),initialValue=this.initialValue;if(null==fieldValue)return!1;const checkResult=await checkFunction(fieldValue,getFieldValue,initialValue);return null!=checkResult&&(this.checkMessage=x$1` <span + class="check-${checkResult.message?"message":checkResult.warning?"warning":checkResult.error?"error":"unknown"}" + > + ${checkResult.message?checkResult.message:checkResult.warning?x$1`<b>Warning</b>: ${checkResult.warning}`:checkResult.error?x$1`<b>Error</b>: ${checkResult.error}`:""} + </span>`,!0)},checkFunctionOrArray=this.fieldProps.check||[],checkFunctions="function"==typeof checkFunctionOrArray?[checkFunctionOrArray]:checkFunctionOrArray;0<checkFunctions.length&&(this.checkMessage="");for(const checkFunction of checkFunctions)if(await checkFunctionWrapper(checkFunction))return}renderWidget(){const type=this.fieldProps.type,fieldDisabled=this.fieldProps.disabled,fieldValue=this.getValue(),isRequired=this.fieldProps.required||this.forceRequired,offerMarkdown=!(this.forEnterprise?!this.fieldProps.enterprise_offer_markdown:!this.fieldProps.offer_markdown),fieldName=this.fieldProps.name||this.name,isMarkdown=(this.feature?.markdown_fields||[]).includes(fieldName),choices=this.fieldProps.choices||this.fetchedChoices;let fieldHTML=x$1``;if("checkbox"===type){const label=this.checkboxLabel||this.fieldProps.label;fieldHTML=x$1` + <sl-checkbox + name="${fieldName}" + id="id_${this.name}" + size="small" + ?checked=${!0===fieldValue||"true"===fieldValue||"True"===fieldValue} + ?disabled=${this.disabled||fieldDisabled} + @sl-change="${this.handleFieldUpdated}" + > + ${label} + </sl-checkbox> + `}else if("select"===type)fieldHTML=x$1` + <sl-select + name="${fieldName}" + id="id_${this.name}" + value="${fieldValue}" + size="small" + hoist + ?disabled=${fieldDisabled||this.disabled||this.loading} + @sl-change="${this.handleFieldUpdated}" + > + ${Object.values(choices).map(([value,label])=>x$1` + <sl-option value="${value}"> ${label} </sl-option> + `)} + </sl-select> + `;else if("multiselect"===type){const valueArray=fieldValue.split(","),availableOptions=Object.values(choices).filter(([value,label,obsolete])=>!obsolete||valueArray.includes(""+value));fieldHTML=x$1` + <sl-select + name="${fieldName}" + id="id_${this.name}" + .value=${valueArray} + size="small" + hoist + multiple + cleareable + ?required=${isRequired} + ?disabled=${fieldDisabled||this.disabled||this.loading} + @sl-change="${this.handleFieldUpdated}" + > + ${availableOptions.map(([value,label])=>x$1` + <sl-option value="${value}"> ${label} </sl-option> + `)} + </sl-select> + `}else"input"===type?fieldHTML=x$1` + <sl-input + ${n$2(this.updateAttributes)} + name="${fieldName}" + id="id_${this.name}" + stageId="${this.stageId}" + size="small" + autocomplete="off" + .value=${fieldValue} + help-text="${this.disabledReason}" + ?disabled=${this.disabled||this.disabledReason||fieldDisabled} + ?required=${isRequired} + @sl-change="${this.handleFieldUpdated}" + > + </sl-input> + `:"textarea"===type?fieldHTML=x$1` + <chromedash-textarea + ${n$2(this.updateAttributes)} + name="${fieldName}" + id="id_${this.name}" + size="small" + resize="auto" + value=${fieldValue} + index=${this.index} + ?required=${isRequired} + ?offerMarkdown=${offerMarkdown} + ?isMarkdown=${isMarkdown} + ?alwaysMarkdown=${this.fieldProps.always_markdown} + @sl-change="${this.handleFieldUpdated}" + > + </chromedash-textarea> + `:"attachments"===type?fieldHTML=x$1` + <chromedash-attachments + ${n$2(this.updateAttributes)} + name="${fieldName}" + featureId=${this.feature.id} + id="id_${this.name}" + size="small" + value=${fieldValue} + ?required=${isRequired} + @sl-change="${this.handleFieldUpdated}" + > + </chromedash-attachments> + `:"radios"===type?fieldHTML=x$1` + ${Object.values(choices).map(([value,label,description])=>x$1` + <input + id="id_${this.name}_${value}" + name="${fieldName}" + value="${value}" + .checked="${value===+fieldValue}" + type="radio" + required + @change=${this.handleFieldUpdated} + /> + <label for="id_${this.name}_${value}">${label}</label> + <p>${description}</p> + `)} + `:"datalist"===type?fieldHTML=x$1` + <div class="datalist-input-wrapper" data-testid="${this.name}_wrapper"> + <input + ${n$2(this.updateAttributes)} + name="${fieldName}" + id="id_${this.name}" + value="${fieldValue}" + class="datalist-input" + type="search" + list="${this.name}_list" + ?required=${isRequired} + @change=${this.handleFieldUpdated} + /> + </div> + <datalist id="${this.name}_list"> + ${Object.values(choices).map(([value])=>x$1` <option value="${value}"></option> `)} + </datalist> + `:console.error(`unknown form field type: ${type}`);return fieldHTML}renderUsageIcons(fieldUsageInfo,featureType){if(featureType===void 0)return[];const intentTypesUsed=fieldUsageInfo[featureType];if(!intentTypesUsed)return[];if(ALL_INTENT_USAGE_BY_FEATURE_TYPE[featureType]?.isSubsetOf(intentTypesUsed))return[x$1`<span + class="usage-tag usage-tag--all" + title="This field is used to populate all intent templates when provided" + > + All + </span>`];const intentIcons=[];for(const intentType of intentTypesUsed){const details=USAGE_TYPE_DETAILS[intentType];if(details){const tooltipText=`This field is used to populate the ${details.title} template`;intentIcons.push(x$1` + <span class="usage-tag ${details.className}" title="${tooltipText}" + >${details.abbreviation}</span + > + `)}}return intentIcons}render(){if(this.fieldProps.deprecated&&!this.value)return E$1;const helpText=this.forEnterprise&&this.fieldProps.enterprise_help_text!==void 0?this.fieldProps.enterprise_help_text:this.fieldProps.help_text,extraHelpText=this.forEnterprise&&this.fieldProps.enterprise_extra_help!==void 0?this.fieldProps.enterprise_extra_help:this.fieldProps.extra_help,fadeInClass=this.shouldFadeIn?"fade-in":"";return x$1` + ${this.fieldProps.label?x$1` + <tr class="${fadeInClass}"> + <th class="form-field-header"> + <div> + <b>${this.fieldProps.label}:</b> + </div> + <div> + ${this.renderUsageIcons(this.fieldProps.usage,this.feature?.feature_type_int)} + </div> + </th> + </tr> + `:E$1} + <tr class=${fadeInClass}> + <td>${this.renderWidget()} ${this.checkMessage}</td> + <td> + ${helpText?x$1`<span class="helptext"> ${helpText} </span>`:E$1} + ${extraHelpText?x$1` + <sl-icon-button + name="plus-square" + label="Toggle extra help" + style="position:absolute" + @click="${this.toggleExtraHelp}" + > + + + </sl-icon-button> + `:E$1} + </td> + </tr> + + ${extraHelpText?x$1` + <tr> + <td colspan="2" class="extrahelp"> + <sl-details summary=""> + <span class="helptext"> ${extraHelpText} </span> + </sl-details> + </td> + </tr> + `:E$1} + ${this.shouldDisplayFeatureLink(this.name,this.value)?x$1` + <tr> + <td colspan="2" class="webdx"> + See web feature + <a + href="https://webstatus.dev/features/${enumLabelToFeatureKey(this.value)}" + target="_blank" + > + ${this.value} + </a> + in webstatus.dev + </td> + </tr> + `:E$1} + `}};__decorate$I([n$5({type:String})],ChromedashFormField.prototype,"name",void 0),__decorate$I([n$5({type:Number})],ChromedashFormField.prototype,"index",void 0),__decorate$I([n$5({type:Object})],ChromedashFormField.prototype,"fieldValues",void 0),__decorate$I([n$5({type:Object,attribute:!1})],ChromedashFormField.prototype,"feature",void 0),__decorate$I([n$5({type:String})],ChromedashFormField.prototype,"checkboxLabel",void 0),__decorate$I([n$5({type:Boolean})],ChromedashFormField.prototype,"disabled",void 0),__decorate$I([n$5({type:Boolean})],ChromedashFormField.prototype,"shouldFadeIn",void 0),__decorate$I([n$5({type:Boolean})],ChromedashFormField.prototype,"forEnterprise",void 0),__decorate$I([n$5({type:String})],ChromedashFormField.prototype,"disabledReason",void 0),__decorate$I([n$5({type:Boolean})],ChromedashFormField.prototype,"forceRequired",void 0),__decorate$I([n$5({type:Number})],ChromedashFormField.prototype,"stageId",void 0),__decorate$I([n$5({type:Number})],ChromedashFormField.prototype,"stageType",void 0),__decorate$I([n$5({type:String})],ChromedashFormField.prototype,"value",void 0),__decorate$I([r$6()],ChromedashFormField.prototype,"initialValue",void 0),__decorate$I([r$6()],ChromedashFormField.prototype,"loading",void 0),__decorate$I([r$6()],ChromedashFormField.prototype,"fetchedChoices",void 0),__decorate$I([r$6()],ChromedashFormField.prototype,"checkMessage",void 0),__decorate$I([r$6()],ChromedashFormField.prototype,"fieldProps",void 0),ChromedashFormField=__decorate$I([t$3("chromedash-form-field")],ChromedashFormField);function enumLabelToFeatureKey(label){let result="";for(let i=0;i<label.length;i++){const char=label[i];if(0==i){result+=char.toLowerCase();continue}if(char===char.toUpperCase()&&/[a-zA-Z]/.test(char)){result+="-"+char.toLowerCase();continue}0<i&&/[a-zA-Z]/.test(label[i-1])&&"0"<=char&&"9">=char&&(result+="-"),result+=char}return result}function getFieldValueWithStage(fieldName,stageOrId,formFieldValues){let stageId;"number"==typeof stageOrId?stageId=stageOrId:"object"==typeof stageOrId&&(stageId=stageOrId.id);for(const obj of formFieldValues)if(obj.name===fieldName&&(null==stageId||obj.stageId==stageId))return obj.value;const feature=formFieldValues?.feature;if(null==feature)return null;const feStage="object"==typeof stageOrId?stageOrId:null==stageId?feature.stages[0]:feature.stages.find(s=>s.id==stageId);if(!feStage)return null;const value=getFieldValueFromFeature(fieldName,feStage,feature);return value}var __decorate$H=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashFormTable=class ChromedashFormTable extends i$4{static get styles(){return[i$7` + :host { + display: table; + max-width: 80em; + } + `]}render(){return x$1` <slot>fallback content</slot> `}};__decorate$H([n$5({type:String})],ChromedashFormTable.prototype,"class",void 0),ChromedashFormTable=__decorate$H([t$3("chromedash-form-table")],ChromedashFormTable);const BLINK_GENERIC_QUESTIONNAIRE=x$1` <p> + To request a review, use the "Draft intent..." button above to generate an + intent messsage, and then post that message to blink-dev@chromium.org. + </p> + <p> + Be sure to update your feature entry in response to any suggestions on that + email thread. + </p>`,PRIVACY_GENERIC_QUESTIONNAIRE=x$1` <p> + <b + >Please fill out the Security & Privacy self-review questionnaire: + <a + href="https://www.w3.org/TR/security-privacy-questionnaire/" + target="_blank" + >https://www.w3.org/TR/security-privacy-questionnaire/</a + ></b + > + </p> + <p> + Share it as a public document, as a file in your repository, or in any other + public format of your choice. + </p> + <p> + You can reuse the same filled-out questionnaire in the security review + below, across all stages of this ChromeStatus entry, and across all entries + related to the same API. If you updated an existing questionnaire to reflect + new changes to the API, please highlight them for an easier review. + </p> + <p> + <b>If you believe your feature has no privacy impact</b> and none of the + questions in the questionnaire apply, you can provide a justification + instead, e.g. "Removing a prefix from the API, no changes to functionality" + or "New CSS property that doesn't depend on the user state, therefore + doesn't reveal any user information". Note that if your reviewer disagrees + with the justification, they may ask you to fill out the questionnaire + nevertheless. + </p>`,SECURITY_GENERIC_QUESTIONNAIRE=x$1` <p> + <b + >Please fill out the Security & Privacy self-review questionnaire: + <a + href="https://www.w3.org/TR/security-privacy-questionnaire/" + target="_blank" + >https://www.w3.org/TR/security-privacy-questionnaire/</a + ></b + > + </p> + <p> + Share it as a public document, as a file in your repository, or in any other + public format of your choice. + </p> + <p> + You can reuse the same filled-out questionnaire in the privacy review above, + across all stages of this ChromeStatus entry, and across all entries related + to an API. If you updated an existing questionnaire to reflect new changes + to the API, please highlight them for an easier review. + </p> + <p> + <b>If you believe your feature has no security impact</b> and none of the + questions in the questionnaire apply, you can provide a justification + instead. Note that if your reviewer disagrees with the justification, they + may ask you to fill out the questionnaire nevertheless. + </p>`,ENTERPRISE_SHIP_QUESTIONNAIRE=x$1` <p> + <b>(1) Does this launch include a breaking change?</b> Does this launch + remove or modify existing behavior or does it interrupt an existing user + flow? (e.g. removing or restricting an API, or significant UI change). + Answer with one of the following options, and/or describe anything you're + unsure about: + </p> + <ul> + <li> + No. There's no change visible to users, developers, or IT admins (e.g. + internal refactoring) + </li> + <li>No. This launch is strictly additive functionality</li> + <li> + Yes. Something that exists is changing or being removed (even if usage is + very small) + </li> + <li> + I don't know. Enterprise reviewers, please help me decide. The relevant + information is: ______ + </li> + </ul> + <p> + <b + >(2) Is there any other reason you expect that enterprises will care about + this launch?</b + > + (e.g. they may perceive a risk of data leaks if the browser is uploading new + information, or it may be a surprise to employees resulting in them calling + their help desk). Answer with one of the following options, and/or describe + anything you're unsure about: + </p> + <ul> + <li>No. Enterprises won't care about this</li> + <li>Yes. They'll probably care because ______</li> + <li> + I don't know. Enterprise reviewers, please help me decide. The relevant + information is: ______ + </li> + </ul> + <p> + <b + >(3) Does your launch have an enterprise policy to control it, and will it + be available when this rolls out to stable (even to 1%)?</b + > + Only required if you answered Yes to either of the first 2 questions. Answer + with one of the following options, and/or describe anything you're unsure + about: + </p> + <ul> + <li> + Yes. It's called ______. It will be a permanent policy, and it will be + available when stable rollout starts + </li> + <li> + Yes. It's called ______. This is a temporary transition period, so the + policy will stop working on milestone ___. It will be available when + stable rollout starts + </li> + <li> + No. A policy is infeasible because ______ (e.g. this launch is a change in + how we compile Chrome) + </li> + <li> + No. A policy isn't necessary because ______ (e.g. there's a better method + of control available to admins) + </li> + </ul> + <p> + <b + >(4) Provide a brief title and description of this launch, which can be + shared with enterprises.</b + > + Only required if you answered Yes to either of the first 2 questions. This + may be added to browser release notes. Where applicable, explain the benefit + to users, and describe the policy to control it. + </p>`,DEBUGGABILITY_ORIGIN_TRIAL_QUESTIONNAIRE=x$1` + <p> + (1) Does the introduction of the new Web Platform feature break Chrome + DevTools' existing developer experience? + </p> + + <p> + (2) Does Chrome DevTools' existing set of tooling features interact with the + new Web Platform feature in an expected way? + </p> + + <p> + (3) Would the new Web Platform feature's acceptance and/or adoption benefit + from adding a new developer workflow to Chrome DevTools? + </p> + + <p> + (4) Can the feature be tested with a WebDriver BiDi module or other + appropriate automation? + </p> + + <p> + When in doubt, please check out + <a href="https://goo.gle/devtools-checklist" target="_blank" + >https://goo.gle/devtools-checklist</a + > + for details! + </p> +`,DEBUGGABILITY_SHIP_QUESTIONNAIRE=DEBUGGABILITY_ORIGIN_TRIAL_QUESTIONNAIRE,TESTING_SHIP_QUESTIONNAIRE=x$1` <p> + <b + >(1) Does your feature have sufficient automated test coverage (Unit + tests, WPT, browser tests and other integration tests)?</b + > + Chrome requires at least 70% automation code coverage (<a + href="https://analysis.chromium.org/coverage/p/chromium" + target="_blank" + >dashboard</a + >) running on the main/release branch and 70% Changelist + <a + href="https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/testing/code_coverage_in_gerrit.md" + target="_blank" + >code coverage in Gerrit</a + >? Do the automated tests have more than 93% green (flakiness < 7%) on CQ + and CI builders? + </p> + <ul> + <li> + Yes. My feature met the minimum automated test coverage and health + requirements. + </li> + <li>No. My feature does not meet the requirements since __________.</li> + </ul> + <p> + <b>(2) How are performance tests conducted on Chromium builders?</b> List + links to tests if any. + </p> + <p> + <b + >(3) Does this feature have non-automatable test cases that require manual + testing? Do you have a plan to get them tested?</b + > + </p> + <ul> + <li>No. All feature related test cases are automated.</li> + <li> + Yes. There are non-automatable test cases and I have completed test + execution or allocated resources to ensure the coverage of these test + cases. + </li> + <li> + Yes. There are non-automatable test cases and my feature impacts Google + products. + </li> + </ul> + <p> + <b + >(4) If your feature impacts Google products, please fill in + <a href="http://go/chrome-wp-test-survey" target="_blank" + >go/chrome-wp-test-survey</a + >.</b + > + Make a copy, answer the survey questions, and provide a link to your + document here. + </p>`,GATE_QUESTIONNAIRES={[GATE_TYPES.API_PROTOTYPE]:BLINK_GENERIC_QUESTIONNAIRE,[GATE_TYPES.API_ORIGIN_TRIAL]:BLINK_GENERIC_QUESTIONNAIRE,[GATE_TYPES.API_EXTEND_ORIGIN_TRIAL]:BLINK_GENERIC_QUESTIONNAIRE,[GATE_TYPES.API_SHIP]:BLINK_GENERIC_QUESTIONNAIRE,[GATE_TYPES.API_PLAN]:BLINK_GENERIC_QUESTIONNAIRE,[GATE_TYPES.PRIVACY_ORIGIN_TRIAL]:PRIVACY_GENERIC_QUESTIONNAIRE,[GATE_TYPES.PRIVACY_SHIP]:PRIVACY_GENERIC_QUESTIONNAIRE,[GATE_TYPES.SECURITY_ORIGIN_TRIAL]:SECURITY_GENERIC_QUESTIONNAIRE,[GATE_TYPES.SECURITY_SHIP]:SECURITY_GENERIC_QUESTIONNAIRE,[GATE_TYPES.ENTERPRISE_SHIP]:ENTERPRISE_SHIP_QUESTIONNAIRE,[GATE_TYPES.ENTERPRISE_PLAN]:ENTERPRISE_SHIP_QUESTIONNAIRE,[GATE_TYPES.DEBUGGABILITY_ORIGIN_TRIAL]:DEBUGGABILITY_ORIGIN_TRIAL_QUESTIONNAIRE,[GATE_TYPES.DEBUGGABILITY_SHIP]:DEBUGGABILITY_SHIP_QUESTIONNAIRE,[GATE_TYPES.DEBUGGABILITY_PLAN]:DEBUGGABILITY_SHIP_QUESTIONNAIRE,[GATE_TYPES.TESTING_SHIP]:TESTING_SHIP_QUESTIONNAIRE,[GATE_TYPES.TESTING_PLAN]:TESTING_SHIP_QUESTIONNAIRE},LAUNCHING_FEATURES_URL="https://www.chromium.org/blink/launching-features/",BLINK_GENERIC_RATIONALE=x$1` + The API Owners review provides a final check on all aspects of your feature + and how you have followed the + <a href=${LAUNCHING_FEATURES_URL} target="_blank">Blink launch process</a>. +`,PRIVACY_GENERIC_RATIONALE=x$1` + The Web Platform privacy review puts you in touch with the privacy team so + that they can consult further with you when needed. +`,SECURITY_GENERIC_RATIONALE=x$1` + The Web Platform Security review helps ensure that new or changed web APIs + uphold the security principles of the web - the same origin policy, no + cross-site leaks, compliance with CSP, CORS, permission norms, etc. It aims to + show that the API can be implemented safely. It doesn’t necessarily try to + prove that it has been implemented safely within Chromium - for Chrome team + features, that’s done by the Chrome launch review process. +`,ENTERPRISE_GENERIC_RATIONALE=x$1` + The enterprise review helps identify the impact of your feature on + enterprises. Features need to be enterprise-friendly. That is: + + <ul> + <li>Breaking changes need to have sufficient notice</li> + <li> + Breaking changes need to have a soft deadline and transition period where + feasible + </li> + <li>Admins need to have central controls where appropriate</li> + </ul> +`,DEBUGGABILITY_GENERIC_RATIONALE=x$1` + The debuggability review helps identify opportunities to make your feature + more successful by integrating with Chrome Dev Tools. +`,TESTING_GENERIC_RATIONALE=x$1` + The test review helps identify gaps in test coverage and ensures that all + crucial functionalities are thoroughly tested. This can lead to a more + polished final product and reduce the odds of missed defects and issues. +`,GATE_RATIONALE={[GATE_TYPES.API_PROTOTYPE]:BLINK_GENERIC_RATIONALE,[GATE_TYPES.API_ORIGIN_TRIAL]:BLINK_GENERIC_RATIONALE,[GATE_TYPES.API_EXTEND_ORIGIN_TRIAL]:BLINK_GENERIC_RATIONALE,[GATE_TYPES.API_SHIP]:BLINK_GENERIC_RATIONALE,[GATE_TYPES.API_PLAN]:BLINK_GENERIC_RATIONALE,[GATE_TYPES.PRIVACY_ORIGIN_TRIAL]:PRIVACY_GENERIC_RATIONALE,[GATE_TYPES.PRIVACY_SHIP]:PRIVACY_GENERIC_RATIONALE,[GATE_TYPES.SECURITY_ORIGIN_TRIAL]:SECURITY_GENERIC_RATIONALE,[GATE_TYPES.SECURITY_SHIP]:SECURITY_GENERIC_RATIONALE,[GATE_TYPES.ENTERPRISE_SHIP]:ENTERPRISE_GENERIC_RATIONALE,[GATE_TYPES.ENTERPRISE_PLAN]:ENTERPRISE_GENERIC_RATIONALE,[GATE_TYPES.DEBUGGABILITY_ORIGIN_TRIAL]:DEBUGGABILITY_GENERIC_RATIONALE,[GATE_TYPES.DEBUGGABILITY_SHIP]:DEBUGGABILITY_GENERIC_RATIONALE,[GATE_TYPES.DEBUGGABILITY_PLAN]:DEBUGGABILITY_GENERIC_RATIONALE,[GATE_TYPES.TESTING_SHIP]:TESTING_GENERIC_RATIONALE,[GATE_TYPES.TESTING_PLAN]:TESTING_GENERIC_RATIONALE};var __decorate$G=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashSurveyQuestions=class ChromedashSurveyQuestions extends i$4{constructor(){super(...arguments),this.loading=!0}static get styles(){return[...SHARED_STYLES,i$7` + #questionnaire { + padding: var(--content-padding-half); + border-radius: var(--border-radius); + background: var(--accordion-background); + } + #questionnaire * + * { + padding-top: var(--content-padding); + } + #questionnaire ul { + padding-left: var(--content-padding); + } + #questionnaire ol { + padding-left: var(--content-padding); + } + #questionnaire ol li { + list-style: auto; + } + .question { + padding: var(--content-padding-half); + } + .instructions { + padding: var(--content-padding-half); + margin-bottom: var(--content-padding-large); + } + `]}_fireEvent(eventName,detail){const event=new CustomEvent(eventName,{bubbles:!0,composed:!0,detail});this.dispatchEvent(event)}canEditSurvey(){return this.user&&(this.user.can_edit_all||this.user.editable_features.includes(this.feature.id))}renderQuestionnaireSkeleton(){return x$1` + <div id="questionnaire">Loading...</div> + <p class="instructions"> </p> + `}handleFieldChange(name,value){window.csClient.updateGate(this.feature.id,this.gate.id,null,{[name]:value}).then(()=>{this._fireEvent("refetch-needed",{})})}handleFieldKeyup(name,value){1>=(value||"").trim().length&&window.csClient.updateGate(this.feature.id,this.gate.id,null,{[name]:value})}renderBooleanField(name,desc){const value=this.gate.survey_answers?.[name];return x$1` + <li class="question"> + <sl-checkbox + name=${name} + ?checked=${value} + ?disabled=${!this.canEditSurvey()} + @sl-change=${e=>this.handleFieldChange(name,e.target?.checked)} + ></sl-checkbox> + ${desc} + </li> + `}renderStringField(name,desc){const value=this.gate.survey_answers?.[name];return x$1` + <li class="question"> + ${desc} + <sl-input + name="${name}" + size="small" + value=${value} + ?disabled=${!this.canEditSurvey()} + @sl-change=${e=>this.handleFieldChange(name,e.target?.value)} + @keyup=${e=>this.handleFieldKeyup(name,e.target?.value)} + ></sl-input> + </li> + `}renderTextField(name,desc){const value=this.gate.survey_answers?.[name];return x$1` + <li class="question"> + ${desc} + <sl-textarea + name="${name}" + size="small" + rows="2" + resize="auto" + value=${value} + ?disabled=${!this.canEditSurvey()} + @sl-change=${e=>this.handleFieldChange(name,e.target?.value)} + @keyup=${e=>this.handleFieldKeyup(name,e.target?.value)} + ></sl-textarea> + </li> + `}renderPrivacyForm(){return x$1` + <div id="questionnaire"> + <ol> + ${this.renderBooleanField("is_language_polyfill",x$1`This is a <b>new JS language construct</b> that has + <b>already been polyfillable</b>.`)} + ${this.renderBooleanField("is_api_polyfill",x$1`This is a <b>new API</b> that ergonomically provides a function + that was <b>already polyfillable under the same conditions</b>. By + "same conditions" we mean, for example, that if a polyfill was + only possible when the user has granted a certain permission, the + API respects the same permission.`)} + ${this.renderBooleanField("is_same_origin_css",x$1`This is a <b>CSS addition</b> or change such that the style + <b>only depends on same-origin information</b> and + <b>NOT on user data</b>. CSS changes are usually benign, however: + if the style relies on iframes or subresources, it could reveal + cross-origin information. If the style depends on user data, such + as browsing history (like :visited), cookies, or user input (like + hidden=until-found), the style could be used by the website to + read this data.`)} + ${this.renderStringField("launch_or_contact",x$1`If there is a Google-internal launch entry filed for this exact + same issue, enter its URL here. Or, if this has previously been + discussed with someone on the privacy team, enter their email + address. Or, enter "None".`)} + ${this.renderTextField("explanation",x$1`<b>Required</b>: If you checked any box above, explain why you + checked it, and provide any other relevant context.`)} + </ol> + </div> + `}renderTestingForm(){return x$1` + <div id="questionnaire"> + Does your feature have WPT or other automated tests that cover the + following? + <ol> + ${this.renderBooleanField("covers_existence",x$1`<b>Feature existence</b>. This is typically done with + surface-level tests like idlharness.js for APIs or + parsing-testcommon.js for CSS. These tests don’t verify actual + behavior. + <a + href="https://wpt.fyi/results/idle-detection/idlharness.https.window.html" + target="_blank" + >API example</a + >. + <a + href="https://wpt.fyi/results/css/css-logical/parsing/inset-valid.html" + target="_blank" + >CSS example</a + >.`)} + ${this.renderBooleanField("covers_common_cases",x$1`<b>Common use cases</b>. Use the feature in a realistic and + straightforward way and verify the expected behavior. + <a + href="https://github.com/web-platform-tests/wpt/blob/master/requestidlecallback/basic.html" + target="_blank" + >API example</a + >. + <a + href="https://wpt.fyi/results/css/css-flexbox/gap-001-ltr.html" + target="_blank" + >CSS example</a + >. + <a href="https://wpt.fyi/results/cors/basic.htm" target="_blank" + >HTML example</a + >.`)} + ${this.renderBooleanField("covers_errors",x$1`<b>Likely error scenarios</b>. Test realistic error scenarios + like out-of-bounds inputs, network errors, or the user rejecting a + permission prompt. + <a + href="https://wpt.fyi/results/fetch/api/basic/error-after-response.any.html" + target="_blank" + >API example</a + >. + <a + href="https://wpt.fyi/results/css/css-color/hsl-clamp-negative-saturation.html" + target="_blank" + >CSS example</a + >. + <a + href="https://wpt.fyi/results/client-hints/accept-ch-malformed-header.https.html" + target="_blank" + >HTML example</a + >. `)} + ${this.renderBooleanField("covers_invalidation",x$1`<b>Invalidation</b>. Rendering or other output often needs to + be invalidated when the inputs change. This kind of test is common + for CSS features, but can make sense for other features too. Often + called “dynamic” when an initial state is updated by script. Or, + if your feature needs no invalidation tests, check this box. + <a + href="https://wpt.fyi/results/dom/nodes/Element-childElementCount-dynamic-add.html" + target="_blank" + >API example</a + >. + <a + href="https://wpt.fyi/results/css/css-content/quotes-lang-dynamic-001.html" + target="_blank" + >CSS example</a + >. `)} + ${this.renderBooleanField("covers_integration",x$1`<b>Integration with other features</b>. If the feature + integrates with other features in some meaningful way, test that + the combination of the two features behaves as expected. Or, if + your feature needs no integration tests, check this box. + <a + href="https://wpt.fyi/results/permissions-policy/reporting/fullscreen-reporting.html" + target="_blank" + >API example</a + >. + <a + href="https://wpt.fyi/results/css/css-anchor-position/anchor-scroll-to-sticky-001.html" + target="_blank" + >CSS example</a + >. + <a + href="https://wpt.fyi/results/clear-site-data/set-cookie-before-clear-cookies.https.html" + target="_blank" + >HTML example</a + >. `)} + </ol> + </div> + `}renderQuestionnaire(){if(this.gate.gate_type===GATE_TYPES.PRIVACY_ORIGIN_TRIAL||this.gate.gate_type===GATE_TYPES.PRIVACY_SHIP)return this.renderPrivacyForm();if(this.gate.gate_type===GATE_TYPES.TESTING_PLAN||this.gate.gate_type===GATE_TYPES.TESTING_SHIP)return this.renderTestingForm();const questionnaireText=GATE_QUESTIONNAIRES[this.gate.gate_type];if(!questionnaireText)return x$1`No questions`;const markup="string"==typeof questionnaireText?autolink(questionnaireText):questionnaireText;return x$1` + <div id="questionnaire">${markup}</div> + <p class="instructions">Please post responses in the comments below.</p> + `}render(){return x$1` + <h2>Survey questions</h2> + ${this.loading?this.renderQuestionnaireSkeleton():this.renderQuestionnaire()} + `}};__decorate$G([n$5({type:Object})],ChromedashSurveyQuestions.prototype,"user",void 0),__decorate$G([r$6()],ChromedashSurveyQuestions.prototype,"feature",void 0),__decorate$G([r$6()],ChromedashSurveyQuestions.prototype,"gate",void 0),__decorate$G([r$6()],ChromedashSurveyQuestions.prototype,"loading",void 0),ChromedashSurveyQuestions=__decorate$G([t$3("chromedash-survey-questions")],ChromedashSurveyQuestions);var __decorate$F=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let naRationalDialogEl;async function openNaRationaleDialog(gate){return naRationalDialogEl||(naRationalDialogEl=document.createElement("chromedash-na-rationale-dialog"),document.body.appendChild(naRationalDialogEl),await naRationalDialogEl.updateComplete),new Promise(resolve=>{naRationalDialogEl.openOn(gate,resolve)})}let ChromedashNaRationaleDialog=class ChromedashNaRationaleDialog extends i$4{constructor(){super(...arguments),this.rationaleDialogRef=e$1(),this.rationaleRef=e$1(),this.gate=void 0,this.resolve=()=>{console.log("Missing resolve action")}}static get styles(){return[...SHARED_STYLES,i$7``]}openOn(gate,resolve){this.gate=gate,this.resolve=resolve,this.rationaleDialogRef.value?.show()}handlePost(){this.resolve(this.rationaleRef.value?.value),this.rationaleDialogRef.value?.hide()}renderDialogContent(){return void 0===this.gate?E$1:x$1` + <p style="padding: var(--content-padding)"> + Please briefly explain why your feature does not require a review. Your + response will be posted as a comment on this review gate and it will + generate a notification to the reviewers. The ${this.gate.team_name} + reviewers will still evaluate whether to give an "N/A" response or do a + review. + </p> + <sl-textarea ${n$2(this.rationaleRef)}></sl-textarea> + <sl-button + slot="footer" + variant="primary" + size="small" + @click=${this.handlePost} + >Post</sl-button + > + `}render(){return x$1` + <sl-dialog ${n$2(this.rationaleDialogRef)} label="Request an N/A"> + ${this.renderDialogContent()} + </sl-dialog> + `}};__decorate$F([n$5({type:Object,attribute:!1})],ChromedashNaRationaleDialog.prototype,"gate",void 0),__decorate$F([n$5({attribute:!1})],ChromedashNaRationaleDialog.prototype,"resolve",void 0),ChromedashNaRationaleDialog=__decorate$F([t$3("chromedash-na-rationale-dialog")],ChromedashNaRationaleDialog);var __decorate$E=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let certifyDialogEl;function shouldShowCertifyDialog(gate){return gate.self_certify_possible&&gate.self_certify_eligible}async function maybeOpenCertifyDialog(gate,voteValue){return shouldShowCertifyDialog(gate)?new Promise(resolve=>{openCertifyDialog(gate,voteValue,resolve)}):Promise.resolve()}async function openCertifyDialog(gate,voteValue,resolve){certifyDialogEl||(certifyDialogEl=document.createElement("chromedash-self-certify-dialog"),document.body.appendChild(certifyDialogEl)),certifyDialogEl.gate=gate,certifyDialogEl.voteValue=voteValue,certifyDialogEl.resolve=resolve,await certifyDialogEl.updateComplete,certifyDialogEl.show()}let ChromedashSelfCertifyDialog=class ChromedashSelfCertifyDialog extends i$4{constructor(){super(...arguments),this.resolve=()=>{console.log("Missing resolve action")}}static get styles(){return[...SHARED_STYLES,i$7` + #prereqs-list li { + margin-left: 8px; + margin-bottom: 8px; + } + #prereqs-header { + margin-bottom: 8px; + } + sl-button { + float: right; + margin: var(--content-padding-half); + } + `]}show(){this.renderRoot.querySelector("sl-dialog")?.show()}hide(){this.renderRoot.querySelector("sl-dialog")?.hide()}handleSelfCertify(){this.resolve(!0),this.hide()}handleFullReview(){this.resolve(!1),this.hide()}renderContentWhenEligible(){const voteWord=this.voteValue==VOTE_OPTIONS.APPROVED[0]?"approval":"N/A";return x$1` + <div id="prereqs-header"> + Based on your answers to the survey questions, you may self-certify an + ${voteWord} for this gate. Alternatively, if you want to start a + consulation with the review team, you may request a full review. + </div> + <br /> + <sl-button size="small" @click=${this.handleFullReview} + >Request full review</sl-button + > + <sl-button size="small" variant="primary" @click=${this.handleSelfCertify} + >Self-certify ${voteWord}</sl-button + > + `}render(){return void 0===this.gate?x$1`Loading gates...`:x$1` <sl-dialog label="Self-certification"> + ${this.renderContentWhenEligible()} + </sl-dialog>`}};__decorate$E([n$5({type:Object})],ChromedashSelfCertifyDialog.prototype,"gate",void 0),__decorate$E([n$5({type:Number})],ChromedashSelfCertifyDialog.prototype,"voteValue",void 0),__decorate$E([n$5({attribute:!1})],ChromedashSelfCertifyDialog.prototype,"resolve",void 0),ChromedashSelfCertifyDialog=__decorate$E([t$3("chromedash-self-certify-dialog")],ChromedashSelfCertifyDialog);var __decorate$D=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let secondarySurveyDialogEl;function isTestingGate(gate){return gate.gate_type===GATE_TYPES.TESTING_PLAN||gate.gate_type===GATE_TYPES.TESTING_SHIP}function shouldShowSecondarySurveyDialog(gate){return isTestingGate(gate)}async function maybeOpenSecondarySurveyDialog(gate){return shouldShowSecondarySurveyDialog(gate)?new Promise(resolve=>{openSecondarySurveyDialog(gate,resolve)}):Promise.resolve()}async function openSecondarySurveyDialog(gate,resolve){secondarySurveyDialogEl||(secondarySurveyDialogEl=document.createElement("chromedash-secondary-survey-dialog"),document.body.appendChild(secondarySurveyDialogEl)),secondarySurveyDialogEl.gate=gate,secondarySurveyDialogEl.resolve=resolve,await secondarySurveyDialogEl.updateComplete,secondarySurveyDialogEl.show()}let ChromedashSecondarySurveyDialog=class ChromedashSecondarySurveyDialog extends i$4{constructor(){super(...arguments),this.resolve=()=>{console.log("Missing resolve action")}}static get styles(){return[...SHARED_STYLES,i$7` + ol { + padding-left: var(--content-padding-half); + } + + ol li { + margin-bottom: var(--content-padding); + } + sl-button { + float: right; + margin: var(--content-padding-half); + } + `]}show(){this.renderRoot.querySelector("sl-dialog")?.show()}hide(){this.renderRoot.querySelector("sl-dialog")?.hide()}generateTestingComment(){const answer1=this.renderRoot.querySelector("#coverage").value,answer2=this.renderRoot.querySelector("#performance_tests").value,answer3=this.renderRoot.querySelector("#automation").value,answer4=this.renderRoot.querySelector("#impact").value,commentText=`Survey answers: +> 1. Does your feature have sufficient automated +> test coverage (Unit tests, WPT, browser tests +> and other integration tests)? + +${answer1} + +> 2. How are performance tests conducted on +> Chromium builders? + +${answer2} + +> 3. Does this feature have non-automatable test +> cases that require manual testing? Do you have +> a plan to get them tested? + +${answer3} + +> 4. If your feature impacts Google products, +> please fill in go/chrome-wp-test-survey. + +${answer4} +`;this.resolve(commentText)}handleGenerateComment(){isTestingGate(this.gate)&&this.generateTestingComment(),this.hide()}renderTestingContent(){const option1a="Yes. My feature met the minimum automated test coverage and health requirements.",option1b="No. My feature does not meet the requirements.",option3a="No. All feature related test cases are automated.",option3b="Yes. There are non-automatable test cases and I have completed test execution or allocated resources to ensure the coverage of these test cases.",option3c="Yes. There are non-automatable test cases and my feature impacts Google products.";return x$1` + <ol> + <li> + <b + >Does your feature have sufficient automated test coverage (Unit + tests, WPT, browser tests and other integration tests)?</b + > + Chrome requires at least 70% automation code coverage (<a + href="https://analysis.chromium.org/coverage/p/chromium" + target="_blank" + >dashboard</a + >) running on the main/release branch and 70% Changelist + <a + href="https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/testing/code_coverage_in_gerrit.md" + target="_blank" + >code coverage in Gerrit</a + >? Do the automated tests have more than 93% green (flakiness < 7%) on + CQ and CI builders? + + <sl-radio-group id="coverage"> + <sl-radio value="${"Yes. My feature met the minimum automated test coverage and health requirements."}" size="small"> ${"Yes. My feature met the minimum automated test coverage and health requirements."} </sl-radio> + <sl-radio value="${option1b}" size="small"> ${option1b} </sl-radio> + </sl-radio-group> + </li> + + <li> + <b>How are performance tests conducted on Chromium builders?</b> List + links to tests if any. + + <sl-textarea id="performance_tests" size="small" rows="2"> + </sl-textarea> + </li> + + <li> + <b + >Does this feature have non-automatable test cases that require + manual testing? Do you have a plan to get them tested?</b + > + + <sl-radio-group id="automation"> + <sl-radio value="${option3a}" size="small"> ${option3a} </sl-radio> + <sl-radio value="${option3b}" size="small"> ${option3b} </sl-radio> + <sl-radio value="${option3c}" size="small"> ${option3c} </sl-radio> + </sl-radio-group> + </li> + + <li> + <b + >If your feature impacts Google products, please fill in + <a href="http://go/chrome-wp-test-survey" target="_blank" + >go/chrome-wp-test-survey</a + >.</b + > + Make a copy, answer the survey questions, and provide a link to your + document here. + <sl-textarea id="impact" size="small" rows="2"> </sl-textarea> + </li> + </ol> + `}render(){return void 0===this.gate?x$1`Loading gates...`:x$1` <sl-dialog label="Additional questions"> + ${isTestingGate(this.gate)?this.renderTestingContent():E$1} + <div> + <sl-button + id="generate_button" + size="small" + variant="primary" + @click=${this.handleGenerateComment} + >Generate comment and request review</sl-button + > + </div> + </sl-dialog>`}};__decorate$D([n$5({type:Object})],ChromedashSecondarySurveyDialog.prototype,"gate",void 0),__decorate$D([n$5({attribute:!1})],ChromedashSecondarySurveyDialog.prototype,"resolve",void 0),ChromedashSecondarySurveyDialog=__decorate$D([t$3("chromedash-secondary-survey-dialog")],ChromedashSecondarySurveyDialog);var __decorate$C=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let prevoteDialogEl;function findMissingFields(feature){const missingFields=[];return feature.web_feature&&"Missing feature"!==feature.web_feature||missingFields.push({name:"Web feature",field:"web_feature"}),missingFields}function shouldShowPrevoteDialog(feature,pendingGates,gate,vote){return(0<pendingGates.length||0<findMissingFields(feature).length)&&gate.gate_type==GATE_TYPES.API_SHIP&&vote==VOTE_OPTIONS.APPROVED[0]}async function maybeOpenPrevoteDialog(feature,featureGates,stage,gate,vote){const pendingGates=findPendingGates(featureGates,stage);return shouldShowPrevoteDialog(feature,pendingGates,gate,vote)?new Promise(resolve=>{openPrevoteDialog(feature,pendingGates,resolve)}):Promise.resolve()}async function openPrevoteDialog(feature,pendingGates,resolve){prevoteDialogEl||(prevoteDialogEl=document.createElement("chromedash-prevote-dialog"),document.body.appendChild(prevoteDialogEl)),prevoteDialogEl.feature=feature,prevoteDialogEl.pendingGates=pendingGates,prevoteDialogEl.resolve=resolve,await prevoteDialogEl.updateComplete,prevoteDialogEl.show()}let ChromedashPrevoteDialog=class ChromedashPrevoteDialog extends i$4{constructor(){super(...arguments),this.resolve=()=>{console.log("Missing resolve action")}}static get styles(){return[...SHARED_STYLES,i$7` + #prereqs-list li { + margin-left: 8px; + margin-bottom: 8px; + } + #prereqs-header { + margin-bottom: 8px; + } + sl-button { + float: right; + margin: var(--content-padding-half); + } + `]}show(){this.renderRoot.querySelector("sl-dialog")?.show()}hide(){this.renderRoot.querySelector("sl-dialog")?.hide()}handleCancel(){this.hide()}handleProceed(){this.resolve(),this.hide()}renderGateItem(gate){return x$1` + <li> + <a + href="/feature/${gate.feature_id}?gate=${gate.id}" + @click=${this.hide} + >${gate.team_name}</a + > + </li> + `}renderGatesSection(){return void 0===this.pendingGates?x$1`Loading gates...`:0==this.pendingGates.length?E$1:x$1` + <div id="gates-header">The following gates are missing approvals:</div> + <ul id="gates-list"> + ${this.pendingGates.map(gate=>this.renderGateItem(gate))} + </ul> + <br /> + `}renderEditLink(item){return x$1` + <a + class="edit-progress-item" + href="/guide/stage/${this.feature.id}/metadata#id_${item.field}" + @click=${this.hide} + > + Edit + </a> + `}renderFieldItem(item){return x$1` <li class="pending"> + Metadata: ${item.name} ${this.renderEditLink(item)} + </li>`}renderFieldsSection(){const missingFields=findMissingFields(this.feature);return 0==missingFields.length?E$1:x$1` + <div id="fields-header"> + The following prerequisite fields are missing: + </div> + <ul id="fields-list"> + ${missingFields.map(mf=>this.renderFieldItem(mf))} + </ul> + <br /> + `}render(){return x$1` <sl-dialog label="Prerequsites for API Owner approval"> + ${this.renderFieldsSection()} ${this.renderGatesSection()} + <sl-button size="small" @click=${this.handleProceed} + >Approve anyway</sl-button + > + <sl-button size="small" variant="warning" @click=${this.handleCancel} + >Don't approve yet</sl-button + > + </sl-dialog>`}};__decorate$C([n$5({type:Object})],ChromedashPrevoteDialog.prototype,"feature",void 0),__decorate$C([n$5({type:Array})],ChromedashPrevoteDialog.prototype,"pendingGates",void 0),__decorate$C([n$5({attribute:!1})],ChromedashPrevoteDialog.prototype,"resolve",void 0),ChromedashPrevoteDialog=__decorate$C([t$3("chromedash-prevote-dialog")],ChromedashPrevoteDialog);var __decorate$B=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashGateColumn=class ChromedashGateColumn extends i$4{constructor(){super(...arguments),this.voteSelectRef=e$1(),this.commentAreaRef=e$1(),this.postToThreadRef=e$1(),this.assigneeSelectRef=e$1(),this.votes=[],this.comments=[],this.needsSave=!1,this.showSaved=!1,this.submittingComment=!1,this.submittingVote=!1,this.needsPost=!1,this.loading=!0}static get styles(){return[...SHARED_STYLES,i$7` + #close-button { + font-size: 2em; + position: absolute; + top: var(--content-padding-quarter); + right: var(--content-padding-quarter); + } + + #review-status-area { + margin: var(--content-padding-half) 0; + } + .status { + display: flex; + gap: var(--content-padding-half); + align-items: center; + font-weight: 500; + } + sl-icon { + font-size: 1.3rem; + } + .approved { + color: var(--gate-approved-color); + } + .approved sl-icon { + color: var(--gate-approved-icon-color); + } + .denied { + color: var(--gate-denied-color); + } + .denied sl-icon { + color: var(--gate-denied-icon-color); + } + #slo-area sl-icon { + font-size: 16px; + vertical-align: text-bottom; + color: var(--unimportant-text-color); + } + .overdue, + #slo-area .overdue sl-icon { + color: var(--slo-overdue-color); + } + + .process-notice { + margin: var(--content-padding-half) 0; + padding: var(--content-padding-half); + background: var(--light-accent-color); + border-radius: 8px; + } + + #votes-area { + margin: var(--content-padding) 0; + } + #votes-area table { + border-spacing: var(--content-padding-half) var(--content-padding); + } + #votes-area th { + font-weight: 500; + } + table .your-vote { + font-style: italic; + white-space: nowrap; + } + + .instructions { + padding: var(--content-padding-half); + margin-bottom: var(--content-padding-large); + } + + #controls { + padding: var(--content-padding); + text-align: right; + display: flex; + justify-content: space-between; + align-items: center; + } + #controls * + * { + padding-left: var(--content-padding); + } + `]}setContext(feature,stageId,gate){this.loading=!0,this.feature=feature,this.gate=gate;const featureId=this.feature.id;Promise.all([window.csClient.getFeatureProgress(featureId),window.csClient.getFeatureProcess(featureId),window.csClient.getStage(featureId,stageId),window.csClient.getVotes(featureId,null),window.csClient.getComments(featureId,gate.id)]).then(([progress,process,stage,votesRes,commentRes])=>{this.progress=progress,this.process=process,this.stage=stage,this.votes=votesRes.votes.filter(v=>v.gate_id==this.gate.id),this.comments=commentRes.comments,this.needsSave=!1,this.showSaved=!1,this.submittingComment=!1,this.submittingVote=!1,this.needsPost=!1,this.loading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later."),this.handleCancel()})}reloadComments(){const commentArea=this.commentAreaRef.value;commentArea&&(commentArea.value=""),this.needsPost=!1,Promise.all([window.csClient.getComments(this.feature.id,this.gate.id)]).then(([commentRes])=>{this.comments=commentRes.comments}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later."),this.handleCancel()})}refetch(){const featureId=this.feature.id;Promise.all([window.csClient.getGates(featureId),window.csClient.getVotes(featureId,null),window.csClient.getComments(featureId,this.gate.id)]).then(([gatesRes,votesRes,commentRes])=>{for(const g of gatesRes.gates)g.id==this.gate.id&&(this.gate=g);this.votes=votesRes.votes.filter(v=>v.gate_id==this.gate.id),this.comments=commentRes.comments,this.needsSave=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later."),this.handleCancel()})}_fireEvent(eventName,detail){const event=new CustomEvent(eventName,{bubbles:!0,composed:!0,detail});this.dispatchEvent(event)}checkNeedsPost(){let newNeedsPost=!1;const commentArea=this.commentAreaRef.value,newVal=commentArea&&commentArea.value.trim()||"";""!=newVal&&(newNeedsPost=!0),this.needsPost=newNeedsPost}handlePost(){const commentArea=this.commentAreaRef.value,commentText=commentArea?.value.trim(),postToThreadType=this.postToThreadRef.value?.checked?this.gate.gate_type:0;this.postComment(commentText,postToThreadType)}async postComment(commentText,postToThreadType=0){this.submittingVote=!0,""!=commentText&&(await window.csClient.postComment(this.feature.id,this.gate.id,commentText,+postToThreadType).then(()=>{this.reloadComments(),this.submittingVote=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later."),this.submittingVote=!1}))}handleSelectChanged(){this.needsSave=!0,this.showSaved=!1}saveVote(){this.submittingComment=!0;const vote=+this.voteSelectRef.value.value;window.csClient.setVote(this.feature.id,this.gate.id,vote).then(()=>{this.needsSave=!1,this.showSaved=!0,this.submittingComment=!1,this._fireEvent("refetch-needed",{})}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later."),this.submittingComment=!1})}handleSave(){Promise.all([window.csClient.getGates(this.feature.id)]).then(([gatesRes])=>{this.featureGates=gatesRes.gates;const vote=+this.voteSelectRef.value.value;maybeOpenPrevoteDialog(this.feature,this.featureGates,this.stage,this.gate,vote).then(()=>{this.saveVote()})}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}handleCancel(){this._fireEvent("close",{})}renderHeadingsSkeleton(){return x$1` + <h3 class="sl-skeleton-header-container" style="width: 60%"> + <sl-skeleton effect="sheen"></sl-skeleton> + </h3> + <h2 + class="sl-skeleton-header-container" + style="margin-top: 4px; width: 75%" + > + <sl-skeleton effect="sheen"></sl-skeleton> + </h2> + `}renderHeadings(){const processStage=findProcessStage(this.stage,this.process),processStageName=processStage?processStage.name:E$1;return x$1` + <h3>${processStageName}</h3> + <h2>${this.gate.team_name}</h2> + `}renderReviewStatusSkeleton(){return x$1` + <h3 class="sl-skeleton-header-container"> + Status: <sl-skeleton effect="sheen"></sl-skeleton> + </h3> + `}async handleReviewRequested(){const featureId=this.feature.id;window.csClient.getGates(featureId).then(gatesRes=>{for(const g of gatesRes.gates)g.id==this.gate.id&&(this.gate=g);maybeOpenCertifyDialog(this.gate,VOTE_NA_SELF).then(selfCertifying=>{selfCertifying?this.handleSelfCertify(VOTE_NA_SELF):maybeOpenSecondarySurveyDialog(this.gate).then(commentText=>{commentText&&this.postComment(commentText),this.handleFullReviewRequest()})})})}async handleNARequested(){const featureId=this.feature.id;window.csClient.getGates(featureId).then(gatesRes=>{for(const g of gatesRes.gates)g.id==this.gate.id&&(this.gate=g);maybeOpenCertifyDialog(this.gate,VOTE_NA_SELF).then(selfCertifying=>{selfCertifying?this.handleSelfCertify(VOTE_NA_SELF):this.handleFullNARequested()})})}handleFullNARequested(){openNaRationaleDialog(this.gate).then(rationale=>{this.handleNARequestSubmitted(rationale)})}async handleFullReviewRequest(){await window.csClient.setVote(this.feature.id,this.gate.id,GATE_REVIEW_REQUESTED),this._fireEvent("refetch-needed",{})}async handleSelfCertify(voteValue){await window.csClient.setVote(this.feature.id,this.gate.id,voteValue);const commentText="This \"N/A\" was self-certified.";await this.postComment("This \"N/A\" was self-certified."),this._fireEvent("refetch-needed",{})}async handleNARequestSubmitted(rationale){await window.csClient.setVote(this.feature.id,this.gate.id,GATE_NA_REQUESTED);const commentText="An \"N/A\" response is requested because: "+rationale;await this.postComment(commentText),this._fireEvent("refetch-needed",{})}userCanRequestReview(){return this.user&&(this.user.can_edit_all||this.user.editable_features.includes(this.feature.id))}userCanVote(){return this.user&&this.user.approvable_gate_types.includes(this.gate.gate_type)}renderAction(processStage,action){const label=action.name,url=action.url.replace("{feature_id}",this.feature.id).replace("{gate_id}",this.gate.id||0),checkCompletion=()=>somePendingPrereqs(action,this.progress)||somePendingGates(this.featureGates,this.stage)?void openPreflightDialog(this.feature,this.progress,this.process,action,processStage,this.stage,this.featureGates,url):void setTimeout(()=>{const draftWindow=window.open(url,"_blank");draftWindow.focus()}),loadThenCheckCompletion=()=>{Promise.all([window.csClient.getGates(this.feature.id)]).then(([gatesRes])=>{this.featureGates=gatesRes.gates,checkCompletion()}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})};return x$1` + <sl-button + @click=${loadThenCheckCompletion} + size="small" + variant="primary" + >${label}</sl-button + > + `}renderReviewStatusPreparing(){if(!this.userCanRequestReview())return x$1` Review has not been requested yet. `;const processStage=findProcessStage(this.stage,this.process);return 0<processStage?.actions?.length&&"API Owners"==this.gate.team_name?processStage.actions.map(act=>this.renderAction(processStage,act)):x$1` + <sl-button + size="small" + variant="primary" + @click=${this.handleReviewRequested} + >Request review</sl-button + > + <sl-button size="small" @click=${this.handleNARequested} + >Request N/A</sl-button + > + `}renderReviewStatusNeedsWork(){const rereviewButton=this.userCanRequestReview()?x$1` + <div> + <sl-button + size="small" + variant="primary" + @click=${this.handleReviewRequested} + >Re-request review</sl-button + > + </div> + `:E$1;return x$1` + <div>Reviewer has indicated a need for rework.</div> + ${rereviewButton} + `}renderReviewRequest(){for(const v of this.votes)if(v.state===GATE_REVIEW_REQUESTED||v.state===GATE_NA_REQUESTED){const shortVoter=v.set_by.split("@")[0]+"@";return x$1` + ${shortVoter} requested on + ${renderAbsoluteDate(this.gate.requested_on)} + ${renderRelativeDate(this.gate.requested_on)} + `}return E$1}renderReviewStatusApproved(){return x$1` + <div class="status approved"> + <sl-icon library="material" name="check_circle_filled_20px"></sl-icon> + Approved + </div> + `}renderReviewStatusNa(){return x$1` + <div class="status approved"> + <sl-icon library="material" name="check_circle_filled_20px"></sl-icon> + N/a + </div> + `}renderReviewStatusNaSelf(){return x$1` + <div class="status approved"> + <sl-icon library="material" name="check_circle_filled_20px"></sl-icon> + N/a (self-certified) + </div> + `}renderReviewStatusNaVerified(){return x$1` + <div class="status approved"> + <sl-icon library="material" name="check_circle_filled_20px"></sl-icon> + N/a (self-certified then verified) + </div> + `}renderReviewStatusDenied(){return x$1` + <div class="status denied"> + <sl-icon library="material" name="block_20px"></sl-icon> + Denied + </div> + `}renderReviewStatus(){return this.gate.state==GATE_PREPARING?this.renderReviewStatusPreparing():this.gate.state==VOTE_OPTIONS.NEEDS_WORK[0]?this.renderReviewStatusNeedsWork():this.gate.state==VOTE_OPTIONS.NA[0]?this.renderReviewStatusNa():this.gate.state==VOTE_NA_SELF?this.renderReviewStatusNaSelf():this.gate.state==VOTE_NA_VERIFIED?this.renderReviewStatusNaVerified():this.gate.state==VOTE_OPTIONS.APPROVED[0]?this.renderReviewStatusApproved():this.gate.state==VOTE_OPTIONS.DENIED[0]?this.renderReviewStatusDenied():E$1}renderSLOStatusSkeleton(){return x$1` + <details> + <summary>SLO initial response:</summary> + Loading... + </details> + <details> + <summary>SLO resolution:</summary> + Loading... + </details> + `}dayPhrase(count){return count+""+(1==count?" day":" days")}renderSLOSummary(limit,remaining,took){if("number"==typeof took)return x$1`took ${this.dayPhrase(took)}`;if("number"==typeof remaining){let msg=x$1`due today`,className="";return 0<remaining?msg=x$1`${this.dayPhrase(remaining)} remaining`:0>remaining&&(className="overdue",msg=x$1`${this.dayPhrase(-remaining)} overdue`),x$1` + <span class="${className}"> + <sl-icon library="material" name="clock_loader_60_20px"></sl-icon> + ${msg} + </span> + `}return"number"==typeof limit?x$1`${this.dayPhrase(limit)} allowed`:E$1}renderSLOStatus(){const initialLimit=this.gate?.slo_initial_response,initialRemaining=this.gate?.slo_initial_response_remaining,initialTook=this.gate?.slo_initial_response_took,resolveLimit=this.gate?.slo_resolve,resolveRemaining=this.gate?.slo_resolve_remaining,resolveTook=this.gate?.slo_resolve_took,needsWorkStartedOn=this.gate?.needs_work_started_on,initialLine=x$1` + <details> + <summary> + SLO initial response: + ${this.renderSLOSummary(initialLimit,initialRemaining,initialTook)} + </summary> + Reviewers are encouraged to provide an initial review status update or a + comment within this number of weekdays. + </details> + `;let resolveLine=x$1` + <details> + <summary> + SLO resolution: + ${this.renderSLOSummary(resolveLimit,resolveRemaining,resolveTook)} + </summary> + Reviewers are encouraged to resolve the review within this number of + weekdays. If a reviewer responds with "Needs work", this clock pauses + until a feature owner clicks "Re-request review". + </details> + `,needsWorkLine=E$1;return"string"==typeof needsWorkStartedOn&&(resolveLine=E$1,needsWorkLine=x$1` + <details> + <summary> + SLO resolution: Needs work since ${needsWorkStartedOn.split(" ")[0]} + </summary> + A reviewer has asked the feature owner to do needed work. Check the + comments for a description of the needed work. The SLO clock is paused + until a feature owner clicks "Re-request review". + </details> + `),x$1`${initialLine} ${resolveLine} ${needsWorkLine}`}renderGateRationale(){const rationale=GATE_RATIONALE[this.gate?.gate_type];return rationale?x$1` + <details> + <summary>Why this gate?</summary> + ${rationale} + </details> + `:E$1}renderWarnings(){return this.gate&&["Privacy","WP Security"].includes(this.gate.team_name)?x$1` + <div class="process-notice"> + Googlers: Please follow the instructions at + <a + href="https://goto.corp.google.com/wp-launch-guidelines" + target="_blank" + rel="noopener" + >go/wp-launch-guidelines</a + > + (internal document) to determine whether you also require an internal + review. + </div> + `:E$1}renderVotesSkeleton(){return x$1` + <table> + <tr> + <th>Reviewer</th> + <th>Review status</th> + </tr> + <tr> + <td><sl-skeleton effect="sheen"></sl-skeleton></td> + <td><sl-skeleton effect="sheen"></sl-skeleton></td> + </tr> + </table> + `}findStateName(state){if(state==GATE_REVIEW_REQUESTED)return"Review requested";if(state==VOTE_NA_SELF)return"N/a (self-certified)";if(state==VOTE_NA_VERIFIED)return"N/a (verified)";for(const item of Object.values(VOTE_OPTIONS))if(item[0]==state)return item[1];return`State ${state}`}renderVoteReadOnly(vote){return this.findStateName(vote.state)}renderVoteMenu(state){return x$1` + <sl-select + name="${this.gate.id}" + value="${state}" + ${n$2(this.voteSelectRef)} + @sl-change=${this.handleSelectChanged} + hoist + size="small" + > + ${this.votes.some(v=>v.state===VOTE_NA_SELF||v.state===VOTE_NA_VERIFIED)?x$1` <sl-option value="${VOTE_NA_VERIFIED}" + >N/a verified</sl-option + >`:E$1} + ${Object.values(VOTE_OPTIONS).map(valName=>x$1` <sl-option value="${valName[0]}">${valName[1]}</sl-option>`)} + </sl-select> + `}renderSaveButton(){return x$1` + <sl-button + size="small" + variant="primary" + @click=${this.handleSave} + ?disabled=${this.submittingComment} + >Save</sl-button + > + `}renderVoteRow(vote,canVote){const shortVoter=vote.set_by.split("@")[0]+"@";let saveButton=E$1,voteCell=this.renderVoteReadOnly(vote);return canVote&&vote.set_by==this.user?.email&&(voteCell=this.renderVoteMenu(vote.state),this.needsSave?saveButton=this.renderSaveButton():this.showSaved&&(saveButton=x$1`<b>Saved</b>`)),x$1` + <tr> + <td title=${vote.set_by}>${shortVoter}</td> + <td>${voteCell}</td> + <td>${saveButton}</td> + </tr> + `}renderAddVoteRow(){const assignedToMe=this.gate.assignee_emails.includes(this.user.email),shortVoter=this.user.email.split("@")[0]+"@",yourLabel=assignedToMe?x$1`<td title=${this.user.email}>${shortVoter}</td>`:x$1`<td class="your-vote">Awaiting review</td>`,voteCell=this.renderVoteMenu(VOTE_OPTIONS.NO_RESPONSE[0]),saveButton=this.needsSave?this.renderSaveButton():E$1;return x$1` + <tr> + ${yourLabel} + <td>${voteCell}</td> + <td>${saveButton}</td> + </tr> + `}renderPendingVote(assigneeEmail){const shortVoter=assigneeEmail.split("@")[0]+"@";return x$1` + <tr> + <td title=${assigneeEmail}>${shortVoter}</td> + <td>No response yet</td> + <td></td> + </tr> + `}saveAssignedReviewer(){const assignee=this.assigneeSelectRef.value?.value,assigneeList=""===assignee?[]:[assignee];window.csClient.updateGate(this.feature.id,this.gate.id,assigneeList).then(()=>this._fireEvent("refetch-needed",{}))}renderAssignReviewerControls(){if(!this.userCanRequestReview()&&!this.userCanVote())return E$1;if(this.gate.state===VOTE_OPTIONS.APPROVED[0])return E$1;const currentAssignee=0<this.gate.assignee_emails?.length?this.gate.assignee_emails[0]:"";return x$1` + <details> + <summary>Assign a reviewer</summary> + <sl-select + hoist + size="small" + ${n$2(this.assigneeSelectRef)} + value=${currentAssignee} + > + <sl-option value="">None</sl-option> + ${this.gate.possible_assignee_emails.map(email=>x$1` <sl-option value="${email}">${email}</sl-option>`)} + </sl-select> + <sl-button + size="small" + variant="primary" + @click=${()=>this.saveAssignedReviewer()} + >Assign</sl-button + > + </details> + `}isReviewRequest(vote){return vote.state===GATE_REVIEW_REQUESTED||vote.state===GATE_NA_REQUESTED}renderVotes(){const canVote=this.userCanVote(),responses=this.votes.filter(v=>!this.isReviewRequest(v)),responseEmails=responses.map(v=>v.set_by),othersPending=this.gate.assignee_emails.filter(ae=>!responseEmails.includes(ae)&&ae!=this.user?.email),myResponseExists=responses.some(v=>v.set_by==this.user?.email),addVoteRow=canVote&&!myResponseExists?this.renderAddVoteRow():E$1,assignControls=this.renderAssignReviewerControls();return canVote||0!==responses.length||0!==othersPending.length?x$1` + <table> + <tr> + <th>Reviewer</th> + <th>Review status</th> + </tr> + ${responses.map(v=>this.renderVoteRow(v,canVote))} + ${othersPending.map(ae=>this.renderPendingVote(ae))} ${addVoteRow} + </table> + ${assignControls} + `:x$1` + <p>No review activity yet.</p> + ${assignControls} + `}renderCommentsSkeleton(){return x$1` + <h2>Comments</h2> + <sl-skeleton effect="sheen"></sl-skeleton> + `}gateHasIntentThread(){return"API Owners"===this.gate.team_name}canPostTo(threadArchiveUrl){return threadArchiveUrl&&(threadArchiveUrl.startsWith("https://groups.google.com/a/chromium.org/d/msgid/blink-dev/")||threadArchiveUrl.startsWith("https://groups.google.com/d/msgid/jrobbins-test"))}renderControls(){const canComment=this.user?.can_comment||this.userCanRequestReview();if(!canComment)return E$1;const postButton=x$1` + <sl-button + variant="primary" + @click=${this.handlePost} + ?disabled=${!this.needsPost||this.submittingVote} + size="small" + >Post</sl-button + > + `,checkboxLabel=this.stage.intent_thread_url?x$1` + Also post to + <a href=${this.stage.intent_thread_url} target="_blank" + >intent thread</a + > + `:"Also post to intent thread",postToThreadCheckbox=this.gateHasIntentThread()?x$1` + <sl-checkbox + ${n$2(this.postToThreadRef)} + ?disabled=${!this.canPostTo(this.stage.intent_thread_url)} + size="small" + >${checkboxLabel}</sl-checkbox + > + `:E$1,escalation=this.gate.escalation_email?x$1`If needed, you can + <a href="mailto:${this.gate.escalation_email}" target="_blank" + >email the team directly</a + >.`:E$1;return x$1` + <sl-textarea + id="comment_area" + rows="2" + cols="40" + resize="auto" + ${n$2(this.commentAreaRef)} + @sl-change=${this.checkNeedsPost} + @keypress=${this.checkNeedsPost} + placeholder="Add a comment" + ></sl-textarea> + <div id="controls">${postButton} ${postToThreadCheckbox}</div> + <div class="instructions"> + Comments will be visible publicly. Only reviewers will be notified when + a comment is posted. ${escalation} + </div> + `}renderComments(){return x$1` + <h2>Comments</h2> + ${this.renderControls()} + <chromedash-activity-log + .user=${this.user} + .featureId=${this.feature.id} + .narrow=${!0} + .reverse=${!0} + .comments=${this.comments} + > + </chromedash-activity-log> + `}render(){return x$1` + <sl-icon-button + title="Close" + name="x" + id="close-button" + @click=${()=>this.handleCancel()} + ></sl-icon-button> + + ${this.loading?this.renderHeadingsSkeleton():this.renderHeadings()} + + <div id="review-status-area"> + ${this.loading?this.renderReviewStatusSkeleton():this.renderReviewStatus()} + ${this.renderReviewRequest()} + </div> + <div id="slo-area"> + ${this.loading?this.renderSLOStatusSkeleton():this.renderSLOStatus()} + ${this.renderGateRationale()} + </div> + + ${this.renderWarnings()} + + <div id="votes-area"> + ${this.loading?this.renderVotesSkeleton():this.renderVotes()} + </div> + + <chromedash-survey-questions + .loading=${this.loading} + .user=${this.user} + .feature=${this.feature} + .gate=${this.gate} + ></chromedash-survey-questions> + ${this.loading?this.renderCommentsSkeleton():this.renderComments()} + `}};__decorate$B([n$5({type:Object})],ChromedashGateColumn.prototype,"user",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"feature",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"featureGates",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"stage",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"gate",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"progress",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"process",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"votes",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"comments",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"needsSave",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"showSaved",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"submittingComment",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"submittingVote",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"needsPost",void 0),__decorate$B([r$6()],ChromedashGateColumn.prototype,"loading",void 0),ChromedashGateColumn=__decorate$B([t$3("chromedash-gate-column")],ChromedashGateColumn);const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=e$3(class extends i$3{constructor(e){if(super(e),e.type!==t.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){const d=p(s),{values:p$1,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p$1;const h=this.ut??=[],v=[];let x=0,j=d.length-1,k=0,w=p$1.length-1,m,y;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=v$1(d[x],p$1[k]),x++,k++;else if(h[j]===a[w])v[w]=v$1(d[j],p$1[w]),j--,w--;else if(h[x]===a[w])v[w]=v$1(d[x],p$1[w]),s$1(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=v$1(d[j],p$1[k]),s$1(s,d[x],d[j]),j--,k++;else if(!(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x])))M$1(d[x]),x++;else if(m.has(h[j])){const e=y.get(a[k]),t=void 0===e?null:d[e];if(null===t){const e=s$1(s,d[x]);v$1(e,p$1[k]),v[k]=e}else v[k]=v$1(t,p$1[k]),s$1(s,d[x],t),d[e]=null;k++}else M$1(d[j]),j--;for(;k<=w;){const e=s$1(s,v[w+1]);v$1(e,p$1[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&M$1(e)}return this.ut=a,m$1(s,v),T$1}});var __decorate$A=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashGuideEditallPage=class ChromedashGuideEditallPage extends i$4{constructor(){super(...arguments),this.featureId=0,this.appTitle="",this.nextStageToCreateId=0,this.loading=!0,this.submitting=!1,this.previousStageTypeRendered=0,this.sameTypeRendered=0,this.fieldValues=[],this.shippingInfo={closestShippingDate:"",hasShipped:!1,isUpcoming:!1}}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7` + .enterprise-help-text > *, + .enterprise-help-text li { + margin: revert; + padding: revert; + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}fetchData(){this.loading=!0,Promise.all([window.csClient.getFeature(this.featureId),window.csClient.getChannels()]).then(async([feature,channels])=>{this.feature=feature,this.feature.name&&(document.title=`${this.feature.name} - ${this.appTitle}`),this.shippingInfo=await findClosestShippingDate(channels,feature.stages),this.loading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}disconnectedCallback(){super.disconnectedCallback(),document.title=this.appTitle}async registerHandlers(el){if(!el)return;await el.updateComplete;const hiddenTokenField=this.renderRoot.querySelector("input[name=token]");hiddenTokenField.form?.addEventListener("submit",event=>{this.handleFormSubmit(event,hiddenTokenField)}),setupScrollToHash(this)}handleFormSubmit(e,hiddenTokenField){e.preventDefault(),this.submitting=!0;const submitBody=formatFeatureChanges(this.fieldValues,this.featureId);window.csClient.ensureTokenIsValid().then(()=>(hiddenTokenField.value=window.csClient.token,window.csClient.updateFeature(submitBody))).then(()=>{window.location.href=this.getNextPage()}).catch(()=>{this.submitting=!1,showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}handleFormFieldUpdate(event){const value=event.detail.value,index=event.detail.index;if(index>=this.fieldValues.length)throw new Error("Out of bounds index when updating field values.");this.fieldValues[index].touched=!0,this.fieldValues[index].value=value}handleCancelClick(){window.location.href=`/feature/${this.featureId}`}renderSkeletons(){return x$1` + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <section class="flat_form"> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <section class="flat_form"> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}getNextPage(){return`/feature/${this.featureId}`}renderSubheader(){return x$1` + <div id="subheader"> + <h2 id="breadcrumbs"> + <a href=${this.getNextPage()}> + <sl-icon name="arrow-left"></sl-icon> + Edit feature: ${this.loading?"loading...":this.feature.name} + </a> + </h2> + </div> + `}getStageForm(stageType){return FORMS_BY_STAGE_TYPE[stageType]||null}getHelpTextForStage(stageType){return stageType===STAGE_ENT_ROLLOUT?x$1` + <section class="enterprise-help-text"> + <h3>Rollout steps</h3> + <p> + The enterprise release notes focus on changes to the stable + channel. Please add a stage for each milestone where something is + changing on the stable channel. For finch rollouts, use the + milestone where the rollout starts. + </p> + <p> + For example, you may only have a single stage where you roll out + to 100% of users on milestone N. + </p> + <p>A more complex example might look like this:</p> + <ul> + <li> + On milestone N-1, you introduce a flag for early testing of an + upcoming change, or start a deprecation origin trial + </li> + <li> + On milestone N, you start a finch rollout of a feature at 1% and + introduce an enterprise policy for it + </li> + <li>On milestone N+3, you remove the enterprise policy</li> + </ul> + </section> + `:E$1}renderStageSection(formattedFeature,sectionBaseName,feStage,stageFields,featureFieldsDisplayed){if(!stageFields)return E$1;let numberDifferentiation="";this.previousStageTypeRendered&&this.previousStageTypeRendered===feStage.stage_type?(this.sameTypeRendered+=1,numberDifferentiation=` ${this.sameTypeRendered}`):(this.previousStageTypeRendered=feStage.stage_type,this.sameTypeRendered=1);let sectionName=`${sectionBaseName}${numberDifferentiation}`;feStage.display_name&&(sectionName=`${sectionBaseName}: ${feStage.display_name} `);const formFieldEls=stageFields.map(field=>{const featureJSONKey=ALL_FIELDS[field].name||field;if("display_name"===featureJSONKey&&!shouldShowDisplayNameField(this.feature.stages,feStage.stage_type))return E$1;let value=formattedFeature[field],stageId=null;if(STAGE_SPECIFIC_FIELDS.has(featureJSONKey))value=getStageValue(feStage,featureJSONKey),stageId=feStage.id;else if(featureFieldsDisplayed.has(featureJSONKey))return E$1;const index=this.fieldValues.length;return this.fieldValues.push({name:featureJSONKey,touched:!1,value,stageId}),featureFieldsDisplayed.add(featureJSONKey),x$1` + <chromedash-form-field + name=${field} + index=${index} + stageId=${stageId??0} + value=${value} + disabledReason="${getDisabledHelpText(field,feStage)}" + .fieldValues=${this.fieldValues} + .feature=${formattedFeature} + ?forEnterprise=${formattedFeature.is_enterprise_feature} + @form-field-update="${this.handleFormFieldUpdate}" + class="${"enterprise_product_category"===field?"choices":""}" + > + </chromedash-form-field> + `}),id=`${STAGE_SHORT_NAMES[feStage.stage_type]||"metadata"}${this.sameTypeRendered}`.toLowerCase(),isEnterpriseFeatureRollout=formattedFeature.is_enterprise_feature&&feStage.stage_type===STAGE_ENT_ROLLOUT;return{id:feStage.id,item:x$1` + ${renderHTMLIf(!isEnterpriseFeatureRollout,x$1`<h3 id="${id}">${sectionName}</h3>`)} + <section class="flat_form" stage="${feStage.stage_type}"> + ${renderHTMLIf(feStage.stage_type===STAGE_ENT_ROLLOUT,x$1` <sl-button + stage="${feStage.stage_type}" + size="small" + @click="${()=>this.deleteStage(feStage)}" + > + Delete + </sl-button>`)} + ${formFieldEls} + </section> + `}}getForms(formattedFeature,feStages){let fieldsOnly=flattenSections(formattedFeature.is_enterprise_feature?FLAT_ENTERPRISE_METADATA_FIELDS:FLAT_METADATA_FIELDS);const featureFieldsDisplayed=new Set,formsToRender=[this.renderStageSection(formattedFeature,FLAT_METADATA_FIELDS.name,{id:-1},fieldsOnly,featureFieldsDisplayed)];let previousStageType=null;for(const feStage of feStages){const stageForm=this.getStageForm(feStage.stage_type);if(!stageForm)continue;formattedFeature.is_enterprise_feature&&feStage.stage_type!==previousStageType&&(formsToRender.push({id:-2,item:this.getHelpTextForStage(feStage.stage_type)}),previousStageType=feStage.stage_type),fieldsOnly=flattenSections(stageForm),formsToRender.push(this.renderStageSection(formattedFeature,stageForm.name,feStage,fieldsOnly,featureFieldsDisplayed));const extensions=feStage.extensions||[];extensions.forEach(extensionStage=>{fieldsOnly=flattenSections(FLAT_TRIAL_EXTENSION_FIELDS);let sectionName=FLAT_TRIAL_EXTENSION_FIELDS.name;feStage.display_name&&(sectionName=` ${FLAT_TRIAL_EXTENSION_FIELDS.name}: ${feStage.display_name} `),formsToRender.push(this.renderStageSection(formattedFeature,sectionName,extensionStage,fieldsOnly,featureFieldsDisplayed))})}return formsToRender}renderAddStageButton(){const clickHandler=()=>{openAddStageDialog(this.feature.id,this.feature.feature_type_int,this.createNewStage.bind(this))};return renderHTMLIf(this.feature.is_enterprise_feature,x$1` <sl-button size="small" @click="${clickHandler}"> + Add Step + </sl-button>`)}createNewStage(newStage){window.csClient.createStage(this.featureId,{stage_type:{form_field_name:"stage_type",value:newStage.stage_type}}).then(()=>window.csClient.getFeature(this.featureId)).then(feature=>{this.feature=feature}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}deleteStage(stage){confirm("Delete feature?")&&window.csClient.deleteStage(this.featureId,stage.id).then(()=>window.csClient.getFeature(this.featureId)).then(feature=>{this.feature=feature}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}renderForm(){const formattedFeature=formatFeatureForEdit(this.feature);this.fieldValues.feature=this.feature;const submitButtonTitle=this.submitting?"Submitting...":"Submit",formsToRender=this.getForms(formattedFeature,this.feature.stages);return x$1` + <form name="feature_form"> + <input type="hidden" name="token" /> + <chromedash-form-table ${n$2(this.registerHandlers)}> + ${c(formsToRender,form=>form.id,(_,i)=>formsToRender[i].item)} + </chromedash-form-table> + ${this.renderAddStageButton()} + + <section class="final_buttons"> + <input + class="button" + type="submit" + value=${submitButtonTitle} + ?disabled=${this.submitting} + /> + <button + id="cancel-button" + type="reset" + @click=${this.handleCancelClick} + > + Cancel + </button> + </section> + </form> + `}render(){return x$1` + ${this.renderSubheader()} + ${this.loading?E$1:getFeatureOutdatedBanner(this.feature,this.shippingInfo,Date.now(),userCanEdit(this.user,this.feature.id))} + ${this.loading?this.renderSkeletons():this.renderForm()} + `}};__decorate$A([n$5({attribute:!1})],ChromedashGuideEditallPage.prototype,"featureId",void 0),__decorate$A([n$5({attribute:!1})],ChromedashGuideEditallPage.prototype,"user",void 0),__decorate$A([n$5({type:String})],ChromedashGuideEditallPage.prototype,"appTitle",void 0),__decorate$A([n$5({type:Number})],ChromedashGuideEditallPage.prototype,"nextStageToCreateId",void 0),__decorate$A([r$6()],ChromedashGuideEditallPage.prototype,"feature",void 0),__decorate$A([r$6()],ChromedashGuideEditallPage.prototype,"loading",void 0),__decorate$A([r$6()],ChromedashGuideEditallPage.prototype,"submitting",void 0),__decorate$A([r$6()],ChromedashGuideEditallPage.prototype,"previousStageTypeRendered",void 0),__decorate$A([r$6()],ChromedashGuideEditallPage.prototype,"sameTypeRendered",void 0),__decorate$A([r$6()],ChromedashGuideEditallPage.prototype,"fieldValues",void 0),__decorate$A([r$6()],ChromedashGuideEditallPage.prototype,"shippingInfo",void 0),ChromedashGuideEditallPage=__decorate$A([t$3("chromedash-guide-editall-page")],ChromedashGuideEditallPage);var __decorate$z=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashGuideNewPage=class ChromedashGuideNewPage extends i$4{constructor(){super(...arguments),this.userEmail="",this.isEnterpriseFeature=!1,this.fieldValues=[],this.submitting=!1}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7` + table td label input[type='radio']:focus { + box-shadow: 0 0 0 var(--sl-focus-ring-width) + var(--sl-input-focus-ring-color); + } + .process-notice { + margin: var(--content-padding-half) 0; + padding: var(--content-padding-half); + background: var(--light-accent-color); + border-radius: 8px; + } + .process-notice p + p { + margin-top: var(--content-padding-half); + } + `]}async registerHandlers(el){if(!el)return;await el.updateComplete;const hiddenTokenField=this.renderRoot.querySelector("input[name=token]");hiddenTokenField.form?.addEventListener("submit",event=>{this.handleFormSubmit(event,hiddenTokenField)}),setupScrollToHash(this)}handleFormSubmit(event,hiddenTokenField){event.preventDefault();const changesBody=formatFeatureChanges(this.fieldValues,this.featureId),createBody=changesBody.feature_changes;if(this.isEnterpriseFeature)createBody.feature_type=FEATURE_TYPES.FEATURE_TYPE_ENTERPRISE_ID[0];else{const selectedRadio=this.shadowRoot?.querySelector("input[name=\"feature_type\"]:checked");createBody.feature_type=selectedRadio?selectedRadio.value:FEATURE_TYPES.FEATURE_TYPE_INCUBATE_ID[0]}this.submitting=!0,window.csClient.createFeature(createBody).then(resp=>{window.location.href=`/feature/${resp.feature_id}`}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}maybeMakeWebFeatureRequired(){const webFeatureField=this.shadowRoot?.querySelector("chromedash-form-field[name=\"web_feature\"]");if(!webFeatureField)return;let featureType=FEATURE_TYPES.FEATURE_TYPE_INCUBATE_ID[0];for(const fv of this.fieldValues)if("feature_type"==fv.name&&fv.value!==void 0){featureType=fv.value;break}webFeatureField.forceRequired=featureType==FEATURE_TYPES.FEATURE_TYPE_INCUBATE_ID[0]||featureType==FEATURE_TYPES.FEATURE_TYPE_EXISTING_ID[0]}maybeMakeEnterpriseFeatureCategoriesRequired(){const enterpriseFeatureCategoriesField=this.shadowRoot?.querySelector("chromedash-form-field[name=\"enterprise_feature_categories\"]");if(!enterpriseFeatureCategoriesField)return;let enterpriseImpact=ENTERPRISE_IMPACT.IMPACT_NONE[0];for(const fv of this.fieldValues)if("enterprise_impact"===fv.name&&fv.value!==void 0){enterpriseImpact=fv.value;break}enterpriseFeatureCategoriesField.forceRequired=enterpriseImpact>ENTERPRISE_IMPACT.IMPACT_NONE[0]||this.isEnterpriseFeature}handleFormFieldUpdate(event){const value=event.detail.value,index=event.detail.index;if(index>=this.fieldValues.length)throw new Error("Out of bounds index when updating field values.");this.fieldValues[index].touched=!0,this.fieldValues[index].value=value,this.fieldValues[index].isMarkdown=event.detail.isMarkdown,this.maybeMakeWebFeatureRequired(),this.maybeMakeEnterpriseFeatureCategoriesRequired()}renderSubHeader(){return x$1` + <div id="subheader" style="display:block"> + <span style="float:right; margin-right: 2em"> + <a + href="https://github.com/GoogleChrome/chromium-dashboard/issues/new?labels=Feedback&template=process-and-guide-ux-feedback.md" + target="_blank" + rel="noopener" + >Process and UI feedback</a + ></span + > + <h2 data-testid="add-a-feature">Add a feature</h2> + </div> + `}renderWarnings(){return this.isEnterpriseFeature?x$1` + <div class="process-notice"> + <p> + Use this form if your feature should be mentioned in the Enterprise + Release Notes. + </p> + </div> + `:x$1` + <div class="process-notice"> + <p> + Please see the + <a + href="https://www.chromium.org/blink/launching-features" + target="_blank" + rel="noopener" + >Launching features</a + > + page for process instructions. + </p> + + <p> + Googlers: Please follow the instructions at + <a + href="https://goto.corp.google.com/wp-launch-guidelines" + target="_blank" + rel="noopener" + >go/wp-launch-guidelines</a + > + (internal document) to determine whether you also require an + internal review. + </p> + </div> + `}renderForm(){const newFeatureInitialValues={owner:this.userEmail,shipping_year:new Date().getFullYear()};this.fieldValues.feature=this.feature;const formFields=this.isEnterpriseFeature?ENTERPRISE_NEW_FEATURE_FORM_FIELDS:NEW_FEATURE_FORM_FIELDS,renderFormField=(field,className)=>{const fieldProps=ALL_FIELDS[field],featureJSONKey=fieldProps.name||field,initialValue=this.isEnterpriseFeature?fieldProps.enterprise_initial??fieldProps.initial:fieldProps.initial,value=newFeatureInitialValues[field]??initialValue,index=this.fieldValues.length;return this.fieldValues.push({name:featureJSONKey,touched:!0,value}),x$1` + <chromedash-form-field + name=${field} + index=${index} + value=${value} + disabledReason="${getDisabledHelpText(field)}" + .fieldValues=${this.fieldValues} + ?forEnterprise=${this.isEnterpriseFeature} + @form-field-update="${this.handleFormFieldUpdate}" + class="${className||""}"></chromedash-form-field> + </chromedash-form-field> + `},submitLabel=this.submitting?"Submitting...":this.isEnterpriseFeature?"Continue":"Submit";return x$1` + <section id="stage_form"> + <form> + <input type="hidden" name="token" /> + <chromedash-form-table ${n$2(this.registerHandlers)}> + ${this.renderWarnings()} + ${this.isEnterpriseFeature?E$1:renderFormField("feature_type_radio_group","choices")} + ${formFields.map(field=>renderFormField(field,"enterprise_product_category"===field?"choices":null))} + </chromedash-form-table> + <input + type="submit" + class="primary" + value=${submitLabel} + ?disabled=${this.submitting} + /> + </form> + </section> + `}render(){return x$1` ${this.renderSubHeader()} ${this.renderForm()} `}};__decorate$z([n$5({attribute:!1})],ChromedashGuideNewPage.prototype,"userEmail",void 0),__decorate$z([n$5({type:Boolean})],ChromedashGuideNewPage.prototype,"isEnterpriseFeature",void 0),__decorate$z([n$5({type:Number})],ChromedashGuideNewPage.prototype,"featureId",void 0),__decorate$z([n$5({type:Object})],ChromedashGuideNewPage.prototype,"feature",void 0),__decorate$z([r$6()],ChromedashGuideNewPage.prototype,"fieldValues",void 0),__decorate$z([n$5({type:Boolean})],ChromedashGuideNewPage.prototype,"submitting",void 0),ChromedashGuideNewPage=__decorate$z([t$3("chromedash-guide-new-page")],ChromedashGuideNewPage);var __decorate$y=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashGuideStagePage=class ChromedashGuideStagePage extends i$4{constructor(){super(...arguments),this.stageId=0,this.featureId=0,this.intentStage=0,this.appTitle="",this.stageName="",this.feature={},this.isActiveStage=!1,this.loading=!0,this.submitting=!1,this.fieldValues=[]}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7``]}connectedCallback(){super.connectedCallback(),this.fetchData()}handleFormFieldUpdate(event){const value=event.detail.value,index=event.detail.index;if(index>=this.fieldValues.length)throw new Error("Out of bounds index when updating field values.");this.fieldValues[index].touched=!0,this.fieldValues[index].value=value,this.fieldValues[index].isMarkdown=event.detail.isMarkdown}fetchData(){this.loading=!0;const rawQuery=parseRawQuery(window.location.search);let gatePromise=Promise.resolve();"updateExtension"in rawQuery&&(gatePromise=window.csClient.getGates(this.featureId)),Promise.all([window.csClient.getFeature(this.featureId),window.csClient.getStage(this.featureId,this.stageId),gatePromise]).then(([feature,stage,gates])=>{this.feature=feature,this.stage=stage,gates&&(this.gateId=gates.gates.find(g=>g.stage_id===this.stageId).id),this.feature.name&&(document.title=`${this.feature.name} - ${this.appTitle}`),this.feature.active_stage_id===this.stage.id&&(this.isActiveStage=!0),this.featureFormFields=FORMS_BY_STAGE_TYPE[stage.stage_type]||{name:"",sections:[]},this.stageName=this.featureFormFields.name,this.loading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}disconnectedCallback(){super.disconnectedCallback(),document.title=this.appTitle}async registerHandlers(el){if(!el)return;await el.updateComplete;const hiddenTokenField=this.renderRoot.querySelector("input[name=token]");hiddenTokenField.form?.addEventListener("submit",event=>{this.handleFormSubmit(event,hiddenTokenField)}),this.miscSetup(),setupScrollToHash(this)}handleFormSubmit(e,hiddenTokenField){e.preventDefault();const submitBody=formatFeatureChanges(this.fieldValues,this.featureId,this.stageId);this.submitting=!0,window.csClient.ensureTokenIsValid().then(()=>(hiddenTokenField.value=window.csClient.token,window.csClient.updateFeature(submitBody))).then(()=>{window.location.href=this.gateId?`/feature/${this.featureId}?gate=${this.gateId}&initiateExtension`:`/feature/${this.featureId}`}).catch(()=>{this.submitting=!1,showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}miscSetup(){const timelineField=this.renderRoot.querySelector("#id_experiment_timeline");timelineField&&timelineField.value&&(timelineField.disabled=!1)}handleCancelClick(){window.location.href=`/feature/${this.featureId}`}getFormFields(){const fields=this.featureFormFields.sections.reduce((combined,section)=>[...combined,...section.fields],[]);return fields.join()}renderSkeletons(){return x$1` + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <section id="metadata"> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}getNextPage(){return`/feature/${this.featureId}`}renderSubheader(){return x$1` + <div id="subheader"> + <h2 id="breadcrumbs"> + <a href=${this.getNextPage()}> + <sl-icon name="arrow-left"></sl-icon> + Edit feature: ${this.feature.name} + </a> + </h2> + </div> + `}renderFields(formattedFeature,section,feStage){return feStage||(feStage=this.stage),section.fields.map(field=>{if("display_name"===field&&!shouldShowDisplayNameField(this.feature.stages,feStage.stage_type))return E$1;const featureJSONKey=ALL_FIELDS[field].name||field;let value=formattedFeature[featureJSONKey],stageId;STAGE_SPECIFIC_FIELDS.has(featureJSONKey)&&(value=getStageValue(feStage,featureJSONKey),stageId=feStage.id);const index=this.fieldValues.length;return this.fieldValues.push({name:featureJSONKey,touched:!1,value,stageId}),x$1` + <chromedash-form-field + name=${field} + index=${index} + value=${value} + disabledReason="${getDisabledHelpText(field,feStage)}" + .fieldValues=${this.fieldValues} + .feature=${formattedFeature} + stageId=${feStage.id} + ?forEnterprise=${formattedFeature.is_enterprise_feature} + @form-field-update="${this.handleFormFieldUpdate}" + > + </chromedash-form-field> + `})}renderSections(formattedFeature,stageSections){const formSections=[];if(stageSections.forEach(section=>{formSections.push(x$1` + <h3>${section.name}</h3> + <section class="stage_form"> + ${this.renderFields(formattedFeature,section)} + </section> + `)}),this.stage.extensions){let i=1;for(const extensionStage of this.stage.extensions){for(const section of FLAT_TRIAL_EXTENSION_FIELDS.sections)formSections.push(x$1` + <h3>${section.name} ${i}</h3> + <section class="stage_form"> + ${this.renderFields(formattedFeature,section,extensionStage)} + </section> + `);i++}}return formSections}renderForm(){const formattedFeature=formatFeatureForEdit(this.feature);this.fieldValues.feature=this.feature;const submitButtonTitle=this.submitting?"Submitting...":"Submit";return x$1` + <form name="feature_form"> + <input type="hidden" name="token" /> + <chromedash-form-table ${n$2(this.registerHandlers)}> + ${this.renderSections(formattedFeature,this.featureFormFields.sections)} + </chromedash-form-table> + <div class="final_buttons"> + <input + id="submit-button" + class="button" + type="submit" + value=${submitButtonTitle} + ?disabled=${this.submitting} + /> + <button + id="cancel-button" + type="reset" + @click=${this.handleCancelClick} + > + Cancel + </button> + </div> + </form> + `}render(){return x$1` + ${this.renderSubheader()} + ${this.loading?this.renderSkeletons():this.renderForm()} + `}};__decorate$y([n$5({attribute:!1})],ChromedashGuideStagePage.prototype,"stageId",void 0),__decorate$y([n$5({attribute:!1})],ChromedashGuideStagePage.prototype,"featureId",void 0),__decorate$y([n$5({attribute:!1})],ChromedashGuideStagePage.prototype,"intentStage",void 0),__decorate$y([n$5({type:String})],ChromedashGuideStagePage.prototype,"appTitle",void 0),__decorate$y([r$6()],ChromedashGuideStagePage.prototype,"stageName",void 0),__decorate$y([r$6()],ChromedashGuideStagePage.prototype,"feature",void 0),__decorate$y([r$6()],ChromedashGuideStagePage.prototype,"stage",void 0),__decorate$y([r$6()],ChromedashGuideStagePage.prototype,"isActiveStage",void 0),__decorate$y([r$6()],ChromedashGuideStagePage.prototype,"featureFormFields",void 0),__decorate$y([r$6()],ChromedashGuideStagePage.prototype,"loading",void 0),__decorate$y([r$6()],ChromedashGuideStagePage.prototype,"submitting",void 0),__decorate$y([r$6()],ChromedashGuideStagePage.prototype,"fieldValues",void 0),__decorate$y([r$6()],ChromedashGuideStagePage.prototype,"gateId",void 0),ChromedashGuideStagePage=__decorate$y([t$3("chromedash-guide-stage-page")],ChromedashGuideStagePage);var __decorate$x=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashGuideMetadataPage=class ChromedashGuideMetadataPage extends i$4{constructor(){super(...arguments),this.featureId=0,this.appTitle="",this.loading=!0,this.fieldValues=[]}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7``]}connectedCallback(){super.connectedCallback(),this.fetchData()}fetchData(){this.loading=!0,Promise.resolve(window.csClient.getFeature(this.featureId)).then(feature=>{this.feature=feature,this.feature.name&&(document.title=`${this.feature.name} - ${this.appTitle}`),this.loading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}disconnectedCallback(){super.disconnectedCallback(),document.title=this.appTitle}async registerHandlers(el){if(!el)return;await el.updateComplete;const hiddenTokenField=this.renderRoot.querySelector("input[name=token]");hiddenTokenField.form?.addEventListener("submit",event=>{this.handleFormSubmit(event,hiddenTokenField)}),setupScrollToHash(this)}handleFormSubmit(e,hiddenTokenField){e.preventDefault();const submitBody=formatFeatureChanges(this.fieldValues,this.featureId);window.csClient.ensureTokenIsValid().then(()=>(hiddenTokenField.value=window.csClient.token,window.csClient.updateFeature(submitBody))).then(()=>{window.location.href=`/feature/${this.featureId}`}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}handleFormFieldUpdate(event){const value=event.detail.value,index=event.detail.index;if(index>=this.fieldValues.length)throw new Error("Out of bounds index when updating field values.");this.fieldValues[index].touched=!0,this.fieldValues[index].value=value,this.fieldValues[index].isMarkdown=event.detail.isMarkdown}handleCancelClick(){window.location.href=`/feature/${this.featureId}`}getFormFields(){const sections=this.feature.is_enterprise_feature?FLAT_ENTERPRISE_METADATA_FIELDS.sections:FLAT_METADATA_FIELDS.sections,fields=sections.reduce((combined,section)=>[...combined,...section.fields],[]);return fields.join()}renderSkeletons(){return x$1` + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <section id="metadata"> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}getNextPage(){return`/feature/${this.featureId}`}renderSubheader(){const link=this.loading?E$1:x$1` + <a href=${this.getNextPage()}> + <sl-icon name="arrow-left"></sl-icon> + Edit feature: ${this.feature.name} + </a> + `;return x$1` + <div id="subheader"> + <h2 id="breadcrumbs">${link}</h2> + </div> + `}renderFields(formattedFeature,section){return section.fields.map(field=>{const featureJSONKey=ALL_FIELDS[field].name||field,value=formattedFeature[featureJSONKey],index=this.fieldValues.length;return this.fieldValues.push({name:featureJSONKey,touched:!1,value}),x$1` + <chromedash-form-field + name=${field} + index=${index} + value=${value} + disabledReason="${getDisabledHelpText(field)}" + .fieldValues=${this.fieldValues} + .feature=${formattedFeature} + ?forEnterprise=${formattedFeature.is_enterprise_feature} + @form-field-update="${this.handleFormFieldUpdate}" + class="${"enterprise_product_category"===field?"choices":""}" + > + </chromedash-form-field> + `})}renderSections(formattedFeature,sections){return sections.map(section=>x$1` + <h3>${section.name}</h3> + <section class="stage_form"> + ${this.renderFields(formattedFeature,section)} + </section> + `)}renderForm(){const formattedFeature=formatFeatureForEdit(this.feature);this.fieldValues.feature=this.feature;let sections=FLAT_METADATA_FIELDS.sections;return formattedFeature.is_enterprise_feature&&(sections=FLAT_ENTERPRISE_METADATA_FIELDS.sections),x$1` + <form name="feature_form"> + <input type="hidden" name="token" /> + <chromedash-form-table ${n$2(this.registerHandlers)}> + ${this.renderSections(formattedFeature,sections)} + </chromedash-form-table> + + <div class="final_buttons"> + <input class="button" type="submit" value="Submit" /> + <button + id="cancel-button" + type="reset" + @click=${this.handleCancelClick} + > + Cancel + </button> + </div> + </form> + `}render(){return x$1` + ${this.renderSubheader()} + ${this.loading?this.renderSkeletons():this.renderForm()} + `}};__decorate$x([n$5({type:Number})],ChromedashGuideMetadataPage.prototype,"featureId",void 0),__decorate$x([n$5({type:String})],ChromedashGuideMetadataPage.prototype,"appTitle",void 0),__decorate$x([r$6()],ChromedashGuideMetadataPage.prototype,"feature",void 0),__decorate$x([r$6()],ChromedashGuideMetadataPage.prototype,"loading",void 0),__decorate$x([r$6()],ChromedashGuideMetadataPage.prototype,"fieldValues",void 0),ChromedashGuideMetadataPage=__decorate$x([t$3("chromedash-guide-metadata-page")],ChromedashGuideMetadataPage);var __decorate$w=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};class ChromedashGuideVerifyAccuracyPage extends i$4{constructor(){super(...arguments),this.featureId=0,this.appTitle="",this.feature={},this.fieldValues=[],this.loading=!0,this.previousStageTypeRendered=0,this.sameTypeRendered=0,this.submitting=!1}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7` + .verify-banner { + margin-bottom: 12px; + } + #alertUnderline { + text-decoration: underline; + display: inline; + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}fetchData(){this.loading=!0,window.csClient.getFeature(this.featureId).then(feature=>{this.feature=feature,this.feature.name&&(document.title=`${this.feature.name} - ${this.appTitle}`),this.loading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}disconnectedCallback(){super.disconnectedCallback(),document.title=this.appTitle}async registerFormSubmitHandler(el){if(!el)return;await el.updateComplete;const hiddenTokenField=this.renderRoot.querySelector("input[name=token]");hiddenTokenField.form?.addEventListener("submit",event=>{this.handleFormSubmit(event,hiddenTokenField)})}navigateToFeaturePage(){window.location.href=`/feature/${this.featureId}`}handleFormSubmit(e,hiddenTokenField){e.preventDefault();const submitBody=formatFeatureChanges(this.fieldValues,this.featureId);window.csClient.ensureTokenIsValid().then(()=>(hiddenTokenField.value=window.csClient.token,this.submitting=!0,window.csClient.updateFeature(submitBody))).then(()=>{this.navigateToFeaturePage()}).catch(()=>{this.submitting=!1,showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}handleFormFieldUpdate(event){const value=event.detail.value,index=event.detail.index;if(index>=this.fieldValues.length)throw new Error("Out of bounds index when updating field values.");this.fieldValues[index].touched=!0,this.fieldValues[index].value=value}renderSkeletons(){return x$1` + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <section id="metadata"> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}renderSubheader(){return x$1` + <div id="subheader"> + <h2 id="breadcrumbs"> + <a href="/feature/${this.featureId}"> + <sl-icon name="arrow-left"></sl-icon> + Verify feature data for ${this.feature.name} + </a> + </h2> + </div> + `}getStageForm(stageType){return VERIFY_ACCURACY_FORMS_BY_STAGE_TYPE[stageType]||null}renderStageSection(formattedFeature,name,feStage,stageFields){if(!stageFields)return E$1;let numberDifferentiation="";this.previousStageTypeRendered&&this.previousStageTypeRendered===feStage.stage_type?(this.sameTypeRendered+=1,numberDifferentiation=` ${this.sameTypeRendered}`):(this.previousStageTypeRendered=feStage.stage_type,this.sameTypeRendered=1);let sectionName=`${name}${numberDifferentiation}`;feStage.display_name&&(sectionName=`${name}: ${feStage.display_name}`);const formFieldEls=stageFields.map(field=>{let value=formattedFeature[field];const featureJSONKey=ALL_FIELDS[field].name||field;if(STAGE_SPECIFIC_FIELDS.has(field))value=getStageValue(feStage,featureJSONKey);else if(1<this.sameTypeRendered)return E$1;const index=this.fieldValues.length;let touched=!1;return"accurate_as_of"===featureJSONKey&&(touched=!0),this.fieldValues.push({name:featureJSONKey,touched,value,stageId:feStage.id}),x$1` + <chromedash-form-field + name=${field} + index=${index} + value=${value} + disabledReason="${getDisabledHelpText(field,feStage)}" + .fieldValues=${this.fieldValues} + .feature=${formattedFeature} + ?forEnterprise=${formattedFeature.is_enterprise_feature} + @form-field-update="${this.handleFormFieldUpdate}" + > + </chromedash-form-field> + `}),id=`${STAGE_SHORT_NAMES[feStage.stage_type]||"metadata"}${this.sameTypeRendered}`.toLowerCase();return x$1` + <h3 id="${id}">${sectionName}</h3> + <section class="flat_form">${formFieldEls}</section> + `}getForms(formattedFeature,feStages){let fieldsOnly=flattenSections(VERIFY_ACCURACY_METADATA_FIELDS);const formsToRender=[this.renderStageSection(formattedFeature,VERIFY_ACCURACY_METADATA_FIELDS.name,{},fieldsOnly)];let allFormFields=[...fieldsOnly];for(const feStage of feStages){const stageForm=this.getStageForm(feStage.stage_type);stageForm&&(fieldsOnly=flattenSections(stageForm),formsToRender.push(this.renderStageSection(formattedFeature,stageForm.name,feStage,fieldsOnly)),allFormFields=[...allFormFields,...fieldsOnly])}return fieldsOnly=flattenSections(VERIFY_ACCURACY_CONFIRMATION_FIELD),formsToRender.push(this.renderStageSection(formattedFeature,`${VERIFY_ACCURACY_CONFIRMATION_FIELD.name}`,{},fieldsOnly)),allFormFields=[...allFormFields,...fieldsOnly],[allFormFields,formsToRender]}getAllStageIds(){return this.feature.stages.map(feStage=>feStage.id)}renderForm(){const formattedFeature=formatFeatureForEdit(this.feature);this.fieldValues.feature=this.feature;const stageIds=this.getAllStageIds(),[allFormFields,formsToRender]=this.getForms(formattedFeature,this.feature.stages),title=this.feature.accurate_as_of?`Accuracy last verified ${this.feature.accurate_as_of.split(" ")[0]}.`:"Accuracy last verified at time of creation.",submitButtonTitle=this.submitting?"Submitting...":"Submit";return x$1` + <form name="feature_form" method="post"> + <input type="hidden" name="stages" .value="${stageIds}" /> + <input type="hidden" name="token" /> + <input + type="hidden" + name="form_fields" + value=${allFormFields.join(",")} + /> + <h3>${title}</h3> + <sl-alert variant="warning" open class="verify-banner"> + <sl-icon slot="icon" name="info-circle"></sl-icon> + <strong + >Please review your information below and click 'Submit' to confirm + it is accurate, + <p id="alertUnderline">even if no changes are made</p> + !</strong + > + </sl-alert> + <chromedash-form-table ${n$2(this.registerFormSubmitHandler)}> + ${formsToRender} + </chromedash-form-table> + + <section class="final_buttons"> + <input + class="button" + type="submit" + value="${submitButtonTitle}" + ?disabled=${this.submitting} + /> + <button + id="cancel-button" + type="reset" + @click=${this.navigateToFeaturePage} + > + Cancel + </button> + </section> + </form> + `}render(){return x$1` + ${this.renderSubheader()} + ${this.loading?this.renderSkeletons():this.renderForm()} + `}}__decorate$w([n$5({attribute:!1})],ChromedashGuideVerifyAccuracyPage.prototype,"featureId",void 0),__decorate$w([n$5({type:String})],ChromedashGuideVerifyAccuracyPage.prototype,"appTitle",void 0),__decorate$w([r$6()],ChromedashGuideVerifyAccuracyPage.prototype,"feature",void 0),__decorate$w([r$6()],ChromedashGuideVerifyAccuracyPage.prototype,"fieldValues",void 0),__decorate$w([r$6()],ChromedashGuideVerifyAccuracyPage.prototype,"loading",void 0),__decorate$w([r$6()],ChromedashGuideVerifyAccuracyPage.prototype,"previousStageTypeRendered",void 0),__decorate$w([r$6()],ChromedashGuideVerifyAccuracyPage.prototype,"sameTypeRendered",void 0),__decorate$w([r$6()],ChromedashGuideVerifyAccuracyPage.prototype,"submitting",void 0),customElements.define("chromedash-guide-verify-accuracy-page",ChromedashGuideVerifyAccuracyPage);var __decorate$v=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashHeader=class ChromedashHeader extends i$4{constructor(){super(...arguments),this.appTitle="",this.googleSignInClientId="",this.devMode="",this.currentPage="",this.user={},this.loading=!1}static get styles(){return[...SHARED_STYLES,i$7` + :host { + --nav-link-color: var(--sl-color-neutral-700); + --nav-link-font-size: 16px; + --nav-link-hover-background: var(--sl-color-neutral-100); + --nav-link-border: 2px solid transparent; + --nav-link-active-color: var(--cl-color-primary-900); + --nav-link-active-border: 2px solid var(--nav-link-active-color); + } + + header { + display: flex; + align-items: center; + user-select: none; + background: var(--card-background); + border-bottom: var(--card-border); + box-shadow: var(--card-box-shadow); + } + header a { + text-decoration: none !important; + } + header nav { + display: flex; + flex: 1; + align-items: center; + margin: 0 var(--content-padding); + -webkit-font-smoothing: initial; + } + + sl-button[slot='trigger']::part(base) { + color: var(--unimportant-text-color); + } + header aside a { + color: var(--logo-color); + } + header aside h1 { + line-height: 1; + } + header aside img { + height: 24px; + width: 24px; + } + + .flex-container { + display: flex; + justify-content: flex-end; + flex-wrap: wrap; + align-items: center; + width: 100%; + } + + .nav-dropdown-trigger { + display: flex; + align-items: flex-end; + } + .nav-dropdown-trigger sl-icon { + padding-left: var(--content-padding-half); + } + + .menu { + margin-left: 15px; + margin-right: 7px; + align-items: center; + } + .menu:hover { + color: black; + background: var(--nav-link-hover-background); + } + .menu [active] { + color: var(--nav-link-active-color); + border-bottom: var(--nav-link-active-border); + } + + @media only screen and (max-width: 700px) { + header { + --logoSize: 24px; + + margin: 0; + display: flex; + } + header aside { + display: flex; + padding: var(--content-padding-half); + border-radius: 0; + background: inherit; + } + } + `]}connectedCallback(){return super.connectedCallback(),IS_MOBILE||this.user&&this.user.email?void 0:this.user?void(this.loading=!0,window.csClient.getPermissions().then(user=>{this.user=user,this.user||(!window.isPlaywright&&this.initializeGoogleSignIn(),"True"==this.devMode&&this.initializeTestingSignIn())}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")}).finally(()=>{this.loading=!1})):(window.isPlaywright||this.initializeGoogleSignIn(),void("True"==this.devMode&&this.initializeTestingSignIn()))}initializeGoogleSignIn(){google.accounts.id.initialize({client_id:this.googleSignInClientId,callback:this.handleCredentialResponse,use_fedcm_for_prompt:!0}),google.accounts.id.prompt();const signInButton=document.createElement("div");google.accounts.id.renderButton(signInButton,{type:"standard"});const appComponent=document.querySelector("chromedash-app");appComponent?appComponent.insertAdjacentElement("afterbegin",signInButton):this.insertAdjacentElement("afterbegin",signInButton)}initializeTestingSignIn(){const signInTestingButton=document.createElement("button");signInTestingButton.innerText="Sign in as example@chromium.org",signInTestingButton.setAttribute("type","button"),signInTestingButton.setAttribute("data-testid","dev-mode-sign-in-button"),signInTestingButton.setAttribute("style","margin-right: 300px; z-index:1000; background: lightblue; border: 1px solid blue;"),signInTestingButton.addEventListener("click",()=>{fetch("/dev/mock_login",{method:"POST"}).then(response=>{if(!response.ok)throw new Error(`Sign in failed! Response: ${response}`)}).then(()=>{setTimeout(()=>{redirectToCurrentPage()},1e3)}).catch(error=>{console.error("Sign in failed.",error)})});const signInButtonContainer=document.querySelector("chromedash-app");signInButtonContainer?signInButtonContainer.insertAdjacentElement("afterbegin",signInTestingButton):this.insertAdjacentElement("afterbegin",signInTestingButton)}handleCredentialResponse(credentialResponse){window.csClient.signIn(credentialResponse).then(()=>{setTimeout(()=>{redirectToCurrentPage()},1e3)}).catch(()=>{console.error("Sign in failed, so signing out to allow retry"),this.signOut()})}gotoSettings(){window.location.href="/settings"}signOut(){window.csClient.signOut().then(()=>{window.location.reload()})}isCurrentPage(href){return this.currentPage.startsWith(href)}_fireEvent(eventName,detail){const event=new CustomEvent(eventName,{bubbles:!0,composed:!0,detail});this.dispatchEvent(event)}handleDrawer(){this._fireEvent("drawer-clicked",{})}renderAccountMenu(){const alreadyOnNew=this.isCurrentPage("/guide/new")||this.isCurrentPage("/guide/enterprise/new");return x$1` + ${this.user?x$1` + ${this.user.can_create_feature&&!alreadyOnNew?x$1` + <sl-button + data-testid="create-feature-button" + href="/guide/new" + variant="primary" + size="small" + > + Create feature + </sl-button> + `:E$1} + <sl-dropdown> + <sl-button + slot="trigger" + variant="text" + size="medium" + data-testid="account-indicator" + caret + > + ${this.user.email} + </sl-button> + <sl-menu> + <sl-menu-item @click=${this.gotoSettings}> + Settings + </sl-menu-item> + <sl-menu-item + id="sign-out-link" + data-testid="sign-out-link" + @click=${this.signOut} + >Sign out</sl-menu-item + > + </sl-menu> + </sl-dropdown> + `:x$1` <slot></slot> `} + `}render(){let accountMenu=x$1``;return IS_MOBILE||this.loading||(accountMenu=x$1` <div class="flex-container"> + ${this.renderAccountMenu()} + </div>`),x$1` + <header data-testid="header"> + <sl-icon-button + data-testid="menu" + variant="text" + library="material" + class="menu" + style="font-size: 2.4rem;" + name="menu_20px" + @click="${this.handleDrawer}" + > + </sl-icon-button> + <aside> + <a href="/roadmap" target="_top"> + <h1> + <img + src="/static/img/chrome_logo.svg" + alt="" + role="presentation" + /> + ${this.appTitle} + </h1> + </a> + </aside> + <nav>${accountMenu}</nav> + </header> + `}};__decorate$v([n$5({type:String})],ChromedashHeader.prototype,"appTitle",void 0),__decorate$v([n$5({type:String})],ChromedashHeader.prototype,"googleSignInClientId",void 0),__decorate$v([n$5({type:String})],ChromedashHeader.prototype,"devMode",void 0),__decorate$v([n$5({type:String})],ChromedashHeader.prototype,"currentPage",void 0),__decorate$v([n$5({type:Object})],ChromedashHeader.prototype,"user",void 0),__decorate$v([r$6()],ChromedashHeader.prototype,"loading",void 0),ChromedashHeader=__decorate$v([t$3("chromedash-header")],ChromedashHeader);var __decorate$u=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashIntentContent=class ChromedashIntentContent extends i$4{constructor(){super(...arguments),this.appTitle="",this.subject="",this.intentBody=""}static get styles(){return[...SHARED_STYLES,i$7` + #copy-email-body { + cursor: pointer; + color: var(--link-color); + } + .email-content-border { + border: 1px solid #ddd; + box-shadow: rgba(0, 0, 0, 0.067) 1px 1px 4px; + margin: 8px 0 24px 0; + } + .email-content-div { + background: white; + padding: 12px; + } + p { + color: #444; + } + h3 { + margin-bottom: 10px; + &:before { + counter-increment: h3; + content: counter(h3) '.'; + margin-right: 5px; + } + } + #content section > div { + background: white; + border: 1px solid #ddd; + box-shadow: rgba(0, 0, 0, 0.067) 1px 1px 4px; + padding: 12px; + margin: 8px 0 16px 0; + } + #content section > p { + color: #444; + } + + .email .help { + font-style: italic; + color: #aaa; + } + .email h4 { + font-weight: 600; + } + .alertbox { + margin: 2em; + padding: 1em; + background: var(--warning-background); + color: var(--warning-color); + } + .subject { + font-size: 16px; + } + table { + tr[hidden] { + th, + td { + padding: 0; + } + } + + th { + padding: 12px 10px 5px 0; + vertical-align: top; + } + + td { + padding: 6px 10px; + vertical-align: top; + } + + td:first-of-type { + width: 60%; + } + + .helptext { + display: block; + font-size: small; + max-width: 40em; + margin-top: 2px; + } + + input[type='text'], + input[type='url'], + input[type='email'], + textarea { + width: 100%; + font: var(--form-element-font); + } + + select { + max-width: 350px; + } + + :required { + border: 1px solid $chromium-color-dark; + } + + .interacted:valid { + border: 1px solid green; + } + + .interacted:invalid { + border: 1px solid $invalid-color; + } + + input:not([type='submit']):not([type='search']) { + outline: 1px dotted var(--error-border-color); + background-color: #ffedf5; + } + } + `]}renderEmailBody(){return this.intentBody?o$2(this.intentBody):E$1}copyIntentBodyHandler(){const copyEmailBodyEl=this.renderRoot.querySelector("#copy-email-body"),emailBodyEl=this.renderRoot.querySelector(".email");if(copyEmailBodyEl&&emailBodyEl){window.getSelection()?.removeAllRanges();const range=document.createRange();range.selectNode(emailBodyEl),window.getSelection()?.addRange(range),document.execCommand("copy"),showToastMessage("Email body copied")}}render(){return x$1` + <p>Email to</p> + <div class="email-content-border"> + <div class="subject email-content-div">blink-dev@chromium.org</div> + </div> + + <p>Subject</p> + <div class="email-content-border"> + <div class="subject email-content-div" id="email-subject-content"> + ${this.subject} + </div> + </div> + <p> + Body + <span + class="tooltip copy-text" + style="float:right" + title="Copy text to clipboard" + > + <sl-icon + name="copy" + id="copy-email-body" + @click="${()=>this.copyIntentBodyHandler()}" + ></sl-icon> + </span> + </p> + + <div class="email-content-border"> + <div class="email email-content-div" id="email-body-content"> + ${this.renderEmailBody()} + </div> + </div> + `}};__decorate$u([n$5({type:String})],ChromedashIntentContent.prototype,"appTitle",void 0),__decorate$u([n$5({type:String})],ChromedashIntentContent.prototype,"subject",void 0),__decorate$u([n$5({type:String})],ChromedashIntentContent.prototype,"intentBody",void 0),ChromedashIntentContent=__decorate$u([t$3("chromedash-intent-content")],ChromedashIntentContent);var __decorate$t=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let dialogEl;async function openPostIntentDialog(featureId,stageId,ownerEmails,gateId=0){dialogEl||(dialogEl=document.createElement("chromedash-post-intent-dialog"),document.body.appendChild(dialogEl),dialogEl.featureId=featureId,dialogEl.stageId=stageId,dialogEl.gateId=gateId,dialogEl.ownerEmails=ownerEmails,await dialogEl.updateComplete),dialogEl.show()}let ChromedashPostIntentDialog=class ChromedashPostIntentDialog extends i$4{constructor(){super(...arguments),this.featureId=0,this.stageId=0,this.gateId=0,this.ownerEmails=[]}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7` + #prereqs-list li { + margin-left: 8px; + margin-bottom: 8px; + } + #prereqs-header { + margin-bottom: 8px; + } + #update-button { + margin-right: 8px; + } + .float-right { + float: right; + } + sl-input::part(base) { + margin-top: 8px; + } + sl-input[data-user-invalid]::part(base) { + border-color: red; + } + `]}show(){this.shadowRoot.querySelector("sl-dialog").show()}updateAttributes(el){if(!el)return;const attrs=ALL_FIELDS.intent_cc_emails.attrs||{};Object.keys(attrs).map(attr=>{el.setAttribute(attr,attrs[attr])})}renderIntentCCEmailOption(){const fieldInfo=ALL_FIELDS.intent_cc_emails,defaultCCEmails=this.ownerEmails.join(",");return x$1`${fieldInfo.help_text}<br /> + <sl-input + ${n$2(this.updateAttributes)} + id="id_${fieldInfo.name}" + size="small" + autocomplete="off" + .value=${defaultCCEmails} + ?required=${fieldInfo.required} + > + </sl-input>`}submitIntent(){const ccEmailsInput=this.shadowRoot.querySelector("sl-input");if(!ccEmailsInput||ccEmailsInput.hasAttribute("data-user-invalid"))return;const submitButton=this.shadowRoot.querySelector("#submit-intent-button");submitButton&&submitButton.setAttribute("disabled",""),window.csClient.postIntentToBlinkDev(this.featureId,this.stageId,{gate_id:this.gateId,intent_cc_emails:ccEmailsInput?.value?.split(",")}).then(()=>{showToastMessage("Intent submitted! Check for your thread on blink-dev shortly."),setTimeout(()=>{window.location.href=`/feature/${this.featureId}`},3e3)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later."),submitButton&&submitButton.removeAttribute("disabled")})}renderDialog(){return x$1`<sl-dialog label="Post intent to blink-dev"> + <p> + This intent will be sent directly to + <a + href="https://groups.google.com/a/chromium.org/g/blink-dev" + target="_blank" + rel="noopener noreferrer" + >blink-dev</a + >. + </p> + <br /><br /> + ${this.renderIntentCCEmailOption()} + <br /><br /> + <sl-button + class="float-right" + id="submit-intent-button" + variant="primary" + size="small" + @click=${()=>this.submitIntent()} + >Submit intent</sl-button + > + </sl-dialog>`}render(){return this.renderDialog()}};__decorate$t([n$5({type:Number})],ChromedashPostIntentDialog.prototype,"featureId",void 0),__decorate$t([n$5({type:Number})],ChromedashPostIntentDialog.prototype,"stageId",void 0),__decorate$t([n$5({type:Number})],ChromedashPostIntentDialog.prototype,"gateId",void 0),__decorate$t([n$5({attribute:!1})],ChromedashPostIntentDialog.prototype,"ownerEmails",void 0),ChromedashPostIntentDialog=__decorate$t([t$3("chromedash-post-intent-dialog")],ChromedashPostIntentDialog);var __decorate$s=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashIntentPreviewPage=class ChromedashIntentPreviewPage extends i$4{constructor(){super(...arguments),this.appTitle="",this.featureId=0,this.stageId=0,this.gateId=0,this.loading=!1,this.subject="",this.intentBody="",this.displayFeatureUnlistedWarning=!1}static get styles(){return[...SHARED_STYLES,i$7` + #content { + flex-direction: column; + counter-reset: h3; + height: auto; + } + #content section { + max-width: 800px; + flex: 1 0 auto; + margin-bottom: 15px; + } + h3 { + margin-bottom: 10px; + } + #content h3:before { + counter-increment: h3; + content: counter(h3) '.'; + margin-right: 5px; + } + #post-intent-button { + float: right; + } + .inline { + display: inline; + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}fetchData(){Promise.all([window.csClient.getFeature(this.featureId),window.csClient.getGates(this.featureId)]).then(([feature,gates])=>{if(this.feature=feature,document.title=`${this.feature.name} - ${this.appTitle}`,this.gateId){if(this.gate=gates.gates.find(gate=>gate.id===this.gateId),!this.gate)throw new Error("Invalid gate ID");for(const stage of this.feature.stages){if(this.stage)break;if(stage.id===this.gate.stage_id&&(this.stage=stage),!this.stage){const extensionStage=stage.extensions.find(e=>e.id===this.gate.stage_id);extensionStage&&(this.stage=extensionStage)}}}else if(this.stageId){const matchingStage=this.feature.stages.find(s=>s.id===this.stageId);if(!matchingStage)throw new Error(`No matching stage found for ID ${this.stageId}`);this.stage=matchingStage}else throw new Error("Invalid gate ID");return this.feature.unlisted&&(this.displayFeatureUnlistedWarning=!0),window.csClient.getIntentBody(this.featureId,this.stage.id,this.gateId)}).then(intentResp=>{this.subject=intentResp.subject,this.intentBody=intentResp.email_body,this.loading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}renderThreeLGTMSection(){return STAGE_TYPES_SHIPPING.has(this.stage?.stage_type)?x$1` <section> + <h3>Obtain LGTMs from 3 API Owners</h3> + <span class="help"> + You will need three LGTMs from API owners. According to the + <a href="http://www.chromium.org/blink#launch-process" + >Blink Launch process</a + > + after that, you're free to ship your feature. + </span> + </section>`:E$1}renderFeatureUnlistedAlert(){return this.displayFeatureUnlistedWarning?x$1`<div class="alertbox"> + Important: This feature is currently unlisted. Please only share feature + details with people who are collaborating with you on the feature. + </div>`:E$1}renderSkeletonSection(){return x$1` + <section> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}renderSkeletons(){return x$1` + <div id="feature" style="margin-top: 65px;"> + ${this.renderSkeletonSection()} ${this.renderSkeletonSection()} + ${this.renderSkeletonSection()} ${this.renderSkeletonSection()} + </div> + `}render(){return this.loading?this.renderSkeletons():x$1` + <div id="content"> + <div id="subheader"> + <div> + <h2>Next steps for the Blink launch process</h2> + </div> + </div> + ${this.renderFeatureUnlistedAlert()} + <section> + <h3>Reach out to a spec mentor</h3> + <p style="margin-left: 1em"> + Consider showing your draft intent email to your spec mentor or + sending it to spec-mentors@chromium.org. They can help make sure + that your intent email is ready for review. + </p> + </section> + <section> + <h3 class="inline">Send this text for your "Intent to ..." email</h3> + <input + ref() + id="post-intent-button" + class="button inline" + type="submit" + value="Post directly to blink-dev" + @click="${()=>openPostIntentDialog(this.feature.id,this.stage.id,this.feature.owner_emails,this.gate?.id)}" + /> + <chromedash-intent-content + appTitle="${this.appTitle}" + .feature=${this.feature} + .stage=${this.stage} + subject="${this.subject}" + intentBody="${this.intentBody}" + > + </chromedash-intent-content> + </section> + ${this.renderThreeLGTMSection()} + </div> + `}};__decorate$s([n$5({type:String})],ChromedashIntentPreviewPage.prototype,"appTitle",void 0),__decorate$s([n$5({type:Number})],ChromedashIntentPreviewPage.prototype,"featureId",void 0),__decorate$s([n$5({type:Number})],ChromedashIntentPreviewPage.prototype,"stageId",void 0),__decorate$s([n$5({type:Number})],ChromedashIntentPreviewPage.prototype,"gateId",void 0),__decorate$s([r$6()],ChromedashIntentPreviewPage.prototype,"feature",void 0),__decorate$s([r$6()],ChromedashIntentPreviewPage.prototype,"stage",void 0),__decorate$s([r$6()],ChromedashIntentPreviewPage.prototype,"gate",void 0),__decorate$s([r$6()],ChromedashIntentPreviewPage.prototype,"loading",void 0),__decorate$s([r$6()],ChromedashIntentPreviewPage.prototype,"subject",void 0),__decorate$s([r$6()],ChromedashIntentPreviewPage.prototype,"intentBody",void 0),__decorate$s([r$6()],ChromedashIntentPreviewPage.prototype,"displayFeatureUnlistedWarning",void 0),ChromedashIntentPreviewPage=__decorate$s([t$3("chromedash-intent-preview-page")],ChromedashIntentPreviewPage);var __decorate$r=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashLoginRequiredPage=class ChromedashLoginRequiredPage extends i$4{render(){return x$1` <div>Please login to see the content of this page.</div> `}};ChromedashLoginRequiredPage=__decorate$r([t$3("chromedash-login-required-page")],ChromedashLoginRequiredPage);var __decorate$q=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashMyFeaturesPage=class ChromedashMyFeaturesPage extends i$4{constructor(){super(...arguments),this.selectedGateId=0,this.starredFeatures=new Set}static get styles(){return[...SHARED_STYLES,i$7` + sl-details { + padding: 0 var(--content-padding); + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}fetchData(){window.csClient.getStars().then(starredFeatures=>{this.starredFeatures=new Set(starredFeatures)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}refetch(){const tables=Array.from(this.renderRoot.querySelectorAll("chromedash-feature-table"));for(const table of tables)table.refetch()}handleStarToggle(e){const newStarredFeatures=new Set(this.starredFeatures);window.csClient.setStar(e.detail.featureId,e.detail.doStar).then(()=>{e.detail.doStar?newStarredFeatures.add(e.detail.featureId):newStarredFeatures.delete(e.detail.featureId),this.starredFeatures=newStarredFeatures}).catch(()=>{showToastMessage("Unable to star the Feature. Please Try Again.")})}userCanApprove(){return this.user&&(this.user.is_admin||0<this.user.approvable_gate_types?.length)}renderBox(title,query,columns,sortSpec="",opened=!0){return x$1` + <sl-details summary="${title}" ?open=${opened}> + <chromedash-feature-table + query="${query}" + showEnterprise + sortSpec="${sortSpec}" + ?signedIn=${!!this.user} + ?canEdit=${this.user&&this.user.can_edit_all} + .starredFeatures=${this.starredFeatures} + @star-toggle-event=${this.handleStarToggle} + selectedGateId=${this.selectedGateId} + num="25" + columns=${columns} + > + </chromedash-feature-table> + </sl-details> + `}renderPendingAndRecentApprovals(){const adminNotice=this.user?.is_admin?x$1`<p>You see all pending approvals because you're a site admin.</p>`:E$1,pendingBox=this.renderBox("Features pending my approval","pending-approval-by:me","approvals","gate.requested_on"),recentBox=this.renderBox("Recently reviewed features","is:recently-reviewed","normal","-gate.reviewed_on",!1);return[adminNotice,pendingBox,recentBox]}renderIStarred(){return this.renderBox("Features I starred","starred-by:me","normal")}renderICanEdit(){return this.renderBox("Features I can edit","can_edit:me","normal")}render(){return x$1` + <div id="subheader"> + <h2>My features</h2> + </div> + <div id="deprecated" class="warning"> + This page will soon be removed from our site.<br /> + Please use one of the "My features" options in the main menu. + </div> + + ${this.userCanApprove()?this.renderPendingAndRecentApprovals():E$1} + ${this.renderICanEdit()} ${this.renderIStarred()} + `}};__decorate$q([n$5({attribute:!1})],ChromedashMyFeaturesPage.prototype,"user",void 0),__decorate$q([n$5({type:Number})],ChromedashMyFeaturesPage.prototype,"selectedGateId",void 0),__decorate$q([r$6()],ChromedashMyFeaturesPage.prototype,"starredFeatures",void 0),ChromedashMyFeaturesPage=__decorate$q([t$3("chromedash-myfeatures-page")],ChromedashMyFeaturesPage);var __decorate$p=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashOTCreationPage=class ChromedashOTCreationPage extends i$4{constructor(){super(...arguments),this.stageId=0,this.featureId=0,this.appTitle="",this.userEmail="",this.loading=!0,this.submitting=!1,this.fieldValues=[],this.showApprovalsFields=!1,this.isDeprecationTrial=!1,this.webfeatureUseCounterType=USE_COUNTER_TYPE_WEBFEATURE}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7` + #overlay { + position: fixed; + width: 100%; + height: 100%; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.3); + z-index: 2; + cursor: pointer; + } + .submission-spinner { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + height: 300px; + } + + .warning { + border: 2px solid #555555; + border-radius: 10px; + padding: 4px; + margin-bottom: 32px; + } + .warning h3 { + text-align: center; + color: #555555; + font-weight: 300; + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}handleFormFieldUpdate(event){const value=event.detail.value,index=event.detail.index;if(index>=this.fieldValues.length)throw new Error("Out of bounds index when updating field values.");this.fieldValues[index].touched=!0,this.fieldValues[index].value=value,"ot_require_approvals"===this.fieldValues[index].name?(this.showApprovalsFields=!this.showApprovalsFields,this.requestUpdate()):"ot_is_deprecation_trial"===this.fieldValues[index].name&&(this.isDeprecationTrial=value,this.requestUpdate())}handleUseCounterTypeUpdate(event){this.webfeatureUseCounterType=parseInt(event.detail.value)}fetchData(){this.loading=!0,Promise.all([window.csClient.getFeature(this.featureId),window.csClient.getStage(this.featureId,this.stageId),window.csClient.getGates(this.featureId)]).then(([feature,stage,gatesRes])=>{this.feature=feature,this.stage=stage,this.stage.ot_setup_status&&this.stage.ot_setup_status!==OT_SETUP_STATUS_OPTIONS.OT_NOT_CREATED&&(window.location.href=`/feature/${this.featureId}`);const relevantGates=gatesRes.gates.filter(g=>g.stage_id===this.stage.id);relevantGates.forEach(g=>{GATE_APPROVED_REVIEW_STATES.includes(g.state)||(window.location.href=`/feature/${this.featureId}`)}),this.feature.name&&(document.title=`${this.feature.name} - ${this.appTitle}`),this.setFieldValues(),this.loading=!1})}addOptionalApprovalsFields(){const insertIndex=this.fieldValues.findIndex(fieldInfo=>"ot_require_approvals"===fieldInfo.name)+1;this.fieldValues.splice(insertIndex,0,{name:"ot_approval_buganizer_component",touched:!0,value:"",stageId:this.stage.id,isApprovalsField:!0},{name:"ot_approval_buganizer_custom_field_id",touched:!0,value:"",stageId:this.stage.id,isApprovalsField:!0},{name:"ot_approval_group_email",touched:!0,value:"",stageId:this.stage.id,isApprovalsField:!0},{name:"ot_approval_criteria_url",touched:!0,value:"",stageId:this.stage.id,isApprovalsField:!0})}addAdditionalFields(){this.fieldValues.push({name:"ot_action_requested",touched:!0,value:!0,stageId:this.stage.id,alwaysHidden:!0}),"Chrome Platform Status"!==this.appTitle&&this.fieldValues.push({name:"ot_creation__bypass_file_checks",touched:!0,value:!1,stageId:this.stage.id,alwaysHidden:!1})}setFieldValues(){const section=ORIGIN_TRIAL_CREATION_FIELDS.sections[0];this.fieldValues=section.fields.map(field=>{const featureJSONKey=ALL_FIELDS[field].name||field;let value=getStageValue(this.stage,featureJSONKey);return"ot_owner_email"!==featureJSONKey||value?"ot_require_approvals"===featureJSONKey&&(this.showApprovalsFields=!!value):value=[this.userEmail],{name:featureJSONKey,touched:!0,value,stageId:this.stage.id}}),this.addOptionalApprovalsFields(),this.addAdditionalFields()}disconnectedCallback(){super.disconnectedCallback(),document.title=this.appTitle}async registerHandlers(el){if(el){await el.updateComplete;const submitButton=this.renderRoot.querySelector("input[id=submit-button]");submitButton?.form?.addEventListener("submit",event=>{this.handleFormSubmit(event)}),setupScrollToHash(this)}}checkWebfeatureUseCounter(field,errors){field.checkMessage=errors.ot_webfeature_use_counter?x$1` <span class="check-error"> + <b>Error</b>: ${errors.ot_webfeature_use_counter} + </span>`:E$1}checkChromiumTrialName(field,errors){field.checkMessage=errors.ot_chromium_trial_name?x$1` <span class="check-error"> + <b>Error</b>: ${errors.ot_chromium_trial_name} + </span>`:E$1}checkThirdPartySupport(field,errors){field.checkMessage=errors.ot_has_third_party_support?x$1` <br /> + <span class="check-error"> + <b>Error</b>: ${errors.ot_has_third_party_support} + </span>`:E$1}checkCriticalTrial(field,errors){field.checkMessage=errors.ot_is_critical_trial?x$1` <br /> + <span class="check-error"> + <b>Error</b>: ${errors.ot_is_critical_trial} + </span>`:E$1}handleChromiumChecks(errors){for(const field of this.fieldValues)"ot_webfeature_use_counter"===field.name?this.checkWebfeatureUseCounter(field,errors):"ot_chromium_trial_name"===field.name?this.checkChromiumTrialName(field,errors):"ot_has_third_party_support"===field.name?this.checkThirdPartySupport(field,errors):"ot_is_critical_trial"===field.name&&this.checkCriticalTrial(field,errors)}async handleFormSubmit(e){e.preventDefault(),this.showApprovalsFields||this.fieldValues.forEach(fieldInfo=>{fieldInfo.isApprovalsField&&(fieldInfo.touched=!1)});const useCounterField=this.fieldValues.find(fv=>"ot_webfeature_use_counter"===fv.name);this.isDeprecationTrial&&(useCounterField.touched=!1);const featureSubmitBody=formatFeatureChanges(this.fieldValues,this.featureId),stageSubmitBody=featureSubmitBody.stages[0];if("ot_webfeature_use_counter"in stageSubmitBody){let useCounterPrefix="";this.webfeatureUseCounterType===USE_COUNTER_TYPE_WEBDXFEATURE?useCounterPrefix="WebDXFeature::":this.webfeatureUseCounterType===USE_COUNTER_TYPE_CSS_PROPERTY_ID&&(useCounterPrefix="CSSSampleId::"),stageSubmitBody.ot_webfeature_use_counter.value=`${useCounterPrefix}${stageSubmitBody.ot_webfeature_use_counter.value}`}this.submitting=!0,window.csClient.createOriginTrial(this.featureId,this.stageId,stageSubmitBody).then(resp=>{resp.errors?(this.handleChromiumChecks(resp.errors),showToastMessage("Some issues were found with the given inputs. Check input errors and try again."),this.submitting=!1,this.requestUpdate()):(showToastMessage("Creation request submitted!"),setTimeout(()=>{window.location.href=`/feature/${this.featureId}`},1e3))})}handleCancelClick(){window.location.href=`/feature/${this.featureId}`}renderSkeletons(){return x$1` + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <section id="metadata"> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}getNextPage(){return`/feature/${this.featureId}`}renderSubheader(){const link=this.loading?E$1:x$1` + <a href=${this.getNextPage()}> + <sl-icon name="arrow-left"></sl-icon> + Request origin trial creation: ${this.feature.name} + </a> + `;return x$1` + <div id="subheader"> + <h2 id="breadcrumbs">${link}</h2> + </div> + `}renderFields(){const fields=this.fieldValues.map((fieldInfo,i)=>{if(fieldInfo.alwaysHidden||fieldInfo.isApprovalsField&&!this.showApprovalsFields||"ot_webfeature_use_counter"===fieldInfo.name&&this.isDeprecationTrial)return E$1;const shouldFadeIn=fieldInfo.isApprovalsField||"ot_webfeature_use_counter"===fieldInfo.name;let additionalInfo=E$1;return"ot_webfeature_use_counter"==fieldInfo.name&&(additionalInfo=x$1` + <chromedash-form-field + name="ot_webfeature_use_counter__type" + index=${i} + .value=${this.webfeatureUseCounterType} + .fieldValues=${this.fieldValues} + ?shouldFadeIn=${shouldFadeIn} + @form-field-update="${this.handleUseCounterTypeUpdate}" + class="choices" + > + </chromedash-form-field> + `),x$1` + ${additionalInfo} + <chromedash-form-field + name=${fieldInfo.name} + index=${i} + value=${fieldInfo.value} + disabledReason="${getDisabledHelpText(fieldInfo.name,this.stage)}" + .checkMessage=${fieldInfo.checkMessage} + .fieldValues=${this.fieldValues} + ?shouldFadeIn=${shouldFadeIn} + @form-field-update="${this.handleFormFieldUpdate}" + > + </chromedash-form-field> + `});return fields}renderForm(){this.fieldValues.feature=this.feature;const submitButtonTitle=this.submitting?"Submitting...":"Submit";return x$1` + <form name="feature_form"> + ${this.submitting?x$1`<div id="overlay"> + <div class="loading"> + <div id="spinner"> + <img class="submission-spinner" src="/static/img/ring.svg" /> + </div> + </div> + </div>`:E$1} + <chromedash-form-table ${n$2(this.registerHandlers)}> + <section class="stage_form"> + <div class="warning warning-div"> + <h3> + Please make sure this data is correct before submission! If you + are not sure about any information on this form, contact + <strong>origin-trials-support@google.com</strong> + </h3> + </div> + ${this.renderFields()} + </section> + </chromedash-form-table> + <div class="final_buttons"> + <input + id="submit-button" + class="button" + type="submit" + value=${submitButtonTitle} + ?disabled=${this.submitting} + /> + <button + id="cancel-button" + type="reset" + @click=${this.handleCancelClick} + > + Cancel + </button> + </div> + </form> + `}render(){return x$1` + ${this.renderSubheader()} + ${this.loading?this.renderSkeletons():this.renderForm()} + `}};__decorate$p([n$5({type:Number})],ChromedashOTCreationPage.prototype,"stageId",void 0),__decorate$p([n$5({type:Number})],ChromedashOTCreationPage.prototype,"featureId",void 0),__decorate$p([n$5({attribute:!1})],ChromedashOTCreationPage.prototype,"feature",void 0),__decorate$p([n$5({type:String})],ChromedashOTCreationPage.prototype,"appTitle",void 0),__decorate$p([n$5({type:String})],ChromedashOTCreationPage.prototype,"userEmail",void 0),__decorate$p([r$6()],ChromedashOTCreationPage.prototype,"loading",void 0),__decorate$p([r$6()],ChromedashOTCreationPage.prototype,"submitting",void 0),__decorate$p([r$6()],ChromedashOTCreationPage.prototype,"fieldValues",void 0),__decorate$p([r$6()],ChromedashOTCreationPage.prototype,"showApprovalsFields",void 0),__decorate$p([r$6()],ChromedashOTCreationPage.prototype,"isDeprecationTrial",void 0),__decorate$p([r$6()],ChromedashOTCreationPage.prototype,"webfeatureUseCounterType",void 0),__decorate$p([r$6()],ChromedashOTCreationPage.prototype,"stage",void 0),ChromedashOTCreationPage=__decorate$p([t$3("chromedash-ot-creation-page")],ChromedashOTCreationPage);var __decorate$o=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};class ChromedashOTExtensionPage extends i$4{constructor(){super(...arguments),this.stageId=0,this.featureId=0,this.appTitle="",this.loading=!0,this.fieldValues=[],this.currentMilestone=123,this.endMilestoneDateValues={}}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7``]}static get properties(){return{stageId:{type:Number},featureId:{type:Number},userEmail:{type:String},feature:{type:Object},loading:{type:Boolean},appTitle:{type:String},fieldValues:{type:Array},currentMilestone:{type:Number},endMilestoneDateValues:{type:Object}}}connectedCallback(){super.connectedCallback(),this.fetchData()}handleFormFieldUpdate(event){const value=event.detail.value,index=event.detail.index;if(index>=this.fieldValues.length)throw new Error("Out of bounds index when updating field values.");this.fieldValues[index].touched=!0,this.fieldValues[index].value=value,"ot_extension__milestone_desktop_last"==this.fieldValues[index].name&&this.getChromeScheduleDate(event.detail.value)}openMilestoneExplanationDialog(){openInfoDialog(dialogTypes.END_MILESTONE_EXPLANATION)}updateMilestoneDate(milestone){const milestoneDiv=this.renderRoot.querySelector("#milestone-date"),milestoneTextEl=this.renderRoot.querySelector("#milestone-date-text"),date=new Date(this.endMilestoneDateValues[milestone]);milestoneDiv&&milestoneTextEl&&(milestoneDiv.style.display="block",milestoneTextEl.innerHTML=`For milestone ${milestone}, this trial will end on ${date.toLocaleDateString()}.`)}async getChromeScheduleDate(milestone){const milestoneDiv=this.renderRoot.querySelector("#milestone-date");if(milestoneDiv&&(milestoneDiv.style.display="none",!!extensionMilestoneIsValid(milestone,this.currentMilestone))){if(!(milestone in this.endMilestoneDateValues)){const milestonePlusTwo=parseInt(milestone)+2,resp=await fetch(`https://chromiumdash.appspot.com/fetch_milestone_schedule?mstone=${milestonePlusTwo}`),respJson=await resp.json();this.endMilestoneDateValues[milestone]=respJson.mstones[0].late_stable_date}this.updateMilestoneDate(milestone)}}fetchData(){this.loading=!0,Promise.all([window.csClient.getFeature(this.featureId),window.csClient.getStage(this.featureId,this.stageId)]).then(([feature,stage])=>{this.feature=feature,this.stage=stage,this.feature.name&&(document.title=`${this.feature.name} - ${this.appTitle}`),this.loading=!1}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")}),fetch("https://chromiumdash.appspot.com/fetch_milestone_schedule").then(resp=>resp.json()).then(scheduleInfo=>{this.currentMilestone=parseInt(scheduleInfo.mstones[0].mstone)})}disconnectedCallback(){super.disconnectedCallback(),document.title=this.appTitle}async registerHandlers(el){if(el){await el.updateComplete;const submitButton=this.renderRoot.querySelector("input[id=submit-button]");submitButton?.form?.addEventListener("submit",event=>{this.handleFormSubmit(event)}),setupScrollToHash(this)}}handleFormSubmit(e){e.preventDefault();const featureSubmitBody=formatFeatureChanges(this.fieldValues,this.featureId),stageSubmitBody=featureSubmitBody.stages[0];let newStageId=null;window.csClient.createStage(this.featureId,stageSubmitBody).then(resp=>(newStageId=resp.stage_id,window.csClient.getGates(this.featureId))).then(resp=>{const gate=resp.gates.find(gate=>gate.stage_id===newStageId);showToastMessage("Extension request started!"),newStageId&&gate?setTimeout(()=>{window.location.href=`/feature/${this.featureId}?gate=${gate.id}`},1e3):setTimeout(()=>{window.location.href=`/feature/${this.featureId}`},1e3)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}handleCancelClick(e){e.preventDefault(),window.location.href=`/feature/${this.featureId}`}renderSkeletons(){return x$1` + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <section id="metadata"> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}getNextPage(){return`/feature/${this.featureId}`}renderSubheader(){const link=this.loading?E$1:x$1` + <a href=${this.getNextPage()}> + <sl-icon name="arrow-left"></sl-icon> + Request origin trial extension: ${this.feature.name} + </a> + `;return x$1` + <div id="subheader"> + <h2 id="breadcrumbs">${link}</h2> + </div> + `}addDefaultRequestFields(){this.fieldValues.push({name:"ot_owner_email",touched:!0,value:this.userEmail,stageId:this.stage.id}),this.fieldValues.push({name:"ot_action_requested",touched:!0,value:!0,stageId:this.stage.id});const extensionStageType=OT_EXTENSION_STAGE_MAPPING[this.stage.stage_type];this.fieldValues.push({name:"stage_type",touched:!0,value:extensionStageType,stageId:this.stage.id}),this.fieldValues.push({name:"ot_stage_id",touched:!0,value:this.stage.id,stageId:this.stage.id})}renderFields(section){const fields=section.fields.map(field=>{const featureJSONKey=ALL_FIELDS[field].name||field,index=this.fieldValues.length;this.fieldValues.push({name:featureJSONKey,touched:!0,value:null,stageId:this.stage.id});let milestoneInfoText=x$1``;return"ot_extension__milestone_desktop_last"===featureJSONKey&&(milestoneInfoText=x$1` <div + id="milestone-date" + style="display:none;" + > + <span id="milestone-date-text" class="helptext fade-in"></span> + <a class="helptext" @click=${this.openMilestoneExplanationDialog}> + Learn how this date is chosen + </a> + </div>`),x$1` + <chromedash-form-field + name=${featureJSONKey} + index=${index} + disabledReason="${getDisabledHelpText(field,this.stage)}" + .fieldValues=${this.fieldValues} + @form-field-update="${this.handleFormFieldUpdate}" + > + </chromedash-form-field> + ${milestoneInfoText} + `});return this.addDefaultRequestFields(),fields}renderForm(){this.fieldValues.feature=this.feature;const section=ORIGIN_TRIAL_EXTENSION_FIELDS.sections[0];return x$1` + <form name="feature_form"> + <chromedash-form-table ${n$2(this.registerHandlers)}> + <section class="stage_form">${this.renderFields(section)}</section> + </chromedash-form-table> + <div class="final_buttons"> + <input + id="submit-button" + class="button" + type="submit" + value="Submit" + /> + <button + id="cancel-button" + type="reset" + @click=${this.handleCancelClick} + > + Cancel + </button> + </div> + </form> + `}render(){return x$1` + ${this.renderSubheader()} + ${this.loading?this.renderSkeletons():this.renderForm()} + `}}__decorate$o([n$5({type:Number})],ChromedashOTExtensionPage.prototype,"stageId",void 0),__decorate$o([n$5({type:Number})],ChromedashOTExtensionPage.prototype,"featureId",void 0),__decorate$o([n$5({type:String})],ChromedashOTExtensionPage.prototype,"userEmail",void 0),__decorate$o([n$5({type:String})],ChromedashOTExtensionPage.prototype,"appTitle",void 0),__decorate$o([r$6()],ChromedashOTExtensionPage.prototype,"feature",void 0),__decorate$o([r$6()],ChromedashOTExtensionPage.prototype,"loading",void 0),__decorate$o([r$6()],ChromedashOTExtensionPage.prototype,"fieldValues",void 0),__decorate$o([r$6()],ChromedashOTExtensionPage.prototype,"currentMilestone",void 0),__decorate$o([r$6()],ChromedashOTExtensionPage.prototype,"endMilestoneDateValues",void 0),__decorate$o([r$6()],ChromedashOTExtensionPage.prototype,"stage",void 0),customElements.define("chromedash-ot-extension-page",ChromedashOTExtensionPage);var __decorate$n=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashSettingsPage=class ChromedashSettingsPage extends i$4{constructor(){super(...arguments),this.notify_as_starrer=!1,this.submitting=!1}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7` + th, + td { + padding: 4px; + } + + input[type='submit'] { + margin: 20px; + } + + input[disabled] { + opacity: 0.5; + pointer-events: none; + } + + #spinner { + display: flex; + align-items: center; + justify-content: center; + position: fixed; + height: 60%; + width: 100%; + } + + table .helptext { + display: block; + font-style: italic; + font-size: smaller; + max-width: 40em; + margin-top: 2px; + } + `]}connectedCallback(){super.connectedCallback(),window.csClient.getSettings().then(res=>{this.notify_as_starrer=res.notify_as_starrer}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}handleSubmit(e){e.preventDefault(),this.submitting=!0,window.csClient.setSettings(this.notify_as_starrer).then(()=>{showToastMessage("Settings saved."),handleSaveChangesResponse("")}).catch(()=>{showToastMessage("Unable to save the settings. Please try again."),handleSaveChangesResponse("Unable to save the settings. Please try again.")}).finally(()=>{this.submitting=!1})}handleChange(){this.notify_as_starrer=!this.notify_as_starrer}render(){const submitButtonTitle=this.submitting?"Submitting...":"Submit";return x$1` + <div id="subheader"> + <h2>User preferences</h2> + </div> + <section> + <form name="user_pref_form" @submit=${this.handleSubmit}> + <table cellspacing="6"> + <tbody> + <tr> + <th> + <label for="id_notify_as_starrer">Notify as starrer:</label> + </th> + <td> + <sl-checkbox + id="id_notify_as_starrer" + name="notify_as_starrer" + ?checked=${this.notify_as_starrer} + @input=${this.handleChange} + > + </sl-checkbox> + <span class="helptext"> + Send you notification emails for features that you + starred?</span + > + </td> + </tr> + </tbody> + </table> + <input + type="submit" + value=${submitButtonTitle} + ?disabled=${this.submitting} + /> + </form> + </section> + ${this.submitting?x$1` <div class="loading"> + <div id="spinner"><img src="/static/img/ring.svg" /></div> + </div>`:E$1} + `}};__decorate$n([r$6()],ChromedashSettingsPage.prototype,"notify_as_starrer",void 0),__decorate$n([r$6()],ChromedashSettingsPage.prototype,"submitting",void 0),ChromedashSettingsPage=__decorate$n([t$3("chromedash-settings-page")],ChromedashSettingsPage);var __decorate$m=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashXMeter=class ChromedashXMeter extends i$4{constructor(){super(...arguments),this.value=0,this.max=100,this.href="#"}static get styles(){return[...SHARED_STYLES,i$7` + :host { + display: grid; + grid-template-columns: 65px 1fr; + grid-column-gap: 15px; + height: 1.6em; + font-size: 14px; + } + + #percentage-number { + place-self: center; + } + + #track { + background: var(--barchart-background); + border-radius: var(--border-radius); + overflow: hidden; + height: 100%; + } + + #indicator { + background: var(--barchart-foreground); + height: 100%; + white-space: nowrap; + padding: 3px 0; + } + `]}render(){return x$1` + <p id="percentage-number"> + ${1e-4>this.value?"<0.0001%":this.value.toFixed(4)+"%"} + </p> + <a href="${this.href}"> + <div id="track"> + <div + id="indicator" + style="width: ${100*(this.value/this.max)}%" + ></div> + </div> + </a> + `}};__decorate$m([n$5({type:Number})],ChromedashXMeter.prototype,"value",void 0),__decorate$m([n$5({type:Number})],ChromedashXMeter.prototype,"max",void 0),__decorate$m([n$5({type:String})],ChromedashXMeter.prototype,"href",void 0),ChromedashXMeter=__decorate$m([t$3("chromedash-x-meter")],ChromedashXMeter);var __decorate$l=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashStackRank=class ChromedashStackRank extends i$4{constructor(){super(...arguments),this.type="",this.view="",this.viewList=[],this.tempList=[],this.maxPercentage=100,this.sortType="percentage",this.sortReverse=!1,this.shouldHideObsolete=!0,this.obsoleteCount=0}static get styles(){return[...SHARED_STYLES,i$7` + :host { + display: block; + flex: 1; + padding: 1px; + } + + .title-text { + flex: 1; + font-weight: 500; + } + + li { + padding: 5px 0; + display: flex; + align-items: center; + } + + #subheader { + font-size: 15px; + display: flex; + justify-content: space-between; + align-items: center; + } + + #dropdown-selection:hover { + background: var(--sl-color-neutral-100); + } + + sl-button::part(base) { + color: #000; + } + + li > :first-child { + flex: 1; + word-break: break-all; + } + + li > :nth-child(2) { + flex: 2; + } + + .stack-rank-header { + margin-bottom: 5px; + text-align: center; + } + + .stack-rank-item { + border-top: var(--table-divider); + } + + .stack-rank-item-hidden { + display: none; + } + + .stack-rank-item-name { + display: grid; + grid-template-columns: var(--icon-size) 1fr; + grid-column-gap: 15px; + position: relative; + left: -20px; + } + .stack-rank-item-name .hash-link { + place-self: center; + visibility: hidden; + } + .stack-rank-item-name:hover .hash-link { + visibility: visible; + } + + .stack-rank-item-result { + display: flex; + align-items: center; + gap: 15px; + margin-right: 15px; + } + + chromedash-x-meter { + flex: 1; + } + + a.icon-wrapper { + display: flex; + gap: 3px; + align-items: center; + } + a.icon-wrapper:hover { + text-decoration: none; + } + + .spacer { + visibility: hidden; + } + + sl-skeleton { + margin: 0; + padding: 5px 20px; + } + + /* On small displays, only show timeline icons (no text). */ + @media only screen and (max-width: 600px) { + .icon-text { + display: none; + } + + .stack-rank-item-name { + grid-column-gap: 5px; + } + + .stack-rank-item-result { + margin-right: 5px; + } + } + `]}willUpdate(changedProperties){var _Mathmax7=Math.max;changedProperties.has("viewList")&&this.viewList.length&&(this.maxPercentage=this.viewList.reduce((accum,currVal)=>_Mathmax7(accum,currVal.percentage),0),setTimeout(()=>{this.scrollToPosition()},300),this.obsoleteCount=this.viewList.filter(item=>item.obsolete).length)}scrollToPosition(e){let hash;if(e?hash=e.currentTarget.getAttribute("href"):location.hash&&(hash=decodeURIComponent(location.hash)),hash){const el=this.renderRoot.querySelector(".stack-rank-list "+hash);el?.scrollIntoView({behavior:"smooth"})}}sort(e){e.preventDefault();const parts=e.target.dataset.order.split("-");this.sortType=parts[0],this.sortReverse=!!parts[1];const newViewList=[...this.viewList];this.viewList=sortBy_(this.sortType,this.sortReverse,newViewList)}handleChangeHideObsolete(e){this.shouldHideObsolete=e.target.checked}renderSubHeader(){return x$1` + <div id="subheader"> + <p class="title-text"> + Showing + <span + >${this.viewList.length-(this.shouldHideObsolete?this.obsoleteCount:0)}</span + > + properties + </p> + <sl-checkbox + ?checked=${this.shouldHideObsolete} + @input=${this.handleChangeHideObsolete} + > + Hide obsolete + </sl-checkbox> + <div id="dropdown-selection"> + <sl-dropdown> + <sl-button + slot="trigger" + variant="text" + ?disabled=${!this.viewList.length} + > + <sl-icon name="filter-left"></sl-icon> + SORT BY + </sl-button> + <sl-menu @click="${this.sort}"> + <sl-menu-item + type="checkbox" + ?checked=${"percentage"==this.sortType&&!this.sortReverse} + data-order="percentage" + > + Most used + </sl-menu-item> + <sl-menu-item + type="checkbox" + ?checked=${"percentage"==this.sortType&&this.sortReverse} + data-order="percentage-reverse" + > + Least used + </sl-menu-item> + <sl-menu-item + type="checkbox" + ?checked=${"property_name"==this.sortType&&this.sortReverse} + data-order="property_name-reverse" + > + Name (A-Z) + </sl-menu-item> + <sl-menu-item + type="checkbox" + ?checked=${"property_name"==this.sortType&&!this.sortReverse} + data-order="property_name" + > + Name (Z-A) + </sl-menu-item> + </sl-menu> + </sl-dropdown> + </div> + </div> + `}renderStackRank(displayedList){return x$1` + ${displayedList.map(item=>x$1` + <li + class="stack-rank-item ${this.shouldHideObsolete&&item.obsolete?"stack-rank-item-hidden":""}" + id="${item.property_name}" + > + <div + title="${item.property_name}. Click to deep link to this property." + > + <a + class="stack-rank-item-name" + href="#${item.property_name}" + @click=${this.scrollToPosition} + > + <sl-icon + class="hash-link" + library="material" + name="link" + ></sl-icon> + <p>${item.property_name}</p> + </a> + </div> + <div class="stack-rank-item-result"> + <chromedash-x-meter + value="${item.percentage}" + max="${this.maxPercentage}" + href="/metrics/${this.type}/timeline/${this.view}/${item.bucket_id}" + title="Click to see a timeline view of this property" + > + </chromedash-x-meter> + <a + class="icon-wrapper" + href="/metrics/${this.type}/timeline/${this.view}/${item.bucket_id}" + title="Click to see a timeline view of this property" + > + <sl-icon name="graph-up"></sl-icon> + <p class="icon-text">Timeline</p> + </a> + </div> + </li> + `)} + `}renderSkeletons(){return x$1`${Array.from(Array(20)).map(()=>x$1` + <li class="stack-rank-item"> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </li> + `)}`}renderTemporaryRank(){return x$1` + ${this.tempList.length?this.renderStackRank(this.tempList):E$1} + ${this.renderSkeletons()} + `}renderStackRankList(){return x$1` + <ol class="stack-rank-list"> + <li class="stack-rank-header"> + <p class="title-text">Property name</p> + <div class="stack-rank-item-result"> + <p class="title-text">Percentage</p> + <a class="icon-wrapper spacer"> + <sl-icon name="graph-up"></sl-icon> + <p class="icon-text">Timeline</p> + </a> + </div> + </li> + ${this.viewList.length?this.renderStackRank(this.viewList):this.renderTemporaryRank()} + </ol> + `}render(){return x$1` ${this.renderSubHeader()} ${this.renderStackRankList()} `}};__decorate$l([n$5({type:String,attribute:!1})],ChromedashStackRank.prototype,"type",void 0),__decorate$l([n$5({type:String,attribute:!1})],ChromedashStackRank.prototype,"view",void 0),__decorate$l([n$5({type:Array,attribute:!1})],ChromedashStackRank.prototype,"viewList",void 0),__decorate$l([n$5({type:Array,attribute:!1})],ChromedashStackRank.prototype,"tempList",void 0),__decorate$l([r$6()],ChromedashStackRank.prototype,"maxPercentage",void 0),__decorate$l([r$6()],ChromedashStackRank.prototype,"sortType",void 0),__decorate$l([r$6()],ChromedashStackRank.prototype,"sortReverse",void 0),__decorate$l([r$6()],ChromedashStackRank.prototype,"shouldHideObsolete",void 0),__decorate$l([r$6()],ChromedashStackRank.prototype,"obsoleteCount",void 0),ChromedashStackRank=__decorate$l([t$3("chromedash-stack-rank")],ChromedashStackRank);const sortBy_=(propName,reverse,arr)=>{const compareAsNumbers="percentage"===propName;return arr.sort((a,b)=>{const propA=compareAsNumbers?+a[propName]:a[propName],propB=compareAsNumbers?+b[propName]:b[propName];return propA>propB?reverse?1:-1:propA<propB?reverse?-1:1:0}),arr};var __decorate$k=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};class ChromedashStackRankPage extends i$4{constructor(){super(...arguments),this.viewList=[],this.tempList=[]}static get styles(){return[...SHARED_STYLES,i$7` + h3 { + margin: var(--content-padding) 0; + font-weight: 500; + color: #000; + } + + .description { + margin-bottom: 1em; + } + .description #highlighted-text { + font-weight: 500; + } + + #datalist-input { + width: 30em; + max-width: 100%; + border-radius: 10px; + height: 25px; + margin-bottom: var(--content-padding); + padding-left: 10px; + font-size: 15px; + } + `]}connectedCallback(){super.connectedCallback(),this.loadAll()}loadAll(){let endpoint=`/data/${this.type}${this.view}`;const options={credentials:"omit"};fetch(endpoint,options).then(res=>res.json()).then(props=>{for(let i=0,item;item=props[i];++i)item.percentage=(100*item.day_percentage).toFixed(6),item.obsolete=item.property_name&&(item.property_name.startsWith("OBSOLETE_")||item.property_name.endsWith("(obsolete)"));const viewList=props.filter(item=>!["ERROR","PageVisits","PageDestruction"].includes(item.property_name));this.tempList=viewList.slice(0,30),setTimeout(()=>{this.viewList=viewList},300)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}handleSearchBarChange(e){const inputValue=e.currentTarget.value,property=this.viewList.find(item=>item.property_name===inputValue);window.location.href=`/metrics/${this.type}/timeline/${this.view}/${property.bucket_id}`}renderSubheader(){const subTitleText=METRICS_TYPE_AND_VIEW_TO_SUBTITLE[this.type+this.view];return x$1`<h2>${subTitleText} > stack rank</h2>`}renderSearchBar(){return x$1` + <input + id="datalist-input" + type="search" + list="features" + autocomplete="off" + placeholder=${this.viewList.length?"Select or search a property for detailed stats":"loading..."} + @change="${this.handleSearchBarChange}" + /> + <datalist id="features"> + ${this.viewList.map(item=>x$1` + <option + value="${item.property_name}" + dataset-debug-bucket-id="${item.bucket_id}" + ></option> + `)} + </datalist> + `}renderDataPanel(){return x$1` + <h3>Data from last 24 hours</h3> + <p class="description"> + The percentage numbers indicate the + <span id="highlighted-text" + >percentage of Chrome page loads (across all channels and platforms) + that use the ${"css"==this.type?"property":"feature"} at least + once</span + >. Data is collected via Chrome's + <a + href="https://cs.chromium.org/chromium/src/tools/metrics/histograms/enums.xml" + target="_blank" + rel="noopener" + >anonymous usage statistics</a + >. + </p> + <chromedash-stack-rank + .type=${this.type} + .view=${this.view} + .tempList=${this.tempList} + .viewList=${this.viewList} + > + </chromedash-stack-rank> + `}render(){return x$1` + <div id="subheader">${this.renderSubheader()}</div> + ${this.renderSearchBar()} ${this.renderDataPanel()} + `}}__decorate$k([n$5({attribute:!1})],ChromedashStackRankPage.prototype,"type",void 0),__decorate$k([n$5({attribute:!1})],ChromedashStackRankPage.prototype,"view",void 0),__decorate$k([n$5({attribute:!1})],ChromedashStackRankPage.prototype,"viewList",void 0),__decorate$k([n$5({attribute:!1})],ChromedashStackRankPage.prototype,"tempList",void 0),customElements.define("chromedash-stack-rank-page",ChromedashStackRankPage);var __decorate$j=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashStaleFeaturesPage=class ChromedashStaleFeaturesPage extends i$4{constructor(){super(...arguments),this.staleFeatures=[],this.loading=!0,this._sortColumn="name",this._sortDirection="asc"}static get styles(){return[...SHARED_STYLES,...FORM_STYLES,i$7` + :host { + display: block; + padding: 1em 2em; + max-width: 1400px; + margin: auto; + } + + #subheader { + padding: 0.5em 0; + margin-bottom: 1.5em; + border-bottom: 1px solid #e0e0e0; + } + + #breadcrumbs { + color: #333; + font-size: 1.75em; + font-weight: 600; + margin: 0; + } + + table { + width: 100%; + border-collapse: collapse; + } + + th, + td { + padding: 14px 18px; + text-align: left; + border-bottom: 1px solid #ddd; + } + + thead tr { + background-color: #f9f9f9; + } + + th { + font-weight: 600; + color: #555; + text-transform: uppercase; + font-size: 0.85em; + letter-spacing: 0.05em; + } + + th.sortable { + cursor: pointer; + user-select: none; + position: relative; + padding-right: 36px; + } + + th.sortable:hover { + background-color: #f0f0f0; + } + + .sort-indicator { + position: absolute; + top: 50%; + right: 18px; + transform: translateY(-50%); + opacity: 0.6; + transition: opacity 0.2s ease-in-out; + } + + tbody tr:nth-child(even) { + background-color: #fdfdfd; + } + + tbody tr:hover { + background-color: #f1f1f1; + transition: background-color 0.2s ease-in-out; + } + + td a { + color: var(--link-color); + text-decoration: none; + font-weight: 500; + } + + td a:hover { + text-decoration: underline; + } + + .no-features { + padding: 2em; + text-align: center; + font-style: italic; + color: #777; + background-color: #fafafa; + border: 1px solid #ddd; + border-radius: 8px; + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}async fetchData(){this.loading=!0;try{const staleFeaturesResp=await window.csClient.getStaleFeatures();this.staleFeatures=staleFeaturesResp.stale_features}catch(error){console.error(error),showToastMessage("Some errors occurred. Please refresh the page or try again later.")}finally{this.loading=!1}}_handleSort(column){this._sortColumn===column?this._sortDirection="asc"===this._sortDirection?"desc":"asc":(this._sortColumn=column,this._sortDirection="asc")}_renderSortIndicator(column){return this._sortColumn===column?"asc"===this._sortDirection?"\u25B2":"\u25BC":""}renderSkeletons(){return x$1` + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <section id="metadata"> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}renderSubheader(){return x$1` + <div id="subheader"> + <h2 id="breadcrumbs">Stale features</h2> + </div> + `}renderStaleFeatures(){if(0===this.staleFeatures.length)return x$1` + <div class="no-features"> + <p>No stale features found. Great job!</p> + </div> + `;const sortedFeatures=[...this.staleFeatures].sort((a,b)=>{const valA=a[this._sortColumn],valB=b[this._sortColumn];let comparison=0;return"string"==typeof valA&&"string"==typeof valB?comparison=valA.localeCompare(valB):"number"==typeof valA&&"number"==typeof valB?comparison=valA-valB:"accurate_as_of"===this._sortColumn&&(comparison=new Date(valA).getTime()-new Date(valB).getTime()),"asc"===this._sortDirection?comparison:-comparison});return x$1` + <div class="stale-features-table-container"> + <table> + <thead> + <tr> + <th class="sortable" @click=${()=>this._handleSort("name")}> + Name + <span class="sort-indicator" + >${this._renderSortIndicator("name")}</span + > + </th> + <th>Owner Emails</th> + <th + class="sortable" + @click=${()=>this._handleSort("milestone_field")} + > + Milestone Field + <span class="sort-indicator" + >${this._renderSortIndicator("milestone_field")}</span + > + </th> + <th + class="sortable" + @click=${()=>this._handleSort("milestone")} + > + Milestone + <span class="sort-indicator" + >${this._renderSortIndicator("milestone")}</span + > + </th> + <th + class="sortable" + @click=${()=>this._handleSort("outstanding_notifications")} + > + Notifications + <span class="sort-indicator" + >${this._renderSortIndicator("outstanding_notifications")}</span + > + </th> + <th + class="sortable" + @click=${()=>this._handleSort("accurate_as_of")} + > + Last Updated + <span class="sort-indicator" + >${this._renderSortIndicator("accurate_as_of")}</span + > + </th> + </tr> + </thead> + <tbody> + ${sortedFeatures.map(feature=>x$1` + <tr> + <td><a href="/feature/${feature.id}">${feature.name}</a></td> + <td>${feature.owner_emails.join(", ")}</td> + <td>${feature.milestone_field}</td> + <td>${feature.milestone}</td> + <td>${feature.outstanding_notifications}</td> + <td> + ${new Date(feature.accurate_as_of).toLocaleDateString()} + </td> + </tr> + `)} + </tbody> + </table> + </div> + `}render(){return x$1` + ${this.renderSubheader()} + ${this.loading?this.renderSkeletons():this.renderStaleFeatures()} + `}};__decorate$j([r$6()],ChromedashStaleFeaturesPage.prototype,"staleFeatures",void 0),__decorate$j([r$6()],ChromedashStaleFeaturesPage.prototype,"loading",void 0),__decorate$j([r$6()],ChromedashStaleFeaturesPage.prototype,"_sortColumn",void 0),__decorate$j([r$6()],ChromedashStaleFeaturesPage.prototype,"_sortDirection",void 0),ChromedashStaleFeaturesPage=__decorate$j([t$3("chromedash-stale-features-page")],ChromedashStaleFeaturesPage);var __decorate$i=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};class ChromedashTimeline extends i$4{constructor(){super(...arguments),this.type="",this.view="",this.props=[],this.selectedBucketId="1",this.showAllHistoricalData=!1}static get styles(){return[...SHARED_STYLES,i$7` + :host { + display: block; + flex: 1; + width: var(--max-content-width); + } + + :host label { + margin-left: 8px; + cursor: pointer; + } + + #chart { + margin-top: 15px; + width: 100%; + height: 450px; + background: var(--table-alternate-background); + border-radius: var(--border-radius); + } + + #http-archive-data { + border: 0; + width: 100%; + height: 870px; + } + + .header_title { + margin: 32px 0 15px 0; + font-weight: 500; + color: #000; + } + + .description { + margin: 15px 0; + } + + .callout { + padding: var(--content-padding); + margin-top: var(--content-padding); + background-color: var(--sl-color-warning-100); + border-color: rgba(27, 31, 35, 0.15); + line-height: 1.4; + } + + #bigquery:empty { + display: none; + } + + #bigquery { + font-family: 'Courier New', Courier, monospace; + font-weight: 600; + padding: 15px; + margin-bottom: 100px; + background: var(--table-alternate-background); + display: inline-block; + } + + #datalist-input { + width: 20em; + border-radius: 10px; + height: 25px; + padding-left: 10px; + font-size: 15px; + } + + sl-progress-bar { + --height: 4px; + --track-color: var(--barchart-foreground); + --indicator-color: var(--barchart-background); + } + `]}updated(){window.google.charts.setOnLoadCallback(this._updateTimeline.bind(this))}updateSelectedBucketId(e){const inputValue=e.currentTarget.value,feature=this.props.find(el=>el[1]===inputValue);feature?this.selectedBucketId=feature[0].toString():inputValue&&showToastMessage("No matching features. Please try again!")}toggleShowAllHistoricalData(){this.showAllHistoricalData=!this.showAllHistoricalData}firstUpdated(){window.google.charts.load("current",{packages:["corechart"]})}drawVisualization(data,bucketId,showAllHistoricalData){function aggregateByMonth(date){const month=date.getMonth(),year=date.getFullYear();return new Date(year,month)}const datatable=new google.visualization.DataTable;datatable.addColumn("date","Date"),datatable.addColumn("number","Percentage"),datatable.addColumn({type:"string",role:"annotation"}),datatable.addColumn({type:"string",role:"annotationText"});const rowArray=[];for(let i=0,item;item=data[i];++i){const dateStr=item.date.split("-"),date=new Date;date.setFullYear(parseInt(dateStr[0]),parseInt(dateStr[1])-1,parseInt(dateStr[2]));const row=[date,parseFloat((100*item.day_percentage).toFixed(6))];"2017-10-27"===item.date?row.push("A","Modernized metrics"):row.push(null,null),rowArray.push(row)}datatable.addRows(rowArray);const groupedTable=window.google.visualization.data.group(datatable,[{column:0,modifier:aggregateByMonth,type:"date"}],[{column:1,aggregation:window.google.visualization.data.avg,type:"number",label:"Monthly Average"}],[{column:2,type:"string"}]),formatter=new window.google.visualization.NumberFormat({fractionDigits:6});formatter.format(groupedTable,1);let view=groupedTable;if(!showAllHistoricalData){const startYear=new Date().getFullYear()-2;view=new window.google.visualization.DataView(groupedTable),view.setRows(view.getFilteredRows([{column:0,minValue:new Date(startYear,0,1)}]))}const chartEl=this.shadowRoot.querySelector("#chart"),chart=new window.google.visualization.LineChart(chartEl);chart.draw(view,{backgroundColor:"white",legend:{position:"none"},curveType:"function",vAxis:{title:"% page loads",minValue:0},hAxis:{title:"Date",format:"MMM d, YYYY"},width:"100%",height:"100%",pointSize:4,series:{0:{color:"#4580c0"}},trendlines:{0:{type:"linear",opacity:.5,color:"#bdd6ed",pointsVisible:!1}}})}_updateTimeline(){if("1"!==this.selectedBucketId&&this.props.length){let url="/data/timeline/"+this.type+this.view+"?bucket_id="+this.selectedBucketId;this._renderHTTPArchiveData();const chartEl=this.shadowRoot.querySelector("#chart");chartEl.innerHTML.includes("sl-progress-bar")||chartEl.insertAdjacentHTML("afterbegin","<sl-progress-bar indeterminate></sl-progress-bar>");const options={credentials:"omit"};fetch(url,options).then(res=>res.json()).then(response=>{this.drawVisualization(response,this.selectedBucketId,this.showAllHistoricalData)});const currentUrl="/metrics/"+this.type+"/timeline/"+this.view+"/"+this.selectedBucketId;history.pushState&&location.pathname!=currentUrl&&history.pushState({id:this.selectedBucketId},"",currentUrl)}}_renderHTTPArchiveData(){const feature=this.props.find(el=>el[0]===parseInt(this.selectedBucketId));if(feature){let featureName=feature[1];const inputEl=this.shadowRoot.querySelector("#datalist-input");inputEl.value=featureName,"css"==this.type&&(featureName=convertToCamelCaseFeatureName(featureName));const REPORT_ID="1M8kXOqPkwYNKjJhtag_nvDNJCpvmw_ri",dsEmbedUrl=`https://datastudio.google.com/embed/reporting/${"1M8kXOqPkwYNKjJhtag_nvDNJCpvmw_ri"}/page/tc5b?params=%7B"df3":"include%25EE%2580%25800%25EE%2580%2580IN%25EE%2580%2580${featureName}"%7D`,hadEl=this.shadowRoot.querySelector("#http-archive-data");hadEl.src=dsEmbedUrl;const bigqueryEl=this.shadowRoot.querySelector("#bigquery");bigqueryEl.textContent=`#standardSQL +SELECT date, client, pct_urls, sample_urls +FROM \`httparchive.blink_features.usage\` +WHERE feature = '${featureName}' +AND date = (SELECT MAX(date) FROM \`httparchive.blink_features.usage\`) +ORDER BY date DESC, client`}}render(){const note2017=x$1` + <p class="callout"> + <b>Note</b>: on 2017-10-26 the underlying metrics were switched over to + a newer collection system which is + <a + href="https://groups.google.com/a/chromium.org/forum/#!msg/blink-api-owners-discuss/IpIkbz0qtrM/HUCfSMv2AQAJ" + target="_blank" + >more accurate</a + >. This is also the reason for the abrupt spike around 2017-10-26. + </p> + `;return x$1` + <input + id="datalist-input" + type="search" + list="features" + autocomplete="off" + placeholder="Select or search a property" + @change="${this.updateSelectedBucketId}" + /> + <datalist id="features"> + ${this.props.map(prop=>x$1` + <option + value="${prop[1]}" + dataset-debug-bucket-id="${prop[0]}" + ></option> + `)} + </datalist> + <label> + Show all historical data: + <input + type="checkbox" + ?checked="${this.showAllHistoricalData}" + @change="${this.toggleShowAllHistoricalData}" + /> + </label> + <h3 id="usage" class="header_title"> + Percentage of page loads over time + </h3> + <p class="description"> + The chart below shows the percentage of page loads (in Chrome) that use + this feature at least once. Data is across all channels and platforms. + Newly added use counters that are not on Chrome stable yet only have + data from the Chrome channels they're on. + </p> + <div id="chart"></div> + ${this.showAllHistoricalData?note2017:E$1} + <h3 id="httparchive" class="header_title"> + Adoption of the feature on top sites + </h3> + <p class="description"> + The chart below shows the adoption of the feature by the top URLs on the + internet. Data from + <a href="https://httparchive.org/" target="_blank">HTTP Archive</a>. + </p> + <iframe id="http-archive-data"></iframe> + <p class="callout"> + <b>Note</b>: The jump around July and December 2018 are because the + corpus of URLs crawled by HTTP Archive increased. These jumps have no + correlation with the jump in the top graph. See the + <a + href="https://discuss.httparchive.org/t/changes-to-the-http-archive-corpus/1539" + target="_blank" + >announcement</a + > + for more details. + </p> + <p class="description"> + Copy and run this command in + <a href="https://bigquery.cloud.google.com" target="_blank">BigQuery</a> + to produce similar results: + </p> + <pre id="bigquery"></pre> + `}}__decorate$i([n$5({type:String})],ChromedashTimeline.prototype,"type",void 0),__decorate$i([n$5({type:String})],ChromedashTimeline.prototype,"view",void 0),__decorate$i([n$5({attribute:!1})],ChromedashTimeline.prototype,"props",void 0),__decorate$i([n$5({attribute:!1})],ChromedashTimeline.prototype,"selectedBucketId",void 0),__decorate$i([n$5({attribute:!1})],ChromedashTimeline.prototype,"showAllHistoricalData",void 0);function capitalize(word){const letters=word.split("");return letters[0]=letters[0].toUpperCase(),letters.join("")}function convertToCamelCaseFeatureName(property){return"CSSProperty"+property.split("-").map(capitalize).join("")}customElements.define("chromedash-timeline",ChromedashTimeline);var __decorate$h=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};class ChromedashTimelinePage extends i$4{constructor(){super(...arguments),this.type="",this.view="",this.props=[],this.selectedBucketId="1"}static get styles(){return[...SHARED_STYLES,i$7``]}connectedCallback(){super.connectedCallback();let endpoint=`/data/blink/${this.type}props`;const options={credentials:"omit"};fetch(endpoint,options).then(res=>res.json()).then(props=>{this.props=props}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}renderSubheader(){const subTitleText=METRICS_TYPE_AND_VIEW_TO_SUBTITLE[this.type+this.view];return x$1` + <div id="subheader"> + <h2 id="breadcrumbs"> + <a href="/metrics/${this.type}/${this.view}"> + <sl-icon name="arrow-left"></sl-icon> </a + >${subTitleText} > timeline + </h2> + </div> + `}renderDataPanel(){return x$1` + <chromedash-timeline + .type=${this.type} + .view=${this.view} + .props=${this.props} + .selectedBucketId=${this.selectedBucketId} + > + </chromedash-timeline> + `}render(){return x$1` ${this.renderSubheader()} ${this.renderDataPanel()} `}}__decorate$h([n$5({type:String})],ChromedashTimelinePage.prototype,"type",void 0),__decorate$h([n$5({type:String})],ChromedashTimelinePage.prototype,"view",void 0),__decorate$h([n$5({attribute:!1})],ChromedashTimelinePage.prototype,"props",void 0),__decorate$h([n$5({attribute:!1})],ChromedashTimelinePage.prototype,"selectedBucketId",void 0),customElements.define("chromedash-timeline-page",ChromedashTimelinePage);var __decorate$g=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const DEFAULT_DURATION=7e3;let ChromedashToast=class ChromedashToast extends i$4{constructor(){super(...arguments),this.msg="",this.open=!1,this.actionLabel="",this.currentTimeout=null,this.waitingForTransition=!1}static get styles(){return[...SHARED_STYLES,i$7` + :host { + display: flex; + justify-content: space-between; + position: fixed; + background: var(--toast-background); + color: var(--toast-color); + min-height: 48px; + min-width: 288px; + padding: var(--content-padding); + box-sizing: border-box; + box-shadow: var(--card-box-shadow); + border-radius: var(--border-radius); + margin: var(--content-padding); + cursor: default; + transition: + transform 0.3s, + opacity 0.3s; + opacity: 0; + will-change: opacity, transform; + -webkit-transform: translateY(100px); + transform: translateY(100px); + z-index: 3; + bottom: 0; + } + + :host([open]) { + opacity: 1; + transform: translateY(-32px); + } + + #action { + text-transform: uppercase; + text-decoration: none; + color: var(--toast-action-color); + font-weight: bold; + } + + #msg { + margin-right: var(--content-padding); + } + `]}showMessage(msg,optAction,optTapHandler,optDuration){if(!this.waitingForTransition){if(this.msg=msg,this.actionLabel=optAction,optTapHandler){const action=this.shadowRoot.querySelector("#action");action&&action.addEventListener("click",e=>{e.preventDefault(),optTapHandler()},{once:!0})}this.open?(this.open=!1,this.waitingForTransition=!0,null!==this.currentTimeout&&clearTimeout(this.currentTimeout),this.addEventListener("transitionend",()=>{this.show(optDuration),this.waitingForTransition=!1},{once:!0})):this.show(optDuration)}}show(optDuration){const duration=optDuration||DEFAULT_DURATION;0<duration&&(this.currentTimeout=window.setTimeout(()=>{this.open=!1},duration)),this.open=!0}render(){return x$1` + <span id="msg">${this.msg}</span> + <a href="#" id="action">${this.actionLabel}</a> + `}};__decorate$g([n$5({type:String})],ChromedashToast.prototype,"msg",void 0),__decorate$g([n$5({type:Boolean,reflect:!0})],ChromedashToast.prototype,"open",void 0),__decorate$g([n$5({attribute:!1})],ChromedashToast.prototype,"actionLabel",void 0),__decorate$g([r$6()],ChromedashToast.prototype,"currentTimeout",void 0),__decorate$g([n$5({type:Boolean})],ChromedashToast.prototype,"waitingForTransition",void 0),ChromedashToast=__decorate$g([t$3("chromedash-toast")],ChromedashToast);var tree_item_styles_default=i$7` + :host { + display: block; + outline: 0; + z-index: 0; + } + + :host(:focus) { + outline: none; + } + + slot:not([name])::slotted(sl-icon) { + margin-inline-end: var(--sl-spacing-x-small); + } + + .tree-item { + position: relative; + display: flex; + align-items: stretch; + flex-direction: column; + color: var(--sl-color-neutral-700); + cursor: pointer; + user-select: none; + -webkit-user-select: none; + } + + .tree-item__checkbox { + pointer-events: none; + } + + .tree-item__expand-button, + .tree-item__checkbox, + .tree-item__label { + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-medium); + font-weight: var(--sl-font-weight-normal); + line-height: var(--sl-line-height-dense); + letter-spacing: var(--sl-letter-spacing-normal); + } + + .tree-item__checkbox::part(base) { + display: flex; + align-items: center; + } + + .tree-item__indentation { + display: block; + width: 1em; + flex-shrink: 0; + } + + .tree-item__expand-button { + display: flex; + align-items: center; + justify-content: center; + box-sizing: content-box; + color: var(--sl-color-neutral-500); + padding: var(--sl-spacing-x-small); + width: 1rem; + height: 1rem; + flex-shrink: 0; + cursor: pointer; + } + + .tree-item__expand-button { + transition: var(--sl-transition-medium) rotate ease; + } + + .tree-item--expanded .tree-item__expand-button { + rotate: 90deg; + } + + .tree-item--expanded.tree-item--rtl .tree-item__expand-button { + rotate: -90deg; + } + + .tree-item--expanded slot[name='expand-icon'], + .tree-item:not(.tree-item--expanded) slot[name='collapse-icon'] { + display: none; + } + + .tree-item:not(.tree-item--has-expand-button) .tree-item__expand-icon-slot { + display: none; + } + + .tree-item__expand-button--visible { + cursor: pointer; + } + + .tree-item__item { + display: flex; + align-items: center; + border-inline-start: solid 3px transparent; + } + + .tree-item--disabled .tree-item__item { + opacity: 0.5; + outline: none; + cursor: not-allowed; + } + + :host(:focus-visible) .tree-item__item { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + z-index: 2; + } + + :host(:not([aria-disabled='true'])) .tree-item--selected .tree-item__item { + background-color: var(--sl-color-neutral-100); + border-inline-start-color: var(--sl-color-primary-600); + } + + :host(:not([aria-disabled='true'])) .tree-item__expand-button { + color: var(--sl-color-neutral-600); + } + + .tree-item__label { + display: flex; + align-items: center; + transition: var(--sl-transition-fast) color; + } + + .tree-item__children { + display: block; + font-size: calc(1em + var(--indent-size, var(--sl-spacing-medium))); + } + + /* Indentation lines */ + .tree-item__children { + position: relative; + } + + .tree-item__children::before { + content: ''; + position: absolute; + top: var(--indent-guide-offset); + bottom: var(--indent-guide-offset); + left: calc(1em - (var(--indent-guide-width) / 2) - 1px); + border-inline-end: var(--indent-guide-width) var(--indent-guide-style) var(--indent-guide-color); + z-index: 1; + } + + .tree-item--rtl .tree-item__children::before { + left: auto; + right: 1em; + } + + @media (forced-colors: active) { + :host(:not([aria-disabled='true'])) .tree-item--selected .tree-item__item { + outline: dashed 1px SelectedItem; + } + } +`;function n(n,r,t){return n?r(n):t?.(n)}var _SlTreeItem=class _SlTreeItem extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.indeterminate=!1,this.isLeaf=!1,this.loading=!1,this.selectable=!1,this.expanded=!1,this.selected=!1,this.disabled=!1,this.lazy=!1}static isTreeItem(node){return node instanceof Element&&"treeitem"===node.getAttribute("role")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","treeitem"),this.setAttribute("tabindex","-1"),this.isNestedItem()&&(this.slot="children")}firstUpdated(){this.childrenContainer.hidden=!this.expanded,this.childrenContainer.style.height=this.expanded?"auto":"0",this.isLeaf=!this.lazy&&0===this.getChildrenItems().length,this.handleExpandedChange()}async animateCollapse(){this.emit("sl-collapse"),await stopAnimations(this.childrenContainer);const{keyframes,options}=getAnimation(this,"tree-item.collapse",{dir:this.localize.dir()});await animateTo(this.childrenContainer,shimKeyframesHeightAuto(keyframes,this.childrenContainer.scrollHeight),options),this.childrenContainer.hidden=!0,this.emit("sl-after-collapse")}isNestedItem(){const parent=this.parentElement;return!!parent&&_SlTreeItem.isTreeItem(parent)}handleChildrenSlotChange(){this.loading=!1,this.isLeaf=!this.lazy&&0===this.getChildrenItems().length}willUpdate(changedProperties){changedProperties.has("selected")&&!changedProperties.has("indeterminate")&&(this.indeterminate=!1)}async animateExpand(){this.emit("sl-expand"),await stopAnimations(this.childrenContainer),this.childrenContainer.hidden=!1;const{keyframes,options}=getAnimation(this,"tree-item.expand",{dir:this.localize.dir()});await animateTo(this.childrenContainer,shimKeyframesHeightAuto(keyframes,this.childrenContainer.scrollHeight),options),this.childrenContainer.style.height="auto",this.emit("sl-after-expand")}handleLoadingChange(){this.setAttribute("aria-busy",this.loading?"true":"false"),this.loading||this.animateExpand()}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleExpandedChange(){this.isLeaf?this.removeAttribute("aria-expanded"):this.setAttribute("aria-expanded",this.expanded?"true":"false")}handleExpandAnimation(){this.expanded?this.lazy?(this.loading=!0,this.emit("sl-lazy-load")):this.animateExpand():this.animateCollapse()}handleLazyChange(){this.emit("sl-lazy-change")}getChildrenItems({includeDisabled=!0}={}){return this.childrenSlot?[...this.childrenSlot.assignedElements({flatten:!0})].filter(item=>_SlTreeItem.isTreeItem(item)&&(includeDisabled||!item.disabled)):[]}render(){const isRtl="rtl"===this.localize.dir(),showExpandButton=!this.loading&&(!this.isLeaf||this.lazy);return x$1` + <div + part="base" + class="${e$2({"tree-item":!0,"tree-item--expanded":this.expanded,"tree-item--selected":this.selected,"tree-item--disabled":this.disabled,"tree-item--leaf":this.isLeaf,"tree-item--has-expand-button":showExpandButton,"tree-item--rtl":"rtl"===this.localize.dir()})}" + > + <div + class="tree-item__item" + part=" + item + ${this.disabled?"item--disabled":""} + ${this.expanded?"item--expanded":""} + ${this.indeterminate?"item--indeterminate":""} + ${this.selected?"item--selected":""} + " + > + <div class="tree-item__indentation" part="indentation"></div> + + <div + part="expand-button" + class=${e$2({"tree-item__expand-button":!0,"tree-item__expand-button--visible":showExpandButton})} + aria-hidden="true" + > + ${n(this.loading,()=>x$1` <sl-spinner part="spinner" exportparts="base:spinner__base"></sl-spinner> `)} + <slot class="tree-item__expand-icon-slot" name="expand-icon"> + <sl-icon library="system" name=${isRtl?"chevron-left":"chevron-right"}></sl-icon> + </slot> + <slot class="tree-item__expand-icon-slot" name="collapse-icon"> + <sl-icon library="system" name=${isRtl?"chevron-left":"chevron-right"}></sl-icon> + </slot> + </div> + + ${n(this.selectable,()=>x$1` + <sl-checkbox + part="checkbox" + exportparts=" + base:checkbox__base, + control:checkbox__control, + control--checked:checkbox__control--checked, + control--indeterminate:checkbox__control--indeterminate, + checked-icon:checkbox__checked-icon, + indeterminate-icon:checkbox__indeterminate-icon, + label:checkbox__label + " + class="tree-item__checkbox" + ?disabled="${this.disabled}" + ?checked="${l(this.selected)}" + ?indeterminate="${this.indeterminate}" + tabindex="-1" + ></sl-checkbox> + `)} + + <slot class="tree-item__label" part="label"></slot> + </div> + + <div class="tree-item__children" part="children" role="group"> + <slot name="children" @slotchange="${this.handleChildrenSlotChange}"></slot> + </div> + </div> + `}};_SlTreeItem.styles=[component_styles_default,tree_item_styles_default],_SlTreeItem.dependencies={"sl-checkbox":SlCheckbox,"sl-icon":SlIcon,"sl-spinner":SlSpinner},__decorateClass([r$6()],_SlTreeItem.prototype,"indeterminate",2),__decorateClass([r$6()],_SlTreeItem.prototype,"isLeaf",2),__decorateClass([r$6()],_SlTreeItem.prototype,"loading",2),__decorateClass([r$6()],_SlTreeItem.prototype,"selectable",2),__decorateClass([n$5({type:Boolean,reflect:!0})],_SlTreeItem.prototype,"expanded",2),__decorateClass([n$5({type:Boolean,reflect:!0})],_SlTreeItem.prototype,"selected",2),__decorateClass([n$5({type:Boolean,reflect:!0})],_SlTreeItem.prototype,"disabled",2),__decorateClass([n$5({type:Boolean,reflect:!0})],_SlTreeItem.prototype,"lazy",2),__decorateClass([e$6("slot:not([name])")],_SlTreeItem.prototype,"defaultSlot",2),__decorateClass([e$6("slot[name=children]")],_SlTreeItem.prototype,"childrenSlot",2),__decorateClass([e$6(".tree-item__item")],_SlTreeItem.prototype,"itemElement",2),__decorateClass([e$6(".tree-item__children")],_SlTreeItem.prototype,"childrenContainer",2),__decorateClass([e$6(".tree-item__expand-button slot")],_SlTreeItem.prototype,"expandButtonSlot",2),__decorateClass([watch("loading",{waitUntilFirstUpdate:!0})],_SlTreeItem.prototype,"handleLoadingChange",1),__decorateClass([watch("disabled")],_SlTreeItem.prototype,"handleDisabledChange",1),__decorateClass([watch("selected")],_SlTreeItem.prototype,"handleSelectedChange",1),__decorateClass([watch("expanded",{waitUntilFirstUpdate:!0})],_SlTreeItem.prototype,"handleExpandedChange",1),__decorateClass([watch("expanded",{waitUntilFirstUpdate:!0})],_SlTreeItem.prototype,"handleExpandAnimation",1),__decorateClass([watch("lazy",{waitUntilFirstUpdate:!0})],_SlTreeItem.prototype,"handleLazyChange",1);var SlTreeItem=_SlTreeItem;setDefaultAnimation("tree-item.expand",{keyframes:[{height:"0",opacity:"0",overflow:"hidden"},{height:"auto",opacity:"1",overflow:"hidden"}],options:{duration:250,easing:"cubic-bezier(0.4, 0.0, 0.2, 1)"}}),setDefaultAnimation("tree-item.collapse",{keyframes:[{height:"auto",opacity:"1",overflow:"hidden"},{height:"0",opacity:"0",overflow:"hidden"}],options:{duration:200,easing:"cubic-bezier(0.4, 0.0, 0.2, 1)"}}),SlTreeItem.define("sl-tree-item");var tree_styles_default=i$7` + :host { + /* + * These are actually used by tree item, but we define them here so they can more easily be set and all tree items + * stay consistent. + */ + --indent-guide-color: var(--sl-color-neutral-200); + --indent-guide-offset: 0; + --indent-guide-style: solid; + --indent-guide-width: 0; + --indent-size: var(--sl-spacing-large); + + display: block; + + /* + * Tree item indentation uses the "em" unit to increment its width on each level, so setting the font size to zero + * here removes the indentation for all the nodes on the first level. + */ + font-size: 0; + } +`;function clamp(value,min,max){const noNegativeZero=n=>Object.is(n,-0)?0:n;return value<min?noNegativeZero(min):value>max?noNegativeZero(max):noNegativeZero(value)}function syncCheckboxes(changedTreeItem,initialSync=!1){function syncParentItem(treeItem){const children=treeItem.getChildrenItems({includeDisabled:!1});if(children.length){const allChecked=children.every(item=>item.selected),allUnchecked=children.every(item=>!item.selected&&!item.indeterminate);treeItem.selected=allChecked,treeItem.indeterminate=!allChecked&&!allUnchecked}}function syncAncestors(treeItem){const parentItem=treeItem.parentElement;SlTreeItem.isTreeItem(parentItem)&&(syncParentItem(parentItem),syncAncestors(parentItem))}function syncDescendants(treeItem){for(const childItem of treeItem.getChildrenItems())childItem.selected=initialSync?treeItem.selected||childItem.selected:!childItem.disabled&&treeItem.selected,syncDescendants(childItem);initialSync&&syncParentItem(treeItem)}syncDescendants(changedTreeItem),syncAncestors(changedTreeItem)}var SlTree=class extends ShoelaceElement{constructor(){super(),this.selection="single",this.clickTarget=null,this.localize=new LocalizeController(this),this.initTreeItem=item=>{item.selectable="multiple"===this.selection,["expand","collapse"].filter(status=>!!this.querySelector(`[slot="${status}-icon"]`)).forEach(status=>{const existingIcon=item.querySelector(`[slot="${status}-icon"]`),expandButtonIcon=this.getExpandButtonIcon(status);if(expandButtonIcon)if(null===existingIcon)item.append(expandButtonIcon);else if(existingIcon.hasAttribute("data-default"))existingIcon.replaceWith(expandButtonIcon);else;})},this.handleTreeChanged=mutations=>{for(const mutation of mutations){const addedNodes=[...mutation.addedNodes].filter(SlTreeItem.isTreeItem),removedNodes=[...mutation.removedNodes].filter(SlTreeItem.isTreeItem);addedNodes.forEach(this.initTreeItem),this.lastFocusedItem&&removedNodes.includes(this.lastFocusedItem)&&(this.lastFocusedItem=null)}},this.handleFocusOut=event=>{const relatedTarget=event.relatedTarget;relatedTarget&&this.contains(relatedTarget)||(this.tabIndex=0)},this.handleFocusIn=event=>{const target=event.target;event.target===this&&this.focusItem(this.lastFocusedItem||this.getAllTreeItems()[0]),SlTreeItem.isTreeItem(target)&&!target.disabled&&(this.lastFocusedItem&&(this.lastFocusedItem.tabIndex=-1),this.lastFocusedItem=target,this.tabIndex=-1,target.tabIndex=0)},this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),this.addEventListener("sl-lazy-change",this.handleSlotChange)}async connectedCallback(){super.connectedCallback(),this.setAttribute("role","tree"),this.setAttribute("tabindex","0"),await this.updateComplete,this.mutationObserver=new MutationObserver(this.handleTreeChanged),this.mutationObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){var _a;super.disconnectedCallback(),null==(_a=this.mutationObserver)?void 0:_a.disconnect()}getExpandButtonIcon(status){const slot="expand"===status?this.expandedIconSlot:this.collapsedIconSlot,icon=slot.assignedElements({flatten:!0})[0];if(icon){const clone=icon.cloneNode(!0);return[clone,...clone.querySelectorAll("[id]")].forEach(el=>el.removeAttribute("id")),clone.setAttribute("data-default",""),clone.slot=`${status}-icon`,clone}return null}selectItem(selectedItem){const previousSelection=[...this.selectedItems];if("multiple"===this.selection)selectedItem.selected=!selectedItem.selected,selectedItem.lazy&&(selectedItem.expanded=!0),syncCheckboxes(selectedItem);else if("single"===this.selection||selectedItem.isLeaf){const items=this.getAllTreeItems();for(const item of items)item.selected=item===selectedItem}else"leaf"===this.selection&&(selectedItem.expanded=!selectedItem.expanded);const nextSelection=this.selectedItems;(previousSelection.length!==nextSelection.length||nextSelection.some(item=>!previousSelection.includes(item)))&&Promise.all(nextSelection.map(el=>el.updateComplete)).then(()=>{this.emit("sl-selection-change",{detail:{selection:nextSelection}})})}getAllTreeItems(){return[...this.querySelectorAll("sl-tree-item")]}focusItem(item){null==item?void 0:item.focus()}handleKeyDown(event){if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Home","End","Enter"," "].includes(event.key))return;if(event.composedPath().some(el=>{var _a;return["input","textarea"].includes(null==(_a=null==el?void 0:el.tagName)?void 0:_a.toLowerCase())}))return;const items=this.getFocusableItems(),isLtr="ltr"===this.localize.dir(),isRtl="rtl"===this.localize.dir();if(0<items.length){event.preventDefault();const activeItemIndex=items.findIndex(item=>item.matches(":focus")),activeItem=items[activeItemIndex],focusItemAt=index=>{const item=items[clamp(index,0,items.length-1)];this.focusItem(item)},toggleExpand=expanded=>{activeItem.expanded=expanded};"ArrowDown"===event.key?focusItemAt(activeItemIndex+1):"ArrowUp"===event.key?focusItemAt(activeItemIndex-1):isLtr&&"ArrowRight"===event.key||isRtl&&"ArrowLeft"===event.key?!activeItem||activeItem.disabled||activeItem.expanded||activeItem.isLeaf&&!activeItem.lazy?focusItemAt(activeItemIndex+1):toggleExpand(!0):isLtr&&"ArrowLeft"===event.key||isRtl&&"ArrowRight"===event.key?!activeItem||activeItem.disabled||activeItem.isLeaf||!activeItem.expanded?focusItemAt(activeItemIndex-1):toggleExpand(!1):"Home"===event.key?focusItemAt(0):"End"===event.key?focusItemAt(items.length-1):("Enter"===event.key||" "===event.key)&&!activeItem.disabled&&this.selectItem(activeItem)}}handleClick(event){const target=event.target,treeItem=target.closest("sl-tree-item"),isExpandButton=event.composedPath().some(el=>{var _a;return null==(_a=null==el?void 0:el.classList)?void 0:_a.contains("tree-item__expand-button")});!treeItem||treeItem.disabled||target!==this.clickTarget||(isExpandButton?treeItem.expanded=!treeItem.expanded:this.selectItem(treeItem))}handleMouseDown(event){this.clickTarget=event.target}handleSlotChange(){const items=this.getAllTreeItems();items.forEach(this.initTreeItem)}async handleSelectionChange(){const isSelectionMultiple="multiple"===this.selection,items=this.getAllTreeItems();this.setAttribute("aria-multiselectable",isSelectionMultiple?"true":"false");for(const item of items)item.selectable=isSelectionMultiple;isSelectionMultiple&&(await this.updateComplete,[...this.querySelectorAll(":scope > sl-tree-item")].forEach(treeItem=>syncCheckboxes(treeItem,!0)))}get selectedItems(){const items=this.getAllTreeItems(),isSelected=item=>item.selected;return items.filter(isSelected)}getFocusableItems(){const items=this.getAllTreeItems(),collapsedItems=new Set;return items.filter(item=>{var _a;if(item.disabled)return!1;const parent=null==(_a=item.parentElement)?void 0:_a.closest("[role=treeitem]");return parent&&(!parent.expanded||parent.loading||collapsedItems.has(parent))&&collapsedItems.add(item),!collapsedItems.has(item)})}render(){return x$1` + <div + part="base" + class="tree" + @click=${this.handleClick} + @keydown=${this.handleKeyDown} + @mousedown=${this.handleMouseDown} + > + <slot @slotchange=${this.handleSlotChange}></slot> + <span hidden aria-hidden="true"><slot name="expand-icon"></slot></span> + <span hidden aria-hidden="true"><slot name="collapse-icon"></slot></span> + </div> + `}};SlTree.styles=[component_styles_default,tree_styles_default],__decorateClass([e$6("slot:not([name])")],SlTree.prototype,"defaultSlot",2),__decorateClass([e$6("slot[name=expand-icon]")],SlTree.prototype,"expandedIconSlot",2),__decorateClass([e$6("slot[name=collapse-icon]")],SlTree.prototype,"collapsedIconSlot",2),__decorateClass([n$5()],SlTree.prototype,"selection",2),__decorateClass([watch("selection")],SlTree.prototype,"handleSelectionChange",1),SlTree.define("sl-tree");var visually_hidden_styles_default=i$7` + :host(:not(:focus-within)) { + position: absolute !important; + width: 1px !important; + height: 1px !important; + clip: rect(0 0 0 0) !important; + clip-path: inset(50%) !important; + border: none !important; + overflow: hidden !important; + white-space: nowrap !important; + padding: 0 !important; + } +`,SlVisuallyHidden=class extends ShoelaceElement{render(){return x$1` <slot></slot> `}};SlVisuallyHidden.styles=[component_styles_default,visually_hidden_styles_default],SlVisuallyHidden.define("sl-visually-hidden");var tab_panel_styles_default=i$7` + :host { + --padding: 0; + + display: none; + } + + :host([active]) { + display: block; + } + + .tab-panel { + display: block; + padding: var(--padding); + } +`,id$1=0,SlTabPanel=class extends ShoelaceElement{constructor(){super(...arguments),this.attrId=++id$1,this.componentId=`sl-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=0<this.id.length?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return x$1` + <slot + part="base" + class=${e$2({"tab-panel":!0,"tab-panel--active":this.active})} + ></slot> + `}};SlTabPanel.styles=[component_styles_default,tab_panel_styles_default],__decorateClass([n$5({reflect:!0})],SlTabPanel.prototype,"name",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTabPanel.prototype,"active",2),__decorateClass([watch("active")],SlTabPanel.prototype,"handleActiveChange",1),SlTabPanel.define("sl-tab-panel");var tab_styles_default=i$7` + :host { + display: inline-block; + } + + .tab { + display: inline-flex; + align-items: center; + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-small); + font-weight: var(--sl-font-weight-semibold); + border-radius: var(--sl-border-radius-medium); + color: var(--sl-color-neutral-600); + padding: var(--sl-spacing-medium) var(--sl-spacing-large); + white-space: nowrap; + user-select: none; + -webkit-user-select: none; + cursor: pointer; + transition: + var(--transition-speed) box-shadow, + var(--transition-speed) color; + } + + .tab:hover:not(.tab--disabled) { + color: var(--sl-color-primary-600); + } + + :host(:focus) { + outline: transparent; + } + + :host(:focus-visible) { + color: var(--sl-color-primary-600); + outline: var(--sl-focus-ring); + outline-offset: calc(-1 * var(--sl-focus-ring-width) - var(--sl-focus-ring-offset)); + } + + .tab.tab--active:not(.tab--disabled) { + color: var(--sl-color-primary-600); + } + + .tab.tab--closable { + padding-inline-end: var(--sl-spacing-small); + } + + .tab.tab--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .tab__close-button { + font-size: var(--sl-font-size-small); + margin-inline-start: var(--sl-spacing-small); + } + + .tab__close-button::part(base) { + padding: var(--sl-spacing-3x-small); + } + + @media (forced-colors: active) { + .tab.tab--active:not(.tab--disabled) { + outline: solid 1px transparent; + outline-offset: -3px; + } + } +`,id=0,SlTab=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.attrId=++id,this.componentId=`sl-tab-${this.attrId}`,this.panel="",this.active=!1,this.closable=!1,this.disabled=!1,this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleCloseClick(event){event.stopPropagation(),this.emit("sl-close")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.tabIndex=this.disabled&&!this.active?-1:0}render(){return this.id=0<this.id.length?this.id:this.componentId,x$1` + <div + part="base" + class=${e$2({tab:!0,"tab--active":this.active,"tab--closable":this.closable,"tab--disabled":this.disabled})} + > + <slot></slot> + ${this.closable?x$1` + <sl-icon-button + part="close-button" + exportparts="base:close-button__base" + name="x-lg" + library="system" + label=${this.localize.term("close")} + class="tab__close-button" + @click=${this.handleCloseClick} + tabindex="-1" + ></sl-icon-button> + `:""} + </div> + `}};SlTab.styles=[component_styles_default,tab_styles_default],SlTab.dependencies={"sl-icon-button":SlIconButton},__decorateClass([e$6(".tab")],SlTab.prototype,"tab",2),__decorateClass([n$5({reflect:!0})],SlTab.prototype,"panel",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTab.prototype,"active",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTab.prototype,"closable",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlTab.prototype,"disabled",2),__decorateClass([n$5({type:Number,reflect:!0})],SlTab.prototype,"tabIndex",2),__decorateClass([watch("active")],SlTab.prototype,"handleActiveChange",1),__decorateClass([watch("disabled")],SlTab.prototype,"handleDisabledChange",1),SlTab.define("sl-tab");var tab_group_styles_default=i$7` + :host { + --indicator-color: var(--sl-color-primary-600); + --track-color: var(--sl-color-neutral-200); + --track-width: 2px; + + display: block; + } + + .tab-group { + display: flex; + border-radius: 0; + } + + .tab-group__tabs { + display: flex; + position: relative; + } + + .tab-group__indicator { + position: absolute; + transition: + var(--sl-transition-fast) translate ease, + var(--sl-transition-fast) width ease; + } + + .tab-group--has-scroll-controls .tab-group__nav-container { + position: relative; + padding: 0 var(--sl-spacing-x-large); + } + + .tab-group--has-scroll-controls .tab-group__scroll-button--start--hidden, + .tab-group--has-scroll-controls .tab-group__scroll-button--end--hidden { + visibility: hidden; + } + + .tab-group__body { + display: block; + overflow: auto; + } + + .tab-group__scroll-button { + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + bottom: 0; + width: var(--sl-spacing-x-large); + } + + .tab-group__scroll-button--start { + left: 0; + } + + .tab-group__scroll-button--end { + right: 0; + } + + .tab-group--rtl .tab-group__scroll-button--start { + left: auto; + right: 0; + } + + .tab-group--rtl .tab-group__scroll-button--end { + left: 0; + right: auto; + } + + /* + * Top + */ + + .tab-group--top { + flex-direction: column; + } + + .tab-group--top .tab-group__nav-container { + order: 1; + } + + .tab-group--top .tab-group__nav { + display: flex; + overflow-x: auto; + + /* Hide scrollbar in Firefox */ + scrollbar-width: none; + } + + /* Hide scrollbar in Chrome/Safari */ + .tab-group--top .tab-group__nav::-webkit-scrollbar { + width: 0; + height: 0; + } + + .tab-group--top .tab-group__tabs { + flex: 1 1 auto; + position: relative; + flex-direction: row; + border-bottom: solid var(--track-width) var(--track-color); + } + + .tab-group--top .tab-group__indicator { + bottom: calc(-1 * var(--track-width)); + border-bottom: solid var(--track-width) var(--indicator-color); + } + + .tab-group--top .tab-group__body { + order: 2; + } + + .tab-group--top ::slotted(sl-tab-panel) { + --padding: var(--sl-spacing-medium) 0; + } + + /* + * Bottom + */ + + .tab-group--bottom { + flex-direction: column; + } + + .tab-group--bottom .tab-group__nav-container { + order: 2; + } + + .tab-group--bottom .tab-group__nav { + display: flex; + overflow-x: auto; + + /* Hide scrollbar in Firefox */ + scrollbar-width: none; + } + + /* Hide scrollbar in Chrome/Safari */ + .tab-group--bottom .tab-group__nav::-webkit-scrollbar { + width: 0; + height: 0; + } + + .tab-group--bottom .tab-group__tabs { + flex: 1 1 auto; + position: relative; + flex-direction: row; + border-top: solid var(--track-width) var(--track-color); + } + + .tab-group--bottom .tab-group__indicator { + top: calc(-1 * var(--track-width)); + border-top: solid var(--track-width) var(--indicator-color); + } + + .tab-group--bottom .tab-group__body { + order: 1; + } + + .tab-group--bottom ::slotted(sl-tab-panel) { + --padding: var(--sl-spacing-medium) 0; + } + + /* + * Start + */ + + .tab-group--start { + flex-direction: row; + } + + .tab-group--start .tab-group__nav-container { + order: 1; + } + + .tab-group--start .tab-group__tabs { + flex: 0 0 auto; + flex-direction: column; + border-inline-end: solid var(--track-width) var(--track-color); + } + + .tab-group--start .tab-group__indicator { + right: calc(-1 * var(--track-width)); + border-right: solid var(--track-width) var(--indicator-color); + } + + .tab-group--start.tab-group--rtl .tab-group__indicator { + right: auto; + left: calc(-1 * var(--track-width)); + } + + .tab-group--start .tab-group__body { + flex: 1 1 auto; + order: 2; + } + + .tab-group--start ::slotted(sl-tab-panel) { + --padding: 0 var(--sl-spacing-medium); + } + + /* + * End + */ + + .tab-group--end { + flex-direction: row; + } + + .tab-group--end .tab-group__nav-container { + order: 2; + } + + .tab-group--end .tab-group__tabs { + flex: 0 0 auto; + flex-direction: column; + border-left: solid var(--track-width) var(--track-color); + } + + .tab-group--end .tab-group__indicator { + left: calc(-1 * var(--track-width)); + border-inline-start: solid var(--track-width) var(--indicator-color); + } + + .tab-group--end.tab-group--rtl .tab-group__indicator { + right: calc(-1 * var(--track-width)); + left: auto; + } + + .tab-group--end .tab-group__body { + flex: 1 1 auto; + order: 1; + } + + .tab-group--end ::slotted(sl-tab-panel) { + --padding: 0 var(--sl-spacing-medium); + } +`,resize_observer_styles_default=i$7` + :host { + display: contents; + } +`,SlResizeObserver=class extends ShoelaceElement{constructor(){super(...arguments),this.observedElements=[],this.disabled=!1}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(entries=>{this.emit("sl-resize",{detail:{entries}})}),this.disabled||this.startObserver()}disconnectedCallback(){super.disconnectedCallback(),this.stopObserver()}handleSlotChange(){this.disabled||this.startObserver()}startObserver(){const slot=this.shadowRoot.querySelector("slot");if(null!==slot){const elements=slot.assignedElements({flatten:!0});this.observedElements.forEach(el=>this.resizeObserver.unobserve(el)),this.observedElements=[],elements.forEach(el=>{this.resizeObserver.observe(el),this.observedElements.push(el)})}}stopObserver(){this.resizeObserver.disconnect()}handleDisabledChange(){this.disabled?this.stopObserver():this.startObserver()}render(){return x$1` <slot @slotchange=${this.handleSlotChange}></slot> `}};SlResizeObserver.styles=[component_styles_default,resize_observer_styles_default],__decorateClass([n$5({type:Boolean,reflect:!0})],SlResizeObserver.prototype,"disabled",2),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlResizeObserver.prototype,"handleDisabledChange",1);var SlTabGroup=class extends ShoelaceElement{constructor(){super(...arguments),this.tabs=[],this.focusableTabs=[],this.panels=[],this.localize=new LocalizeController(this),this.hasScrollControls=!1,this.shouldHideScrollStartButton=!1,this.shouldHideScrollEndButton=!1,this.placement="top",this.activation="auto",this.noScrollControls=!1,this.fixedScrollControls=!1,this.scrollOffset=1}connectedCallback(){const whenAllDefined=Promise.all([customElements.whenDefined("sl-tab"),customElements.whenDefined("sl-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>{this.repositionIndicator(),this.updateScrollControls()}),this.mutationObserver=new MutationObserver(mutations=>{const instanceMutations=mutations.filter(({target})=>{if(target===this)return!0;if(target.closest("sl-tab-group")!==this)return!1;const tagName=target.tagName.toLowerCase();return"sl-tab"===tagName||"sl-tab-panel"===tagName});if(0!==instanceMutations.length)if(instanceMutations.some(m=>!["aria-labelledby","aria-controls"].includes(m.attributeName))&&setTimeout(()=>this.setAriaLabels()),instanceMutations.some(m=>"disabled"===m.attributeName))this.syncTabsAndPanels();else if(instanceMutations.some(m=>"active"===m.attributeName)){const tabs=instanceMutations.filter(m=>"active"===m.attributeName&&"sl-tab"===m.target.tagName.toLowerCase()).map(m=>m.target),newActiveTab=tabs.find(tab=>tab.active);newActiveTab&&this.setActiveTab(newActiveTab)}}),this.updateComplete.then(()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,attributeFilter:["active","disabled","name","panel"],childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),whenAllDefined.then(()=>{const intersectionObserver=new IntersectionObserver((entries,observer)=>{var _a;0<entries[0].intersectionRatio&&(this.setAriaLabels(),this.setActiveTab(null==(_a=this.getActiveTab())?this.tabs[0]:_a,{emitEvents:!1}),observer.unobserve(entries[0].target))});intersectionObserver.observe(this.tabGroup)})})}disconnectedCallback(){var _a,_b;super.disconnectedCallback(),null==(_a=this.mutationObserver)?void 0:_a.disconnect(),this.nav&&(null==(_b=this.resizeObserver)?void 0:_b.unobserve(this.nav))}getAllTabs(){const slot=this.shadowRoot.querySelector("slot[name=\"nav\"]");return slot.assignedElements()}getAllPanels(){return[...this.body.assignedElements()].filter(el=>"sl-tab-panel"===el.tagName.toLowerCase())}getActiveTab(){return this.tabs.find(el=>el.active)}handleClick(event){const target=event.target,tab=target.closest("sl-tab"),tabGroup=null==tab?void 0:tab.closest("sl-tab-group");tabGroup!==this||null!==tab&&this.setActiveTab(tab,{scrollBehavior:"smooth"})}handleKeyDown(event){const target=event.target,tab=target.closest("sl-tab"),tabGroup=null==tab?void 0:tab.closest("sl-tab-group");if(tabGroup===this&&(["Enter"," "].includes(event.key)&&null!==tab&&(this.setActiveTab(tab,{scrollBehavior:"smooth"}),event.preventDefault()),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(event.key))){const activeEl=this.tabs.find(t=>t.matches(":focus")),isRtl="rtl"===this.localize.dir();let nextTab=null;if("sl-tab"===(null==activeEl?void 0:activeEl.tagName.toLowerCase())){if("Home"===event.key)nextTab=this.focusableTabs[0];else if("End"===event.key)nextTab=this.focusableTabs[this.focusableTabs.length-1];else if(["top","bottom"].includes(this.placement)&&event.key===(isRtl?"ArrowRight":"ArrowLeft")||["start","end"].includes(this.placement)&&"ArrowUp"===event.key){const currentIndex=this.tabs.findIndex(el=>el===activeEl);nextTab=this.findNextFocusableTab(currentIndex,"backward")}else if(["top","bottom"].includes(this.placement)&&event.key===(isRtl?"ArrowLeft":"ArrowRight")||["start","end"].includes(this.placement)&&"ArrowDown"===event.key){const currentIndex=this.tabs.findIndex(el=>el===activeEl);nextTab=this.findNextFocusableTab(currentIndex,"forward")}if(!nextTab)return;nextTab.tabIndex=0,nextTab.focus({preventScroll:!0}),"auto"===this.activation?this.setActiveTab(nextTab,{scrollBehavior:"smooth"}):this.tabs.forEach(tabEl=>{tabEl.tabIndex=tabEl===nextTab?0:-1}),["top","bottom"].includes(this.placement)&&scrollIntoView(nextTab,this.nav,"horizontal"),event.preventDefault()}}}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(tab,options){if(options=__spreadValues({emitEvents:!0,scrollBehavior:"auto"},options),tab!==this.activeTab&&!tab.disabled){const previousTab=this.activeTab;this.activeTab=tab,this.tabs.forEach(el=>{el.active=el===this.activeTab,el.tabIndex=el===this.activeTab?0:-1}),this.panels.forEach(el=>{var _a;return el.active=el.name===(null==(_a=this.activeTab)?void 0:_a.panel)}),this.syncIndicator(),["top","bottom"].includes(this.placement)&&scrollIntoView(this.activeTab,this.nav,"horizontal",options.scrollBehavior),options.emitEvents&&(previousTab&&this.emit("sl-tab-hide",{detail:{name:previousTab.panel}}),this.emit("sl-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach(tab=>{const panel=this.panels.find(el=>el.name===tab.panel);panel&&(tab.setAttribute("aria-controls",panel.getAttribute("id")),panel.setAttribute("aria-labelledby",tab.getAttribute("id")))})}repositionIndicator(){const currentTab=this.getActiveTab();if(!currentTab)return;const width=currentTab.clientWidth,height=currentTab.clientHeight,isRtl="rtl"===this.localize.dir(),allTabs=this.getAllTabs(),precedingTabs=allTabs.slice(0,allTabs.indexOf(currentTab)),offset=precedingTabs.reduce((previous,current)=>({left:previous.left+current.clientWidth,top:previous.top+current.clientHeight}),{left:0,top:0});switch(this.placement){case"top":case"bottom":this.indicator.style.width=`${width}px`,this.indicator.style.height="auto",this.indicator.style.translate=isRtl?`${-1*offset.left}px`:`${offset.left}px`;break;case"start":case"end":this.indicator.style.width="auto",this.indicator.style.height=`${height}px`,this.indicator.style.translate=`0 ${offset.top}px`}}syncTabsAndPanels(){this.tabs=this.getAllTabs(),this.focusableTabs=this.tabs.filter(el=>!el.disabled),this.panels=this.getAllPanels(),this.syncIndicator(),this.updateComplete.then(()=>this.updateScrollControls())}findNextFocusableTab(currentIndex,direction){let nextTab=null;const iterator="forward"===direction?1:-1;for(let nextIndex=currentIndex+iterator;currentIndex<this.tabs.length;){if(nextTab=this.tabs[nextIndex]||null,null===nextTab){nextTab="forward"===direction?this.focusableTabs[0]:this.focusableTabs[this.focusableTabs.length-1];break}if(!nextTab.disabled)break;nextIndex+=iterator}return nextTab}updateScrollButtons(){this.hasScrollControls&&!this.fixedScrollControls&&(this.shouldHideScrollStartButton=this.scrollFromStart()<=this.scrollOffset,this.shouldHideScrollEndButton=this.isScrolledToEnd())}isScrolledToEnd(){return this.scrollFromStart()+this.nav.clientWidth>=this.nav.scrollWidth-this.scrollOffset}scrollFromStart(){return"rtl"===this.localize.dir()?-this.nav.scrollLeft:this.nav.scrollLeft}updateScrollControls(){this.hasScrollControls=!this.noScrollControls&&["top","bottom"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth+1,this.updateScrollButtons()}syncIndicator(){const tab=this.getActiveTab();tab?(this.indicator.style.display="block",this.repositionIndicator()):this.indicator.style.display="none"}show(panel){const tab=this.tabs.find(el=>el.panel===panel);tab&&this.setActiveTab(tab,{scrollBehavior:"smooth"})}render(){const isRtl="rtl"===this.localize.dir();return x$1` + <div + part="base" + class=${e$2({"tab-group":!0,"tab-group--top":"top"===this.placement,"tab-group--bottom":"bottom"===this.placement,"tab-group--start":"start"===this.placement,"tab-group--end":"end"===this.placement,"tab-group--rtl":"rtl"===this.localize.dir(),"tab-group--has-scroll-controls":this.hasScrollControls})} + @click=${this.handleClick} + @keydown=${this.handleKeyDown} + > + <div class="tab-group__nav-container" part="nav"> + ${this.hasScrollControls?x$1` + <sl-icon-button + part="scroll-button scroll-button--start" + exportparts="base:scroll-button__base" + class=${e$2({"tab-group__scroll-button":!0,"tab-group__scroll-button--start":!0,"tab-group__scroll-button--start--hidden":this.shouldHideScrollStartButton})} + name=${isRtl?"chevron-right":"chevron-left"} + library="system" + tabindex="-1" + aria-hidden="true" + label=${this.localize.term("scrollToStart")} + @click=${this.handleScrollToStart} + ></sl-icon-button> + `:""} + + <div class="tab-group__nav" @scrollend=${this.updateScrollButtons}> + <div part="tabs" class="tab-group__tabs" role="tablist"> + <div part="active-tab-indicator" class="tab-group__indicator"></div> + <sl-resize-observer @sl-resize=${this.syncIndicator}> + <slot name="nav" @slotchange=${this.syncTabsAndPanels}></slot> + </sl-resize-observer> + </div> + </div> + + ${this.hasScrollControls?x$1` + <sl-icon-button + part="scroll-button scroll-button--end" + exportparts="base:scroll-button__base" + class=${e$2({"tab-group__scroll-button":!0,"tab-group__scroll-button--end":!0,"tab-group__scroll-button--end--hidden":this.shouldHideScrollEndButton})} + name=${isRtl?"chevron-left":"chevron-right"} + library="system" + tabindex="-1" + aria-hidden="true" + label=${this.localize.term("scrollToEnd")} + @click=${this.handleScrollToEnd} + ></sl-icon-button> + `:""} + </div> + + <slot part="body" class="tab-group__body" @slotchange=${this.syncTabsAndPanels}></slot> + </div> + `}};SlTabGroup.styles=[component_styles_default,tab_group_styles_default],SlTabGroup.dependencies={"sl-icon-button":SlIconButton,"sl-resize-observer":SlResizeObserver},__decorateClass([e$6(".tab-group")],SlTabGroup.prototype,"tabGroup",2),__decorateClass([e$6(".tab-group__body")],SlTabGroup.prototype,"body",2),__decorateClass([e$6(".tab-group__nav")],SlTabGroup.prototype,"nav",2),__decorateClass([e$6(".tab-group__indicator")],SlTabGroup.prototype,"indicator",2),__decorateClass([r$6()],SlTabGroup.prototype,"hasScrollControls",2),__decorateClass([r$6()],SlTabGroup.prototype,"shouldHideScrollStartButton",2),__decorateClass([r$6()],SlTabGroup.prototype,"shouldHideScrollEndButton",2),__decorateClass([n$5()],SlTabGroup.prototype,"placement",2),__decorateClass([n$5()],SlTabGroup.prototype,"activation",2),__decorateClass([n$5({attribute:"no-scroll-controls",type:Boolean})],SlTabGroup.prototype,"noScrollControls",2),__decorateClass([n$5({attribute:"fixed-scroll-controls",type:Boolean})],SlTabGroup.prototype,"fixedScrollControls",2),__decorateClass([t$2({passive:!0})],SlTabGroup.prototype,"updateScrollButtons",1),__decorateClass([watch("noScrollControls",{waitUntilFirstUpdate:!0})],SlTabGroup.prototype,"updateScrollControls",1),__decorateClass([watch("placement",{waitUntilFirstUpdate:!0})],SlTabGroup.prototype,"syncIndicator",1),SlTabGroup.define("sl-tab-group");var split_panel_styles_default=i$7` + :host { + --divider-width: 4px; + --divider-hit-area: 12px; + --min: 0%; + --max: 100%; + + display: grid; + } + + .start, + .end { + overflow: hidden; + } + + .divider { + flex: 0 0 var(--divider-width); + display: flex; + position: relative; + align-items: center; + justify-content: center; + background-color: var(--sl-color-neutral-200); + color: var(--sl-color-neutral-900); + z-index: 1; + } + + .divider:focus { + outline: none; + } + + :host(:not([disabled])) .divider:focus-visible { + background-color: var(--sl-color-primary-600); + color: var(--sl-color-neutral-0); + } + + :host([disabled]) .divider { + cursor: not-allowed; + } + + /* Horizontal */ + :host(:not([vertical], [disabled])) .divider { + cursor: col-resize; + } + + :host(:not([vertical])) .divider::after { + display: flex; + content: ''; + position: absolute; + height: 100%; + left: calc(var(--divider-hit-area) / -2 + var(--divider-width) / 2); + width: var(--divider-hit-area); + } + + /* Vertical */ + :host([vertical]) { + flex-direction: column; + } + + :host([vertical]:not([disabled])) .divider { + cursor: row-resize; + } + + :host([vertical]) .divider::after { + content: ''; + position: absolute; + width: 100%; + top: calc(var(--divider-hit-area) / -2 + var(--divider-width) / 2); + height: var(--divider-hit-area); + } + + @media (forced-colors: active) { + .divider { + outline: solid 1px transparent; + } + } +`;function drag(container,options){function move(pointerEvent){const dims=container.getBoundingClientRect(),defaultView=container.ownerDocument.defaultView,offsetX=dims.left+defaultView.scrollX,offsetY=dims.top+defaultView.scrollY,x=pointerEvent.pageX-offsetX,y=pointerEvent.pageY-offsetY;(null==options?void 0:options.onMove)&&options.onMove(x,y)}function stop(){document.removeEventListener("pointermove",move),document.removeEventListener("pointerup",stop),(null==options?void 0:options.onStop)&&options.onStop()}document.addEventListener("pointermove",move,{passive:!0}),document.addEventListener("pointerup",stop),(null==options?void 0:options.initialEvent)instanceof PointerEvent&&move(options.initialEvent)}var SNAP_NONE=()=>null,SlSplitPanel=class extends ShoelaceElement{constructor(){super(...arguments),this.isCollapsed=!1,this.localize=new LocalizeController(this),this.positionBeforeCollapsing=0,this.position=50,this.vertical=!1,this.disabled=!1,this.snapValue="",this.snapFunction=SNAP_NONE,this.snapThreshold=12}toSnapFunction(snap){var _Mathabs3=Math.abs,_Mathround3=Math.round;const snapPoints=snap.split(" ");return({pos,size,snapThreshold,isRtl,vertical})=>{var _NumberPOSITIVE_INFINITY=Number.POSITIVE_INFINITY;let newPos=pos,minDistance=_NumberPOSITIVE_INFINITY;return snapPoints.forEach(value=>{var _NumberparseFloat=Number.parseFloat;let snapPoint;if(value.startsWith("repeat(")){const repeatVal=snap.substring(7,snap.length-1),isPercent=repeatVal.endsWith("%"),repeatNum=_NumberparseFloat(repeatVal),snapIntervalPx=isPercent?size*(repeatNum/100):repeatNum;snapPoint=_Mathround3((isRtl&&!vertical?size-pos:pos)/snapIntervalPx)*snapIntervalPx}else snapPoint=value.endsWith("%")?size*(_NumberparseFloat(value)/100):_NumberparseFloat(value);isRtl&&!vertical&&(snapPoint=size-snapPoint);const distance=_Mathabs3(pos-snapPoint);distance<=snapThreshold&&distance<minDistance&&(newPos=snapPoint,minDistance=distance)}),newPos}}set snap(snap){this.snapValue=null==snap?"":snap,this.snapFunction=snap?"string"==typeof snap?this.toSnapFunction(snap):snap:SNAP_NONE}get snap(){return this.snapValue}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(entries=>this.handleResize(entries)),this.updateComplete.then(()=>this.resizeObserver.observe(this)),this.detectSize(),this.cachedPositionInPixels=this.percentageToPixels(this.position)}disconnectedCallback(){var _a;super.disconnectedCallback(),null==(_a=this.resizeObserver)?void 0:_a.unobserve(this)}detectSize(){const{width,height}=this.getBoundingClientRect();this.size=this.vertical?height:width}percentageToPixels(value){return this.size*(value/100)}pixelsToPercentage(value){return 100*(value/this.size)}handleDrag(event){const isRtl="rtl"===this.localize.dir();this.disabled||(event.cancelable&&event.preventDefault(),drag(this,{onMove:(x,y)=>{var _a;let newPositionInPixels=this.vertical?y:x;"end"===this.primary&&(newPositionInPixels=this.size-newPositionInPixels),newPositionInPixels=null==(_a=this.snapFunction({pos:newPositionInPixels,size:this.size,snapThreshold:this.snapThreshold,isRtl,vertical:this.vertical}))?newPositionInPixels:_a,this.position=clamp(this.pixelsToPercentage(newPositionInPixels),0,100)},initialEvent:event}))}handleKeyDown(event){if(!this.disabled&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","Enter"].includes(event.key)){let newPosition=this.position;const incr=(event.shiftKey?10:1)*("end"===this.primary?-1:1);if(event.preventDefault(),("ArrowLeft"===event.key&&!this.vertical||"ArrowUp"===event.key&&this.vertical)&&(newPosition-=incr),("ArrowRight"===event.key&&!this.vertical||"ArrowDown"===event.key&&this.vertical)&&(newPosition+=incr),"Home"===event.key&&(newPosition="end"===this.primary?100:0),"End"===event.key&&(newPosition="end"===this.primary?0:100),"Enter"===event.key)if(this.isCollapsed)newPosition=this.positionBeforeCollapsing,this.isCollapsed=!1;else{const positionBeforeCollapsing=this.position;newPosition=0,requestAnimationFrame(()=>{this.isCollapsed=!0,this.positionBeforeCollapsing=positionBeforeCollapsing})}this.position=clamp(newPosition,0,100)}}handleResize(entries){const{width,height}=entries[0].contentRect;this.size=this.vertical?height:width,(isNaN(this.cachedPositionInPixels)||this.position===1/0)&&(this.cachedPositionInPixels=+this.getAttribute("position-in-pixels"),this.positionInPixels=+this.getAttribute("position-in-pixels"),this.position=this.pixelsToPercentage(this.positionInPixels)),this.primary&&(this.position=this.pixelsToPercentage(this.cachedPositionInPixels))}handlePositionChange(){this.cachedPositionInPixels=this.percentageToPixels(this.position),this.isCollapsed=!1,this.positionBeforeCollapsing=0,this.positionInPixels=this.percentageToPixels(this.position),this.emit("sl-reposition")}handlePositionInPixelsChange(){this.position=this.pixelsToPercentage(this.positionInPixels)}handleVerticalChange(){this.detectSize()}render(){const gridTemplate=this.vertical?"gridTemplateRows":"gridTemplateColumns",gridTemplateAlt=this.vertical?"gridTemplateColumns":"gridTemplateRows",isRtl="rtl"===this.localize.dir(),primary=` + clamp( + 0%, + clamp( + var(--min), + ${this.position}% - var(--divider-width) / 2, + var(--max) + ), + calc(100% - var(--divider-width)) + ) + `,secondary="auto";return this.style[gridTemplate]="end"===this.primary?isRtl&&!this.vertical?`${primary} var(--divider-width) ${secondary}`:`${secondary} var(--divider-width) ${primary}`:isRtl&&!this.vertical?`${secondary} var(--divider-width) ${primary}`:`${primary} var(--divider-width) ${secondary}`,this.style[gridTemplateAlt]="",x$1` + <slot name="start" part="panel start" class="start"></slot> + + <div + part="divider" + class="divider" + tabindex=${o$6(this.disabled?void 0:"0")} + role="separator" + aria-valuenow=${this.position} + aria-valuemin="0" + aria-valuemax="100" + aria-label=${this.localize.term("resize")} + @keydown=${this.handleKeyDown} + @mousedown=${this.handleDrag} + @touchstart=${this.handleDrag} + > + <slot name="divider"></slot> + </div> + + <slot name="end" part="panel end" class="end"></slot> + `}};SlSplitPanel.styles=[component_styles_default,split_panel_styles_default],__decorateClass([e$6(".divider")],SlSplitPanel.prototype,"divider",2),__decorateClass([n$5({type:Number,reflect:!0})],SlSplitPanel.prototype,"position",2),__decorateClass([n$5({attribute:"position-in-pixels",type:Number})],SlSplitPanel.prototype,"positionInPixels",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSplitPanel.prototype,"vertical",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSplitPanel.prototype,"disabled",2),__decorateClass([n$5()],SlSplitPanel.prototype,"primary",2),__decorateClass([n$5({reflect:!0})],SlSplitPanel.prototype,"snap",1),__decorateClass([n$5({type:Number,attribute:"snap-threshold"})],SlSplitPanel.prototype,"snapThreshold",2),__decorateClass([watch("position")],SlSplitPanel.prototype,"handlePositionChange",1),__decorateClass([watch("positionInPixels")],SlSplitPanel.prototype,"handlePositionInPixelsChange",1),__decorateClass([watch("vertical")],SlSplitPanel.prototype,"handleVerticalChange",1),SlSplitPanel.define("sl-split-panel");var switch_styles_default=i$7` + :host { + display: inline-block; + } + + :host([size='small']) { + --height: var(--sl-toggle-size-small); + --thumb-size: calc(var(--sl-toggle-size-small) + 4px); + --width: calc(var(--height) * 2); + + font-size: var(--sl-input-font-size-small); + } + + :host([size='medium']) { + --height: var(--sl-toggle-size-medium); + --thumb-size: calc(var(--sl-toggle-size-medium) + 4px); + --width: calc(var(--height) * 2); + + font-size: var(--sl-input-font-size-medium); + } + + :host([size='large']) { + --height: var(--sl-toggle-size-large); + --thumb-size: calc(var(--sl-toggle-size-large) + 4px); + --width: calc(var(--height) * 2); + + font-size: var(--sl-input-font-size-large); + } + + .switch { + position: relative; + display: inline-flex; + align-items: center; + font-family: var(--sl-input-font-family); + font-size: inherit; + font-weight: var(--sl-input-font-weight); + color: var(--sl-input-label-color); + vertical-align: middle; + cursor: pointer; + } + + .switch__control { + flex: 0 0 auto; + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + width: var(--width); + height: var(--height); + background-color: var(--sl-color-neutral-400); + border: solid var(--sl-input-border-width) var(--sl-color-neutral-400); + border-radius: var(--height); + transition: + var(--sl-transition-fast) border-color, + var(--sl-transition-fast) background-color; + } + + .switch__control .switch__thumb { + width: var(--thumb-size); + height: var(--thumb-size); + background-color: var(--sl-color-neutral-0); + border-radius: 50%; + border: solid var(--sl-input-border-width) var(--sl-color-neutral-400); + translate: calc((var(--width) - var(--height)) / -2); + transition: + var(--sl-transition-fast) translate ease, + var(--sl-transition-fast) background-color, + var(--sl-transition-fast) border-color, + var(--sl-transition-fast) box-shadow; + } + + .switch__input { + position: absolute; + opacity: 0; + padding: 0; + margin: 0; + pointer-events: none; + } + + /* Hover */ + .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover { + background-color: var(--sl-color-neutral-400); + border-color: var(--sl-color-neutral-400); + } + + .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb { + background-color: var(--sl-color-neutral-0); + border-color: var(--sl-color-neutral-400); + } + + /* Focus */ + .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control { + background-color: var(--sl-color-neutral-400); + border-color: var(--sl-color-neutral-400); + } + + .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb { + background-color: var(--sl-color-neutral-0); + border-color: var(--sl-color-primary-600); + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + /* Checked */ + .switch--checked .switch__control { + background-color: var(--sl-color-primary-600); + border-color: var(--sl-color-primary-600); + } + + .switch--checked .switch__control .switch__thumb { + background-color: var(--sl-color-neutral-0); + border-color: var(--sl-color-primary-600); + translate: calc((var(--width) - var(--height)) / 2); + } + + /* Checked + hover */ + .switch.switch--checked:not(.switch--disabled) .switch__control:hover { + background-color: var(--sl-color-primary-600); + border-color: var(--sl-color-primary-600); + } + + .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb { + background-color: var(--sl-color-neutral-0); + border-color: var(--sl-color-primary-600); + } + + /* Checked + focus */ + .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control { + background-color: var(--sl-color-primary-600); + border-color: var(--sl-color-primary-600); + } + + .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb { + background-color: var(--sl-color-neutral-0); + border-color: var(--sl-color-primary-600); + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + /* Disabled */ + .switch--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .switch__label { + display: inline-block; + line-height: var(--height); + margin-inline-start: 0.5em; + user-select: none; + -webkit-user-select: none; + } + + :host([required]) .switch__label::after { + content: var(--sl-input-required-content); + color: var(--sl-input-required-content-color); + margin-inline-start: var(--sl-input-required-content-offset); + } + + @media (forced-colors: active) { + .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb, + .switch--checked .switch__control .switch__thumb { + background-color: ButtonText; + } + } +`,SlSwitch=class extends ShoelaceElement{constructor(){super(...arguments),this.formControlController=new FormControlController(this,{value:control=>control.checked?control.value||"on":void 0,defaultValue:control=>control.defaultChecked,setValue:(control,checked)=>control.checked=checked}),this.hasSlotController=new HasSlotController(this,"help-text"),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.helpText=""}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleInput(){this.emit("sl-input")}handleInvalid(event){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(event)}handleClick(){this.checked=!this.checked,this.emit("sl-change")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleKeyDown(event){"ArrowLeft"===event.key&&(event.preventDefault(),this.checked=!1,this.emit("sl-change"),this.emit("sl-input")),"ArrowRight"===event.key&&(event.preventDefault(),this.checked=!0,this.emit("sl-change"),this.emit("sl-input"))}handleCheckedChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}handleDisabledChange(){this.formControlController.setValidity(!0)}click(){this.input.click()}focus(options){this.input.focus(options)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(message){this.input.setCustomValidity(message),this.formControlController.updateValidity()}render(){const hasHelpTextSlot=this.hasSlotController.test("help-text"),hasHelpText=!!this.helpText||!!hasHelpTextSlot;return x$1` + <div + class=${e$2({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-help-text":hasHelpText})} + > + <label + part="base" + class=${e$2({switch:!0,"switch--checked":this.checked,"switch--disabled":this.disabled,"switch--focused":this.hasFocus,"switch--small":"small"===this.size,"switch--medium":"medium"===this.size,"switch--large":"large"===this.size})} + > + <input + class="switch__input" + type="checkbox" + title=${this.title} + name=${this.name} + value=${o$6(this.value)} + .checked=${l(this.checked)} + .disabled=${this.disabled} + .required=${this.required} + role="switch" + aria-checked=${this.checked?"true":"false"} + aria-describedby="help-text" + @click=${this.handleClick} + @input=${this.handleInput} + @invalid=${this.handleInvalid} + @blur=${this.handleBlur} + @focus=${this.handleFocus} + @keydown=${this.handleKeyDown} + /> + + <span part="control" class="switch__control"> + <span part="thumb" class="switch__thumb"></span> + </span> + + <div part="label" class="switch__label"> + <slot></slot> + </div> + </label> + + <div + aria-hidden=${hasHelpText?"false":"true"} + class="form-control__help-text" + id="help-text" + part="form-control-help-text" + > + <slot name="help-text">${this.helpText}</slot> + </div> + </div> + `}};SlSwitch.styles=[component_styles_default,form_control_styles_default,switch_styles_default],__decorateClass([e$6("input[type=\"checkbox\"]")],SlSwitch.prototype,"input",2),__decorateClass([r$6()],SlSwitch.prototype,"hasFocus",2),__decorateClass([n$5()],SlSwitch.prototype,"title",2),__decorateClass([n$5()],SlSwitch.prototype,"name",2),__decorateClass([n$5()],SlSwitch.prototype,"value",2),__decorateClass([n$5({reflect:!0})],SlSwitch.prototype,"size",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSwitch.prototype,"disabled",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSwitch.prototype,"checked",2),__decorateClass([defaultValue("checked")],SlSwitch.prototype,"defaultChecked",2),__decorateClass([n$5({reflect:!0})],SlSwitch.prototype,"form",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlSwitch.prototype,"required",2),__decorateClass([n$5({attribute:"help-text"})],SlSwitch.prototype,"helpText",2),__decorateClass([watch("checked",{waitUntilFirstUpdate:!0})],SlSwitch.prototype,"handleCheckedChange",1),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlSwitch.prototype,"handleDisabledChange",1),SlSwitch.define("sl-switch"),SlResizeObserver.define("sl-resize-observer"),SlSpinner.define("sl-spinner");var range_styles_default=i$7` + :host { + --thumb-size: 20px; + --tooltip-offset: 10px; + --track-color-active: var(--sl-color-neutral-200); + --track-color-inactive: var(--sl-color-neutral-200); + --track-active-offset: 0%; + --track-height: 6px; + + display: block; + } + + .range { + position: relative; + } + + .range__control { + --percent: 0%; + -webkit-appearance: none; + border-radius: 3px; + width: 100%; + height: var(--track-height); + background: transparent; + line-height: var(--sl-input-height-medium); + vertical-align: middle; + margin: 0; + + background-image: linear-gradient( + to right, + var(--track-color-inactive) 0%, + var(--track-color-inactive) min(var(--percent), var(--track-active-offset)), + var(--track-color-active) min(var(--percent), var(--track-active-offset)), + var(--track-color-active) max(var(--percent), var(--track-active-offset)), + var(--track-color-inactive) max(var(--percent), var(--track-active-offset)), + var(--track-color-inactive) 100% + ); + } + + .range--rtl .range__control { + background-image: linear-gradient( + to left, + var(--track-color-inactive) 0%, + var(--track-color-inactive) min(var(--percent), var(--track-active-offset)), + var(--track-color-active) min(var(--percent), var(--track-active-offset)), + var(--track-color-active) max(var(--percent), var(--track-active-offset)), + var(--track-color-inactive) max(var(--percent), var(--track-active-offset)), + var(--track-color-inactive) 100% + ); + } + + /* Webkit */ + .range__control::-webkit-slider-runnable-track { + width: 100%; + height: var(--track-height); + border-radius: 3px; + border: none; + } + + .range__control::-webkit-slider-thumb { + border: none; + width: var(--thumb-size); + height: var(--thumb-size); + border-radius: 50%; + background-color: var(--sl-color-primary-600); + border: solid var(--sl-input-border-width) var(--sl-color-primary-600); + -webkit-appearance: none; + margin-top: calc(var(--thumb-size) / -2 + var(--track-height) / 2); + cursor: pointer; + } + + .range__control:enabled::-webkit-slider-thumb:hover { + background-color: var(--sl-color-primary-500); + border-color: var(--sl-color-primary-500); + } + + .range__control:enabled:focus-visible::-webkit-slider-thumb { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .range__control:enabled::-webkit-slider-thumb:active { + background-color: var(--sl-color-primary-500); + border-color: var(--sl-color-primary-500); + cursor: grabbing; + } + + /* Firefox */ + .range__control::-moz-focus-outer { + border: 0; + } + + .range__control::-moz-range-progress { + background-color: var(--track-color-active); + border-radius: 3px; + height: var(--track-height); + } + + .range__control::-moz-range-track { + width: 100%; + height: var(--track-height); + background-color: var(--track-color-inactive); + border-radius: 3px; + border: none; + } + + .range__control::-moz-range-thumb { + border: none; + height: var(--thumb-size); + width: var(--thumb-size); + border-radius: 50%; + background-color: var(--sl-color-primary-600); + border-color: var(--sl-color-primary-600); + transition: + var(--sl-transition-fast) border-color, + var(--sl-transition-fast) background-color, + var(--sl-transition-fast) color, + var(--sl-transition-fast) box-shadow; + cursor: pointer; + } + + .range__control:enabled::-moz-range-thumb:hover { + background-color: var(--sl-color-primary-500); + border-color: var(--sl-color-primary-500); + } + + .range__control:enabled:focus-visible::-moz-range-thumb { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .range__control:enabled::-moz-range-thumb:active { + background-color: var(--sl-color-primary-500); + border-color: var(--sl-color-primary-500); + cursor: grabbing; + } + + /* States */ + .range__control:focus-visible { + outline: none; + } + + .range__control:disabled { + opacity: 0.5; + } + + .range__control:disabled::-webkit-slider-thumb { + cursor: not-allowed; + } + + .range__control:disabled::-moz-range-thumb { + cursor: not-allowed; + } + + /* Tooltip output */ + .range__tooltip { + position: absolute; + z-index: var(--sl-z-index-tooltip); + left: 0; + border-radius: var(--sl-tooltip-border-radius); + background-color: var(--sl-tooltip-background-color); + font-family: var(--sl-tooltip-font-family); + font-size: var(--sl-tooltip-font-size); + font-weight: var(--sl-tooltip-font-weight); + line-height: var(--sl-tooltip-line-height); + color: var(--sl-tooltip-color); + opacity: 0; + padding: var(--sl-tooltip-padding); + transition: var(--sl-transition-fast) opacity; + pointer-events: none; + } + + .range__tooltip:after { + content: ''; + position: absolute; + width: 0; + height: 0; + left: 50%; + translate: calc(-1 * var(--sl-tooltip-arrow-size)); + } + + .range--tooltip-visible .range__tooltip { + opacity: 1; + } + + /* Tooltip on top */ + .range--tooltip-top .range__tooltip { + top: calc(-1 * var(--thumb-size) - var(--tooltip-offset)); + } + + .range--tooltip-top .range__tooltip:after { + border-top: var(--sl-tooltip-arrow-size) solid var(--sl-tooltip-background-color); + border-left: var(--sl-tooltip-arrow-size) solid transparent; + border-right: var(--sl-tooltip-arrow-size) solid transparent; + top: 100%; + } + + /* Tooltip on bottom */ + .range--tooltip-bottom .range__tooltip { + bottom: calc(-1 * var(--thumb-size) - var(--tooltip-offset)); + } + + .range--tooltip-bottom .range__tooltip:after { + border-bottom: var(--sl-tooltip-arrow-size) solid var(--sl-tooltip-background-color); + border-left: var(--sl-tooltip-arrow-size) solid transparent; + border-right: var(--sl-tooltip-arrow-size) solid transparent; + bottom: 100%; + } + + @media (forced-colors: active) { + .range__control, + .range__tooltip { + border: solid 1px transparent; + } + + .range__control::-webkit-slider-thumb { + border: solid 1px transparent; + } + + .range__control::-moz-range-thumb { + border: solid 1px transparent; + } + + .range__tooltip:after { + display: none; + } + } +`,SlRange=class extends ShoelaceElement{constructor(){super(...arguments),this.formControlController=new FormControlController(this),this.hasSlotController=new HasSlotController(this,"help-text","label"),this.localize=new LocalizeController(this),this.hasFocus=!1,this.hasTooltip=!1,this.title="",this.name="",this.value=0,this.label="",this.helpText="",this.disabled=!1,this.min=0,this.max=100,this.step=1,this.tooltip="top",this.tooltipFormatter=value=>value.toString(),this.form="",this.defaultValue=0}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>this.syncRange()),this.value<this.min&&(this.value=this.min),this.value>this.max&&(this.value=this.max),this.updateComplete.then(()=>{this.syncRange(),this.resizeObserver.observe(this.input)})}disconnectedCallback(){var _a;super.disconnectedCallback(),null==(_a=this.resizeObserver)?void 0:_a.unobserve(this.input)}handleChange(){this.emit("sl-change")}handleInput(){this.value=parseFloat(this.input.value),this.emit("sl-input"),this.syncRange()}handleBlur(){this.hasFocus=!1,this.hasTooltip=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.hasTooltip=!0,this.emit("sl-focus")}handleThumbDragStart(){this.hasTooltip=!0}handleThumbDragEnd(){this.hasTooltip=!1}syncProgress(percent){this.input.style.setProperty("--percent",`${100*percent}%`)}syncTooltip(percent){if(null!==this.output){const inputWidth=this.input.offsetWidth,tooltipWidth=this.output.offsetWidth,thumbSize=getComputedStyle(this.input).getPropertyValue("--thumb-size"),isRtl="rtl"===this.localize.dir(),percentAsWidth=inputWidth*percent;if(isRtl){const x=`${inputWidth-percentAsWidth}px + ${percent} * ${thumbSize}`;this.output.style.translate=`calc((${x} - ${tooltipWidth/2}px - ${thumbSize} / 2))`}else{const x=`${percentAsWidth}px - ${percent} * ${thumbSize}`;this.output.style.translate=`calc(${x} - ${tooltipWidth/2}px + ${thumbSize} / 2)`}}}handleValueChange(){this.formControlController.updateValidity(),this.input.value=this.value.toString(),this.value=parseFloat(this.input.value),this.syncRange()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}syncRange(){const percent=Math.max(0,(this.value-this.min)/(this.max-this.min));this.syncProgress(percent),"none"!==this.tooltip&&this.hasTooltip&&this.updateComplete.then(()=>this.syncTooltip(percent))}handleInvalid(event){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(event)}focus(options){this.input.focus(options)}blur(){this.input.blur()}stepUp(){this.input.stepUp(),this.value!==+this.input.value&&(this.value=+this.input.value)}stepDown(){this.input.stepDown(),this.value!==+this.input.value&&(this.value=+this.input.value)}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(message){this.input.setCustomValidity(message),this.formControlController.updateValidity()}render(){const hasLabelSlot=this.hasSlotController.test("label"),hasHelpTextSlot=this.hasSlotController.test("help-text"),hasLabel=!!this.label||!!hasLabelSlot,hasHelpText=!!this.helpText||!!hasHelpTextSlot;return x$1` + <div + part="form-control" + class=${e$2({"form-control":!0,"form-control--medium":!0,"form-control--has-label":hasLabel,"form-control--has-help-text":hasHelpText})} + > + <label + part="form-control-label" + class="form-control__label" + for="input" + aria-hidden=${hasLabel?"false":"true"} + > + <slot name="label">${this.label}</slot> + </label> + + <div part="form-control-input" class="form-control-input"> + <div + part="base" + class=${e$2({range:!0,"range--disabled":this.disabled,"range--focused":this.hasFocus,"range--rtl":"rtl"===this.localize.dir(),"range--tooltip-visible":this.hasTooltip,"range--tooltip-top":"top"===this.tooltip,"range--tooltip-bottom":"bottom"===this.tooltip})} + @mousedown=${this.handleThumbDragStart} + @mouseup=${this.handleThumbDragEnd} + @touchstart=${this.handleThumbDragStart} + @touchend=${this.handleThumbDragEnd} + > + <input + part="input" + id="input" + class="range__control" + title=${this.title} + type="range" + name=${o$6(this.name)} + ?disabled=${this.disabled} + min=${o$6(this.min)} + max=${o$6(this.max)} + step=${o$6(this.step)} + .value=${l(this.value.toString())} + aria-describedby="help-text" + @change=${this.handleChange} + @focus=${this.handleFocus} + @input=${this.handleInput} + @invalid=${this.handleInvalid} + @blur=${this.handleBlur} + /> + ${"none"===this.tooltip||this.disabled?"":x$1` + <output part="tooltip" class="range__tooltip"> + ${"function"==typeof this.tooltipFormatter?this.tooltipFormatter(this.value):this.value} + </output> + `} + </div> + </div> + + <div + part="form-control-help-text" + id="help-text" + class="form-control__help-text" + aria-hidden=${hasHelpText?"false":"true"} + > + <slot name="help-text">${this.helpText}</slot> + </div> + </div> + `}};SlRange.styles=[component_styles_default,form_control_styles_default,range_styles_default],__decorateClass([e$6(".range__control")],SlRange.prototype,"input",2),__decorateClass([e$6(".range__tooltip")],SlRange.prototype,"output",2),__decorateClass([r$6()],SlRange.prototype,"hasFocus",2),__decorateClass([r$6()],SlRange.prototype,"hasTooltip",2),__decorateClass([n$5()],SlRange.prototype,"title",2),__decorateClass([n$5()],SlRange.prototype,"name",2),__decorateClass([n$5({type:Number})],SlRange.prototype,"value",2),__decorateClass([n$5()],SlRange.prototype,"label",2),__decorateClass([n$5({attribute:"help-text"})],SlRange.prototype,"helpText",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlRange.prototype,"disabled",2),__decorateClass([n$5({type:Number})],SlRange.prototype,"min",2),__decorateClass([n$5({type:Number})],SlRange.prototype,"max",2),__decorateClass([n$5({type:Number})],SlRange.prototype,"step",2),__decorateClass([n$5()],SlRange.prototype,"tooltip",2),__decorateClass([n$5({attribute:!1})],SlRange.prototype,"tooltipFormatter",2),__decorateClass([n$5({reflect:!0})],SlRange.prototype,"form",2),__decorateClass([defaultValue()],SlRange.prototype,"defaultValue",2),__decorateClass([t$2({passive:!0})],SlRange.prototype,"handleThumbDragStart",1),__decorateClass([watch("value",{waitUntilFirstUpdate:!0})],SlRange.prototype,"handleValueChange",1),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlRange.prototype,"handleDisabledChange",1),__decorateClass([watch("hasTooltip",{waitUntilFirstUpdate:!0})],SlRange.prototype,"syncRange",1),SlRange.define("sl-range");var rating_styles_default=i$7` + :host { + --symbol-color: var(--sl-color-neutral-300); + --symbol-color-active: var(--sl-color-amber-500); + --symbol-size: 1.2rem; + --symbol-spacing: var(--sl-spacing-3x-small); + + display: inline-flex; + } + + .rating { + position: relative; + display: inline-flex; + border-radius: var(--sl-border-radius-medium); + vertical-align: middle; + } + + .rating:focus { + outline: none; + } + + .rating:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .rating__symbols { + display: inline-flex; + position: relative; + font-size: var(--symbol-size); + line-height: 0; + color: var(--symbol-color); + white-space: nowrap; + cursor: pointer; + } + + .rating__symbols > * { + padding: var(--symbol-spacing); + } + + .rating__symbol--active, + .rating__partial--filled { + color: var(--symbol-color-active); + } + + .rating__partial-symbol-container { + position: relative; + } + + .rating__partial--filled { + position: absolute; + top: var(--symbol-spacing); + left: var(--symbol-spacing); + } + + .rating__symbol { + transition: var(--sl-transition-fast) scale; + pointer-events: none; + } + + .rating__symbol--hover { + scale: 1.2; + } + + .rating--disabled .rating__symbols, + .rating--readonly .rating__symbols { + cursor: default; + } + + .rating--disabled .rating__symbol--hover, + .rating--readonly .rating__symbol--hover { + scale: none; + } + + .rating--disabled { + opacity: 0.5; + } + + .rating--disabled .rating__symbols { + cursor: not-allowed; + } + + /* Forced colors mode */ + @media (forced-colors: active) { + .rating__symbol--active { + color: SelectedItem; + } + } +`,SlRating=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.hoverValue=0,this.isHovering=!1,this.label="",this.value=0,this.max=5,this.precision=1,this.readonly=!1,this.disabled=!1,this.getSymbol=()=>"<sl-icon name=\"star-fill\" library=\"system\"></sl-icon>"}getValueFromMousePosition(event){return this.getValueFromXCoordinate(event.clientX)}getValueFromTouchPosition(event){return this.getValueFromXCoordinate(event.touches[0].clientX)}getValueFromXCoordinate(coordinate){const isRtl="rtl"===this.localize.dir(),{left,right,width}=this.rating.getBoundingClientRect(),value=isRtl?this.roundToPrecision((right-coordinate)/width*this.max,this.precision):this.roundToPrecision((coordinate-left)/width*this.max,this.precision);return clamp(value,0,this.max)}handleClick(event){this.disabled||(this.setValue(this.getValueFromMousePosition(event)),this.emit("sl-change"))}setValue(newValue){this.disabled||this.readonly||(this.value=newValue===this.value?0:newValue,this.isHovering=!1)}handleKeyDown(event){var _Mathmin4=Math.min,_Mathmax8=Math.max;const isLtr="ltr"===this.localize.dir(),isRtl="rtl"===this.localize.dir(),oldValue=this.value;if(!(this.disabled||this.readonly)){if("ArrowDown"===event.key||isLtr&&"ArrowLeft"===event.key||isRtl&&"ArrowRight"===event.key){const decrement=event.shiftKey?1:this.precision;this.value=_Mathmax8(0,this.value-decrement),event.preventDefault()}if("ArrowUp"===event.key||isLtr&&"ArrowRight"===event.key||isRtl&&"ArrowLeft"===event.key){const increment=event.shiftKey?1:this.precision;this.value=_Mathmin4(this.max,this.value+increment),event.preventDefault()}"Home"===event.key&&(this.value=0,event.preventDefault()),"End"===event.key&&(this.value=this.max,event.preventDefault()),this.value!==oldValue&&this.emit("sl-change")}}handleMouseEnter(event){this.isHovering=!0,this.hoverValue=this.getValueFromMousePosition(event)}handleMouseMove(event){this.hoverValue=this.getValueFromMousePosition(event)}handleMouseLeave(){this.isHovering=!1}handleTouchStart(event){this.isHovering=!0,this.hoverValue=this.getValueFromTouchPosition(event),event.preventDefault()}handleTouchMove(event){this.hoverValue=this.getValueFromTouchPosition(event)}handleTouchEnd(event){this.isHovering=!1,this.setValue(this.hoverValue),this.emit("sl-change"),event.preventDefault()}roundToPrecision(numberToRound,precision=.5){const multiplier=1/precision;return Math.ceil(numberToRound*multiplier)/multiplier}handleHoverValueChange(){this.emit("sl-hover",{detail:{phase:"move",value:this.hoverValue}})}handleIsHoveringChange(){this.emit("sl-hover",{detail:{phase:this.isHovering?"start":"end",value:this.hoverValue}})}focus(options){this.rating.focus(options)}blur(){this.rating.blur()}render(){var _Mathceil2=Math.ceil;const isRtl="rtl"===this.localize.dir(),counter=Array.from(Array(this.max).keys());let displayValue=0;return displayValue=this.disabled||this.readonly?this.value:this.isHovering?this.hoverValue:this.value,x$1` + <div + part="base" + class=${e$2({rating:!0,"rating--readonly":this.readonly,"rating--disabled":this.disabled,"rating--rtl":isRtl})} + role="slider" + aria-label=${this.label} + aria-disabled=${this.disabled?"true":"false"} + aria-readonly=${this.readonly?"true":"false"} + aria-valuenow=${this.value} + aria-valuemin=${0} + aria-valuemax=${this.max} + tabindex=${this.disabled||this.readonly?"-1":"0"} + @click=${this.handleClick} + @keydown=${this.handleKeyDown} + @mouseenter=${this.handleMouseEnter} + @touchstart=${this.handleTouchStart} + @mouseleave=${this.handleMouseLeave} + @touchend=${this.handleTouchEnd} + @mousemove=${this.handleMouseMove} + @touchmove=${this.handleTouchMove} + > + <span class="rating__symbols"> + ${counter.map(index=>displayValue>index&&displayValue<index+1?x$1` + <span + class=${e$2({rating__symbol:!0,"rating__partial-symbol-container":!0,"rating__symbol--hover":this.isHovering&&_Mathceil2(displayValue)===index+1})} + role="presentation" + > + <div + style=${o$3({clipPath:isRtl?`inset(0 ${100*(displayValue-index)}% 0 0)`:`inset(0 0 0 ${100*(displayValue-index)}%)`})} + > + ${o$2(this.getSymbol(index+1))} + </div> + <div + class="rating__partial--filled" + style=${o$3({clipPath:isRtl?`inset(0 0 0 ${100-100*(displayValue-index)}%)`:`inset(0 ${100-100*(displayValue-index)}% 0 0)`})} + > + ${o$2(this.getSymbol(index+1))} + </div> + </span> + `:x$1` + <span + class=${e$2({rating__symbol:!0,"rating__symbol--hover":this.isHovering&&_Mathceil2(displayValue)===index+1,"rating__symbol--active":displayValue>=index+1})} + role="presentation" + > + ${o$2(this.getSymbol(index+1))} + </span> + `)} + </span> + </div> + `}};SlRating.styles=[component_styles_default,rating_styles_default],SlRating.dependencies={"sl-icon":SlIcon},__decorateClass([e$6(".rating")],SlRating.prototype,"rating",2),__decorateClass([r$6()],SlRating.prototype,"hoverValue",2),__decorateClass([r$6()],SlRating.prototype,"isHovering",2),__decorateClass([n$5()],SlRating.prototype,"label",2),__decorateClass([n$5({type:Number})],SlRating.prototype,"value",2),__decorateClass([n$5({type:Number})],SlRating.prototype,"max",2),__decorateClass([n$5({type:Number})],SlRating.prototype,"precision",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlRating.prototype,"readonly",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlRating.prototype,"disabled",2),__decorateClass([n$5()],SlRating.prototype,"getSymbol",2),__decorateClass([t$2({passive:!0})],SlRating.prototype,"handleTouchMove",1),__decorateClass([watch("hoverValue")],SlRating.prototype,"handleHoverValueChange",1),__decorateClass([watch("isHovering")],SlRating.prototype,"handleIsHoveringChange",1),SlRating.define("sl-rating");var radio_button_styles_default=i$7` + ${button_styles_default} + + .button__prefix, + .button__suffix, + .button__label { + display: inline-flex; + position: relative; + align-items: center; + } + + /* We use a hidden input so constraint validation errors work, since they don't appear to show when used with buttons. + We can't actually hide it, though, otherwise the messages will be suppressed by the browser. */ + .hidden-input { + all: unset; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + outline: dotted 1px red; + opacity: 0; + z-index: -1; + } +`,SlRadioButton=class extends ShoelaceElement{constructor(){super(...arguments),this.hasSlotController=new HasSlotController(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.checked=!1,this.disabled=!1,this.size="medium",this.pill=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleClick(e){return this.disabled?(e.preventDefault(),void e.stopPropagation()):void(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(options){this.input.focus(options)}blur(){this.input.blur()}render(){return u$1` + <div part="base" role="presentation"> + <button + part="${`button${this.checked?" button--checked":""}`}" + role="radio" + aria-checked="${this.checked}" + class=${e$2({button:!0,"button--default":!0,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--checked":this.checked,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--outline":!0,"button--pill":this.pill,"button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")})} + aria-disabled=${this.disabled} + type="button" + value=${o$6(this.value)} + @blur=${this.handleBlur} + @focus=${this.handleFocus} + @click=${this.handleClick} + > + <slot name="prefix" part="prefix" class="button__prefix"></slot> + <slot part="label" class="button__label"></slot> + <slot name="suffix" part="suffix" class="button__suffix"></slot> + </button> + </div> + `}};SlRadioButton.styles=[component_styles_default,radio_button_styles_default],__decorateClass([e$6(".button")],SlRadioButton.prototype,"input",2),__decorateClass([e$6(".hidden-input")],SlRadioButton.prototype,"hiddenInput",2),__decorateClass([r$6()],SlRadioButton.prototype,"hasFocus",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlRadioButton.prototype,"checked",2),__decorateClass([n$5()],SlRadioButton.prototype,"value",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlRadioButton.prototype,"disabled",2),__decorateClass([n$5({reflect:!0})],SlRadioButton.prototype,"size",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlRadioButton.prototype,"pill",2),__decorateClass([watch("disabled",{waitUntilFirstUpdate:!0})],SlRadioButton.prototype,"handleDisabledChange",1),SlRadioButton.define("sl-radio-button");var progress_ring_styles_default=i$7` + :host { + --size: 128px; + --track-width: 4px; + --track-color: var(--sl-color-neutral-200); + --indicator-width: var(--track-width); + --indicator-color: var(--sl-color-primary-600); + --indicator-transition-duration: 0.35s; + + display: inline-flex; + } + + .progress-ring { + display: inline-flex; + align-items: center; + justify-content: center; + position: relative; + } + + .progress-ring__image { + width: var(--size); + height: var(--size); + rotate: -90deg; + transform-origin: 50% 50%; + } + + .progress-ring__track, + .progress-ring__indicator { + --radius: calc(var(--size) / 2 - max(var(--track-width), var(--indicator-width)) * 0.5); + --circumference: calc(var(--radius) * 2 * 3.141592654); + + fill: none; + r: var(--radius); + cx: calc(var(--size) / 2); + cy: calc(var(--size) / 2); + } + + .progress-ring__track { + stroke: var(--track-color); + stroke-width: var(--track-width); + } + + .progress-ring__indicator { + stroke: var(--indicator-color); + stroke-width: var(--indicator-width); + stroke-linecap: round; + transition-property: stroke-dashoffset; + transition-duration: var(--indicator-transition-duration); + stroke-dasharray: var(--circumference) var(--circumference); + stroke-dashoffset: calc(var(--circumference) - var(--percentage) * var(--circumference)); + } + + .progress-ring__label { + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + user-select: none; + -webkit-user-select: none; + } +`,SlProgressRing=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.value=0,this.label=""}updated(changedProps){var _MathPI=Math.PI;if(super.updated(changedProps),changedProps.has("value")){const radius=parseFloat(getComputedStyle(this.indicator).getPropertyValue("r")),circumference=2*_MathPI*radius,offset=circumference-this.value/100*circumference;this.indicatorOffset=`${offset}px`}}render(){return x$1` + <div + part="base" + class="progress-ring" + role="progressbar" + aria-label=${0<this.label.length?this.label:this.localize.term("progress")} + aria-describedby="label" + aria-valuemin="0" + aria-valuemax="100" + aria-valuenow="${this.value}" + style="--percentage: ${this.value/100}" + > + <svg class="progress-ring__image"> + <circle class="progress-ring__track"></circle> + <circle class="progress-ring__indicator" style="stroke-dashoffset: ${this.indicatorOffset}"></circle> + </svg> + + <slot id="label" part="label" class="progress-ring__label"></slot> + </div> + `}};SlProgressRing.styles=[component_styles_default,progress_ring_styles_default],__decorateClass([e$6(".progress-ring__indicator")],SlProgressRing.prototype,"indicator",2),__decorateClass([r$6()],SlProgressRing.prototype,"indicatorOffset",2),__decorateClass([n$5({type:Number,reflect:!0})],SlProgressRing.prototype,"value",2),__decorateClass([n$5()],SlProgressRing.prototype,"label",2),SlProgressRing.define("sl-progress-ring");var qr_code_styles_default=i$7` + :host { + display: inline-block; + } +`;let G=null;class H{}H.render=function(w,B){G(w,B)},self.QrCreator=H,function(w){var _Mathfloor6=Math.floor,_Mathmin5=Math.min,_Mathmax9=Math.max,_Mathround4=Math.round;function B(t,c,a,e){var b={},h=w(a,c);h.u(t),h.J(),e=e||0;var r=h.h(),d=h.h()+2*e;return b.text=t,b.level=c,b.version=a,b.O=d,b.a=function(b,a){return b-=e,a-=e,!(0>b||b>=r||0>a||a>=r)&&h.a(b,a)},b}function C(t,c,a,e,b,h,r,d,g,x){function u(b,a,f,c,d,r,g){b?(t.lineTo(a+r,f+g),t.arcTo(a,f,c,d,h)):t.lineTo(a,f)}r?t.moveTo(c+h,a):t.moveTo(c,a),u(d,e,a,e,b,-h,0),u(g,e,b,c,b,0,-h),u(x,c,b,c,a,h,0),u(r,c,a,e,a,0,h)}function z(t,c,a,e,b,h,r,d,g,x){function u(b,a,c,d){t.moveTo(b+c,a),t.lineTo(b,a),t.lineTo(b,a+d),t.arcTo(b,a,b+c,a,h)}r&&u(c,a,h,h),d&&u(e,a,-h,h),g&&u(e,b,-h,-h),x&&u(c,b,h,-h)}function A(t,c){var a=c.fill;if("string"==typeof a)t.fillStyle=a;else{var e=a.type,b=a.colorStops;if(a=a.position.map(b=>_Mathround4(b*c.size)),"linear-gradient"===e)var h=t.createLinearGradient.apply(t,a);else if("radial-gradient"===e)h=t.createRadialGradient.apply(t,a);else throw Error("Unsupported fill");b.forEach(([b,a])=>{h.addColorStop(b,a)}),t.fillStyle=h}}function y(t,c){a:{var a=c.text,e=c.v,b=c.N,h=c.K,r=c.P;for(b=_Mathmax9(1,b||1),h=_Mathmin5(40,h||40);b<=h;b+=1)try{var d=B(a,e,b,r);break a}catch(J){}d=void 0}if(!d)return null;for(a=t.getContext("2d"),c.background&&(a.fillStyle=c.background,a.fillRect(c.left,c.top,c.size,c.size)),e=d.O,h=c.size/e,a.beginPath(),r=0;r<e;r+=1)for(b=0;b<e;b+=1){var g=a,x=c.left+b*h,u=c.top+r*h,p=r,q=b,f=d.a,k=x+h,m=u+h,D=p-1,E=p+1,n=q-1,l=q+1,y=_Mathfloor6(_Mathmin5(.5,_Mathmax9(0,c.R))*h),v=f(p,q),I=f(D,n),w=f(D,q);D=f(D,l);var F=f(p,l);l=f(E,l),q=f(E,q),E=f(E,n),p=f(p,n),x=_Mathround4(x),u=_Mathround4(u),k=_Mathround4(k),m=_Mathround4(m),v?C(g,x,u,k,m,y,!w&&!p,!w&&!F,!q&&!F,!q&&!p):z(g,x,u,k,m,y,w&&p&&I,w&&F&&D,q&&F&&l,q&&p&&E)}return A(a,c),a.fill(),t}var v={minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:.5,quiet:0};G=function(t,c){var a={};Object.assign(a,v,t),a.N=a.minVersion,a.K=a.maxVersion,a.v=a.ecLevel,a.left=a.left,a.top=a.top,a.size=a.size,a.fill=a.fill,a.background=a.background,a.text=a.text,a.R=a.radius,a.P=a.quiet,c instanceof HTMLCanvasElement?((c.width!==a.size||c.height!==a.size)&&(c.width=a.size,c.height=a.size),c.getContext("2d").clearRect(0,0,c.width,c.height),y(c,a)):(t=document.createElement("canvas"),t.width=a.size,t.height=a.size,a=y(t,a),c.appendChild(a))}}(function(){var _Mathfloor7=Math.floor,_Mathmax0=Math.max;function w(c){var a=C.s(c);return{S:function(){return 4},b:function(){return a.length},write:function(c){for(var b=0;b<a.length;b+=1)c.put(a[b],8)}}}function B(){var c=[],a=0,e={B:function(){return c},c:function(b){return 1==(1&c[_Mathfloor7(b/8)]>>>7-b%8)},put:function(b,h){for(var a=0;a<h;a+=1)e.m(1==(1&b>>>h-a-1))},f:function(){return a},m:function(b){var h=_Mathfloor7(a/8);c.length<=h&&c.push(0),b&&(c[h]|=128>>>a%8),a+=1}};return e}function C(c,a){function e(b,h){for(var a=-1;7>=a;a+=1)if(!(-1>=b+a||d<=b+a))for(var c=-1;7>=c;c+=1)-1>=h+c||d<=h+c||(r[b+a][h+c]=!!(0<=a&&6>=a&&(0==c||6==c)||0<=c&&6>=c&&(0==a||6==a)||2<=a&&4>=a&&2<=c&&4>=c))}function b(b,a){for(var f=d=4*c+17,k=Array(f),m=0;m<f;m+=1){k[m]=Array(f);for(var p=0;p<f;p+=1)k[m][p]=null}for(r=k,e(0,0),e(d-7,0),e(0,d-7),f=y.G(c),k=0;k<f.length;k+=1)for(m=0;m<f.length;m+=1){p=f[k];var q=f[m];if(null==r[p][q])for(var n=-2;2>=n;n+=1)for(var l=-2;2>=l;l+=1)r[p+n][q+l]=-2==n||2==n||-2==l||2==l||0==n&&0==l}for(f=8;f<d-8;f+=1)null==r[f][6]&&(r[f][6]=0==f%2);for(f=8;f<d-8;f+=1)null==r[6][f]&&(r[6][f]=0==f%2);for(f=y.w(h<<3|a),k=0;15>k;k+=1)m=!b&&1==(1&f>>k),r[6>k?k:8>k?k+1:d-15+k][8]=m,r[8][8>k?d-k-1:9>k?15-k:14-k]=m;if(r[d-8][8]=!b,7<=c){for(f=y.A(c),k=0;18>k;k+=1)m=!b&&1==(1&f>>k),r[_Mathfloor7(k/3)][k%3+d-8-3]=m;for(k=0;18>k;k+=1)m=!b&&1==(1&f>>k),r[k%3+d-8-3][_Mathfloor7(k/3)]=m}if(null==g){for(b=t.I(c,h),f=B(),k=0;k<x.length;k+=1)m=x[k],f.put(4,4),f.put(m.b(),y.f(4,c)),m.write(f);for(k=m=0;k<b.length;k+=1)m+=b[k].j;if(f.f()>8*m)throw Error("code length overflow. ("+f.f()+">"+8*m+")");for(f.f()+4<=8*m&&f.put(0,4);0!=f.f()%8;)f.m(!1);for(;!(f.f()>=8*m)&&(f.put(236,8),!(f.f()>=8*m));)f.put(17,8);var u=0;for(m=k=0,p=Array(b.length),q=Array(b.length),n=0;n<b.length;n+=1){var v=b[n].j,w=b[n].o-v;for(k=_Mathmax0(k,v),m=_Mathmax0(m,w),p[n]=Array(v),l=0;l<p[n].length;l+=1)p[n][l]=255&f.B()[l+u];for(u+=v,l=y.C(w),v=z(p[n],l.b()-1).l(l),q[n]=Array(l.b()-1),l=0;l<q[n].length;l+=1)w=l+v.b()-q[n].length,q[n][l]=0<=w?v.c(w):0}for(l=f=0;l<b.length;l+=1)f+=b[l].o;for(f=Array(f),l=u=0;l<k;l+=1)for(n=0;n<b.length;n+=1)l<p[n].length&&(f[u]=p[n][l],u+=1);for(l=0;l<m;l+=1)for(n=0;n<b.length;n+=1)l<q[n].length&&(f[u]=q[n][l],u+=1);g=f}for(b=g,f=-1,k=d-1,m=7,p=0,a=y.F(a),q=d-1;0<q;q-=2)for(6==q&&--q;;){for(n=0;2>n;n+=1)null==r[k][q-n]&&(l=!1,p<b.length&&(l=1==(1&b[p]>>>m)),a(k,q-n)&&(l=!l),r[k][q-n]=l,--m,-1==m&&(p+=1,m=7));if(k+=f,0>k||d<=k){k-=f,f=-f;break}}}var h=A[a],r=null,d=0,g=null,x=[],u={u:function(b){b=w(b),x.push(b),g=null},a:function(b,a){if(0>b||d<=b||0>a||d<=a)throw Error(b+","+a);return r[b][a]},h:function(){return d},J:function(){for(var a=0,h=0,c=0;8>c;c+=1){b(!0,c);var d=y.D(u);(0==c||a>d)&&(a=d,h=c)}b(!1,h)}};return u}function z(c,a){if("undefined"==typeof c.length)throw Error(c.length+"/"+a);var e=function(){for(var b=0;b<c.length&&0==c[b];)b+=1;for(var r=Array(c.length-b+a),d=0;d<c.length-b;d+=1)r[d]=c[d+b];return r}(),b={c:function(b){return e[b]},b:function(){return e.length},multiply:function(a){for(var h=Array(b.b()+a.b()-1),c=0;c<b.b();c+=1)for(var g=0;g<a.b();g+=1)h[c+g]^=v.i(v.g(b.c(c))+v.g(a.c(g)));return z(h,0)},l:function(a){if(0>b.b()-a.b())return b;for(var c=v.g(b.c(0))-v.g(a.c(0)),h=Array(b.b()),g=0;g<b.b();g+=1)h[g]=b.c(g);for(g=0;g<a.b();g+=1)h[g]^=v.i(v.g(a.c(g))+c);return z(h,0).l(a)}};return b}C.s=function(c){for(var a=[],e=0,b;e<c.length;e++)b=c.charCodeAt(e),128>b?a.push(b):2048>b?a.push(192|b>>6,128|63&b):55296>b||57344<=b?a.push(224|b>>12,128|63&b>>6,128|63&b):(e++,b=65536+((1023&b)<<10|1023&c.charCodeAt(e)),a.push(240|b>>18,128|63&b>>12,128|63&b>>6,128|63&b));return a};var A={L:1,M:0,Q:3,H:2},y=function(){function c(b){for(var a=0;0!=b;)a+=1,b>>>=1;return a}var a=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e={w:function(b){for(var a=b<<10;0<=c(a)-c(1335);)a^=1335<<c(a)-c(1335);return 21522^(b<<10|a)},A:function(b){for(var a=b<<12;0<=c(a)-c(7973);)a^=7973<<c(a)-c(7973);return b<<12|a},G:function(b){return a[b-1]},F:function(b){switch(b){case 0:return function(b,a){return 0==(b+a)%2};case 1:return function(b){return 0==b%2};case 2:return function(b,a){return 0==a%3};case 3:return function(b,a){return 0==(b+a)%3};case 4:return function(b,a){return 0==(_Mathfloor7(b/2)+_Mathfloor7(a/3))%2};case 5:return function(b,a){return 0==b*a%2+b*a%3};case 6:return function(b,a){return 0==(b*a%2+b*a%3)%2};case 7:return function(b,a){return 0==(b*a%3+(b+a)%2)%2};default:throw Error("bad maskPattern:"+b)}},C:function(b){for(var a=z([1],0),c=0;c<b;c+=1)a=a.multiply(z([1,v.i(c)],0));return a},f:function(b,a){if(4!=b||1>a||40<a)throw Error("mode: "+b+"; type: "+a);return 10>a?8:16},D:function(b){for(var a=b.h(),c=0,d=0;d<a;d+=1)for(var g=0;g<a;g+=1){for(var e=0,t=b.a(d,g),p=-1;1>=p;p+=1)if(!(0>d+p||a<=d+p))for(var q=-1;1>=q;q+=1)0>g+q||a<=g+q||(0!=p||0!=q)&&t==b.a(d+p,g+q)&&(e+=1);5<e&&(c+=3+e-5)}for(d=0;d<a-1;d+=1)for(g=0;g<a-1;g+=1)(e=0,b.a(d,g)&&(e+=1),b.a(d+1,g)&&(e+=1),b.a(d,g+1)&&(e+=1),b.a(d+1,g+1)&&(e+=1),0==e||4==e)&&(c+=3);for(d=0;d<a;d+=1)for(g=0;g<a-6;g+=1)b.a(d,g)&&!b.a(d,g+1)&&b.a(d,g+2)&&b.a(d,g+3)&&b.a(d,g+4)&&!b.a(d,g+5)&&b.a(d,g+6)&&(c+=40);for(g=0;g<a;g+=1)for(d=0;d<a-6;d+=1)b.a(d,g)&&!b.a(d+1,g)&&b.a(d+2,g)&&b.a(d+3,g)&&b.a(d+4,g)&&!b.a(d+5,g)&&b.a(d+6,g)&&(c+=40);for(g=e=0;g<a;g+=1)for(d=0;d<a;d+=1)b.a(d,g)&&(e+=1);return c+=10*(Math.abs(100*e/a/a-50)/5)}};return e}(),v=function(){for(var c=Array(256),a=Array(256),e=0;8>e;e+=1)c[e]=1<<e;for(e=8;256>e;e+=1)c[e]=c[e-4]^c[e-5]^c[e-6]^c[e-8];for(e=0;255>e;e+=1)a[c[e]]=e;return{g:function(b){if(1>b)throw Error("glog("+b+")");return a[b]},i:function(b){for(;0>b;)b+=255;for(;256<=b;)b-=255;return c[b]}}}(),t=function(){function c(b,c){return c===A.L?a[4*(b-1)]:c===A.M?a[4*(b-1)+1]:c===A.Q?a[4*(b-1)+2]:c===A.H?a[4*(b-1)+3]:void 0}var a=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e={I:function(b,a){var e=c(b,a);if("undefined"==typeof e)throw Error("bad rs block @ typeNumber:"+b+"/errorCorrectLevel:"+a);b=e.length/3,a=[];for(var d=0;d<b;d+=1)for(var g=e[3*d],h=e[3*d+1],t=e[3*d+2],p=0;p<g;p+=1){var q=t,f={};f.o=h,f.j=q,a.push(f)}return a}};return e}();return C}());var QrCreator$1=QrCreator,SlQrCode=class extends ShoelaceElement{constructor(){super(...arguments),this.value="",this.label="",this.size=128,this.fill="black",this.background="white",this.radius=0,this.errorCorrection="H"}firstUpdated(){this.generate()}generate(){this.hasUpdated&&QrCreator$1.render({text:this.value,radius:this.radius,ecLevel:this.errorCorrection,fill:this.fill,background:this.background,size:2*this.size},this.canvas)}render(){var _a;return x$1` + <canvas + part="base" + class="qr-code" + role="img" + aria-label=${0<(null==(_a=this.label)?void 0:_a.length)?this.label:this.value} + style=${o$3({width:`${this.size}px`,height:`${this.size}px`})} + ></canvas> + `}};SlQrCode.styles=[component_styles_default,qr_code_styles_default],__decorateClass([e$6("canvas")],SlQrCode.prototype,"canvas",2),__decorateClass([n$5()],SlQrCode.prototype,"value",2),__decorateClass([n$5()],SlQrCode.prototype,"label",2),__decorateClass([n$5({type:Number})],SlQrCode.prototype,"size",2),__decorateClass([n$5()],SlQrCode.prototype,"fill",2),__decorateClass([n$5()],SlQrCode.prototype,"background",2),__decorateClass([n$5({type:Number})],SlQrCode.prototype,"radius",2),__decorateClass([n$5({attribute:"error-correction"})],SlQrCode.prototype,"errorCorrection",2),__decorateClass([watch(["background","errorCorrection","fill","radius","size","value"])],SlQrCode.prototype,"generate",1),SlQrCode.define("sl-qr-code");var menu_label_styles_default=i$7` + :host { + display: block; + } + + .menu-label { + display: inline-block; + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-small); + font-weight: var(--sl-font-weight-semibold); + line-height: var(--sl-line-height-normal); + letter-spacing: var(--sl-letter-spacing-normal); + color: var(--sl-color-neutral-500); + padding: var(--sl-spacing-2x-small) var(--sl-spacing-x-large); + user-select: none; + -webkit-user-select: none; + } +`,SlMenuLabel=class extends ShoelaceElement{render(){return x$1` <slot part="base" class="menu-label"></slot> `}};SlMenuLabel.styles=[component_styles_default,menu_label_styles_default],SlMenuLabel.define("sl-menu-label");var mutation_observer_styles_default=i$7` + :host { + display: contents; + } +`,SlMutationObserver=class extends ShoelaceElement{constructor(){super(...arguments),this.attrOldValue=!1,this.charData=!1,this.charDataOldValue=!1,this.childList=!1,this.disabled=!1,this.handleMutation=mutationList=>{this.emit("sl-mutation",{detail:{mutationList}})}}connectedCallback(){super.connectedCallback(),this.mutationObserver=new MutationObserver(this.handleMutation),this.disabled||this.startObserver()}disconnectedCallback(){super.disconnectedCallback(),this.stopObserver()}startObserver(){const observeAttributes="string"==typeof this.attr&&0<this.attr.length,attributeFilter=observeAttributes&&"*"!==this.attr?this.attr.split(" "):void 0;try{this.mutationObserver.observe(this,{subtree:!0,childList:this.childList,attributes:observeAttributes,attributeFilter,attributeOldValue:this.attrOldValue,characterData:this.charData,characterDataOldValue:this.charDataOldValue})}catch(e){}}stopObserver(){this.mutationObserver.disconnect()}handleDisabledChange(){this.disabled?this.stopObserver():this.startObserver()}handleChange(){this.stopObserver(),this.startObserver()}render(){return x$1` <slot></slot> `}};SlMutationObserver.styles=[component_styles_default,mutation_observer_styles_default],__decorateClass([n$5({reflect:!0})],SlMutationObserver.prototype,"attr",2),__decorateClass([n$5({attribute:"attr-old-value",type:Boolean,reflect:!0})],SlMutationObserver.prototype,"attrOldValue",2),__decorateClass([n$5({attribute:"char-data",type:Boolean,reflect:!0})],SlMutationObserver.prototype,"charData",2),__decorateClass([n$5({attribute:"char-data-old-value",type:Boolean,reflect:!0})],SlMutationObserver.prototype,"charDataOldValue",2),__decorateClass([n$5({attribute:"child-list",type:Boolean,reflect:!0})],SlMutationObserver.prototype,"childList",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlMutationObserver.prototype,"disabled",2),__decorateClass([watch("disabled")],SlMutationObserver.prototype,"handleDisabledChange",1),__decorateClass([watch("attr",{waitUntilFirstUpdate:!0}),watch("attr-old-value",{waitUntilFirstUpdate:!0}),watch("char-data",{waitUntilFirstUpdate:!0}),watch("char-data-old-value",{waitUntilFirstUpdate:!0}),watch("childList",{waitUntilFirstUpdate:!0})],SlMutationObserver.prototype,"handleChange",1),SlMutationObserver.define("sl-mutation-observer");var image_comparer_styles_default=i$7` + :host { + --divider-width: 2px; + --handle-size: 2.5rem; + + display: inline-block; + position: relative; + } + + .image-comparer { + max-width: 100%; + max-height: 100%; + overflow: hidden; + } + + .image-comparer__before, + .image-comparer__after { + display: block; + pointer-events: none; + } + + .image-comparer__before::slotted(img), + .image-comparer__after::slotted(img), + .image-comparer__before::slotted(svg), + .image-comparer__after::slotted(svg) { + display: block; + max-width: 100% !important; + height: auto; + } + + .image-comparer__after { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + } + + .image-comparer__divider { + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + width: var(--divider-width); + height: 100%; + background-color: var(--sl-color-neutral-0); + translate: calc(var(--divider-width) / -2); + cursor: ew-resize; + } + + .image-comparer__handle { + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: calc(50% - (var(--handle-size) / 2)); + width: var(--handle-size); + height: var(--handle-size); + background-color: var(--sl-color-neutral-0); + border-radius: var(--sl-border-radius-circle); + font-size: calc(var(--handle-size) * 0.5); + color: var(--sl-color-neutral-700); + cursor: inherit; + z-index: 10; + } + + .image-comparer__handle:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } +`,SlImageComparer=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.position=50}handleDrag(event){const{width}=this.base.getBoundingClientRect(),isRtl="rtl"===this.localize.dir();event.preventDefault(),drag(this.base,{onMove:x=>{this.position=parseFloat(clamp(100*(x/width),0,100).toFixed(2)),isRtl&&(this.position=100-this.position)},initialEvent:event})}handleKeyDown(event){const isLtr="ltr"===this.localize.dir(),isRtl="rtl"===this.localize.dir();if(["ArrowLeft","ArrowRight","Home","End"].includes(event.key)){const incr=event.shiftKey?10:1;let newPosition=this.position;event.preventDefault(),(isLtr&&"ArrowLeft"===event.key||isRtl&&"ArrowRight"===event.key)&&(newPosition-=incr),(isLtr&&"ArrowRight"===event.key||isRtl&&"ArrowLeft"===event.key)&&(newPosition+=incr),"Home"===event.key&&(newPosition=0),"End"===event.key&&(newPosition=100),newPosition=clamp(newPosition,0,100),this.position=newPosition}}handlePositionChange(){this.emit("sl-change")}render(){const isRtl="rtl"===this.localize.dir();return x$1` + <div + part="base" + id="image-comparer" + class=${e$2({"image-comparer":!0,"image-comparer--rtl":isRtl})} + @keydown=${this.handleKeyDown} + > + <div class="image-comparer__image"> + <div part="before" class="image-comparer__before"> + <slot name="before"></slot> + </div> + + <div + part="after" + class="image-comparer__after" + style=${o$3({clipPath:isRtl?`inset(0 0 0 ${100-this.position}%)`:`inset(0 ${100-this.position}% 0 0)`})} + > + <slot name="after"></slot> + </div> + </div> + + <div + part="divider" + class="image-comparer__divider" + style=${o$3({left:isRtl?`${100-this.position}%`:`${this.position}%`})} + @mousedown=${this.handleDrag} + @touchstart=${this.handleDrag} + > + <div + part="handle" + class="image-comparer__handle" + role="scrollbar" + aria-valuenow=${this.position} + aria-valuemin="0" + aria-valuemax="100" + aria-controls="image-comparer" + tabindex="0" + > + <slot name="handle"> + <sl-icon library="system" name="grip-vertical"></sl-icon> + </slot> + </div> + </div> + </div> + `}};SlImageComparer.styles=[component_styles_default,image_comparer_styles_default],SlImageComparer.scopedElement={"sl-icon":SlIcon},__decorateClass([e$6(".image-comparer")],SlImageComparer.prototype,"base",2),__decorateClass([e$6(".image-comparer__handle")],SlImageComparer.prototype,"handle",2),__decorateClass([n$5({type:Number,reflect:!0})],SlImageComparer.prototype,"position",2),__decorateClass([watch("position",{waitUntilFirstUpdate:!0})],SlImageComparer.prototype,"handlePositionChange",1),SlImageComparer.define("sl-image-comparer");var include_styles_default=i$7` + :host { + display: block; + } +`,includeFiles=new Map;function requestInclude(src,mode="cors"){const prev=includeFiles.get(src);if(void 0!==prev)return Promise.resolve(prev);const fileDataPromise=fetch(src,{mode}).then(async response=>{const res={ok:response.ok,status:response.status,html:await response.text()};return includeFiles.set(src,res),res});return includeFiles.set(src,fileDataPromise),fileDataPromise}var SlInclude=class extends ShoelaceElement{constructor(){super(...arguments),this.mode="cors",this.allowScripts=!1}executeScript(script){const newScript=document.createElement("script");[...script.attributes].forEach(attr=>newScript.setAttribute(attr.name,attr.value)),newScript.textContent=script.textContent,script.parentNode.replaceChild(newScript,script)}async handleSrcChange(){try{const src=this.src,file=await requestInclude(src,this.mode);if(src!==this.src)return;if(!file.ok)return void this.emit("sl-error",{detail:{status:file.status}});this.innerHTML=file.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach(script=>this.executeScript(script)),this.emit("sl-load")}catch(e){this.emit("sl-error",{detail:{status:-1}})}}render(){return x$1`<slot></slot>`}};SlInclude.styles=[component_styles_default,include_styles_default],__decorateClass([n$5()],SlInclude.prototype,"src",2),__decorateClass([n$5()],SlInclude.prototype,"mode",2),__decorateClass([n$5({attribute:"allow-scripts",type:Boolean})],SlInclude.prototype,"allowScripts",2),__decorateClass([watch("src")],SlInclude.prototype,"handleSrcChange",1),SlInclude.define("sl-include");var SlFormatBytes=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.value=0,this.unit="byte",this.display="short"}render(){if(isNaN(this.value))return"";const bitPrefixes=["","kilo","mega","giga","tera"],bytePrefixes=["","kilo","mega","giga","tera","peta"],prefix="bit"===this.unit?bitPrefixes:bytePrefixes,index=Math.max(0,Math.min(Math.floor(Math.log10(this.value)/3),prefix.length-1)),unit=prefix[index]+this.unit,valueToFormat=parseFloat((this.value/Math.pow(1e3,index)).toPrecision(3));return this.localize.number(valueToFormat,{style:"unit",unit,unitDisplay:this.display})}};__decorateClass([n$5({type:Number})],SlFormatBytes.prototype,"value",2),__decorateClass([n$5()],SlFormatBytes.prototype,"unit",2),__decorateClass([n$5()],SlFormatBytes.prototype,"display",2),SlFormatBytes.define("sl-format-bytes");var SlFormatDate=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.date=new Date,this.hourFormat="auto"}render(){const date=new Date(this.date),hour12="auto"===this.hourFormat?void 0:"12"===this.hourFormat;return isNaN(date.getMilliseconds())?void 0:x$1` + <time datetime=${date.toISOString()}> + ${this.localize.date(date,{weekday:this.weekday,era:this.era,year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second,timeZoneName:this.timeZoneName,timeZone:this.timeZone,hour12})} + </time> + `}};__decorateClass([n$5()],SlFormatDate.prototype,"date",2),__decorateClass([n$5()],SlFormatDate.prototype,"weekday",2),__decorateClass([n$5()],SlFormatDate.prototype,"era",2),__decorateClass([n$5()],SlFormatDate.prototype,"year",2),__decorateClass([n$5()],SlFormatDate.prototype,"month",2),__decorateClass([n$5()],SlFormatDate.prototype,"day",2),__decorateClass([n$5()],SlFormatDate.prototype,"hour",2),__decorateClass([n$5()],SlFormatDate.prototype,"minute",2),__decorateClass([n$5()],SlFormatDate.prototype,"second",2),__decorateClass([n$5({attribute:"time-zone-name"})],SlFormatDate.prototype,"timeZoneName",2),__decorateClass([n$5({attribute:"time-zone"})],SlFormatDate.prototype,"timeZone",2),__decorateClass([n$5({attribute:"hour-format"})],SlFormatDate.prototype,"hourFormat",2),SlFormatDate.define("sl-format-date");var SlFormatNumber=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.value=0,this.type="decimal",this.noGrouping=!1,this.currency="USD",this.currencyDisplay="symbol"}render(){return isNaN(this.value)?"":this.localize.number(this.value,{style:this.type,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:!this.noGrouping,minimumIntegerDigits:this.minimumIntegerDigits,minimumFractionDigits:this.minimumFractionDigits,maximumFractionDigits:this.maximumFractionDigits,minimumSignificantDigits:this.minimumSignificantDigits,maximumSignificantDigits:this.maximumSignificantDigits})}};__decorateClass([n$5({type:Number})],SlFormatNumber.prototype,"value",2),__decorateClass([n$5()],SlFormatNumber.prototype,"type",2),__decorateClass([n$5({attribute:"no-grouping",type:Boolean})],SlFormatNumber.prototype,"noGrouping",2),__decorateClass([n$5()],SlFormatNumber.prototype,"currency",2),__decorateClass([n$5({attribute:"currency-display"})],SlFormatNumber.prototype,"currencyDisplay",2),__decorateClass([n$5({attribute:"minimum-integer-digits",type:Number})],SlFormatNumber.prototype,"minimumIntegerDigits",2),__decorateClass([n$5({attribute:"minimum-fraction-digits",type:Number})],SlFormatNumber.prototype,"minimumFractionDigits",2),__decorateClass([n$5({attribute:"maximum-fraction-digits",type:Number})],SlFormatNumber.prototype,"maximumFractionDigits",2),__decorateClass([n$5({attribute:"minimum-significant-digits",type:Number})],SlFormatNumber.prototype,"minimumSignificantDigits",2),__decorateClass([n$5({attribute:"maximum-significant-digits",type:Number})],SlFormatNumber.prototype,"maximumSignificantDigits",2),SlFormatNumber.define("sl-format-number");var divider_styles_default=i$7` + :host { + --color: var(--sl-panel-border-color); + --width: var(--sl-panel-border-width); + --spacing: var(--sl-spacing-medium); + } + + :host(:not([vertical])) { + display: block; + border-top: solid var(--width) var(--color); + margin: var(--spacing) 0; + } + + :host([vertical]) { + display: inline-block; + height: 100%; + border-left: solid var(--width) var(--color); + margin: 0 var(--spacing); + } +`,SlDivider=class extends ShoelaceElement{constructor(){super(...arguments),this.vertical=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}handleVerticalChange(){this.setAttribute("aria-orientation",this.vertical?"vertical":"horizontal")}};SlDivider.styles=[component_styles_default,divider_styles_default],__decorateClass([n$5({type:Boolean,reflect:!0})],SlDivider.prototype,"vertical",2),__decorateClass([watch("vertical")],SlDivider.prototype,"handleVerticalChange",1),SlDivider.define("sl-divider");var copy_button_styles_default=i$7` + :host { + --error-color: var(--sl-color-danger-600); + --success-color: var(--sl-color-success-600); + + display: inline-block; + } + + .copy-button__button { + flex: 0 0 auto; + display: flex; + align-items: center; + background: none; + border: none; + border-radius: var(--sl-border-radius-medium); + font-size: inherit; + color: inherit; + padding: var(--sl-spacing-x-small); + cursor: pointer; + transition: var(--sl-transition-x-fast) color; + } + + .copy-button--success .copy-button__button { + color: var(--success-color); + } + + .copy-button--error .copy-button__button { + color: var(--error-color); + } + + .copy-button__button:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .copy-button__button[disabled] { + opacity: 0.5; + cursor: not-allowed !important; + } + + slot { + display: inline-flex; + } +`,SlCopyButton=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.isCopying=!1,this.status="rest",this.value="",this.from="",this.disabled=!1,this.copyLabel="",this.successLabel="",this.errorLabel="",this.feedbackDuration=1e3,this.tooltipPlacement="top",this.hoist=!1}async handleCopy(){if(this.disabled||this.isCopying)return;this.isCopying=!0;let valueToCopy=this.value;if(this.from){const root=this.getRootNode(),isProperty=this.from.includes("."),isAttribute=this.from.includes("[")&&this.from.includes("]");let id=this.from,field="";isProperty?[id,field]=this.from.trim().split("."):isAttribute&&([id,field]=this.from.trim().replace(/\]$/,"").split("["));const target="getElementById"in root?root.getElementById(id):null;target?isAttribute?valueToCopy=target.getAttribute(field)||"":isProperty?valueToCopy=target[field]||"":valueToCopy=target.textContent||"":(this.showStatus("error"),this.emit("sl-error"))}if(!valueToCopy)this.showStatus("error"),this.emit("sl-error");else try{await navigator.clipboard.writeText(valueToCopy),this.showStatus("success"),this.emit("sl-copy",{detail:{value:valueToCopy}})}catch(error){this.showStatus("error"),this.emit("sl-error")}}async showStatus(status){const copyLabel=this.copyLabel||this.localize.term("copy"),successLabel=this.successLabel||this.localize.term("copied"),errorLabel=this.errorLabel||this.localize.term("error"),iconToShow="success"===status?this.successIcon:this.errorIcon,showAnimation=getAnimation(this,"copy.in",{dir:"ltr"}),hideAnimation=getAnimation(this,"copy.out",{dir:"ltr"});this.tooltip.content="success"===status?successLabel:errorLabel,await this.copyIcon.animate(hideAnimation.keyframes,hideAnimation.options).finished,this.copyIcon.hidden=!0,this.status=status,iconToShow.hidden=!1,await iconToShow.animate(showAnimation.keyframes,showAnimation.options).finished,setTimeout(async()=>{await iconToShow.animate(hideAnimation.keyframes,hideAnimation.options).finished,iconToShow.hidden=!0,this.status="rest",this.copyIcon.hidden=!1,await this.copyIcon.animate(showAnimation.keyframes,showAnimation.options).finished,this.tooltip.content=copyLabel,this.isCopying=!1},this.feedbackDuration)}render(){const copyLabel=this.copyLabel||this.localize.term("copy");return x$1` + <sl-tooltip + class=${e$2({"copy-button":!0,"copy-button--success":"success"===this.status,"copy-button--error":"error"===this.status})} + content=${copyLabel} + placement=${this.tooltipPlacement} + ?disabled=${this.disabled} + ?hoist=${this.hoist} + exportparts=" + base:tooltip__base, + base__popup:tooltip__base__popup, + base__arrow:tooltip__base__arrow, + body:tooltip__body + " + > + <button + class="copy-button__button" + part="button" + type="button" + ?disabled=${this.disabled} + @click=${this.handleCopy} + > + <slot part="copy-icon" name="copy-icon"> + <sl-icon library="system" name="copy"></sl-icon> + </slot> + <slot part="success-icon" name="success-icon" hidden> + <sl-icon library="system" name="check"></sl-icon> + </slot> + <slot part="error-icon" name="error-icon" hidden> + <sl-icon library="system" name="x-lg"></sl-icon> + </slot> + </button> + </sl-tooltip> + `}};SlCopyButton.styles=[component_styles_default,copy_button_styles_default],SlCopyButton.dependencies={"sl-icon":SlIcon,"sl-tooltip":SlTooltip},__decorateClass([e$6("slot[name=\"copy-icon\"]")],SlCopyButton.prototype,"copyIcon",2),__decorateClass([e$6("slot[name=\"success-icon\"]")],SlCopyButton.prototype,"successIcon",2),__decorateClass([e$6("slot[name=\"error-icon\"]")],SlCopyButton.prototype,"errorIcon",2),__decorateClass([e$6("sl-tooltip")],SlCopyButton.prototype,"tooltip",2),__decorateClass([r$6()],SlCopyButton.prototype,"isCopying",2),__decorateClass([r$6()],SlCopyButton.prototype,"status",2),__decorateClass([n$5()],SlCopyButton.prototype,"value",2),__decorateClass([n$5()],SlCopyButton.prototype,"from",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlCopyButton.prototype,"disabled",2),__decorateClass([n$5({attribute:"copy-label"})],SlCopyButton.prototype,"copyLabel",2),__decorateClass([n$5({attribute:"success-label"})],SlCopyButton.prototype,"successLabel",2),__decorateClass([n$5({attribute:"error-label"})],SlCopyButton.prototype,"errorLabel",2),__decorateClass([n$5({attribute:"feedback-duration",type:Number})],SlCopyButton.prototype,"feedbackDuration",2),__decorateClass([n$5({attribute:"tooltip-placement"})],SlCopyButton.prototype,"tooltipPlacement",2),__decorateClass([n$5({type:Boolean})],SlCopyButton.prototype,"hoist",2),setDefaultAnimation("copy.in",{keyframes:[{scale:".25",opacity:".25"},{scale:"1",opacity:"1"}],options:{duration:100}}),setDefaultAnimation("copy.out",{keyframes:[{scale:"1",opacity:"1"},{scale:".25",opacity:"0"}],options:{duration:100}}),SlCopyButton.define("sl-copy-button");var color_picker_styles_default=i$7` + :host { + --grid-width: 280px; + --grid-height: 200px; + --grid-handle-size: 16px; + --slider-height: 15px; + --slider-handle-size: 17px; + --swatch-size: 25px; + + display: inline-block; + } + + .color-picker { + width: var(--grid-width); + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-medium); + font-weight: var(--sl-font-weight-normal); + color: var(--color); + background-color: var(--sl-panel-background-color); + border-radius: var(--sl-border-radius-medium); + user-select: none; + -webkit-user-select: none; + } + + .color-picker--inline { + border: solid var(--sl-panel-border-width) var(--sl-panel-border-color); + } + + .color-picker--inline:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .color-picker__grid { + position: relative; + height: var(--grid-height); + background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%), + linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%); + border-top-left-radius: var(--sl-border-radius-medium); + border-top-right-radius: var(--sl-border-radius-medium); + cursor: crosshair; + forced-color-adjust: none; + } + + .color-picker__grid-handle { + position: absolute; + width: var(--grid-handle-size); + height: var(--grid-handle-size); + border-radius: 50%; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); + border: solid 2px white; + margin-top: calc(var(--grid-handle-size) / -2); + margin-left: calc(var(--grid-handle-size) / -2); + transition: var(--sl-transition-fast) scale; + } + + .color-picker__grid-handle--dragging { + cursor: none; + scale: 1.5; + } + + .color-picker__grid-handle:focus-visible { + outline: var(--sl-focus-ring); + } + + .color-picker__controls { + padding: var(--sl-spacing-small); + display: flex; + align-items: center; + } + + .color-picker__sliders { + flex: 1 1 auto; + } + + .color-picker__slider { + position: relative; + height: var(--slider-height); + border-radius: var(--sl-border-radius-pill); + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); + forced-color-adjust: none; + } + + .color-picker__slider:not(:last-of-type) { + margin-bottom: var(--sl-spacing-small); + } + + .color-picker__slider-handle { + position: absolute; + top: calc(50% - var(--slider-handle-size) / 2); + width: var(--slider-handle-size); + height: var(--slider-handle-size); + background-color: white; + border-radius: 50%; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); + margin-left: calc(var(--slider-handle-size) / -2); + } + + .color-picker__slider-handle:focus-visible { + outline: var(--sl-focus-ring); + } + + .color-picker__hue { + background-image: linear-gradient( + to right, + rgb(255, 0, 0) 0%, + rgb(255, 255, 0) 17%, + rgb(0, 255, 0) 33%, + rgb(0, 255, 255) 50%, + rgb(0, 0, 255) 67%, + rgb(255, 0, 255) 83%, + rgb(255, 0, 0) 100% + ); + } + + .color-picker__alpha .color-picker__alpha-gradient { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: inherit; + } + + .color-picker__preview { + flex: 0 0 auto; + display: inline-flex; + align-items: center; + justify-content: center; + position: relative; + width: 2.25rem; + height: 2.25rem; + border: none; + border-radius: var(--sl-border-radius-circle); + background: none; + margin-left: var(--sl-spacing-small); + cursor: copy; + forced-color-adjust: none; + } + + .color-picker__preview:before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: inherit; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); + + /* We use a custom property in lieu of currentColor because of https://bugs.webkit.org/show_bug.cgi?id=216780 */ + background-color: var(--preview-color); + } + + .color-picker__preview:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .color-picker__preview-color { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: solid 1px rgba(0, 0, 0, 0.125); + } + + .color-picker__preview-color--copied { + animation: pulse 0.75s; + } + + @keyframes pulse { + 0% { + box-shadow: 0 0 0 0 var(--sl-color-primary-500); + } + 70% { + box-shadow: 0 0 0 0.5rem transparent; + } + 100% { + box-shadow: 0 0 0 0 transparent; + } + } + + .color-picker__user-input { + display: flex; + padding: 0 var(--sl-spacing-small) var(--sl-spacing-small) var(--sl-spacing-small); + } + + .color-picker__user-input sl-input { + min-width: 0; /* fix input width in Safari */ + flex: 1 1 auto; + } + + .color-picker__user-input sl-button-group { + margin-left: var(--sl-spacing-small); + } + + .color-picker__user-input sl-button { + min-width: 3.25rem; + max-width: 3.25rem; + font-size: 1rem; + } + + .color-picker__swatches { + display: grid; + grid-template-columns: repeat(8, 1fr); + grid-gap: 0.5rem; + justify-items: center; + border-top: solid 1px var(--sl-color-neutral-200); + padding: var(--sl-spacing-small); + forced-color-adjust: none; + } + + .color-picker__swatch { + position: relative; + width: var(--swatch-size); + height: var(--swatch-size); + border-radius: var(--sl-border-radius-small); + } + + .color-picker__swatch .color-picker__swatch-color { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: solid 1px rgba(0, 0, 0, 0.125); + border-radius: inherit; + cursor: pointer; + } + + .color-picker__swatch:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .color-picker__transparent-bg { + background-image: linear-gradient(45deg, var(--sl-color-neutral-300) 25%, transparent 25%), + linear-gradient(45deg, transparent 75%, var(--sl-color-neutral-300) 75%), + linear-gradient(45deg, transparent 75%, var(--sl-color-neutral-300) 75%), + linear-gradient(45deg, var(--sl-color-neutral-300) 25%, transparent 25%); + background-size: 10px 10px; + background-position: + 0 0, + 0 0, + -5px -5px, + 5px 5px; + } + + .color-picker--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .color-picker--disabled .color-picker__grid, + .color-picker--disabled .color-picker__grid-handle, + .color-picker--disabled .color-picker__slider, + .color-picker--disabled .color-picker__slider-handle, + .color-picker--disabled .color-picker__preview, + .color-picker--disabled .color-picker__swatch, + .color-picker--disabled .color-picker__swatch-color { + pointer-events: none; + } + + /* + * Color dropdown + */ + + .color-dropdown::part(panel) { + max-height: none; + background-color: var(--sl-panel-background-color); + border: solid var(--sl-panel-border-width) var(--sl-panel-border-color); + border-radius: var(--sl-border-radius-medium); + overflow: visible; + } + + .color-dropdown__trigger { + display: inline-block; + position: relative; + background-color: transparent; + border: none; + cursor: pointer; + forced-color-adjust: none; + } + + .color-dropdown__trigger.color-dropdown__trigger--small { + width: var(--sl-input-height-small); + height: var(--sl-input-height-small); + border-radius: var(--sl-border-radius-circle); + } + + .color-dropdown__trigger.color-dropdown__trigger--medium { + width: var(--sl-input-height-medium); + height: var(--sl-input-height-medium); + border-radius: var(--sl-border-radius-circle); + } + + .color-dropdown__trigger.color-dropdown__trigger--large { + width: var(--sl-input-height-large); + height: var(--sl-input-height-large); + border-radius: var(--sl-border-radius-circle); + } + + .color-dropdown__trigger:before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: inherit; + background-color: currentColor; + box-shadow: + inset 0 0 0 2px var(--sl-input-border-color), + inset 0 0 0 4px var(--sl-color-neutral-0); + } + + .color-dropdown__trigger--empty:before { + background-color: transparent; + } + + .color-dropdown__trigger:focus-visible { + outline: none; + } + + .color-dropdown__trigger:focus-visible:not(.color-dropdown__trigger--disabled) { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .color-dropdown__trigger.color-dropdown__trigger--disabled { + opacity: 0.5; + cursor: not-allowed; + } +`;function bound01(n,max){var _Mathmin6=Math.min,_Mathmax1=Math.max,_Mathabs4=Math.abs;isOnePointZero(n)&&(n="100%");const isPercent=isPercentage(n);return(n=360===max?n:_Mathmin6(max,_Mathmax1(0,parseFloat(n))),isPercent&&(n=parseInt(n*max+"",10)/100),1e-6>_Mathabs4(n-max))?1:(n=360===max?(0>n?n%max+max:n%max)/parseFloat(max+""):n%max/parseFloat(max+""),n)}function clamp01(val){return Math.min(1,Math.max(0,val))}function isOnePointZero(n){return"string"==typeof n&&-1!==n.indexOf(".")&&1===parseFloat(n)}function isPercentage(n){return"string"==typeof n&&-1!==n.indexOf("%")}function boundAlpha(a){return a=parseFloat(a),(isNaN(a)||0>a||1<a)&&(a=1),a}function convertToPercentage(n){return 1>=+n?`${100*+n}%`:n}function pad2(c){return 1===c.length?"0"+c:c+""}function rgbToRgb(r,g,b){return{r:255*bound01(r,255),g:255*bound01(g,255),b:255*bound01(b,255)}}function rgbToHsl(r,g,b){r=bound01(r,255),g=bound01(g,255),b=bound01(b,255);const max=Math.max(r,g,b),min=Math.min(r,g,b);let h=0,s=0;const l=(max+min)/2;if(max===min)s=0,h=0;else{const d=max-min;s=.5<l?d/(2-max-min):d/(max+min);max===r?h=(g-b)/d+(g<b?6:0):max===g?h=(b-r)/d+2:max===b?h=(r-g)/d+4:void 0;h/=6}return{h,s,l}}function hue2rgb(p,q,t){return 0>t&&(t+=1),1<t&&(t-=1),t<1/6?p+(q-p)*(6*t):t<1/2?q:t<2/3?p+6*((q-p)*(2/3-t)):p}function hslToRgb(h,s,l){let r,g,b;if(h=bound01(h,360),s=bound01(s,100),l=bound01(l,100),0===s)g=l,b=l,r=l;else{const q=.5>l?l*(1+s):l+s-l*s,p=2*l-q;r=hue2rgb(p,q,h+1/3),g=hue2rgb(p,q,h),b=hue2rgb(p,q,h-1/3)}return{r:255*r,g:255*g,b:255*b}}function rgbToHsv(r,g,b){var _Mathmin7=Math.min,_Mathmax10=Math.max;r=bound01(r,255),g=bound01(g,255),b=bound01(b,255);const max=_Mathmax10(r,g,b),min=_Mathmin7(r,g,b);let h=0;const v=max,d=max-min,s=0===max?0:d/max;return max===min?h=0:(max===r?h=(g-b)/d+(g<b?6:0):max===g?h=(b-r)/d+2:max===b?h=(r-g)/d+4:void 0,h/=6),{h,s,v}}function hsvToRgb(h,s,v){h=6*bound01(h,360),s=bound01(s,100),v=bound01(v,100);const i=Math.floor(h),f=h-i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s),mod=i%6,r=[v,q,p,p,t,v][mod],g=[t,v,v,q,p,p][mod],b=[p,p,t,v,v,q][mod];return{r:255*r,g:255*g,b:255*b}}function rgbToHex(r,g,b,allow3Char){var _Mathround5=Math.round;const hex=[pad2(_Mathround5(r).toString(16)),pad2(_Mathround5(g).toString(16)),pad2(_Mathround5(b).toString(16))];return allow3Char&&hex[0].startsWith(hex[0].charAt(1))&&hex[1].startsWith(hex[1].charAt(1))&&hex[2].startsWith(hex[2].charAt(1))?hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0):hex.join("")}function rgbaToHex(r,g,b,a,allow4Char){var _Mathround6=Math.round;const hex=[pad2(_Mathround6(r).toString(16)),pad2(_Mathround6(g).toString(16)),pad2(_Mathround6(b).toString(16)),pad2(convertDecimalToHex(a))];return allow4Char&&hex[0].startsWith(hex[0].charAt(1))&&hex[1].startsWith(hex[1].charAt(1))&&hex[2].startsWith(hex[2].charAt(1))&&hex[3].startsWith(hex[3].charAt(1))?hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0)+hex[3].charAt(0):hex.join("")}function cmykToRgb(c,m,y,k){const cConv=c/100,mConv=m/100,yConv=y/100,kConv=k/100,r=255*(1-cConv)*(1-kConv),g=255*(1-mConv)*(1-kConv),b=255*(1-yConv)*(1-kConv);return{r,g,b}}function rgbToCmyk(r,g,b){var _Mathmin8=Math.min,_Mathround7=Math.round;let c=1-r/255,m=1-g/255,y=1-b/255,k=_Mathmin8(c,m,y);return 1===k?(c=0,m=0,y=0):(c=100*((c-k)/(1-k)),m=100*((m-k)/(1-k)),y=100*((y-k)/(1-k))),k*=100,{c:_Mathround7(c),m:_Mathround7(m),y:_Mathround7(y),k:_Mathround7(k)}}function convertDecimalToHex(d){return Math.round(255*parseFloat(d)).toString(16)}function convertHexToDecimal(h){return parseIntFromHex(h)/255}function parseIntFromHex(val){return parseInt(val,16)}function numberInputToObject(color){return{r:color>>16,g:(65280&color)>>8,b:255&color}}const names={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function inputToRGB(color){var _Mathmin9=Math.min,_Mathmax11=Math.max;let rgb={r:0,g:0,b:0},a=1,s=null,v=null,l=null,ok=!1,format=!1;return"string"==typeof color&&(color=stringInputToObject(color)),"object"==typeof color&&(isValidCSSUnit(color.r)&&isValidCSSUnit(color.g)&&isValidCSSUnit(color.b)?(rgb=rgbToRgb(color.r,color.g,color.b),ok=!0,format="%"===(color.r+"").substr(-1)?"prgb":"rgb"):isValidCSSUnit(color.h)&&isValidCSSUnit(color.s)&&isValidCSSUnit(color.v)?(s=convertToPercentage(color.s),v=convertToPercentage(color.v),rgb=hsvToRgb(color.h,s,v),ok=!0,format="hsv"):isValidCSSUnit(color.h)&&isValidCSSUnit(color.s)&&isValidCSSUnit(color.l)?(s=convertToPercentage(color.s),l=convertToPercentage(color.l),rgb=hslToRgb(color.h,s,l),ok=!0,format="hsl"):isValidCSSUnit(color.c)&&isValidCSSUnit(color.m)&&isValidCSSUnit(color.y)&&isValidCSSUnit(color.k)&&(rgb=cmykToRgb(color.c,color.m,color.y,color.k),ok=!0,format="cmyk"),Object.prototype.hasOwnProperty.call(color,"a")&&(a=color.a)),a=boundAlpha(a),{ok,format:color.format||format,r:_Mathmin9(255,_Mathmax11(rgb.r,0)),g:_Mathmin9(255,_Mathmax11(rgb.g,0)),b:_Mathmin9(255,_Mathmax11(rgb.b,0)),a}}const CSS_INTEGER="[-\\+]?\\d+%?",CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?",CSS_UNIT="(?:"+CSS_NUMBER+")|(?:"+"[-\\+]?\\d+%?"+")",PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",matchers={CSS_UNIT:new RegExp(CSS_UNIT),rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),cmyk:new RegExp("cmyk"+PERMISSIVE_MATCH4),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function stringInputToObject(color){if(color=color.trim().toLowerCase(),0===color.length)return!1;let named=!1;if(names[color])color=names[color],named=!0;else if("transparent"===color)return{r:0,g:0,b:0,a:0,format:"name"};let match=matchers.rgb.exec(color);return match?{r:match[1],g:match[2],b:match[3]}:(match=matchers.rgba.exec(color),match)?{r:match[1],g:match[2],b:match[3],a:match[4]}:(match=matchers.hsl.exec(color),match)?{h:match[1],s:match[2],l:match[3]}:(match=matchers.hsla.exec(color),match)?{h:match[1],s:match[2],l:match[3],a:match[4]}:(match=matchers.hsv.exec(color),match)?{h:match[1],s:match[2],v:match[3]}:(match=matchers.hsva.exec(color),match)?{h:match[1],s:match[2],v:match[3],a:match[4]}:(match=matchers.cmyk.exec(color),match)?{c:match[1],m:match[2],y:match[3],k:match[4]}:(match=matchers.hex8.exec(color),match)?{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),a:convertHexToDecimal(match[4]),format:named?"name":"hex8"}:(match=matchers.hex6.exec(color),match)?{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),format:named?"name":"hex"}:(match=matchers.hex4.exec(color),match)?{r:parseIntFromHex(match[1]+match[1]),g:parseIntFromHex(match[2]+match[2]),b:parseIntFromHex(match[3]+match[3]),a:convertHexToDecimal(match[4]+match[4]),format:named?"name":"hex8"}:(match=matchers.hex3.exec(color),!!match&&{r:parseIntFromHex(match[1]+match[1]),g:parseIntFromHex(match[2]+match[2]),b:parseIntFromHex(match[3]+match[3]),format:named?"name":"hex"})}function isValidCSSUnit(color){var _NumberisNaN2=Number.isNaN;return"number"==typeof color?!_NumberisNaN2(color):matchers.CSS_UNIT.test(color)}class TinyColor{constructor(color="",opts={}){var _Mathround8=Math.round;if(color instanceof TinyColor)return color;"number"==typeof color&&(color=numberInputToObject(color)),this.originalInput=color;const rgb=inputToRGB(color);this.originalInput=color,this.r=rgb.r,this.g=rgb.g,this.b=rgb.b,this.a=rgb.a,this.roundA=_Mathround8(100*this.a)/100,this.format=opts.format??rgb.format,this.gradientType=opts.gradientType,1>this.r&&(this.r=_Mathround8(this.r)),1>this.g&&(this.g=_Mathround8(this.g)),1>this.b&&(this.b=_Mathround8(this.b)),this.isValid=rgb.ok}isDark(){return 128>this.getBrightness()}isLight(){return!this.isDark()}getBrightness(){const rgb=this.toRgb();return(299*rgb.r+587*rgb.g+114*rgb.b)/1e3}getLuminance(){var _Mathpow9=Math.pow;const rgb=this.toRgb();let R,G,B;const RsRGB=rgb.r/255,GsRGB=rgb.g/255,BsRGB=rgb.b/255;return R=.03928>=RsRGB?RsRGB/12.92:_Mathpow9((RsRGB+.055)/1.055,2.4),G=.03928>=GsRGB?GsRGB/12.92:_Mathpow9((GsRGB+.055)/1.055,2.4),B=.03928>=BsRGB?BsRGB/12.92:_Mathpow9((BsRGB+.055)/1.055,2.4),.2126*R+.7152*G+.0722*B}getAlpha(){return this.a}setAlpha(alpha){var _Mathround9=Math.round;return this.a=boundAlpha(alpha),this.roundA=_Mathround9(100*this.a)/100,this}isMonochrome(){const{s}=this.toHsl();return 0===s}toHsv(){const hsv=rgbToHsv(this.r,this.g,this.b);return{h:360*hsv.h,s:hsv.s,v:hsv.v,a:this.a}}toHsvString(){var _Mathround0=Math.round;const hsv=rgbToHsv(this.r,this.g,this.b),h=_Mathround0(360*hsv.h),s=_Mathround0(100*hsv.s),v=_Mathround0(100*hsv.v);return 1===this.a?`hsv(${h}, ${s}%, ${v}%)`:`hsva(${h}, ${s}%, ${v}%, ${this.roundA})`}toHsl(){const hsl=rgbToHsl(this.r,this.g,this.b);return{h:360*hsl.h,s:hsl.s,l:hsl.l,a:this.a}}toHslString(){var _Mathround1=Math.round;const hsl=rgbToHsl(this.r,this.g,this.b),h=_Mathround1(360*hsl.h),s=_Mathround1(100*hsl.s),l=_Mathround1(100*hsl.l);return 1===this.a?`hsl(${h}, ${s}%, ${l}%)`:`hsla(${h}, ${s}%, ${l}%, ${this.roundA})`}toHex(allow3Char=!1){return rgbToHex(this.r,this.g,this.b,allow3Char)}toHexString(allow3Char=!1){return"#"+this.toHex(allow3Char)}toHex8(allow4Char=!1){return rgbaToHex(this.r,this.g,this.b,this.a,allow4Char)}toHex8String(allow4Char=!1){return"#"+this.toHex8(allow4Char)}toHexShortString(allowShortChar=!1){return 1===this.a?this.toHexString(allowShortChar):this.toHex8String(allowShortChar)}toRgb(){var _Mathround10=Math.round;return{r:_Mathround10(this.r),g:_Mathround10(this.g),b:_Mathround10(this.b),a:this.a}}toRgbString(){var _Mathround11=Math.round;const r=_Mathround11(this.r),g=_Mathround11(this.g),b=_Mathround11(this.b);return 1===this.a?`rgb(${r}, ${g}, ${b})`:`rgba(${r}, ${g}, ${b}, ${this.roundA})`}toPercentageRgb(){const fmt=x=>`${Math.round(100*bound01(x,255))}%`;return{r:fmt(this.r),g:fmt(this.g),b:fmt(this.b),a:this.a}}toPercentageRgbString(){const rnd=x=>Math.round(100*bound01(x,255));return 1===this.a?`rgb(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%)`:`rgba(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%, ${this.roundA})`}toCmyk(){return{...rgbToCmyk(this.r,this.g,this.b)}}toCmykString(){const{c,m,y,k}=rgbToCmyk(this.r,this.g,this.b);return`cmyk(${c}, ${m}, ${y}, ${k})`}toName(){if(0===this.a)return"transparent";if(1>this.a)return!1;const hex="#"+rgbToHex(this.r,this.g,this.b,!1);for(const[key,value]of Object.entries(names))if(hex===value)return key;return!1}toString(format){const formatSet=!!format;format=format??this.format;let formattedString=!1;const hasAlpha=1>this.a&&0<=this.a,needsAlphaFormat=!formatSet&&hasAlpha&&(format.startsWith("hex")||"name"===format);return needsAlphaFormat?"name"===format&&0===this.a?this.toName():this.toRgbString():("rgb"===format&&(formattedString=this.toRgbString()),"prgb"===format&&(formattedString=this.toPercentageRgbString()),("hex"===format||"hex6"===format)&&(formattedString=this.toHexString()),"hex3"===format&&(formattedString=this.toHexString(!0)),"hex4"===format&&(formattedString=this.toHex8String(!0)),"hex8"===format&&(formattedString=this.toHex8String()),"name"===format&&(formattedString=this.toName()),"hsl"===format&&(formattedString=this.toHslString()),"hsv"===format&&(formattedString=this.toHsvString()),"cmyk"===format&&(formattedString=this.toCmykString()),formattedString||this.toHexString())}toNumber(){var _Mathround12=Math.round;return(_Mathround12(this.r)<<16)+(_Mathround12(this.g)<<8)+_Mathround12(this.b)}clone(){return new TinyColor(this.toString())}lighten(amount=10){const hsl=this.toHsl();return hsl.l+=amount/100,hsl.l=clamp01(hsl.l),new TinyColor(hsl)}brighten(amount=10){var _Mathmin0=Math.min,_Mathmax12=Math.max,_Mathround13=Math.round;const rgb=this.toRgb();return rgb.r=_Mathmax12(0,_Mathmin0(255,rgb.r-_Mathround13(255*-(amount/100)))),rgb.g=_Mathmax12(0,_Mathmin0(255,rgb.g-_Mathround13(255*-(amount/100)))),rgb.b=_Mathmax12(0,_Mathmin0(255,rgb.b-_Mathround13(255*-(amount/100)))),new TinyColor(rgb)}darken(amount=10){const hsl=this.toHsl();return hsl.l-=amount/100,hsl.l=clamp01(hsl.l),new TinyColor(hsl)}tint(amount=10){return this.mix("white",amount)}shade(amount=10){return this.mix("black",amount)}desaturate(amount=10){const hsl=this.toHsl();return hsl.s-=amount/100,hsl.s=clamp01(hsl.s),new TinyColor(hsl)}saturate(amount=10){const hsl=this.toHsl();return hsl.s+=amount/100,hsl.s=clamp01(hsl.s),new TinyColor(hsl)}greyscale(){return this.desaturate(100)}spin(amount){const hsl=this.toHsl(),hue=(hsl.h+amount)%360;return hsl.h=0>hue?360+hue:hue,new TinyColor(hsl)}mix(color,amount=50){const rgb1=this.toRgb(),rgb2=new TinyColor(color).toRgb(),p=amount/100,rgba={r:(rgb2.r-rgb1.r)*p+rgb1.r,g:(rgb2.g-rgb1.g)*p+rgb1.g,b:(rgb2.b-rgb1.b)*p+rgb1.b,a:(rgb2.a-rgb1.a)*p+rgb1.a};return new TinyColor(rgba)}analogous(results=6,slices=30){const hsl=this.toHsl(),part=360/slices,ret=[this];for(hsl.h=(hsl.h-(part*results>>1)+720)%360;--results;)hsl.h=(hsl.h+part)%360,ret.push(new TinyColor(hsl));return ret}complement(){const hsl=this.toHsl();return hsl.h=(hsl.h+180)%360,new TinyColor(hsl)}monochromatic(results=6){const hsv=this.toHsv(),{h}=hsv,{s}=hsv;let{v}=hsv;const res=[],modification=1/results;for(;results--;)res.push(new TinyColor({h,s,v})),v=(v+modification)%1;return res}splitcomplement(){const hsl=this.toHsl(),{h}=hsl;return[this,new TinyColor({h:(h+72)%360,s:hsl.s,l:hsl.l}),new TinyColor({h:(h+216)%360,s:hsl.s,l:hsl.l})]}onBackground(background){const fg=this.toRgb(),bg=new TinyColor(background).toRgb(),alpha=fg.a+bg.a*(1-fg.a);return new TinyColor({r:(fg.r*fg.a+bg.r*bg.a*(1-fg.a))/alpha,g:(fg.g*fg.a+bg.g*bg.a*(1-fg.a))/alpha,b:(fg.b*fg.a+bg.b*bg.a*(1-fg.a))/alpha,a:alpha})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(n){const hsl=this.toHsl(),{h}=hsl,result=[this],increment=360/n;for(let i=1;i<n;i++)result.push(new TinyColor({h:(h+i*increment)%360,s:hsl.s,l:hsl.l}));return result}equals(color){const comparedColor=new TinyColor(color);return"cmyk"===this.format||"cmyk"===comparedColor.format?this.toCmykString()===comparedColor.toCmykString():this.toRgbString()===comparedColor.toRgbString()}}var hasEyeDropper="EyeDropper"in window,SlColorPicker=class extends ShoelaceElement{constructor(){super(),this.formControlController=new FormControlController(this),this.isSafeValue=!1,this.localize=new LocalizeController(this),this.hasFocus=!1,this.isDraggingGridHandle=!1,this.isEmpty=!1,this.inputValue="",this.hue=0,this.saturation=100,this.brightness=100,this.alpha=100,this.value="",this.defaultValue="",this.label="",this.format="hex",this.inline=!1,this.size="medium",this.noFormatToggle=!1,this.name="",this.disabled=!1,this.hoist=!1,this.opacity=!1,this.uppercase=!1,this.swatches="",this.form="",this.required=!1,this.handleFocusIn=()=>{this.hasFocus=!0,this.emit("sl-focus")},this.handleFocusOut=()=>{this.hasFocus=!1,this.emit("sl-blur")},this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut)}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.input.updateComplete.then(()=>{this.formControlController.updateValidity()})}handleCopy(){this.input.select(),document.execCommand("copy"),this.previewButton.focus(),this.previewButton.classList.add("color-picker__preview-color--copied"),this.previewButton.addEventListener("animationend",()=>{this.previewButton.classList.remove("color-picker__preview-color--copied")})}handleFormatToggle(){const formats=["hex","rgb","hsl","hsv"],nextIndex=(formats.indexOf(this.format)+1)%formats.length;this.format=formats[nextIndex],this.setColor(this.value),this.emit("sl-change"),this.emit("sl-input")}handleAlphaDrag(event){const container=this.shadowRoot.querySelector(".color-picker__slider.color-picker__alpha"),handle=container.querySelector(".color-picker__slider-handle"),{width}=container.getBoundingClientRect();let initialValue=this.value,currentValue=this.value;handle.focus(),event.preventDefault(),drag(container,{onMove:x=>{this.alpha=clamp(100*(x/width),0,100),this.syncValues(),this.value!==currentValue&&(currentValue=this.value,this.emit("sl-input"))},onStop:()=>{this.value!==initialValue&&(initialValue=this.value,this.emit("sl-change"))},initialEvent:event})}handleHueDrag(event){const container=this.shadowRoot.querySelector(".color-picker__slider.color-picker__hue"),handle=container.querySelector(".color-picker__slider-handle"),{width}=container.getBoundingClientRect();let initialValue=this.value,currentValue=this.value;handle.focus(),event.preventDefault(),drag(container,{onMove:x=>{this.hue=clamp(360*(x/width),0,360),this.syncValues(),this.value!==currentValue&&(currentValue=this.value,this.emit("sl-input"))},onStop:()=>{this.value!==initialValue&&(initialValue=this.value,this.emit("sl-change"))},initialEvent:event})}handleGridDrag(event){const grid=this.shadowRoot.querySelector(".color-picker__grid"),handle=grid.querySelector(".color-picker__grid-handle"),{width,height}=grid.getBoundingClientRect();let initialValue=this.value,currentValue=this.value;handle.focus(),event.preventDefault(),this.isDraggingGridHandle=!0,drag(grid,{onMove:(x,y)=>{this.saturation=clamp(100*(x/width),0,100),this.brightness=clamp(100-100*(y/height),0,100),this.syncValues(),this.value!==currentValue&&(currentValue=this.value,this.emit("sl-input"))},onStop:()=>{this.isDraggingGridHandle=!1,this.value!==initialValue&&(initialValue=this.value,this.emit("sl-change"))},initialEvent:event})}handleAlphaKeyDown(event){const increment=event.shiftKey?10:1,oldValue=this.value;"ArrowLeft"===event.key&&(event.preventDefault(),this.alpha=clamp(this.alpha-increment,0,100),this.syncValues()),"ArrowRight"===event.key&&(event.preventDefault(),this.alpha=clamp(this.alpha+increment,0,100),this.syncValues()),"Home"===event.key&&(event.preventDefault(),this.alpha=0,this.syncValues()),"End"===event.key&&(event.preventDefault(),this.alpha=100,this.syncValues()),this.value!==oldValue&&(this.emit("sl-change"),this.emit("sl-input"))}handleHueKeyDown(event){const increment=event.shiftKey?10:1,oldValue=this.value;"ArrowLeft"===event.key&&(event.preventDefault(),this.hue=clamp(this.hue-increment,0,360),this.syncValues()),"ArrowRight"===event.key&&(event.preventDefault(),this.hue=clamp(this.hue+increment,0,360),this.syncValues()),"Home"===event.key&&(event.preventDefault(),this.hue=0,this.syncValues()),"End"===event.key&&(event.preventDefault(),this.hue=360,this.syncValues()),this.value!==oldValue&&(this.emit("sl-change"),this.emit("sl-input"))}handleGridKeyDown(event){const increment=event.shiftKey?10:1,oldValue=this.value;"ArrowLeft"===event.key&&(event.preventDefault(),this.saturation=clamp(this.saturation-increment,0,100),this.syncValues()),"ArrowRight"===event.key&&(event.preventDefault(),this.saturation=clamp(this.saturation+increment,0,100),this.syncValues()),"ArrowUp"===event.key&&(event.preventDefault(),this.brightness=clamp(this.brightness+increment,0,100),this.syncValues()),"ArrowDown"===event.key&&(event.preventDefault(),this.brightness=clamp(this.brightness-increment,0,100),this.syncValues()),this.value!==oldValue&&(this.emit("sl-change"),this.emit("sl-input"))}handleInputChange(event){const target=event.target,oldValue=this.value;event.stopPropagation(),this.input.value?(this.setColor(target.value),target.value=this.value):this.value="",this.value!==oldValue&&(this.emit("sl-change"),this.emit("sl-input"))}handleInputInput(event){this.formControlController.updateValidity(),event.stopPropagation()}handleInputKeyDown(event){if("Enter"===event.key){const oldValue=this.value;this.input.value?(this.setColor(this.input.value),this.input.value=this.value,this.value!==oldValue&&(this.emit("sl-change"),this.emit("sl-input")),setTimeout(()=>this.input.select())):this.hue=0}}handleInputInvalid(event){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(event)}handleTouchMove(event){event.preventDefault()}parseColor(colorString){var _Mathround14=Math.round;const color=new TinyColor(colorString);if(!color.isValid)return null;const hslColor=color.toHsl(),hsl={h:hslColor.h,s:100*hslColor.s,l:100*hslColor.l,a:hslColor.a},rgb=color.toRgb(),hex=color.toHexString(),hexa=color.toHex8String(),hsvColor=color.toHsv(),hsv={h:hsvColor.h,s:100*hsvColor.s,v:100*hsvColor.v,a:hsvColor.a};return{hsl:{h:hsl.h,s:hsl.s,l:hsl.l,string:this.setLetterCase(`hsl(${_Mathround14(hsl.h)}, ${_Mathround14(hsl.s)}%, ${_Mathround14(hsl.l)}%)`)},hsla:{h:hsl.h,s:hsl.s,l:hsl.l,a:hsl.a,string:this.setLetterCase(`hsla(${_Mathround14(hsl.h)}, ${_Mathround14(hsl.s)}%, ${_Mathround14(hsl.l)}%, ${hsl.a.toFixed(2).toString()})`)},hsv:{h:hsv.h,s:hsv.s,v:hsv.v,string:this.setLetterCase(`hsv(${_Mathround14(hsv.h)}, ${_Mathround14(hsv.s)}%, ${_Mathround14(hsv.v)}%)`)},hsva:{h:hsv.h,s:hsv.s,v:hsv.v,a:hsv.a,string:this.setLetterCase(`hsva(${_Mathround14(hsv.h)}, ${_Mathround14(hsv.s)}%, ${_Mathround14(hsv.v)}%, ${hsv.a.toFixed(2).toString()})`)},rgb:{r:rgb.r,g:rgb.g,b:rgb.b,string:this.setLetterCase(`rgb(${_Mathround14(rgb.r)}, ${_Mathround14(rgb.g)}, ${_Mathround14(rgb.b)})`)},rgba:{r:rgb.r,g:rgb.g,b:rgb.b,a:rgb.a,string:this.setLetterCase(`rgba(${_Mathround14(rgb.r)}, ${_Mathround14(rgb.g)}, ${_Mathround14(rgb.b)}, ${rgb.a.toFixed(2).toString()})`)},hex:this.setLetterCase(hex),hexa:this.setLetterCase(hexa)}}setColor(colorString){const newColor=this.parseColor(colorString);return null!==newColor&&(this.hue=newColor.hsva.h,this.saturation=newColor.hsva.s,this.brightness=newColor.hsva.v,this.alpha=this.opacity?100*newColor.hsva.a:100,this.syncValues(),!0)}setLetterCase(string){return"string"==typeof string?this.uppercase?string.toUpperCase():string.toLowerCase():""}async syncValues(){const currentColor=this.parseColor(`hsva(${this.hue}, ${this.saturation}%, ${this.brightness}%, ${this.alpha/100})`);null===currentColor||(this.inputValue="hsl"===this.format?this.opacity?currentColor.hsla.string:currentColor.hsl.string:"rgb"===this.format?this.opacity?currentColor.rgba.string:currentColor.rgb.string:"hsv"===this.format?this.opacity?currentColor.hsva.string:currentColor.hsv.string:this.opacity?currentColor.hexa:currentColor.hex,this.isSafeValue=!0,this.value=this.inputValue,await this.updateComplete,this.isSafeValue=!1)}handleAfterHide(){this.previewButton.classList.remove("color-picker__preview-color--copied")}handleEyeDropper(){if(hasEyeDropper){const eyeDropper=new EyeDropper;eyeDropper.open().then(colorSelectionResult=>{const oldValue=this.value;this.setColor(colorSelectionResult.sRGBHex),this.value!==oldValue&&(this.emit("sl-change"),this.emit("sl-input"))}).catch(()=>{})}}selectSwatch(color){const oldValue=this.value;this.disabled||(this.setColor(color),this.value!==oldValue&&(this.emit("sl-change"),this.emit("sl-input")))}getHexString(hue,saturation,brightness,alpha=100){const color=new TinyColor(`hsva(${hue}, ${saturation}%, ${brightness}%, ${alpha/100})`);return color.isValid?color.toHex8String():""}stopNestedEventPropagation(event){event.stopImmediatePropagation()}handleFormatChange(){this.syncValues()}handleOpacityChange(){this.alpha=100}handleValueChange(oldValue,newValue){if(this.isEmpty=!newValue,newValue||(this.hue=0,this.saturation=0,this.brightness=100,this.alpha=100),!this.isSafeValue){const newColor=this.parseColor(newValue);null===newColor?this.inputValue=null==oldValue?"":oldValue:(this.inputValue=this.value,this.hue=newColor.hsva.h,this.saturation=newColor.hsva.s,this.brightness=newColor.hsva.v,this.alpha=100*newColor.hsva.a,this.syncValues())}}focus(options){this.inline?this.base.focus(options):this.trigger.focus(options)}blur(){var _a;const elementToBlur=this.inline?this.base:this.trigger;this.hasFocus&&(elementToBlur.focus({preventScroll:!0}),elementToBlur.blur()),(null==(_a=this.dropdown)?void 0:_a.open)&&this.dropdown.hide()}getFormattedValue(format="hex"){const currentColor=this.parseColor(`hsva(${this.hue}, ${this.saturation}%, ${this.brightness}%, ${this.alpha/100})`);if(null===currentColor)return"";return"hex"===format?currentColor.hex:"hexa"===format?currentColor.hexa:"rgb"===format?currentColor.rgb.string:"rgba"===format?currentColor.rgba.string:"hsl"===format?currentColor.hsl.string:"hsla"===format?currentColor.hsla.string:"hsv"===format?currentColor.hsv.string:"hsva"===format?currentColor.hsva.string:""}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.inline||this.validity.valid?this.input.reportValidity():(this.dropdown.show(),this.addEventListener("sl-after-show",()=>this.input.reportValidity(),{once:!0}),this.disabled||this.formControlController.emitInvalidEvent(),!1)}setCustomValidity(message){this.input.setCustomValidity(message),this.formControlController.updateValidity()}render(){var _Mathround15=Math.round;const gridHandleX=this.saturation,gridHandleY=100-this.brightness,swatches=Array.isArray(this.swatches)?this.swatches:this.swatches.split(";").filter(color=>""!==color.trim()),colorPicker=x$1` + <div + part="base" + class=${e$2({"color-picker":!0,"color-picker--inline":this.inline,"color-picker--disabled":this.disabled,"color-picker--focused":this.hasFocus})} + aria-disabled=${this.disabled?"true":"false"} + aria-labelledby="label" + tabindex=${this.inline?"0":"-1"} + > + ${this.inline?x$1` + <sl-visually-hidden id="label"> + <slot name="label">${this.label}</slot> + </sl-visually-hidden> + `:null} + + <div + part="grid" + class="color-picker__grid" + style=${o$3({backgroundColor:this.getHexString(this.hue,100,100)})} + @pointerdown=${this.handleGridDrag} + @touchmove=${this.handleTouchMove} + > + <span + part="grid-handle" + class=${e$2({"color-picker__grid-handle":!0,"color-picker__grid-handle--dragging":this.isDraggingGridHandle})} + style=${o$3({top:`${gridHandleY}%`,left:`${gridHandleX}%`,backgroundColor:this.getHexString(this.hue,this.saturation,this.brightness,this.alpha)})} + role="application" + aria-label="HSV" + tabindex=${o$6(this.disabled?void 0:"0")} + @keydown=${this.handleGridKeyDown} + ></span> + </div> + + <div class="color-picker__controls"> + <div class="color-picker__sliders"> + <div + part="slider hue-slider" + class="color-picker__hue color-picker__slider" + @pointerdown=${this.handleHueDrag} + @touchmove=${this.handleTouchMove} + > + <span + part="slider-handle hue-slider-handle" + class="color-picker__slider-handle" + style=${o$3({left:`${0===this.hue?0:100/(360/this.hue)}%`})} + role="slider" + aria-label="hue" + aria-orientation="horizontal" + aria-valuemin="0" + aria-valuemax="360" + aria-valuenow=${`${_Mathround15(this.hue)}`} + tabindex=${o$6(this.disabled?void 0:"0")} + @keydown=${this.handleHueKeyDown} + ></span> + </div> + + ${this.opacity?x$1` + <div + part="slider opacity-slider" + class="color-picker__alpha color-picker__slider color-picker__transparent-bg" + @pointerdown="${this.handleAlphaDrag}" + @touchmove=${this.handleTouchMove} + > + <div + class="color-picker__alpha-gradient" + style=${o$3({backgroundImage:`linear-gradient( + to right, + ${this.getHexString(this.hue,this.saturation,this.brightness,0)} 0%, + ${this.getHexString(this.hue,this.saturation,this.brightness,100)} 100% + )`})} + ></div> + <span + part="slider-handle opacity-slider-handle" + class="color-picker__slider-handle" + style=${o$3({left:`${this.alpha}%`})} + role="slider" + aria-label="alpha" + aria-orientation="horizontal" + aria-valuemin="0" + aria-valuemax="100" + aria-valuenow=${_Mathround15(this.alpha)} + tabindex=${o$6(this.disabled?void 0:"0")} + @keydown=${this.handleAlphaKeyDown} + ></span> + </div> + `:""} + </div> + + <button + type="button" + part="preview" + class="color-picker__preview color-picker__transparent-bg" + aria-label=${this.localize.term("copy")} + style=${o$3({"--preview-color":this.getHexString(this.hue,this.saturation,this.brightness,this.alpha)})} + @click=${this.handleCopy} + ></button> + </div> + + <div class="color-picker__user-input" aria-live="polite"> + <sl-input + part="input" + type="text" + name=${this.name} + autocomplete="off" + autocorrect="off" + autocapitalize="off" + spellcheck="false" + value=${this.isEmpty?"":this.inputValue} + ?required=${this.required} + ?disabled=${this.disabled} + aria-label=${this.localize.term("currentValue")} + @keydown=${this.handleInputKeyDown} + @sl-change=${this.handleInputChange} + @sl-input=${this.handleInputInput} + @sl-invalid=${this.handleInputInvalid} + @sl-blur=${this.stopNestedEventPropagation} + @sl-focus=${this.stopNestedEventPropagation} + ></sl-input> + + <sl-button-group> + ${this.noFormatToggle?"":x$1` + <sl-button + part="format-button" + aria-label=${this.localize.term("toggleColorFormat")} + exportparts=" + base:format-button__base, + prefix:format-button__prefix, + label:format-button__label, + suffix:format-button__suffix, + caret:format-button__caret + " + @click=${this.handleFormatToggle} + @sl-blur=${this.stopNestedEventPropagation} + @sl-focus=${this.stopNestedEventPropagation} + > + ${this.setLetterCase(this.format)} + </sl-button> + `} + ${hasEyeDropper?x$1` + <sl-button + part="eye-dropper-button" + exportparts=" + base:eye-dropper-button__base, + prefix:eye-dropper-button__prefix, + label:eye-dropper-button__label, + suffix:eye-dropper-button__suffix, + caret:eye-dropper-button__caret + " + @click=${this.handleEyeDropper} + @sl-blur=${this.stopNestedEventPropagation} + @sl-focus=${this.stopNestedEventPropagation} + > + <sl-icon + library="system" + name="eyedropper" + label=${this.localize.term("selectAColorFromTheScreen")} + ></sl-icon> + </sl-button> + `:""} + </sl-button-group> + </div> + + ${0<swatches.length?x$1` + <div part="swatches" class="color-picker__swatches"> + ${swatches.map(swatch=>{const parsedColor=this.parseColor(swatch);return parsedColor?x$1` + <div + part="swatch" + class="color-picker__swatch color-picker__transparent-bg" + tabindex=${o$6(this.disabled?void 0:"0")} + role="button" + aria-label=${swatch} + @click=${()=>this.selectSwatch(swatch)} + @keydown=${event=>!this.disabled&&"Enter"===event.key&&this.setColor(parsedColor.hexa)} + > + <div + class="color-picker__swatch-color" + style=${o$3({backgroundColor:parsedColor.hexa})} + ></div> + </div> + `:(console.error(`Unable to parse swatch color: "${swatch}"`,this),"")})} + </div> + `:""} + </div> + `;return this.inline?colorPicker:x$1` + <sl-dropdown + class="color-dropdown" + aria-disabled=${this.disabled?"true":"false"} + .containingElement=${this} + ?disabled=${this.disabled} + ?hoist=${this.hoist} + @sl-after-hide=${this.handleAfterHide} + > + <button + part="trigger" + slot="trigger" + class=${e$2({"color-dropdown__trigger":!0,"color-dropdown__trigger--disabled":this.disabled,"color-dropdown__trigger--small":"small"===this.size,"color-dropdown__trigger--medium":"medium"===this.size,"color-dropdown__trigger--large":"large"===this.size,"color-dropdown__trigger--empty":this.isEmpty,"color-dropdown__trigger--focused":this.hasFocus,"color-picker__transparent-bg":!0})} + style=${o$3({color:this.getHexString(this.hue,this.saturation,this.brightness,this.alpha)})} + type="button" + > + <sl-visually-hidden> + <slot name="label">${this.label}</slot> + </sl-visually-hidden> + </button> + ${colorPicker} + </sl-dropdown> + `}};SlColorPicker.styles=[component_styles_default,color_picker_styles_default],SlColorPicker.dependencies={"sl-button-group":SlButtonGroup,"sl-button":SlButton,"sl-dropdown":SlDropdown,"sl-icon":SlIcon,"sl-input":SlInput,"sl-visually-hidden":SlVisuallyHidden},__decorateClass([e$6("[part~=\"base\"]")],SlColorPicker.prototype,"base",2),__decorateClass([e$6("[part~=\"input\"]")],SlColorPicker.prototype,"input",2),__decorateClass([e$6(".color-dropdown")],SlColorPicker.prototype,"dropdown",2),__decorateClass([e$6("[part~=\"preview\"]")],SlColorPicker.prototype,"previewButton",2),__decorateClass([e$6("[part~=\"trigger\"]")],SlColorPicker.prototype,"trigger",2),__decorateClass([r$6()],SlColorPicker.prototype,"hasFocus",2),__decorateClass([r$6()],SlColorPicker.prototype,"isDraggingGridHandle",2),__decorateClass([r$6()],SlColorPicker.prototype,"isEmpty",2),__decorateClass([r$6()],SlColorPicker.prototype,"inputValue",2),__decorateClass([r$6()],SlColorPicker.prototype,"hue",2),__decorateClass([r$6()],SlColorPicker.prototype,"saturation",2),__decorateClass([r$6()],SlColorPicker.prototype,"brightness",2),__decorateClass([r$6()],SlColorPicker.prototype,"alpha",2),__decorateClass([n$5()],SlColorPicker.prototype,"value",2),__decorateClass([defaultValue()],SlColorPicker.prototype,"defaultValue",2),__decorateClass([n$5()],SlColorPicker.prototype,"label",2),__decorateClass([n$5()],SlColorPicker.prototype,"format",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlColorPicker.prototype,"inline",2),__decorateClass([n$5({reflect:!0})],SlColorPicker.prototype,"size",2),__decorateClass([n$5({attribute:"no-format-toggle",type:Boolean})],SlColorPicker.prototype,"noFormatToggle",2),__decorateClass([n$5()],SlColorPicker.prototype,"name",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlColorPicker.prototype,"disabled",2),__decorateClass([n$5({type:Boolean})],SlColorPicker.prototype,"hoist",2),__decorateClass([n$5({type:Boolean})],SlColorPicker.prototype,"opacity",2),__decorateClass([n$5({type:Boolean})],SlColorPicker.prototype,"uppercase",2),__decorateClass([n$5()],SlColorPicker.prototype,"swatches",2),__decorateClass([n$5({reflect:!0})],SlColorPicker.prototype,"form",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlColorPicker.prototype,"required",2),__decorateClass([t$2({passive:!1})],SlColorPicker.prototype,"handleTouchMove",1),__decorateClass([watch("format",{waitUntilFirstUpdate:!0})],SlColorPicker.prototype,"handleFormatChange",1),__decorateClass([watch("opacity",{waitUntilFirstUpdate:!0})],SlColorPicker.prototype,"handleOpacityChange",1),__decorateClass([watch("value")],SlColorPicker.prototype,"handleValueChange",1),SlColorPicker.define("sl-color-picker");var card_styles_default=i$7` + :host { + --border-color: var(--sl-color-neutral-200); + --border-radius: var(--sl-border-radius-medium); + --border-width: 1px; + --padding: var(--sl-spacing-large); + + display: inline-block; + } + + .card { + display: flex; + flex-direction: column; + background-color: var(--sl-panel-background-color); + box-shadow: var(--sl-shadow-x-small); + border: solid var(--border-width) var(--border-color); + border-radius: var(--border-radius); + } + + .card__image { + display: flex; + border-top-left-radius: var(--border-radius); + border-top-right-radius: var(--border-radius); + margin: calc(-1 * var(--border-width)); + overflow: hidden; + } + + .card__image::slotted(img) { + display: block; + width: 100%; + } + + .card:not(.card--has-image) .card__image { + display: none; + } + + .card__header { + display: block; + border-bottom: solid var(--border-width) var(--border-color); + padding: calc(var(--padding) / 2) var(--padding); + } + + .card:not(.card--has-header) .card__header { + display: none; + } + + .card:not(.card--has-image) .card__header { + border-top-left-radius: var(--border-radius); + border-top-right-radius: var(--border-radius); + } + + .card__body { + display: block; + padding: var(--padding); + } + + .card--has-footer .card__footer { + display: block; + border-top: solid var(--border-width) var(--border-color); + padding: var(--padding); + } + + .card:not(.card--has-footer) .card__footer { + display: none; + } +`,SlCard=class extends ShoelaceElement{constructor(){super(...arguments),this.hasSlotController=new HasSlotController(this,"footer","header","image")}render(){return x$1` + <div + part="base" + class=${e$2({card:!0,"card--has-footer":this.hasSlotController.test("footer"),"card--has-image":this.hasSlotController.test("image"),"card--has-header":this.hasSlotController.test("header")})} + > + <slot name="image" part="image" class="card__image"></slot> + <slot name="header" part="header" class="card__header"></slot> + <slot part="body" class="card__body"></slot> + <slot name="footer" part="footer" class="card__footer"></slot> + </div> + `}};SlCard.styles=[component_styles_default,card_styles_default],SlCard.define("sl-card");var AutoplayController=class{constructor(host,tickCallback){this.timerId=0,this.activeInteractions=0,this.paused=!1,this.stopped=!0,this.pause=()=>{this.activeInteractions++||(this.paused=!0,this.host.requestUpdate())},this.resume=()=>{--this.activeInteractions||(this.paused=!1,this.host.requestUpdate())},host.addController(this),this.host=host,this.tickCallback=tickCallback}hostConnected(){this.host.addEventListener("mouseenter",this.pause),this.host.addEventListener("mouseleave",this.resume),this.host.addEventListener("focusin",this.pause),this.host.addEventListener("focusout",this.resume),this.host.addEventListener("touchstart",this.pause,{passive:!0}),this.host.addEventListener("touchend",this.resume)}hostDisconnected(){this.stop(),this.host.removeEventListener("mouseenter",this.pause),this.host.removeEventListener("mouseleave",this.resume),this.host.removeEventListener("focusin",this.pause),this.host.removeEventListener("focusout",this.resume),this.host.removeEventListener("touchstart",this.pause),this.host.removeEventListener("touchend",this.resume)}start(interval){this.stop(),this.stopped=!1,this.timerId=window.setInterval(()=>{this.paused||this.tickCallback()},interval)}stop(){clearInterval(this.timerId),this.stopped=!0,this.host.requestUpdate()}},carousel_styles_default=i$7` + :host { + --slide-gap: var(--sl-spacing-medium, 1rem); + --aspect-ratio: 16 / 9; + --scroll-hint: 0px; + + display: flex; + } + + .carousel { + display: grid; + grid-template-columns: min-content 1fr min-content; + grid-template-rows: 1fr min-content; + grid-template-areas: + '. slides .' + '. pagination .'; + gap: var(--sl-spacing-medium); + align-items: center; + min-height: 100%; + min-width: 100%; + position: relative; + } + + .carousel__pagination { + grid-area: pagination; + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: var(--sl-spacing-small); + } + + .carousel__slides { + grid-area: slides; + + display: grid; + height: 100%; + width: 100%; + align-items: center; + justify-items: center; + overflow: auto; + overscroll-behavior-x: contain; + scrollbar-width: none; + aspect-ratio: calc(var(--aspect-ratio) * var(--slides-per-page)); + border-radius: var(--sl-border-radius-small); + + --slide-size: calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page)); + } + + @media (prefers-reduced-motion) { + :where(.carousel__slides) { + scroll-behavior: auto; + } + } + + .carousel__slides--horizontal { + grid-auto-flow: column; + grid-auto-columns: var(--slide-size); + grid-auto-rows: 100%; + column-gap: var(--slide-gap); + scroll-snap-type: x mandatory; + scroll-padding-inline: var(--scroll-hint); + padding-inline: var(--scroll-hint); + overflow-y: hidden; + } + + .carousel__slides--vertical { + grid-auto-flow: row; + grid-auto-columns: 100%; + grid-auto-rows: var(--slide-size); + row-gap: var(--slide-gap); + scroll-snap-type: y mandatory; + scroll-padding-block: var(--scroll-hint); + padding-block: var(--scroll-hint); + overflow-x: hidden; + } + + .carousel__slides--dragging { + } + + :host([vertical]) ::slotted(sl-carousel-item) { + height: 100%; + } + + .carousel__slides::-webkit-scrollbar { + display: none; + } + + .carousel__navigation { + grid-area: navigation; + display: contents; + font-size: var(--sl-font-size-x-large); + } + + .carousel__navigation-button { + flex: 0 0 auto; + display: flex; + align-items: center; + background: none; + border: none; + border-radius: var(--sl-border-radius-small); + font-size: inherit; + color: var(--sl-color-neutral-600); + padding: var(--sl-spacing-x-small); + cursor: pointer; + transition: var(--sl-transition-medium) color; + appearance: none; + } + + .carousel__navigation-button--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .carousel__navigation-button--disabled::part(base) { + pointer-events: none; + } + + .carousel__navigation-button--previous { + grid-column: 1; + grid-row: 1; + } + + .carousel__navigation-button--next { + grid-column: 3; + grid-row: 1; + } + + .carousel__pagination-item { + display: block; + cursor: pointer; + background: none; + border: 0; + border-radius: var(--sl-border-radius-circle); + width: var(--sl-spacing-small); + height: var(--sl-spacing-small); + background-color: var(--sl-color-neutral-300); + padding: 0; + margin: 0; + } + + .carousel__pagination-item--active { + background-color: var(--sl-color-neutral-700); + transform: scale(1.2); + } + + /* Focus styles */ + .carousel__slides:focus-visible, + .carousel__navigation-button:focus-visible, + .carousel__pagination-item:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } +`,SlCarousel=class extends ShoelaceElement{constructor(){super(...arguments),this.loop=!1,this.navigation=!1,this.pagination=!1,this.autoplay=!1,this.autoplayInterval=3e3,this.slidesPerPage=1,this.slidesPerMove=1,this.orientation="horizontal",this.mouseDragging=!1,this.activeSlide=0,this.scrolling=!1,this.dragging=!1,this.autoplayController=new AutoplayController(this,()=>this.next()),this.dragStartPosition=[-1,-1],this.localize=new LocalizeController(this),this.pendingSlideChange=!1,this.handleMouseDrag=event=>{this.dragging||(this.scrollContainer.style.setProperty("scroll-snap-type","none"),this.dragging=!0,this.dragStartPosition=[event.clientX,event.clientY]),this.scrollContainer.scrollBy({left:-event.movementX,top:-event.movementY,behavior:"instant"})},this.handleMouseDragEnd=()=>{const scrollContainer=this.scrollContainer;document.removeEventListener("pointermove",this.handleMouseDrag,{capture:!0});const startLeft=scrollContainer.scrollLeft,startTop=scrollContainer.scrollTop;scrollContainer.style.removeProperty("scroll-snap-type"),scrollContainer.style.setProperty("overflow","hidden");const finalLeft=scrollContainer.scrollLeft,finalTop=scrollContainer.scrollTop;scrollContainer.style.removeProperty("overflow"),scrollContainer.style.setProperty("scroll-snap-type","none"),scrollContainer.scrollTo({left:startLeft,top:startTop,behavior:"instant"}),requestAnimationFrame(async()=>{(startLeft!==finalLeft||startTop!==finalTop)&&(scrollContainer.scrollTo({left:finalLeft,top:finalTop,behavior:prefersReducedMotion()?"auto":"smooth"}),await waitForEvent(scrollContainer,"scrollend")),scrollContainer.style.removeProperty("scroll-snap-type"),this.dragging=!1,this.dragStartPosition=[-1,-1],this.handleScrollEnd()})},this.handleSlotChange=mutations=>{const needsInitialization=mutations.some(mutation=>[...mutation.addedNodes,...mutation.removedNodes].some(el=>this.isCarouselItem(el)&&!el.hasAttribute("data-clone")));needsInitialization&&this.initializeSlides(),this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-label",this.localize.term("carousel"))}disconnectedCallback(){var _a;super.disconnectedCallback(),null==(_a=this.mutationObserver)?void 0:_a.disconnect()}firstUpdated(){this.initializeSlides(),this.mutationObserver=new MutationObserver(this.handleSlotChange),this.mutationObserver.observe(this,{childList:!0,subtree:!0})}willUpdate(changedProperties){(changedProperties.has("slidesPerMove")||changedProperties.has("slidesPerPage"))&&(this.slidesPerMove=Math.min(this.slidesPerMove,this.slidesPerPage))}getPageCount(){const slidesCount=this.getSlides().length,{slidesPerPage,slidesPerMove,loop}=this,pages=loop?slidesCount/slidesPerMove:(slidesCount-slidesPerPage)/slidesPerMove+1;return Math.ceil(pages)}getCurrentPage(){return Math.ceil(this.activeSlide/this.slidesPerMove)}canScrollNext(){return this.loop||this.getCurrentPage()<this.getPageCount()-1}canScrollPrev(){return this.loop||0<this.getCurrentPage()}getSlides({excludeClones=!0}={}){return[...this.children].filter(el=>this.isCarouselItem(el)&&(!excludeClones||!el.hasAttribute("data-clone")))}handleClick(event){var _Mathabs5=Math.abs;if(this.dragging&&0<this.dragStartPosition[0]&&0<this.dragStartPosition[1]){const deltaX=_Mathabs5(this.dragStartPosition[0]-event.clientX),deltaY=_Mathabs5(this.dragStartPosition[1]-event.clientY),delta=Math.sqrt(deltaX*deltaX+deltaY*deltaY);10<=delta&&event.preventDefault()}}handleKeyDown(event){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(event.key)){const target=event.target,isRtl="rtl"===this.localize.dir(),isFocusInPagination=null!==target.closest("[part~=\"pagination-item\"]"),isNext="ArrowDown"===event.key||!isRtl&&"ArrowRight"===event.key||isRtl&&"ArrowLeft"===event.key,isPrevious="ArrowUp"===event.key||!isRtl&&"ArrowLeft"===event.key||isRtl&&"ArrowRight"===event.key;event.preventDefault(),isPrevious&&this.previous(),isNext&&this.next(),"Home"===event.key&&this.goToSlide(0),"End"===event.key&&this.goToSlide(this.getSlides().length-1),isFocusInPagination&&this.updateComplete.then(()=>{var _a;const activePaginationItem=null==(_a=this.shadowRoot)?void 0:_a.querySelector("[part~=\"pagination-item--active\"]");activePaginationItem&&activePaginationItem.focus()})}}handleMouseDragStart(event){const canDrag=this.mouseDragging&&0===event.button;canDrag&&(event.preventDefault(),document.addEventListener("pointermove",this.handleMouseDrag,{capture:!0,passive:!0}),document.addEventListener("pointerup",this.handleMouseDragEnd,{capture:!0,once:!0}))}handleScroll(){this.scrolling=!0,this.pendingSlideChange||this.synchronizeSlides()}synchronizeSlides(){var _Mathceil3=Math.ceil;const io=new IntersectionObserver(entries=>{io.disconnect();for(const entry of entries){const slide=entry.target;slide.toggleAttribute("inert",!entry.isIntersecting),slide.classList.toggle("--in-view",entry.isIntersecting),slide.setAttribute("aria-hidden",entry.isIntersecting?"false":"true")}const firstIntersecting=entries.find(entry=>entry.isIntersecting);if(!firstIntersecting)return;const slidesWithClones=this.getSlides({excludeClones:!1}),slidesCount=this.getSlides().length,slideIndex=slidesWithClones.indexOf(firstIntersecting.target),normalizedIndex=this.loop?slideIndex-this.slidesPerPage:slideIndex;if(this.activeSlide=(_Mathceil3(normalizedIndex/this.slidesPerMove)*this.slidesPerMove+slidesCount)%slidesCount,!this.scrolling&&this.loop&&firstIntersecting.target.hasAttribute("data-clone")){const clonePosition=+firstIntersecting.target.getAttribute("data-clone");this.goToSlide(clonePosition,"instant")}},{root:this.scrollContainer,threshold:.6});this.getSlides({excludeClones:!1}).forEach(slide=>{io.observe(slide)})}handleScrollEnd(){!this.scrolling||this.dragging||(this.scrolling=!1,this.pendingSlideChange=!1,this.synchronizeSlides())}isCarouselItem(node){return node instanceof Element&&"sl-carousel-item"===node.tagName.toLowerCase()}initializeSlides(){this.getSlides({excludeClones:!1}).forEach((slide,index)=>{slide.classList.remove("--in-view"),slide.classList.remove("--is-active"),slide.setAttribute("role","group"),slide.setAttribute("aria-label",this.localize.term("slideNum",index+1)),this.pagination&&(slide.setAttribute("id",`slide-${index+1}`),slide.setAttribute("role","tabpanel"),slide.removeAttribute("aria-label"),slide.setAttribute("aria-labelledby",`tab-${index+1}`)),slide.hasAttribute("data-clone")&&slide.remove()}),this.updateSlidesSnap(),this.loop&&this.createClones(),this.goToSlide(this.activeSlide,"auto"),this.synchronizeSlides()}createClones(){const slides=this.getSlides(),slidesPerPage=this.slidesPerPage,lastSlides=slides.slice(-slidesPerPage),firstSlides=slides.slice(0,slidesPerPage);lastSlides.reverse().forEach((slide,i)=>{const clone=slide.cloneNode(!0);clone.setAttribute("data-clone",slides.length-i-1+""),this.prepend(clone)}),firstSlides.forEach((slide,i)=>{const clone=slide.cloneNode(!0);clone.setAttribute("data-clone",i+""),this.append(clone)})}handleSlideChange(){const slides=this.getSlides();slides.forEach((slide,i)=>{slide.classList.toggle("--is-active",i===this.activeSlide)}),this.hasUpdated&&this.emit("sl-slide-change",{detail:{index:this.activeSlide,slide:slides[this.activeSlide]}})}updateSlidesSnap(){const slides=this.getSlides(),slidesPerMove=this.slidesPerMove;slides.forEach((slide,i)=>{const shouldSnap=0==(i+slidesPerMove)%slidesPerMove;shouldSnap?slide.style.removeProperty("scroll-snap-align"):slide.style.setProperty("scroll-snap-align","none")})}handleAutoplayChange(){this.autoplayController.stop(),this.autoplay&&this.autoplayController.start(this.autoplayInterval)}previous(behavior="smooth"){this.goToSlide(this.activeSlide-this.slidesPerMove,behavior)}next(behavior="smooth"){this.goToSlide(this.activeSlide+this.slidesPerMove,behavior)}goToSlide(index,behavior="smooth"){const{slidesPerPage,loop}=this,slides=this.getSlides(),slidesWithClones=this.getSlides({excludeClones:!1});if(!slides.length)return;const newActiveSlide=loop?(index+slides.length)%slides.length:clamp(index,0,slides.length-slidesPerPage);this.activeSlide=newActiveSlide;const isRtl="rtl"===this.localize.dir(),nextSlideIndex=clamp(index+(loop?slidesPerPage:0)+(isRtl?slidesPerPage-1:0),0,slidesWithClones.length-1),nextSlide=slidesWithClones[nextSlideIndex];this.scrollToSlide(nextSlide,prefersReducedMotion()?"auto":behavior)}scrollToSlide(slide,behavior="smooth"){this.pendingSlideChange=!0,window.requestAnimationFrame(()=>{if(!this.scrollContainer)return;const scrollContainer=this.scrollContainer,scrollContainerRect=scrollContainer.getBoundingClientRect(),nextSlideRect=slide.getBoundingClientRect(),nextLeft=nextSlideRect.left-scrollContainerRect.left,nextTop=nextSlideRect.top-scrollContainerRect.top;nextLeft||nextTop?(this.pendingSlideChange=!0,scrollContainer.scrollTo({left:nextLeft+scrollContainer.scrollLeft,top:nextTop+scrollContainer.scrollTop,behavior})):this.pendingSlideChange=!1})}render(){const{slidesPerMove,scrolling}=this,pagesCount=this.getPageCount(),currentPage=this.getCurrentPage(),prevEnabled=this.canScrollPrev(),nextEnabled=this.canScrollNext(),isLtr="ltr"===this.localize.dir();return x$1` + <div part="base" class="carousel"> + <div + id="scroll-container" + part="scroll-container" + class="${e$2({carousel__slides:!0,"carousel__slides--horizontal":"horizontal"===this.orientation,"carousel__slides--vertical":"vertical"===this.orientation,"carousel__slides--dragging":this.dragging})}" + style="--slides-per-page: ${this.slidesPerPage};" + aria-busy="${scrolling?"true":"false"}" + aria-atomic="true" + tabindex="0" + @keydown=${this.handleKeyDown} + @mousedown="${this.handleMouseDragStart}" + @scroll="${this.handleScroll}" + @scrollend=${this.handleScrollEnd} + @click=${this.handleClick} + > + <slot></slot> + </div> + + ${this.navigation?x$1` + <div part="navigation" class="carousel__navigation"> + <button + part="navigation-button navigation-button--previous" + class="${e$2({"carousel__navigation-button":!0,"carousel__navigation-button--previous":!0,"carousel__navigation-button--disabled":!prevEnabled})}" + aria-label="${this.localize.term("previousSlide")}" + aria-controls="scroll-container" + aria-disabled="${prevEnabled?"false":"true"}" + @click=${prevEnabled?()=>this.previous():null} + > + <slot name="previous-icon"> + <sl-icon library="system" name="${isLtr?"chevron-left":"chevron-right"}"></sl-icon> + </slot> + </button> + + <button + part="navigation-button navigation-button--next" + class=${e$2({"carousel__navigation-button":!0,"carousel__navigation-button--next":!0,"carousel__navigation-button--disabled":!nextEnabled})} + aria-label="${this.localize.term("nextSlide")}" + aria-controls="scroll-container" + aria-disabled="${nextEnabled?"false":"true"}" + @click=${nextEnabled?()=>this.next():null} + > + <slot name="next-icon"> + <sl-icon library="system" name="${isLtr?"chevron-right":"chevron-left"}"></sl-icon> + </slot> + </button> + </div> + `:""} + ${this.pagination?x$1` + <div part="pagination" role="tablist" class="carousel__pagination"> + ${o(o$1(pagesCount),index=>{const isActive=index===currentPage;return x$1` + <button + part="pagination-item ${isActive?"pagination-item--active":""}" + class="${e$2({"carousel__pagination-item":!0,"carousel__pagination-item--active":isActive})}" + role="tab" + id="tab-${index+1}" + aria-controls="slide-${index+1}" + aria-selected="${isActive?"true":"false"}" + aria-label="${isActive?this.localize.term("slideNum",index+1):this.localize.term("goToSlide",index+1,pagesCount)}" + tabindex=${isActive?"0":"-1"} + @click=${()=>this.goToSlide(index*slidesPerMove)} + @keydown=${this.handleKeyDown} + ></button> + `})} + </div> + `:""} + </div> + `}};SlCarousel.styles=[component_styles_default,carousel_styles_default],SlCarousel.dependencies={"sl-icon":SlIcon},__decorateClass([n$5({type:Boolean,reflect:!0})],SlCarousel.prototype,"loop",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlCarousel.prototype,"navigation",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlCarousel.prototype,"pagination",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlCarousel.prototype,"autoplay",2),__decorateClass([n$5({type:Number,attribute:"autoplay-interval"})],SlCarousel.prototype,"autoplayInterval",2),__decorateClass([n$5({type:Number,attribute:"slides-per-page"})],SlCarousel.prototype,"slidesPerPage",2),__decorateClass([n$5({type:Number,attribute:"slides-per-move"})],SlCarousel.prototype,"slidesPerMove",2),__decorateClass([n$5()],SlCarousel.prototype,"orientation",2),__decorateClass([n$5({type:Boolean,reflect:!0,attribute:"mouse-dragging"})],SlCarousel.prototype,"mouseDragging",2),__decorateClass([e$6(".carousel__slides")],SlCarousel.prototype,"scrollContainer",2),__decorateClass([e$6(".carousel__pagination")],SlCarousel.prototype,"paginationContainer",2),__decorateClass([r$6()],SlCarousel.prototype,"activeSlide",2),__decorateClass([r$6()],SlCarousel.prototype,"scrolling",2),__decorateClass([r$6()],SlCarousel.prototype,"dragging",2),__decorateClass([t$2({passive:!0})],SlCarousel.prototype,"handleScroll",1),__decorateClass([watch("loop",{waitUntilFirstUpdate:!0}),watch("slidesPerPage",{waitUntilFirstUpdate:!0})],SlCarousel.prototype,"initializeSlides",1),__decorateClass([watch("activeSlide")],SlCarousel.prototype,"handleSlideChange",1),__decorateClass([watch("slidesPerMove")],SlCarousel.prototype,"updateSlidesSnap",1),__decorateClass([watch("autoplay")],SlCarousel.prototype,"handleAutoplayChange",1),SlCarousel.define("sl-carousel");var debounce=(fn,delay)=>{let timerId=0;return function(...args){window.clearTimeout(timerId),timerId=window.setTimeout(()=>{fn.call(this,...args)},delay)}},decorate=(proto,method,decorateFn)=>{const superFn=proto[method];proto[method]=function(...args){superFn.call(this,...args),decorateFn.call(this,superFn,...args)}};(()=>{if("undefined"!=typeof window){const isSupported="onscrollend"in window;if(!isSupported){const pointers=new Set,scrollHandlers=new WeakMap,handlePointerDown=event=>{for(const touch of event.changedTouches)pointers.add(touch.identifier)},handlePointerUp=event=>{for(const touch of event.changedTouches)pointers.delete(touch.identifier)};document.addEventListener("touchstart",handlePointerDown,!0),document.addEventListener("touchend",handlePointerUp,!0),document.addEventListener("touchcancel",handlePointerUp,!0),decorate(EventTarget.prototype,"addEventListener",function(addEventListener,type){if("scrollend"!==type)return;const handleScrollEnd=debounce(()=>{pointers.size?handleScrollEnd():this.dispatchEvent(new Event("scrollend"))},100);addEventListener.call(this,"scroll",handleScrollEnd,{passive:!0}),scrollHandlers.set(this,handleScrollEnd)}),decorate(EventTarget.prototype,"removeEventListener",function(removeEventListener,type){if("scrollend"===type){const scrollHandler=scrollHandlers.get(this);scrollHandler&&removeEventListener.call(this,"scroll",scrollHandler,{passive:!0})}})}}})();var carousel_item_styles_default=i$7` + :host { + --aspect-ratio: inherit; + + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + width: 100%; + max-height: 100%; + aspect-ratio: var(--aspect-ratio); + scroll-snap-align: start; + scroll-snap-stop: always; + } + + ::slotted(img) { + width: 100% !important; + height: 100% !important; + object-fit: cover; + } +`,SlCarouselItem=class extends ShoelaceElement{connectedCallback(){super.connectedCallback()}render(){return x$1` <slot></slot> `}};SlCarouselItem.styles=[component_styles_default,carousel_item_styles_default],SlCarouselItem.define("sl-carousel-item");var breadcrumb_item_styles_default=i$7` + :host { + display: inline-flex; + } + + .breadcrumb-item { + display: inline-flex; + align-items: center; + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-small); + font-weight: var(--sl-font-weight-semibold); + color: var(--sl-color-neutral-600); + line-height: var(--sl-line-height-normal); + white-space: nowrap; + } + + .breadcrumb-item__label { + display: inline-block; + font-family: inherit; + font-size: inherit; + font-weight: inherit; + line-height: inherit; + text-decoration: none; + color: inherit; + background: none; + border: none; + border-radius: var(--sl-border-radius-medium); + padding: 0; + margin: 0; + cursor: pointer; + transition: var(--sl-transition-fast) --color; + } + + :host(:not(:last-of-type)) .breadcrumb-item__label { + color: var(--sl-color-primary-600); + } + + :host(:not(:last-of-type)) .breadcrumb-item__label:hover { + color: var(--sl-color-primary-500); + } + + :host(:not(:last-of-type)) .breadcrumb-item__label:active { + color: var(--sl-color-primary-600); + } + + .breadcrumb-item__label:focus { + outline: none; + } + + .breadcrumb-item__label:focus-visible { + outline: var(--sl-focus-ring); + outline-offset: var(--sl-focus-ring-offset); + } + + .breadcrumb-item__prefix, + .breadcrumb-item__suffix { + display: none; + flex: 0 0 auto; + display: flex; + align-items: center; + } + + .breadcrumb-item--has-prefix .breadcrumb-item__prefix { + display: inline-flex; + margin-inline-end: var(--sl-spacing-x-small); + } + + .breadcrumb-item--has-suffix .breadcrumb-item__suffix { + display: inline-flex; + margin-inline-start: var(--sl-spacing-x-small); + } + + :host(:last-of-type) .breadcrumb-item__separator { + display: none; + } + + .breadcrumb-item__separator { + display: inline-flex; + align-items: center; + margin: 0 var(--sl-spacing-x-small); + user-select: none; + -webkit-user-select: none; + } +`,SlBreadcrumbItem=class extends ShoelaceElement{constructor(){super(...arguments),this.hasSlotController=new HasSlotController(this,"prefix","suffix"),this.renderType="button",this.rel="noreferrer noopener"}setRenderType(){const hasDropdown=0<this.defaultSlot.assignedElements({flatten:!0}).filter(i=>"sl-dropdown"===i.tagName.toLowerCase()).length;return this.href?void(this.renderType="link"):hasDropdown?void(this.renderType="dropdown"):void(this.renderType="button")}hrefChanged(){this.setRenderType()}handleSlotChange(){this.setRenderType()}render(){return x$1` + <div + part="base" + class=${e$2({"breadcrumb-item":!0,"breadcrumb-item--has-prefix":this.hasSlotController.test("prefix"),"breadcrumb-item--has-suffix":this.hasSlotController.test("suffix")})} + > + <span part="prefix" class="breadcrumb-item__prefix"> + <slot name="prefix"></slot> + </span> + + ${"link"===this.renderType?x$1` + <a + part="label" + class="breadcrumb-item__label breadcrumb-item__label--link" + href="${this.href}" + target="${o$6(this.target?this.target:void 0)}" + rel=${o$6(this.target?this.rel:void 0)} + > + <slot @slotchange=${this.handleSlotChange}></slot> + </a> + `:""} + ${"button"===this.renderType?x$1` + <button part="label" type="button" class="breadcrumb-item__label breadcrumb-item__label--button"> + <slot @slotchange=${this.handleSlotChange}></slot> + </button> + `:""} + ${"dropdown"===this.renderType?x$1` + <div part="label" class="breadcrumb-item__label breadcrumb-item__label--drop-down"> + <slot @slotchange=${this.handleSlotChange}></slot> + </div> + `:""} + + <span part="suffix" class="breadcrumb-item__suffix"> + <slot name="suffix"></slot> + </span> + + <span part="separator" class="breadcrumb-item__separator" aria-hidden="true"> + <slot name="separator"></slot> + </span> + </div> + `}};SlBreadcrumbItem.styles=[component_styles_default,breadcrumb_item_styles_default],__decorateClass([e$6("slot:not([name])")],SlBreadcrumbItem.prototype,"defaultSlot",2),__decorateClass([r$6()],SlBreadcrumbItem.prototype,"renderType",2),__decorateClass([n$5()],SlBreadcrumbItem.prototype,"href",2),__decorateClass([n$5()],SlBreadcrumbItem.prototype,"target",2),__decorateClass([n$5()],SlBreadcrumbItem.prototype,"rel",2),__decorateClass([watch("href",{waitUntilFirstUpdate:!0})],SlBreadcrumbItem.prototype,"hrefChanged",1),SlBreadcrumbItem.define("sl-breadcrumb-item"),SlButtonGroup.define("sl-button-group");var avatar_styles_default=i$7` + :host { + display: inline-block; + + --size: 3rem; + } + + .avatar { + display: inline-flex; + align-items: center; + justify-content: center; + position: relative; + width: var(--size); + height: var(--size); + background-color: var(--sl-color-neutral-400); + font-family: var(--sl-font-sans); + font-size: calc(var(--size) * 0.5); + font-weight: var(--sl-font-weight-normal); + color: var(--sl-color-neutral-0); + user-select: none; + -webkit-user-select: none; + vertical-align: middle; + } + + .avatar--circle, + .avatar--circle .avatar__image { + border-radius: var(--sl-border-radius-circle); + } + + .avatar--rounded, + .avatar--rounded .avatar__image { + border-radius: var(--sl-border-radius-medium); + } + + .avatar--square { + border-radius: 0; + } + + .avatar__icon { + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + + .avatar__initials { + line-height: 1; + text-transform: uppercase; + } + + .avatar__image { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + object-fit: cover; + overflow: hidden; + } +`,SlAvatar=class extends ShoelaceElement{constructor(){super(...arguments),this.hasError=!1,this.image="",this.label="",this.initials="",this.loading="eager",this.shape="circle"}handleImageChange(){this.hasError=!1}handleImageLoadError(){this.hasError=!0,this.emit("sl-error")}render(){const avatarWithImage=x$1` + <img + part="image" + class="avatar__image" + src="${this.image}" + loading="${this.loading}" + alt="" + @error="${this.handleImageLoadError}" + /> + `;let avatarWithoutImage=x$1``;return avatarWithoutImage=this.initials?x$1`<div part="initials" class="avatar__initials">${this.initials}</div>`:x$1` + <div part="icon" class="avatar__icon" aria-hidden="true"> + <slot name="icon"> + <sl-icon name="person-fill" library="system"></sl-icon> + </slot> + </div> + `,x$1` + <div + part="base" + class=${e$2({avatar:!0,"avatar--circle":"circle"===this.shape,"avatar--rounded":"rounded"===this.shape,"avatar--square":"square"===this.shape})} + role="img" + aria-label=${this.label} + > + ${this.image&&!this.hasError?avatarWithImage:avatarWithoutImage} + </div> + `}};SlAvatar.styles=[component_styles_default,avatar_styles_default],SlAvatar.dependencies={"sl-icon":SlIcon},__decorateClass([r$6()],SlAvatar.prototype,"hasError",2),__decorateClass([n$5()],SlAvatar.prototype,"image",2),__decorateClass([n$5()],SlAvatar.prototype,"label",2),__decorateClass([n$5()],SlAvatar.prototype,"initials",2),__decorateClass([n$5()],SlAvatar.prototype,"loading",2),__decorateClass([n$5({reflect:!0})],SlAvatar.prototype,"shape",2),__decorateClass([watch("image")],SlAvatar.prototype,"handleImageChange",1),SlAvatar.define("sl-avatar");var breadcrumb_styles_default=i$7` + .breadcrumb { + display: flex; + align-items: center; + flex-wrap: wrap; + } +`,SlBreadcrumb=class extends ShoelaceElement{constructor(){super(...arguments),this.localize=new LocalizeController(this),this.separatorDir=this.localize.dir(),this.label=""}getSeparator(){const separator=this.separatorSlot.assignedElements({flatten:!0})[0],clone=separator.cloneNode(!0);return[clone,...clone.querySelectorAll("[id]")].forEach(el=>el.removeAttribute("id")),clone.setAttribute("data-default",""),clone.slot="separator",clone}handleSlotChange(){const items=[...this.defaultSlot.assignedElements({flatten:!0})].filter(item=>"sl-breadcrumb-item"===item.tagName.toLowerCase());items.forEach((item,index)=>{const separator=item.querySelector("[slot=\"separator\"]");if(null===separator)item.append(this.getSeparator());else if(separator.hasAttribute("data-default"))separator.replaceWith(this.getSeparator());else;index===items.length-1?item.setAttribute("aria-current","page"):item.removeAttribute("aria-current")})}render(){return this.separatorDir!==this.localize.dir()&&(this.separatorDir=this.localize.dir(),this.updateComplete.then(()=>this.handleSlotChange())),x$1` + <nav part="base" class="breadcrumb" aria-label=${this.label}> + <slot @slotchange=${this.handleSlotChange}></slot> + </nav> + + <span hidden aria-hidden="true"> + <slot name="separator"> + <sl-icon name=${"rtl"===this.localize.dir()?"chevron-left":"chevron-right"} library="system"></sl-icon> + </slot> + </span> + `}};SlBreadcrumb.styles=[component_styles_default,breadcrumb_styles_default],SlBreadcrumb.dependencies={"sl-icon":SlIcon},__decorateClass([e$6("slot")],SlBreadcrumb.prototype,"defaultSlot",2),__decorateClass([e$6("slot[name=\"separator\"]")],SlBreadcrumb.prototype,"separatorSlot",2),__decorateClass([n$5()],SlBreadcrumb.prototype,"label",2),SlBreadcrumb.define("sl-breadcrumb");var animated_image_styles_default=i$7` + :host { + --control-box-size: 3rem; + --icon-size: calc(var(--control-box-size) * 0.625); + + display: inline-flex; + position: relative; + cursor: pointer; + } + + img { + display: block; + width: 100%; + height: 100%; + } + + img[aria-hidden='true'] { + display: none; + } + + .animated-image__control-box { + display: flex; + position: absolute; + align-items: center; + justify-content: center; + top: calc(50% - var(--control-box-size) / 2); + right: calc(50% - var(--control-box-size) / 2); + width: var(--control-box-size); + height: var(--control-box-size); + font-size: var(--icon-size); + background: none; + border: solid 2px currentColor; + background-color: rgb(0 0 0 /50%); + border-radius: var(--sl-border-radius-circle); + color: white; + pointer-events: none; + transition: var(--sl-transition-fast) opacity; + } + + :host([play]:hover) .animated-image__control-box { + opacity: 1; + } + + :host([play]:not(:hover)) .animated-image__control-box { + opacity: 0; + } + + :host([play]) slot[name='play-icon'], + :host(:not([play])) slot[name='pause-icon'] { + display: none; + } +`,SlAnimatedImage=class extends ShoelaceElement{constructor(){super(...arguments),this.isLoaded=!1}handleClick(){this.play=!this.play}handleLoad(){const canvas=document.createElement("canvas"),{width,height}=this.animatedImage;canvas.width=width,canvas.height=height,canvas.getContext("2d").drawImage(this.animatedImage,0,0,width,height),this.frozenFrame=canvas.toDataURL("image/gif"),this.isLoaded||(this.emit("sl-load"),this.isLoaded=!0)}handleError(){this.emit("sl-error")}handlePlayChange(){this.play&&(this.animatedImage.src="",this.animatedImage.src=this.src)}handleSrcChange(){this.isLoaded=!1}render(){return x$1` + <div class="animated-image"> + <img + class="animated-image__animated" + src=${this.src} + alt=${this.alt} + crossorigin="anonymous" + aria-hidden=${this.play?"false":"true"} + @click=${this.handleClick} + @load=${this.handleLoad} + @error=${this.handleError} + /> + + ${this.isLoaded?x$1` + <img + class="animated-image__frozen" + src=${this.frozenFrame} + alt=${this.alt} + aria-hidden=${this.play?"true":"false"} + @click=${this.handleClick} + /> + + <div part="control-box" class="animated-image__control-box"> + <slot name="play-icon"><sl-icon name="play-fill" library="system"></sl-icon></slot> + <slot name="pause-icon"><sl-icon name="pause-fill" library="system"></sl-icon></slot> + </div> + `:""} + </div> + `}};SlAnimatedImage.styles=[component_styles_default,animated_image_styles_default],SlAnimatedImage.dependencies={"sl-icon":SlIcon},__decorateClass([e$6(".animated-image__animated")],SlAnimatedImage.prototype,"animatedImage",2),__decorateClass([r$6()],SlAnimatedImage.prototype,"frozenFrame",2),__decorateClass([r$6()],SlAnimatedImage.prototype,"isLoaded",2),__decorateClass([n$5()],SlAnimatedImage.prototype,"src",2),__decorateClass([n$5()],SlAnimatedImage.prototype,"alt",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlAnimatedImage.prototype,"play",2),__decorateClass([watch("play",{waitUntilFirstUpdate:!0})],SlAnimatedImage.prototype,"handlePlayChange",1),__decorateClass([watch("src")],SlAnimatedImage.prototype,"handleSrcChange",1),SlAnimatedImage.define("sl-animated-image");var alert_styles_default=i$7` + :host { + display: contents; + + /* For better DX, we'll reset the margin here so the base part can inherit it */ + margin: 0; + } + + .alert { + position: relative; + display: flex; + align-items: stretch; + background-color: var(--sl-panel-background-color); + border: solid var(--sl-panel-border-width) var(--sl-panel-border-color); + border-top-width: calc(var(--sl-panel-border-width) * 3); + border-radius: var(--sl-border-radius-medium); + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-small); + font-weight: var(--sl-font-weight-normal); + line-height: 1.6; + color: var(--sl-color-neutral-700); + margin: inherit; + overflow: hidden; + } + + .alert:not(.alert--has-icon) .alert__icon, + .alert:not(.alert--closable) .alert__close-button { + display: none; + } + + .alert__icon { + flex: 0 0 auto; + display: flex; + align-items: center; + font-size: var(--sl-font-size-large); + padding-inline-start: var(--sl-spacing-large); + } + + .alert--has-countdown { + border-bottom: none; + } + + .alert--primary { + border-top-color: var(--sl-color-primary-600); + } + + .alert--primary .alert__icon { + color: var(--sl-color-primary-600); + } + + .alert--success { + border-top-color: var(--sl-color-success-600); + } + + .alert--success .alert__icon { + color: var(--sl-color-success-600); + } + + .alert--neutral { + border-top-color: var(--sl-color-neutral-600); + } + + .alert--neutral .alert__icon { + color: var(--sl-color-neutral-600); + } + + .alert--warning { + border-top-color: var(--sl-color-warning-600); + } + + .alert--warning .alert__icon { + color: var(--sl-color-warning-600); + } + + .alert--danger { + border-top-color: var(--sl-color-danger-600); + } + + .alert--danger .alert__icon { + color: var(--sl-color-danger-600); + } + + .alert__message { + flex: 1 1 auto; + display: block; + padding: var(--sl-spacing-large); + overflow: hidden; + } + + .alert__close-button { + flex: 0 0 auto; + display: flex; + align-items: center; + font-size: var(--sl-font-size-medium); + margin-inline-end: var(--sl-spacing-medium); + align-self: center; + } + + .alert__countdown { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: calc(var(--sl-panel-border-width) * 3); + background-color: var(--sl-panel-border-color); + display: flex; + } + + .alert__countdown--ltr { + justify-content: flex-end; + } + + .alert__countdown .alert__countdown-elapsed { + height: 100%; + width: 0; + } + + .alert--primary .alert__countdown-elapsed { + background-color: var(--sl-color-primary-600); + } + + .alert--success .alert__countdown-elapsed { + background-color: var(--sl-color-success-600); + } + + .alert--neutral .alert__countdown-elapsed { + background-color: var(--sl-color-neutral-600); + } + + .alert--warning .alert__countdown-elapsed { + background-color: var(--sl-color-warning-600); + } + + .alert--danger .alert__countdown-elapsed { + background-color: var(--sl-color-danger-600); + } + + .alert__timer { + display: none; + } +`,_SlAlert=class _SlAlert extends ShoelaceElement{constructor(){super(...arguments),this.hasSlotController=new HasSlotController(this,"icon","suffix"),this.localize=new LocalizeController(this),this.open=!1,this.closable=!1,this.variant="primary",this.duration=1/0,this.remainingTime=this.duration}static get toastStack(){return this.currentToastStack||(this.currentToastStack=Object.assign(document.createElement("div"),{className:"sl-toast-stack"})),this.currentToastStack}firstUpdated(){this.base.hidden=!this.open}restartAutoHide(){this.handleCountdownChange(),clearTimeout(this.autoHideTimeout),clearInterval(this.remainingTimeInterval),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration),this.remainingTime=this.duration,this.remainingTimeInterval=window.setInterval(()=>{this.remainingTime-=100},100))}pauseAutoHide(){var _a;null==(_a=this.countdownAnimation)?void 0:_a.pause(),clearTimeout(this.autoHideTimeout),clearInterval(this.remainingTimeInterval)}resumeAutoHide(){var _a;this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.remainingTime),this.remainingTimeInterval=window.setInterval(()=>{this.remainingTime-=100},100),null==(_a=this.countdownAnimation)?void 0:_a.play())}handleCountdownChange(){if(this.open&&this.duration<1/0&&this.countdown){const{countdownElement}=this,start="100%",end="0";this.countdownAnimation=countdownElement.animate([{width:start},{width:end}],{duration:this.duration,easing:"linear"})}}handleCloseClick(){this.hide()}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.duration<1/0&&this.restartAutoHide(),await stopAnimations(this.base),this.base.hidden=!1;const{keyframes,options}=getAnimation(this,"alert.show",{dir:this.localize.dir()});await animateTo(this.base,keyframes,options),this.emit("sl-after-show")}else{blurActiveElement(this),this.emit("sl-hide"),clearTimeout(this.autoHideTimeout),clearInterval(this.remainingTimeInterval),await stopAnimations(this.base);const{keyframes,options}=getAnimation(this,"alert.hide",{dir:this.localize.dir()});await animateTo(this.base,keyframes,options),this.base.hidden=!0,this.emit("sl-after-hide")}}handleDurationChange(){this.restartAutoHide()}async show(){if(!this.open)return this.open=!0,waitForEvent(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,waitForEvent(this,"sl-after-hide")}async toast(){return new Promise(resolve=>{this.handleCountdownChange(),null===_SlAlert.toastStack.parentElement&&document.body.append(_SlAlert.toastStack),_SlAlert.toastStack.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sl-after-hide",()=>{_SlAlert.toastStack.removeChild(this),resolve(),null===_SlAlert.toastStack.querySelector("sl-alert")&&_SlAlert.toastStack.remove()},{once:!0})})}render(){return x$1` + <div + part="base" + class=${e$2({alert:!0,"alert--open":this.open,"alert--closable":this.closable,"alert--has-countdown":!!this.countdown,"alert--has-icon":this.hasSlotController.test("icon"),"alert--primary":"primary"===this.variant,"alert--success":"success"===this.variant,"alert--neutral":"neutral"===this.variant,"alert--warning":"warning"===this.variant,"alert--danger":"danger"===this.variant})} + role="alert" + aria-hidden=${this.open?"false":"true"} + @mouseenter=${this.pauseAutoHide} + @mouseleave=${this.resumeAutoHide} + > + <div part="icon" class="alert__icon"> + <slot name="icon"></slot> + </div> + + <div part="message" class="alert__message" aria-live="polite"> + <slot></slot> + </div> + + ${this.closable?x$1` + <sl-icon-button + part="close-button" + exportparts="base:close-button__base" + class="alert__close-button" + name="x-lg" + library="system" + label=${this.localize.term("close")} + @click=${this.handleCloseClick} + ></sl-icon-button> + `:""} + + <div role="timer" class="alert__timer">${this.remainingTime}</div> + + ${this.countdown?x$1` + <div + class=${e$2({alert__countdown:!0,"alert__countdown--ltr":"ltr"===this.countdown})} + > + <div class="alert__countdown-elapsed"></div> + </div> + `:""} + </div> + `}};_SlAlert.styles=[component_styles_default,alert_styles_default],_SlAlert.dependencies={"sl-icon-button":SlIconButton},__decorateClass([e$6("[part~=\"base\"]")],_SlAlert.prototype,"base",2),__decorateClass([e$6(".alert__countdown-elapsed")],_SlAlert.prototype,"countdownElement",2),__decorateClass([n$5({type:Boolean,reflect:!0})],_SlAlert.prototype,"open",2),__decorateClass([n$5({type:Boolean,reflect:!0})],_SlAlert.prototype,"closable",2),__decorateClass([n$5({reflect:!0})],_SlAlert.prototype,"variant",2),__decorateClass([n$5({type:Number})],_SlAlert.prototype,"duration",2),__decorateClass([n$5({type:String,reflect:!0})],_SlAlert.prototype,"countdown",2),__decorateClass([r$6()],_SlAlert.prototype,"remainingTime",2),__decorateClass([watch("open",{waitUntilFirstUpdate:!0})],_SlAlert.prototype,"handleOpenChange",1),__decorateClass([watch("duration")],_SlAlert.prototype,"handleDurationChange",1);var SlAlert=_SlAlert;setDefaultAnimation("alert.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),setDefaultAnimation("alert.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),SlAlert.define("sl-alert");const bounce=[{offset:0,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)",transform:"translate3d(0, 0, 0)"},{offset:.2,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)",transform:"translate3d(0, 0, 0)"},{offset:.4,easing:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",transform:"translate3d(0, -30px, 0) scaleY(1.1)"},{offset:.43,easing:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",transform:"translate3d(0, -30px, 0) scaleY(1.1)"},{offset:.53,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)",transform:"translate3d(0, 0, 0)"},{offset:.7,easing:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",transform:"translate3d(0, -15px, 0) scaleY(1.05)"},{offset:.8,"transition-timing-function":"cubic-bezier(0.215, 0.61, 0.355, 1)",transform:"translate3d(0, 0, 0) scaleY(0.95)"},{offset:.9,transform:"translate3d(0, -4px, 0) scaleY(1.02)"},{offset:1,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)",transform:"translate3d(0, 0, 0)"}],flash=[{offset:0,opacity:"1"},{offset:.25,opacity:"0"},{offset:.5,opacity:"1"},{offset:.75,opacity:"0"},{offset:1,opacity:"1"}],headShake=[{offset:0,transform:"translateX(0)"},{offset:.065,transform:"translateX(-6px) rotateY(-9deg)"},{offset:.185,transform:"translateX(5px) rotateY(7deg)"},{offset:.315,transform:"translateX(-3px) rotateY(-5deg)"},{offset:.435,transform:"translateX(2px) rotateY(3deg)"},{offset:.5,transform:"translateX(0)"}],heartBeat=[{offset:0,transform:"scale(1)"},{offset:.14,transform:"scale(1.3)"},{offset:.28,transform:"scale(1)"},{offset:.42,transform:"scale(1.3)"},{offset:.7,transform:"scale(1)"}],jello=[{offset:0,transform:"translate3d(0, 0, 0)"},{offset:.111,transform:"translate3d(0, 0, 0)"},{offset:.222,transform:"skewX(-12.5deg) skewY(-12.5deg)"},{offset:.33299999999999996,transform:"skewX(6.25deg) skewY(6.25deg)"},{offset:.444,transform:"skewX(-3.125deg) skewY(-3.125deg)"},{offset:.555,transform:"skewX(1.5625deg) skewY(1.5625deg)"},{offset:.6659999999999999,transform:"skewX(-0.78125deg) skewY(-0.78125deg)"},{offset:.777,transform:"skewX(0.390625deg) skewY(0.390625deg)"},{offset:.888,transform:"skewX(-0.1953125deg) skewY(-0.1953125deg)"},{offset:1,transform:"translate3d(0, 0, 0)"}],pulse=[{offset:0,transform:"scale3d(1, 1, 1)"},{offset:.5,transform:"scale3d(1.05, 1.05, 1.05)"},{offset:1,transform:"scale3d(1, 1, 1)"}],rubberBand=[{offset:0,transform:"scale3d(1, 1, 1)"},{offset:.3,transform:"scale3d(1.25, 0.75, 1)"},{offset:.4,transform:"scale3d(0.75, 1.25, 1)"},{offset:.5,transform:"scale3d(1.15, 0.85, 1)"},{offset:.65,transform:"scale3d(0.95, 1.05, 1)"},{offset:.75,transform:"scale3d(1.05, 0.95, 1)"},{offset:1,transform:"scale3d(1, 1, 1)"}],shake=[{offset:0,transform:"translate3d(0, 0, 0)"},{offset:.1,transform:"translate3d(-10px, 0, 0)"},{offset:.2,transform:"translate3d(10px, 0, 0)"},{offset:.3,transform:"translate3d(-10px, 0, 0)"},{offset:.4,transform:"translate3d(10px, 0, 0)"},{offset:.5,transform:"translate3d(-10px, 0, 0)"},{offset:.6,transform:"translate3d(10px, 0, 0)"},{offset:.7,transform:"translate3d(-10px, 0, 0)"},{offset:.8,transform:"translate3d(10px, 0, 0)"},{offset:.9,transform:"translate3d(-10px, 0, 0)"},{offset:1,transform:"translate3d(0, 0, 0)"}],shakeX=[{offset:0,transform:"translate3d(0, 0, 0)"},{offset:.1,transform:"translate3d(-10px, 0, 0)"},{offset:.2,transform:"translate3d(10px, 0, 0)"},{offset:.3,transform:"translate3d(-10px, 0, 0)"},{offset:.4,transform:"translate3d(10px, 0, 0)"},{offset:.5,transform:"translate3d(-10px, 0, 0)"},{offset:.6,transform:"translate3d(10px, 0, 0)"},{offset:.7,transform:"translate3d(-10px, 0, 0)"},{offset:.8,transform:"translate3d(10px, 0, 0)"},{offset:.9,transform:"translate3d(-10px, 0, 0)"},{offset:1,transform:"translate3d(0, 0, 0)"}],shakeY=[{offset:0,transform:"translate3d(0, 0, 0)"},{offset:.1,transform:"translate3d(0, -10px, 0)"},{offset:.2,transform:"translate3d(0, 10px, 0)"},{offset:.3,transform:"translate3d(0, -10px, 0)"},{offset:.4,transform:"translate3d(0, 10px, 0)"},{offset:.5,transform:"translate3d(0, -10px, 0)"},{offset:.6,transform:"translate3d(0, 10px, 0)"},{offset:.7,transform:"translate3d(0, -10px, 0)"},{offset:.8,transform:"translate3d(0, 10px, 0)"},{offset:.9,transform:"translate3d(0, -10px, 0)"},{offset:1,transform:"translate3d(0, 0, 0)"}],swing=[{offset:.2,transform:"rotate3d(0, 0, 1, 15deg)"},{offset:.4,transform:"rotate3d(0, 0, 1, -10deg)"},{offset:.6,transform:"rotate3d(0, 0, 1, 5deg)"},{offset:.8,transform:"rotate3d(0, 0, 1, -5deg)"},{offset:1,transform:"rotate3d(0, 0, 1, 0deg)"}],tada=[{offset:0,transform:"scale3d(1, 1, 1)"},{offset:.1,transform:"scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg)"},{offset:.2,transform:"scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg)"},{offset:.3,transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)"},{offset:.4,transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)"},{offset:.5,transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)"},{offset:.6,transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)"},{offset:.7,transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)"},{offset:.8,transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)"},{offset:.9,transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)"},{offset:1,transform:"scale3d(1, 1, 1)"}],wobble=[{offset:0,transform:"translate3d(0, 0, 0)"},{offset:.15,transform:"translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg)"},{offset:.3,transform:"translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg)"},{offset:.45,transform:"translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg)"},{offset:.6,transform:"translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg)"},{offset:.75,transform:"translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg)"},{offset:1,transform:"translate3d(0, 0, 0)"}],backInDown=[{offset:0,transform:"translateY(-1200px) scale(0.7)",opacity:"0.7"},{offset:.8,transform:"translateY(0px) scale(0.7)",opacity:"0.7"},{offset:1,transform:"scale(1)",opacity:"1"}],backInLeft=[{offset:0,transform:"translateX(-2000px) scale(0.7)",opacity:"0.7"},{offset:.8,transform:"translateX(0px) scale(0.7)",opacity:"0.7"},{offset:1,transform:"scale(1)",opacity:"1"}],backInRight=[{offset:0,transform:"translateX(2000px) scale(0.7)",opacity:"0.7"},{offset:.8,transform:"translateX(0px) scale(0.7)",opacity:"0.7"},{offset:1,transform:"scale(1)",opacity:"1"}],backInUp=[{offset:0,transform:"translateY(1200px) scale(0.7)",opacity:"0.7"},{offset:.8,transform:"translateY(0px) scale(0.7)",opacity:"0.7"},{offset:1,transform:"scale(1)",opacity:"1"}],backOutDown=[{offset:0,transform:"scale(1)",opacity:"1"},{offset:.2,transform:"translateY(0px) scale(0.7)",opacity:"0.7"},{offset:1,transform:"translateY(700px) scale(0.7)",opacity:"0.7"}],backOutLeft=[{offset:0,transform:"scale(1)",opacity:"1"},{offset:.2,transform:"translateX(0px) scale(0.7)",opacity:"0.7"},{offset:1,transform:"translateX(-2000px) scale(0.7)",opacity:"0.7"}],backOutRight=[{offset:0,transform:"scale(1)",opacity:"1"},{offset:.2,transform:"translateX(0px) scale(0.7)",opacity:"0.7"},{offset:1,transform:"translateX(2000px) scale(0.7)",opacity:"0.7"}],backOutUp=[{offset:0,transform:"scale(1)",opacity:"1"},{offset:.2,transform:"translateY(0px) scale(0.7)",opacity:"0.7"},{offset:1,transform:"translateY(-700px) scale(0.7)",opacity:"0.7"}],bounceIn=[{offset:0,opacity:"0",transform:"scale3d(0.3, 0.3, 0.3)"},{offset:0,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.2,transform:"scale3d(1.1, 1.1, 1.1)"},{offset:.2,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.4,transform:"scale3d(0.9, 0.9, 0.9)"},{offset:.4,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.6,opacity:"1",transform:"scale3d(1.03, 1.03, 1.03)"},{offset:.6,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.8,transform:"scale3d(0.97, 0.97, 0.97)"},{offset:.8,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:1,opacity:"1",transform:"scale3d(1, 1, 1)"},{offset:1,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"}],bounceInDown=[{offset:0,opacity:"0",transform:"translate3d(0, -3000px, 0) scaleY(3)"},{offset:0,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.6,opacity:"1",transform:"translate3d(0, 25px, 0) scaleY(0.9)"},{offset:.6,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.75,transform:"translate3d(0, -10px, 0) scaleY(0.95)"},{offset:.75,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.9,transform:"translate3d(0, 5px, 0) scaleY(0.985)"},{offset:.9,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:1,transform:"translate3d(0, 0, 0)"},{offset:1,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"}],bounceInLeft=[{offset:0,opacity:"0",transform:"translate3d(-3000px, 0, 0) scaleX(3)"},{offset:0,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.6,opacity:"1",transform:"translate3d(25px, 0, 0) scaleX(1)"},{offset:.6,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.75,transform:"translate3d(-10px, 0, 0) scaleX(0.98)"},{offset:.75,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.9,transform:"translate3d(5px, 0, 0) scaleX(0.995)"},{offset:.9,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:1,transform:"translate3d(0, 0, 0)"},{offset:1,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"}],bounceInRight=[{offset:0,opacity:"0",transform:"translate3d(3000px, 0, 0) scaleX(3)"},{offset:0,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.6,opacity:"1",transform:"translate3d(-25px, 0, 0) scaleX(1)"},{offset:.6,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.75,transform:"translate3d(10px, 0, 0) scaleX(0.98)"},{offset:.75,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.9,transform:"translate3d(-5px, 0, 0) scaleX(0.995)"},{offset:.9,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:1,transform:"translate3d(0, 0, 0)"},{offset:1,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"}],bounceInUp=[{offset:0,opacity:"0",transform:"translate3d(0, 3000px, 0) scaleY(5)"},{offset:0,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.6,opacity:"1",transform:"translate3d(0, -20px, 0) scaleY(0.9)"},{offset:.6,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.75,transform:"translate3d(0, 10px, 0) scaleY(0.95)"},{offset:.75,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:.9,transform:"translate3d(0, -5px, 0) scaleY(0.985)"},{offset:.9,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"},{offset:1,transform:"translate3d(0, 0, 0)"},{offset:1,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)"}],bounceOut=[{offset:.2,transform:"scale3d(0.9, 0.9, 0.9)"},{offset:.5,opacity:"1",transform:"scale3d(1.1, 1.1, 1.1)"},{offset:.55,opacity:"1",transform:"scale3d(1.1, 1.1, 1.1)"},{offset:1,opacity:"0",transform:"scale3d(0.3, 0.3, 0.3)"}],bounceOutDown=[{offset:.2,transform:"translate3d(0, 10px, 0) scaleY(0.985)"},{offset:.4,opacity:"1",transform:"translate3d(0, -20px, 0) scaleY(0.9)"},{offset:.45,opacity:"1",transform:"translate3d(0, -20px, 0) scaleY(0.9)"},{offset:1,opacity:"0",transform:"translate3d(0, 2000px, 0) scaleY(3)"}],bounceOutLeft=[{offset:.2,opacity:"1",transform:"translate3d(20px, 0, 0) scaleX(0.9)"},{offset:1,opacity:"0",transform:"translate3d(-2000px, 0, 0) scaleX(2)"}],bounceOutRight=[{offset:.2,opacity:"1",transform:"translate3d(-20px, 0, 0) scaleX(0.9)"},{offset:1,opacity:"0",transform:"translate3d(2000px, 0, 0) scaleX(2)"}],bounceOutUp=[{offset:.2,transform:"translate3d(0, -10px, 0) scaleY(0.985)"},{offset:.4,opacity:"1",transform:"translate3d(0, 20px, 0) scaleY(0.9)"},{offset:.45,opacity:"1",transform:"translate3d(0, 20px, 0) scaleY(0.9)"},{offset:1,opacity:"0",transform:"translate3d(0, -2000px, 0) scaleY(3)"}],fadeIn=[{offset:0,opacity:"0"},{offset:1,opacity:"1"}],fadeInBottomLeft=[{offset:0,opacity:"0",transform:"translate3d(-100%, 100%, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInBottomRight=[{offset:0,opacity:"0",transform:"translate3d(100%, 100%, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInDown=[{offset:0,opacity:"0",transform:"translate3d(0, -100%, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInDownBig=[{offset:0,opacity:"0",transform:"translate3d(0, -2000px, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInLeft=[{offset:0,opacity:"0",transform:"translate3d(-100%, 0, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInLeftBig=[{offset:0,opacity:"0",transform:"translate3d(-2000px, 0, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInRight=[{offset:0,opacity:"0",transform:"translate3d(100%, 0, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInRightBig=[{offset:0,opacity:"0",transform:"translate3d(2000px, 0, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInTopLeft=[{offset:0,opacity:"0",transform:"translate3d(-100%, -100%, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInTopRight=[{offset:0,opacity:"0",transform:"translate3d(100%, -100%, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInUp=[{offset:0,opacity:"0",transform:"translate3d(0, 100%, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeInUpBig=[{offset:0,opacity:"0",transform:"translate3d(0, 2000px, 0)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],fadeOut=[{offset:0,opacity:"1"},{offset:1,opacity:"0"}],fadeOutBottomLeft=[{offset:0,opacity:"1",transform:"translate3d(0, 0, 0)"},{offset:1,opacity:"0",transform:"translate3d(-100%, 100%, 0)"}],fadeOutBottomRight=[{offset:0,opacity:"1",transform:"translate3d(0, 0, 0)"},{offset:1,opacity:"0",transform:"translate3d(100%, 100%, 0)"}],fadeOutDown=[{offset:0,opacity:"1"},{offset:1,opacity:"0",transform:"translate3d(0, 100%, 0)"}],fadeOutDownBig=[{offset:0,opacity:"1"},{offset:1,opacity:"0",transform:"translate3d(0, 2000px, 0)"}],fadeOutLeft=[{offset:0,opacity:"1"},{offset:1,opacity:"0",transform:"translate3d(-100%, 0, 0)"}],fadeOutLeftBig=[{offset:0,opacity:"1"},{offset:1,opacity:"0",transform:"translate3d(-2000px, 0, 0)"}],fadeOutRight=[{offset:0,opacity:"1"},{offset:1,opacity:"0",transform:"translate3d(100%, 0, 0)"}],fadeOutRightBig=[{offset:0,opacity:"1"},{offset:1,opacity:"0",transform:"translate3d(2000px, 0, 0)"}],fadeOutTopLeft=[{offset:0,opacity:"1",transform:"translate3d(0, 0, 0)"},{offset:1,opacity:"0",transform:"translate3d(-100%, -100%, 0)"}],fadeOutTopRight=[{offset:0,opacity:"1",transform:"translate3d(0, 0, 0)"},{offset:1,opacity:"0",transform:"translate3d(100%, -100%, 0)"}],fadeOutUp=[{offset:0,opacity:"1"},{offset:1,opacity:"0",transform:"translate3d(0, -100%, 0)"}],fadeOutUpBig=[{offset:0,opacity:"1"},{offset:1,opacity:"0",transform:"translate3d(0, -2000px, 0)"}],flip=[{offset:0,transform:"perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg)",easing:"ease-out"},{offset:.4,transform:"perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)\n rotate3d(0, 1, 0, -190deg)",easing:"ease-out"},{offset:.5,transform:"perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)\n rotate3d(0, 1, 0, -170deg)",easing:"ease-in"},{offset:.8,transform:"perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0)\n rotate3d(0, 1, 0, 0deg)",easing:"ease-in"},{offset:1,transform:"perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg)",easing:"ease-in"}],flipInX=[{offset:0,transform:"perspective(400px) rotate3d(1, 0, 0, 90deg)",easing:"ease-in",opacity:"0"},{offset:.4,transform:"perspective(400px) rotate3d(1, 0, 0, -20deg)",easing:"ease-in"},{offset:.6,transform:"perspective(400px) rotate3d(1, 0, 0, 10deg)",opacity:"1"},{offset:.8,transform:"perspective(400px) rotate3d(1, 0, 0, -5deg)"},{offset:1,transform:"perspective(400px)"}],flipInY=[{offset:0,transform:"perspective(400px) rotate3d(0, 1, 0, 90deg)",easing:"ease-in",opacity:"0"},{offset:.4,transform:"perspective(400px) rotate3d(0, 1, 0, -20deg)",easing:"ease-in"},{offset:.6,transform:"perspective(400px) rotate3d(0, 1, 0, 10deg)",opacity:"1"},{offset:.8,transform:"perspective(400px) rotate3d(0, 1, 0, -5deg)"},{offset:1,transform:"perspective(400px)"}],flipOutX=[{offset:0,transform:"perspective(400px)"},{offset:.3,transform:"perspective(400px) rotate3d(1, 0, 0, -20deg)",opacity:"1"},{offset:1,transform:"perspective(400px) rotate3d(1, 0, 0, 90deg)",opacity:"0"}],flipOutY=[{offset:0,transform:"perspective(400px)"},{offset:.3,transform:"perspective(400px) rotate3d(0, 1, 0, -15deg)",opacity:"1"},{offset:1,transform:"perspective(400px) rotate3d(0, 1, 0, 90deg)",opacity:"0"}],lightSpeedInLeft=[{offset:0,transform:"translate3d(-100%, 0, 0) skewX(30deg)",opacity:"0"},{offset:.6,transform:"skewX(-20deg)",opacity:"1"},{offset:.8,transform:"skewX(5deg)"},{offset:1,transform:"translate3d(0, 0, 0)"}],lightSpeedInRight=[{offset:0,transform:"translate3d(100%, 0, 0) skewX(-30deg)",opacity:"0"},{offset:.6,transform:"skewX(20deg)",opacity:"1"},{offset:.8,transform:"skewX(-5deg)"},{offset:1,transform:"translate3d(0, 0, 0)"}],lightSpeedOutLeft=[{offset:0,opacity:"1"},{offset:1,transform:"translate3d(-100%, 0, 0) skewX(-30deg)",opacity:"0"}],lightSpeedOutRight=[{offset:0,opacity:"1"},{offset:1,transform:"translate3d(100%, 0, 0) skewX(30deg)",opacity:"0"}],rotateIn=[{offset:0,transform:"rotate3d(0, 0, 1, -200deg)",opacity:"0"},{offset:1,transform:"translate3d(0, 0, 0)",opacity:"1"}],rotateInDownLeft=[{offset:0,transform:"rotate3d(0, 0, 1, -45deg)",opacity:"0"},{offset:1,transform:"translate3d(0, 0, 0)",opacity:"1"}],rotateInDownRight=[{offset:0,transform:"rotate3d(0, 0, 1, 45deg)",opacity:"0"},{offset:1,transform:"translate3d(0, 0, 0)",opacity:"1"}],rotateInUpLeft=[{offset:0,transform:"rotate3d(0, 0, 1, 45deg)",opacity:"0"},{offset:1,transform:"translate3d(0, 0, 0)",opacity:"1"}],rotateInUpRight=[{offset:0,transform:"rotate3d(0, 0, 1, -90deg)",opacity:"0"},{offset:1,transform:"translate3d(0, 0, 0)",opacity:"1"}],rotateOut=[{offset:0,opacity:"1"},{offset:1,transform:"rotate3d(0, 0, 1, 200deg)",opacity:"0"}],rotateOutDownLeft=[{offset:0,opacity:"1"},{offset:1,transform:"rotate3d(0, 0, 1, 45deg)",opacity:"0"}],rotateOutDownRight=[{offset:0,opacity:"1"},{offset:1,transform:"rotate3d(0, 0, 1, -45deg)",opacity:"0"}],rotateOutUpLeft=[{offset:0,opacity:"1"},{offset:1,transform:"rotate3d(0, 0, 1, -45deg)",opacity:"0"}],rotateOutUpRight=[{offset:0,opacity:"1"},{offset:1,transform:"rotate3d(0, 0, 1, 90deg)",opacity:"0"}],slideInDown=[{offset:0,transform:"translate3d(0, -100%, 0)",visibility:"visible"},{offset:1,transform:"translate3d(0, 0, 0)"}],slideInLeft=[{offset:0,transform:"translate3d(-100%, 0, 0)",visibility:"visible"},{offset:1,transform:"translate3d(0, 0, 0)"}],slideInRight=[{offset:0,transform:"translate3d(100%, 0, 0)",visibility:"visible"},{offset:1,transform:"translate3d(0, 0, 0)"}],slideInUp=[{offset:0,transform:"translate3d(0, 100%, 0)",visibility:"visible"},{offset:1,transform:"translate3d(0, 0, 0)"}],slideOutDown=[{offset:0,transform:"translate3d(0, 0, 0)"},{offset:1,visibility:"hidden",transform:"translate3d(0, 100%, 0)"}],slideOutLeft=[{offset:0,transform:"translate3d(0, 0, 0)"},{offset:1,visibility:"hidden",transform:"translate3d(-100%, 0, 0)"}],slideOutRight=[{offset:0,transform:"translate3d(0, 0, 0)"},{offset:1,visibility:"hidden",transform:"translate3d(100%, 0, 0)"}],slideOutUp=[{offset:0,transform:"translate3d(0, 0, 0)"},{offset:1,visibility:"hidden",transform:"translate3d(0, -100%, 0)"}],hinge=[{offset:0,easing:"ease-in-out"},{offset:.2,transform:"rotate3d(0, 0, 1, 80deg)",easing:"ease-in-out"},{offset:.4,transform:"rotate3d(0, 0, 1, 60deg)",easing:"ease-in-out",opacity:"1"},{offset:.6,transform:"rotate3d(0, 0, 1, 80deg)",easing:"ease-in-out"},{offset:.8,transform:"rotate3d(0, 0, 1, 60deg)",easing:"ease-in-out",opacity:"1"},{offset:1,transform:"translate3d(0, 700px, 0)",opacity:"0"}],jackInTheBox=[{offset:0,opacity:"0",transform:"scale(0.1) rotate(30deg)","transform-origin":"center bottom"},{offset:.5,transform:"rotate(-10deg)"},{offset:.7,transform:"rotate(3deg)"},{offset:1,opacity:"1",transform:"scale(1)"}],rollIn=[{offset:0,opacity:"0",transform:"translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg)"},{offset:1,opacity:"1",transform:"translate3d(0, 0, 0)"}],rollOut=[{offset:0,opacity:"1"},{offset:1,opacity:"0",transform:"translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg)"}],zoomIn=[{offset:0,opacity:"0",transform:"scale3d(0.3, 0.3, 0.3)"},{offset:.5,opacity:"1"}],zoomInDown=[{offset:0,opacity:"0",transform:"scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0)",easing:"cubic-bezier(0.55, 0.055, 0.675, 0.19)"},{offset:.6,opacity:"1",transform:"scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0)",easing:"cubic-bezier(0.175, 0.885, 0.32, 1)"}],zoomInLeft=[{offset:0,opacity:"0",transform:"scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0)",easing:"cubic-bezier(0.55, 0.055, 0.675, 0.19)"},{offset:.6,opacity:"1",transform:"scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0)",easing:"cubic-bezier(0.175, 0.885, 0.32, 1)"}],zoomInRight=[{offset:0,opacity:"0",transform:"scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0)",easing:"cubic-bezier(0.55, 0.055, 0.675, 0.19)"},{offset:.6,opacity:"1",transform:"scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0)",easing:"cubic-bezier(0.175, 0.885, 0.32, 1)"}],zoomInUp=[{offset:0,opacity:"0",transform:"scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0)",easing:"cubic-bezier(0.55, 0.055, 0.675, 0.19)"},{offset:.6,opacity:"1",transform:"scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0)",easing:"cubic-bezier(0.175, 0.885, 0.32, 1)"}],zoomOut=[{offset:0,opacity:"1"},{offset:.5,opacity:"0",transform:"scale3d(0.3, 0.3, 0.3)"},{offset:1,opacity:"0"}],zoomOutDown=[{offset:.4,opacity:"1",transform:"scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0)",easing:"cubic-bezier(0.55, 0.055, 0.675, 0.19)"},{offset:1,opacity:"0",transform:"scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0)",easing:"cubic-bezier(0.175, 0.885, 0.32, 1)"}],zoomOutLeft=[{offset:.4,opacity:"1",transform:"scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0)"},{offset:1,opacity:"0",transform:"scale(0.1) translate3d(-2000px, 0, 0)"}],zoomOutRight=[{offset:.4,opacity:"1",transform:"scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0)"},{offset:1,opacity:"0",transform:"scale(0.1) translate3d(2000px, 0, 0)"}],zoomOutUp=[{offset:.4,opacity:"1",transform:"scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0)",easing:"cubic-bezier(0.55, 0.055, 0.675, 0.19)"},{offset:1,opacity:"0",transform:"scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0)",easing:"cubic-bezier(0.175, 0.885, 0.32, 1)"}],easings={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",easeInSine:"cubic-bezier(0.47, 0, 0.745, 0.715)",easeOutSine:"cubic-bezier(0.39, 0.575, 0.565, 1)",easeInOutSine:"cubic-bezier(0.445, 0.05, 0.55, 0.95)",easeInQuad:"cubic-bezier(0.55, 0.085, 0.68, 0.53)",easeOutQuad:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",easeInOutQuad:"cubic-bezier(0.455, 0.03, 0.515, 0.955)",easeInCubic:"cubic-bezier(0.55, 0.055, 0.675, 0.19)",easeOutCubic:"cubic-bezier(0.215, 0.61, 0.355, 1)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1)",easeInQuart:"cubic-bezier(0.895, 0.03, 0.685, 0.22)",easeOutQuart:"cubic-bezier(0.165, 0.84, 0.44, 1)",easeInOutQuart:"cubic-bezier(0.77, 0, 0.175, 1)",easeInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",easeOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",easeInOutQuint:"cubic-bezier(0.86, 0, 0.07, 1)",easeInExpo:"cubic-bezier(0.95, 0.05, 0.795, 0.035)",easeOutExpo:"cubic-bezier(0.19, 1, 0.22, 1)",easeInOutExpo:"cubic-bezier(1, 0, 0, 1)",easeInCirc:"cubic-bezier(0.6, 0.04, 0.98, 0.335)",easeOutCirc:"cubic-bezier(0.075, 0.82, 0.165, 1)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.15, 0.86)",easeInBack:"cubic-bezier(0.6, -0.28, 0.735, 0.045)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",easeInOutBack:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"};var animations=Object.freeze({__proto__:null,backInDown:backInDown,backInLeft:backInLeft,backInRight:backInRight,backInUp:backInUp,backOutDown:backOutDown,backOutLeft:backOutLeft,backOutRight:backOutRight,backOutUp:backOutUp,bounce:bounce,bounceIn:bounceIn,bounceInDown:bounceInDown,bounceInLeft:bounceInLeft,bounceInRight:bounceInRight,bounceInUp:bounceInUp,bounceOut:bounceOut,bounceOutDown:bounceOutDown,bounceOutLeft:bounceOutLeft,bounceOutRight:bounceOutRight,bounceOutUp:bounceOutUp,easings:easings,fadeIn:fadeIn,fadeInBottomLeft:fadeInBottomLeft,fadeInBottomRight:fadeInBottomRight,fadeInDown:fadeInDown,fadeInDownBig:fadeInDownBig,fadeInLeft:fadeInLeft,fadeInLeftBig:fadeInLeftBig,fadeInRight:fadeInRight,fadeInRightBig:fadeInRightBig,fadeInTopLeft:fadeInTopLeft,fadeInTopRight:fadeInTopRight,fadeInUp:fadeInUp,fadeInUpBig:fadeInUpBig,fadeOut:fadeOut,fadeOutBottomLeft:fadeOutBottomLeft,fadeOutBottomRight:fadeOutBottomRight,fadeOutDown:fadeOutDown,fadeOutDownBig:fadeOutDownBig,fadeOutLeft:fadeOutLeft,fadeOutLeftBig:fadeOutLeftBig,fadeOutRight:fadeOutRight,fadeOutRightBig:fadeOutRightBig,fadeOutTopLeft:fadeOutTopLeft,fadeOutTopRight:fadeOutTopRight,fadeOutUp:fadeOutUp,fadeOutUpBig:fadeOutUpBig,flash:flash,flip:flip,flipInX:flipInX,flipInY:flipInY,flipOutX:flipOutX,flipOutY:flipOutY,headShake:headShake,heartBeat:heartBeat,hinge:hinge,jackInTheBox:jackInTheBox,jello:jello,lightSpeedInLeft:lightSpeedInLeft,lightSpeedInRight:lightSpeedInRight,lightSpeedOutLeft:lightSpeedOutLeft,lightSpeedOutRight:lightSpeedOutRight,pulse:pulse,rollIn:rollIn,rollOut:rollOut,rotateIn:rotateIn,rotateInDownLeft:rotateInDownLeft,rotateInDownRight:rotateInDownRight,rotateInUpLeft:rotateInUpLeft,rotateInUpRight:rotateInUpRight,rotateOut:rotateOut,rotateOutDownLeft:rotateOutDownLeft,rotateOutDownRight:rotateOutDownRight,rotateOutUpLeft:rotateOutUpLeft,rotateOutUpRight:rotateOutUpRight,rubberBand:rubberBand,shake:shake,shakeX:shakeX,shakeY:shakeY,slideInDown:slideInDown,slideInLeft:slideInLeft,slideInRight:slideInRight,slideInUp:slideInUp,slideOutDown:slideOutDown,slideOutLeft:slideOutLeft,slideOutRight:slideOutRight,slideOutUp:slideOutUp,swing:swing,tada:tada,wobble:wobble,zoomIn:zoomIn,zoomInDown:zoomInDown,zoomInLeft:zoomInLeft,zoomInRight:zoomInRight,zoomInUp:zoomInUp,zoomOut:zoomOut,zoomOutDown:zoomOutDown,zoomOutLeft:zoomOutLeft,zoomOutRight:zoomOutRight,zoomOutUp:zoomOutUp}),animation_styles_default=i$7` + :host { + display: contents; + } +`,SlAnimation=class extends ShoelaceElement{constructor(){super(...arguments),this.hasStarted=!1,this.name="none",this.play=!1,this.delay=0,this.direction="normal",this.duration=1e3,this.easing="linear",this.endDelay=0,this.fill="auto",this.iterations=1/0,this.iterationStart=0,this.playbackRate=1,this.handleAnimationFinish=()=>{this.play=!1,this.hasStarted=!1,this.emit("sl-finish")},this.handleAnimationCancel=()=>{this.play=!1,this.hasStarted=!1,this.emit("sl-cancel")}}get currentTime(){var _a,_b;return null==(_b=null==(_a=this.animation)?void 0:_a.currentTime)?0:_b}set currentTime(time){this.animation&&(this.animation.currentTime=time)}connectedCallback(){super.connectedCallback(),this.createAnimation()}disconnectedCallback(){super.disconnectedCallback(),this.destroyAnimation()}handleSlotChange(){this.destroyAnimation(),this.createAnimation()}async createAnimation(){var _a,_b;const easing=null==(_a=easings[this.easing])?this.easing:_a,keyframes=null==(_b=this.keyframes)?animations[this.name]:_b,slot=await this.defaultSlot,element=slot.assignedElements()[0];return!!(element&&keyframes)&&(this.destroyAnimation(),this.animation=element.animate(keyframes,{delay:this.delay,direction:this.direction,duration:this.duration,easing,endDelay:this.endDelay,fill:this.fill,iterationStart:this.iterationStart,iterations:this.iterations}),this.animation.playbackRate=this.playbackRate,this.animation.addEventListener("cancel",this.handleAnimationCancel),this.animation.addEventListener("finish",this.handleAnimationFinish),this.play?(this.hasStarted=!0,this.emit("sl-start")):this.animation.pause(),!0)}destroyAnimation(){this.animation&&(this.animation.cancel(),this.animation.removeEventListener("cancel",this.handleAnimationCancel),this.animation.removeEventListener("finish",this.handleAnimationFinish),this.hasStarted=!1)}handleAnimationChange(){this.hasUpdated&&this.createAnimation()}handlePlayChange(){return!!this.animation&&(this.play&&!this.hasStarted&&(this.hasStarted=!0,this.emit("sl-start")),this.play?this.animation.play():this.animation.pause(),!0)}handlePlaybackRateChange(){this.animation&&(this.animation.playbackRate=this.playbackRate)}cancel(){var _a;null==(_a=this.animation)?void 0:_a.cancel()}finish(){var _a;null==(_a=this.animation)?void 0:_a.finish()}render(){return x$1` <slot @slotchange=${this.handleSlotChange}></slot> `}};SlAnimation.styles=[component_styles_default,animation_styles_default],__decorateClass([r$4("slot")],SlAnimation.prototype,"defaultSlot",2),__decorateClass([n$5()],SlAnimation.prototype,"name",2),__decorateClass([n$5({type:Boolean,reflect:!0})],SlAnimation.prototype,"play",2),__decorateClass([n$5({type:Number})],SlAnimation.prototype,"delay",2),__decorateClass([n$5()],SlAnimation.prototype,"direction",2),__decorateClass([n$5({type:Number})],SlAnimation.prototype,"duration",2),__decorateClass([n$5()],SlAnimation.prototype,"easing",2),__decorateClass([n$5({attribute:"end-delay",type:Number})],SlAnimation.prototype,"endDelay",2),__decorateClass([n$5()],SlAnimation.prototype,"fill",2),__decorateClass([n$5({type:Number})],SlAnimation.prototype,"iterations",2),__decorateClass([n$5({attribute:"iteration-start",type:Number})],SlAnimation.prototype,"iterationStart",2),__decorateClass([n$5({attribute:!1})],SlAnimation.prototype,"keyframes",2),__decorateClass([n$5({attribute:"playback-rate",type:Number})],SlAnimation.prototype,"playbackRate",2),__decorateClass([watch(["name","delay","direction","duration","easing","endDelay","fill","iterations","iterationsStart","keyframes"])],SlAnimation.prototype,"handleAnimationChange",1),__decorateClass([watch("play")],SlAnimation.prototype,"handlePlayChange",1),__decorateClass([watch("playbackRate")],SlAnimation.prototype,"handlePlaybackRateChange",1),SlAnimation.define("sl-animation");var __decorate$f=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashTypeahead=class ChromedashTypeahead extends i$4{constructor(){super(...arguments),this.slDropdownRef=e$1(),this.slInputRef=e$1(),this.value="",this.candidates=[],this.prefix=null,this.chunkStart=0,this.chunkEnd=0,this.wasDismissed=!1,this.termWasCompleted=!1,this.placeholder=""}static get styles(){return[...SHARED_STYLES,i$7` + chromedash-typeahead-dropdown { + width: 100%; + } + #inputfield::part(base) { + background: #eee; + border: none; + border-radius: 8px; + } + `]}_fireEvent(eventName,detail){const event=new CustomEvent(eventName,{bubbles:!0,composed:!0,detail});this.dispatchEvent(event)}reflectValue(event){event&&event.stopPropagation();const slInput=this.slInputRef.value;this.value=slInput.value}hide(){this.slDropdownRef.value.hide()}show(){this.slDropdownRef.value.show()}focus(){const slInput=this.slInputRef.value;slInput?.focus()}blur(){const slInput=this.slInputRef.value;slInput?.blur()}findPrefix(){const inputEl=this.slInputRef.value?.input;if(!inputEl)return;const wholeStr=inputEl.value,caret=inputEl.selectionStart||0;return caret==inputEl.selectionEnd?void(this.chunkStart=wholeStr.lastIndexOf(" ",caret-1)+1,this.chunkEnd=wholeStr.indexOf(" ",caret),-1===this.chunkEnd&&(this.chunkEnd=wholeStr.length),this.prefix=wholeStr.substring(this.chunkStart,caret)):void(this.prefix=null)}shouldShowCandidate(candidate,prefix){if(null===prefix)return!1;prefix=prefix.toLowerCase();const lowerName=candidate.name.toLowerCase(),lowerDoc=candidate.doc.toLowerCase();return lowerName.split(/\s+/).some(w=>w.startsWith(prefix))||lowerDoc.split(/\s+/).some(w=>w.startsWith(prefix))||lowerName.split(/\W+/).some(w=>w.startsWith(prefix))||lowerDoc.split(/\W+/).some(w=>w.startsWith(prefix))}shouldGroup(s){if(null===s)return!0;const COMPARE_OPS=["=",":","<",">"];return!COMPARE_OPS.some(op=>s.includes(op))}groupCandidates(candidates){const groupsSeen=new Set,groupsSeenTwice=new Set;for(const c of candidates)groupsSeen.has(c.group)?groupsSeenTwice.add(c.group):groupsSeen.add(c.group);const groupsSeenTwiceProcessed=new Set,result=[];for(const c of candidates)groupsSeenTwice.has(c.group)?groupsSeenTwiceProcessed.has(c.group)||(result.push({group:c.group,name:c.group+":",doc:c.doc}),groupsSeenTwiceProcessed.add(c.group)):result.push(c);return result}async handleCandidateSelected(e){const candidateValue=e.detail.item.value,inputEl=this.slInputRef.value?.renderRoot.querySelector("input");if(!inputEl)return;const wholeStr=inputEl.value,newWholeStr=wholeStr.substring(0,this.chunkStart)+candidateValue+wholeStr.substring(this.chunkEnd,wholeStr.length);this.slInputRef.value.value=newWholeStr,this.reflectValue(),await this.updateComplete,this.chunkStart+=candidateValue.length,this.chunkEnd=this.chunkStart,inputEl.selectionStart=this.chunkStart,inputEl.selectionEnd=this.chunkEnd;const possibleExtensions=this.vocabulary.filter(c=>c.name.startsWith(candidateValue));this.termWasCompleted=1>=possibleExtensions.length,this.calcCandidates(),inputEl.focus()}handleInputFieldKeyDown(event){if("Enter"===event.key){const slDropdown=this.slDropdownRef.value;if(!slDropdown)return;const currentItem=slDropdown.getCurrentItem();slDropdown.open&¤tItem||(this._fireEvent("sl-change",this),event.stopPropagation())}}handleInputFieldKeyUp(event){return["Escape"].includes(event.key)?void(this.wasDismissed=!0):["ArrowDown","ArrowUp","Enter"].includes(event.key)?void(this.wasDismissed=!1):void(this.termWasCompleted=!1,this.calcCandidates())}calcCandidates(event){event&&event.stopPropagation(),this.findPrefix(),this.candidates=this.vocabulary.filter(c=>this.shouldShowCandidate(c,this.prefix)),this.shouldGroup(this.prefix)&&(this.candidates=this.groupCandidates(this.candidates));const slDropdown=this.slDropdownRef.value;slDropdown&&(!(0<this.candidates.length)||this.wasDismissed||this.termWasCompleted?slDropdown.hide():slDropdown.show())}renderInputField(){return x$1` + <sl-input + id="inputfield" + slot="trigger" + placeholder=${this.placeholder} + value=${l(this.value)} + ${n$2(this.slInputRef)} + autocomplete="off" + spellcheck="false" + @keydown="${this.handleInputFieldKeyDown}" + @keyup="${this.handleInputFieldKeyUp}" + @focus="${this.calcCandidates}" + @click="${this.calcCandidates}" + @sl-change="${this.reflectValue}" + @sl-input="${this.reflectValue}" + > + <slot name="prefix" slot="prefix"></slot> + <slot name="suffix" slot="suffix"></slot> + </sl-input> + `}renderAutocompleteMenu(){const nonselectableItem=x$1` + <chromedash-typeahead-invisible-item></chromedash-typeahead-invisible-item> + `;return x$1` + <sl-menu + @click=${e=>e.preventDefault()} + @sl-select=${this.handleCandidateSelected} + > + ${nonselectableItem} + ${this.candidates.map(c=>x$1` + <chromedash-typeahead-item + value=${c.name} + doc=${c.doc} + prefix=${this.prefix??E$1} + ></chromedash-typeahead-item> + `)} + </sl-menu> + `}render(){return x$1` + <chromedash-typeahead-dropdown + stay-open-on-select + sync="width" + ${n$2(this.slDropdownRef)} + > + ${this.renderInputField()} ${this.renderAutocompleteMenu()} + </chromedash-typeahead-dropdown> + `}};__decorate$f([n$5()],ChromedashTypeahead.prototype,"value",void 0),__decorate$f([r$6()],ChromedashTypeahead.prototype,"candidates",void 0),__decorate$f([r$6()],ChromedashTypeahead.prototype,"prefix",void 0),__decorate$f([r$6()],ChromedashTypeahead.prototype,"chunkStart",void 0),__decorate$f([r$6()],ChromedashTypeahead.prototype,"chunkEnd",void 0),__decorate$f([r$6()],ChromedashTypeahead.prototype,"wasDismissed",void 0),__decorate$f([r$6()],ChromedashTypeahead.prototype,"termWasCompleted",void 0),__decorate$f([n$5({type:String})],ChromedashTypeahead.prototype,"placeholder",void 0),__decorate$f([n$5({type:Array,attribute:!1})],ChromedashTypeahead.prototype,"vocabulary",void 0),ChromedashTypeahead=__decorate$f([t$3("chromedash-typeahead")],ChromedashTypeahead);let ChromedashTypeaheadDropdown=class ChromedashTypeaheadDropdown extends dropdown_default{getCurrentItem(){const item=this.getMenu().getCurrentItem();return!item||item instanceof ChromedashTypeaheadInvisibleItem?void 0:item}setCurrentItem(newCurrentItem){const menu=this.getMenu();menu.setCurrentItem(newCurrentItem),newCurrentItem.scrollIntoView({block:"nearest",behavior:"smooth"})}getAllVisibleItems(menu){const items=menu.getAllItems();return items.filter(item=>!(item instanceof ChromedashTypeaheadInvisibleItem))}resetSelection(){const currentItem=this.getCurrentItem();currentItem?.setAttribute("tabindex","-1")}async handleTriggerKeyDown(event){const menu=this.getMenu();if(menu){const menuItems=this.getAllVisibleItems(menu);if(0!==menuItems.length){const currentItem=menu.getCurrentItem();if(["Enter"].includes(event.key)&&(event.preventDefault(),this.open&¤tItem&&(currentItem.click(),this.resetSelection())),["ArrowDown","ArrowUp"].includes(event.key))if(event.preventDefault(),event.stopPropagation(),this.open||this.show(),currentItem){const currentItemIndex=menuItems.indexOf(currentItem);"ArrowDown"===event.key&&menuItems[currentItemIndex+1]&&this.setCurrentItem(menuItems[currentItemIndex+1]),"ArrowUp"===event.key&&menuItems[currentItemIndex-1]&&this.setCurrentItem(menuItems[currentItemIndex-1])}else"ArrowDown"===event.key&&this.setCurrentItem(menuItems[1]),"ArrowUp"===event.key&&this.setCurrentItem(menuItems[menuItems.length-1])}}}};ChromedashTypeaheadDropdown=__decorate$f([t$3("chromedash-typeahead-dropdown")],ChromedashTypeaheadDropdown);let ChromedashTypeaheadItem=class ChromedashTypeaheadItem extends i$4{constructor(){super(...arguments),this.value="",this.doc="",this.prefix="",this.tabindex=-1,this.role="menuitem"}static get styles(){return[...SHARED_STYLES,i$7` + .menu-item { + display: flex; + flex-wrap: wrap; + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-medium); + font-weight: var(--sl-font-weight-normal); + line-height: var(--sl-line-height-normal); + letter-spacing: var(--sl-letter-spacing-normal); + color: var(--sl-color-neutral-700); + padding: var(--sl-spacing-2x-small) var(--sl-spacing-2x-small); + transition: var(--sl-transition-fast) fill; + user-select: none; + -webkit-user-select: none; + white-space: nowrap; + cursor: pointer; + } + + .active { + outline: none; + background-color: var(--sl-color-primary-200); + opacity: 1; + } + #value { + width: 24em; + overflow-x: hidden; + } + code { + font-size: 85%; + background: #eee; + padding: var(--content-padding-quarter); + } + `]}handleMouseOver(event){this.parentElement&&this.parentElement.setCurrentItem(this),event.stopPropagation()}highlight(s){const start=s.toLowerCase().indexOf(this.prefix.toLowerCase());if(-1===start)return s;const before=s.substring(0,start),matching=s.substring(start,start+this.prefix.length),after=s.substring(start+this.prefix.length);return x$1`${before}<b>${matching}</b>${after}`}render(){const highlightedValue=this.highlight(this.value),highlightedDoc=this.highlight(this.doc);return x$1` + <div + class="menu-item ${0===this.tabindex?"active":""}" + @mouseover=${this.handleMouseOver} + > + <span id="value"><code>${highlightedValue}</code></span> + <span id="doc">${highlightedDoc}</span> + </div> + `}};__decorate$f([n$5({type:String})],ChromedashTypeaheadItem.prototype,"value",void 0),__decorate$f([n$5({type:String})],ChromedashTypeaheadItem.prototype,"doc",void 0),__decorate$f([n$5({type:String})],ChromedashTypeaheadItem.prototype,"prefix",void 0),__decorate$f([n$5({type:Number})],ChromedashTypeaheadItem.prototype,"tabindex",void 0),__decorate$f([n$5({type:String,reflect:!0})],ChromedashTypeaheadItem.prototype,"role",void 0),ChromedashTypeaheadItem=__decorate$f([t$3("chromedash-typeahead-item")],ChromedashTypeaheadItem);let ChromedashTypeaheadInvisibleItem=class ChromedashTypeaheadInvisibleItem extends ChromedashTypeaheadItem{render(){return x$1`${E$1}`}};ChromedashTypeaheadInvisibleItem=__decorate$f([t$3("chromedash-typeahead-invisible-item")],ChromedashTypeaheadInvisibleItem);var __decorate$e=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashReportExternalReviewsDispatchPage=class ChromedashReportExternalReviewsDispatchPage extends i$4{static get styles(){return SHARED_STYLES}render(){return x$1` + <div id="subheader">Which group's reviews do you want to see?</div> + <ul> + <li><a href="/reports/external_reviews/tag">W3C TAG</a></li> + <li> + <a href="/reports/external_reviews/gecko" + >Gecko / Firefox / Mozilla</a + > + </li> + <li> + <a href="/reports/external_reviews/webkit">WebKit / Safari / Apple</a> + </li> + </ul> + `}};ChromedashReportExternalReviewsDispatchPage=__decorate$e([t$3("chromedash-report-external-reviews-dispatch-page")],ChromedashReportExternalReviewsDispatchPage);const i=Symbol();class h{get taskComplete(){return this.t||(1===this.i?this.t=new Promise((t,s)=>{this.o=t,this.h=s}):3===this.i?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,i){this.p=0,this.i=0,(this._=t).addController(this);const h="object"==typeof s?s:{task:s,args:i};this.v=h.task,this.j=h.args,this.m=h.argsEqual??r$1,this.k=h.onComplete,this.A=h.onError,this.autoRun=h.autoRun??!0,"initialValue"in h&&(this.u=h.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){!0===this.autoRun&&this.S()}hostUpdated(){"afterUpdate"===this.autoRun&&this.S()}T(){if(void 0!==this.j){const t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}}async S(){const t=this.T(),s=this.O;this.O=t,t===s||void 0===t||void 0!==s&&this.m(s,t)||(await this.run(t))}async run(t){let s,h;t??=this.T(),this.O=t,1===this.i?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,"afterUpdate"===this.autoRun?queueMicrotask(()=>this._.requestUpdate()):this._.requestUpdate();const r=++this.p;this.q=new AbortController;let e=!1;try{s=await this.v(t,{signal:this.q.signal})}catch(t){e=!0,h=t}if(this.p===r){if(s===i)this.i=0;else{if(!1===e){try{this.k?.(s)}catch{}this.i=2,this.o?.(s)}else{try{this.A?.(h)}catch{}this.i=3,this.h?.(h)}this.u=s,this.l=h}this._.requestUpdate()}}abort(t){1===this.i&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}}const r$1=(s,i)=>s===i||s.length===i.length&&s.every((s,h)=>!f$3(s,i[h])),r=(r,o,t)=>{for(const t of o)if(t[0]===r)return(0,t[1])();return t?.()};var __decorate$d=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};function ascendingNumberUndefinedLast(a,b){return a===b?0:void 0===a?1:void 0===b?-1:a-b}function compareOutstandingReview(a,b){return console.assert(a.current_stage===b.current_stage,`Tried to compare features at stages ${a.current_stage} and `+`${b.current_stage} using a function that ignores features' stages.`),a.estimated_end_milestone===b.estimated_end_milestone?a.estimated_start_milestone===b.estimated_start_milestone?a.review_link<b.review_link?-1:a.review_link>b.review_link?1:0:ascendingNumberUndefinedLast(a.estimated_start_milestone,b.estimated_start_milestone):ascendingNumberUndefinedLast(a.estimated_end_milestone,b.estimated_end_milestone)}let ChromedashReportExternalReviewsPage=class ChromedashReportExternalReviewsPage extends i$4{constructor(){super(...arguments),this.reviewer=void 0,this._client=window.csOpenApiClient,this._reviewsTask=new h(this,{task:async([reviewer],{signal})=>{if(reviewer===void 0)throw new Error("Element must have \"reviewer\" attribute.",{cause:this});if(!["tag","gecko","webkit"].includes(reviewer))throw new Error(`Reviewer (${reviewer}) must be 'tag', 'gecko', or 'webkit'.`,{cause:this});const response=await this._client.listExternalReviews({reviewGroup:reviewer},{signal});return{reviews:this.groupReviews(response.reviews),links:response.link_previews,noOutstandingReviews:0===response.reviews.length}},args:()=>[this.reviewer]})}static get styles(){return[...SHARED_STYLES,i$7` + #subheader { + display: block; + } + h3 { + margin-top: var(--content-padding); + margin-bottom: var(--content-padding-quarter); + + sl-skeleton { + width: 30%; + height: 1lh; + } + } + td.feature, + td.review { + width: 45%; + } + td.milestones { + width: 10%; + } + `]}groupReviews(reviews){const result={incubating:[],prototyping:[],"dev-trial":[],"wide-review":[],"origin-trial":[],shipping:[],shipped:[]};for(const review of reviews)review.current_stage&&result[review.current_stage].push(review);for(const list of Object.values(result))list.sort(compareOutstandingReview);return result}headerRow(){return x$1`<tr> + <th>Feature</th> + <th>Review</th> + <th>Target Milestones</th> + </tr>`}renderOutstandingReviews(reviews,links){return[["Preparing to ship","shipping"],["In Origin Trial","origin-trial"],["Getting wide review","wide-review"],["In developer trials","dev-trial"],["Prototyping","prototyping"],["Incubating","incubating"],["Already shipped","shipped"]].map(([title,key])=>0<reviews[key].length?x$1`<section> + <h3 id=${key}>${title}</h3> + <table class="data-table"> + ${this.headerRow()} + ${reviews[key].map(review=>x$1` + <tr> + <td class="feature"> + <a href="/feature/${review.feature.id}" + >${review.feature.name}</a + > + </td> + <td class="review"> + <chromedash-link + href=${review.review_link} + .featureLinks=${links} + ></chromedash-link> + </td> + <td class="milestones"> + ${review.estimated_start_milestone?"M"+review.estimated_start_milestone:E$1}${["shipping","shipped"].includes(review.current_stage)?E$1:x$1`${review.estimated_start_milestone||review.estimated_end_milestone?"\u2013":E$1}${review.estimated_end_milestone?"M"+review.estimated_end_milestone:E$1}`} + </td> + </tr> + `)} + </table> + </section>`:E$1)}render(){return x$1` + <div id="subheader"> + <h2> + Open + ${r(this.reviewer,[["tag",()=>x$1`W3C TAG`],["webkit",()=>x$1`WebKit`],["gecko",()=>x$1`Mozilla`]])} + reviews for Chromium features + </h2> + <p> + Reviews are in rough order of urgency, from about-to-ship down to + incubations. Already-shipped features are listed at the bottom. + </p> + </div> + ${this._reviewsTask.render({pending:()=>x$1` + <section> + <h3><sl-skeleton effect="sheen"></sl-skeleton></h3> + <table class="data-table"> + ${this.headerRow()} + ${[1,2,3].map(()=>x$1` + <tr> + <td class="feature"> + <sl-skeleton effect="sheen"></sl-skeleton> + </td> + <td class="review"> + <sl-skeleton effect="sheen"></sl-skeleton> + </td> + <td class="milestones"> + <sl-skeleton effect="sheen"></sl-skeleton> + </td> + </tr> + `)} + </table> + </section> + `,complete:({reviews,links,noOutstandingReviews})=>noOutstandingReviews?x$1`No outstanding reviews. Congratulations!`:this.renderOutstandingReviews(reviews,links),error:e=>(console.error(`Couldn't fetch ${this.reviewer}'s reviews: `,e),x$1`<p> + Some errors occurred. Please refresh the page or try again later. + </p>`)})} + `}};__decorate$d([n$5({type:String})],ChromedashReportExternalReviewsPage.prototype,"reviewer",void 0),__decorate$d([n$5({type:Object})],ChromedashReportExternalReviewsPage.prototype,"_client",void 0),__decorate$d([n$5({attribute:!1})],ChromedashReportExternalReviewsPage.prototype,"_reviewsTask",void 0),ChromedashReportExternalReviewsPage=__decorate$d([t$3("chromedash-report-external-reviews-page")],ChromedashReportExternalReviewsPage);var __decorate$c=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashReportFeatureLatencyPage=class ChromedashReportFeatureLatencyPage extends i$4{constructor(){super(...arguments),this.rawQuery={},this._client=window.csOpenApiClient,this.latencyList=[],this._latencyTask=new h(this,{task:async([startAt,endAt],{signal})=>(this.latencyList=await this._client.listFeatureLatency({startAt,endAt},{signal}),this.latencyList),args:()=>[this.startAtDate,this.endAtDate]}),this.startAtDate=new Date("January 1, 2023"),this.endAtDate=new Date("January 1, 2024")}static get styles(){return[...SHARED_STYLES,i$7` + p { + margin: var(--content-padding) 0; + } + + table { + border: var(--table-divider); + } + td, + th { + padding: var(--content-padding); + border-bottom: var(--table-divider); + vertical-align: baseline; + } + th { + background: var(--table-header-background); + } + tr { + background: var(--table-row-background); + } + `]}static get properties(){return{latencyList:{type:Array},startAtDate:{state:!0},endAtDate:{state:!0}}}connectedCallback(){super.connectedCallback(),this.initializeParams()}initializeParams(){if(this.rawQuery){if(this.rawQuery.startAt){const parsed=Date.parse(this.rawQuery.startAt);isNaN(parsed)||(this.startAtDate=new Date(parsed))}if(this.rawQuery.endAt){const parsed=Date.parse(this.rawQuery.endAt);isNaN(parsed)||(this.endAtDate=new Date(parsed))}}}renderCount(){return x$1` + <p> + Launched ${this.latencyList.length} features between + ${this.startAtDate.toLocaleDateString()} and + ${this.endAtDate.toLocaleDateString()}. + </p> + <p>Latency is measured in calendar days.</p> + `}renderLatencyRow(featureLatency){const latencyMs=featureLatency.shipped_date-featureLatency.entry_created_date,latencyDays=Math.ceil(latencyMs/86400000);return x$1` + <tr> + <td> + <a href="/feature/${featureLatency.feature.id}"> + ${featureLatency.feature.name} + </a> + </td> + <td> + ${featureLatency.owner_emails.map(addr=>x$1`<div>${addr}</div>`)} + </td> + <td>${featureLatency.entry_created_date.toLocaleDateString()}</td> + <td>${featureLatency.shipped_date.toLocaleDateString()}</td> + <td>${latencyDays}</td> + </tr> + `}renderTable(){return x$1` + <table> + <tr> + <th>Feature</th> + <th>Owners</th> + <th>Created</th> + <th>Shipped</th> + <th>Latency</th> + </tr> + ${this.latencyList.map(fl=>this.renderLatencyRow(fl))} + </table> + `}renderWhenComplete(){return x$1` ${this.renderCount()} ${this.renderTable()} `}render(){return this._latencyTask.render({initial:()=>x$1`<p>Loading...</p>`,pending:()=>x$1`<p>Loading...</p>`,complete:()=>this.renderWhenComplete(),error:e=>(console.error(e),x$1`<p> + Some errors occurred. Please refresh the page or try again later. + </p>`)})}};__decorate$c([n$5({type:Object})],ChromedashReportFeatureLatencyPage.prototype,"rawQuery",void 0),__decorate$c([n$5({attribute:!1})],ChromedashReportFeatureLatencyPage.prototype,"_client",void 0),__decorate$c([n$5({attribute:!1})],ChromedashReportFeatureLatencyPage.prototype,"latencyList",void 0),__decorate$c([n$5({attribute:!1})],ChromedashReportFeatureLatencyPage.prototype,"_latencyTask",void 0),__decorate$c([r$6()],ChromedashReportFeatureLatencyPage.prototype,"startAtDate",void 0),__decorate$c([r$6()],ChromedashReportFeatureLatencyPage.prototype,"endAtDate",void 0),ChromedashReportFeatureLatencyPage=__decorate$c([t$3("chromedash-report-feature-latency-page")],ChromedashReportFeatureLatencyPage);var __decorate$b=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashReportSpecMentor=class ChromedashReportSpecMentor extends i$4{static get styles(){return[...SHARED_STYLES,i$7``]}render(){return x$1` + <sl-details summary="${this.mentor.email} has mentored:" open> + <table> + ${this.mentor.mentored_features.map(feature=>x$1` + <chromedash-feature-row + .feature="${feature}" + ></chromedash-feature-row> + `)} + </table> + </sl-details> + `}};__decorate$b([n$5({attribute:!1})],ChromedashReportSpecMentor.prototype,"mentor",void 0),ChromedashReportSpecMentor=__decorate$b([t$3("chromedash-report-spec-mentor")],ChromedashReportSpecMentor);var __decorate$a=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashReportSpecMentorsPage=class ChromedashReportSpecMentorsPage extends i$4{constructor(){super(...arguments),this.rawQuery={},this._client=window.csOpenApiClient,this._mentorsTask=new h(this,{task:async([updatedAfter],{signal})=>{const mentors=await this._client.listSpecMentors({after:updatedAfter},{signal});return mentors.sort((a,b)=>a.email.localeCompare(b.email)),mentors},args:()=>[this._updatedAfter]}),this._updatedAfter=new Date(Date.now()-31536000000)}static get styles(){return[...SHARED_STYLES,i$7``]}connectedCallback(){super.connectedCallback(),this.initializeParams()}initializeParams(){if(this.rawQuery&&this.rawQuery.after){const parsed=Date.parse(this.rawQuery.after);isNaN(parsed)||(this._updatedAfter=new Date(parsed))}}afterChanged(e){e.stopPropagation();const newDate=e.target.valueAsDate;newDate&&(this._updatedAfter=newDate,this.dispatchEvent(new CustomEvent("afterchanged",{detail:{after:this._updatedAfter},bubbles:!0,composed:!0})))}render(){return x$1` + <div id="subheader"> + <sl-input + type="date" + name="after" + value=${isoDateString(this._updatedAfter)} + label="List spec mentors who've worked on features that were updated after this date" + @sl-change=${this.afterChanged} + ></sl-input> + </div> + ${this._mentorsTask.render({pending:()=>x$1` <details open> + <summary><sl-skeleton effect="sheen"></sl-skeleton></summary> + <sl-skeleton effect="sheen"></sl-skeleton> + </details>`,complete:specMentors=>specMentors.map(mentor=>x$1`<chromedash-report-spec-mentor + .mentor=${mentor} + ></chromedash-report-spec-mentor>`),error:e=>(console.error(e),x$1`<p> + Some errors occurred. Please refresh the page or try again later. + </p>`)})} + `}};__decorate$a([n$5({type:Object})],ChromedashReportSpecMentorsPage.prototype,"rawQuery",void 0),__decorate$a([n$5({attribute:!1})],ChromedashReportSpecMentorsPage.prototype,"_client",void 0),__decorate$a([n$5({attribute:!1})],ChromedashReportSpecMentorsPage.prototype,"_mentorsTask",void 0),__decorate$a([r$6()],ChromedashReportSpecMentorsPage.prototype,"_updatedAfter",void 0),ChromedashReportSpecMentorsPage=__decorate$a([t$3("chromedash-report-spec-mentors-page")],ChromedashReportSpecMentorsPage);var __decorate$9=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashReportReviewLatencyPage=class ChromedashReportReviewLatencyPage extends i$4{constructor(){super(...arguments),this._client=window.csOpenApiClient,this.reviewLatencyList=[],this._reviewLatencyTask=new h(this,{task:async([],{signal})=>{this.reviewLatencyList=await this._client.listReviewsWithLatency({signal})},args:()=>[]})}static get styles(){return[...SHARED_STYLES,i$7` + p { + margin: var(--content-padding) 0; + } + table { + border-collapse: collapse; + border: 1px solid #888; + } + td, + th { + padding: var(--content-padding-half); + text-align: center; + } + td { + border-top: 1px solid #888; + border-bottom: 1px solid #888; + } + colgroup { + border: 1px solid #888; + } + th { + background: var(--table-header-background); + } + tr { + background: var(--table-row-background); + } + .left { + text-align: left; + min-width: 18em; + } + `]}static get properties(){return{featureReviewList:{state:!0}}}renderCount(){let count=0;for(const rl of this.reviewLatencyList)for(const gr of rl.gate_reviews)0<=gr.latency_days&&count++;return x$1` + <p> + ${count} reviews of ${this.reviewLatencyList.length} distinct features + in the past 90 days. + </p> + <p>Latency is measured in weekdays from request to initial response.</p> + `}renderFeatureReviewsRow(reviewLatency){const gateLatency={};for(const gr of reviewLatency.gate_reviews){let display=gr.latency_days;-1===gr.latency_days?display="":-2==gr.latency_days&&(display="Pending"),gateLatency[gr.gate_type]=display}return x$1` + <tr> + <td class="left"> + <a href="/feature/${reviewLatency.feature.id}"> + ${reviewLatency.feature.name} + </a> + </td> + <td>${gateLatency[GATE_TYPES.PRIVACY_ORIGIN_TRIAL]}</td> + <td>${gateLatency[GATE_TYPES.PRIVACY_SHIP]}</td> + <td>${gateLatency[GATE_TYPES.SECURITY_ORIGIN_TRIAL]}</td> + <td>${gateLatency[GATE_TYPES.SECURITY_SHIP]}</td> + <td>${gateLatency[GATE_TYPES.ENTERPRISE_SHIP]}</td> + <td>${gateLatency[GATE_TYPES.DEBUGGABILITY_ORIGIN_TRIAL]}</td> + <td>${gateLatency[GATE_TYPES.DEBUGGABILITY_SHIP]}</td> + <td>${gateLatency[GATE_TYPES.TESTING_SHIP]}</td> + <td>${gateLatency[GATE_TYPES.API_ORIGIN_TRIAL]}</td> + <td>${gateLatency[GATE_TYPES.API_SHIP]}</td> + </tr> + `}renderTable(){return x$1` + <table> + <colgroup> + <col /> + </colgroup> + <colgroup> + <col /> + <col /> + </colgroup> + <colgroup> + <col /> + <col /> + </colgroup> + <colgroup> + <col /> + </colgroup> + <colgroup> + <col /> + <col /> + </colgroup> + <colgroup> + <col /> + </colgroup> + <colgroup> + <col /> + <col /> + </colgroup> + <tr> + <th scope="col" rowspan="2" class="left">Feature</th> + <th scope="col" colspan="2">Privacy</th> + <th scope="col" colspan="2">Security</th> + <th scope="col" colspan="1">Enterprise</th> + <th scope="col" colspan="2">Debugability</th> + <th scope="col" colspan="1">Testing</th> + <th scope="col" colspan="2">API Owners</th> + </tr> + <tr> + <th>OT</th> + <th>Ship</th> + <th>OT</th> + <th>Ship</th> + <th>Ship</th> + <th>OT</th> + <th>Ship</th> + <th>Ship</th> + <th>OT</th> + <th>Ship</th> + </tr> + + ${this.reviewLatencyList.map(rl=>this.renderFeatureReviewsRow(rl))} + </table> + `}renderWhenComplete(){return x$1` ${this.renderCount()} ${this.renderTable()} `}render(){return this._reviewLatencyTask.render({initial:()=>x$1`<p>Loading...</p>`,pending:()=>x$1`<p>Loading...</p>`,complete:()=>this.renderWhenComplete(),error:e=>(console.error(e),x$1`<p> + Some errors occurred. Please refresh the page or try again later. + </p>`)})}};__decorate$9([n$5({attribute:!1})],ChromedashReportReviewLatencyPage.prototype,"_client",void 0),__decorate$9([n$5({attribute:!1})],ChromedashReportReviewLatencyPage.prototype,"reviewLatencyList",void 0),__decorate$9([n$5({attribute:!1})],ChromedashReportReviewLatencyPage.prototype,"_reviewLatencyTask",void 0),ChromedashReportReviewLatencyPage=__decorate$9([t$3("chromedash-report-review-latency-page")],ChromedashReportReviewLatencyPage);var __decorate$8=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const TEMPLATE_CONTENT={stable_minus_one:{channelLabel:"Released",h1Class:"",dateText:"was",featureHeader:"Features in this release"},stable:{channelLabel:"Stable",h1Class:"",dateText:"was",featureHeader:"Features in this release"},stable_soon:{channelLabel:"Stable soon",h1Class:"",dateText:"was",featureHeader:"Features planned in this release"},beta:{channelLabel:"Next up",h1Class:"chrome_version--beta",channelTag:"BETA",dateText:"between",featureHeader:"Features planned in this release"},dev:{channelLabel:"Dev",h1Class:"chrome_version--dev",channelTag:"DEV",dateText:"coming",featureHeader:"Features planned in this release"},dev_plus_one:{channelLabel:"Later",h1Class:"chrome_version--dev_plus_one",dateText:"coming",featureHeader:"Features planned in this release"}},DEFAULT_CHANNEL_TYPES=["stable","beta","dev"],GAPPED_CHANNEL_TYPES=["stable","stable_soon","beta","dev"],SHOW_DATES=!0,compareFeatures=(a,b)=>a.name.localeCompare(b.name,"fr",{ignorePunctuation:!0});let ChromedashRoadmap=class ChromedashRoadmap extends i$4{constructor(){super(...arguments),this.numColumns=0,this.cardWidth=0,this.channels={},this.starredFeatures=new Set,this.futureMilestoneArray=[],this.pastMilestoneArray=[],this.highlightFeature=void 0,this.cardOffset=0,this.shownChannelNames=[]}static get styles(){return[...SHARED_STYLES,i$7` + :host { + display: inline-flex; + padding: 0 0em var(--content-padding-huge); + margin-right: var(--content-padding-negative); + position: relative; + } + `]}connectedCallback(){super.connectedCallback(),Promise.all([window.csClient.getChannels(),window.csClient.getStars()]).then(([channels,starredFeatures])=>{this.fetchFirstBatch(channels),this.starredFeatures=new Set(starredFeatures)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}fetchFirstBatch(channels){this.shownChannelNames=channels.stable_soon?GAPPED_CHANNEL_TYPES:DEFAULT_CHANNEL_TYPES;const promises=this.shownChannelNames.map(channelType=>window.csClient.getFeaturesInMilestone(channels[channelType].version));Promise.all(promises).then(allRes=>{allRes.map((res,idx)=>{Object.keys(res).forEach(status=>{res[status].sort(compareFeatures)}),channels[this.shownChannelNames[idx]].features=res}),this.channels=channels,this.fetchNextBatch(channels.beta.version,!0),this.fetchPreviousBatch(channels.stable.version),this.lastMilestoneVisible=channels[this.shownChannelNames[this.numColumns-1]].version})}fetchNextBatch(nextVersion,firstTime=!1){const fetchInAdvance=3,fetchStart=firstTime?nextVersion+2:nextVersion+3+1,fetchEnd=nextVersion+3+1,versions=[...Array(fetchEnd-fetchStart+1).keys()].map(x=>x+fetchStart),milestonePromise=window.csClient.getSpecifiedChannels(fetchStart,fetchEnd),featurePromises=versions.map(ver=>window.csClient.getFeaturesInMilestone(ver));this.futureMilestoneArray=[...this.futureMilestoneArray,...versions],this.lastFutureFetchedOn=nextVersion,milestonePromise.then(newMilestonesInfo=>{Promise.all(featurePromises).then(allRes=>{allRes.map((res,idx)=>{Object.keys(res).forEach(status=>{res[status].sort(compareFeatures)});const version=versions[idx];newMilestonesInfo[version].features=res,newMilestonesInfo[version].version=version,this.milestoneInfo=Object.assign({},this.milestoneInfo,newMilestonesInfo)})})}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}fetchPreviousBatch(version){const versionToFetch=version-1;if(2>versionToFetch)return;const milestonePromise=window.csClient.getSpecifiedChannels(versionToFetch,versionToFetch),featurePromise=window.csClient.getFeaturesInMilestone(versionToFetch),margin=16;this.cardOffset-=1,this.style.left=this.cardOffset*(this.cardWidth+margin)+"px",this.pastMilestoneArray=[versionToFetch,...this.pastMilestoneArray],this.lastPastFetchedOn=version,Promise.all([milestonePromise,featurePromise]).then(([newMilestonesInfo,features])=>{Object.keys(features).forEach(status=>{features[status].sort(compareFeatures)}),newMilestonesInfo[versionToFetch].features=features,newMilestonesInfo[versionToFetch].version=versionToFetch,this.milestoneInfo=Object.assign({},this.milestoneInfo,newMilestonesInfo)}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}handleStarToggle(e){const newStarredFeatures=new Set(this.starredFeatures);window.csClient.setStar(e.detail.feature,e.detail.doStar).then(()=>{e.detail.doStar?newStarredFeatures.add(e.detail.feature):newStarredFeatures.delete(e.detail.feature),this.starredFeatures=newStarredFeatures}).catch(()=>{showToastMessage("Unable to star the Feature. Please Try Again.")})}handleHighlightEvent(e){this.highlightFeature=e.detail.feature}render(){return x$1` + ${c(this.pastMilestoneArray,milestone=>milestone,milestone=>x$1` + <chromedash-roadmap-milestone-card + style="width:${this.cardWidth}px;" + .channel=${this.milestoneInfo?.[milestone]} + .templateContent=${TEMPLATE_CONTENT.stable_minus_one} + ?showdates=${SHOW_DATES} + .starredFeatures=${this.starredFeatures} + .highlightFeature=${this.highlightFeature} + ?signedin=${this.signedIn} + @star-toggle-event=${this.handleStarToggle} + @highlight-feature-event=${this.handleHighlightEvent} + > + </chromedash-roadmap-milestone-card> + `)} + ${c(this.shownChannelNames,channelType=>channelType,channelType=>x$1` + <chromedash-roadmap-milestone-card + style="width:${this.cardWidth}px;" + .channel=${this.channels?.[channelType]} + .templateContent=${TEMPLATE_CONTENT[channelType]} + ?showdates=${SHOW_DATES} + .starredFeatures=${this.starredFeatures} + .highlightFeature=${this.highlightFeature} + ?signedin=${this.signedIn} + .stableMilestone=${this.channels?.["stable"]?.version} + @star-toggle-event=${this.handleStarToggle} + @highlight-feature-event=${this.handleHighlightEvent} + > + </chromedash-roadmap-milestone-card> + `)} + ${c(this.futureMilestoneArray,milestone=>milestone,milestone=>x$1` + <chromedash-roadmap-milestone-card + style="width:${this.cardWidth}px;" + .channel=${this.milestoneInfo?.[milestone]} + .templateContent=${TEMPLATE_CONTENT.dev_plus_one} + ?showdates=${SHOW_DATES} + .starredFeatures=${this.starredFeatures} + .highlightFeature=${this.highlightFeature} + ?signedin=${this.signedIn} + @star-toggle-event=${this.handleStarToggle} + @highlight-feature-event=${this.handleHighlightEvent} + > + </chromedash-roadmap-milestone-card> + `)} + `}};__decorate$8([n$5({type:Boolean})],ChromedashRoadmap.prototype,"signedIn",void 0),__decorate$8([n$5({type:Number,attribute:!1})],ChromedashRoadmap.prototype,"numColumns",void 0),__decorate$8([n$5({type:Number,attribute:!1})],ChromedashRoadmap.prototype,"cardWidth",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"channels",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"starredFeatures",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"lastFutureFetchedOn",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"lastPastFetchedOn",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"lastMilestoneVisible",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"futureMilestoneArray",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"pastMilestoneArray",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"milestoneInfo",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"highlightFeature",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"cardOffset",void 0),__decorate$8([r$6()],ChromedashRoadmap.prototype,"shownChannelNames",void 0),ChromedashRoadmap=__decorate$8([t$3("chromedash-roadmap")],ChromedashRoadmap);const ROADMAP_MILESTONE_CARD_CSS=[SHARED_STYLES,i$7` + .layout { + display: flex; + } + .layout.wrap { + flex-wrap: wrap; + } + .layout.center { + align-items: center; + } + .layout.center-center { + align-items: center; + justify-content: center; + } + .layout.vertical { + flex-direction: column; + } + :host { + padding: 16px; + background: #fff; + padding: 16px; + margin-bottom: 16px !important; + border-radius: 3px; + margin-right: 8px !important; + margin-left: 8px !important; + counter-reset: featurecount; + margin: 8px; + } + sl-icon { + font-size: 1.4rem; + color: #366597; + } + sl-icon:hover { + color: #248; + } + sl-icon.pushicon { + cursor: pointer; + } + sl-icon-button { + font-size: 16px; + } + .popup-content { + border: 2px solid #888; + border-radius: 8px; + background: #f8f8f8; + color: black; + font-size: 12pt; + padding: 1em; + width: 14em; + } + .chrome_version { + font-size: 45px; + margin: 8px 0 16px 0; + white-space: nowrap; + } + .channel_label { + font-weight: 600; + text-transform: uppercase; + font-size: 24px; + text-align: center; + } + .chrome_version .chrome-logo, + .chrome_version--stable .chrome-logo { + position: relative; + width: 45px; + height: 45px; + background: url(/static/img/chrome_logo.svg) no-repeat 50% 50%; + background-size: contain; + margin-right: 8px; + } + .chrome_version--beta .chrome-logo { + background-image: url(/static/img/chrome_logo.svg); + } + .chrome_version--dev .chrome-logo { + background-image: url(/static/img/chrome_logo.svg); + } + .chrome_version--canary .chrome-logo { + background-image: url(/static/img/chrome_logo_canary.svg); + background-size: 42px; + } + .chrome_version--dev_plus_one .chrome-logo { + filter: gray; + -webkit-filter: grayscale(1); + filter: grayscale(1); + } + .chrome-logo .channel-tag { + position: absolute; + right: 0; + top: 50%; + padding: 1px 2px; + font-size: 10px; + font-weight: bold; + color: white; + background: var(--sl-color-neutral-900); + } + .release { + padding: 16px; + background: #fff; + padding: 16px; + margin-bottom: 16px !important; + border-radius: 3px; + flex: 1 0 0; + min-width: 300px; + counter-reset: featurecount; + } + .release.no-components .feature_shipping_type { + display: none; + } + .release.no-components .feature_shipping_type + ul { + margin-top: 0; + } + .milestone_info { + margin-bottom: 8px; + } + .milestone_info:nth-of-type(3) { + border-bottom: 1px solid #e6e6e6; + padding-bottom: 16px; + } + .milestone_info .channel_label { + font-size: inherit; + font-weight: 500; + text-transform: none; + } + .no_feature_released { + color: #737373; + } + .features_list { + margin-top: 32px; + } + .features_list ul, + .features_list ol { + margin-top: 8px; + list-style: none; + padding: 0; + } + .features_list li { + padding: 8px; + font-weight: 500; + } + .features_list li .icon_row { + flex-shrink: 0; + } + .features_list .features_header { + font-weight: 500; + text-transform: uppercase; + margin-bottom: 16px; + } + .feature_shipping_type { + margin-top: 16px; + overflow: hidden; + text-overflow: ellipsis; + } + .highlight { + background: var(--light-accent-color); + } + #feature_link { + width: 100%; + } + .sl-skeleton-header-container { + display: flex; + width: 100%; + gap: 10px; + justify-content: center; + margin-top: 10px; + } + .sl-skeleton-header-container sl-skeleton { + width: 60%; + } + .sl-skeleton-title-container { + width: 50%; + } + .features_list sl-skeleton { + height: 20px; + margin: 8px; + } + .experiment { + font-size: 85%; + padding: 2px 8px; + background: #fea; + border-radius: 8px; + } + `];var __decorate$7=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const STATUS_TO_ICON_NAME={"Not started":"arrow_circle_right_20px","In-progress":"pending_20px","Needs work":"autorenew_20px",Approved:"check_circle_filled_20px",Denied:"block_20px"};let ChromedashReviewStatusIcon=class ChromedashReviewStatusIcon extends i$4{constructor(){super(...arguments),this.gates=[]}static get styles(){return[...SHARED_STYLES,i$7` + sl-icon { + width: 26px; + height: 18px; + } + + sl-icon.not-started { + color: var(--gate-preparing-icon-color); + } + sl-icon.in-progress { + color: var(--gate-pending-icon-color); + } + sl-icon.needs-work { + color: var(--gate-needs-work-icon-color); + } + sl-icon.approved { + color: var(--gate-approved-icon-color); + } + sl-icon.denied { + color: var(--gate-denied-icon-color); + } + `]}connectedCallback(){super.connectedCallback(),this.fetchData()}fetchData(){this.gates=[],window.csClient?.getGates(this.feature?.id).then(gatesRes=>{let featureGates=gatesRes.gates;this.gates=featureGates.filter(g=>this.feature.roadmap_stage_ids?.includes(g.stage_id))})}calcStatus(){let status="Not started",targetGateId,apiOwnersGateId;for(const g of this.gates)g.state!==GATE_PREPARING&&(status="In-progress"),g.state!==VOTE_OPTIONS.APPROVED[0]&&g.state!==VOTE_OPTIONS.NA[0]&&g.state!==VOTE_NA_SELF&&(targetGateId=g.id),"API Owners"===g.team_name&&(apiOwnersGateId=g.id);0<this.gates.length&&this.gates.every(g=>g.state===VOTE_OPTIONS.APPROVED[0]||g.state===VOTE_OPTIONS.NA[0]||g.state===VOTE_NA_SELF)&&(status="Approved",targetGateId=apiOwnersGateId),this.feature?.feature_type_int===FEATURE_TYPES.FEATURE_TYPE_CODE_CHANGE_ID[0]&&(status="Approved",targetGateId=void 0);for(const g of this.gates)g.state==VOTE_OPTIONS.NEEDS_WORK[0]&&(status="Needs work",targetGateId=g.id);for(const g of this.gates)g.state==VOTE_OPTIONS.DENIED[0]&&(status="Denied",targetGateId=g.id);return{status,targetGateId}}render(){if(0===this.gates.length)return x$1`<sl-icon></sl-icon>`;const{status,targetGateId}=this.calcStatus();let className=status.toLowerCase().replace(" ","-"),iconName=STATUS_TO_ICON_NAME[status],hoverText="Reviews: "+status;const icon=x$1` + <sl-icon + library="material" + title="${hoverText}" + class="${className}" + name="${iconName}" + ></sl-icon> + `;return targetGateId?x$1` + <a href="/feature/${this.feature.id}?gate=${targetGateId}">${icon}</a> + `:icon}};__decorate$7([n$5({type:Object})],ChromedashReviewStatusIcon.prototype,"feature",void 0),__decorate$7([r$6()],ChromedashReviewStatusIcon.prototype,"gates",void 0),ChromedashReviewStatusIcon=__decorate$7([t$3("chromedash-review-status-icon")],ChromedashReviewStatusIcon);var __decorate$6=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const REMOVED_STATUS=["Removed"],DEPRECATED_STATUS=["Deprecated","No longer pursuing"],ORIGIN_TRIAL=["Origin trial"],DEPRECATION_TRIAL=["Deprecation trial"],NO_FEATURE_STRING="NO FEATURES ARE PLANNED FOR THIS MILESTONE YET";let ChromedashRoadmapMilestoneCard=class ChromedashRoadmapMilestoneCard extends i$4{constructor(){super(...arguments),this.infoPopupRef=e$1(),this.starredFeatures=new Set,this.showDates=!1,this.signedIn=!1,this.currentDate=Date.now()}static{this.styles=ROADMAP_MILESTONE_CARD_CSS}_dateDiffInDays(a,b){const utc1=Date.UTC(a.getFullYear(),a.getMonth(),a.getDate()),utc2=Date.UTC(b.getFullYear(),b.getMonth(),b.getDate()),MS_PER_DAY=86400000,daysDiff=Math.floor((utc2-utc1)/MS_PER_DAY);return{days:Math.abs(daysDiff),future:1>daysDiff}}_computeDate(dateStr,addYear=!1){const opts={month:"short",day:"numeric"};addYear&&(opts.year="numeric");const date=new Date(dateStr);return new Intl.DateTimeFormat("en-US",opts).format(date)}_fireEvent(eventName,detail){const event=new CustomEvent(eventName,{bubbles:!0,composed:!0,detail});this.dispatchEvent(event)}_isAnyFeatureReleased(){for(const shippingType of this._objKeys(this.channel?.features))if(0!=this.channel?.features[shippingType].length)return!0;return!1}toggleStar(e){e.preventDefault(),e.stopPropagation();const iconEl=e.target,featureId=+iconEl.dataset.featureId,newStarred=!this.starredFeatures.has(featureId);this._fireEvent("star-toggle-event",{feature:featureId,doStar:newStarred})}highlight(e){e.preventDefault(),e.stopPropagation();const iconEl=e.target.parentNode.parentNode,featureId=+iconEl.dataset.featureId;this._fireEvent("highlight-feature-event",{feature:featureId})}removeHighlight(e){e.preventDefault(),e.stopPropagation(),this._fireEvent("highlight-feature-event",{feature:null})}_computeDaysUntil(dateStr){const date=new Date(dateStr);if(isNaN(date.getTime()))return E$1;const today=new Date,diff=this._dateDiffInDays(date,today);return 1>diff.days?"coming soon":x$1`<sl-relative-time + class="no-squeeze" + date="${date.toISOString()}" + > + </sl-relative-time>`}_objKeys(obj){return obj?Object.keys(obj).sort():[]}hidePopup(e){e.relatedTarget!=this.renderRoot.querySelector("#detailed-info-link")&&(this.infoPopupRef.value.active=!1)}renderInfoIcon(){return x$1` + <sl-icon-button + name="info-circle" + id="info-button" + @click=${()=>this.infoPopupRef.value.active=!this.infoPopupRef.value.active} + @focusout=${this.hidePopup} + ></sl-icon-button> + + <sl-popup + anchor="info-button" + placement="bottom" + strategy="fixed" + ${n$2(this.infoPopupRef)} + > + <div class="popup-content"> + New versions are offered to users gradually. <br /> + See + <a + @focusout=${this.hidePopup} + id="detailed-info-link" + href="https://chromiumdash.appspot.com/schedule" + target="_blank" + >detailed dates</a + >. + </div> + </sl-popup> + `}renderCardHeader(){if(!this.channel)return E$1;const stableStart=110<=this.channel.version?this.channel?.early_stable:this.channel?.stable_date,logo=x$1` + <span class="chrome-logo"> + ${this.templateContent.channelTag?x$1` + <span class="channel-tag" + >${this.templateContent.channelTag}</span + > + `:E$1} + </span> + `;return x$1` + <div class="layout vertical center"> + <h1 class="channel_label">${this.templateContent.channelLabel}</h1> + <h1 + class="chrome_version layout horizontal center ${this.templateContent.h1Class}" + > + ${logo} Chrome ${this.channel?.version} + </h1> + </div> + ${this.showDates&&this.channel?.earliest_beta?x$1` + <div class="milestone_info layout horizontal center-center"> + <h3> + <span class="channel_label">Beta</span> ${this.templateContent.dateText} + <span class="milestone_info-beta"> + ${this._computeDate(this.channel?.earliest_beta)} - + ${this._computeDate(this.channel?.latest_beta)} + </span> + </h3> + </div> + <div class="milestone_info layout horizontal center-center"> + <h3> + <span class="channel_label">Stable</span> + ${this._computeDaysUntil(stableStart)} + <span class="release-stable" + >(${this._computeDate(stableStart,!0)})</span + > + ${this.renderInfoIcon()} + </h3> + </div> + `:E$1} + `}_isFeatureOutdated(accurateAsOf,liveChromeVersion){if(0===this.stableMilestone||!liveChromeVersion)return!1;if(this.stableMilestone+1!==liveChromeVersion&&this.stableMilestone+2!==liveChromeVersion)return!1;const isVerified=isVerifiedWithinGracePeriod(accurateAsOf,this.currentDate);return!isVerified}_cardFeatureItemTemplate(f,shippingType){return x$1` + <li + data-feature-id="${f.id}" + class="hbox align-top ${f.id==this.highlightFeature?"highlight":""}" + > + <chromedash-review-status-icon + .feature=${f} + ></chromedash-review-status-icon> + <span> + <a + id="feature_link" + href="/feature/${f.id}" + @mouseenter="${this.highlight}" + @mouseleave="${this.removeHighlight}" + > + ${f.name} + </a> + ${f.finch_urls?.map(url=>x$1` + <a + target="_blank" + class="experiment" + href=${url} + title="Deploying to some users as an experiment" + >Exp</a + > + `)} + </span> + <span class="spacer"></span> + <span class="icon_row"> + ${this._isFeatureOutdated(f.accurate_as_of,this.channel?.version)?x$1` + <span + class="tooltip" + id="outdated-icon" + title="Feature outdated - last checked for overall accuracy more than four weeks ago" + > + <sl-icon + name="exclamation-circle-fill" + data-tooltip + ></sl-icon> + </span> + `:E$1} + ${ORIGIN_TRIAL.includes(shippingType)?x$1` + <span class="tooltip" title="Origin Trial"> + <sl-icon + library="material" + name="extension" + class="experimental" + data-tooltip + ></sl-icon> + </span> + `:E$1} + ${DEPRECATION_TRIAL.includes(shippingType)?x$1` + <span class="tooltip" title="Deprecation Trial"> + <sl-icon + library="material" + name="extension" + class="experimental" + data-tooltip + ></sl-icon> + </span> + `:E$1} + ${REMOVED_STATUS.includes(shippingType)?x$1` + <span class="tooltip" title="Removed"> + <sl-icon + name="x-circle-fill" + class="remove" + data-tooltip + ></sl-icon> + </span> + `:E$1} + ${DEPRECATED_STATUS.includes(shippingType)?x$1` + <span class="tooltip" title="Deprecated"> + <sl-icon + name="exclamation-triangle-fill" + class="deprecated" + data-tooltip + ></sl-icon> + </span> + `:E$1} + ${this.signedIn?x$1` + <span + class="tooltip" + title="Receive an email notification when there are updates" + > + <sl-icon + name="${this.starredFeatures.has(+f.id)?"star-fill":"star"}" + class="pushicon" + data-feature-id="${f.id}" + @click="${this.toggleStar}" + > + </sl-icon> + </span> + `:E$1} + </span> + </li> + `}renderOTFeatures(features){if(!features)return[];const display=[],otFeatures=features.filter(f=>f.feature_type_int!==FEATURE_TYPES.FEATURE_TYPE_DEPRECATION_ID[0]),deprecationFeatures=features.filter(f=>f.feature_type_int===FEATURE_TYPES.FEATURE_TYPE_DEPRECATION_ID[0]);return 0<otFeatures.length&&display.push(x$1` + <h3 class="feature_shipping_type">${ORIGIN_TRIAL[0]}</h3> + <ul> + ${otFeatures.map(f=>x$1` ${this._cardFeatureItemTemplate(f,ORIGIN_TRIAL[0])} `)} + </ul> + `),0<deprecationFeatures.length&&display.push(x$1` + <h3 class="feature_shipping_type">${DEPRECATION_TRIAL[0]}</h3> + <ul> + ${deprecationFeatures.map(f=>x$1` + ${this._cardFeatureItemTemplate(f,DEPRECATION_TRIAL[0])} + `)} + </ul> + `),display}renderCardFeatureList(){const featureListItems=this._objKeys(this.channel?.features).map(shippingType=>{if(shippingType===ORIGIN_TRIAL[0])return this.renderOTFeatures(this.channel?.features[shippingType]);return 0===this.channel?.features[shippingType].length?E$1:x$1` + <h3 class="feature_shipping_type">${shippingType}</h3> + <ul> + ${this.channel?.features[shippingType].map(f=>x$1` ${this._cardFeatureItemTemplate(f,shippingType)} `)} + </ul> + `});return x$1` + <div class="features_list"> + ${this._isAnyFeatureReleased()?x$1` + <div class="features_header">${this.templateContent.featureHeader}:</div> + ${featureListItems} + </div>`:x$1` + <div class="features_header no_feature_released"> + ${NO_FEATURE_STRING} + </div> + `} + </div> + `}renderSkeletons(){return x$1` + <div class="layout vertical center"> + <h1 class="channel_label">${this.templateContent.channelLabel}</h1> + <h1 class="chrome_version layout horizontal sl-skeleton-header-container ${this.templateContent.h1Class}"> + <span class="chrome-logo"></span> + <sl-skeleton effect="sheen"></sl-skeleton> + </h1> + </div> + <div class="milestone_info layout horizontal center-center"> + <h3 class="sl-skeleton-header-container"> + <sl-skeleton effect="sheen"></sl-skeleton> + </h3> + </div> + <div class="milestone_info layout horizontal center-center"> + <h3 class="sl-skeleton-header-container"> + <sl-skeleton effect="sheen"></sl-skeleton> + </h3> + </div> + <div class="features_list"> + <div class="sl-skeleton-title-container"> + <sl-skeleton effect="sheen"></sl-skeleton> + </div> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </div> + </div> + <div class="features_list"> + <div class="sl-skeleton-title-container"> + <sl-skeleton effect="sheen"></sl-skeleton> + </div> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </div> + </div> + `}render(){return x$1` + <section class="release"> + ${this.channel?x$1` ${this.renderCardHeader()} ${this.renderCardFeatureList()} `:x$1` ${this.renderSkeletons()} `} + </section> + `}};__decorate$6([n$5({attribute:!1})],ChromedashRoadmapMilestoneCard.prototype,"starredFeatures",void 0),__decorate$6([n$5({attribute:!1})],ChromedashRoadmapMilestoneCard.prototype,"highlightFeature",void 0),__decorate$6([n$5({attribute:!1})],ChromedashRoadmapMilestoneCard.prototype,"templateContent",void 0),__decorate$6([n$5({attribute:!1})],ChromedashRoadmapMilestoneCard.prototype,"channel",void 0),__decorate$6([n$5({type:Boolean})],ChromedashRoadmapMilestoneCard.prototype,"showDates",void 0),__decorate$6([n$5({type:Boolean})],ChromedashRoadmapMilestoneCard.prototype,"signedIn",void 0),__decorate$6([n$5({attribute:!1})],ChromedashRoadmapMilestoneCard.prototype,"stableMilestone",void 0),__decorate$6([r$6()],ChromedashRoadmapMilestoneCard.prototype,"currentDate",void 0),ChromedashRoadmapMilestoneCard=__decorate$6([t$3("chromedash-roadmap-milestone-card")],ChromedashRoadmapMilestoneCard);var __decorate$5=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let roadmapHelpDialogEl;async function openRoadmapHelpDialog(){roadmapHelpDialogEl||(roadmapHelpDialogEl=document.createElement("chromedash-roadmap-help-dialog"),document.body.appendChild(roadmapHelpDialogEl),await roadmapHelpDialogEl.updateComplete),roadmapHelpDialogEl.show()}let ChromedashRoadmapHelpDialog=class ChromedashRoadmapHelpDialog extends i$4{static get styles(){return[...SHARED_STYLES,i$7` + #dialog-content { + max-width: 60rem; + } + #legend li { + padding: var(--content-padding-quarter); + white-space: nowrap; + } + #legend span { + display: inline-block; + width: 8em; + } + + #legend sl-icon { + width: 26px; + height: 18px; + } + sl-icon.not-started { + color: var(--gate-preparing-icon-color); + } + sl-icon.in-progress { + color: var(--gate-pending-icon-color); + } + sl-icon.needs-work { + color: var(--gate-needs-work-icon-color); + } + sl-icon.approved { + color: var(--gate-approved-icon-color); + } + sl-icon.denied { + color: var(--gate-denied-icon-color); + } + `]}show(){this.renderRoot.querySelector("sl-dialog")?.show()}hide(){this.renderRoot.querySelector("sl-dialog")?.hide()}renderDialogContent(){return x$1` + <div id="dialog-content"> + <ul id="legend"> + <li> + <sl-icon + library="material" + class="approved" + name="check_circle_filled_20px" + ></sl-icon> + <span>Approved</span> + <td>Reviewers approved feature at this stage</td> + </li> + <li> + <sl-icon + library="material" + class="not-started" + name="arrow_circle_right_20px" + ></sl-icon> + <span>Not started</span> + <td>Feature owners have not requested reviews yet</td> + </li> + <li> + <sl-icon + library="material" + class="in-progress" + name="pending_20px" + ></sl-icon> + <span>In-progress</span> + <td>Not all reviews have finished</td> + </li> + <li> + <sl-icon + library="material" + class="needs-work" + name="autorenew_20px" + ></sl-icon> + <span>Needs work</span> + <td>Reviewers have asked for changes</td> + </li> + <li> + <sl-icon + library="material" + class="denied" + name="block_20px" + ></sl-icon> + <span>Denied</span> + <td>Reviewers suggested directional changes</td> + </li> + </ul> + </div> + `}render(){return x$1` + <sl-dialog label="Roadmap legend" style="--width:fit-content"> + ${this.renderDialogContent()} + </sl-dialog> + `}};ChromedashRoadmapHelpDialog=__decorate$5([t$3("chromedash-roadmap-help-dialog")],ChromedashRoadmapHelpDialog);var __decorate$4=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashRoadmapPage=class ChromedashRoadmapPage extends i$4{constructor(){super(...arguments),this.sectionRef=e$1(),this.roadmapRef=e$1(),this.cardWidth=0,this.numColumns=0,this.viewOffset=0,this.boundHandleResize=this.handleResize.bind(this)}static get styles(){return[...SHARED_STYLES,i$7` + .animate { + transition: margin 0.4s ease; + } + #help-button { + font-size: 1.4rem; + color: var(--unimportant-text-color); + float: right; + } + + #releases-section { + overflow: hidden; + } + + .timeline-controls { + text-align: center; + padding-bottom: var(--content-padding); + margin: 0 var(--content-padding-half); + } + `]}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.boundHandleResize)}disconnectedCallback(){window.removeEventListener("resize",this.boundHandleResize),super.disconnectedCallback()}firstUpdated(){this.handleResize()}handleResize(){const containerWidth=this.sectionRef.value.offsetWidth,margin=16;let numColumns=3;768>containerWidth?numColumns=1:1152>containerWidth&&(numColumns=2),this.numColumns=numColumns,containerWidth&&(this.cardWidth=containerWidth/numColumns-margin),this.updateRoadmapMargin(!1)}handleMove(e){const roadmap=this.roadmapRef.value;roadmap?.lastFutureFetchedOn&&("next-button"==e.target.id?(this.viewOffset-=1,roadmap.lastMilestoneVisible+=1,this.updateRoadmapMargin(!0)):(this.viewOffset+=1,roadmap.lastMilestoneVisible-=1,this.updateRoadmapMargin(!0)),1<roadmap.lastMilestoneVisible-roadmap.lastFutureFetchedOn?roadmap.fetchNextBatch(roadmap.lastFutureFetchedOn+1):0>=roadmap.lastMilestoneVisible-roadmap.lastPastFetchedOn&&roadmap.fetchPreviousBatch(roadmap.lastPastFetchedOn-1))}updateRoadmapMargin(animated){const roadmap=this.roadmapRef.value;if(!roadmap)return;animated?roadmap.classList.add("animate"):roadmap.classList.remove("animate");const margin=16;roadmap.style.marginLeft=this.viewOffset*(this.cardWidth+16)+"px",roadmap.style.left=roadmap.cardOffset*(this.cardWidth+16)+"px"}renderHelpIcon(){return x$1` + <sl-icon + id="help-button" + library="material" + name="help_20px" + @click="${openRoadmapHelpDialog}" + > + </sl-icon> + `}render(){return x$1` + <div id="subheader"> + <div> + <h3>Roadmap</h3> + </div> + </div> + <section id="releases-section" ${n$2(this.sectionRef)}> + <div class="timeline-controls"> + <button + id="previous-button" + aria-label="Button to move to previous release" + @click=${this.handleMove} + > + Previous + </button> + <button + id="next-button" + aria-label="Button to move to later release" + @click=${this.handleMove} + > + Next + </button> + ${this.renderHelpIcon()} + </div> + <chromedash-roadmap + ${n$2(this.roadmapRef)} + class="animate" + aria-label="List of milestone releases" + .numColumns=${this.numColumns} + .cardWidth=${this.cardWidth} + ?signedIn=${!!this.user} + > + </chromedash-roadmap> + </section> + `}};__decorate$4([n$5({type:Object,attribute:!1})],ChromedashRoadmapPage.prototype,"user",void 0),__decorate$4([r$6()],ChromedashRoadmapPage.prototype,"cardWidth",void 0),__decorate$4([r$6()],ChromedashRoadmapPage.prototype,"numColumns",void 0),__decorate$4([r$6()],ChromedashRoadmapPage.prototype,"viewOffset",void 0),ChromedashRoadmapPage=__decorate$4([t$3("chromedash-roadmap-page")],ChromedashRoadmapPage);var __decorate$3=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashUserlist=class ChromedashUserlist extends i$4{constructor(){super(...arguments),this.users=[]}static get styles(){return[...SHARED_STYLES,i$7` + form { + padding: var(--content-padding); + background: var(--card-background); + border: var(--card-border); + margin-bottom: var(--content-padding); + max-width: 20em; + } + form > * + * { + margin-top: var(--content-padding-half); + } + + ul { + margin-top: 10px; + } + ul li { + transition: opacity 600ms ease-in-out; + margin-bottom: 5px; + } + ul li.faded { + opacity: 0; + } + ul li a { + margin-right: 10px; + } + `]}addUser(user){this.users.splice(0,0,user),this.users=this.users.slice(0)}removeUser(idx){this.users.splice(idx,1),this.users=this.users.slice(0)}sortUsers(){this.users.sort((a,b)=>(!a.is_admin||b.is_admin)&&(!a.is_site_editor||b.is_site_editor||b.is_admin)?(!b.is_admin||a.is_admin)&&(!b.is_site_editor||a.is_site_editor||a.is_admin)?a.email.localeCompare(b.email):1:-1)}_onAdminToggle(){const formEl=this.renderRoot.querySelector("form"),adminCheckbox=formEl?.querySelector("input[name=\"is_admin\"]"),siteEditorCheckbox=formEl?.querySelector("input[name=\"is_site_editor\"]");adminCheckbox.checked?(siteEditorCheckbox.checked=!0,siteEditorCheckbox.disabled=!0):siteEditorCheckbox.disabled=!1}async ajaxSubmit(e){e.preventDefault();const formEl=this.renderRoot.querySelector("form");if(formEl.checkValidity()){const emailInput=formEl.querySelector("input[name=\"email\"]"),adminCheckbox=formEl.querySelector("input[name=\"is_admin\"]"),siteEditorCheckbox=formEl.querySelector("input[name=\"is_site_editor\"]"),email=emailInput?.value,isAdmin=adminCheckbox?.checked,isSiteEditor=siteEditorCheckbox?.checked;window.csClient.createAccount(email,isAdmin,isSiteEditor).then(json=>{json.error_message?alert(json.error_message):(this.addUser(json),formEl.reset(),formEl.querySelector("input[name=\"is_site_editor\"]").disabled=!1)})}}ajaxDelete(e){if(e.preventDefault(),!confirm("Remove user?"))return;const idx=e.target.dataset.index;window.csClient.deleteAccount(e.target.dataset.account).then(()=>{this.removeUser(idx)})}render(){return this.sortUsers(),x$1` + <form id="form" name="user_form" method="post"> + <div> + <input + type="email" + placeholder="Email address" + name="email" + required + /> + </div> + <div> + <label + ><input + type="checkbox" + name="is_admin" + @click="${this._onAdminToggle}" + /> + User is admin</label + > + </div> + <div> + <label + ><input type="checkbox" name="is_site_editor" /> User is site + editor</label + > + </div> + <div> + <input type="submit" @click="${this.ajaxSubmit}" value="Add user" /> + </div> + </form> + + <ul id="user-list"> + ${this.users.map((user,index)=>x$1` + <li> + <a + href="#" + data-index="${index}" + data-account="${user.id}" + @click="${this.ajaxDelete}" + >delete</a + > + ${user.is_admin?x$1`(admin)`:E$1} + ${!user.is_admin&&user.is_site_editor?x$1`(site editor)`:E$1} + <span>${user.email}</span> + </li> + `)} + </ul> + `}};__decorate$3([r$6()],ChromedashUserlist.prototype,"users",void 0),ChromedashUserlist=__decorate$3([t$3("chromedash-userlist")],ChromedashUserlist);var __decorate$2=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};let ChromedashEnterprisePage=class ChromedashEnterprisePage extends ChromedashAllFeaturesPage{renderBox(query){return x$1` + <chromedash-feature-table + query=${query} + ?signedIn=${!!this.user} + ?canEdit=${this.user&&this.user.can_edit_all} + .starredFeatures=${this.starredFeatures} + @star-toggle-event=${this.handleStarToggle} + num="100" + alwaysOfferPagination + columns="normal" + > + </chromedash-feature-table> + `}renderEnterpriseFeatures(){return this.renderBox("feature_type=\"New Feature or removal affecting enterprises\" OR enterprise_impact>1")}render(){return x$1` + <h2>Enterprise features and breaking changes</h2> + ${this.renderEnterpriseFeatures()} + `}};ChromedashEnterprisePage=__decorate$2([t$3("chromedash-enterprise-page")],ChromedashEnterprisePage);var __decorate$1=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const milestoneQueryParamKey="milestone";let ChromedashEnterpriseReleaseNotesPage=class ChromedashEnterpriseReleaseNotesPage extends i$4{constructor(){super(...arguments),this.currentChromeBrowserUpdates=[],this.upcomingChromeBrowserUpdates=[],this.currentChromeEnterpriseCore=[],this.upcomingChromeEnterpriseCore=[],this.currentChromeEnterprisePremium=[],this.upcomingChromeEnterprisePremium=[],this.features=[],this.editingFeatureIds=new Set,this.previewingIds=new Set}static get styles(){return[...SHARED_STYLES,i$7` + :host > * { + margin: 2rem 0; + } + + *[hidden] { + display: none; + } + h1 { + font-size: 2rem; + line-height: 2.5rem; + margin: 0 0 0.5rem; + } + + h2 { + font-size: 1.5rem; + letter-spacing: 0rem; + line-height: 2rem; + margin: 2rem 0 0.5rem; + font-weight: bold; + } + + h3 { + margin: 16px 0; + } + + table { + width: 100%; + } + + tr { + background-color: var(--table-row-background); + } + + th { + background-color: var(--table-header-background); + } + + table, + th, + td { + border: var(--table-divider); + } + + table th, + .bold { + font-weight: bold; + } + + table th, + table td { + padding: 16px 32px; + vertical-align: top; + } + + ul { + padding-inline-start: 1rem; + } + + .stage { + margin-top: 16px; + } + + .feature { + margin: 1rem 0 2rem; + background: var(--card-background); + border: var(--card-border); + border-radius: var(--default-border-radius); + box-shadow: var(--card-box-shadow); + padding: var(--content-padding); + } + + .toremove { + margin: 1rem 0; + } + + .labels { + margin-bottom: var(--content-padding-half); + } + .confidential::part(base) { + background: var(--warning-background); + font-weight: bold; + } + .reviewed::part(base) { + background: var(--sl-color-blue-100); + } + .ready::part(base) { + background: var(--success-background); + } + + .toremove { + font-style: italic; + } + + td:not(:first-child), + th:not(:first-child) { + text-align: center; + } + + .edit-button { + float: right; + } + .feature-summary { + margin-bottom: var(--content-padding); + } + .rollout-milestone { + width: 6em; + } + .rollout-platforms { + margin-left: 2em; + flex-grow: 1; + } + + .screenshots { + display: flex; + flex-wrap: wrap; + gap: 1rem; + } + + .screenshots img { + flex: 0 1 auto; + max-height: 300px; + max-width: calc(50% - 0.5rem); + } + `]}convertShippingStageToRolloutStages(stage){const milestones=[stage.desktop_first,stage.android_first,stage.ios_first,stage.webview_first,stage.desktop_last,stage.android_last,stage.ios_last,stage.webview_last],milestoneAndPlatformsMap=milestones.reduce((acc,milestone)=>({...acc,[milestone]:new Set}),{});return stage.desktop_first&&(milestoneAndPlatformsMap[stage.desktop_first].add(PLATFORM_CATEGORIES.PLATFORM_WINDOWS[0]),milestoneAndPlatformsMap[stage.desktop_first].add(PLATFORM_CATEGORIES.PLATFORM_MAC[0]),milestoneAndPlatformsMap[stage.desktop_first].add(PLATFORM_CATEGORIES.PLATFORM_LINUX[0])),stage.android_first&&milestoneAndPlatformsMap[stage.android_first].add(PLATFORM_CATEGORIES.PLATFORM_ANDROID[0]),stage.ios_first&&milestoneAndPlatformsMap[stage.ios_first].add(PLATFORM_CATEGORIES.PLATFORM_IOS[0]),stage.webview_first&&milestoneAndPlatformsMap[stage.webview_first].add(PLATFORM_CATEGORIES.PLATFORM_ANDROID[0]),stage.desktop_last&&(milestoneAndPlatformsMap[stage.desktop_last].add(PLATFORM_CATEGORIES.PLATFORM_WINDOWS[0]),milestoneAndPlatformsMap[stage.desktop_last].add(PLATFORM_CATEGORIES.PLATFORM_MAC[0]),milestoneAndPlatformsMap[stage.desktop_last].add(PLATFORM_CATEGORIES.PLATFORM_LINUX[0])),stage.android_last&&milestoneAndPlatformsMap[stage.android_last].add(PLATFORM_CATEGORIES.PLATFORM_ANDROID[0]),stage.ios_last&&milestoneAndPlatformsMap[stage.ios_last].add(PLATFORM_CATEGORIES.PLATFORM_IOS[0]),stage.webview_last&&milestoneAndPlatformsMap[stage.webview_last].add(PLATFORM_CATEGORIES.PLATFORM_ANDROID[0]),Object.entries(milestoneAndPlatformsMap).map(([milestone,platforms])=>({stage_type:STAGE_ENT_ROLLOUT,rollout_milestone:+milestone,rollout_platforms:Array.from(platforms).map(String),rollout_stage_plan:ROLLOUT_STAGE_PLAN_CATEGORIES.ROLLOUT_STAGE_PLAN_CUSTOM[0],rollout_details:"No rollout step"}))}convertFeatureShippingStagesToRolloutStages(f){const rollouts=f.stages.filter(s=>s.stage_type===STAGE_ENT_ROLLOUT),converted=f.stages.filter(s=>STAGE_TYPES_SHIPPING.has(s.stage_type)).map(s=>this.convertShippingStageToRolloutStages(s)).flatMap(x=>x);let newStages=0<rollouts.length?rollouts:converted;return newStages=newStages.filter(s=>!!s.rollout_milestone),newStages=newStages.sort((a,b)=>a.rollout_milestone-b.rollout_milestone),{...f,stages:newStages}}updateFeatures(features){features=features.map(f=>this.convertFeatureShippingStagesToRolloutStages(f)),this.features=features.filter(({stages})=>stages.some(s=>s.stage_type===STAGE_ENT_ROLLOUT)),this.categorizeFeatures()}categorizeFeatures(){var _Mathmin1=Math.min;const currentFeatures=this.features.filter(({stages})=>stages.some(s=>s.rollout_milestone===this.selectedMilestone)).sort((a,b)=>b.enterprise_impact-a.enterprise_impact);this.currentChromeBrowserUpdates=currentFeatures.filter(f=>f.enterprise_product_category===ENTERPRISE_PRODUCT_CATEGORY.CHROME_BROWSER_UPDATE[0]),this.currentChromeEnterpriseCore=currentFeatures.filter(f=>f.enterprise_product_category===ENTERPRISE_PRODUCT_CATEGORY.CHROME_ENTERPRISE_CORE[0]),this.currentChromeEnterprisePremium=currentFeatures.filter(f=>f.enterprise_product_category===ENTERPRISE_PRODUCT_CATEGORY.CHROME_ENTERPRISE_PREMIUM[0]);const upcomingFeatures=this.features.filter(({stages})=>!stages.some(s=>s.rollout_milestone===this.selectedMilestone)&&stages.some(s=>s.rollout_milestone>this.selectedMilestone)).sort((a,b)=>{const minA=_Mathmin1(...a.stages.filter(s=>(s.rollout_milestone||0)>this.selectedMilestone).map(s=>s.rollout_milestone))||0,minB=_Mathmin1(...b.stages.filter(s=>(s.rollout_milestone||0)>this.selectedMilestone).map(s=>s.rollout_milestone))||0;return minA-minB});this.upcomingChromeBrowserUpdates=upcomingFeatures.filter(f=>f.enterprise_product_category===ENTERPRISE_PRODUCT_CATEGORY.CHROME_BROWSER_UPDATE[0]),this.upcomingChromeEnterpriseCore=upcomingFeatures.filter(f=>f.enterprise_product_category===ENTERPRISE_PRODUCT_CATEGORY.CHROME_ENTERPRISE_CORE[0]),this.upcomingChromeEnterprisePremium=upcomingFeatures.filter(f=>f.enterprise_product_category===ENTERPRISE_PRODUCT_CATEGORY.CHROME_ENTERPRISE_PREMIUM[0])}replaceOneFeature(revisedFeature){const revisedList=this.features.map(f=>f.id===revisedFeature.id?revisedFeature:f);this.features=revisedList,this.categorizeFeatures()}connectedCallback(){window.csClient.getChannels().then(channels=>{this.channels=channels;const queryParams=parseRawQuery(window.location.search);milestoneQueryParamKey in queryParams?this.selectedMilestone=parseInt(queryParams[milestoneQueryParamKey],10):(this.selectedMilestone=this.channels.stable.version,updateURLParams(milestoneQueryParamKey,this.selectedMilestone))}).then(()=>window.csClient.getFeaturesForEnterpriseReleaseNotes(this.selectedMilestone)).then(({features})=>this.updateFeatures(features)).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")}).finally(()=>super.connectedCallback())}updateSelectedMilestone(){const milestoneSelector=this.shadowRoot.querySelector("#milestone-selector");this.selectedMilestone=parseInt(milestoneSelector.value),window.csClient.getFeaturesForEnterpriseReleaseNotes(this.selectedMilestone).then(({features})=>this.updateFeatures(features)).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")})}update(changedProperties){this.selectedMilestone!==void 0&&updateURLParams(milestoneQueryParamKey,this.selectedMilestone),super.update(changedProperties)}renderMilestoneSelector(){const options=[];for(let i=0;i<this.selectedMilestone+20;++i)options.push(x$1`<sl-option value="${i}">Chrome ${i} release summary</sl-option>`);return x$1` <sl-select + id="milestone-selector" + placement="top" + hoist + size="small" + value=${this.selectedMilestone} + @sl-change=${this.updateSelectedMilestone} + > + ${options.map(option=>option)} + </sl-select>`}getFeatureMarkerForCategory(feature,category){return feature.enterprise_feature_categories.includes(category.toString())?"\u2713":""}renderReleaseNotesSummarySection(title,features){return x$1` + <tr> + <th>${title}</th> + <th>Security / Privacy</th> + <th>User productivity / Apps</th> + <th>Management</th> + </tr> + ${0===features.length?x$1`<tr> + <td colspan="4">Nothing</td> + </tr>`:features.map(f=>x$1` + <tr> + <td>${f.name}</td> + <td> + ${this.getFeatureMarkerForCategory(f,ENTERPRISE_FEATURE_CATEGORIES.SECURITYANDPRIVACY[0])} + </td> + <td> + ${this.getFeatureMarkerForCategory(f,ENTERPRISE_FEATURE_CATEGORIES.USERPRODUCTIVITYANDAPPS[0])} + </td> + <td> + ${this.getFeatureMarkerForCategory(f,ENTERPRISE_FEATURE_CATEGORIES.MANAGEMENT[0])} + </td> + </tr> + `)} + `}renderReleaseNotesSummary(){return x$1` <table id="release-notes-summary"> + ${this.renderReleaseNotesSummarySection("Chrome Browser updates",this.currentChromeBrowserUpdates)} + ${this.renderReleaseNotesSummarySection("Chrome Enterprise Core (CEC)",this.currentChromeEnterpriseCore)} + ${this.renderReleaseNotesSummarySection("Chrome Enterprise Premium (CEP, paid SKU)",this.currentChromeEnterprisePremium)} + ${this.renderReleaseNotesSummarySection("Upcoming Chrome Browser updates",this.upcomingChromeBrowserUpdates)} + ${this.renderReleaseNotesSummarySection("Upcoming Chrome Enterprise Core (CEC)",this.upcomingChromeEnterpriseCore)} + ${this.renderReleaseNotesSummarySection("Upcoming Chrome Enterprise Premium (CEP, paid SKU)",this.upcomingChromeEnterprisePremium)} + </table>`}getStageTitle(stage){if(0===stage.rollout_platforms.length||stage.rollout_platforms.length===Object.values(PLATFORMS_DISPLAYNAME).length)return`Chrome ${stage.rollout_milestone}`;const rollout_staqe_plan_display=stage.rollout_stage_plan===ROLLOUT_STAGE_PLAN_CATEGORIES.ROLLOUT_STAGE_PLAN_CUSTOM[0]?"":ROLLOUT_STAGE_PLAN_DISPLAYNAME[stage.rollout_stage_plan];return`Chrome ${stage.rollout_milestone} on `+`${stage.rollout_platforms.map(p=>PLATFORMS_DISPLAYNAME[p]).join(", ")}`+` ${rollout_staqe_plan_display?"- "+rollout_staqe_plan_display:""}`}userCanEdit(f){return this.user&&(this.user.can_edit_all||this.user.editable_features.includes(f.id))}userCanReview(){return this.user&&(this.user.is_admin||this.user.can_review_release_notes)}startEditing(featureId){const newEditing=new Set(this.editingFeatureIds);newEditing.add(featureId),this.editingFeatureIds=newEditing}cancel(featureId){const newEditing=new Set(this.editingFeatureIds);newEditing.delete(featureId),this.editingFeatureIds=newEditing}nowString(){const now=new Date,formatter=new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,timeZone:"UTC"});let nowStr=formatter.format(now);return nowStr=nowStr.replace(",",""),nowStr}save(f){const fieldValues=[],addFieldValue=(name,el,originalValue,stage)=>{const value="SL-CHECKBOX"===el?.tagName?el?.checked:el?.value;value!==void 0&&""+value!=""+originalValue&&fieldValues.push({name,value,touched:!0,stageId:stage?.id})};let nameEl=this.shadowRoot?.querySelector("#edit-name-"+f.id);addFieldValue("name",nameEl,f.name);let confidentialEl=this.shadowRoot?.querySelector("#edit-confidential-"+f.id);addFieldValue("confidential",confidentialEl,f.confidential);let reviewedEl=this.shadowRoot?.querySelector("#edit-reviewed-"+f.id);addFieldValue("is_releasenotes_content_reviewed",reviewedEl,f.is_releasenotes_content_reviewed);let readyEl=this.shadowRoot?.querySelector("#edit-ready-"+f.id);addFieldValue("is_releasenotes_publish_ready",readyEl,f.is_releasenotes_publish_ready);let summaryEl=this.shadowRoot?.querySelector("#edit-summary-"+f.id);addFieldValue("summary",summaryEl,f.summary);const isMarkdown=(f.markdown_fields||[]).includes("summary");let markdownEl=this.shadowRoot?.querySelector("#summary-is-markdown-"+f.id);addFieldValue("summary_is_markdown",markdownEl,isMarkdown);for(const s of f.stages)if(s.id){const milestoneEl=this.shadowRoot?.querySelector("#edit-rollout-milestone-"+s.id);addFieldValue("rollout_milestone",milestoneEl,s.rollout_milestone,s);const platformsEl=this.shadowRoot?.querySelector("#edit-rollout-platforms-"+s.id);addFieldValue("rollout_platforms",platformsEl,s.rollout_platforms,s);const rolloutStagePlanEl=this.shadowRoot?.querySelector("#edit-rollout-stage-plan-"+s.id);addFieldValue("rollout_stage_plan",rolloutStagePlanEl,s.rollout_stage_plan,s);const detailsEl=this.shadowRoot?.querySelector("#edit-rollout-details-"+s.id);addFieldValue("rollout_details",detailsEl,s.rollout_details,s)}const submitBody=formatFeatureChanges(fieldValues,f.id);window.csClient.updateFeature(submitBody).then(resp=>{window.csClient.getFeature(f.id).then(resp2=>{this.replaceOneFeature(this.convertFeatureShippingStagesToRolloutStages(resp2))})}).catch(()=>{showToastMessage("Some errors occurred. Please refresh the page or try again later.")}).finally(()=>{this.cancel(f.id)})}renderToRemoveParagraph(f){return x$1` + <p class="toremove"> + <b>< To remove</b> + - <a target="_blank" href="/feature/${f.id}">Feature details</a> - + <b>Owners:</b> ${f.browsers.chrome.owners?.join(", ")} - + <b>Editors:</b> ${(f.editors||[]).join(", ")} - + <b>Enterprise impact:</b> ${ENTERPRISE_IMPACT_DISPLAYNAME[f.enterprise_impact]} + - <b>First notice:</b> ${f.first_enterprise_notification_milestone} - + <b>Last updated:</b> + <a + href="/feature/${f.id}/activity" + target="_blank" + title=${o$6(f.updated.when)} + > + ${renderRelativeDate(f.updated.when)} + </a> + by ${f.updated.by} + <b>></b> + </p> + `}renderEditButton(f){return this.userCanEdit(f)&&!this.editingFeatureIds.has(f.id)?x$1` + <sl-button + @click=${()=>{this.startEditing(f.id)}} + class="edit-button" + size="small" + >Edit</sl-button + > + `:x$1``}renderLabels(f){let confidentialLabel=x$1``;f.confidential&&(confidentialLabel=x$1`<sl-tag pill size="small" class="confidential" + >CONFIDENTIAL</sl-tag + >`);let reviewedLabel=x$1``;f.is_releasenotes_content_reviewed&&(reviewedLabel=x$1`<sl-tag pill size="small" class="reviewed" + >Release Notes Content Finalized</sl-tag + >`);let readyLabel=x$1``;return f.is_releasenotes_publish_ready&&(readyLabel=x$1`<sl-tag pill size="small" class="ready" + >Ready for Publishing</sl-tag + >`),x$1`<div class="labels"> + ${confidentialLabel} ${reviewedLabel} ${readyLabel} + </div>`}renderEditableLabels(f){let confidentialBox=x$1` + <div> + <sl-checkbox + class="feature-confidential" + id="edit-confidential-${f.id}" + ?checked=${f.confidential} + size="small" + > + Confidential + </sl-checkbox> + </div> + `,reviewedBox=x$1``;this.userCanReview()&&(reviewedBox=x$1` + <div> + <sl-checkbox + class="feature-reviewed" + id="edit-reviewed-${f.id}" + ?checked=${f.is_releasenotes_content_reviewed} + size="small" + > + Release Notes Content Finalized + </sl-checkbox> + </div> + `);let readyBox=x$1``;return this.userCanReview()&&(readyBox=x$1`<div> + <sl-checkbox + class="feature-ready" + id="edit-ready-${f.id}" + ?checked=${f.is_releasenotes_publish_ready} + size="small" + > + Ready for Publishing + </sl-checkbox> + </div> `),x$1`${confidentialBox} ${reviewedBox} ${readyBox}`}renderFeatureName(f){return x$1`<strong>${f.name}</strong>`}renderEditableFeatureName(f){return x$1` + <sl-input + class="feature-name" + id="edit-name-${f.id}" + value=${f.name} + size="small" + > + </sl-input> + `}renderFeatureSummary(f){const isMarkdown=(f.markdown_fields||[]).includes("summary"),markup=autolink(f.summary,[],isMarkdown);return isMarkdown?x$1`${markup}`:x$1`<p class="summary preformatted">${markup}</p>`}handlePreviewChecked(e,featureOrStageId){const newPreviewing=new Set(this.previewingIds);e.target.checked?newPreviewing.add(featureOrStageId):newPreviewing.delete(featureOrStageId),this.previewingIds=newPreviewing}renderEditableFeatureSummary(f){const isMarkdown=(f.markdown_fields||[]).includes("summary"),isPreviewing=this.previewingIds.has(f.id),editor=x$1` <sl-textarea + ?hidden=${isPreviewing} + class="feature-summary" + id="edit-summary-${f.id}" + value=${f.summary} + size="small" + resize="auto" + > + </sl-textarea>`,previewText=this.shadowRoot?.querySelector("#edit-summary-"+f.id)?.value??f.summary,markdownChecked=this.shadowRoot?.querySelector("#summary-is-markdown-"+f.id)?.checked??isMarkdown,preview=x$1` + <div + id="preview" + ?hidden=${!isPreviewing} + style="border:var(--card-border); padding:0 var(--content-padding); min-height:14em; background:var(--table-alternate-background)" + > + ${autolink(previewText,[],markdownChecked)} + </div> + `,controls=x$1` + <sl-checkbox + class="markdown-checkbox" + id="summary-is-markdown-${f.id}" + size="small" + ?checked=${isMarkdown} + >Use markdown</sl-checkbox + > + <sl-icon-button + name="info-circle" + id="info-button" + title="GitHub flavored markdown docs" + href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax" + target="_blank" + ></sl-icon-button> + <sl-checkbox + id="show-preview-${f.id}" + size="small" + ?checked=${isPreviewing} + @sl-change=${e=>this.handlePreviewChecked(e,f.id)} + > + Preview + </sl-checkbox> + `;return x$1` ${preview} ${editor} ${controls} `}renderEditableStageItem(f,s,shouldDisplayStageTitleInBold){const platforms=s.rollout_platforms,choices=PLATFORM_CATEGORIES,availableOptions=Object.values(choices).filter(([value,label,obsolete])=>!obsolete||platforms.includes(""+value)),isPreviewing=this.previewingIds.has(s.id),editor=x$1` <sl-textarea + ?hidden=${isPreviewing} + class="rollout-details" + id="edit-rollout-details-${s.id}" + value=${s.rollout_details} + size="small" + rows="1" + resize="auto" + > + </sl-textarea>`,previewText=this.shadowRoot?.querySelector("#edit-rollout-details-"+s.id)?.value??s.rollout_details,preview=x$1` + <div + ?hidden=${!isPreviewing} + id="preview" + style="border:var(--card-border); padding:0 var(--content-padding); min-height:14em; background:var(--table-alternate-background)" + > + ${autolink(previewText,[],!0)} + </div> + `,controls=x$1` + <sl-checkbox class="markdown-checkbox" size="small" checked disabled + >Use markdown</sl-checkbox + > + <sl-icon-button + name="info-circle" + id="info-button" + title="GitHub flavored markdown docs" + href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax" + target="_blank" + ></sl-icon-button> + <sl-checkbox + id="show-preview-${s.id}" + size="small" + ?checked=${isPreviewing} + @sl-change=${e=>this.handlePreviewChecked(e,s.id)} + > + Preview + </sl-checkbox> + `;return x$1` + <li class="stage"> + <div class="hbox"> + <sl-input + class="rollout-milestone" + id="edit-rollout-milestone-${s.id}" + type="number" + value=${s.rollout_milestone} + ></sl-input> + + <sl-select + class="rollout-platforms" + multiple + clearable + id="edit-rollout-platforms-${s.id}" + .value=${platforms} + > + ${availableOptions.map(([value,label])=>x$1` + <sl-option value="${value}"> ${label} </sl-option> + `)} + </sl-select> + </div> + <sl-select + class="rollout-stage-plan" + id="edit-rollout-stage-plan-${s.id}" + value=${s.rollout_stage_plan} + > + ${Object.values(ROLLOUT_STAGE_PLAN_CATEGORIES).map(([value,label])=>x$1`<sl-option value=${value}>${label}</sl-option>`)} + </sl-select> + ${preview} ${editor} ${controls} + </li> + `}renderStageItem(f,s,shouldDisplayStageTitleInBold){let details=x$1``;if(s.rollout_details){const markup=autolink(s.rollout_details,[],!0);details=x$1`${markup}`}return x$1` + <li class="stage"> + <span + class="${shouldDisplayStageTitleInBold(s.rollout_milestone,f.stages.map(s=>s.rollout_milestone).sort())?"bold":""}" + > + ${this.getStageTitle(s)} + </span> + ${details} + </li> + `}renderSaveAndCancel(f){return this.editingFeatureIds.has(f.id)?x$1` + <sl-button + class="save-button" + @click=${()=>{this.save(f)}} + size="small" + variant="primary" + >Save</sl-button + > + <sl-button + class="cancel-button" + @click=${()=>{this.cancel(f.id)}} + size="small" + >Cancel</sl-button + > + `:x$1``}renderFeatureReleaseNote(f,shouldDisplayStageTitleInBold){const isEditing=this.editingFeatureIds.has(f.id);return x$1` <section class="feature"> + ${this.renderEditButton(f)} + ${isEditing?this.renderEditableLabels(f):this.renderLabels(f)} + ${isEditing?this.renderEditableFeatureName(f):this.renderFeatureName(f)} + ${this.renderToRemoveParagraph(f)} + ${isEditing?this.renderEditableFeatureSummary(f):this.renderFeatureSummary(f)} + <ul class="stages"> + ${f.stages.map(s=>isEditing&&s.id?this.renderEditableStageItem(f,s,shouldDisplayStageTitleInBold):this.renderStageItem(f,s,shouldDisplayStageTitleInBold))} + </ul> + ${this.renderSaveAndCancel(f)} + + <div class="screenshots"> + ${f.screenshot_links.map((url,i)=>x$1`<img src="${url}" alt="Feature screenshot ${i+1}" />`)} + </div> + </section>`}renderReleaseNotesDetailsSection(title,features,shouldDisplayStageTitleInBold){return x$1` <div class="note-section"> + <h2>${title}</h2> + ${features.map(f=>this.renderFeatureReleaseNote(f,shouldDisplayStageTitleInBold))} + </div>`}renderReleaseNotesDetails(){return x$1` ${this.renderReleaseNotesDetailsSection("Chrome Browser updates",this.currentChromeBrowserUpdates,m=>m===this.selectedMilestone)} + ${this.renderReleaseNotesDetailsSection("Chrome Enterprise Core (CEC)",this.currentChromeEnterpriseCore,m=>m===this.selectedMilestone)} + ${this.renderReleaseNotesDetailsSection("Chrome Enterprise Premium (CEP, paid SKU)",this.currentChromeEnterprisePremium,m=>m===this.selectedMilestone)} + ${this.renderReleaseNotesDetailsSection("Upcoming Chrome Browser updates",this.upcomingChromeBrowserUpdates,(m,milestones)=>milestones.find(x=>parseInt(x)>this.selectedMilestone)===m)} + ${this.renderReleaseNotesDetailsSection("Upcoming Chrome Enterprise Core (CEC)",this.upcomingChromeEnterpriseCore,(m,milestones)=>milestones.find(x=>parseInt(x)>this.selectedMilestone)===m)} + ${this.renderReleaseNotesDetailsSection("Upcoming Chrome Enterprise Premium (CEP, paid SKU)",this.upcomingChromeEnterprisePremium,(m,milestones)=>milestones.find(x=>parseInt(x)>this.selectedMilestone)===m)}`}render(){return x$1` + <h1>Chrome Enterprise and Education release notes</h1> + ${this.renderMilestoneSelector()} ${this.renderReleaseNotesSummary()} + ${this.renderReleaseNotesDetails()} + `}};__decorate$1([n$5({attribute:!1})],ChromedashEnterpriseReleaseNotesPage.prototype,"user",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"currentChromeBrowserUpdates",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"upcomingChromeBrowserUpdates",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"currentChromeEnterpriseCore",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"upcomingChromeEnterpriseCore",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"currentChromeEnterprisePremium",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"upcomingChromeEnterprisePremium",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"features",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"channels",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"selectedMilestone",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"editingFeatureIds",void 0),__decorate$1([r$6()],ChromedashEnterpriseReleaseNotesPage.prototype,"previewingIds",void 0),ChromedashEnterpriseReleaseNotesPage=__decorate$1([t$3("chromedash-enterprise-release-notes-page")],ChromedashEnterpriseReleaseNotesPage);var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r};const WPT_RESULTS_REGEX=/(https?:\/\/wpt\.fyi\/results[^\s?]+)/g,COOLDOWN_MS=1800000,HANGING_TIMEOUT_MS=3600000;let ChromedashWPTEvalPage=class ChromedashWPTEvalPage extends i$4{constructor(){super(...arguments),this.featureId=0,this.feature=null,this.loading=!1,this.isRequirementsFulfilled=!1,this.completedInThisSession=!1,this._cooldownRemaining=0,this._reportContentChanged=!1,this._pollIntervalId=null,this._cooldownIntervalId=null,this._previousReportContent=null}static get styles(){return[...SHARED_STYLES,i$7` + :host { + display: block; + min-height: 100vh; + background: var(--sl-color-neutral-50); + padding: 2em; + } + + h1 { + font-size: 2rem; + font-weight: 300; + margin-bottom: 1.5rem; + padding-bottom: 0.5rem; + } + + h2 { + font-size: 1.5rem; + font-weight: 400; + margin-top: 0; + margin-bottom: 1rem; + } + + h3 { + margin-top: 1.5em; + } + + .experimental-tag { + font-size: 0.6em; + font-weight: normal; + vertical-align: middle; + background: var(--sl-color-neutral-200); + padding: 2px 8px; + border-radius: 12px; + margin-left: 8px; + } + + .card { + background: var(--sl-color-neutral-0); + border: 1px solid var(--sl-color-neutral-200); + border-radius: var(--sl-border-radius-medium); + padding: var(--sl-spacing-x-large); + box-shadow: var(--sl-shadow-x-small); + margin-bottom: var(--sl-spacing-large); + } + + .description ul { + line-height: 1.6; + } + .description li { + margin-bottom: 0.5em; + } + + .requirements-list { + display: flex; + flex-direction: column; + gap: 12px; + } + + .requirement-item { + display: flex; + align-items: center; + gap: 12px; + font-size: 16px; + padding: 8px; + border-radius: var(--sl-border-radius-medium); + transition: background 0.2s ease; + } + .requirement-item:hover { + background: var(--sl-color-neutral-50); + } + + .requirement-item sl-icon { + font-size: 1.4em; + flex-shrink: 0; + } + .requirement-item .success { + color: var(--sl-color-success-600); + } + .requirement-item .danger { + color: var(--sl-color-danger-600); + } + + .edit-link { + font-size: 0.9em; + margin-left: auto; + padding: 4px 12px; + background: var(--sl-color-primary-50); + border-radius: 12px; + text-decoration: none; + font-weight: 600; + } + .edit-link:hover { + background: var(--sl-color-primary-100); + } + + .url-list-container { + margin-left: 44px; + } + .url-list { + list-style: none; + margin: 0; + padding: 12px; + font-size: 0.85em; + background: var(--sl-color-neutral-100); + border-radius: 4px; + border: 1px solid var(--sl-color-neutral-200); + max-height: 150px; + overflow-y: auto; + } + .url-list li { + margin-bottom: 4px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .url-list a { + text-decoration: none; + } + .url-list a:hover { + text-decoration: underline; + } + + .action-section { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; + min-height: 120px; + } + + .generate-button { + font-size: 1.1rem; + padding-left: 2rem; + padding-right: 2rem; + } + .generate-button sl-icon { + font-size: 1.3em; + } + + .cooldown-message { + margin-top: 12px; + color: var(--sl-color-neutral-600); + font-size: 0.9em; + display: flex; + align-items: center; + gap: 6px; + } + + .help-text { + margin-top: 8px; + color: var(--sl-color-neutral-600); + font-size: 0.9rem; + max-width: 400px; + line-height: 1.4; + } + + .status-in-progress, + .status-complete { + display: flex; + flex-direction: column; + align-items: center; + gap: 16px; + font-size: 1.1rem; + } + .status-in-progress { + color: var(--sl-color-primary-600); + } + .status-in-progress sl-spinner { + font-size: 3rem; + --track-width: 4px; + } + .status-complete { + color: var(--sl-color-success-700); + } + .status-complete sl-icon { + font-size: 3rem; + color: var(--sl-color-success-600); + } + + .report-content { + overflow-wrap: break-word; + line-height: 1.6; + } + .report-content h1, + .report-content h2, + .report-content h3 { + margin-top: 1.5em; + margin-bottom: 0.75em; + color: var(--sl-color-neutral-1000); + } + .report-content *:first-child { + margin-top: 0; + } + .report-content pre { + background: var(--sl-color-neutral-900); + padding: 16px; + border-radius: 6px; + overflow-x: auto; + } + .report-content code { + background: var(--sl-color-neutral-200); + padding: 2px 4px; + border-radius: 4px; + font-size: 0.9em; + font-family: monospace; + } + .report-content pre code { + background: transparent; + padding: 0; + color: inherit; + } + + .prewrap { + white-space: pre-wrap; + } + + @keyframes fadeIn { + from { + opacity: 0; + transform: translateY(20px); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + .fade-in { + animation: fadeIn 0.8s ease-out forwards; + } + .delay-title { + animation-delay: 0.1s; + } + .delay-content { + animation-delay: 0.4s; + } + + sl-alert { + margin-bottom: var(--sl-spacing-large); + } + `]}async fetchData(){this.feature||(this.loading=!0);try{this.feature=await window.csClient.getFeature(this.featureId),this.checkRequirements(),this.managePolling(),this.updateCooldown()}catch(error){showToastMessage("Some errors occurred. Please refresh the page or try again later.")}finally{this.loading=!1}}updated(changedProperties){if(changedProperties.has("feature")&&this.feature){const currentReport=this.feature.ai_test_eval_report||null;currentReport&¤tReport!==this._previousReportContent&&(this._reportContentChanged=!0,setTimeout(()=>{this._reportContentChanged=!1},100)),this._previousReportContent=currentReport}}connectedCallback(){super.connectedCallback(),this.fetchData()}disconnectedCallback(){super.disconnectedCallback(),this.stopPolling(),this.stopCooldownTimer()}checkRequirements(){if(!this.feature)return void(this.isRequirementsFulfilled=!1);const hasSpecLink=!!this.feature.spec_link,hasWptDescr=!!this.feature.wpt_descr,hasValidUrls=null!==(this.feature.wpt_descr||"").match(WPT_RESULTS_REGEX);this.isRequirementsFulfilled=hasSpecLink&&hasWptDescr&&hasValidUrls}updateCooldown(){if(this.feature?.ai_test_eval_run_status===AITestEvaluationStatus.COMPLETE&&this.feature.ai_test_eval_status_timestamp){const completedAt=new Date(this.feature.ai_test_eval_status_timestamp).getTime(),now=Date.now(),elapsed=now-completedAt;elapsed<COOLDOWN_MS?(this._cooldownRemaining=COOLDOWN_MS-elapsed,this.startCooldownTimer()):(this._cooldownRemaining=0,this.stopCooldownTimer())}else this._cooldownRemaining=0,this.stopCooldownTimer()}startCooldownTimer(){this._cooldownIntervalId||(this._cooldownIntervalId=window.setInterval(()=>{this.updateCooldown()},6e4))}stopCooldownTimer(){this._cooldownIntervalId&&(window.clearInterval(this._cooldownIntervalId),this._cooldownIntervalId=null)}managePolling(){const status=this.feature?.ai_test_eval_run_status;status===AITestEvaluationStatus.IN_PROGRESS?this.startPolling():(this._pollIntervalId&&status===AITestEvaluationStatus.COMPLETE&&(this.completedInThisSession=!0),this.stopPolling())}startPolling(){this._pollIntervalId||(this._pollIntervalId=window.setInterval(()=>{this.fetchData()},5e3))}stopPolling(){this._pollIntervalId&&(window.clearInterval(this._pollIntervalId),this._pollIntervalId=null)}async handleGenerateClick(){if(this.isRequirementsFulfilled&&this.feature&&!(0<this._cooldownRemaining))try{this.feature={...this.feature,ai_test_eval_run_status:AITestEvaluationStatus.IN_PROGRESS,ai_test_eval_status_timestamp:new Date().toString()},this.completedInThisSession=!1,this.managePolling(),await window.csClient.generateWPTCoverageEvaluation(this.featureId)}catch(e){showToastMessage("Failed to start evaluation. Please try again later."),this.fetchData()}}renderRequirementItem(isFulfilled,label,urlHash){const icon=isFulfilled?x$1`<sl-icon + class="success" + library="material" + name="check_circle_20px" + ></sl-icon>`:x$1`<sl-icon name="x-circle-fill" class="danger"></sl-icon>`,text=isFulfilled?`${label} provided`:`Missing ${label}`;return x$1` + <div class="requirement-item"> + ${icon} + <span>${text}</span> + <a class="edit-link" href="/guide/editall/${this.featureId}#${urlHash}"> + Edit + </a> + </div> + `}_renderPreformattedText(content){return content?x$1`<div class="url-list prewrap">${content}</div>`:E$1}renderRequirementsChecks(){if(!this.feature)return x$1`${E$1}`;const hasSpecLink=!!this.feature.spec_link,hasWptDescr=!!this.feature.wpt_descr,wptUrls=(this.feature.wpt_descr||"").match(WPT_RESULTS_REGEX)||[],hasValidUrls=0<wptUrls.length;return x$1` + <section class="card"> + <h2>Prerequisites Checklist</h2> + <div class="requirements-list"> + <!-- Name and summary are assumed to always be filled --> + ${this.renderRequirementItem(!0,"Feature name","id_name")} + <div class="url-list-container"> + <div class="url-list">${this.feature.name}</div> + </div> + ${this.renderRequirementItem(!0,"Feature summary","id_summary")} + <div class="url-list-container"> + ${this._renderPreformattedText(this.feature.summary)} + </div> + ${this.renderRequirementItem(hasSpecLink,"Spec URL","id_spec_link")} + ${hasSpecLink?x$1` + <div class="url-list-container"> + <div class="url-list"> + <a + href="${o$6(this.feature.spec_link)}" + target="_blank" + >${this.feature.spec_link}</a + > + </div> + </div> + `:E$1} + ${this.renderRequirementItem(hasWptDescr,"WPT description","id_wpt_descr")} + ${hasWptDescr?x$1` + <div class="url-list-container"> + ${this._renderPreformattedText(this.feature.wpt_descr)} + </div> + `:E$1} + ${this.renderRequirementItem(hasValidUrls,"Valid wpt.fyi results URLs","id_wpt_descr")} + ${hasValidUrls?x$1` + <div class="url-list-container"> + <ul class="url-list"> + ${wptUrls.map(url=>x$1` + <li> + <a href="${url}" target="_blank" title="${url}" + >${url}</a + > + </li> + `)} + </ul> + </div> + `:E$1} + </div> + </section> + `}renderActionSection(){var _Mathceil4=Math.ceil;if(!this.feature)return x$1`${E$1}`;const status=this.feature.ai_test_eval_run_status;let isHanging=!1;if(status===AITestEvaluationStatus.IN_PROGRESS&&this.feature.ai_test_eval_status_timestamp){const startedAt=new Date(this.feature.ai_test_eval_status_timestamp).getTime(),now=Date.now();now-startedAt>HANGING_TIMEOUT_MS&&(isHanging=!0)}if(status===AITestEvaluationStatus.IN_PROGRESS&&!isHanging)return x$1` + <section class="card action-section"> + <div class="status-in-progress"> + <sl-spinner></sl-spinner> + <span>Evaluation in progress... This may take a few minutes.</span> + </div> + </section> + `;if(this.completedInThisSession&&status!==AITestEvaluationStatus.IN_PROGRESS)return x$1` + <section class="card action-section"> + <div class="status-complete fade-in"> + <sl-icon library="material" name="check_circle_20px"></sl-icon> + <span>Evaluation complete! The report is available above.</span> + </div> + </section> + `;const isCooldownActive=0<this._cooldownRemaining,minutesRemaining=_Mathceil4(this._cooldownRemaining/6e4);let buttonLabel="Evaluate test coverage";return isHanging?buttonLabel="Retry evaluation (Process timed out)":this.feature.ai_test_eval_report&&(buttonLabel="Discard this report and reevaluate test coverage"),x$1` + <section class="card action-section"> + ${status===AITestEvaluationStatus.FAILED?x$1` + <sl-alert variant="danger" open> + The previous evaluation run failed. Please try again. + </sl-alert> + `:E$1} + + <sl-button + variant="${this.feature.ai_test_eval_report?"danger":"primary"}" + size="large" + class="generate-button" + ?disabled=${!this.isRequirementsFulfilled||isCooldownActive} + @click=${this.handleGenerateClick} + > + ${buttonLabel} + </sl-button> + + ${isHanging?x$1` + <div class="help-text"> + The previous evaluation seems to be stuck. You can try starting + a new one. + </div> + `:E$1} + ${isCooldownActive?x$1` + <div class="cooldown-message"> + <sl-icon name="hourglass-split"></sl-icon> + Available in ${minutesRemaining} + minute${1===minutesRemaining?"":"s"} + </div> + `:E$1} + </section> + `}renderReport(){if(!this.feature?.ai_test_eval_report)return x$1`${E$1}`;const rawHtml=d.parse(this.feature.ai_test_eval_report),titleClass=this._reportContentChanged?"fade-in delay-title":"",contentClass=this._reportContentChanged?"fade-in delay-content":"";return x$1` + <section class="card report-section"> + <h2 class="${titleClass}">Evaluation Report</h2> + <div class="report-content ${contentClass}">${o$2(rawHtml)}</div> + </section> + `}renderSkeletonSection(){return x$1` + <section class="card"> + <h3><sl-skeleton effect="sheen" style="width: 50%"></sl-skeleton></h3> + <p> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + <sl-skeleton effect="sheen"></sl-skeleton> + </p> + </section> + `}renderSkeletons(){return x$1` + <div style="margin-top: 2em;"> + ${this.renderSkeletonSection()} ${this.renderSkeletonSection()} + </div> + `}render(){return x$1` + <div> + <h1> + AI-powered WPT coverage evaluation + <span class="experimental-tag">Experimental</span> + </h1> + + <sl-alert variant="primary" open> + <sl-icon slot="icon" name="info-circle"></sl-icon> + This feature is experimental and reports may be inaccurate. Please + <a + href="https://github.com/GoogleChrome/chromium-dashboard/issues/new?labels=Feedback,WPT-AI" + target="_blank" + >file an issue</a + > + if you have feedback or suggestions. + </sl-alert> + + <section class="card description"> + <h2>About</h2> + <p> + Here you can generate an AI-powered test coverage report for your + feature using Gemini. Gemini will analyze your feature's details, + specification, and listed Web Platform Tests to evaluate if it meets + standard minimum test coverage criteria. + </p> + + <h3>Before you begin</h3> + <p> + To ensure an accurate report, please verify the following feature + details: + </p> + <ul> + <li> + <strong>Metadata:</strong> Ensure the feature name and summary are + accurate. + </li> + <li> + <strong>Specification:</strong> A valid Spec URL must be provided. + </li> + <li> + <strong>Test Results:</strong> Add relevant + <code>wpt.fyi</code> URLs to the + <i>Web Platform Tests</i> description field. + <ul> + <li> + URLs must begin with <code>https://wpt.fyi/results/</code>. + </li> + <li> + Individual test file URLs are accepted (e.g., + <code>dom/historical.html</code>). + </li> + <li> + Directory URLs are accepted, but <strong>only</strong> if + every test in that directory is relevant to your feature. + </li> + <li> + There is a limit of <strong>50 individual test files</strong> + In the Web Platform Tests repository. If more than 50 relevant + test files are found via the listed URLs, the test suite size + is too big for automated test coverage evaluation. + </li> + <li> + <em + >Note: Subdirectories within listed directories are not + scanned.</em + > + </li> + </ul> + </li> + </ul> + </section> + + ${this.loading?this.renderSkeletons():x$1` + ${this.renderRequirementsChecks()} ${this.renderReport()} + ${this.renderActionSection()} + `} + </div> + `}};__decorate([n$5({type:Number})],ChromedashWPTEvalPage.prototype,"featureId",void 0),__decorate([r$6()],ChromedashWPTEvalPage.prototype,"feature",void 0),__decorate([r$6()],ChromedashWPTEvalPage.prototype,"loading",void 0),__decorate([r$6()],ChromedashWPTEvalPage.prototype,"isRequirementsFulfilled",void 0),__decorate([r$6()],ChromedashWPTEvalPage.prototype,"completedInThisSession",void 0),__decorate([r$6()],ChromedashWPTEvalPage.prototype,"_cooldownRemaining",void 0),__decorate([r$6()],ChromedashWPTEvalPage.prototype,"_reportContentChanged",void 0),ChromedashWPTEvalPage=__decorate([t$3("chromedash-wpt-eval-page")],ChromedashWPTEvalPage),setBasePath("/static/shoelace"),registerIconLibrary("material",{resolver:name=>`/static/shoelace/assets/material-icons/${name}.svg`,mutator:svg=>svg.setAttribute("fill","currentColor")});//# sourceMappingURL=components.js.map diff --git a/viewer.mjs b/viewer.mjs new file mode 100644 index 0000000..5e9469a --- /dev/null +++ b/viewer.mjs @@ -0,0 +1,16934 @@ +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2024 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ + +/** + * pdfjsVersion = 5.4.445 + * pdfjsBuild = ec5330f78 + */ +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; + +;// ./web/pdfjs.js +const { + AbortException, + AnnotationEditorLayer, + AnnotationEditorParamsType, + AnnotationEditorType, + AnnotationEditorUIManager, + AnnotationLayer, + AnnotationMode, + AnnotationType, + applyOpacity, + build, + ColorPicker, + createValidAbsoluteUrl, + CSSConstants, + DOMSVGFactory, + DrawLayer, + FeatureTest, + fetchData, + findContrastColor, + getDocument, + getFilenameFromUrl, + getPdfFilenameFromUrl, + getRGB, + getUuid, + getXfaPageViewport, + GlobalWorkerOptions, + ImageKind, + InvalidPDFException, + isDataScheme, + isPdfFile, + isValidExplicitDest, + MathClamp, + noContextMenu, + normalizeUnicode, + OPS, + OutputScale, + PasswordResponses, + PDFDataRangeTransport, + PDFDateString, + PDFWorker, + PermissionFlag, + PixelsPerInch, + RenderingCancelledException, + renderRichText, + ResponseException, + setLayerDimensions, + shadow, + SignatureExtractor, + stopEvent, + SupportedImageMimeTypes, + TextLayer, + TouchManager, + updateUrlHash, + Util, + VerbosityLevel, + version, + XfaLayer +} = globalThis.pdfjsLib; + +;// ./web/ui_utils.js + +const DEFAULT_SCALE_VALUE = "auto"; +const DEFAULT_SCALE = 1.0; +const DEFAULT_SCALE_DELTA = 1.1; +const MIN_SCALE = 0.1; +const MAX_SCALE = 10.0; +const UNKNOWN_SCALE = 0; +const MAX_AUTO_SCALE = 1.25; +const SCROLLBAR_PADDING = 40; +const VERTICAL_PADDING = 5; +const RenderingStates = { + INITIAL: 0, + RUNNING: 1, + PAUSED: 2, + FINISHED: 3 +}; +const PresentationModeState = { + UNKNOWN: 0, + NORMAL: 1, + CHANGING: 2, + FULLSCREEN: 3 +}; +const SidebarView = { + UNKNOWN: -1, + NONE: 0, + THUMBS: 1, + OUTLINE: 2, + ATTACHMENTS: 3, + LAYERS: 4 +}; +const TextLayerMode = { + DISABLE: 0, + ENABLE: 1, + ENABLE_PERMISSIONS: 2 +}; +const ScrollMode = { + UNKNOWN: -1, + VERTICAL: 0, + HORIZONTAL: 1, + WRAPPED: 2, + PAGE: 3 +}; +const SpreadMode = { + UNKNOWN: -1, + NONE: 0, + ODD: 1, + EVEN: 2 +}; +const CursorTool = { + SELECT: 0, + HAND: 1, + ZOOM: 2 +}; +const AutoPrintRegExp = /\bprint\s*\(/; +function scrollIntoView(element, spot, scrollMatches = false) { + let parent = element.offsetParent; + if (!parent) { + console.error("offsetParent is not set -- cannot scroll"); + return; + } + let offsetY = element.offsetTop + element.clientTop; + let offsetX = element.offsetLeft + element.clientLeft; + while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || scrollMatches && (parent.classList.contains("markedContent") || getComputedStyle(parent).overflow === "hidden")) { + offsetY += parent.offsetTop; + offsetX += parent.offsetLeft; + parent = parent.offsetParent; + if (!parent) { + return; + } + } + if (spot) { + if (spot.top !== undefined) { + offsetY += spot.top; + } + if (spot.left !== undefined) { + if (scrollMatches) { + const elementWidth = element.getBoundingClientRect().width; + const padding = MathClamp((parent.clientWidth - elementWidth) / 2, 20, 400); + offsetX += spot.left - padding; + } else { + offsetX += spot.left; + } + parent.scrollLeft = offsetX; + } + } + parent.scrollTop = offsetY; +} +function watchScroll(viewAreaElement, callback, abortSignal = undefined) { + const debounceScroll = function (evt) { + if (rAF) { + return; + } + rAF = window.requestAnimationFrame(function viewAreaElementScrolled() { + rAF = null; + const currentX = viewAreaElement.scrollLeft; + const lastX = state.lastX; + if (currentX !== lastX) { + state.right = currentX > lastX; + } + state.lastX = currentX; + const currentY = viewAreaElement.scrollTop; + const lastY = state.lastY; + if (currentY !== lastY) { + state.down = currentY > lastY; + } + state.lastY = currentY; + callback(state); + }); + }; + const state = { + right: true, + down: true, + lastX: viewAreaElement.scrollLeft, + lastY: viewAreaElement.scrollTop, + _eventHandler: debounceScroll + }; + let rAF = null; + viewAreaElement.addEventListener("scroll", debounceScroll, { + useCapture: true, + signal: abortSignal + }); + abortSignal?.addEventListener("abort", () => window.cancelAnimationFrame(rAF), { + once: true + }); + return state; +} +function parseQueryString(query) { + const params = new Map(); + for (const [key, value] of new URLSearchParams(query)) { + params.set(key.toLowerCase(), value); + } + return params; +} +const InvisibleCharsRegExp = /[\x00-\x1F]/g; +function removeNullCharacters(str, replaceInvisible = false) { + if (!InvisibleCharsRegExp.test(str)) { + return str; + } + if (replaceInvisible) { + return str.replaceAll(InvisibleCharsRegExp, m => m === "\x00" ? "" : " "); + } + return str.replaceAll("\x00", ""); +} +function binarySearchFirstItem(items, condition, start = 0) { + let minIndex = start; + let maxIndex = items.length - 1; + if (maxIndex < 0 || !condition(items[maxIndex])) { + return items.length; + } + if (condition(items[minIndex])) { + return minIndex; + } + while (minIndex < maxIndex) { + const currentIndex = minIndex + maxIndex >> 1; + const currentItem = items[currentIndex]; + if (condition(currentItem)) { + maxIndex = currentIndex; + } else { + minIndex = currentIndex + 1; + } + } + return minIndex; +} +function approximateFraction(x) { + if (Math.floor(x) === x) { + return [x, 1]; + } + const xinv = 1 / x; + const limit = 8; + if (xinv > limit) { + return [1, limit]; + } else if (Math.floor(xinv) === xinv) { + return [1, xinv]; + } + const x_ = x > 1 ? xinv : x; + let a = 0, + b = 1, + c = 1, + d = 1; + while (true) { + const p = a + c, + q = b + d; + if (q > limit) { + break; + } + if (x_ <= p / q) { + c = p; + d = q; + } else { + a = p; + b = q; + } + } + let result; + if (x_ - a / b < c / d - x_) { + result = x_ === x ? [a, b] : [b, a]; + } else { + result = x_ === x ? [c, d] : [d, c]; + } + return result; +} +function floorToDivide(x, div) { + return x - x % div; +} +function getPageSizeInches({ + view, + userUnit, + rotate +}) { + const [x1, y1, x2, y2] = view; + const changeOrientation = rotate % 180 !== 0; + const width = (x2 - x1) / 72 * userUnit; + const height = (y2 - y1) / 72 * userUnit; + return { + width: changeOrientation ? height : width, + height: changeOrientation ? width : height + }; +} +function backtrackBeforeAllVisibleElements(index, views, top) { + if (index < 2) { + return index; + } + let elt = views[index].div; + let pageTop = elt.offsetTop + elt.clientTop; + if (pageTop >= top) { + elt = views[index - 1].div; + pageTop = elt.offsetTop + elt.clientTop; + } + for (let i = index - 2; i >= 0; --i) { + elt = views[i].div; + if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) { + break; + } + index = i; + } + return index; +} +function getVisibleElements({ + scrollEl, + views, + sortByVisibility = false, + horizontal = false, + rtl = false +}) { + const top = scrollEl.scrollTop, + bottom = top + scrollEl.clientHeight; + const left = scrollEl.scrollLeft, + right = left + scrollEl.clientWidth; + function isElementBottomAfterViewTop(view) { + const element = view.div; + const elementBottom = element.offsetTop + element.clientTop + element.clientHeight; + return elementBottom > top; + } + function isElementNextAfterViewHorizontally(view) { + const element = view.div; + const elementLeft = element.offsetLeft + element.clientLeft; + const elementRight = elementLeft + element.clientWidth; + return rtl ? elementLeft < right : elementRight > left; + } + const visible = [], + ids = new Set(), + numViews = views.length; + let firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop); + if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) { + firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top); + } + let lastEdge = horizontal ? right : -1; + for (let i = firstVisibleElementInd; i < numViews; i++) { + const view = views[i], + element = view.div; + const currentWidth = element.offsetLeft + element.clientLeft; + const currentHeight = element.offsetTop + element.clientTop; + const viewWidth = element.clientWidth, + viewHeight = element.clientHeight; + const viewRight = currentWidth + viewWidth; + const viewBottom = currentHeight + viewHeight; + if (lastEdge === -1) { + if (viewBottom >= bottom) { + lastEdge = viewBottom; + } + } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) { + break; + } + if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) { + continue; + } + const minY = Math.max(0, top - currentHeight); + const minX = Math.max(0, left - currentWidth); + const hiddenHeight = minY + Math.max(0, viewBottom - bottom); + const hiddenWidth = minX + Math.max(0, viewRight - right); + const fractionHeight = (viewHeight - hiddenHeight) / viewHeight, + fractionWidth = (viewWidth - hiddenWidth) / viewWidth; + const percent = fractionHeight * fractionWidth * 100 | 0; + visible.push({ + id: view.id, + x: currentWidth, + y: currentHeight, + visibleArea: percent === 100 ? null : { + minX, + minY, + maxX: Math.min(viewRight, right) - currentWidth, + maxY: Math.min(viewBottom, bottom) - currentHeight + }, + view, + percent, + widthPercent: fractionWidth * 100 | 0 + }); + ids.add(view.id); + } + const first = visible[0], + last = visible.at(-1); + if (sortByVisibility) { + visible.sort(function (a, b) { + const pc = a.percent - b.percent; + if (Math.abs(pc) > 0.001) { + return -pc; + } + return a.id - b.id; + }); + } + return { + first, + last, + views: visible, + ids + }; +} +function normalizeWheelEventDirection(evt) { + let delta = Math.hypot(evt.deltaX, evt.deltaY); + const angle = Math.atan2(evt.deltaY, evt.deltaX); + if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) { + delta = -delta; + } + return delta; +} +function normalizeWheelEventDelta(evt) { + const deltaMode = evt.deltaMode; + let delta = normalizeWheelEventDirection(evt); + const MOUSE_PIXELS_PER_LINE = 30; + const MOUSE_LINES_PER_PAGE = 30; + if (deltaMode === WheelEvent.DOM_DELTA_PIXEL) { + delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE; + } else if (deltaMode === WheelEvent.DOM_DELTA_LINE) { + delta /= MOUSE_LINES_PER_PAGE; + } + return delta; +} +function isValidRotation(angle) { + return Number.isInteger(angle) && angle % 90 === 0; +} +function isValidScrollMode(mode) { + return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN; +} +function isValidSpreadMode(mode) { + return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN; +} +function isPortraitOrientation(size) { + return size.width <= size.height; +} +const animationStarted = new Promise(function (resolve) { + window.requestAnimationFrame(resolve); +}); +const docStyle = document.documentElement.style; +class ProgressBar { + #classList = null; + #disableAutoFetchTimeout = null; + #percent = 0; + #style = null; + #visible = true; + constructor(bar) { + this.#classList = bar.classList; + this.#style = bar.style; + } + get percent() { + return this.#percent; + } + set percent(val) { + this.#percent = MathClamp(val, 0, 100); + if (isNaN(val)) { + this.#classList.add("indeterminate"); + return; + } + this.#classList.remove("indeterminate"); + this.#style.setProperty("--progressBar-percent", `${this.#percent}%`); + } + setWidth(viewer) { + if (!viewer) { + return; + } + const container = viewer.parentNode; + const scrollbarWidth = container.offsetWidth - viewer.offsetWidth; + if (scrollbarWidth > 0) { + this.#style.setProperty("--progressBar-end-offset", `${scrollbarWidth}px`); + } + } + setDisableAutoFetch(delay = 5000) { + if (this.#percent === 100 || isNaN(this.#percent)) { + return; + } + if (this.#disableAutoFetchTimeout) { + clearTimeout(this.#disableAutoFetchTimeout); + } + this.show(); + this.#disableAutoFetchTimeout = setTimeout(() => { + this.#disableAutoFetchTimeout = null; + this.hide(); + }, delay); + } + hide() { + if (!this.#visible) { + return; + } + this.#visible = false; + this.#classList.add("hidden"); + } + show() { + if (this.#visible) { + return; + } + this.#visible = true; + this.#classList.remove("hidden"); + } +} +function getActiveOrFocusedElement() { + let curRoot = document; + let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus"); + while (curActiveOrFocused?.shadowRoot) { + curRoot = curActiveOrFocused.shadowRoot; + curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus"); + } + return curActiveOrFocused; +} +function apiPageLayoutToViewerModes(layout) { + let scrollMode = ScrollMode.VERTICAL, + spreadMode = SpreadMode.NONE; + switch (layout) { + case "SinglePage": + scrollMode = ScrollMode.PAGE; + break; + case "OneColumn": + break; + case "TwoPageLeft": + scrollMode = ScrollMode.PAGE; + case "TwoColumnLeft": + spreadMode = SpreadMode.ODD; + break; + case "TwoPageRight": + scrollMode = ScrollMode.PAGE; + case "TwoColumnRight": + spreadMode = SpreadMode.EVEN; + break; + } + return { + scrollMode, + spreadMode + }; +} +function apiPageModeToSidebarView(mode) { + switch (mode) { + case "UseNone": + return SidebarView.NONE; + case "UseThumbs": + return SidebarView.THUMBS; + case "UseOutlines": + return SidebarView.OUTLINE; + case "UseAttachments": + return SidebarView.ATTACHMENTS; + case "UseOC": + return SidebarView.LAYERS; + } + return SidebarView.NONE; +} +function toggleCheckedBtn(button, toggle, view = null) { + button.classList.toggle("toggled", toggle); + button.setAttribute("aria-checked", toggle); + view?.classList.toggle("hidden", !toggle); +} +function toggleExpandedBtn(button, toggle, view = null) { + button.classList.toggle("toggled", toggle); + button.setAttribute("aria-expanded", toggle); + view?.classList.toggle("hidden", !toggle); +} +const calcRound = Math.fround; + +;// ./web/app_options.js +const OptionKind = { + BROWSER: 0x01, + VIEWER: 0x02, + API: 0x04, + WORKER: 0x08, + EVENT_DISPATCH: 0x10, + PREFERENCE: 0x80 +}; +const Type = { + BOOLEAN: 0x01, + NUMBER: 0x02, + OBJECT: 0x04, + STRING: 0x08, + UNDEFINED: 0x10 +}; +const defaultOptions = { + allowedGlobalEvents: { + value: null, + kind: OptionKind.BROWSER + }, + canvasMaxAreaInBytes: { + value: -1, + kind: OptionKind.BROWSER + OptionKind.API + }, + isInAutomation: { + value: false, + kind: OptionKind.BROWSER + }, + localeProperties: { + value: null, + kind: OptionKind.BROWSER + }, + maxCanvasDim: { + value: 32767, + kind: OptionKind.BROWSER + OptionKind.VIEWER + }, + nimbusDataStr: { + value: "", + kind: OptionKind.BROWSER + }, + supportsCaretBrowsingMode: { + value: false, + kind: OptionKind.BROWSER + }, + supportsDocumentFonts: { + value: true, + kind: OptionKind.BROWSER + }, + supportsIntegratedFind: { + value: false, + kind: OptionKind.BROWSER + }, + supportsMouseWheelZoomCtrlKey: { + value: true, + kind: OptionKind.BROWSER + }, + supportsMouseWheelZoomMetaKey: { + value: true, + kind: OptionKind.BROWSER + }, + supportsPinchToZoom: { + value: true, + kind: OptionKind.BROWSER + }, + supportsPrinting: { + value: true, + kind: OptionKind.BROWSER + }, + toolbarDensity: { + value: 0, + kind: OptionKind.BROWSER + OptionKind.EVENT_DISPATCH + }, + altTextLearnMoreUrl: { + value: "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/pdf-alt-text", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + annotationEditorMode: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + annotationMode: { + value: 2, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + capCanvasAreaFactor: { + value: 200, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + commentLearnMoreUrl: { + value: "https://support.mozilla.org/%LOCALE%/kb/view-pdf-files-firefox-or-choose-another-viewer#w_add-a-comment-to-a-pdf", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + cursorToolOnLoad: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + debuggerSrc: { + value: "./debugger.mjs", + kind: OptionKind.VIEWER + }, + defaultZoomDelay: { + value: 400, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + defaultZoomValue: { + value: "", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + disableHistory: { + value: false, + kind: OptionKind.VIEWER + }, + disablePageLabels: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableAltText: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableAltTextModelDownload: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + OptionKind.EVENT_DISPATCH + }, + enableAutoLinking: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableComment: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableDetailCanvas: { + value: true, + kind: OptionKind.VIEWER + }, + enableGuessAltText: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + OptionKind.EVENT_DISPATCH + }, + enableHighlightFloatingButton: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableNewAltTextWhenAddingImage: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableOptimizedPartialRendering: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enablePermissions: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enablePrintAutoRotate: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableScripting: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableSignatureEditor: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableUpdatedAddImage: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + externalLinkRel: { + value: "noopener noreferrer nofollow", + kind: OptionKind.VIEWER + }, + externalLinkTarget: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + highlightEditorColors: { + value: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F," + "yellow_HCM=#FFFFCC,green_HCM=#53FFBC,blue_HCM=#80EBFF,pink_HCM=#F6B8FF,red_HCM=#C50043", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + historyUpdateUrl: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + ignoreDestinationZoom: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + imageResourcesPath: { + value: "resource://pdf.js/web/images/", + kind: OptionKind.VIEWER + }, + maxCanvasPixels: { + value: 2 ** 25, + kind: OptionKind.VIEWER + }, + minDurationToUpdateCanvas: { + value: 500, + kind: OptionKind.VIEWER + }, + forcePageColors: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + pageColorsBackground: { + value: "Canvas", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + pageColorsForeground: { + value: "CanvasText", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + pdfBugEnabled: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + printResolution: { + value: 150, + kind: OptionKind.VIEWER + }, + sidebarViewOnLoad: { + value: -1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + scrollModeOnLoad: { + value: -1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + spreadModeOnLoad: { + value: -1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + textLayerMode: { + value: 1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + viewerCssTheme: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + viewOnLoad: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + cMapPacked: { + value: true, + kind: OptionKind.API + }, + cMapUrl: { + value: "resource://pdf.js/web/cmaps/", + kind: OptionKind.API + }, + disableAutoFetch: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + disableFontFace: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + disableRange: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + disableStream: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + docBaseUrl: { + value: "", + kind: OptionKind.API + }, + enableHWA: { + value: false, + kind: OptionKind.API + OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableXfa: { + value: true, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + fontExtraProperties: { + value: false, + kind: OptionKind.API + }, + iccUrl: { + value: "resource://pdf.js/web/iccs/", + kind: OptionKind.API + }, + isEvalSupported: { + value: true, + kind: OptionKind.API + }, + isOffscreenCanvasSupported: { + value: true, + kind: OptionKind.API + }, + maxImageSize: { + value: -1, + kind: OptionKind.API + }, + pdfBug: { + value: false, + kind: OptionKind.API + }, + standardFontDataUrl: { + value: "resource://pdf.js/web/standard_fonts/", + kind: OptionKind.API + }, + useSystemFonts: { + value: undefined, + kind: OptionKind.API, + type: Type.BOOLEAN + Type.UNDEFINED + }, + verbosity: { + value: 1, + kind: OptionKind.API + }, + wasmUrl: { + value: "resource://pdf.js/web/wasm/", + kind: OptionKind.API + }, + workerPort: { + value: globalThis.pdfjsPreloadedWorker || null, + kind: OptionKind.WORKER + }, + workerSrc: { + value: "resource://pdf.js/build/pdf.worker.mjs", + kind: OptionKind.WORKER + } +}; +class AppOptions { + static eventBus; + static #opts = new Map(); + static { + for (const name in defaultOptions) { + this.#opts.set(name, defaultOptions[name].value); + } + } + static get(name) { + return this.#opts.get(name); + } + static getAll(kind = null, defaultOnly = false) { + const options = Object.create(null); + for (const name in defaultOptions) { + const defaultOpt = defaultOptions[name]; + if (kind && !(kind & defaultOpt.kind)) { + continue; + } + options[name] = !defaultOnly ? this.#opts.get(name) : defaultOpt.value; + } + return options; + } + static set(name, value) { + this.setAll({ + [name]: value + }); + } + static setAll(options, prefs = false) { + let events; + for (const name in options) { + const defaultOpt = defaultOptions[name], + userOpt = options[name]; + if (!defaultOpt || !(typeof userOpt === typeof defaultOpt.value || Type[(typeof userOpt).toUpperCase()] & defaultOpt.type)) { + continue; + } + const { + kind + } = defaultOpt; + if (prefs && !(kind & OptionKind.BROWSER || kind & OptionKind.PREFERENCE)) { + continue; + } + if (this.eventBus && kind & OptionKind.EVENT_DISPATCH) { + (events ||= new Map()).set(name, userOpt); + } + this.#opts.set(name, userOpt); + } + if (events) { + for (const [name, value] of events) { + this.eventBus.dispatch(name.toLowerCase(), { + source: this, + value + }); + } + } + } +} + +;// ./web/pdf_link_service.js + + +const DEFAULT_LINK_REL = "noopener noreferrer nofollow"; +const LinkTarget = { + NONE: 0, + SELF: 1, + BLANK: 2, + PARENT: 3, + TOP: 4 +}; +class PDFLinkService { + externalLinkEnabled = true; + constructor({ + eventBus, + externalLinkTarget = null, + externalLinkRel = null, + ignoreDestinationZoom = false + } = {}) { + this.eventBus = eventBus; + this.externalLinkTarget = externalLinkTarget; + this.externalLinkRel = externalLinkRel; + this._ignoreDestinationZoom = ignoreDestinationZoom; + this.baseUrl = null; + this.pdfDocument = null; + this.pdfViewer = null; + this.pdfHistory = null; + } + setDocument(pdfDocument, baseUrl = null) { + this.baseUrl = baseUrl; + this.pdfDocument = pdfDocument; + } + setViewer(pdfViewer) { + this.pdfViewer = pdfViewer; + } + setHistory(pdfHistory) { + this.pdfHistory = pdfHistory; + } + get pagesCount() { + return this.pdfDocument ? this.pdfDocument.numPages : 0; + } + get page() { + return this.pdfDocument ? this.pdfViewer.currentPageNumber : 1; + } + set page(value) { + if (this.pdfDocument) { + this.pdfViewer.currentPageNumber = value; + } + } + get rotation() { + return this.pdfDocument ? this.pdfViewer.pagesRotation : 0; + } + set rotation(value) { + if (this.pdfDocument) { + this.pdfViewer.pagesRotation = value; + } + } + get isInPresentationMode() { + return this.pdfDocument ? this.pdfViewer.isInPresentationMode : false; + } + async goToDestination(dest) { + if (!this.pdfDocument) { + return; + } + let namedDest, explicitDest, pageNumber; + if (typeof dest === "string") { + namedDest = dest; + explicitDest = await this.pdfDocument.getDestination(dest); + } else { + namedDest = null; + explicitDest = await dest; + } + if (!Array.isArray(explicitDest)) { + console.error(`goToDestination: "${explicitDest}" is not a valid destination array, for dest="${dest}".`); + return; + } + const [destRef] = explicitDest; + if (destRef && typeof destRef === "object") { + pageNumber = this.pdfDocument.cachedPageNumber(destRef); + if (!pageNumber) { + try { + pageNumber = (await this.pdfDocument.getPageIndex(destRef)) + 1; + } catch { + console.error(`goToDestination: "${destRef}" is not a valid page reference, for dest="${dest}".`); + return; + } + } + } else if (Number.isInteger(destRef)) { + pageNumber = destRef + 1; + } + if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) { + console.error(`goToDestination: "${pageNumber}" is not a valid page number, for dest="${dest}".`); + return; + } + if (this.pdfHistory) { + this.pdfHistory.pushCurrentPosition(); + this.pdfHistory.push({ + namedDest, + explicitDest, + pageNumber + }); + } + this.pdfViewer.scrollPageIntoView({ + pageNumber, + destArray: explicitDest, + ignoreDestinationZoom: this._ignoreDestinationZoom + }); + const ac = new AbortController(); + this.eventBus._on("textlayerrendered", evt => { + if (evt.pageNumber === pageNumber) { + evt.source.textLayer.div.focus(); + ac.abort(); + } + }, { + signal: ac.signal + }); + } + goToPage(val) { + if (!this.pdfDocument) { + return; + } + const pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0; + if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) { + console.error(`PDFLinkService.goToPage: "${val}" is not a valid page.`); + return; + } + if (this.pdfHistory) { + this.pdfHistory.pushCurrentPosition(); + this.pdfHistory.pushPage(pageNumber); + } + this.pdfViewer.scrollPageIntoView({ + pageNumber + }); + } + goToXY(pageNumber, x, y, options = {}) { + this.pdfViewer.scrollPageIntoView({ + pageNumber, + destArray: [null, { + name: "XYZ" + }, x, y], + ignoreDestinationZoom: true, + ...options + }); + } + addLinkAttributes(link, url, newWindow = false) { + if (!url || typeof url !== "string") { + throw new Error('A valid "url" parameter must provided.'); + } + const target = newWindow ? LinkTarget.BLANK : this.externalLinkTarget, + rel = this.externalLinkRel; + if (this.externalLinkEnabled) { + link.href = link.title = url; + } else { + link.href = ""; + link.title = `Disabled: ${url}`; + link.onclick = () => false; + } + let targetStr = ""; + switch (target) { + case LinkTarget.NONE: + break; + case LinkTarget.SELF: + targetStr = "_self"; + break; + case LinkTarget.BLANK: + targetStr = "_blank"; + break; + case LinkTarget.PARENT: + targetStr = "_parent"; + break; + case LinkTarget.TOP: + targetStr = "_top"; + break; + } + link.target = targetStr; + link.rel = typeof rel === "string" ? rel : DEFAULT_LINK_REL; + } + getDestinationHash(dest) { + if (typeof dest === "string") { + if (dest.length > 0) { + return this.getAnchorUrl("#" + escape(dest)); + } + } else if (Array.isArray(dest)) { + const str = JSON.stringify(dest); + if (str.length > 0) { + return this.getAnchorUrl("#" + escape(str)); + } + } + return this.getAnchorUrl(""); + } + getAnchorUrl(anchor) { + return this.baseUrl ? this.baseUrl + anchor : anchor; + } + setHash(hash) { + if (!this.pdfDocument) { + return; + } + let pageNumber, dest; + if (hash.includes("=")) { + const params = parseQueryString(hash); + if (params.has("search")) { + const query = params.get("search").replaceAll('"', ""), + phrase = params.get("phrase") === "true"; + this.eventBus.dispatch("findfromurlhash", { + source: this, + query: phrase ? query : query.match(/\S+/g) + }); + } + if (params.has("page")) { + pageNumber = params.get("page") | 0 || 1; + } + if (params.has("zoom")) { + const zoomArgs = params.get("zoom").split(","); + const zoomArg = zoomArgs[0]; + const zoomArgNumber = parseFloat(zoomArg); + if (!zoomArg.includes("Fit")) { + dest = [null, { + name: "XYZ" + }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg]; + } else if (zoomArg === "Fit" || zoomArg === "FitB") { + dest = [null, { + name: zoomArg + }]; + } else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") { + dest = [null, { + name: zoomArg + }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null]; + } else if (zoomArg === "FitR") { + if (zoomArgs.length !== 5) { + console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'); + } else { + dest = [null, { + name: zoomArg + }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0]; + } + } else { + console.error(`PDFLinkService.setHash: "${zoomArg}" is not a valid zoom value.`); + } + } + if (dest) { + this.pdfViewer.scrollPageIntoView({ + pageNumber: pageNumber || this.page, + destArray: dest, + allowNegativeOffset: true + }); + } else if (pageNumber) { + this.page = pageNumber; + } + if (params.has("pagemode")) { + this.eventBus.dispatch("pagemode", { + source: this, + mode: params.get("pagemode") + }); + } + if (params.has("nameddest")) { + this.goToDestination(params.get("nameddest")); + } + if (!params.has("filename") || !params.has("filedest")) { + return; + } + hash = params.get("filedest"); + } + dest = unescape(hash); + try { + dest = JSON.parse(dest); + if (!Array.isArray(dest)) { + dest = dest.toString(); + } + } catch {} + if (typeof dest === "string" || isValidExplicitDest(dest)) { + this.goToDestination(dest); + return; + } + console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not a valid destination.`); + } + executeNamedAction(action) { + if (!this.pdfDocument) { + return; + } + switch (action) { + case "GoBack": + this.pdfHistory?.back(); + break; + case "GoForward": + this.pdfHistory?.forward(); + break; + case "NextPage": + this.pdfViewer.nextPage(); + break; + case "PrevPage": + this.pdfViewer.previousPage(); + break; + case "LastPage": + this.page = this.pagesCount; + break; + case "FirstPage": + this.page = 1; + break; + default: + break; + } + this.eventBus.dispatch("namedaction", { + source: this, + action + }); + } + async executeSetOCGState(action) { + if (!this.pdfDocument) { + return; + } + const pdfDocument = this.pdfDocument, + optionalContentConfig = await this.pdfViewer.optionalContentConfigPromise; + if (pdfDocument !== this.pdfDocument) { + return; + } + optionalContentConfig.setOCGState(action); + this.pdfViewer.optionalContentConfigPromise = Promise.resolve(optionalContentConfig); + } +} +class SimpleLinkService extends PDFLinkService { + setDocument(pdfDocument, baseUrl = null) {} +} + +;// ./web/event_utils.js +const WaitOnType = { + EVENT: "event", + TIMEOUT: "timeout" +}; +async function waitOnEventOrTimeout({ + target, + name, + delay = 0 +}) { + if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) { + throw new Error("waitOnEventOrTimeout - invalid parameters."); + } + const { + promise, + resolve + } = Promise.withResolvers(); + const ac = new AbortController(); + function handler(type) { + ac.abort(); + clearTimeout(timeout); + resolve(type); + } + const evtMethod = target instanceof EventBus ? "_on" : "addEventListener"; + target[evtMethod](name, handler.bind(null, WaitOnType.EVENT), { + signal: ac.signal + }); + const timeout = setTimeout(handler.bind(null, WaitOnType.TIMEOUT), delay); + return promise; +} +class EventBus { + #listeners = Object.create(null); + on(eventName, listener, options = null) { + this._on(eventName, listener, { + external: true, + once: options?.once, + signal: options?.signal + }); + } + off(eventName, listener, options = null) { + this._off(eventName, listener); + } + dispatch(eventName, data) { + const eventListeners = this.#listeners[eventName]; + if (!eventListeners || eventListeners.length === 0) { + return; + } + let externalListeners; + for (const { + listener, + external, + once + } of eventListeners.slice(0)) { + if (once) { + this._off(eventName, listener); + } + if (external) { + (externalListeners ||= []).push(listener); + continue; + } + listener(data); + } + if (externalListeners) { + for (const listener of externalListeners) { + listener(data); + } + externalListeners = null; + } + } + _on(eventName, listener, options = null) { + let rmAbort = null; + if (options?.signal instanceof AbortSignal) { + const { + signal + } = options; + if (signal.aborted) { + console.error("Cannot use an `aborted` signal."); + return; + } + const onAbort = () => this._off(eventName, listener); + rmAbort = () => signal.removeEventListener("abort", onAbort); + signal.addEventListener("abort", onAbort); + } + const eventListeners = this.#listeners[eventName] ||= []; + eventListeners.push({ + listener, + external: options?.external === true, + once: options?.once === true, + rmAbort + }); + } + _off(eventName, listener, options = null) { + const eventListeners = this.#listeners[eventName]; + if (!eventListeners) { + return; + } + for (let i = 0, ii = eventListeners.length; i < ii; i++) { + const evt = eventListeners[i]; + if (evt.listener === listener) { + evt.rmAbort?.(); + eventListeners.splice(i, 1); + return; + } + } + } +} +class FirefoxEventBus extends EventBus { + #externalServices; + #globalEventNames; + #isInAutomation; + constructor(globalEventNames, externalServices, isInAutomation) { + super(); + this.#globalEventNames = globalEventNames; + this.#externalServices = externalServices; + this.#isInAutomation = isInAutomation; + } + dispatch(eventName, data) { + super.dispatch(eventName, data); + if (this.#isInAutomation) { + const detail = Object.create(null); + if (data) { + for (const key in data) { + const value = data[key]; + if (key === "source") { + if (value === window || value === document) { + return; + } + continue; + } + detail[key] = value; + } + } + const event = new CustomEvent(eventName, { + bubbles: true, + cancelable: true, + detail + }); + document.dispatchEvent(event); + } + if (this.#globalEventNames?.has(eventName)) { + this.#externalServices.dispatchGlobalEvent({ + eventName, + detail: data + }); + } + } +} + +;// ./web/external_services.js +class BaseExternalServices { + updateFindControlState(data) {} + updateFindMatchesCount(data) {} + initPassiveLoading() {} + reportTelemetry(data) {} + reportText(data) {} + async createL10n() { + throw new Error("Not implemented: createL10n"); + } + createScripting() { + throw new Error("Not implemented: createScripting"); + } + createSignatureStorage() { + throw new Error("Not implemented: createSignatureStorage"); + } + updateEditorStates(data) { + throw new Error("Not implemented: updateEditorStates"); + } + dispatchGlobalEvent(_event) {} +} + +;// ./web/preferences.js + +class BasePreferences { + #defaults = Object.freeze({ + altTextLearnMoreUrl: "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/pdf-alt-text", + annotationEditorMode: 0, + annotationMode: 2, + capCanvasAreaFactor: 200, + commentLearnMoreUrl: "https://support.mozilla.org/%LOCALE%/kb/view-pdf-files-firefox-or-choose-another-viewer#w_add-a-comment-to-a-pdf", + cursorToolOnLoad: 0, + defaultZoomDelay: 400, + defaultZoomValue: "", + disablePageLabels: false, + enableAltText: false, + enableAltTextModelDownload: true, + enableAutoLinking: true, + enableComment: false, + enableGuessAltText: true, + enableHighlightFloatingButton: false, + enableNewAltTextWhenAddingImage: true, + enableOptimizedPartialRendering: false, + enablePermissions: false, + enablePrintAutoRotate: true, + enableScripting: true, + enableSignatureEditor: false, + enableUpdatedAddImage: false, + externalLinkTarget: 0, + highlightEditorColors: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F,yellow_HCM=#FFFFCC,green_HCM=#53FFBC,blue_HCM=#80EBFF,pink_HCM=#F6B8FF,red_HCM=#C50043", + historyUpdateUrl: false, + ignoreDestinationZoom: false, + forcePageColors: false, + pageColorsBackground: "Canvas", + pageColorsForeground: "CanvasText", + pdfBugEnabled: false, + sidebarViewOnLoad: -1, + scrollModeOnLoad: -1, + spreadModeOnLoad: -1, + textLayerMode: 1, + viewerCssTheme: 0, + viewOnLoad: 0, + disableAutoFetch: false, + disableFontFace: false, + disableRange: false, + disableStream: false, + enableHWA: false, + enableXfa: true + }); + #initializedPromise = null; + constructor() { + this.#initializedPromise = this._readFromStorage(this.#defaults).then(({ + browserPrefs, + prefs + }) => { + AppOptions.setAll({ + ...browserPrefs, + ...prefs + }, true); + }); + window.addEventListener("updatedPreference", async ({ + detail: { + name, + value + } + }) => { + await this.#initializedPromise; + AppOptions.setAll({ + [name]: value + }, true); + }); + } + async _writeToStorage(prefObj) { + throw new Error("Not implemented: _writeToStorage"); + } + async _readFromStorage(prefObj) { + throw new Error("Not implemented: _readFromStorage"); + } + async reset() { + throw new Error("Please use `about:config` to change preferences."); + } + async set(name, value) { + await this.#initializedPromise; + AppOptions.setAll({ + [name]: value + }, true); + await this._writeToStorage({ + [name]: AppOptions.get(name) + }); + } + async get(name) { + throw new Error("Not implemented: get"); + } + get initializedPromise() { + return this.#initializedPromise; + } +} + +;// ./web/l10n.js +class L10n { + #dir; + #elements; + #lang; + #l10n; + constructor({ + lang, + isRTL + }, l10n = null) { + this.#lang = L10n.#fixupLangCode(lang); + this.#l10n = l10n; + this.#dir = isRTL ?? L10n.#isRTL(this.#lang) ? "rtl" : "ltr"; + } + _setL10n(l10n) { + this.#l10n = l10n; + } + getLanguage() { + return this.#lang; + } + getDirection() { + return this.#dir; + } + async get(ids, args = null, fallback) { + if (Array.isArray(ids)) { + ids = ids.map(id => ({ + id + })); + const messages = await this.#l10n.formatMessages(ids); + return messages.map(message => message.value); + } + const messages = await this.#l10n.formatMessages([{ + id: ids, + args + }]); + return messages[0]?.value || fallback; + } + async translate(element) { + (this.#elements ||= new Set()).add(element); + try { + this.#l10n.connectRoot(element); + await this.#l10n.translateRoots(); + } catch {} + } + async translateOnce(element) { + try { + await this.#l10n.translateElements([element]); + } catch (ex) { + console.error("translateOnce:", ex); + } + } + async destroy() { + if (this.#elements) { + for (const element of this.#elements) { + this.#l10n.disconnectRoot(element); + } + this.#elements.clear(); + this.#elements = null; + } + this.#l10n.pauseObserving(); + } + pause() { + this.#l10n.pauseObserving(); + } + resume() { + this.#l10n.resumeObserving(); + } + static #fixupLangCode(langCode) { + langCode = langCode?.toLowerCase() || "en-us"; + const PARTIAL_LANG_CODES = { + en: "en-us", + es: "es-es", + fy: "fy-nl", + ga: "ga-ie", + gu: "gu-in", + hi: "hi-in", + hy: "hy-am", + nb: "nb-no", + ne: "ne-np", + nn: "nn-no", + pa: "pa-in", + pt: "pt-pt", + sv: "sv-se", + zh: "zh-cn" + }; + return PARTIAL_LANG_CODES[langCode] || langCode; + } + static #isRTL(lang) { + const shortCode = lang.split("-", 1)[0]; + return ["ar", "he", "fa", "ps", "ur"].includes(shortCode); + } +} +const GenericL10n = null; + +;// ./web/firefoxcom.js + + + + + + +let viewerApp = { + initialized: false +}; +function initCom(app) { + viewerApp = app; +} +class FirefoxCom { + static requestAsync(action, data) { + return new Promise(resolve => { + this.request(action, data, resolve); + }); + } + static request(action, data, callback = null) { + const request = document.createTextNode(""); + if (callback) { + request.addEventListener("pdf.js.response", event => { + const response = event.detail.response; + event.target.remove(); + callback(response); + }, { + once: true + }); + } + document.documentElement.append(request); + const sender = new CustomEvent("pdf.js.message", { + bubbles: true, + cancelable: false, + detail: { + action, + data, + responseExpected: !!callback + } + }); + request.dispatchEvent(sender); + } +} +class DownloadManager { + #openBlobUrls = new WeakMap(); + downloadData(data, filename, contentType) { + const blobUrl = URL.createObjectURL(new Blob([data], { + type: contentType + })); + FirefoxCom.request("download", { + blobUrl, + originalUrl: blobUrl, + filename, + isAttachment: true + }); + } + openOrDownloadData(data, filename, dest = null) { + const isPdfData = isPdfFile(filename); + const contentType = isPdfData ? "application/pdf" : ""; + if (isPdfData) { + let blobUrl = this.#openBlobUrls.get(data); + if (!blobUrl) { + blobUrl = URL.createObjectURL(new Blob([data], { + type: contentType + })); + this.#openBlobUrls.set(data, blobUrl); + } + let viewerUrl = blobUrl + "#filename=" + encodeURIComponent(filename); + if (dest) { + viewerUrl += `&filedest=${escape(dest)}`; + } + try { + window.open(viewerUrl); + return true; + } catch (ex) { + console.error("openOrDownloadData:", ex); + URL.revokeObjectURL(blobUrl); + this.#openBlobUrls.delete(data); + } + } + this.downloadData(data, filename, contentType); + return false; + } + download(data, url, filename) { + const blobUrl = data ? URL.createObjectURL(new Blob([data], { + type: "application/pdf" + })) : null; + FirefoxCom.request("download", { + blobUrl, + originalUrl: url, + filename + }); + } +} +class Preferences extends BasePreferences { + async _readFromStorage(prefObj) { + return FirefoxCom.requestAsync("getPreferences", prefObj); + } + async _writeToStorage(prefObj) { + return FirefoxCom.requestAsync("setPreferences", prefObj); + } +} +(function listenFindEvents() { + const events = ["find", "findagain", "findhighlightallchange", "findcasesensitivitychange", "findentirewordchange", "findbarclose", "finddiacriticmatchingchange"]; + const findLen = "find".length; + const handleEvent = function ({ + type, + detail + }) { + if (!viewerApp.initialized) { + return; + } + if (type === "findbarclose") { + viewerApp.eventBus.dispatch(type, { + source: window + }); + return; + } + viewerApp.eventBus.dispatch("find", { + source: window, + type: type.substring(findLen), + query: detail.query, + caseSensitive: !!detail.caseSensitive, + entireWord: !!detail.entireWord, + highlightAll: !!detail.highlightAll, + findPrevious: !!detail.findPrevious, + matchDiacritics: !!detail.matchDiacritics + }); + }; + for (const event of events) { + window.addEventListener(event, handleEvent); + } +})(); +(function listenZoomEvents() { + const events = ["zoomin", "zoomout", "zoomreset"]; + const handleEvent = function ({ + type, + detail + }) { + if (!viewerApp.initialized) { + return; + } + if (type === "zoomreset" && viewerApp.pdfViewer.currentScaleValue === DEFAULT_SCALE_VALUE) { + return; + } + viewerApp.eventBus.dispatch(type, { + source: window + }); + }; + for (const event of events) { + window.addEventListener(event, handleEvent); + } +})(); +(function listenSaveEvent() { + const handleEvent = function ({ + type, + detail + }) { + if (!viewerApp.initialized) { + return; + } + viewerApp.eventBus.dispatch("download", { + source: window + }); + }; + window.addEventListener("save", handleEvent); +})(); +(function listenEditingEvent() { + const handleEvent = function ({ + detail + }) { + if (!viewerApp.initialized) { + return; + } + viewerApp.eventBus.dispatch("editingaction", { + source: window, + name: detail.name + }); + }; + window.addEventListener("editingaction", handleEvent); +})(); +class FirefoxComDataRangeTransport extends PDFDataRangeTransport { + requestDataRange(begin, end) { + FirefoxCom.request("requestDataRange", { + begin, + end + }); + } + abort() { + FirefoxCom.request("abortLoading", null); + } +} +class FirefoxScripting { + static async createSandbox(data) { + const success = await FirefoxCom.requestAsync("createSandbox", data); + if (!success) { + throw new Error("Cannot create sandbox."); + } + } + static async dispatchEventInSandbox(event) { + FirefoxCom.request("dispatchEventInSandbox", event); + } + static async destroySandbox() { + FirefoxCom.request("destroySandbox", null); + } +} +class MLManager { + #abortSignal = null; + #enabled = null; + #eventBus = null; + #ready = null; + #requestResolvers = null; + hasProgress = false; + static #AI_ALT_TEXT_MODEL_NAME = "moz-image-to-text"; + constructor({ + altTextLearnMoreUrl, + enableGuessAltText, + enableAltTextModelDownload + }) { + this.altTextLearnMoreUrl = altTextLearnMoreUrl; + this.enableAltTextModelDownload = enableAltTextModelDownload; + this.enableGuessAltText = enableGuessAltText; + } + setEventBus(eventBus, abortSignal) { + this.#eventBus = eventBus; + this.#abortSignal = abortSignal; + eventBus._on("enablealttextmodeldownload", ({ + value + }) => { + if (this.enableAltTextModelDownload === value) { + return; + } + if (value) { + this.downloadModel("altText"); + } else { + this.deleteModel("altText"); + } + }, { + signal: abortSignal + }); + eventBus._on("enableguessalttext", ({ + value + }) => { + this.toggleService("altText", value); + }, { + signal: abortSignal + }); + } + async isEnabledFor(name) { + return this.enableGuessAltText && !!(await this.#enabled?.get(name)); + } + isReady(name) { + return this.#ready?.has(name) ?? false; + } + async deleteModel(name) { + if (name !== "altText" || !this.enableAltTextModelDownload) { + return; + } + this.enableAltTextModelDownload = false; + this.#ready?.delete(name); + this.#enabled?.delete(name); + await this.toggleService("altText", false); + await FirefoxCom.requestAsync("mlDelete", MLManager.#AI_ALT_TEXT_MODEL_NAME); + } + async loadModel(name) { + if (name === "altText" && this.enableAltTextModelDownload) { + await this.#loadAltTextEngine(false); + } + } + async downloadModel(name) { + if (name !== "altText" || this.enableAltTextModelDownload) { + return null; + } + this.enableAltTextModelDownload = true; + return this.#loadAltTextEngine(true); + } + async guess(data) { + if (data?.name !== "altText") { + return null; + } + const resolvers = this.#requestResolvers ||= new Set(); + const resolver = Promise.withResolvers(); + resolvers.add(resolver); + data.service = MLManager.#AI_ALT_TEXT_MODEL_NAME; + FirefoxCom.requestAsync("mlGuess", data).then(response => { + if (resolvers.has(resolver)) { + resolver.resolve(response); + resolvers.delete(resolver); + } + }).catch(reason => { + if (resolvers.has(resolver)) { + resolver.reject(reason); + resolvers.delete(resolver); + } + }); + return resolver.promise; + } + async #cancelAllRequests() { + if (!this.#requestResolvers) { + return; + } + for (const resolver of this.#requestResolvers) { + resolver.resolve({ + cancel: true + }); + } + this.#requestResolvers.clear(); + this.#requestResolvers = null; + } + async toggleService(name, enabled) { + if (name !== "altText" || this.enableGuessAltText === enabled) { + return; + } + this.enableGuessAltText = enabled; + if (enabled) { + if (this.enableAltTextModelDownload) { + await this.#loadAltTextEngine(false); + } + } else { + this.#cancelAllRequests(); + } + } + async #loadAltTextEngine(listenToProgress) { + if (this.#enabled?.has("altText")) { + return; + } + this.#ready ||= new Set(); + const promise = FirefoxCom.requestAsync("loadAIEngine", { + service: MLManager.#AI_ALT_TEXT_MODEL_NAME, + listenToProgress + }).then(ok => { + if (ok) { + this.#ready.add("altText"); + } + return ok; + }); + (this.#enabled ||= new Map()).set("altText", promise); + if (listenToProgress) { + const ac = new AbortController(); + const signal = AbortSignal.any([this.#abortSignal, ac.signal]); + this.hasProgress = true; + window.addEventListener("loadAIEngineProgress", ({ + detail + }) => { + this.#eventBus.dispatch("loadaiengineprogress", { + source: this, + detail + }); + if (detail.finished) { + ac.abort(); + this.hasProgress = false; + } + }, { + signal + }); + promise.then(ok => { + if (!ok) { + ac.abort(); + this.hasProgress = false; + } + }); + } + await promise; + } +} +class SignatureStorage { + #eventBus = null; + #signatures = null; + #signal = null; + constructor(eventBus, signal) { + this.#eventBus = eventBus; + this.#signal = signal; + } + #handleSignature(data) { + return FirefoxCom.requestAsync("handleSignature", data); + } + async getAll() { + if (this.#signal) { + window.addEventListener("storedSignaturesChanged", () => { + this.#signatures = null; + this.#eventBus?.dispatch("storedsignatureschanged", { + source: this + }); + }, { + signal: this.#signal + }); + this.#signal = null; + } + if (!this.#signatures) { + this.#signatures = new Map(); + const data = await this.#handleSignature({ + action: "get" + }); + if (data) { + for (const { + uuid, + description, + signatureData + } of data) { + this.#signatures.set(uuid, { + description, + signatureData + }); + } + } + } + return this.#signatures; + } + async isFull() { + return (await this.size()) === 5; + } + async size() { + return (await this.getAll()).size; + } + async create(data) { + if (await this.isFull()) { + return null; + } + const uuid = await this.#handleSignature({ + action: "create", + ...data + }); + if (!uuid) { + return null; + } + this.#signatures.set(uuid, data); + return uuid; + } + async delete(uuid) { + const signatures = await this.getAll(); + if (!signatures.has(uuid)) { + return false; + } + if (await this.#handleSignature({ + action: "delete", + uuid + })) { + signatures.delete(uuid); + return true; + } + return false; + } +} +class ExternalServices extends BaseExternalServices { + updateFindControlState(data) { + FirefoxCom.request("updateFindControlState", data); + } + updateFindMatchesCount(data) { + FirefoxCom.request("updateFindMatchesCount", data); + } + initPassiveLoading() { + let pdfDataRangeTransport; + window.addEventListener("message", function windowMessage(e) { + if (e.source !== null) { + console.warn("Rejected untrusted message from " + e.origin); + return; + } + const args = e.data; + if (typeof args !== "object" || !("pdfjsLoadAction" in args)) { + return; + } + switch (args.pdfjsLoadAction) { + case "supportsRangedLoading": + if (args.done && !args.data) { + viewerApp._documentError(null); + break; + } + pdfDataRangeTransport = new FirefoxComDataRangeTransport(args.length, args.data, args.done, args.filename); + viewerApp.open({ + range: pdfDataRangeTransport + }); + break; + case "range": + pdfDataRangeTransport.onDataRange(args.begin, args.chunk); + break; + case "rangeProgress": + pdfDataRangeTransport.onDataProgress(args.loaded); + break; + case "progressiveRead": + pdfDataRangeTransport.onDataProgressiveRead(args.chunk); + pdfDataRangeTransport.onDataProgress(args.loaded, args.total); + break; + case "progressiveDone": + pdfDataRangeTransport?.onDataProgressiveDone(); + break; + case "progress": + viewerApp.progress(args.loaded / args.total); + break; + case "complete": + if (!args.data) { + viewerApp._documentError(null, { + message: args.errorCode + }); + break; + } + viewerApp.open({ + data: args.data, + filename: args.filename + }); + break; + } + }); + FirefoxCom.request("initPassiveLoading", null); + } + reportTelemetry(data) { + FirefoxCom.request("reportTelemetry", data); + } + reportText(data) { + FirefoxCom.request("reportText", data); + } + updateEditorStates(data) { + FirefoxCom.request("updateEditorStates", data); + } + async createL10n() { + await document.l10n.ready; + return new L10n(AppOptions.get("localeProperties"), document.l10n); + } + createScripting() { + return FirefoxScripting; + } + createSignatureStorage(eventBus, signal) { + return new SignatureStorage(eventBus, signal); + } + dispatchGlobalEvent(event) { + FirefoxCom.request("dispatchGlobalEvent", event); + } +} + +;// ./web/new_alt_text_manager.js + +class NewAltTextManager { + #boundCancel = this.#cancel.bind(this); + #createAutomaticallyButton; + #currentEditor = null; + #cancelButton; + #descriptionContainer; + #dialog; + #disclaimer; + #downloadModel; + #downloadModelDescription; + #eventBus; + #firstTime = false; + #guessedAltText; + #hasAI = null; + #isEditing = null; + #imagePreview; + #imageData; + #isAILoading = false; + #wasAILoading = false; + #learnMore; + #notNowButton; + #overlayManager; + #textarea; + #title; + #uiManager; + #previousAltText = null; + constructor({ + descriptionContainer, + dialog, + imagePreview, + cancelButton, + disclaimer, + notNowButton, + saveButton, + textarea, + learnMore, + errorCloseButton, + createAutomaticallyButton, + downloadModel, + downloadModelDescription, + title + }, overlayManager, eventBus) { + this.#cancelButton = cancelButton; + this.#createAutomaticallyButton = createAutomaticallyButton; + this.#descriptionContainer = descriptionContainer; + this.#dialog = dialog; + this.#disclaimer = disclaimer; + this.#notNowButton = notNowButton; + this.#imagePreview = imagePreview; + this.#textarea = textarea; + this.#learnMore = learnMore; + this.#title = title; + this.#downloadModel = downloadModel; + this.#downloadModelDescription = downloadModelDescription; + this.#overlayManager = overlayManager; + this.#eventBus = eventBus; + dialog.addEventListener("close", this.#close.bind(this)); + dialog.addEventListener("contextmenu", event => { + if (event.target !== this.#textarea) { + event.preventDefault(); + } + }); + cancelButton.addEventListener("click", this.#boundCancel); + notNowButton.addEventListener("click", this.#boundCancel); + saveButton.addEventListener("click", this.#save.bind(this)); + errorCloseButton.addEventListener("click", () => { + this.#toggleError(false); + }); + createAutomaticallyButton.addEventListener("click", async () => { + const checked = createAutomaticallyButton.getAttribute("aria-pressed") !== "true"; + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.ai_generation_check", + data: { + status: checked + } + }); + if (this.#uiManager) { + this.#uiManager.setPreference("enableGuessAltText", checked); + await this.#uiManager.mlManager.toggleService("altText", checked); + } + this.#toggleGuessAltText(checked, false); + }); + textarea.addEventListener("focus", () => { + this.#wasAILoading = this.#isAILoading; + this.#toggleLoading(false); + this.#toggleTitleAndDisclaimer(); + }); + textarea.addEventListener("blur", () => { + if (!textarea.value) { + this.#toggleLoading(this.#wasAILoading); + } + this.#toggleTitleAndDisclaimer(); + }); + textarea.addEventListener("input", () => { + this.#toggleTitleAndDisclaimer(); + }); + textarea.addEventListener("keydown", e => { + if ((e.ctrlKey || e.metaKey) && e.key === "Enter" && !saveButton.disabled) { + this.#save(); + } + }); + eventBus._on("enableguessalttext", ({ + value + }) => { + this.#toggleGuessAltText(value, false); + }); + this.#overlayManager.register(dialog); + this.#learnMore.addEventListener("click", () => { + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.info", + data: { + topic: "alt_text" + } + }); + }); + } + #toggleLoading(value) { + if (!this.#uiManager || this.#isAILoading === value) { + return; + } + this.#isAILoading = value; + this.#descriptionContainer.classList.toggle("loading", value); + } + #toggleError(value) { + if (!this.#uiManager) { + return; + } + this.#dialog.classList.toggle("error", value); + } + async #toggleGuessAltText(value, isInitial = false) { + if (!this.#uiManager) { + return; + } + this.#dialog.classList.toggle("aiDisabled", !value); + this.#createAutomaticallyButton.setAttribute("aria-pressed", value); + if (value) { + const { + altTextLearnMoreUrl + } = this.#uiManager.mlManager; + if (altTextLearnMoreUrl) { + this.#learnMore.href = altTextLearnMoreUrl; + } + this.#mlGuessAltText(isInitial); + } else { + this.#toggleLoading(false); + this.#isAILoading = false; + this.#toggleTitleAndDisclaimer(); + } + } + #toggleNotNow() { + this.#notNowButton.classList.toggle("hidden", !this.#firstTime); + this.#cancelButton.classList.toggle("hidden", this.#firstTime); + } + #toggleAI(value) { + if (!this.#uiManager || this.#hasAI === value) { + return; + } + this.#hasAI = value; + this.#dialog.classList.toggle("noAi", !value); + this.#toggleTitleAndDisclaimer(); + } + #toggleTitleAndDisclaimer() { + const visible = this.#isAILoading || this.#guessedAltText && this.#guessedAltText === this.#textarea.value; + this.#disclaimer.hidden = !visible; + const isEditing = this.#isAILoading || !!this.#textarea.value; + if (this.#isEditing === isEditing) { + return; + } + this.#isEditing = isEditing; + this.#title.setAttribute("data-l10n-id", isEditing ? "pdfjs-editor-new-alt-text-dialog-edit-label" : "pdfjs-editor-new-alt-text-dialog-add-label"); + } + async #mlGuessAltText(isInitial) { + if (this.#isAILoading) { + return; + } + if (this.#textarea.value) { + return; + } + if (isInitial && this.#previousAltText !== null) { + return; + } + this.#guessedAltText = this.#currentEditor.guessedAltText; + if (this.#previousAltText === null && this.#guessedAltText) { + this.#addAltText(this.#guessedAltText); + return; + } + this.#toggleLoading(true); + this.#toggleTitleAndDisclaimer(); + let hasError = false; + try { + const altText = await this.#currentEditor.mlGuessAltText(this.#imageData, false); + if (altText) { + this.#guessedAltText = altText; + this.#wasAILoading = this.#isAILoading; + if (this.#isAILoading) { + this.#addAltText(altText); + } + } + } catch (e) { + console.error(e); + hasError = true; + } + this.#toggleLoading(false); + this.#toggleTitleAndDisclaimer(); + if (hasError && this.#uiManager) { + this.#toggleError(true); + } + } + #addAltText(altText) { + if (!this.#uiManager || this.#textarea.value) { + return; + } + this.#textarea.value = altText; + this.#toggleTitleAndDisclaimer(); + } + #setProgress() { + this.#downloadModel.classList.toggle("hidden", false); + const callback = async ({ + detail: { + finished, + total, + totalLoaded + } + }) => { + const ONE_MEGA_BYTES = 1e6; + totalLoaded = Math.min(0.99 * total, totalLoaded); + const totalSize = this.#downloadModelDescription.ariaValueMax = Math.round(total / ONE_MEGA_BYTES); + const downloadedSize = this.#downloadModelDescription.ariaValueNow = Math.round(totalLoaded / ONE_MEGA_BYTES); + this.#downloadModelDescription.setAttribute("data-l10n-args", JSON.stringify({ + totalSize, + downloadedSize + })); + if (!finished) { + return; + } + this.#eventBus._off("loadaiengineprogress", callback); + this.#downloadModel.classList.toggle("hidden", true); + this.#toggleAI(true); + if (!this.#uiManager) { + return; + } + const { + mlManager + } = this.#uiManager; + mlManager.toggleService("altText", true); + this.#toggleGuessAltText(await mlManager.isEnabledFor("altText"), true); + }; + this.#eventBus._on("loadaiengineprogress", callback); + } + async editAltText(uiManager, editor, firstTime) { + if (this.#currentEditor || !editor) { + return; + } + if (firstTime && editor.hasAltTextData()) { + editor.altTextFinish(); + return; + } + this.#firstTime = firstTime; + let { + mlManager + } = uiManager; + let hasAI = !!mlManager; + this.#toggleTitleAndDisclaimer(); + if (mlManager && !mlManager.isReady("altText")) { + hasAI = false; + if (mlManager.hasProgress) { + this.#setProgress(); + } else { + mlManager = null; + } + } else { + this.#downloadModel.classList.toggle("hidden", true); + } + const isAltTextEnabledPromise = mlManager?.isEnabledFor("altText"); + this.#currentEditor = editor; + this.#uiManager = uiManager; + this.#uiManager.removeEditListeners(); + ({ + altText: this.#previousAltText + } = editor.altTextData); + this.#textarea.value = this.#previousAltText ?? ""; + const AI_MAX_IMAGE_DIMENSION = 224; + const MAX_PREVIEW_DIMENSION = 180; + let canvas, width, height; + if (mlManager) { + ({ + canvas, + width, + height, + imageData: this.#imageData + } = editor.copyCanvas(AI_MAX_IMAGE_DIMENSION, MAX_PREVIEW_DIMENSION, true)); + if (hasAI) { + this.#toggleGuessAltText(await isAltTextEnabledPromise, true); + } + } else { + ({ + canvas, + width, + height + } = editor.copyCanvas(AI_MAX_IMAGE_DIMENSION, MAX_PREVIEW_DIMENSION, false)); + } + canvas.setAttribute("role", "presentation"); + const { + style + } = canvas; + style.width = `${width}px`; + style.height = `${height}px`; + this.#imagePreview.append(canvas); + this.#toggleNotNow(); + this.#toggleAI(hasAI); + this.#toggleError(false); + try { + await this.#overlayManager.open(this.#dialog); + } catch (ex) { + this.#close(); + throw ex; + } + } + #cancel() { + this.#currentEditor.altTextData = { + cancel: true + }; + const altText = this.#textarea.value.trim(); + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.dismiss", + data: { + alt_text_type: altText ? "present" : "empty", + flow: this.#firstTime ? "image_add" : "alt_text_edit" + } + }); + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.image_added", + data: { + alt_text_modal: true, + alt_text_type: "skipped" + } + }); + this.#finish(); + } + #finish() { + this.#overlayManager.closeIfActive(this.#dialog); + } + #close() { + const canvas = this.#imagePreview.firstElementChild; + canvas.remove(); + canvas.width = canvas.height = 0; + this.#imageData = null; + this.#toggleLoading(false); + this.#uiManager?.addEditListeners(); + this.#currentEditor.altTextFinish(); + this.#uiManager?.setSelected(this.#currentEditor); + this.#currentEditor = null; + this.#uiManager = null; + } + #extractWords(text) { + return new Set(text.toLowerCase().split(/[^\p{L}\p{N}]+/gu).filter(x => !!x)); + } + #save() { + const altText = this.#textarea.value.trim(); + this.#currentEditor.altTextData = { + altText, + decorative: false + }; + this.#currentEditor.altTextData.guessedAltText = this.#guessedAltText; + if (this.#guessedAltText && this.#guessedAltText !== altText) { + const guessedWords = this.#extractWords(this.#guessedAltText); + const words = this.#extractWords(altText); + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.user_edit", + data: { + total_words: guessedWords.size, + words_removed: guessedWords.difference(words).size, + words_added: words.difference(guessedWords).size + } + }); + } + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.image_added", + data: { + alt_text_modal: true, + alt_text_type: altText ? "present" : "empty" + } + }); + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.save", + data: { + alt_text_type: altText ? "present" : "empty", + flow: this.#firstTime ? "image_add" : "alt_text_edit" + } + }); + this.#finish(); + } + destroy() { + this.#uiManager = null; + this.#finish(); + } +} +class ImageAltTextSettings { + #aiModelSettings; + #createModelButton; + #downloadModelButton; + #dialog; + #eventBus; + #mlManager; + #overlayManager; + #showAltTextDialogButton; + constructor({ + dialog, + createModelButton, + aiModelSettings, + learnMore, + closeButton, + deleteModelButton, + downloadModelButton, + showAltTextDialogButton + }, overlayManager, eventBus, mlManager) { + this.#dialog = dialog; + this.#aiModelSettings = aiModelSettings; + this.#createModelButton = createModelButton; + this.#downloadModelButton = downloadModelButton; + this.#showAltTextDialogButton = showAltTextDialogButton; + this.#overlayManager = overlayManager; + this.#eventBus = eventBus; + this.#mlManager = mlManager; + const { + altTextLearnMoreUrl + } = mlManager; + if (altTextLearnMoreUrl) { + learnMore.href = altTextLearnMoreUrl; + } + dialog.addEventListener("contextmenu", noContextMenu); + createModelButton.addEventListener("click", async e => { + const checked = this.#togglePref("enableGuessAltText", e); + await mlManager.toggleService("altText", checked); + this.#reportTelemetry({ + type: "stamp", + action: "pdfjs.image.alt_text.settings_ai_generation_check", + data: { + status: checked + } + }); + }); + showAltTextDialogButton.addEventListener("click", e => { + const checked = this.#togglePref("enableNewAltTextWhenAddingImage", e); + this.#reportTelemetry({ + type: "stamp", + action: "pdfjs.image.alt_text.settings_edit_alt_text_check", + data: { + status: checked + } + }); + }); + deleteModelButton.addEventListener("click", this.#delete.bind(this, true)); + downloadModelButton.addEventListener("click", this.#download.bind(this, true)); + closeButton.addEventListener("click", this.#finish.bind(this)); + learnMore.addEventListener("click", () => { + this.#reportTelemetry({ + type: "stamp", + action: "pdfjs.image.alt_text.info", + data: { + topic: "ai_generation" + } + }); + }); + eventBus._on("enablealttextmodeldownload", ({ + value + }) => { + if (value) { + this.#download(false); + } else { + this.#delete(false); + } + }); + this.#overlayManager.register(dialog); + } + #reportTelemetry(data) { + this.#eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "editing", + data + } + }); + } + async #download(isFromUI = false) { + if (isFromUI) { + this.#downloadModelButton.disabled = true; + const span = this.#downloadModelButton.firstElementChild; + span.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-settings-downloading-model-button"); + await this.#mlManager.downloadModel("altText"); + span.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-settings-download-model-button"); + this.#createModelButton.disabled = false; + this.#setPref("enableGuessAltText", true); + this.#mlManager.toggleService("altText", true); + this.#setPref("enableAltTextModelDownload", true); + this.#downloadModelButton.disabled = false; + } + this.#aiModelSettings.classList.toggle("download", false); + this.#createModelButton.setAttribute("aria-pressed", true); + } + async #delete(isFromUI = false) { + if (isFromUI) { + await this.#mlManager.deleteModel("altText"); + this.#setPref("enableGuessAltText", false); + this.#setPref("enableAltTextModelDownload", false); + } + this.#aiModelSettings.classList.toggle("download", true); + this.#createModelButton.disabled = true; + this.#createModelButton.setAttribute("aria-pressed", false); + } + async open({ + enableGuessAltText, + enableNewAltTextWhenAddingImage + }) { + const { + enableAltTextModelDownload + } = this.#mlManager; + this.#createModelButton.disabled = !enableAltTextModelDownload; + this.#createModelButton.setAttribute("aria-pressed", enableAltTextModelDownload && enableGuessAltText); + this.#showAltTextDialogButton.setAttribute("aria-pressed", enableNewAltTextWhenAddingImage); + this.#aiModelSettings.classList.toggle("download", !enableAltTextModelDownload); + await this.#overlayManager.open(this.#dialog); + this.#reportTelemetry({ + type: "stamp", + action: "pdfjs.image.alt_text.settings_displayed" + }); + } + #togglePref(name, { + target + }) { + const checked = target.getAttribute("aria-pressed") !== "true"; + this.#setPref(name, checked); + target.setAttribute("aria-pressed", checked); + return checked; + } + #setPref(name, value) { + this.#eventBus.dispatch("setpreference", { + source: this, + name, + value + }); + } + #finish() { + this.#overlayManager.closeIfActive(this.#dialog); + } +} + +;// ./web/alt_text_manager.js + +class AltTextManager { + #clickAC = null; + #currentEditor = null; + #cancelButton; + #dialog; + #eventBus; + #hasUsedPointer = false; + #optionDescription; + #optionDecorative; + #overlayManager; + #saveButton; + #textarea; + #uiManager; + #previousAltText = null; + #resizeAC = null; + #svgElement = null; + #rectElement = null; + #container; + #telemetryData = null; + constructor({ + dialog, + optionDescription, + optionDecorative, + textarea, + cancelButton, + saveButton + }, container, overlayManager, eventBus) { + this.#dialog = dialog; + this.#optionDescription = optionDescription; + this.#optionDecorative = optionDecorative; + this.#textarea = textarea; + this.#cancelButton = cancelButton; + this.#saveButton = saveButton; + this.#overlayManager = overlayManager; + this.#eventBus = eventBus; + this.#container = container; + const onUpdateUIState = this.#updateUIState.bind(this); + dialog.addEventListener("close", this.#close.bind(this)); + dialog.addEventListener("contextmenu", event => { + if (event.target !== this.#textarea) { + event.preventDefault(); + } + }); + cancelButton.addEventListener("click", this.#finish.bind(this)); + saveButton.addEventListener("click", this.#save.bind(this)); + optionDescription.addEventListener("change", onUpdateUIState); + optionDecorative.addEventListener("change", onUpdateUIState); + textarea.addEventListener("keydown", e => { + if ((e.ctrlKey || e.metaKey) && e.key === "Enter" && !saveButton.disabled) { + this.#save(); + } + }); + this.#overlayManager.register(dialog); + } + #createSVGElement() { + if (this.#svgElement) { + return; + } + const svgFactory = new DOMSVGFactory(); + const svg = this.#svgElement = svgFactory.createElement("svg"); + svg.setAttribute("width", "0"); + svg.setAttribute("height", "0"); + const defs = svgFactory.createElement("defs"); + svg.append(defs); + const mask = svgFactory.createElement("mask"); + defs.append(mask); + mask.setAttribute("id", "alttext-manager-mask"); + mask.setAttribute("maskContentUnits", "objectBoundingBox"); + let rect = svgFactory.createElement("rect"); + mask.append(rect); + rect.setAttribute("fill", "white"); + rect.setAttribute("width", "1"); + rect.setAttribute("height", "1"); + rect.setAttribute("x", "0"); + rect.setAttribute("y", "0"); + rect = this.#rectElement = svgFactory.createElement("rect"); + mask.append(rect); + rect.setAttribute("fill", "black"); + this.#dialog.append(svg); + } + async editAltText(uiManager, editor) { + if (this.#currentEditor || !editor) { + return; + } + this.#createSVGElement(); + this.#hasUsedPointer = false; + this.#clickAC = new AbortController(); + const clickOpts = { + signal: this.#clickAC.signal + }, + onClick = this.#onClick.bind(this); + for (const element of [this.#optionDescription, this.#optionDecorative, this.#textarea, this.#saveButton, this.#cancelButton]) { + element.addEventListener("click", onClick, clickOpts); + } + const { + altText, + decorative + } = editor.altTextData; + if (decorative === true) { + this.#optionDecorative.checked = true; + this.#optionDescription.checked = false; + } else { + this.#optionDecorative.checked = false; + this.#optionDescription.checked = true; + } + this.#previousAltText = this.#textarea.value = altText?.trim() || ""; + this.#updateUIState(); + this.#currentEditor = editor; + this.#uiManager = uiManager; + this.#uiManager.removeEditListeners(); + this.#resizeAC = new AbortController(); + this.#eventBus._on("resize", this.#setPosition.bind(this), { + signal: this.#resizeAC.signal + }); + try { + await this.#overlayManager.open(this.#dialog); + this.#setPosition(); + } catch (ex) { + this.#close(); + throw ex; + } + } + #setPosition() { + if (!this.#currentEditor) { + return; + } + const dialog = this.#dialog; + const { + style + } = dialog; + const { + x: containerX, + y: containerY, + width: containerW, + height: containerH + } = this.#container.getBoundingClientRect(); + const { + innerWidth: windowW, + innerHeight: windowH + } = window; + const { + width: dialogW, + height: dialogH + } = dialog.getBoundingClientRect(); + const { + x, + y, + width, + height + } = this.#currentEditor.getClientDimensions(); + const MARGIN = 10; + const isLTR = this.#uiManager.direction === "ltr"; + const xs = Math.max(x, containerX); + const xe = Math.min(x + width, containerX + containerW); + const ys = Math.max(y, containerY); + const ye = Math.min(y + height, containerY + containerH); + this.#rectElement.setAttribute("width", `${(xe - xs) / windowW}`); + this.#rectElement.setAttribute("height", `${(ye - ys) / windowH}`); + this.#rectElement.setAttribute("x", `${xs / windowW}`); + this.#rectElement.setAttribute("y", `${ys / windowH}`); + let left = null; + let top = Math.max(y, 0); + top += Math.min(windowH - (top + dialogH), 0); + if (isLTR) { + if (x + width + MARGIN + dialogW < windowW) { + left = x + width + MARGIN; + } else if (x > dialogW + MARGIN) { + left = x - dialogW - MARGIN; + } + } else if (x > dialogW + MARGIN) { + left = x - dialogW - MARGIN; + } else if (x + width + MARGIN + dialogW < windowW) { + left = x + width + MARGIN; + } + if (left === null) { + top = null; + left = Math.max(x, 0); + left += Math.min(windowW - (left + dialogW), 0); + if (y > dialogH + MARGIN) { + top = y - dialogH - MARGIN; + } else if (y + height + MARGIN + dialogH < windowH) { + top = y + height + MARGIN; + } + } + if (top !== null) { + dialog.classList.add("positioned"); + if (isLTR) { + style.left = `${left}px`; + } else { + style.right = `${windowW - left - dialogW}px`; + } + style.top = `${top}px`; + } else { + dialog.classList.remove("positioned"); + style.left = ""; + style.top = ""; + } + } + #finish() { + this.#overlayManager.closeIfActive(this.#dialog); + } + #close() { + this.#currentEditor._reportTelemetry(this.#telemetryData || { + action: "alt_text_cancel", + alt_text_keyboard: !this.#hasUsedPointer + }); + this.#telemetryData = null; + this.#removeOnClickListeners(); + this.#uiManager?.addEditListeners(); + this.#resizeAC?.abort(); + this.#resizeAC = null; + this.#currentEditor.altTextFinish(); + this.#currentEditor = null; + this.#uiManager = null; + } + #updateUIState() { + this.#textarea.disabled = this.#optionDecorative.checked; + } + #save() { + const altText = this.#textarea.value.trim(); + const decorative = this.#optionDecorative.checked; + this.#currentEditor.altTextData = { + altText, + decorative + }; + this.#telemetryData = { + action: "alt_text_save", + alt_text_description: !!altText, + alt_text_edit: !!this.#previousAltText && this.#previousAltText !== altText, + alt_text_decorative: decorative, + alt_text_keyboard: !this.#hasUsedPointer + }; + this.#finish(); + } + #onClick(evt) { + if (evt.detail === 0) { + return; + } + this.#hasUsedPointer = true; + this.#removeOnClickListeners(); + } + #removeOnClickListeners() { + this.#clickAC?.abort(); + this.#clickAC = null; + } + destroy() { + this.#uiManager = null; + this.#finish(); + this.#svgElement?.remove(); + this.#svgElement = this.#rectElement = null; + } +} + +;// ./web/annotation_editor_params.js + +class AnnotationEditorParams { + constructor(options, eventBus) { + this.eventBus = eventBus; + this.#bindListeners(options); + } + #bindListeners({ + editorFreeTextFontSize, + editorFreeTextColor, + editorInkColor, + editorInkThickness, + editorInkOpacity, + editorStampAddImage, + editorFreeHighlightThickness, + editorHighlightShowAll, + editorSignatureAddSignature + }) { + const { + eventBus + } = this; + const dispatchEvent = (typeStr, value) => { + eventBus.dispatch("switchannotationeditorparams", { + source: this, + type: AnnotationEditorParamsType[typeStr], + value + }); + }; + editorFreeTextFontSize.addEventListener("input", function () { + dispatchEvent("FREETEXT_SIZE", this.valueAsNumber); + }); + editorFreeTextColor.addEventListener("input", function () { + dispatchEvent("FREETEXT_COLOR", this.value); + }); + editorInkColor.addEventListener("input", function () { + dispatchEvent("INK_COLOR", this.value); + }); + editorInkThickness.addEventListener("input", function () { + dispatchEvent("INK_THICKNESS", this.valueAsNumber); + }); + editorInkOpacity.addEventListener("input", function () { + dispatchEvent("INK_OPACITY", this.valueAsNumber); + }); + editorStampAddImage.addEventListener("click", () => { + eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "editing", + data: { + action: "pdfjs.image.add_image_click" + } + } + }); + dispatchEvent("CREATE"); + }); + editorFreeHighlightThickness.addEventListener("input", function () { + dispatchEvent("HIGHLIGHT_THICKNESS", this.valueAsNumber); + }); + editorHighlightShowAll.addEventListener("click", function () { + const checked = this.getAttribute("aria-pressed") === "true"; + this.setAttribute("aria-pressed", !checked); + dispatchEvent("HIGHLIGHT_SHOW_ALL", !checked); + }); + editorSignatureAddSignature.addEventListener("click", () => { + dispatchEvent("CREATE"); + }); + eventBus._on("annotationeditorparamschanged", evt => { + for (const [type, value] of evt.details) { + switch (type) { + case AnnotationEditorParamsType.FREETEXT_SIZE: + editorFreeTextFontSize.value = value; + break; + case AnnotationEditorParamsType.FREETEXT_COLOR: + editorFreeTextColor.value = value; + break; + case AnnotationEditorParamsType.INK_COLOR: + editorInkColor.value = value; + break; + case AnnotationEditorParamsType.INK_THICKNESS: + editorInkThickness.value = value; + break; + case AnnotationEditorParamsType.INK_OPACITY: + editorInkOpacity.value = value; + break; + case AnnotationEditorParamsType.HIGHLIGHT_COLOR: + eventBus.dispatch("mainhighlightcolorpickerupdatecolor", { + source: this, + value + }); + break; + case AnnotationEditorParamsType.HIGHLIGHT_THICKNESS: + editorFreeHighlightThickness.value = value; + break; + case AnnotationEditorParamsType.HIGHLIGHT_FREE: + editorFreeHighlightThickness.disabled = !value; + break; + case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL: + editorHighlightShowAll.setAttribute("aria-pressed", value); + break; + } + } + }); + } +} + +;// ./web/caret_browsing.js +const PRECISION = 1e-1; +class CaretBrowsingMode { + #mainContainer; + #toolBarHeight = 0; + #viewerContainer; + constructor(abortSignal, mainContainer, viewerContainer, toolbarContainer) { + this.#mainContainer = mainContainer; + this.#viewerContainer = viewerContainer; + if (!toolbarContainer) { + return; + } + this.#toolBarHeight = toolbarContainer.getBoundingClientRect().height; + const toolbarObserver = new ResizeObserver(entries => { + for (const entry of entries) { + if (entry.target === toolbarContainer) { + this.#toolBarHeight = Math.floor(entry.borderBoxSize[0].blockSize); + break; + } + } + }); + toolbarObserver.observe(toolbarContainer); + abortSignal.addEventListener("abort", () => toolbarObserver.disconnect(), { + once: true + }); + } + #isOnSameLine(rect1, rect2) { + const top1 = rect1.y; + const bot1 = rect1.bottom; + const mid1 = rect1.y + rect1.height / 2; + const top2 = rect2.y; + const bot2 = rect2.bottom; + const mid2 = rect2.y + rect2.height / 2; + return top1 <= mid2 && mid2 <= bot1 || top2 <= mid1 && mid1 <= bot2; + } + #isUnderOver(rect, x, y, isUp) { + const midY = rect.y + rect.height / 2; + return (isUp ? y >= midY : y <= midY) && rect.x - PRECISION <= x && x <= rect.right + PRECISION; + } + #isVisible(rect) { + return rect.top >= this.#toolBarHeight && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth); + } + #getCaretPosition(selection, isUp) { + const { + focusNode, + focusOffset + } = selection; + const range = document.createRange(); + range.setStart(focusNode, focusOffset); + range.setEnd(focusNode, focusOffset); + const rect = range.getBoundingClientRect(); + return [rect.x, isUp ? rect.top : rect.bottom]; + } + static #caretPositionFromPoint(x, y) { + return document.caretPositionFromPoint(x, y); + } + #setCaretPositionHelper(selection, caretX, select, element, rect) { + rect ||= element.getBoundingClientRect(); + if (caretX <= rect.x + PRECISION) { + if (select) { + selection.extend(element.firstChild, 0); + } else { + selection.setPosition(element.firstChild, 0); + } + return; + } + if (rect.right - PRECISION <= caretX) { + const { + lastChild + } = element; + if (select) { + selection.extend(lastChild, lastChild.length); + } else { + selection.setPosition(lastChild, lastChild.length); + } + return; + } + const midY = rect.y + rect.height / 2; + let caretPosition = CaretBrowsingMode.#caretPositionFromPoint(caretX, midY); + let parentElement = caretPosition.offsetNode?.parentElement; + if (parentElement && parentElement !== element) { + const elementsAtPoint = document.elementsFromPoint(caretX, midY); + const savedVisibilities = []; + for (const el of elementsAtPoint) { + if (el === element) { + break; + } + const { + style + } = el; + savedVisibilities.push([el, style.visibility]); + style.visibility = "hidden"; + } + caretPosition = CaretBrowsingMode.#caretPositionFromPoint(caretX, midY); + parentElement = caretPosition.offsetNode?.parentElement; + for (const [el, visibility] of savedVisibilities) { + el.style.visibility = visibility; + } + } + if (parentElement !== element) { + if (select) { + selection.extend(element.firstChild, 0); + } else { + selection.setPosition(element.firstChild, 0); + } + return; + } + if (select) { + selection.extend(caretPosition.offsetNode, caretPosition.offset); + } else { + selection.setPosition(caretPosition.offsetNode, caretPosition.offset); + } + } + #setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX) { + if (this.#isVisible(newLineElementRect)) { + this.#setCaretPositionHelper(selection, caretX, select, newLineElement, newLineElementRect); + return; + } + this.#mainContainer.addEventListener("scrollend", this.#setCaretPositionHelper.bind(this, selection, caretX, select, newLineElement, null), { + once: true + }); + newLineElement.scrollIntoView(); + } + #getNodeOnNextPage(textLayer, isUp) { + while (true) { + const page = textLayer.closest(".page"); + const pageNumber = parseInt(page.getAttribute("data-page-number")); + const nextPage = isUp ? pageNumber - 1 : pageNumber + 1; + textLayer = this.#viewerContainer.querySelector(`.page[data-page-number="${nextPage}"] .textLayer`); + if (!textLayer) { + return null; + } + const walker = document.createTreeWalker(textLayer, NodeFilter.SHOW_TEXT); + const node = isUp ? walker.lastChild() : walker.firstChild(); + if (node) { + return node; + } + } + } + moveCaret(isUp, select) { + const selection = document.getSelection(); + if (selection.rangeCount === 0) { + return; + } + const { + focusNode + } = selection; + const focusElement = focusNode.nodeType !== Node.ELEMENT_NODE ? focusNode.parentElement : focusNode; + const root = focusElement.closest(".textLayer"); + if (!root) { + return; + } + const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT); + walker.currentNode = focusNode; + const focusRect = focusElement.getBoundingClientRect(); + let newLineElement = null; + const nodeIterator = (isUp ? walker.previousSibling : walker.nextSibling).bind(walker); + while (nodeIterator()) { + const element = walker.currentNode.parentElement; + if (!this.#isOnSameLine(focusRect, element.getBoundingClientRect())) { + newLineElement = element; + break; + } + } + if (!newLineElement) { + const node = this.#getNodeOnNextPage(root, isUp); + if (!node) { + return; + } + if (select) { + const lastNode = (isUp ? walker.firstChild() : walker.lastChild()) || focusNode; + selection.extend(lastNode, isUp ? 0 : lastNode.length); + const range = document.createRange(); + range.setStart(node, isUp ? node.length : 0); + range.setEnd(node, isUp ? node.length : 0); + selection.addRange(range); + return; + } + const [caretX] = this.#getCaretPosition(selection, isUp); + const { + parentElement + } = node; + this.#setCaretPosition(select, selection, parentElement, parentElement.getBoundingClientRect(), caretX); + return; + } + const [caretX, caretY] = this.#getCaretPosition(selection, isUp); + const newLineElementRect = newLineElement.getBoundingClientRect(); + if (this.#isUnderOver(newLineElementRect, caretX, caretY, isUp)) { + this.#setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX); + return; + } + while (nodeIterator()) { + const element = walker.currentNode.parentElement; + const elementRect = element.getBoundingClientRect(); + if (!this.#isOnSameLine(newLineElementRect, elementRect)) { + break; + } + if (this.#isUnderOver(elementRect, caretX, caretY, isUp)) { + this.#setCaretPosition(select, selection, element, elementRect, caretX); + return; + } + } + this.#setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX); + } +} + +;// ./web/sidebar.js + +class Sidebar { + #minWidth = 0; + #maxWidth = 0; + #initialWidth = 0; + #width = 0; + #coefficient; + #visible = false; + constructor({ + sidebar, + resizer, + toggleButton + }, ltr, isResizerOnTheLeft) { + this._sidebar = sidebar; + this.#coefficient = ltr === isResizerOnTheLeft ? -1 : 1; + const style = window.getComputedStyle(sidebar); + this.#minWidth = parseFloat(style.getPropertyValue("--sidebar-min-width")); + this.#maxWidth = parseFloat(style.getPropertyValue("--sidebar-max-width")); + this.#initialWidth = this.#width = parseFloat(style.getPropertyValue("--sidebar-width")); + this.#makeSidebarResizable(resizer, isResizerOnTheLeft); + toggleButton.addEventListener("click", this.toggle.bind(this)); + sidebar.hidden = true; + } + #makeSidebarResizable(resizer, isResizerOnTheLeft) { + resizer.ariaValueMin = this.#minWidth; + resizer.ariaValueMax = this.#maxWidth; + resizer.ariaValueNow = this.#width; + let pointerMoveAC; + const cancelResize = () => { + this.#width = MathClamp(this.#width, this.#minWidth, this.#maxWidth); + this._sidebar.classList.remove("resizing"); + pointerMoveAC?.abort(); + pointerMoveAC = null; + }; + resizer.addEventListener("pointerdown", e => { + if (pointerMoveAC) { + cancelResize(); + return; + } + const { + clientX + } = e; + stopEvent(e); + let prevX = clientX; + pointerMoveAC = new AbortController(); + const { + signal + } = pointerMoveAC; + const sidebar = this._sidebar; + const sidebarStyle = sidebar.style; + sidebar.classList.add("resizing"); + const parentStyle = sidebar.parentElement.style; + parentStyle.minWidth = 0; + window.addEventListener("contextmenu", noContextMenu, { + signal + }); + window.addEventListener("pointermove", ev => { + if (!pointerMoveAC) { + return; + } + stopEvent(ev); + const { + clientX: x + } = ev; + this.#setNewWidth(x - prevX, parentStyle, resizer, sidebarStyle, isResizerOnTheLeft, false); + prevX = x; + }, { + signal, + capture: true + }); + window.addEventListener("blur", cancelResize, { + signal + }); + window.addEventListener("pointerup", ev => { + if (pointerMoveAC) { + cancelResize(); + stopEvent(ev); + } + }, { + signal + }); + }); + resizer.addEventListener("keydown", e => { + const { + key + } = e; + const isArrowLeft = key === "ArrowLeft"; + if (isArrowLeft || key === "ArrowRight") { + const base = e.ctrlKey || e.metaKey ? 10 : 1; + const dx = base * (isArrowLeft ? -1 : 1); + this.#setNewWidth(dx, this._sidebar.parentElement.style, resizer, this._sidebar.style, isResizerOnTheLeft, true); + stopEvent(e); + } + }); + } + #setNewWidth(dx, parentStyle, resizer, sidebarStyle, isResizerOnTheLeft, isFromKeyboard) { + let newWidth = this.#width + this.#coefficient * dx; + if (!isFromKeyboard) { + this.#width = newWidth; + } + if ((newWidth > this.#maxWidth || newWidth < this.#minWidth) && (this.#width === this.#maxWidth || this.#width === this.#minWidth)) { + return; + } + newWidth = MathClamp(newWidth, this.#minWidth, this.#maxWidth); + if (isFromKeyboard) { + this.#width = newWidth; + } + resizer.ariaValueNow = Math.round(newWidth); + sidebarStyle.width = `${newWidth.toFixed(3)}px`; + if (isResizerOnTheLeft) { + parentStyle.insetInlineStart = `${(this.#initialWidth - newWidth).toFixed(3)}px`; + } + } + toggle() { + this._sidebar.hidden = !(this.#visible = !this.#visible); + } +} + +;// ./web/comment_manager.js + + + +class CommentManager { + #dialog; + #popup; + #sidebar; + static #hasForcedColors = null; + constructor(commentDialog, sidebar, eventBus, linkService, overlayManager, ltr, hasForcedColors) { + const dateFormat = new Intl.DateTimeFormat(undefined, { + dateStyle: "long" + }); + this.dialogElement = commentDialog.dialog; + this.#dialog = new CommentDialog(commentDialog, overlayManager, eventBus, ltr); + this.#popup = new CommentPopup(eventBus, dateFormat, ltr, this.dialogElement); + this.#sidebar = new CommentSidebar(sidebar, eventBus, linkService, this.#popup, dateFormat, ltr); + this.#popup.sidebar = this.#sidebar; + CommentManager.#hasForcedColors = hasForcedColors; + } + setSidebarUiManager(uiManager) { + this.#sidebar.setUIManager(uiManager); + } + showSidebar(annotations) { + this.#sidebar.show(annotations); + } + hideSidebar() { + this.#sidebar.hide(); + } + removeComments(ids) { + this.#sidebar.removeComments(ids); + } + selectComment(id) { + this.#sidebar.selectComment(null, id); + } + addComment(annotation) { + this.#sidebar.addComment(annotation); + } + updateComment(annotation) { + this.#sidebar.updateComment(annotation); + } + toggleCommentPopup(editor, isSelected, visibility, isEditable) { + if (isSelected) { + this.selectComment(editor.uid); + } + this.#popup.toggle(editor, isSelected, visibility, isEditable); + } + destroyPopup() { + this.#popup.destroy(); + } + updatePopupColor(editor) { + this.#popup.updateColor(editor); + } + showDialog(uiManager, editor, posX, posY, options) { + return this.#dialog.open(uiManager, editor, posX, posY, options); + } + makeCommentColor(color, opacity) { + return CommentManager._makeCommentColor(color, opacity); + } + static _makeCommentColor(color, opacity) { + return this.#hasForcedColors ? null : findContrastColor(applyOpacity(...color, opacity ?? 1), CSSConstants.commentForegroundColor); + } + destroy() { + this.#dialog.destroy(); + this.#sidebar.hide(); + this.#popup.destroy(); + } +} +class CommentSidebar extends Sidebar { + #annotations = null; + #eventBus; + #boundCommentClick = this.#commentClick.bind(this); + #boundCommentKeydown = this.#commentKeydown.bind(this); + #closeButton; + #commentsList; + #commentCount; + #dateFormat; + #sidebarTitle; + #learnMoreUrl; + #linkService; + #popup; + #elementsToAnnotations = null; + #idsToElements = null; + #uiManager = null; + constructor({ + learnMoreUrl, + sidebar, + sidebarResizer, + commentsList, + commentCount, + sidebarTitle, + closeButton, + commentToolbarButton + }, eventBus, linkService, popup, dateFormat, ltr) { + super({ + sidebar, + resizer: sidebarResizer, + toggleButton: commentToolbarButton + }, ltr, true); + this.#sidebarTitle = sidebarTitle; + this.#commentsList = commentsList; + this.#commentCount = commentCount; + this.#learnMoreUrl = learnMoreUrl; + this.#linkService = linkService; + this.#closeButton = closeButton; + this.#popup = popup; + this.#dateFormat = dateFormat; + this.#eventBus = eventBus; + closeButton.addEventListener("click", () => { + eventBus.dispatch("switchannotationeditormode", { + source: this, + mode: AnnotationEditorType.NONE + }); + }); + const keyDownCallback = e => { + if (e.key === "ArrowDown" || e.key === "Home" || e.key === "F6") { + this.#commentsList.firstElementChild.focus(); + stopEvent(e); + } else if (e.key === "ArrowUp" || e.key === "End") { + this.#commentsList.lastElementChild.focus(); + stopEvent(e); + } + }; + commentToolbarButton.addEventListener("keydown", keyDownCallback); + sidebar.addEventListener("keydown", keyDownCallback); + } + setUIManager(uiManager) { + this.#uiManager = uiManager; + } + show(annotations) { + this.#elementsToAnnotations = new WeakMap(); + this.#idsToElements = new Map(); + this.#annotations = annotations; + annotations.sort(this.#sortComments.bind(this)); + if (annotations.length !== 0) { + const fragment = document.createDocumentFragment(); + for (const annotation of annotations) { + fragment.append(this.#createCommentElement(annotation)); + } + this.#setCommentsCount(fragment); + this.#commentsList.append(fragment); + } else { + this.#setCommentsCount(); + } + this._sidebar.hidden = false; + this.#eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "commentSidebar", + data: { + numberOfAnnotations: annotations.length + } + } + }); + } + hide() { + this._sidebar.hidden = true; + this.#commentsList.replaceChildren(); + this.#elementsToAnnotations = null; + this.#idsToElements = null; + this.#annotations = null; + } + removeComments(ids) { + if (ids.length === 0 || !this.#idsToElements) { + return; + } + if (new Set(this.#idsToElements.keys()).difference(new Set(ids)).size === 0) { + this.#removeAll(); + return; + } + for (const id of ids) { + this.#removeComment(id); + } + } + focusComment(id) { + const element = this.#idsToElements.get(id); + if (!element) { + return; + } + this._sidebar.scrollTop = element.offsetTop - this._sidebar.offsetTop; + for (const el of this.#commentsList.children) { + el.classList.toggle("selected", el === element); + } + } + updateComment(annotation) { + if (!this.#idsToElements) { + return; + } + const { + id, + creationDate, + modificationDate, + richText, + contentsObj, + popupRef + } = annotation; + if (!popupRef || !richText && !contentsObj?.str) { + this.#removeComment(id); + } + const element = this.#idsToElements.get(id); + if (!element) { + return; + } + const prevAnnotation = this.#elementsToAnnotations.get(element); + let index = binarySearchFirstItem(this.#annotations, a => this.#sortComments(a, prevAnnotation) >= 0); + if (index >= this.#annotations.length) { + return; + } + this.#setDate(element.firstElementChild, modificationDate || creationDate); + this.#setText(element.lastElementChild, richText, contentsObj); + this.#annotations.splice(index, 1); + index = binarySearchFirstItem(this.#annotations, a => this.#sortComments(a, annotation) >= 0); + this.#annotations.splice(index, 0, annotation); + if (index >= this.#commentsList.children.length) { + this.#commentsList.append(element); + } else { + this.#commentsList.insertBefore(element, this.#commentsList.children[index]); + } + } + #removeComment(id) { + const element = this.#idsToElements?.get(id); + if (!element) { + return; + } + const annotation = this.#elementsToAnnotations.get(element); + const index = binarySearchFirstItem(this.#annotations, a => this.#sortComments(a, annotation) >= 0); + if (index >= this.#annotations.length) { + return; + } + this.#annotations.splice(index, 1); + element.remove(); + this.#idsToElements.delete(id); + this.#setCommentsCount(); + } + #removeAll() { + this.#commentsList.replaceChildren(); + this.#elementsToAnnotations = new WeakMap(); + this.#idsToElements.clear(); + this.#annotations.length = 0; + this.#setCommentsCount(); + } + selectComment(element, id = null) { + if (!this.#idsToElements) { + return; + } + const hasNoElement = !element; + element ||= this.#idsToElements.get(id); + for (const el of this.#commentsList.children) { + el.classList.toggle("selected", el === element); + } + if (hasNoElement) { + element?.scrollIntoView({ + behavior: "instant", + block: "center" + }); + } + } + addComment(annotation) { + if (this.#idsToElements?.has(annotation.id)) { + return; + } + const { + popupRef, + contentsObj + } = annotation; + if (!popupRef || !contentsObj?.str) { + return; + } + const commentItem = this.#createCommentElement(annotation); + if (this.#annotations.length === 0) { + this.#commentsList.replaceChildren(commentItem); + this.#annotations.push(annotation); + this.#setCommentsCount(); + return; + } + const index = binarySearchFirstItem(this.#annotations, a => this.#sortComments(a, annotation) >= 0); + this.#annotations.splice(index, 0, annotation); + if (index >= this.#commentsList.children.length) { + this.#commentsList.append(commentItem); + } else { + this.#commentsList.insertBefore(commentItem, this.#commentsList.children[index]); + } + this.#setCommentsCount(); + } + #setCommentsCount(container = this.#commentsList) { + const count = this.#idsToElements.size; + this.#sidebarTitle.setAttribute("data-l10n-args", JSON.stringify({ + count + })); + this.#commentCount.textContent = count; + if (count === 0) { + container.append(this.#createZeroCommentElement()); + } + } + #createZeroCommentElement() { + const commentItem = document.createElement("li"); + commentItem.classList.add("sidebarComment", "noComments"); + const textDiv = document.createElement("div"); + textDiv.className = "sidebarCommentText"; + textDiv.setAttribute("data-l10n-id", "pdfjs-editor-comments-sidebar-no-comments1"); + commentItem.append(textDiv); + if (this.#learnMoreUrl) { + const a = document.createElement("a"); + a.setAttribute("data-l10n-id", "pdfjs-editor-comments-sidebar-no-comments-link"); + a.href = this.#learnMoreUrl; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + commentItem.append(a); + } + return commentItem; + } + #setDate(element, date) { + date = PDFDateString.toDateObject(date); + element.dateTime = date.toISOString(); + element.textContent = this.#dateFormat.format(date); + } + #setText(element, richText, contentsObj) { + element.replaceChildren(); + const html = richText?.str && (!contentsObj?.str || richText.str === contentsObj.str) ? richText.html : contentsObj?.str; + renderRichText({ + html, + dir: contentsObj?.dir || "auto", + className: "richText" + }, element); + } + #createCommentElement(annotation) { + const { + id, + creationDate, + modificationDate, + richText, + contentsObj, + color, + opacity + } = annotation; + const commentItem = document.createElement("li"); + commentItem.role = "button"; + commentItem.className = "sidebarComment"; + commentItem.tabIndex = -1; + commentItem.style.backgroundColor = color && CommentManager._makeCommentColor(color, opacity) || ""; + const dateDiv = document.createElement("time"); + this.#setDate(dateDiv, modificationDate || creationDate); + const textDiv = document.createElement("div"); + textDiv.className = "sidebarCommentText"; + this.#setText(textDiv, richText, contentsObj); + commentItem.append(dateDiv, textDiv); + commentItem.addEventListener("click", this.#boundCommentClick); + commentItem.addEventListener("keydown", this.#boundCommentKeydown); + this.#elementsToAnnotations.set(commentItem, annotation); + this.#idsToElements.set(id, commentItem); + return commentItem; + } + async #commentClick({ + currentTarget + }) { + if (currentTarget.classList.contains("selected")) { + currentTarget.classList.remove("selected"); + this.#popup._hide(); + return; + } + const annotation = this.#elementsToAnnotations.get(currentTarget); + if (!annotation) { + return; + } + this.#popup._hide(); + const { + id, + pageIndex, + rect + } = annotation; + const pageNumber = pageIndex + 1; + const pageVisiblePromise = this.#uiManager?.waitForEditorsRendered(pageNumber); + this.#linkService?.goToXY(pageNumber, rect[0], rect[3], { + center: "both" + }); + this.selectComment(currentTarget); + await pageVisiblePromise; + this.#uiManager?.selectComment(pageIndex, id); + } + #commentKeydown(e) { + const { + key, + currentTarget + } = e; + switch (key) { + case "ArrowDown": + (currentTarget.nextElementSibling || this.#commentsList.firstElementChild).focus(); + stopEvent(e); + break; + case "ArrowUp": + (currentTarget.previousElementSibling || this.#commentsList.lastElementChild).focus(); + stopEvent(e); + break; + case "Home": + this.#commentsList.firstElementChild.focus(); + stopEvent(e); + break; + case "End": + this.#commentsList.lastElementChild.focus(); + stopEvent(e); + break; + case "Enter": + case " ": + this.#commentClick(e); + stopEvent(e); + break; + case "ShiftTab": + this.#closeButton.focus(); + stopEvent(e); + break; + } + } + #sortComments(a, b) { + const dateA = PDFDateString.toDateObject(a.modificationDate || a.creationDate); + const dateB = PDFDateString.toDateObject(b.modificationDate || b.creationDate); + if (dateA !== dateB) { + if (dateA !== null && dateB !== null) { + return dateB - dateA; + } + return dateA !== null ? -1 : 1; + } + if (a.pageIndex !== b.pageIndex) { + return a.pageIndex - b.pageIndex; + } + if (a.rect[3] !== b.rect[3]) { + return b.rect[3] - a.rect[3]; + } + if (a.rect[0] !== b.rect[0]) { + return a.rect[0] - b.rect[0]; + } + if (a.rect[1] !== b.rect[1]) { + return b.rect[1] - a.rect[1]; + } + if (a.rect[2] !== b.rect[2]) { + return a.rect[2] - b.rect[2]; + } + return a.id.localeCompare(b.id); + } +} +class CommentDialog { + #dialog; + #editor; + #overlayManager; + #previousText = ""; + #commentText = ""; + #textInput; + #title; + #saveButton; + #uiManager; + #prevDragX = 0; + #prevDragY = 0; + #dialogX = 0; + #dialogY = 0; + #isLTR; + #eventBus; + constructor({ + dialog, + toolbar, + title, + textInput, + cancelButton, + saveButton + }, overlayManager, eventBus, ltr) { + this.#dialog = dialog; + this.#textInput = textInput; + this.#overlayManager = overlayManager; + this.#eventBus = eventBus; + this.#saveButton = saveButton; + this.#title = title; + this.#isLTR = ltr; + const finishBound = this.#finish.bind(this); + dialog.addEventListener("close", finishBound); + dialog.addEventListener("contextmenu", e => { + if (e.target !== this.#textInput) { + e.preventDefault(); + } + }); + cancelButton.addEventListener("click", finishBound); + saveButton.addEventListener("click", this.#save.bind(this)); + textInput.addEventListener("input", () => { + saveButton.disabled = textInput.value === this.#previousText; + }); + textInput.addEventListener("keydown", e => { + if ((e.ctrlKey || e.metaKey) && e.key === "Enter" && !saveButton.disabled) { + this.#save(); + } + }); + let pointerMoveAC; + const cancelDrag = () => { + dialog.classList.remove("dragging"); + pointerMoveAC?.abort(); + pointerMoveAC = null; + }; + toolbar.addEventListener("pointerdown", e => { + if (pointerMoveAC) { + cancelDrag(); + return; + } + const { + clientX, + clientY + } = e; + stopEvent(e); + this.#prevDragX = clientX; + this.#prevDragY = clientY; + pointerMoveAC = new AbortController(); + const { + signal + } = pointerMoveAC; + const { + innerHeight, + innerWidth + } = window; + dialog.classList.add("dragging"); + window.addEventListener("pointermove", ev => { + if (!pointerMoveAC) { + return; + } + const { + clientX: x, + clientY: y + } = ev; + this.#setPosition(this.#dialogX + (x - this.#prevDragX) / innerWidth, this.#dialogY + (y - this.#prevDragY) / innerHeight); + this.#prevDragX = x; + this.#prevDragY = y; + stopEvent(ev); + }, { + signal + }); + window.addEventListener("blur", cancelDrag, { + signal + }); + window.addEventListener("pointerup", ev => { + if (pointerMoveAC) { + cancelDrag(); + stopEvent(ev); + } + }, { + signal + }); + }); + overlayManager.register(dialog); + } + async open(uiManager, editor, posX, posY, options) { + if (editor) { + this.#uiManager = uiManager; + this.#editor = editor; + } + const { + contentsObj: { + str + }, + color, + opacity + } = editor.getData(); + const { + style: dialogStyle + } = this.#dialog; + if (color) { + dialogStyle.backgroundColor = CommentManager._makeCommentColor(color, opacity); + dialogStyle.borderColor = Util.makeHexColor(...color); + } else { + dialogStyle.backgroundColor = dialogStyle.borderColor = ""; + } + this.#commentText = str || ""; + const textInput = this.#textInput; + textInput.value = this.#previousText = this.#commentText; + if (str) { + this.#title.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-dialog-title-when-editing"); + this.#saveButton.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-dialog-save-button-when-editing"); + } else { + this.#title.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-dialog-title-when-adding"); + this.#saveButton.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-dialog-save-button-when-adding"); + } + if (options?.height) { + textInput.style.height = `${options.height}px`; + } + this.#uiManager?.removeEditListeners(); + this.#saveButton.disabled = true; + const parentDimensions = options?.parentDimensions; + const { + innerHeight, + innerWidth + } = window; + if (editor.hasDefaultPopupPosition()) { + const { + dialogWidth, + dialogHeight + } = this._dialogDimensions; + if (parentDimensions) { + if (this.#isLTR && posX + dialogWidth > Math.min(parentDimensions.x + parentDimensions.width, innerWidth)) { + const buttonWidth = this.#editor.commentButtonWidth; + posX -= dialogWidth - buttonWidth * parentDimensions.width; + } else if (!this.#isLTR) { + const buttonWidth = this.#editor.commentButtonWidth * parentDimensions.width; + if (posX - dialogWidth < Math.max(0, parentDimensions.x)) { + posX = Math.max(0, posX); + } else { + posX -= dialogWidth - buttonWidth; + } + } + } + const height = Math.max(dialogHeight, options?.height || 0); + if (posY + height > innerHeight) { + posY = innerHeight - height; + } + if (posY < 0) { + posY = 0; + } + } + posX = MathClamp(posX / innerWidth, 0, 1); + posY = MathClamp(posY / innerHeight, 0, 1); + this.#setPosition(posX, posY); + await this.#overlayManager.open(this.#dialog); + textInput.focus(); + } + async #save() { + this.#editor.comment = this.#textInput.value; + this.#finish(); + } + get _dialogDimensions() { + const dialog = this.#dialog; + const { + style + } = dialog; + style.opacity = "0"; + style.display = "block"; + const { + width, + height + } = dialog.getBoundingClientRect(); + style.opacity = style.display = ""; + return shadow(this, "_dialogDimensions", { + dialogWidth: width, + dialogHeight: height + }); + } + #setPosition(x, y) { + this.#dialogX = x; + this.#dialogY = y; + const { + style + } = this.#dialog; + style.left = `${100 * x}%`; + style.top = `${100 * y}%`; + } + #finish() { + if (!this.#editor) { + return; + } + const edited = this.#textInput.value !== this.#commentText; + this.#eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "comment", + data: { + edited + } + } + }); + this.#editor?.focusCommentButton(); + this.#editor = null; + this.#textInput.value = this.#previousText = this.#commentText = ""; + this.#overlayManager.closeIfActive(this.#dialog); + this.#textInput.style.height = ""; + this.#uiManager?.addEditListeners(); + this.#uiManager = null; + } + destroy() { + this.#uiManager = null; + this.#editor = null; + this.#finish(); + } +} +class CommentPopup { + #buttonsContainer = null; + #eventBus; + #commentDialog; + #dateFormat; + #editor = null; + #isLTR; + #container = null; + #text = null; + #time = null; + #prevDragX = 0; + #prevDragY = 0; + #posX = 0; + #posY = 0; + #previousFocusedElement = null; + #selected = false; + #visible = false; + constructor(eventBus, dateFormat, ltr, commentDialog) { + this.#eventBus = eventBus; + this.#dateFormat = dateFormat; + this.#isLTR = ltr; + this.#commentDialog = commentDialog; + this.sidebar = null; + } + get _popupWidth() { + const container = this.#createPopup(); + const { + style + } = container; + style.opacity = "0"; + style.display = "block"; + document.body.append(container); + const width = container.getBoundingClientRect().width; + container.remove(); + style.opacity = style.display = ""; + return shadow(this, "_popupWidth", width); + } + #createPopup() { + if (this.#container) { + return this.#container; + } + const container = this.#container = document.createElement("div"); + container.className = "commentPopup"; + container.id = "commentPopup"; + container.tabIndex = -1; + container.role = "dialog"; + container.ariaModal = "false"; + container.addEventListener("contextmenu", noContextMenu); + container.addEventListener("keydown", e => { + if (e.key === "Escape") { + this.toggle(this.#editor, true, false); + this.#previousFocusedElement?.focus(); + stopEvent(e); + } + }); + container.addEventListener("click", () => { + container.focus(); + }); + const top = document.createElement("div"); + top.className = "commentPopupTop"; + const time = this.#time = document.createElement("time"); + time.className = "commentPopupTime"; + const buttons = this.#buttonsContainer = document.createElement("div"); + buttons.className = "commentPopupButtons"; + const edit = document.createElement("button"); + edit.classList.add("commentPopupEdit", "toolbarButton"); + edit.tabIndex = 0; + edit.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-popup-button"); + edit.ariaHasPopup = "dialog"; + edit.ariaControlsElements = [this.#commentDialog]; + const editLabel = document.createElement("span"); + editLabel.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-popup-button-label"); + edit.append(editLabel); + edit.addEventListener("click", () => { + const editor = this.#editor; + const height = parseFloat(getComputedStyle(this.#text).height); + this.toggle(editor, true, false); + editor.editComment({ + height + }); + }); + edit.addEventListener("contextmenu", noContextMenu); + const del = document.createElement("button"); + del.classList.add("commentPopupDelete", "toolbarButton"); + del.tabIndex = 0; + del.setAttribute("data-l10n-id", "pdfjs-editor-delete-comment-popup-button"); + const delLabel = document.createElement("span"); + delLabel.setAttribute("data-l10n-id", "pdfjs-editor-delete-comment-popup-button-label"); + del.append(delLabel); + del.addEventListener("click", () => { + this.#eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "comment", + data: { + deleted: true + } + } + }); + this.#editor.comment = null; + this.#editor.focus(); + this.destroy(); + }); + del.addEventListener("contextmenu", noContextMenu); + buttons.append(edit, del); + top.append(time, buttons); + const separator = document.createElement("hr"); + const text = this.#text = document.createElement("div"); + text.className = "commentPopupText"; + container.append(top, separator, text); + let pointerMoveAC; + const cancelDrag = () => { + container.classList.remove("dragging"); + pointerMoveAC?.abort(); + pointerMoveAC = null; + }; + top.addEventListener("pointerdown", e => { + if (pointerMoveAC) { + cancelDrag(); + return; + } + const { + target, + clientX, + clientY + } = e; + if (buttons.contains(target)) { + return; + } + stopEvent(e); + const { + width: parentWidth, + height: parentHeight + } = this.#editor.parentBoundingClientRect; + this.#prevDragX = clientX; + this.#prevDragY = clientY; + pointerMoveAC = new AbortController(); + const { + signal + } = pointerMoveAC; + container.classList.add("dragging"); + window.addEventListener("pointermove", ev => { + if (!pointerMoveAC) { + return; + } + const { + clientX: x, + clientY: y + } = ev; + this.#setPosition(this.#posX + (x - this.#prevDragX) / parentWidth, this.#posY + (y - this.#prevDragY) / parentHeight, false); + this.#prevDragX = x; + this.#prevDragY = y; + stopEvent(ev); + }, { + signal + }); + window.addEventListener("blur", cancelDrag, { + signal + }); + window.addEventListener("pointerup", ev => { + if (pointerMoveAC) { + cancelDrag(); + stopEvent(ev); + } + }, { + signal + }); + }); + return container; + } + updateColor(editor) { + if (this.#editor !== editor || !this.#visible) { + return; + } + const { + color, + opacity + } = editor.getData(); + this.#container.style.backgroundColor = color && CommentManager._makeCommentColor(color, opacity) || ""; + } + _hide(editor) { + const container = this.#createPopup(); + container.classList.toggle("hidden", true); + container.classList.toggle("selected", false); + (editor || this.#editor)?.setCommentButtonStates({ + selected: false, + hasPopup: false + }); + this.#editor = null; + this.#selected = false; + this.#visible = false; + this.#text.replaceChildren(); + this.sidebar.selectComment(null); + } + toggle(editor, isSelected, visibility = undefined, isEditable = true) { + if (!editor) { + this.destroy(); + return; + } + if (isSelected) { + visibility ??= this.#editor === editor ? !this.#selected || !this.#visible : true; + } else { + if (this.#selected) { + return; + } + visibility ??= !this.#visible; + } + if (!visibility) { + this._hide(editor); + return; + } + this.#visible = true; + if (this.#editor !== editor) { + this.#editor?.setCommentButtonStates({ + selected: false, + hasPopup: false + }); + } + const container = this.#createPopup(); + this.#buttonsContainer.classList.toggle("hidden", !isEditable); + container.classList.toggle("hidden", false); + container.classList.toggle("selected", isSelected); + this.#selected = isSelected; + this.#editor = editor; + editor.setCommentButtonStates({ + selected: isSelected, + hasPopup: true + }); + const { + contentsObj, + richText, + creationDate, + modificationDate, + color, + opacity + } = editor.getData(); + container.style.backgroundColor = color && CommentManager._makeCommentColor(color, opacity) || ""; + this.#text.replaceChildren(); + const html = richText?.str && (!contentsObj?.str || richText.str === contentsObj.str) ? richText.html : contentsObj?.str; + if (html) { + renderRichText({ + html, + dir: contentsObj?.dir || "auto", + className: "richText" + }, this.#text); + } + this.#time.textContent = this.#dateFormat.format(PDFDateString.toDateObject(modificationDate || creationDate)); + this.#setPosition(...editor.commentPopupPosition, editor.hasDefaultPopupPosition()); + editor.elementBeforePopup.after(container); + container.addEventListener("focus", ({ + relatedTarget + }) => { + this.#previousFocusedElement = relatedTarget; + }, { + once: true + }); + if (isSelected) { + setTimeout(() => container.focus(), 0); + } + } + #setPosition(x, y, correctPosition) { + if (!correctPosition) { + this.#editor.commentPopupPosition = [x, y]; + } else { + const parentRect = this.#editor.parentBoundingClientRect; + const widthRatio = this._popupWidth / parentRect.width; + if (this.#isLTR && x + widthRatio > 1 || !this.#isLTR && x - widthRatio >= 0) { + const buttonWidth = this.#editor.commentButtonWidth; + x -= widthRatio - buttonWidth; + } + const margin = 0.01; + if (this.#isLTR) { + x = Math.max(x, -parentRect.x / parentRect.width + margin); + } else { + x = Math.min(x, (window.innerWidth - parentRect.x) / parentRect.width - widthRatio - margin); + } + } + this.#posX = x; + this.#posY = y; + const { + style + } = this.#container; + style.left = `${100 * x}%`; + style.top = `${100 * y}%`; + } + destroy() { + this._hide(); + this.#container?.remove(); + this.#container = this.#text = this.#time = null; + this.#prevDragX = this.#prevDragY = Infinity; + this.#posX = this.#posY = 0; + this.#previousFocusedElement = null; + } +} + +;// ./web/editor_undo_bar.js + +class EditorUndoBar { + #closeButton = null; + #container; + #eventBus = null; + #focusTimeout = null; + #initController = null; + isOpen = false; + #message; + #showController = null; + #undoButton; + static #l10nMessages = Object.freeze({ + highlight: "pdfjs-editor-undo-bar-message-highlight", + freetext: "pdfjs-editor-undo-bar-message-freetext", + stamp: "pdfjs-editor-undo-bar-message-stamp", + ink: "pdfjs-editor-undo-bar-message-ink", + signature: "pdfjs-editor-undo-bar-message-signature", + _multiple: "pdfjs-editor-undo-bar-message-multiple" + }); + constructor({ + container, + message, + undoButton, + closeButton + }, eventBus) { + this.#container = container; + this.#message = message; + this.#undoButton = undoButton; + this.#closeButton = closeButton; + this.#eventBus = eventBus; + } + destroy() { + this.#initController?.abort(); + this.#initController = null; + this.hide(); + } + show(undoAction, messageData) { + if (!this.#initController) { + this.#initController = new AbortController(); + const opts = { + signal: this.#initController.signal + }; + const boundHide = this.hide.bind(this); + this.#container.addEventListener("contextmenu", noContextMenu, opts); + this.#closeButton.addEventListener("click", boundHide, opts); + this.#eventBus._on("beforeprint", boundHide, opts); + this.#eventBus._on("download", boundHide, opts); + } + this.hide(); + if (typeof messageData === "string") { + this.#message.setAttribute("data-l10n-id", EditorUndoBar.#l10nMessages[messageData]); + } else { + this.#message.setAttribute("data-l10n-id", EditorUndoBar.#l10nMessages._multiple); + this.#message.setAttribute("data-l10n-args", JSON.stringify({ + count: messageData + })); + } + this.isOpen = true; + this.#container.hidden = false; + this.#showController = new AbortController(); + this.#undoButton.addEventListener("click", () => { + undoAction(); + this.hide(); + }, { + signal: this.#showController.signal + }); + this.#focusTimeout = setTimeout(() => { + this.#container.focus(); + this.#focusTimeout = null; + }, 100); + } + hide() { + if (!this.isOpen) { + return; + } + this.isOpen = false; + this.#container.hidden = true; + this.#showController?.abort(); + this.#showController = null; + if (this.#focusTimeout) { + clearTimeout(this.#focusTimeout); + this.#focusTimeout = null; + } + } +} + +;// ./web/overlay_manager.js +class OverlayManager { + #overlays = new WeakMap(); + #active = null; + get active() { + return this.#active; + } + async register(dialog, canForceClose = false) { + if (typeof dialog !== "object") { + throw new Error("Not enough parameters."); + } else if (this.#overlays.has(dialog)) { + throw new Error("The overlay is already registered."); + } + this.#overlays.set(dialog, { + canForceClose + }); + dialog.addEventListener("cancel", ({ + target + }) => { + if (this.#active === target) { + this.#active = null; + } + }); + } + async open(dialog) { + if (!this.#overlays.has(dialog)) { + throw new Error("The overlay does not exist."); + } else if (this.#active) { + if (this.#active === dialog) { + throw new Error("The overlay is already active."); + } else if (this.#overlays.get(dialog).canForceClose) { + await this.close(); + } else { + throw new Error("Another overlay is currently active."); + } + } + this.#active = dialog; + dialog.showModal(); + } + async close(dialog = this.#active) { + if (!this.#overlays.has(dialog)) { + throw new Error("The overlay does not exist."); + } else if (!this.#active) { + throw new Error("The overlay is currently not active."); + } else if (this.#active !== dialog) { + throw new Error("Another overlay is currently active."); + } + dialog.close(); + this.#active = null; + } + async closeIfActive(dialog) { + if (this.#active === dialog) { + await this.close(dialog); + } + } +} + +;// ./web/password_prompt.js + +class PasswordPrompt { + #activeCapability = null; + #updateCallback = null; + #reason = null; + constructor(options, overlayManager, isViewerEmbedded = false) { + this.dialog = options.dialog; + this.label = options.label; + this.input = options.input; + this.submitButton = options.submitButton; + this.cancelButton = options.cancelButton; + this.overlayManager = overlayManager; + this._isViewerEmbedded = isViewerEmbedded; + this.submitButton.addEventListener("click", this.#verify.bind(this)); + this.cancelButton.addEventListener("click", this.close.bind(this)); + this.input.addEventListener("keydown", e => { + if (e.keyCode === 13) { + this.#verify(); + } + }); + this.overlayManager.register(this.dialog, true); + this.dialog.addEventListener("close", this.#cancel.bind(this)); + } + async open() { + await this.#activeCapability?.promise; + this.#activeCapability = Promise.withResolvers(); + try { + await this.overlayManager.open(this.dialog); + } catch (ex) { + this.#activeCapability.resolve(); + throw ex; + } + const passwordIncorrect = this.#reason === PasswordResponses.INCORRECT_PASSWORD; + if (!this._isViewerEmbedded || passwordIncorrect) { + this.input.focus(); + } + this.label.setAttribute("data-l10n-id", passwordIncorrect ? "pdfjs-password-invalid" : "pdfjs-password-label"); + } + async close() { + this.overlayManager.closeIfActive(this.dialog); + } + #verify() { + const password = this.input.value; + if (password?.length > 0) { + this.#invokeCallback(password); + } + } + #cancel() { + this.#invokeCallback(new Error("PasswordPrompt cancelled.")); + this.#activeCapability.resolve(); + } + #invokeCallback(password) { + if (!this.#updateCallback) { + return; + } + this.close(); + this.input.value = ""; + this.#updateCallback(password); + this.#updateCallback = null; + } + async setUpdateCallback(updateCallback, reason) { + if (this.#activeCapability) { + await this.#activeCapability.promise; + } + this.#updateCallback = updateCallback; + this.#reason = reason; + } +} + +;// ./web/base_tree_viewer.js + +const TREEITEM_OFFSET_TOP = -100; +const TREEITEM_SELECTED_CLASS = "selected"; +class BaseTreeViewer { + constructor(options) { + this.container = options.container; + this.eventBus = options.eventBus; + this._l10n = options.l10n; + this.reset(); + } + reset() { + this._pdfDocument = null; + this._lastToggleIsShow = true; + this._currentTreeItem = null; + this.container.textContent = ""; + this.container.classList.remove("treeWithDeepNesting"); + } + _dispatchEvent(count) { + throw new Error("Not implemented: _dispatchEvent"); + } + _bindLink(element, params) { + throw new Error("Not implemented: _bindLink"); + } + _normalizeTextContent(str) { + return removeNullCharacters(str, true) || "\u2013"; + } + _addToggleButton(div, hidden = false) { + const toggler = document.createElement("div"); + toggler.className = "treeItemToggler"; + if (hidden) { + toggler.classList.add("treeItemsHidden"); + } + toggler.onclick = evt => { + evt.stopPropagation(); + toggler.classList.toggle("treeItemsHidden"); + if (evt.shiftKey) { + const shouldShowAll = !toggler.classList.contains("treeItemsHidden"); + this._toggleTreeItem(div, shouldShowAll); + } + }; + div.prepend(toggler); + } + _toggleTreeItem(root, show = false) { + this._l10n.pause(); + this._lastToggleIsShow = show; + for (const toggler of root.querySelectorAll(".treeItemToggler")) { + toggler.classList.toggle("treeItemsHidden", !show); + } + this._l10n.resume(); + } + _toggleAllTreeItems() { + this._toggleTreeItem(this.container, !this._lastToggleIsShow); + } + _finishRendering(fragment, count, hasAnyNesting = false) { + if (hasAnyNesting) { + this.container.classList.add("treeWithDeepNesting"); + this._lastToggleIsShow = !fragment.querySelector(".treeItemsHidden"); + } + this._l10n.pause(); + this.container.append(fragment); + this._l10n.resume(); + this._dispatchEvent(count); + } + render(params) { + throw new Error("Not implemented: render"); + } + _updateCurrentTreeItem(treeItem = null) { + if (this._currentTreeItem) { + this._currentTreeItem.classList.remove(TREEITEM_SELECTED_CLASS); + this._currentTreeItem = null; + } + if (treeItem) { + treeItem.classList.add(TREEITEM_SELECTED_CLASS); + this._currentTreeItem = treeItem; + } + } + _scrollToCurrentTreeItem(treeItem) { + if (!treeItem) { + return; + } + this._l10n.pause(); + let currentNode = treeItem.parentNode; + while (currentNode && currentNode !== this.container) { + if (currentNode.classList.contains("treeItem")) { + const toggler = currentNode.firstElementChild; + toggler?.classList.remove("treeItemsHidden"); + } + currentNode = currentNode.parentNode; + } + this._l10n.resume(); + this._updateCurrentTreeItem(treeItem); + this.container.scrollTo(treeItem.offsetLeft, treeItem.offsetTop + TREEITEM_OFFSET_TOP); + } +} + +;// ./web/pdf_attachment_viewer.js + + +class PDFAttachmentViewer extends BaseTreeViewer { + constructor(options) { + super(options); + this.downloadManager = options.downloadManager; + this.eventBus._on("fileattachmentannotation", this.#appendAttachment.bind(this)); + } + reset(keepRenderedCapability = false) { + super.reset(); + this._attachments = null; + if (!keepRenderedCapability) { + this._renderedCapability = Promise.withResolvers(); + } + this._pendingDispatchEvent = false; + } + async _dispatchEvent(attachmentsCount) { + this._renderedCapability.resolve(); + if (attachmentsCount === 0 && !this._pendingDispatchEvent) { + this._pendingDispatchEvent = true; + await waitOnEventOrTimeout({ + target: this.eventBus, + name: "annotationlayerrendered", + delay: 1000 + }); + if (!this._pendingDispatchEvent) { + return; + } + } + this._pendingDispatchEvent = false; + this.eventBus.dispatch("attachmentsloaded", { + source: this, + attachmentsCount + }); + } + _bindLink(element, { + content, + description, + filename + }) { + if (description) { + element.title = description; + } + element.onclick = () => { + this.downloadManager.openOrDownloadData(content, filename); + return false; + }; + } + render({ + attachments, + keepRenderedCapability = false + }) { + if (this._attachments) { + this.reset(keepRenderedCapability); + } + this._attachments = attachments || null; + if (!attachments) { + this._dispatchEvent(0); + return; + } + const fragment = document.createDocumentFragment(); + let attachmentsCount = 0; + for (const name in attachments) { + const item = attachments[name]; + const div = document.createElement("div"); + div.className = "treeItem"; + const element = document.createElement("a"); + this._bindLink(element, item); + element.textContent = this._normalizeTextContent(item.filename); + div.append(element); + fragment.append(div); + attachmentsCount++; + } + this._finishRendering(fragment, attachmentsCount); + } + #appendAttachment(item) { + const renderedPromise = this._renderedCapability.promise; + renderedPromise.then(() => { + if (renderedPromise !== this._renderedCapability.promise) { + return; + } + const attachments = this._attachments || Object.create(null); + for (const name in attachments) { + if (item.filename === name) { + return; + } + } + attachments[item.filename] = item; + this.render({ + attachments, + keepRenderedCapability: true + }); + }); + } +} + +;// ./web/grab_to_pan.js + +const CSS_CLASS_GRAB = "grab-to-pan-grab"; +class GrabToPan { + #activateAC = null; + #mouseDownAC = null; + #scrollAC = null; + constructor({ + element + }) { + this.element = element; + this.document = element.ownerDocument; + const overlay = this.overlay = document.createElement("div"); + overlay.className = "grab-to-pan-grabbing"; + } + activate() { + if (!this.#activateAC) { + this.#activateAC = new AbortController(); + this.element.addEventListener("mousedown", this.#onMouseDown.bind(this), { + capture: true, + signal: this.#activateAC.signal + }); + this.element.classList.add(CSS_CLASS_GRAB); + } + } + deactivate() { + if (this.#activateAC) { + this.#activateAC.abort(); + this.#activateAC = null; + this.#endPan(); + this.element.classList.remove(CSS_CLASS_GRAB); + } + } + toggle() { + if (this.#activateAC) { + this.deactivate(); + } else { + this.activate(); + } + } + ignoreTarget(node) { + return node.matches("a[href], a[href] *, input, textarea, button, button *, select, option"); + } + #onMouseDown(event) { + if (event.button !== 0 || this.ignoreTarget(event.target)) { + return; + } + if (event.originalTarget) { + try { + event.originalTarget.tagName; + } catch { + return; + } + } + this.scrollLeftStart = this.element.scrollLeft; + this.scrollTopStart = this.element.scrollTop; + this.clientXStart = event.clientX; + this.clientYStart = event.clientY; + this.#mouseDownAC = new AbortController(); + const boundEndPan = this.#endPan.bind(this), + mouseOpts = { + capture: true, + signal: this.#mouseDownAC.signal + }; + this.document.addEventListener("mousemove", this.#onMouseMove.bind(this), mouseOpts); + this.document.addEventListener("mouseup", boundEndPan, mouseOpts); + this.#scrollAC = new AbortController(); + this.element.addEventListener("scroll", boundEndPan, { + capture: true, + signal: this.#scrollAC.signal + }); + stopEvent(event); + const focusedElement = document.activeElement; + if (focusedElement && !focusedElement.contains(event.target)) { + focusedElement.blur(); + } + } + #onMouseMove(event) { + this.#scrollAC?.abort(); + this.#scrollAC = null; + if (!(event.buttons & 1)) { + this.#endPan(); + return; + } + const xDiff = event.clientX - this.clientXStart; + const yDiff = event.clientY - this.clientYStart; + this.element.scrollTo({ + top: this.scrollTopStart - yDiff, + left: this.scrollLeftStart - xDiff, + behavior: "instant" + }); + if (!this.overlay.parentNode) { + document.body.append(this.overlay); + } + } + #endPan() { + this.#mouseDownAC?.abort(); + this.#mouseDownAC = null; + this.#scrollAC?.abort(); + this.#scrollAC = null; + this.overlay.remove(); + } +} + +;// ./web/pdf_cursor_tools.js + + + +class PDFCursorTools { + #active = CursorTool.SELECT; + #prevActive = null; + constructor({ + container, + eventBus, + cursorToolOnLoad = CursorTool.SELECT + }) { + this.container = container; + this.eventBus = eventBus; + this.#addEventListeners(); + Promise.resolve().then(() => { + this.switchTool(cursorToolOnLoad); + }); + } + get activeTool() { + return this.#active; + } + switchTool(tool) { + if (this.#prevActive !== null) { + return; + } + this.#switchTool(tool); + } + #switchTool(tool, disabled = false) { + if (tool === this.#active) { + if (this.#prevActive !== null) { + this.eventBus.dispatch("cursortoolchanged", { + source: this, + tool, + disabled + }); + } + return; + } + const disableActiveTool = () => { + switch (this.#active) { + case CursorTool.SELECT: + break; + case CursorTool.HAND: + this._handTool.deactivate(); + break; + case CursorTool.ZOOM: + } + }; + switch (tool) { + case CursorTool.SELECT: + disableActiveTool(); + break; + case CursorTool.HAND: + disableActiveTool(); + this._handTool.activate(); + break; + case CursorTool.ZOOM: + default: + console.error(`switchTool: "${tool}" is an unsupported value.`); + return; + } + this.#active = tool; + this.eventBus.dispatch("cursortoolchanged", { + source: this, + tool, + disabled + }); + } + #addEventListeners() { + this.eventBus._on("switchcursortool", evt => { + if (!evt.reset) { + this.switchTool(evt.tool); + } else if (this.#prevActive !== null) { + annotationEditorMode = AnnotationEditorType.NONE; + presentationModeState = PresentationModeState.NORMAL; + enableActive(); + } + }); + let annotationEditorMode = AnnotationEditorType.NONE, + presentationModeState = PresentationModeState.NORMAL; + const disableActive = () => { + this.#prevActive ??= this.#active; + this.#switchTool(CursorTool.SELECT, true); + }; + const enableActive = () => { + if (this.#prevActive !== null && annotationEditorMode === AnnotationEditorType.NONE && presentationModeState === PresentationModeState.NORMAL) { + this.#switchTool(this.#prevActive); + this.#prevActive = null; + } + }; + this.eventBus._on("annotationeditormodechanged", ({ + mode + }) => { + annotationEditorMode = mode; + if (mode === AnnotationEditorType.NONE) { + enableActive(); + } else { + disableActive(); + } + }); + this.eventBus._on("presentationmodechanged", ({ + state + }) => { + presentationModeState = state; + if (state === PresentationModeState.NORMAL) { + enableActive(); + } else if (state === PresentationModeState.FULLSCREEN) { + disableActive(); + } + }); + } + get _handTool() { + return shadow(this, "_handTool", new GrabToPan({ + element: this.container + })); + } +} + +;// ./web/pdf_document_properties.js + + +const NON_METRIC_LOCALES = ["en-us", "en-lr", "my"]; +const US_PAGE_NAMES = { + "8.5x11": "pdfjs-document-properties-page-size-name-letter", + "8.5x14": "pdfjs-document-properties-page-size-name-legal" +}; +const METRIC_PAGE_NAMES = { + "297x420": "pdfjs-document-properties-page-size-name-a-three", + "210x297": "pdfjs-document-properties-page-size-name-a-four" +}; +function getPageName(size, isPortrait, pageNames) { + const width = isPortrait ? size.width : size.height; + const height = isPortrait ? size.height : size.width; + return pageNames[`${width}x${height}`]; +} +class PDFDocumentProperties { + #fieldData = null; + constructor({ + dialog, + fields, + closeButton + }, overlayManager, eventBus, l10n, fileNameLookup, titleLookup) { + this.dialog = dialog; + this.fields = fields; + this.overlayManager = overlayManager; + this.l10n = l10n; + this._fileNameLookup = fileNameLookup; + this._titleLookup = titleLookup; + this.#reset(); + closeButton.addEventListener("click", this.close.bind(this)); + this.overlayManager.register(this.dialog); + eventBus._on("pagechanging", evt => { + this._currentPageNumber = evt.pageNumber; + }); + eventBus._on("rotationchanging", evt => { + this._pagesRotation = evt.pagesRotation; + }); + } + async open() { + await Promise.all([this.overlayManager.open(this.dialog), this._dataAvailableCapability.promise]); + const currentPageNumber = this._currentPageNumber; + const pagesRotation = this._pagesRotation; + if (this.#fieldData && currentPageNumber === this.#fieldData._currentPageNumber && pagesRotation === this.#fieldData._pagesRotation) { + this.#updateUI(); + return; + } + const [{ + info, + metadata, + contentLength + }, pdfPage] = await Promise.all([this.pdfDocument.getMetadata(), this.pdfDocument.getPage(currentPageNumber)]); + const [fileName, fileSize, title, creationDate, modificationDate, pageSize, isLinearized] = await Promise.all([this._fileNameLookup(), this.#parseFileSize(contentLength), this._titleLookup(), this.#parseDate(metadata?.get("xmp:createdate"), info.CreationDate), this.#parseDate(metadata?.get("xmp:modifydate"), info.ModDate), this.#parsePageSize(getPageSizeInches(pdfPage), pagesRotation), this.#parseLinearization(info.IsLinearized)]); + this.#fieldData = Object.freeze({ + fileName, + fileSize, + title, + author: metadata?.get("dc:creator")?.join("\n") || info.Author, + subject: metadata?.get("dc:subject")?.join("\n") || info.Subject, + keywords: metadata?.get("pdf:keywords") || info.Keywords, + creationDate, + modificationDate, + creator: metadata?.get("xmp:creatortool") || info.Creator, + producer: metadata?.get("pdf:producer") || info.Producer, + version: info.PDFFormatVersion, + pageCount: this.pdfDocument.numPages, + pageSize, + linearized: isLinearized, + _currentPageNumber: currentPageNumber, + _pagesRotation: pagesRotation + }); + this.#updateUI(); + const { + length + } = await this.pdfDocument.getDownloadInfo(); + if (contentLength === length) { + return; + } + const data = Object.assign(Object.create(null), this.#fieldData); + data.fileSize = await this.#parseFileSize(length); + this.#fieldData = Object.freeze(data); + this.#updateUI(); + } + async close() { + this.overlayManager.close(this.dialog); + } + setDocument(pdfDocument) { + if (this.pdfDocument) { + this.#reset(); + this.#updateUI(); + } + if (!pdfDocument) { + return; + } + this.pdfDocument = pdfDocument; + this._dataAvailableCapability.resolve(); + } + #reset() { + this.pdfDocument = null; + this.#fieldData = null; + this._dataAvailableCapability = Promise.withResolvers(); + this._currentPageNumber = 1; + this._pagesRotation = 0; + } + #updateUI() { + if (this.#fieldData && this.overlayManager.active !== this.dialog) { + return; + } + for (const id in this.fields) { + const content = this.#fieldData?.[id]; + this.fields[id].textContent = content || content === 0 ? content : "-"; + } + } + async #parseFileSize(b = 0) { + const kb = b / 1024, + mb = kb / 1024; + return kb ? this.l10n.get(mb >= 1 ? "pdfjs-document-properties-size-mb" : "pdfjs-document-properties-size-kb", { + mb, + kb, + b + }) : undefined; + } + async #parsePageSize(pageSizeInches, pagesRotation) { + if (!pageSizeInches) { + return undefined; + } + if (pagesRotation % 180 !== 0) { + pageSizeInches = { + width: pageSizeInches.height, + height: pageSizeInches.width + }; + } + const isPortrait = isPortraitOrientation(pageSizeInches), + nonMetric = NON_METRIC_LOCALES.includes(this.l10n.getLanguage()); + let sizeInches = { + width: Math.round(pageSizeInches.width * 100) / 100, + height: Math.round(pageSizeInches.height * 100) / 100 + }; + let sizeMillimeters = { + width: Math.round(pageSizeInches.width * 25.4 * 10) / 10, + height: Math.round(pageSizeInches.height * 25.4 * 10) / 10 + }; + let nameId = getPageName(sizeInches, isPortrait, US_PAGE_NAMES) || getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES); + if (!nameId && !(Number.isInteger(sizeMillimeters.width) && Number.isInteger(sizeMillimeters.height))) { + const exactMillimeters = { + width: pageSizeInches.width * 25.4, + height: pageSizeInches.height * 25.4 + }; + const intMillimeters = { + width: Math.round(sizeMillimeters.width), + height: Math.round(sizeMillimeters.height) + }; + if (Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 && Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1) { + nameId = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES); + if (nameId) { + sizeInches = { + width: Math.round(intMillimeters.width / 25.4 * 100) / 100, + height: Math.round(intMillimeters.height / 25.4 * 100) / 100 + }; + sizeMillimeters = intMillimeters; + } + } + } + const [{ + width, + height + }, unit, name, orientation] = await Promise.all([nonMetric ? sizeInches : sizeMillimeters, this.l10n.get(nonMetric ? "pdfjs-document-properties-page-size-unit-inches" : "pdfjs-document-properties-page-size-unit-millimeters"), nameId && this.l10n.get(nameId), this.l10n.get(isPortrait ? "pdfjs-document-properties-page-size-orientation-portrait" : "pdfjs-document-properties-page-size-orientation-landscape")]); + return this.l10n.get(name ? "pdfjs-document-properties-page-size-dimension-name-string" : "pdfjs-document-properties-page-size-dimension-string", { + width, + height, + unit, + name, + orientation + }); + } + async #parseDate(metadataDate, infoDate) { + const dateObj = Date.parse(metadataDate) || PDFDateString.toDateObject(infoDate); + return dateObj ? this.l10n.get("pdfjs-document-properties-date-time-string", { + dateObj: dateObj.valueOf() + }) : undefined; + } + #parseLinearization(isLinearized) { + return this.l10n.get(isLinearized ? "pdfjs-document-properties-linearized-yes" : "pdfjs-document-properties-linearized-no"); + } +} + +;// ./web/pdf_find_utils.js + +const CharacterType = { + SPACE: 0, + ALPHA_LETTER: 1, + PUNCT: 2, + HAN_LETTER: 3, + KATAKANA_LETTER: 4, + HIRAGANA_LETTER: 5, + HALFWIDTH_KATAKANA_LETTER: 6, + THAI_LETTER: 7 +}; +function isAlphabeticalScript(charCode) { + return charCode < 0x2e80; +} +function isAscii(charCode) { + return (charCode & 0xff80) === 0; +} +function isAsciiAlpha(charCode) { + return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a; +} +function isAsciiDigit(charCode) { + return charCode >= 0x30 && charCode <= 0x39; +} +function isAsciiSpace(charCode) { + return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a; +} +function isHan(charCode) { + return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff; +} +function isKatakana(charCode) { + return charCode >= 0x30a0 && charCode <= 0x30ff; +} +function isHiragana(charCode) { + return charCode >= 0x3040 && charCode <= 0x309f; +} +function isHalfwidthKatakana(charCode) { + return charCode >= 0xff60 && charCode <= 0xff9f; +} +function isThai(charCode) { + return (charCode & 0xff80) === 0x0e00; +} +function getCharacterType(charCode) { + if (isAlphabeticalScript(charCode)) { + if (isAscii(charCode)) { + if (isAsciiSpace(charCode)) { + return CharacterType.SPACE; + } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) { + return CharacterType.ALPHA_LETTER; + } + return CharacterType.PUNCT; + } else if (isThai(charCode)) { + return CharacterType.THAI_LETTER; + } else if (charCode === 0xa0) { + return CharacterType.SPACE; + } + return CharacterType.ALPHA_LETTER; + } + if (isHan(charCode)) { + return CharacterType.HAN_LETTER; + } else if (isKatakana(charCode)) { + return CharacterType.KATAKANA_LETTER; + } else if (isHiragana(charCode)) { + return CharacterType.HIRAGANA_LETTER; + } else if (isHalfwidthKatakana(charCode)) { + return CharacterType.HALFWIDTH_KATAKANA_LETTER; + } + return CharacterType.ALPHA_LETTER; +} +let NormalizeWithNFKC; +function getNormalizeWithNFKC() { + NormalizeWithNFKC ||= `\xA0¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰ꟱-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`; + return NormalizeWithNFKC; +} + +;// ./web/pdf_find_controller.js + + +const FindState = { + FOUND: 0, + NOT_FOUND: 1, + WRAPPED: 2, + PENDING: 3 +}; +const FIND_TIMEOUT = 250; +const MATCH_SCROLL_OFFSET_TOP = -50; +const CHARACTERS_TO_NORMALIZE = { + "\u2010": "-", + "\u2018": "'", + "\u2019": "'", + "\u201A": "'", + "\u201B": "'", + "\u201C": '"', + "\u201D": '"', + "\u201E": '"', + "\u201F": '"', + "\u00BC": "1/4", + "\u00BD": "1/2", + "\u00BE": "3/4" +}; +const DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]); +let DIACRITICS_EXCEPTION_STR; +const DIACRITICS_REG_EXP = /\p{M}+/gu; +const SPECIAL_CHARS_REG_EXP = /([*+^${}()|[\]\\])|(\p{P}+)|(\s+)|(\p{M})|(\p{L})/gu; +const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u; +const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u; +const SYLLABLES_REG_EXP = /[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g; +const SYLLABLES_LENGTHS = new Map(); +const FIRST_CHAR_SYLLABLES_REG_EXP = "[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]"; +const NFKC_CHARS_TO_NORMALIZE = new Map(); +let noSyllablesRegExp = null; +let withSyllablesRegExp = null; +function normalize(text, options = {}) { + const syllablePositions = []; + let m; + while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) { + let { + index + } = m; + for (const char of m[0]) { + let len = SYLLABLES_LENGTHS.get(char); + if (!len) { + len = char.normalize("NFD").length; + SYLLABLES_LENGTHS.set(char, len); + } + syllablePositions.push([len, index++]); + } + } + const hasSyllables = syllablePositions.length > 0; + const ignoreDashEOL = options.ignoreDashEOL ?? false; + let normalizationRegex; + if (!hasSyllables && noSyllablesRegExp) { + normalizationRegex = noSyllablesRegExp; + } else if (hasSyllables && withSyllablesRegExp) { + normalizationRegex = withSyllablesRegExp; + } else { + const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(""); + const toNormalizeWithNFKC = getNormalizeWithNFKC(); + const CJK = "(?:\\p{Ideographic}|[\u3040-\u30FF])"; + const HKDiacritics = "(?:\u3099|\u309A)"; + const BrokenWord = `\\p{Ll}-\\n(?=\\p{Ll})|\\p{Lu}-\\n(?=\\p{L})`; + const regexps = [`[${replace}]`, `[${toNormalizeWithNFKC}]`, `${HKDiacritics}\\n`, "\\p{M}+(?:-\\n)?", `${BrokenWord}`, "\\S-\\n", `${CJK}\\n`, "\\n", hasSyllables ? FIRST_CHAR_SYLLABLES_REG_EXP : "\\u0000"]; + normalizationRegex = new RegExp(regexps.map(r => `(${r})`).join("|"), "gum"); + if (hasSyllables) { + withSyllablesRegExp = normalizationRegex; + } else { + noSyllablesRegExp = normalizationRegex; + } + } + const rawDiacriticsPositions = []; + while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) { + rawDiacriticsPositions.push([m[0].length, m.index]); + } + let normalized = text.normalize("NFD"); + const positions = [0, 0]; + let rawDiacriticsIndex = 0; + let syllableIndex = 0; + let shift = 0; + let shiftOrigin = 0; + let eol = 0; + let hasDiacritics = false; + normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, p6, p7, p8, p9, i) => { + i -= shiftOrigin; + if (p1) { + const replacement = CHARACTERS_TO_NORMALIZE[p1]; + const jj = replacement.length; + for (let j = 1; j < jj; j++) { + positions.push(i - shift + j, shift - j); + } + shift -= jj - 1; + return replacement; + } + if (p2) { + let replacement = NFKC_CHARS_TO_NORMALIZE.get(p2); + if (!replacement) { + replacement = p2.normalize("NFKC"); + NFKC_CHARS_TO_NORMALIZE.set(p2, replacement); + } + const jj = replacement.length; + for (let j = 1; j < jj; j++) { + positions.push(i - shift + j, shift - j); + } + shift -= jj - 1; + return replacement; + } + if (p3) { + hasDiacritics = true; + if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) { + ++rawDiacriticsIndex; + } else { + positions.push(i - 1 - shift + 1, shift - 1); + shift -= 1; + shiftOrigin += 1; + } + positions.push(i - shift + 1, shift); + shiftOrigin += 1; + eol += 1; + return p3.charAt(0); + } + if (p4) { + const hasTrailingDashEOL = p4.endsWith("\n"); + const len = hasTrailingDashEOL ? p4.length - 2 : p4.length; + hasDiacritics = true; + let jj = len; + if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) { + jj -= rawDiacriticsPositions[rawDiacriticsIndex][0]; + ++rawDiacriticsIndex; + } + for (let j = 1; j <= jj; j++) { + positions.push(i - 1 - shift + j, shift - j); + } + shift -= jj; + shiftOrigin += jj; + if (hasTrailingDashEOL) { + i += len - 1; + positions.push(i - shift + 1, 1 + shift); + shift += 1; + shiftOrigin += 1; + eol += 1; + return p4.slice(0, len); + } + return p4; + } + if (p5) { + if (ignoreDashEOL) { + shiftOrigin += 1; + eol += 1; + return p5.slice(0, -1); + } + const len = p5.length - 2; + positions.push(i - shift + len, 1 + shift); + shift += 1; + shiftOrigin += 1; + eol += 1; + return p5.slice(0, -2); + } + if (p6) { + shiftOrigin += 1; + eol += 1; + return p6.slice(0, -1); + } + if (p7) { + const len = p7.length - 1; + positions.push(i - shift + len, shift); + shiftOrigin += 1; + eol += 1; + return p7.slice(0, -1); + } + if (p8) { + positions.push(i - shift + 1, shift - 1); + shift -= 1; + shiftOrigin += 1; + eol += 1; + return " "; + } + if (i + eol === syllablePositions[syllableIndex]?.[1]) { + const newCharLen = syllablePositions[syllableIndex][0] - 1; + ++syllableIndex; + for (let j = 1; j <= newCharLen; j++) { + positions.push(i - (shift - j), shift - j); + } + shift -= newCharLen; + shiftOrigin += newCharLen; + } + return p9; + }); + positions.push(normalized.length, shift); + const starts = new Uint32Array(positions.length >> 1); + const shifts = new Int32Array(positions.length >> 1); + for (let i = 0, ii = positions.length; i < ii; i += 2) { + starts[i >> 1] = positions[i]; + shifts[i >> 1] = positions[i + 1]; + } + return [normalized, [starts, shifts], hasDiacritics]; +} +function getOriginalIndex(diffs, pos, len) { + if (!diffs) { + return [pos, len]; + } + const [starts, shifts] = diffs; + const start = pos; + const end = pos + len - 1; + let i = binarySearchFirstItem(starts, x => x >= start); + if (starts[i] > start) { + --i; + } + let j = binarySearchFirstItem(starts, x => x >= end, i); + if (starts[j] > end) { + --j; + } + const oldStart = start + shifts[i]; + const oldEnd = end + shifts[j]; + const oldLen = oldEnd + 1 - oldStart; + return [oldStart, oldLen]; +} +class PDFFindController { + #state = null; + #updateMatchesCountOnProgress = true; + #visitedPagesCount = 0; + constructor({ + linkService, + eventBus, + updateMatchesCountOnProgress = true + }) { + this._linkService = linkService; + this._eventBus = eventBus; + this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress; + this.onIsPageVisible = null; + this.#reset(); + eventBus._on("find", this.#onFind.bind(this)); + eventBus._on("findbarclose", this.#onFindBarClose.bind(this)); + } + get highlightMatches() { + return this._highlightMatches; + } + get pageMatches() { + return this._pageMatches; + } + get pageMatchesLength() { + return this._pageMatchesLength; + } + get selected() { + return this._selected; + } + get state() { + return this.#state; + } + setDocument(pdfDocument) { + if (this._pdfDocument) { + this.#reset(); + } + if (!pdfDocument) { + return; + } + this._pdfDocument = pdfDocument; + this._firstPageCapability.resolve(); + } + #onFind(state) { + if (!state) { + return; + } + const pdfDocument = this._pdfDocument; + const { + type + } = state; + if (this.#state === null || this.#shouldDirtyMatch(state)) { + this._dirtyMatch = true; + } + this.#state = state; + if (type !== "highlightallchange") { + this.#updateUIState(FindState.PENDING); + } + this._firstPageCapability.promise.then(() => { + if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) { + return; + } + this.#extractText(); + const findbarClosed = !this._highlightMatches; + const pendingTimeout = !!this._findTimeout; + if (this._findTimeout) { + clearTimeout(this._findTimeout); + this._findTimeout = null; + } + if (!type) { + this._findTimeout = setTimeout(() => { + this.#nextMatch(); + this._findTimeout = null; + }, FIND_TIMEOUT); + } else if (this._dirtyMatch) { + this.#nextMatch(); + } else if (type === "again") { + this.#nextMatch(); + if (findbarClosed && this.#state.highlightAll) { + this.#updateAllPages(); + } + } else if (type === "highlightallchange") { + if (pendingTimeout) { + this.#nextMatch(); + } else { + this._highlightMatches = true; + } + this.#updateAllPages(); + } else { + this.#nextMatch(); + } + }); + } + scrollMatchIntoView({ + element = null, + selectedLeft = 0, + pageIndex = -1, + matchIndex = -1 + }) { + if (!this._scrollMatches || !element) { + return; + } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) { + return; + } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) { + return; + } + this._scrollMatches = false; + const spot = { + top: MATCH_SCROLL_OFFSET_TOP, + left: selectedLeft + }; + scrollIntoView(element, spot, true); + } + #reset() { + this._highlightMatches = false; + this._scrollMatches = false; + this._pdfDocument = null; + this._pageMatches = []; + this._pageMatchesLength = []; + this.#visitedPagesCount = 0; + this.#state = null; + this._selected = { + pageIdx: -1, + matchIdx: -1 + }; + this._offset = { + pageIdx: null, + matchIdx: null, + wrapped: false + }; + this._extractTextPromises = []; + this._pageContents = []; + this._pageDiffs = []; + this._hasDiacritics = []; + this._matchesCountTotal = 0; + this._pagesToSearch = null; + this._pendingFindMatches = new Set(); + this._resumePageIdx = null; + this._dirtyMatch = false; + clearTimeout(this._findTimeout); + this._findTimeout = null; + this._firstPageCapability = Promise.withResolvers(); + } + get #query() { + const { + query + } = this.#state; + if (typeof query === "string") { + if (query !== this._rawQuery) { + this._rawQuery = query; + [this._normalizedQuery] = normalize(query); + } + return this._normalizedQuery; + } + return (query || []).filter(q => !!q).map(q => normalize(q)[0]); + } + #shouldDirtyMatch(state) { + const newQuery = state.query, + prevQuery = this.#state.query; + const newType = typeof newQuery, + prevType = typeof prevQuery; + if (newType !== prevType) { + return true; + } + if (newType === "string") { + if (newQuery !== prevQuery) { + return true; + } + } else if (JSON.stringify(newQuery) !== JSON.stringify(prevQuery)) { + return true; + } + switch (state.type) { + case "again": + const pageNumber = this._selected.pageIdx + 1; + const linkService = this._linkService; + return pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !(this.onIsPageVisible?.(pageNumber) ?? true); + case "highlightallchange": + return false; + } + return true; + } + #isEntireWord(content, startIdx, length) { + let match = content.slice(0, startIdx).match(NOT_DIACRITIC_FROM_END_REG_EXP); + if (match) { + const first = content.charCodeAt(startIdx); + const limit = match[1].charCodeAt(0); + if (getCharacterType(first) === getCharacterType(limit)) { + return false; + } + } + match = content.slice(startIdx + length).match(NOT_DIACRITIC_FROM_START_REG_EXP); + if (match) { + const last = content.charCodeAt(startIdx + length - 1); + const limit = match[1].charCodeAt(0); + if (getCharacterType(last) === getCharacterType(limit)) { + return false; + } + } + return true; + } + #convertToRegExpString(query, hasDiacritics) { + const { + matchDiacritics + } = this.#state; + let isUnicode = false; + const addExtraWhitespaces = (original, fixed) => { + if (original === query) { + return fixed; + } + if (query.startsWith(original)) { + return `${fixed}[ ]*`; + } + if (query.endsWith(original)) { + return `[ ]*${fixed}`; + } + return `[ ]*${fixed}[ ]*`; + }; + query = query.replaceAll(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => { + if (p1) { + return addExtraWhitespaces(p1, `\\${p1}`); + } + if (p2) { + return addExtraWhitespaces(p2, p2.replaceAll(/[.?]/g, "\\$&")); + } + if (p3) { + return "[ ]+"; + } + if (matchDiacritics) { + return p4 || p5; + } + if (p4) { + return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : ""; + } + if (hasDiacritics) { + isUnicode = true; + return `${p5}\\p{M}*`; + } + return p5; + }); + const trailingSpaces = "[ ]*"; + if (query.endsWith(trailingSpaces)) { + query = query.slice(0, query.length - trailingSpaces.length); + } + if (matchDiacritics) { + if (hasDiacritics) { + DIACRITICS_EXCEPTION_STR ||= String.fromCharCode(...DIACRITICS_EXCEPTION); + isUnicode = true; + query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\p{M}]|$)`; + } + } + return [isUnicode, query]; + } + #calculateMatch(pageIndex) { + if (!this.#state) { + return; + } + const query = this.#query; + if (query.length === 0) { + return; + } + const pageContent = this._pageContents[pageIndex]; + const matcherResult = this.match(query, pageContent, pageIndex); + const matches = this._pageMatches[pageIndex] = []; + const matchesLength = this._pageMatchesLength[pageIndex] = []; + const diffs = this._pageDiffs[pageIndex]; + matcherResult?.forEach(({ + index, + length + }) => { + const [matchPos, matchLen] = getOriginalIndex(diffs, index, length); + if (matchLen) { + matches.push(matchPos); + matchesLength.push(matchLen); + } + }); + if (this.#state.highlightAll) { + this.#updatePage(pageIndex); + } + if (this._resumePageIdx === pageIndex) { + this._resumePageIdx = null; + this.#nextPageMatch(); + } + const pageMatchesCount = matches.length; + this._matchesCountTotal += pageMatchesCount; + if (this.#updateMatchesCountOnProgress) { + if (pageMatchesCount > 0) { + this.#updateUIResultsCount(); + } + } else if (++this.#visitedPagesCount === this._linkService.pagesCount) { + this.#updateUIResultsCount(); + } + } + match(query, pageContent, pageIndex) { + const hasDiacritics = this._hasDiacritics[pageIndex]; + let isUnicode = false; + if (typeof query === "string") { + [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics); + } else { + query = query.sort().reverse().map(q => { + const [isUnicodePart, queryPart] = this.#convertToRegExpString(q, hasDiacritics); + isUnicode ||= isUnicodePart; + return `(${queryPart})`; + }).join("|"); + } + if (!query) { + return undefined; + } + const { + caseSensitive, + entireWord + } = this.#state; + const flags = `g${isUnicode ? "u" : ""}${caseSensitive ? "" : "i"}`; + query = new RegExp(query, flags); + const matches = []; + let match; + while ((match = query.exec(pageContent)) !== null) { + if (entireWord && !this.#isEntireWord(pageContent, match.index, match[0].length)) { + continue; + } + matches.push({ + index: match.index, + length: match[0].length + }); + } + return matches; + } + #extractText() { + if (this._extractTextPromises.length > 0) { + return; + } + let deferred = Promise.resolve(); + const textOptions = { + disableNormalization: true + }; + const pdfDoc = this._pdfDocument; + for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) { + const { + promise, + resolve + } = Promise.withResolvers(); + this._extractTextPromises[i] = promise; + deferred = deferred.then(async () => { + if (pdfDoc !== this._pdfDocument) { + resolve(); + return; + } + await pdfDoc.getPage(i + 1).then(pdfPage => pdfPage.getTextContent(textOptions)).then(textContent => { + const strBuf = []; + for (const textItem of textContent.items) { + strBuf.push(textItem.str); + if (textItem.hasEOL) { + strBuf.push("\n"); + } + } + [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] = normalize(strBuf.join("")); + resolve(); + }, reason => { + console.error(`Unable to get text content for page ${i + 1}`, reason); + this._pageContents[i] = ""; + this._pageDiffs[i] = null; + this._hasDiacritics[i] = false; + resolve(); + }); + }); + } + } + #updatePage(index) { + if (this._scrollMatches && this._selected.pageIdx === index) { + this._linkService.page = index + 1; + } + this._eventBus.dispatch("updatetextlayermatches", { + source: this, + pageIndex: index + }); + } + #updateAllPages() { + this._eventBus.dispatch("updatetextlayermatches", { + source: this, + pageIndex: -1 + }); + } + #nextMatch() { + const previous = this.#state.findPrevious; + const currentPageIndex = this._linkService.page - 1; + const numPages = this._linkService.pagesCount; + this._highlightMatches = true; + if (this._dirtyMatch) { + this._dirtyMatch = false; + this._selected.pageIdx = this._selected.matchIdx = -1; + this._offset.pageIdx = currentPageIndex; + this._offset.matchIdx = null; + this._offset.wrapped = false; + this._resumePageIdx = null; + this._pageMatches.length = 0; + this._pageMatchesLength.length = 0; + this.#visitedPagesCount = 0; + this._matchesCountTotal = 0; + this.#updateAllPages(); + for (let i = 0; i < numPages; i++) { + if (this._pendingFindMatches.has(i)) { + continue; + } + this._pendingFindMatches.add(i); + this._extractTextPromises[i].then(() => { + this._pendingFindMatches.delete(i); + this.#calculateMatch(i); + }); + } + } + const query = this.#query; + if (query.length === 0) { + this.#updateUIState(FindState.FOUND); + return; + } + if (this._resumePageIdx) { + return; + } + const offset = this._offset; + this._pagesToSearch = numPages; + if (offset.matchIdx !== null) { + const numPageMatches = this._pageMatches[offset.pageIdx].length; + if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) { + offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1; + this.#updateMatch(true); + return; + } + this.#advanceOffsetPage(previous); + } + this.#nextPageMatch(); + } + #matchesReady(matches) { + const offset = this._offset; + const numMatches = matches.length; + const previous = this.#state.findPrevious; + if (numMatches) { + offset.matchIdx = previous ? numMatches - 1 : 0; + this.#updateMatch(true); + return true; + } + this.#advanceOffsetPage(previous); + if (offset.wrapped) { + offset.matchIdx = null; + if (this._pagesToSearch < 0) { + this.#updateMatch(false); + return true; + } + } + return false; + } + #nextPageMatch() { + if (this._resumePageIdx !== null) { + console.error("There can only be one pending page."); + } + let matches = null; + do { + const pageIdx = this._offset.pageIdx; + matches = this._pageMatches[pageIdx]; + if (!matches) { + this._resumePageIdx = pageIdx; + break; + } + } while (!this.#matchesReady(matches)); + } + #advanceOffsetPage(previous) { + const offset = this._offset; + const numPages = this._linkService.pagesCount; + offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1; + offset.matchIdx = null; + this._pagesToSearch--; + if (offset.pageIdx >= numPages || offset.pageIdx < 0) { + offset.pageIdx = previous ? numPages - 1 : 0; + offset.wrapped = true; + } + } + #updateMatch(found = false) { + let state = FindState.NOT_FOUND; + const wrapped = this._offset.wrapped; + this._offset.wrapped = false; + if (found) { + const previousPage = this._selected.pageIdx; + this._selected.pageIdx = this._offset.pageIdx; + this._selected.matchIdx = this._offset.matchIdx; + state = wrapped ? FindState.WRAPPED : FindState.FOUND; + if (previousPage !== -1 && previousPage !== this._selected.pageIdx) { + this.#updatePage(previousPage); + } + } + this.#updateUIState(state, this.#state.findPrevious); + if (this._selected.pageIdx !== -1) { + this._scrollMatches = true; + this.#updatePage(this._selected.pageIdx); + } + } + #onFindBarClose(evt) { + const pdfDocument = this._pdfDocument; + this._firstPageCapability.promise.then(() => { + if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) { + return; + } + if (this._findTimeout) { + clearTimeout(this._findTimeout); + this._findTimeout = null; + } + if (this._resumePageIdx) { + this._resumePageIdx = null; + this._dirtyMatch = true; + } + this.#updateUIState(FindState.FOUND); + this._highlightMatches = false; + this.#updateAllPages(); + }); + } + #requestMatchesCount() { + const { + pageIdx, + matchIdx + } = this._selected; + let current = 0, + total = this._matchesCountTotal; + if (matchIdx !== -1) { + for (let i = 0; i < pageIdx; i++) { + current += this._pageMatches[i]?.length || 0; + } + current += matchIdx + 1; + } + if (current < 1 || current > total) { + current = total = 0; + } + return { + current, + total + }; + } + #updateUIResultsCount() { + this._eventBus.dispatch("updatefindmatchescount", { + source: this, + matchesCount: this.#requestMatchesCount() + }); + } + #updateUIState(state, previous = false) { + if (!this.#updateMatchesCountOnProgress && (this.#visitedPagesCount !== this._linkService.pagesCount || state === FindState.PENDING)) { + return; + } + this._eventBus.dispatch("updatefindcontrolstate", { + source: this, + state, + previous, + entireWord: this.#state?.entireWord ?? null, + matchesCount: this.#requestMatchesCount(), + rawQuery: this.#state?.query ?? null + }); + } +} + +;// ./web/pdf_find_bar.js + + +const MATCHES_COUNT_LIMIT = 1000; +class PDFFindBar { + #mainContainer; + #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this)); + constructor(options, mainContainer, eventBus) { + this.opened = false; + this.bar = options.bar; + this.toggleButton = options.toggleButton; + this.findField = options.findField; + this.highlightAll = options.highlightAllCheckbox; + this.caseSensitive = options.caseSensitiveCheckbox; + this.matchDiacritics = options.matchDiacriticsCheckbox; + this.entireWord = options.entireWordCheckbox; + this.findMsg = options.findMsg; + this.findResultsCount = options.findResultsCount; + this.findPreviousButton = options.findPreviousButton; + this.findNextButton = options.findNextButton; + this.eventBus = eventBus; + this.#mainContainer = mainContainer; + const checkedInputs = new Map([[this.highlightAll, "highlightallchange"], [this.caseSensitive, "casesensitivitychange"], [this.entireWord, "entirewordchange"], [this.matchDiacritics, "diacriticmatchingchange"]]); + this.toggleButton.addEventListener("click", () => { + this.toggle(); + }); + this.findField.addEventListener("input", () => { + this.dispatchEvent(""); + }); + this.bar.addEventListener("keydown", ({ + keyCode, + shiftKey, + target + }) => { + switch (keyCode) { + case 13: + if (target === this.findField) { + this.dispatchEvent("again", shiftKey); + } else if (checkedInputs.has(target)) { + target.checked = !target.checked; + this.dispatchEvent(checkedInputs.get(target)); + } + break; + case 27: + this.close(); + break; + } + }); + this.findPreviousButton.addEventListener("click", () => { + this.dispatchEvent("again", true); + }); + this.findNextButton.addEventListener("click", () => { + this.dispatchEvent("again", false); + }); + for (const [elem, evtName] of checkedInputs) { + elem.addEventListener("click", () => { + this.dispatchEvent(evtName); + }); + } + } + reset() { + this.updateUIState(); + } + dispatchEvent(type, findPrev = false) { + this.eventBus.dispatch("find", { + source: this, + type, + query: this.findField.value, + caseSensitive: this.caseSensitive.checked, + entireWord: this.entireWord.checked, + highlightAll: this.highlightAll.checked, + findPrevious: findPrev, + matchDiacritics: this.matchDiacritics.checked + }); + } + updateUIState(state, previous, matchesCount) { + const { + findField, + findMsg + } = this; + let findMsgId = "", + status = ""; + switch (state) { + case FindState.FOUND: + break; + case FindState.PENDING: + status = "pending"; + break; + case FindState.NOT_FOUND: + findMsgId = "pdfjs-find-not-found"; + status = "notFound"; + break; + case FindState.WRAPPED: + findMsgId = previous ? "pdfjs-find-reached-top" : "pdfjs-find-reached-bottom"; + break; + } + findField.setAttribute("data-status", status); + findField.setAttribute("aria-invalid", state === FindState.NOT_FOUND); + findMsg.setAttribute("data-status", status); + if (findMsgId) { + findMsg.setAttribute("data-l10n-id", findMsgId); + } else { + findMsg.removeAttribute("data-l10n-id"); + findMsg.textContent = ""; + } + this.updateResultsCount(matchesCount); + } + updateResultsCount({ + current = 0, + total = 0 + } = {}) { + const { + findResultsCount + } = this; + if (total > 0) { + const limit = MATCHES_COUNT_LIMIT; + findResultsCount.setAttribute("data-l10n-id", total > limit ? "pdfjs-find-match-count-limit" : "pdfjs-find-match-count"); + findResultsCount.setAttribute("data-l10n-args", JSON.stringify({ + limit, + current, + total + })); + } else { + findResultsCount.removeAttribute("data-l10n-id"); + findResultsCount.textContent = ""; + } + } + open() { + if (!this.opened) { + this.#resizeObserver.observe(this.#mainContainer); + this.#resizeObserver.observe(this.bar); + this.opened = true; + toggleExpandedBtn(this.toggleButton, true, this.bar); + } + this.findField.select(); + this.findField.focus(); + } + close() { + if (!this.opened) { + return; + } + this.#resizeObserver.disconnect(); + this.opened = false; + toggleExpandedBtn(this.toggleButton, false, this.bar); + this.eventBus.dispatch("findbarclose", { + source: this + }); + } + toggle() { + if (this.opened) { + this.close(); + } else { + this.open(); + } + } + #resizeObserverCallback() { + const { + bar + } = this; + bar.classList.remove("wrapContainers"); + const findbarHeight = bar.clientHeight; + const inputContainerHeight = bar.firstElementChild.clientHeight; + if (findbarHeight > inputContainerHeight) { + bar.classList.add("wrapContainers"); + } + } +} + +;// ./web/pdf_history.js + + + +const HASH_CHANGE_TIMEOUT = 1000; +const POSITION_UPDATED_THRESHOLD = 50; +const UPDATE_VIEWAREA_TIMEOUT = 1000; +function getCurrentHash() { + return document.location.hash; +} +class PDFHistory { + #eventAbortController = null; + constructor({ + linkService, + eventBus + }) { + this.linkService = linkService; + this.eventBus = eventBus; + this._initialized = false; + this._fingerprint = ""; + this.reset(); + this.eventBus._on("pagesinit", () => { + this._isPagesLoaded = false; + this.eventBus._on("pagesloaded", evt => { + this._isPagesLoaded = !!evt.pagesCount; + }, { + once: true + }); + }); + } + initialize({ + fingerprint, + resetHistory = false, + updateUrl = false + }) { + if (!fingerprint || typeof fingerprint !== "string") { + console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.'); + return; + } + if (this._initialized) { + this.reset(); + } + const reInitialized = this._fingerprint !== "" && this._fingerprint !== fingerprint; + this._fingerprint = fingerprint; + this._updateUrl = updateUrl === true; + this._initialized = true; + this.#bindEvents(); + const state = window.history.state; + this._popStateInProgress = false; + this._blockHashChange = 0; + this._currentHash = getCurrentHash(); + this._numPositionUpdates = 0; + this._uid = this._maxUid = 0; + this._destination = null; + this._position = null; + if (!this.#isValidState(state, true) || resetHistory) { + const { + hash, + page, + rotation + } = this.#parseCurrentHash(true); + if (!hash || reInitialized || resetHistory) { + this.#pushOrReplaceState(null, true); + return; + } + this.#pushOrReplaceState({ + hash, + page, + rotation + }, true); + return; + } + const destination = state.destination; + this.#updateInternalState(destination, state.uid, true); + if (destination.rotation !== undefined) { + this._initialRotation = destination.rotation; + } + if (destination.dest) { + this._initialBookmark = JSON.stringify(destination.dest); + this._destination.page = null; + } else if (destination.hash) { + this._initialBookmark = destination.hash; + } else if (destination.page) { + this._initialBookmark = `page=${destination.page}`; + } + } + reset() { + if (this._initialized) { + this.#pageHide(); + this._initialized = false; + this.#unbindEvents(); + } + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + this._initialBookmark = null; + this._initialRotation = null; + } + push({ + namedDest = null, + explicitDest, + pageNumber + }) { + if (!this._initialized) { + return; + } + if (namedDest && typeof namedDest !== "string") { + console.error("PDFHistory.push: " + `"${namedDest}" is not a valid namedDest parameter.`); + return; + } else if (!Array.isArray(explicitDest)) { + console.error("PDFHistory.push: " + `"${explicitDest}" is not a valid explicitDest parameter.`); + return; + } else if (!this.#isValidPage(pageNumber)) { + if (pageNumber !== null || this._destination) { + console.error("PDFHistory.push: " + `"${pageNumber}" is not a valid pageNumber parameter.`); + return; + } + } + const hash = namedDest || JSON.stringify(explicitDest); + if (!hash) { + return; + } + let forceReplace = false; + if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) { + if (this._destination.page) { + return; + } + forceReplace = true; + } + if (this._popStateInProgress && !forceReplace) { + return; + } + this.#pushOrReplaceState({ + dest: explicitDest, + hash, + page: pageNumber, + rotation: this.linkService.rotation + }, forceReplace); + if (!this._popStateInProgress) { + this._popStateInProgress = true; + Promise.resolve().then(() => { + this._popStateInProgress = false; + }); + } + } + pushPage(pageNumber) { + if (!this._initialized) { + return; + } + if (!this.#isValidPage(pageNumber)) { + console.error(`PDFHistory.pushPage: "${pageNumber}" is not a valid page number.`); + return; + } + if (this._destination?.page === pageNumber) { + return; + } + if (this._popStateInProgress) { + return; + } + this.#pushOrReplaceState({ + dest: null, + hash: `page=${pageNumber}`, + page: pageNumber, + rotation: this.linkService.rotation + }); + if (!this._popStateInProgress) { + this._popStateInProgress = true; + Promise.resolve().then(() => { + this._popStateInProgress = false; + }); + } + } + pushCurrentPosition() { + if (!this._initialized || this._popStateInProgress) { + return; + } + this.#tryPushCurrentPosition(); + } + back() { + if (!this._initialized || this._popStateInProgress) { + return; + } + const state = window.history.state; + if (this.#isValidState(state) && state.uid > 0) { + window.history.back(); + } + } + forward() { + if (!this._initialized || this._popStateInProgress) { + return; + } + const state = window.history.state; + if (this.#isValidState(state) && state.uid < this._maxUid) { + window.history.forward(); + } + } + get popStateInProgress() { + return this._initialized && (this._popStateInProgress || this._blockHashChange > 0); + } + get initialBookmark() { + return this._initialized ? this._initialBookmark : null; + } + get initialRotation() { + return this._initialized ? this._initialRotation : null; + } + #pushOrReplaceState(destination, forceReplace = false) { + const shouldReplace = forceReplace || !this._destination; + const newState = { + fingerprint: this._fingerprint, + uid: shouldReplace ? this._uid : this._uid + 1, + destination + }; + this.#updateInternalState(destination, newState.uid); + let newUrl; + if (this._updateUrl && destination?.hash) { + const { + href, + protocol + } = document.location; + if (protocol !== "file:") { + newUrl = updateUrlHash(href, destination.hash); + } + } + if (shouldReplace) { + window.history.replaceState(newState, "", newUrl); + } else { + window.history.pushState(newState, "", newUrl); + } + } + #tryPushCurrentPosition(temporary = false) { + if (!this._position) { + return; + } + let position = this._position; + if (temporary) { + position = Object.assign(Object.create(null), this._position); + position.temporary = true; + } + if (!this._destination) { + this.#pushOrReplaceState(position); + return; + } + if (this._destination.temporary) { + this.#pushOrReplaceState(position, true); + return; + } + if (this._destination.hash === position.hash) { + return; + } + if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) { + return; + } + let forceReplace = false; + if (this._destination.page >= position.first && this._destination.page <= position.page) { + if (this._destination.dest !== undefined || !this._destination.first) { + return; + } + forceReplace = true; + } + this.#pushOrReplaceState(position, forceReplace); + } + #isValidPage(val) { + return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount; + } + #isValidState(state, checkReload = false) { + if (!state) { + return false; + } + if (state.fingerprint !== this._fingerprint) { + if (checkReload) { + if (typeof state.fingerprint !== "string" || state.fingerprint.length !== this._fingerprint.length) { + return false; + } + const [perfEntry] = performance.getEntriesByType("navigation"); + if (perfEntry?.type !== "reload") { + return false; + } + } else { + return false; + } + } + if (!Number.isInteger(state.uid) || state.uid < 0) { + return false; + } + if (state.destination === null || typeof state.destination !== "object") { + return false; + } + return true; + } + #updateInternalState(destination, uid, removeTemporary = false) { + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + if (removeTemporary && destination?.temporary) { + delete destination.temporary; + } + this._destination = destination; + this._uid = uid; + this._maxUid = Math.max(this._maxUid, uid); + this._numPositionUpdates = 0; + } + #parseCurrentHash(checkNameddest = false) { + const hash = unescape(getCurrentHash()).substring(1); + const params = parseQueryString(hash); + const nameddest = params.get("nameddest") || ""; + let page = params.get("page") | 0; + if (!this.#isValidPage(page) || checkNameddest && nameddest.length > 0) { + page = null; + } + return { + hash, + page, + rotation: this.linkService.rotation + }; + } + #updateViewarea({ + location + }) { + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + this._position = { + hash: location.pdfOpenParams.substring(1), + page: this.linkService.page, + first: location.pageNumber, + rotation: location.rotation + }; + if (this._popStateInProgress) { + return; + } + if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) { + this._numPositionUpdates++; + } + if (UPDATE_VIEWAREA_TIMEOUT > 0) { + this._updateViewareaTimeout = setTimeout(() => { + if (!this._popStateInProgress) { + this.#tryPushCurrentPosition(true); + } + this._updateViewareaTimeout = null; + }, UPDATE_VIEWAREA_TIMEOUT); + } + } + #popState({ + state + }) { + const newHash = getCurrentHash(), + hashChanged = this._currentHash !== newHash; + this._currentHash = newHash; + if (!state) { + this._uid++; + const { + hash, + page, + rotation + } = this.#parseCurrentHash(); + this.#pushOrReplaceState({ + hash, + page, + rotation + }, true); + return; + } + if (!this.#isValidState(state)) { + return; + } + this._popStateInProgress = true; + if (hashChanged) { + this._blockHashChange++; + waitOnEventOrTimeout({ + target: window, + name: "hashchange", + delay: HASH_CHANGE_TIMEOUT + }).then(() => { + this._blockHashChange--; + }); + } + const destination = state.destination; + this.#updateInternalState(destination, state.uid, true); + if (isValidRotation(destination.rotation)) { + this.linkService.rotation = destination.rotation; + } + if (destination.dest) { + this.linkService.goToDestination(destination.dest); + } else if (destination.hash) { + this.linkService.setHash(destination.hash); + } else if (destination.page) { + this.linkService.page = destination.page; + } + Promise.resolve().then(() => { + this._popStateInProgress = false; + }); + } + #pageHide() { + if (!this._destination || this._destination.temporary) { + this.#tryPushCurrentPosition(); + } + } + #bindEvents() { + if (this.#eventAbortController) { + return; + } + this.#eventAbortController = new AbortController(); + const { + signal + } = this.#eventAbortController; + this.eventBus._on("updateviewarea", this.#updateViewarea.bind(this), { + signal + }); + window.addEventListener("popstate", this.#popState.bind(this), { + signal + }); + window.addEventListener("pagehide", this.#pageHide.bind(this), { + signal + }); + } + #unbindEvents() { + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + } +} +function isDestHashesEqual(destHash, pushHash) { + if (typeof destHash !== "string" || typeof pushHash !== "string") { + return false; + } + if (destHash === pushHash) { + return true; + } + const nameddest = parseQueryString(destHash).get("nameddest"); + if (nameddest === pushHash) { + return true; + } + return false; +} +function isDestArraysEqual(firstDest, secondDest) { + function isEntryEqual(first, second) { + if (typeof first !== typeof second) { + return false; + } + if (Array.isArray(first) || Array.isArray(second)) { + return false; + } + if (first !== null && typeof first === "object" && second !== null) { + if (Object.keys(first).length !== Object.keys(second).length) { + return false; + } + for (const key in first) { + if (!isEntryEqual(first[key], second[key])) { + return false; + } + } + return true; + } + return first === second || Number.isNaN(first) && Number.isNaN(second); + } + if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) { + return false; + } + if (firstDest.length !== secondDest.length) { + return false; + } + for (let i = 0, ii = firstDest.length; i < ii; i++) { + if (!isEntryEqual(firstDest[i], secondDest[i])) { + return false; + } + } + return true; +} + +;// ./web/pdf_layer_viewer.js + +class PDFLayerViewer extends BaseTreeViewer { + constructor(options) { + super(options); + this.eventBus._on("optionalcontentconfigchanged", evt => { + this.#updateLayers(evt.promise); + }); + this.eventBus._on("resetlayers", () => { + this.#updateLayers(); + }); + this.eventBus._on("togglelayerstree", this._toggleAllTreeItems.bind(this)); + } + reset() { + super.reset(); + this._optionalContentConfig = null; + this._optionalContentVisibility?.clear(); + this._optionalContentVisibility = null; + } + _dispatchEvent(layersCount) { + this.eventBus.dispatch("layersloaded", { + source: this, + layersCount + }); + } + _bindLink(element, { + groupId, + input + }) { + const setVisibility = () => { + const visible = input.checked; + this._optionalContentConfig.setVisibility(groupId, visible); + const cached = this._optionalContentVisibility.get(groupId); + if (cached) { + cached.visible = visible; + } + this.eventBus.dispatch("optionalcontentconfig", { + source: this, + promise: Promise.resolve(this._optionalContentConfig) + }); + }; + element.onclick = evt => { + if (evt.target === input) { + setVisibility(); + return true; + } else if (evt.target !== element) { + return true; + } + input.checked = !input.checked; + setVisibility(); + return false; + }; + } + _setNestedName(element, { + name = null + }) { + if (typeof name === "string") { + element.textContent = this._normalizeTextContent(name); + return; + } + element.setAttribute("data-l10n-id", "pdfjs-additional-layers"); + element.style.fontStyle = "italic"; + this._l10n.translateOnce(element); + } + _addToggleButton(div, { + name = null + }) { + super._addToggleButton(div, name === null); + } + _toggleAllTreeItems() { + if (!this._optionalContentConfig) { + return; + } + super._toggleAllTreeItems(); + } + render({ + optionalContentConfig, + pdfDocument + }) { + if (this._optionalContentConfig) { + this.reset(); + } + this._optionalContentConfig = optionalContentConfig || null; + this._pdfDocument = pdfDocument || null; + const groups = optionalContentConfig?.getOrder(); + if (!groups) { + this._dispatchEvent(0); + return; + } + this._optionalContentVisibility = new Map(); + const fragment = document.createDocumentFragment(), + queue = [{ + parent: fragment, + groups + }]; + let layersCount = 0, + hasAnyNesting = false; + while (queue.length > 0) { + const levelData = queue.shift(); + for (const groupId of levelData.groups) { + const div = document.createElement("div"); + div.className = "treeItem"; + const element = document.createElement("a"); + div.append(element); + if (typeof groupId === "object") { + hasAnyNesting = true; + this._addToggleButton(div, groupId); + this._setNestedName(element, groupId); + const itemsDiv = document.createElement("div"); + itemsDiv.className = "treeItems"; + div.append(itemsDiv); + queue.push({ + parent: itemsDiv, + groups: groupId.order + }); + } else { + const group = optionalContentConfig.getGroup(groupId); + const input = document.createElement("input"); + this._bindLink(element, { + groupId, + input + }); + input.type = "checkbox"; + input.checked = group.visible; + this._optionalContentVisibility.set(groupId, { + input, + visible: input.checked + }); + const label = document.createElement("label"); + label.textContent = this._normalizeTextContent(group.name); + label.append(input); + element.append(label); + layersCount++; + } + levelData.parent.append(div); + } + } + this._finishRendering(fragment, layersCount, hasAnyNesting); + } + async #updateLayers(promise = null) { + if (!this._optionalContentConfig) { + return; + } + const pdfDocument = this._pdfDocument; + const optionalContentConfig = await (promise || pdfDocument.getOptionalContentConfig({ + intent: "display" + })); + if (pdfDocument !== this._pdfDocument) { + return; + } + if (promise) { + for (const [groupId, cached] of this._optionalContentVisibility) { + const group = optionalContentConfig.getGroup(groupId); + if (group && cached.visible !== group.visible) { + cached.input.checked = cached.visible = !cached.visible; + } + } + return; + } + this.eventBus.dispatch("optionalcontentconfig", { + source: this, + promise: Promise.resolve(optionalContentConfig) + }); + this.render({ + optionalContentConfig, + pdfDocument: this._pdfDocument + }); + } +} + +;// ./web/pdf_outline_viewer.js + + +class PDFOutlineViewer extends BaseTreeViewer { + constructor(options) { + super(options); + this.linkService = options.linkService; + this.downloadManager = options.downloadManager; + this.eventBus._on("toggleoutlinetree", this._toggleAllTreeItems.bind(this)); + this.eventBus._on("currentoutlineitem", this._currentOutlineItem.bind(this)); + this.eventBus._on("pagechanging", evt => { + this._currentPageNumber = evt.pageNumber; + }); + this.eventBus._on("pagesloaded", evt => { + this._isPagesLoaded = !!evt.pagesCount; + this._currentOutlineItemCapability?.resolve(this._isPagesLoaded); + }); + this.eventBus._on("sidebarviewchanged", evt => { + this._sidebarView = evt.view; + }); + } + reset() { + super.reset(); + this._outline = null; + this._pageNumberToDestHashCapability = null; + this._currentPageNumber = 1; + this._isPagesLoaded = null; + this._currentOutlineItemCapability?.resolve(false); + this._currentOutlineItemCapability = null; + } + _dispatchEvent(outlineCount) { + this._currentOutlineItemCapability = Promise.withResolvers(); + if (outlineCount === 0 || this._pdfDocument?.loadingParams.disableAutoFetch) { + this._currentOutlineItemCapability.resolve(false); + } else if (this._isPagesLoaded !== null) { + this._currentOutlineItemCapability.resolve(this._isPagesLoaded); + } + this.eventBus.dispatch("outlineloaded", { + source: this, + outlineCount, + currentOutlineItemPromise: this._currentOutlineItemCapability.promise + }); + } + _bindLink(element, { + url, + newWindow, + action, + attachment, + dest, + setOCGState + }) { + const { + linkService + } = this; + if (url) { + linkService.addLinkAttributes(element, url, newWindow); + return; + } + if (action) { + element.href = linkService.getAnchorUrl(""); + element.onclick = () => { + linkService.executeNamedAction(action); + return false; + }; + return; + } + if (attachment) { + element.href = linkService.getAnchorUrl(""); + element.onclick = () => { + this.downloadManager.openOrDownloadData(attachment.content, attachment.filename); + return false; + }; + return; + } + if (setOCGState) { + element.href = linkService.getAnchorUrl(""); + element.onclick = () => { + linkService.executeSetOCGState(setOCGState); + return false; + }; + return; + } + element.href = linkService.getDestinationHash(dest); + element.onclick = evt => { + this._updateCurrentTreeItem(evt.target.parentNode); + if (dest) { + linkService.goToDestination(dest); + } + return false; + }; + } + _setStyles(element, { + bold, + italic + }) { + if (bold) { + element.style.fontWeight = "bold"; + } + if (italic) { + element.style.fontStyle = "italic"; + } + } + _addToggleButton(div, { + count, + items + }) { + let hidden = false; + if (count < 0) { + let totalCount = items.length; + if (totalCount > 0) { + const queue = [...items]; + while (queue.length > 0) { + const { + count: nestedCount, + items: nestedItems + } = queue.shift(); + if (nestedCount > 0 && nestedItems.length > 0) { + totalCount += nestedItems.length; + queue.push(...nestedItems); + } + } + } + if (Math.abs(count) === totalCount) { + hidden = true; + } + } + super._addToggleButton(div, hidden); + } + _toggleAllTreeItems() { + if (!this._outline) { + return; + } + super._toggleAllTreeItems(); + } + render({ + outline, + pdfDocument + }) { + if (this._outline) { + this.reset(); + } + this._outline = outline || null; + this._pdfDocument = pdfDocument || null; + if (!outline) { + this._dispatchEvent(0); + return; + } + const fragment = document.createDocumentFragment(); + const queue = [{ + parent: fragment, + items: outline + }]; + let outlineCount = 0, + hasAnyNesting = false; + while (queue.length > 0) { + const levelData = queue.shift(); + for (const item of levelData.items) { + const div = document.createElement("div"); + div.className = "treeItem"; + const element = document.createElement("a"); + this._bindLink(element, item); + this._setStyles(element, item); + element.textContent = this._normalizeTextContent(item.title); + div.append(element); + if (item.items.length > 0) { + hasAnyNesting = true; + this._addToggleButton(div, item); + const itemsDiv = document.createElement("div"); + itemsDiv.className = "treeItems"; + div.append(itemsDiv); + queue.push({ + parent: itemsDiv, + items: item.items + }); + } + levelData.parent.append(div); + outlineCount++; + } + } + this._finishRendering(fragment, outlineCount, hasAnyNesting); + } + async _currentOutlineItem() { + if (!this._isPagesLoaded) { + throw new Error("_currentOutlineItem: All pages have not been loaded."); + } + if (!this._outline || !this._pdfDocument) { + return; + } + const pageNumberToDestHash = await this._getPageNumberToDestHash(this._pdfDocument); + if (!pageNumberToDestHash) { + return; + } + this._updateCurrentTreeItem(null); + if (this._sidebarView !== SidebarView.OUTLINE) { + return; + } + for (let i = this._currentPageNumber; i > 0; i--) { + const destHash = pageNumberToDestHash.get(i); + if (!destHash) { + continue; + } + const linkElement = this.container.querySelector(`a[href="${destHash}"]`); + if (!linkElement) { + continue; + } + this._scrollToCurrentTreeItem(linkElement.parentNode); + break; + } + } + async _getPageNumberToDestHash(pdfDocument) { + if (this._pageNumberToDestHashCapability) { + return this._pageNumberToDestHashCapability.promise; + } + this._pageNumberToDestHashCapability = Promise.withResolvers(); + const pageNumberToDestHash = new Map(), + pageNumberNesting = new Map(); + const queue = [{ + nesting: 0, + items: this._outline + }]; + while (queue.length > 0) { + const levelData = queue.shift(), + currentNesting = levelData.nesting; + for (const { + dest, + items + } of levelData.items) { + let explicitDest, pageNumber; + if (typeof dest === "string") { + explicitDest = await pdfDocument.getDestination(dest); + if (pdfDocument !== this._pdfDocument) { + return null; + } + } else { + explicitDest = dest; + } + if (Array.isArray(explicitDest)) { + const [destRef] = explicitDest; + if (destRef && typeof destRef === "object") { + pageNumber = pdfDocument.cachedPageNumber(destRef); + } else if (Number.isInteger(destRef)) { + pageNumber = destRef + 1; + } + if (Number.isInteger(pageNumber) && (!pageNumberToDestHash.has(pageNumber) || currentNesting > pageNumberNesting.get(pageNumber))) { + const destHash = this.linkService.getDestinationHash(dest); + pageNumberToDestHash.set(pageNumber, destHash); + pageNumberNesting.set(pageNumber, currentNesting); + } + } + if (items.length > 0) { + queue.push({ + nesting: currentNesting + 1, + items + }); + } + } + } + this._pageNumberToDestHashCapability.resolve(pageNumberToDestHash.size > 0 ? pageNumberToDestHash : null); + return this._pageNumberToDestHashCapability.promise; + } +} + +;// ./web/pdf_presentation_mode.js + + +const DELAY_BEFORE_HIDING_CONTROLS = 3000; +const ACTIVE_SELECTOR = "pdfPresentationMode"; +const CONTROLS_SELECTOR = "pdfPresentationModeControls"; +const MOUSE_SCROLL_COOLDOWN_TIME = 50; +const PAGE_SWITCH_THRESHOLD = 0.1; +const SWIPE_MIN_DISTANCE_THRESHOLD = 50; +const SWIPE_ANGLE_THRESHOLD = Math.PI / 6; +class PDFPresentationMode { + #state = PresentationModeState.UNKNOWN; + #args = null; + #fullscreenChangeAbortController = null; + #windowAbortController = null; + constructor({ + container, + pdfViewer, + eventBus + }) { + this.container = container; + this.pdfViewer = pdfViewer; + this.eventBus = eventBus; + this.contextMenuOpen = false; + this.mouseScrollTimeStamp = 0; + this.mouseScrollDelta = 0; + this.touchSwipeState = null; + } + async request() { + const { + container, + pdfViewer + } = this; + if (this.active || !pdfViewer.pagesCount || !container.requestFullscreen) { + return false; + } + this.#addFullscreenChangeListeners(); + this.#notifyStateChange(PresentationModeState.CHANGING); + const promise = container.requestFullscreen(); + this.#args = { + pageNumber: pdfViewer.currentPageNumber, + scaleValue: pdfViewer.currentScaleValue, + scrollMode: pdfViewer.scrollMode, + spreadMode: null, + annotationEditorMode: null + }; + if (pdfViewer.spreadMode !== SpreadMode.NONE && !(pdfViewer.pageViewsReady && pdfViewer.hasEqualPageSizes)) { + console.warn("Ignoring Spread modes when entering PresentationMode, " + "since the document may contain varying page sizes."); + this.#args.spreadMode = pdfViewer.spreadMode; + } + if (pdfViewer.annotationEditorMode !== AnnotationEditorType.DISABLE) { + this.#args.annotationEditorMode = pdfViewer.annotationEditorMode; + } + try { + await promise; + pdfViewer.focus(); + return true; + } catch { + this.#removeFullscreenChangeListeners(); + this.#notifyStateChange(PresentationModeState.NORMAL); + } + return false; + } + get active() { + return this.#state === PresentationModeState.CHANGING || this.#state === PresentationModeState.FULLSCREEN; + } + #mouseWheel(evt) { + if (!this.active) { + return; + } + evt.preventDefault(); + const delta = normalizeWheelEventDelta(evt); + const currentTime = Date.now(); + const storedTime = this.mouseScrollTimeStamp; + if (currentTime > storedTime && currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) { + return; + } + if (this.mouseScrollDelta > 0 && delta < 0 || this.mouseScrollDelta < 0 && delta > 0) { + this.#resetMouseScrollState(); + } + this.mouseScrollDelta += delta; + if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) { + const totalDelta = this.mouseScrollDelta; + this.#resetMouseScrollState(); + const success = totalDelta > 0 ? this.pdfViewer.previousPage() : this.pdfViewer.nextPage(); + if (success) { + this.mouseScrollTimeStamp = currentTime; + } + } + } + #notifyStateChange(state) { + this.#state = state; + this.eventBus.dispatch("presentationmodechanged", { + source: this, + state + }); + } + #enter() { + this.#notifyStateChange(PresentationModeState.FULLSCREEN); + this.container.classList.add(ACTIVE_SELECTOR); + setTimeout(() => { + this.pdfViewer.scrollMode = ScrollMode.PAGE; + if (this.#args.spreadMode !== null) { + this.pdfViewer.spreadMode = SpreadMode.NONE; + } + this.pdfViewer.currentPageNumber = this.#args.pageNumber; + this.pdfViewer.currentScaleValue = "page-fit"; + if (this.#args.annotationEditorMode !== null) { + this.pdfViewer.annotationEditorMode = { + mode: AnnotationEditorType.NONE + }; + } + }, 0); + this.#addWindowListeners(); + this.#showControls(); + this.contextMenuOpen = false; + document.getSelection().empty(); + } + #exit() { + const pageNumber = this.pdfViewer.currentPageNumber; + this.container.classList.remove(ACTIVE_SELECTOR); + setTimeout(() => { + this.#removeFullscreenChangeListeners(); + this.#notifyStateChange(PresentationModeState.NORMAL); + this.pdfViewer.scrollMode = this.#args.scrollMode; + if (this.#args.spreadMode !== null) { + this.pdfViewer.spreadMode = this.#args.spreadMode; + } + this.pdfViewer.currentScaleValue = this.#args.scaleValue; + this.pdfViewer.currentPageNumber = pageNumber; + if (this.#args.annotationEditorMode !== null) { + this.pdfViewer.annotationEditorMode = { + mode: this.#args.annotationEditorMode + }; + } + this.#args = null; + }, 0); + this.#removeWindowListeners(); + this.#hideControls(); + this.#resetMouseScrollState(); + this.contextMenuOpen = false; + } + #mouseDown(evt) { + if (this.contextMenuOpen) { + this.contextMenuOpen = false; + evt.preventDefault(); + return; + } + if (evt.button !== 0) { + return; + } + if (evt.target.href && evt.target.parentNode?.hasAttribute("data-internal-link")) { + return; + } + evt.preventDefault(); + if (evt.shiftKey) { + this.pdfViewer.previousPage(); + } else { + this.pdfViewer.nextPage(); + } + } + #contextMenu() { + this.contextMenuOpen = true; + } + #showControls() { + if (this.controlsTimeout) { + clearTimeout(this.controlsTimeout); + } else { + this.container.classList.add(CONTROLS_SELECTOR); + } + this.controlsTimeout = setTimeout(() => { + this.container.classList.remove(CONTROLS_SELECTOR); + delete this.controlsTimeout; + }, DELAY_BEFORE_HIDING_CONTROLS); + } + #hideControls() { + if (!this.controlsTimeout) { + return; + } + clearTimeout(this.controlsTimeout); + this.container.classList.remove(CONTROLS_SELECTOR); + delete this.controlsTimeout; + } + #resetMouseScrollState() { + this.mouseScrollTimeStamp = 0; + this.mouseScrollDelta = 0; + } + #touchSwipe(evt) { + if (!this.active) { + return; + } + if (evt.touches.length > 1) { + this.touchSwipeState = null; + return; + } + switch (evt.type) { + case "touchstart": + this.touchSwipeState = { + startX: evt.touches[0].pageX, + startY: evt.touches[0].pageY, + endX: evt.touches[0].pageX, + endY: evt.touches[0].pageY + }; + break; + case "touchmove": + if (this.touchSwipeState === null) { + return; + } + this.touchSwipeState.endX = evt.touches[0].pageX; + this.touchSwipeState.endY = evt.touches[0].pageY; + evt.preventDefault(); + break; + case "touchend": + if (this.touchSwipeState === null) { + return; + } + let delta = 0; + const dx = this.touchSwipeState.endX - this.touchSwipeState.startX; + const dy = this.touchSwipeState.endY - this.touchSwipeState.startY; + const absAngle = Math.abs(Math.atan2(dy, dx)); + if (Math.abs(dx) > SWIPE_MIN_DISTANCE_THRESHOLD && (absAngle <= SWIPE_ANGLE_THRESHOLD || absAngle >= Math.PI - SWIPE_ANGLE_THRESHOLD)) { + delta = dx; + } else if (Math.abs(dy) > SWIPE_MIN_DISTANCE_THRESHOLD && Math.abs(absAngle - Math.PI / 2) <= SWIPE_ANGLE_THRESHOLD) { + delta = dy; + } + if (delta > 0) { + this.pdfViewer.previousPage(); + } else if (delta < 0) { + this.pdfViewer.nextPage(); + } + break; + } + } + #addWindowListeners() { + if (this.#windowAbortController) { + return; + } + this.#windowAbortController = new AbortController(); + const { + signal + } = this.#windowAbortController; + const touchSwipeBind = this.#touchSwipe.bind(this); + window.addEventListener("mousemove", this.#showControls.bind(this), { + signal + }); + window.addEventListener("mousedown", this.#mouseDown.bind(this), { + signal + }); + window.addEventListener("wheel", this.#mouseWheel.bind(this), { + passive: false, + signal + }); + window.addEventListener("keydown", this.#resetMouseScrollState.bind(this), { + signal + }); + window.addEventListener("contextmenu", this.#contextMenu.bind(this), { + signal + }); + window.addEventListener("touchstart", touchSwipeBind, { + signal + }); + window.addEventListener("touchmove", touchSwipeBind, { + signal + }); + window.addEventListener("touchend", touchSwipeBind, { + signal + }); + } + #removeWindowListeners() { + this.#windowAbortController?.abort(); + this.#windowAbortController = null; + } + #addFullscreenChangeListeners() { + if (this.#fullscreenChangeAbortController) { + return; + } + this.#fullscreenChangeAbortController = new AbortController(); + window.addEventListener("fullscreenchange", () => { + if (document.fullscreenElement) { + this.#enter(); + } else { + this.#exit(); + } + }, { + signal: this.#fullscreenChangeAbortController.signal + }); + } + #removeFullscreenChangeListeners() { + this.#fullscreenChangeAbortController?.abort(); + this.#fullscreenChangeAbortController = null; + } +} + +;// ./web/xfa_layer_builder.js + +class XfaLayerBuilder { + constructor({ + pdfPage, + annotationStorage = null, + linkService, + xfaHtml = null + }) { + this.pdfPage = pdfPage; + this.annotationStorage = annotationStorage; + this.linkService = linkService; + this.xfaHtml = xfaHtml; + this.div = null; + this._cancelled = false; + } + async render({ + viewport, + intent = "display" + }) { + if (intent === "print") { + const parameters = { + viewport: viewport.clone({ + dontFlip: true + }), + div: this.div, + xfaHtml: this.xfaHtml, + annotationStorage: this.annotationStorage, + linkService: this.linkService, + intent + }; + this.div = document.createElement("div"); + parameters.div = this.div; + return XfaLayer.render(parameters); + } + const xfaHtml = await this.pdfPage.getXfa(); + if (this._cancelled || !xfaHtml) { + return { + textDivs: [] + }; + } + const parameters = { + viewport: viewport.clone({ + dontFlip: true + }), + div: this.div, + xfaHtml, + annotationStorage: this.annotationStorage, + linkService: this.linkService, + intent + }; + if (this.div) { + return XfaLayer.update(parameters); + } + this.div = document.createElement("div"); + parameters.div = this.div; + return XfaLayer.render(parameters); + } + cancel() { + this._cancelled = true; + } + hide() { + if (!this.div) { + return; + } + this.div.hidden = true; + } +} + +;// ./web/print_utils.js + + + +function getXfaHtmlForPrinting(printContainer, pdfDocument) { + const xfaHtml = pdfDocument.allXfaHtml; + const linkService = new SimpleLinkService(); + const scale = Math.round(PixelsPerInch.PDF_TO_CSS_UNITS * 100) / 100; + for (const xfaPage of xfaHtml.children) { + const page = document.createElement("div"); + page.className = "xfaPrintedPage"; + printContainer.append(page); + const builder = new XfaLayerBuilder({ + pdfPage: null, + annotationStorage: pdfDocument.annotationStorage, + linkService, + xfaHtml: xfaPage + }); + const viewport = getXfaPageViewport(xfaPage, { + scale + }); + builder.render({ + viewport, + intent: "print" + }); + page.append(builder.div); + } +} + +;// ./web/firefox_print_service.js + + +function composePage(pdfDocument, pageNumber, size, printContainer, printResolution, optionalContentConfigPromise, printAnnotationStoragePromise) { + const canvas = document.createElement("canvas"); + const PRINT_UNITS = printResolution / PixelsPerInch.PDF; + canvas.width = Math.floor(size.width * PRINT_UNITS); + canvas.height = Math.floor(size.height * PRINT_UNITS); + const canvasWrapper = document.createElement("div"); + canvasWrapper.className = "printedPage"; + canvasWrapper.append(canvas); + printContainer.append(canvasWrapper); + let currentRenderTask = null; + canvas.mozPrintCallback = function (obj) { + const ctx = obj.context; + ctx.save(); + ctx.fillStyle = "rgb(255, 255, 255)"; + ctx.fillRect(0, 0, canvas.width, canvas.height); + ctx.restore(); + let thisRenderTask = null; + Promise.all([pdfDocument.getPage(pageNumber), printAnnotationStoragePromise]).then(function ([pdfPage, printAnnotationStorage]) { + if (currentRenderTask) { + currentRenderTask.cancel(); + currentRenderTask = null; + } + const renderContext = { + canvasContext: ctx, + canvas: null, + transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0], + viewport: pdfPage.getViewport({ + scale: 1, + rotation: size.rotation + }), + intent: "print", + annotationMode: AnnotationMode.ENABLE_STORAGE, + optionalContentConfigPromise, + printAnnotationStorage + }; + currentRenderTask = thisRenderTask = pdfPage.render(renderContext); + return thisRenderTask.promise; + }).then(function () { + if (currentRenderTask === thisRenderTask) { + currentRenderTask = null; + } + obj.done(); + }, function (reason) { + if (!(reason instanceof RenderingCancelledException)) { + console.error(reason); + } + if (currentRenderTask === thisRenderTask) { + currentRenderTask.cancel(); + currentRenderTask = null; + } + if ("abort" in obj) { + obj.abort(); + } else { + obj.done(); + } + }); + }; +} +class FirefoxPrintService { + constructor({ + pdfDocument, + pagesOverview, + printContainer, + printResolution, + printAnnotationStoragePromise = null + }) { + this.pdfDocument = pdfDocument; + this.pagesOverview = pagesOverview; + this.printContainer = printContainer; + this._printResolution = printResolution || 150; + this._optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({ + intent: "print" + }); + this._printAnnotationStoragePromise = printAnnotationStoragePromise || Promise.resolve(); + } + layout() { + const { + pdfDocument, + pagesOverview, + printContainer, + _printResolution, + _optionalContentConfigPromise, + _printAnnotationStoragePromise + } = this; + const body = document.querySelector("body"); + body.setAttribute("data-pdfjsprinting", true); + const { + width, + height + } = this.pagesOverview[0]; + const hasEqualPageSizes = this.pagesOverview.every(size => size.width === width && size.height === height); + if (!hasEqualPageSizes) { + console.warn("Not all pages have the same size. The printed result may be incorrect!"); + } + this.pageStyleSheet = document.createElement("style"); + this.pageStyleSheet.textContent = `@page { size: ${width}pt ${height}pt;}`; + body.append(this.pageStyleSheet); + if (pdfDocument.isPureXfa) { + getXfaHtmlForPrinting(printContainer, pdfDocument); + return; + } + for (let i = 0, ii = pagesOverview.length; i < ii; ++i) { + composePage(pdfDocument, i + 1, pagesOverview[i], printContainer, _printResolution, _optionalContentConfigPromise, _printAnnotationStoragePromise); + } + } + destroy() { + this.printContainer.textContent = ""; + const body = document.querySelector("body"); + body.removeAttribute("data-pdfjsprinting"); + if (this.pageStyleSheet) { + this.pageStyleSheet.remove(); + this.pageStyleSheet = null; + } + } +} +class PDFPrintServiceFactory { + static get supportsPrinting() { + const canvas = document.createElement("canvas"); + return shadow(this, "supportsPrinting", "mozPrintCallback" in canvas); + } + static createPrintService(params) { + return new FirefoxPrintService(params); + } +} + +;// ./web/pdf_rendering_queue.js + + +const CLEANUP_TIMEOUT = 30000; +class PDFRenderingQueue { + constructor() { + this.pdfViewer = null; + this.pdfThumbnailViewer = null; + this.onIdle = null; + this.highestPriorityPage = null; + this.idleTimeout = null; + this.printing = false; + this.isThumbnailViewEnabled = false; + } + setViewer(pdfViewer) { + this.pdfViewer = pdfViewer; + } + setThumbnailViewer(pdfThumbnailViewer) { + this.pdfThumbnailViewer = pdfThumbnailViewer; + } + isHighestPriority(view) { + return this.highestPriorityPage === view.renderingId; + } + renderHighestPriority(currentlyVisiblePages) { + if (this.idleTimeout) { + clearTimeout(this.idleTimeout); + this.idleTimeout = null; + } + if (this.pdfViewer.forceRendering(currentlyVisiblePages)) { + return; + } + if (this.isThumbnailViewEnabled && this.pdfThumbnailViewer?.forceRendering()) { + return; + } + if (this.printing) { + return; + } + if (this.onIdle) { + this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT); + } + } + getHighestPriority(visible, views, scrolledDown, preRenderExtra = false, ignoreDetailViews = false) { + const visibleViews = visible.views, + numVisible = visibleViews.length; + if (numVisible === 0) { + return null; + } + for (let i = 0; i < numVisible; i++) { + const view = visibleViews[i].view; + if (!this.isViewFinished(view)) { + return view; + } + } + if (!ignoreDetailViews) { + for (let i = 0; i < numVisible; i++) { + const { + detailView + } = visibleViews[i].view; + if (detailView && !this.isViewFinished(detailView)) { + return detailView; + } + } + } + const firstId = visible.first.id, + lastId = visible.last.id; + if (lastId - firstId + 1 > numVisible) { + const visibleIds = visible.ids; + for (let i = 1, ii = lastId - firstId; i < ii; i++) { + const holeId = scrolledDown ? firstId + i : lastId - i; + if (visibleIds.has(holeId)) { + continue; + } + const holeView = views[holeId - 1]; + if (!this.isViewFinished(holeView)) { + return holeView; + } + } + } + let preRenderIndex = scrolledDown ? lastId : firstId - 2; + let preRenderView = views[preRenderIndex]; + if (preRenderView && !this.isViewFinished(preRenderView)) { + return preRenderView; + } + if (preRenderExtra) { + preRenderIndex += scrolledDown ? 1 : -1; + preRenderView = views[preRenderIndex]; + if (preRenderView && !this.isViewFinished(preRenderView)) { + return preRenderView; + } + } + return null; + } + isViewFinished(view) { + return view.renderingState === RenderingStates.FINISHED; + } + renderView(view) { + switch (view.renderingState) { + case RenderingStates.FINISHED: + return false; + case RenderingStates.PAUSED: + this.highestPriorityPage = view.renderingId; + view.resume(); + break; + case RenderingStates.RUNNING: + this.highestPriorityPage = view.renderingId; + break; + case RenderingStates.INITIAL: + this.highestPriorityPage = view.renderingId; + view.draw().finally(() => { + this.renderHighestPriority(); + }).catch(reason => { + if (reason instanceof RenderingCancelledException) { + return; + } + console.error("renderView:", reason); + }); + break; + } + return true; + } +} + +;// ./web/pdf_scripting_manager.js + + +class PDFScriptingManager { + #closeCapability = null; + #destroyCapability = null; + #docProperties = null; + #eventAbortController = null; + #eventBus = null; + #externalServices = null; + #pdfDocument = null; + #pdfViewer = null; + #ready = false; + #scripting = null; + #willPrintCapability = null; + constructor({ + eventBus, + externalServices = null, + docProperties = null + }) { + this.#eventBus = eventBus; + this.#externalServices = externalServices; + this.#docProperties = docProperties; + } + setViewer(pdfViewer) { + this.#pdfViewer = pdfViewer; + } + async setDocument(pdfDocument) { + if (this.#pdfDocument) { + await this.#destroyScripting(); + } + this.#pdfDocument = pdfDocument; + if (!pdfDocument) { + return; + } + const [objects, calculationOrder, docActions] = await Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]); + if (!objects && !docActions) { + await this.#destroyScripting(); + return; + } + if (pdfDocument !== this.#pdfDocument) { + return; + } + try { + this.#scripting = this.#initScripting(); + } catch (error) { + console.error("setDocument:", error); + await this.#destroyScripting(); + return; + } + const eventBus = this.#eventBus; + this.#eventAbortController = new AbortController(); + const { + signal + } = this.#eventAbortController; + eventBus._on("updatefromsandbox", event => { + if (event?.source === window) { + this.#updateFromSandbox(event.detail); + } + }, { + signal + }); + eventBus._on("dispatcheventinsandbox", event => { + this.#scripting?.dispatchEventInSandbox(event.detail); + }, { + signal + }); + eventBus._on("pagechanging", ({ + pageNumber, + previous + }) => { + if (pageNumber === previous) { + return; + } + this.#dispatchPageClose(previous); + this.#dispatchPageOpen(pageNumber); + }, { + signal + }); + eventBus._on("pagerendered", ({ + pageNumber + }) => { + if (!this._pageOpenPending.has(pageNumber)) { + return; + } + if (pageNumber !== this.#pdfViewer.currentPageNumber) { + return; + } + this.#dispatchPageOpen(pageNumber); + }, { + signal + }); + eventBus._on("pagesdestroy", async () => { + await this.#dispatchPageClose(this.#pdfViewer.currentPageNumber); + await this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "WillClose" + }); + this.#closeCapability?.resolve(); + }, { + signal + }); + try { + const docProperties = await this.#docProperties(pdfDocument); + if (pdfDocument !== this.#pdfDocument) { + return; + } + await this.#scripting.createSandbox({ + objects, + calculationOrder, + appInfo: { + platform: navigator.platform, + language: navigator.language + }, + docInfo: { + ...docProperties, + actions: docActions + } + }); + eventBus.dispatch("sandboxcreated", { + source: this + }); + } catch (error) { + console.error("setDocument:", error); + await this.#destroyScripting(); + return; + } + await this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "Open" + }); + await this.#dispatchPageOpen(this.#pdfViewer.currentPageNumber, true); + Promise.resolve().then(() => { + if (pdfDocument === this.#pdfDocument) { + this.#ready = true; + } + }); + } + async dispatchWillSave() { + return this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "WillSave" + }); + } + async dispatchDidSave() { + return this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "DidSave" + }); + } + async dispatchWillPrint() { + if (!this.#scripting) { + return; + } + await this.#willPrintCapability?.promise; + this.#willPrintCapability = Promise.withResolvers(); + try { + await this.#scripting.dispatchEventInSandbox({ + id: "doc", + name: "WillPrint" + }); + } catch (ex) { + this.#willPrintCapability.resolve(); + this.#willPrintCapability = null; + throw ex; + } + await this.#willPrintCapability.promise; + } + async dispatchDidPrint() { + return this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "DidPrint" + }); + } + get destroyPromise() { + return this.#destroyCapability?.promise || null; + } + get ready() { + return this.#ready; + } + get _pageOpenPending() { + return shadow(this, "_pageOpenPending", new Set()); + } + get _visitedPages() { + return shadow(this, "_visitedPages", new Map()); + } + async #updateFromSandbox(detail) { + const pdfViewer = this.#pdfViewer; + const isInPresentationMode = pdfViewer.isInPresentationMode || pdfViewer.isChangingPresentationMode; + const { + id, + siblings, + command, + value + } = detail; + if (!id) { + switch (command) { + case "clear": + console.clear(); + break; + case "error": + console.error(value); + break; + case "layout": + if (!isInPresentationMode) { + const modes = apiPageLayoutToViewerModes(value); + pdfViewer.spreadMode = modes.spreadMode; + } + break; + case "page-num": + pdfViewer.currentPageNumber = value + 1; + break; + case "print": + await pdfViewer.pagesPromise; + this.#eventBus.dispatch("print", { + source: this + }); + break; + case "println": + console.log(value); + break; + case "zoom": + if (!isInPresentationMode) { + pdfViewer.currentScaleValue = value; + } + break; + case "SaveAs": + this.#eventBus.dispatch("download", { + source: this + }); + break; + case "FirstPage": + pdfViewer.currentPageNumber = 1; + break; + case "LastPage": + pdfViewer.currentPageNumber = pdfViewer.pagesCount; + break; + case "NextPage": + pdfViewer.nextPage(); + break; + case "PrevPage": + pdfViewer.previousPage(); + break; + case "ZoomViewIn": + if (!isInPresentationMode) { + pdfViewer.increaseScale(); + } + break; + case "ZoomViewOut": + if (!isInPresentationMode) { + pdfViewer.decreaseScale(); + } + break; + case "WillPrintFinished": + this.#willPrintCapability?.resolve(); + this.#willPrintCapability = null; + break; + } + return; + } + if (isInPresentationMode && detail.focus) { + return; + } + delete detail.id; + delete detail.siblings; + const ids = siblings ? [id, ...siblings] : [id]; + for (const elementId of ids) { + const element = document.querySelector(`[data-element-id="${elementId}"]`); + if (element) { + element.dispatchEvent(new CustomEvent("updatefromsandbox", { + detail + })); + } else { + this.#pdfDocument?.annotationStorage.setValue(elementId, detail); + } + } + } + async #dispatchPageOpen(pageNumber, initialize = false) { + const pdfDocument = this.#pdfDocument, + visitedPages = this._visitedPages; + if (initialize) { + this.#closeCapability = Promise.withResolvers(); + } + if (!this.#closeCapability) { + return; + } + const pageView = this.#pdfViewer.getPageView(pageNumber - 1); + if (pageView?.renderingState !== RenderingStates.FINISHED) { + this._pageOpenPending.add(pageNumber); + return; + } + this._pageOpenPending.delete(pageNumber); + const actionsPromise = (async () => { + const actions = await (!visitedPages.has(pageNumber) ? pageView.pdfPage?.getJSActions() : null); + if (pdfDocument !== this.#pdfDocument) { + return; + } + await this.#scripting?.dispatchEventInSandbox({ + id: "page", + name: "PageOpen", + pageNumber, + actions + }); + })(); + visitedPages.set(pageNumber, actionsPromise); + } + async #dispatchPageClose(pageNumber) { + const pdfDocument = this.#pdfDocument, + visitedPages = this._visitedPages; + if (!this.#closeCapability) { + return; + } + if (this._pageOpenPending.has(pageNumber)) { + return; + } + const actionsPromise = visitedPages.get(pageNumber); + if (!actionsPromise) { + return; + } + visitedPages.set(pageNumber, null); + await actionsPromise; + if (pdfDocument !== this.#pdfDocument) { + return; + } + await this.#scripting?.dispatchEventInSandbox({ + id: "page", + name: "PageClose", + pageNumber + }); + } + #initScripting() { + this.#destroyCapability = Promise.withResolvers(); + if (this.#scripting) { + throw new Error("#initScripting: Scripting already exists."); + } + return this.#externalServices.createScripting(); + } + async #destroyScripting() { + if (!this.#scripting) { + this.#pdfDocument = null; + this.#destroyCapability?.resolve(); + return; + } + if (this.#closeCapability) { + await Promise.race([this.#closeCapability.promise, new Promise(resolve => { + setTimeout(resolve, 1000); + })]).catch(() => {}); + this.#closeCapability = null; + } + this.#pdfDocument = null; + try { + await this.#scripting.destroySandbox(); + } catch {} + this.#willPrintCapability?.reject(new Error("Scripting destroyed.")); + this.#willPrintCapability = null; + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + this._pageOpenPending.clear(); + this._visitedPages.clear(); + this.#scripting = null; + this.#ready = false; + this.#destroyCapability?.resolve(); + } +} + +;// ./web/pdf_sidebar.js + +const SIDEBAR_WIDTH_VAR = "--sidebar-width"; +const SIDEBAR_MIN_WIDTH = 200; +const SIDEBAR_RESIZING_CLASS = "sidebarResizing"; +const UI_NOTIFICATION_CLASS = "pdfSidebarNotification"; +class PDFSidebar { + #isRTL = false; + #mouseAC = null; + #outerContainerWidth = null; + #width = null; + constructor({ + elements, + eventBus, + l10n + }) { + this.isOpen = false; + this.active = SidebarView.THUMBS; + this.isInitialViewSet = false; + this.isInitialEventDispatched = false; + this.onToggled = null; + this.onUpdateThumbnails = null; + this.outerContainer = elements.outerContainer; + this.sidebarContainer = elements.sidebarContainer; + this.toggleButton = elements.toggleButton; + this.resizer = elements.resizer; + this.thumbnailButton = elements.thumbnailButton; + this.outlineButton = elements.outlineButton; + this.attachmentsButton = elements.attachmentsButton; + this.layersButton = elements.layersButton; + this.thumbnailView = elements.thumbnailView; + this.outlineView = elements.outlineView; + this.attachmentsView = elements.attachmentsView; + this.layersView = elements.layersView; + this._currentOutlineItemButton = elements.currentOutlineItemButton; + this.eventBus = eventBus; + this.#isRTL = l10n.getDirection() === "rtl"; + this.#addEventListeners(); + } + reset() { + this.isInitialViewSet = false; + this.isInitialEventDispatched = false; + this.#hideUINotification(true); + this.switchView(SidebarView.THUMBS); + this.outlineButton.disabled = false; + this.attachmentsButton.disabled = false; + this.layersButton.disabled = false; + this._currentOutlineItemButton.disabled = true; + } + get visibleView() { + return this.isOpen ? this.active : SidebarView.NONE; + } + setInitialView(view = SidebarView.NONE) { + if (this.isInitialViewSet) { + return; + } + this.isInitialViewSet = true; + if (view === SidebarView.NONE || view === SidebarView.UNKNOWN) { + this.#dispatchEvent(); + return; + } + this.switchView(view, true); + if (!this.isInitialEventDispatched) { + this.#dispatchEvent(); + } + } + switchView(view, forceOpen = false) { + const isViewChanged = view !== this.active; + let forceRendering = false; + switch (view) { + case SidebarView.NONE: + if (this.isOpen) { + this.close(); + } + return; + case SidebarView.THUMBS: + if (this.isOpen && isViewChanged) { + forceRendering = true; + } + break; + case SidebarView.OUTLINE: + if (this.outlineButton.disabled) { + return; + } + break; + case SidebarView.ATTACHMENTS: + if (this.attachmentsButton.disabled) { + return; + } + break; + case SidebarView.LAYERS: + if (this.layersButton.disabled) { + return; + } + break; + default: + console.error(`PDFSidebar.switchView: "${view}" is not a valid view.`); + return; + } + this.active = view; + toggleCheckedBtn(this.thumbnailButton, view === SidebarView.THUMBS, this.thumbnailView); + toggleCheckedBtn(this.outlineButton, view === SidebarView.OUTLINE, this.outlineView); + toggleCheckedBtn(this.attachmentsButton, view === SidebarView.ATTACHMENTS, this.attachmentsView); + toggleCheckedBtn(this.layersButton, view === SidebarView.LAYERS, this.layersView); + if (forceOpen && !this.isOpen) { + this.open(); + return; + } + if (forceRendering) { + this.onUpdateThumbnails(); + this.onToggled(); + } + if (isViewChanged) { + this.#dispatchEvent(); + } + } + open() { + if (this.isOpen) { + return; + } + this.isOpen = true; + toggleExpandedBtn(this.toggleButton, true); + this.outerContainer.classList.add("sidebarMoving", "sidebarOpen"); + if (this.active === SidebarView.THUMBS) { + this.onUpdateThumbnails(); + } + this.onToggled(); + this.#dispatchEvent(); + this.#hideUINotification(); + } + close(evt = null) { + if (!this.isOpen) { + return; + } + this.isOpen = false; + toggleExpandedBtn(this.toggleButton, false); + this.outerContainer.classList.add("sidebarMoving"); + this.outerContainer.classList.remove("sidebarOpen"); + this.onToggled(); + this.#dispatchEvent(); + if (evt?.detail > 0) { + this.toggleButton.blur(); + } + } + toggle(evt = null) { + if (this.isOpen) { + this.close(evt); + } else { + this.open(); + } + } + #dispatchEvent() { + if (this.isInitialViewSet) { + this.isInitialEventDispatched ||= true; + } + this.eventBus.dispatch("sidebarviewchanged", { + source: this, + view: this.visibleView + }); + } + #showUINotification() { + this.toggleButton.setAttribute("data-l10n-id", "pdfjs-toggle-sidebar-notification-button"); + if (!this.isOpen) { + this.toggleButton.classList.add(UI_NOTIFICATION_CLASS); + } + } + #hideUINotification(reset = false) { + if (this.isOpen || reset) { + this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS); + } + if (reset) { + this.toggleButton.setAttribute("data-l10n-id", "pdfjs-toggle-sidebar-button"); + } + } + #addEventListeners() { + const { + eventBus, + outerContainer + } = this; + this.sidebarContainer.addEventListener("transitionend", evt => { + if (evt.target === this.sidebarContainer) { + outerContainer.classList.remove("sidebarMoving"); + eventBus.dispatch("resize", { + source: this + }); + } + }); + this.toggleButton.addEventListener("click", evt => { + this.toggle(evt); + }); + this.thumbnailButton.addEventListener("click", () => { + this.switchView(SidebarView.THUMBS); + }); + this.outlineButton.addEventListener("click", () => { + this.switchView(SidebarView.OUTLINE); + }); + this.outlineButton.addEventListener("dblclick", () => { + eventBus.dispatch("toggleoutlinetree", { + source: this + }); + }); + this.attachmentsButton.addEventListener("click", () => { + this.switchView(SidebarView.ATTACHMENTS); + }); + this.layersButton.addEventListener("click", () => { + this.switchView(SidebarView.LAYERS); + }); + this.layersButton.addEventListener("dblclick", () => { + eventBus.dispatch("resetlayers", { + source: this + }); + }); + this._currentOutlineItemButton.addEventListener("click", () => { + eventBus.dispatch("currentoutlineitem", { + source: this + }); + }); + const onTreeLoaded = (count, button, view) => { + button.disabled = !count; + if (count) { + this.#showUINotification(); + } else if (this.active === view) { + this.switchView(SidebarView.THUMBS); + } + }; + eventBus._on("outlineloaded", evt => { + onTreeLoaded(evt.outlineCount, this.outlineButton, SidebarView.OUTLINE); + evt.currentOutlineItemPromise.then(enabled => { + if (!this.isInitialViewSet) { + return; + } + this._currentOutlineItemButton.disabled = !enabled; + }); + }); + eventBus._on("attachmentsloaded", evt => { + onTreeLoaded(evt.attachmentsCount, this.attachmentsButton, SidebarView.ATTACHMENTS); + }); + eventBus._on("layersloaded", evt => { + onTreeLoaded(evt.layersCount, this.layersButton, SidebarView.LAYERS); + }); + eventBus._on("presentationmodechanged", evt => { + if (evt.state === PresentationModeState.NORMAL && this.visibleView === SidebarView.THUMBS) { + this.onUpdateThumbnails(); + } + }); + this.resizer.addEventListener("mousedown", evt => { + if (evt.button !== 0) { + return; + } + outerContainer.classList.add(SIDEBAR_RESIZING_CLASS); + this.#mouseAC = new AbortController(); + const opts = { + signal: this.#mouseAC.signal + }; + window.addEventListener("mousemove", this.#mouseMove.bind(this), opts); + window.addEventListener("mouseup", this.#mouseUp.bind(this), opts); + window.addEventListener("blur", this.#mouseUp.bind(this), opts); + }); + eventBus._on("resize", evt => { + if (evt.source !== window) { + return; + } + this.#outerContainerWidth = null; + if (!this.#width) { + return; + } + if (!this.isOpen) { + this.#updateWidth(this.#width); + return; + } + outerContainer.classList.add(SIDEBAR_RESIZING_CLASS); + const updated = this.#updateWidth(this.#width); + Promise.resolve().then(() => { + outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS); + if (updated) { + eventBus.dispatch("resize", { + source: this + }); + } + }); + }); + } + get outerContainerWidth() { + return this.#outerContainerWidth ||= this.outerContainer.clientWidth; + } + #updateWidth(width = 0) { + const maxWidth = Math.floor(this.outerContainerWidth / 2); + if (width > maxWidth) { + width = maxWidth; + } + if (width < SIDEBAR_MIN_WIDTH) { + width = SIDEBAR_MIN_WIDTH; + } + if (width === this.#width) { + return false; + } + this.#width = width; + docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`); + return true; + } + #mouseMove(evt) { + let width = evt.clientX; + if (this.#isRTL) { + width = this.outerContainerWidth - width; + } + this.#updateWidth(width); + } + #mouseUp(evt) { + this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS); + this.eventBus.dispatch("resize", { + source: this + }); + this.#mouseAC?.abort(); + this.#mouseAC = null; + } +} + +;// ./web/pdf_text_extractor.js +class PdfTextExtractor { + #pdfViewer; + #externalServices; + #textPromise; + #pendingRequests = new Set(); + constructor(externalServices) { + this.#externalServices = externalServices; + window.addEventListener("requestTextContent", ({ + detail + }) => { + this.extractTextContent(detail.requestId); + }); + } + setViewer(pdfViewer) { + this.#pdfViewer = pdfViewer; + if (this.#pdfViewer && this.#pendingRequests.size) { + for (const pendingRequest of this.#pendingRequests) { + this.extractTextContent(pendingRequest); + } + this.#pendingRequests.clear(); + } + } + async extractTextContent(requestId) { + if (!this.#pdfViewer) { + this.#pendingRequests.add(requestId); + return; + } + if (!this.#textPromise) { + const textPromise = this.#textPromise = this.#pdfViewer.getAllText(); + textPromise.then(() => { + setTimeout(() => { + if (this.#textPromise === textPromise) { + this.#textPromise = null; + } + }, 5000); + }); + } + this.#externalServices.reportText({ + text: await this.#textPromise, + requestId + }); + } +} + +;// ./web/pdf_thumbnail_view.js + + + +const DRAW_UPSCALE_FACTOR = 2; +const MAX_NUM_SCALING_STEPS = 3; +const THUMBNAIL_WIDTH = 98; +function zeroCanvas(c) { + c.width = 0; + c.height = 0; +} +class TempImageFactory { + static #tempCanvas = null; + static getCanvas(width, height) { + const tempCanvas = this.#tempCanvas ||= document.createElement("canvas"); + tempCanvas.width = width; + tempCanvas.height = height; + const ctx = tempCanvas.getContext("2d", { + alpha: false + }); + ctx.save(); + ctx.fillStyle = "rgb(255, 255, 255)"; + ctx.fillRect(0, 0, width, height); + ctx.restore(); + return [tempCanvas, tempCanvas.getContext("2d")]; + } + static destroyCanvas() { + if (this.#tempCanvas) { + zeroCanvas(this.#tempCanvas); + } + this.#tempCanvas = null; + } +} +class PDFThumbnailView { + constructor({ + container, + eventBus, + id, + defaultViewport, + optionalContentConfigPromise, + linkService, + renderingQueue, + maxCanvasPixels, + maxCanvasDim, + pageColors + }) { + this.id = id; + this.renderingId = "thumbnail" + id; + this.pageLabel = null; + this.pdfPage = null; + this.rotation = 0; + this.viewport = defaultViewport; + this.pdfPageRotate = defaultViewport.rotation; + this._optionalContentConfigPromise = optionalContentConfigPromise || null; + this.maxCanvasPixels = maxCanvasPixels ?? AppOptions.get("maxCanvasPixels"); + this.maxCanvasDim = maxCanvasDim || AppOptions.get("maxCanvasDim"); + this.pageColors = pageColors || null; + this.eventBus = eventBus; + this.linkService = linkService; + this.renderingQueue = renderingQueue; + this.renderTask = null; + this.renderingState = RenderingStates.INITIAL; + this.resume = null; + const anchor = document.createElement("a"); + anchor.href = linkService.getAnchorUrl("#page=" + id); + anchor.setAttribute("data-l10n-id", "pdfjs-thumb-page-title"); + anchor.setAttribute("data-l10n-args", this.#pageL10nArgs); + anchor.onclick = function () { + linkService.goToPage(id); + return false; + }; + this.anchor = anchor; + const div = document.createElement("div"); + div.className = "thumbnail"; + div.setAttribute("data-page-number", this.id); + this.div = div; + this.#updateDims(); + const img = document.createElement("div"); + img.className = "thumbnailImage"; + this._placeholderImg = img; + div.append(img); + anchor.append(div); + container.append(anchor); + } + #updateDims() { + const { + width, + height + } = this.viewport; + const ratio = width / height; + this.canvasWidth = THUMBNAIL_WIDTH; + this.canvasHeight = this.canvasWidth / ratio | 0; + this.scale = this.canvasWidth / width; + const { + style + } = this.div; + style.setProperty("--thumbnail-width", `${this.canvasWidth}px`); + style.setProperty("--thumbnail-height", `${this.canvasHeight}px`); + } + setPdfPage(pdfPage) { + this.pdfPage = pdfPage; + this.pdfPageRotate = pdfPage.rotate; + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = pdfPage.getViewport({ + scale: 1, + rotation: totalRotation + }); + this.reset(); + } + reset() { + this.cancelRendering(); + this.renderingState = RenderingStates.INITIAL; + this.div.removeAttribute("data-loaded"); + this.image?.replaceWith(this._placeholderImg); + this.#updateDims(); + if (this.image) { + this.image.removeAttribute("src"); + delete this.image; + } + } + update({ + rotation = null + }) { + if (typeof rotation === "number") { + this.rotation = rotation; + } + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = this.viewport.clone({ + scale: 1, + rotation: totalRotation + }); + this.reset(); + } + cancelRendering() { + if (this.renderTask) { + this.renderTask.cancel(); + this.renderTask = null; + } + this.resume = null; + } + #getPageDrawContext(upscaleFactor = 1) { + const canvas = document.createElement("canvas"); + const outputScale = new OutputScale(); + const width = upscaleFactor * this.canvasWidth, + height = upscaleFactor * this.canvasHeight; + outputScale.limitCanvas(width, height, this.maxCanvasPixels, this.maxCanvasDim); + canvas.width = width * outputScale.sx | 0; + canvas.height = height * outputScale.sy | 0; + const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null; + return { + canvas, + transform + }; + } + #convertCanvasToImage(canvas) { + if (this.renderingState !== RenderingStates.FINISHED) { + throw new Error("#convertCanvasToImage: Rendering has not finished."); + } + const reducedCanvas = this.#reduceImage(canvas); + const image = document.createElement("img"); + image.className = "thumbnailImage"; + image.setAttribute("data-l10n-id", "pdfjs-thumb-page-canvas"); + image.setAttribute("data-l10n-args", this.#pageL10nArgs); + image.src = reducedCanvas.toDataURL(); + this.image = image; + this.div.setAttribute("data-loaded", true); + this._placeholderImg.replaceWith(image); + zeroCanvas(reducedCanvas); + } + async draw() { + if (this.renderingState !== RenderingStates.INITIAL) { + console.error("Must be in new state before drawing"); + return; + } + const { + pageColors, + pdfPage + } = this; + if (!pdfPage) { + this.renderingState = RenderingStates.FINISHED; + throw new Error("pdfPage is not loaded"); + } + this.renderingState = RenderingStates.RUNNING; + const { + canvas, + transform + } = this.#getPageDrawContext(DRAW_UPSCALE_FACTOR); + const drawViewport = this.viewport.clone({ + scale: DRAW_UPSCALE_FACTOR * this.scale + }); + const renderContinueCallback = cont => { + if (!this.renderingQueue.isHighestPriority(this)) { + this.renderingState = RenderingStates.PAUSED; + this.resume = () => { + this.renderingState = RenderingStates.RUNNING; + cont(); + }; + return; + } + cont(); + }; + const renderContext = { + canvas, + transform, + viewport: drawViewport, + optionalContentConfigPromise: this._optionalContentConfigPromise, + pageColors + }; + const renderTask = this.renderTask = pdfPage.render(renderContext); + renderTask.onContinue = renderContinueCallback; + let error = null; + try { + await renderTask.promise; + } catch (e) { + if (e instanceof RenderingCancelledException) { + zeroCanvas(canvas); + return; + } + error = e; + } finally { + if (renderTask === this.renderTask) { + this.renderTask = null; + } + } + this.renderingState = RenderingStates.FINISHED; + this.#convertCanvasToImage(canvas); + zeroCanvas(canvas); + this.eventBus.dispatch("thumbnailrendered", { + source: this, + pageNumber: this.id, + pdfPage + }); + if (error) { + throw error; + } + } + setImage(pageView) { + if (this.renderingState !== RenderingStates.INITIAL) { + return; + } + const { + thumbnailCanvas: canvas, + pdfPage, + scale + } = pageView; + if (!canvas) { + return; + } + if (!this.pdfPage) { + this.setPdfPage(pdfPage); + } + if (scale < this.scale) { + return; + } + this.renderingState = RenderingStates.FINISHED; + this.#convertCanvasToImage(canvas); + } + #getReducedImageDims(canvas) { + const width = canvas.width << MAX_NUM_SCALING_STEPS, + height = canvas.height << MAX_NUM_SCALING_STEPS; + const outputScale = new OutputScale(); + outputScale.sx = outputScale.sy = 1; + outputScale.limitCanvas(width, height, this.maxCanvasPixels, this.maxCanvasDim); + return [width * outputScale.sx | 0, height * outputScale.sy | 0]; + } + #reduceImage(img) { + const { + canvas + } = this.#getPageDrawContext(1); + const ctx = canvas.getContext("2d", { + alpha: false, + willReadFrequently: false + }); + if (img.width <= 2 * canvas.width) { + ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height); + return canvas; + } + let [reducedWidth, reducedHeight] = this.#getReducedImageDims(canvas); + const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(reducedWidth, reducedHeight); + while (reducedWidth > img.width || reducedHeight > img.height) { + reducedWidth >>= 1; + reducedHeight >>= 1; + } + reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, 0, 0, reducedWidth, reducedHeight); + while (reducedWidth > 2 * canvas.width) { + reducedImageCtx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, reducedWidth >> 1, reducedHeight >> 1); + reducedWidth >>= 1; + reducedHeight >>= 1; + } + ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height); + return canvas; + } + get #pageL10nArgs() { + return JSON.stringify({ + page: this.pageLabel ?? this.id + }); + } + setPageLabel(label) { + this.pageLabel = typeof label === "string" ? label : null; + this.anchor.setAttribute("data-l10n-args", this.#pageL10nArgs); + if (this.renderingState !== RenderingStates.FINISHED) { + return; + } + this.image?.setAttribute("data-l10n-args", this.#pageL10nArgs); + } +} + +;// ./web/pdf_thumbnail_viewer.js + + +const THUMBNAIL_SCROLL_MARGIN = -19; +const THUMBNAIL_SELECTED_CLASS = "selected"; +class PDFThumbnailViewer { + constructor({ + container, + eventBus, + linkService, + renderingQueue, + maxCanvasPixels, + maxCanvasDim, + pageColors, + abortSignal, + enableHWA + }) { + this.container = container; + this.eventBus = eventBus; + this.linkService = linkService; + this.renderingQueue = renderingQueue; + this.maxCanvasPixels = maxCanvasPixels; + this.maxCanvasDim = maxCanvasDim; + this.pageColors = pageColors || null; + this.enableHWA = enableHWA || false; + this.scroll = watchScroll(this.container, this.#scrollUpdated.bind(this), abortSignal); + this.#resetView(); + } + #scrollUpdated() { + this.renderingQueue.renderHighestPriority(); + } + getThumbnail(index) { + return this._thumbnails[index]; + } + #getVisibleThumbs() { + return getVisibleElements({ + scrollEl: this.container, + views: this._thumbnails + }); + } + scrollThumbnailIntoView(pageNumber) { + if (!this.pdfDocument) { + return; + } + const thumbnailView = this._thumbnails[pageNumber - 1]; + if (!thumbnailView) { + console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.'); + return; + } + if (pageNumber !== this._currentPageNumber) { + const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1]; + prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS); + thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS); + } + const { + first, + last, + views + } = this.#getVisibleThumbs(); + if (views.length > 0) { + let shouldScroll = false; + if (pageNumber <= first.id || pageNumber >= last.id) { + shouldScroll = true; + } else { + for (const { + id, + percent + } of views) { + if (id !== pageNumber) { + continue; + } + shouldScroll = percent < 100; + break; + } + } + if (shouldScroll) { + scrollIntoView(thumbnailView.div, { + top: THUMBNAIL_SCROLL_MARGIN + }); + } + } + this._currentPageNumber = pageNumber; + } + get pagesRotation() { + return this._pagesRotation; + } + set pagesRotation(rotation) { + if (!isValidRotation(rotation)) { + throw new Error("Invalid thumbnails rotation angle."); + } + if (!this.pdfDocument) { + return; + } + if (this._pagesRotation === rotation) { + return; + } + this._pagesRotation = rotation; + const updateArgs = { + rotation + }; + for (const thumbnail of this._thumbnails) { + thumbnail.update(updateArgs); + } + } + cleanup() { + for (const thumbnail of this._thumbnails) { + if (thumbnail.renderingState !== RenderingStates.FINISHED) { + thumbnail.reset(); + } + } + TempImageFactory.destroyCanvas(); + } + #resetView() { + this._thumbnails = []; + this._currentPageNumber = 1; + this._pageLabels = null; + this._pagesRotation = 0; + this.container.textContent = ""; + } + setDocument(pdfDocument) { + if (this.pdfDocument) { + this.#cancelRendering(); + this.#resetView(); + } + this.pdfDocument = pdfDocument; + if (!pdfDocument) { + return; + } + const firstPagePromise = pdfDocument.getPage(1); + const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({ + intent: "display" + }); + firstPagePromise.then(firstPdfPage => { + const pagesCount = pdfDocument.numPages; + const viewport = firstPdfPage.getViewport({ + scale: 1 + }); + for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) { + const thumbnail = new PDFThumbnailView({ + container: this.container, + eventBus: this.eventBus, + id: pageNum, + defaultViewport: viewport.clone(), + optionalContentConfigPromise, + linkService: this.linkService, + renderingQueue: this.renderingQueue, + maxCanvasPixels: this.maxCanvasPixels, + maxCanvasDim: this.maxCanvasDim, + pageColors: this.pageColors, + enableHWA: this.enableHWA + }); + this._thumbnails.push(thumbnail); + } + this._thumbnails[0]?.setPdfPage(firstPdfPage); + const thumbnailView = this._thumbnails[this._currentPageNumber - 1]; + thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS); + }).catch(reason => { + console.error("Unable to initialize thumbnail viewer", reason); + }); + } + #cancelRendering() { + for (const thumbnail of this._thumbnails) { + thumbnail.cancelRendering(); + } + } + setPageLabels(labels) { + if (!this.pdfDocument) { + return; + } + if (!labels) { + this._pageLabels = null; + } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) { + this._pageLabels = null; + console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels."); + } else { + this._pageLabels = labels; + } + for (let i = 0, ii = this._thumbnails.length; i < ii; i++) { + this._thumbnails[i].setPageLabel(this._pageLabels?.[i] ?? null); + } + } + async #ensurePdfPageLoaded(thumbView) { + if (thumbView.pdfPage) { + return thumbView.pdfPage; + } + try { + const pdfPage = await this.pdfDocument.getPage(thumbView.id); + if (!thumbView.pdfPage) { + thumbView.setPdfPage(pdfPage); + } + return pdfPage; + } catch (reason) { + console.error("Unable to get page for thumb view", reason); + return null; + } + } + #getScrollAhead(visible) { + if (visible.first?.id === 1) { + return true; + } else if (visible.last?.id === this._thumbnails.length) { + return false; + } + return this.scroll.down; + } + forceRendering() { + const visibleThumbs = this.#getVisibleThumbs(); + const scrollAhead = this.#getScrollAhead(visibleThumbs); + const thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, scrollAhead, false, true); + if (thumbView) { + this.#ensurePdfPageLoaded(thumbView).then(() => { + this.renderingQueue.renderView(thumbView); + }); + return true; + } + return false; + } +} + +;// ./web/annotation_editor_layer_builder.js + + +class AnnotationEditorLayerBuilder { + #annotationLayer = null; + #drawLayer = null; + #onAppend = null; + #structTreeLayer = null; + #textLayer = null; + #uiManager; + constructor(options) { + this.pdfPage = options.pdfPage; + this.accessibilityManager = options.accessibilityManager; + this.l10n = options.l10n; + this.annotationEditorLayer = null; + this.div = null; + this._cancelled = false; + this.#uiManager = options.uiManager; + this.#annotationLayer = options.annotationLayer || null; + this.#textLayer = options.textLayer || null; + this.#drawLayer = options.drawLayer || null; + this.#onAppend = options.onAppend || null; + this.#structTreeLayer = options.structTreeLayer || null; + } + async render({ + viewport, + intent = "display" + }) { + if (intent !== "display") { + return; + } + if (this._cancelled) { + return; + } + const clonedViewport = viewport.clone({ + dontFlip: true + }); + if (this.div) { + this.annotationEditorLayer.update({ + viewport: clonedViewport + }); + this.show(); + return; + } + const div = this.div = document.createElement("div"); + div.className = "annotationEditorLayer"; + div.hidden = true; + div.dir = this.#uiManager.direction; + this.#onAppend?.(div); + this.annotationEditorLayer = new AnnotationEditorLayer({ + uiManager: this.#uiManager, + div, + structTreeLayer: this.#structTreeLayer, + accessibilityManager: this.accessibilityManager, + pageIndex: this.pdfPage.pageNumber - 1, + l10n: this.l10n, + viewport: clonedViewport, + annotationLayer: this.#annotationLayer, + textLayer: this.#textLayer, + drawLayer: this.#drawLayer + }); + const parameters = { + viewport: clonedViewport, + div, + annotations: null, + intent + }; + this.annotationEditorLayer.render(parameters); + this.show(); + } + cancel() { + this._cancelled = true; + if (!this.div) { + return; + } + this.annotationEditorLayer.destroy(); + } + hide() { + if (!this.div) { + return; + } + this.annotationEditorLayer.pause(true); + this.div.hidden = true; + } + show() { + if (!this.div || this.annotationEditorLayer.isInvisible) { + return; + } + this.div.hidden = false; + this.annotationEditorLayer.pause(false); + } +} + +;// ./web/annotation_layer_builder.js + + +class AnnotationLayerBuilder { + #annotations = null; + #commentManager = null; + #externalHide = false; + #onAppend = null; + #eventAbortController = null; + #linksInjected = false; + constructor({ + pdfPage, + linkService, + downloadManager, + annotationStorage = null, + imageResourcesPath = "", + renderForms = true, + enableComment = false, + commentManager = null, + enableScripting = false, + hasJSActionsPromise = null, + fieldObjectsPromise = null, + annotationCanvasMap = null, + accessibilityManager = null, + annotationEditorUIManager = null, + onAppend = null + }) { + this.pdfPage = pdfPage; + this.linkService = linkService; + this.downloadManager = downloadManager; + this.imageResourcesPath = imageResourcesPath; + this.renderForms = renderForms; + this.annotationStorage = annotationStorage; + this.enableComment = enableComment; + this.#commentManager = commentManager; + this.enableScripting = enableScripting; + this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false); + this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null); + this._annotationCanvasMap = annotationCanvasMap; + this._accessibilityManager = accessibilityManager; + this._annotationEditorUIManager = annotationEditorUIManager; + this.#onAppend = onAppend; + this.annotationLayer = null; + this.div = null; + this._cancelled = false; + this._eventBus = linkService.eventBus; + } + async render({ + viewport, + intent = "display", + structTreeLayer = null + }) { + if (this.div) { + if (this._cancelled || !this.annotationLayer) { + return; + } + this.annotationLayer.update({ + viewport: viewport.clone({ + dontFlip: true + }) + }); + return; + } + const [annotations, hasJSActions, fieldObjects] = await Promise.all([this.pdfPage.getAnnotations({ + intent + }), this._hasJSActionsPromise, this._fieldObjectsPromise]); + if (this._cancelled) { + return; + } + const div = this.div = document.createElement("div"); + div.className = "annotationLayer"; + this.#onAppend?.(div); + this.#initAnnotationLayer(viewport, structTreeLayer); + if (annotations.length === 0) { + this.#annotations = annotations; + setLayerDimensions(this.div, viewport); + return; + } + await this.annotationLayer.render({ + annotations, + imageResourcesPath: this.imageResourcesPath, + renderForms: this.renderForms, + downloadManager: this.downloadManager, + enableComment: this.enableComment, + enableScripting: this.enableScripting, + hasJSActions, + fieldObjects + }); + this.#annotations = annotations; + if (this.linkService.isInPresentationMode) { + this.#updatePresentationModeState(PresentationModeState.FULLSCREEN); + } + if (!this.#eventAbortController) { + this.#eventAbortController = new AbortController(); + this._eventBus?._on("presentationmodechanged", evt => { + this.#updatePresentationModeState(evt.state); + }, { + signal: this.#eventAbortController.signal + }); + } + } + #initAnnotationLayer(viewport, structTreeLayer) { + this.annotationLayer = new AnnotationLayer({ + div: this.div, + accessibilityManager: this._accessibilityManager, + annotationCanvasMap: this._annotationCanvasMap, + annotationEditorUIManager: this._annotationEditorUIManager, + annotationStorage: this.annotationStorage, + page: this.pdfPage, + viewport: viewport.clone({ + dontFlip: true + }), + structTreeLayer, + commentManager: this.#commentManager, + linkService: this.linkService + }); + } + cancel() { + this._cancelled = true; + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + } + hide(internal = false) { + this.#externalHide = !internal; + if (!this.div) { + return; + } + this.div.hidden = true; + } + hasEditableAnnotations() { + return !!this.annotationLayer?.hasEditableAnnotations(); + } + async injectLinkAnnotations(inferredLinks) { + if (this.#annotations === null) { + throw new Error("`render` method must be called before `injectLinkAnnotations`."); + } + if (this._cancelled || this.#linksInjected) { + return; + } + this.#linksInjected = true; + const newLinks = this.#annotations.length ? this.#checkInferredLinks(inferredLinks) : inferredLinks; + if (!newLinks.length) { + return; + } + await this.annotationLayer.addLinkAnnotations(newLinks); + if (!this.#externalHide) { + this.div.hidden = false; + } + } + #updatePresentationModeState(state) { + if (!this.div) { + return; + } + let disableFormElements = false; + switch (state) { + case PresentationModeState.FULLSCREEN: + disableFormElements = true; + break; + case PresentationModeState.NORMAL: + break; + default: + return; + } + for (const section of this.div.childNodes) { + if (section.hasAttribute("data-internal-link")) { + continue; + } + section.inert = disableFormElements; + } + } + #checkInferredLinks(inferredLinks) { + function annotationRects(annot) { + if (!annot.quadPoints) { + return [annot.rect]; + } + const rects = []; + for (let i = 2, ii = annot.quadPoints.length; i < ii; i += 8) { + const trX = annot.quadPoints[i]; + const trY = annot.quadPoints[i + 1]; + const blX = annot.quadPoints[i + 2]; + const blY = annot.quadPoints[i + 3]; + rects.push([blX, blY, trX, trY]); + } + return rects; + } + function intersectAnnotations(annot1, annot2) { + const intersections = []; + const annot1Rects = annotationRects(annot1); + const annot2Rects = annotationRects(annot2); + for (const rect1 of annot1Rects) { + for (const rect2 of annot2Rects) { + const intersection = Util.intersect(rect1, rect2); + if (intersection) { + intersections.push(intersection); + } + } + } + return intersections; + } + function areaRects(rects) { + let totalArea = 0; + for (const rect of rects) { + totalArea += Math.abs((rect[2] - rect[0]) * (rect[3] - rect[1])); + } + return totalArea; + } + return inferredLinks.filter(link => { + let linkAreaRects; + for (const annotation of this.#annotations) { + if (annotation.annotationType !== AnnotationType.LINK || !annotation.url) { + continue; + } + const intersections = intersectAnnotations(annotation, link); + if (intersections.length === 0) { + continue; + } + linkAreaRects ??= areaRects(annotationRects(link)); + if (areaRects(intersections) / linkAreaRects > 0.5) { + return false; + } + } + return true; + }); + } +} + +;// ./web/autolinker.js + + +function DOMRectToPDF({ + width, + height, + left, + top +}, pdfPageView) { + if (width === 0 || height === 0) { + return null; + } + const pageBox = pdfPageView.textLayer.div.getBoundingClientRect(); + const bottomLeft = pdfPageView.getPagePoint(left - pageBox.left, top - pageBox.top); + const topRight = pdfPageView.getPagePoint(left - pageBox.left + width, top - pageBox.top + height); + return Util.normalizeRect([bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]]); +} +function calculateLinkPosition(range, pdfPageView) { + const rangeRects = range.getClientRects(); + if (rangeRects.length === 1) { + return { + rect: DOMRectToPDF(rangeRects[0], pdfPageView) + }; + } + const rect = [Infinity, Infinity, -Infinity, -Infinity]; + const quadPoints = []; + let i = 0; + for (const domRect of rangeRects) { + const normalized = DOMRectToPDF(domRect, pdfPageView); + if (normalized === null) { + continue; + } + quadPoints[i] = quadPoints[i + 4] = normalized[0]; + quadPoints[i + 1] = quadPoints[i + 3] = normalized[3]; + quadPoints[i + 2] = quadPoints[i + 6] = normalized[2]; + quadPoints[i + 5] = quadPoints[i + 7] = normalized[1]; + Util.rectBoundingBox(...normalized, rect); + i += 8; + } + return { + quadPoints, + rect + }; +} +function textPosition(container, offset) { + let currentContainer = container; + do { + if (currentContainer.nodeType === Node.TEXT_NODE) { + const currentLength = currentContainer.textContent.length; + if (offset <= currentLength) { + return [currentContainer, offset]; + } + offset -= currentLength; + } else if (currentContainer.firstChild) { + currentContainer = currentContainer.firstChild; + continue; + } + while (!currentContainer.nextSibling && currentContainer !== container) { + currentContainer = currentContainer.parentNode; + } + if (currentContainer !== container) { + currentContainer = currentContainer.nextSibling; + } + } while (currentContainer !== container); + throw new Error("Offset is bigger than container's contents length."); +} +function createLinkAnnotation({ + url, + index, + length +}, pdfPageView, id) { + const highlighter = pdfPageView._textHighlighter; + const [{ + begin, + end + }] = highlighter._convertMatches([index], [length]); + const range = new Range(); + range.setStart(...textPosition(highlighter.textDivs[begin.divIdx], begin.offset)); + range.setEnd(...textPosition(highlighter.textDivs[end.divIdx], end.offset)); + return { + id: `inferred_link_${id}`, + unsafeUrl: url, + url, + annotationType: AnnotationType.LINK, + rotation: 0, + ...calculateLinkPosition(range, pdfPageView), + borderStyle: null + }; +} +class Autolinker { + static #index = 0; + static #regex; + static findLinks(text) { + this.#regex ??= /\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv; + const [normalizedText, diffs] = normalize(text, { + ignoreDashEOL: true + }); + const matches = normalizedText.matchAll(this.#regex); + const links = []; + for (const match of matches) { + const [url, emailDomain] = match; + let raw; + if (url.startsWith("www.") || url.startsWith("http://") || url.startsWith("https://")) { + raw = url; + } else if (URL.canParse(`http://${emailDomain}`)) { + raw = url.startsWith("mailto:") ? url : `mailto:${url}`; + } else { + continue; + } + const absoluteURL = createValidAbsoluteUrl(raw, null, { + addDefaultProtocol: true + }); + if (absoluteURL) { + const [index, length] = getOriginalIndex(diffs, match.index, url.length); + links.push({ + url: absoluteURL.href, + index, + length + }); + } + } + return links; + } + static processLinks(pdfPageView) { + return this.findLinks(pdfPageView._textHighlighter.textContentItemsStr.join("\n")).map(link => createLinkAnnotation(link, pdfPageView, this.#index++)); + } +} + +;// ./web/base_pdf_page_view.js + + +class BasePDFPageView { + #loadingId = null; + #minDurationToUpdateCanvas = 0; + #renderError = null; + #renderingState = RenderingStates.INITIAL; + #showCanvas = null; + #startTime = 0; + #tempCanvas = null; + canvas = null; + div = null; + enableOptimizedPartialRendering = false; + eventBus = null; + id = null; + pageColors = null; + recordedBBoxes = null; + renderingQueue = null; + renderTask = null; + resume = null; + constructor(options) { + this.eventBus = options.eventBus; + this.id = options.id; + this.pageColors = options.pageColors || null; + this.renderingQueue = options.renderingQueue; + this.enableOptimizedPartialRendering = options.enableOptimizedPartialRendering ?? false; + this.#minDurationToUpdateCanvas = options.minDurationToUpdateCanvas ?? 500; + } + get renderingState() { + return this.#renderingState; + } + set renderingState(state) { + if (state === this.#renderingState) { + return; + } + this.#renderingState = state; + if (this.#loadingId) { + clearTimeout(this.#loadingId); + this.#loadingId = null; + } + switch (state) { + case RenderingStates.PAUSED: + this.div.classList.remove("loading"); + this.#startTime = 0; + this.#showCanvas?.(false); + break; + case RenderingStates.RUNNING: + this.div.classList.add("loadingIcon"); + this.#loadingId = setTimeout(() => { + this.div.classList.add("loading"); + this.#loadingId = null; + }, 0); + this.#startTime = Date.now(); + break; + case RenderingStates.INITIAL: + case RenderingStates.FINISHED: + this.div.classList.remove("loadingIcon", "loading"); + this.#startTime = 0; + break; + } + } + _createCanvas(onShow, hideUntilComplete = false) { + const { + pageColors + } = this; + const hasHCM = !!(pageColors?.background && pageColors?.foreground); + const prevCanvas = this.canvas; + const updateOnFirstShow = !prevCanvas && !hasHCM && !hideUntilComplete; + let canvas = this.canvas = document.createElement("canvas"); + this.#showCanvas = isLastShow => { + if (updateOnFirstShow) { + let tempCanvas = this.#tempCanvas; + if (!isLastShow && this.#minDurationToUpdateCanvas > 0) { + if (Date.now() - this.#startTime < this.#minDurationToUpdateCanvas) { + return; + } + if (!tempCanvas) { + tempCanvas = this.#tempCanvas = canvas; + canvas = this.canvas = canvas.cloneNode(false); + onShow(canvas); + } + } + if (tempCanvas) { + const ctx = canvas.getContext("2d", { + alpha: false + }); + ctx.drawImage(tempCanvas, 0, 0); + if (isLastShow) { + this.#resetTempCanvas(); + } else { + this.#startTime = Date.now(); + } + return; + } + onShow(canvas); + this.#showCanvas = null; + return; + } + if (!isLastShow) { + return; + } + if (prevCanvas) { + prevCanvas.replaceWith(canvas); + prevCanvas.width = prevCanvas.height = 0; + } else { + onShow(canvas); + } + }; + return { + canvas, + prevCanvas + }; + } + #renderContinueCallback = cont => { + this.#showCanvas?.(false); + if (this.renderingQueue && !this.renderingQueue.isHighestPriority(this)) { + this.renderingState = RenderingStates.PAUSED; + this.resume = () => { + this.renderingState = RenderingStates.RUNNING; + cont(); + }; + return; + } + cont(); + }; + _resetCanvas() { + const { + canvas + } = this; + if (!canvas) { + return; + } + canvas.remove(); + canvas.width = canvas.height = 0; + this.canvas = null; + this.#resetTempCanvas(); + } + #resetTempCanvas() { + if (this.#tempCanvas) { + this.#tempCanvas.width = this.#tempCanvas.height = 0; + this.#tempCanvas = null; + } + } + async _drawCanvas(options, onCancel, onFinish) { + const renderTask = this.renderTask = this.pdfPage.render(options); + renderTask.onContinue = this.#renderContinueCallback; + renderTask.onError = error => { + if (error instanceof RenderingCancelledException) { + onCancel(); + this.#renderError = null; + } + }; + let error = null; + try { + await renderTask.promise; + this.#showCanvas?.(true); + } catch (e) { + if (e instanceof RenderingCancelledException) { + return; + } + error = e; + this.#showCanvas?.(true); + } finally { + this.#renderError = error; + if (renderTask === this.renderTask) { + this.renderTask = null; + if (this.enableOptimizedPartialRendering) { + this.recordedBBoxes ??= renderTask.recordedBBoxes; + } + } + } + this.renderingState = RenderingStates.FINISHED; + onFinish(renderTask); + if (error) { + throw error; + } + } + cancelRendering({ + cancelExtraDelay = 0 + } = {}) { + if (this.renderTask) { + this.renderTask.cancel(cancelExtraDelay); + this.renderTask = null; + } + this.resume = null; + } + dispatchPageRender() { + this.eventBus.dispatch("pagerender", { + source: this, + pageNumber: this.id + }); + } + dispatchPageRendered(cssTransform, isDetailView) { + this.eventBus.dispatch("pagerendered", { + source: this, + pageNumber: this.id, + cssTransform, + isDetailView, + timestamp: performance.now(), + error: this.#renderError + }); + } +} + +;// ./web/draw_layer_builder.js + +class DrawLayerBuilder { + #drawLayer = null; + constructor(options) { + this.pageIndex = options.pageIndex; + } + async render({ + intent = "display" + }) { + if (intent !== "display" || this.#drawLayer || this._cancelled) { + return; + } + this.#drawLayer = new DrawLayer({ + pageIndex: this.pageIndex + }); + } + cancel() { + this._cancelled = true; + if (!this.#drawLayer) { + return; + } + this.#drawLayer.destroy(); + this.#drawLayer = null; + } + setParent(parent) { + this.#drawLayer?.setParent(parent); + } + getDrawLayer() { + return this.#drawLayer; + } +} + +;// ./web/pdf_page_detail_view.js + + + +class PDFPageDetailView extends BasePDFPageView { + #detailArea = null; + renderingCancelled = false; + constructor({ + pageView + }) { + super(pageView); + this.pageView = pageView; + this.renderingId = "detail" + this.id; + this.div = pageView.div; + } + setPdfPage(pdfPage) { + this.pageView.setPdfPage(pdfPage); + } + get pdfPage() { + return this.pageView.pdfPage; + } + get renderingState() { + return super.renderingState; + } + set renderingState(value) { + this.renderingCancelled = false; + super.renderingState = value; + } + reset({ + keepCanvas = false + } = {}) { + const renderingCancelled = this.renderingCancelled || this.renderingState === RenderingStates.RUNNING || this.renderingState === RenderingStates.PAUSED; + this.cancelRendering(); + this.renderingState = RenderingStates.INITIAL; + this.renderingCancelled = renderingCancelled; + if (!keepCanvas) { + this._resetCanvas(); + } + } + #shouldRenderDifferentArea(visibleArea) { + if (!this.#detailArea) { + return true; + } + const minDetailX = this.#detailArea.minX; + const minDetailY = this.#detailArea.minY; + const maxDetailX = this.#detailArea.width + minDetailX; + const maxDetailY = this.#detailArea.height + minDetailY; + if (visibleArea.minX < minDetailX || visibleArea.minY < minDetailY || visibleArea.maxX > maxDetailX || visibleArea.maxY > maxDetailY) { + return true; + } + const { + width: maxWidth, + height: maxHeight, + scale + } = this.pageView.viewport; + if (this.#detailArea.scale !== scale) { + return true; + } + const paddingLeftSize = visibleArea.minX - minDetailX; + const paddingRightSize = maxDetailX - visibleArea.maxX; + const paddingTopSize = visibleArea.minY - minDetailY; + const paddingBottomSize = maxDetailY - visibleArea.maxY; + const MOVEMENT_THRESHOLD = 0.5; + const ratio = (1 + MOVEMENT_THRESHOLD) / MOVEMENT_THRESHOLD; + if (minDetailX > 0 && paddingRightSize / paddingLeftSize > ratio || maxDetailX < maxWidth && paddingLeftSize / paddingRightSize > ratio || minDetailY > 0 && paddingBottomSize / paddingTopSize > ratio || maxDetailY < maxHeight && paddingTopSize / paddingBottomSize > ratio) { + return true; + } + return false; + } + update({ + visibleArea = null, + underlyingViewUpdated = false + } = {}) { + if (underlyingViewUpdated) { + this.cancelRendering(); + this.renderingState = RenderingStates.INITIAL; + return; + } + if (!this.#shouldRenderDifferentArea(visibleArea)) { + return; + } + const { + viewport, + maxCanvasPixels, + capCanvasAreaFactor + } = this.pageView; + const visibleWidth = visibleArea.maxX - visibleArea.minX; + const visibleHeight = visibleArea.maxY - visibleArea.minY; + const visiblePixels = visibleWidth * visibleHeight * OutputScale.pixelRatio ** 2; + const maxDetailToVisibleLinearRatio = Math.sqrt(OutputScale.capPixels(maxCanvasPixels, capCanvasAreaFactor) / visiblePixels); + const maxOverflowScale = (maxDetailToVisibleLinearRatio - 1) / 2; + let overflowScale = Math.min(1, maxOverflowScale); + if (overflowScale < 0) { + overflowScale = 0; + } + const overflowWidth = visibleWidth * overflowScale; + const overflowHeight = visibleHeight * overflowScale; + const minX = Math.max(0, visibleArea.minX - overflowWidth); + const maxX = Math.min(viewport.width, visibleArea.maxX + overflowWidth); + const minY = Math.max(0, visibleArea.minY - overflowHeight); + const maxY = Math.min(viewport.height, visibleArea.maxY + overflowHeight); + const width = maxX - minX; + const height = maxY - minY; + this.#detailArea = { + minX, + minY, + width, + height, + scale: viewport.scale + }; + this.reset({ + keepCanvas: true + }); + } + _getRenderingContext(canvas, transform) { + const baseContext = this.pageView._getRenderingContext(canvas, transform, false); + const recordedBBoxes = this.pdfPage.recordedBBoxes; + if (!recordedBBoxes || !this.enableOptimizedPartialRendering) { + return baseContext; + } + const { + viewport: { + width: vWidth, + height: vHeight + } + } = this.pageView; + const { + width: aWidth, + height: aHeight, + minX: aMinX, + minY: aMinY + } = this.#detailArea; + const detailMinX = aMinX / vWidth; + const detailMinY = aMinY / vHeight; + const detailMaxX = (aMinX + aWidth) / vWidth; + const detailMaxY = (aMinY + aHeight) / vHeight; + return { + ...baseContext, + operationsFilter(index) { + if (recordedBBoxes.isEmpty(index)) { + return false; + } + return recordedBBoxes.minX(index) <= detailMaxX && recordedBBoxes.maxX(index) >= detailMinX && recordedBBoxes.minY(index) <= detailMaxY && recordedBBoxes.maxY(index) >= detailMinY; + } + }; + } + async draw() { + if (this.pageView.detailView !== this) { + return undefined; + } + const hideUntilComplete = this.pageView.renderingState === RenderingStates.FINISHED || this.renderingState === RenderingStates.FINISHED; + if (this.renderingState !== RenderingStates.INITIAL) { + console.error("Must be in new state before drawing"); + this.reset(); + } + const { + div, + pdfPage, + viewport + } = this.pageView; + if (!pdfPage) { + this.renderingState = RenderingStates.FINISHED; + throw new Error("pdfPage is not loaded"); + } + this.renderingState = RenderingStates.RUNNING; + const canvasWrapper = this.pageView._ensureCanvasWrapper(); + const { + canvas, + prevCanvas + } = this._createCanvas(newCanvas => { + if (canvasWrapper.firstElementChild?.tagName === "CANVAS") { + canvasWrapper.firstElementChild.after(newCanvas); + } else { + canvasWrapper.prepend(newCanvas); + } + }, hideUntilComplete); + canvas.ariaHidden = true; + if (this.enableOptimizedPartialRendering) { + canvas.className = "detailView"; + } + const { + width, + height + } = viewport; + const area = this.#detailArea; + const { + pixelRatio + } = OutputScale; + const transform = [pixelRatio, 0, 0, pixelRatio, -area.minX * pixelRatio, -area.minY * pixelRatio]; + canvas.width = area.width * pixelRatio; + canvas.height = area.height * pixelRatio; + const { + style + } = canvas; + style.width = `${area.width * 100 / width}%`; + style.height = `${area.height * 100 / height}%`; + style.top = `${area.minY * 100 / height}%`; + style.left = `${area.minX * 100 / width}%`; + const renderingPromise = this._drawCanvas(this._getRenderingContext(canvas, transform), () => { + this.canvas?.remove(); + this.canvas = prevCanvas; + }, () => { + this.dispatchPageRendered(false, true); + }); + div.setAttribute("data-loaded", true); + this.dispatchPageRender(); + return renderingPromise; + } +} + +;// ./web/struct_tree_layer_builder.js + + +const PDF_ROLE_TO_HTML_ROLE = { + Document: null, + DocumentFragment: null, + Part: "group", + Sect: "group", + Div: "group", + Aside: "note", + NonStruct: "none", + P: null, + H: "heading", + Title: null, + FENote: "note", + Sub: "group", + Lbl: null, + Span: null, + Em: null, + Strong: null, + Link: "link", + Annot: "note", + Form: "form", + Ruby: null, + RB: null, + RT: null, + RP: null, + Warichu: null, + WT: null, + WP: null, + L: "list", + LI: "listitem", + LBody: null, + Table: "table", + TR: "row", + TH: "columnheader", + TD: "cell", + THead: "columnheader", + TBody: null, + TFoot: null, + Caption: null, + Figure: "figure", + Formula: null, + Artifact: null +}; +const MathMLElements = new Set(["math", "merror", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics"]); +const MathMLNamespace = "http://www.w3.org/1998/Math/MathML"; +class MathMLSanitizer { + static get sanitizer() { + return shadow(this, "sanitizer", FeatureTest.isSanitizerSupported ? new Sanitizer({ + elements: [...MathMLElements].map(name => ({ + name, + namespace: MathMLNamespace + })), + replaceWithChildrenElements: [{ + name: "maction", + namespace: MathMLNamespace + }], + attributes: ["dir", "displaystyle", "mathbackground", "mathcolor", "mathsize", "scriptlevel", "encoding", "display", "linethickness", "intent", "arg", "form", "fence", "separator", "lspace", "rspace", "stretchy", "symmetric", "maxsize", "minsize", "largeop", "movablelimits", "width", "height", "depth", "voffset", "accent", "accentunder", "columnspan", "rowspan"], + comments: false + }) : null); + } +} +const HEADING_PATTERN = /^H(\d+)$/; +class StructTreeLayerBuilder { + #promise; + #treeDom = null; + #treePromise; + #elementAttributes = new Map(); + #rawDims; + #elementsToAddToTextLayer = null; + constructor(pdfPage, rawDims) { + this.#promise = pdfPage.getStructTree(); + this.#rawDims = rawDims; + } + async render() { + if (this.#treePromise) { + return this.#treePromise; + } + const { + promise, + resolve, + reject + } = Promise.withResolvers(); + this.#treePromise = promise; + try { + this.#treeDom = this.#walk(await this.#promise); + } catch (ex) { + reject(ex); + } + this.#promise = null; + this.#treeDom?.classList.add("structTree"); + resolve(this.#treeDom); + return promise; + } + async getAriaAttributes(annotationId) { + try { + await this.render(); + return this.#elementAttributes.get(annotationId); + } catch {} + return null; + } + hide() { + if (this.#treeDom && !this.#treeDom.hidden) { + this.#treeDom.hidden = true; + } + } + show() { + if (this.#treeDom?.hidden) { + this.#treeDom.hidden = false; + } + } + #setAttributes(structElement, htmlElement) { + const { + alt, + id, + lang + } = structElement; + if (alt !== undefined) { + let added = false; + const label = removeNullCharacters(alt); + for (const child of structElement.children) { + if (child.type === "annotation") { + let attrs = this.#elementAttributes.get(child.id); + if (!attrs) { + attrs = new Map(); + this.#elementAttributes.set(child.id, attrs); + } + attrs.set("aria-label", label); + added = true; + } + } + if (!added) { + htmlElement.setAttribute("aria-label", label); + } + } + if (id !== undefined) { + htmlElement.setAttribute("aria-owns", id); + } + if (lang !== undefined) { + htmlElement.setAttribute("lang", removeNullCharacters(lang, true)); + } + } + #addImageInTextLayer(node, element) { + const { + alt, + bbox, + children + } = node; + const child = children?.[0]; + if (!this.#rawDims || !alt || !bbox || child?.type !== "content") { + return false; + } + const { + id + } = child; + if (!id) { + return false; + } + element.setAttribute("aria-owns", id); + const img = document.createElement("span"); + (this.#elementsToAddToTextLayer ||= new Map()).set(id, img); + img.setAttribute("role", "img"); + img.setAttribute("aria-label", removeNullCharacters(alt)); + const { + pageHeight, + pageX, + pageY + } = this.#rawDims; + const calc = "calc(var(--total-scale-factor) *"; + const { + style + } = img; + style.width = `${calc}${bbox[2] - bbox[0]}px)`; + style.height = `${calc}${bbox[3] - bbox[1]}px)`; + style.left = `${calc}${bbox[0] - pageX}px)`; + style.top = `${calc}${pageHeight - bbox[3] + pageY}px)`; + return true; + } + addElementsToTextLayer() { + if (!this.#elementsToAddToTextLayer) { + return; + } + for (const [id, img] of this.#elementsToAddToTextLayer) { + document.getElementById(id)?.append(img); + } + this.#elementsToAddToTextLayer.clear(); + this.#elementsToAddToTextLayer = null; + } + #walk(node) { + if (!node) { + return null; + } + let element; + if ("role" in node) { + const { + role + } = node; + element = MathMLElements.has(role) ? document.createElementNS(MathMLNamespace, role) : document.createElement("span"); + const match = role.match(HEADING_PATTERN); + if (match) { + element.setAttribute("role", "heading"); + element.setAttribute("aria-level", match[1]); + } else if (PDF_ROLE_TO_HTML_ROLE[role]) { + element.setAttribute("role", PDF_ROLE_TO_HTML_ROLE[role]); + } + if (role === "Figure" && this.#addImageInTextLayer(node, element)) { + return element; + } + if (role === "Formula") { + if (node.mathML && MathMLSanitizer.sanitizer) { + element.setHTML(node.mathML, { + sanitizer: MathMLSanitizer.sanitizer + }); + } + if (!node.mathML && node.children.length === 1 && node.children[0].role !== "math") { + element = document.createElementNS(MathMLNamespace, "math"); + } + } + } + element ||= document.createElement("span"); + this.#setAttributes(node, element); + if (node.children) { + if (node.children.length === 1 && "id" in node.children[0]) { + this.#setAttributes(node.children[0], element); + } else { + for (const kid of node.children) { + element.append(this.#walk(kid)); + } + } + } + return element; + } +} + +;// ./web/text_accessibility.js + +class TextAccessibilityManager { + #enabled = false; + #textChildren = null; + #textNodes = new Map(); + #waitingElements = new Map(); + setTextMapping(textDivs) { + this.#textChildren = textDivs; + } + static #compareElementPositions(e1, e2) { + const rect1 = e1.getBoundingClientRect(); + const rect2 = e2.getBoundingClientRect(); + if (rect1.width === 0 && rect1.height === 0) { + return +1; + } + if (rect2.width === 0 && rect2.height === 0) { + return -1; + } + const top1 = rect1.y; + const bot1 = rect1.y + rect1.height; + const mid1 = rect1.y + rect1.height / 2; + const top2 = rect2.y; + const bot2 = rect2.y + rect2.height; + const mid2 = rect2.y + rect2.height / 2; + if (mid1 <= top2 && mid2 >= bot1) { + return -1; + } + if (mid2 <= top1 && mid1 >= bot2) { + return +1; + } + const centerX1 = rect1.x + rect1.width / 2; + const centerX2 = rect2.x + rect2.width / 2; + return centerX1 - centerX2; + } + enable() { + if (this.#enabled) { + throw new Error("TextAccessibilityManager is already enabled."); + } + if (!this.#textChildren) { + throw new Error("Text divs and strings have not been set."); + } + this.#enabled = true; + this.#textChildren = this.#textChildren.slice(); + this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions); + if (this.#textNodes.size > 0) { + const textChildren = this.#textChildren; + for (const [id, nodeIndex] of this.#textNodes) { + const element = document.getElementById(id); + if (!element) { + this.#textNodes.delete(id); + continue; + } + this.#addIdToAriaOwns(id, textChildren[nodeIndex]); + } + } + for (const [element, isRemovable] of this.#waitingElements) { + this.addPointerInTextLayer(element, isRemovable); + } + this.#waitingElements.clear(); + } + disable() { + if (!this.#enabled) { + return; + } + this.#waitingElements.clear(); + this.#textChildren = null; + this.#enabled = false; + } + removePointerInTextLayer(element) { + if (!this.#enabled) { + this.#waitingElements.delete(element); + return; + } + const children = this.#textChildren; + if (!children || children.length === 0) { + return; + } + const { + id + } = element; + const nodeIndex = this.#textNodes.get(id); + if (nodeIndex === undefined) { + return; + } + const node = children[nodeIndex]; + this.#textNodes.delete(id); + let owns = node.getAttribute("aria-owns"); + if (owns?.includes(id)) { + owns = owns.split(" ").filter(x => x !== id).join(" "); + if (owns) { + node.setAttribute("aria-owns", owns); + } else { + node.removeAttribute("aria-owns"); + node.setAttribute("role", "presentation"); + } + } + } + #addIdToAriaOwns(id, node) { + const owns = node.getAttribute("aria-owns"); + if (!owns?.includes(id)) { + node.setAttribute("aria-owns", owns ? `${owns} ${id}` : id); + } + node.removeAttribute("role"); + } + addPointerInTextLayer(element, isRemovable) { + const { + id + } = element; + if (!id) { + return null; + } + if (!this.#enabled) { + this.#waitingElements.set(element, isRemovable); + return null; + } + if (isRemovable) { + this.removePointerInTextLayer(element); + } + const children = this.#textChildren; + if (!children || children.length === 0) { + return null; + } + const index = binarySearchFirstItem(children, node => TextAccessibilityManager.#compareElementPositions(element, node) < 0); + const nodeIndex = Math.max(0, index - 1); + const child = children[nodeIndex]; + this.#addIdToAriaOwns(id, child); + this.#textNodes.set(id, nodeIndex); + const parent = child.parentNode; + return parent?.classList.contains("markedContent") ? parent.id : null; + } + moveElementInDOM(container, element, contentElement, isRemovable) { + const id = this.addPointerInTextLayer(contentElement, isRemovable); + if (!container.hasChildNodes()) { + container.append(element); + return id; + } + const children = Array.from(container.childNodes).filter(node => node !== element); + if (children.length === 0) { + return id; + } + const index = binarySearchFirstItem(children, node => TextAccessibilityManager.#compareElementPositions(element, node) < 0); + if (index === 0) { + children[0].before(element); + } else { + children[index - 1].after(element); + } + return id; + } +} + +;// ./web/text_highlighter.js +class TextHighlighter { + #eventAbortController = null; + constructor({ + findController, + eventBus, + pageIndex + }) { + this.findController = findController; + this.matches = []; + this.eventBus = eventBus; + this.pageIdx = pageIndex; + this.textDivs = null; + this.textContentItemsStr = null; + this.enabled = false; + } + setTextMapping(divs, texts) { + this.textDivs = divs; + this.textContentItemsStr = texts; + } + enable() { + if (!this.textDivs || !this.textContentItemsStr) { + throw new Error("Text divs and strings have not been set."); + } + if (this.enabled) { + throw new Error("TextHighlighter is already enabled."); + } + this.enabled = true; + if (!this.#eventAbortController) { + this.#eventAbortController = new AbortController(); + this.eventBus._on("updatetextlayermatches", evt => { + if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) { + this._updateMatches(); + } + }, { + signal: this.#eventAbortController.signal + }); + } + this._updateMatches(); + } + disable() { + if (!this.enabled) { + return; + } + this.enabled = false; + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + this._updateMatches(true); + } + _convertMatches(matches, matchesLength) { + if (!matches) { + return []; + } + const { + textContentItemsStr + } = this; + let i = 0, + iIndex = 0; + const end = textContentItemsStr.length - 1; + const result = []; + for (let m = 0, mm = matches.length; m < mm; m++) { + let matchIdx = matches[m]; + while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) { + iIndex += textContentItemsStr[i].length; + i++; + } + if (i === textContentItemsStr.length) { + console.error("Could not find a matching mapping"); + } + const match = { + begin: { + divIdx: i, + offset: matchIdx - iIndex + } + }; + matchIdx += matchesLength[m]; + while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) { + iIndex += textContentItemsStr[i].length; + i++; + } + match.end = { + divIdx: i, + offset: matchIdx - iIndex + }; + result.push(match); + } + return result; + } + _renderMatches(matches) { + if (matches.length === 0) { + return; + } + const { + findController, + pageIdx + } = this; + const { + textContentItemsStr, + textDivs + } = this; + const isSelectedPage = pageIdx === findController.selected.pageIdx; + const selectedMatchIdx = findController.selected.matchIdx; + const highlightAll = findController.state.highlightAll; + let prevEnd = null; + const infinity = { + divIdx: -1, + offset: undefined + }; + function beginText(begin, className) { + const divIdx = begin.divIdx; + textDivs[divIdx].textContent = ""; + return appendTextToDiv(divIdx, 0, begin.offset, className); + } + function appendTextToDiv(divIdx, fromOffset, toOffset, className) { + let div = textDivs[divIdx]; + if (div.nodeType === Node.TEXT_NODE) { + const span = document.createElement("span"); + div.before(span); + span.append(div); + textDivs[divIdx] = span; + div = span; + } + const content = textContentItemsStr[divIdx].substring(fromOffset, toOffset); + const node = document.createTextNode(content); + if (className) { + const span = document.createElement("span"); + span.className = `${className} appended`; + span.append(node); + div.append(span); + if (className.includes("selected")) { + const { + left + } = span.getClientRects()[0]; + const parentLeft = div.getBoundingClientRect().left; + return left - parentLeft; + } + return 0; + } + div.append(node); + return 0; + } + let i0 = selectedMatchIdx, + i1 = i0 + 1; + if (highlightAll) { + i0 = 0; + i1 = matches.length; + } else if (!isSelectedPage) { + return; + } + let lastDivIdx = -1; + let lastOffset = -1; + for (let i = i0; i < i1; i++) { + const match = matches[i]; + const begin = match.begin; + if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) { + continue; + } + lastDivIdx = begin.divIdx; + lastOffset = begin.offset; + const end = match.end; + const isSelected = isSelectedPage && i === selectedMatchIdx; + const highlightSuffix = isSelected ? " selected" : ""; + let selectedLeft = 0; + if (!prevEnd || begin.divIdx !== prevEnd.divIdx) { + if (prevEnd !== null) { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); + } + beginText(begin); + } else { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset); + } + if (begin.divIdx === end.divIdx) { + selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix); + } else { + selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix); + for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) { + textDivs[n0].className = "highlight middle" + highlightSuffix; + } + beginText(end, "highlight end" + highlightSuffix); + } + prevEnd = end; + if (isSelected) { + findController.scrollMatchIntoView({ + element: textDivs[begin.divIdx], + selectedLeft, + pageIndex: pageIdx, + matchIndex: selectedMatchIdx + }); + } + } + if (prevEnd) { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); + } + } + _updateMatches(reset = false) { + if (!this.enabled && !reset) { + return; + } + const { + findController, + matches, + pageIdx + } = this; + const { + textContentItemsStr, + textDivs + } = this; + let clearedUntilDivIdx = -1; + for (const match of matches) { + const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx); + for (let n = begin, end = match.end.divIdx; n <= end; n++) { + const div = textDivs[n]; + div.textContent = textContentItemsStr[n]; + div.className = ""; + } + clearedUntilDivIdx = match.end.divIdx + 1; + } + if (!findController?.highlightMatches || reset) { + return; + } + const pageMatches = findController.pageMatches[pageIdx] || null; + const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null; + this.matches = this._convertMatches(pageMatches, pageMatchesLength); + this._renderMatches(this.matches); + } +} + +;// ./web/text_layer_builder.js + + +class TextLayerBuilder { + #enablePermissions = false; + #onAppend = null; + #renderingDone = false; + #textLayer = null; + static #textLayers = new Map(); + static #selectionChangeAbortController = null; + constructor({ + pdfPage, + highlighter = null, + accessibilityManager = null, + enablePermissions = false, + onAppend = null + }) { + this.pdfPage = pdfPage; + this.highlighter = highlighter; + this.accessibilityManager = accessibilityManager; + this.#enablePermissions = enablePermissions === true; + this.#onAppend = onAppend; + this.div = document.createElement("div"); + this.div.tabIndex = 0; + this.div.className = "textLayer"; + } + async render({ + viewport, + textContentParams = null + }) { + if (this.#renderingDone && this.#textLayer) { + this.#textLayer.update({ + viewport, + onBefore: this.hide.bind(this) + }); + this.show(); + return; + } + this.cancel(); + this.#textLayer = new TextLayer({ + textContentSource: this.pdfPage.streamTextContent(textContentParams || { + includeMarkedContent: true, + disableNormalization: true + }), + container: this.div, + viewport + }); + const { + textDivs, + textContentItemsStr + } = this.#textLayer; + this.highlighter?.setTextMapping(textDivs, textContentItemsStr); + this.accessibilityManager?.setTextMapping(textDivs); + await this.#textLayer.render(); + this.#renderingDone = true; + const endOfContent = document.createElement("div"); + endOfContent.className = "endOfContent"; + this.div.append(endOfContent); + this.#bindMouse(endOfContent); + this.#onAppend?.(this.div); + this.highlighter?.enable(); + this.accessibilityManager?.enable(); + } + hide() { + if (!this.div.hidden && this.#renderingDone) { + this.highlighter?.disable(); + this.div.hidden = true; + } + } + show() { + if (this.div.hidden && this.#renderingDone) { + this.div.hidden = false; + this.highlighter?.enable(); + } + } + cancel() { + this.#textLayer?.cancel(); + this.#textLayer = null; + this.highlighter?.disable(); + this.accessibilityManager?.disable(); + TextLayerBuilder.#removeGlobalSelectionListener(this.div); + } + #bindMouse(end) { + const { + div + } = this; + div.addEventListener("mousedown", () => { + div.classList.add("selecting"); + }); + div.addEventListener("copy", event => { + if (!this.#enablePermissions) { + const selection = document.getSelection(); + event.clipboardData.setData("text/plain", removeNullCharacters(normalizeUnicode(selection.toString()))); + } + stopEvent(event); + }); + TextLayerBuilder.#textLayers.set(div, end); + TextLayerBuilder.#enableGlobalSelectionListener(); + } + static #removeGlobalSelectionListener(textLayerDiv) { + this.#textLayers.delete(textLayerDiv); + if (this.#textLayers.size === 0) { + this.#selectionChangeAbortController?.abort(); + this.#selectionChangeAbortController = null; + } + } + static #enableGlobalSelectionListener() { + if (this.#selectionChangeAbortController) { + return; + } + this.#selectionChangeAbortController = new AbortController(); + const { + signal + } = this.#selectionChangeAbortController; + const reset = (end, textLayer) => { + textLayer.classList.remove("selecting"); + }; + let isPointerDown = false; + document.addEventListener("pointerdown", () => { + isPointerDown = true; + }, { + signal + }); + document.addEventListener("pointerup", () => { + isPointerDown = false; + this.#textLayers.forEach(reset); + }, { + signal + }); + window.addEventListener("blur", () => { + isPointerDown = false; + this.#textLayers.forEach(reset); + }, { + signal + }); + document.addEventListener("keyup", () => { + if (!isPointerDown) { + this.#textLayers.forEach(reset); + } + }, { + signal + }); + document.addEventListener("selectionchange", () => { + const selection = document.getSelection(); + if (selection.rangeCount === 0) { + this.#textLayers.forEach(reset); + return; + } + const activeTextLayers = new Set(); + for (let i = 0; i < selection.rangeCount; i++) { + const range = selection.getRangeAt(i); + for (const textLayerDiv of this.#textLayers.keys()) { + if (!activeTextLayers.has(textLayerDiv) && range.intersectsNode(textLayerDiv)) { + activeTextLayers.add(textLayerDiv); + } + } + } + for (const [textLayerDiv, endDiv] of this.#textLayers) { + if (activeTextLayers.has(textLayerDiv)) { + textLayerDiv.classList.add("selecting"); + } else { + reset(endDiv, textLayerDiv); + } + } + }, { + signal + }); + } +} + +;// ./web/pdf_page_view.js + + + + + + + + + + + + + + + + +const DEFAULT_LAYER_PROPERTIES = null; +const LAYERS_ORDER = new Map([["canvasWrapper", 0], ["textLayer", 1], ["annotationLayer", 2], ["annotationEditorLayer", 3], ["xfaLayer", 3]]); +class PDFPageView extends BasePDFPageView { + #annotationMode = AnnotationMode.ENABLE_FORMS; + #canvasWrapper = null; + #commentManager = null; + #enableAutoLinking = true; + #hasRestrictedScaling = false; + #isEditing = false; + #layerProperties = null; + #needsRestrictedScaling = false; + #originalViewport = null; + #previousRotation = null; + #scaleRoundX = 1; + #scaleRoundY = 1; + #textLayerMode = TextLayerMode.ENABLE; + #userUnit = 1; + #useThumbnailCanvas = { + directDrawing: true, + initialOptionalContent: true, + regularAnnotations: true + }; + #layers = [null, null, null, null]; + constructor(options) { + super(options); + const container = options.container; + const defaultViewport = options.defaultViewport; + this.renderingId = "page" + this.id; + this.#layerProperties = options.layerProperties || DEFAULT_LAYER_PROPERTIES; + this.pdfPage = null; + this.pageLabel = null; + this.rotation = 0; + this.scale = options.scale || DEFAULT_SCALE; + this.viewport = defaultViewport; + this.pdfPageRotate = defaultViewport.rotation; + this._optionalContentConfigPromise = options.optionalContentConfigPromise || null; + this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE; + this.#annotationMode = options.annotationMode ?? AnnotationMode.ENABLE_FORMS; + this.imageResourcesPath = options.imageResourcesPath || ""; + this.enableDetailCanvas = options.enableDetailCanvas ?? true; + this.maxCanvasPixels = options.maxCanvasPixels ?? AppOptions.get("maxCanvasPixels"); + this.maxCanvasDim = options.maxCanvasDim || AppOptions.get("maxCanvasDim"); + this.capCanvasAreaFactor = options.capCanvasAreaFactor ?? AppOptions.get("capCanvasAreaFactor"); + this.#enableAutoLinking = options.enableAutoLinking !== false; + this.#commentManager = options.commentManager || null; + this.l10n = options.l10n; + this._annotationCanvasMap = null; + this.annotationLayer = null; + this.annotationEditorLayer = null; + this.textLayer = null; + this.xfaLayer = null; + this.structTreeLayer = null; + this.drawLayer = null; + this.detailView = null; + const div = document.createElement("div"); + div.className = "page"; + div.setAttribute("data-page-number", this.id); + div.setAttribute("role", "region"); + div.setAttribute("data-l10n-id", "pdfjs-page-landmark"); + div.setAttribute("data-l10n-args", JSON.stringify({ + page: this.id + })); + this.div = div; + this.#setDimensions(); + container?.append(div); + } + #addLayer(div, name) { + const pos = LAYERS_ORDER.get(name); + const oldDiv = this.#layers[pos]; + this.#layers[pos] = div; + if (oldDiv) { + oldDiv.replaceWith(div); + return; + } + for (let i = pos - 1; i >= 0; i--) { + const layer = this.#layers[i]; + if (layer) { + layer.after(div); + return; + } + } + this.div.prepend(div); + } + #setDimensions() { + const { + div, + viewport + } = this; + if (viewport.userUnit !== this.#userUnit) { + if (viewport.userUnit !== 1) { + div.style.setProperty("--user-unit", viewport.userUnit); + } else { + div.style.removeProperty("--user-unit"); + } + this.#userUnit = viewport.userUnit; + } + if (this.pdfPage) { + if (this.#previousRotation === viewport.rotation) { + return; + } + this.#previousRotation = viewport.rotation; + } + setLayerDimensions(div, viewport, true, false); + } + setPdfPage(pdfPage) { + this.pdfPage = pdfPage; + this.pdfPageRotate = pdfPage.rotate; + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = pdfPage.getViewport({ + scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS, + rotation: totalRotation + }); + this.#setDimensions(); + this.reset(); + } + destroy() { + this.reset(); + this.pdfPage?.cleanup(); + } + hasEditableAnnotations() { + return !!this.annotationLayer?.hasEditableAnnotations(); + } + get _textHighlighter() { + return shadow(this, "_textHighlighter", new TextHighlighter({ + pageIndex: this.id - 1, + eventBus: this.eventBus, + findController: this.#layerProperties.findController + })); + } + #dispatchLayerRendered(name, error) { + this.eventBus.dispatch(name, { + source: this, + pageNumber: this.id, + error + }); + } + async #renderAnnotationLayer() { + let error = null; + try { + await this.annotationLayer.render({ + viewport: this.viewport, + intent: "display", + structTreeLayer: this.structTreeLayer + }); + } catch (ex) { + console.error("#renderAnnotationLayer:", ex); + error = ex; + } finally { + this.#dispatchLayerRendered("annotationlayerrendered", error); + } + } + async #renderAnnotationEditorLayer() { + let error = null; + try { + await this.annotationEditorLayer.render({ + viewport: this.viewport, + intent: "display" + }); + } catch (ex) { + console.error("#renderAnnotationEditorLayer:", ex); + error = ex; + } finally { + this.#dispatchLayerRendered("annotationeditorlayerrendered", error); + } + } + async #renderDrawLayer() { + try { + await this.drawLayer.render({ + intent: "display" + }); + } catch (ex) { + console.error("#renderDrawLayer:", ex); + } + } + async #renderXfaLayer() { + let error = null; + try { + const result = await this.xfaLayer.render({ + viewport: this.viewport, + intent: "display" + }); + if (result?.textDivs && this._textHighlighter) { + this.#buildXfaTextContentItems(result.textDivs); + } + } catch (ex) { + console.error("#renderXfaLayer:", ex); + error = ex; + } finally { + if (this.xfaLayer?.div) { + this.l10n.pause(); + this.#addLayer(this.xfaLayer.div, "xfaLayer"); + this.l10n.resume(); + } + this.#dispatchLayerRendered("xfalayerrendered", error); + } + } + async #renderTextLayer() { + if (!this.textLayer) { + return; + } + let error = null; + try { + await this.textLayer.render({ + viewport: this.viewport + }); + } catch (ex) { + if (ex instanceof AbortException) { + return; + } + console.error("#renderTextLayer:", ex); + error = ex; + } + this.#dispatchLayerRendered("textlayerrendered", error); + this.#renderStructTreeLayer(); + } + async #renderStructTreeLayer() { + if (!this.textLayer) { + return; + } + const treeDom = await this.structTreeLayer?.render(); + if (treeDom) { + this.l10n.pause(); + this.structTreeLayer?.addElementsToTextLayer(); + if (this.canvas && treeDom.parentNode !== this.canvas) { + this.canvas.append(treeDom); + } + this.l10n.resume(); + } + this.structTreeLayer?.show(); + } + async #buildXfaTextContentItems(textDivs) { + const text = await this.pdfPage.getTextContent(); + const items = []; + for (const item of text.items) { + items.push(item.str); + } + this._textHighlighter.setTextMapping(textDivs, items); + this._textHighlighter.enable(); + } + async #injectLinkAnnotations(textLayerPromise) { + let error = null; + try { + await textLayerPromise; + if (!this.annotationLayer) { + return; + } + await this.annotationLayer.injectLinkAnnotations(Autolinker.processLinks(this)); + } catch (ex) { + console.error("#injectLinkAnnotations:", ex); + error = ex; + } + } + _resetCanvas() { + super._resetCanvas(); + this.#originalViewport = null; + } + reset({ + keepAnnotationLayer = false, + keepAnnotationEditorLayer = false, + keepXfaLayer = false, + keepTextLayer = false, + keepCanvasWrapper = false, + preserveDetailViewState = false + } = {}) { + const keepPdfBugGroups = this.pdfPage?._pdfBug ?? false; + this.cancelRendering({ + keepAnnotationLayer, + keepAnnotationEditorLayer, + keepXfaLayer, + keepTextLayer + }); + this.renderingState = RenderingStates.INITIAL; + const div = this.div; + const childNodes = div.childNodes, + annotationLayerNode = keepAnnotationLayer && this.annotationLayer?.div || null, + annotationEditorLayerNode = keepAnnotationEditorLayer && this.annotationEditorLayer?.div || null, + xfaLayerNode = keepXfaLayer && this.xfaLayer?.div || null, + textLayerNode = keepTextLayer && this.textLayer?.div || null, + canvasWrapperNode = keepCanvasWrapper && this.#canvasWrapper || null; + for (let i = childNodes.length - 1; i >= 0; i--) { + const node = childNodes[i]; + switch (node) { + case annotationLayerNode: + case annotationEditorLayerNode: + case xfaLayerNode: + case textLayerNode: + case canvasWrapperNode: + continue; + } + if (keepPdfBugGroups && node.classList.contains("pdfBugGroupsLayer")) { + continue; + } + node.remove(); + const layerIndex = this.#layers.indexOf(node); + if (layerIndex >= 0) { + this.#layers[layerIndex] = null; + } + } + div.removeAttribute("data-loaded"); + if (annotationLayerNode) { + this.annotationLayer.hide(); + } + if (annotationEditorLayerNode) { + this.annotationEditorLayer.hide(); + } + if (xfaLayerNode) { + this.xfaLayer.hide(); + } + if (textLayerNode) { + this.textLayer.hide(); + } + this.structTreeLayer?.hide(); + if (!keepCanvasWrapper && this.#canvasWrapper) { + this.#canvasWrapper = null; + this._resetCanvas(); + } + if (!preserveDetailViewState) { + this.detailView?.reset({ + keepCanvas: keepCanvasWrapper + }); + if (!keepCanvasWrapper) { + this.detailView = null; + } + } + } + toggleEditingMode(isEditing) { + this.#isEditing = isEditing; + if (!this.hasEditableAnnotations()) { + return; + } + this.reset({ + keepAnnotationLayer: true, + keepAnnotationEditorLayer: true, + keepXfaLayer: true, + keepTextLayer: true, + keepCanvasWrapper: true + }); + } + updateVisibleArea(visibleArea) { + if (this.enableDetailCanvas) { + if (this.#needsRestrictedScaling && this.maxCanvasPixels > 0 && visibleArea) { + this.detailView ??= new PDFPageDetailView({ + pageView: this, + enableOptimizedPartialRendering: this.enableOptimizedPartialRendering + }); + this.detailView.update({ + visibleArea + }); + } else if (this.detailView) { + this.detailView.reset(); + this.detailView = null; + } + } + } + update({ + scale = 0, + rotation = null, + optionalContentConfigPromise = null, + drawingDelay = -1 + }) { + this.scale = scale || this.scale; + if (typeof rotation === "number") { + this.rotation = rotation; + } + if (optionalContentConfigPromise instanceof Promise) { + this._optionalContentConfigPromise = optionalContentConfigPromise; + optionalContentConfigPromise.then(optionalContentConfig => { + if (optionalContentConfigPromise !== this._optionalContentConfigPromise) { + return; + } + this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility; + }); + } + this.#useThumbnailCanvas.directDrawing = true; + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = this.viewport.clone({ + scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS, + rotation: totalRotation + }); + this.#setDimensions(); + this.#computeScale(); + if (this.canvas) { + const onlyCssZoom = this.#hasRestrictedScaling && this.#needsRestrictedScaling; + const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000; + if (postponeDrawing || onlyCssZoom) { + if (postponeDrawing && !onlyCssZoom && this.renderingState !== RenderingStates.FINISHED) { + this.cancelRendering({ + keepAnnotationLayer: true, + keepAnnotationEditorLayer: true, + keepXfaLayer: true, + keepTextLayer: true, + cancelExtraDelay: drawingDelay + }); + this.renderingState = RenderingStates.FINISHED; + this.#useThumbnailCanvas.directDrawing = false; + } + this.cssTransform({ + redrawAnnotationLayer: true, + redrawAnnotationEditorLayer: true, + redrawXfaLayer: true, + redrawTextLayer: !postponeDrawing, + hideTextLayer: postponeDrawing + }); + if (!postponeDrawing) { + this.detailView?.update({ + underlyingViewUpdated: true + }); + this.dispatchPageRendered(true, false); + } + return; + } + } + this.cssTransform({}); + this.reset({ + keepAnnotationLayer: true, + keepAnnotationEditorLayer: true, + keepXfaLayer: true, + keepTextLayer: true, + keepCanvasWrapper: true, + preserveDetailViewState: true + }); + this.detailView?.update({ + underlyingViewUpdated: true + }); + } + #computeScale() { + const { + width, + height + } = this.viewport; + const outputScale = this.outputScale = new OutputScale(); + this.#needsRestrictedScaling = outputScale.limitCanvas(width, height, this.maxCanvasPixels, this.maxCanvasDim, this.capCanvasAreaFactor); + if (this.#needsRestrictedScaling && this.enableDetailCanvas) { + const factor = this.enableOptimizedPartialRendering ? 4 : 2; + outputScale.sx /= factor; + outputScale.sy /= factor; + } + } + cancelRendering({ + keepAnnotationLayer = false, + keepAnnotationEditorLayer = false, + keepXfaLayer = false, + keepTextLayer = false, + cancelExtraDelay = 0 + } = {}) { + super.cancelRendering({ + cancelExtraDelay + }); + if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) { + this.textLayer.cancel(); + this.textLayer = null; + } + if (this.annotationLayer && (!keepAnnotationLayer || !this.annotationLayer.div)) { + this.annotationLayer.cancel(); + this.annotationLayer = null; + this._annotationCanvasMap = null; + } + if (this.structTreeLayer && !this.textLayer) { + this.structTreeLayer = null; + } + if (this.annotationEditorLayer && (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)) { + if (this.drawLayer) { + this.drawLayer.cancel(); + this.drawLayer = null; + } + this.annotationEditorLayer.cancel(); + this.annotationEditorLayer = null; + } + if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) { + this.xfaLayer.cancel(); + this.xfaLayer = null; + this._textHighlighter?.disable(); + } + } + cssTransform({ + redrawAnnotationLayer = false, + redrawAnnotationEditorLayer = false, + redrawXfaLayer = false, + redrawTextLayer = false, + hideTextLayer = false + }) { + const { + canvas + } = this; + if (!canvas) { + return; + } + const originalViewport = this.#originalViewport; + if (this.viewport !== originalViewport) { + const relativeRotation = (360 + this.viewport.rotation - originalViewport.rotation) % 360; + if (relativeRotation === 90 || relativeRotation === 270) { + const { + width, + height + } = this.viewport; + const scaleX = height / width; + const scaleY = width / height; + canvas.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX},${scaleY})`; + } else { + canvas.style.transform = relativeRotation === 0 ? "" : `rotate(${relativeRotation}deg)`; + } + } + if (redrawAnnotationLayer && this.annotationLayer) { + this.#renderAnnotationLayer(); + } + if (redrawAnnotationEditorLayer && this.annotationEditorLayer) { + if (this.drawLayer) { + this.#renderDrawLayer(); + } + this.#renderAnnotationEditorLayer(); + } + if (redrawXfaLayer && this.xfaLayer) { + this.#renderXfaLayer(); + } + if (this.textLayer) { + if (hideTextLayer) { + this.textLayer.hide(); + this.structTreeLayer?.hide(); + } else if (redrawTextLayer) { + this.#renderTextLayer(); + } + } + } + get width() { + return this.viewport.width; + } + get height() { + return this.viewport.height; + } + getPagePoint(x, y) { + return this.viewport.convertToPdfPoint(x, y); + } + _ensureCanvasWrapper() { + let canvasWrapper = this.#canvasWrapper; + if (!canvasWrapper) { + canvasWrapper = this.#canvasWrapper = document.createElement("div"); + canvasWrapper.classList.add("canvasWrapper"); + this.#addLayer(canvasWrapper, "canvasWrapper"); + } + return canvasWrapper; + } + _getRenderingContext(canvas, transform, recordOperations) { + return { + canvas, + transform, + viewport: this.viewport, + annotationMode: this.#annotationMode, + optionalContentConfigPromise: this._optionalContentConfigPromise, + annotationCanvasMap: this._annotationCanvasMap, + pageColors: this.pageColors, + isEditing: this.#isEditing, + recordOperations + }; + } + async draw() { + if (this.renderingState !== RenderingStates.INITIAL) { + console.error("Must be in new state before drawing"); + this.reset(); + } + const { + div, + l10n, + pdfPage, + viewport + } = this; + if (!pdfPage) { + this.renderingState = RenderingStates.FINISHED; + throw new Error("pdfPage is not loaded"); + } + this.renderingState = RenderingStates.RUNNING; + const canvasWrapper = this._ensureCanvasWrapper(); + if (!this.textLayer && this.#textLayerMode !== TextLayerMode.DISABLE && !pdfPage.isPureXfa) { + this._accessibilityManager ||= new TextAccessibilityManager(); + this.textLayer = new TextLayerBuilder({ + pdfPage, + highlighter: this._textHighlighter, + accessibilityManager: this._accessibilityManager, + enablePermissions: this.#textLayerMode === TextLayerMode.ENABLE_PERMISSIONS, + onAppend: textLayerDiv => { + this.l10n.pause(); + this.#addLayer(textLayerDiv, "textLayer"); + this.l10n.resume(); + } + }); + } + if (!this.annotationLayer && this.#annotationMode !== AnnotationMode.DISABLE) { + const { + annotationStorage, + annotationEditorUIManager, + downloadManager, + enableComment, + enableScripting, + fieldObjectsPromise, + hasJSActionsPromise, + linkService + } = this.#layerProperties; + this._annotationCanvasMap ||= new Map(); + this.annotationLayer = new AnnotationLayerBuilder({ + pdfPage, + annotationStorage, + imageResourcesPath: this.imageResourcesPath, + renderForms: this.#annotationMode === AnnotationMode.ENABLE_FORMS, + linkService, + downloadManager, + enableComment, + enableScripting, + hasJSActionsPromise, + fieldObjectsPromise, + annotationCanvasMap: this._annotationCanvasMap, + accessibilityManager: this._accessibilityManager, + annotationEditorUIManager, + commentManager: this.#commentManager, + onAppend: annotationLayerDiv => { + this.#addLayer(annotationLayerDiv, "annotationLayer"); + } + }); + } + const { + width, + height + } = viewport; + this.#originalViewport = viewport; + const { + canvas, + prevCanvas + } = this._createCanvas(newCanvas => { + canvasWrapper.prepend(newCanvas); + }); + canvas.setAttribute("role", "presentation"); + if (!this.outputScale) { + this.#computeScale(); + } + const { + outputScale + } = this; + this.#hasRestrictedScaling = this.#needsRestrictedScaling; + const sfx = approximateFraction(outputScale.sx); + const sfy = approximateFraction(outputScale.sy); + const canvasWidth = canvas.width = floorToDivide(calcRound(width * outputScale.sx), sfx[0]); + const canvasHeight = canvas.height = floorToDivide(calcRound(height * outputScale.sy), sfy[0]); + const pageWidth = floorToDivide(calcRound(width), sfx[1]); + const pageHeight = floorToDivide(calcRound(height), sfy[1]); + outputScale.sx = canvasWidth / pageWidth; + outputScale.sy = canvasHeight / pageHeight; + if (this.#scaleRoundX !== sfx[1]) { + div.style.setProperty("--scale-round-x", `${sfx[1]}px`); + this.#scaleRoundX = sfx[1]; + } + if (this.#scaleRoundY !== sfy[1]) { + div.style.setProperty("--scale-round-y", `${sfy[1]}px`); + this.#scaleRoundY = sfy[1]; + } + const recordBBoxes = this.enableOptimizedPartialRendering && this.#hasRestrictedScaling && !this.recordedBBoxes; + const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null; + const resultPromise = this._drawCanvas(this._getRenderingContext(canvas, transform, recordBBoxes), () => { + prevCanvas?.remove(); + this._resetCanvas(); + }, renderTask => { + this.#useThumbnailCanvas.regularAnnotations = !renderTask.separateAnnots; + this.dispatchPageRendered(false, false); + }).then(async () => { + if (this.renderingState !== RenderingStates.FINISHED) { + return; + } + this.structTreeLayer ||= new StructTreeLayerBuilder(pdfPage, viewport.rawDims); + const textLayerPromise = this.#renderTextLayer(); + if (this.annotationLayer) { + await this.#renderAnnotationLayer(); + if (this.#enableAutoLinking && this.annotationLayer && this.textLayer) { + await this.#injectLinkAnnotations(textLayerPromise); + } + } + const { + annotationEditorUIManager + } = this.#layerProperties; + if (!annotationEditorUIManager) { + return; + } + this.drawLayer ||= new DrawLayerBuilder({ + pageIndex: this.id + }); + await this.#renderDrawLayer(); + this.drawLayer.setParent(canvasWrapper); + if (this.annotationLayer || this.#annotationMode === AnnotationMode.DISABLE) { + this.annotationEditorLayer ||= new AnnotationEditorLayerBuilder({ + uiManager: annotationEditorUIManager, + pdfPage, + l10n, + structTreeLayer: this.structTreeLayer, + accessibilityManager: this._accessibilityManager, + annotationLayer: this.annotationLayer?.annotationLayer, + textLayer: this.textLayer, + drawLayer: this.drawLayer.getDrawLayer(), + onAppend: annotationEditorLayerDiv => { + this.#addLayer(annotationEditorLayerDiv, "annotationEditorLayer"); + } + }); + this.#renderAnnotationEditorLayer(); + } + }); + if (pdfPage.isPureXfa) { + if (!this.xfaLayer) { + const { + annotationStorage, + linkService + } = this.#layerProperties; + this.xfaLayer = new XfaLayerBuilder({ + pdfPage, + annotationStorage, + linkService + }); + } + this.#renderXfaLayer(); + } + div.setAttribute("data-loaded", true); + this.dispatchPageRender(); + return resultPromise; + } + setPageLabel(label) { + this.pageLabel = typeof label === "string" ? label : null; + this.div.setAttribute("data-l10n-args", JSON.stringify({ + page: this.pageLabel ?? this.id + })); + if (this.pageLabel !== null) { + this.div.setAttribute("data-page-label", this.pageLabel); + } else { + this.div.removeAttribute("data-page-label"); + } + } + get thumbnailCanvas() { + const { + directDrawing, + initialOptionalContent, + regularAnnotations + } = this.#useThumbnailCanvas; + return directDrawing && initialOptionalContent && regularAnnotations ? this.canvas : null; + } +} + +;// ./web/pdf_viewer.js + + + + + + +const DEFAULT_CACHE_SIZE = 10; +const PagesCountLimit = { + FORCE_SCROLL_MODE_PAGE: 10000, + FORCE_LAZY_PAGE_INIT: 5000, + PAUSE_EAGER_PAGE_INIT: 250 +}; +function isValidAnnotationEditorMode(mode) { + return Object.values(AnnotationEditorType).includes(mode) && mode !== AnnotationEditorType.DISABLE; +} +class PDFPageViewBuffer { + #buf = new Set(); + #size = 0; + constructor(size) { + this.#size = size; + } + push(view) { + const buf = this.#buf; + if (buf.has(view)) { + buf.delete(view); + } + buf.add(view); + if (buf.size > this.#size) { + this.#destroyFirstView(); + } + } + resize(newSize, idsToKeep = null) { + this.#size = newSize; + const buf = this.#buf; + if (idsToKeep) { + const ii = buf.size; + let i = 1; + for (const view of buf) { + if (idsToKeep.has(view.id)) { + buf.delete(view); + buf.add(view); + } + if (++i > ii) { + break; + } + } + } + while (buf.size > this.#size) { + this.#destroyFirstView(); + } + } + has(view) { + return this.#buf.has(view); + } + [Symbol.iterator]() { + return this.#buf.keys(); + } + #destroyFirstView() { + const firstView = this.#buf.keys().next().value; + firstView?.destroy(); + this.#buf.delete(firstView); + } +} +class PDFViewer { + #buffer = null; + #altTextManager = null; + #annotationEditorHighlightColors = null; + #annotationEditorMode = AnnotationEditorType.NONE; + #annotationEditorUIManager = null; + #annotationMode = AnnotationMode.ENABLE_FORMS; + #commentManager = null; + #containerTopLeft = null; + #editorUndoBar = null; + #enableHWA = false; + #enableHighlightFloatingButton = false; + #enablePermissions = false; + #enableUpdatedAddImage = false; + #enableNewAltTextWhenAddingImage = false; + #enableAutoLinking = true; + #eventAbortController = null; + #minDurationToUpdateCanvas = 0; + #mlManager = null; + #printingAllowed = true; + #scrollTimeoutId = null; + #switchAnnotationEditorModeAC = null; + #switchAnnotationEditorModeTimeoutId = null; + #getAllTextInProgress = false; + #hiddenCopyElement = null; + #interruptCopyCondition = false; + #previousContainerHeight = 0; + #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this)); + #scrollModePageState = null; + #scaleTimeoutId = null; + #signatureManager = null; + #supportsPinchToZoom = true; + #textLayerMode = TextLayerMode.ENABLE; + #viewerAlert = null; + constructor(options) { + const viewerVersion = "5.4.445"; + if (version !== viewerVersion) { + throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`); + } + this.container = options.container; + this.viewer = options.viewer || options.container.firstElementChild; + this.#viewerAlert = options.viewerAlert || null; + this.#resizeObserver.observe(this.container); + this.eventBus = options.eventBus; + this.linkService = options.linkService || new SimpleLinkService(); + this.downloadManager = options.downloadManager || null; + this.findController = options.findController || null; + this.#altTextManager = options.altTextManager || null; + this.#commentManager = options.commentManager || null; + this.#signatureManager = options.signatureManager || null; + this.#editorUndoBar = options.editorUndoBar || null; + if (this.findController) { + this.findController.onIsPageVisible = pageNumber => this._getVisiblePages().ids.has(pageNumber); + } + this._scriptingManager = options.scriptingManager || null; + this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE; + this.#annotationMode = options.annotationMode ?? AnnotationMode.ENABLE_FORMS; + this.#annotationEditorMode = options.annotationEditorMode ?? AnnotationEditorType.NONE; + this.#annotationEditorHighlightColors = options.annotationEditorHighlightColors || null; + this.#enableHighlightFloatingButton = options.enableHighlightFloatingButton === true; + this.#enableUpdatedAddImage = options.enableUpdatedAddImage === true; + this.#enableNewAltTextWhenAddingImage = options.enableNewAltTextWhenAddingImage === true; + this.imageResourcesPath = options.imageResourcesPath || ""; + this.enablePrintAutoRotate = options.enablePrintAutoRotate || false; + this.maxCanvasPixels = options.maxCanvasPixels; + this.maxCanvasDim = options.maxCanvasDim; + this.capCanvasAreaFactor = options.capCanvasAreaFactor; + this.enableDetailCanvas = options.enableDetailCanvas ?? true; + this.enableOptimizedPartialRendering = options.enableOptimizedPartialRendering ?? false; + this.l10n = options.l10n; + this.#enablePermissions = options.enablePermissions || false; + this.pageColors = options.pageColors || null; + this.#mlManager = options.mlManager || null; + this.#enableHWA = options.enableHWA || false; + this.#supportsPinchToZoom = options.supportsPinchToZoom !== false; + this.#enableAutoLinking = options.enableAutoLinking !== false; + this.#minDurationToUpdateCanvas = options.minDurationToUpdateCanvas ?? 500; + this.defaultRenderingQueue = !options.renderingQueue; + this.renderingQueue = options.renderingQueue; + const { + abortSignal + } = options; + abortSignal?.addEventListener("abort", () => { + this.#resizeObserver.disconnect(); + this.#resizeObserver = null; + }, { + once: true + }); + this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this), abortSignal); + this.presentationModeState = PresentationModeState.UNKNOWN; + this._resetView(); + this.#updateContainerHeightCss(); + this.eventBus._on("thumbnailrendered", ({ + pageNumber, + pdfPage + }) => { + const pageView = this._pages[pageNumber - 1]; + if (!this.#buffer.has(pageView)) { + pdfPage?.cleanup(); + } + }); + } + get printingAllowed() { + return this.#printingAllowed; + } + get pagesCount() { + return this._pages.length; + } + getPageView(index) { + return this._pages[index]; + } + getCachedPageViews() { + return new Set(this.#buffer); + } + get pageViewsReady() { + return this._pages.every(pageView => pageView?.pdfPage); + } + get renderForms() { + return this.#annotationMode === AnnotationMode.ENABLE_FORMS; + } + get enableScripting() { + return !!this._scriptingManager; + } + get currentPageNumber() { + return this._currentPageNumber; + } + set currentPageNumber(val) { + if (!Number.isInteger(val)) { + throw new Error("Invalid page number."); + } + if (!this.pdfDocument) { + return; + } + if (!this._setCurrentPageNumber(val, true)) { + console.error(`currentPageNumber: "${val}" is not a valid page.`); + } + } + _setCurrentPageNumber(val, resetCurrentPageView = false) { + if (this._currentPageNumber === val) { + if (resetCurrentPageView) { + this.#resetCurrentPageView(); + } + return true; + } + if (!(0 < val && val <= this.pagesCount)) { + return false; + } + const previous = this._currentPageNumber; + this._currentPageNumber = val; + this.eventBus.dispatch("pagechanging", { + source: this, + pageNumber: val, + pageLabel: this._pageLabels?.[val - 1] ?? null, + previous + }); + if (resetCurrentPageView) { + this.#resetCurrentPageView(); + } + return true; + } + get currentPageLabel() { + return this._pageLabels?.[this._currentPageNumber - 1] ?? null; + } + set currentPageLabel(val) { + if (!this.pdfDocument) { + return; + } + let page = val | 0; + if (this._pageLabels) { + const i = this._pageLabels.indexOf(val); + if (i >= 0) { + page = i + 1; + } + } + if (!this._setCurrentPageNumber(page, true)) { + console.error(`currentPageLabel: "${val}" is not a valid page.`); + } + } + get currentScale() { + return this._currentScale !== UNKNOWN_SCALE ? this._currentScale : DEFAULT_SCALE; + } + set currentScale(val) { + if (isNaN(val)) { + throw new Error("Invalid numeric scale."); + } + if (!this.pdfDocument) { + return; + } + this.#setScale(val, { + noScroll: false + }); + } + get currentScaleValue() { + return this._currentScaleValue; + } + set currentScaleValue(val) { + if (!this.pdfDocument) { + return; + } + this.#setScale(val, { + noScroll: false + }); + } + get pagesRotation() { + return this._pagesRotation; + } + set pagesRotation(rotation) { + if (!isValidRotation(rotation)) { + throw new Error("Invalid pages rotation angle."); + } + if (!this.pdfDocument) { + return; + } + rotation %= 360; + if (rotation < 0) { + rotation += 360; + } + if (this._pagesRotation === rotation) { + return; + } + this._pagesRotation = rotation; + const pageNumber = this._currentPageNumber; + this.refresh(true, { + rotation + }); + if (this._currentScaleValue) { + this.#setScale(this._currentScaleValue, { + noScroll: true + }); + } + this.eventBus.dispatch("rotationchanging", { + source: this, + pagesRotation: rotation, + pageNumber + }); + if (this.defaultRenderingQueue) { + this.update(); + } + } + get firstPagePromise() { + return this.pdfDocument ? this._firstPageCapability.promise : null; + } + get onePageRendered() { + return this.pdfDocument ? this._onePageRenderedCapability.promise : null; + } + get pagesPromise() { + return this.pdfDocument ? this._pagesCapability.promise : null; + } + get _layerProperties() { + const self = this; + return shadow(this, "_layerProperties", { + get annotationEditorUIManager() { + return self.#annotationEditorUIManager; + }, + get annotationStorage() { + return self.pdfDocument?.annotationStorage; + }, + get downloadManager() { + return self.downloadManager; + }, + get enableComment() { + return !!self.#commentManager; + }, + get enableScripting() { + return !!self._scriptingManager; + }, + get fieldObjectsPromise() { + return self.pdfDocument?.getFieldObjects(); + }, + get findController() { + return self.findController; + }, + get hasJSActionsPromise() { + return self.pdfDocument?.hasJSActions(); + }, + get linkService() { + return self.linkService; + } + }); + } + #initializePermissions(permissions) { + const params = { + annotationEditorMode: this.#annotationEditorMode, + annotationMode: this.#annotationMode, + textLayerMode: this.#textLayerMode + }; + if (!permissions) { + this.#printingAllowed = true; + this.eventBus.dispatch("printingallowed", { + source: this, + isAllowed: this.#printingAllowed + }); + return params; + } + this.#printingAllowed = permissions.includes(PermissionFlag.PRINT_HIGH_QUALITY) || permissions.includes(PermissionFlag.PRINT); + this.eventBus.dispatch("printingallowed", { + source: this, + isAllowed: this.#printingAllowed + }); + if (!permissions.includes(PermissionFlag.COPY) && this.#textLayerMode === TextLayerMode.ENABLE) { + params.textLayerMode = TextLayerMode.ENABLE_PERMISSIONS; + } + if (!permissions.includes(PermissionFlag.MODIFY_CONTENTS)) { + params.annotationEditorMode = AnnotationEditorType.DISABLE; + } + if (!permissions.includes(PermissionFlag.MODIFY_ANNOTATIONS) && !permissions.includes(PermissionFlag.FILL_INTERACTIVE_FORMS) && this.#annotationMode === AnnotationMode.ENABLE_FORMS) { + params.annotationMode = AnnotationMode.ENABLE; + } + return params; + } + async #onePageRenderedOrForceFetch(signal) { + if (document.visibilityState === "hidden" || !this.container.offsetParent || this._getVisiblePages().views.length === 0) { + return; + } + const hiddenCapability = Promise.withResolvers(), + ac = new AbortController(); + document.addEventListener("visibilitychange", () => { + if (document.visibilityState === "hidden") { + hiddenCapability.resolve(); + } + }, { + signal: AbortSignal.any([signal, ac.signal]) + }); + await Promise.race([this._onePageRenderedCapability.promise, hiddenCapability.promise]); + ac.abort(); + } + async getAllText() { + const texts = []; + const buffer = []; + for (let pageNum = 1, pagesCount = this.pdfDocument.numPages; pageNum <= pagesCount; ++pageNum) { + if (this.#interruptCopyCondition) { + return null; + } + buffer.length = 0; + const page = await this.pdfDocument.getPage(pageNum); + const { + items + } = await page.getTextContent(); + for (const item of items) { + if (item.str) { + buffer.push(item.str); + } + if (item.hasEOL) { + buffer.push("\n"); + } + } + texts.push(removeNullCharacters(buffer.join(""))); + } + return texts.join("\n"); + } + #copyCallback(textLayerMode, event) { + const selection = document.getSelection(); + const { + focusNode, + anchorNode + } = selection; + if (anchorNode && focusNode && selection.containsNode(this.#hiddenCopyElement)) { + if (this.#getAllTextInProgress || textLayerMode === TextLayerMode.ENABLE_PERMISSIONS) { + stopEvent(event); + return; + } + this.#getAllTextInProgress = true; + const { + classList + } = this.viewer; + classList.add("copyAll"); + const ac = new AbortController(); + window.addEventListener("keydown", ev => this.#interruptCopyCondition = ev.key === "Escape", { + signal: ac.signal + }); + this.getAllText().then(async text => { + if (text !== null) { + await navigator.clipboard.writeText(text); + } + }).catch(reason => { + console.warn(`Something goes wrong when extracting the text: ${reason.message}`); + }).finally(() => { + this.#getAllTextInProgress = false; + this.#interruptCopyCondition = false; + ac.abort(); + classList.remove("copyAll"); + }); + stopEvent(event); + } + } + setDocument(pdfDocument) { + if (this.pdfDocument) { + this.eventBus.dispatch("pagesdestroy", { + source: this + }); + this._cancelRendering(); + this._resetView(); + this.findController?.setDocument(null); + this._scriptingManager?.setDocument(null); + this.#annotationEditorUIManager?.destroy(); + this.#annotationEditorUIManager = null; + this.#annotationEditorMode = AnnotationEditorType.NONE; + this.#printingAllowed = true; + } + this.pdfDocument = pdfDocument; + if (!pdfDocument) { + return; + } + const pagesCount = pdfDocument.numPages; + const firstPagePromise = pdfDocument.getPage(1); + const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({ + intent: "display" + }); + const permissionsPromise = this.#enablePermissions ? pdfDocument.getPermissions() : Promise.resolve(); + const { + eventBus, + pageColors, + viewer + } = this; + this.#eventAbortController = new AbortController(); + const { + signal + } = this.#eventAbortController; + if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) { + console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document."); + const mode = this._scrollMode = ScrollMode.PAGE; + eventBus.dispatch("scrollmodechanged", { + source: this, + mode + }); + } + this._pagesCapability.promise.then(() => { + eventBus.dispatch("pagesloaded", { + source: this, + pagesCount + }); + }, () => {}); + const onBeforeDraw = evt => { + const pageView = this._pages[evt.pageNumber - 1]; + if (!pageView) { + return; + } + this.#buffer.push(pageView); + }; + eventBus._on("pagerender", onBeforeDraw, { + signal + }); + const onAfterDraw = evt => { + if (evt.cssTransform || evt.isDetailView) { + return; + } + this._onePageRenderedCapability.resolve({ + timestamp: evt.timestamp + }); + eventBus._off("pagerendered", onAfterDraw); + }; + eventBus._on("pagerendered", onAfterDraw, { + signal + }); + Promise.all([firstPagePromise, permissionsPromise]).then(([firstPdfPage, permissions]) => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this._firstPageCapability.resolve(firstPdfPage); + this._optionalContentConfigPromise = optionalContentConfigPromise; + const { + annotationEditorMode, + annotationMode, + textLayerMode + } = this.#initializePermissions(permissions); + if (textLayerMode !== TextLayerMode.DISABLE) { + const element = this.#hiddenCopyElement = document.createElement("div"); + element.id = "hiddenCopyElement"; + viewer.before(element); + } + if (annotationEditorMode !== AnnotationEditorType.DISABLE) { + const mode = annotationEditorMode; + if (pdfDocument.isPureXfa) { + console.warn("Warning: XFA-editing is not implemented."); + } else if (isValidAnnotationEditorMode(mode)) { + this.#annotationEditorUIManager = new AnnotationEditorUIManager(this.container, viewer, this.#viewerAlert, this.#altTextManager, this.#commentManager, this.#signatureManager, eventBus, pdfDocument, pageColors, this.#annotationEditorHighlightColors, this.#enableHighlightFloatingButton, this.#enableUpdatedAddImage, this.#enableNewAltTextWhenAddingImage, this.#mlManager, this.#editorUndoBar, this.#supportsPinchToZoom); + eventBus.dispatch("annotationeditoruimanager", { + source: this, + uiManager: this.#annotationEditorUIManager + }); + if (mode !== AnnotationEditorType.NONE) { + this.#preloadEditingData(mode); + this.#annotationEditorUIManager.updateMode(mode); + } + } else { + console.error(`Invalid AnnotationEditor mode: ${mode}`); + } + } + const viewerElement = this._scrollMode === ScrollMode.PAGE ? null : viewer; + const scale = this.currentScale; + const viewport = firstPdfPage.getViewport({ + scale: scale * PixelsPerInch.PDF_TO_CSS_UNITS + }); + viewer.style.setProperty("--scale-factor", viewport.scale); + if (pageColors?.background) { + viewer.style.setProperty("--page-bg-color", pageColors.background); + } + if (pageColors?.foreground === "CanvasText" || pageColors?.background === "Canvas") { + viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight")); + viewer.style.setProperty("--hcm-highlight-selected-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "ButtonText")); + } + for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) { + const pageView = new PDFPageView({ + container: viewerElement, + eventBus, + id: pageNum, + scale, + defaultViewport: viewport.clone(), + optionalContentConfigPromise, + renderingQueue: this.renderingQueue, + textLayerMode, + annotationMode, + imageResourcesPath: this.imageResourcesPath, + maxCanvasPixels: this.maxCanvasPixels, + maxCanvasDim: this.maxCanvasDim, + capCanvasAreaFactor: this.capCanvasAreaFactor, + enableDetailCanvas: this.enableDetailCanvas, + enableOptimizedPartialRendering: this.enableOptimizedPartialRendering, + pageColors, + l10n: this.l10n, + layerProperties: this._layerProperties, + enableHWA: this.#enableHWA, + enableAutoLinking: this.#enableAutoLinking, + minDurationToUpdateCanvas: this.#minDurationToUpdateCanvas, + commentManager: this.#commentManager + }); + this._pages.push(pageView); + } + this._pages[0]?.setPdfPage(firstPdfPage); + if (this._scrollMode === ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + } else if (this._spreadMode !== SpreadMode.NONE) { + this._updateSpreadMode(); + } + eventBus._on("annotationeditorlayerrendered", evt => { + if (this.#annotationEditorUIManager) { + eventBus.dispatch("annotationeditormodechanged", { + source: this, + mode: this.#annotationEditorMode + }); + } + }, { + once: true, + signal + }); + this.#onePageRenderedOrForceFetch(signal).then(async () => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this.findController?.setDocument(pdfDocument); + this._scriptingManager?.setDocument(pdfDocument); + if (this.#hiddenCopyElement) { + document.addEventListener("copy", this.#copyCallback.bind(this, textLayerMode), { + signal + }); + } + if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT) { + this._pagesCapability.resolve(); + return; + } + let getPagesLeft = pagesCount - 1; + if (getPagesLeft <= 0) { + this._pagesCapability.resolve(); + return; + } + for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) { + const promise = pdfDocument.getPage(pageNum).then(pdfPage => { + const pageView = this._pages[pageNum - 1]; + if (!pageView.pdfPage) { + pageView.setPdfPage(pdfPage); + } + if (--getPagesLeft === 0) { + this._pagesCapability.resolve(); + } + }, reason => { + console.error(`Unable to get page ${pageNum} to initialize viewer`, reason); + if (--getPagesLeft === 0) { + this._pagesCapability.resolve(); + } + }); + if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) { + await promise; + } + } + }); + eventBus.dispatch("pagesinit", { + source: this + }); + pdfDocument.getMetadata().then(({ + info + }) => { + if (pdfDocument !== this.pdfDocument) { + return; + } + if (info.Language) { + viewer.lang = info.Language; + } + }); + if (this.defaultRenderingQueue) { + this.update(); + } + }).catch(reason => { + console.error("Unable to initialize viewer", reason); + this._pagesCapability.reject(reason); + }); + } + setPageLabels(labels) { + if (!this.pdfDocument) { + return; + } + if (!labels) { + this._pageLabels = null; + } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) { + this._pageLabels = null; + console.error(`setPageLabels: Invalid page labels.`); + } else { + this._pageLabels = labels; + } + for (let i = 0, ii = this._pages.length; i < ii; i++) { + this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null); + } + } + _resetView() { + this._pages = []; + this._currentPageNumber = 1; + this._currentScale = UNKNOWN_SCALE; + this._currentScaleValue = null; + this._pageLabels = null; + this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE); + this._location = null; + this._pagesRotation = 0; + this._optionalContentConfigPromise = null; + this._firstPageCapability = Promise.withResolvers(); + this._onePageRenderedCapability = Promise.withResolvers(); + this._pagesCapability = Promise.withResolvers(); + this._scrollMode = ScrollMode.VERTICAL; + this._previousScrollMode = ScrollMode.UNKNOWN; + this._spreadMode = SpreadMode.NONE; + this.#scrollModePageState = { + previousPageNumber: 1, + scrollDown: true, + pages: [] + }; + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + this.viewer.textContent = ""; + this._updateScrollMode(); + this.viewer.removeAttribute("lang"); + this.#hiddenCopyElement?.remove(); + this.#hiddenCopyElement = null; + this.#cleanupTimeouts(); + this.#cleanupSwitchAnnotationEditorMode(); + } + #ensurePageViewVisible() { + if (this._scrollMode !== ScrollMode.PAGE) { + throw new Error("#ensurePageViewVisible: Invalid scrollMode value."); + } + const pageNumber = this._currentPageNumber, + state = this.#scrollModePageState, + viewer = this.viewer; + viewer.textContent = ""; + state.pages.length = 0; + if (this._spreadMode === SpreadMode.NONE && !this.isInPresentationMode) { + const pageView = this._pages[pageNumber - 1]; + viewer.append(pageView.div); + state.pages.push(pageView); + } else { + const pageIndexSet = new Set(), + parity = this._spreadMode - 1; + if (parity === -1) { + pageIndexSet.add(pageNumber - 1); + } else if (pageNumber % 2 !== parity) { + pageIndexSet.add(pageNumber - 1); + pageIndexSet.add(pageNumber); + } else { + pageIndexSet.add(pageNumber - 2); + pageIndexSet.add(pageNumber - 1); + } + const spread = document.createElement("div"); + spread.className = "spread"; + if (this.isInPresentationMode) { + const dummyPage = document.createElement("div"); + dummyPage.className = "dummyPage"; + spread.append(dummyPage); + } + for (const i of pageIndexSet) { + const pageView = this._pages[i]; + if (!pageView) { + continue; + } + spread.append(pageView.div); + state.pages.push(pageView); + } + viewer.append(spread); + } + state.scrollDown = pageNumber >= state.previousPageNumber; + state.previousPageNumber = pageNumber; + } + _scrollUpdate() { + if (this.pagesCount === 0) { + return; + } + if (this.#scrollTimeoutId) { + clearTimeout(this.#scrollTimeoutId); + } + this.#scrollTimeoutId = setTimeout(() => { + this.#scrollTimeoutId = null; + this.update(); + }, 100); + this.update(); + } + #scrollIntoView(pageView, pageSpot = null) { + const { + div, + id + } = pageView; + if (this._currentPageNumber !== id) { + this._setCurrentPageNumber(id); + } + if (this._scrollMode === ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + this.update(); + } + if (!pageSpot && !this.isInPresentationMode) { + const left = div.offsetLeft + div.clientLeft, + right = left + div.clientWidth; + const { + scrollLeft, + clientWidth + } = this.container; + if (this._scrollMode === ScrollMode.HORIZONTAL || left < scrollLeft || right > scrollLeft + clientWidth) { + pageSpot = { + left: 0, + top: 0 + }; + } + } + scrollIntoView(div, pageSpot); + if (!this._currentScaleValue && this._location) { + this._location = null; + } + } + #isSameScale(newScale) { + return newScale === this._currentScale || Math.abs(newScale - this._currentScale) < 1e-15; + } + #setScaleUpdatePages(newScale, newValue, { + noScroll = false, + preset = false, + drawingDelay = -1, + origin = null + }) { + this._currentScaleValue = newValue.toString(); + if (this.#isSameScale(newScale)) { + if (preset) { + this.eventBus.dispatch("scalechanging", { + source: this, + scale: newScale, + presetValue: newValue + }); + } + return; + } + this.viewer.style.setProperty("--scale-factor", newScale * PixelsPerInch.PDF_TO_CSS_UNITS); + const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000; + this.refresh(true, { + scale: newScale, + drawingDelay: postponeDrawing ? drawingDelay : -1 + }); + if (postponeDrawing) { + this.#scaleTimeoutId = setTimeout(() => { + this.#scaleTimeoutId = null; + this.refresh(); + }, drawingDelay); + } + const previousScale = this._currentScale; + this._currentScale = newScale; + if (!noScroll) { + let page = this._currentPageNumber, + dest; + if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) { + page = this._location.pageNumber; + dest = [null, { + name: "XYZ" + }, this._location.left, this._location.top, null]; + } + this.scrollPageIntoView({ + pageNumber: page, + destArray: dest, + allowNegativeOffset: true + }); + if (Array.isArray(origin)) { + const scaleDiff = newScale / previousScale - 1; + const [top, left] = this.containerTopLeft; + this.container.scrollLeft += (origin[0] - left) * scaleDiff; + this.container.scrollTop += (origin[1] - top) * scaleDiff; + } + } + this.eventBus.dispatch("scalechanging", { + source: this, + scale: newScale, + presetValue: preset ? newValue : undefined + }); + if (this.defaultRenderingQueue) { + this.update(); + } + } + get #pageWidthScaleFactor() { + if (this._spreadMode !== SpreadMode.NONE && this._scrollMode !== ScrollMode.HORIZONTAL) { + return 2; + } + return 1; + } + #setScale(value, options) { + let scale = parseFloat(value); + if (scale > 0) { + options.preset = false; + this.#setScaleUpdatePages(scale, value, options); + } else { + const currentPage = this._pages[this._currentPageNumber - 1]; + if (!currentPage) { + return; + } + let hPadding = SCROLLBAR_PADDING, + vPadding = VERTICAL_PADDING; + if (this.isInPresentationMode) { + hPadding = vPadding = 4; + if (this._spreadMode !== SpreadMode.NONE) { + hPadding *= 2; + } + } else if (this._scrollMode === ScrollMode.HORIZONTAL) { + [hPadding, vPadding] = [vPadding, hPadding]; + } + const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this.#pageWidthScaleFactor; + const pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale; + switch (value) { + case "page-actual": + scale = 1; + break; + case "page-width": + scale = pageWidthScale; + break; + case "page-height": + scale = pageHeightScale; + break; + case "page-fit": + scale = Math.min(pageWidthScale, pageHeightScale); + break; + case "auto": + const horizontalScale = isPortraitOrientation(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale); + scale = Math.min(MAX_AUTO_SCALE, horizontalScale); + break; + default: + console.error(`#setScale: "${value}" is an unknown zoom value.`); + return; + } + options.preset = true; + this.#setScaleUpdatePages(scale, value, options); + } + } + #resetCurrentPageView() { + const pageView = this._pages[this._currentPageNumber - 1]; + if (this.isInPresentationMode) { + this.#setScale(this._currentScaleValue, { + noScroll: true + }); + } + this.#scrollIntoView(pageView); + } + pageLabelToPageNumber(label) { + if (!this._pageLabels) { + return null; + } + const i = this._pageLabels.indexOf(label); + if (i < 0) { + return null; + } + return i + 1; + } + scrollPageIntoView({ + pageNumber, + destArray = null, + allowNegativeOffset = false, + ignoreDestinationZoom = false, + center = null + }) { + if (!this.pdfDocument) { + return; + } + const pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1]; + if (!pageView) { + console.error(`scrollPageIntoView: "${pageNumber}" is not a valid pageNumber parameter.`); + return; + } + if (this.isInPresentationMode || !destArray) { + this._setCurrentPageNumber(pageNumber, true); + return; + } + let x = 0, + y = 0; + let width = 0, + height = 0, + widthScale, + heightScale; + const changeOrientation = pageView.rotation % 180 !== 0; + const pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / PixelsPerInch.PDF_TO_CSS_UNITS; + const pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / PixelsPerInch.PDF_TO_CSS_UNITS; + let scale = 0; + switch (destArray[1].name) { + case "XYZ": + x = destArray[2]; + y = destArray[3]; + scale = destArray[4]; + x = x !== null ? x : 0; + y = y !== null ? y : pageHeight; + break; + case "Fit": + case "FitB": + scale = "page-fit"; + break; + case "FitH": + case "FitBH": + y = destArray[2]; + scale = "page-width"; + if (y === null && this._location) { + x = this._location.left; + y = this._location.top; + } else if (typeof y !== "number" || y < 0) { + y = pageHeight; + } + break; + case "FitV": + case "FitBV": + x = destArray[2]; + width = pageWidth; + height = pageHeight; + scale = "page-height"; + break; + case "FitR": + x = destArray[2]; + y = destArray[3]; + width = destArray[4] - x; + height = destArray[5] - y; + let hPadding = SCROLLBAR_PADDING, + vPadding = VERTICAL_PADDING; + widthScale = (this.container.clientWidth - hPadding) / width / PixelsPerInch.PDF_TO_CSS_UNITS; + heightScale = (this.container.clientHeight - vPadding) / height / PixelsPerInch.PDF_TO_CSS_UNITS; + scale = Math.min(Math.abs(widthScale), Math.abs(heightScale)); + break; + default: + console.error(`scrollPageIntoView: "${destArray[1].name}" is not a valid destination type.`); + return; + } + if (!ignoreDestinationZoom) { + if (scale && scale !== this._currentScale) { + this.currentScaleValue = scale; + } else if (this._currentScale === UNKNOWN_SCALE) { + this.currentScaleValue = DEFAULT_SCALE_VALUE; + } + } + if (scale === "page-fit" && !destArray[4]) { + this.#scrollIntoView(pageView); + return; + } + const boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)]; + let left = Math.min(boundingRect[0][0], boundingRect[1][0]); + let top = Math.min(boundingRect[0][1], boundingRect[1][1]); + if (center) { + if (center === "both" || center === "vertical") { + top -= (this.container.clientHeight - Math.abs(boundingRect[1][1] - boundingRect[0][1])) / 2; + } + if (center === "both" || center === "horizontal") { + left -= (this.container.clientWidth - Math.abs(boundingRect[1][0] - boundingRect[0][0])) / 2; + } + } else if (!allowNegativeOffset) { + left = Math.max(left, 0); + top = Math.max(top, 0); + } + this.#scrollIntoView(pageView, { + left, + top + }); + } + _updateLocation(firstPage) { + const currentScale = this._currentScale; + const currentScaleValue = this._currentScaleValue; + const normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue; + const pageNumber = firstPage.id; + const currentPageView = this._pages[pageNumber - 1]; + const container = this.container; + const topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y); + const intLeft = Math.round(topLeft[0]); + const intTop = Math.round(topLeft[1]); + let pdfOpenParams = `#page=${pageNumber}`; + if (!this.isInPresentationMode) { + pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`; + } + this._location = { + pageNumber, + scale: normalizedScaleValue, + top: intTop, + left: intLeft, + rotation: this._pagesRotation, + pdfOpenParams + }; + } + update() { + const visible = this._getVisiblePages(); + const visiblePages = visible.views, + numVisiblePages = visiblePages.length; + if (numVisiblePages === 0) { + return; + } + const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1); + this.#buffer.resize(newCacheSize, visible.ids); + for (const { + view, + visibleArea + } of visiblePages) { + view.updateVisibleArea(visibleArea); + } + for (const view of this.#buffer) { + if (!visible.ids.has(view.id)) { + view.updateVisibleArea(null); + } + } + this.renderingQueue.renderHighestPriority(visible); + const isSimpleLayout = this._spreadMode === SpreadMode.NONE && (this._scrollMode === ScrollMode.PAGE || this._scrollMode === ScrollMode.VERTICAL); + const currentId = this._currentPageNumber; + let stillFullyVisible = false; + for (const page of visiblePages) { + if (page.percent < 100) { + break; + } + if (page.id === currentId && isSimpleLayout) { + stillFullyVisible = true; + break; + } + } + this._setCurrentPageNumber(stillFullyVisible ? currentId : visiblePages[0].id); + this._updateLocation(visible.first); + this.eventBus.dispatch("updateviewarea", { + source: this, + location: this._location + }); + } + #switchToEditAnnotationMode() { + const visible = this._getVisiblePages(); + const pagesToRefresh = []; + const { + ids, + views + } = visible; + for (const page of views) { + const { + view + } = page; + if (!view.hasEditableAnnotations()) { + ids.delete(view.id); + continue; + } + pagesToRefresh.push(page); + } + if (pagesToRefresh.length === 0) { + return null; + } + this.renderingQueue.renderHighestPriority({ + first: pagesToRefresh[0], + last: pagesToRefresh.at(-1), + views: pagesToRefresh, + ids + }); + return ids; + } + containsElement(element) { + return this.container.contains(element); + } + focus() { + this.container.focus(); + } + get _isContainerRtl() { + return getComputedStyle(this.container).direction === "rtl"; + } + get isInPresentationMode() { + return this.presentationModeState === PresentationModeState.FULLSCREEN; + } + get isChangingPresentationMode() { + return this.presentationModeState === PresentationModeState.CHANGING; + } + get isHorizontalScrollbarEnabled() { + return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth; + } + get isVerticalScrollbarEnabled() { + return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight; + } + _getVisiblePages() { + const views = this._scrollMode === ScrollMode.PAGE ? this.#scrollModePageState.pages : this._pages, + horizontal = this._scrollMode === ScrollMode.HORIZONTAL, + rtl = horizontal && this._isContainerRtl; + return getVisibleElements({ + scrollEl: this.container, + views, + sortByVisibility: true, + horizontal, + rtl + }); + } + cleanup() { + for (const pageView of this._pages) { + if (pageView.renderingState !== RenderingStates.FINISHED) { + pageView.reset(); + } + } + } + _cancelRendering() { + for (const pageView of this._pages) { + pageView.cancelRendering(); + } + } + async #ensurePdfPageLoaded(pageView) { + if (pageView.pdfPage) { + return pageView.pdfPage; + } + try { + const pdfPage = await this.pdfDocument.getPage(pageView.id); + if (!pageView.pdfPage) { + pageView.setPdfPage(pdfPage); + } + return pdfPage; + } catch (reason) { + console.error("Unable to get page for page view", reason); + return null; + } + } + #getScrollAhead(visible) { + if (visible.first?.id === 1) { + return true; + } else if (visible.last?.id === this.pagesCount) { + return false; + } + switch (this._scrollMode) { + case ScrollMode.PAGE: + return this.#scrollModePageState.scrollDown; + case ScrollMode.HORIZONTAL: + return this.scroll.right; + } + return this.scroll.down; + } + forceRendering(currentlyVisiblePages) { + const visiblePages = currentlyVisiblePages || this._getVisiblePages(); + const scrollAhead = this.#getScrollAhead(visiblePages); + const preRenderExtra = this._spreadMode !== SpreadMode.NONE && this._scrollMode !== ScrollMode.HORIZONTAL; + const ignoreDetailViews = this.#scaleTimeoutId !== null || this.#scrollTimeoutId !== null && visiblePages.views.some(page => page.detailView?.renderingCancelled); + const pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead, preRenderExtra, ignoreDetailViews); + if (pageView) { + this.#ensurePdfPageLoaded(pageView).then(() => { + this.renderingQueue.renderView(pageView); + }); + return true; + } + return false; + } + get hasEqualPageSizes() { + const firstPageView = this._pages[0]; + for (let i = 1, ii = this._pages.length; i < ii; ++i) { + const pageView = this._pages[i]; + if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) { + return false; + } + } + return true; + } + getPagesOverview() { + let initialOrientation; + return this._pages.map(pageView => { + const viewport = pageView.pdfPage.getViewport({ + scale: 1 + }); + const orientation = isPortraitOrientation(viewport); + if (initialOrientation === undefined) { + initialOrientation = orientation; + } else if (this.enablePrintAutoRotate && orientation !== initialOrientation) { + return { + width: viewport.height, + height: viewport.width, + rotation: (viewport.rotation - 90) % 360 + }; + } + return { + width: viewport.width, + height: viewport.height, + rotation: viewport.rotation + }; + }); + } + get optionalContentConfigPromise() { + if (!this.pdfDocument) { + return Promise.resolve(null); + } + if (!this._optionalContentConfigPromise) { + console.error("optionalContentConfigPromise: Not initialized yet."); + return this.pdfDocument.getOptionalContentConfig({ + intent: "display" + }); + } + return this._optionalContentConfigPromise; + } + set optionalContentConfigPromise(promise) { + if (!(promise instanceof Promise)) { + throw new Error(`Invalid optionalContentConfigPromise: ${promise}`); + } + if (!this.pdfDocument) { + return; + } + if (!this._optionalContentConfigPromise) { + return; + } + this._optionalContentConfigPromise = promise; + this.refresh(false, { + optionalContentConfigPromise: promise + }); + this.eventBus.dispatch("optionalcontentconfigchanged", { + source: this, + promise + }); + } + get scrollMode() { + return this._scrollMode; + } + set scrollMode(mode) { + if (this._scrollMode === mode) { + return; + } + if (!isValidScrollMode(mode)) { + throw new Error(`Invalid scroll mode: ${mode}`); + } + if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) { + return; + } + this._previousScrollMode = this._scrollMode; + this._scrollMode = mode; + this.eventBus.dispatch("scrollmodechanged", { + source: this, + mode + }); + this._updateScrollMode(this._currentPageNumber); + } + _updateScrollMode(pageNumber = null) { + const scrollMode = this._scrollMode, + viewer = this.viewer; + viewer.classList.toggle("scrollHorizontal", scrollMode === ScrollMode.HORIZONTAL); + viewer.classList.toggle("scrollWrapped", scrollMode === ScrollMode.WRAPPED); + if (!this.pdfDocument || !pageNumber) { + return; + } + if (scrollMode === ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + } else if (this._previousScrollMode === ScrollMode.PAGE) { + this._updateSpreadMode(); + } + if (this._currentScaleValue && isNaN(this._currentScaleValue)) { + this.#setScale(this._currentScaleValue, { + noScroll: true + }); + } + this._setCurrentPageNumber(pageNumber, true); + this.update(); + } + get spreadMode() { + return this._spreadMode; + } + set spreadMode(mode) { + if (this._spreadMode === mode) { + return; + } + if (!isValidSpreadMode(mode)) { + throw new Error(`Invalid spread mode: ${mode}`); + } + this._spreadMode = mode; + this.eventBus.dispatch("spreadmodechanged", { + source: this, + mode + }); + this._updateSpreadMode(this._currentPageNumber); + } + _updateSpreadMode(pageNumber = null) { + if (!this.pdfDocument) { + return; + } + const viewer = this.viewer, + pages = this._pages; + if (this._scrollMode === ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + } else { + viewer.textContent = ""; + if (this._spreadMode === SpreadMode.NONE) { + for (const pageView of this._pages) { + viewer.append(pageView.div); + } + } else { + const parity = this._spreadMode - 1; + let spread = null; + for (let i = 0, ii = pages.length; i < ii; ++i) { + if (spread === null) { + spread = document.createElement("div"); + spread.className = "spread"; + viewer.append(spread); + } else if (i % 2 === parity) { + spread = spread.cloneNode(false); + viewer.append(spread); + } + spread.append(pages[i].div); + } + } + } + if (!pageNumber) { + return; + } + if (this._currentScaleValue && isNaN(this._currentScaleValue)) { + this.#setScale(this._currentScaleValue, { + noScroll: true + }); + } + this._setCurrentPageNumber(pageNumber, true); + this.update(); + } + _getPageAdvance(currentPageNumber, previous = false) { + switch (this._scrollMode) { + case ScrollMode.WRAPPED: + { + const { + views + } = this._getVisiblePages(), + pageLayout = new Map(); + for (const { + id, + y, + percent, + widthPercent + } of views) { + if (percent === 0 || widthPercent < 100) { + continue; + } + let yArray = pageLayout.get(y); + if (!yArray) { + pageLayout.set(y, yArray ||= []); + } + yArray.push(id); + } + for (const yArray of pageLayout.values()) { + const currentIndex = yArray.indexOf(currentPageNumber); + if (currentIndex === -1) { + continue; + } + const numPages = yArray.length; + if (numPages === 1) { + break; + } + if (previous) { + for (let i = currentIndex - 1, ii = 0; i >= ii; i--) { + const currentId = yArray[i], + expectedId = yArray[i + 1] - 1; + if (currentId < expectedId) { + return currentPageNumber - expectedId; + } + } + } else { + for (let i = currentIndex + 1, ii = numPages; i < ii; i++) { + const currentId = yArray[i], + expectedId = yArray[i - 1] + 1; + if (currentId > expectedId) { + return expectedId - currentPageNumber; + } + } + } + if (previous) { + const firstId = yArray[0]; + if (firstId < currentPageNumber) { + return currentPageNumber - firstId + 1; + } + } else { + const lastId = yArray[numPages - 1]; + if (lastId > currentPageNumber) { + return lastId - currentPageNumber + 1; + } + } + break; + } + break; + } + case ScrollMode.HORIZONTAL: + { + break; + } + case ScrollMode.PAGE: + case ScrollMode.VERTICAL: + { + if (this._spreadMode === SpreadMode.NONE) { + break; + } + const parity = this._spreadMode - 1; + if (previous && currentPageNumber % 2 !== parity) { + break; + } else if (!previous && currentPageNumber % 2 === parity) { + break; + } + const { + views + } = this._getVisiblePages(), + expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1; + for (const { + id, + percent, + widthPercent + } of views) { + if (id !== expectedId) { + continue; + } + if (percent > 0 && widthPercent === 100) { + return 2; + } + break; + } + break; + } + } + return 1; + } + nextPage() { + const currentPageNumber = this._currentPageNumber, + pagesCount = this.pagesCount; + if (currentPageNumber >= pagesCount) { + return false; + } + const advance = this._getPageAdvance(currentPageNumber, false) || 1; + this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount); + return true; + } + previousPage() { + const currentPageNumber = this._currentPageNumber; + if (currentPageNumber <= 1) { + return false; + } + const advance = this._getPageAdvance(currentPageNumber, true) || 1; + this.currentPageNumber = Math.max(currentPageNumber - advance, 1); + return true; + } + updateScale({ + drawingDelay, + scaleFactor = null, + steps = null, + origin + }) { + if (steps === null && scaleFactor === null) { + throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided."); + } + if (!this.pdfDocument) { + return; + } + let newScale = this._currentScale; + if (scaleFactor > 0 && scaleFactor !== 1) { + newScale = Math.round(newScale * scaleFactor * 100) / 100; + } else if (steps) { + const delta = steps > 0 ? DEFAULT_SCALE_DELTA : 1 / DEFAULT_SCALE_DELTA; + const round = steps > 0 ? Math.ceil : Math.floor; + steps = Math.abs(steps); + do { + newScale = round((newScale * delta).toFixed(2) * 10) / 10; + } while (--steps > 0); + } + newScale = MathClamp(newScale, MIN_SCALE, MAX_SCALE); + this.#setScale(newScale, { + noScroll: false, + drawingDelay, + origin + }); + } + increaseScale(options = {}) { + this.updateScale({ + ...options, + steps: options.steps ?? 1 + }); + } + decreaseScale(options = {}) { + this.updateScale({ + ...options, + steps: -(options.steps ?? 1) + }); + } + #updateContainerHeightCss(height = this.container.clientHeight) { + if (height !== this.#previousContainerHeight) { + this.#previousContainerHeight = height; + docStyle.setProperty("--viewer-container-height", `${height}px`); + } + } + #resizeObserverCallback(entries) { + for (const entry of entries) { + if (entry.target === this.container) { + this.#updateContainerHeightCss(Math.floor(entry.borderBoxSize[0].blockSize)); + this.#containerTopLeft = null; + break; + } + } + } + get containerTopLeft() { + return this.#containerTopLeft ||= [this.container.offsetTop, this.container.offsetLeft]; + } + #cleanupTimeouts() { + if (this.#scaleTimeoutId !== null) { + clearTimeout(this.#scaleTimeoutId); + this.#scaleTimeoutId = null; + } + if (this.#scrollTimeoutId !== null) { + clearTimeout(this.#scrollTimeoutId); + this.#scrollTimeoutId = null; + } + } + #cleanupSwitchAnnotationEditorMode() { + this.#switchAnnotationEditorModeAC?.abort(); + this.#switchAnnotationEditorModeAC = null; + if (this.#switchAnnotationEditorModeTimeoutId !== null) { + clearTimeout(this.#switchAnnotationEditorModeTimeoutId); + this.#switchAnnotationEditorModeTimeoutId = null; + } + } + #preloadEditingData(mode) { + switch (mode) { + case AnnotationEditorType.STAMP: + this.#mlManager?.loadModel("altText"); + break; + case AnnotationEditorType.SIGNATURE: + this.#signatureManager?.loadSignatures(); + break; + } + } + get annotationEditorMode() { + return this.#annotationEditorUIManager ? this.#annotationEditorMode : AnnotationEditorType.DISABLE; + } + set annotationEditorMode({ + mode, + editId = null, + isFromKeyboard = false, + mustEnterInEditMode = false, + editComment = false + }) { + if (!this.#annotationEditorUIManager) { + throw new Error(`The AnnotationEditor is not enabled.`); + } + if (this.#annotationEditorMode === mode) { + return; + } + if (!isValidAnnotationEditorMode(mode)) { + throw new Error(`Invalid AnnotationEditor mode: ${mode}`); + } + if (!this.pdfDocument) { + return; + } + this.#preloadEditingData(mode); + const { + eventBus, + pdfDocument + } = this; + const updater = async () => { + this.#cleanupSwitchAnnotationEditorMode(); + this.#annotationEditorMode = mode; + await this.#annotationEditorUIManager.updateMode(mode, editId, isFromKeyboard, mustEnterInEditMode, editComment); + if (mode !== this.#annotationEditorMode || pdfDocument !== this.pdfDocument) { + return; + } + eventBus.dispatch("annotationeditormodechanged", { + source: this, + mode + }); + }; + if (mode === AnnotationEditorType.NONE || this.#annotationEditorMode === AnnotationEditorType.NONE) { + const isEditing = mode !== AnnotationEditorType.NONE; + if (!isEditing) { + this.pdfDocument.annotationStorage.resetModifiedIds(); + } + this.cleanup(); + for (const pageView of this._pages) { + pageView.toggleEditingMode(isEditing); + } + const idsToRefresh = this.#switchToEditAnnotationMode(); + if (isEditing && idsToRefresh) { + this.#cleanupSwitchAnnotationEditorMode(); + this.#switchAnnotationEditorModeAC = new AbortController(); + const signal = AbortSignal.any([this.#eventAbortController.signal, this.#switchAnnotationEditorModeAC.signal]); + eventBus._on("pagerendered", ({ + pageNumber + }) => { + idsToRefresh.delete(pageNumber); + if (idsToRefresh.size === 0) { + this.#switchAnnotationEditorModeTimeoutId = setTimeout(updater, 0); + } + }, { + signal + }); + return; + } + } + updater(); + } + refresh(noUpdate = false, updateArgs = Object.create(null)) { + if (!this.pdfDocument) { + return; + } + for (const pageView of this._pages) { + pageView.update(updateArgs); + } + this.#cleanupTimeouts(); + if (!noUpdate) { + this.update(); + } + } +} + +;// ./web/secondary_toolbar.js + + +class SecondaryToolbar { + #opts; + constructor(options, eventBus) { + this.#opts = options; + const buttons = [{ + element: options.presentationModeButton, + eventName: "presentationmode", + close: true + }, { + element: options.printButton, + eventName: "print", + close: true + }, { + element: options.downloadButton, + eventName: "download", + close: true + }, { + element: options.viewBookmarkButton, + eventName: null, + close: true + }, { + element: options.firstPageButton, + eventName: "firstpage", + close: true + }, { + element: options.lastPageButton, + eventName: "lastpage", + close: true + }, { + element: options.pageRotateCwButton, + eventName: "rotatecw", + close: false + }, { + element: options.pageRotateCcwButton, + eventName: "rotateccw", + close: false + }, { + element: options.cursorSelectToolButton, + eventName: "switchcursortool", + eventDetails: { + tool: CursorTool.SELECT + }, + close: true + }, { + element: options.cursorHandToolButton, + eventName: "switchcursortool", + eventDetails: { + tool: CursorTool.HAND + }, + close: true + }, { + element: options.scrollPageButton, + eventName: "switchscrollmode", + eventDetails: { + mode: ScrollMode.PAGE + }, + close: true + }, { + element: options.scrollVerticalButton, + eventName: "switchscrollmode", + eventDetails: { + mode: ScrollMode.VERTICAL + }, + close: true + }, { + element: options.scrollHorizontalButton, + eventName: "switchscrollmode", + eventDetails: { + mode: ScrollMode.HORIZONTAL + }, + close: true + }, { + element: options.scrollWrappedButton, + eventName: "switchscrollmode", + eventDetails: { + mode: ScrollMode.WRAPPED + }, + close: true + }, { + element: options.spreadNoneButton, + eventName: "switchspreadmode", + eventDetails: { + mode: SpreadMode.NONE + }, + close: true + }, { + element: options.spreadOddButton, + eventName: "switchspreadmode", + eventDetails: { + mode: SpreadMode.ODD + }, + close: true + }, { + element: options.spreadEvenButton, + eventName: "switchspreadmode", + eventDetails: { + mode: SpreadMode.EVEN + }, + close: true + }, { + element: options.imageAltTextSettingsButton, + eventName: "imagealttextsettings", + close: true + }, { + element: options.documentPropertiesButton, + eventName: "documentproperties", + close: true + }]; + this.eventBus = eventBus; + this.opened = false; + this.#bindListeners(buttons); + this.reset(); + } + get isOpen() { + return this.opened; + } + setPageNumber(pageNumber) { + this.pageNumber = pageNumber; + this.#updateUIState(); + } + setPagesCount(pagesCount) { + this.pagesCount = pagesCount; + this.#updateUIState(); + } + reset() { + this.pageNumber = 0; + this.pagesCount = 0; + this.#updateUIState(); + this.eventBus.dispatch("switchcursortool", { + source: this, + reset: true + }); + this.#scrollModeChanged({ + mode: ScrollMode.VERTICAL + }); + this.#spreadModeChanged({ + mode: SpreadMode.NONE + }); + } + #updateUIState() { + const { + firstPageButton, + lastPageButton, + pageRotateCwButton, + pageRotateCcwButton + } = this.#opts; + firstPageButton.disabled = this.pageNumber <= 1; + lastPageButton.disabled = this.pageNumber >= this.pagesCount; + pageRotateCwButton.disabled = this.pagesCount === 0; + pageRotateCcwButton.disabled = this.pagesCount === 0; + } + #bindListeners(buttons) { + const { + eventBus + } = this; + const { + toggleButton + } = this.#opts; + toggleButton.addEventListener("click", this.toggle.bind(this)); + for (const { + element, + eventName, + close, + eventDetails + } of buttons) { + element.addEventListener("click", evt => { + if (eventName !== null) { + eventBus.dispatch(eventName, { + source: this, + ...eventDetails + }); + } + if (close) { + this.close(); + } + eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "buttons", + data: { + id: element.id + } + } + }); + }); + } + eventBus._on("cursortoolchanged", this.#cursorToolChanged.bind(this)); + eventBus._on("scrollmodechanged", this.#scrollModeChanged.bind(this)); + eventBus._on("spreadmodechanged", this.#spreadModeChanged.bind(this)); + } + #cursorToolChanged({ + tool, + disabled + }) { + const { + cursorSelectToolButton, + cursorHandToolButton + } = this.#opts; + toggleCheckedBtn(cursorSelectToolButton, tool === CursorTool.SELECT); + toggleCheckedBtn(cursorHandToolButton, tool === CursorTool.HAND); + cursorSelectToolButton.disabled = disabled; + cursorHandToolButton.disabled = disabled; + } + #scrollModeChanged({ + mode + }) { + const { + scrollPageButton, + scrollVerticalButton, + scrollHorizontalButton, + scrollWrappedButton, + spreadNoneButton, + spreadOddButton, + spreadEvenButton + } = this.#opts; + toggleCheckedBtn(scrollPageButton, mode === ScrollMode.PAGE); + toggleCheckedBtn(scrollVerticalButton, mode === ScrollMode.VERTICAL); + toggleCheckedBtn(scrollHorizontalButton, mode === ScrollMode.HORIZONTAL); + toggleCheckedBtn(scrollWrappedButton, mode === ScrollMode.WRAPPED); + const forceScrollModePage = this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE; + scrollPageButton.disabled = forceScrollModePage; + scrollVerticalButton.disabled = forceScrollModePage; + scrollHorizontalButton.disabled = forceScrollModePage; + scrollWrappedButton.disabled = forceScrollModePage; + const isHorizontal = mode === ScrollMode.HORIZONTAL; + spreadNoneButton.disabled = isHorizontal; + spreadOddButton.disabled = isHorizontal; + spreadEvenButton.disabled = isHorizontal; + } + #spreadModeChanged({ + mode + }) { + const { + spreadNoneButton, + spreadOddButton, + spreadEvenButton + } = this.#opts; + toggleCheckedBtn(spreadNoneButton, mode === SpreadMode.NONE); + toggleCheckedBtn(spreadOddButton, mode === SpreadMode.ODD); + toggleCheckedBtn(spreadEvenButton, mode === SpreadMode.EVEN); + } + open() { + if (this.opened) { + return; + } + this.opened = true; + const { + toggleButton, + toolbar + } = this.#opts; + toggleExpandedBtn(toggleButton, true, toolbar); + } + close() { + if (!this.opened) { + return; + } + this.opened = false; + const { + toggleButton, + toolbar + } = this.#opts; + toggleExpandedBtn(toggleButton, false, toolbar); + } + toggle() { + if (this.opened) { + this.close(); + } else { + this.open(); + } + } +} + +;// ./web/signature_manager.js + +const DEFAULT_HEIGHT_IN_PAGE = 40; +class SignatureManager { + #addButton; + #tabsToAltText = null; + #clearButton; + #clearDescription; + #currentEditor; + #description; + #dialog; + #drawCurves = null; + #drawPlaceholder; + #drawPath = null; + #drawPathString = ""; + #drawPoints = null; + #drawSVG; + #drawThickness; + #errorBar; + #errorDescription; + #errorTitle; + #extractedSignatureData = null; + #imagePath = null; + #imagePicker; + #imagePickerLink; + #imagePlaceholder; + #imageSVG; + #saveCheckbox; + #saveContainer; + #tabButtons; + #addSignatureToolbarButton; + #loadSignaturesPromise = null; + #typeInput; + #currentTab = null; + #currentTabAC = null; + #hasDescriptionChanged = false; + #eventBus; + #isStorageFull = false; + #l10n; + #overlayManager; + #editDescriptionDialog; + #signatureStorage; + #uiManager = null; + static #l10nDescription = null; + constructor({ + dialog, + panels, + typeButton, + typeInput, + drawButton, + drawPlaceholder, + drawSVG, + drawThickness, + imageButton, + imageSVG, + imagePlaceholder, + imagePicker, + imagePickerLink, + description, + clearButton, + cancelButton, + addButton, + errorCloseButton, + errorBar, + errorTitle, + errorDescription, + saveCheckbox, + saveContainer + }, editSignatureElements, addSignatureToolbarButton, overlayManager, l10n, signatureStorage, eventBus) { + this.#addButton = addButton; + this.#clearButton = clearButton; + this.#clearDescription = description.lastElementChild; + this.#description = description.firstElementChild; + this.#dialog = dialog; + this.#drawSVG = drawSVG; + this.#drawPlaceholder = drawPlaceholder; + this.#drawThickness = drawThickness; + this.#errorBar = errorBar; + this.#errorTitle = errorTitle; + this.#errorDescription = errorDescription; + this.#imageSVG = imageSVG; + this.#imagePlaceholder = imagePlaceholder; + this.#imagePicker = imagePicker; + this.#imagePickerLink = imagePickerLink; + this.#overlayManager = overlayManager; + this.#saveCheckbox = saveCheckbox; + this.#saveContainer = saveContainer; + this.#addSignatureToolbarButton = addSignatureToolbarButton; + this.#typeInput = typeInput; + this.#l10n = l10n; + this.#signatureStorage = signatureStorage; + this.#eventBus = eventBus; + this.#editDescriptionDialog = new EditDescriptionDialog(editSignatureElements, overlayManager); + SignatureManager.#l10nDescription ||= Object.freeze({ + signature: "pdfjs-editor-add-signature-description-default-when-drawing", + errorUploadTitle: "pdfjs-editor-add-signature-image-upload-error-title", + errorUploadDescription: "pdfjs-editor-add-signature-image-upload-error-description", + errorNoDataTitle: "pdfjs-editor-add-signature-image-no-data-error-title", + errorNoDataDescription: "pdfjs-editor-add-signature-image-no-data-error-description" + }); + dialog.addEventListener("close", this.#close.bind(this)); + dialog.addEventListener("contextmenu", e => { + const { + target + } = e; + if (target !== this.#typeInput && target !== this.#description) { + e.preventDefault(); + } + }); + dialog.addEventListener("drop", e => { + stopEvent(e); + }); + cancelButton.addEventListener("click", this.#cancel.bind(this)); + addButton.addEventListener("click", this.#add.bind(this)); + clearButton.addEventListener("click", () => { + this.#reportTelemetry({ + type: "signature", + action: "pdfjs.signature.clear", + data: { + type: this.#currentTab + } + }); + this.#initTab(null); + }, { + passive: true + }); + this.#description.addEventListener("input", () => { + this.#clearDescription.disabled = this.#description.value === ""; + }, { + passive: true + }); + this.#clearDescription.addEventListener("click", () => { + this.#description.value = ""; + this.#clearDescription.disabled = true; + }, { + passive: true + }); + errorCloseButton.addEventListener("click", () => { + errorBar.hidden = true; + }, { + passive: true + }); + this.#initTabButtons(typeButton, drawButton, imageButton, panels); + imagePicker.accept = SupportedImageMimeTypes.join(","); + eventBus._on("storedsignatureschanged", this.#signaturesChanged.bind(this)); + overlayManager.register(dialog); + } + #initTabButtons(typeButton, drawButton, imageButton, panels) { + const buttons = this.#tabButtons = new Map([["type", typeButton], ["draw", drawButton], ["image", imageButton]]); + const tabCallback = e => { + for (const [name, button] of buttons) { + if (button === e.target) { + button.setAttribute("aria-selected", true); + button.setAttribute("tabindex", 0); + panels.setAttribute("data-selected", name); + this.#initTab(name); + } else { + button.setAttribute("aria-selected", false); + button.setAttribute("tabindex", -1); + } + } + }; + const buttonsArray = Array.from(buttons.values()); + for (let i = 0, ii = buttonsArray.length; i < ii; i++) { + const button = buttonsArray[i]; + button.addEventListener("click", tabCallback, { + passive: true + }); + button.addEventListener("keydown", ({ + key + }) => { + if (key !== "ArrowLeft" && key !== "ArrowRight") { + return; + } + buttonsArray[i + (key === "ArrowLeft" ? -1 : 1)]?.focus(); + }, { + passive: true + }); + } + } + #resetCommon() { + this.#hasDescriptionChanged = false; + this.#description.value = ""; + if (this.#currentTab) { + this.#tabsToAltText.get(this.#currentTab).value = ""; + } + } + #resetTab(name) { + switch (name) { + case "type": + this.#typeInput.value = ""; + break; + case "draw": + this.#drawCurves = null; + this.#drawPoints = null; + this.#drawPathString = ""; + this.#drawPath?.remove(); + this.#drawPath = null; + this.#drawPlaceholder.hidden = false; + this.#drawThickness.value = 1; + break; + case "image": + this.#imagePlaceholder.hidden = false; + this.#imagePath?.remove(); + this.#imagePath = null; + break; + } + } + #initTab(name) { + if (name && this.#currentTab === name) { + return; + } + if (this.#currentTab) { + this.#tabsToAltText.get(this.#currentTab).value = this.#description.value; + } + if (name) { + this.#currentTab = name; + } + this.#errorBar.hidden = true; + const reset = !name; + if (reset) { + this.#resetCommon(); + } else { + this.#description.value = this.#tabsToAltText.get(this.#currentTab).value; + } + this.#clearDescription.disabled = this.#description.value === ""; + this.#currentTabAC?.abort(); + this.#currentTabAC = new AbortController(); + switch (this.#currentTab) { + case "type": + this.#initTypeTab(reset); + break; + case "draw": + this.#initDrawTab(reset); + break; + case "image": + this.#initImageTab(reset); + break; + } + } + #disableButtons(value) { + if (!value || !this.#isStorageFull) { + this.#saveCheckbox.disabled = !value; + } + this.#clearButton.disabled = this.#addButton.disabled = this.#description.disabled = !value; + } + #initTypeTab(reset) { + if (reset) { + this.#resetTab("type"); + } + this.#disableButtons(this.#typeInput.value); + const { + signal + } = this.#currentTabAC; + const options = { + passive: true, + signal + }; + this.#typeInput.addEventListener("input", () => { + const { + value + } = this.#typeInput; + if (!this.#hasDescriptionChanged) { + this.#tabsToAltText.get("type").default = this.#description.value = value; + this.#clearDescription.disabled = value === ""; + } + this.#disableButtons(value); + }, options); + this.#description.addEventListener("input", () => { + this.#hasDescriptionChanged = this.#typeInput.value !== this.#description.value; + }, options); + } + #initDrawTab(reset) { + if (reset) { + this.#resetTab("draw"); + } + this.#disableButtons(this.#drawPath); + const { + signal + } = this.#currentTabAC; + const options = { + signal + }; + let currentPointerId = NaN; + const drawCallback = e => { + const { + pointerId + } = e; + if (!isNaN(currentPointerId) && currentPointerId !== pointerId) { + return; + } + currentPointerId = pointerId; + e.preventDefault(); + this.#drawSVG.setPointerCapture(pointerId); + const { + width: drawWidth, + height: drawHeight + } = this.#drawSVG.getBoundingClientRect(); + let { + offsetX, + offsetY + } = e; + offsetX = Math.round(offsetX); + offsetY = Math.round(offsetY); + if (e.target === this.#drawPlaceholder) { + this.#drawPlaceholder.hidden = true; + } + if (!this.#drawCurves) { + this.#drawCurves = { + width: drawWidth, + height: drawHeight, + thickness: parseInt(this.#drawThickness.value), + curves: [] + }; + this.#disableButtons(true); + const svgFactory = new DOMSVGFactory(); + const path = this.#drawPath = svgFactory.createElement("path"); + path.setAttribute("stroke-width", this.#drawThickness.value); + this.#drawSVG.append(path); + this.#drawSVG.addEventListener("pointerdown", drawCallback, options); + this.#drawPlaceholder.removeEventListener("pointerdown", drawCallback); + if (this.#description.value === "") { + this.#l10n.get(SignatureManager.#l10nDescription.signature).then(description => { + this.#tabsToAltText.get("draw").default = description; + this.#description.value ||= description; + this.#clearDescription.disabled = this.#description.value === ""; + }); + } + } + this.#drawPoints = [offsetX, offsetY]; + this.#drawCurves.curves.push({ + points: this.#drawPoints + }); + this.#drawPathString += `M ${offsetX} ${offsetY}`; + this.#drawPath.setAttribute("d", this.#drawPathString); + const finishDrawAC = new AbortController(); + const listenerDrawOptions = { + signal: AbortSignal.any([signal, finishDrawAC.signal]) + }; + this.#drawSVG.addEventListener("contextmenu", noContextMenu, listenerDrawOptions); + this.#drawSVG.addEventListener("pointermove", evt => { + evt.preventDefault(); + let { + offsetX: x, + offsetY: y + } = evt; + x = Math.round(x); + y = Math.round(y); + const drawPoints = this.#drawPoints; + if (x < 0 || y < 0 || x > drawWidth || y > drawHeight || x === drawPoints.at(-2) && y === drawPoints.at(-1)) { + return; + } + if (drawPoints.length >= 4) { + const [x1, y1, x2, y2] = drawPoints.slice(-4); + this.#drawPathString += `C${(x1 + 5 * x2) / 6} ${(y1 + 5 * y2) / 6} ${(5 * x2 + x) / 6} ${(5 * y2 + y) / 6} ${(x2 + x) / 2} ${(y2 + y) / 2}`; + } else { + this.#drawPathString += `L${x} ${y}`; + } + drawPoints.push(x, y); + this.#drawPath.setAttribute("d", this.#drawPathString); + }, listenerDrawOptions); + this.#drawSVG.addEventListener("pointerup", evt => { + const { + pointerId: pId + } = evt; + if (!isNaN(currentPointerId) && currentPointerId !== pId) { + return; + } + currentPointerId = NaN; + evt.preventDefault(); + this.#drawSVG.releasePointerCapture(pId); + finishDrawAC.abort(); + if (this.#drawPoints.length === 2) { + this.#drawPathString += `L${this.#drawPoints[0]} ${this.#drawPoints[1]}`; + this.#drawPath.setAttribute("d", this.#drawPathString); + } + }, listenerDrawOptions); + }; + if (this.#drawCurves) { + this.#drawSVG.addEventListener("pointerdown", drawCallback, options); + } else { + this.#drawPlaceholder.addEventListener("pointerdown", drawCallback, options); + } + this.#drawThickness.addEventListener("input", () => { + const { + value: thickness + } = this.#drawThickness; + this.#drawThickness.setAttribute("data-l10n-args", JSON.stringify({ + thickness + })); + if (!this.#drawCurves) { + return; + } + this.#drawPath.setAttribute("stroke-width", thickness); + this.#drawCurves.thickness = thickness; + }, options); + } + #showError(type) { + this.#errorTitle.setAttribute("data-l10n-id", SignatureManager.#l10nDescription[`error${type}Title`]); + this.#errorDescription.setAttribute("data-l10n-id", SignatureManager.#l10nDescription[`error${type}Description`]); + this.#errorBar.hidden = false; + } + #initImageTab(reset) { + if (reset) { + this.#resetTab("image"); + } + this.#disableButtons(this.#imagePath); + const { + signal + } = this.#currentTabAC; + const options = { + signal + }; + const passiveOptions = { + passive: true, + signal + }; + this.#imagePickerLink.addEventListener("keydown", e => { + const { + key + } = e; + if (key === "Enter" || key === " ") { + stopEvent(e); + this.#imagePicker.click(); + } + }, options); + this.#imagePicker.addEventListener("click", () => { + this.#dialog.classList.toggle("waiting", true); + }, passiveOptions); + this.#imagePicker.addEventListener("change", async () => { + const file = this.#imagePicker.files?.[0]; + if (!file || !SupportedImageMimeTypes.includes(file.type)) { + this.#showError("Upload"); + this.#dialog.classList.toggle("waiting", false); + return; + } + await this.#extractSignature(file); + }, passiveOptions); + this.#imagePicker.addEventListener("cancel", () => { + this.#dialog.classList.toggle("waiting", false); + }, passiveOptions); + this.#imagePlaceholder.addEventListener("dragover", e => { + const { + dataTransfer + } = e; + for (const { + type + } of dataTransfer.items) { + if (!SupportedImageMimeTypes.includes(type)) { + continue; + } + dataTransfer.dropEffect = dataTransfer.effectAllowed === "copy" ? "copy" : "move"; + stopEvent(e); + return; + } + dataTransfer.dropEffect = "none"; + }, options); + this.#imagePlaceholder.addEventListener("drop", e => { + const { + dataTransfer: { + files + } + } = e; + if (!files?.length) { + return; + } + for (const file of files) { + if (SupportedImageMimeTypes.includes(file.type)) { + this.#extractSignature(file); + break; + } + } + stopEvent(e); + this.#dialog.classList.toggle("waiting", true); + }, options); + } + async #extractSignature(file) { + let data; + try { + data = await this.#uiManager.imageManager.getFromFile(file); + } catch (e) { + console.error("SignatureManager.#extractSignature.", e); + } + if (!data) { + this.#showError("Upload"); + this.#dialog.classList.toggle("waiting", false); + return; + } + const lineData = this.#extractedSignatureData = this.#currentEditor.getFromImage(data.bitmap); + if (!lineData) { + this.#showError("NoData"); + this.#dialog.classList.toggle("waiting", false); + return; + } + const { + outline + } = lineData; + this.#imagePlaceholder.hidden = true; + this.#disableButtons(true); + const svgFactory = new DOMSVGFactory(); + const path = this.#imagePath = svgFactory.createElement("path"); + this.#imageSVG.setAttribute("viewBox", outline.viewBox); + this.#imageSVG.setAttribute("preserveAspectRatio", "xMidYMid meet"); + this.#imageSVG.append(path); + path.setAttribute("d", outline.toSVGPath()); + this.#tabsToAltText.get("image").default = file.name; + if (this.#description.value === "") { + this.#description.value = file.name || ""; + this.#clearDescription.disabled = this.#description.value === ""; + } + this.#dialog.classList.toggle("waiting", false); + } + #getOutlineForType() { + return this.#currentEditor.getFromText(this.#typeInput.value, window.getComputedStyle(this.#typeInput)); + } + #getOutlineForDraw() { + const { + width, + height + } = this.#drawSVG.getBoundingClientRect(); + return this.#currentEditor.getDrawnSignature(this.#drawCurves, width, height); + } + #reportTelemetry(data) { + this.#eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "editing", + data + } + }); + } + #addToolbarButton(signatureData, uuid, description) { + const { + curves, + areContours, + thickness, + width, + height + } = signatureData; + const maxDim = Math.max(width, height); + const outlineData = SignatureExtractor.processDrawnLines({ + lines: { + curves, + thickness, + width, + height + }, + pageWidth: maxDim, + pageHeight: maxDim, + rotation: 0, + innerMargin: 0, + mustSmooth: false, + areContours + }); + if (!outlineData) { + return; + } + const { + outline + } = outlineData; + const svgFactory = new DOMSVGFactory(); + const div = document.createElement("div"); + const button = document.createElement("button"); + button.addEventListener("click", () => { + this.#eventBus.dispatch("switchannotationeditorparams", { + source: this, + type: AnnotationEditorParamsType.CREATE, + value: { + signatureData: { + lines: { + curves, + thickness, + width, + height + }, + mustSmooth: false, + areContours, + description, + uuid, + heightInPage: DEFAULT_HEIGHT_IN_PAGE + } + } + }); + }); + div.append(button); + div.classList.add("toolbarAddSignatureButtonContainer"); + const svg = svgFactory.create(1, 1, true); + button.append(svg); + const span = document.createElement("span"); + span.ariaHidden = true; + button.append(span); + button.classList.add("toolbarAddSignatureButton"); + button.type = "button"; + span.textContent = description; + button.setAttribute("data-l10n-id", "pdfjs-editor-add-saved-signature-button"); + button.setAttribute("data-l10n-args", JSON.stringify({ + description + })); + button.tabIndex = 0; + const path = svgFactory.createElement("path"); + svg.append(path); + svg.setAttribute("viewBox", outline.viewBox); + svg.setAttribute("preserveAspectRatio", "xMidYMid meet"); + if (areContours) { + path.classList.add("contours"); + } + path.setAttribute("d", outline.toSVGPath()); + const deleteButton = document.createElement("button"); + div.append(deleteButton); + deleteButton.classList.add("toolbarButton", "deleteButton"); + deleteButton.setAttribute("data-l10n-id", "pdfjs-editor-delete-signature-button1"); + deleteButton.type = "button"; + deleteButton.tabIndex = 0; + deleteButton.addEventListener("click", async () => { + if (await this.#signatureStorage.delete(uuid)) { + div.remove(); + this.#reportTelemetry({ + type: "signature", + action: "pdfjs.signature.delete_saved", + data: { + savedCount: await this.#signatureStorage.size() + } + }); + } + }); + const deleteSpan = document.createElement("span"); + deleteButton.append(deleteSpan); + deleteSpan.setAttribute("data-l10n-id", "pdfjs-editor-delete-signature-button-label1"); + this.#addSignatureToolbarButton.before(div); + } + async #signaturesChanged() { + const parent = this.#addSignatureToolbarButton.parentElement; + while (parent.firstElementChild !== this.#addSignatureToolbarButton) { + parent.firstElementChild.remove(); + } + this.#loadSignaturesPromise = null; + await this.loadSignatures(true); + } + getSignature(params) { + return this.open(params); + } + async loadSignatures(reload = false) { + if (!this.#addSignatureToolbarButton || !reload && this.#addSignatureToolbarButton.previousElementSibling || !this.#signatureStorage) { + return; + } + if (!this.#loadSignaturesPromise) { + this.#loadSignaturesPromise = this.#signatureStorage.getAll().then(async signatures => [signatures, await Promise.all(Array.from(signatures.values(), ({ + signatureData + }) => SignatureExtractor.decompressSignature(signatureData)))]); + if (!reload) { + return; + } + } + const [signatures, signaturesData] = await this.#loadSignaturesPromise; + this.#loadSignaturesPromise = null; + let i = 0; + for (const [uuid, { + description + }] of signatures) { + const data = signaturesData[i++]; + if (!data) { + continue; + } + data.curves = data.outlines.map(points => ({ + points + })); + delete data.outlines; + this.#addToolbarButton(data, uuid, description); + } + } + async renderEditButton(editor) { + const button = document.createElement("button"); + button.classList.add("altText", "editDescription"); + button.tabIndex = 0; + if (editor.description) { + button.title = editor.description; + } + const span = document.createElement("span"); + button.append(span); + span.setAttribute("data-l10n-id", "pdfjs-editor-add-signature-edit-button-label"); + button.addEventListener("click", () => { + this.#editDescriptionDialog.open(editor); + }, { + passive: true + }); + return button; + } + async open({ + uiManager, + editor + }) { + this.#tabsToAltText ||= new Map(this.#tabButtons.keys().map(name => [name, { + value: "", + default: "" + }])); + this.#uiManager = uiManager; + this.#currentEditor = editor; + this.#uiManager.removeEditListeners(); + const isStorageFull = this.#isStorageFull = await this.#signatureStorage.isFull(); + this.#saveContainer.classList.toggle("fullStorage", isStorageFull); + this.#saveCheckbox.checked = !isStorageFull; + await this.#overlayManager.open(this.#dialog); + const tabType = this.#tabButtons.get("type"); + tabType.focus(); + tabType.click(); + } + #cancel() { + this.#finish(); + } + #finish() { + this.#overlayManager.closeIfActive(this.#dialog); + } + #close() { + if (this.#currentEditor._drawId === null) { + this.#currentEditor.remove(); + } + this.#uiManager?.addEditListeners(); + this.#currentTabAC?.abort(); + this.#currentTabAC = null; + this.#uiManager = null; + this.#currentEditor = null; + this.#resetCommon(); + for (const [name] of this.#tabButtons) { + this.#resetTab(name); + } + this.#disableButtons(false); + this.#currentTab = null; + this.#tabsToAltText = null; + } + async #add() { + let data; + const type = this.#currentTab; + switch (type) { + case "type": + data = this.#getOutlineForType(); + break; + case "draw": + data = this.#getOutlineForDraw(); + break; + case "image": + data = this.#extractedSignatureData; + break; + } + let uuid = null; + const description = this.#description.value; + if (this.#saveCheckbox.checked) { + const { + newCurves, + areContours, + thickness, + width, + height + } = data; + const signatureData = await SignatureExtractor.compressSignature({ + outlines: newCurves, + areContours, + thickness, + width, + height + }); + uuid = await this.#signatureStorage.create({ + description, + signatureData + }); + if (uuid) { + this.#addToolbarButton({ + curves: newCurves.map(points => ({ + points + })), + areContours, + thickness, + width, + height + }, uuid, description); + } else { + console.warn("SignatureManager.add: cannot save the signature."); + } + } + const altText = this.#tabsToAltText.get(type); + this.#reportTelemetry({ + type: "signature", + action: "pdfjs.signature.created", + data: { + type, + saved: !!uuid, + savedCount: await this.#signatureStorage.size(), + descriptionChanged: description !== altText.default + } + }); + this.#currentEditor.addSignature(data, DEFAULT_HEIGHT_IN_PAGE, this.#description.value, uuid); + this.#finish(); + } + destroy() { + this.#uiManager = null; + this.#finish(); + } +} +class EditDescriptionDialog { + #currentEditor; + #previousDescription; + #description; + #dialog; + #overlayManager; + #signatureSVG; + #uiManager; + constructor({ + dialog, + description, + cancelButton, + updateButton, + editSignatureView + }, overlayManager) { + const descriptionInput = this.#description = description.firstElementChild; + this.#signatureSVG = editSignatureView; + this.#dialog = dialog; + this.#overlayManager = overlayManager; + dialog.addEventListener("close", this.#close.bind(this)); + dialog.addEventListener("contextmenu", e => { + if (e.target !== this.#description) { + e.preventDefault(); + } + }); + cancelButton.addEventListener("click", this.#cancel.bind(this)); + updateButton.addEventListener("click", this.#update.bind(this)); + const clearDescription = description.lastElementChild; + clearDescription.addEventListener("click", () => { + descriptionInput.value = ""; + clearDescription.disabled = true; + updateButton.disabled = this.#previousDescription === ""; + }); + descriptionInput.addEventListener("input", () => { + const { + value + } = descriptionInput; + clearDescription.disabled = value === ""; + updateButton.disabled = value === this.#previousDescription; + editSignatureView.setAttribute("aria-label", value); + }, { + passive: true + }); + overlayManager.register(dialog); + } + async open(editor) { + this.#uiManager = editor._uiManager; + this.#currentEditor = editor; + this.#previousDescription = this.#description.value = editor.description; + this.#description.dispatchEvent(new Event("input")); + this.#uiManager.removeEditListeners(); + const { + areContours, + outline + } = editor.getSignaturePreview(); + const svgFactory = new DOMSVGFactory(); + const path = svgFactory.createElement("path"); + this.#signatureSVG.append(path); + this.#signatureSVG.setAttribute("viewBox", outline.viewBox); + path.setAttribute("d", outline.toSVGPath()); + if (areContours) { + path.classList.add("contours"); + } + await this.#overlayManager.open(this.#dialog); + } + async #update() { + this.#currentEditor._reportTelemetry({ + action: "pdfjs.signature.edit_description", + data: { + hasBeenChanged: true + } + }); + this.#currentEditor.description = this.#description.value; + this.#finish(); + } + #cancel() { + this.#currentEditor._reportTelemetry({ + action: "pdfjs.signature.edit_description", + data: { + hasBeenChanged: false + } + }); + this.#finish(); + } + #finish() { + this.#overlayManager.closeIfActive(this.#dialog); + } + #close() { + this.#uiManager?.addEditListeners(); + this.#uiManager = null; + this.#currentEditor = null; + this.#signatureSVG.firstElementChild.remove(); + } +} + +;// ./web/toolbar.js + + +class Toolbar { + #colorPicker = null; + #opts; + constructor(options, eventBus, toolbarDensity = 0) { + this.#opts = options; + this.eventBus = eventBus; + const buttons = [{ + element: options.previous, + eventName: "previouspage" + }, { + element: options.next, + eventName: "nextpage" + }, { + element: options.zoomIn, + eventName: "zoomin" + }, { + element: options.zoomOut, + eventName: "zoomout" + }, { + element: options.print, + eventName: "print" + }, { + element: options.download, + eventName: "download" + }, { + element: options.editorCommentButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorCommentButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.POPUP; + } + } + }, { + element: options.editorFreeTextButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorFreeTextButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.FREETEXT; + } + } + }, { + element: options.editorHighlightButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorHighlightButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.HIGHLIGHT; + } + } + }, { + element: options.editorInkButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorInkButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.INK; + } + } + }, { + element: options.editorStampButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorStampButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.STAMP; + } + }, + telemetry: { + type: "editing", + data: { + action: "pdfjs.image.icon_click" + } + } + }, { + element: options.editorSignatureButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorSignatureButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.SIGNATURE; + } + } + }]; + this.#bindListeners(buttons); + this.#updateToolbarDensity({ + value: toolbarDensity + }); + this.reset(); + } + #updateToolbarDensity({ + value + }) { + let name = "normal"; + switch (value) { + case 1: + name = "compact"; + break; + case 2: + name = "touch"; + break; + } + document.documentElement.setAttribute("data-toolbar-density", name); + } + setPageNumber(pageNumber, pageLabel) { + this.pageNumber = pageNumber; + this.pageLabel = pageLabel; + this.#updateUIState(false); + } + setPagesCount(pagesCount, hasPageLabels) { + this.pagesCount = pagesCount; + this.hasPageLabels = hasPageLabels; + this.#updateUIState(true); + } + setPageScale(pageScaleValue, pageScale) { + this.pageScaleValue = (pageScaleValue || pageScale).toString(); + this.pageScale = pageScale; + this.#updateUIState(false); + } + reset() { + this.#colorPicker = null; + this.pageNumber = 0; + this.pageLabel = null; + this.hasPageLabels = false; + this.pagesCount = 0; + this.pageScaleValue = DEFAULT_SCALE_VALUE; + this.pageScale = DEFAULT_SCALE; + this.#updateUIState(true); + this.updateLoadingIndicatorState(); + this.#editorModeChanged({ + mode: AnnotationEditorType.DISABLE + }); + } + #bindListeners(buttons) { + const { + eventBus + } = this; + const { + editorHighlightColorPicker, + editorHighlightButton, + pageNumber, + scaleSelect + } = this.#opts; + const self = this; + for (const { + element, + eventName, + eventDetails, + telemetry + } of buttons) { + element.addEventListener("click", evt => { + if (eventName !== null) { + eventBus.dispatch(eventName, { + source: this, + ...eventDetails, + isFromKeyboard: evt.detail === 0 + }); + } + if (telemetry) { + eventBus.dispatch("reporttelemetry", { + source: this, + details: telemetry + }); + } + }); + } + pageNumber.addEventListener("click", function () { + this.select(); + }); + pageNumber.addEventListener("change", function () { + eventBus.dispatch("pagenumberchanged", { + source: self, + value: this.value + }); + }); + scaleSelect.addEventListener("change", function () { + if (this.value === "custom") { + return; + } + eventBus.dispatch("scalechanged", { + source: self, + value: this.value + }); + }); + scaleSelect.addEventListener("click", function ({ + target + }) { + if (this.value === self.pageScaleValue && target.tagName.toUpperCase() === "OPTION") { + this.blur(); + } + }); + scaleSelect.oncontextmenu = noContextMenu; + eventBus._on("annotationeditormodechanged", this.#editorModeChanged.bind(this)); + eventBus._on("showannotationeditorui", ({ + mode + }) => { + switch (mode) { + case AnnotationEditorType.HIGHLIGHT: + editorHighlightButton.click(); + break; + } + }); + eventBus._on("toolbardensity", this.#updateToolbarDensity.bind(this)); + if (editorHighlightColorPicker) { + eventBus._on("annotationeditoruimanager", ({ + uiManager + }) => { + const cp = this.#colorPicker = new ColorPicker({ + uiManager + }); + uiManager.setMainHighlightColorPicker(cp); + editorHighlightColorPicker.append(cp.renderMainDropdown()); + }); + eventBus._on("mainhighlightcolorpickerupdatecolor", ({ + value + }) => { + this.#colorPicker?.updateColor(value); + }); + } + } + #editorModeChanged({ + mode + }) { + const { + editorCommentButton, + editorCommentParamsToolbar, + editorFreeTextButton, + editorFreeTextParamsToolbar, + editorHighlightButton, + editorHighlightParamsToolbar, + editorInkButton, + editorInkParamsToolbar, + editorStampButton, + editorStampParamsToolbar, + editorSignatureButton, + editorSignatureParamsToolbar + } = this.#opts; + toggleExpandedBtn(editorCommentButton, mode === AnnotationEditorType.POPUP, editorCommentParamsToolbar); + toggleExpandedBtn(editorFreeTextButton, mode === AnnotationEditorType.FREETEXT, editorFreeTextParamsToolbar); + toggleExpandedBtn(editorHighlightButton, mode === AnnotationEditorType.HIGHLIGHT, editorHighlightParamsToolbar); + toggleExpandedBtn(editorInkButton, mode === AnnotationEditorType.INK, editorInkParamsToolbar); + toggleExpandedBtn(editorStampButton, mode === AnnotationEditorType.STAMP, editorStampParamsToolbar); + toggleExpandedBtn(editorSignatureButton, mode === AnnotationEditorType.SIGNATURE, editorSignatureParamsToolbar); + editorCommentButton.disabled = editorFreeTextButton.disabled = editorHighlightButton.disabled = editorInkButton.disabled = editorStampButton.disabled = editorSignatureButton.disabled = mode === AnnotationEditorType.DISABLE; + } + #updateUIState(resetNumPages = false) { + const { + pageNumber, + pagesCount, + pageScaleValue, + pageScale + } = this; + const opts = this.#opts; + if (resetNumPages) { + if (this.hasPageLabels) { + opts.pageNumber.type = "text"; + opts.numPages.setAttribute("data-l10n-id", "pdfjs-page-of-pages"); + } else { + opts.pageNumber.type = "number"; + opts.numPages.setAttribute("data-l10n-id", "pdfjs-of-pages"); + opts.numPages.setAttribute("data-l10n-args", JSON.stringify({ + pagesCount + })); + } + opts.pageNumber.max = pagesCount; + } + if (this.hasPageLabels) { + opts.pageNumber.value = this.pageLabel; + opts.numPages.setAttribute("data-l10n-args", JSON.stringify({ + pageNumber, + pagesCount + })); + } else { + opts.pageNumber.value = pageNumber; + } + opts.previous.disabled = pageNumber <= 1; + opts.next.disabled = pageNumber >= pagesCount; + opts.zoomOut.disabled = pageScale <= MIN_SCALE; + opts.zoomIn.disabled = pageScale >= MAX_SCALE; + let predefinedValueFound = false; + for (const option of opts.scaleSelect.options) { + if (option.value !== pageScaleValue) { + option.selected = false; + continue; + } + option.selected = true; + predefinedValueFound = true; + } + if (!predefinedValueFound) { + opts.customScaleOption.selected = true; + opts.customScaleOption.setAttribute("data-l10n-args", JSON.stringify({ + scale: Math.round(pageScale * 10000) / 100 + })); + } + } + updateLoadingIndicatorState(loading = false) { + const { + pageNumber + } = this.#opts; + pageNumber.classList.toggle("loading", loading); + } +} + +;// ./web/view_history.js +const DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20; +class ViewHistory { + constructor(fingerprint, cacheSize = DEFAULT_VIEW_HISTORY_CACHE_SIZE) { + this.fingerprint = fingerprint; + this.cacheSize = cacheSize; + this._initializedPromise = this._readFromStorage().then(databaseStr => { + const database = JSON.parse(databaseStr || "{}"); + let index = -1; + if (!Array.isArray(database.files)) { + database.files = []; + } else { + while (database.files.length >= this.cacheSize) { + database.files.shift(); + } + for (let i = 0, ii = database.files.length; i < ii; i++) { + const branch = database.files[i]; + if (branch.fingerprint === this.fingerprint) { + index = i; + break; + } + } + } + if (index === -1) { + index = database.files.push({ + fingerprint: this.fingerprint + }) - 1; + } + this.file = database.files[index]; + this.database = database; + }); + } + async _writeToStorage() { + const databaseStr = JSON.stringify(this.database); + sessionStorage.setItem("pdfjs.history", databaseStr); + } + async _readFromStorage() { + return sessionStorage.getItem("pdfjs.history"); + } + async set(name, val) { + await this._initializedPromise; + this.file[name] = val; + return this._writeToStorage(); + } + async setMultiple(properties) { + await this._initializedPromise; + for (const name in properties) { + this.file[name] = properties[name]; + } + return this._writeToStorage(); + } + async get(name, defaultValue) { + await this._initializedPromise; + const val = this.file[name]; + return val !== undefined ? val : defaultValue; + } + async getMultiple(properties) { + await this._initializedPromise; + const values = Object.create(null); + for (const name in properties) { + const val = this.file[name]; + values[name] = val !== undefined ? val : properties[name]; + } + return values; + } +} + +;// ./web/app.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const FORCE_PAGES_LOADED_TIMEOUT = 10000; +const ViewOnLoad = { + UNKNOWN: -1, + PREVIOUS: 0, + INITIAL: 1 +}; +const PDFViewerApplication = { + initialBookmark: document.location.hash.substring(1), + _initializedCapability: { + ...Promise.withResolvers(), + settled: false + }, + appConfig: null, + pdfDocument: null, + pdfLoadingTask: null, + printService: null, + pdfViewer: null, + pdfThumbnailViewer: null, + pdfRenderingQueue: null, + pdfPresentationMode: null, + pdfDocumentProperties: null, + pdfLinkService: null, + pdfTextExtractor: null, + pdfHistory: null, + pdfSidebar: null, + pdfOutlineViewer: null, + pdfAttachmentViewer: null, + pdfLayerViewer: null, + pdfCursorTools: null, + pdfScriptingManager: null, + store: null, + downloadManager: null, + overlayManager: null, + preferences: new Preferences(), + toolbar: null, + secondaryToolbar: null, + eventBus: null, + l10n: null, + annotationEditorParams: null, + imageAltTextSettings: null, + isInitialViewSet: false, + isViewerEmbedded: window.parent !== window, + url: "", + baseUrl: "", + mlManager: null, + _downloadUrl: "", + _eventBusAbortController: null, + _windowAbortController: null, + _globalAbortController: new AbortController(), + documentInfo: null, + metadata: null, + _contentDispositionFilename: null, + _contentLength: null, + _saveInProgress: false, + _wheelUnusedTicks: 0, + _wheelUnusedFactor: 1, + _touchManager: null, + _touchUnusedTicks: 0, + _touchUnusedFactor: 1, + _PDFBug: null, + _hasAnnotationEditors: false, + _title: document.title, + _printAnnotationStoragePromise: null, + _isCtrlKeyDown: false, + _caretBrowsing: null, + _isScrolling: false, + editorUndoBar: null, + _printPermissionPromise: null, + async initialize(appConfig) { + this.appConfig = appConfig; + try { + await this.preferences.initializedPromise; + } catch (ex) { + console.error("initialize:", ex); + } + if (AppOptions.get("pdfBugEnabled")) { + await this._parseHashParams(); + } + let mode; + switch (AppOptions.get("viewerCssTheme")) { + case 1: + mode = "light"; + break; + case 2: + mode = "dark"; + break; + } + if (mode) { + docStyle.setProperty("color-scheme", mode); + } + if (AppOptions.get("enableAltText")) { + this.mlManager = new MLManager({ + enableGuessAltText: AppOptions.get("enableGuessAltText"), + enableAltTextModelDownload: AppOptions.get("enableAltTextModelDownload"), + altTextLearnMoreUrl: AppOptions.get("altTextLearnMoreUrl") + }); + } + this.l10n = await this.externalServices.createL10n(); + document.getElementsByTagName("html")[0].dir = this.l10n.getDirection(); + if (this.isViewerEmbedded && AppOptions.get("externalLinkTarget") === LinkTarget.NONE) { + AppOptions.set("externalLinkTarget", LinkTarget.TOP); + } + await this._initializeViewerComponents(); + this.pdfTextExtractor = new PdfTextExtractor(this.externalServices); + this.bindEvents(); + this.bindWindowEvents(); + this._initializedCapability.settled = true; + this._initializedCapability.resolve(); + }, + async _parseHashParams() { + const hash = document.location.hash.substring(1); + if (!hash) { + return; + } + const { + mainContainer, + viewerContainer + } = this.appConfig, + params = parseQueryString(hash); + const loadPDFBug = async () => { + if (this._PDFBug) { + return; + } + const { + PDFBug + } = await import( + /*webpackIgnore: true*/ + /*@vite-ignore*/ + AppOptions.get("debuggerSrc")); + this._PDFBug = PDFBug; + }; + if (params.get("disableworker") === "true") { + try { + GlobalWorkerOptions.workerSrc ||= AppOptions.get("workerSrc"); + await import( + /*webpackIgnore: true*/ + /*@vite-ignore*/ + PDFWorker.workerSrc); + AppOptions.set("workerPort", null); + } catch (ex) { + console.error("_parseHashParams:", ex); + } + } + if (params.has("textlayer")) { + switch (params.get("textlayer")) { + case "off": + AppOptions.set("textLayerMode", TextLayerMode.DISABLE); + break; + case "visible": + case "shadow": + case "hover": + viewerContainer.classList.add(`textLayer-${params.get("textlayer")}`); + try { + await loadPDFBug(); + this._PDFBug.loadCSS(); + } catch (ex) { + console.error("_parseHashParams:", ex); + } + break; + } + } + if (params.has("pdfbug")) { + const enabled = params.get("pdfbug").split(","); + try { + await loadPDFBug(); + this._PDFBug.init(mainContainer, enabled); + } catch (ex) { + console.error("_parseHashParams:", ex); + } + const debugOpts = { + pdfBug: true, + fontExtraProperties: true + }; + if (globalThis.StepperManager?.enabled) { + debugOpts.minDurationToUpdateCanvas = 0; + } + AppOptions.setAll(debugOpts); + } + const opts = { + disableAutoFetch: x => x === "true", + disableFontFace: x => x === "true", + disableHistory: x => x === "true", + disableRange: x => x === "true", + disableStream: x => x === "true", + verbosity: x => x | 0 + }; + for (const name in opts) { + const check = opts[name], + key = name.toLowerCase(); + if (params.has(key)) { + AppOptions.set(name, check(params.get(key))); + } + } + }, + async _initializeViewerComponents() { + const { + appConfig, + externalServices, + l10n, + mlManager + } = this; + const abortSignal = this._globalAbortController.signal; + const eventBus = new FirefoxEventBus(AppOptions.get("allowedGlobalEvents"), externalServices, AppOptions.get("isInAutomation")); + this.eventBus = AppOptions.eventBus = eventBus; + mlManager?.setEventBus(eventBus, abortSignal); + const overlayManager = this.overlayManager = new OverlayManager(); + const renderingQueue = this.pdfRenderingQueue = new PDFRenderingQueue(); + renderingQueue.onIdle = this._cleanup.bind(this); + const linkService = this.pdfLinkService = new PDFLinkService({ + eventBus, + externalLinkTarget: AppOptions.get("externalLinkTarget"), + externalLinkRel: AppOptions.get("externalLinkRel"), + ignoreDestinationZoom: AppOptions.get("ignoreDestinationZoom") + }); + const downloadManager = this.downloadManager = new DownloadManager(); + const findController = this.findController = new PDFFindController({ + linkService, + eventBus, + updateMatchesCountOnProgress: true + }); + const pdfScriptingManager = this.pdfScriptingManager = new PDFScriptingManager({ + eventBus, + externalServices, + docProperties: this._scriptingDocProperties.bind(this) + }); + const container = appConfig.mainContainer, + viewer = appConfig.viewerContainer; + const annotationEditorMode = AppOptions.get("annotationEditorMode"); + const hasForcedColors = AppOptions.get("forcePageColors") || window.matchMedia("(forced-colors: active)").matches; + const pageColors = hasForcedColors ? { + background: AppOptions.get("pageColorsBackground"), + foreground: AppOptions.get("pageColorsForeground") + } : null; + let altTextManager; + if (AppOptions.get("enableUpdatedAddImage")) { + altTextManager = appConfig.newAltTextDialog ? new NewAltTextManager(appConfig.newAltTextDialog, overlayManager, eventBus) : null; + } else { + altTextManager = appConfig.altTextDialog ? new AltTextManager(appConfig.altTextDialog, container, overlayManager, eventBus) : null; + } + if (appConfig.editorUndoBar) { + this.editorUndoBar = new EditorUndoBar(appConfig.editorUndoBar, eventBus); + } + const signatureManager = AppOptions.get("enableSignatureEditor") && appConfig.addSignatureDialog ? new SignatureManager(appConfig.addSignatureDialog, appConfig.editSignatureDialog, appConfig.annotationEditorParams?.editorSignatureAddSignature || null, overlayManager, l10n, externalServices.createSignatureStorage(eventBus, abortSignal), eventBus) : null; + const ltr = appConfig.viewerContainer ? getComputedStyle(appConfig.viewerContainer).direction === "ltr" : true; + const commentManager = AppOptions.get("enableComment") && appConfig.editCommentDialog ? new CommentManager(appConfig.editCommentDialog, { + learnMoreUrl: AppOptions.get("commentLearnMoreUrl"), + sidebar: appConfig.annotationEditorParams?.editorCommentsSidebar || null, + sidebarResizer: appConfig.annotationEditorParams?.editorCommentsSidebarResizer || null, + commentsList: appConfig.annotationEditorParams?.editorCommentsSidebarList || null, + commentCount: appConfig.annotationEditorParams?.editorCommentsSidebarCount || null, + sidebarTitle: appConfig.annotationEditorParams?.editorCommentsSidebarTitle || null, + closeButton: appConfig.annotationEditorParams?.editorCommentsSidebarCloseButton || null, + commentToolbarButton: appConfig.toolbar?.editorCommentButton || null + }, eventBus, linkService, overlayManager, ltr, hasForcedColors) : null; + const enableHWA = AppOptions.get("enableHWA"), + maxCanvasPixels = AppOptions.get("maxCanvasPixels"), + maxCanvasDim = AppOptions.get("maxCanvasDim"), + capCanvasAreaFactor = AppOptions.get("capCanvasAreaFactor"); + const pdfViewer = this.pdfViewer = new PDFViewer({ + container, + viewer, + viewerAlert: appConfig.viewerAlert, + eventBus, + renderingQueue, + linkService, + downloadManager, + altTextManager, + commentManager, + signatureManager, + editorUndoBar: this.editorUndoBar, + findController, + scriptingManager: AppOptions.get("enableScripting") && pdfScriptingManager, + l10n, + textLayerMode: AppOptions.get("textLayerMode"), + annotationMode: AppOptions.get("annotationMode"), + annotationEditorMode, + annotationEditorHighlightColors: AppOptions.get("highlightEditorColors"), + enableHighlightFloatingButton: AppOptions.get("enableHighlightFloatingButton"), + enableUpdatedAddImage: AppOptions.get("enableUpdatedAddImage"), + enableNewAltTextWhenAddingImage: AppOptions.get("enableNewAltTextWhenAddingImage"), + imageResourcesPath: AppOptions.get("imageResourcesPath"), + enablePrintAutoRotate: AppOptions.get("enablePrintAutoRotate"), + maxCanvasPixels, + maxCanvasDim, + capCanvasAreaFactor, + enableDetailCanvas: AppOptions.get("enableDetailCanvas"), + enablePermissions: AppOptions.get("enablePermissions"), + enableOptimizedPartialRendering: AppOptions.get("enableOptimizedPartialRendering"), + pageColors, + mlManager, + abortSignal, + enableHWA, + supportsPinchToZoom: this.supportsPinchToZoom, + enableAutoLinking: AppOptions.get("enableAutoLinking"), + minDurationToUpdateCanvas: AppOptions.get("minDurationToUpdateCanvas") + }); + renderingQueue.setViewer(pdfViewer); + linkService.setViewer(pdfViewer); + pdfScriptingManager.setViewer(pdfViewer); + if (appConfig.sidebar?.thumbnailView) { + this.pdfThumbnailViewer = new PDFThumbnailViewer({ + container: appConfig.sidebar.thumbnailView, + eventBus, + renderingQueue, + linkService, + maxCanvasPixels, + maxCanvasDim, + pageColors, + abortSignal, + enableHWA + }); + renderingQueue.setThumbnailViewer(this.pdfThumbnailViewer); + } + if (!this.isViewerEmbedded && !AppOptions.get("disableHistory")) { + this.pdfHistory = new PDFHistory({ + linkService, + eventBus + }); + linkService.setHistory(this.pdfHistory); + } + if (!this.supportsIntegratedFind && appConfig.findBar) { + this.findBar = new PDFFindBar(appConfig.findBar, appConfig.principalContainer, eventBus); + } + if (appConfig.annotationEditorParams) { + if (annotationEditorMode !== AnnotationEditorType.DISABLE) { + const editorSignatureButton = appConfig.toolbar?.editorSignatureButton; + if (editorSignatureButton && AppOptions.get("enableSignatureEditor")) { + editorSignatureButton.parentElement.hidden = false; + } + const editorCommentButton = appConfig.toolbar?.editorCommentButton; + if (editorCommentButton && AppOptions.get("enableComment")) { + editorCommentButton.parentElement.hidden = false; + } + this.annotationEditorParams = new AnnotationEditorParams(appConfig.annotationEditorParams, eventBus); + } else { + for (const id of ["editorModeButtons", "editorModeSeparator"]) { + document.getElementById(id)?.classList.add("hidden"); + } + } + } + if (mlManager && appConfig.secondaryToolbar?.imageAltTextSettingsButton) { + this.imageAltTextSettings = new ImageAltTextSettings(appConfig.altTextSettingsDialog, overlayManager, eventBus, mlManager); + } + if (appConfig.documentProperties) { + this.pdfDocumentProperties = new PDFDocumentProperties(appConfig.documentProperties, overlayManager, eventBus, l10n, () => this._docFilename, () => this._docTitle); + } + if (appConfig.secondaryToolbar?.cursorHandToolButton) { + this.pdfCursorTools = new PDFCursorTools({ + container, + eventBus, + cursorToolOnLoad: AppOptions.get("cursorToolOnLoad") + }); + } + if (appConfig.toolbar) { + this.toolbar = new Toolbar(appConfig.toolbar, eventBus, AppOptions.get("toolbarDensity")); + } + if (appConfig.secondaryToolbar) { + if (AppOptions.get("enableAltText")) { + appConfig.secondaryToolbar.imageAltTextSettingsButton?.classList.remove("hidden"); + appConfig.secondaryToolbar.imageAltTextSettingsSeparator?.classList.remove("hidden"); + } + this.secondaryToolbar = new SecondaryToolbar(appConfig.secondaryToolbar, eventBus); + } + if (this.supportsFullscreen && appConfig.secondaryToolbar?.presentationModeButton) { + this.pdfPresentationMode = new PDFPresentationMode({ + container, + pdfViewer, + eventBus + }); + } + if (appConfig.passwordOverlay) { + this.passwordPrompt = new PasswordPrompt(appConfig.passwordOverlay, overlayManager, this.isViewerEmbedded); + } + if (appConfig.sidebar?.outlineView) { + this.pdfOutlineViewer = new PDFOutlineViewer({ + container: appConfig.sidebar.outlineView, + eventBus, + l10n, + linkService, + downloadManager + }); + } + if (appConfig.sidebar?.attachmentsView) { + this.pdfAttachmentViewer = new PDFAttachmentViewer({ + container: appConfig.sidebar.attachmentsView, + eventBus, + l10n, + downloadManager + }); + } + if (appConfig.sidebar?.layersView) { + this.pdfLayerViewer = new PDFLayerViewer({ + container: appConfig.sidebar.layersView, + eventBus, + l10n + }); + } + if (appConfig.sidebar) { + this.pdfSidebar = new PDFSidebar({ + elements: appConfig.sidebar, + eventBus, + l10n + }); + this.pdfSidebar.onToggled = this.forceRendering.bind(this); + this.pdfSidebar.onUpdateThumbnails = () => { + for (const pageView of pdfViewer.getCachedPageViews()) { + if (pageView.renderingState === RenderingStates.FINISHED) { + this.pdfThumbnailViewer.getThumbnail(pageView.id - 1)?.setImage(pageView); + } + } + this.pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber); + }; + } + }, + async run(config) { + await this.initialize(config); + const { + appConfig, + eventBus + } = this; + let file; + file = window.location.href; + if (!AppOptions.get("supportsDocumentFonts")) { + AppOptions.set("disableFontFace", true); + this.l10n.get("pdfjs-web-fonts-disabled").then(msg => { + console.warn(msg); + }); + } + const togglePrintingButtons = visible => { + appConfig.toolbar?.print?.classList.toggle("hidden", !visible); + appConfig.secondaryToolbar?.printButton.classList.toggle("hidden", !visible); + }; + if (!this.supportsPrinting) { + togglePrintingButtons(false); + } else { + eventBus.on("printingallowed", ({ + isAllowed + }) => togglePrintingButtons(isAllowed)); + } + if (!this.supportsFullscreen) { + appConfig.secondaryToolbar?.presentationModeButton.classList.add("hidden"); + } + if (this.supportsIntegratedFind) { + appConfig.findBar?.toggleButton?.classList.add("hidden"); + } + this.setTitleUsingUrl(file, file); + this.externalServices.initPassiveLoading(); + }, + get externalServices() { + return shadow(this, "externalServices", new ExternalServices()); + }, + get initialized() { + return this._initializedCapability.settled; + }, + get initializedPromise() { + return this._initializedCapability.promise; + }, + updateZoom(steps, scaleFactor, origin) { + if (this.pdfViewer.isInPresentationMode) { + return; + } + this.pdfViewer.updateScale({ + drawingDelay: AppOptions.get("defaultZoomDelay"), + steps, + scaleFactor, + origin + }); + }, + zoomIn() { + this.updateZoom(1); + }, + zoomOut() { + this.updateZoom(-1); + }, + zoomReset() { + if (this.pdfViewer.isInPresentationMode) { + return; + } + this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE; + }, + touchPinchCallback(origin, prevDistance, distance) { + if (this.supportsPinchToZoom) { + const newScaleFactor = this._accumulateFactor(this.pdfViewer.currentScale, distance / prevDistance, "_touchUnusedFactor"); + this.updateZoom(null, newScaleFactor, origin); + } else { + const PIXELS_PER_LINE_SCALE = 30; + const ticks = this._accumulateTicks((distance - prevDistance) / PIXELS_PER_LINE_SCALE, "_touchUnusedTicks"); + this.updateZoom(ticks, null, origin); + } + }, + touchPinchEndCallback() { + this._touchUnusedTicks = 0; + this._touchUnusedFactor = 1; + }, + get pagesCount() { + return this.pdfDocument ? this.pdfDocument.numPages : 0; + }, + get page() { + return this.pdfViewer.currentPageNumber; + }, + set page(val) { + this.pdfViewer.currentPageNumber = val; + }, + get supportsPrinting() { + return shadow(this, "supportsPrinting", AppOptions.get("supportsPrinting") && PDFPrintServiceFactory.supportsPrinting); + }, + get supportsFullscreen() { + return shadow(this, "supportsFullscreen", document.fullscreenEnabled); + }, + get supportsPinchToZoom() { + return shadow(this, "supportsPinchToZoom", AppOptions.get("supportsPinchToZoom")); + }, + get supportsIntegratedFind() { + return shadow(this, "supportsIntegratedFind", AppOptions.get("supportsIntegratedFind")); + }, + get loadingBar() { + const barElement = document.getElementById("loadingBar"); + const bar = barElement ? new ProgressBar(barElement) : null; + return shadow(this, "loadingBar", bar); + }, + get supportsMouseWheelZoomCtrlKey() { + return shadow(this, "supportsMouseWheelZoomCtrlKey", AppOptions.get("supportsMouseWheelZoomCtrlKey")); + }, + get supportsMouseWheelZoomMetaKey() { + return shadow(this, "supportsMouseWheelZoomMetaKey", AppOptions.get("supportsMouseWheelZoomMetaKey")); + }, + get supportsCaretBrowsingMode() { + return AppOptions.get("supportsCaretBrowsingMode"); + }, + moveCaret(isUp, select) { + this._caretBrowsing ||= new CaretBrowsingMode(this._globalAbortController.signal, this.appConfig.mainContainer, this.appConfig.viewerContainer, this.appConfig.toolbar?.container); + this._caretBrowsing.moveCaret(isUp, select); + }, + setTitleUsingUrl(url = "", downloadUrl = null) { + this.url = url; + this.baseUrl = updateUrlHash(url, ""); + if (downloadUrl) { + this._downloadUrl = downloadUrl === url ? this.baseUrl : updateUrlHash(downloadUrl, ""); + } + if (isDataScheme(url)) { + this._hideViewBookmark(); + } else { + AppOptions.set("docBaseUrl", this.baseUrl); + } + let title = getPdfFilenameFromUrl(url, ""); + if (!title) { + try { + title = decodeURIComponent(getFilenameFromUrl(url)); + } catch {} + } + this.setTitle(title || url); + }, + setTitle(title = this._title) { + this._title = title; + if (this.isViewerEmbedded) { + return; + } + const editorIndicator = this._hasAnnotationEditors && !this.pdfRenderingQueue.printing; + document.title = `${editorIndicator ? "* " : ""}${title}`; + }, + get _docFilename() { + return this._contentDispositionFilename || getPdfFilenameFromUrl(this.url); + }, + get _docTitle() { + const { + documentInfo, + metadata + } = this; + const title = metadata?.get("dc:title"); + if (title) { + if (title !== "Untitled" && !/[\uFFF0-\uFFFF]/g.test(title)) { + return title; + } + } + return documentInfo.Title; + }, + _hideViewBookmark() { + const { + secondaryToolbar + } = this.appConfig; + secondaryToolbar?.viewBookmarkButton.classList.add("hidden"); + if (secondaryToolbar?.presentationModeButton.classList.contains("hidden")) { + document.getElementById("viewBookmarkSeparator")?.classList.add("hidden"); + } + }, + async close() { + this._unblockDocumentLoadEvent(); + this._hideViewBookmark(); + if (!this.pdfLoadingTask) { + return; + } + const promises = []; + promises.push(this.pdfLoadingTask.destroy()); + this.pdfLoadingTask = null; + if (this.pdfDocument) { + this.pdfDocument = null; + this.pdfThumbnailViewer?.setDocument(null); + this.pdfViewer.setDocument(null); + this.pdfLinkService.setDocument(null); + this.pdfDocumentProperties?.setDocument(null); + this.pdfTextExtractor?.setViewer(null); + } + this.pdfLinkService.externalLinkEnabled = true; + this.store = null; + this.isInitialViewSet = false; + this.url = ""; + this.baseUrl = ""; + this._downloadUrl = ""; + this.documentInfo = null; + this.metadata = null; + this._contentDispositionFilename = null; + this._contentLength = null; + this._saveInProgress = false; + this._hasAnnotationEditors = false; + promises.push(this.pdfScriptingManager.destroyPromise, this.passwordPrompt.close()); + this.setTitle(); + this.pdfSidebar?.reset(); + this.pdfOutlineViewer?.reset(); + this.pdfAttachmentViewer?.reset(); + this.pdfLayerViewer?.reset(); + this.pdfHistory?.reset(); + this.findBar?.reset(); + this.toolbar?.reset(); + this.secondaryToolbar?.reset(); + this._PDFBug?.cleanup(); + await Promise.all(promises); + }, + async open(args) { + if (this.pdfLoadingTask) { + await this.close(); + } + const workerParams = AppOptions.getAll(OptionKind.WORKER); + Object.assign(GlobalWorkerOptions, workerParams); + if (args.data && isPdfFile(args.filename)) { + this._contentDispositionFilename = args.filename; + } + const apiParams = AppOptions.getAll(OptionKind.API); + const loadingTask = getDocument({ + ...apiParams, + ...args + }); + this.pdfLoadingTask = loadingTask; + loadingTask.onPassword = (updateCallback, reason) => { + if (this.isViewerEmbedded) { + this._unblockDocumentLoadEvent(); + } + this.pdfLinkService.externalLinkEnabled = false; + this.passwordPrompt.setUpdateCallback(updateCallback, reason); + this.passwordPrompt.open(); + }; + loadingTask.onProgress = ({ + loaded, + total + }) => { + this.progress(loaded / total); + }; + return loadingTask.promise.then(pdfDocument => { + this.load(pdfDocument); + }, reason => { + if (loadingTask !== this.pdfLoadingTask) { + return undefined; + } + let key = "pdfjs-loading-error"; + if (reason instanceof InvalidPDFException) { + key = "pdfjs-invalid-file-error"; + } else if (reason instanceof ResponseException) { + key = reason.missing ? "pdfjs-missing-file-error" : "pdfjs-unexpected-response-error"; + } + return this._documentError(key, { + message: reason.message + }).then(() => { + throw reason; + }); + }); + }, + async download() { + let data; + try { + data = await (this.pdfDocument ? this.pdfDocument.getData() : this.pdfLoadingTask.getData()); + } catch {} + this.downloadManager.download(data, this._downloadUrl, this._docFilename); + }, + async save() { + if (this._saveInProgress) { + return; + } + this._saveInProgress = true; + await this.pdfScriptingManager.dispatchWillSave(); + try { + const data = await this.pdfDocument.saveDocument(); + this.downloadManager.download(data, this._downloadUrl, this._docFilename); + } catch (reason) { + console.error(`Error when saving the document:`, reason); + await this.download(); + } finally { + await this.pdfScriptingManager.dispatchDidSave(); + this._saveInProgress = false; + } + const editorStats = this.pdfDocument?.annotationStorage.editorStats; + if (editorStats) { + this.externalServices.reportTelemetry({ + type: "editing", + data: { + type: "save", + stats: editorStats + } + }); + } + }, + async downloadOrSave() { + const { + classList + } = this.appConfig.appContainer; + classList.add("wait"); + await (this.pdfDocument?.annotationStorage.size > 0 ? this.save() : this.download()); + classList.remove("wait"); + }, + async _documentError(key, moreInfo = null) { + this._unblockDocumentLoadEvent(); + const message = await this._otherError(key || "pdfjs-loading-error", moreInfo); + this.eventBus.dispatch("documenterror", { + source: this, + message, + reason: moreInfo?.message ?? null + }); + }, + async _otherError(key, moreInfo = null) { + const message = await this.l10n.get(key); + const moreInfoText = [`PDF.js v${version || "?"} (build: ${build || "?"})`]; + if (moreInfo) { + moreInfoText.push(`Message: ${moreInfo.message}`); + if (moreInfo.stack) { + moreInfoText.push(`Stack: ${moreInfo.stack}`); + } else { + if (moreInfo.filename) { + moreInfoText.push(`File: ${moreInfo.filename}`); + } + if (moreInfo.lineNumber) { + moreInfoText.push(`Line: ${moreInfo.lineNumber}`); + } + } + } + console.error(`${message}\n\n${moreInfoText.join("\n")}`); + return message; + }, + progress(level) { + const percent = Math.round(level * 100); + if (!this.loadingBar || percent <= this.loadingBar.percent) { + return; + } + this.loadingBar.percent = percent; + if (this.pdfDocument?.loadingParams.disableAutoFetch ?? AppOptions.get("disableAutoFetch")) { + this.loadingBar.setDisableAutoFetch(); + } + }, + load(pdfDocument) { + this.pdfDocument = pdfDocument; + this._printPermissionPromise = new Promise(resolve => { + this.eventBus.on("printingallowed", ({ + isAllowed + }) => { + if (!isAllowed) { + window.print = () => { + console.warn("Printing is not allowed."); + }; + } + resolve(isAllowed); + }, { + once: true + }); + }); + pdfDocument.getDownloadInfo().then(({ + length + }) => { + this._contentLength = length; + this.loadingBar?.hide(); + firstPagePromise.then(() => { + this.eventBus.dispatch("documentloaded", { + source: this + }); + }); + }); + const pageLayoutPromise = pdfDocument.getPageLayout().catch(() => {}); + const pageModePromise = pdfDocument.getPageMode().catch(() => {}); + const openActionPromise = pdfDocument.getOpenAction().catch(() => {}); + this.toolbar?.setPagesCount(pdfDocument.numPages, false); + this.secondaryToolbar?.setPagesCount(pdfDocument.numPages); + this.pdfLinkService.setDocument(pdfDocument); + this.pdfDocumentProperties?.setDocument(pdfDocument); + const pdfViewer = this.pdfViewer; + pdfViewer.setDocument(pdfDocument); + this.pdfTextExtractor.setViewer(pdfViewer); + const { + firstPagePromise, + onePageRendered, + pagesPromise + } = pdfViewer; + this.pdfThumbnailViewer?.setDocument(pdfDocument); + const storedPromise = (this.store = new ViewHistory(pdfDocument.fingerprints[0])).getMultiple({ + page: null, + zoom: DEFAULT_SCALE_VALUE, + scrollLeft: "0", + scrollTop: "0", + rotation: null, + sidebarView: SidebarView.UNKNOWN, + scrollMode: ScrollMode.UNKNOWN, + spreadMode: SpreadMode.UNKNOWN + }).catch(() => {}); + firstPagePromise.then(pdfPage => { + this.loadingBar?.setWidth(this.appConfig.viewerContainer); + this._initializeAnnotationStorageCallbacks(pdfDocument); + Promise.all([animationStarted, storedPromise, pageLayoutPromise, pageModePromise, openActionPromise]).then(async ([timeStamp, stored, pageLayout, pageMode, openAction]) => { + const viewOnLoad = AppOptions.get("viewOnLoad"); + this._initializePdfHistory({ + fingerprint: pdfDocument.fingerprints[0], + viewOnLoad, + initialDest: openAction?.dest + }); + const initialBookmark = this.initialBookmark; + const zoom = AppOptions.get("defaultZoomValue"); + let hash = zoom ? `zoom=${zoom}` : null; + let rotation = null; + let sidebarView = AppOptions.get("sidebarViewOnLoad"); + let scrollMode = AppOptions.get("scrollModeOnLoad"); + let spreadMode = AppOptions.get("spreadModeOnLoad"); + if (stored?.page && viewOnLoad !== ViewOnLoad.INITIAL) { + hash = `page=${stored.page}&zoom=${zoom || stored.zoom},` + `${stored.scrollLeft},${stored.scrollTop}`; + rotation = parseInt(stored.rotation, 10); + if (sidebarView === SidebarView.UNKNOWN) { + sidebarView = stored.sidebarView | 0; + } + if (scrollMode === ScrollMode.UNKNOWN) { + scrollMode = stored.scrollMode | 0; + } + if (spreadMode === SpreadMode.UNKNOWN) { + spreadMode = stored.spreadMode | 0; + } + } + if (pageMode && sidebarView === SidebarView.UNKNOWN) { + sidebarView = apiPageModeToSidebarView(pageMode); + } + if (pageLayout && scrollMode === ScrollMode.UNKNOWN && spreadMode === SpreadMode.UNKNOWN) { + const modes = apiPageLayoutToViewerModes(pageLayout); + spreadMode = modes.spreadMode; + } + this.setInitialView(hash, { + rotation, + sidebarView, + scrollMode, + spreadMode + }); + this.eventBus.dispatch("documentinit", { + source: this + }); + await Promise.race([pagesPromise, new Promise(resolve => { + setTimeout(resolve, FORCE_PAGES_LOADED_TIMEOUT); + })]); + if (!initialBookmark && !hash) { + return; + } + if (pdfViewer.hasEqualPageSizes) { + return; + } + this.initialBookmark = initialBookmark; + pdfViewer.currentScaleValue = pdfViewer.currentScaleValue; + this.setInitialView(hash); + }).catch(() => { + this.setInitialView(); + }).then(function () { + pdfViewer.update(); + }); + }); + pagesPromise.then(() => { + this._unblockDocumentLoadEvent(); + this._initializeAutoPrint(pdfDocument, openActionPromise); + }, reason => { + this._documentError("pdfjs-loading-error", { + message: reason.message + }); + }); + onePageRendered.then(data => { + this.externalServices.reportTelemetry({ + type: "pageInfo", + timestamp: data.timestamp + }); + if (this.pdfOutlineViewer) { + pdfDocument.getOutline().then(outline => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this.pdfOutlineViewer.render({ + outline, + pdfDocument + }); + }); + } + if (this.pdfAttachmentViewer) { + pdfDocument.getAttachments().then(attachments => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this.pdfAttachmentViewer.render({ + attachments + }); + }); + } + if (this.pdfLayerViewer) { + pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this.pdfLayerViewer.render({ + optionalContentConfig, + pdfDocument + }); + }); + } + }); + this._initializePageLabels(pdfDocument); + this._initializeMetadata(pdfDocument); + }, + async _scriptingDocProperties(pdfDocument) { + if (!this.documentInfo) { + await new Promise(resolve => { + this.eventBus._on("metadataloaded", resolve, { + once: true + }); + }); + if (pdfDocument !== this.pdfDocument) { + return null; + } + } + if (!this._contentLength) { + await new Promise(resolve => { + this.eventBus._on("documentloaded", resolve, { + once: true + }); + }); + if (pdfDocument !== this.pdfDocument) { + return null; + } + } + return { + ...this.documentInfo, + baseURL: this.baseUrl, + filesize: this._contentLength, + filename: this._docFilename, + metadata: this.metadata?.getRaw(), + authors: this.metadata?.get("dc:creator"), + numPages: this.pagesCount, + URL: this.url + }; + }, + async _initializeAutoPrint(pdfDocument, openActionPromise) { + const [openAction, jsActions] = await Promise.all([openActionPromise, this.pdfViewer.enableScripting ? null : pdfDocument.getJSActions()]); + if (pdfDocument !== this.pdfDocument) { + return; + } + let triggerAutoPrint = openAction?.action === "Print"; + if (jsActions) { + console.warn("Warning: JavaScript support is not enabled"); + for (const name in jsActions) { + if (triggerAutoPrint) { + break; + } + switch (name) { + case "WillClose": + case "WillSave": + case "DidSave": + case "WillPrint": + case "DidPrint": + continue; + } + triggerAutoPrint = jsActions[name].some(js => AutoPrintRegExp.test(js)); + } + } + if (triggerAutoPrint) { + this.triggerPrinting(); + } + }, + async _initializeMetadata(pdfDocument) { + const { + info, + metadata, + contentDispositionFilename, + contentLength, + hasStructTree + } = await pdfDocument.getMetadata(); + if (pdfDocument !== this.pdfDocument) { + return; + } + this.externalServices.reportTelemetry({ + type: "taggedPDF", + data: hasStructTree + }); + this.documentInfo = info; + this.metadata = metadata; + this._contentDispositionFilename ??= contentDispositionFilename; + this._contentLength ??= contentLength; + console.log(`PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` + `${(metadata?.get("pdf:producer") || info.Producer || "-").trim()} / ` + `${(metadata?.get("xmp:creatortool") || info.Creator || "-").trim()}` + `] (PDF.js: ${version || "?"} [${build || "?"}])`); + const pdfTitle = this._docTitle; + if (pdfTitle) { + this.setTitle(`${pdfTitle} - ${this._contentDispositionFilename || this._title}`); + } else if (this._contentDispositionFilename) { + this.setTitle(this._contentDispositionFilename); + } + if (info.IsXFAPresent && !info.IsAcroFormPresent && !pdfDocument.isPureXfa) { + if (pdfDocument.loadingParams.enableXfa) { + console.warn("Warning: XFA Foreground documents are not supported"); + } else { + console.warn("Warning: XFA support is not enabled"); + } + } else if ((info.IsAcroFormPresent || info.IsXFAPresent) && !this.pdfViewer.renderForms) { + console.warn("Warning: Interactive form support is not enabled"); + } + if (info.IsSignaturesPresent) { + console.warn("Warning: Digital signatures validation is not supported"); + } + this.eventBus.dispatch("metadataloaded", { + source: this + }); + }, + async _initializePageLabels(pdfDocument) { + const labels = await pdfDocument.getPageLabels(); + if (pdfDocument !== this.pdfDocument) { + return; + } + if (!labels || AppOptions.get("disablePageLabels")) { + return; + } + const numLabels = labels.length; + let standardLabels = 0, + emptyLabels = 0; + for (let i = 0; i < numLabels; i++) { + const label = labels[i]; + if (label === (i + 1).toString()) { + standardLabels++; + } else if (label === "") { + emptyLabels++; + } else { + break; + } + } + if (standardLabels >= numLabels || emptyLabels >= numLabels) { + return; + } + const { + pdfViewer, + pdfThumbnailViewer, + toolbar + } = this; + pdfViewer.setPageLabels(labels); + pdfThumbnailViewer?.setPageLabels(labels); + toolbar?.setPagesCount(numLabels, true); + toolbar?.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); + }, + _initializePdfHistory({ + fingerprint, + viewOnLoad, + initialDest = null + }) { + if (!this.pdfHistory) { + return; + } + this.pdfHistory.initialize({ + fingerprint, + resetHistory: viewOnLoad === ViewOnLoad.INITIAL, + updateUrl: AppOptions.get("historyUpdateUrl") + }); + if (this.pdfHistory.initialBookmark) { + this.initialBookmark = this.pdfHistory.initialBookmark; + this.initialRotation = this.pdfHistory.initialRotation; + } + if (initialDest && !this.initialBookmark && viewOnLoad === ViewOnLoad.UNKNOWN) { + this.initialBookmark = JSON.stringify(initialDest); + this.pdfHistory.push({ + explicitDest: initialDest, + pageNumber: null + }); + } + }, + _initializeAnnotationStorageCallbacks(pdfDocument) { + if (pdfDocument !== this.pdfDocument) { + return; + } + const { + annotationStorage + } = pdfDocument; + annotationStorage.onSetModified = () => { + window.addEventListener("beforeunload", beforeUnload); + }; + annotationStorage.onResetModified = () => { + window.removeEventListener("beforeunload", beforeUnload); + }; + annotationStorage.onAnnotationEditor = typeStr => { + this._hasAnnotationEditors = !!typeStr; + this.setTitle(); + }; + }, + setInitialView(storedHash, { + rotation, + sidebarView, + scrollMode, + spreadMode + } = {}) { + const setRotation = angle => { + if (isValidRotation(angle)) { + this.pdfViewer.pagesRotation = angle; + } + }; + const setViewerModes = (scroll, spread) => { + if (isValidScrollMode(scroll)) { + this.pdfViewer.scrollMode = scroll; + } + if (isValidSpreadMode(spread)) { + this.pdfViewer.spreadMode = spread; + } + }; + this.isInitialViewSet = true; + this.pdfSidebar?.setInitialView(sidebarView); + setViewerModes(scrollMode, spreadMode); + if (this.initialBookmark) { + setRotation(this.initialRotation); + delete this.initialRotation; + this.pdfLinkService.setHash(this.initialBookmark); + this.initialBookmark = null; + } else if (storedHash) { + setRotation(rotation); + this.pdfLinkService.setHash(storedHash); + } + this.toolbar?.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel); + this.secondaryToolbar?.setPageNumber(this.pdfViewer.currentPageNumber); + if (!this.pdfViewer.currentScaleValue) { + this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE; + } + }, + _cleanup() { + if (!this.pdfDocument) { + return; + } + this.pdfViewer.cleanup(); + this.pdfThumbnailViewer?.cleanup(); + this.pdfDocument.cleanup(AppOptions.get("fontExtraProperties")); + }, + forceRendering() { + this.pdfRenderingQueue.printing = !!this.printService; + this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar?.visibleView === SidebarView.THUMBS; + this.pdfRenderingQueue.renderHighestPriority(); + }, + beforePrint() { + this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().catch(() => {}).then(() => this.pdfDocument?.annotationStorage.print); + if (this.printService) { + return; + } + if (!this.supportsPrinting || !this.pdfViewer.printingAllowed) { + this._otherError("pdfjs-printing-not-supported"); + return; + } + if (!this.pdfViewer.pageViewsReady) { + this.l10n.get("pdfjs-printing-not-ready").then(msg => { + window.alert(msg); + }); + return; + } + this.printService = PDFPrintServiceFactory.createPrintService({ + pdfDocument: this.pdfDocument, + pagesOverview: this.pdfViewer.getPagesOverview(), + printContainer: this.appConfig.printContainer, + printResolution: AppOptions.get("printResolution"), + printAnnotationStoragePromise: this._printAnnotationStoragePromise + }); + this.forceRendering(); + this.setTitle(); + this.printService.layout(); + if (this._hasAnnotationEditors) { + this.externalServices.reportTelemetry({ + type: "editing", + data: { + type: "print", + stats: this.pdfDocument?.annotationStorage.editorStats + } + }); + } + }, + afterPrint() { + if (this._printAnnotationStoragePromise) { + this._printAnnotationStoragePromise.then(() => { + this.pdfScriptingManager.dispatchDidPrint(); + }); + this._printAnnotationStoragePromise = null; + } + if (this.printService) { + this.printService.destroy(); + this.printService = null; + this.pdfDocument?.annotationStorage.resetModified(); + } + this.forceRendering(); + this.setTitle(); + }, + rotatePages(delta) { + this.pdfViewer.pagesRotation += delta; + }, + requestPresentationMode() { + this.pdfPresentationMode?.request(); + }, + async triggerPrinting() { + if (this.supportsPrinting && (await this._printPermissionPromise)) { + window.print(); + } + }, + bindEvents() { + if (this._eventBusAbortController) { + return; + } + const ac = this._eventBusAbortController = new AbortController(); + const opts = { + signal: ac.signal + }; + const { + eventBus, + externalServices, + pdfDocumentProperties, + pdfViewer, + preferences + } = this; + eventBus._on("resize", onResize.bind(this), opts); + eventBus._on("hashchange", onHashchange.bind(this), opts); + eventBus._on("beforeprint", this.beforePrint.bind(this), opts); + eventBus._on("afterprint", this.afterPrint.bind(this), opts); + eventBus._on("pagerender", onPageRender.bind(this), opts); + eventBus._on("pagerendered", onPageRendered.bind(this), opts); + eventBus._on("updateviewarea", onUpdateViewarea.bind(this), opts); + eventBus._on("pagechanging", onPageChanging.bind(this), opts); + eventBus._on("scalechanging", onScaleChanging.bind(this), opts); + eventBus._on("rotationchanging", onRotationChanging.bind(this), opts); + eventBus._on("sidebarviewchanged", onSidebarViewChanged.bind(this), opts); + eventBus._on("pagemode", onPageMode.bind(this), opts); + eventBus._on("namedaction", onNamedAction.bind(this), opts); + eventBus._on("presentationmodechanged", evt => pdfViewer.presentationModeState = evt.state, opts); + eventBus._on("presentationmode", this.requestPresentationMode.bind(this), opts); + eventBus._on("switchannotationeditormode", evt => pdfViewer.annotationEditorMode = evt, opts); + eventBus._on("print", this.triggerPrinting.bind(this), opts); + eventBus._on("download", this.downloadOrSave.bind(this), opts); + eventBus._on("firstpage", () => this.page = 1, opts); + eventBus._on("lastpage", () => this.page = this.pagesCount, opts); + eventBus._on("nextpage", () => pdfViewer.nextPage(), opts); + eventBus._on("previouspage", () => pdfViewer.previousPage(), opts); + eventBus._on("zoomin", this.zoomIn.bind(this), opts); + eventBus._on("zoomout", this.zoomOut.bind(this), opts); + eventBus._on("zoomreset", this.zoomReset.bind(this), opts); + eventBus._on("pagenumberchanged", onPageNumberChanged.bind(this), opts); + eventBus._on("scalechanged", evt => pdfViewer.currentScaleValue = evt.value, opts); + eventBus._on("rotatecw", this.rotatePages.bind(this, 90), opts); + eventBus._on("rotateccw", this.rotatePages.bind(this, -90), opts); + eventBus._on("optionalcontentconfig", evt => pdfViewer.optionalContentConfigPromise = evt.promise, opts); + eventBus._on("switchscrollmode", evt => pdfViewer.scrollMode = evt.mode, opts); + eventBus._on("scrollmodechanged", onViewerModesChanged.bind(this, "scrollMode"), opts); + eventBus._on("switchspreadmode", evt => pdfViewer.spreadMode = evt.mode, opts); + eventBus._on("spreadmodechanged", onViewerModesChanged.bind(this, "spreadMode"), opts); + eventBus._on("imagealttextsettings", onImageAltTextSettings.bind(this), opts); + eventBus._on("documentproperties", () => pdfDocumentProperties?.open(), opts); + eventBus._on("findfromurlhash", onFindFromUrlHash.bind(this), opts); + eventBus._on("updatefindmatchescount", onUpdateFindMatchesCount.bind(this), opts); + eventBus._on("updatefindcontrolstate", onUpdateFindControlState.bind(this), opts); + eventBus._on("annotationeditorstateschanged", evt => externalServices.updateEditorStates(evt), opts); + eventBus._on("reporttelemetry", evt => externalServices.reportTelemetry(evt.details), opts); + eventBus._on("setpreference", evt => preferences.set(evt.name, evt.value), opts); + }, + bindWindowEvents() { + if (this._windowAbortController) { + return; + } + this._windowAbortController = new AbortController(); + const { + eventBus, + appConfig: { + mainContainer + }, + pdfViewer, + _windowAbortController: { + signal + } + } = this; + this._touchManager = new TouchManager({ + container: window, + isPinchingDisabled: () => pdfViewer.isInPresentationMode, + isPinchingStopped: () => this.overlayManager?.active, + onPinching: this.touchPinchCallback.bind(this), + onPinchEnd: this.touchPinchEndCallback.bind(this), + signal + }); + function addWindowResolutionChange(evt = null) { + if (evt) { + pdfViewer.refresh(); + } + const mediaQueryList = window.matchMedia(`(resolution: ${OutputScale.pixelRatio}dppx)`); + mediaQueryList.addEventListener("change", addWindowResolutionChange, { + once: true, + signal + }); + } + addWindowResolutionChange(); + window.addEventListener("wheel", onWheel.bind(this), { + passive: false, + signal + }); + window.addEventListener("click", onClick.bind(this), { + signal + }); + window.addEventListener("keydown", onKeyDown.bind(this), { + signal + }); + window.addEventListener("keyup", onKeyUp.bind(this), { + signal + }); + window.addEventListener("resize", () => eventBus.dispatch("resize", { + source: window + }), { + signal + }); + window.addEventListener("hashchange", () => { + eventBus.dispatch("hashchange", { + source: window, + hash: document.location.hash.substring(1) + }); + }, { + signal + }); + window.addEventListener("beforeprint", () => eventBus.dispatch("beforeprint", { + source: window + }), { + signal + }); + window.addEventListener("afterprint", () => eventBus.dispatch("afterprint", { + source: window + }), { + signal + }); + window.addEventListener("updatefromsandbox", evt => { + eventBus.dispatch("updatefromsandbox", { + source: window, + detail: evt.detail + }); + }, { + signal + }); + let scrollendTimeoutID, scrollAbortController; + const scrollend = () => { + clearTimeout(scrollendTimeoutID); + if (this._isScrolling) { + scrollAbortController.abort(); + scrollAbortController = null; + this._isScrolling = false; + } + }; + const scroll = () => { + if (this._isCtrlKeyDown) { + return; + } + if (!this._isScrolling) { + scrollAbortController = new AbortController(); + const abortSignal = AbortSignal.any([scrollAbortController.signal, signal]); + mainContainer.addEventListener("scrollend", scrollend, { + signal: abortSignal + }); + mainContainer.addEventListener("blur", scrollend, { + signal: abortSignal + }); + this._isScrolling = true; + } + clearTimeout(scrollendTimeoutID); + scrollendTimeoutID = setTimeout(scrollend, 100); + }; + mainContainer.addEventListener("scroll", scroll, { + passive: true, + signal + }); + }, + unbindEvents() { + this._eventBusAbortController?.abort(); + this._eventBusAbortController = null; + }, + unbindWindowEvents() { + this._windowAbortController?.abort(); + this._windowAbortController = null; + this._touchManager = null; + }, + async testingClose() { + this.unbindEvents(); + this.unbindWindowEvents(); + this._globalAbortController?.abort(); + this._globalAbortController = null; + this.findBar?.close(); + await Promise.all([this.l10n?.destroy(), this.close()]); + }, + _accumulateTicks(ticks, prop) { + if (this[prop] > 0 && ticks < 0 || this[prop] < 0 && ticks > 0) { + this[prop] = 0; + } + this[prop] += ticks; + const wholeTicks = Math.trunc(this[prop]); + this[prop] -= wholeTicks; + return wholeTicks; + }, + _accumulateFactor(previousScale, factor, prop) { + if (factor === 1) { + return 1; + } + if (this[prop] > 1 && factor < 1 || this[prop] < 1 && factor > 1) { + this[prop] = 1; + } + const newFactor = Math.floor(previousScale * factor * this[prop] * 100) / (100 * previousScale); + this[prop] = factor / newFactor; + return newFactor; + }, + _unblockDocumentLoadEvent() { + document.blockUnblockOnload?.(false); + this._unblockDocumentLoadEvent = () => {}; + }, + get scriptingReady() { + return this.pdfScriptingManager.ready; + } +}; +initCom(PDFViewerApplication); +function onPageRender({ + pageNumber +}) { + if (pageNumber === this.page) { + this.toolbar?.updateLoadingIndicatorState(true); + } +} +function onPageRendered({ + pageNumber, + isDetailView, + error +}) { + if (pageNumber === this.page) { + this.toolbar?.updateLoadingIndicatorState(false); + } + if (!isDetailView && this.pdfSidebar?.visibleView === SidebarView.THUMBS) { + const pageView = this.pdfViewer.getPageView(pageNumber - 1); + const thumbnailView = this.pdfThumbnailViewer?.getThumbnail(pageNumber - 1); + if (pageView) { + thumbnailView?.setImage(pageView); + } + } + if (error) { + this._otherError("pdfjs-rendering-error", error); + } +} +function onPageMode({ + mode +}) { + let view; + switch (mode) { + case "thumbs": + view = SidebarView.THUMBS; + break; + case "bookmarks": + case "outline": + view = SidebarView.OUTLINE; + break; + case "attachments": + view = SidebarView.ATTACHMENTS; + break; + case "layers": + view = SidebarView.LAYERS; + break; + case "none": + view = SidebarView.NONE; + break; + default: + console.error('Invalid "pagemode" hash parameter: ' + mode); + return; + } + this.pdfSidebar?.switchView(view, true); +} +function onNamedAction(evt) { + switch (evt.action) { + case "GoToPage": + this.appConfig.toolbar?.pageNumber.select(); + break; + case "Find": + if (!this.supportsIntegratedFind) { + this.findBar?.toggle(); + } + break; + case "Print": + this.triggerPrinting(); + break; + case "SaveAs": + this.downloadOrSave(); + break; + } +} +function onSidebarViewChanged({ + view +}) { + this.pdfRenderingQueue.isThumbnailViewEnabled = view === SidebarView.THUMBS; + if (this.isInitialViewSet) { + this.store?.set("sidebarView", view).catch(() => {}); + } +} +function onUpdateViewarea({ + location +}) { + if (this.isInitialViewSet) { + this.store?.setMultiple({ + page: location.pageNumber, + zoom: location.scale, + scrollLeft: location.left, + scrollTop: location.top, + rotation: location.rotation + }).catch(() => {}); + } + if (this.appConfig.secondaryToolbar) { + this.appConfig.secondaryToolbar.viewBookmarkButton.href = this.pdfLinkService.getAnchorUrl(location.pdfOpenParams); + } +} +function onViewerModesChanged(name, evt) { + if (this.isInitialViewSet && !this.pdfViewer.isInPresentationMode) { + this.store?.set(name, evt.mode).catch(() => {}); + } +} +function onResize() { + const { + pdfDocument, + pdfViewer, + pdfRenderingQueue + } = this; + if (pdfRenderingQueue.printing && window.matchMedia("print").matches) { + return; + } + if (!pdfDocument) { + return; + } + const currentScaleValue = pdfViewer.currentScaleValue; + if (currentScaleValue === "auto" || currentScaleValue === "page-fit" || currentScaleValue === "page-width") { + pdfViewer.currentScaleValue = currentScaleValue; + } + pdfViewer.update(); +} +function onHashchange(evt) { + const hash = evt.hash; + if (!hash) { + return; + } + if (!this.isInitialViewSet) { + this.initialBookmark = hash; + } else if (!this.pdfHistory?.popStateInProgress) { + this.pdfLinkService.setHash(hash); + } +} +function onPageNumberChanged(evt) { + const { + pdfViewer + } = this; + if (evt.value !== "") { + this.pdfLinkService.goToPage(evt.value); + } + if (evt.value !== pdfViewer.currentPageNumber.toString() && evt.value !== pdfViewer.currentPageLabel) { + this.toolbar?.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); + } +} +function onImageAltTextSettings() { + this.imageAltTextSettings?.open({ + enableGuessAltText: AppOptions.get("enableGuessAltText"), + enableNewAltTextWhenAddingImage: AppOptions.get("enableNewAltTextWhenAddingImage") + }); +} +function onFindFromUrlHash(evt) { + this.eventBus.dispatch("find", { + source: evt.source, + type: "", + query: evt.query, + caseSensitive: false, + entireWord: false, + highlightAll: true, + findPrevious: false, + matchDiacritics: true + }); +} +function onUpdateFindMatchesCount({ + matchesCount +}) { + if (this.supportsIntegratedFind) { + this.externalServices.updateFindMatchesCount(matchesCount); + } else { + this.findBar?.updateResultsCount(matchesCount); + } +} +function onUpdateFindControlState({ + state, + previous, + entireWord, + matchesCount, + rawQuery +}) { + if (this.supportsIntegratedFind) { + this.externalServices.updateFindControlState({ + result: state, + findPrevious: previous, + entireWord, + matchesCount, + rawQuery + }); + } else { + this.findBar?.updateUIState(state, previous, matchesCount); + } +} +function onScaleChanging(evt) { + this.toolbar?.setPageScale(evt.presetValue, evt.scale); + this.pdfViewer.update(); +} +function onRotationChanging(evt) { + if (this.pdfThumbnailViewer) { + this.pdfThumbnailViewer.pagesRotation = evt.pagesRotation; + } + this.forceRendering(); + this.pdfViewer.currentPageNumber = evt.pageNumber; +} +function onPageChanging({ + pageNumber, + pageLabel +}) { + this.toolbar?.setPageNumber(pageNumber, pageLabel); + this.secondaryToolbar?.setPageNumber(pageNumber); + if (this.pdfSidebar?.visibleView === SidebarView.THUMBS) { + this.pdfThumbnailViewer?.scrollThumbnailIntoView(pageNumber); + } + const currentPage = this.pdfViewer.getPageView(pageNumber - 1); + this.toolbar?.updateLoadingIndicatorState(currentPage?.renderingState === RenderingStates.RUNNING); +} +function onWheel(evt) { + const { + pdfViewer, + supportsMouseWheelZoomCtrlKey, + supportsMouseWheelZoomMetaKey, + supportsPinchToZoom + } = this; + if (pdfViewer.isInPresentationMode) { + return; + } + const deltaMode = evt.deltaMode; + let scaleFactor = Math.exp(-evt.deltaY / 100); + const isBuiltInMac = FeatureTest.platform.isMac; + const isPinchToZoom = evt.ctrlKey && !this._isCtrlKeyDown && deltaMode === WheelEvent.DOM_DELTA_PIXEL && evt.deltaX === 0 && (Math.abs(scaleFactor - 1) < 0.05 || isBuiltInMac) && evt.deltaZ === 0; + const origin = [evt.clientX, evt.clientY]; + if (isPinchToZoom || evt.ctrlKey && supportsMouseWheelZoomCtrlKey || evt.metaKey && supportsMouseWheelZoomMetaKey) { + evt.preventDefault(); + if (this._isScrolling || document.visibilityState === "hidden" || this.overlayManager.active) { + return; + } + if (isPinchToZoom && supportsPinchToZoom) { + scaleFactor = this._accumulateFactor(pdfViewer.currentScale, scaleFactor, "_wheelUnusedFactor"); + this.updateZoom(null, scaleFactor, origin); + } else { + const delta = normalizeWheelEventDirection(evt); + let ticks = 0; + if (deltaMode === WheelEvent.DOM_DELTA_LINE || deltaMode === WheelEvent.DOM_DELTA_PAGE) { + ticks = Math.abs(delta) >= 1 ? Math.sign(delta) : this._accumulateTicks(delta, "_wheelUnusedTicks"); + } else { + const PIXELS_PER_LINE_SCALE = 30; + ticks = this._accumulateTicks(delta / PIXELS_PER_LINE_SCALE, "_wheelUnusedTicks"); + } + this.updateZoom(ticks, null, origin); + } + } +} +function closeSecondaryToolbar({ + target +}) { + if (!this.secondaryToolbar?.isOpen) { + return; + } + const { + toolbar, + secondaryToolbar + } = this.appConfig; + if (this.pdfViewer.containsElement(target) || toolbar?.container.contains(target) && !secondaryToolbar?.toolbar.contains(target) && !secondaryToolbar?.toggleButton.contains(target)) { + this.secondaryToolbar.close(); + } +} +function closeEditorUndoBar(evt) { + if (!this.editorUndoBar?.isOpen) { + return; + } + if (this.appConfig.secondaryToolbar?.toolbar.contains(evt.target)) { + this.editorUndoBar.hide(); + } +} +function onClick(evt) { + closeSecondaryToolbar.call(this, evt); + closeEditorUndoBar.call(this, evt); +} +function onKeyUp(evt) { + if (evt.key === "Control") { + this._isCtrlKeyDown = false; + } +} +function onKeyDown(evt) { + this._isCtrlKeyDown = evt.key === "Control"; + if (this.editorUndoBar?.isOpen && evt.keyCode !== 9 && evt.keyCode !== 16 && !((evt.keyCode === 13 || evt.keyCode === 32) && getActiveOrFocusedElement() === this.appConfig.editorUndoBar.undoButton)) { + this.editorUndoBar.hide(); + } + if (this.overlayManager.active) { + return; + } + const { + eventBus, + pdfViewer + } = this; + const isViewerInPresentationMode = pdfViewer.isInPresentationMode; + let handled = false, + ensureViewerFocused = false; + const cmd = (evt.ctrlKey ? 1 : 0) | (evt.altKey ? 2 : 0) | (evt.shiftKey ? 4 : 0) | (evt.metaKey ? 8 : 0); + if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) { + switch (evt.keyCode) { + case 70: + if (!this.supportsIntegratedFind && !evt.shiftKey) { + this.findBar?.open(); + handled = true; + } + break; + case 71: + if (!this.supportsIntegratedFind) { + const { + state + } = this.findController; + if (state) { + const newState = { + source: window, + type: "again", + findPrevious: cmd === 5 || cmd === 12 + }; + eventBus.dispatch("find", { + ...state, + ...newState + }); + } + handled = true; + } + break; + case 61: + case 107: + case 187: + case 171: + this.zoomIn(); + handled = true; + break; + case 173: + case 109: + case 189: + this.zoomOut(); + handled = true; + break; + case 48: + case 96: + if (!isViewerInPresentationMode) { + setTimeout(() => { + this.zoomReset(); + }); + handled = false; + } + break; + case 38: + if (isViewerInPresentationMode || this.page > 1) { + this.page = 1; + handled = true; + ensureViewerFocused = true; + } + break; + case 40: + if (isViewerInPresentationMode || this.page < this.pagesCount) { + this.page = this.pagesCount; + handled = true; + ensureViewerFocused = true; + } + break; + } + } + if (cmd === 3 || cmd === 10) { + switch (evt.keyCode) { + case 80: + this.requestPresentationMode(); + handled = true; + this.externalServices.reportTelemetry({ + type: "buttons", + data: { + id: "presentationModeKeyboard" + } + }); + break; + case 71: + if (this.appConfig.toolbar) { + this.appConfig.toolbar.pageNumber.select(); + handled = true; + } + break; + } + } + if (handled) { + if (ensureViewerFocused && !isViewerInPresentationMode) { + pdfViewer.focus(); + } + evt.preventDefault(); + return; + } + const curElement = getActiveOrFocusedElement(); + const curElementTagName = curElement?.tagName.toUpperCase(); + if (curElementTagName === "INPUT" || curElementTagName === "TEXTAREA" || curElementTagName === "SELECT" || curElementTagName === "BUTTON" && evt.keyCode === 32 || curElement?.isContentEditable) { + if (evt.keyCode !== 27) { + return; + } + } + if (cmd === 0) { + let turnPage = 0, + turnOnlyIfPageFit = false; + switch (evt.keyCode) { + case 38: + if (this.supportsCaretBrowsingMode) { + this.moveCaret(true, false); + handled = true; + break; + } + case 33: + if (pdfViewer.isVerticalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + turnPage = -1; + break; + case 8: + if (!isViewerInPresentationMode) { + turnOnlyIfPageFit = true; + } + turnPage = -1; + break; + case 37: + if (this.supportsCaretBrowsingMode) { + return; + } + if (pdfViewer.isHorizontalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + case 75: + case 80: + turnPage = -1; + break; + case 27: + if (this.secondaryToolbar?.isOpen) { + this.secondaryToolbar.close(); + handled = true; + } + if (!this.supportsIntegratedFind && this.findBar?.opened) { + this.findBar.close(); + handled = true; + } + break; + case 40: + if (this.supportsCaretBrowsingMode) { + this.moveCaret(false, false); + handled = true; + break; + } + case 34: + if (pdfViewer.isVerticalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + turnPage = 1; + break; + case 32: + if (!isViewerInPresentationMode) { + turnOnlyIfPageFit = true; + } + turnPage = 1; + break; + case 39: + if (this.supportsCaretBrowsingMode) { + return; + } + if (pdfViewer.isHorizontalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + case 74: + case 78: + turnPage = 1; + break; + case 36: + if (isViewerInPresentationMode || this.page > 1) { + this.page = 1; + handled = true; + ensureViewerFocused = true; + } + break; + case 35: + if (isViewerInPresentationMode || this.page < this.pagesCount) { + this.page = this.pagesCount; + handled = true; + ensureViewerFocused = true; + } + break; + case 83: + this.pdfCursorTools?.switchTool(CursorTool.SELECT); + break; + case 72: + this.pdfCursorTools?.switchTool(CursorTool.HAND); + break; + case 82: + this.rotatePages(90); + break; + case 115: + this.pdfSidebar?.toggle(); + break; + } + if (turnPage !== 0 && (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === "page-fit")) { + if (turnPage > 0) { + pdfViewer.nextPage(); + } else { + pdfViewer.previousPage(); + } + handled = true; + } + } + if (cmd === 4) { + switch (evt.keyCode) { + case 32: + if (!isViewerInPresentationMode && pdfViewer.currentScaleValue !== "page-fit") { + break; + } + pdfViewer.previousPage(); + handled = true; + break; + case 38: + this.moveCaret(true, true); + handled = true; + break; + case 40: + this.moveCaret(false, true); + handled = true; + break; + case 82: + this.rotatePages(-90); + break; + } + } + if (!handled && !isViewerInPresentationMode) { + if (evt.keyCode >= 33 && evt.keyCode <= 40 || evt.keyCode === 32 && curElementTagName !== "BUTTON") { + ensureViewerFocused = true; + } + } + if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) { + pdfViewer.focus(); + } + if (handled) { + evt.preventDefault(); + } +} +function beforeUnload(evt) { + evt.preventDefault(); + evt.returnValue = ""; + return false; +} + +;// ./web/viewer.js + + + + +const AppConstants = null; +window.PDFViewerApplication = PDFViewerApplication; +window.PDFViewerApplicationConstants = AppConstants; +window.PDFViewerApplicationOptions = AppOptions; +function getViewerConfiguration() { + return { + appContainer: document.body, + principalContainer: document.getElementById("mainContainer"), + mainContainer: document.getElementById("viewerContainer"), + viewerContainer: document.getElementById("viewer"), + viewerAlert: document.getElementById("viewer-alert"), + toolbar: { + container: document.getElementById("toolbarContainer"), + numPages: document.getElementById("numPages"), + pageNumber: document.getElementById("pageNumber"), + scaleSelect: document.getElementById("scaleSelect"), + customScaleOption: document.getElementById("customScaleOption"), + previous: document.getElementById("previous"), + next: document.getElementById("next"), + zoomIn: document.getElementById("zoomInButton"), + zoomOut: document.getElementById("zoomOutButton"), + print: document.getElementById("printButton"), + editorCommentButton: document.getElementById("editorCommentButton"), + editorCommentParamsToolbar: document.getElementById("editorCommentParamsToolbar"), + editorFreeTextButton: document.getElementById("editorFreeTextButton"), + editorFreeTextParamsToolbar: document.getElementById("editorFreeTextParamsToolbar"), + editorHighlightButton: document.getElementById("editorHighlightButton"), + editorHighlightParamsToolbar: document.getElementById("editorHighlightParamsToolbar"), + editorHighlightColorPicker: document.getElementById("editorHighlightColorPicker"), + editorInkButton: document.getElementById("editorInkButton"), + editorInkParamsToolbar: document.getElementById("editorInkParamsToolbar"), + editorStampButton: document.getElementById("editorStampButton"), + editorStampParamsToolbar: document.getElementById("editorStampParamsToolbar"), + editorSignatureButton: document.getElementById("editorSignatureButton"), + editorSignatureParamsToolbar: document.getElementById("editorSignatureParamsToolbar"), + download: document.getElementById("downloadButton") + }, + secondaryToolbar: { + toolbar: document.getElementById("secondaryToolbar"), + toggleButton: document.getElementById("secondaryToolbarToggleButton"), + presentationModeButton: document.getElementById("presentationMode"), + openFileButton: null, + printButton: document.getElementById("secondaryPrint"), + downloadButton: document.getElementById("secondaryDownload"), + viewBookmarkButton: document.getElementById("viewBookmark"), + firstPageButton: document.getElementById("firstPage"), + lastPageButton: document.getElementById("lastPage"), + pageRotateCwButton: document.getElementById("pageRotateCw"), + pageRotateCcwButton: document.getElementById("pageRotateCcw"), + cursorSelectToolButton: document.getElementById("cursorSelectTool"), + cursorHandToolButton: document.getElementById("cursorHandTool"), + scrollPageButton: document.getElementById("scrollPage"), + scrollVerticalButton: document.getElementById("scrollVertical"), + scrollHorizontalButton: document.getElementById("scrollHorizontal"), + scrollWrappedButton: document.getElementById("scrollWrapped"), + spreadNoneButton: document.getElementById("spreadNone"), + spreadOddButton: document.getElementById("spreadOdd"), + spreadEvenButton: document.getElementById("spreadEven"), + imageAltTextSettingsButton: document.getElementById("imageAltTextSettings"), + imageAltTextSettingsSeparator: document.getElementById("imageAltTextSettingsSeparator"), + documentPropertiesButton: document.getElementById("documentProperties") + }, + sidebar: { + outerContainer: document.getElementById("outerContainer"), + sidebarContainer: document.getElementById("sidebarContainer"), + toggleButton: document.getElementById("sidebarToggleButton"), + resizer: document.getElementById("sidebarResizer"), + thumbnailButton: document.getElementById("viewThumbnail"), + outlineButton: document.getElementById("viewOutline"), + attachmentsButton: document.getElementById("viewAttachments"), + layersButton: document.getElementById("viewLayers"), + thumbnailView: document.getElementById("thumbnailView"), + outlineView: document.getElementById("outlineView"), + attachmentsView: document.getElementById("attachmentsView"), + layersView: document.getElementById("layersView"), + currentOutlineItemButton: document.getElementById("currentOutlineItem") + }, + findBar: { + bar: document.getElementById("findbar"), + toggleButton: document.getElementById("viewFindButton"), + findField: document.getElementById("findInput"), + highlightAllCheckbox: document.getElementById("findHighlightAll"), + caseSensitiveCheckbox: document.getElementById("findMatchCase"), + matchDiacriticsCheckbox: document.getElementById("findMatchDiacritics"), + entireWordCheckbox: document.getElementById("findEntireWord"), + findMsg: document.getElementById("findMsg"), + findResultsCount: document.getElementById("findResultsCount"), + findPreviousButton: document.getElementById("findPreviousButton"), + findNextButton: document.getElementById("findNextButton") + }, + passwordOverlay: { + dialog: document.getElementById("passwordDialog"), + label: document.getElementById("passwordText"), + input: document.getElementById("password"), + submitButton: document.getElementById("passwordSubmit"), + cancelButton: document.getElementById("passwordCancel") + }, + documentProperties: { + dialog: document.getElementById("documentPropertiesDialog"), + closeButton: document.getElementById("documentPropertiesClose"), + fields: { + fileName: document.getElementById("fileNameField"), + fileSize: document.getElementById("fileSizeField"), + title: document.getElementById("titleField"), + author: document.getElementById("authorField"), + subject: document.getElementById("subjectField"), + keywords: document.getElementById("keywordsField"), + creationDate: document.getElementById("creationDateField"), + modificationDate: document.getElementById("modificationDateField"), + creator: document.getElementById("creatorField"), + producer: document.getElementById("producerField"), + version: document.getElementById("versionField"), + pageCount: document.getElementById("pageCountField"), + pageSize: document.getElementById("pageSizeField"), + linearized: document.getElementById("linearizedField") + } + }, + altTextDialog: { + dialog: document.getElementById("altTextDialog"), + optionDescription: document.getElementById("descriptionButton"), + optionDecorative: document.getElementById("decorativeButton"), + textarea: document.getElementById("descriptionTextarea"), + cancelButton: document.getElementById("altTextCancel"), + saveButton: document.getElementById("altTextSave") + }, + newAltTextDialog: { + dialog: document.getElementById("newAltTextDialog"), + title: document.getElementById("newAltTextTitle"), + descriptionContainer: document.getElementById("newAltTextDescriptionContainer"), + textarea: document.getElementById("newAltTextDescriptionTextarea"), + disclaimer: document.getElementById("newAltTextDisclaimer"), + learnMore: document.getElementById("newAltTextLearnMore"), + imagePreview: document.getElementById("newAltTextImagePreview"), + createAutomatically: document.getElementById("newAltTextCreateAutomatically"), + createAutomaticallyButton: document.getElementById("newAltTextCreateAutomaticallyButton"), + downloadModel: document.getElementById("newAltTextDownloadModel"), + downloadModelDescription: document.getElementById("newAltTextDownloadModelDescription"), + error: document.getElementById("newAltTextError"), + errorCloseButton: document.getElementById("newAltTextCloseButton"), + cancelButton: document.getElementById("newAltTextCancel"), + notNowButton: document.getElementById("newAltTextNotNow"), + saveButton: document.getElementById("newAltTextSave") + }, + altTextSettingsDialog: { + dialog: document.getElementById("altTextSettingsDialog"), + createModelButton: document.getElementById("createModelButton"), + aiModelSettings: document.getElementById("aiModelSettings"), + learnMore: document.getElementById("altTextSettingsLearnMore"), + deleteModelButton: document.getElementById("deleteModelButton"), + downloadModelButton: document.getElementById("downloadModelButton"), + showAltTextDialogButton: document.getElementById("showAltTextDialogButton"), + altTextSettingsCloseButton: document.getElementById("altTextSettingsCloseButton"), + closeButton: document.getElementById("altTextSettingsCloseButton") + }, + addSignatureDialog: { + dialog: document.getElementById("addSignatureDialog"), + panels: document.getElementById("addSignatureActionContainer"), + typeButton: document.getElementById("addSignatureTypeButton"), + typeInput: document.getElementById("addSignatureTypeInput"), + drawButton: document.getElementById("addSignatureDrawButton"), + drawSVG: document.getElementById("addSignatureDraw"), + drawPlaceholder: document.getElementById("addSignatureDrawPlaceholder"), + drawThickness: document.getElementById("addSignatureDrawThickness"), + imageButton: document.getElementById("addSignatureImageButton"), + imageSVG: document.getElementById("addSignatureImage"), + imagePlaceholder: document.getElementById("addSignatureImagePlaceholder"), + imagePicker: document.getElementById("addSignatureFilePicker"), + imagePickerLink: document.getElementById("addSignatureImageBrowse"), + description: document.getElementById("addSignatureDescription"), + clearButton: document.getElementById("clearSignatureButton"), + saveContainer: document.getElementById("addSignatureSaveContainer"), + saveCheckbox: document.getElementById("addSignatureSaveCheckbox"), + errorBar: document.getElementById("addSignatureError"), + errorTitle: document.getElementById("addSignatureErrorTitle"), + errorDescription: document.getElementById("addSignatureErrorDescription"), + errorCloseButton: document.getElementById("addSignatureErrorCloseButton"), + cancelButton: document.getElementById("addSignatureCancelButton"), + addButton: document.getElementById("addSignatureAddButton") + }, + editSignatureDialog: { + dialog: document.getElementById("editSignatureDescriptionDialog"), + description: document.getElementById("editSignatureDescription"), + editSignatureView: document.getElementById("editSignatureView"), + cancelButton: document.getElementById("editSignatureCancelButton"), + updateButton: document.getElementById("editSignatureUpdateButton") + }, + annotationEditorParams: { + editorCommentsSidebar: document.getElementById("editorCommentsSidebar"), + editorCommentsSidebarCount: document.getElementById("editorCommentsSidebarCount"), + editorCommentsSidebarTitle: document.getElementById("editorCommentsSidebarTitle"), + editorCommentsSidebarCloseButton: document.getElementById("editorCommentsSidebarCloseButton"), + editorCommentsSidebarList: document.getElementById("editorCommentsSidebarList"), + editorCommentsSidebarResizer: document.getElementById("editorCommentsSidebarResizer"), + editorFreeTextFontSize: document.getElementById("editorFreeTextFontSize"), + editorFreeTextColor: document.getElementById("editorFreeTextColor"), + editorInkColor: document.getElementById("editorInkColor"), + editorInkThickness: document.getElementById("editorInkThickness"), + editorInkOpacity: document.getElementById("editorInkOpacity"), + editorStampAddImage: document.getElementById("editorStampAddImage"), + editorSignatureAddSignature: document.getElementById("editorSignatureAddSignature"), + editorFreeHighlightThickness: document.getElementById("editorFreeHighlightThickness"), + editorHighlightShowAll: document.getElementById("editorHighlightShowAll") + }, + printContainer: document.getElementById("printContainer"), + editorUndoBar: { + container: document.getElementById("editorUndoBar"), + message: document.getElementById("editorUndoBarMessage"), + undoButton: document.getElementById("editorUndoBarUndoButton"), + closeButton: document.getElementById("editorUndoBarCloseButton") + }, + editCommentDialog: { + dialog: document.getElementById("commentManagerDialog"), + toolbar: document.getElementById("commentManagerToolbar"), + title: document.getElementById("commentManagerTitle"), + textInput: document.getElementById("commentManagerTextInput"), + cancelButton: document.getElementById("commentManagerCancelButton"), + saveButton: document.getElementById("commentManagerSaveButton") + } + }; +} +function webViewerLoad() { + const config = getViewerConfiguration(); + PDFViewerApplication.run(config); +} +document.blockUnblockOnload?.(true); +if (document.readyState === "interactive" || document.readyState === "complete") { + webViewerLoad(); +} else { + document.addEventListener("DOMContentLoaded", webViewerLoad, true); +} + +export { PDFViewerApplication, AppConstants as PDFViewerApplicationConstants, AppOptions as PDFViewerApplicationOptions }; diff --git a/web-vitals/base/metric.ts b/web-vitals/base/metric.ts new file mode 100644 index 0000000..2b4162e --- /dev/null +++ b/web-vitals/base/metric.ts @@ -0,0 +1,11 @@ +export abstract class BaseMetric<AttributionType, EntryType> { + value: number + entries: EntryType[] + + constructor(value: number, entries: EntryType[]) { + this.value = value + this.entries = entries + } + + abstract get attribution(): AttributionType +} diff --git a/web-vitals/base/observer.ts b/web-vitals/base/observer.ts new file mode 100644 index 0000000..aaa9596 --- /dev/null +++ b/web-vitals/base/observer.ts @@ -0,0 +1,66 @@ +import {ssrSafeDocument} from '@github-ui/ssr-utils' +import type {BaseProcessor} from './processor' +import type {BaseMetric} from './metric' + +type ObserverCallback<MetricType> = (metric: MetricType, opts: {url?: string}) => void + +/* + * The CLSObserver is responsible for listening to Performance events and routing them to the entryProcessor. + * It also manages resetting CLS and reporting it when navigating or hiding a page. + */ +export abstract class BaseObserver<MetricType extends BaseMetric<unknown, unknown>, EntryType> { + cb: ObserverCallback<MetricType> + entryProcessor: BaseProcessor<MetricType, EntryType> + observer?: PerformanceObserver + url?: string + + constructor(cb: ObserverCallback<MetricType>) { + this.cb = cb + this.entryProcessor = this.initializeProcessor() + this.setupListeners() + } + + abstract initializeProcessor(): BaseProcessor<MetricType, EntryType> + abstract get supported(): boolean + abstract get softNavEventToListen(): string + + setupListeners() { + if (!this.supported) return + + const onHiddenOrPageHide = (event: Event) => { + if (event.type === 'pagehide' || document.visibilityState === 'hidden') { + this.report() + } + } + + // Similar to web-vitals, we report the current CLS when hard navigating or + // when the page is hidden + ssrSafeDocument?.addEventListener('visibilitychange', onHiddenOrPageHide, true) + ssrSafeDocument?.addEventListener('pagehide', onHiddenOrPageHide, true) + + ssrSafeDocument?.addEventListener(this.softNavEventToListen, () => { + this.report() + this.reset() + }) + } + + abstract observe(initialLoad: boolean): void + + report() { + if (!this.entryProcessor.metric || this.entryProcessor.metric.value < 0) return + + this.cb(this.entryProcessor.metric, {url: this.url}) + } + + teardown() { + this.observer?.takeRecords() + this.observer?.disconnect() + } + + reset() { + this.teardown() + this.entryProcessor.teardown() + this.entryProcessor = this.initializeProcessor() + this.observe(false) + } +} diff --git a/web-vitals/base/processor.ts b/web-vitals/base/processor.ts new file mode 100644 index 0000000..7160e42 --- /dev/null +++ b/web-vitals/base/processor.ts @@ -0,0 +1,6 @@ +export abstract class BaseProcessor<MetricType, EntryType> { + abstract processEntries(entries: EntryType[]): void + abstract get metric(): MetricType | null + + teardown() {} +} diff --git a/web-vitals/cls/layout-shift-processor.ts b/web-vitals/cls/layout-shift-processor.ts new file mode 100644 index 0000000..bd734f5 --- /dev/null +++ b/web-vitals/cls/layout-shift-processor.ts @@ -0,0 +1,65 @@ +import {BaseProcessor} from '../base/processor' +import {getSelector} from '../get-selector' +import {CLSMetric, getLargestLayoutShiftSource} from './metric' + +// From https://github.com/GoogleChrome/web-vitals/blob/1b872cf5f2159e8ace0e98d55d8eb54fb09adfbe/src/lib/LayoutShiftManager.ts#L17 +// with a few modifications to fit our needs. +export class LayoutShiftProcessor extends BaseProcessor<CLSMetric, LayoutShift> { + sessionValue = 0 + sessionEntries: LayoutShift[] = [] + layoutShiftTargetMap: Map<LayoutShiftAttribution, string> = new Map() + + get metric() { + // Pages without entries report CLS = 0 + if (this.sessionEntries.length === 0) { + return new CLSMetric(0, [], new Map()) + } + + return new CLSMetric(this.sessionValue, this.sessionEntries, this.layoutShiftTargetMap) + } + + processEntries(entries: LayoutShift[]) { + for (const entry of entries) { + this.processEntry(entry) + } + } + + processEntry(entry: LayoutShift) { + // Only count layout shifts without recent user input. + if (entry.hadRecentInput) return + + const firstSessionEntry = this.sessionEntries[0] + const lastSessionEntry = this.sessionEntries.at(-1) + + // If the entry occurred less than 1 second after the previous entry + // and less than 5 seconds after the first entry in the session, + // include the entry in the current session. Otherwise, start a new + // session. + if ( + this.sessionValue && + firstSessionEntry && + lastSessionEntry && + entry.startTime - lastSessionEntry.startTime < 1000 && + entry.startTime - firstSessionEntry.startTime < 5000 + ) { + this.sessionValue += entry.value + this.sessionEntries.push(entry) + } else { + this.sessionValue = entry.value + this.sessionEntries = [entry] + } + + this.setLargestShiftSource(entry) + } + + setLargestShiftSource(entry: LayoutShift) { + if (entry?.sources?.length) { + const largestSource = getLargestLayoutShiftSource(entry.sources) + const node = largestSource?.node + if (node) { + const customTarget = getSelector(node) + this.layoutShiftTargetMap.set(largestSource, customTarget) + } + } + } +} diff --git a/web-vitals/cls/metric.ts b/web-vitals/cls/metric.ts new file mode 100644 index 0000000..564e494 --- /dev/null +++ b/web-vitals/cls/metric.ts @@ -0,0 +1,40 @@ +import {BaseMetric} from '../base/metric' + +export interface CLSAttribution { + largestShiftTarget?: string +} + +const getLargestLayoutShiftEntry = (entries: LayoutShift[]) => { + return entries.reduce((a, b) => (a.value > b.value ? a : b)) +} + +export const getLargestLayoutShiftSource = (sources: LayoutShiftAttribution[]) => { + return sources.find(s => s.node?.nodeType === 1) || sources[0] +} + +/* + * The CLS metric. This class is compatible with web-vitals' CLSMetric interface that we expect to report to DataDog and Hydro. + */ +export class CLSMetric extends BaseMetric<CLSAttribution, LayoutShift> { + name = 'CLS' as const + targetMap: Map<LayoutShiftAttribution, string> + + constructor(value: number, entries: LayoutShift[], targetMap: Map<LayoutShiftAttribution, string>) { + super(value, entries) + this.targetMap = targetMap + } + + get attribution(): CLSAttribution { + if (!this.entries.length) return {} + + const largestEntry = getLargestLayoutShiftEntry(this.entries) + if (!largestEntry?.sources?.length) return {} + + const largestSource = getLargestLayoutShiftSource(largestEntry.sources) + if (!largestSource) return {} + + return { + largestShiftTarget: this.targetMap.get(largestSource), + } + } +} diff --git a/web-vitals/cls/observer.ts b/web-vitals/cls/observer.ts new file mode 100644 index 0000000..d2b01de --- /dev/null +++ b/web-vitals/cls/observer.ts @@ -0,0 +1,34 @@ +import {ssrSafeWindow} from '@github-ui/ssr-utils' +import type {CLSMetric} from './metric' +import {LayoutShiftProcessor} from './layout-shift-processor' +import {BaseObserver} from '../base/observer' +import {SOFT_NAV_STATE} from '@github-ui/soft-nav/states' + +const supportsCLS = ssrSafeWindow && 'LayoutShift' in ssrSafeWindow + +/* + * The CLSObserver is responsible for listening to Performance events and routing them to the entryProcessor. + * It also manages resetting CLS and reporting it when navigating or hiding a page. + */ +export class CLSObserver extends BaseObserver<CLSMetric, LayoutShift> { + get softNavEventToListen() { + return SOFT_NAV_STATE.START + } + + initializeProcessor() { + return new LayoutShiftProcessor() + } + + override get supported(): boolean { + return !!supportsCLS + } + + observe(initialLoad = true) { + this.url = ssrSafeWindow?.location.href + this.observer = new PerformanceObserver(list => { + this.entryProcessor.processEntries(list.getEntries() as LayoutShift[]) + }) + + this.observer.observe({type: 'layout-shift', buffered: initialLoad}) + } +} diff --git a/web-vitals/dom-nodes.ts b/web-vitals/dom-nodes.ts new file mode 100644 index 0000000..a117608 --- /dev/null +++ b/web-vitals/dom-nodes.ts @@ -0,0 +1,21 @@ +import {isFeatureEnabled} from '@github-ui/feature-flags' +import {SOFT_NAV_STATE} from '@github-ui/soft-nav/states' +import {ssrSafeDocument} from '@github-ui/ssr-utils' + +let previousDomNodeCount: number = 0 + +ssrSafeDocument?.addEventListener(SOFT_NAV_STATE.START, () => { + if (!isFeatureEnabled('dom_node_counts')) return + previousDomNodeCount = countNodes() // nodes may have changes with user interactions / deferred renders +}) + +function countNodes() { + return ssrSafeDocument?.getElementsByTagName('*').length || 0 +} + +export function getDomNodes() { + return { + previous: previousDomNodeCount, + current: countNodes(), + } +} diff --git a/web-vitals/element-timing/metric.ts b/web-vitals/element-timing/metric.ts new file mode 100644 index 0000000..4292dff --- /dev/null +++ b/web-vitals/element-timing/metric.ts @@ -0,0 +1,20 @@ +import {getSelector} from '../get-selector' + +export class ElementTimingMetric { + name = 'ElementTiming' as const + value: number + identifier: string + attribution: { + target?: string + } + + declare app: string + + constructor(value: number, element: Element, identifier: string) { + this.value = value + this.identifier = identifier + this.attribution = { + target: getSelector(element), + } + } +} diff --git a/web-vitals/element-timing/observer.ts b/web-vitals/element-timing/observer.ts new file mode 100644 index 0000000..ca0263b --- /dev/null +++ b/web-vitals/element-timing/observer.ts @@ -0,0 +1,69 @@ +import {SOFT_NAV_STATE} from '@github-ui/soft-nav/states' +import {ssrSafeDocument, ssrSafeWindow} from '@github-ui/ssr-utils' +import {ElementTimingMetric} from './metric' + +const supportsElementTiming = ssrSafeWindow && 'PerformanceElementTiming' in ssrSafeWindow + +type ElementTimingTCallback = (elementTiming: ElementTimingMetric, opts: {url?: string}) => void + +interface PerformanceElementTiming extends PerformanceEntry { + renderTime: number + observer?: PerformanceObserver + element: Element + identifier: string +} +/* + * The ElementTimingObserver is responsible for listening to PerformanceElementTiming events and reporting them. + */ +export class ElementTimingObserver { + cb: ElementTimingTCallback + observer?: PerformanceObserver + url?: string + + constructor(cb: ElementTimingTCallback) { + this.cb = cb + this.setupListeners() + } + + setupListeners() { + if (!supportsElementTiming) return + + // SOFT_NAV_STATE.RENDER is dispatched when the soft navigation finished rendering. + // That means that the previous page is fully hidden so we can stop listening for its events. + ssrSafeDocument?.addEventListener(SOFT_NAV_STATE.RENDER, () => { + this.reset() + }) + } + + observe(initialLoad = true) { + if (!supportsElementTiming) return + + this.observer = new PerformanceObserver(list => { + const entries = list.getEntries() as PerformanceElementTiming[] + for (const {renderTime, element, identifier} of entries) { + this.report(new ElementTimingMetric(renderTime, element, identifier)) + } + }) + + this.observer.observe({ + type: 'element', + // buffered events are important on first page load since we may have missed + // a few until the observer was set up. + buffered: initialLoad, + }) + } + + report(metric: ElementTimingMetric) { + this.cb(metric, {url: this.url}) + } + + teardown() { + this.observer?.takeRecords() + this.observer?.disconnect() + } + + reset() { + this.teardown() + this.observe(false) + } +} diff --git a/web-vitals/get-selector.ts b/web-vitals/get-selector.ts new file mode 100644 index 0000000..2c48dea --- /dev/null +++ b/web-vitals/get-selector.ts @@ -0,0 +1,32 @@ +/* + * From https://github.com/GoogleChrome/web-vitals/blob/7b44bea0d5ba6629c5fd34c3a09cc683077871d0/src/lib/getSelector.ts + * I want to make sure we get element names the same way as web-vitals does. + */ + +const getName = (node: Node) => { + const name = node.nodeName + return node.nodeType === 1 ? name.toLowerCase() : name.toUpperCase().replace(/^#/, '') +} + +export const getSelector = (node: Node | null | undefined, maxLen?: number) => { + let sel = '' + + try { + while (node && node.nodeType !== 9) { + const el: Element = node as Element + const part = el.id + ? `#${el.id}` + : getName(el) + + (el.classList && el.classList.value && el.classList.value.trim() && el.classList.value.trim().length + ? `.${el.classList.value.trim().replace(/\s+/g, '.')}` + : '') + if (sel.length + part.length > (maxLen || 100) - 1) return sel || part + sel = sel ? `${part}>${sel}` : part + if (el.id) break + node = el.parentNode + } + } catch { + // Do nothing... + } + return sel +} diff --git a/web-vitals/hpc-events.ts b/web-vitals/hpc-events.ts new file mode 100644 index 0000000..a67473a --- /dev/null +++ b/web-vitals/hpc-events.ts @@ -0,0 +1,84 @@ +import type {SoftNavMechanism} from '@github-ui/soft-nav/events' +import {getSelector} from './get-selector' + +export interface HPCEventTarget extends EventTarget { + addEventListener( + type: 'hpc:timing', + listener: (event: HPCTimingEvent) => void, + options?: boolean | AddEventListenerOptions, + ): void + addEventListener( + type: 'hpc:dom-insertion', + listener: (event: HPCDomInsertionEvent) => void, + options?: boolean | AddEventListenerOptions, + ): void + addEventListener(type: string, listener: (event: Event) => void, options?: boolean | AddEventListenerOptions): void + + removeEventListener( + type: 'hpc:timing', + listener: (event: HPCTimingEvent) => void, + options?: boolean | AddEventListenerOptions, + ): void + removeEventListener( + type: 'hpc:dom-insertion', + listener: (event: HPCDomInsertionEvent) => void, + options?: boolean | AddEventListenerOptions, + ): void + removeEventListener(type: string, listener: (event: Event) => void, options?: boolean | AddEventListenerOptions): void +} + +export class HPCTimingEvent extends Event { + name = 'HPC' as const + value: number + attribution: { + element?: string + } + + soft: boolean + ssr: boolean + lazy: boolean + alternate: boolean + mechanism: SoftNavMechanism | 'hard' + found: boolean + gqlFetched: boolean + jsFetched: boolean + app: string + + constructor( + soft: boolean, + ssr: boolean, + lazy: boolean, + alternate: boolean, + mechanism: SoftNavMechanism | 'hard', + found: boolean, + gqlFetched: boolean, + jsFetched: boolean, + app: string, + start: number, + element: Element | null, + ) { + super('hpc:timing') + this.soft = soft + this.ssr = ssr + this.lazy = lazy + this.alternate = alternate + this.mechanism = mechanism + this.found = found + this.gqlFetched = gqlFetched + this.jsFetched = jsFetched + this.app = app + + this.value = performance.now() - start + this.attribution = { + element: getSelector(element), + } + } +} + +export class HPCDomInsertionEvent extends Event { + element: Element | null + constructor(element: Element | null) { + super('hpc:dom-insertion') + this.element = element + } +} diff --git a/web-vitals/hpc-events1.ts b/web-vitals/hpc-events1.ts new file mode 100644 index 0000000..a67473a --- /dev/null +++ b/web-vitals/hpc-events1.ts @@ -0,0 +1,84 @@ +import type {SoftNavMechanism} from '@github-ui/soft-nav/events' +import {getSelector} from './get-selector' + +export interface HPCEventTarget extends EventTarget { + addEventListener( + type: 'hpc:timing', + listener: (event: HPCTimingEvent) => void, + options?: boolean | AddEventListenerOptions, + ): void + addEventListener( + type: 'hpc:dom-insertion', + listener: (event: HPCDomInsertionEvent) => void, + options?: boolean | AddEventListenerOptions, + ): void + addEventListener(type: string, listener: (event: Event) => void, options?: boolean | AddEventListenerOptions): void + + removeEventListener( + type: 'hpc:timing', + listener: (event: HPCTimingEvent) => void, + options?: boolean | AddEventListenerOptions, + ): void + removeEventListener( + type: 'hpc:dom-insertion', + listener: (event: HPCDomInsertionEvent) => void, + options?: boolean | AddEventListenerOptions, + ): void + removeEventListener(type: string, listener: (event: Event) => void, options?: boolean | AddEventListenerOptions): void +} + +export class HPCTimingEvent extends Event { + name = 'HPC' as const + value: number + attribution: { + element?: string + } + + soft: boolean + ssr: boolean + lazy: boolean + alternate: boolean + mechanism: SoftNavMechanism | 'hard' + found: boolean + gqlFetched: boolean + jsFetched: boolean + app: string + + constructor( + soft: boolean, + ssr: boolean, + lazy: boolean, + alternate: boolean, + mechanism: SoftNavMechanism | 'hard', + found: boolean, + gqlFetched: boolean, + jsFetched: boolean, + app: string, + start: number, + element: Element | null, + ) { + super('hpc:timing') + this.soft = soft + this.ssr = ssr + this.lazy = lazy + this.alternate = alternate + this.mechanism = mechanism + this.found = found + this.gqlFetched = gqlFetched + this.jsFetched = jsFetched + this.app = app + + this.value = performance.now() - start + this.attribution = { + element: getSelector(element), + } + } +} + +export class HPCDomInsertionEvent extends Event { + element: Element | null + constructor(element: Element | null) { + super('hpc:dom-insertion') + this.element = element + } +} diff --git a/web-vitals/hpc.ts b/web-vitals/hpc.ts new file mode 100644 index 0000000..4af0361 --- /dev/null +++ b/web-vitals/hpc.ts @@ -0,0 +1,293 @@ +import {wasServerRendered} from '@github-ui/ssr-utils' +import {onLCP} from 'web-vitals/attribution' +import {hasFetchedGQL, hasFetchedJS, isReactAlternate, isReactLazyPayload} from './web-vitals' +import type {SoftNavMechanism} from '@github-ui/soft-nav/events' +import {HPCDomInsertionEvent, HPCTimingEvent, type HPCEventTarget} from './hpc-events' +import {hasSoftNavFailure} from '@github-ui/soft-nav/utils' +import {SOFT_NAV_STATE} from '@github-ui/soft-nav/states' +import {getCurrentReactAppName} from '@github-ui/stats-metadata' + +const INSERTION_TIMEOUT = 10000 +const ELEMENTS_TO_IGNORE = ['meta', 'script', 'link'] + +function getAppName() { + return getCurrentReactAppName() || 'rails' +} + +function isVisible(element: HTMLElement) { + // Safari doesn't support `checkVisibility` yet. + if (typeof element.checkVisibility === 'function') return element.checkVisibility() + + return Boolean(element.offsetParent || element.offsetWidth || element.offsetHeight) +} + +type CallbackFunction = (metric: HPCTimingEvent) => void + +interface HPCObserverAttributes { + soft: boolean + mechanism: SoftNavMechanism | 'hard' + latestHPCElement: Element | null + callback: CallbackFunction +} + +export class HPCObserver { + abortController = new AbortController() + tabHidden = false + insertionFound = false + hpcElement: Element | null = null + + soft: boolean + mechanism: SoftNavMechanism | 'hard' + latestHPCElement: Element | null + hpcStart: DOMHighResTimeStamp + hpcTarget: HPCEventTarget = new EventTarget() as HPCEventTarget + animationFrame?: number + dataHPCanimationFrame?: number + emulatedHPCTimer?: ReturnType<typeof setTimeout> + listenerOpts: AddEventListenerOptions + hpcDOMInsertionObserver: MutationObserver | null = null + callback: CallbackFunction + + constructor({soft, mechanism, latestHPCElement, callback}: HPCObserverAttributes) { + this.soft = soft + this.mechanism = mechanism + + if (hasSoftNavFailure()) { + this.mechanism = 'turbo.error' + } + + this.latestHPCElement = latestHPCElement + this.hpcStart = soft ? performance.now() : 0 + this.listenerOpts = {capture: true, passive: true, once: true, signal: this.abortController.signal} + this.callback = callback + } + + connect() { + if (!this.soft) { + // In a hard-load, if the script is evaluated after the `data-hpc` element is rendered, + // we default the HPC value to LCP. + const hpcElement = document.querySelector('[data-hpc]') + if (hpcElement) { + this.hpcElement = hpcElement + this.setLCPasHPC(this.soft, true, this.callback) + return + } + + // if the element is not in the page yet, listen for mutations. + setTimeout(() => { + // if no mutations happen after INSERTION_TIMEOUT, default to LCP again + if (!this.insertionFound) this.setLCPasHPC(this.soft, false, this.callback) + }, INSERTION_TIMEOUT) + } + + this.#setupListeners() + this.hpcDOMInsertionObserver = this.#buildMutationObserver() + this.hpcDOMInsertionObserver.observe(document, {childList: true, subtree: true}) + } + + disconnect() { + this.#cleanupListeners() + this.hpcDOMInsertionObserver?.disconnect() + } + + // Observer to listen to ALL mutations to the DOM. We need to check all added nodes + // for the `data-hpc` attribue. If none are found, we keep listening until all mutations are done. + #buildMutationObserver() { + return new MutationObserver(mutations => { + let hasDataHPC = false + let visibleElement = false + let hpcElement: Element | null = null + let insertionElement: Element | null = null + + const validMutations = mutations.filter( + mutation => mutation.type === 'childList' && mutation.addedNodes.length > 0, + ) + + // if the mutation didn't add any nodes, we don't track its HPC + if (validMutations.length === 0) return + + const addedNodes = validMutations + .flatMap(mutation => Array.from(mutation.addedNodes)) + .filter(node => node instanceof Element && !ELEMENTS_TO_IGNORE.includes(node.tagName.toLowerCase())) + + if (addedNodes.length === 0) return + + for (const node of addedNodes) { + const el = node as Element + hpcElement = el.hasAttribute('data-hpc') ? el : el.querySelector('[data-hpc]') + if (hpcElement) { + this.hpcElement = hpcElement + if (this.animationFrame) cancelAnimationFrame(this.animationFrame) + hasDataHPC = true + break + } + } + + if (hasDataHPC && hpcElement) { + this.#reportHPC(hpcElement) + return + } + + for (const node of addedNodes) { + const el = node as HTMLElement + // we only care about visible elements + if (isVisible(el)) { + insertionElement = el + if (this.animationFrame) cancelAnimationFrame(this.animationFrame) + visibleElement = true + break + } + } + + if (visibleElement) { + const insertionEvent = new HPCDomInsertionEvent(insertionElement) + this.animationFrame = requestAnimationFrame(() => { + this.hpcTarget.dispatchEvent(insertionEvent) + }) + } + }) + } + + #reportHPC(element: Element) { + window.performance.measure('HPC', 'navigationStart') + // data-hpc found, we can stop listening to mutations. + this.hpcDOMInsertionObserver?.disconnect() + // only cancel the animation frame if the controller aborts. + const timingEvent = new HPCTimingEvent( + this.soft, + wasServerRendered(), + isReactLazyPayload(), + isReactAlternate(), + this.mechanism, + true, + hasFetchedGQL(), + hasFetchedJS(), + getAppName(), + this.hpcStart, + element, + ) + + this.dataHPCanimationFrame = requestAnimationFrame(() => { + this.hpcTarget.dispatchEvent(timingEvent) + }) + } + + #cleanupListeners() { + document.removeEventListener('touchstart', this.stop, this.listenerOpts) + document.removeEventListener('mousedown', this.stop, this.listenerOpts) + document.removeEventListener('keydown', this.stop, this.listenerOpts) + document.removeEventListener('pointerdown', this.stop, this.listenerOpts) + document.removeEventListener('visibilitychange', this.onVisibilityChange) + document.removeEventListener(SOFT_NAV_STATE.RENDER, this.onSoftNavRender) + + this.hpcTarget.removeEventListener('hpc:dom-insertion', this.onDOMInsertion) + this.hpcTarget.removeEventListener('hpc:timing', this.onHPCTiming) + + this.abortController.signal.removeEventListener('abort', this.onAbort) + } + + #setupListeners() { + // Stop listening for HPC events if the user has interacted, as interactions + // can cause DOM mutations, which we want to avoid capturing for HPC. + // eslint-disable-next-line github/require-passive-events + document.addEventListener('touchstart', this.stop, this.listenerOpts) + document.addEventListener('mousedown', this.stop, this.listenerOpts) + document.addEventListener('keydown', this.stop, this.listenerOpts) + document.addEventListener('pointerdown', this.stop, this.listenerOpts) + + // Process HPC events + this.hpcTarget.addEventListener('hpc:dom-insertion', this.onDOMInsertion, { + signal: this.abortController.signal, + }) + this.hpcTarget.addEventListener('hpc:timing', this.onHPCTiming, {signal: this.abortController.signal}) + document.addEventListener(SOFT_NAV_STATE.RENDER, this.onSoftNavRender) + + // If the user changes tab, we don't want to send the recorded metrics since it may send garbage data. + document.addEventListener('visibilitychange', this.onVisibilityChange, { + signal: this.abortController.signal, + }) + + // If the stop event is triggered, we want to stop listening to DOM mutations. + this.abortController.signal.addEventListener('abort', this.onAbort) + } + + stop = () => { + this.abortController.abort() + } + + onDOMInsertion = (e: HPCDomInsertionEvent) => { + this.insertionFound = true + clearTimeout(this.emulatedHPCTimer) + // Whenever we see a DOM insertion, we keep track of when it happened. + const event = new HPCTimingEvent( + this.soft, + wasServerRendered(), + isReactLazyPayload(), + isReactAlternate(), + this.mechanism, + false, + hasFetchedGQL(), + hasFetchedJS(), + getAppName(), + this.hpcStart, + e.element, + ) + + // If no mutations happen after the timeout, we assume that the DOM is fully loaded, so we send the + // last seen mutation values. + this.emulatedHPCTimer = setTimeout(() => this.hpcTarget.dispatchEvent(event), INSERTION_TIMEOUT) + } + + onHPCTiming = (e: HPCTimingEvent) => { + if (!this.tabHidden && e.value < 60_000) this.callback(e) + + this.abortController.abort() + } + + onVisibilityChange = () => { + this.tabHidden = true + this.abortController.abort() + } + + onSoftNavRender = () => { + const currentHPCElement = document.querySelector('[data-hpc]') + this.hpcElement = currentHPCElement + + // In case the soft navigation doesn't change the root data-hpc element, the MutationObserver + // won't catch it, so we use the soft navigation timing as HPC. + if (!currentHPCElement || currentHPCElement !== this.latestHPCElement) return + + this.#reportHPC(currentHPCElement) + } + + onAbort = () => { + if (this.dataHPCanimationFrame) cancelAnimationFrame(this.dataHPCanimationFrame) + if (this.animationFrame) cancelAnimationFrame(this.animationFrame) + clearTimeout(this.emulatedHPCTimer) + this.disconnect() + } + + setLCPasHPC(soft: boolean, found: boolean, cb: CallbackFunction) { + const mechanism = this.mechanism === 'turbo.error' ? this.mechanism : 'hard' + + onLCP(({value, attribution}) => { + window.performance.measure('HPC', {start: 'navigationStart', end: value}) + cb({ + name: 'HPC', + value, + soft, + found, + gqlFetched: hasFetchedGQL(), + jsFetched: hasFetchedJS(), + ssr: wasServerRendered(), + lazy: isReactLazyPayload(), + alternate: isReactAlternate(), + mechanism, + app: getAppName(), + attribution: { + element: attribution?.target, + }, + } as HPCTimingEvent) + }) + } +} diff --git a/web-vitals/hydro-stats.ts b/web-vitals/hydro-stats.ts new file mode 100644 index 0000000..cf9b429 --- /dev/null +++ b/web-vitals/hydro-stats.ts @@ -0,0 +1,198 @@ +import {sendEvent, stringifyObjectValues} from '@github-ui/hydro-analytics' +import {getEnabledFeatures, isFeatureEnabled} from '@github-ui/feature-flags' +import {loaded} from '@github-ui/document-ready' +import type {WebVitalMetric, MetricOrHPC} from './web-vitals' +import type {HPCTimingEvent} from './hpc-events' +import {getCPUBucket} from '@github-ui/cpu-bucket' +import type {INPAttribution} from './inp/metric' + +interface WebVitalInformation { + name: string + value: number + element?: string + events?: string + interactionType?: string + eventType?: string + inputDelay?: number + processingDuration?: number + presentationDelay?: number +} + +interface HPCInformation extends WebVitalInformation { + mechanism: HPCTimingEvent['mechanism'] + soft: boolean +} + +interface HydroStat { + react?: boolean + reactApp?: string | null + reactPartials?: string[] + featureFlags?: string[] + ssr?: boolean + hpc?: HPCInformation + ttfb?: WebVitalInformation + fcp?: WebVitalInformation + lcp?: WebVitalInformation + fid?: WebVitalInformation + inp?: WebVitalInformation + cls?: WebVitalInformation + elementtiming?: WebVitalInformation + longTasks?: PerformanceEntryList + longAnimationFrames?: PerformanceEntryList + controller?: string + action?: string + routePattern?: string + cpu?: string + domNodes?: number + previousDomNodes?: number +} + +let queued: HydroStat | undefined + +/** + * Batched report of vital to hydro + */ +export function sendToHydro({ + metric, + ssr, + domNodes, + previousDomNodes, + longTasks, + longAnimationFrames, +}: { + metric?: MetricOrHPC + ssr: boolean + domNodes?: number + previousDomNodes?: number + longTasks?: PerformanceEntryList + longAnimationFrames?: PerformanceEntryList +}) { + let hydroStat: HydroStat | undefined + if (isFeatureEnabled('report_hydro_web_vitals')) return + + if (!hydroStat) { + const reactApp = document.querySelector('react-app') + hydroStat = queueStat() + hydroStat.react = !!reactApp + hydroStat.reactApp = reactApp?.getAttribute('app-name') + // Convert to Set and back to Array to remove duplicates. + hydroStat.reactPartials = [ + ...new Set( + Array.from(document.querySelectorAll('react-partial')).map( + partial => partial.getAttribute('partial-name') || '', + ), + ), + ] + hydroStat.featureFlags = getFeatureFlags() + hydroStat.ssr = ssr + hydroStat.controller = document.querySelector<HTMLMetaElement>('meta[name="route-controller"]')?.content + hydroStat.action = document.querySelector<HTMLMetaElement>('meta[name="route-action"]')?.content + hydroStat.routePattern = document.querySelector<HTMLMetaElement>('meta[name="route-pattern"]')?.content + hydroStat.cpu = getCPUBucket() + + if (domNodes) hydroStat.domNodes = domNodes + if (previousDomNodes) hydroStat.previousDomNodes = previousDomNodes + } + + if (metric) { + return sendWebVital(hydroStat, metric) + } + + hydroStat.longTasks = longTasks + hydroStat.longAnimationFrames = longAnimationFrames +} + +interface ReactApp extends Element { + enabledFeatures: string[] +} + +function getFeatureFlags() { + const globalFlags = getEnabledFeatures() + const reactAppFlags = document.querySelector<ReactApp>('react-app')?.enabledFeatures || [] + // need to many to check for speculation_rules otherwise it will get minified away + const speculationRulesFlag = isFeatureEnabled('speculation_rules') ? ['speculation_rules'] : [] + + return Array.from(new Set([...globalFlags, ...reactAppFlags, ...speculationRulesFlag])) +} + +function sendWebVital(hydroStat: HydroStat, metric: MetricOrHPC) { + if (metric.value < 60_000) { + if (metric.name === 'HPC') { + hydroStat[metric.name.toLocaleLowerCase() as Lowercase<typeof metric.name>] = buildHPCInformation(metric) + } else { + hydroStat[metric.name.toLocaleLowerCase() as Lowercase<typeof metric.name>] = buildWebVitalInformation(metric) + } + } +} + +function buildHPCInformation(metric: HPCTimingEvent): HPCInformation { + return { + name: metric.name, + value: metric.value, + element: metric.attribution?.element, + soft: !!metric.soft, + mechanism: metric.mechanism, + } +} + +function buildWebVitalInformation(metric: WebVitalMetric): WebVitalInformation { + const vitalInformation: WebVitalInformation = { + name: metric.name, + value: metric.value, + } + + switch (metric.name) { + case 'LCP': + case 'ElementTiming': + vitalInformation.element = metric.attribution?.target + break + case 'INP': + vitalInformation.element = metric.attribution?.interactionTarget + // Only include custom fields if they exist (from our custom INPMetric class) + if (metric.attribution && 'interactionType' in metric.attribution) { + const customAttribution = metric.attribution as INPAttribution + vitalInformation.interactionType = customAttribution.interactionType + vitalInformation.eventType = customAttribution.eventType + vitalInformation.inputDelay = customAttribution.inputDelay + vitalInformation.processingDuration = customAttribution.processingDuration + vitalInformation.presentationDelay = customAttribution.presentationDelay + } + if (metric.entries?.length) vitalInformation.events = metric.entries.map(entry => entry.name).join(',') + break + case 'CLS': + vitalInformation.element = metric.attribution?.largestShiftTarget + break + } + + return vitalInformation +} + +/** + * Create a new stat object and schedule it to be sent to hydro + */ +function queueStat(): HydroStat { + if (!queued) { + queued = {} + scheduleSend() + } + return queued +} + +/** + * Schedule a send to hydro + */ +async function scheduleSend() { + await loaded + // eslint-disable-next-line compat/compat + window.requestIdleCallback(send) +} + +/** + * Send the queued event to hydro + */ +function send() { + if (!queued) return + + sendEvent('web-vital', stringifyObjectValues(queued)) + queued = undefined +} diff --git a/web-vitals/hydro-stats1.ts b/web-vitals/hydro-stats1.ts new file mode 100644 index 0000000..cf9b429 --- /dev/null +++ b/web-vitals/hydro-stats1.ts @@ -0,0 +1,198 @@ +import {sendEvent, stringifyObjectValues} from '@github-ui/hydro-analytics' +import {getEnabledFeatures, isFeatureEnabled} from '@github-ui/feature-flags' +import {loaded} from '@github-ui/document-ready' +import type {WebVitalMetric, MetricOrHPC} from './web-vitals' +import type {HPCTimingEvent} from './hpc-events' +import {getCPUBucket} from '@github-ui/cpu-bucket' +import type {INPAttribution} from './inp/metric' + +interface WebVitalInformation { + name: string + value: number + element?: string + events?: string + interactionType?: string + eventType?: string + inputDelay?: number + processingDuration?: number + presentationDelay?: number +} + +interface HPCInformation extends WebVitalInformation { + mechanism: HPCTimingEvent['mechanism'] + soft: boolean +} + +interface HydroStat { + react?: boolean + reactApp?: string | null + reactPartials?: string[] + featureFlags?: string[] + ssr?: boolean + hpc?: HPCInformation + ttfb?: WebVitalInformation + fcp?: WebVitalInformation + lcp?: WebVitalInformation + fid?: WebVitalInformation + inp?: WebVitalInformation + cls?: WebVitalInformation + elementtiming?: WebVitalInformation + longTasks?: PerformanceEntryList + longAnimationFrames?: PerformanceEntryList + controller?: string + action?: string + routePattern?: string + cpu?: string + domNodes?: number + previousDomNodes?: number +} + +let queued: HydroStat | undefined + +/** + * Batched report of vital to hydro + */ +export function sendToHydro({ + metric, + ssr, + domNodes, + previousDomNodes, + longTasks, + longAnimationFrames, +}: { + metric?: MetricOrHPC + ssr: boolean + domNodes?: number + previousDomNodes?: number + longTasks?: PerformanceEntryList + longAnimationFrames?: PerformanceEntryList +}) { + let hydroStat: HydroStat | undefined + if (isFeatureEnabled('report_hydro_web_vitals')) return + + if (!hydroStat) { + const reactApp = document.querySelector('react-app') + hydroStat = queueStat() + hydroStat.react = !!reactApp + hydroStat.reactApp = reactApp?.getAttribute('app-name') + // Convert to Set and back to Array to remove duplicates. + hydroStat.reactPartials = [ + ...new Set( + Array.from(document.querySelectorAll('react-partial')).map( + partial => partial.getAttribute('partial-name') || '', + ), + ), + ] + hydroStat.featureFlags = getFeatureFlags() + hydroStat.ssr = ssr + hydroStat.controller = document.querySelector<HTMLMetaElement>('meta[name="route-controller"]')?.content + hydroStat.action = document.querySelector<HTMLMetaElement>('meta[name="route-action"]')?.content + hydroStat.routePattern = document.querySelector<HTMLMetaElement>('meta[name="route-pattern"]')?.content + hydroStat.cpu = getCPUBucket() + + if (domNodes) hydroStat.domNodes = domNodes + if (previousDomNodes) hydroStat.previousDomNodes = previousDomNodes + } + + if (metric) { + return sendWebVital(hydroStat, metric) + } + + hydroStat.longTasks = longTasks + hydroStat.longAnimationFrames = longAnimationFrames +} + +interface ReactApp extends Element { + enabledFeatures: string[] +} + +function getFeatureFlags() { + const globalFlags = getEnabledFeatures() + const reactAppFlags = document.querySelector<ReactApp>('react-app')?.enabledFeatures || [] + // need to many to check for speculation_rules otherwise it will get minified away + const speculationRulesFlag = isFeatureEnabled('speculation_rules') ? ['speculation_rules'] : [] + + return Array.from(new Set([...globalFlags, ...reactAppFlags, ...speculationRulesFlag])) +} + +function sendWebVital(hydroStat: HydroStat, metric: MetricOrHPC) { + if (metric.value < 60_000) { + if (metric.name === 'HPC') { + hydroStat[metric.name.toLocaleLowerCase() as Lowercase<typeof metric.name>] = buildHPCInformation(metric) + } else { + hydroStat[metric.name.toLocaleLowerCase() as Lowercase<typeof metric.name>] = buildWebVitalInformation(metric) + } + } +} + +function buildHPCInformation(metric: HPCTimingEvent): HPCInformation { + return { + name: metric.name, + value: metric.value, + element: metric.attribution?.element, + soft: !!metric.soft, + mechanism: metric.mechanism, + } +} + +function buildWebVitalInformation(metric: WebVitalMetric): WebVitalInformation { + const vitalInformation: WebVitalInformation = { + name: metric.name, + value: metric.value, + } + + switch (metric.name) { + case 'LCP': + case 'ElementTiming': + vitalInformation.element = metric.attribution?.target + break + case 'INP': + vitalInformation.element = metric.attribution?.interactionTarget + // Only include custom fields if they exist (from our custom INPMetric class) + if (metric.attribution && 'interactionType' in metric.attribution) { + const customAttribution = metric.attribution as INPAttribution + vitalInformation.interactionType = customAttribution.interactionType + vitalInformation.eventType = customAttribution.eventType + vitalInformation.inputDelay = customAttribution.inputDelay + vitalInformation.processingDuration = customAttribution.processingDuration + vitalInformation.presentationDelay = customAttribution.presentationDelay + } + if (metric.entries?.length) vitalInformation.events = metric.entries.map(entry => entry.name).join(',') + break + case 'CLS': + vitalInformation.element = metric.attribution?.largestShiftTarget + break + } + + return vitalInformation +} + +/** + * Create a new stat object and schedule it to be sent to hydro + */ +function queueStat(): HydroStat { + if (!queued) { + queued = {} + scheduleSend() + } + return queued +} + +/** + * Schedule a send to hydro + */ +async function scheduleSend() { + await loaded + // eslint-disable-next-line compat/compat + window.requestIdleCallback(send) +} + +/** + * Send the queued event to hydro + */ +function send() { + if (!queued) return + + sendEvent('web-vital', stringifyObjectValues(queued)) + queued = undefined +} diff --git a/web-vitals/inp/interaction-count.ts b/web-vitals/inp/interaction-count.ts new file mode 100644 index 0000000..f3b4117 --- /dev/null +++ b/web-vitals/inp/interaction-count.ts @@ -0,0 +1,63 @@ +// Based on https://github.com/GoogleChrome/web-vitals/blob/7b44bea0d5ba6629c5fd34c3a09cc683077871d0/src/lib/polyfills/interactionCountPolyfill.ts +declare global { + interface Performance { + interactionCount: number + } +} + +/* + * The InteractionCountObserver tracks the number of interactions that have occurred on the page. This + * is used to estimate INP's p98 value. + */ +export class InteractionCountObserver { + interactionCountEstimate = 0 + minKnownInteractionId = Infinity + maxKnownInteractionId = 0 + observer?: PerformanceObserver + + get interactionCount() { + return this.observer ? this.interactionCountEstimate : performance.interactionCount || 0 + } + + teardown() { + if (this.observer) { + // take the records so a new observer will start empty + this.observer.takeRecords() + this.observer.disconnect() + this.observer = undefined + } + } + + // from https://github.com/GoogleChrome/web-vitals/blob/7b44bea0d5ba6629c5fd34c3a09cc683077871d0/src/lib/polyfills/interactionCountPolyfill.ts#L29-L40 + updateEstimate = (entries: PerformanceEventTiming[]) => { + for (const e of entries) { + if (e.interactionId) { + this.minKnownInteractionId = Math.min(this.minKnownInteractionId, e.interactionId) + this.maxKnownInteractionId = Math.max(this.maxKnownInteractionId, e.interactionId) + + this.interactionCountEstimate = this.maxKnownInteractionId + ? (this.maxKnownInteractionId - this.minKnownInteractionId) / 7 + 1 + : 0 + } + } + } + + observe() { + if ('interactionCount' in performance || this.observer) return + + this.observer = new PerformanceObserver(async list => { + // Delay by a microtask to workaround a bug in Safari where the + // callback is invoked immediately, rather than in a separate task. + // See: https://github.com/GoogleChrome/web-vitals/issues/277 + await Promise.resolve() + + this.updateEstimate(list.getEntries() as PerformanceEventTiming[]) + }) + + this.observer.observe({ + type: 'event', + buffered: true, + durationThreshold: 0, + }) + } +} diff --git a/web-vitals/inp/interaction-list.ts b/web-vitals/inp/interaction-list.ts new file mode 100644 index 0000000..f8e8086 --- /dev/null +++ b/web-vitals/inp/interaction-list.ts @@ -0,0 +1,77 @@ +export interface Interaction { + id: string + latency: number + entries: PerformanceEventTiming[] +} + +/* + * The InteractionList is a list of interactions that are sorted by latency DESCENDING. + * The list has a maximum size and will remove the shortest interaction if the list is full. + */ +export class InteractionList { + interactions: Interaction[] = [] + interactionsMap: Map<string, Interaction> = new Map() + maxSize: number + + constructor(size: number) { + this.maxSize = size + } + + get shortestInteraction() { + return this.interactions[this.interactions.length - 1] + } + + get(id: string) { + return this.interactionsMap.get(id) + } + + update(interaction: Interaction, entry: PerformanceEventTiming) { + const newLatency = Math.max(interaction.latency, entry.duration) + interaction.entries.push(entry) + + if (newLatency !== interaction.latency) { + interaction.latency = Math.max(interaction.latency, entry.duration) + // the new value may change sorting order so we need to sort the list + this.sort() + } + } + + add(interaction: Interaction) { + const shortestInteraction = this.shortestInteraction + + // Only add interaction if list is not full or if the interaction is longer than the shortest one + if ( + this.interactions.length <= this.maxSize || + !shortestInteraction || + interaction.latency > shortestInteraction.latency + ) { + this.interactionsMap.set(interaction.id, interaction) + this.interactions.push(interaction) + this.sort() + + // Remove the shortest interaction if list reached the limit + if (this.interactions.length > this.maxSize) { + this.interactions.pop() + } + } + } + + sort() { + this.interactions.sort((a, b) => b.latency - a.latency) + } + + findEntry(entry: PerformanceEventTiming) { + return this.interactions.some((interaction: Interaction) => { + return interaction.entries.some(prevEntry => { + return entry.duration === prevEntry.duration && entry.startTime === prevEntry.startTime + }) + }) + } + + // from https://github.com/GoogleChrome/web-vitals/blob/7b44bea0d5ba6629c5fd34c3a09cc683077871d0/src/onINP.ts#L112-L123 + estimateP98(numOfPageInteractions: number) { + const candidateInteractionIndex = Math.min(this.interactions.length - 1, Math.floor(numOfPageInteractions / 50)) + + return this.interactions[candidateInteractionIndex] + } +} diff --git a/web-vitals/inp/interaction-processor.ts b/web-vitals/inp/interaction-processor.ts new file mode 100644 index 0000000..9112dd0 --- /dev/null +++ b/web-vitals/inp/interaction-processor.ts @@ -0,0 +1,124 @@ +import {BaseProcessor} from '../base/processor' +import {InteractionCountObserver} from './interaction-count' +import {InteractionList, type Interaction} from './interaction-list' +import {INPMetric} from './metric' + +export interface CallbackRegistration { + event: Event + cb: CallbackFn +} +export type CallbackFn = (data: Interaction) => void + +const MAX_INTERACTION_ENTRIES = 10 + +// Event to PerformanceEventTiming type mapping +const EVENT_TO_PERF_MAP: Record<string, string> = { + // Mouse events → Pointer events + mousedown: 'pointerdown', + mouseup: 'pointerup', + mousemove: 'pointermove', + mouseenter: 'pointerenter', + mouseleave: 'pointerleave', + mouseover: 'pointerover', + mouseout: 'pointerout', + // Touch events → Pointer events + touchstart: 'pointerdown', + touchend: 'pointerup', + touchmove: 'pointermove', + touchcancel: 'pointercancel', +} + +function normalizeEventType(eventType: string): string { + return EVENT_TO_PERF_MAP[eventType] ?? eventType +} + +function eventMatches(entry: PerformanceEventTiming, event: Event) { + // performance entries don't have a reference to the original event, + // so we match them based on their type and target. Since the target + // may not be present in the entry anymore, we match timestamps to within 1ms + const normalizedEventType = normalizeEventType(event.type) + return ( + (entry.name === normalizedEventType || entry.name === event.type) && + (entry.target === event.target || Math.abs(entry.startTime - event.timeStamp) < 1) + ) +} +/* + * The InteractionProcessor is responsible for processing PerformanceEventTiming entries and keeping track of the current INP. + */ +export class InteractionProcessor extends BaseProcessor<INPMetric, PerformanceEventTiming> { + interactions: InteractionList = new InteractionList(MAX_INTERACTION_ENTRIES) + interactionCountObserver: InteractionCountObserver + registeredCallbacks: Set<CallbackRegistration> = new Set() + + constructor() { + super() + this.interactionCountObserver = new InteractionCountObserver() + this.interactionCountObserver.observe() + } + + get metric() { + const interaction = this.interactions.estimateP98(this.interactionCountObserver.interactionCount) + + // Pages without interactions report INP = 0 + if (!interaction) { + return null + } + + return new INPMetric(interaction.latency, interaction.entries) + } + + override teardown() { + this.registeredCallbacks.clear() + this.interactionCountObserver.teardown() + } + + processEntries(entries: PerformanceEventTiming[]) { + const callbackMap = new Map<string, CallbackFn>() + + for (const entry of entries) { + // This is a `event` type entry + if (entry.interactionId) { + for (const callback of this.registeredCallbacks) { + if (eventMatches(entry, callback.event)) { + callbackMap.set(String(entry.interactionId), callback.cb) + // avoid checking this callback again since we already found a match + this.registeredCallbacks.delete(callback) + } + } + + this.processEntry(entry) + continue + } + + // see https://github.com/GoogleChrome/web-vitals/blob/7b44bea0d5ba6629c5fd34c3a09cc683077871d0/src/onINP.ts#L169-L189 + if (entry.entryType === 'first-input') { + if (!this.interactions.findEntry(entry)) { + this.processEntry(entry) + } + } + } + + for (const [interactionId, fn] of callbackMap) { + const interaction = this.interactions.get(interactionId) + if (interaction) fn(interaction) + } + } + + processEntry(entry: PerformanceEventTiming) { + const existingInteraction = this.interactions.get(String(entry.interactionId)) + + // multiple events may be fired for the same interaction, so we'll only keep + // the longest duration. + if (existingInteraction) { + return this.interactions.update(existingInteraction, entry) + } + + const interaction: Interaction = { + id: String(entry.interactionId), + latency: entry.duration, + entries: [entry], + } + + this.interactions.add(interaction) + } +} diff --git a/web-vitals/inp/metric.ts b/web-vitals/inp/metric.ts new file mode 100644 index 0000000..e387c2c --- /dev/null +++ b/web-vitals/inp/metric.ts @@ -0,0 +1,187 @@ +import {BaseMetric} from '../base/metric' +import {getSelector} from '../get-selector' + +export type InteractionType = 'text_input' | 'action_click' | 'disclosure' | 'selection' | 'submit' | 'unknown' + +export interface INPAttribution { + interactionTarget?: string + interactionType?: InteractionType + eventType?: string + // Phase timing fields + inputDelay?: number + processingDuration?: number + presentationDelay?: number +} + +const INPUT_EVENTS = new Set(['input', 'keydown', 'keyup', 'keypress']) +const POINTER_EVENTS = new Set(['click', 'pointerdown', 'pointerup', 'mousedown', 'mouseup']) + +interface EntryFlags { + isDisclosure: boolean + isSubmitButton: boolean + isTextInput: boolean + isSelection: boolean + isPointerEventEventType: boolean + isInputEventType: boolean +} + +// WeakMap to store precomputed flags per entry +const entryFlagsMap = new WeakMap<PerformanceEventTiming, EntryFlags>() + +function isPointerEvent(eventType: string) { + return POINTER_EVENTS.has(eventType) +} + +/** + * Check if element is a selection element using native DOM checks for performance. + * Avoids CSS selector matching. + */ +function isSelectionElement(el: Element): boolean { + if (el.tagName === 'SELECT') return true + const role = el.getAttribute('role') + return role === 'listbox' || role === 'combobox' +} + +/** + * Lazily compute and cache DOM-derived flags for an entry. + * Ensures each DOM traversal happens only once per entry. + * Performance optimizations: + * - Uses native closest() for DOM traversal for better performance + * - Lazy computation of isSelection only when needed + * - Native DOM property checks for better performance + */ +function getEntryFlags(entry: PerformanceEventTiming, target: Element | null): EntryFlags { + const cached = entryFlagsMap.get(entry) + if (cached) return cached + + const isPointerEventEventType = isPointerEvent(entry.name) + const isInputEventType = INPUT_EVENTS.has(entry.name) + + // Early return for unknown events on non-select, non-input, non-pointer + // Only compute isSelection if needed (after checking event type) + if (!isPointerEventEventType && !isInputEventType) { + // Lazy computation: only check selection elements when we might need it + const isSelection = !!(target && isSelectionElement(target)) + if (!isSelection) { + const flags: EntryFlags = { + isDisclosure: false, + isSubmitButton: false, + isTextInput: false, + isSelection: false, + isPointerEventEventType, + isInputEventType, + } + entryFlagsMap.set(entry, flags) + return flags + } + } + + let disclosure = false + let submitButton = false + let textInput = false + // Compute isSelection only when needed (for pointer/input events or when early return didn't happen) + let isSelection = false + + if (target) { + // Check if target is a selection element (only when we need it) + isSelection = isSelectionElement(target) + + // Disclosure and submit detection + if (isPointerEventEventType) { + // Use native closest() for disclosure and submit detection + // This is more efficient than manual traversal as it's implemented in browser native code + const match = target.closest('details, [aria-expanded], button[type="submit"], input[type="submit"]') + + if (match) { + // Precedence: disclosure takes priority over submit + if (match.tagName === 'DETAILS' || match.hasAttribute('aria-expanded')) { + disclosure = true + } else if ( + (match.tagName === 'BUTTON' && (match as HTMLButtonElement).type === 'submit') || + (match.tagName === 'INPUT' && (match as HTMLInputElement).type === 'submit') + ) { + submitButton = true + } + } + } + + // Only compute textInput if event is input type + // Use direct property checks instead of complex :not() selectors for performance + if (isInputEventType) { + if (target.tagName === 'TEXTAREA') { + textInput = true + } else if (target.tagName === 'INPUT') { + const inputType = (target as HTMLInputElement).type + // Input elements are text inputs unless they're button or submit types + textInput = inputType !== 'button' && inputType !== 'submit' + } else if (target instanceof HTMLElement && target.isContentEditable) { + textInput = true + } + } + } + + const flags: EntryFlags = { + isDisclosure: disclosure, + isSubmitButton: submitButton, + isTextInput: textInput, + isSelection, + isPointerEventEventType, + isInputEventType, + } + + entryFlagsMap.set(entry, flags) + return flags +} + +/** + * Determine interaction type using precomputed flags. + */ +function detectInteractionType(entry: PerformanceEventTiming, target: Element | null): InteractionType { + const eventType = entry.name + const {isDisclosure, isSubmitButton, isTextInput, isSelection, isPointerEventEventType} = getEntryFlags(entry, target) + + // Precedence rules + if (isDisclosure) return 'disclosure' + if (isSubmitButton) return 'submit' + if (eventType === 'submit') return 'submit' + if (isTextInput) return 'text_input' + if (isSelection) return 'selection' + if (isPointerEventEventType) return 'action_click' + + return 'unknown' +} + +/* + * The INP metric. Compatible with web-vitals' INPMetric interface + * and suitable for reporting to DataDog and Hydro. + */ +export class INPMetric extends BaseMetric<INPAttribution, PerformanceEventTiming> { + name = 'INP' as const + + get attribution(): INPAttribution { + let entry: PerformanceEventTiming | undefined + + // Select the longest interaction (INP definition) + for (const e of this.entries) { + if (!entry || e.duration > entry.duration) { + entry = e + } + } + + const target = (entry?.target as Element | null) ?? null + + // Compute phase durations from the PerformanceEventTiming entry + const inputDelay = entry ? entry.processingStart - entry.startTime : undefined + const processingDuration = entry ? entry.processingEnd - entry.processingStart : undefined + const presentationDelay = entry ? entry.duration - (entry.processingEnd - entry.startTime) : undefined + + return { + interactionTarget: entry && target ? getSelector(target) : '', + interactionType: entry ? detectInteractionType(entry, target) : undefined, + eventType: entry?.name, + inputDelay, + processingDuration, + presentationDelay, + } + } +} diff --git a/web-vitals/inp/observer.ts b/web-vitals/inp/observer.ts new file mode 100644 index 0000000..49ebf4e --- /dev/null +++ b/web-vitals/inp/observer.ts @@ -0,0 +1,80 @@ +import {ssrSafeDocument, ssrSafeWindow} from '@github-ui/ssr-utils' +import type {INPMetric} from './metric' +import {InteractionProcessor, type CallbackRegistration} from './interaction-processor' +import {BaseObserver} from '../base/observer' +import {SOFT_NAV_STATE} from '@github-ui/soft-nav/states' +import {whenIdleOrHidden} from '../utils/when-idle-or-hidden' + +const supportsINP = + // eslint-disable-next-line compat/compat + ssrSafeWindow && 'PerformanceEventTiming' in ssrSafeWindow && 'interactionId' in PerformanceEventTiming.prototype + +/* + * The INPObserver is responsible for listening to Performance events and routing them to the InteractionProcessor. + * It also manages resetting INP and reporting it when navigating or hiding a page. + */ +export class INPObserver extends BaseObserver<INPMetric, PerformanceEventTiming> { + get softNavEventToListen() { + return SOFT_NAV_STATE.START + } + + initializeProcessor() { + return new InteractionProcessor() + } + + override get supported(): boolean { + return !!supportsINP + } + + observe(initialLoad = true) { + if (!supportsINP) return + + this.url = ssrSafeWindow?.location.href + this.observer = new PerformanceObserver(list => { + whenIdleOrHidden(() => { + this.entryProcessor.processEntries(list.getEntries() as PerformanceEventTiming[]) + }) + }) + + if (initialLoad) { + return this.observeEvents(initialLoad) + } + + // SOFT_NAV_STATE.RENDER is dispatched when the soft navigation finished rendering. + // That means that the previous page is fully hidden so we can start listening for new events. + ssrSafeDocument?.addEventListener(SOFT_NAV_STATE.RENDER, () => { + this.observeEvents(initialLoad) + }) + } + + observeEvents(initialLoad: boolean) { + if (!this.observer) return + + this.observer.observe({type: 'first-input', buffered: initialLoad}) + this.observer.observe({ + type: 'event', + durationThreshold: 40, + // buffered events are important on first page load since we may have missed + // a few until the observer was set up. + buffered: initialLoad, + }) + } + + registerCallback(callback: CallbackRegistration) { + this.interactionProcessor.registeredCallbacks.add(callback) + } + + override report() { + const entries = this.observer?.takeRecords() + + if (entries && entries.length) { + this.entryProcessor.processEntries(entries as PerformanceEventTiming[]) + } + + super.report() + } + + get interactionProcessor(): InteractionProcessor { + return this.entryProcessor as InteractionProcessor + } +} diff --git a/web-vitals/long-animation-frames.ts b/web-vitals/long-animation-frames.ts new file mode 100644 index 0000000..1d5febf --- /dev/null +++ b/web-vitals/long-animation-frames.ts @@ -0,0 +1,28 @@ +import {sendStats} from '@github-ui/stats' +import {sendToHydro} from './hydro-stats' +import {wasServerRendered} from '@github-ui/ssr-utils' + +export const observeLongAnimationFrames = () => { + if ( + typeof PerformanceObserver !== 'undefined' && + (PerformanceObserver.supportedEntryTypes || []).includes('long-animation-frame') + ) { + const observer = new PerformanceObserver(function (list) { + const longAnimationFrameEntries = list.getEntries() + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const longAnimationFrames = longAnimationFrameEntries.map(({name, duration, blockingDuration}: any) => ({ + name, + duration, + blockingDuration, + url: window.location.href, + })) + + if (longAnimationFrames.length > 0) { + sendToHydro({longAnimationFrames: longAnimationFrameEntries, ssr: wasServerRendered()}) + } + + sendStats({longAnimationFrames}) + }) + observer.observe({type: 'long-animation-frame', buffered: true}) + } +} diff --git a/web-vitals/utils/when-idle-or-hidden.ts b/web-vitals/utils/when-idle-or-hidden.ts new file mode 100644 index 0000000..d799173 --- /dev/null +++ b/web-vitals/utils/when-idle-or-hidden.ts @@ -0,0 +1,24 @@ +// from https://github.com/GoogleChrome/web-vitals/blob/255855743e6c7a28a81a568ae229bd454559701d/src/lib/whenIdleOrHidden.ts#L23 + +export const whenIdleOrHidden = (cb: () => void) => { + // If the document is hidden, run the callback immediately, otherwise + // race an idle callback with the next `visibilitychange` event. + if (document.visibilityState === 'hidden') return cb() + + // run callback only once + let called = false + + const callback = () => { + if (called) return + called = true + cb() + } + + addEventListener('visibilitychange', callback, {once: true, capture: true}) + // eslint-disable-next-line compat/compat + requestIdleCallback(() => { + callback() + // cleanup listener + removeEventListener('visibilitychange', callback, {capture: true}) + }) +} diff --git a/web-vitals/web-vitals.ts b/web-vitals/web-vitals.ts new file mode 100644 index 0000000..e126901 --- /dev/null +++ b/web-vitals/web-vitals.ts @@ -0,0 +1,69 @@ +import type { + CLSMetricWithAttribution, + FCPMetricWithAttribution, + INPMetricWithAttribution, + LCPMetricWithAttribution, + TTFBMetricWithAttribution, +} from 'web-vitals/attribution' +import type {HPCTimingEvent} from './hpc-events' +import type {INPMetric} from './inp/metric' +import type {ElementTimingMetric} from './element-timing/metric' +import type {CLSMetric} from './cls/metric' +import type {INPObserver} from './inp/observer' +import {isFeatureEnabled} from '@github-ui/feature-flags' + +// eslint-disable-next-line no-barrel-files/no-barrel-files +export {initMemorySampling} from './memory-sampling' + +export type WebVitalMetric = + | CLSMetricWithAttribution + | FCPMetricWithAttribution + | INPMetricWithAttribution + | LCPMetricWithAttribution + | TTFBMetricWithAttribution + | INPMetric + | CLSMetric + | ElementTimingMetric + +export type SoftWebVitalMetric = + | CLSMetricWithAttribution + | FCPMetricWithAttribution + | INPMetricWithAttribution + | LCPMetricWithAttribution + | TTFBMetricWithAttribution + +export type MetricOrHPC = WebVitalMetric | HPCTimingEvent + +export function isReactLazyPayload() { + return Boolean(document.querySelector('react-app[data-lazy="true"]')) +} + +export function isReactAlternate() { + return Boolean(document.querySelector('react-app[data-alternate="true"]')) +} + +export function isHeaderRedesign() { + return Boolean(document.querySelector('header.AppHeader')) +} + +export function hasFetchedGQL(): boolean { + return performance.getEntriesByType('resource').some(e => e.initiatorType === 'fetch' && e.name.includes('_graphql?')) +} + +export function hasFetchedJS(): boolean { + return performance.getEntriesByType('resource').some(e => e.initiatorType === 'script') +} + +let inpObserver: INPObserver | null = null + +export function getGlobalINPObserver(): INPObserver | null { + return inpObserver +} + +export function setGlobalINPObserver(observer: INPObserver) { + inpObserver = observer +} + +export function isSpeculationRulesEnabled(): boolean { + return isFeatureEnabled('speculation_rules') +}