@openfin/workspace-platform 7.1.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={421:(e,t)=>{"use strict";function a(e){return e.endsWith("/")&&"/"!==e?e.slice(0,-1):e}Object.defineProperty(t,"__esModule",{value:!0}),t.removePathTrailingSlash=a,t.normalizePathTrailingSlash=void 0;const n=process.env.__NEXT_TRAILING_SLASH?e=>/\.[^/]+\/?$/.test(e)?a(e):e.endsWith("/")?e:e+"/":a;t.normalizePathTrailingSlash=n},644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelIdleCallback=t.requestIdleCallback=void 0;const a="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})}),1)};t.requestIdleCallback=a;const n="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};t.cancelIdleCallback=n},37:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markAssetError=l,t.isAssetError=function(e){return e&&c in e},t.getClientBuildManifest=p,t.getMiddlewareManifest=function(){if(self.__MIDDLEWARE_MANIFEST)return Promise.resolve(self.__MIDDLEWARE_MANIFEST);return u(new Promise((e=>{const t=self.__MIDDLEWARE_MANIFEST_CB;self.__MIDDLEWARE_MANIFEST_CB=()=>{e(self.__MIDDLEWARE_MANIFEST),t&&t()}})),o,l(new Error("Failed to load client middleware manifest")))},t.createRouteLoader=function(e){const t=new Map,a=new Map,n=new Map,c=new Map;function p(e){{let t=a.get(e);return t||(document.querySelector(`script[src^="${e}"]`)?Promise.resolve():(a.set(e,t=function(e,t){return new Promise(((a,n)=>{(t=document.createElement("script")).onload=a,t.onerror=()=>n(l(new Error(`Failed to load script: ${e}`))),t.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,t.src=e,document.body.appendChild(t)}))}(e)),t))}}function h(e){let t=n.get(e);return t||(n.set(e,t=fetch(e).then((t=>{if(!t.ok)throw new Error(`Failed to load stylesheet: ${e}`);return t.text().then((t=>({href:e,content:t})))})).catch((e=>{throw l(e)}))),t)}return{whenEntrypoint:e=>i(e,t),onEntrypoint(e,a){(a?Promise.resolve().then((()=>a())).then((e=>({component:e&&e.default||e,exports:e})),(e=>({error:e}))):Promise.resolve(void 0)).then((a=>{const n=t.get(e);n&&"resolve"in n?a&&(t.set(e,a),n.resolve(a)):(a?t.set(e,a):t.delete(e),c.delete(e))}))},loadRoute(a,n){return i(a,c,(()=>u(d(e,a).then((({scripts:e,css:n})=>Promise.all([t.has(a)?[]:Promise.all(e.map(p)),Promise.all(n.map(h))]))).then((e=>this.whenEntrypoint(a).then((t=>({entrypoint:t,styles:e[1]}))))),o,l(new Error(`Route did not complete loading: ${a}`))).then((({entrypoint:e,styles:t})=>{const a=Object.assign({styles:t},e);return"error"in e?e:a})).catch((e=>{if(n)throw e;return{error:e}})).finally((()=>{}))))},prefetch(t){let a;return(a=navigator.connection)&&(a.saveData||/2g/.test(a.effectiveType))?Promise.resolve():d(e,t).then((e=>Promise.all(s?e.scripts.map((e=>{return t=e,a="script",new Promise(((e,r)=>{const o=`\n link[rel="prefetch"][href^="${t}"],\n link[rel="preload"][href^="${t}"],\n script[src^="${t}"]`;if(document.querySelector(o))return e();n=document.createElement("link"),a&&(n.as=a),n.rel="prefetch",n.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,n.onload=e,n.onerror=r,n.href=t,document.head.appendChild(n)}));var t,a,n})):[]))).then((()=>{r.requestIdleCallback((()=>this.loadRoute(t,!0).catch((()=>{}))))})).catch((()=>{}))}}};(n=a(705))&&n.__esModule;var n,r=a(644);const o=3800;function i(e,t,a){let n,r=t.get(e);if(r)return"future"in r?r.future:Promise.resolve(r);const o=new Promise((e=>{n=e}));return t.set(e,r={resolve:n,future:o}),a?a().then((e=>(n(e),e))).catch((a=>{throw t.delete(e),a})):o}const s=function(e){try{return e=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||e.relList.supports("prefetch")}catch(e){return!1}}();const c=Symbol("ASSET_LOAD_ERROR");function l(e){return Object.defineProperty(e,c,{})}function u(e,t,a){return new Promise(((n,o)=>{let i=!1;e.then((e=>{i=!0,n(e)})).catch(o),r.requestIdleCallback((()=>setTimeout((()=>{i||o(a)}),t)))}))}function p(){if(self.__BUILD_MANIFEST)return Promise.resolve(self.__BUILD_MANIFEST);return u(new Promise((e=>{const t=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{e(self.__BUILD_MANIFEST),t&&t()}})),o,l(new Error("Failed to load client build manifest")))}function d(e,t){return p().then((a=>{if(!(t in a))throw l(new Error(`Failed to lookup route: ${t}`));const n=a[t].map((t=>e+"/_next/"+encodeURI(t)));return{scripts:n.filter((e=>e.endsWith(".js"))),css:n.filter((e=>e.endsWith(".css")))}}))}},236:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Router",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"withRouter",{enumerable:!0,get:function(){return i.default}}),t.useRouter=function(){return n.default.useContext(o.RouterContext)},t.createRouter=function(...e){return c.router=new r.default(...e),c.readyCallbacks.forEach((e=>e())),c.readyCallbacks=[],c.router},t.makePublicRouterInstance=function(e){const t=e,a={};for(const e of l)"object"!=typeof t[e]?a[e]=t[e]:a[e]=Object.assign(Array.isArray(t[e])?[]:{},t[e]);return a.events=r.default.events,u.forEach((e=>{a[e]=(...a)=>t[e](...a)})),a},t.default=void 0;var n=s(a(378)),r=s(a(765)),o=a(876),i=(s(a(16)),s(a(58)));function s(e){return e&&e.__esModule?e:{default:e}}const c={router:null,readyCallbacks:[],ready(e){if(this.router)return e();"undefined"!=typeof window&&this.readyCallbacks.push(e)}},l=["pathname","route","query","asPath","components","isFallback","basePath","locale","locales","defaultLocale","isReady","isPreview","isLocaleDomain","domainLocales"],u=["push","replace","reload","back","prefetch","beforePopState"];function p(){if(!c.router){throw new Error('No router instance found.\nYou should only use "next/router" on the client side of your app.\n')}return c.router}Object.defineProperty(c,"events",{get:()=>r.default.events}),l.forEach((e=>{Object.defineProperty(c,e,{get:()=>p()[e]})})),u.forEach((e=>{c[e]=(...t)=>p()[e](...t)})),["routeChangeStart","beforeHistoryChange","routeChangeComplete","routeChangeError","hashChangeStart","hashChangeComplete"].forEach((e=>{c.ready((()=>{r.default.events.on(e,((...t)=>{const a=`on${e.charAt(0).toUpperCase()}${e.substring(1)}`,n=c;if(n[a])try{n[a](...t)}catch(e){}}))}))}));var d=c;t.default=d},58:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t){return r.default.createElement(e,Object.assign({router:o.useRouter()},t))}t.getInitialProps=e.getInitialProps,t.origGetInitialProps=e.origGetInitialProps,!1;return t};var n,r=(n=a(378))&&n.__esModule?n:{default:n},o=a(236)},173:(e,t)=>{"use strict";function a(e,t){void 0===t&&(t={});for(var a=function(e){for(var t=[],a=0;a<e.length;){var n=e[a];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:a,value:e[a++]});else{var r=1,o="";if("?"===e[s=a+1])throw new TypeError('Pattern cannot start with "?" at '+s);for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--r){s++;break}}else if("("===e[s]&&(r++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at "+s);o+=e[s++]}else o+=e[s++]+e[s++];if(r)throw new TypeError("Unbalanced pattern at "+a);if(!o)throw new TypeError("Missing pattern at "+a);t.push({type:"PATTERN",index:a,value:o}),a=s}else{for(var i="",s=a+1;s<e.length;){var c=e.charCodeAt(s);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;i+=e[s++]}if(!i)throw new TypeError("Missing parameter name at "+a);t.push({type:"NAME",index:a,value:i}),a=s}else t.push({type:"CLOSE",index:a,value:e[a++]});else t.push({type:"OPEN",index:a,value:e[a++]});else t.push({type:"ESCAPED_CHAR",index:a++,value:e[a++]});else t.push({type:"MODIFIER",index:a,value:e[a++]})}return t.push({type:"END",index:a,value:""}),t}(e),n=t.prefixes,r=void 0===n?"./":n,i="[^"+o(t.delimiter||"/#?")+"]+?",s=[],c=0,l=0,u="",p=function(e){if(l<a.length&&a[l].type===e)return a[l++].value},d=function(e){var t=p(e);if(void 0!==t)return t;var n=a[l],r=n.type,o=n.index;throw new TypeError("Unexpected "+r+" at "+o+", expected "+e)},h=function(){for(var e,t="";e=p("CHAR")||p("ESCAPED_CHAR");)t+=e;return t};l<a.length;){var f=p("CHAR"),w=p("NAME"),g=p("PATTERN");if(w||g){var y=f||"";-1===r.indexOf(y)&&(u+=y,y=""),u&&(s.push(u),u=""),s.push({name:w||c++,prefix:y,suffix:"",pattern:g||i,modifier:p("MODIFIER")||""})}else{var m=f||p("ESCAPED_CHAR");if(m)u+=m;else if(u&&(s.push(u),u=""),p("OPEN")){y=h();var v=p("NAME")||"",P=p("PATTERN")||"",S=h();d("CLOSE"),s.push({name:v||(P?c++:""),pattern:v&&!P?i:P,prefix:y,suffix:S,modifier:p("MODIFIER")||""})}else d("END")}}return s}function n(e,t){void 0===t&&(t={});var a=i(t),n=t.encode,r=void 0===n?function(e){return e}:n,o=t.validate,s=void 0===o||o,c=e.map((function(e){if("object"==typeof e)return new RegExp("^(?:"+e.pattern+")$",a)}));return function(t){for(var a="",n=0;n<e.length;n++){var o=e[n];if("string"!=typeof o){var i=t?t[o.name]:void 0,l="?"===o.modifier||"*"===o.modifier,u="*"===o.modifier||"+"===o.modifier;if(Array.isArray(i)){if(!u)throw new TypeError('Expected "'+o.name+'" to not repeat, but got an array');if(0===i.length){if(l)continue;throw new TypeError('Expected "'+o.name+'" to not be empty')}for(var p=0;p<i.length;p++){var d=r(i[p],o);if(s&&!c[n].test(d))throw new TypeError('Expected all "'+o.name+'" to match "'+o.pattern+'", but got "'+d+'"');a+=o.prefix+d+o.suffix}}else if("string"!=typeof i&&"number"!=typeof i){if(!l){var h=u?"an array":"a string";throw new TypeError('Expected "'+o.name+'" to be '+h)}}else{d=r(String(i),o);if(s&&!c[n].test(d))throw new TypeError('Expected "'+o.name+'" to match "'+o.pattern+'", but got "'+d+'"');a+=o.prefix+d+o.suffix}}else a+=o}return a}}function r(e,t,a){void 0===a&&(a={});var n=a.decode,r=void 0===n?function(e){return e}:n;return function(a){var n=e.exec(a);if(!n)return!1;for(var o=n[0],i=n.index,s=Object.create(null),c=function(e){if(void 0===n[e])return"continue";var a=t[e-1];"*"===a.modifier||"+"===a.modifier?s[a.name]=n[e].split(a.prefix+a.suffix).map((function(e){return r(e,a)})):s[a.name]=r(n[e],a)},l=1;l<n.length;l++)c(l);return{path:o,index:i,params:s}}}function o(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function i(e){return e&&e.sensitive?"":"i"}function s(e,t,a){void 0===a&&(a={});for(var n=a.strict,r=void 0!==n&&n,s=a.start,c=void 0===s||s,l=a.end,u=void 0===l||l,p=a.encode,d=void 0===p?function(e){return e}:p,h="["+o(a.endsWith||"")+"]|$",f="["+o(a.delimiter||"/#?")+"]",w=c?"^":"",g=0,y=e;g<y.length;g++){var m=y[g];if("string"==typeof m)w+=o(d(m));else{var v=o(d(m.prefix)),P=o(d(m.suffix));if(m.pattern)if(t&&t.push(m),v||P)if("+"===m.modifier||"*"===m.modifier){var S="*"===m.modifier?"?":"";w+="(?:"+v+"((?:"+m.pattern+")(?:"+P+v+"(?:"+m.pattern+"))*)"+P+")"+S}else w+="(?:"+v+"("+m.pattern+")"+P+")"+m.modifier;else w+="("+m.pattern+")"+m.modifier;else w+="(?:"+v+P+")"+m.modifier}}if(u)r||(w+=f+"?"),w+=a.endsWith?"(?="+h+")":"$";else{var _=e[e.length-1],b="string"==typeof _?f.indexOf(_[_.length-1])>-1:void 0===_;r||(w+="(?:"+f+"(?="+h+"))?"),b||(w+="(?="+f+"|"+h+")")}return new RegExp(w,i(a))}function c(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;var a=e.source.match(/\((?!\?)/g);if(a)for(var n=0;n<a.length;n++)t.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return e}(e,t):Array.isArray(e)?function(e,t,a){var n=e.map((function(e){return c(e,t,a).source}));return new RegExp("(?:"+n.join("|")+")",i(a))}(e,t,n):function(e,t,n){return s(a(e,n),t,n)}(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=a,t.compile=function(e,t){return n(a(e,t),t)},t.tokensToFunction=n,t.match=function(e,t){var a=[];return r(c(e,a,t),a,t)},t.regexpToFunction=r,t.tokensToRegexp=s,t.pathToRegexp=c},16:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,t.getProperError=function(e){if(r(e))return e;0;return new Error(n.isPlainObject(e)?JSON.stringify(e):e+"")};var n=a(332);function r(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}},709:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePathSep=r,t.denormalizePagePath=function(e){(e=r(e)).startsWith("/index/")&&!n.isDynamicRoute(e)?e=e.slice(6):"/index"===e&&(e="/");return e};var n=a(720);function r(e){return e.replace(/\\/g,"/")}},294:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeStringRegexp=function(e){return e.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")}},723:(e,t)=>{"use strict";t.D=function(e,t,a){let n;if(e){a&&(a=a.toLowerCase());for(const i of e){var r,o;const e=null===(r=i.domain)||void 0===r?void 0:r.split(":")[0].toLowerCase();if(t===e||a===i.defaultLocale.toLowerCase()||(null===(o=i.locales)||void 0===o?void 0:o.some((e=>e.toLowerCase()===a)))){n=i;break}}}return n}},559:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeLocalePath=function(e,t){let a;const n=e.split("/");return(t||[]).some((t=>!(!n[1]||n[1].toLowerCase()!==t.toLowerCase())&&(a=t,n.splice(1,1),e=n.join("/")||"/",!0))),{pathname:e,detectedLocale:a}}},332:(e,t)=>{"use strict";function a(e){return Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getObjectClassLabel=a,t.isPlainObject=function(e){if("[object Object]"!==a(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}},564:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=Object.create(null);return{on(t,a){(e[t]||(e[t]=[])).push(a)},off(t,a){e[t]&&e[t].splice(e[t].indexOf(a)>>>0,1)},emit(t,...a){(e[t]||[]).slice().map((e=>{e(...a)}))}}}},876:(e,t,a)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.RouterContext=void 0;const r=((n=a(378))&&n.__esModule?n:{default:n}).default.createContext(null);t.RouterContext=r},765:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomainLocale=function(e,t,a,n){if(process.env.__NEXT_I18N_SUPPORT){t=t||s.normalizeLocalePath(e,a).detectedLocale;const r=m(n,void 0,t);return!!r&&`http${r.http?"":"s"}://${r.domain}${v||""}${t===r.defaultLocale?"":`/${t}`}${e}`}return!1},t.addLocale=_,t.delLocale=b,t.hasBasePath=E,t.addBasePath=k,t.delBasePath=R,t.isLocalURL=W,t.interpolateAs=A,t.resolveHref=I,t.default=void 0;var n=a(421),r=a(37),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,a):{};n.get||n.set?Object.defineProperty(t,a,n):t[a]=e[a]}return t.default=e,t}(a(16)),i=a(709),s=a(559),c=y(a(564)),l=a(916),u=a(554),p=a(920),d=a(624),h=y(a(853)),f=a(205),w=a(445),g=a(304);function y(e){return e&&e.__esModule?e:{default:e}}let m;process.env.__NEXT_I18N_SUPPORT&&(m=a(723).D);const v=process.env.__NEXT_ROUTER_BASEPATH||"";function P(){return Object.assign(new Error("Route Cancelled"),{cancelled:!0})}function S(e,t){if(!e.startsWith("/")||!t)return e;const a=C(e);return n.normalizePathTrailingSlash(`${t}${a}`)+e.substr(a.length)}function _(e,t,a){if(process.env.__NEXT_I18N_SUPPORT){const n=C(e).toLowerCase(),r=t&&t.toLowerCase();return t&&t!==a&&!n.startsWith("/"+r+"/")&&n!=="/"+r?S(e,"/"+t):e}return e}function b(e,t){if(process.env.__NEXT_I18N_SUPPORT){const a=C(e),n=a.toLowerCase(),r=t&&t.toLowerCase();return t&&(n.startsWith("/"+r+"/")||n==="/"+r)?(a.length===t.length+1?"/":"")+e.substr(t.length+1):e}return e}function C(e){const t=e.indexOf("?"),a=e.indexOf("#");return(t>-1||a>-1)&&(e=e.substring(0,t>-1?t:a)),e}function E(e){return(e=C(e))===v||e.startsWith(v+"/")}function k(e){return S(e,v)}function R(e){return(e=e.slice(v.length)).startsWith("/")||(e=`/${e}`),e}function W(e){if(e.startsWith("/")||e.startsWith("#")||e.startsWith("?"))return!0;try{const t=l.getLocationOrigin(),a=new URL(e,t);return a.origin===t&&E(a.pathname)}catch(e){return!1}}function A(e,t,a){let n="";const r=w.getRouteRegex(e),o=r.groups,i=(t!==e?f.getRouteMatcher(r)(t):"")||a;n=e;const s=Object.keys(o);return s.every((e=>{let t=i[e]||"";const{repeat:a,optional:r}=o[e];let s=`[${a?"...":""}${e}]`;return r&&(s=`${t?"":"/"}[${s}]`),a&&!Array.isArray(t)&&(t=[t]),(r||e in i)&&(n=n.replace(s,a?t.map((e=>encodeURIComponent(e))).join("/"):encodeURIComponent(t))||"/")}))||(n=""),{params:s,result:n}}function O(e,t){const a={};return Object.keys(e).forEach((n=>{t.includes(n)||(a[n]=e[n])})),a}function I(e,t,a){let r,o="string"==typeof t?t:l.formatWithValidation(t);const i=o.match(/^[a-zA-Z]{1,}:\/\//),s=i?o.substr(i[0].length):o;if((s.split("?")[0]||"").match(/(\/\/|\\)/)){const e=l.normalizeRepeatedSlashes(s);o=(i?i[0]:"")+e}if(!W(o))return a?[o]:o;try{r=new URL(o.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(e){r=new URL("/","http://n")}try{const e=new URL(o,r);e.pathname=n.normalizePathTrailingSlash(e.pathname);let t="";if(u.isDynamicRoute(e.pathname)&&e.searchParams&&a){const a=d.searchParamsToUrlQuery(e.searchParams),{result:n,params:r}=A(e.pathname,e.pathname,a);n&&(t=l.formatWithValidation({pathname:n,hash:e.hash,query:O(a,r)}))}const i=e.origin===r.origin?e.href.slice(e.origin.length):e.href;return a?[i,t||i]:i}catch(e){return a?[o]:o}}function T(e){const t=l.getLocationOrigin();return e.startsWith(t)?e.substring(t.length):e}function x(e,t,a){let[n,r]=I(e,t,!0);const o=l.getLocationOrigin(),i=n.startsWith(o),s=r&&r.startsWith(o);n=T(n),r=r?T(r):r;const c=i?n:k(n),u=a?T(I(e,a)):r||n;return{url:c,as:s?u:k(u)}}function M(e,t){const a=n.removePathTrailingSlash(i.denormalizePagePath(e));return"/404"===a||"/_error"===a?e:(t.includes(a)||t.some((t=>{if(u.isDynamicRoute(t)&&w.getRouteRegex(t).re.test(a))return e=t,!0})),n.removePathTrailingSlash(e))}const L=process.env.__NEXT_SCROLL_RESTORATION&&"undefined"!=typeof window&&"scrollRestoration"in window.history&&!!function(){try{let e="__next";return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){}}(),N=Symbol("SSG_DATA_NOT_FOUND");function $(e,t,a){return fetch(e,{credentials:"same-origin"}).then((n=>{if(!n.ok){if(t>1&&n.status>=500)return $(e,t-1,a);if(404===n.status)return n.json().then((e=>{if(e.notFound)return{notFound:N};throw new Error("Failed to load static props")}));throw new Error("Failed to load static props")}return a.text?n.text():n.json()}))}function D(e,t,a,n,o){const{href:i}=new URL(e,window.location.href);return void 0!==n[i]?n[i]:n[i]=$(e,t?3:1,{text:a}).catch((e=>{throw t||r.markAssetError(e),e})).then((e=>(o||delete n[i],e))).catch((e=>{throw delete n[i],e}))}class U{constructor(e,t,a,{initialProps:r,pageLoader:o,App:i,wrapApp:s,Component:c,err:d,subscription:h,isFallback:f,locale:w,locales:g,defaultLocale:y,domainLocales:P,isPreview:S}){this.sdc={},this.sdr={},this.sde={},this._idx=0,this.onPopState=e=>{const t=e.state;if(!t){const{pathname:e,query:t}=this;return void this.changeState("replaceState",l.formatWithValidation({pathname:k(e),query:t}),l.getURL())}if(!t.__N)return;let a;const{url:n,as:r,options:o,idx:i}=t;if(process.env.__NEXT_SCROLL_RESTORATION&&L&&this._idx!==i){try{sessionStorage.setItem("__next_scroll_"+this._idx,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}try{const e=sessionStorage.getItem("__next_scroll_"+i);a=JSON.parse(e)}catch{a={x:0,y:0}}}this._idx=i;const{pathname:s}=p.parseRelativeUrl(n);this.isSsr&&r===k(this.asPath)&&s===k(this.pathname)||this._bps&&!this._bps(t)||this.change("replaceState",n,r,Object.assign({},o,{shallow:o.shallow&&this._shallow,locale:o.locale||this.defaultLocale}),a)};const _=n.removePathTrailingSlash(e);var b;(this.components={},"/_error"!==e)&&(this.components[_]={Component:c,initial:!0,props:r,err:d,__N_SSG:r&&r.__N_SSG,__N_SSP:r&&r.__N_SSP,__N_RSC:!!(null===(b=c)||void 0===b?void 0:b.__next_rsc__)});this.components["/_app"]={Component:i,styleSheets:[]},this.events=U.events,this.pageLoader=o;const C=u.isDynamicRoute(e)&&self.__NEXT_DATA__.autoExport;if(this.basePath=v,this.sub=h,this.clc=null,this._wrapApp=s,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!(!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp)&&(C||self.location.search||process.env.__NEXT_HAS_REWRITES)),process.env.__NEXT_I18N_SUPPORT&&(this.locales=g,this.defaultLocale=y,this.domainLocales=P,this.isLocaleDomain=!!m(P,self.location.hostname)),this.state={route:_,pathname:e,query:t,asPath:C?e:a,isPreview:!!S,locale:process.env.__NEXT_I18N_SUPPORT?w:void 0,isFallback:f},"undefined"!=typeof window){if("//"!==a.substr(0,2)){const n={locale:w};n._shouldResolveHref=a!==e,this.changeState("replaceState",l.formatWithValidation({pathname:k(e),query:t}),l.getURL(),n)}window.addEventListener("popstate",this.onPopState),process.env.__NEXT_SCROLL_RESTORATION&&L&&(window.history.scrollRestoration="manual")}}reload(){window.location.reload()}back(){window.history.back()}push(e,t,a={}){if(process.env.__NEXT_SCROLL_RESTORATION&&L)try{sessionStorage.setItem("__next_scroll_"+this._idx,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}return({url:e,as:t}=x(this,e,t)),this.change("pushState",e,t,a)}replace(e,t,a={}){return({url:e,as:t}=x(this,e,t)),this.change("replaceState",e,t,a)}async change(e,t,a,i,c){if(!W(t))return window.location.href=t,!1;const d=i._h||i._shouldResolveHref||C(t)===C(a),g={...this.state};i._h&&(this.isReady=!0);const y=g.locale;if(process.env.__NEXT_I18N_SUPPORT){g.locale=!1===i.locale?this.defaultLocale:i.locale||g.locale,void 0===i.locale&&(i.locale=g.locale);const e=p.parseRelativeUrl(E(a)?R(a):a),n=s.normalizeLocalePath(e.pathname,this.locales);n.detectedLocale&&(g.locale=n.detectedLocale,e.pathname=k(e.pathname),a=l.formatWithValidation(e),t=k(s.normalizeLocalePath(E(t)?R(t):t,this.locales).pathname));let r=!1;if(process.env.__NEXT_I18N_SUPPORT)(null===(G=this.locales)||void 0===G?void 0:G.includes(g.locale))||(e.pathname=_(e.pathname,g.locale),window.location.href=l.formatWithValidation(e),r=!0);const o=m(this.domainLocales,void 0,g.locale);if(process.env.__NEXT_I18N_SUPPORT&&!r&&o&&this.isLocaleDomain&&self.location.hostname!==o.domain){const e=R(a);window.location.href=`http${o.http?"":"s"}://${o.domain}${k(`${g.locale===o.defaultLocale?"":`/${g.locale}`}${"/"===e?"":e}`||"/")}`,r=!0}if(r)return new Promise((()=>{}))}i._h||(this.isSsr=!1),l.ST&&performance.mark("routeChange");const{shallow:v=!1,scroll:P=!0}=i,S={shallow:v};this._inFlightRoute&&this.abortComponentLoad(this._inFlightRoute,S),a=k(_(E(a)?R(a):a,i.locale,this.defaultLocale));const I=b(E(a)?R(a):a,g.locale);this._inFlightRoute=a;let T=y!==g.locale;if(!i._h&&this.onlyAHashChange(I)&&!T)return g.asPath=I,U.events.emit("hashChangeStart",a,S),this.changeState(e,t,a,{...i,scroll:!1}),P&&this.scrollToHash(I),this.set(g,this.components[g.route],null),U.events.emit("hashChangeComplete",a,S),!0;let L,$,D=p.parseRelativeUrl(t),{pathname:j,query:F}=D;try{[L,{__rewrites:$}]=await Promise.all([this.pageLoader.getPageList(),r.getClientBuildManifest(),this.pageLoader.getMiddlewareList()])}catch(e){return window.location.href=a,!1}this.urlIsNew(I)||T||(e="replaceState");let V=a;if(j=j?n.removePathTrailingSlash(R(j)):j,d&&"/_error"!==j)if(i._shouldResolveHref=!0,process.env.__NEXT_HAS_REWRITES&&a.startsWith("/")){const e=h.default(k(_(I,g.locale)),L,$,F,(e=>M(e,L)),this.locales);if(e.externalDest)return location.href=a,!0;V=e.asPath,e.matchedPage&&e.resolvedHref&&(j=e.resolvedHref,D.pathname=k(j),t=l.formatWithValidation(D))}else D.pathname=M(j,L),D.pathname!==j&&(j=D.pathname,D.pathname=k(j),t=l.formatWithValidation(D));if(!W(a))return window.location.href=a,!1;if(V=b(R(V),g.locale),1!==i._h||u.isDynamicRoute(n.removePathTrailingSlash(j))){const n=await this._preflightRequest({as:a,cache:!0,pages:L,pathname:j,query:F,locale:g.locale,isPreview:g.isPreview});if("rewrite"===n.type)F={...F,...n.parsedAs.query},V=n.asPath,j=n.resolvedHref,D.pathname=n.resolvedHref,t=l.formatWithValidation(D);else{if("redirect"===n.type&&n.newAs)return this.change(e,n.newUrl,n.newAs,i);if("redirect"===n.type&&n.destination)return window.location.href=n.destination,new Promise((()=>{}));if("refresh"===n.type&&a!==window.location.pathname)return window.location.href=a,new Promise((()=>{}))}}const B=n.removePathTrailingSlash(j);if(u.isDynamicRoute(B)){const e=p.parseRelativeUrl(V),n=e.pathname,r=w.getRouteRegex(B),o=f.getRouteMatcher(r)(n),i=B===n,s=i?A(B,n,F):{};if(!o||i&&!s.result){const e=Object.keys(r.groups).filter((e=>!F[e]));if(e.length>0)throw new Error((i?`The provided \`href\` (${t}) value is missing query values (${e.join(", ")}) to be interpolated properly. `:`The provided \`as\` value (${n}) is incompatible with the \`href\` value (${B}). `)+"Read more: https://nextjs.org/docs/messages/"+(i?"href-interpolation-failed":"incompatible-href-as"))}else i?a=l.formatWithValidation(Object.assign({},e,{pathname:s.result,query:O(F,s.params)})):Object.assign(F,o)}U.events.emit("routeChangeStart",a,S);try{var G,q;let n=await this.getRouteInfo(B,j,F,a,V,S,g.locale,g.isPreview),{error:r,props:o,__N_SSG:s,__N_SSP:l}=n;if((s||l)&&o){if(o.pageProps&&o.pageProps.__N_REDIRECT){const t=o.pageProps.__N_REDIRECT;if(t.startsWith("/")&&!1!==o.pageProps.__N_REDIRECT_BASE_PATH){const a=p.parseRelativeUrl(t);a.pathname=M(a.pathname,L);const{url:n,as:r}=x(this,t,t);return this.change(e,n,r,i)}return window.location.href=t,new Promise((()=>{}))}if(g.isPreview=!!o.__N_PREVIEW,o.notFound===N){let e;try{await this.fetchComponent("/404"),e="/404"}catch(t){e="/_error"}n=await this.getRouteInfo(e,e,F,a,V,{shallow:!1},g.locale,g.isPreview)}}U.events.emit("beforeHistoryChange",a,S),this.changeState(e,t,a,i),i._h&&"/_error"===j&&500===(null===(G=self.__NEXT_DATA__.props)||void 0===G||null===(q=G.pageProps)||void 0===q?void 0:q.statusCode)&&(null==o?void 0:o.pageProps)&&(o.pageProps.statusCode=500);const u=i.shallow&&g.route===B;var H;const d=(null!==(H=i.scroll)&&void 0!==H?H:!u)?{x:0,y:0}:null;if(await this.set({...g,route:B,pathname:j,query:F,asPath:I,isFallback:!1},n,null!=c?c:d).catch((e=>{if(!e.cancelled)throw e;r=r||e})),r)throw U.events.emit("routeChangeError",r,I,S),r;return process.env.__NEXT_I18N_SUPPORT&&g.locale&&(document.documentElement.lang=g.locale),U.events.emit("routeChangeComplete",a,S),!0}catch(e){if(o.default(e)&&e.cancelled)return!1;throw e}}changeState(e,t,a,n={}){"pushState"===e&&l.getURL()===a||(this._shallow=n.shallow,window.history[e]({url:t,as:a,options:n,__N:!0,idx:this._idx="pushState"!==e?this._idx:this._idx+1},"",a))}async handleRouteInfoError(e,t,a,n,i,s){if(e.cancelled)throw e;if(r.isAssetError(e)||s)throw U.events.emit("routeChangeError",e,n,i),window.location.href=n,P();try{let n,r,o;void 0!==n&&void 0!==r||({page:n,styleSheets:r}=await this.fetchComponent("/_error"));const i={props:o,Component:n,styleSheets:r,err:e,error:e};if(!i.props)try{i.props=await this.getInitialProps(n,{err:e,pathname:t,query:a})}catch(e){i.props={}}return i}catch(e){return this.handleRouteInfoError(o.default(e)?e:new Error(e+""),t,a,n,i,!0)}}async getRouteInfo(e,t,a,n,r,i,s,c){try{const o=this.components[e];if(i.shallow&&o&&this.route===e)return o;let u;o&&!("initial"in o)&&(u=o);const p=u||await this.fetchComponent(e).then((e=>({Component:e.page,styleSheets:e.styleSheets,__N_SSG:e.mod.__N_SSG,__N_SSP:e.mod.__N_SSP,__N_RSC:!!e.page.__next_rsc__}))),{Component:d,__N_SSG:h,__N_SSP:f,__N_RSC:w}=p;let g;0,(h||f||w)&&(g=this.pageLoader.getDataHref({href:l.formatWithValidation({pathname:t,query:a}),asPath:r,ssg:h,rsc:w,locale:s}));const y=await this._getData((()=>h||f?D(g,this.isSsr,!1,h?this.sdc:this.sdr,!!h&&!c):this.getInitialProps(d,{pathname:t,query:a,asPath:n,locale:s,locales:this.locales,defaultLocale:this.defaultLocale})));if(w){const{fresh:e,data:t}=await this._getData((()=>this._getFlightData(g)));y.pageProps=Object.assign(y.pageProps,{__flight_serialized__:t,__flight_fresh__:e})}return p.props=y,this.components[e]=p,p}catch(e){return this.handleRouteInfoError(o.getProperError(e),t,a,n,i)}}set(e,t,a){return this.state=e,this.sub(t,this.components["/_app"].Component,a)}beforePopState(e){this._bps=e}onlyAHashChange(e){if(!this.asPath)return!1;const[t,a]=this.asPath.split("#"),[n,r]=e.split("#");return!(!r||t!==n||a!==r)||t===n&&a!==r}scrollToHash(e){const[,t=""]=e.split("#");if(""===t||"top"===t)return void window.scrollTo(0,0);const a=document.getElementById(t);if(a)return void a.scrollIntoView();const n=document.getElementsByName(t)[0];n&&n.scrollIntoView()}urlIsNew(e){return this.asPath!==e}async prefetch(e,t=e,a={}){let o=p.parseRelativeUrl(e),{pathname:i,query:c}=o;if(process.env.__NEXT_I18N_SUPPORT&&!1===a.locale){i=s.normalizeLocalePath(i,this.locales).pathname,o.pathname=i,e=l.formatWithValidation(o);let n=p.parseRelativeUrl(t);const r=s.normalizeLocalePath(n.pathname,this.locales);n.pathname=r.pathname,a.locale=r.detectedLocale||this.defaultLocale,t=l.formatWithValidation(n)}const u=await this.pageLoader.getPageList();let d=t;if(process.env.__NEXT_HAS_REWRITES&&t.startsWith("/")){let a;({__rewrites:a}=await r.getClientBuildManifest());const n=h.default(k(_(t,this.locale)),u,a,o.query,(e=>M(e,u)),this.locales);if(n.externalDest)return;d=b(R(n.asPath),this.locale),n.matchedPage&&n.resolvedHref&&(i=n.resolvedHref,o.pathname=i,e=l.formatWithValidation(o))}else o.pathname=M(o.pathname,u),o.pathname!==i&&(i=o.pathname,o.pathname=i,e=l.formatWithValidation(o));const f=await this._preflightRequest({as:k(t),cache:!0,pages:u,pathname:i,query:c,locale:this.locale,isPreview:this.isPreview});"rewrite"===f.type&&(o.pathname=f.resolvedHref,i=f.resolvedHref,c={...c,...f.parsedAs.query},d=f.asPath,e=l.formatWithValidation(o));const w=n.removePathTrailingSlash(i);await Promise.all([this.pageLoader._isSsg(w).then((t=>!!t&&D(this.pageLoader.getDataHref({href:e,asPath:d,ssg:!0,locale:void 0!==a.locale?a.locale:this.locale}),!1,!1,this.sdc,!0))),this.pageLoader[a.priority?"loadPage":"prefetch"](w)])}async fetchComponent(e){let t=!1;const a=this.clc=()=>{t=!0},n=()=>{if(t){const t=new Error(`Abort fetching component for route: "${e}"`);throw t.cancelled=!0,t}a===this.clc&&(this.clc=null)};try{const t=await this.pageLoader.loadPage(e);return n(),t}catch(e){throw n(),e}}_getData(e){let t=!1;const a=()=>{t=!0};return this.clc=a,e().then((e=>{if(a===this.clc&&(this.clc=null),t){const e=new Error("Loading initial props cancelled");throw e.cancelled=!0,e}return e}))}_getFlightData(e){return D(e,!0,!0,this.sdc,!1).then((e=>({fresh:!0,data:e})))}async _preflightRequest(e){const t=b(E(e.as)?R(e.as):e.as,e.locale);if(!(await this.pageLoader.getMiddlewareList()).some((([e,a])=>f.getRouteMatcher(g.getMiddlewareRegex(e,!a))(t))))return{type:"next"};const a=await this._getPreflightData({preflightHref:e.as,shouldCache:e.cache,isPreview:e.isPreview});if(a.rewrite){if(!a.rewrite.startsWith("/"))return{type:"redirect",destination:e.as};const t=p.parseRelativeUrl(s.normalizeLocalePath(E(a.rewrite)?R(a.rewrite):a.rewrite,this.locales).pathname),r=n.removePathTrailingSlash(t.pathname);let o,i;return e.pages.includes(r)?(o=!0,i=r):(i=M(r,e.pages),i!==t.pathname&&e.pages.includes(i)&&(o=!0)),{type:"rewrite",asPath:t.pathname,parsedAs:t,matchedPage:o,resolvedHref:i}}if(a.redirect){if(a.redirect.startsWith("/")){const e=n.removePathTrailingSlash(s.normalizeLocalePath(E(a.redirect)?R(a.redirect):a.redirect,this.locales).pathname),{url:t,as:r}=x(this,e,e);return{type:"redirect",newUrl:t,newAs:r}}return{type:"redirect",destination:a.redirect}}return a.refresh&&!a.ssr?{type:"refresh"}:{type:"next"}}_getPreflightData(e){const{preflightHref:t,shouldCache:a=!1,isPreview:n}=e,{href:r}=new URL(t,window.location.href);return!n&&a&&this.sde[r]?Promise.resolve(this.sde[r]):fetch(t,{method:"HEAD",credentials:"same-origin",headers:{"x-middleware-preflight":"1"}}).then((e=>{if(!e.ok)throw new Error("Failed to preflight request");return{cache:e.headers.get("x-middleware-cache"),redirect:e.headers.get("Location"),refresh:e.headers.has("x-middleware-refresh"),rewrite:e.headers.get("x-middleware-rewrite"),ssr:!!e.headers.get("x-middleware-ssr")}})).then((e=>(a&&"no-cache"!==e.cache&&(this.sde[r]=e),e))).catch((e=>{throw delete this.sde[r],e}))}getInitialProps(e,t){const{Component:a}=this.components["/_app"],n=this._wrapApp(a);return t.AppTree=n,l.loadGetInitialProps(a,{AppTree:n,Component:e,router:this,ctx:t})}abortComponentLoad(e,t){this.clc&&(U.events.emit("routeChangeError",P(),e,t),this.clc(),this.clc=null)}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}}U.events=c.default(),t.default=U},169:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatUrl=function(e){let{auth:t,hostname:a}=e,o=e.protocol||"",i=e.pathname||"",s=e.hash||"",c=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:a&&(l=t+(~a.indexOf(":")?`[${a}]`:a),e.port&&(l+=":"+e.port));c&&"object"==typeof c&&(c=String(n.urlQueryToSearchParams(c)));let u=e.search||c&&`?${c}`||"";o&&":"!==o.substr(-1)&&(o+=":");e.slashes||(!o||r.test(o))&&!1!==l?(l="//"+(l||""),i&&"/"!==i[0]&&(i="/"+i)):l||(l="");s&&"#"!==s[0]&&(s="#"+s);u&&"?"!==u[0]&&(u="?"+u);return i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${o}${l}${i}${u}${s}`};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,a):{};n.get||n.set?Object.defineProperty(t,a,n):t[a]=e[a]}return t.default=e,t}(a(624));const r=/https?|ftp|gopher|file/},705:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t=""){return("/"===e?"/index":/^\/index(\/|$)/.test(e)?`/index${e}`:`${e}`)+t}},304:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMiddlewareRegex=function(e,t=!0){const a=n.getParametrizedRoute(e);let r=t?"(?!_next).*":"",o=t?"(?:(/.*)?)":"";if("routeKeys"in a)return"/"===a.parameterizedRoute?{groups:{},namedRegex:`^/${r}$`,re:new RegExp(`^/${r}$`),routeKeys:{}}:{groups:a.groups,namedRegex:`^${a.namedParameterizedRoute}${o}$`,re:new RegExp(`^${a.parameterizedRoute}${o}$`),routeKeys:a.routeKeys};if("/"===a.parameterizedRoute)return{groups:{},re:new RegExp(`^/${r}$`)};return{groups:{},re:new RegExp(`^${a.parameterizedRoute}${o}$`)}};var n=a(445)},720:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getMiddlewareRegex",{enumerable:!0,get:function(){return n.getMiddlewareRegex}}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return r.getRouteMatcher}}),Object.defineProperty(t,"getRouteRegex",{enumerable:!0,get:function(){return o.getRouteRegex}}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return i.getSortedRoutes}}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return s.isDynamicRoute}});var n=a(304),r=a(205),o=a(445),i=a(832),s=a(554)},554:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicRoute=function(e){return a.test(e)};const a=/\/\[[^/]+?\](?=\/|$)/},920:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRelativeUrl=function(e,t){const a=new URL("undefined"==typeof window?"http://n":n.getLocationOrigin()),o=t?new URL(t,a):a,{pathname:i,searchParams:s,search:c,hash:l,href:u,origin:p}=new URL(e,o);if(p!==a.origin)throw new Error(`invariant: invalid relative URL, router received ${e}`);return{pathname:i,query:r.searchParamsToUrlQuery(s),search:c,hash:l,href:u.slice(a.origin.length)}};var n=a(916),r=a(624)},462:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUrl=function(e){if(e.startsWith("/"))return r.parseRelativeUrl(e);const t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:n.searchParamsToUrlQuery(t.searchParams),search:t.search}};var n=a(624),r=a(920)},757:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.customRouteMatcherOptions=t.matcherOptions=t.pathToRegexp=void 0;var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,a):{};n.get||n.set?Object.defineProperty(t,a,n):t[a]=e[a]}return t.default=e,t}(a(173));t.pathToRegexp=n;const r={sensitive:!1,delimiter:"/"};t.matcherOptions=r;const o={...r,strict:!0};t.customRouteMatcherOptions=o;t.default=(e=!1)=>(t,a)=>{const i=[];let s=n.pathToRegexp(t,i,e?o:r);if(a){const e=a(s.source);s=new RegExp(e,s.flags)}const c=n.regexpToFunction(s,i);return(t,a)=>{const n=null!=t&&c(t);if(!n)return!1;if(e)for(const e of i)"number"==typeof e.name&&delete n.params[e.name];return{...a,...n.params}}}},379:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchHas=function(e,t,a){const n={};if(t.every((t=>{let r,o=t.key;switch(t.type){case"header":o=o.toLowerCase(),r=e.headers[o];break;case"cookie":r=e.cookies[t.key];break;case"query":r=a[o];break;case"host":{const{host:t}=(null==e?void 0:e.headers)||{};r=null==t?void 0:t.split(":")[0].toLowerCase();break}}if(!t.value&&r)return n[function(e){let t="";for(let a=0;a<e.length;a++){const n=e.charCodeAt(a);(n>64&&n<91||n>96&&n<123)&&(t+=e[a])}return t}(o)]=r,!0;if(r){const e=new RegExp(`^${t.value}$`),a=Array.isArray(r)?r.slice(-1)[0].match(e):r.match(e);if(a)return Array.isArray(a)&&(a.groups?Object.keys(a.groups).forEach((e=>{n[e]=a.groups[e]})):"host"===t.type&&a[0]&&(n.host=a[0])),!0}return!1})))return n;return!1},t.compileNonPath=i,t.prepareDestination=function(e){const t=Object.assign({},e.query);delete t.__nextLocale,delete t.__nextDefaultLocale;let a=e.destination;for(const n of Object.keys({...e.params,...t}))c=n,a=a.replace(new RegExp(`:${r.escapeStringRegexp(c)}`,"g"),`__ESC_COLON_${c}`);var c;const l=o.parseUrl(a),u=l.query,p=s(`${l.pathname}${l.hash||""}`),d=s(l.hostname||""),h=[],f=[];n.pathToRegexp(p,h),n.pathToRegexp(d,f);const w=[];h.forEach((e=>w.push(e.name))),f.forEach((e=>w.push(e.name)));const g=n.compile(p,{validate:!1}),y=n.compile(d,{validate:!1});for(const[t,a]of Object.entries(u))Array.isArray(a)?u[t]=a.map((t=>i(s(t),e.params))):u[t]=i(s(a),e.params);let m,v=Object.keys(e.params).filter((e=>"nextInternalLocale"!==e));if(e.appendParamsToQuery&&!v.some((e=>w.includes(e))))for(const t of v)t in u||(u[t]=e.params[t]);try{m=g(e.params);const[t,a]=m.split("#");l.hostname=y(e.params),l.pathname=t,l.hash=`${a?"#":""}${a||""}`,delete l.search}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw new Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw e}return l.query={...t,...l.query},{newUrl:m,parsedDestination:l}};var n=a(173),r=a(294),o=a(462);function i(e,t){if(!e.includes(":"))return e;for(const a of Object.keys(t))e.includes(`:${a}`)&&(e=e.replace(new RegExp(`:${a}\\*`,"g"),`:${a}--ESCAPED_PARAM_ASTERISKS`).replace(new RegExp(`:${a}\\?`,"g"),`:${a}--ESCAPED_PARAM_QUESTION`).replace(new RegExp(`:${a}\\+`,"g"),`:${a}--ESCAPED_PARAM_PLUS`).replace(new RegExp(`:${a}(?!\\w)`,"g"),`--ESCAPED_PARAM_COLON${a}`));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),n.compile(`/${e}`,{validate:!1})(t).substr(1)}function s(e){return e.replace(/__ESC_COLON_/gi,":")}},624:(e,t)=>{"use strict";function a(e){return"string"==typeof e||"number"==typeof e&&!isNaN(e)||"boolean"==typeof e?String(e):""}Object.defineProperty(t,"__esModule",{value:!0}),t.searchParamsToUrlQuery=function(e){const t={};return e.forEach(((e,a)=>{void 0===t[a]?t[a]=e:Array.isArray(t[a])?t[a].push(e):t[a]=[t[a],e]})),t},t.urlQueryToSearchParams=function(e){const t=new URLSearchParams;return Object.entries(e).forEach((([e,n])=>{Array.isArray(n)?n.forEach((n=>t.append(e,a(n)))):t.set(e,a(n))})),t},t.assign=function(e,...t){return t.forEach((t=>{Array.from(t.keys()).forEach((t=>e.delete(t))),t.forEach(((t,a)=>e.append(a,t)))})),e}},853:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,a,n,r,p){let d,h=!1,f=!1,w=c.parseRelativeUrl(e),g=i.removePathTrailingSlash(s.normalizeLocalePath(l.delBasePath(w.pathname),p).pathname);const y=a=>{let c=u(a.source)(w.pathname);if(a.has&&c){const e=o.matchHas({headers:{host:document.location.hostname},cookies:document.cookie.split("; ").reduce(((e,t)=>{const[a,...n]=t.split("=");return e[a]=n.join("="),e}),{})},a.has,w.query);e?Object.assign(c,e):c=!1}if(c){if(!a.destination)return f=!0,!0;const u=o.prepareDestination({appendParamsToQuery:!0,destination:a.destination,params:c,query:n});if(w=u.parsedDestination,e=u.newUrl,Object.assign(n,u.parsedDestination.query),g=i.removePathTrailingSlash(s.normalizeLocalePath(l.delBasePath(e),p).pathname),t.includes(g))return h=!0,d=g,!0;if(d=r(g),d!==e&&t.includes(d))return h=!0,!0}};let m=!1;for(let e=0;e<a.beforeFiles.length;e++)m=y(a.beforeFiles[e])||!1;if(h=t.includes(g),!h){if(!m)for(let e=0;e<a.afterFiles.length;e++)if(y(a.afterFiles[e])){m=!0;break}if(m||(d=r(g),h=t.includes(d),m=h),!m)for(let e=0;e<a.fallback.length;e++)if(y(a.fallback[e])){m=!0;break}}return{asPath:e,parsedAs:w,matchedPage:h,resolvedHref:d,externalDest:f}};var n,r=(n=a(757))&&n.__esModule?n:{default:n},o=a(379),i=a(421),s=a(559),c=a(920),l=a(765);const u=r.default(!0)},205:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRouteMatcher=function(e){const{re:t,groups:a}=e;return e=>{const r=t.exec(e);if(!r)return!1;const o=e=>{try{return decodeURIComponent(e)}catch(e){throw new n.DecodeError("failed to decode param")}},i={};return Object.keys(a).forEach((e=>{const t=a[e],n=r[t.pos];void 0!==n&&(i[e]=~n.indexOf("/")?n.split("/").map((e=>o(e))):t.repeat?[o(n)]:o(n))})),i}};var n=a(916)},445:(e,t)=>{"use strict";function a(e){return e.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")}function n(e){const t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));const a=e.startsWith("...");return a&&(e=e.slice(3)),{key:e,repeat:a,optional:t}}function r(e){const t=(e.replace(/\/$/,"")||"/").slice(1).split("/"),r={};let o=1;const i=t.map((e=>{if(e.startsWith("[")&&e.endsWith("]")){const{key:t,optional:a,repeat:i}=n(e.slice(1,-1));return r[t]={pos:o++,repeat:i,optional:a},i?a?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}return`/${a(e)}`})).join("");if("undefined"==typeof window){let e=97,o=1;const s=()=>{let t="";for(let a=0;a<o;a++)t+=String.fromCharCode(e),e++,e>122&&(o++,e=97);return t},c={};return{parameterizedRoute:i,namedParameterizedRoute:t.map((e=>{if(e.startsWith("[")&&e.endsWith("]")){const{key:t,optional:a,repeat:r}=n(e.slice(1,-1));let o=t.replace(/\W/g,""),i=!1;return(0===o.length||o.length>30)&&(i=!0),isNaN(parseInt(o.substr(0,1)))||(i=!0),i&&(o=s()),c[o]=t,r?a?`(?:/(?<${o}>.+?))?`:`/(?<${o}>.+?)`:`/(?<${o}>[^/]+?)`}return`/${a(e)}`})).join(""),groups:r,routeKeys:c}}return{parameterizedRoute:i,groups:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.getParametrizedRoute=r,t.getRouteRegex=function(e){const t=r(e);if("routeKeys"in t)return{re:new RegExp(`^${t.parameterizedRoute}(?:/)?$`),groups:t.groups,routeKeys:t.routeKeys,namedRegex:`^${t.namedParameterizedRoute}(?:/)?$`};return{re:new RegExp(`^${t.parameterizedRoute}(?:/)?$`),groups:t.groups}}},832:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSortedRoutes=function(e){const t=new a;return e.forEach((e=>t.insert(e))),t.smoosh()};class a{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e="/"){const t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);const a=t.map((t=>this.children.get(t)._smoosh(`${e}${t}/`))).reduce(((e,t)=>[...e,...t]),[]);if(null!==this.slugName&&a.push(...this.children.get("[]")._smoosh(`${e}[${this.slugName}]/`)),!this.placeholder){const t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${t}" and "${t}[[...${this.optionalRestSlugName}]]").`);a.unshift(t)}return null!==this.restSlugName&&a.push(...this.children.get("[...]")._smoosh(`${e}[...${this.restSlugName}]/`)),null!==this.optionalRestSlugName&&a.push(...this.children.get("[[...]]")._smoosh(`${e}[[...${this.optionalRestSlugName}]]/`)),a}_insert(e,t,n){if(0===e.length)return void(this.placeholder=!1);if(n)throw new Error("Catch-all must be the last part of the URL.");let r=e[0];if(r.startsWith("[")&&r.endsWith("]")){let a=r.slice(1,-1),i=!1;if(a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1),i=!0),a.startsWith("...")&&(a=a.substring(3),n=!0),a.startsWith("[")||a.endsWith("]"))throw new Error(`Segment names may not start or end with extra brackets ('${a}').`);if(a.startsWith("."))throw new Error(`Segment names may not start with erroneous periods ('${a}').`);function o(e,a){if(null!==e&&e!==a)throw new Error(`You cannot use different slug names for the same dynamic path ('${e}' !== '${a}').`);t.forEach((e=>{if(e===a)throw new Error(`You cannot have the same slug name "${a}" repeat within a single dynamic path`);if(e.replace(/\W/g,"")===r.replace(/\W/g,""))throw new Error(`You cannot have the slug names "${e}" and "${a}" differ only by non-word symbols within a single dynamic path`)})),t.push(a)}if(n)if(i){if(null!=this.restSlugName)throw new Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${e[0]}" ).`);o(this.optionalRestSlugName,a),this.optionalRestSlugName=a,r="[[...]]"}else{if(null!=this.optionalRestSlugName)throw new Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${e[0]}").`);o(this.restSlugName,a),this.restSlugName=a,r="[...]"}else{if(i)throw new Error(`Optional route parameters are not yet supported ("${e[0]}").`);o(this.slugName,a),this.slugName=a,r="[]"}}this.children.has(r)||this.children.set(r,new a),this.children.get(r)._insert(e.slice(1),t,n)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}},916:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execOnce=function(e){let t,a=!1;return(...n)=>(a||(a=!0,t=e(...n)),t)},t.getLocationOrigin=o,t.getURL=function(){const{href:e}=window.location,t=o();return e.substring(t.length)},t.getDisplayName=i,t.isResSent=s,t.normalizeRepeatedSlashes=function(e){const t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")},t.loadGetInitialProps=async function e(t,a){0;const n=a.res||a.ctx&&a.ctx.res;if(!t.getInitialProps)return a.ctx&&a.Component?{pageProps:await e(a.Component,a.ctx)}:{};const r=await t.getInitialProps(a);if(n&&s(n))return r;if(!r){const e=`"${i(t)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`;throw new Error(e)}0;return r},t.formatWithValidation=function(e){0;return r.formatUrl(e)},t.HtmlContext=t.ST=t.SP=t.urlObjectKeys=void 0;var n=a(378),r=a(169);function o(){const{protocol:e,hostname:t,port:a}=window.location;return`${e}//${t}${a?":"+a:""}`}function i(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}t.urlObjectKeys=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];const c="undefined"!=typeof performance;t.SP=c;const l=c&&"function"==typeof performance.mark&&"function"==typeof performance.measure;t.ST=l;class u extends Error{}t.DecodeError=u;const p=n.createContext(null);t.HtmlContext=p},677:(e,t,a)=>{e.exports=a(236)},525:e=>{"use strict";var t=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,s,c=r(e),l=1;l<arguments.length;l++){for(var u in i=Object(arguments[l]))a.call(i,u)&&(c[u]=i[u]);if(t){s=t(i);for(var p=0;p<s.length;p++)n.call(i,s[p])&&(c[s[p]]=i[s[p]])}}return c}},535:(e,t,a)=>{"use strict";var n=a(525),r=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var i=60109,s=60110,c=60112;t.Suspense=60113;var l=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var p=Symbol.for;r=p("react.element"),o=p("react.portal"),t.Fragment=p("react.fragment"),t.StrictMode=p("react.strict_mode"),t.Profiler=p("react.profiler"),i=p("react.provider"),s=p("react.context"),c=p("react.forward_ref"),t.Suspense=p("react.suspense"),l=p("react.memo"),u=p("react.lazy")}var d="function"==typeof Symbol&&Symbol.iterator;function h(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w={};function g(e,t,a){this.props=e,this.context=t,this.refs=w,this.updater=a||f}function y(){}function m(e,t,a){this.props=e,this.context=t,this.refs=w,this.updater=a||f}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(h(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var v=m.prototype=new y;v.constructor=m,n(v,g.prototype),v.isPureReactComponent=!0;var P={current:null},S=Object.prototype.hasOwnProperty,_={key:!0,ref:!0,__self:!0,__source:!0};function b(e,t,a){var n,o={},i=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)S.call(t,n)&&!_.hasOwnProperty(n)&&(o[n]=t[n]);var c=arguments.length-2;if(1===c)o.children=a;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(n in c=e.defaultProps)void 0===o[n]&&(o[n]=c[n]);return{$$typeof:r,type:e,key:i,ref:s,props:o,_owner:P.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var E=/\/+/g;function k(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function R(e,t,a,n,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c=!1;if(null===e)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case r:case o:c=!0}}if(c)return i=i(c=e),e=""===n?"."+k(c,0):n,Array.isArray(i)?(a="",null!=e&&(a=e.replace(E,"$&/")+"/"),R(i,t,a,"",(function(e){return e}))):null!=i&&(C(i)&&(i=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,a+(!i.key||c&&c.key===i.key?"":(""+i.key).replace(E,"$&/")+"/")+e)),t.push(i)),1;if(c=0,n=""===n?".":n+":",Array.isArray(e))for(var l=0;l<e.length;l++){var u=n+k(s=e[l],l);c+=R(s,t,a,u,i)}else if("function"==typeof(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e)))for(e=u.call(e),l=0;!(s=e.next()).done;)c+=R(s=s.value,t,a,u=n+k(s,l++),i);else if("object"===s)throw t=""+e,Error(h(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return c}function W(e,t,a){if(null==e)return e;var n=[],r=0;return R(e,n,"","",(function(e){return t.call(a,e,r++)})),n}function A(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var O={current:null};function I(){var e=O.current;if(null===e)throw Error(h(321));return e}var T={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:P,IsSomeRendererActing:{current:!1},assign:n};t.Children={map:W,forEach:function(e,t,a){W(e,(function(){t.apply(this,arguments)}),a)},count:function(e){var t=0;return W(e,(function(){t++})),t},toArray:function(e){return W(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error(h(143));return e}},t.Component=g,t.PureComponent=m,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,t.cloneElement=function(e,t,a){if(null==e)throw Error(h(267,e));var o=n({},e.props),i=e.key,s=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,c=P.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)S.call(t,u)&&!_.hasOwnProperty(u)&&(o[u]=void 0===t[u]&&void 0!==l?l[u]:t[u])}var u=arguments.length-2;if(1===u)o.children=a;else if(1<u){l=Array(u);for(var p=0;p<u;p++)l[p]=arguments[p+2];o.children=l}return{$$typeof:r,type:e.type,key:i,ref:s,props:o,_owner:c}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},t.createElement=b,t.createFactory=function(e){var t=b.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:A}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return I().useCallback(e,t)},t.useContext=function(e,t){return I().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return I().useEffect(e,t)},t.useImperativeHandle=function(e,t,a){return I().useImperativeHandle(e,t,a)},t.useLayoutEffect=function(e,t){return I().useLayoutEffect(e,t)},t.useMemo=function(e,t){return I().useMemo(e,t)},t.useReducer=function(e,t,a){return I().useReducer(e,t,a)},t.useRef=function(e){return I().useRef(e)},t.useState=function(e){return I().useState(e)},t.version="17.0.2"},378:(e,t,a)=>{"use strict";e.exports=a(535)}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";var e,t,r,o,i,s,c;a.r(n),a.d(n,{AppManifestType:()=>s,BrowserButtonType:()=>h,CustomActionCallerType:()=>w,GlobalContextMenuOptionType:()=>u,PageTabContextMenuOptionType:()=>p,SaveButtonContextMenuOptionType:()=>f,SaveModalType:()=>g,ViewTabMenuOptionType:()=>d,getCurrentSync:()=>Ot,init:()=>La,wrapSync:()=>At}),function(e){e.Fetching="fetching",e.Fetched="fetched",e.Complete="complete"}(e||(e={})),function(e){e.Active="active",e.Default="default"}(t||(t={})),function(e){e.Suggestion="suggestion"}(r||(r={})),function(e){e.Contact="Contact",e.Custom="Custom",e.List="List",e.Plain="Plain",e.SimpleText="SimpleText"}(o||(o={})),function(e){e.MultiSelect="MultiSelect"}(i||(i={})),function(e){e.Snapshot="snapshot",e.Manifest="manifest",e.View="view",e.External="external"}(s||(s={})),function(e){e.LandingPage="landingPage",e.AppGrid="appGrid"}(c||(c={}));var l,u,p,d,h,f,w,g,y;!function(e){e.Primary="primary",e.Secondary="secondary",e.TextOnly="textOnly"}(l||(l={})),function(e){e.NewWindow="NewWindow",e.NewPage="NewPage",e.SavePage="SavePage",e.SavePageAs="SavePageAs",e.CloseWindow="CloseWindow",e.SwitchWorkspace="SwitchWorkspace",e.DeleteWorkspace="DeleteWorkspace",e.OpenStorefront="OpenStorefront",e.Quit="Quit",e.Custom="Custom"}(u||(u={})),function(e){e.Close="Close",e.Duplicate="Duplicate",e.Rename="Rename",e.Save="Save",e.SaveAs="Save As",e.Custom="Custom"}(p||(p={})),function(e){e.NewView="NewView",e.DuplicateViews="DuplicateView",e.OpenWithDefaultBrowser="OpenWithDefaultBrowser",e.ReloadViews="ReloadTab",e.CloseViews="CloseTab",e.AddToChannel="AddToChannel",e.RemoveFromChannel="RemoveFromChannel",e.Custom="Custom"}(d||(d={})),function(e){e.ShowHideTabs="ShowHideTabs",e.ColorLinking="ColorLinking",e.PresetLayouts="PresetLayouts",e.SavePage="SavePage",e.Minimise="Minimise",e.Maximise="Maximise",e.Close="Close",e.Custom="Custom"}(h||(h={})),function(e){e.SavePage="SavePage",e.SaveWorkspace="SaveWorkspace",e.Custom="Custom"}(f||(f={})),function(e){e.CustomButton="CustomButton",e.GlobalContextMenu="GlobalContextMenu",e.ViewTabContextMenu="ViewTabContextMenu",e.PageTabContextMenu="PageTabContextMenu",e.SaveButtonContextMenu="SaveButtonContextMenu",e.API="API"}(w||(w={})),function(e){e.SAVE_PAGE="SAVE_PAGE",e.SAVE_WORKSPACE="SAVE_WORKSPACE",e.SAVE_PAGE_AS="SAVE_PAGE_AS",e.SAVE_WORKSPACE_AS="SAVE_WORKSPACE_AS",e.RENAME_PAGE="RENAME_PAGE",e.RENAME_WORKSPACE="RENAME_WORKSPACE"}(g||(g={})),function(e){e.Local="local",e.Dev="dev",e.Staging="staging",e.Prod="prod"}(y||(y={}));const m="undefined"!=typeof window&&"undefined"!=typeof fin,v=("undefined"==typeof process||process.env?.JEST_WORKER_ID,"undefined"!=typeof window),P=v&&"undefined"!=typeof indexedDB,S=v?window.origin:y.Local,_=m&&fin.me.uuid,b=m&&fin.me.name,C=m&&fin.me.entityType,E=(y.Local,y.Dev,y.Staging,y.Prod,e=>e.startsWith("http://")||e.startsWith("https://")?e:S+e),k=(E("https://cdn.openfin.co/workspace/7.1.0"),E("https://cdn.openfin.co/workspace/7.1.0")),R=("undefined"!=typeof WORKSPACE_DOCS_PLATFORM_URL&&E(WORKSPACE_DOCS_PLATFORM_URL),"undefined"!=typeof WORKSPACE_DOCS_CLIENT_URL&&E(WORKSPACE_DOCS_CLIENT_URL),"24.98.68.14"),W="7.1.0";var A,O,I;!function(e){e.Workspace="openfin-browser"}(A||(A={})),function(e){e.RunRequested="run-requested",e.WindowOptionsChanged="window-options-changed",e.WindowClosed="window-closed",e.WindowCreated="window-created"}(O||(O={})),function(e){e.FinProtocol="fin-protocol"}(I||(I={}));const T={uuid:_,name:_},x=(A.Workspace,A.Workspace,e=>{if(!m)throw new Error("getApplication cannot be used in a non OpenFin env. Avoid using this during pre-rendering.");return fin.Application.wrapSync(e)});var M,L;!function(e){e.Home="openfin-home",e.Dock="openfin-dock",e.Storefront="openfin-storefront",e.HomeInternal="openfin-home-internal",e.BrowserMenu="openfin-browser-menu",e.BrowserIndicator="openfin-browser-indicator",e.BrowserWindow="internal-generated-window"}(M||(M={})),function(e){e.Shown="shown",e.BoundsChanged="bounds-changed",e.LayoutReady="layout-ready",e.EndUserBoundsChanging="end-user-bounds-changing",e.Blurred="blurred",e.CloseRequested="close-requested",e.Focused="focused",e.ShowRequested="show-requested",e.ViewCrashed="view-crashed",e.ViewAttached="view-attached",e.ViewDetached="view-detached",e.ViewPageTitleUpdated="view-page-title-updated",e.ViewDestroyed="view-destroyed",e.OptionsChanged="options-changed"}(L||(L={}));function N(e){if(!m)throw new Error("getOFWindow can only be used in an OpenFin env. Avoid calling this method during pre-rendering.");return fin.Window.wrapSync(e)}const $={name:b,uuid:_};function D(){return N($)}M.Home,A.Workspace,M.Dock,A.Workspace;const U={name:M.Storefront,uuid:A.Workspace};A.Workspace,A.Workspace;async function j(e){const t=N(e);"minimized"===await t.getState()&&await t.restore(),await t.show(),await t.bringToFront(),await t.focus()}const F=e=>e.startsWith(M.BrowserWindow);async function V(){return(await fin.Application.getCurrentSync().getChildWindows()).filter((e=>F(e.identity.name)))}const B=e=>N(e).getOptions().then((()=>!0)).catch((()=>!1)),G=()=>B(U);var q;!function(e){e.Browser="Browser",e.Home="Home",e.Notification="Notification",e.Storefront="Storefront",e.Platform="Platform",e.Theming="Theming"}(q||(q={}));const H=async(e,t)=>{const a={apiVersion:t.apiVersion||W,componentName:e,componentVersion:W,...t};fin.System.registerUsage({type:"workspace-licensing",data:a})};var z,X=new Uint8Array(16);function K(){if(!z&&!(z="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return z(X)}const Q=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const Y=function(e){return"string"==typeof e&&Q.test(e)};for(var J=[],Z=0;Z<256;++Z)J.push((Z+256).toString(16).substr(1));const ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(J[e[t+0]]+J[e[t+1]]+J[e[t+2]]+J[e[t+3]]+"-"+J[e[t+4]]+J[e[t+5]]+"-"+J[e[t+6]]+J[e[t+7]]+"-"+J[e[t+8]]+J[e[t+9]]+"-"+J[e[t+10]]+J[e[t+11]]+J[e[t+12]]+J[e[t+13]]+J[e[t+14]]+J[e[t+15]]).toLowerCase();if(!Y(a))throw TypeError("Stringified UUID is invalid");return a};const te=function(e,t,a){var n=(e=e||{}).random||(e.rng||K)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){a=a||0;for(var r=0;r<16;++r)t[a+r]=n[r];return t}return ee(n)};var ae;!function(e){e.CurrentWorkspaceId="currentWorkspaceId",e.LastFocusedBrowserWindow="lastFocusedBrowserWindow",e.MachineName="machineName",e.NewTabPageLayout="NewTabPageLayout",e.NewTabPageSort="NewTabPageSort"}(ae||(ae={}));const ne=ae;var re;!function(e){e.LaunchApp="launchApp",e.SavePage="savePage",e.GetSavedPage="getSavedPage",e.CreateSavedPage="createSavedPage",e.UpdateSavedPage="updateSavedPage",e.DeleteSavedPage="deleteSavedPage",e.GetSavedPages="getSavedPages",e.CreateSavedPageInternal="createSavedPageInternal",e.UpdateSavedPageInternal="updateSavedPageInternal",e.DeleteSavedPageInternal="deleteSavedPageInternal",e.SharePage="sharePage",e.UpdatePageForWindow="updatePageForWindow",e.AttachPagesToWindow="attachPagesToWindow",e.DetachPagesFromWindow="detachPagesFromWindow",e.ReorderPagesForWindow="reorderPagesForWindow",e.SetActivePage="setActivePage",e.GetAllAttachedPages="getAllAttachedPages",e.GetActivePageIdForWindow="getActivePageIdForWindow",e.GetPagesForWindow="getPagesForWindow",e.GetPageForWindow="getPageForWindow",e.GetSavedPageMetadata="getSavedPageMetadata",e.GetUniquePageTitle="getUniquePageTitle",e.GetLastFocusedBrowserWindow="getLastFocusedBrowserWindow",e.GetThemes="getThemes",e.OpenGlobalContextMenuInternal="openGlobalContextMenuInternal",e.OpenViewTabContextMenuInternal="openViewTabContextMenuInternal",e.OpenPageTabContextMenuInternal="openPageTabContextMenuInternal",e.OpenSaveButtonContextMenuInternal="openSaveButtonContextMenuInternal",e.InvokeCustomActionInternal="invokeCustomActionInternal",e.GetSavedWorkspace="getSavedWorkspace",e.CreateSavedWorkspace="createSavedWorkspace",e.UpdateSavedWorkspace="updateSavedWorkspace",e.DeleteSavedWorkspace="deleteSavedWorkspace",e.GetSavedWorkspaces="getSavedWorkspaces",e.SaveWorkspace="saveWorkspace",e.GetCurrentWorkspace="getCurrentWorkspace",e.ApplyWorkspace="applyWorkspace",e.SetActiveWorkspace="setActiveWorkspace"}(re||(re={}));const oe=async e=>{const t=fin.Platform.wrapSync(e),a=await t.getClient(),n="Target is not a Workspace Platform. Target must call WorkspacePlatform.init";try{if(!0===await a.dispatch("isWorkspacePlatform"))return a;throw new Error(n)}catch(e){throw new Error(n)}},ie=(e,t)=>!t.find((t=>t===e)),se=(e,t)=>`${e} (${t})`,ce=(e,t)=>{let a=1;const n=e.replace(/ \(.+\)$/,"");for(;!ie(se(n,a),t);)a+=1;return se(n,a)};async function le(e){try{await fin.Platform.getCurrentSync().applySnapshot(e.snapshot,{closeExistingWindows:!0}),ue(e)}catch(e){}}function ue(e){if("undefined"!=typeof localStorage)try{const t=JSON.stringify(e);localStorage.setItem(ne.CurrentWorkspaceId,t)}catch(e){}}async function pe(){if("undefined"==typeof localStorage)return;const e=await fin.Platform.getCurrentSync().getSnapshot();return{workspaceId:te(),title:await fe(),snapshot:e}}async function de(){if("undefined"==typeof localStorage)return;const e=localStorage.getItem(ne.CurrentWorkspaceId);if(!e)return pe();return{...JSON.parse(e),snapshot:await fin.Platform.getCurrentSync().getSnapshot()}}const he=async e=>await(async e=>(await oe($)).dispatch(re.GetSavedWorkspace,e))(e.workspaceId)?(async e=>(await oe($)).dispatch(re.UpdateSavedWorkspace,e))({workspaceId:e.workspaceId,workspace:e}):(async e=>(await oe($)).dispatch(re.CreateSavedWorkspace,e))({workspace:e});async function fe(e="Untitled Workspace"){const t=(await(async()=>(await oe($)).dispatch(re.GetSavedWorkspaces,void 0))()).map((({title:e})=>e));return t.find((t=>t===e))?ce(e,t):e}async function we(){if("undefined"!=typeof localStorage)try{const e=localStorage.getItem(ne.LastFocusedBrowserWindow),t=JSON.parse(e);if(await B(t))return t}catch(e){throw new Error(`failed to get last focused browser window: ${e}`)}}function ge(e=fin.me.identity){F(e.name)&&function(e){if("undefined"!=typeof localStorage)try{const t=JSON.stringify(e);localStorage.setItem(ne.LastFocusedBrowserWindow,t)}catch(e){}}(e)}const ye=(e,t=0)=>{let a,n,r=!1;const o=async n=>{const i=await e(...n);if(r){await new Promise((e=>setTimeout(e,t)));const e=a;return a=void 0,r=!1,o(e)}return i};return(...e)=>(n?(r=!0,a=e):n=o(e).then((e=>(n=void 0,e))),n)};var me;!function(e){e.TabCreated="tab-created",e.ContainerCreated="container-created",e.ContainerResized="container-resized"}(me||(me={}));const ve=e=>{const t=[];return(e&&Array.isArray(e)?e:[]).forEach((e=>{if("component"===e.type)return t.push(e.componentState);const a=ve(e.content);t.push(...a)})),t},Pe=async(e,t,a=$)=>{let n;if(F(a.name)){n=(await N(a).getOptions()).layout||{settings:{}}}return{...n,content:[{type:"stack",content:[{type:"component",componentName:"view",componentState:{title:e,url:t}}]}]}};new Map;const Se=v&&"complete"!==document.readyState&&new Promise((e=>document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&e()}))));function _e(e){let t;return()=>{if(!m)throw new Error("getChannelClient cannot be used outside an OpenFin env. Avoid using this method during pre-rendering.");return t||(t=(async()=>{await Se;const a=await fin.InterApplicationBus.Channel.connect(e);return a.onDisconnection((async()=>{t=void 0})),a})().then((e=>e)).catch((a=>{throw t=void 0,new Error(`failed to connect to channel provider ${e}: ${a}`)}))),t}}const be=e=>`__browser_window__-${e.uuid}-${e.name}`,Ce=new Map,Ee=e=>{const t=be(e);return Ce.has(t)||Ce.set(t,_e(t)),Ce.get(t)()};var ke,Re,We;!function(e){e.CloseBrowserWindow="close-browser-window",e.QuitPlatform="quit-platform",e.ClosePage="close-page",e.AddToChannel="add-to-channel",e.RemoveFromChannel="remove-from-channel",e.OpenSaveModalInternal="open-save-modal-internal",e.DuplicatePage="duplicate-page"}(ke||(ke={})),function(e){e.GetPages="get-pages",e.GetActivePageForWindow="get-active-page-for-window",e.AttachPagesToWindow="attach-pages-to-window",e.DetachPagesFromWindow="detach-pages-from-window",e.SetActivePageForWindow="set-active-page-for-window",e.RenamePage="rename-page",e.ReorderPagesForWindow="reorder-pages-for-window",e.UpdatePageForWindow="update-page-for-window",e.UpdatePagesWindowOptions="update-pages-window-options",e.IsDetachingPages="is-detaching-pages",e.IsActivePageChanging="is-active-page-changing"}(Re||(Re={})),function(e){e.AttachedPagesToWindow="attached-pages-to-window",e.DetachedPagesFromWindow="detached-pages-from-window"}(We||(We={}));new Map;const Ae=async e=>{const t=await Ee(e);return await t.dispatch(Re.GetPages)},Oe=async e=>(await Ee(e.identity)).dispatch(Re.UpdatePageForWindow,e),Ie=async()=>{const e=await V();return(await Promise.all(e.map((async({identity:e})=>Ae(e))))).reduce(((e,t)=>e.concat(t)),[])},Te=async()=>(await oe($)).dispatch(re.GetSavedPages,void 0),xe=async e=>(await oe($)).dispatch(re.GetSavedPage,e),Me=async(e,t)=>{const a=await(async e=>(await Ie()).find((t=>t.pageId===e)))(e);return!a||a.title===t.title&&e===t.pageId||await Oe({identity:a.parentIdentity,pageId:e,page:{pageId:t.pageId,title:t.title}}),a},Le=async({page:e})=>{await Me(e.pageId,e),await(async e=>(await oe($)).dispatch(re.CreateSavedPage,e))({page:e})},Ne=async e=>{await xe(e)&&await(async e=>(await oe($)).dispatch(re.DeleteSavedPage,e))(e)},$e=async({pageId:e,page:t})=>{await Me(e,t);return await(async e=>(await oe($)).dispatch(re.UpdateSavedPage,e))({pageId:e,page:t})},De=async e=>await xe(e.pageId)?$e({pageId:e.pageId,page:e}):Le({page:e}),Ue=async e=>{await(async e=>(await Ee(e.identity)).dispatch(Re.AttachPagesToWindow,e))(e)},je=async e=>{await Oe(e)},Fe=async e=>{await(async e=>(await Ee(e.identity)).dispatch(Re.DetachPagesFromWindow,e))(e)},Ve=async e=>{await(async e=>(await Ee(e.identity)).dispatch(Re.SetActivePageForWindow,e))(e)},Be=e=>Ae(e),Ge=async({identity:e,pageId:t})=>(await Be(e)).find((e=>e.pageId===t)),qe=async e=>{await(async e=>(await Ee(e.identity)).dispatch(Re.ReorderPagesForWindow,e))(e)};async function He(e="Untitled Page"){const[t,a]=await Promise.all([Te(),Ie()]),n=[...t,...a].map((({title:e})=>e));return n.find((t=>t===e))?ce(e,n):e}const ze=new Map,Xe=e=>`${e.uuid}-${e.name}`;const Ke=ye((async function(){const e=await Ie(),t=new Set;e.forEach((e=>{ve(e.layout.content).forEach((e=>{if(e.name){const a=Xe(e);t.add(a)}}))}));const a=D();(await a.getCurrentViews()).forEach((({identity:e})=>{const a=Xe(e);if(t.has(a)||ze.has(a))return;const n=setTimeout((()=>{fin.View.wrapSync(e).destroy(),ze.delete(a)}),5e3);ze.set(a,n)})),ze.forEach(((e,a)=>{t.has(a)&&(clearTimeout(e),ze.delete(a))}))}),2500),Qe=({name:e})=>{F(e)&&Ke().catch((()=>{}))};function Ye(){const e=x(T);e.addListener(O.WindowOptionsChanged,Ke),e.addListener(O.WindowClosed,Qe),e.addListener(O.WindowCreated,Qe)}let Je={};const Ze=({actionId:e,payload:t})=>{if("function"!=typeof Je[e])throw new Error(`Cannot find a configured function for the action '${e}'`);return Je[e](t)};function et(){return localStorage.getItem(ne.MachineName)}let tt,at;async function nt(){return tt||(tt=await fin.System.getMachineId()),tt}async function rt(e){const t=e||await fin.Platform.getCurrentSync().getSnapshot();if(t.snapshotDetails?.machineId)return t;const a=et();return{...t,snapshotDetails:{...e.snapshotDetails,machineId:await nt(),machineName:a}}}function ot(e){return new Promise(((t,a)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>a(e.error)}))}function it(e,t){const a=indexedDB.open(e);a.onupgradeneeded=()=>a.result.createObjectStore(t);const n=ot(a);return(e,a)=>n.then((n=>a(n.transaction(t,e).objectStore(t))))}function st(){return at||(at=it("keyval-store","keyval")),at}function ct(e,t=st()){return t("readonly",(t=>ot(t.get(e))))}function lt(e,t,a=st()){return a("readwrite",(a=>(a.put(t,e),ot(a.transaction))))}function ut(e,t=st()){return t("readwrite",(t=>(t.delete(e),ot(t.transaction))))}function pt(e,t){return e("readonly",(e=>(e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},ot(e.transaction))))}function dt(e=st()){const t=[];return pt(e,(e=>t.push(e.key))).then((()=>t))}const ht=(e,t="")=>e.toLowerCase().includes(t.toLowerCase()),ft=P&&it("openfin-home-pages","pages");async function wt(e){const t=await ct(e,ft);return t?(t.pageId=e.toString(),t.title=t.title||t.pageId,t):null}async function gt(e){const t=await dt(ft),a=await Promise.all(t.map((e=>wt(e.toString()))));return e?a.filter((t=>ht(t.title,e))):a}async function yt({page:e}){await lt(e.pageId,e,ft)}async function mt(e){await ut(e,ft)}async function vt({pageId:e,page:t}){if(void 0===await wt(e))throw new Error("page not found");await yt({page:t}),e!==t.pageId&&await mt(e)}var Pt;!function(e){e.Label="normal",e.Separator="separator",e.Submenu="submenu",e.Checkbox="checkbox"}(Pt||(Pt={}));const St=247;var _t;!function(e){e.RegisterStorefrontProvider="register-storefront-provider",e.DeregisterStorefrontProvider="deregister-storefront-provider",e.GetStorefrontProviders="get-storefront-providers",e.HideStorefront="hide-storefront",e.GetStorefrontProviderApps="get-storefront-provider-apps",e.GetStorefrontProviderLandingPage="get-storefront-provider-landing-page",e.GetStorefrontProviderFooter="get-storefront-provider-footer",e.GetStorefrontProviderNavigation="get-storefront-provider-navigation",e.LaunchStorefrontProviderApp="launch-storefront-provider-app",e.ShowStorefront="show-storefront",e.CreateStorefrontWindow="create-storefront-window",e.ShowHome="show-home",e.HideHome="hide-home",e.AssignHomeSearchContext="assign-home-search-context",e.GetLegacyPages="get-legacy-pages",e.GetLegacyWorkspaces="get-legacy-workspaces",e.GetComputedPlatformTheme="get-computed-platform-theme"}(_t||(_t={}));_e("__of_workspace_protocol__");const bt=async(e,t)=>{const a=await(async e=>({...e,layoutDetails:{machineId:await nt(),machineName:et()}}))(t);return{pageId:te(),title:e,layout:a,isReadOnly:!1,hasUnsavedChanges:!0}},Ct=e=>({identity:e,openfinWindow:fin.Window.wrapSync(e),getPages:async()=>(await oe(e)).dispatch(re.GetPagesForWindow,e),getPage:async t=>(await oe(e)).dispatch(re.GetPageForWindow,{identity:e,pageId:t}),addPage:async t=>{const a=await oe(e);t?.title||(t.title=await a.dispatch(re.GetUniquePageTitle,void 0));const n=(await a.dispatch(re.GetAllAttachedPages,void 0)).find((e=>e.pageId===t.pageId||e.title===t.title));if(n)throw n.pageId===t.pageId?new Error(`page with id ${t.pageId} is already attached to a browser window ${n.parentIdentity.name}`):new Error(`page with title ${t.title} is already attached to a browser window ${n.parentIdentity.name}`);const r={identity:e,pages:[t]};return a.dispatch(re.AttachPagesToWindow,r)},removePage:async t=>(await oe(e)).dispatch(re.DetachPagesFromWindow,{identity:e,pageIds:[t]}),setActivePage:async t=>(await oe(e)).dispatch(re.SetActivePage,{identity:e,pageId:t}),updatePage:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.UpdatePageForWindow,t)},reorderPages:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.ReorderPagesForWindow,t)},_openGlobalContextMenu:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.OpenGlobalContextMenuInternal,t)},replaceToolbarOptions:async t=>{const a=fin.Window.wrapSync(e);await a.updateOptions({workspacePlatform:{toolbarOptions:t}})},replaceWindowStateButtonOptions:async t=>{const a=fin.Window.wrapSync(e);await a.updateOptions({workspacePlatform:{windowStateButtonOptions:t}})},_openViewTabContextMenu:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.OpenViewTabContextMenuInternal,t)},_openPageTabContextMenu:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.OpenPageTabContextMenuInternal,t)},_openSaveModal:async t=>(await Ee(e)).dispatch(ke.OpenSaveModalInternal,t),_openSaveButtonContextMenu:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.OpenSaveButtonContextMenuInternal,t)}});let Et=!1;const kt=e=>{const t=fin.Platform.wrapSync(e);return{wrapSync:e=>Ct(e),createWindow:async e=>{Et||(Et=!0,(async e=>{H(q.Browser,e)})({allowed:!0}));const a=await t.createWindow(e);return Ct(a.identity)},getAllAttachedPages:async()=>(await t.getClient()).dispatch(re.GetAllAttachedPages,void 0),getAllWindows:async()=>(await fin.Application.wrapSync(e).getChildWindows()).filter((e=>e.identity.name.includes("internal-generated-window-"))).map((e=>Ct(e.identity))),getUniquePageTitle:async t=>(await oe(e)).dispatch(re.GetUniquePageTitle,t),getLastFocusedWindow:async()=>(await oe(e)).dispatch(re.GetLastFocusedBrowserWindow,void 0)}},Rt=e=>({createPage:async t=>(await oe(e)).dispatch(re.CreateSavedPageInternal,t),deletePage:async t=>(await oe(e)).dispatch(re.DeleteSavedPageInternal,t),updatePage:async t=>(await oe(e)).dispatch(re.UpdateSavedPageInternal,t),getPage:async t=>(await oe(e)).dispatch(re.GetSavedPage,t),getPages:async t=>(await oe(e)).dispatch(re.GetSavedPages,t),savePage:async t=>(await oe(e)).dispatch(re.SavePage,t),createWorkspace:async t=>(await oe(e)).dispatch(re.CreateSavedWorkspace,t),deleteWorkspace:async t=>(await oe(e)).dispatch(re.DeleteSavedWorkspace,t),updateWorkspace:async t=>(await oe(e)).dispatch(re.UpdateSavedWorkspace,t),getWorkspace:async t=>(await oe(e)).dispatch(re.GetSavedWorkspace,t),getWorkspaces:async t=>(await oe(e)).dispatch(re.GetSavedWorkspaces,t),saveWorkspace:async t=>(await oe(e)).dispatch(re.SaveWorkspace,t)}),Wt=e=>({getThemes:async()=>(await oe(e)).dispatch(re.GetThemes,void 0)}),At=e=>{const t=fin.Platform.wrapSync(e);return Object.assign(t,{applySnapshot:async t=>{if("string"!=typeof t&&!t?.windows)throw new Error("Not a valid browser snapshot");return fin.Platform.wrapSync(e).applySnapshot(t)},getSnapshot:()=>fin.Platform.wrapSync(e).getSnapshot().then((e=>e)),launchApp:async t=>{t.target||(t.target={uuid:_,name:b,entityType:C||"unknown"});return(await oe(e)).dispatch(re.LaunchApp,t)},_invokeCustomAction:async(t,a)=>{const n=await oe(e),r={actionId:t,payload:{...a,callerType:a.callerType||w.API}};return n.dispatch(re.InvokeCustomActionInternal,r)},getCurrentWorkspace:async()=>(await oe(e)).dispatch(re.GetCurrentWorkspace,void 0),applyWorkspace:async t=>(await oe(e)).dispatch(re.ApplyWorkspace,t),setActiveWorkspace:async t=>(await oe(e)).dispatch(re.SetActiveWorkspace,t),Theme:Wt(e),Browser:kt(e),Storage:Rt(e)})},Ot=()=>At(fin.me.identity),It=async(e=$)=>{const{workspacePlatform:t}=await N(e).getOptions();return{newPageUrl:t?.newPageUrl,newTabUrl:t?.newTabUrl}},Tt=async(e=$)=>{const t=await Ot().Browser.getUniquePageTitle("Untitled Page"),a=await(async(e=$)=>{const{newPageUrl:t}=await It(e);if(!t)throw new Error("Trying to create a new page without a newPageUrl set");return Pe("New Tab",t,e)})(e);return bt(t,a)},xt=[{type:Pt.Label,label:"Close Window",data:{type:u.CloseWindow}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Open Storefront",data:{type:u.OpenStorefront}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Quit Workspace",data:{type:u.Quit}}],Mt=[{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Close Window",data:{type:u.CloseWindow}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Quit",data:{type:u.Quit}}],Lt=(e,t,a)=>t.map((t=>{const n=t.workspaceId===e.workspaceId;return{label:t.title,type:Pt.Checkbox,enabled:!n,checked:n,data:{type:a,workspaceId:t.workspaceId}}})),Nt=async e=>{const t=await G(),{newPageUrl:a}=await It(e),n=await(async e=>{const t=N(e),{workspacePlatform:a}=await t.getOptions();return a?.disableMultiplePages})(e),r=[];a&&(r.push({type:Pt.Label,label:"New Window",data:{type:u.NewWindow}}),n||r.push({type:Pt.Label,label:"New Page",data:{type:u.NewPage}})),r.push({type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Save Page",data:{type:u.SavePage}},{type:Pt.Label,label:"Save Page As...",data:{type:u.SavePageAs}});const o=Ot(),i=await o.getCurrentWorkspace(),s=await o.Storage.getWorkspaces();return s.filter((e=>e.workspaceId!==i.workspaceId)).length?r.push({label:"Switch Workspace",submenu:Lt(i,s,u.SwitchWorkspace)},{label:"Delete Workspace",submenu:Lt(i,s,u.DeleteWorkspace)}):r.push({label:"Switch Workspace",enabled:!1},{label:"Delete Workspace",enabled:!1}),t?[...r,...xt]:[...r,...Mt]};var $t,Dt;!function(e){e.HomeIndex="/home/",e.HomeSearch="/home/search/",e.HomePagesRename="/home/pages/rename/",e.Dock="/home/dock/",e.BrowserPagesLanding="/browser/pages/landing/",e.HomeIndicator="/home/indicator/",e.Browser="/browser/",e.BrowserPopupMenu="/browser/popup-menu/",e.Provider="/provider/",e.BrowserPopupMenuSharePage="/browser/popup-menu/share-page/",e.BrowserPopupMenuSaveModal="/browser/popup-menu/save-modal/",e.BrowserPopupMenuLayouts="/browser/popup-menu/layouts/layouts/",e.BrowserPopupMenuColorLinking="/browser/popup-menu/color-linking/color-linking/",e.BrowserIndicator="/browser/indicator/",e.ResponseModal="/browser/popup-menu/response-modal/",e.Docs="/provider/docs/",e.Storefront="/storefront/",e.DeprecatedAlert="/provider/deprecated-alert/"}($t||($t={})),function(e){e.IconOpenFinLogo="/icons/openfinlogo.svg",e.IconFilter="/icons/filter.svg"}(Dt||(Dt={}));const Ut={...Dt,...$t};var jt,Ft;!function(e){e.ERROR="error",e.SUCCESS="success",e.INFO="info"}(jt||(jt={})),function(e){e.Home="/home",e.Browser="/browser",e.Provider="/provider",e.Storefront="/storefront"}(Ft||(Ft={}));const Vt="/workspace/7.1.0";function Bt(){return Vt.substring(0,Vt.length-"".length)}function Gt(e){if(!v)throw new Error("getAbsoluteRoutePath can only be used in a window");return function(){if(!window)throw new Error("getAbsoluteBasePath can only be used in a window");return`${window.origin}${Bt()}`}()+e}var qt,Ht=a(677);!function(e){e.RouteChangeComplete="routeChangeComplete"}(qt||(qt={}));new Promise((e=>Ht.default.ready(e)));const zt={alwaysOnTop:!0,autoShow:!1,cornerRounding:{height:5,width:5},frame:!1,resizable:!1,showTaskbarIcon:!1};var Xt;!function(e){e.Locked="LockClosedIcon",e.Unlocked="LockOpen1Icon"}(Xt||(Xt={}));const Kt=function(e=zt){const t=new Map;return async(a,n,r,o)=>{if(t.has(a)){const{currentUrl:e,currentName:r}=t.get(a);if(e===n)return;const o=fin.Window.wrapSync({uuid:fin.me.uuid,name:r});await o.close()}const i=`${M.HomeInternal}-${Date.now()}${Math.random()}`;t.set(a,{currentUrl:n,currentName:i});const s=await fin.Platform.getCurrentSync().createWindow({...e,name:i,url:n});((e,t)=>{const a=document.createElement("div");a.setAttribute("aria-live",t||"polite"),(e=>{e.style.position="absolute",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="-1px",e.style.overflow="hidden",e.style.whiteSpace="nowrap",e.style.border="0"})(a),document.body.appendChild(a),setTimeout((()=>{a.innerHTML=e}),100),setTimeout((()=>{document.body.removeChild(a)}),1e3)})(`New ${o} indicator: ${r}`),s.once("closed",(()=>{t.delete(a)}))}}();async function Qt(e,t,a,n){const r=new URLSearchParams;r.append("type",e),r.append("message",t),r.append("parentName",a),r.append("icon",n||"");const o=`${Gt(Ut.BrowserIndicator)}?${r.toString()}`;return Kt("browser"+a,o,t,e)}function Yt(e,t,a){return Qt(jt.SUCCESS,e,t,a)}const Jt=async(e,t)=>{if(!e)return;const a=t.identity,n=await Ee(a),r=Ot().Browser.wrapSync(t.identity),o=(await r.getPages()).find((e=>e.isActive)),i=e,s=Ot(),c=await s.Storage.getWorkspaces();switch(e.type){case u.NewWindow:const{newPageUrl:f}=await It(a);if(!f)throw new Error("Trying to create a new empty window without a newPageUrl set");Ot().createView({target:void 0,url:f});break;case u.NewPage:await(async e=>{const t=await Tt(e);await Ot().Browser.wrapSync(e).addPage(t)})(a);break;case u.CloseWindow:n.dispatch(ke.CloseBrowserWindow);break;case u.SavePage:if((await Ot().Storage.getPages()).some((e=>o.pageId===e.pageId)))try{await Ot().Storage.savePage((h=o,{...h,hasUnsavedChanges:void 0,parentIdentity:void 0,isActive:void 0})),await r.updatePage({pageId:o.pageId,page:{hasUnsavedChanges:!1}}),Yt("Page saved",o.parentIdentity.name)}catch{l="Page failed to save",p=o.parentIdentity.name,Qt(jt.ERROR,l,p,d)}else Ot().Browser.wrapSync(t.identity)._openSaveModal({id:o.pageId,menuType:g.SAVE_PAGE});break;case u.SavePageAs:Ot().Browser.wrapSync(t.identity)._openSaveModal({id:o.pageId,menuType:g.SAVE_PAGE_AS});break;case u.SwitchWorkspace:const y=c.find((e=>e.workspaceId===i.workspaceId));y&&(await s.applyWorkspace(y),Yt("Workspace Switched!",a.name));break;case u.DeleteWorkspace:c.some((e=>e.workspaceId===i.workspaceId))&&(await s.Storage.deleteWorkspace(i.workspaceId),Yt("Workspace Deleted!",a.name));break;case u.Quit:n.dispatch(ke.QuitPlatform);break;case u.OpenStorefront:(async()=>{await G()&&j(U)})();break;case u.Custom:if(e.action){const t={callerType:w.GlobalContextMenu,windowIdentity:a,customData:e.action.customData};Ot()._invokeCustomAction(e.action.id,t)}}var l,p,d,h},Zt=async(e,t)=>{const a=await Ee(t.identity),n=Ot();switch(e.type){case p.Save:await n.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.SAVE_PAGE,id:t.pageId});break;case p.SaveAs:await n.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.SAVE_PAGE_AS,id:t.pageId});break;case p.Rename:await n.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.RENAME_PAGE,id:t.pageId});break;case p.Duplicate:a.dispatch(ke.DuplicatePage,t.pageId);break;case p.Close:a.dispatch(ke.ClosePage,t.pageId);break;case p.Custom:if(e.action){const a={callerType:w.PageTabContextMenu,windowIdentity:t.identity,pageId:t.pageId,customData:e.action.customData};Ot()._invokeCustomAction(e.action.id,a)}}},ea=async(e,t)=>{if(e?.type){const a=Ot();switch(e.type){case f.SavePage:await a.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.SAVE_PAGE,id:t.pageId,x:t.buttonLeft+t.buttonWidth/2-St/2,y:t.y});break;case f.SaveWorkspace:await a.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.SAVE_WORKSPACE,x:t.buttonLeft+t.buttonWidth/2-St/2,y:t.y});break;case f.Custom:if(e.action){const a={callerType:w.SaveButtonContextMenu,windowIdentity:t.identity,pageId:t.pageId,customData:e.action.customData};Ot()._invokeCustomAction(e.action.id,a)}}}},ta=async(e,t)=>{const a=t.selectedViews[0],n=fin.View.wrapSync(a),r=await(async e=>{const{newTabUrl:t}=await It(e);if(!t)throw new Error("Trying to create a new page without a newTabUrl set");return{...Pe("New View",t),url:t,target:e}})(e);await Ot().createView(r,e,n.identity)},aa=async(e,t)=>{const a=await(e=>Promise.all(e.map((async e=>fin.View.wrapSync(e).getInfo()))))(t),{newPageUrl:n,newTabUrl:r}=await It(e);a.forEach((async e=>{e.url!==n&&e.url!==r&&await fin.System.openUrlWithBrowser(e.url)}))},na=(e,t)=>{t.forEach((async t=>{const a=fin.View.wrapSync(t);await(async(e,t)=>{const{url:a}=await t.getInfo(),n={...await t.getOptions(),url:a,target:e,name:void 0};await Ot().createView(n,e,t.identity)})(e,a)}))},ra=async(e,t)=>{if(!e)return;const a=t.identity;switch(e.type){case d.CloseViews:await(async(e,t)=>{if((await fin.Window.wrapSync(e).getCurrentViews()).length!==t.length)t.forEach((async e=>{const t=fin.View.wrapSync(e);await t.destroy()}));else{const t=(await Ot().Browser.wrapSync(e).getPages()).find((e=>e.isActive));(await Ee(e)).dispatch(ke.ClosePage,t?.pageId)}})(a,t.selectedViews);break;case d.OpenWithDefaultBrowser:await aa(a,t.selectedViews);break;case d.ReloadViews:t.selectedViews.forEach((async e=>{const t=fin.View.wrapSync(e);await t.reload()}));break;case d.NewView:await ta(a,t);break;case d.DuplicateViews:na(a,t.selectedViews);break;case d.AddToChannel:(async(e,t,a)=>{const n={newChannelId:t,selectedViews:a};(await Ee(e)).dispatch(ke.AddToChannel,n)})(a,e.option,t.selectedViews);break;case d.RemoveFromChannel:(async(e,t)=>{(await Ee(e)).dispatch(ke.RemoveFromChannel,t)})(a,t.selectedViews);break;case d.Custom:if(e.action){const n={callerType:w.ViewTabContextMenu,windowIdentity:a,selectedViews:t.selectedViews,customData:e.action.customData};Ot()._invokeCustomAction(e.action.id,n)}}};async function oa(e,t){const a=await Nt(e.identity),n={...e,template:a,callback:Jt};await this.openGlobalContextMenu(n,t)}const ia=async(e,t)=>{const{x:a,y:n,identity:r,template:o,callback:i}=e,{data:s}=await function(e,t){if(!m)throw new Error("showContextMenu can only be used in an OpenFin env. Avoid calling this method during pre-rendering.");if(!t&&!fin.me.isWindow)throw new Error("showContextMenu can only be used in an OpenFin window.");return(t||fin.Window.getCurrentSync()).showPopupMenu(e)}({x:a,y:n,template:o},fin.Window.wrapSync(r));i(s,e)};async function sa(e,t){const a={...e,callback:ra};await this.openViewTabContextMenu(a,t)}async function ca(e,t){const a=await Ot().Storage.getPage(e.pageId),n=await(r=!!a,[{type:Pt.Label,label:"Save Page",data:{type:p.Save}},{type:Pt.Label,label:"Save Page As",data:{type:p.SaveAs}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Rename Page",data:{type:p.Rename},enabled:r},{type:Pt.Label,label:"Duplicate Page",data:{type:p.Duplicate}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Close Page",data:{type:p.Close}}]);var r;const o={...e,template:n,callback:Zt};await this.openPageTabContextMenu(o,t)}async function la(e,t){const a={...e,template:await([{type:Pt.Label,label:"Save Workspace",data:{type:f.SaveWorkspace}},{type:Pt.Label,label:"Save Page",data:{type:f.SavePage}}]),callback:ea};await this.openSaveButtonContextMenu(a,t)}const ua=P&&it("openfin-workspace-platform-workspaces","workspaces");async function pa(e){const t=await ct(e,ua);return t?(t.workspaceId=e.toString(),t.title=t.title||t.workspaceId,t):null}async function da(e){const t=await dt(ua),a=await Promise.all(t.map((e=>pa(e.toString()))));return e?a.filter((t=>ht(t.title,e))):a}async function ha({workspace:e}){await lt(e.workspaceId,e,ua)}async function fa(e){await ut(e,ua)}async function wa({workspaceId:e,workspace:t}){if(void 0===await pa(e))throw new Error("workspace not found");await ha({workspace:t}),e!==t.workspaceId&&await fa(e)}async function ga({app:e,target:t}){const a=fin.Platform.getCurrentSync();switch(e.manifestType){case s.Snapshot:return a.applySnapshot(e.manifest);case s.View:return async function(e,t){const a=fin.Platform.getCurrentSync();if("view"===t.entityType){const a=fin.View.wrapSync(t),n=await a.getParentLayout();return await n.replaceView(t,{manifestUrl:e.manifest,url:void 0,target:void 0}),a.destroy()}return a.createView({name:void 0,url:void 0,manifestUrl:e.manifest,target:void 0})}(e,t);case s.External:return fin.System.launchExternalProcess({path:e.manifest,uuid:e.appId});default:return fin.Application.startFromManifest(e.manifest)}}const ya=e=>e&&"object"==typeof e&&!Array.isArray(e);function ma(e,...t){if(!t.length)return e;const a=t.shift();return ya(e)&&ya(a)&&Object.entries(a).forEach((([t,a])=>{if(ya(a))return e[t]||(e[t]={}),ma(e[t],a);e[t]=a})),ma(e,...t)}const va=k+Ut.Browser;function Pa(e,t){const a=ma({},t,e);return a.detachOnClose=!0,a}async function Sa(e,t,a){const n=e.manifestUrl?await t({manifestUrl:e.manifestUrl},a):void 0;if(n?.interop&&e.interop){const t={...e,...n,interop:e.interop};return delete t.manifestUrl,t}return e}const _a=e=>{const t=e.name===M.Home,a=e.name?.startsWith(M.HomeInternal),n=e.name?.startsWith(M.BrowserMenu);return!t&&!a&&!n},ba=e=>"workspacePlatform"in e?e:(({workstacks:e,pages:t,...a})=>({...a,workspacePlatform:{pages:t||e||null}}))(e),Ca={contextMenuSettings:{reload:!1},backgroundThrottling:!0,url:va,contextMenu:!0,cornerRounding:{height:8,width:8},closeOnLastViewRemoved:!1,experimental:{showFavicons:!0,defaultFaviconUrl:`${k}/icons/defaultFavicon.svg`},permissions:{System:{openUrlWithBrowser:{enabled:!0,protocols:["mailto"]}}}},Ea={dimensions:{borderWidth:3,headerHeight:30}},ka=(e,t)=>t?e.map((e=>({...t,...e}))):e,Ra=e=>{const t=fin.Window.wrapSync(e);return Promise.all([t.bringToFront(),t.restore(),t.focus()])};async function Wa(e){const t=await V();return await Promise.all(t.map((({identity:e})=>(async e=>(await Ee(e)).dispatch(Re.UpdatePagesWindowOptions))(e)))),e?e():rt()}let Aa=[];const Oa=()=>Aa;const Ia=e=>async t=>{class a extends t{constructor(){super(),this.isWorkspacePlatform=()=>!0,this.addPage=this.attachPagesToWindow,this.detachPagesFromWindow=Fe,this.getAllAttachedPages=Ie,this.getPagesForWindow=Be,this.getPageForWindow=Ge,this.setActivePage=Ve,this.launchApp=ga,this.savePage=De,this.saveWorkspace=he,this.createSavedPageInternal=Le,this.updateSavedPageInternal=$e,this.deleteSavedPageInternal=Ne,this.reorderPagesForWindow=qe,this.getUniquePageTitle=He,this.updatePageForWindow=je,this.getLastFocusedBrowserWindow=we,this.getThemes=Oa,this.invokeCustomActionInternal=Ze,this.getCurrentWorkspace=de,this.applyWorkspace=le,this.setActiveWorkspace=ue,this.openGlobalContextMenuInternal=this.openGlobalContextMenuInternal.bind(this),this.openGlobalContextMenu=this.openGlobalContextMenu.bind(this),this.getSavedPages=this.getSavedPages.bind(this),this.getSavedPage=this.getSavedPage.bind(this),this.createSavedPage=this.createSavedPage.bind(this),this.updateSavedPage=this.updateSavedPage.bind(this),this.deleteSavedPage=this.deleteSavedPage.bind(this),this.attachPagesToWindow=this.attachPagesToWindow.bind(this),this.openViewTabContextMenuInternal=this.openViewTabContextMenuInternal.bind(this),this.openViewTabContextMenu=this.openViewTabContextMenu.bind(this),this.openPageTabContextMenuInternal=this.openPageTabContextMenuInternal.bind(this),this.openPageTabContextMenu=this.openPageTabContextMenu.bind(this),this.getSavedWorkspaces=this.getSavedWorkspaces.bind(this),this.getSavedWorkspace=this.getSavedWorkspace.bind(this),this.createSavedWorkspace=this.createSavedWorkspace.bind(this),this.updateSavedWorkspace=this.updateSavedWorkspace.bind(this),this.deleteSavedWorkspace=this.deleteSavedWorkspace.bind(this),this.getCurrentWorkspace=this.getCurrentWorkspace.bind(this),this.applyWorkspace=this.applyWorkspace.bind(this),this.setActiveWorkspace=this.setActiveWorkspace.bind(this),this.openSaveButtonContextMenu=this.openSaveButtonContextMenu.bind(this),this.openSaveButtonContextMenuInternal=this.openSaveButtonContextMenuInternal.bind(this)}async getSnapshot(){const e=await Wa((async()=>rt(await super.getSnapshot(void 0,fin.me.identity))));return{...e,windows:e.windows.filter(_a)}}async applySnapshot({snapshot:e,options:t}){t?.closeExistingWindows&&await async function(){const e=await V();await Promise.all(e.map((e=>e.close(!0).catch((()=>{})))))}();let a=e;return"string"==typeof a&&(a=await super.fetchManifest({manifestUrl:a},fin.me.identity)),async function(e,t){const a=await Ie(),n=e.snapshotDetails?.monitorInfo||await fin.System.getMonitorInfo(),r=(e.windows||[]).filter((({layout:e})=>!!e)),o=new Map;a.forEach((e=>o.set(e.pageId,e)));const i=[],s=r.map((async e=>{const t=ba(e),a=[],n=(e=>{let t=!1;const a=(e||[]).map((e=>{const a=function({id:e,name:t,...a}){return{pageId:e,title:t,...a}}(e);return t&&a.isActive&&(a.isActive=!1),a.isActive&&(t=!0),a}));return!t&&a.length&&(a[0].isActive=!0),a})(t?.workspacePlatform?.pages);if(!n?.length){const e=await He();a.push(await bt(e,t.layout))}let r;n.forEach((e=>{const t=o.get(e.pageId);t?r=t:a.push(e)})),r&&await Promise.all([Ve({identity:r.parentIdentity,pageId:r.pageId}),Ra(r.parentIdentity)]),a.length&&i.push({...t,workspacePlatform:{...t.workspacePlatform,pages:a}})}));if(await Promise.all(s),!i.length)return;const c=fin.Platform.getCurrentSync();return(t||c.applySnapshot.bind(c))({...e,snapshotDetails:{...e.snapshotDetails,monitorInfo:n},windows:i})}(a,(e=>super.applySnapshot({snapshot:e,options:{...t,closeExistingWindows:!1}})))}async createWindow(t,a){let n=ba(t);const r=await this.getThemes();n=((e,t,a)=>{let n=e;const r=n?.workspacePlatform?.pages;if(r){const e=r.find((e=>e.isActive));e?n.layout=e.layout:(r[0].isActive=!0,n.layout=r[0].layout)}if(n.layout){if(n=ma({},t.defaultWindowOptions,n,Ca),n.layout=ma(n.layout,Ea),(n.icon||n.taskbarIcon)&&(n.taskbarIconGroup=n.taskbarIconGroup||fin.me.identity.uuid),!n.backgroundColor){const e=a?.palette;n.backgroundColor=e?.background2||e?.backgroundPrimary}const e=n.workspacePlatform.newTabUrl;e&&(n.layout.settings||(n.layout.settings={}),n.layout.settings.newTabButton={url:e}),n=(e=>{const t=e;return t.workspacePlatform||(t.workspacePlatform={}),t.workspacePlatform._internalDeferShowEnabled=!0,t.workspacePlatform._internalAutoShow=t.workspacePlatform?._internalAutoShow||void 0===t.autoShow||t.autoShow,t.autoShow=!1,t})(n)}return n.workspacePlatform?.pages&&(n.workspacePlatform.pages=ka(n.workspacePlatform.pages,t?.defaultPageOptions)),n})(n,e,r[0]),n=await(async e=>{const t=await fin.System.getMonitorInfo(),a=t.primaryMonitor.availableRect.bottom-t.primaryMonitor.availableRect.top,n=t.primaryMonitor.availableRect.right-t.primaryMonitor.availableRect.left;return e.defaultHeight=e.defaultHeight||"800",e.defaultWidth=e.defaultWidth||"800",a<e.defaultHeight&&(e.defaultHeight=a),n<e.defaultWidth&&(e.defaultWidth=n),e})(n);return(e=>async(t,a)=>{const n=await e(t,a);return t?.workspacePlatform?._internalDeferShowEnabled?(await n.addListener(L.ShowRequested,(()=>{})),n):n})(((e,t)=>super.createWindow(e,t)))(n,a)}async createView(t,a){return t.opts=Pa(t.opts,e?.defaultViewOptions),t.opts=await Sa(t.opts,this.fetchManifest,a),super.createView(t,a)}async replaceView(t,a){return t.opts.newView=await Pa(t.opts.newView,e?.defaultViewOptions),t.opts.newView=await Sa(t.opts.newView,this.fetchManifest,a),super.replaceView(t,a)}async replaceLayout(e,t){return e.opts.layout?.dimensions,super.replaceLayout(e,t)}async closeView(e,t){const a=fin.View.wrapSync(e.view);await super.closeView(e,t),await a.destroy().catch((e=>e))}async getSavedPage(...e){return wt.apply(this,e)}async getSavedPages(...e){return gt.apply(this,e)}async createSavedPage(...e){return yt.apply(this,e)}async deleteSavedPage(...e){return mt.apply(this,e)}async updateSavedPage(...e){return vt.apply(this,e)}async getSavedWorkspace(...e){return pa.apply(this,e)}async getSavedWorkspaces(...e){return da.apply(this,e)}async createSavedWorkspace(...e){return ha.apply(this,e)}async deleteSavedWorkspace(...e){return fa.apply(this,e)}async updateSavedWorkspace(...e){return wa.apply(this,e)}async attachPagesToWindow(t){t.pages=ka(t.pages,e?.defaultPageOptions),await Ue(t)}async openGlobalContextMenuInternal(...e){return oa.apply(this,e)}async openGlobalContextMenu(...e){return ia.apply(this,e)}async openViewTabContextMenuInternal(...e){return sa.apply(this,e)}async openViewTabContextMenu(...e){return ia.apply(this,e)}async openPageTabContextMenuInternal(...e){return ca.apply(this,e)}async openPageTabContextMenu(...e){return ia.apply(this,e)}async openSaveButtonContextMenu(...e){return ia.apply(this,e)}async openSaveButtonContextMenuInternal(...e){return la.apply(this,e)}}return"function"==typeof e?.overrideCallback?e.overrideCallback(a):new a};async function Ta(){Ye(),async function(){const e=fin.Application.getCurrentSync();await e.addListener("window-focused",ge)}();ue(await pe())}let xa;function Ma(e){if(!m)throw new Error("Cannot be used outside an OpenFin env.");if(!xa){fin.Platform.getCurrentSync().once("platform-api-ready",(()=>Ta())),xa=fin.Platform.init({overrideCallback:Ia(e),interopOverride:e?.interopOverride}),(async e=>{H(q.Platform,e)})({allowed:!0})}return xa}const La=async e=>{const t=R.split(".").map((e=>parseInt(e))),a=await(async e=>new Promise((async t=>{const a=(await fin.System.getVersion()).split(".").map((e=>parseInt(e)));t(e.every(((t,n)=>!(n<3)||a[n]===e[n])))})))(t),n=e?.theme;var r;if(n&&((r=n).forEach((e=>{const t=e.palette.backgroundPrimary;if(!t.includes("#")&&!t.includes("rgb")&&!t.includes("hsl"))throw new Error("Background primary color is not the right format.")})),Aa=r,(async e=>{H(q.Theming,e)})({allowed:!0})),e?.customActions&&(Je=e?.customActions),a){return Ma(e?.browser)}throw new Error(`Runtime version is not supported. ${t[0]}.${t[1]}.${t[2]}.* is required`)}})(),module.exports=n})();
|
|
2
|
+
(()=>{var e={421:(e,t)=>{"use strict";function a(e){return e.endsWith("/")&&"/"!==e?e.slice(0,-1):e}Object.defineProperty(t,"__esModule",{value:!0}),t.removePathTrailingSlash=a,t.normalizePathTrailingSlash=void 0;const n=process.env.__NEXT_TRAILING_SLASH?e=>/\.[^/]+\/?$/.test(e)?a(e):e.endsWith("/")?e:e+"/":a;t.normalizePathTrailingSlash=n},644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelIdleCallback=t.requestIdleCallback=void 0;const a="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})}),1)};t.requestIdleCallback=a;const n="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};t.cancelIdleCallback=n},37:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markAssetError=l,t.isAssetError=function(e){return e&&c in e},t.getClientBuildManifest=p,t.getMiddlewareManifest=function(){if(self.__MIDDLEWARE_MANIFEST)return Promise.resolve(self.__MIDDLEWARE_MANIFEST);return u(new Promise((e=>{const t=self.__MIDDLEWARE_MANIFEST_CB;self.__MIDDLEWARE_MANIFEST_CB=()=>{e(self.__MIDDLEWARE_MANIFEST),t&&t()}})),o,l(new Error("Failed to load client middleware manifest")))},t.createRouteLoader=function(e){const t=new Map,a=new Map,n=new Map,c=new Map;function p(e){{let t=a.get(e);return t||(document.querySelector(`script[src^="${e}"]`)?Promise.resolve():(a.set(e,t=function(e,t){return new Promise(((a,n)=>{(t=document.createElement("script")).onload=a,t.onerror=()=>n(l(new Error(`Failed to load script: ${e}`))),t.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,t.src=e,document.body.appendChild(t)}))}(e)),t))}}function h(e){let t=n.get(e);return t||(n.set(e,t=fetch(e).then((t=>{if(!t.ok)throw new Error(`Failed to load stylesheet: ${e}`);return t.text().then((t=>({href:e,content:t})))})).catch((e=>{throw l(e)}))),t)}return{whenEntrypoint:e=>i(e,t),onEntrypoint(e,a){(a?Promise.resolve().then((()=>a())).then((e=>({component:e&&e.default||e,exports:e})),(e=>({error:e}))):Promise.resolve(void 0)).then((a=>{const n=t.get(e);n&&"resolve"in n?a&&(t.set(e,a),n.resolve(a)):(a?t.set(e,a):t.delete(e),c.delete(e))}))},loadRoute(a,n){return i(a,c,(()=>u(d(e,a).then((({scripts:e,css:n})=>Promise.all([t.has(a)?[]:Promise.all(e.map(p)),Promise.all(n.map(h))]))).then((e=>this.whenEntrypoint(a).then((t=>({entrypoint:t,styles:e[1]}))))),o,l(new Error(`Route did not complete loading: ${a}`))).then((({entrypoint:e,styles:t})=>{const a=Object.assign({styles:t},e);return"error"in e?e:a})).catch((e=>{if(n)throw e;return{error:e}})).finally((()=>{}))))},prefetch(t){let a;return(a=navigator.connection)&&(a.saveData||/2g/.test(a.effectiveType))?Promise.resolve():d(e,t).then((e=>Promise.all(s?e.scripts.map((e=>{return t=e,a="script",new Promise(((e,r)=>{const o=`\n link[rel="prefetch"][href^="${t}"],\n link[rel="preload"][href^="${t}"],\n script[src^="${t}"]`;if(document.querySelector(o))return e();n=document.createElement("link"),a&&(n.as=a),n.rel="prefetch",n.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,n.onload=e,n.onerror=r,n.href=t,document.head.appendChild(n)}));var t,a,n})):[]))).then((()=>{r.requestIdleCallback((()=>this.loadRoute(t,!0).catch((()=>{}))))})).catch((()=>{}))}}};(n=a(705))&&n.__esModule;var n,r=a(644);const o=3800;function i(e,t,a){let n,r=t.get(e);if(r)return"future"in r?r.future:Promise.resolve(r);const o=new Promise((e=>{n=e}));return t.set(e,r={resolve:n,future:o}),a?a().then((e=>(n(e),e))).catch((a=>{throw t.delete(e),a})):o}const s=function(e){try{return e=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||e.relList.supports("prefetch")}catch(e){return!1}}();const c=Symbol("ASSET_LOAD_ERROR");function l(e){return Object.defineProperty(e,c,{})}function u(e,t,a){return new Promise(((n,o)=>{let i=!1;e.then((e=>{i=!0,n(e)})).catch(o),r.requestIdleCallback((()=>setTimeout((()=>{i||o(a)}),t)))}))}function p(){if(self.__BUILD_MANIFEST)return Promise.resolve(self.__BUILD_MANIFEST);return u(new Promise((e=>{const t=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{e(self.__BUILD_MANIFEST),t&&t()}})),o,l(new Error("Failed to load client build manifest")))}function d(e,t){return p().then((a=>{if(!(t in a))throw l(new Error(`Failed to lookup route: ${t}`));const n=a[t].map((t=>e+"/_next/"+encodeURI(t)));return{scripts:n.filter((e=>e.endsWith(".js"))),css:n.filter((e=>e.endsWith(".css")))}}))}},236:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Router",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"withRouter",{enumerable:!0,get:function(){return i.default}}),t.useRouter=function(){return n.default.useContext(o.RouterContext)},t.createRouter=function(...e){return c.router=new r.default(...e),c.readyCallbacks.forEach((e=>e())),c.readyCallbacks=[],c.router},t.makePublicRouterInstance=function(e){const t=e,a={};for(const e of l)"object"!=typeof t[e]?a[e]=t[e]:a[e]=Object.assign(Array.isArray(t[e])?[]:{},t[e]);return a.events=r.default.events,u.forEach((e=>{a[e]=(...a)=>t[e](...a)})),a},t.default=void 0;var n=s(a(378)),r=s(a(765)),o=a(876),i=(s(a(16)),s(a(58)));function s(e){return e&&e.__esModule?e:{default:e}}const c={router:null,readyCallbacks:[],ready(e){if(this.router)return e();"undefined"!=typeof window&&this.readyCallbacks.push(e)}},l=["pathname","route","query","asPath","components","isFallback","basePath","locale","locales","defaultLocale","isReady","isPreview","isLocaleDomain","domainLocales"],u=["push","replace","reload","back","prefetch","beforePopState"];function p(){if(!c.router){throw new Error('No router instance found.\nYou should only use "next/router" on the client side of your app.\n')}return c.router}Object.defineProperty(c,"events",{get:()=>r.default.events}),l.forEach((e=>{Object.defineProperty(c,e,{get:()=>p()[e]})})),u.forEach((e=>{c[e]=(...t)=>p()[e](...t)})),["routeChangeStart","beforeHistoryChange","routeChangeComplete","routeChangeError","hashChangeStart","hashChangeComplete"].forEach((e=>{c.ready((()=>{r.default.events.on(e,((...t)=>{const a=`on${e.charAt(0).toUpperCase()}${e.substring(1)}`,n=c;if(n[a])try{n[a](...t)}catch(e){}}))}))}));var d=c;t.default=d},58:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t){return r.default.createElement(e,Object.assign({router:o.useRouter()},t))}t.getInitialProps=e.getInitialProps,t.origGetInitialProps=e.origGetInitialProps,!1;return t};var n,r=(n=a(378))&&n.__esModule?n:{default:n},o=a(236)},173:(e,t)=>{"use strict";function a(e,t){void 0===t&&(t={});for(var a=function(e){for(var t=[],a=0;a<e.length;){var n=e[a];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:a,value:e[a++]});else{var r=1,o="";if("?"===e[s=a+1])throw new TypeError('Pattern cannot start with "?" at '+s);for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--r){s++;break}}else if("("===e[s]&&(r++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at "+s);o+=e[s++]}else o+=e[s++]+e[s++];if(r)throw new TypeError("Unbalanced pattern at "+a);if(!o)throw new TypeError("Missing pattern at "+a);t.push({type:"PATTERN",index:a,value:o}),a=s}else{for(var i="",s=a+1;s<e.length;){var c=e.charCodeAt(s);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;i+=e[s++]}if(!i)throw new TypeError("Missing parameter name at "+a);t.push({type:"NAME",index:a,value:i}),a=s}else t.push({type:"CLOSE",index:a,value:e[a++]});else t.push({type:"OPEN",index:a,value:e[a++]});else t.push({type:"ESCAPED_CHAR",index:a++,value:e[a++]});else t.push({type:"MODIFIER",index:a,value:e[a++]})}return t.push({type:"END",index:a,value:""}),t}(e),n=t.prefixes,r=void 0===n?"./":n,i="[^"+o(t.delimiter||"/#?")+"]+?",s=[],c=0,l=0,u="",p=function(e){if(l<a.length&&a[l].type===e)return a[l++].value},d=function(e){var t=p(e);if(void 0!==t)return t;var n=a[l],r=n.type,o=n.index;throw new TypeError("Unexpected "+r+" at "+o+", expected "+e)},h=function(){for(var e,t="";e=p("CHAR")||p("ESCAPED_CHAR");)t+=e;return t};l<a.length;){var f=p("CHAR"),w=p("NAME"),g=p("PATTERN");if(w||g){var y=f||"";-1===r.indexOf(y)&&(u+=y,y=""),u&&(s.push(u),u=""),s.push({name:w||c++,prefix:y,suffix:"",pattern:g||i,modifier:p("MODIFIER")||""})}else{var m=f||p("ESCAPED_CHAR");if(m)u+=m;else if(u&&(s.push(u),u=""),p("OPEN")){y=h();var v=p("NAME")||"",P=p("PATTERN")||"",S=h();d("CLOSE"),s.push({name:v||(P?c++:""),pattern:v&&!P?i:P,prefix:y,suffix:S,modifier:p("MODIFIER")||""})}else d("END")}}return s}function n(e,t){void 0===t&&(t={});var a=i(t),n=t.encode,r=void 0===n?function(e){return e}:n,o=t.validate,s=void 0===o||o,c=e.map((function(e){if("object"==typeof e)return new RegExp("^(?:"+e.pattern+")$",a)}));return function(t){for(var a="",n=0;n<e.length;n++){var o=e[n];if("string"!=typeof o){var i=t?t[o.name]:void 0,l="?"===o.modifier||"*"===o.modifier,u="*"===o.modifier||"+"===o.modifier;if(Array.isArray(i)){if(!u)throw new TypeError('Expected "'+o.name+'" to not repeat, but got an array');if(0===i.length){if(l)continue;throw new TypeError('Expected "'+o.name+'" to not be empty')}for(var p=0;p<i.length;p++){var d=r(i[p],o);if(s&&!c[n].test(d))throw new TypeError('Expected all "'+o.name+'" to match "'+o.pattern+'", but got "'+d+'"');a+=o.prefix+d+o.suffix}}else if("string"!=typeof i&&"number"!=typeof i){if(!l){var h=u?"an array":"a string";throw new TypeError('Expected "'+o.name+'" to be '+h)}}else{d=r(String(i),o);if(s&&!c[n].test(d))throw new TypeError('Expected "'+o.name+'" to match "'+o.pattern+'", but got "'+d+'"');a+=o.prefix+d+o.suffix}}else a+=o}return a}}function r(e,t,a){void 0===a&&(a={});var n=a.decode,r=void 0===n?function(e){return e}:n;return function(a){var n=e.exec(a);if(!n)return!1;for(var o=n[0],i=n.index,s=Object.create(null),c=function(e){if(void 0===n[e])return"continue";var a=t[e-1];"*"===a.modifier||"+"===a.modifier?s[a.name]=n[e].split(a.prefix+a.suffix).map((function(e){return r(e,a)})):s[a.name]=r(n[e],a)},l=1;l<n.length;l++)c(l);return{path:o,index:i,params:s}}}function o(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function i(e){return e&&e.sensitive?"":"i"}function s(e,t,a){void 0===a&&(a={});for(var n=a.strict,r=void 0!==n&&n,s=a.start,c=void 0===s||s,l=a.end,u=void 0===l||l,p=a.encode,d=void 0===p?function(e){return e}:p,h="["+o(a.endsWith||"")+"]|$",f="["+o(a.delimiter||"/#?")+"]",w=c?"^":"",g=0,y=e;g<y.length;g++){var m=y[g];if("string"==typeof m)w+=o(d(m));else{var v=o(d(m.prefix)),P=o(d(m.suffix));if(m.pattern)if(t&&t.push(m),v||P)if("+"===m.modifier||"*"===m.modifier){var S="*"===m.modifier?"?":"";w+="(?:"+v+"((?:"+m.pattern+")(?:"+P+v+"(?:"+m.pattern+"))*)"+P+")"+S}else w+="(?:"+v+"("+m.pattern+")"+P+")"+m.modifier;else w+="("+m.pattern+")"+m.modifier;else w+="(?:"+v+P+")"+m.modifier}}if(u)r||(w+=f+"?"),w+=a.endsWith?"(?="+h+")":"$";else{var _=e[e.length-1],b="string"==typeof _?f.indexOf(_[_.length-1])>-1:void 0===_;r||(w+="(?:"+f+"(?="+h+"))?"),b||(w+="(?="+f+"|"+h+")")}return new RegExp(w,i(a))}function c(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;var a=e.source.match(/\((?!\?)/g);if(a)for(var n=0;n<a.length;n++)t.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return e}(e,t):Array.isArray(e)?function(e,t,a){var n=e.map((function(e){return c(e,t,a).source}));return new RegExp("(?:"+n.join("|")+")",i(a))}(e,t,n):function(e,t,n){return s(a(e,n),t,n)}(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=a,t.compile=function(e,t){return n(a(e,t),t)},t.tokensToFunction=n,t.match=function(e,t){var a=[];return r(c(e,a,t),a,t)},t.regexpToFunction=r,t.tokensToRegexp=s,t.pathToRegexp=c},16:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,t.getProperError=function(e){if(r(e))return e;0;return new Error(n.isPlainObject(e)?JSON.stringify(e):e+"")};var n=a(332);function r(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}},709:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePathSep=r,t.denormalizePagePath=function(e){(e=r(e)).startsWith("/index/")&&!n.isDynamicRoute(e)?e=e.slice(6):"/index"===e&&(e="/");return e};var n=a(720);function r(e){return e.replace(/\\/g,"/")}},294:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeStringRegexp=function(e){return e.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")}},723:(e,t)=>{"use strict";t.D=function(e,t,a){let n;if(e){a&&(a=a.toLowerCase());for(const i of e){var r,o;const e=null===(r=i.domain)||void 0===r?void 0:r.split(":")[0].toLowerCase();if(t===e||a===i.defaultLocale.toLowerCase()||(null===(o=i.locales)||void 0===o?void 0:o.some((e=>e.toLowerCase()===a)))){n=i;break}}}return n}},559:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeLocalePath=function(e,t){let a;const n=e.split("/");return(t||[]).some((t=>!(!n[1]||n[1].toLowerCase()!==t.toLowerCase())&&(a=t,n.splice(1,1),e=n.join("/")||"/",!0))),{pathname:e,detectedLocale:a}}},332:(e,t)=>{"use strict";function a(e){return Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getObjectClassLabel=a,t.isPlainObject=function(e){if("[object Object]"!==a(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}},564:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=Object.create(null);return{on(t,a){(e[t]||(e[t]=[])).push(a)},off(t,a){e[t]&&e[t].splice(e[t].indexOf(a)>>>0,1)},emit(t,...a){(e[t]||[]).slice().map((e=>{e(...a)}))}}}},876:(e,t,a)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.RouterContext=void 0;const r=((n=a(378))&&n.__esModule?n:{default:n}).default.createContext(null);t.RouterContext=r},765:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomainLocale=function(e,t,a,n){if(process.env.__NEXT_I18N_SUPPORT){t=t||s.normalizeLocalePath(e,a).detectedLocale;const r=m(n,void 0,t);return!!r&&`http${r.http?"":"s"}://${r.domain}${v||""}${t===r.defaultLocale?"":`/${t}`}${e}`}return!1},t.addLocale=_,t.delLocale=b,t.hasBasePath=k,t.addBasePath=E,t.delBasePath=R,t.isLocalURL=W,t.interpolateAs=A,t.resolveHref=O,t.default=void 0;var n=a(421),r=a(37),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,a):{};n.get||n.set?Object.defineProperty(t,a,n):t[a]=e[a]}return t.default=e,t}(a(16)),i=a(709),s=a(559),c=y(a(564)),l=a(916),u=a(554),p=a(920),d=a(624),h=y(a(853)),f=a(205),w=a(445),g=a(304);function y(e){return e&&e.__esModule?e:{default:e}}let m;process.env.__NEXT_I18N_SUPPORT&&(m=a(723).D);const v=process.env.__NEXT_ROUTER_BASEPATH||"";function P(){return Object.assign(new Error("Route Cancelled"),{cancelled:!0})}function S(e,t){if(!e.startsWith("/")||!t)return e;const a=C(e);return n.normalizePathTrailingSlash(`${t}${a}`)+e.substr(a.length)}function _(e,t,a){if(process.env.__NEXT_I18N_SUPPORT){const n=C(e).toLowerCase(),r=t&&t.toLowerCase();return t&&t!==a&&!n.startsWith("/"+r+"/")&&n!=="/"+r?S(e,"/"+t):e}return e}function b(e,t){if(process.env.__NEXT_I18N_SUPPORT){const a=C(e),n=a.toLowerCase(),r=t&&t.toLowerCase();return t&&(n.startsWith("/"+r+"/")||n==="/"+r)?(a.length===t.length+1?"/":"")+e.substr(t.length+1):e}return e}function C(e){const t=e.indexOf("?"),a=e.indexOf("#");return(t>-1||a>-1)&&(e=e.substring(0,t>-1?t:a)),e}function k(e){return(e=C(e))===v||e.startsWith(v+"/")}function E(e){return S(e,v)}function R(e){return(e=e.slice(v.length)).startsWith("/")||(e=`/${e}`),e}function W(e){if(e.startsWith("/")||e.startsWith("#")||e.startsWith("?"))return!0;try{const t=l.getLocationOrigin(),a=new URL(e,t);return a.origin===t&&k(a.pathname)}catch(e){return!1}}function A(e,t,a){let n="";const r=w.getRouteRegex(e),o=r.groups,i=(t!==e?f.getRouteMatcher(r)(t):"")||a;n=e;const s=Object.keys(o);return s.every((e=>{let t=i[e]||"";const{repeat:a,optional:r}=o[e];let s=`[${a?"...":""}${e}]`;return r&&(s=`${t?"":"/"}[${s}]`),a&&!Array.isArray(t)&&(t=[t]),(r||e in i)&&(n=n.replace(s,a?t.map((e=>encodeURIComponent(e))).join("/"):encodeURIComponent(t))||"/")}))||(n=""),{params:s,result:n}}function I(e,t){const a={};return Object.keys(e).forEach((n=>{t.includes(n)||(a[n]=e[n])})),a}function O(e,t,a){let r,o="string"==typeof t?t:l.formatWithValidation(t);const i=o.match(/^[a-zA-Z]{1,}:\/\//),s=i?o.substr(i[0].length):o;if((s.split("?")[0]||"").match(/(\/\/|\\)/)){const e=l.normalizeRepeatedSlashes(s);o=(i?i[0]:"")+e}if(!W(o))return a?[o]:o;try{r=new URL(o.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(e){r=new URL("/","http://n")}try{const e=new URL(o,r);e.pathname=n.normalizePathTrailingSlash(e.pathname);let t="";if(u.isDynamicRoute(e.pathname)&&e.searchParams&&a){const a=d.searchParamsToUrlQuery(e.searchParams),{result:n,params:r}=A(e.pathname,e.pathname,a);n&&(t=l.formatWithValidation({pathname:n,hash:e.hash,query:I(a,r)}))}const i=e.origin===r.origin?e.href.slice(e.origin.length):e.href;return a?[i,t||i]:i}catch(e){return a?[o]:o}}function T(e){const t=l.getLocationOrigin();return e.startsWith(t)?e.substring(t.length):e}function x(e,t,a){let[n,r]=O(e,t,!0);const o=l.getLocationOrigin(),i=n.startsWith(o),s=r&&r.startsWith(o);n=T(n),r=r?T(r):r;const c=i?n:E(n),u=a?T(O(e,a)):r||n;return{url:c,as:s?u:E(u)}}function M(e,t){const a=n.removePathTrailingSlash(i.denormalizePagePath(e));return"/404"===a||"/_error"===a?e:(t.includes(a)||t.some((t=>{if(u.isDynamicRoute(t)&&w.getRouteRegex(t).re.test(a))return e=t,!0})),n.removePathTrailingSlash(e))}const L=process.env.__NEXT_SCROLL_RESTORATION&&"undefined"!=typeof window&&"scrollRestoration"in window.history&&!!function(){try{let e="__next";return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){}}(),N=Symbol("SSG_DATA_NOT_FOUND");function $(e,t,a){return fetch(e,{credentials:"same-origin"}).then((n=>{if(!n.ok){if(t>1&&n.status>=500)return $(e,t-1,a);if(404===n.status)return n.json().then((e=>{if(e.notFound)return{notFound:N};throw new Error("Failed to load static props")}));throw new Error("Failed to load static props")}return a.text?n.text():n.json()}))}function D(e,t,a,n,o){const{href:i}=new URL(e,window.location.href);return void 0!==n[i]?n[i]:n[i]=$(e,t?3:1,{text:a}).catch((e=>{throw t||r.markAssetError(e),e})).then((e=>(o||delete n[i],e))).catch((e=>{throw delete n[i],e}))}class U{constructor(e,t,a,{initialProps:r,pageLoader:o,App:i,wrapApp:s,Component:c,err:d,subscription:h,isFallback:f,locale:w,locales:g,defaultLocale:y,domainLocales:P,isPreview:S}){this.sdc={},this.sdr={},this.sde={},this._idx=0,this.onPopState=e=>{const t=e.state;if(!t){const{pathname:e,query:t}=this;return void this.changeState("replaceState",l.formatWithValidation({pathname:E(e),query:t}),l.getURL())}if(!t.__N)return;let a;const{url:n,as:r,options:o,idx:i}=t;if(process.env.__NEXT_SCROLL_RESTORATION&&L&&this._idx!==i){try{sessionStorage.setItem("__next_scroll_"+this._idx,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}try{const e=sessionStorage.getItem("__next_scroll_"+i);a=JSON.parse(e)}catch{a={x:0,y:0}}}this._idx=i;const{pathname:s}=p.parseRelativeUrl(n);this.isSsr&&r===E(this.asPath)&&s===E(this.pathname)||this._bps&&!this._bps(t)||this.change("replaceState",n,r,Object.assign({},o,{shallow:o.shallow&&this._shallow,locale:o.locale||this.defaultLocale}),a)};const _=n.removePathTrailingSlash(e);var b;(this.components={},"/_error"!==e)&&(this.components[_]={Component:c,initial:!0,props:r,err:d,__N_SSG:r&&r.__N_SSG,__N_SSP:r&&r.__N_SSP,__N_RSC:!!(null===(b=c)||void 0===b?void 0:b.__next_rsc__)});this.components["/_app"]={Component:i,styleSheets:[]},this.events=U.events,this.pageLoader=o;const C=u.isDynamicRoute(e)&&self.__NEXT_DATA__.autoExport;if(this.basePath=v,this.sub=h,this.clc=null,this._wrapApp=s,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!(!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp)&&(C||self.location.search||process.env.__NEXT_HAS_REWRITES)),process.env.__NEXT_I18N_SUPPORT&&(this.locales=g,this.defaultLocale=y,this.domainLocales=P,this.isLocaleDomain=!!m(P,self.location.hostname)),this.state={route:_,pathname:e,query:t,asPath:C?e:a,isPreview:!!S,locale:process.env.__NEXT_I18N_SUPPORT?w:void 0,isFallback:f},"undefined"!=typeof window){if("//"!==a.substr(0,2)){const n={locale:w};n._shouldResolveHref=a!==e,this.changeState("replaceState",l.formatWithValidation({pathname:E(e),query:t}),l.getURL(),n)}window.addEventListener("popstate",this.onPopState),process.env.__NEXT_SCROLL_RESTORATION&&L&&(window.history.scrollRestoration="manual")}}reload(){window.location.reload()}back(){window.history.back()}push(e,t,a={}){if(process.env.__NEXT_SCROLL_RESTORATION&&L)try{sessionStorage.setItem("__next_scroll_"+this._idx,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}return({url:e,as:t}=x(this,e,t)),this.change("pushState",e,t,a)}replace(e,t,a={}){return({url:e,as:t}=x(this,e,t)),this.change("replaceState",e,t,a)}async change(e,t,a,i,c){if(!W(t))return window.location.href=t,!1;const d=i._h||i._shouldResolveHref||C(t)===C(a),g={...this.state};i._h&&(this.isReady=!0);const y=g.locale;if(process.env.__NEXT_I18N_SUPPORT){g.locale=!1===i.locale?this.defaultLocale:i.locale||g.locale,void 0===i.locale&&(i.locale=g.locale);const e=p.parseRelativeUrl(k(a)?R(a):a),n=s.normalizeLocalePath(e.pathname,this.locales);n.detectedLocale&&(g.locale=n.detectedLocale,e.pathname=E(e.pathname),a=l.formatWithValidation(e),t=E(s.normalizeLocalePath(k(t)?R(t):t,this.locales).pathname));let r=!1;if(process.env.__NEXT_I18N_SUPPORT)(null===(G=this.locales)||void 0===G?void 0:G.includes(g.locale))||(e.pathname=_(e.pathname,g.locale),window.location.href=l.formatWithValidation(e),r=!0);const o=m(this.domainLocales,void 0,g.locale);if(process.env.__NEXT_I18N_SUPPORT&&!r&&o&&this.isLocaleDomain&&self.location.hostname!==o.domain){const e=R(a);window.location.href=`http${o.http?"":"s"}://${o.domain}${E(`${g.locale===o.defaultLocale?"":`/${g.locale}`}${"/"===e?"":e}`||"/")}`,r=!0}if(r)return new Promise((()=>{}))}i._h||(this.isSsr=!1),l.ST&&performance.mark("routeChange");const{shallow:v=!1,scroll:P=!0}=i,S={shallow:v};this._inFlightRoute&&this.abortComponentLoad(this._inFlightRoute,S),a=E(_(k(a)?R(a):a,i.locale,this.defaultLocale));const O=b(k(a)?R(a):a,g.locale);this._inFlightRoute=a;let T=y!==g.locale;if(!i._h&&this.onlyAHashChange(O)&&!T)return g.asPath=O,U.events.emit("hashChangeStart",a,S),this.changeState(e,t,a,{...i,scroll:!1}),P&&this.scrollToHash(O),this.set(g,this.components[g.route],null),U.events.emit("hashChangeComplete",a,S),!0;let L,$,D=p.parseRelativeUrl(t),{pathname:j,query:V}=D;try{[L,{__rewrites:$}]=await Promise.all([this.pageLoader.getPageList(),r.getClientBuildManifest(),this.pageLoader.getMiddlewareList()])}catch(e){return window.location.href=a,!1}this.urlIsNew(O)||T||(e="replaceState");let F=a;if(j=j?n.removePathTrailingSlash(R(j)):j,d&&"/_error"!==j)if(i._shouldResolveHref=!0,process.env.__NEXT_HAS_REWRITES&&a.startsWith("/")){const e=h.default(E(_(O,g.locale)),L,$,V,(e=>M(e,L)),this.locales);if(e.externalDest)return location.href=a,!0;F=e.asPath,e.matchedPage&&e.resolvedHref&&(j=e.resolvedHref,D.pathname=E(j),t=l.formatWithValidation(D))}else D.pathname=M(j,L),D.pathname!==j&&(j=D.pathname,D.pathname=E(j),t=l.formatWithValidation(D));if(!W(a))return window.location.href=a,!1;if(F=b(R(F),g.locale),1!==i._h||u.isDynamicRoute(n.removePathTrailingSlash(j))){const n=await this._preflightRequest({as:a,cache:!0,pages:L,pathname:j,query:V,locale:g.locale,isPreview:g.isPreview});if("rewrite"===n.type)V={...V,...n.parsedAs.query},F=n.asPath,j=n.resolvedHref,D.pathname=n.resolvedHref,t=l.formatWithValidation(D);else{if("redirect"===n.type&&n.newAs)return this.change(e,n.newUrl,n.newAs,i);if("redirect"===n.type&&n.destination)return window.location.href=n.destination,new Promise((()=>{}));if("refresh"===n.type&&a!==window.location.pathname)return window.location.href=a,new Promise((()=>{}))}}const B=n.removePathTrailingSlash(j);if(u.isDynamicRoute(B)){const e=p.parseRelativeUrl(F),n=e.pathname,r=w.getRouteRegex(B),o=f.getRouteMatcher(r)(n),i=B===n,s=i?A(B,n,V):{};if(!o||i&&!s.result){const e=Object.keys(r.groups).filter((e=>!V[e]));if(e.length>0)throw new Error((i?`The provided \`href\` (${t}) value is missing query values (${e.join(", ")}) to be interpolated properly. `:`The provided \`as\` value (${n}) is incompatible with the \`href\` value (${B}). `)+"Read more: https://nextjs.org/docs/messages/"+(i?"href-interpolation-failed":"incompatible-href-as"))}else i?a=l.formatWithValidation(Object.assign({},e,{pathname:s.result,query:I(V,s.params)})):Object.assign(V,o)}U.events.emit("routeChangeStart",a,S);try{var G,q;let n=await this.getRouteInfo(B,j,V,a,F,S,g.locale,g.isPreview),{error:r,props:o,__N_SSG:s,__N_SSP:l}=n;if((s||l)&&o){if(o.pageProps&&o.pageProps.__N_REDIRECT){const t=o.pageProps.__N_REDIRECT;if(t.startsWith("/")&&!1!==o.pageProps.__N_REDIRECT_BASE_PATH){const a=p.parseRelativeUrl(t);a.pathname=M(a.pathname,L);const{url:n,as:r}=x(this,t,t);return this.change(e,n,r,i)}return window.location.href=t,new Promise((()=>{}))}if(g.isPreview=!!o.__N_PREVIEW,o.notFound===N){let e;try{await this.fetchComponent("/404"),e="/404"}catch(t){e="/_error"}n=await this.getRouteInfo(e,e,V,a,F,{shallow:!1},g.locale,g.isPreview)}}U.events.emit("beforeHistoryChange",a,S),this.changeState(e,t,a,i),i._h&&"/_error"===j&&500===(null===(G=self.__NEXT_DATA__.props)||void 0===G||null===(q=G.pageProps)||void 0===q?void 0:q.statusCode)&&(null==o?void 0:o.pageProps)&&(o.pageProps.statusCode=500);const u=i.shallow&&g.route===B;var H;const d=(null!==(H=i.scroll)&&void 0!==H?H:!u)?{x:0,y:0}:null;if(await this.set({...g,route:B,pathname:j,query:V,asPath:O,isFallback:!1},n,null!=c?c:d).catch((e=>{if(!e.cancelled)throw e;r=r||e})),r)throw U.events.emit("routeChangeError",r,O,S),r;return process.env.__NEXT_I18N_SUPPORT&&g.locale&&(document.documentElement.lang=g.locale),U.events.emit("routeChangeComplete",a,S),!0}catch(e){if(o.default(e)&&e.cancelled)return!1;throw e}}changeState(e,t,a,n={}){"pushState"===e&&l.getURL()===a||(this._shallow=n.shallow,window.history[e]({url:t,as:a,options:n,__N:!0,idx:this._idx="pushState"!==e?this._idx:this._idx+1},"",a))}async handleRouteInfoError(e,t,a,n,i,s){if(e.cancelled)throw e;if(r.isAssetError(e)||s)throw U.events.emit("routeChangeError",e,n,i),window.location.href=n,P();try{let n,r,o;void 0!==n&&void 0!==r||({page:n,styleSheets:r}=await this.fetchComponent("/_error"));const i={props:o,Component:n,styleSheets:r,err:e,error:e};if(!i.props)try{i.props=await this.getInitialProps(n,{err:e,pathname:t,query:a})}catch(e){i.props={}}return i}catch(e){return this.handleRouteInfoError(o.default(e)?e:new Error(e+""),t,a,n,i,!0)}}async getRouteInfo(e,t,a,n,r,i,s,c){try{const o=this.components[e];if(i.shallow&&o&&this.route===e)return o;let u;o&&!("initial"in o)&&(u=o);const p=u||await this.fetchComponent(e).then((e=>({Component:e.page,styleSheets:e.styleSheets,__N_SSG:e.mod.__N_SSG,__N_SSP:e.mod.__N_SSP,__N_RSC:!!e.page.__next_rsc__}))),{Component:d,__N_SSG:h,__N_SSP:f,__N_RSC:w}=p;let g;0,(h||f||w)&&(g=this.pageLoader.getDataHref({href:l.formatWithValidation({pathname:t,query:a}),asPath:r,ssg:h,rsc:w,locale:s}));const y=await this._getData((()=>h||f?D(g,this.isSsr,!1,h?this.sdc:this.sdr,!!h&&!c):this.getInitialProps(d,{pathname:t,query:a,asPath:n,locale:s,locales:this.locales,defaultLocale:this.defaultLocale})));if(w){const{fresh:e,data:t}=await this._getData((()=>this._getFlightData(g)));y.pageProps=Object.assign(y.pageProps,{__flight_serialized__:t,__flight_fresh__:e})}return p.props=y,this.components[e]=p,p}catch(e){return this.handleRouteInfoError(o.getProperError(e),t,a,n,i)}}set(e,t,a){return this.state=e,this.sub(t,this.components["/_app"].Component,a)}beforePopState(e){this._bps=e}onlyAHashChange(e){if(!this.asPath)return!1;const[t,a]=this.asPath.split("#"),[n,r]=e.split("#");return!(!r||t!==n||a!==r)||t===n&&a!==r}scrollToHash(e){const[,t=""]=e.split("#");if(""===t||"top"===t)return void window.scrollTo(0,0);const a=document.getElementById(t);if(a)return void a.scrollIntoView();const n=document.getElementsByName(t)[0];n&&n.scrollIntoView()}urlIsNew(e){return this.asPath!==e}async prefetch(e,t=e,a={}){let o=p.parseRelativeUrl(e),{pathname:i,query:c}=o;if(process.env.__NEXT_I18N_SUPPORT&&!1===a.locale){i=s.normalizeLocalePath(i,this.locales).pathname,o.pathname=i,e=l.formatWithValidation(o);let n=p.parseRelativeUrl(t);const r=s.normalizeLocalePath(n.pathname,this.locales);n.pathname=r.pathname,a.locale=r.detectedLocale||this.defaultLocale,t=l.formatWithValidation(n)}const u=await this.pageLoader.getPageList();let d=t;if(process.env.__NEXT_HAS_REWRITES&&t.startsWith("/")){let a;({__rewrites:a}=await r.getClientBuildManifest());const n=h.default(E(_(t,this.locale)),u,a,o.query,(e=>M(e,u)),this.locales);if(n.externalDest)return;d=b(R(n.asPath),this.locale),n.matchedPage&&n.resolvedHref&&(i=n.resolvedHref,o.pathname=i,e=l.formatWithValidation(o))}else o.pathname=M(o.pathname,u),o.pathname!==i&&(i=o.pathname,o.pathname=i,e=l.formatWithValidation(o));const f=await this._preflightRequest({as:E(t),cache:!0,pages:u,pathname:i,query:c,locale:this.locale,isPreview:this.isPreview});"rewrite"===f.type&&(o.pathname=f.resolvedHref,i=f.resolvedHref,c={...c,...f.parsedAs.query},d=f.asPath,e=l.formatWithValidation(o));const w=n.removePathTrailingSlash(i);await Promise.all([this.pageLoader._isSsg(w).then((t=>!!t&&D(this.pageLoader.getDataHref({href:e,asPath:d,ssg:!0,locale:void 0!==a.locale?a.locale:this.locale}),!1,!1,this.sdc,!0))),this.pageLoader[a.priority?"loadPage":"prefetch"](w)])}async fetchComponent(e){let t=!1;const a=this.clc=()=>{t=!0},n=()=>{if(t){const t=new Error(`Abort fetching component for route: "${e}"`);throw t.cancelled=!0,t}a===this.clc&&(this.clc=null)};try{const t=await this.pageLoader.loadPage(e);return n(),t}catch(e){throw n(),e}}_getData(e){let t=!1;const a=()=>{t=!0};return this.clc=a,e().then((e=>{if(a===this.clc&&(this.clc=null),t){const e=new Error("Loading initial props cancelled");throw e.cancelled=!0,e}return e}))}_getFlightData(e){return D(e,!0,!0,this.sdc,!1).then((e=>({fresh:!0,data:e})))}async _preflightRequest(e){const t=b(k(e.as)?R(e.as):e.as,e.locale);if(!(await this.pageLoader.getMiddlewareList()).some((([e,a])=>f.getRouteMatcher(g.getMiddlewareRegex(e,!a))(t))))return{type:"next"};const a=await this._getPreflightData({preflightHref:e.as,shouldCache:e.cache,isPreview:e.isPreview});if(a.rewrite){if(!a.rewrite.startsWith("/"))return{type:"redirect",destination:e.as};const t=p.parseRelativeUrl(s.normalizeLocalePath(k(a.rewrite)?R(a.rewrite):a.rewrite,this.locales).pathname),r=n.removePathTrailingSlash(t.pathname);let o,i;return e.pages.includes(r)?(o=!0,i=r):(i=M(r,e.pages),i!==t.pathname&&e.pages.includes(i)&&(o=!0)),{type:"rewrite",asPath:t.pathname,parsedAs:t,matchedPage:o,resolvedHref:i}}if(a.redirect){if(a.redirect.startsWith("/")){const e=n.removePathTrailingSlash(s.normalizeLocalePath(k(a.redirect)?R(a.redirect):a.redirect,this.locales).pathname),{url:t,as:r}=x(this,e,e);return{type:"redirect",newUrl:t,newAs:r}}return{type:"redirect",destination:a.redirect}}return a.refresh&&!a.ssr?{type:"refresh"}:{type:"next"}}_getPreflightData(e){const{preflightHref:t,shouldCache:a=!1,isPreview:n}=e,{href:r}=new URL(t,window.location.href);return!n&&a&&this.sde[r]?Promise.resolve(this.sde[r]):fetch(t,{method:"HEAD",credentials:"same-origin",headers:{"x-middleware-preflight":"1"}}).then((e=>{if(!e.ok)throw new Error("Failed to preflight request");return{cache:e.headers.get("x-middleware-cache"),redirect:e.headers.get("Location"),refresh:e.headers.has("x-middleware-refresh"),rewrite:e.headers.get("x-middleware-rewrite"),ssr:!!e.headers.get("x-middleware-ssr")}})).then((e=>(a&&"no-cache"!==e.cache&&(this.sde[r]=e),e))).catch((e=>{throw delete this.sde[r],e}))}getInitialProps(e,t){const{Component:a}=this.components["/_app"],n=this._wrapApp(a);return t.AppTree=n,l.loadGetInitialProps(a,{AppTree:n,Component:e,router:this,ctx:t})}abortComponentLoad(e,t){this.clc&&(U.events.emit("routeChangeError",P(),e,t),this.clc(),this.clc=null)}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}}U.events=c.default(),t.default=U},169:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatUrl=function(e){let{auth:t,hostname:a}=e,o=e.protocol||"",i=e.pathname||"",s=e.hash||"",c=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:a&&(l=t+(~a.indexOf(":")?`[${a}]`:a),e.port&&(l+=":"+e.port));c&&"object"==typeof c&&(c=String(n.urlQueryToSearchParams(c)));let u=e.search||c&&`?${c}`||"";o&&":"!==o.substr(-1)&&(o+=":");e.slashes||(!o||r.test(o))&&!1!==l?(l="//"+(l||""),i&&"/"!==i[0]&&(i="/"+i)):l||(l="");s&&"#"!==s[0]&&(s="#"+s);u&&"?"!==u[0]&&(u="?"+u);return i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${o}${l}${i}${u}${s}`};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,a):{};n.get||n.set?Object.defineProperty(t,a,n):t[a]=e[a]}return t.default=e,t}(a(624));const r=/https?|ftp|gopher|file/},705:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t=""){return("/"===e?"/index":/^\/index(\/|$)/.test(e)?`/index${e}`:`${e}`)+t}},304:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMiddlewareRegex=function(e,t=!0){const a=n.getParametrizedRoute(e);let r=t?"(?!_next).*":"",o=t?"(?:(/.*)?)":"";if("routeKeys"in a)return"/"===a.parameterizedRoute?{groups:{},namedRegex:`^/${r}$`,re:new RegExp(`^/${r}$`),routeKeys:{}}:{groups:a.groups,namedRegex:`^${a.namedParameterizedRoute}${o}$`,re:new RegExp(`^${a.parameterizedRoute}${o}$`),routeKeys:a.routeKeys};if("/"===a.parameterizedRoute)return{groups:{},re:new RegExp(`^/${r}$`)};return{groups:{},re:new RegExp(`^${a.parameterizedRoute}${o}$`)}};var n=a(445)},720:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getMiddlewareRegex",{enumerable:!0,get:function(){return n.getMiddlewareRegex}}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return r.getRouteMatcher}}),Object.defineProperty(t,"getRouteRegex",{enumerable:!0,get:function(){return o.getRouteRegex}}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return i.getSortedRoutes}}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return s.isDynamicRoute}});var n=a(304),r=a(205),o=a(445),i=a(832),s=a(554)},554:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicRoute=function(e){return a.test(e)};const a=/\/\[[^/]+?\](?=\/|$)/},920:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRelativeUrl=function(e,t){const a=new URL("undefined"==typeof window?"http://n":n.getLocationOrigin()),o=t?new URL(t,a):a,{pathname:i,searchParams:s,search:c,hash:l,href:u,origin:p}=new URL(e,o);if(p!==a.origin)throw new Error(`invariant: invalid relative URL, router received ${e}`);return{pathname:i,query:r.searchParamsToUrlQuery(s),search:c,hash:l,href:u.slice(a.origin.length)}};var n=a(916),r=a(624)},462:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUrl=function(e){if(e.startsWith("/"))return r.parseRelativeUrl(e);const t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:n.searchParamsToUrlQuery(t.searchParams),search:t.search}};var n=a(624),r=a(920)},757:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.customRouteMatcherOptions=t.matcherOptions=t.pathToRegexp=void 0;var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,a):{};n.get||n.set?Object.defineProperty(t,a,n):t[a]=e[a]}return t.default=e,t}(a(173));t.pathToRegexp=n;const r={sensitive:!1,delimiter:"/"};t.matcherOptions=r;const o={...r,strict:!0};t.customRouteMatcherOptions=o;t.default=(e=!1)=>(t,a)=>{const i=[];let s=n.pathToRegexp(t,i,e?o:r);if(a){const e=a(s.source);s=new RegExp(e,s.flags)}const c=n.regexpToFunction(s,i);return(t,a)=>{const n=null!=t&&c(t);if(!n)return!1;if(e)for(const e of i)"number"==typeof e.name&&delete n.params[e.name];return{...a,...n.params}}}},379:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchHas=function(e,t,a){const n={};if(t.every((t=>{let r,o=t.key;switch(t.type){case"header":o=o.toLowerCase(),r=e.headers[o];break;case"cookie":r=e.cookies[t.key];break;case"query":r=a[o];break;case"host":{const{host:t}=(null==e?void 0:e.headers)||{};r=null==t?void 0:t.split(":")[0].toLowerCase();break}}if(!t.value&&r)return n[function(e){let t="";for(let a=0;a<e.length;a++){const n=e.charCodeAt(a);(n>64&&n<91||n>96&&n<123)&&(t+=e[a])}return t}(o)]=r,!0;if(r){const e=new RegExp(`^${t.value}$`),a=Array.isArray(r)?r.slice(-1)[0].match(e):r.match(e);if(a)return Array.isArray(a)&&(a.groups?Object.keys(a.groups).forEach((e=>{n[e]=a.groups[e]})):"host"===t.type&&a[0]&&(n.host=a[0])),!0}return!1})))return n;return!1},t.compileNonPath=i,t.prepareDestination=function(e){const t=Object.assign({},e.query);delete t.__nextLocale,delete t.__nextDefaultLocale;let a=e.destination;for(const n of Object.keys({...e.params,...t}))c=n,a=a.replace(new RegExp(`:${r.escapeStringRegexp(c)}`,"g"),`__ESC_COLON_${c}`);var c;const l=o.parseUrl(a),u=l.query,p=s(`${l.pathname}${l.hash||""}`),d=s(l.hostname||""),h=[],f=[];n.pathToRegexp(p,h),n.pathToRegexp(d,f);const w=[];h.forEach((e=>w.push(e.name))),f.forEach((e=>w.push(e.name)));const g=n.compile(p,{validate:!1}),y=n.compile(d,{validate:!1});for(const[t,a]of Object.entries(u))Array.isArray(a)?u[t]=a.map((t=>i(s(t),e.params))):u[t]=i(s(a),e.params);let m,v=Object.keys(e.params).filter((e=>"nextInternalLocale"!==e));if(e.appendParamsToQuery&&!v.some((e=>w.includes(e))))for(const t of v)t in u||(u[t]=e.params[t]);try{m=g(e.params);const[t,a]=m.split("#");l.hostname=y(e.params),l.pathname=t,l.hash=`${a?"#":""}${a||""}`,delete l.search}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw new Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw e}return l.query={...t,...l.query},{newUrl:m,parsedDestination:l}};var n=a(173),r=a(294),o=a(462);function i(e,t){if(!e.includes(":"))return e;for(const a of Object.keys(t))e.includes(`:${a}`)&&(e=e.replace(new RegExp(`:${a}\\*`,"g"),`:${a}--ESCAPED_PARAM_ASTERISKS`).replace(new RegExp(`:${a}\\?`,"g"),`:${a}--ESCAPED_PARAM_QUESTION`).replace(new RegExp(`:${a}\\+`,"g"),`:${a}--ESCAPED_PARAM_PLUS`).replace(new RegExp(`:${a}(?!\\w)`,"g"),`--ESCAPED_PARAM_COLON${a}`));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),n.compile(`/${e}`,{validate:!1})(t).substr(1)}function s(e){return e.replace(/__ESC_COLON_/gi,":")}},624:(e,t)=>{"use strict";function a(e){return"string"==typeof e||"number"==typeof e&&!isNaN(e)||"boolean"==typeof e?String(e):""}Object.defineProperty(t,"__esModule",{value:!0}),t.searchParamsToUrlQuery=function(e){const t={};return e.forEach(((e,a)=>{void 0===t[a]?t[a]=e:Array.isArray(t[a])?t[a].push(e):t[a]=[t[a],e]})),t},t.urlQueryToSearchParams=function(e){const t=new URLSearchParams;return Object.entries(e).forEach((([e,n])=>{Array.isArray(n)?n.forEach((n=>t.append(e,a(n)))):t.set(e,a(n))})),t},t.assign=function(e,...t){return t.forEach((t=>{Array.from(t.keys()).forEach((t=>e.delete(t))),t.forEach(((t,a)=>e.append(a,t)))})),e}},853:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,a,n,r,p){let d,h=!1,f=!1,w=c.parseRelativeUrl(e),g=i.removePathTrailingSlash(s.normalizeLocalePath(l.delBasePath(w.pathname),p).pathname);const y=a=>{let c=u(a.source)(w.pathname);if(a.has&&c){const e=o.matchHas({headers:{host:document.location.hostname},cookies:document.cookie.split("; ").reduce(((e,t)=>{const[a,...n]=t.split("=");return e[a]=n.join("="),e}),{})},a.has,w.query);e?Object.assign(c,e):c=!1}if(c){if(!a.destination)return f=!0,!0;const u=o.prepareDestination({appendParamsToQuery:!0,destination:a.destination,params:c,query:n});if(w=u.parsedDestination,e=u.newUrl,Object.assign(n,u.parsedDestination.query),g=i.removePathTrailingSlash(s.normalizeLocalePath(l.delBasePath(e),p).pathname),t.includes(g))return h=!0,d=g,!0;if(d=r(g),d!==e&&t.includes(d))return h=!0,!0}};let m=!1;for(let e=0;e<a.beforeFiles.length;e++)m=y(a.beforeFiles[e])||!1;if(h=t.includes(g),!h){if(!m)for(let e=0;e<a.afterFiles.length;e++)if(y(a.afterFiles[e])){m=!0;break}if(m||(d=r(g),h=t.includes(d),m=h),!m)for(let e=0;e<a.fallback.length;e++)if(y(a.fallback[e])){m=!0;break}}return{asPath:e,parsedAs:w,matchedPage:h,resolvedHref:d,externalDest:f}};var n,r=(n=a(757))&&n.__esModule?n:{default:n},o=a(379),i=a(421),s=a(559),c=a(920),l=a(765);const u=r.default(!0)},205:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRouteMatcher=function(e){const{re:t,groups:a}=e;return e=>{const r=t.exec(e);if(!r)return!1;const o=e=>{try{return decodeURIComponent(e)}catch(e){throw new n.DecodeError("failed to decode param")}},i={};return Object.keys(a).forEach((e=>{const t=a[e],n=r[t.pos];void 0!==n&&(i[e]=~n.indexOf("/")?n.split("/").map((e=>o(e))):t.repeat?[o(n)]:o(n))})),i}};var n=a(916)},445:(e,t)=>{"use strict";function a(e){return e.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")}function n(e){const t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));const a=e.startsWith("...");return a&&(e=e.slice(3)),{key:e,repeat:a,optional:t}}function r(e){const t=(e.replace(/\/$/,"")||"/").slice(1).split("/"),r={};let o=1;const i=t.map((e=>{if(e.startsWith("[")&&e.endsWith("]")){const{key:t,optional:a,repeat:i}=n(e.slice(1,-1));return r[t]={pos:o++,repeat:i,optional:a},i?a?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}return`/${a(e)}`})).join("");if("undefined"==typeof window){let e=97,o=1;const s=()=>{let t="";for(let a=0;a<o;a++)t+=String.fromCharCode(e),e++,e>122&&(o++,e=97);return t},c={};return{parameterizedRoute:i,namedParameterizedRoute:t.map((e=>{if(e.startsWith("[")&&e.endsWith("]")){const{key:t,optional:a,repeat:r}=n(e.slice(1,-1));let o=t.replace(/\W/g,""),i=!1;return(0===o.length||o.length>30)&&(i=!0),isNaN(parseInt(o.substr(0,1)))||(i=!0),i&&(o=s()),c[o]=t,r?a?`(?:/(?<${o}>.+?))?`:`/(?<${o}>.+?)`:`/(?<${o}>[^/]+?)`}return`/${a(e)}`})).join(""),groups:r,routeKeys:c}}return{parameterizedRoute:i,groups:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.getParametrizedRoute=r,t.getRouteRegex=function(e){const t=r(e);if("routeKeys"in t)return{re:new RegExp(`^${t.parameterizedRoute}(?:/)?$`),groups:t.groups,routeKeys:t.routeKeys,namedRegex:`^${t.namedParameterizedRoute}(?:/)?$`};return{re:new RegExp(`^${t.parameterizedRoute}(?:/)?$`),groups:t.groups}}},832:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSortedRoutes=function(e){const t=new a;return e.forEach((e=>t.insert(e))),t.smoosh()};class a{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e="/"){const t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);const a=t.map((t=>this.children.get(t)._smoosh(`${e}${t}/`))).reduce(((e,t)=>[...e,...t]),[]);if(null!==this.slugName&&a.push(...this.children.get("[]")._smoosh(`${e}[${this.slugName}]/`)),!this.placeholder){const t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${t}" and "${t}[[...${this.optionalRestSlugName}]]").`);a.unshift(t)}return null!==this.restSlugName&&a.push(...this.children.get("[...]")._smoosh(`${e}[...${this.restSlugName}]/`)),null!==this.optionalRestSlugName&&a.push(...this.children.get("[[...]]")._smoosh(`${e}[[...${this.optionalRestSlugName}]]/`)),a}_insert(e,t,n){if(0===e.length)return void(this.placeholder=!1);if(n)throw new Error("Catch-all must be the last part of the URL.");let r=e[0];if(r.startsWith("[")&&r.endsWith("]")){let a=r.slice(1,-1),i=!1;if(a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1),i=!0),a.startsWith("...")&&(a=a.substring(3),n=!0),a.startsWith("[")||a.endsWith("]"))throw new Error(`Segment names may not start or end with extra brackets ('${a}').`);if(a.startsWith("."))throw new Error(`Segment names may not start with erroneous periods ('${a}').`);function o(e,a){if(null!==e&&e!==a)throw new Error(`You cannot use different slug names for the same dynamic path ('${e}' !== '${a}').`);t.forEach((e=>{if(e===a)throw new Error(`You cannot have the same slug name "${a}" repeat within a single dynamic path`);if(e.replace(/\W/g,"")===r.replace(/\W/g,""))throw new Error(`You cannot have the slug names "${e}" and "${a}" differ only by non-word symbols within a single dynamic path`)})),t.push(a)}if(n)if(i){if(null!=this.restSlugName)throw new Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${e[0]}" ).`);o(this.optionalRestSlugName,a),this.optionalRestSlugName=a,r="[[...]]"}else{if(null!=this.optionalRestSlugName)throw new Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${e[0]}").`);o(this.restSlugName,a),this.restSlugName=a,r="[...]"}else{if(i)throw new Error(`Optional route parameters are not yet supported ("${e[0]}").`);o(this.slugName,a),this.slugName=a,r="[]"}}this.children.has(r)||this.children.set(r,new a),this.children.get(r)._insert(e.slice(1),t,n)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}},916:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execOnce=function(e){let t,a=!1;return(...n)=>(a||(a=!0,t=e(...n)),t)},t.getLocationOrigin=o,t.getURL=function(){const{href:e}=window.location,t=o();return e.substring(t.length)},t.getDisplayName=i,t.isResSent=s,t.normalizeRepeatedSlashes=function(e){const t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")},t.loadGetInitialProps=async function e(t,a){0;const n=a.res||a.ctx&&a.ctx.res;if(!t.getInitialProps)return a.ctx&&a.Component?{pageProps:await e(a.Component,a.ctx)}:{};const r=await t.getInitialProps(a);if(n&&s(n))return r;if(!r){const e=`"${i(t)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`;throw new Error(e)}0;return r},t.formatWithValidation=function(e){0;return r.formatUrl(e)},t.HtmlContext=t.ST=t.SP=t.urlObjectKeys=void 0;var n=a(378),r=a(169);function o(){const{protocol:e,hostname:t,port:a}=window.location;return`${e}//${t}${a?":"+a:""}`}function i(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}t.urlObjectKeys=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];const c="undefined"!=typeof performance;t.SP=c;const l=c&&"function"==typeof performance.mark&&"function"==typeof performance.measure;t.ST=l;class u extends Error{}t.DecodeError=u;const p=n.createContext(null);t.HtmlContext=p},677:(e,t,a)=>{e.exports=a(236)},525:e=>{"use strict";var t=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,s,c=r(e),l=1;l<arguments.length;l++){for(var u in i=Object(arguments[l]))a.call(i,u)&&(c[u]=i[u]);if(t){s=t(i);for(var p=0;p<s.length;p++)n.call(i,s[p])&&(c[s[p]]=i[s[p]])}}return c}},535:(e,t,a)=>{"use strict";var n=a(525),r=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var i=60109,s=60110,c=60112;t.Suspense=60113;var l=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var p=Symbol.for;r=p("react.element"),o=p("react.portal"),t.Fragment=p("react.fragment"),t.StrictMode=p("react.strict_mode"),t.Profiler=p("react.profiler"),i=p("react.provider"),s=p("react.context"),c=p("react.forward_ref"),t.Suspense=p("react.suspense"),l=p("react.memo"),u=p("react.lazy")}var d="function"==typeof Symbol&&Symbol.iterator;function h(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w={};function g(e,t,a){this.props=e,this.context=t,this.refs=w,this.updater=a||f}function y(){}function m(e,t,a){this.props=e,this.context=t,this.refs=w,this.updater=a||f}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(h(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var v=m.prototype=new y;v.constructor=m,n(v,g.prototype),v.isPureReactComponent=!0;var P={current:null},S=Object.prototype.hasOwnProperty,_={key:!0,ref:!0,__self:!0,__source:!0};function b(e,t,a){var n,o={},i=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)S.call(t,n)&&!_.hasOwnProperty(n)&&(o[n]=t[n]);var c=arguments.length-2;if(1===c)o.children=a;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(n in c=e.defaultProps)void 0===o[n]&&(o[n]=c[n]);return{$$typeof:r,type:e,key:i,ref:s,props:o,_owner:P.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var k=/\/+/g;function E(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function R(e,t,a,n,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c=!1;if(null===e)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case r:case o:c=!0}}if(c)return i=i(c=e),e=""===n?"."+E(c,0):n,Array.isArray(i)?(a="",null!=e&&(a=e.replace(k,"$&/")+"/"),R(i,t,a,"",(function(e){return e}))):null!=i&&(C(i)&&(i=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,a+(!i.key||c&&c.key===i.key?"":(""+i.key).replace(k,"$&/")+"/")+e)),t.push(i)),1;if(c=0,n=""===n?".":n+":",Array.isArray(e))for(var l=0;l<e.length;l++){var u=n+E(s=e[l],l);c+=R(s,t,a,u,i)}else if("function"==typeof(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e)))for(e=u.call(e),l=0;!(s=e.next()).done;)c+=R(s=s.value,t,a,u=n+E(s,l++),i);else if("object"===s)throw t=""+e,Error(h(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return c}function W(e,t,a){if(null==e)return e;var n=[],r=0;return R(e,n,"","",(function(e){return t.call(a,e,r++)})),n}function A(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var I={current:null};function O(){var e=I.current;if(null===e)throw Error(h(321));return e}var T={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:P,IsSomeRendererActing:{current:!1},assign:n};t.Children={map:W,forEach:function(e,t,a){W(e,(function(){t.apply(this,arguments)}),a)},count:function(e){var t=0;return W(e,(function(){t++})),t},toArray:function(e){return W(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error(h(143));return e}},t.Component=g,t.PureComponent=m,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,t.cloneElement=function(e,t,a){if(null==e)throw Error(h(267,e));var o=n({},e.props),i=e.key,s=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,c=P.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)S.call(t,u)&&!_.hasOwnProperty(u)&&(o[u]=void 0===t[u]&&void 0!==l?l[u]:t[u])}var u=arguments.length-2;if(1===u)o.children=a;else if(1<u){l=Array(u);for(var p=0;p<u;p++)l[p]=arguments[p+2];o.children=l}return{$$typeof:r,type:e.type,key:i,ref:s,props:o,_owner:c}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},t.createElement=b,t.createFactory=function(e){var t=b.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:A}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return O().useCallback(e,t)},t.useContext=function(e,t){return O().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return O().useEffect(e,t)},t.useImperativeHandle=function(e,t,a){return O().useImperativeHandle(e,t,a)},t.useLayoutEffect=function(e,t){return O().useLayoutEffect(e,t)},t.useMemo=function(e,t){return O().useMemo(e,t)},t.useReducer=function(e,t,a){return O().useReducer(e,t,a)},t.useRef=function(e){return O().useRef(e)},t.useState=function(e){return O().useState(e)},t.version="17.0.2"},378:(e,t,a)=>{"use strict";e.exports=a(535)}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";var e,t,r,o,i,s,c;a.r(n),a.d(n,{AppManifestType:()=>s,BrowserButtonType:()=>h,CustomActionCallerType:()=>w,GlobalContextMenuOptionType:()=>u,PageTabContextMenuOptionType:()=>p,SaveButtonContextMenuOptionType:()=>f,SaveModalType:()=>g,ViewTabMenuOptionType:()=>d,getCurrentSync:()=>It,init:()=>La,wrapSync:()=>At}),function(e){e.Fetching="fetching",e.Fetched="fetched",e.Complete="complete"}(e||(e={})),function(e){e.Active="active",e.Default="default"}(t||(t={})),function(e){e.Suggestion="suggestion"}(r||(r={})),function(e){e.Contact="Contact",e.Custom="Custom",e.List="List",e.Plain="Plain",e.SimpleText="SimpleText"}(o||(o={})),function(e){e.MultiSelect="MultiSelect"}(i||(i={})),function(e){e.Snapshot="snapshot",e.Manifest="manifest",e.View="view",e.External="external"}(s||(s={})),function(e){e.LandingPage="landingPage",e.AppGrid="appGrid"}(c||(c={}));var l,u,p,d,h,f,w,g,y;!function(e){e.Primary="primary",e.Secondary="secondary",e.TextOnly="textOnly"}(l||(l={})),function(e){e.NewWindow="NewWindow",e.NewPage="NewPage",e.SaveWorkspace="SaveWorkspace",e.SavePage="SavePage",e.SavePageAs="SavePageAs",e.CloseWindow="CloseWindow",e.SaveWorkspaceAs="SaveWorkspaceAs",e.RenameWorkspace="RenameWorkspace",e.SwitchWorkspace="SwitchWorkspace",e.DeleteWorkspace="DeleteWorkspace",e.OpenStorefront="OpenStorefront",e.Quit="Quit",e.Custom="Custom"}(u||(u={})),function(e){e.Close="Close",e.Duplicate="Duplicate",e.Rename="Rename",e.Save="Save",e.SaveAs="Save As",e.Custom="Custom"}(p||(p={})),function(e){e.NewView="NewView",e.DuplicateViews="DuplicateView",e.OpenWithDefaultBrowser="OpenWithDefaultBrowser",e.ReloadViews="ReloadTab",e.CloseViews="CloseTab",e.AddToChannel="AddToChannel",e.RemoveFromChannel="RemoveFromChannel",e.Custom="Custom"}(d||(d={})),function(e){e.ShowHideTabs="ShowHideTabs",e.ColorLinking="ColorLinking",e.PresetLayouts="PresetLayouts",e.SaveMenu="SaveMenu",e.Minimise="Minimise",e.Maximise="Maximise",e.Close="Close",e.Custom="Custom"}(h||(h={})),function(e){e.SavePage="SavePage",e.SaveWorkspace="SaveWorkspace",e.Custom="Custom"}(f||(f={})),function(e){e.CustomButton="CustomButton",e.GlobalContextMenu="GlobalContextMenu",e.ViewTabContextMenu="ViewTabContextMenu",e.PageTabContextMenu="PageTabContextMenu",e.SaveButtonContextMenu="SaveButtonContextMenu",e.API="API"}(w||(w={})),function(e){e.SAVE_PAGE="SAVE_PAGE",e.SAVE_WORKSPACE="SAVE_WORKSPACE",e.SAVE_PAGE_AS="SAVE_PAGE_AS",e.SAVE_WORKSPACE_AS="SAVE_WORKSPACE_AS",e.RENAME_PAGE="RENAME_PAGE",e.RENAME_WORKSPACE="RENAME_WORKSPACE"}(g||(g={})),function(e){e.Local="local",e.Dev="dev",e.Staging="staging",e.Prod="prod"}(y||(y={}));const m="undefined"!=typeof window&&"undefined"!=typeof fin,v=("undefined"==typeof process||process.env?.JEST_WORKER_ID,"undefined"!=typeof window),P=v&&"undefined"!=typeof indexedDB,S=v?window.origin:y.Local,_=m&&fin.me.uuid,b=m&&fin.me.name,C=m&&fin.me.entityType,k=(y.Local,y.Dev,y.Staging,y.Prod,e=>e.startsWith("http://")||e.startsWith("https://")?e:S+e),E=(k("https://cdn.openfin.co/workspace/7.2.0"),k("https://cdn.openfin.co/workspace/7.2.0")),R=("undefined"!=typeof WORKSPACE_DOCS_PLATFORM_URL&&k(WORKSPACE_DOCS_PLATFORM_URL),"undefined"!=typeof WORKSPACE_DOCS_CLIENT_URL&&k(WORKSPACE_DOCS_CLIENT_URL),"24.98.68.14"),W="7.2.0";var A,I,O;!function(e){e.Workspace="openfin-browser"}(A||(A={})),function(e){e.RunRequested="run-requested",e.WindowOptionsChanged="window-options-changed",e.WindowClosed="window-closed",e.WindowCreated="window-created"}(I||(I={})),function(e){e.FinProtocol="fin-protocol"}(O||(O={}));const T={uuid:_,name:_},x=(A.Workspace,A.Workspace,e=>{if(!m)throw new Error("getApplication cannot be used in a non OpenFin env. Avoid using this during pre-rendering.");return fin.Application.wrapSync(e)});var M,L;!function(e){e.Home="openfin-home",e.Dock="openfin-dock",e.Storefront="openfin-storefront",e.HomeInternal="openfin-home-internal",e.BrowserMenu="openfin-browser-menu",e.BrowserIndicator="openfin-browser-indicator",e.BrowserWindow="internal-generated-window"}(M||(M={})),function(e){e.Shown="shown",e.BoundsChanged="bounds-changed",e.LayoutReady="layout-ready",e.EndUserBoundsChanging="end-user-bounds-changing",e.Blurred="blurred",e.CloseRequested="close-requested",e.Focused="focused",e.ShowRequested="show-requested",e.ViewCrashed="view-crashed",e.ViewAttached="view-attached",e.ViewDetached="view-detached",e.ViewPageTitleUpdated="view-page-title-updated",e.ViewDestroyed="view-destroyed",e.OptionsChanged="options-changed"}(L||(L={}));function N(e){if(!m)throw new Error("getOFWindow can only be used in an OpenFin env. Avoid calling this method during pre-rendering.");return fin.Window.wrapSync(e)}const $={name:b,uuid:_};function D(){return N($)}M.Home,A.Workspace,M.Dock,A.Workspace;const U={name:M.Storefront,uuid:A.Workspace};A.Workspace,A.Workspace;async function j(e){const t=N(e);"minimized"===await t.getState()&&await t.restore(),await t.show(),await t.bringToFront(),await t.focus()}const V=e=>e.startsWith(M.BrowserWindow);async function F(){return(await fin.Application.getCurrentSync().getChildWindows()).filter((e=>V(e.identity.name)))}const B=e=>N(e).getOptions().then((()=>!0)).catch((()=>!1)),G=()=>B(U);var q;!function(e){e.Browser="Browser",e.Home="Home",e.Notification="Notification",e.Storefront="Storefront",e.Platform="Platform",e.Theming="Theming"}(q||(q={}));const H=async(e,t)=>{const a={apiVersion:t.apiVersion||W,componentName:e,componentVersion:W,...t};fin.System.registerUsage({type:"workspace-licensing",data:a})};var z,X=new Uint8Array(16);function K(){if(!z&&!(z="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return z(X)}const Q=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const Y=function(e){return"string"==typeof e&&Q.test(e)};for(var J=[],Z=0;Z<256;++Z)J.push((Z+256).toString(16).substr(1));const ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(J[e[t+0]]+J[e[t+1]]+J[e[t+2]]+J[e[t+3]]+"-"+J[e[t+4]]+J[e[t+5]]+"-"+J[e[t+6]]+J[e[t+7]]+"-"+J[e[t+8]]+J[e[t+9]]+"-"+J[e[t+10]]+J[e[t+11]]+J[e[t+12]]+J[e[t+13]]+J[e[t+14]]+J[e[t+15]]).toLowerCase();if(!Y(a))throw TypeError("Stringified UUID is invalid");return a};const te=function(e,t,a){var n=(e=e||{}).random||(e.rng||K)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){a=a||0;for(var r=0;r<16;++r)t[a+r]=n[r];return t}return ee(n)};var ae;!function(e){e.CurrentWorkspaceId="currentWorkspaceId",e.LastFocusedBrowserWindow="lastFocusedBrowserWindow",e.MachineName="machineName",e.NewTabPageLayout="NewTabPageLayout",e.NewTabPageSort="NewTabPageSort"}(ae||(ae={}));const ne=ae;var re;!function(e){e.LaunchApp="launchApp",e.SavePage="savePage",e.GetSavedPage="getSavedPage",e.CreateSavedPage="createSavedPage",e.UpdateSavedPage="updateSavedPage",e.DeleteSavedPage="deleteSavedPage",e.GetSavedPages="getSavedPages",e.CreateSavedPageInternal="createSavedPageInternal",e.UpdateSavedPageInternal="updateSavedPageInternal",e.DeleteSavedPageInternal="deleteSavedPageInternal",e.SharePage="sharePage",e.UpdatePageForWindow="updatePageForWindow",e.AttachPagesToWindow="attachPagesToWindow",e.DetachPagesFromWindow="detachPagesFromWindow",e.ReorderPagesForWindow="reorderPagesForWindow",e.SetActivePage="setActivePage",e.GetAllAttachedPages="getAllAttachedPages",e.GetActivePageIdForWindow="getActivePageIdForWindow",e.GetPagesForWindow="getPagesForWindow",e.GetPageForWindow="getPageForWindow",e.GetSavedPageMetadata="getSavedPageMetadata",e.GetUniquePageTitle="getUniquePageTitle",e.GetLastFocusedBrowserWindow="getLastFocusedBrowserWindow",e.GetThemes="getThemes",e.OpenGlobalContextMenuInternal="openGlobalContextMenuInternal",e.OpenViewTabContextMenuInternal="openViewTabContextMenuInternal",e.OpenPageTabContextMenuInternal="openPageTabContextMenuInternal",e.OpenSaveButtonContextMenuInternal="openSaveButtonContextMenuInternal",e.InvokeCustomActionInternal="invokeCustomActionInternal",e.GetSavedWorkspace="getSavedWorkspace",e.CreateSavedWorkspace="createSavedWorkspace",e.UpdateSavedWorkspace="updateSavedWorkspace",e.DeleteSavedWorkspace="deleteSavedWorkspace",e.GetSavedWorkspaces="getSavedWorkspaces",e.SaveWorkspace="saveWorkspace",e.GetCurrentWorkspace="getCurrentWorkspace",e.ApplyWorkspace="applyWorkspace",e.SetActiveWorkspace="setActiveWorkspace"}(re||(re={}));const oe=async e=>{const t=fin.Platform.wrapSync(e),a=await t.getClient(),n="Target is not a Workspace Platform. Target must call WorkspacePlatform.init";try{if(!0===await a.dispatch("isWorkspacePlatform"))return a;throw new Error(n)}catch(e){throw new Error(n)}},ie=(e,t)=>!t.find((t=>t===e)),se=(e,t)=>`${e} (${t})`,ce=(e,t)=>{let a=1;const n=e.replace(/ \(.+\)$/,"");for(;!ie(se(n,a),t);)a+=1;return se(n,a)};async function le(e){try{await fin.Platform.getCurrentSync().applySnapshot(e.snapshot,{closeExistingWindows:!0}),ue(e)}catch(e){}}function ue(e){if("undefined"!=typeof localStorage)try{const t=JSON.stringify(e);localStorage.setItem(ne.CurrentWorkspaceId,t)}catch(e){}}async function pe(){if("undefined"==typeof localStorage)return;const e=await fin.Platform.getCurrentSync().getSnapshot();return{workspaceId:te(),title:await fe(),metadata:{APIVersion:W},snapshot:e}}async function de(){if("undefined"==typeof localStorage)return;const e=localStorage.getItem(ne.CurrentWorkspaceId);if(!e)return pe();const t=JSON.parse(e),a=await fin.Platform.getCurrentSync().getSnapshot();return{...t,metadata:t.metadata||{APIVersion:W},snapshot:a}}const he=async e=>await(async e=>(await oe($)).dispatch(re.GetSavedWorkspace,e))(e.workspaceId)?(async e=>(await oe($)).dispatch(re.UpdateSavedWorkspace,e))({workspaceId:e.workspaceId,workspace:e}):(async e=>(await oe($)).dispatch(re.CreateSavedWorkspace,e))({workspace:e});async function fe(e="Untitled Workspace"){const t=(await(async()=>(await oe($)).dispatch(re.GetSavedWorkspaces,void 0))()).map((({title:e})=>e));return t.find((t=>t===e))?ce(e,t):e}async function we(){if("undefined"!=typeof localStorage)try{const e=localStorage.getItem(ne.LastFocusedBrowserWindow),t=JSON.parse(e);if(await B(t))return t}catch(e){throw new Error(`failed to get last focused browser window: ${e}`)}}function ge(e=fin.me.identity){V(e.name)&&function(e){if("undefined"!=typeof localStorage)try{const t=JSON.stringify(e);localStorage.setItem(ne.LastFocusedBrowserWindow,t)}catch(e){}}(e)}const ye=(e,t=0)=>{let a,n,r=!1;const o=async n=>{const i=await e(...n);if(r){await new Promise((e=>setTimeout(e,t)));const e=a;return a=void 0,r=!1,o(e)}return i};return(...e)=>(n?(r=!0,a=e):n=o(e).then((e=>(n=void 0,e))),n)};var me;!function(e){e.TabCreated="tab-created",e.ContainerCreated="container-created",e.ContainerResized="container-resized"}(me||(me={}));const ve=e=>{const t=[];return(e&&Array.isArray(e)?e:[]).forEach((e=>{if("component"===e.type)return t.push(e.componentState);const a=ve(e.content);t.push(...a)})),t},Pe=async(e,t,a=$)=>{let n;if(V(a.name)){n=(await N(a).getOptions()).layout||{settings:{}}}return{...n,content:[{type:"stack",content:[{type:"component",componentName:"view",componentState:{title:e,url:t}}]}]}};new Map;const Se=v&&"complete"!==document.readyState&&new Promise((e=>document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&e()}))));function _e(e){let t;return()=>{if(!m)throw new Error("getChannelClient cannot be used outside an OpenFin env. Avoid using this method during pre-rendering.");return t||(t=(async()=>{await Se;const a=await fin.InterApplicationBus.Channel.connect(e);return a.onDisconnection((async()=>{t=void 0})),a})().then((e=>e)).catch((a=>{throw t=void 0,new Error(`failed to connect to channel provider ${e}: ${a}`)}))),t}}const be=e=>`__browser_window__-${e.uuid}-${e.name}`,Ce=new Map,ke=e=>{const t=be(e);return Ce.has(t)||Ce.set(t,_e(t)),Ce.get(t)()};var Ee,Re,We;!function(e){e.CloseBrowserWindow="close-browser-window",e.QuitPlatform="quit-platform",e.ClosePage="close-page",e.AddToChannel="add-to-channel",e.RemoveFromChannel="remove-from-channel",e.OpenSaveModalInternal="open-save-modal-internal",e.DuplicatePage="duplicate-page"}(Ee||(Ee={})),function(e){e.GetPages="get-pages",e.GetActivePageForWindow="get-active-page-for-window",e.AttachPagesToWindow="attach-pages-to-window",e.DetachPagesFromWindow="detach-pages-from-window",e.SetActivePageForWindow="set-active-page-for-window",e.RenamePage="rename-page",e.ReorderPagesForWindow="reorder-pages-for-window",e.UpdatePageForWindow="update-page-for-window",e.UpdatePagesWindowOptions="update-pages-window-options",e.IsDetachingPages="is-detaching-pages",e.IsActivePageChanging="is-active-page-changing"}(Re||(Re={})),function(e){e.AttachedPagesToWindow="attached-pages-to-window",e.DetachedPagesFromWindow="detached-pages-from-window"}(We||(We={}));new Map;const Ae=async e=>{const t=await ke(e);return await t.dispatch(Re.GetPages)},Ie=async e=>(await ke(e.identity)).dispatch(Re.UpdatePageForWindow,e),Oe=async()=>{const e=await F();return(await Promise.all(e.map((async({identity:e})=>Ae(e))))).reduce(((e,t)=>e.concat(t)),[])},Te=async()=>(await oe($)).dispatch(re.GetSavedPages,void 0),xe=async e=>(await oe($)).dispatch(re.GetSavedPage,e),Me=async(e,t)=>{const a=await(async e=>(await Oe()).find((t=>t.pageId===e)))(e);return!a||a.title===t.title&&e===t.pageId||await Ie({identity:a.parentIdentity,pageId:e,page:{pageId:t.pageId,title:t.title}}),a},Le=async({page:e})=>{await Me(e.pageId,e),await(async e=>(await oe($)).dispatch(re.CreateSavedPage,e))({page:e})},Ne=async e=>{await xe(e)&&await(async e=>(await oe($)).dispatch(re.DeleteSavedPage,e))(e)},$e=async({pageId:e,page:t})=>{await Me(e,t);return await(async e=>(await oe($)).dispatch(re.UpdateSavedPage,e))({pageId:e,page:t})},De=async e=>await xe(e.pageId)?$e({pageId:e.pageId,page:e}):Le({page:e}),Ue=async e=>{await(async e=>(await ke(e.identity)).dispatch(Re.AttachPagesToWindow,e))(e)},je=async e=>{await Ie(e)},Ve=async e=>{await(async e=>(await ke(e.identity)).dispatch(Re.DetachPagesFromWindow,e))(e)},Fe=async e=>{await(async e=>(await ke(e.identity)).dispatch(Re.SetActivePageForWindow,e))(e)},Be=e=>Ae(e),Ge=async({identity:e,pageId:t})=>(await Be(e)).find((e=>e.pageId===t)),qe=async e=>{await(async e=>(await ke(e.identity)).dispatch(Re.ReorderPagesForWindow,e))(e)};async function He(e="Untitled Page"){const[t,a]=await Promise.all([Te(),Oe()]),n=[...t,...a].map((({title:e})=>e));return n.find((t=>t===e))?ce(e,n):e}const ze=new Map,Xe=e=>`${e.uuid}-${e.name}`;const Ke=ye((async function(){const e=await Oe(),t=new Set;e.forEach((e=>{ve(e.layout.content).forEach((e=>{if(e.name){const a=Xe(e);t.add(a)}}))}));const a=D();(await a.getCurrentViews()).forEach((({identity:e})=>{const a=Xe(e);if(t.has(a)||ze.has(a))return;const n=setTimeout((()=>{fin.View.wrapSync(e).destroy(),ze.delete(a)}),5e3);ze.set(a,n)})),ze.forEach(((e,a)=>{t.has(a)&&(clearTimeout(e),ze.delete(a))}))}),2500),Qe=({name:e})=>{V(e)&&Ke().catch((()=>{}))};function Ye(){const e=x(T);e.addListener(I.WindowOptionsChanged,Ke),e.addListener(I.WindowClosed,Qe),e.addListener(I.WindowCreated,Qe)}let Je={};const Ze=({actionId:e,payload:t})=>{if("function"!=typeof Je[e])throw new Error(`Cannot find a configured function for the action '${e}'`);return Je[e](t)};function et(){return localStorage.getItem(ne.MachineName)}let tt,at;async function nt(){return tt||(tt=await fin.System.getMachineId()),tt}async function rt(e){const t=e||await fin.Platform.getCurrentSync().getSnapshot();if(t.snapshotDetails?.machineId)return t;const a=et();return{...t,snapshotDetails:{...e.snapshotDetails,machineId:await nt(),machineName:a}}}function ot(e){return new Promise(((t,a)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>a(e.error)}))}function it(e,t){const a=indexedDB.open(e);a.onupgradeneeded=()=>a.result.createObjectStore(t);const n=ot(a);return(e,a)=>n.then((n=>a(n.transaction(t,e).objectStore(t))))}function st(){return at||(at=it("keyval-store","keyval")),at}function ct(e,t=st()){return t("readonly",(t=>ot(t.get(e))))}function lt(e,t,a=st()){return a("readwrite",(a=>(a.put(t,e),ot(a.transaction))))}function ut(e,t=st()){return t("readwrite",(t=>(t.delete(e),ot(t.transaction))))}function pt(e,t){return e("readonly",(e=>(e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},ot(e.transaction))))}function dt(e=st()){const t=[];return pt(e,(e=>t.push(e.key))).then((()=>t))}const ht=(e,t="")=>e.toLowerCase().includes(t.toLowerCase()),ft=P&&it("openfin-home-pages","pages");async function wt(e){const t=await ct(e,ft);return t?(t.pageId=e.toString(),t.title=t.title||t.pageId,t):null}async function gt(e){const t=await dt(ft),a=await Promise.all(t.map((e=>wt(e.toString()))));return e?a.filter((t=>ht(t.title,e))):a}async function yt({page:e}){await lt(e.pageId,e,ft)}async function mt(e){await ut(e,ft)}async function vt({pageId:e,page:t}){if(void 0===await wt(e))throw new Error("page not found");await yt({page:t}),e!==t.pageId&&await mt(e)}var Pt;!function(e){e.Label="normal",e.Separator="separator",e.Submenu="submenu",e.Checkbox="checkbox"}(Pt||(Pt={}));const St=247;var _t;!function(e){e.RegisterStorefrontProvider="register-storefront-provider",e.DeregisterStorefrontProvider="deregister-storefront-provider",e.GetStorefrontProviders="get-storefront-providers",e.HideStorefront="hide-storefront",e.GetStorefrontProviderApps="get-storefront-provider-apps",e.GetStorefrontProviderLandingPage="get-storefront-provider-landing-page",e.GetStorefrontProviderFooter="get-storefront-provider-footer",e.GetStorefrontProviderNavigation="get-storefront-provider-navigation",e.LaunchStorefrontProviderApp="launch-storefront-provider-app",e.ShowStorefront="show-storefront",e.CreateStorefrontWindow="create-storefront-window",e.ShowHome="show-home",e.HideHome="hide-home",e.AssignHomeSearchContext="assign-home-search-context",e.GetLegacyPages="get-legacy-pages",e.GetLegacyWorkspaces="get-legacy-workspaces",e.GetComputedPlatformTheme="get-computed-platform-theme"}(_t||(_t={}));_e("__of_workspace_protocol__");const bt=async(e,t)=>{const a=await(async e=>({...e,layoutDetails:{machineId:await nt(),machineName:et()}}))(t);return{pageId:te(),title:e,layout:a,isReadOnly:!1,hasUnsavedChanges:!0}},Ct=e=>({identity:e,openfinWindow:fin.Window.wrapSync(e),getPages:async()=>(await oe(e)).dispatch(re.GetPagesForWindow,e),getPage:async t=>(await oe(e)).dispatch(re.GetPageForWindow,{identity:e,pageId:t}),addPage:async t=>{const a=await oe(e);t?.title||(t.title=await a.dispatch(re.GetUniquePageTitle,void 0));const n=(await a.dispatch(re.GetAllAttachedPages,void 0)).find((e=>e.pageId===t.pageId||e.title===t.title));if(n)throw n.pageId===t.pageId?new Error(`page with id ${t.pageId} is already attached to a browser window ${n.parentIdentity.name}`):new Error(`page with title ${t.title} is already attached to a browser window ${n.parentIdentity.name}`);const r={identity:e,pages:[t]};return a.dispatch(re.AttachPagesToWindow,r)},removePage:async t=>(await oe(e)).dispatch(re.DetachPagesFromWindow,{identity:e,pageIds:[t]}),setActivePage:async t=>(await oe(e)).dispatch(re.SetActivePage,{identity:e,pageId:t}),updatePage:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.UpdatePageForWindow,t)},reorderPages:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.ReorderPagesForWindow,t)},_openGlobalContextMenu:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.OpenGlobalContextMenuInternal,t)},replaceToolbarOptions:async t=>{const a=fin.Window.wrapSync(e);await a.updateOptions({workspacePlatform:{toolbarOptions:t}})},replaceWindowStateButtonOptions:async t=>{const a=fin.Window.wrapSync(e);await a.updateOptions({workspacePlatform:{windowStateButtonOptions:t}})},_openViewTabContextMenu:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.OpenViewTabContextMenuInternal,t)},_openPageTabContextMenu:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.OpenPageTabContextMenuInternal,t)},_openSaveModal:async t=>(await ke(e)).dispatch(Ee.OpenSaveModalInternal,t),_openSaveButtonContextMenu:async t=>{const a=await oe(e);return t.identity=e,a.dispatch(re.OpenSaveButtonContextMenuInternal,t)}});let kt=!1;const Et=e=>{const t=fin.Platform.wrapSync(e);return{wrapSync:e=>Ct(e),createWindow:async e=>{kt||(kt=!0,(async e=>{H(q.Browser,e)})({allowed:!0}));const a=await t.createWindow(e);return Ct(a.identity)},getAllAttachedPages:async()=>(await t.getClient()).dispatch(re.GetAllAttachedPages,void 0),getAllWindows:async()=>(await fin.Application.wrapSync(e).getChildWindows()).filter((e=>e.identity.name.includes("internal-generated-window-"))).map((e=>Ct(e.identity))),getUniquePageTitle:async t=>(await oe(e)).dispatch(re.GetUniquePageTitle,t),getLastFocusedWindow:async()=>(await oe(e)).dispatch(re.GetLastFocusedBrowserWindow,void 0)}},Rt=e=>({createPage:async t=>(await oe(e)).dispatch(re.CreateSavedPageInternal,t),deletePage:async t=>(await oe(e)).dispatch(re.DeleteSavedPageInternal,t),updatePage:async t=>(await oe(e)).dispatch(re.UpdateSavedPageInternal,t),getPage:async t=>(await oe(e)).dispatch(re.GetSavedPage,t),getPages:async t=>(await oe(e)).dispatch(re.GetSavedPages,t),savePage:async t=>(await oe(e)).dispatch(re.SavePage,t),createWorkspace:async t=>(await oe(e)).dispatch(re.CreateSavedWorkspace,t),deleteWorkspace:async t=>(await oe(e)).dispatch(re.DeleteSavedWorkspace,t),updateWorkspace:async t=>(await oe(e)).dispatch(re.UpdateSavedWorkspace,t),getWorkspace:async t=>(await oe(e)).dispatch(re.GetSavedWorkspace,t),getWorkspaces:async t=>(await oe(e)).dispatch(re.GetSavedWorkspaces,t),saveWorkspace:async t=>(await oe(e)).dispatch(re.SaveWorkspace,t)}),Wt=e=>({getThemes:async()=>(await oe(e)).dispatch(re.GetThemes,void 0)}),At=e=>{const t=fin.Platform.wrapSync(e);return Object.assign(t,{applySnapshot:async t=>{if("string"!=typeof t&&!t?.windows)throw new Error("Not a valid browser snapshot");return fin.Platform.wrapSync(e).applySnapshot(t)},getSnapshot:()=>fin.Platform.wrapSync(e).getSnapshot().then((e=>e)),launchApp:async t=>{t.target||(t.target={uuid:_,name:b,entityType:C||"unknown"});return(await oe(e)).dispatch(re.LaunchApp,t)},_invokeCustomAction:async(t,a)=>{const n=await oe(e),r={actionId:t,payload:{...a,callerType:a.callerType||w.API}};return n.dispatch(re.InvokeCustomActionInternal,r)},getCurrentWorkspace:async()=>(await oe(e)).dispatch(re.GetCurrentWorkspace,void 0),applyWorkspace:async t=>(await oe(e)).dispatch(re.ApplyWorkspace,t),setActiveWorkspace:async t=>(await oe(e)).dispatch(re.SetActiveWorkspace,t),Theme:Wt(e),Browser:Et(e),Storage:Rt(e)})},It=()=>At(fin.me.identity),Ot=async(e=$)=>{const{workspacePlatform:t}=await N(e).getOptions();return{newPageUrl:t?.newPageUrl,newTabUrl:t?.newTabUrl}},Tt=async(e=$)=>{const t=await It().Browser.getUniquePageTitle("Untitled Page"),a=await(async(e=$)=>{const{newPageUrl:t}=await Ot(e);if(!t)throw new Error("Trying to create a new page without a newPageUrl set");return Pe("New Tab",t,e)})(e);return bt(t,a)},xt=[{type:Pt.Label,label:"Close Window",data:{type:u.CloseWindow}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Open Storefront",data:{type:u.OpenStorefront}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Quit Workspace",data:{type:u.Quit}}],Mt=[{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Close Window",data:{type:u.CloseWindow}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Quit",data:{type:u.Quit}}],Lt=(e,t,a)=>t.map((t=>{const n=t.workspaceId===e.workspaceId;return{label:t.title,type:Pt.Checkbox,enabled:!n,checked:n,data:{type:a,workspaceId:t.workspaceId}}})),Nt=async e=>{const t=await G(),{newPageUrl:a}=await Ot(e),n=await(async e=>{const t=N(e),{workspacePlatform:a}=await t.getOptions();return a?.disableMultiplePages})(e),r=[];a&&(r.push({type:Pt.Label,label:"New Window",data:{type:u.NewWindow}}),n||r.push({type:Pt.Label,label:"New Page",data:{type:u.NewPage}})),r.push({type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Save Workspace",data:{type:u.SaveWorkspace}},{type:Pt.Label,label:"Save Workspace As...",data:{type:u.SaveWorkspaceAs}});const o=It(),i=await o.getCurrentWorkspace(),s=await o.Storage.getWorkspaces();return s.some((e=>e.workspaceId===i.workspaceId))?r.push({type:Pt.Label,label:"Rename Workspace",data:{type:u.RenameWorkspace}}):r.push({label:"Rename Workspace",enabled:!1}),s.some((e=>e.workspaceId!==i.workspaceId))?r.push({label:"Switch Workspace",submenu:Lt(i,s,u.SwitchWorkspace)},{label:"Delete Workspace",submenu:Lt(i,s,u.DeleteWorkspace)}):r.push({label:"Switch Workspace",enabled:!1},{label:"Delete Workspace",enabled:!1}),r.push({type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Save Page",data:{type:u.SavePage}},{type:Pt.Label,label:"Save Page As...",data:{type:u.SavePageAs}}),t?[...r,...xt]:[...r,...Mt]};var $t,Dt;!function(e){e.HomeIndex="/home/",e.HomeSearch="/home/search/",e.HomePagesRename="/home/pages/rename/",e.Dock="/home/dock/",e.BrowserPagesLanding="/browser/pages/landing/",e.HomeIndicator="/home/indicator/",e.Browser="/browser/",e.BrowserPopupMenu="/browser/popup-menu/",e.Provider="/provider/",e.BrowserPopupMenuSharePage="/browser/popup-menu/share-page/",e.BrowserPopupMenuSaveModal="/browser/popup-menu/save-modal/",e.BrowserPopupMenuLayouts="/browser/popup-menu/layouts/layouts/",e.BrowserPopupMenuColorLinking="/browser/popup-menu/color-linking/color-linking/",e.BrowserIndicator="/browser/indicator/",e.ResponseModal="/browser/popup-menu/response-modal/",e.Docs="/provider/docs/",e.Storefront="/storefront/",e.DeprecatedAlert="/provider/deprecated-alert/"}($t||($t={})),function(e){e.IconOpenFinLogo="/icons/openfinlogo.svg",e.IconFilter="/icons/filter.svg"}(Dt||(Dt={}));const Ut={...Dt,...$t};var jt,Vt;!function(e){e.ERROR="error",e.SUCCESS="success",e.INFO="info"}(jt||(jt={})),function(e){e.Home="/home",e.Browser="/browser",e.Provider="/provider",e.Storefront="/storefront"}(Vt||(Vt={}));const Ft="/workspace/7.2.0";function Bt(){return Ft.substring(0,Ft.length-"".length)}function Gt(e){if(!v)throw new Error("getAbsoluteRoutePath can only be used in a window");return function(){if(!window)throw new Error("getAbsoluteBasePath can only be used in a window");return`${window.origin}${Bt()}`}()+e}var qt,Ht=a(677);!function(e){e.RouteChangeComplete="routeChangeComplete"}(qt||(qt={}));new Promise((e=>Ht.default.ready(e)));const zt={alwaysOnTop:!0,autoShow:!1,cornerRounding:{height:5,width:5},frame:!1,resizable:!1,showTaskbarIcon:!1};var Xt;!function(e){e.Locked="LockClosedIcon",e.Unlocked="LockOpen1Icon"}(Xt||(Xt={}));const Kt=function(e=zt){const t=new Map;return async(a,n,r,o)=>{if(t.has(a)){const{currentUrl:e,currentName:r}=t.get(a);if(e===n)return;const o=fin.Window.wrapSync({uuid:fin.me.uuid,name:r});await o.close()}const i=`${M.HomeInternal}-${Date.now()}${Math.random()}`;t.set(a,{currentUrl:n,currentName:i});const s=await fin.Platform.getCurrentSync().createWindow({...e,name:i,url:n});((e,t)=>{const a=document.createElement("div");a.setAttribute("aria-live",t||"polite"),(e=>{e.style.position="absolute",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="-1px",e.style.overflow="hidden",e.style.whiteSpace="nowrap",e.style.border="0"})(a),document.body.appendChild(a),setTimeout((()=>{a.innerHTML=e}),100),setTimeout((()=>{document.body.removeChild(a)}),1e3)})(`New ${o} indicator: ${r}`),s.once("closed",(()=>{t.delete(a)}))}}();async function Qt(e,t,a,n){const r=new URLSearchParams;r.append("type",e),r.append("message",t),r.append("parentName",a),r.append("icon",n||"");const o=`${Gt(Ut.BrowserIndicator)}?${r.toString()}`;return Kt("browser"+a,o,t,e)}function Yt(e,t,a){return Qt(jt.SUCCESS,e,t,a)}const Jt=async(e,t)=>{if(!e)return;const a=t.identity,n=await ke(a),r=It().Browser.wrapSync(t.identity),o=(await r.getPages()).find((e=>e.isActive)),i=e,s=It(),c=await s.Storage.getWorkspaces();switch(e.type){case u.NewWindow:const{newPageUrl:t}=await Ot(a);if(!t)throw new Error("Trying to create a new empty window without a newPageUrl set");It().createView({target:void 0,url:t});break;case u.NewPage:await(async e=>{const t=await Tt(e);await It().Browser.wrapSync(e).addPage(t)})(a);break;case u.CloseWindow:n.dispatch(Ee.CloseBrowserWindow);break;case u.SaveWorkspace:const f=await s.getCurrentWorkspace(),y=f.workspaceId;c.some((e=>e.workspaceId===y))?(s.Storage.saveWorkspace(f),Yt("Workspace Saved!",a.name)):r._openSaveModal({menuType:g.SAVE_WORKSPACE});break;case u.SavePage:if((await It().Storage.getPages()).some((e=>o.pageId===e.pageId)))try{await It().Storage.savePage((h=o,{...h,hasUnsavedChanges:void 0,parentIdentity:void 0,isActive:void 0})),await r.updatePage({pageId:o.pageId,page:{hasUnsavedChanges:!1}}),Yt("Page saved",o.parentIdentity.name)}catch{l="Page failed to save",p=o.parentIdentity.name,Qt(jt.ERROR,l,p,d)}else r._openSaveModal({id:o.pageId,menuType:g.SAVE_PAGE});break;case u.SavePageAs:r._openSaveModal({id:o.pageId,menuType:g.SAVE_PAGE_AS});break;case u.SaveWorkspaceAs:r._openSaveModal({menuType:g.SAVE_WORKSPACE_AS});break;case u.RenameWorkspace:r._openSaveModal({menuType:g.RENAME_WORKSPACE});break;case u.SwitchWorkspace:const m=c.find((e=>e.workspaceId===i.workspaceId));m&&(await s.applyWorkspace(m),Yt("Workspace Switched!",a.name));break;case u.DeleteWorkspace:c.some((e=>e.workspaceId===i.workspaceId))&&(await s.Storage.deleteWorkspace(i.workspaceId),Yt("Workspace Deleted!",a.name));break;case u.Quit:n.dispatch(Ee.QuitPlatform);break;case u.OpenStorefront:(async()=>{await G()&&j(U)})();break;case u.Custom:if(e.action){const t={callerType:w.GlobalContextMenu,windowIdentity:a,customData:e.action.customData};It()._invokeCustomAction(e.action.id,t)}}var l,p,d,h},Zt=async(e,t)=>{const a=await ke(t.identity),n=It();switch(e.type){case p.Save:await n.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.SAVE_PAGE,id:t.pageId});break;case p.SaveAs:await n.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.SAVE_PAGE_AS,id:t.pageId});break;case p.Rename:await n.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.RENAME_PAGE,id:t.pageId});break;case p.Duplicate:a.dispatch(Ee.DuplicatePage,t.pageId);break;case p.Close:a.dispatch(Ee.ClosePage,t.pageId);break;case p.Custom:if(e.action){const a={callerType:w.PageTabContextMenu,windowIdentity:t.identity,pageId:t.pageId,customData:e.action.customData};It()._invokeCustomAction(e.action.id,a)}}},ea=async(e,t)=>{if(e?.type){const a=It();switch(e.type){case f.SavePage:await a.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.SAVE_PAGE,id:t.pageId,x:t.buttonLeft+t.buttonWidth/2-St/2,y:t.y});break;case f.SaveWorkspace:await a.Browser.wrapSync(t.identity)._openSaveModal({menuType:g.SAVE_WORKSPACE,x:t.buttonLeft+t.buttonWidth/2-St/2,y:t.y});break;case f.Custom:if(e.action){const a={callerType:w.SaveButtonContextMenu,windowIdentity:t.identity,pageId:t.pageId,customData:e.action.customData};It()._invokeCustomAction(e.action.id,a)}}}},ta=async(e,t)=>{const a=t.selectedViews[0],n=fin.View.wrapSync(a),r=await(async e=>{const{newTabUrl:t}=await Ot(e);if(!t)throw new Error("Trying to create a new page without a newTabUrl set");return{...Pe("New View",t),url:t,target:e}})(e);await It().createView(r,e,n.identity)},aa=async(e,t)=>{const a=await(e=>Promise.all(e.map((async e=>fin.View.wrapSync(e).getInfo()))))(t),{newPageUrl:n,newTabUrl:r}=await Ot(e);a.forEach((async e=>{e.url!==n&&e.url!==r&&await fin.System.openUrlWithBrowser(e.url)}))},na=(e,t)=>{t.forEach((async t=>{const a=fin.View.wrapSync(t);await(async(e,t)=>{const{url:a}=await t.getInfo(),n={...await t.getOptions(),url:a,target:e,name:void 0};await It().createView(n,e,t.identity)})(e,a)}))},ra=async(e,t)=>{if(!e)return;const a=t.identity;switch(e.type){case d.CloseViews:await(async(e,t)=>{if((await fin.Window.wrapSync(e).getCurrentViews()).length!==t.length)t.forEach((async e=>{const t=fin.View.wrapSync(e);await t.destroy()}));else{const t=(await It().Browser.wrapSync(e).getPages()).find((e=>e.isActive));(await ke(e)).dispatch(Ee.ClosePage,t?.pageId)}})(a,t.selectedViews);break;case d.OpenWithDefaultBrowser:await aa(a,t.selectedViews);break;case d.ReloadViews:t.selectedViews.forEach((async e=>{const t=fin.View.wrapSync(e);await t.reload()}));break;case d.NewView:await ta(a,t);break;case d.DuplicateViews:na(a,t.selectedViews);break;case d.AddToChannel:(async(e,t,a)=>{const n={newChannelId:t,selectedViews:a};(await ke(e)).dispatch(Ee.AddToChannel,n)})(a,e.option,t.selectedViews);break;case d.RemoveFromChannel:(async(e,t)=>{(await ke(e)).dispatch(Ee.RemoveFromChannel,t)})(a,t.selectedViews);break;case d.Custom:if(e.action){const n={callerType:w.ViewTabContextMenu,windowIdentity:a,selectedViews:t.selectedViews,customData:e.action.customData};It()._invokeCustomAction(e.action.id,n)}}};async function oa(e,t){const a=await Nt(e.identity),n={...e,template:a,callback:Jt};await this.openGlobalContextMenu(n,t)}const ia=async(e,t)=>{const{x:a,y:n,identity:r,template:o,callback:i}=e,{data:s}=await function(e,t){if(!m)throw new Error("showContextMenu can only be used in an OpenFin env. Avoid calling this method during pre-rendering.");if(!t&&!fin.me.isWindow)throw new Error("showContextMenu can only be used in an OpenFin window.");return(t||fin.Window.getCurrentSync()).showPopupMenu(e)}({x:a,y:n,template:o},fin.Window.wrapSync(r));i(s,e)};async function sa(e,t){const a={...e,callback:ra};await this.openViewTabContextMenu(a,t)}async function ca(e,t){const a=await It().Storage.getPage(e.pageId),n=await(r=!!a,[{type:Pt.Label,label:"Save Page",data:{type:p.Save}},{type:Pt.Label,label:"Save Page As",data:{type:p.SaveAs}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Rename Page",data:{type:p.Rename},enabled:r},{type:Pt.Label,label:"Duplicate Page",data:{type:p.Duplicate}},{type:Pt.Separator,data:void 0},{type:Pt.Label,label:"Close Page",data:{type:p.Close}}]);var r;const o={...e,template:n,callback:Zt};await this.openPageTabContextMenu(o,t)}async function la(e,t){const a={...e,template:await([{type:Pt.Label,label:"Save Workspace",data:{type:f.SaveWorkspace}},{type:Pt.Label,label:"Save Page",data:{type:f.SavePage}}]),callback:ea};await this.openSaveButtonContextMenu(a,t)}const ua=P&&it("openfin-workspace-platform-workspaces","workspaces");async function pa(e){const t=await ct(e,ua);return t?(t.workspaceId=e.toString(),t.title=t.title||t.workspaceId,t):null}async function da(e){const t=await dt(ua),a=await Promise.all(t.map((e=>pa(e.toString()))));return e?a.filter((t=>ht(t.title,e))):a}async function ha({workspace:e}){await lt(e.workspaceId,e,ua)}async function fa(e){await ut(e,ua)}async function wa({workspaceId:e,workspace:t}){if(void 0===await pa(e))throw new Error("workspace not found");await ha({workspace:t}),e!==t.workspaceId&&await fa(e)}async function ga({app:e,target:t}){const a=fin.Platform.getCurrentSync();switch(e.manifestType){case s.Snapshot:return a.applySnapshot(e.manifest);case s.View:return async function(e,t){const a=fin.Platform.getCurrentSync();if("view"===t.entityType){const a=fin.View.wrapSync(t),n=await a.getParentLayout();return await n.replaceView(t,{manifestUrl:e.manifest,url:void 0,target:void 0}),a.destroy()}return a.createView({name:void 0,url:void 0,manifestUrl:e.manifest,target:void 0})}(e,t);case s.External:return fin.System.launchExternalProcess({path:e.manifest,uuid:e.appId});default:return fin.Application.startFromManifest(e.manifest)}}const ya=e=>e&&"object"==typeof e&&!Array.isArray(e);function ma(e,...t){if(!t.length)return e;const a=t.shift();return ya(e)&&ya(a)&&Object.entries(a).forEach((([t,a])=>{if(ya(a))return e[t]||(e[t]={}),ma(e[t],a);e[t]=a})),ma(e,...t)}const va=E+Ut.Browser;function Pa(e,t){const a=ma({},t,e);return a.detachOnClose=!0,a}async function Sa(e,t,a){const n=e.manifestUrl?await t({manifestUrl:e.manifestUrl},a):void 0;if(n?.interop&&e.interop){const t={...e,...n,interop:e.interop};return delete t.manifestUrl,t}return e}const _a=e=>{const t=e.name===M.Home,a=e.name?.startsWith(M.HomeInternal),n=e.name?.startsWith(M.BrowserMenu);return!t&&!a&&!n},ba=e=>"workspacePlatform"in e?e:(({workstacks:e,pages:t,...a})=>({...a,workspacePlatform:{pages:t||e||null}}))(e),Ca={contextMenuSettings:{reload:!1},backgroundThrottling:!0,url:va,contextMenu:!0,closeOnLastViewRemoved:!1,experimental:{showFavicons:!0,defaultFaviconUrl:`${E}/icons/defaultFavicon.svg`},permissions:{System:{openUrlWithBrowser:{enabled:!0,protocols:["mailto"]}}}},ka={dimensions:{borderWidth:3,headerHeight:30}},Ea=(e,t)=>t?e.map((e=>({...t,...e}))):e,Ra=e=>{const t=fin.Window.wrapSync(e);return Promise.all([t.bringToFront(),t.restore(),t.focus()])};async function Wa(e){const t=await F();return await Promise.all(t.map((({identity:e})=>(async e=>(await ke(e)).dispatch(Re.UpdatePagesWindowOptions))(e)))),e?e():rt()}let Aa=[];const Ia=()=>Aa;const Oa=e=>async t=>{class a extends t{constructor(){super(),this.isWorkspacePlatform=()=>!0,this.addPage=this.attachPagesToWindow,this.detachPagesFromWindow=Ve,this.getAllAttachedPages=Oe,this.getPagesForWindow=Be,this.getPageForWindow=Ge,this.setActivePage=Fe,this.launchApp=ga,this.savePage=De,this.saveWorkspace=he,this.createSavedPageInternal=Le,this.updateSavedPageInternal=$e,this.deleteSavedPageInternal=Ne,this.reorderPagesForWindow=qe,this.getUniquePageTitle=He,this.updatePageForWindow=je,this.getLastFocusedBrowserWindow=we,this.getThemes=Ia,this.invokeCustomActionInternal=Ze,this.getCurrentWorkspace=de,this.applyWorkspace=le,this.setActiveWorkspace=ue,this.openGlobalContextMenuInternal=this.openGlobalContextMenuInternal.bind(this),this.openGlobalContextMenu=this.openGlobalContextMenu.bind(this),this.getSavedPages=this.getSavedPages.bind(this),this.getSavedPage=this.getSavedPage.bind(this),this.createSavedPage=this.createSavedPage.bind(this),this.updateSavedPage=this.updateSavedPage.bind(this),this.deleteSavedPage=this.deleteSavedPage.bind(this),this.attachPagesToWindow=this.attachPagesToWindow.bind(this),this.openViewTabContextMenuInternal=this.openViewTabContextMenuInternal.bind(this),this.openViewTabContextMenu=this.openViewTabContextMenu.bind(this),this.openPageTabContextMenuInternal=this.openPageTabContextMenuInternal.bind(this),this.openPageTabContextMenu=this.openPageTabContextMenu.bind(this),this.getSavedWorkspaces=this.getSavedWorkspaces.bind(this),this.getSavedWorkspace=this.getSavedWorkspace.bind(this),this.createSavedWorkspace=this.createSavedWorkspace.bind(this),this.updateSavedWorkspace=this.updateSavedWorkspace.bind(this),this.deleteSavedWorkspace=this.deleteSavedWorkspace.bind(this),this.getCurrentWorkspace=this.getCurrentWorkspace.bind(this),this.applyWorkspace=this.applyWorkspace.bind(this),this.setActiveWorkspace=this.setActiveWorkspace.bind(this),this.openSaveButtonContextMenu=this.openSaveButtonContextMenu.bind(this),this.openSaveButtonContextMenuInternal=this.openSaveButtonContextMenuInternal.bind(this)}async getSnapshot(){const e=await Wa((async()=>rt(await super.getSnapshot(void 0,fin.me.identity))));return{...e,windows:e.windows.filter(_a)}}async applySnapshot({snapshot:e,options:t}){t?.closeExistingWindows&&await async function(){const e=await F();await Promise.all(e.map((e=>e.close(!0).catch((()=>{})))))}();let a=e;return"string"==typeof a&&(a=await super.fetchManifest({manifestUrl:a},fin.me.identity)),async function(e,t){const a=await Oe(),n=e.snapshotDetails?.monitorInfo||await fin.System.getMonitorInfo(),r=(e.windows||[]).filter((({layout:e})=>!!e)),o=new Map;a.forEach((e=>o.set(e.pageId,e)));const i=[],s=r.map((async e=>{const t=ba(e),a=[],n=(e=>{let t=!1;const a=(e||[]).map((e=>{const a=function({id:e,name:t,...a}){return{pageId:e,title:t,...a}}(e);return t&&a.isActive&&(a.isActive=!1),a.isActive&&(t=!0),a}));return!t&&a.length&&(a[0].isActive=!0),a})(t?.workspacePlatform?.pages);if(!n?.length){const e=await He();a.push(await bt(e,t.layout))}let r;n.forEach((e=>{const t=o.get(e.pageId);t?r=t:a.push(e)})),r&&await Promise.all([Fe({identity:r.parentIdentity,pageId:r.pageId}),Ra(r.parentIdentity)]),a.length&&i.push({...t,workspacePlatform:{...t.workspacePlatform,pages:a}})}));if(await Promise.all(s),!i.length)return;const c=fin.Platform.getCurrentSync();return(t||c.applySnapshot.bind(c))({...e,snapshotDetails:{...e.snapshotDetails,monitorInfo:n},windows:i})}(a,(e=>super.applySnapshot({snapshot:e,options:{...t,closeExistingWindows:!1}})))}async createWindow(t,a){let n=ba(t);const r=await this.getThemes();n=((e,t,a)=>{let n=e;const r=n?.workspacePlatform?.pages;if(r){const e=r.find((e=>e.isActive));e?n.layout=e.layout:(r[0].isActive=!0,n.layout=r[0].layout)}if(n.layout){if(n=ma({},t.defaultWindowOptions,n,Ca),n.layout=ma(n.layout,ka),(n.icon||n.taskbarIcon)&&(n.taskbarIconGroup=n.taskbarIconGroup||fin.me.identity.uuid),!n.backgroundColor){const e=a?.palette;n.backgroundColor=e?.background2||e?.backgroundPrimary}const e=n.workspacePlatform.newTabUrl;e&&(n.layout.settings||(n.layout.settings={}),n.layout.settings.newTabButton={url:e}),n=(e=>{const t=e;return t.workspacePlatform||(t.workspacePlatform={}),t.workspacePlatform._internalDeferShowEnabled=!0,t.workspacePlatform._internalAutoShow=t.workspacePlatform?._internalAutoShow||void 0===t.autoShow||t.autoShow,t.autoShow=!1,t})(n)}return n.workspacePlatform?.pages&&(n.workspacePlatform.pages=Ea(n.workspacePlatform.pages,t?.defaultPageOptions)),n.cornerRounding&&delete n.cornerRounding,n})(n,e,r[0]),n=await(async e=>{const t=await fin.System.getMonitorInfo(),a=t.primaryMonitor.availableRect.bottom-t.primaryMonitor.availableRect.top,n=t.primaryMonitor.availableRect.right-t.primaryMonitor.availableRect.left;return e.defaultHeight=e.defaultHeight||"800",e.defaultWidth=e.defaultWidth||"800",a<e.defaultHeight&&(e.defaultHeight=a),n<e.defaultWidth&&(e.defaultWidth=n),e})(n);return(e=>async(t,a)=>{const n=await e(t,a);return t?.workspacePlatform?._internalDeferShowEnabled?(await n.addListener(L.ShowRequested,(()=>{})),n):n})(((e,t)=>super.createWindow(e,t)))(n,a)}async createView(t,a){return t.opts=Pa(t.opts,e?.defaultViewOptions),t.opts=await Sa(t.opts,this.fetchManifest,a),super.createView(t,a)}async replaceView(t,a){return t.opts.newView=await Pa(t.opts.newView,e?.defaultViewOptions),t.opts.newView=await Sa(t.opts.newView,this.fetchManifest,a),super.replaceView(t,a)}async replaceLayout(e,t){return e.opts.layout?.dimensions,super.replaceLayout(e,t)}async closeView(e,t){const a=fin.View.wrapSync(e.view);await super.closeView(e,t),await a.destroy().catch((e=>e))}async getSavedPage(...e){return wt.apply(this,e)}async getSavedPages(...e){return gt.apply(this,e)}async createSavedPage(...e){return yt.apply(this,e)}async deleteSavedPage(...e){return mt.apply(this,e)}async updateSavedPage(...e){return vt.apply(this,e)}async getSavedWorkspace(...e){return pa.apply(this,e)}async getSavedWorkspaces(...e){return da.apply(this,e)}async createSavedWorkspace(...e){return ha.apply(this,e)}async deleteSavedWorkspace(...e){return fa.apply(this,e)}async updateSavedWorkspace(...e){return wa.apply(this,e)}async attachPagesToWindow(t){t.pages=Ea(t.pages,e?.defaultPageOptions),await Ue(t)}async openGlobalContextMenuInternal(...e){return oa.apply(this,e)}async openGlobalContextMenu(...e){return ia.apply(this,e)}async openViewTabContextMenuInternal(...e){return sa.apply(this,e)}async openViewTabContextMenu(...e){return ia.apply(this,e)}async openPageTabContextMenuInternal(...e){return ca.apply(this,e)}async openPageTabContextMenu(...e){return ia.apply(this,e)}async openSaveButtonContextMenu(...e){return ia.apply(this,e)}async openSaveButtonContextMenuInternal(...e){return la.apply(this,e)}}return"function"==typeof e?.overrideCallback?e.overrideCallback(a):new a};async function Ta(){Ye(),async function(){const e=fin.Application.getCurrentSync();await e.addListener("window-focused",ge)}();ue(await pe())}let xa;function Ma(e){if(!m)throw new Error("Cannot be used outside an OpenFin env.");if(!xa){fin.Platform.getCurrentSync().once("platform-api-ready",(()=>Ta())),xa=fin.Platform.init({overrideCallback:Oa(e),interopOverride:e?.interopOverride}),(async e=>{H(q.Platform,e)})({allowed:!0})}return xa}const La=async e=>{const t=R.split(".").map((e=>parseInt(e))),a=await(async e=>new Promise((async t=>{const a=(await fin.System.getVersion()).split(".").map((e=>parseInt(e)));t(e.every(((t,n)=>!(n<3)||a[n]===e[n])))})))(t),n=e?.theme;var r;if(n&&((r=n).forEach((e=>{const t=e.palette.backgroundPrimary;if(!t.includes("#")&&!t.includes("rgb")&&!t.includes("hsl"))throw new Error("Background primary color is not the right format.")})),Aa=r,(async e=>{H(q.Theming,e)})({allowed:!0})),e?.customActions&&(Je=e?.customActions),a){return Ma(e?.browser)}throw new Error(`Runtime version is not supported. ${t[0]}.${t[1]}.${t[2]}.* is required`)}})(),module.exports=n})();
|
|
3
3
|
//# sourceMappingURL=index.js.map
|