@olenbetong/appframe-core 2.11.6 → 2.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -149,8 +149,7 @@ async function time(callback) {
149
149
  }
150
150
  async function logError(error) {
151
151
  try {
152
- if (!error)
153
- return;
152
+ if (!error) return;
154
153
  let data = typeof error === "string" ? { error } : typeof error === "object" ? "message" in error ? {
155
154
  error: error.message,
156
155
  stack: error.stack ?? null
@@ -289,7 +288,7 @@ function toLocalDateTime(date) {
289
288
 
290
289
  // src/downloadBlob.ts
291
290
  function downloadBlob(blob, fileName) {
292
- return new Promise(function(resolve, reject) {
291
+ return new Promise((resolve, reject) => {
293
292
  try {
294
293
  const url = URL.createObjectURL(blob);
295
294
  const parent = document.body;
@@ -299,7 +298,7 @@ function downloadBlob(blob, fileName) {
299
298
  parent.append(anchor);
300
299
  anchor.click();
301
300
  parent.removeChild(anchor);
302
- setTimeout(function() {
301
+ setTimeout(() => {
303
302
  URL.revokeObjectURL(url);
304
303
  resolve();
305
304
  }, 250);
@@ -334,9 +333,9 @@ async function downloadRequest(request, { fileName, signal, onProgress }) {
334
333
  try {
335
334
  const reader = response.body.getReader();
336
335
  const stream = new ReadableStream({
337
- start: function(controller) {
336
+ start: (controller) => {
338
337
  function pump() {
339
- return reader.read().then(function(read) {
338
+ return reader.read().then((read) => {
340
339
  if (read.done) {
341
340
  controller.close();
342
341
  return;
@@ -369,7 +368,7 @@ async function downloadRequest(request, { fileName, signal, onProgress }) {
369
368
  // src/parseFunc.ts
370
369
  var funcRegex = /^function(?:\s+([a-zA-Z$_][a-zA-Z0-9$_]*))?\s*\(((?:(?:\s*[a-zA-Z$_][a-zA-Z0-9$_]*)(?:\s*,\s*[a-zA-Z$_][a-zA-Z0-9$_]*)*)?)\s*\)\s*\{((?:.|\n|\r)*)\}$/;
371
370
  function parseFunc(func) {
372
- var match = func.toString().match(funcRegex);
371
+ const match = func.toString().match(funcRegex);
373
372
  invariant(match, "Unable to parse function!");
374
373
  return { name: func.name ?? match[1], args: match[2].split(",").map((a) => a.trim()), body: match[3] };
375
374
  }
@@ -426,7 +425,7 @@ function expose(name, value, options = {}) {
426
425
  invariant(false, "Invalid typeof parameter 'name', or unable to parse pValue!");
427
426
  }
428
427
  if (Object.hasOwn(namespace, keyName) && options?.overwrite !== true) {
429
- console.warn([name, keyName].join(".") + " is already defined!");
428
+ console.warn(`${[name, keyName].join(".")} is already defined!`);
430
429
  } else {
431
430
  namespace[keyName] = value;
432
431
  }
@@ -504,7 +503,7 @@ function localize(stringParts, ...args) {
504
503
  let stringToLocalize = stringParts.map((s, i) => i === stringParts.length - 1 ? s : `${s}$${i}`).join("");
505
504
  let localized = getLocalizedString(stringToLocalize);
506
505
  args.forEach((arg, index) => {
507
- localized = localized.replace("$" + index, arg);
506
+ localized = localized.replace(`$${index}`, arg);
508
507
  });
509
508
  return localized;
510
509
  }
@@ -515,8 +514,7 @@ function getKey(article2) {
515
514
  return `${articleKey}.${window.af?.userSession.login ?? "anonymous"}`;
516
515
  }
517
516
  function getSettings(setting, article2) {
518
- if (!window.af?.userSession)
519
- return null;
517
+ if (!window.af?.userSession) return null;
520
518
  const key = getKey(article2);
521
519
  const settings = JSON.parse(localStorage.getItem(key) || "{}");
522
520
  if (setting) {
@@ -525,8 +523,7 @@ function getSettings(setting, article2) {
525
523
  return settings;
526
524
  }
527
525
  function saveSettings(setting, value, article2) {
528
- if (!window.af?.userSession)
529
- return;
526
+ if (!window.af?.userSession) return;
530
527
  const key = getKey(article2);
531
528
  let userSettings = JSON.parse(localStorage.getItem(key) || "{}");
532
529
  if (typeof value !== "undefined") {
@@ -581,15 +578,15 @@ async function openAlertDialog({ buttons, content, className, id, title }) {
581
578
  return await alertDialogPromiseMap.get(id);
582
579
  }
583
580
  let $template = document.querySelector("#AlertDialogTemplate");
584
- if (!$template)
585
- throw Error("No alert dialog template found");
581
+ if (!$template) throw Error("No alert dialog template found");
586
582
  let $dialog = $template.content.firstElementChild?.cloneNode(true);
587
583
  let $content = $dialog?.querySelector("article");
588
584
  let $menu = $dialog?.querySelector("footer menu");
589
- if (!$dialog || !$content || !$menu)
590
- throw Error("Invalid alert dialog template");
585
+ if (!$dialog || !$content || !$menu) throw Error("Invalid alert dialog template");
591
586
  if (className) {
592
- className.split(/\s+/).forEach((className2) => $dialog?.classList.add(className2));
587
+ for (const className_ of className.split(/\s+/)) {
588
+ $dialog?.classList.add(className_);
589
+ }
593
590
  }
594
591
  if (title) {
595
592
  let $header = document.createElement("header");
@@ -614,8 +611,7 @@ async function openAlertDialog({ buttons, content, className, id, title }) {
614
611
  if (id && alertDialogPromiseMap.has(id)) {
615
612
  alertDialogPromiseMap.delete(id);
616
613
  }
617
- if ($dialog)
618
- document.body.removeChild($dialog);
614
+ if ($dialog) document.body.removeChild($dialog);
619
615
  return returnValue;
620
616
  });
621
617
  if (id) {
@@ -650,7 +646,7 @@ async function alert(prompt, options = {}) {
650
646
  }
651
647
 
652
648
  // src/index.ts
653
- var version = "2.11.6";
649
+ var version = "2.11.7";
654
650
  export {
655
651
  ConfirmButtons,
656
652
  SessionHandler,
@@ -17,10 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __publicField = (obj, key, value) => {
21
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
- return value;
23
- };
20
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
21
 
25
22
  // ../../node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs
26
23
  function mitt_default(n) {
@@ -177,8 +174,7 @@ async function time(callback) {
177
174
  async function logError(error) {
178
175
  var _a3;
179
176
  try {
180
- if (!error)
181
- return;
177
+ if (!error) return;
182
178
  let data = typeof error === "string" ? { error } : typeof error === "object" ? "message" in error ? {
183
179
  error: error.message,
184
180
  stack: (_a3 = error.stack) != null ? _a3 : null
@@ -325,7 +321,7 @@ function toLocalDateTime(date) {
325
321
 
326
322
  // src/downloadBlob.ts
327
323
  function downloadBlob(blob, fileName) {
328
- return new Promise(function(resolve, reject) {
324
+ return new Promise((resolve, reject) => {
329
325
  try {
330
326
  const url = URL.createObjectURL(blob);
331
327
  const parent = document.body;
@@ -335,7 +331,7 @@ function downloadBlob(blob, fileName) {
335
331
  parent.append(anchor);
336
332
  anchor.click();
337
333
  parent.removeChild(anchor);
338
- setTimeout(function() {
334
+ setTimeout(() => {
339
335
  URL.revokeObjectURL(url);
340
336
  resolve();
341
337
  }, 250);
@@ -371,9 +367,9 @@ async function downloadRequest(request, { fileName, signal, onProgress }) {
371
367
  try {
372
368
  const reader = response.body.getReader();
373
369
  const stream = new ReadableStream({
374
- start: function(controller) {
370
+ start: (controller) => {
375
371
  function pump() {
376
- return reader.read().then(function(read) {
372
+ return reader.read().then((read) => {
377
373
  if (read.done) {
378
374
  controller.close();
379
375
  return;
@@ -407,7 +403,7 @@ async function downloadRequest(request, { fileName, signal, onProgress }) {
407
403
  var funcRegex = /^function(?:\s+([a-zA-Z$_][a-zA-Z0-9$_]*))?\s*\(((?:(?:\s*[a-zA-Z$_][a-zA-Z0-9$_]*)(?:\s*,\s*[a-zA-Z$_][a-zA-Z0-9$_]*)*)?)\s*\)\s*\{((?:.|\n|\r)*)\}$/;
408
404
  function parseFunc(func) {
409
405
  var _a3;
410
- var match = func.toString().match(funcRegex);
406
+ const match = func.toString().match(funcRegex);
411
407
  invariant(match, "Unable to parse function!");
412
408
  return { name: (_a3 = func.name) != null ? _a3 : match[1], args: match[2].split(",").map((a) => a.trim()), body: match[3] };
413
409
  }
@@ -464,7 +460,7 @@ function expose(name, value, options = {}) {
464
460
  invariant(false, "Invalid typeof parameter 'name', or unable to parse pValue!");
465
461
  }
466
462
  if (Object.hasOwn(namespace, keyName) && (options == null ? void 0 : options.overwrite) !== true) {
467
- console.warn([name, keyName].join(".") + " is already defined!");
463
+ console.warn("".concat([name, keyName].join("."), " is already defined!"));
468
464
  } else {
469
465
  namespace[keyName] = value;
470
466
  }
@@ -543,7 +539,7 @@ function localize(stringParts, ...args) {
543
539
  let stringToLocalize = stringParts.map((s, i) => i === stringParts.length - 1 ? s : "".concat(s, "$").concat(i)).join("");
544
540
  let localized = getLocalizedString(stringToLocalize);
545
541
  args.forEach((arg, index) => {
546
- localized = localized.replace("$" + index, arg);
542
+ localized = localized.replace("$".concat(index), arg);
547
543
  });
548
544
  return localized;
549
545
  }
@@ -556,8 +552,7 @@ function getKey(article2) {
556
552
  }
557
553
  function getSettings(setting, article2) {
558
554
  var _a3;
559
- if (!((_a3 = window.af) == null ? void 0 : _a3.userSession))
560
- return null;
555
+ if (!((_a3 = window.af) == null ? void 0 : _a3.userSession)) return null;
561
556
  const key = getKey(article2);
562
557
  const settings = JSON.parse(localStorage.getItem(key) || "{}");
563
558
  if (setting) {
@@ -567,8 +562,7 @@ function getSettings(setting, article2) {
567
562
  }
568
563
  function saveSettings(setting, value, article2) {
569
564
  var _a3;
570
- if (!((_a3 = window.af) == null ? void 0 : _a3.userSession))
571
- return;
565
+ if (!((_a3 = window.af) == null ? void 0 : _a3.userSession)) return;
572
566
  const key = getKey(article2);
573
567
  let userSettings = JSON.parse(localStorage.getItem(key) || "{}");
574
568
  if (typeof value !== "undefined") {
@@ -615,15 +609,15 @@ async function openAlertDialog({ buttons, content, className, id, title }) {
615
609
  return await alertDialogPromiseMap.get(id);
616
610
  }
617
611
  let $template = document.querySelector("#AlertDialogTemplate");
618
- if (!$template)
619
- throw Error("No alert dialog template found");
612
+ if (!$template) throw Error("No alert dialog template found");
620
613
  let $dialog = (_a3 = $template.content.firstElementChild) == null ? void 0 : _a3.cloneNode(true);
621
614
  let $content = $dialog == null ? void 0 : $dialog.querySelector("article");
622
615
  let $menu = $dialog == null ? void 0 : $dialog.querySelector("footer menu");
623
- if (!$dialog || !$content || !$menu)
624
- throw Error("Invalid alert dialog template");
616
+ if (!$dialog || !$content || !$menu) throw Error("Invalid alert dialog template");
625
617
  if (className) {
626
- className.split(/\s+/).forEach((className2) => $dialog == null ? void 0 : $dialog.classList.add(className2));
618
+ for (const className_ of className.split(/\s+/)) {
619
+ $dialog == null ? void 0 : $dialog.classList.add(className_);
620
+ }
627
621
  }
628
622
  if (title) {
629
623
  let $header = document.createElement("header");
@@ -648,8 +642,7 @@ async function openAlertDialog({ buttons, content, className, id, title }) {
648
642
  if (id && alertDialogPromiseMap.has(id)) {
649
643
  alertDialogPromiseMap.delete(id);
650
644
  }
651
- if ($dialog)
652
- document.body.removeChild($dialog);
645
+ if ($dialog) document.body.removeChild($dialog);
653
646
  return returnValue;
654
647
  });
655
648
  if (id) {
@@ -683,7 +676,7 @@ async function alert(prompt, options = {}) {
683
676
  }
684
677
 
685
678
  // src/index.ts
686
- var version = "2.11.6";
679
+ var version = "2.11.7";
687
680
  export {
688
681
  ConfirmButtons,
689
682
  SessionHandler,
@@ -1,2 +1,2 @@
1
- var oe=Object.defineProperty,re=Object.defineProperties;var ie=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var ae=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var A=(e,t,o)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,g=(e,t)=>{for(var o in t||(t={}))ae.call(t,o)&&A(e,o,t[o]);if($)for(var o of $(t))le.call(t,o)&&A(e,o,t[o]);return e},C=(e,t)=>re(e,ie(t));var l=(e,t,o)=>(A(e,typeof t!="symbol"?t+"":t,o),o);function I(e){return{all:e=e||new Map,on:function(t,o){var n=e.get(t);n?n.push(o):e.set(t,[o])},off:function(t,o){var n=e.get(t);n&&(o?n.splice(n.indexOf(o)>>>0,1):e.set(t,[]))},emit:function(t,o){var n=e.get(t);n&&n.slice().map(function(r){r(o)}),(n=e.get("*"))&&n.slice().map(function(r){r(t,o)})}}}var m=class{constructor(){l(this,"eventHandler",I())}authenticated(){this.eventHandler.emit("onAuthenticated")}async expired(t,o){try{let n=new Promise(i=>{let a=()=>{this.eventHandler.off("onAuthenticated",a),t==null||t(),i()};this.eventHandler.on("onAuthenticated",a)}),r=document.querySelector("dialog.session-expired-dialog");if(r)await n;else{r=document.createElement("dialog"),r.className="session-expired-dialog",r.style.display="flex",r.style.padding="0",r.style.left="50%",r.style.transform="translateX(-50%)";let i="/login?ReturnUrl=%2fapi/sessionexpired/remove";o!=="RequireTwoFactor"?await fetch("/logout",{method:"POST"}):i="/login?RequireTwoFactor=1&ReturnUrl=%2fapi/sessionexpired/remove",r.innerHTML='<iframe sandbox="allow-same-origin allow-scripts allow-modals allow-top-navigation-by-user-activation allow-forms" src="'.concat(i,'" style="border:0;width:min(500px,100vw);height:min(700px, 100vh);"></iframe>'),document.body.append(r),r.showModal(),await n,r.remove()}}catch(n){window.location.href="/login?ReturnUrl=".concat(encodeURIComponent(window.location.pathname)).concat(encodeURIComponent(window.location.search))}}attachEvent(t,o){return this.eventHandler.on(t,o)}detachEvent(t,o){return this.eventHandler.off(t,o)}};var L=class extends m{constructor(o){super();l(this,"amDesignator","a.m.");l(this,"dayNames",["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]);l(this,"dayNamesShort",["sun","mon","tue","wed","thu","fri","sat"]);l(this,"decimalSeparator",".");l(this,"domain","OB");l(this,"email");l(this,"formats");l(this,"groupSeparator",null);l(this,"integratedSecurity",!1);l(this,"isDeveloper",!1);l(this,"login","");l(this,"loginType");l(this,"monthNames",["january","february","march","april","may","june","july","august","september","october","november","december",""]);l(this,"monthNamesShort",["jan","feb","mar","apr","may","jun","jul","augt","sep","oct","nov","dec",""]);l(this,"name");l(this,"pmDesignator","p.m.");l(this,"shortDateFormat","dd.MM.yyyy");l(this,"culture","en-GB");l(this,"uiculture","en-GB");this.formats={},Object.assign(this,o)}};var _,H,M,q,k=(q=(H=(_=window.af)==null?void 0:_.article)==null?void 0:H.id)!=null?q:(M=window.window)==null?void 0:M.location.pathname.substring(1).split("/")[0];async function T(e,t={},o=0){var n;try{let r=await fetch("/api/logging/log-activity",{method:"POST",body:JSON.stringify({article:k,timeElapsed:o,action:e,parameters:C(g({},t),{_session:E()})}),headers:{"Content-Type":"application/json",Accept:"application/json"}});if(!r.ok)if((n=r.headers.get("Content-Type"))!=null&&n.includes("application/json")){let i=await r.json();console.error(i.error)}else console.error("".concat(r.status," ").concat(r.statusText))}catch(r){}}function se(e,t={}){let o=performance.now();return(n={})=>T(e,g(g({},t),n),performance.now()-o)}async function ce(e){let t=performance.now();return[await e(),performance.now()-t]}async function D(e){var t;try{if(!e)return;let o=typeof e=="string"?{error:e}:typeof e=="object"?"message"in e?{error:e.message,stack:(t=e.stack)!=null?t:null}:{error:e.toString()}:{error:"Unspecified error"};console.error(e);let n=await fetch("/data/Logger/LogError",{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json; charset=utf-8"}});if(n.ok)return await n.json();console.error(Error("Failed to log error"))}catch(o){}}function B(){var e;return(e=crypto.randomUUID)==null?void 0:e.call(crypto)}var U=Date.now(),F=B(),S="",x="";if("document"in window){let e=()=>{var t,o,n,r,i,a;return T("AfSessionInit",{"appframe-core":(o=(t=window.af)==null?void 0:t.common)==null?void 0:o.version,"appframe-data":(r=(n=window.af)==null?void 0:n.data)==null?void 0:r.version,"app-version":(a=(i=window.af)==null?void 0:i.article)==null?void 0:a.version})};document.addEventListener("DOMContentLoaded",()=>{S=localStorage.getItem("_afDeviceId"),x=sessionStorage.getItem("_afSessionId"),S||(S=B(),localStorage.setItem("_afDeviceId",S)),x||(x=F,sessionStorage.setItem("_afSessionId",x)),e()}),document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"?navigator.sendBeacon("/api/logging/log-activity",JSON.stringify({article:k,action:"AfSessionEnd",parameters:{_session:E()}})):e()})}function E(){return{browserSessionId:x,sessionStart:U,sessionLength:Date.now()-U,sessionId:F,deviceId:S}}var J;(J=window.window)==null||J.addEventListener("error",e=>{typeof e=="object"&&"error"in e?D(e.error):typeof e=="object"&&"message"in e&&D(e)});function K(e){var t;return[((t=af==null?void 0:af.article)==null?void 0:t.id)||"","common",e].join(".")}var z=class{constructor(){l(this,"isPersisted",()=>!0)}getLocalStorageKey(t,o){return o?["common",t].join("."):K(t)}get(t,o,n){let r=this.getLocalStorageKey(t,n),i=localStorage.getItem(r);return i!==null?JSON.parse(i):o}set(t,o,n){localStorage.setItem(this.getLocalStorageKey(t,n),JSON.stringify(o))}remove(t,o){let n=this.getLocalStorageKey(t,o);return localStorage.getItem(n)!==null?(localStorage.removeItem(n),!0):!1}clear(){let t=K("");for(let o in localStorage)o.slice(0,t.length)===t&&localStorage.removeItem(o)}},ue=new z;function de(e){return e?V(e).substring(0,10):null}function p(e,t=2){return String(e).padStart(t,"0")}function V(e){return e?"".concat(e.getFullYear(),"-").concat(p(e.getMonth()+1),"-").concat(p(e.getDate()),"T").concat(p(e.getHours()),":").concat(p(e.getMinutes()),":").concat(p(e.getSeconds()),".").concat(p(e.getMilliseconds(),3)):null}function fe(e){return e?e.toISOString().substring(0,16):""}function O(e,t){return new Promise(function(o,n){try{let r=URL.createObjectURL(e),i=document.body,a=document.createElement("a");a.setAttribute("download",t),a.href=r,i.append(a),a.click(),i.removeChild(a),setTimeout(function(){URL.revokeObjectURL(r),o()},250)}catch(r){n(r)}})}function c(e,t){if(e)return;let o=typeof t=="function"?t():t;throw new Error(o!=null?o:"Invariant failed")}async function ge(e,{fileName:t,signal:o,onProgress:n}){var i;let r=0;n==null||n({status:"requested"});try{let a=await fetch(e);if(!a.ok||!a.body){if((i=a.headers.get("content-type"))!=null&&i.includes("application/json")){let f=await a.json();c(!f.error,f.error)}throw new Error("".concat(a.status," ").concat(a.statusText))}try{let f=a.body.getReader(),v=new ReadableStream({start:function(y){function h(){return f.read().then(function(s){if(s.done){y.close();return}return r+=s.value.length,n==null||n({bytesReceived:r,status:"downloading"}),y.enqueue(s.value),h()})}return h()}});a=new Response(v)}catch(f){}let u=await a.blob();n==null||n({bytesReceived:r,status:"downloaded"}),await O(u,t),n==null||n({bytesReceived:r,status:"completed"})}catch(a){o!=null&&o.aborted?n==null||n({status:"cancelled"}):n==null||n({error:a.message,status:"error"})}}var me=/^function(?:\s+([a-zA-Z$_][a-zA-Z0-9$_]*))?\s*\(((?:(?:\s*[a-zA-Z$_][a-zA-Z0-9$_]*)(?:\s*,\s*[a-zA-Z$_][a-zA-Z0-9$_]*)*)?)\s*\)\s*\{((?:.|\n|\r)*)\}$/;function j(e){var o;var t=e.toString().match(me);return c(t,"Unable to parse function!"),{name:(o=e.name)!=null?o:t[1],args:t[2].split(",").map(n=>n.trim()),body:t[3]}}function Z(){}Z.prototype=Object.create(null);var Y=Z;function N(e,t){if(typeof e=="object"){if(typeof t=="string"){let o=t.split(".");return N(e,o)}else if(Array.isArray(t)){let o=e;for(let n=0;n<t.length;n++)o=o[t[n]]=o[t[n]]||new Y;return o}}}function X(e,t,o={}){if(Array.isArray(t))for(let n of t){let{name:r}=j(n);c(r,"Unable to detect name of function! Name it, or only supply one function and include name in first parameter."),X(e,n)}else{let n,r;if(typeof t=="function"&&(n=j(t).name),typeof e=="string"){let i=e.split(".");n||(n=i[i.length-1],i=i.slice(0,i.length-1)),r=N(window,i)}else n&&(typeof e=="object"||typeof e=="function")?r=e:c(!1,"Invalid typeof parameter 'name', or unable to parse pValue!");Object.hasOwn(r,n)&&(o==null?void 0:o.overwrite)!==!0?console.warn([e,n].join(".")+" is already defined!"):r[n]=t}}var pe={xs:64,sm:128,md:256,lg:512,xl:void 0};function G(e,t,o,n="xs"){if(e&&typeof e=="object")return G(e.primKey,e.login,e.hash,e.size);if(!e||!o)return"";let r=pe[n];return"/api/data/blob/EmployeesLookup/".concat(e,"/Image/").concat(encodeURIComponent(t!=null?t:"")).concat(t?".":"").concat(encodeURIComponent(o),".jpg").concat(r?"?width=".concat(r):"")}async function ye(e){try{let t=await fetch("/api/user/localize/new/".concat(af.article.id),{body:JSON.stringify({text:e}),headers:{Accept:"application/json; */*","Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},method:"POST"});if(t.ok)return await t.json()}catch(t){}return e}function d(e,t){var o,n;if(typeof e=="string"&&e.trim().length===0)return e;if(!(e===void 0||e===""||e===null))if(((n=(o=window.af)==null?void 0:o.article)==null?void 0:n.i18n)!==void 0){if(!Object.hasOwn(af.article.i18n,e)){af.article.i18n[e]=e;let r=ye(e).then(i=>(af.article.i18n[e]=i,i));if(t)return r}return af.article.i18n[e]}else return e}function he(e,...t){c(Array.isArray(e)&&e.length===t.length+1,"Method 'localize' must be used as a tag function");let o=e.map((r,i)=>i===e.length-1?r:"".concat(r,"$").concat(i)).join(""),n=d(o);return t.forEach((r,i)=>{n=n.replace("$"+i,r)}),n}function W(e){var o,n,r,i,a,u;let t=(i=e!=null?e:(n=(o=window.af)==null?void 0:o.article)==null?void 0:n.id)!=null?i:(r=window.window)==null?void 0:r.location.pathname.substring(1).split("/")[0];return"".concat(t,".").concat((u=(a=window.af)==null?void 0:a.userSession.login)!=null?u:"anonymous")}function be(e,t){var r;if(!((r=window.af)!=null&&r.userSession))return null;let o=W(t),n=JSON.parse(localStorage.getItem(o)||"{}");return e?n[e]||null:n}function Se(e,t,o){var i;if(!((i=window.af)!=null&&i.userSession))return;let n=W(o),r=JSON.parse(localStorage.getItem(n)||"{}");typeof t<"u"?r[e]=t:r=e,localStorage.setItem(n,JSON.stringify(r))}var xe='\n <dialog class="alert-dialog">\n <form method="dialog">\n <article></article>\n <footer>\n <menu></menu>\n </footer>\n </form>\n </dialog>\n';if(window.document&&!document.querySelector("#AlertDialogTemplate")){let e=document.createElement("template");e.id="AlertDialogTemplate",e.innerHTML=xe,document.body.append(e)}function Q(e,t="No"){return new Promise(o=>{let n=new AbortController;e.addEventListener("close",()=>{o(e.returnValue),n.abort()},{signal:n.signal}),e.addEventListener("cancel",()=>{o(t),n.abort()},{signal:n.signal})})}var w=new Map;async function R({buttons:e,content:t,className:o,id:n,title:r}){var y,h;if(n&&w.has(n))return await w.get(n);let i=document.querySelector("#AlertDialogTemplate");if(!i)throw Error("No alert dialog template found");let a=(y=i.content.firstElementChild)==null?void 0:y.cloneNode(!0),u=a==null?void 0:a.querySelector("article"),f=a==null?void 0:a.querySelector("footer menu");if(!a||!u||!f)throw Error("Invalid alert dialog template");if(o&&o.split(/\s+/).forEach(s=>a==null?void 0:a.classList.add(s)),r){let s=document.createElement("header");s.append(r),(h=u.parentNode)==null||h.insertBefore(s,u)}u.appendChild(typeof t=="string"?document.createTextNode(t):t);for(let{label:s,value:ee,primary:te}of e){let ne=document.createElement("li"),b=document.createElement("button");b.value=ee,te&&b.classList.add("primary"),b.textContent=s,ne.appendChild(b),f.appendChild(b)}document.body.appendChild(a),a.showModal();let v=Q(a).then(s=>(n&&w.has(n)&&w.delete(n),a&&document.body.removeChild(a),s));return n&&w.set(n,v),await v}var P=(o=>(o[o.YesNo=0]="YesNo",o[o.OkCancel=1]="OkCancel",o))(P||{});async function we(e,t={}){let{buttons:o=0,title:n}=t,r=o===1?[{label:d("OK"),value:"yes",primary:!0},{label:d("Cancel"),value:"no"}]:[{label:d("Yes"),value:"yes",primary:!0},{label:d("No"),value:"no"}];return await R({content:e,buttons:r,className:"alert-dialog-confirm",title:n})==="yes"}async function ve(e,t={}){await R(g({content:e,className:"alert-dialog-alert",buttons:[{label:d("OK"),value:"ok",primary:!0}]},t))}var dt="2.11.6";export{P as ConfirmButtons,m as SessionHandler,L as UserSession,ve as alert,we as confirm,O as downloadBlob,ge as downloadRequest,X as expose,d as getLocalizedString,E as getSessionData,be as getSettings,G as getUserImage,c as invariant,ue as localStorage,he as localize,T as logActivity,D as logError,I as mitt,R as openAlertDialog,Se as saveSettings,se as startActivity,ce as time,fe as toLocalDateTime,de as toLocalISODate,V as toLocalISODateTime,dt as version,Q as waitForDialog};
1
+ var oe=Object.defineProperty,re=Object.defineProperties;var ie=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var ae=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var A=(e,t,o)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,p=(e,t)=>{for(var o in t||(t={}))ae.call(t,o)&&A(e,o,t[o]);if(R)for(var o of R(t))le.call(t,o)&&A(e,o,t[o]);return e},C=(e,t)=>re(e,ie(t));var l=(e,t,o)=>A(e,typeof t!="symbol"?t+"":t,o);function I(e){return{all:e=e||new Map,on:function(t,o){var n=e.get(t);n?n.push(o):e.set(t,[o])},off:function(t,o){var n=e.get(t);n&&(o?n.splice(n.indexOf(o)>>>0,1):e.set(t,[]))},emit:function(t,o){var n=e.get(t);n&&n.slice().map(function(r){r(o)}),(n=e.get("*"))&&n.slice().map(function(r){r(t,o)})}}}var g=class{constructor(){l(this,"eventHandler",I())}authenticated(){this.eventHandler.emit("onAuthenticated")}async expired(t,o){try{let n=new Promise(i=>{let a=()=>{this.eventHandler.off("onAuthenticated",a),t==null||t(),i()};this.eventHandler.on("onAuthenticated",a)}),r=document.querySelector("dialog.session-expired-dialog");if(r)await n;else{r=document.createElement("dialog"),r.className="session-expired-dialog",r.style.display="flex",r.style.padding="0",r.style.left="50%",r.style.transform="translateX(-50%)";let i="/login?ReturnUrl=%2fapi/sessionexpired/remove";o!=="RequireTwoFactor"?await fetch("/logout",{method:"POST"}):i="/login?RequireTwoFactor=1&ReturnUrl=%2fapi/sessionexpired/remove",r.innerHTML='<iframe sandbox="allow-same-origin allow-scripts allow-modals allow-top-navigation-by-user-activation allow-forms" src="'.concat(i,'" style="border:0;width:min(500px,100vw);height:min(700px, 100vh);"></iframe>'),document.body.append(r),r.showModal(),await n,r.remove()}}catch(n){window.location.href="/login?ReturnUrl=".concat(encodeURIComponent(window.location.pathname)).concat(encodeURIComponent(window.location.search))}}attachEvent(t,o){return this.eventHandler.on(t,o)}detachEvent(t,o){return this.eventHandler.off(t,o)}};var L=class extends g{constructor(o){super();l(this,"amDesignator","a.m.");l(this,"dayNames",["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]);l(this,"dayNamesShort",["sun","mon","tue","wed","thu","fri","sat"]);l(this,"decimalSeparator",".");l(this,"domain","OB");l(this,"email");l(this,"formats");l(this,"groupSeparator",null);l(this,"integratedSecurity",!1);l(this,"isDeveloper",!1);l(this,"login","");l(this,"loginType");l(this,"monthNames",["january","february","march","april","may","june","july","august","september","october","november","december",""]);l(this,"monthNamesShort",["jan","feb","mar","apr","may","jun","jul","augt","sep","oct","nov","dec",""]);l(this,"name");l(this,"pmDesignator","p.m.");l(this,"shortDateFormat","dd.MM.yyyy");l(this,"culture","en-GB");l(this,"uiculture","en-GB");this.formats={},Object.assign(this,o)}};var U,H,M,q,k=(q=(H=(U=window.af)==null?void 0:U.article)==null?void 0:H.id)!=null?q:(M=window.window)==null?void 0:M.location.pathname.substring(1).split("/")[0];async function T(e,t={},o=0){var n;try{let r=await fetch("/api/logging/log-activity",{method:"POST",body:JSON.stringify({article:k,timeElapsed:o,action:e,parameters:C(p({},t),{_session:E()})}),headers:{"Content-Type":"application/json",Accept:"application/json"}});if(!r.ok)if((n=r.headers.get("Content-Type"))!=null&&n.includes("application/json")){let i=await r.json();console.error(i.error)}else console.error("".concat(r.status," ").concat(r.statusText))}catch(r){}}function se(e,t={}){let o=performance.now();return(n={})=>T(e,p(p({},t),n),performance.now()-o)}async function ce(e){let t=performance.now();return[await e(),performance.now()-t]}async function D(e){var t;try{if(!e)return;let o=typeof e=="string"?{error:e}:typeof e=="object"?"message"in e?{error:e.message,stack:(t=e.stack)!=null?t:null}:{error:e.toString()}:{error:"Unspecified error"};console.error(e);let n=await fetch("/data/Logger/LogError",{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json; charset=utf-8"}});if(n.ok)return await n.json();console.error(Error("Failed to log error"))}catch(o){}}function B(){var e;return(e=crypto.randomUUID)==null?void 0:e.call(crypto)}var _=Date.now(),F=B(),b="",x="";if("document"in window){let e=()=>{var t,o,n,r,i,a;return T("AfSessionInit",{"appframe-core":(o=(t=window.af)==null?void 0:t.common)==null?void 0:o.version,"appframe-data":(r=(n=window.af)==null?void 0:n.data)==null?void 0:r.version,"app-version":(a=(i=window.af)==null?void 0:i.article)==null?void 0:a.version})};document.addEventListener("DOMContentLoaded",()=>{b=localStorage.getItem("_afDeviceId"),x=sessionStorage.getItem("_afSessionId"),b||(b=B(),localStorage.setItem("_afDeviceId",b)),x||(x=F,sessionStorage.setItem("_afSessionId",x)),e()}),document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"?navigator.sendBeacon("/api/logging/log-activity",JSON.stringify({article:k,action:"AfSessionEnd",parameters:{_session:E()}})):e()})}function E(){return{browserSessionId:x,sessionStart:_,sessionLength:Date.now()-_,sessionId:F,deviceId:b}}var J;(J=window.window)==null||J.addEventListener("error",e=>{typeof e=="object"&&"error"in e?D(e.error):typeof e=="object"&&"message"in e&&D(e)});function K(e){var t;return[((t=af==null?void 0:af.article)==null?void 0:t.id)||"","common",e].join(".")}var j=class{constructor(){l(this,"isPersisted",()=>!0)}getLocalStorageKey(t,o){return o?["common",t].join("."):K(t)}get(t,o,n){let r=this.getLocalStorageKey(t,n),i=localStorage.getItem(r);return i!==null?JSON.parse(i):o}set(t,o,n){localStorage.setItem(this.getLocalStorageKey(t,n),JSON.stringify(o))}remove(t,o){let n=this.getLocalStorageKey(t,o);return localStorage.getItem(n)!==null?(localStorage.removeItem(n),!0):!1}clear(){let t=K("");for(let o in localStorage)o.slice(0,t.length)===t&&localStorage.removeItem(o)}},ue=new j;function de(e){return e?V(e).substring(0,10):null}function m(e,t=2){return String(e).padStart(t,"0")}function V(e){return e?"".concat(e.getFullYear(),"-").concat(m(e.getMonth()+1),"-").concat(m(e.getDate()),"T").concat(m(e.getHours()),":").concat(m(e.getMinutes()),":").concat(m(e.getSeconds()),".").concat(m(e.getMilliseconds(),3)):null}function fe(e){return e?e.toISOString().substring(0,16):""}function z(e,t){return new Promise((o,n)=>{try{let r=URL.createObjectURL(e),i=document.body,a=document.createElement("a");a.setAttribute("download",t),a.href=r,i.append(a),a.click(),i.removeChild(a),setTimeout(()=>{URL.revokeObjectURL(r),o()},250)}catch(r){n(r)}})}function c(e,t){if(e)return;let o=typeof t=="function"?t():t;throw new Error(o!=null?o:"Invariant failed")}async function pe(e,{fileName:t,signal:o,onProgress:n}){var i;let r=0;n==null||n({status:"requested"});try{let a=await fetch(e);if(!a.ok||!a.body){if((i=a.headers.get("content-type"))!=null&&i.includes("application/json")){let f=await a.json();c(!f.error,f.error)}throw new Error("".concat(a.status," ").concat(a.statusText))}try{let f=a.body.getReader(),v=new ReadableStream({start:y=>{function h(){return f.read().then(s=>{if(s.done){y.close();return}return r+=s.value.length,n==null||n({bytesReceived:r,status:"downloading"}),y.enqueue(s.value),h()})}return h()}});a=new Response(v)}catch(f){}let u=await a.blob();n==null||n({bytesReceived:r,status:"downloaded"}),await z(u,t),n==null||n({bytesReceived:r,status:"completed"})}catch(a){o!=null&&o.aborted?n==null||n({status:"cancelled"}):n==null||n({error:a.message,status:"error"})}}var ge=/^function(?:\s+([a-zA-Z$_][a-zA-Z0-9$_]*))?\s*\(((?:(?:\s*[a-zA-Z$_][a-zA-Z0-9$_]*)(?:\s*,\s*[a-zA-Z$_][a-zA-Z0-9$_]*)*)?)\s*\)\s*\{((?:.|\n|\r)*)\}$/;function O(e){var o;let t=e.toString().match(ge);return c(t,"Unable to parse function!"),{name:(o=e.name)!=null?o:t[1],args:t[2].split(",").map(n=>n.trim()),body:t[3]}}function Z(){}Z.prototype=Object.create(null);var Y=Z;function N(e,t){if(typeof e=="object"){if(typeof t=="string"){let o=t.split(".");return N(e,o)}else if(Array.isArray(t)){let o=e;for(let n=0;n<t.length;n++)o=o[t[n]]=o[t[n]]||new Y;return o}}}function X(e,t,o={}){if(Array.isArray(t))for(let n of t){let{name:r}=O(n);c(r,"Unable to detect name of function! Name it, or only supply one function and include name in first parameter."),X(e,n)}else{let n,r;if(typeof t=="function"&&(n=O(t).name),typeof e=="string"){let i=e.split(".");n||(n=i[i.length-1],i=i.slice(0,i.length-1)),r=N(window,i)}else n&&(typeof e=="object"||typeof e=="function")?r=e:c(!1,"Invalid typeof parameter 'name', or unable to parse pValue!");Object.hasOwn(r,n)&&(o==null?void 0:o.overwrite)!==!0?console.warn("".concat([e,n].join(".")," is already defined!")):r[n]=t}}var me={xs:64,sm:128,md:256,lg:512,xl:void 0};function G(e,t,o,n="xs"){if(e&&typeof e=="object")return G(e.primKey,e.login,e.hash,e.size);if(!e||!o)return"";let r=me[n];return"/api/data/blob/EmployeesLookup/".concat(e,"/Image/").concat(encodeURIComponent(t!=null?t:"")).concat(t?".":"").concat(encodeURIComponent(o),".jpg").concat(r?"?width=".concat(r):"")}async function ye(e){try{let t=await fetch("/api/user/localize/new/".concat(af.article.id),{body:JSON.stringify({text:e}),headers:{Accept:"application/json; */*","Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},method:"POST"});if(t.ok)return await t.json()}catch(t){}return e}function d(e,t){var o,n;if(typeof e=="string"&&e.trim().length===0)return e;if(!(e===void 0||e===""||e===null))if(((n=(o=window.af)==null?void 0:o.article)==null?void 0:n.i18n)!==void 0){if(!Object.hasOwn(af.article.i18n,e)){af.article.i18n[e]=e;let r=ye(e).then(i=>(af.article.i18n[e]=i,i));if(t)return r}return af.article.i18n[e]}else return e}function he(e,...t){c(Array.isArray(e)&&e.length===t.length+1,"Method 'localize' must be used as a tag function");let o=e.map((r,i)=>i===e.length-1?r:"".concat(r,"$").concat(i)).join(""),n=d(o);return t.forEach((r,i)=>{n=n.replace("$".concat(i),r)}),n}function W(e){var o,n,r,i,a,u;let t=(i=e!=null?e:(n=(o=window.af)==null?void 0:o.article)==null?void 0:n.id)!=null?i:(r=window.window)==null?void 0:r.location.pathname.substring(1).split("/")[0];return"".concat(t,".").concat((u=(a=window.af)==null?void 0:a.userSession.login)!=null?u:"anonymous")}function Se(e,t){var r;if(!((r=window.af)!=null&&r.userSession))return null;let o=W(t),n=JSON.parse(localStorage.getItem(o)||"{}");return e?n[e]||null:n}function be(e,t,o){var i;if(!((i=window.af)!=null&&i.userSession))return;let n=W(o),r=JSON.parse(localStorage.getItem(n)||"{}");typeof t<"u"?r[e]=t:r=e,localStorage.setItem(n,JSON.stringify(r))}var xe='\n <dialog class="alert-dialog">\n <form method="dialog">\n <article></article>\n <footer>\n <menu></menu>\n </footer>\n </form>\n </dialog>\n';if(window.document&&!document.querySelector("#AlertDialogTemplate")){let e=document.createElement("template");e.id="AlertDialogTemplate",e.innerHTML=xe,document.body.append(e)}function Q(e,t="No"){return new Promise(o=>{let n=new AbortController;e.addEventListener("close",()=>{o(e.returnValue),n.abort()},{signal:n.signal}),e.addEventListener("cancel",()=>{o(t),n.abort()},{signal:n.signal})})}var w=new Map;async function $({buttons:e,content:t,className:o,id:n,title:r}){var y,h;if(n&&w.has(n))return await w.get(n);let i=document.querySelector("#AlertDialogTemplate");if(!i)throw Error("No alert dialog template found");let a=(y=i.content.firstElementChild)==null?void 0:y.cloneNode(!0),u=a==null?void 0:a.querySelector("article"),f=a==null?void 0:a.querySelector("footer menu");if(!a||!u||!f)throw Error("Invalid alert dialog template");if(o)for(let s of o.split(/\s+/))a==null||a.classList.add(s);if(r){let s=document.createElement("header");s.append(r),(h=u.parentNode)==null||h.insertBefore(s,u)}u.appendChild(typeof t=="string"?document.createTextNode(t):t);for(let{label:s,value:ee,primary:te}of e){let ne=document.createElement("li"),S=document.createElement("button");S.value=ee,te&&S.classList.add("primary"),S.textContent=s,ne.appendChild(S),f.appendChild(S)}document.body.appendChild(a),a.showModal();let v=Q(a).then(s=>(n&&w.has(n)&&w.delete(n),a&&document.body.removeChild(a),s));return n&&w.set(n,v),await v}var P=(o=>(o[o.YesNo=0]="YesNo",o[o.OkCancel=1]="OkCancel",o))(P||{});async function we(e,t={}){let{buttons:o=0,title:n}=t,r=o===1?[{label:d("OK"),value:"yes",primary:!0},{label:d("Cancel"),value:"no"}]:[{label:d("Yes"),value:"yes",primary:!0},{label:d("No"),value:"no"}];return await $({content:e,buttons:r,className:"alert-dialog-confirm",title:n})==="yes"}async function ve(e,t={}){await $(p({content:e,className:"alert-dialog-alert",buttons:[{label:d("OK"),value:"ok",primary:!0}]},t))}var ct="2.11.7";export{P as ConfirmButtons,g as SessionHandler,L as UserSession,ve as alert,we as confirm,z as downloadBlob,pe as downloadRequest,X as expose,d as getLocalizedString,E as getSessionData,Se as getSettings,G as getUserImage,c as invariant,ue as localStorage,he as localize,T as logActivity,D as logError,I as mitt,$ as openAlertDialog,be as saveSettings,se as startActivity,ce as time,fe as toLocalDateTime,de as toLocalISODate,V as toLocalISODateTime,ct as version,Q as waitForDialog};
2
2
  //# sourceMappingURL=af.common.legacy.min.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/src/index.ts", "../../src/SessionHandler.ts", "../../src/UserSession.ts", "../../src/log.ts", "../../src/errorHandler.ts", "../../src/localStorage.ts", "../../src/date.ts", "../../src/downloadBlob.ts", "../../src/invariant.ts", "../../src/downloadRequest.ts", "../../src/parseFunc.ts", "../../src/Namespace.ts", "../../src/requireNamespace.ts", "../../src/expose.ts", "../../src/getUserImage.ts", "../../src/getLocalizedString.ts", "../../src/localize.ts", "../../src/settings.ts", "../../src/alert.ts", "../../src/index.ts"],
4
- "sourcesContent": ["export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = unknown> = (event: T) => void;\nexport type WildcardHandler<T = Record<string, unknown>> = (\n\ttype: keyof T,\n\tevent: T[keyof T]\n) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList<T = unknown> = Array<Handler<T>>;\nexport type WildCardEventHandlerList<T = Record<string, unknown>> = Array<\n\tWildcardHandler<T>\n>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<\n\tkeyof Events | '*',\n\tEventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>\n>;\n\nexport interface Emitter<Events extends Record<EventType, unknown>> {\n\tall: EventHandlerMap<Events>;\n\n\ton<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;\n\ton(type: '*', handler: WildcardHandler<Events>): void;\n\n\toff<Key extends keyof Events>(\n\t\ttype: Key,\n\t\thandler?: Handler<Events[Key]>\n\t): void;\n\toff(type: '*', handler: WildcardHandler<Events>): void;\n\n\temit<Key extends keyof Events>(type: Key, event: Events[Key]): void;\n\temit<Key extends keyof Events>(\n\t\ttype: undefined extends Events[Key] ? Key : never\n\t): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt<Events extends Record<EventType, unknown>>(\n\tall?: EventHandlerMap<Events>\n): Emitter<Events> {\n\ttype GenericEventHandler =\n\t\t| Handler<Events[keyof Events]>\n\t\t| WildcardHandler<Events>;\n\tall = all || new Map();\n\n\treturn {\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `'*'` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<Key extends keyof Events>(type: Key, handler: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.push(handler);\n\t\t\t} else {\n\t\t\t\tall!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * If `handler` is omitted, all handlers of the given type are removed.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)\n\t\t * @param {Function} [handler] Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<Key extends keyof Events>(type: Key, handler?: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\tif (handler) {\n\t\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tall!.set(type, []);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `'*'` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing '*' handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<Key extends keyof Events>(type: Key, evt?: Events[Key]) {\n\t\t\tlet handlers = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as EventHandlerList<Events[keyof Events]>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(evt!);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlers = all!.get('*');\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as WildCardEventHandlerList<Events>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(type, evt!);\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\n", "import mitt, { Emitter, Handler } from \"mitt\";\n\ntype SessionHandlerEvent = \"onExpired\" | \"onAuthenticated\";\n\nexport default class SessionHandler {\n\tprivate eventHandler: Emitter<{ onAuthenticated: void; onExpired: void }> = mitt();\n\n\tauthenticated() {\n\t\tthis.eventHandler.emit(\"onAuthenticated\");\n\t}\n\n\tasync expired(callback?: () => void, type?: \"RequireTwoFactor\"): Promise<void> {\n\t\ttry {\n\t\t\tlet authPromise = new Promise<void>((resolve) => {\n\t\t\t\tlet eventHandler = () => {\n\t\t\t\t\tthis.eventHandler.off(\"onAuthenticated\", eventHandler);\n\t\t\t\t\tcallback?.();\n\t\t\t\t\tresolve();\n\t\t\t\t};\n\n\t\t\t\tthis.eventHandler.on(\"onAuthenticated\", eventHandler);\n\t\t\t});\n\n\t\t\tlet dialog: HTMLDialogElement | null = document.querySelector(\"dialog.session-expired-dialog\");\n\t\t\tif (!dialog) {\n\t\t\t\tdialog = document.createElement(\"dialog\");\n\t\t\t\tdialog.className = \"session-expired-dialog\";\n\t\t\t\tdialog.style.display = \"flex\";\n\t\t\t\tdialog.style.padding = \"0\";\n\t\t\t\tdialog.style.left = \"50%\";\n\t\t\t\tdialog.style.transform = \"translateX(-50%)\";\n\n\t\t\t\tlet link = \"/login?ReturnUrl=%2fapi/sessionexpired/remove\";\n\t\t\t\tif (type !== \"RequireTwoFactor\") {\n\t\t\t\t\tawait fetch(\"/logout\", { method: \"POST\" });\n\t\t\t\t} else {\n\t\t\t\t\tlink = \"/login?RequireTwoFactor=1&ReturnUrl=%2fapi/sessionexpired/remove\";\n\t\t\t\t}\n\n\t\t\t\tdialog.innerHTML = `<iframe sandbox=\"allow-same-origin allow-scripts allow-modals allow-top-navigation-by-user-activation allow-forms\" src=\"${link}\" style=\"border:0;width:min(500px,100vw);height:min(700px, 100vh);\"></iframe>`;\n\t\t\t\tdocument.body.append(dialog);\n\t\t\t\tdialog.showModal();\n\t\t\t\tawait authPromise;\n\t\t\t\tdialog.remove();\n\t\t\t} else {\n\t\t\t\tawait authPromise;\n\t\t\t}\n\t\t} catch (_) {\n\t\t\twindow.location.href = `/login?ReturnUrl=${encodeURIComponent(window.location.pathname)}${encodeURIComponent(\n\t\t\t\twindow.location.search,\n\t\t\t)}`;\n\t\t}\n\t}\n\n\tattachEvent(eventName: SessionHandlerEvent, handler: Handler) {\n\t\treturn this.eventHandler.on(eventName, handler);\n\t}\n\n\tdetachEvent(eventName: SessionHandlerEvent, handler: Handler) {\n\t\treturn this.eventHandler.off(eventName, handler);\n\t}\n}\n", "import SessionHandler from \"./SessionHandler.js\";\n\nexport class UserSession extends SessionHandler {\n\tamDesignator: string = \"a.m.\";\n\tdayNames: string[] = [\"sunday\", \"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\"];\n\tdayNamesShort: string[] = [\"sun\", \"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\"];\n\tdecimalSeparator: string = \".\";\n\tdomain: string = \"OB\";\n\temail: string | null | undefined;\n\tformats: undefined | Record<string, string>;\n\tgroupSeparator: string | null = null;\n\tintegratedSecurity: boolean = false;\n\tisDeveloper: boolean = false;\n\tlogin: string = \"\";\n\tloginType: string | undefined;\n\tmonthNames: string[] = [\n\t\t\"january\",\n\t\t\"february\",\n\t\t\"march\",\n\t\t\"april\",\n\t\t\"may\",\n\t\t\"june\",\n\t\t\"july\",\n\t\t\"august\",\n\t\t\"september\",\n\t\t\"october\",\n\t\t\"november\",\n\t\t\"december\",\n\t\t\"\",\n\t];\n\tmonthNamesShort: string[] = [\"jan\", \"feb\", \"mar\", \"apr\", \"may\", \"jun\", \"jul\", \"augt\", \"sep\", \"oct\", \"nov\", \"dec\", \"\"];\n\tname: string | undefined;\n\tpmDesignator: string = \"p.m.\";\n\tshortDateFormat: string = \"dd.MM.yyyy\";\n\tculture: string = \"en-GB\";\n\tuiculture: string = \"en-GB\";\n\n\tconstructor(userData: any) {\n\t\tsuper();\n\t\tthis.formats = {};\n\t\tObject.assign(this, userData);\n\t}\n}\n", "const article = globalThis.af?.article?.id ?? globalThis.window?.location.pathname.substring(1).split(\"/\")[0];\n\n/**\n * Logs an activity to the website activity log\n *\n * @param activity name of the activity we are logging\n * @param parameters A dictionary of parameters used when doing the activity\n * @param timeElapsed Number of milliseconds elapsed while executing\n */\nexport async function logActivity(activity: string, parameters: Record<string, any> = {}, timeElapsed: number = 0) {\n\ttry {\n\t\tlet response = await fetch(\"/api/logging/log-activity\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({\n\t\t\t\tarticle,\n\t\t\t\ttimeElapsed,\n\t\t\t\taction: activity,\n\t\t\t\tparameters: {\n\t\t\t\t\t...parameters,\n\t\t\t\t\t_session: getSessionData(),\n\t\t\t\t},\n\t\t\t}),\n\t\t\theaders: { \"Content-Type\": \"application/json\", Accept: \"application/json\" },\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tif (response.headers.get(\"Content-Type\")?.includes(\"application/json\")) {\n\t\t\t\tlet data = await response.json();\n\t\t\t\tconsole.error(data.error);\n\t\t\t} else {\n\t\t\t\tconsole.error(`${response.status} ${response.statusText}`);\n\t\t\t}\n\t\t}\n\t} catch (error) {}\n}\n\n/**\n * Records the current time, and returns a function that logs the activity with the\n * time elapsed when it is called.\n *\n * @param activity Name of the activity we are logging\n * @param parameters A dictionary of parameters used when doing the activity\n * @returns A function that should be called when the activity is completed to log it to the website log\n */\nexport function startActivity(activity: string, startParameters: Record<string, any> = {}) {\n\tlet start = performance.now();\n\treturn (endParameters: Record<string, any> = {}) =>\n\t\tlogActivity(activity, { ...startParameters, ...endParameters }, performance.now() - start);\n}\n\n/**\n * Records the time used to execute an operation and returns the value of the operation and the time\n * in milliseconds\n */\nexport async function time<T>(callback: () => T | Promise<T>): Promise<[T, number]> {\n\tlet start = performance.now();\n\tlet returnValue = await callback();\n\n\treturn [returnValue, performance.now() - start];\n}\n\nexport async function logError(error: any) {\n\ttry {\n\t\tif (!error) return;\n\n\t\tlet data =\n\t\t\ttypeof error === \"string\"\n\t\t\t\t? { error: error }\n\t\t\t\t: typeof error === \"object\"\n\t\t\t\t\t? \"message\" in error\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\terror: error.message,\n\t\t\t\t\t\t\t\tstack: error.stack ?? null,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: { error: error.toString() }\n\t\t\t\t\t: { error: \"Unspecified error\" };\n\n\t\tconsole.error(error);\n\n\t\tlet result = await fetch(\"/data/Logger/LogError\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json; charset=utf-8\",\n\t\t\t},\n\t\t});\n\n\t\tif (result.ok) {\n\t\t\treturn await result.json();\n\t\t}\n\n\t\tconsole.error(Error(\"Failed to log error\"));\n\t} catch {}\n}\n\nfunction getSessionId() {\n\treturn crypto.randomUUID?.();\n}\n\nlet sessionStart = Date.now();\nlet sessionId = getSessionId();\nlet deviceId: string | null = \"\";\nlet browserSessionId: string | null = \"\";\n\nif (\"document\" in globalThis) {\n\tlet startSession = () =>\n\t\tlogActivity(\"AfSessionInit\", {\n\t\t\t\"appframe-core\": globalThis.af?.common?.version,\n\t\t\t\"appframe-data\": (globalThis.af as any)?.data?.version,\n\t\t\t\"app-version\": globalThis.af?.article?.version,\n\t\t});\n\n\tdocument.addEventListener(\"DOMContentLoaded\", () => {\n\t\tdeviceId = localStorage.getItem(\"_afDeviceId\");\n\t\tbrowserSessionId = sessionStorage.getItem(\"_afSessionId\");\n\t\tif (!deviceId) {\n\t\t\tdeviceId = getSessionId();\n\t\t\tlocalStorage.setItem(\"_afDeviceId\", deviceId);\n\t\t}\n\n\t\tif (!browserSessionId) {\n\t\t\tbrowserSessionId = sessionId;\n\t\t\tsessionStorage.setItem(\"_afSessionId\", browserSessionId);\n\t\t}\n\n\t\tstartSession();\n\t});\n\n\tdocument.addEventListener(\"visibilitychange\", function logData() {\n\t\tif (document.visibilityState === \"hidden\") {\n\t\t\tnavigator.sendBeacon(\n\t\t\t\t\"/api/logging/log-activity\",\n\t\t\t\tJSON.stringify({\n\t\t\t\t\tarticle,\n\t\t\t\t\taction: \"AfSessionEnd\",\n\t\t\t\t\tparameters: {\n\t\t\t\t\t\t_session: getSessionData(),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\tstartSession();\n\t\t}\n\t});\n}\n\n/**\n * Session and device ID's and information about session start and duration.\n * ID's will be null/undefined if crypto.randomUUID() is not supported.\n */\nexport type SessionData = {\n\t/**\n\t * Random UUID generated on page load, and persisted in sessionStorage\n\t */\n\tbrowserSessionId: string | null;\n\t/**\n\t * Random UUID generated on page load, and persisted in localStorage\n\t */\n\tdeviceId: string | null;\n\t/**\n\t * Time of page load in MS since epoch\n\t */\n\tsessionStart: number;\n\t/**\n\t * Time since page load (in MS) when this method was called\n\t */\n\tsessionLength: number;\n\t/**\n\t * Random UUID generated on page load. Not persisted.\n\t */\n\tsessionId: string | null;\n};\n\nexport function getSessionData(): SessionData {\n\treturn {\n\t\tbrowserSessionId,\n\t\tsessionStart,\n\t\tsessionLength: Date.now() - sessionStart,\n\t\tsessionId,\n\t\tdeviceId,\n\t};\n}\n", "import { logError } from \"./log.js\";\n\nif (process.env.NODE_ENV === \"production\") {\n\tglobalThis.window?.addEventListener(\"error\", (event) => {\n\t\tif (typeof event === \"object\" && \"error\" in event) {\n\t\t\tlogError(event.error);\n\t\t} else if (typeof event === \"object\" && \"message\" in event) {\n\t\t\tlogError(event);\n\t\t}\n\t});\n}\n", "function getLocalKey(key: string): string {\n\treturn [af?.article?.id || \"\", \"common\", key].join(\".\");\n}\n\nclass LocalStorage {\n\tisPersisted = () => true;\n\n\tgetLocalStorageKey(key: string, global?: boolean) {\n\t\treturn global ? [\"common\", key].join(\".\") : getLocalKey(key);\n\t}\n\n\tget(key: string, defaultValue: unknown, global?: boolean) {\n\t\tconst lsKey = this.getLocalStorageKey(key, global);\n\t\tconst value = localStorage.getItem(lsKey);\n\n\t\treturn value !== null ? JSON.parse(value) : defaultValue;\n\t}\n\n\tset(key: string, value: unknown, global?: boolean) {\n\t\tlocalStorage.setItem(this.getLocalStorageKey(key, global), JSON.stringify(value));\n\t}\n\n\tremove(key: string, global?: boolean) {\n\t\tconst lsKey = this.getLocalStorageKey(key, global);\n\t\tif (localStorage.getItem(lsKey) !== null) {\n\t\t\tlocalStorage.removeItem(lsKey);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclear() {\n\t\tconst baseKey = getLocalKey(\"\");\n\n\t\tfor (let key in localStorage) {\n\t\t\tif (key.slice(0, baseKey.length) === baseKey) {\n\t\t\t\tlocalStorage.removeItem(key);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default new LocalStorage();\n", "export function toLocalISODate(date: Date): string;\nexport function toLocalISODate(date: Date | null): string | null;\nexport function toLocalISODate(date: Date | null): string | null {\n\treturn date ? toLocalISODateTime(date).substring(0, 10) : null;\n}\n\nfunction pad(num: number, digits: number = 2) {\n\treturn String(num).padStart(digits, \"0\");\n}\n\n/**\n * Returns an ISO string (yyyy-MM-ddTHH:mm:ss.SSS) representing the local time\n * of the date object.\n *\n * @param date\n */\nexport function toLocalISODateTime(date: Date): string;\nexport function toLocalISODateTime(date: Date | null): string | null;\nexport function toLocalISODateTime(date: Date | null): string | null {\n\treturn date\n\t\t? `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(\n\t\t\t\tdate.getMinutes(),\n\t\t\t)}:${pad(date.getSeconds())}.${pad(date.getMilliseconds(), 3)}`\n\t\t: null;\n}\n\n/**\n * Converts a date object to a string compatible with input type datetime-local.\n * Will handle the UTC value of the date as if it was local, to be compatible with\n * data objects.\n *\n * If null or undefined is passed, returns an empty string.\n *\n * @param date\n */\nexport function toLocalDateTime(date?: Date | null): string {\n\treturn date ? date.toISOString().substring(0, 16) : \"\";\n}\n", "export function downloadBlob(blob: Blob | MediaSource, fileName: string) {\n\treturn new Promise<void>(function (resolve, reject) {\n\t\ttry {\n\t\t\tconst url = URL.createObjectURL(blob);\n\t\t\tconst parent = document.body;\n\t\t\tconst anchor = document.createElement(\"a\");\n\t\t\tanchor.setAttribute(\"download\", fileName);\n\t\t\tanchor.href = url;\n\t\t\tparent.append(anchor);\n\t\t\tanchor.click();\n\t\t\tparent.removeChild(anchor);\n\n\t\t\tsetTimeout(function () {\n\t\t\t\tURL.revokeObjectURL(url);\n\t\t\t\tresolve();\n\t\t\t}, 250);\n\t\t} catch (ex) {\n\t\t\treject(ex);\n\t\t}\n\t});\n}\n", "/**\n * Throws an error if the condition is falsy. The provided message is used as the error message.\n * A function can be provided to lazily generate the message.\n * \n * @param {any} condition \n * @param {string | (() => string)} [message] \n * @returns {void}\n */\nexport function invariant(condition: any, message?: string | (() => string)): asserts condition {\n\tif (condition) {\n\t\treturn;\n\t}\n\tconst provided: string | undefined = typeof message === \"function\" ? message() : message;\n\n\tthrow new Error(provided ?? \"Invariant failed\");\n}\n", "import { downloadBlob } from \"./downloadBlob.js\";\nimport { invariant } from \"./invariant.js\";\n\nexport type DownloadItem = {\n\tstatus: \"cancelled\" | \"error\" | \"requested\" | \"downloading\" | \"downloaded\" | \"completed\";\n\tbytesReceived?: number;\n\terror?: string;\n};\n\nexport type DownloadParameters = {\n\tsignal?: AbortSignal;\n\tfileName: string;\n\tonProgress?: (progress: DownloadItem) => void;\n};\n\nexport async function downloadRequest(request: Request, { fileName, signal, onProgress }: DownloadParameters) {\n\tlet bytesReceived = 0;\n\n\tonProgress?.({ status: \"requested\" });\n\n\ttry {\n\t\tlet response = await fetch(request);\n\n\t\tif (!response.ok || !response.body) {\n\t\t\tif (response.headers.get(\"content-type\")?.includes(\"application/json\")) {\n\t\t\t\tlet data = await response.json();\n\t\t\t\tinvariant(!data.error, data.error);\n\t\t\t}\n\t\t\tthrow new Error(`${response.status} ${response.statusText}`);\n\t\t}\n\n\t\ttry {\n\t\t\tconst reader = response.body.getReader();\n\t\t\tconst stream = new ReadableStream({\n\t\t\t\tstart: function (controller) {\n\t\t\t\t\tfunction pump(): Promise<void> {\n\t\t\t\t\t\treturn reader.read().then(function (read) {\n\t\t\t\t\t\t\tif (read.done) {\n\t\t\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbytesReceived += read.value.length;\n\t\t\t\t\t\t\tonProgress?.({ bytesReceived, status: \"downloading\" });\n\t\t\t\t\t\t\tcontroller.enqueue(read.value);\n\n\t\t\t\t\t\t\treturn pump();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn pump();\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tresponse = new Response(stream);\n\t\t} catch (error) {}\n\n\t\tconst blob = await response.blob();\n\n\t\tonProgress?.({ bytesReceived, status: \"downloaded\" });\n\n\t\tawait downloadBlob(blob, fileName);\n\n\t\tonProgress?.({ bytesReceived, status: \"completed\" });\n\t} catch (err) {\n\t\tif (signal?.aborted) {\n\t\t\tonProgress?.({ status: \"cancelled\" });\n\t\t} else {\n\t\t\tonProgress?.({ error: (err as Error).message, status: \"error\" });\n\t\t}\n\t}\n}\n", "import { invariant } from \"./invariant.js\";\n\nconst funcRegex =\n\t/^function(?:\\s+([a-zA-Z$_][a-zA-Z0-9$_]*))?\\s*\\(((?:(?:\\s*[a-zA-Z$_][a-zA-Z0-9$_]*)(?:\\s*,\\s*[a-zA-Z$_][a-zA-Z0-9$_]*)*)?)\\s*\\)\\s*\\{((?:.|\\n|\\r)*)\\}$/;\n\nexport function parseFunc(func: Function) {\n\tvar match = func.toString().match(funcRegex);\n\tinvariant(match, \"Unable to parse function!\");\n\treturn { name: func.name ?? match[1], args: match[2].split(\",\").map((a) => a.trim()), body: match[3] };\n}\n", "function Namespace() {}\nNamespace.prototype = Object.create(null);\n\nexport default Namespace;\n", "import Namespace from \"./Namespace.js\";\n\nexport function requireNamespace(root: any, namespace: string | Array<string>): any {\n\tif (typeof root === \"object\") {\n\t\tif (typeof namespace === \"string\") {\n\t\t\tlet path = namespace.split(\".\");\n\n\t\t\treturn requireNamespace(root, path);\n\t\t} else if (Array.isArray(namespace)) {\n\t\t\tlet current: any = root;\n\t\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\t\tcurrent = current[namespace[i]] = current[namespace[i]] || new (Namespace as any)();\n\t\t\t}\n\n\t\t\treturn current;\n\t\t}\n\t}\n}\n", "import { invariant } from \"./invariant.js\";\nimport { parseFunc } from \"./parseFunc.js\";\nimport { requireNamespace } from \"./requireNamespace.js\";\n\nexport type ExposeOptions = {\n\t/**\n\t * Whether we should overwrite any existing values without warning.\n\t */\n\toverwrite?: boolean;\n};\n\n/**\n * Expose a value to a potentially deeply nested global variable\n * @param name {string | object} Either a dot-separated path to the global variable, or an object to expose the value on\n * @param value {object | Function | Function[]} The value(s) to expose\n */\nexport function expose(\n\tname: object | string,\n\tvalue: object | Function | Function[] | string | number,\n\toptions: ExposeOptions = {},\n): void {\n\tif (Array.isArray(value)) {\n\t\tfor (let func of value) {\n\t\t\tconst { name: funcName } = parseFunc(func);\n\n\t\t\tinvariant(\n\t\t\t\tfuncName,\n\t\t\t\t\"Unable to detect name of function! Name it, or only supply one function and include name in first parameter.\",\n\t\t\t);\n\t\t\texpose(name, func); // Expose func on namespace found in pName\n\t\t}\n\t} else {\n\t\tlet keyName: string | undefined;\n\t\tlet namespace;\n\n\t\tif (typeof value === \"function\") {\n\t\t\tkeyName = parseFunc(value).name;\n\t\t}\n\n\t\tif (typeof name === \"string\") {\n\t\t\tlet pathParts = name.split(\".\");\n\n\t\t\tif (!keyName) {\n\t\t\t\tkeyName = pathParts[pathParts.length - 1];\n\t\t\t\tpathParts = pathParts.slice(0, pathParts.length - 1);\n\t\t\t}\n\n\t\t\tnamespace = requireNamespace(window, pathParts);\n\t\t} else if (keyName && (typeof name === \"object\" || typeof name === \"function\")) {\n\t\t\tnamespace = name;\n\t\t} else {\n\t\t\tinvariant(false, \"Invalid typeof parameter 'name', or unable to parse pValue!\");\n\t\t}\n\n\t\tif (Object.hasOwn(namespace, keyName) && options?.overwrite !== true) {\n\t\t\t// If class is already defined, warn or show an alert\n\t\t\tconsole.warn([name, keyName].join(\".\") + \" is already defined!\");\n\t\t} else {\n\t\t\tnamespace[keyName] = value;\n\t\t}\n\t}\n}\n", "export type ImageSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface getUserImageOptions {\n\t/**\n\t * Prim key of the record in atbl_Personnel_Employees\n\t */\n\tprimKey: string | null;\n\t/**\n\t * Person ID of the employee\n\t */\n\tlogin: string | null;\n\t/**\n\t * The value of the ImageHash column in atbl_Personnel_Employees\n\t */\n\thash: string | number | null;\n\t/**\n\t * The image will be resized according to this value. Default is 'xs':\n\t * - xs: 64px\n\t * - sm: 128px\n\t * - md: 256px\n\t * - lg: 512px\n\t * - xl: image is not resized\n\t */\n\tsize?: ImageSize;\n}\n\nconst sizeMap: Record<ImageSize, number | undefined> = {\n\txs: 64,\n\tsm: 128,\n\tmd: 256,\n\tlg: 512,\n\txl: undefined,\n};\n\n/**\n * Returns the absolute path of a users profile picture. Uses the EmployeesLookup\n * data resource to enable caching across applications.\n *\n * If one of primKey or hash are not provided, or are null, an empty string will be returned.\n */\nexport function getUserImage(\n\tprimKey: string | null,\n\tlogin: string | null,\n\thash: string | number | null,\n\tsize?: ImageSize,\n): string;\nexport function getUserImage(options: getUserImageOptions): string;\nexport function getUserImage(\n\tprimKeyOrOptions: string | null | getUserImageOptions,\n\tlogin?: string | null,\n\thash?: string | number | null,\n\tsize: ImageSize = \"xs\",\n) {\n\tif (primKeyOrOptions && typeof primKeyOrOptions === \"object\") {\n\t\treturn getUserImage(primKeyOrOptions.primKey, primKeyOrOptions.login, primKeyOrOptions.hash, primKeyOrOptions.size);\n\t}\n\n\tif (!primKeyOrOptions || !hash) {\n\t\treturn \"\";\n\t}\n\n\tlet sizePx = sizeMap[size];\n\treturn `/api/data/blob/EmployeesLookup/${primKeyOrOptions}/Image/${encodeURIComponent(login ?? \"\")}${\n\t\tlogin ? \".\" : \"\"\n\t}${encodeURIComponent(hash)}.jpg${sizePx ? `?width=${sizePx}` : \"\"}`;\n}\n", "async function fetchLocalizedString(text: string) {\n\ttry {\n\t\tlet response = await fetch(`/api/user/localize/new/${af.article.id}`, {\n\t\t\tbody: JSON.stringify({ text }),\n\t\t\theaders: {\n\t\t\t\tAccept: \"application/json; */*\",\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\"X-Requested-With\": \"XMLHttpRequest\",\n\t\t\t},\n\t\t\tmethod: \"POST\",\n\t\t});\n\n\t\tif (response.ok) {\n\t\t\treturn (await response.json()) as string;\n\t\t}\n\t} catch (error) {}\n\n\treturn text;\n}\nexport function getLocalizedStringAsync(string: undefined | null): undefined | null;\nexport function getLocalizedStringAsync(string: string): Promise<string>;\nexport function getLocalizedStringAsync(string: string | undefined | null) {\n\tif (!string) return string;\n\n\treturn getLocalizedString(string, true);\n}\n\nexport function getLocalizedString(string: undefined | null): undefined | null;\nexport function getLocalizedString(string: string): string;\nexport function getLocalizedString(string: string, wait: false): string;\nexport function getLocalizedString(string: string, wait: true): Promise<string>;\nexport function getLocalizedString(string: undefined | null, wait: true): undefined | null;\nexport function getLocalizedString(\n\tstring: string | undefined | null,\n\twait?: boolean,\n): string | undefined | null | Promise<string> {\n\tif (typeof string === \"string\" && string.trim().length === 0) {\n\t\treturn string;\n\t}\n\n\tif (string === undefined || string === \"\" || string === null) {\n\t\treturn;\n\t}\n\n\tif (globalThis.af?.article?.i18n !== undefined) {\n\t\tif (!Object.hasOwn(af.article.i18n, string)) {\n\t\t\taf.article.i18n[string] = string;\n\n\t\t\tlet promise = fetchLocalizedString(string).then((text) => {\n\t\t\t\taf.article.i18n[string] = text;\n\t\t\t\treturn text;\n\t\t\t});\n\n\t\t\tif (wait) {\n\t\t\t\treturn promise;\n\t\t\t}\n\t\t}\n\n\t\treturn af.article.i18n[string];\n\t} else {\n\t\treturn string;\n\t}\n}\n", "import { getLocalizedString } from \"./getLocalizedString.js\";\nimport { invariant } from \"./invariant.js\";\n\n/**\n * Localization function for tagged templates. Replaces the arguments\n * with $n, where n is the index, before asking Appframe to translate\n * the string.\n *\n * For example, if you call localize`Page ${2} or ${5}`, the string\n * \"Page $0 of $1\" will be sent to Appframe, and for norwegian,\n * \"Side 2 av 5\" will be returned.\n *\n * @param stringParts\n * @param args\n * @returns Translated string\n */\nexport function localize(stringParts: TemplateStringsArray, ...args: any[]): string {\n\tinvariant(\n\t\tArray.isArray(stringParts) && stringParts.length === args.length + 1,\n\t\t\"Method 'localize' must be used as a tag function\",\n\t);\n\n\tlet stringToLocalize = stringParts.map((s, i) => (i === stringParts.length - 1 ? s : `${s}\\$${i}`)).join(\"\");\n\tlet localized = getLocalizedString(stringToLocalize);\n\n\targs.forEach((arg, index) => {\n\t\tlocalized = localized.replace(\"$\" + index, arg);\n\t});\n\n\treturn localized;\n}\n", "function getKey(article?: string) {\n\tconst articleKey =\n\t\tarticle ?? globalThis.af?.article?.id ?? globalThis.window?.location.pathname.substring(1).split(\"/\")[0];\n\treturn `${articleKey}.${globalThis.af?.userSession.login ?? \"anonymous\"}`;\n}\n\nexport function getSettings<T>(setting: string, article?: string): T | null {\n\tif (!globalThis.af?.userSession) return null;\n\n\tconst key = getKey(article);\n\tconst settings = JSON.parse(localStorage.getItem(key) || \"{}\");\n\n\tif (setting) {\n\t\treturn settings[setting] || null;\n\t}\n\n\treturn settings;\n}\n\nexport function saveSettings<T>(setting: string, value: T | null, article?: string): void {\n\tif (!globalThis.af?.userSession) return;\n\n\tconst key = getKey(article);\n\tlet userSettings = JSON.parse(localStorage.getItem(key) || \"{}\");\n\n\tif (typeof value !== \"undefined\") {\n\t\tuserSettings[setting] = value;\n\t} else {\n\t\tuserSettings = setting;\n\t}\n\n\tlocalStorage.setItem(key, JSON.stringify(userSettings));\n}\n", "import { getLocalizedString } from \"./getLocalizedString.js\";\n\nconst template = `\n\t<dialog class=\"alert-dialog\">\n\t\t\t<form method=\"dialog\">\n\t\t\t\t\t<article></article>\n\t\t\t\t\t<footer>\n\t\t\t\t\t\t\t<menu></menu>\n\t\t\t\t\t</footer>\n\t\t\t</form>\n\t</dialog>\n`;\n\nif (globalThis.document && !document.querySelector(\"#AlertDialogTemplate\")) {\n\tlet $template = document.createElement(\"template\");\n\t$template.id = \"AlertDialogTemplate\";\n\t$template.innerHTML = template;\n\tdocument.body.append($template);\n}\n\nexport function waitForDialog(dialog: HTMLDialogElement, cancelValue: string = \"No\"): Promise<string> {\n\treturn new Promise((resolve) => {\n\t\tlet controller = new AbortController();\n\n\t\tdialog.addEventListener(\n\t\t\t\"close\",\n\t\t\t() => {\n\t\t\t\tresolve(dialog.returnValue);\n\t\t\t\tcontroller.abort();\n\t\t\t},\n\t\t\t{ signal: controller.signal },\n\t\t);\n\n\t\tdialog.addEventListener(\n\t\t\t\"cancel\",\n\t\t\t() => {\n\t\t\t\tresolve(cancelValue);\n\t\t\t\tcontroller.abort();\n\t\t\t},\n\t\t\t{ signal: controller.signal },\n\t\t);\n\t});\n}\nexport type AlertDialogButton = {\n\tlabel: string;\n\tvalue: string;\n\tprimary?: boolean;\n};\n\nexport type AlertDialogOptions = {\n\tbuttons: AlertDialogButton[];\n\tcontent: string | HTMLElement;\n\tclassName?: string;\n\tid?: string;\n\ttitle?: string;\n};\n\nconst alertDialogPromiseMap = new Map<string, Promise<string>>();\n\nexport async function openAlertDialog({ buttons, content, className, id, title }: AlertDialogOptions) {\n\tif (id && alertDialogPromiseMap.has(id)) {\n\t\treturn await alertDialogPromiseMap.get(id);\n\t}\n\n\tlet $template = document.querySelector<HTMLTemplateElement>(\"#AlertDialogTemplate\");\n\tif (!$template) throw Error(\"No alert dialog template found\");\n\n\tlet $dialog = $template.content.firstElementChild?.cloneNode(true) as HTMLDialogElement | null;\n\tlet $content = $dialog?.querySelector(\"article\");\n\tlet $menu = $dialog?.querySelector(\"footer menu\");\n\n\tif (!$dialog || !$content || !$menu) throw Error(\"Invalid alert dialog template\");\n\n\tif (className) {\n\t\tclassName.split(/\\s+/).forEach((className) => $dialog?.classList.add(className));\n\t}\n\n\tif (title) {\n\t\tlet $header = document.createElement(\"header\");\n\t\t$header.append(title);\n\t\t$content.parentNode?.insertBefore($header, $content);\n\t}\n\n\t$content.appendChild(typeof content === \"string\" ? document.createTextNode(content) : content);\n\tfor (let { label, value, primary } of buttons) {\n\t\tlet listItem = document.createElement(\"li\");\n\t\tlet buttonElem = document.createElement(\"button\");\n\t\tbuttonElem.value = value;\n\t\tif (primary) {\n\t\t\tbuttonElem.classList.add(\"primary\");\n\t\t}\n\t\tbuttonElem.textContent = label;\n\t\tlistItem.appendChild(buttonElem);\n\t\t$menu.appendChild(buttonElem);\n\t}\n\n\tdocument.body.appendChild($dialog);\n\t$dialog.showModal();\n\n\tlet dialogPromise = waitForDialog($dialog).then((returnValue) => {\n\t\tif (id && alertDialogPromiseMap.has(id)) {\n\t\t\talertDialogPromiseMap.delete(id);\n\t\t}\n\t\tif ($dialog) document.body.removeChild($dialog);\n\t\treturn returnValue;\n\t});\n\n\tif (id) {\n\t\talertDialogPromiseMap.set(id, dialogPromise);\n\t}\n\n\treturn await dialogPromise;\n}\n\nexport enum ConfirmButtons {\n\tYesNo,\n\tOkCancel,\n}\n\nexport type ConfirmOptions = {\n\tbuttons?: ConfirmButtons;\n\ttitle?: string;\n};\n\nexport async function confirm(prompt: string, options: ConfirmOptions = {}): Promise<boolean> {\n\tlet { buttons: optionButtons = ConfirmButtons.YesNo, title } = options;\n\tlet buttons: AlertDialogButton[] =\n\t\toptionButtons === ConfirmButtons.OkCancel\n\t\t\t? [\n\t\t\t\t\t{ label: getLocalizedString(\"OK\"), value: \"yes\", primary: true },\n\t\t\t\t\t{ label: getLocalizedString(\"Cancel\"), value: \"no\" },\n\t\t\t ]\n\t\t\t: [\n\t\t\t\t\t{ label: getLocalizedString(\"Yes\"), value: \"yes\", primary: true },\n\t\t\t\t\t{ label: getLocalizedString(\"No\"), value: \"no\" },\n\t\t\t ];\n\n\tlet result = await openAlertDialog({ content: prompt, buttons, className: \"alert-dialog-confirm\", title });\n\treturn result === \"yes\";\n}\n\nexport type AlertOptions = {\n\ttitle?: string;\n};\n\nexport async function alert(prompt: string, options: AlertOptions = {}): Promise<void> {\n\tawait openAlertDialog({\n\t\tcontent: prompt,\n\t\tclassName: \"alert-dialog-alert\",\n\t\tbuttons: [{ label: getLocalizedString(\"OK\"), value: \"ok\", primary: true }],\n\t\t...options,\n\t});\n}\n", "import { UserSession } from \"./UserSession.js\";\nimport { alert, confirm, openAlertDialog } from \"./alert.js\";\nimport \"./errorHandler.js\";\nimport { expose } from \"./expose.js\";\nimport { getLocalizedString } from \"./getLocalizedString.js\";\nimport afLocalStorage from \"./localStorage.js\";\nimport { localize } from \"./localize.js\";\nimport { getSessionData, logActivity, logError, startActivity, time } from \"./log.js\";\n\nexport { default as mitt } from \"mitt\";\nexport { toLocalISODate, toLocalISODateTime, toLocalDateTime } from \"./date.js\";\nexport { downloadBlob } from \"./downloadBlob.js\";\nexport { downloadRequest } from \"./downloadRequest.js\";\nexport type { DownloadParameters, DownloadItem } from \"./downloadRequest.js\";\nexport { expose } from \"./expose.js\";\nexport { getUserImage } from \"./getUserImage.js\";\nexport type { getUserImageOptions } from \"./getUserImage.js\";\nexport { getLocalizedString } from \"./getLocalizedString.js\";\nexport { invariant } from \"./invariant.js\";\nexport { localize } from \"./localize.js\";\nexport { afLocalStorage as localStorage };\nexport { getSessionData, logActivity, logError, startActivity, time } from \"./log.js\";\nexport { default as SessionHandler } from \"./SessionHandler.js\";\nexport { UserSession };\nexport { getSettings, saveSettings } from \"./settings.js\";\nexport { alert, confirm, ConfirmButtons, openAlertDialog, waitForDialog } from \"./alert.js\";\nexport type { AlertDialogButton, AlertDialogOptions, AlertOptions, ConfirmOptions } from \"./alert.js\";\n\nexport const version = __VERSION__;\n\ndeclare global {\n\tvar __VERSION__: string;\n\tvar __DEV__: number;\n\tvar af: AfCore;\n\n\tinterface Window {\n\t\taf: AfCore;\n\t}\n}\n\nexport interface AfArticle {\n\thostName: string;\n\ti18n: Record<string, string>;\n\tid: string;\n\tversion?: string;\n}\n\nexport interface AfCore {\n\tarticle: AfArticle;\n\tcommon: {\n\t\tgetLocalizedString: typeof getLocalizedString;\n\t\texpose: typeof expose;\n\t\tgetSessionData: typeof getSessionData;\n\t\tlocalize: typeof localize;\n\t\tlocalStorage: typeof afLocalStorage;\n\t\tlogActivity: typeof logActivity;\n\t\tlogError: typeof logError;\n\t\tstartActivity: typeof startActivity;\n\t\talert: typeof alert;\n\t\tconfirm: typeof confirm;\n\t\topenAlertDialog: typeof openAlertDialog;\n\t\ttime: typeof time;\n\t\tversion?: string;\n\t};\n\tcontrols?: {\n\t\talert?: (message: string, callback?: () => void) => void;\n\t\tconfirm?: (options: {\n\t\t\ttitle: string;\n\t\t\tmessage: string;\n\t\t\tbuttons: string[];\n\t\t\tcallback: (button: number) => void;\n\t\t}) => void;\n\t};\n\tuserSession: UserSession;\n}\n"],
5
- "mappings": "sfA8CCA,EAAAA,CAOA,MAAO,CAINA,IANDA,EAAMA,GAAO,IAAIC,IAchBC,GAAAA,SAA6BC,EAAWC,EAAAA,CACvC,IAAMC,EAAmDL,EAAKM,IAAIH,CAAAA,EAC9DE,EACHA,EAASE,KAAKH,CAAAA,EAEdJ,EAAKQ,IAAIL,EAAM,CAACC,CAAAA,CAAAA,CAAAA,EAWlBK,IAAAA,SAA8BN,EAAWC,EAAAA,CACxC,IAAMC,EAAmDL,EAAKM,IAAIH,CAAAA,EAC9DE,IACCD,EACHC,EAASK,OAAOL,EAASM,QAAQP,CAAAA,IAAa,EAAG,CAAA,EAEjDJ,EAAKQ,IAAIL,EAAM,CAAA,CAAA,EAAA,EAelBS,KAAAA,SAA+BT,EAAWU,EAAAA,CACzC,IAAIR,EAAWL,EAAKM,IAAIH,CAAAA,EACpBE,GACFA,EACCS,MAAAA,EACAC,IAAI,SAACX,EAAAA,CACLA,EAAQS,CAAAA,CAAAA,CAAAA,GAIXR,EAAWL,EAAKM,IAAI,GAAA,IAElBD,EACCS,MAAAA,EACAC,IAAI,SAACX,EAAAA,CACLA,EAAQD,EAAMU,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CCjHpB,IAAqBG,EAArB,KAAoC,CAApC,cACCC,EAAA,KAAQ,eAAoEC,EAAK,GAEjF,eAAgB,CACf,KAAK,aAAa,KAAK,iBAAiB,CACzC,CAEA,MAAM,QAAQC,EAAuBC,EAA0C,CAC9E,GAAI,CACH,IAAIC,EAAc,IAAI,QAAeC,GAAY,CAChD,IAAIC,EAAe,IAAM,CACxB,KAA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,EAC/D,CAAE,MAAOA,EAAmB,QAAQ,EAAG,MAAO,IAAK,CACnD,EACA,CACA,CAAE,MAAOA,EAAmB,KAAK,EAAG,MAAO,MAAO,QAAS,EAAK,EAChE,CAAE,MAAOA,EAAmB,IAAI,EAAG,MAAO,IAAK,CAC/C,EAGJ,OADa,MAAMxB,EAAgB,CAAE,QAASqB,EAAQ,QAAApB,EAAS,UAAW,uBAAwB,MAAAI,CAAM,CAAC,IACvF,KACnB,CAMA,eAAsBoB,GAAMJ,EAAgBC,EAAwB,CAAC,EAAkB,CACtF,MAAMtB,EAAgB0B,EAAA,CACrB,QAASL,EACT,UAAW,qBACX,QAAS,CAAC,CAAE,MAAOG,EAAmB,IAAI,EAAG,MAAO,KAAM,QAAS,EAAK,CAAC,GACtEF,EACH,CACF,CC5HO,IAAMK,GAAU",
6
- "names": ["all", "Map", "on", "type", "handler", "handlers", "get", "push", "set", "off", "splice", "indexOf", "emit", "evt", "slice", "map", "SessionHandler", "__publicField", "mitt_default", "callback", "type", "authPromise", "resolve", "eventHandler", "dialog", "link", "_", "eventName", "handler", "UserSession", "SessionHandler", "userData", "__publicField", "_a", "_b", "_c", "_d", "article", "logActivity", "activity", "parameters", "timeElapsed", "response", "__spreadProps", "__spreadValues", "getSessionData", "data", "error", "startActivity", "startParameters", "start", "endParameters", "time", "callback", "logError", "result", "e", "getSessionId", "sessionStart", "sessionId", "deviceId", "browserSessionId", "startSession", "_e", "_f", "_a", "event", "logError", "getLocalKey", "key", "_a", "LocalStorage", "__publicField", "global", "defaultValue", "lsKey", "value", "baseKey", "localStorage_default", "toLocalISODate", "date", "toLocalISODateTime", "pad", "num", "digits", "toLocalDateTime", "downloadBlob", "blob", "fileName", "resolve", "reject", "url", "parent", "anchor", "ex", "invariant", "condition", "message", "provided", "downloadRequest", "request", "fileName", "signal", "onProgress", "_a", "bytesReceived", "response", "data", "invariant", "reader", "stream", "controller", "pump", "read", "error", "blob", "downloadBlob", "err", "funcRegex", "parseFunc", "func", "_a", "match", "invariant", "a", "Namespace", "Namespace_default", "requireNamespace", "root", "namespace", "path", "current", "i", "Namespace_default", "expose", "name", "value", "options", "func", "funcName", "parseFunc", "invariant", "keyName", "namespace", "pathParts", "requireNamespace", "sizeMap", "getUserImage", "primKeyOrOptions", "login", "hash", "size", "sizePx", "fetchLocalizedString", "text", "response", "error", "getLocalizedString", "string", "wait", "_a", "_b", "promise", "fetchLocalizedString", "text", "localize", "stringParts", "args", "invariant", "stringToLocalize", "s", "localized", "getLocalizedString", "arg", "index", "getKey", "article", "_a", "_b", "_c", "_d", "_e", "_f", "articleKey", "getSettings", "setting", "key", "settings", "saveSettings", "value", "userSettings", "template", "$template", "waitForDialog", "dialog", "cancelValue", "resolve", "controller", "alertDialogPromiseMap", "openAlertDialog", "buttons", "content", "className", "id", "title", "_a", "_b", "$dialog", "$content", "$menu", "$header", "label", "value", "primary", "listItem", "buttonElem", "dialogPromise", "returnValue", "ConfirmButtons", "confirm", "prompt", "options", "optionButtons", "getLocalizedString", "alert", "__spreadValues", "version"]
4
+ "sourcesContent": ["export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = unknown> = (event: T) => void;\nexport type WildcardHandler<T = Record<string, unknown>> = (\n\ttype: keyof T,\n\tevent: T[keyof T]\n) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList<T = unknown> = Array<Handler<T>>;\nexport type WildCardEventHandlerList<T = Record<string, unknown>> = Array<\n\tWildcardHandler<T>\n>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<\n\tkeyof Events | '*',\n\tEventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>\n>;\n\nexport interface Emitter<Events extends Record<EventType, unknown>> {\n\tall: EventHandlerMap<Events>;\n\n\ton<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;\n\ton(type: '*', handler: WildcardHandler<Events>): void;\n\n\toff<Key extends keyof Events>(\n\t\ttype: Key,\n\t\thandler?: Handler<Events[Key]>\n\t): void;\n\toff(type: '*', handler: WildcardHandler<Events>): void;\n\n\temit<Key extends keyof Events>(type: Key, event: Events[Key]): void;\n\temit<Key extends keyof Events>(\n\t\ttype: undefined extends Events[Key] ? Key : never\n\t): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt<Events extends Record<EventType, unknown>>(\n\tall?: EventHandlerMap<Events>\n): Emitter<Events> {\n\ttype GenericEventHandler =\n\t\t| Handler<Events[keyof Events]>\n\t\t| WildcardHandler<Events>;\n\tall = all || new Map();\n\n\treturn {\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `'*'` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<Key extends keyof Events>(type: Key, handler: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.push(handler);\n\t\t\t} else {\n\t\t\t\tall!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * If `handler` is omitted, all handlers of the given type are removed.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)\n\t\t * @param {Function} [handler] Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<Key extends keyof Events>(type: Key, handler?: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\tif (handler) {\n\t\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tall!.set(type, []);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `'*'` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing '*' handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<Key extends keyof Events>(type: Key, evt?: Events[Key]) {\n\t\t\tlet handlers = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as EventHandlerList<Events[keyof Events]>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(evt!);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlers = all!.get('*');\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as WildCardEventHandlerList<Events>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(type, evt!);\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\n", "import mitt, { type Emitter, type Handler } from \"mitt\";\n\ntype SessionHandlerEvent = \"onExpired\" | \"onAuthenticated\";\n\nexport default class SessionHandler {\n\tprivate eventHandler: Emitter<{ onAuthenticated: undefined; onExpired: undefined }> = mitt();\n\n\tauthenticated() {\n\t\tthis.eventHandler.emit(\"onAuthenticated\");\n\t}\n\n\tasync expired(callback?: () => void, type?: \"RequireTwoFactor\"): Promise<void> {\n\t\ttry {\n\t\t\tlet authPromise = new Promise<void>((resolve) => {\n\t\t\t\tlet eventHandler = () => {\n\t\t\t\t\tthis.eventHandler.off(\"onAuthenticated\", eventHandler);\n\t\t\t\t\tcallback?.();\n\t\t\t\t\tresolve();\n\t\t\t\t};\n\n\t\t\t\tthis.eventHandler.on(\"onAuthenticated\", eventHandler);\n\t\t\t});\n\n\t\t\tlet dialog: HTMLDialogElement | null = document.querySelector(\"dialog.session-expired-dialog\");\n\t\t\tif (!dialog) {\n\t\t\t\tdialog = document.createElement(\"dialog\");\n\t\t\t\tdialog.className = \"session-expired-dialog\";\n\t\t\t\tdialog.style.display = \"flex\";\n\t\t\t\tdialog.style.padding = \"0\";\n\t\t\t\tdialog.style.left = \"50%\";\n\t\t\t\tdialog.style.transform = \"translateX(-50%)\";\n\n\t\t\t\tlet link = \"/login?ReturnUrl=%2fapi/sessionexpired/remove\";\n\t\t\t\tif (type !== \"RequireTwoFactor\") {\n\t\t\t\t\tawait fetch(\"/logout\", { method: \"POST\" });\n\t\t\t\t} else {\n\t\t\t\t\tlink = \"/login?RequireTwoFactor=1&ReturnUrl=%2fapi/sessionexpired/remove\";\n\t\t\t\t}\n\n\t\t\t\tdialog.innerHTML = `<iframe sandbox=\"allow-same-origin allow-scripts allow-modals allow-top-navigation-by-user-activation allow-forms\" src=\"${link}\" style=\"border:0;width:min(500px,100vw);height:min(700px, 100vh);\"></iframe>`;\n\t\t\t\tdocument.body.append(dialog);\n\t\t\t\tdialog.showModal();\n\t\t\t\tawait authPromise;\n\t\t\t\tdialog.remove();\n\t\t\t} else {\n\t\t\t\tawait authPromise;\n\t\t\t}\n\t\t} catch (_) {\n\t\t\twindow.location.href = `/login?ReturnUrl=${encodeURIComponent(window.location.pathname)}${encodeURIComponent(\n\t\t\t\twindow.location.search,\n\t\t\t)}`;\n\t\t}\n\t}\n\n\tattachEvent(eventName: SessionHandlerEvent, handler: Handler) {\n\t\treturn this.eventHandler.on(eventName, handler);\n\t}\n\n\tdetachEvent(eventName: SessionHandlerEvent, handler: Handler) {\n\t\treturn this.eventHandler.off(eventName, handler);\n\t}\n}\n", "import SessionHandler from \"./SessionHandler.js\";\n\nexport class UserSession extends SessionHandler {\n\tamDesignator = \"a.m.\";\n\tdayNames: string[] = [\"sunday\", \"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\"];\n\tdayNamesShort: string[] = [\"sun\", \"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\"];\n\tdecimalSeparator = \".\";\n\tdomain = \"OB\";\n\temail: string | null | undefined;\n\tformats: undefined | Record<string, string>;\n\tgroupSeparator: string | null = null;\n\tintegratedSecurity = false;\n\tisDeveloper = false;\n\tlogin = \"\";\n\tloginType: string | undefined;\n\tmonthNames: string[] = [\n\t\t\"january\",\n\t\t\"february\",\n\t\t\"march\",\n\t\t\"april\",\n\t\t\"may\",\n\t\t\"june\",\n\t\t\"july\",\n\t\t\"august\",\n\t\t\"september\",\n\t\t\"october\",\n\t\t\"november\",\n\t\t\"december\",\n\t\t\"\",\n\t];\n\tmonthNamesShort: string[] = [\"jan\", \"feb\", \"mar\", \"apr\", \"may\", \"jun\", \"jul\", \"augt\", \"sep\", \"oct\", \"nov\", \"dec\", \"\"];\n\tname: string | undefined;\n\tpmDesignator = \"p.m.\";\n\tshortDateFormat = \"dd.MM.yyyy\";\n\tculture = \"en-GB\";\n\tuiculture = \"en-GB\";\n\n\tconstructor(userData: any) {\n\t\tsuper();\n\t\tthis.formats = {};\n\t\tObject.assign(this, userData);\n\t}\n}\n", "const article = globalThis.af?.article?.id ?? globalThis.window?.location.pathname.substring(1).split(\"/\")[0];\n\n/**\n * Logs an activity to the website activity log\n *\n * @param activity name of the activity we are logging\n * @param parameters A dictionary of parameters used when doing the activity\n * @param timeElapsed Number of milliseconds elapsed while executing\n */\nexport async function logActivity(activity: string, parameters: Record<string, any> = {}, timeElapsed = 0) {\n\ttry {\n\t\tlet response = await fetch(\"/api/logging/log-activity\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({\n\t\t\t\tarticle,\n\t\t\t\ttimeElapsed,\n\t\t\t\taction: activity,\n\t\t\t\tparameters: {\n\t\t\t\t\t...parameters,\n\t\t\t\t\t_session: getSessionData(),\n\t\t\t\t},\n\t\t\t}),\n\t\t\theaders: { \"Content-Type\": \"application/json\", Accept: \"application/json\" },\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tif (response.headers.get(\"Content-Type\")?.includes(\"application/json\")) {\n\t\t\t\tlet data = await response.json();\n\t\t\t\tconsole.error(data.error);\n\t\t\t} else {\n\t\t\t\tconsole.error(`${response.status} ${response.statusText}`);\n\t\t\t}\n\t\t}\n\t} catch (error) {}\n}\n\n/**\n * Records the current time, and returns a function that logs the activity with the\n * time elapsed when it is called.\n *\n * @param activity Name of the activity we are logging\n * @param parameters A dictionary of parameters used when doing the activity\n * @returns A function that should be called when the activity is completed to log it to the website log\n */\nexport function startActivity(activity: string, startParameters: Record<string, any> = {}) {\n\tlet start = performance.now();\n\treturn (endParameters: Record<string, any> = {}) =>\n\t\tlogActivity(activity, { ...startParameters, ...endParameters }, performance.now() - start);\n}\n\n/**\n * Records the time used to execute an operation and returns the value of the operation and the time\n * in milliseconds\n */\nexport async function time<T>(callback: () => T | Promise<T>): Promise<[T, number]> {\n\tlet start = performance.now();\n\tlet returnValue = await callback();\n\n\treturn [returnValue, performance.now() - start];\n}\n\nexport async function logError(error: any) {\n\ttry {\n\t\tif (!error) return;\n\n\t\tlet data =\n\t\t\ttypeof error === \"string\"\n\t\t\t\t? { error: error }\n\t\t\t\t: typeof error === \"object\"\n\t\t\t\t\t? \"message\" in error\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\terror: error.message,\n\t\t\t\t\t\t\t\tstack: error.stack ?? null,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: { error: error.toString() }\n\t\t\t\t\t: { error: \"Unspecified error\" };\n\n\t\tconsole.error(error);\n\n\t\tlet result = await fetch(\"/data/Logger/LogError\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json; charset=utf-8\",\n\t\t\t},\n\t\t});\n\n\t\tif (result.ok) {\n\t\t\treturn await result.json();\n\t\t}\n\n\t\tconsole.error(Error(\"Failed to log error\"));\n\t} catch {}\n}\n\nfunction getSessionId() {\n\treturn crypto.randomUUID?.();\n}\n\nlet sessionStart = Date.now();\nlet sessionId = getSessionId();\nlet deviceId: string | null = \"\";\nlet browserSessionId: string | null = \"\";\n\nif (\"document\" in globalThis) {\n\tlet startSession = () =>\n\t\tlogActivity(\"AfSessionInit\", {\n\t\t\t\"appframe-core\": globalThis.af?.common?.version,\n\t\t\t\"appframe-data\": (globalThis.af as any)?.data?.version,\n\t\t\t\"app-version\": globalThis.af?.article?.version,\n\t\t});\n\n\tdocument.addEventListener(\"DOMContentLoaded\", () => {\n\t\tdeviceId = localStorage.getItem(\"_afDeviceId\");\n\t\tbrowserSessionId = sessionStorage.getItem(\"_afSessionId\");\n\t\tif (!deviceId) {\n\t\t\tdeviceId = getSessionId();\n\t\t\tlocalStorage.setItem(\"_afDeviceId\", deviceId);\n\t\t}\n\n\t\tif (!browserSessionId) {\n\t\t\tbrowserSessionId = sessionId;\n\t\t\tsessionStorage.setItem(\"_afSessionId\", browserSessionId);\n\t\t}\n\n\t\tstartSession();\n\t});\n\n\tdocument.addEventListener(\"visibilitychange\", function logData() {\n\t\tif (document.visibilityState === \"hidden\") {\n\t\t\tnavigator.sendBeacon(\n\t\t\t\t\"/api/logging/log-activity\",\n\t\t\t\tJSON.stringify({\n\t\t\t\t\tarticle,\n\t\t\t\t\taction: \"AfSessionEnd\",\n\t\t\t\t\tparameters: {\n\t\t\t\t\t\t_session: getSessionData(),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\tstartSession();\n\t\t}\n\t});\n}\n\n/**\n * Session and device ID's and information about session start and duration.\n * ID's will be null/undefined if crypto.randomUUID() is not supported.\n */\nexport type SessionData = {\n\t/**\n\t * Random UUID generated on page load, and persisted in sessionStorage\n\t */\n\tbrowserSessionId: string | null;\n\t/**\n\t * Random UUID generated on page load, and persisted in localStorage\n\t */\n\tdeviceId: string | null;\n\t/**\n\t * Time of page load in MS since epoch\n\t */\n\tsessionStart: number;\n\t/**\n\t * Time since page load (in MS) when this method was called\n\t */\n\tsessionLength: number;\n\t/**\n\t * Random UUID generated on page load. Not persisted.\n\t */\n\tsessionId: string | null;\n};\n\nexport function getSessionData(): SessionData {\n\treturn {\n\t\tbrowserSessionId,\n\t\tsessionStart,\n\t\tsessionLength: Date.now() - sessionStart,\n\t\tsessionId,\n\t\tdeviceId,\n\t};\n}\n", "import { logError } from \"./log.js\";\n\nif (process.env.NODE_ENV === \"production\") {\n\tglobalThis.window?.addEventListener(\"error\", (event) => {\n\t\tif (typeof event === \"object\" && \"error\" in event) {\n\t\t\tlogError(event.error);\n\t\t} else if (typeof event === \"object\" && \"message\" in event) {\n\t\t\tlogError(event);\n\t\t}\n\t});\n}\n", "function getLocalKey(key: string): string {\n\treturn [af?.article?.id || \"\", \"common\", key].join(\".\");\n}\n\nclass LocalStorage {\n\tisPersisted = () => true;\n\n\tgetLocalStorageKey(key: string, global?: boolean) {\n\t\treturn global ? [\"common\", key].join(\".\") : getLocalKey(key);\n\t}\n\n\tget(key: string, defaultValue: unknown, global?: boolean) {\n\t\tconst lsKey = this.getLocalStorageKey(key, global);\n\t\tconst value = localStorage.getItem(lsKey);\n\n\t\treturn value !== null ? JSON.parse(value) : defaultValue;\n\t}\n\n\tset(key: string, value: unknown, global?: boolean) {\n\t\tlocalStorage.setItem(this.getLocalStorageKey(key, global), JSON.stringify(value));\n\t}\n\n\tremove(key: string, global?: boolean) {\n\t\tconst lsKey = this.getLocalStorageKey(key, global);\n\t\tif (localStorage.getItem(lsKey) !== null) {\n\t\t\tlocalStorage.removeItem(lsKey);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclear() {\n\t\tconst baseKey = getLocalKey(\"\");\n\n\t\tfor (let key in localStorage) {\n\t\t\tif (key.slice(0, baseKey.length) === baseKey) {\n\t\t\t\tlocalStorage.removeItem(key);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default new LocalStorage();\n", "export function toLocalISODate(date: Date): string;\nexport function toLocalISODate(date: Date | null): string | null;\nexport function toLocalISODate(date: Date | null): string | null {\n\treturn date ? toLocalISODateTime(date).substring(0, 10) : null;\n}\n\nfunction pad(num: number, digits = 2) {\n\treturn String(num).padStart(digits, \"0\");\n}\n\n/**\n * Returns an ISO string (yyyy-MM-ddTHH:mm:ss.SSS) representing the local time\n * of the date object.\n *\n * @param date\n */\nexport function toLocalISODateTime(date: Date): string;\nexport function toLocalISODateTime(date: Date | null): string | null;\nexport function toLocalISODateTime(date: Date | null): string | null {\n\treturn date\n\t\t? `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(\n\t\t\t\tdate.getMinutes(),\n\t\t\t)}:${pad(date.getSeconds())}.${pad(date.getMilliseconds(), 3)}`\n\t\t: null;\n}\n\n/**\n * Converts a date object to a string compatible with input type datetime-local.\n * Will handle the UTC value of the date as if it was local, to be compatible with\n * data objects.\n *\n * If null or undefined is passed, returns an empty string.\n *\n * @param date\n */\nexport function toLocalDateTime(date?: Date | null): string {\n\treturn date ? date.toISOString().substring(0, 16) : \"\";\n}\n", "export function downloadBlob(blob: Blob | MediaSource, fileName: string) {\n\treturn new Promise<void>((resolve, reject) => {\n\t\ttry {\n\t\t\tconst url = URL.createObjectURL(blob);\n\t\t\tconst parent = document.body;\n\t\t\tconst anchor = document.createElement(\"a\");\n\t\t\tanchor.setAttribute(\"download\", fileName);\n\t\t\tanchor.href = url;\n\t\t\tparent.append(anchor);\n\t\t\tanchor.click();\n\t\t\tparent.removeChild(anchor);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tURL.revokeObjectURL(url);\n\t\t\t\tresolve();\n\t\t\t}, 250);\n\t\t} catch (ex) {\n\t\t\treject(ex);\n\t\t}\n\t});\n}\n", "/**\n * Throws an error if the condition is falsy. The provided message is used as the error message.\n * A function can be provided to lazily generate the message.\n *\n * @param {any} condition\n * @param {string | (() => string)} [message]\n * @returns {void}\n */\nexport function invariant(condition: any, message?: string | (() => string)): asserts condition {\n\tif (condition) {\n\t\treturn;\n\t}\n\tconst provided: string | undefined = typeof message === \"function\" ? message() : message;\n\n\tthrow new Error(provided ?? \"Invariant failed\");\n}\n", "import { downloadBlob } from \"./downloadBlob.js\";\nimport { invariant } from \"./invariant.js\";\n\nexport type DownloadItem = {\n\tstatus: \"cancelled\" | \"error\" | \"requested\" | \"downloading\" | \"downloaded\" | \"completed\";\n\tbytesReceived?: number;\n\terror?: string;\n};\n\nexport type DownloadParameters = {\n\tsignal?: AbortSignal;\n\tfileName: string;\n\tonProgress?: (progress: DownloadItem) => void;\n};\n\nexport async function downloadRequest(request: Request, { fileName, signal, onProgress }: DownloadParameters) {\n\tlet bytesReceived = 0;\n\n\tonProgress?.({ status: \"requested\" });\n\n\ttry {\n\t\tlet response = await fetch(request);\n\n\t\tif (!response.ok || !response.body) {\n\t\t\tif (response.headers.get(\"content-type\")?.includes(\"application/json\")) {\n\t\t\t\tlet data = await response.json();\n\t\t\t\tinvariant(!data.error, data.error);\n\t\t\t}\n\t\t\tthrow new Error(`${response.status} ${response.statusText}`);\n\t\t}\n\n\t\ttry {\n\t\t\tconst reader = response.body.getReader();\n\t\t\tconst stream = new ReadableStream({\n\t\t\t\tstart: (controller) => {\n\t\t\t\t\tfunction pump(): Promise<void> {\n\t\t\t\t\t\treturn reader.read().then((read) => {\n\t\t\t\t\t\t\tif (read.done) {\n\t\t\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbytesReceived += read.value.length;\n\t\t\t\t\t\t\tonProgress?.({ bytesReceived, status: \"downloading\" });\n\t\t\t\t\t\t\tcontroller.enqueue(read.value);\n\n\t\t\t\t\t\t\treturn pump();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn pump();\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tresponse = new Response(stream);\n\t\t} catch (error) {}\n\n\t\tconst blob = await response.blob();\n\n\t\tonProgress?.({ bytesReceived, status: \"downloaded\" });\n\n\t\tawait downloadBlob(blob, fileName);\n\n\t\tonProgress?.({ bytesReceived, status: \"completed\" });\n\t} catch (err) {\n\t\tif (signal?.aborted) {\n\t\t\tonProgress?.({ status: \"cancelled\" });\n\t\t} else {\n\t\t\tonProgress?.({ error: (err as Error).message, status: \"error\" });\n\t\t}\n\t}\n}\n", "import { invariant } from \"./invariant.js\";\n\nconst funcRegex =\n\t/^function(?:\\s+([a-zA-Z$_][a-zA-Z0-9$_]*))?\\s*\\(((?:(?:\\s*[a-zA-Z$_][a-zA-Z0-9$_]*)(?:\\s*,\\s*[a-zA-Z$_][a-zA-Z0-9$_]*)*)?)\\s*\\)\\s*\\{((?:.|\\n|\\r)*)\\}$/;\n\nexport function parseFunc(func: (...args: any[]) => any) {\n\tconst match = func.toString().match(funcRegex);\n\tinvariant(match, \"Unable to parse function!\");\n\treturn { name: func.name ?? match[1], args: match[2].split(\",\").map((a) => a.trim()), body: match[3] };\n}\n", "function Namespace() {}\nNamespace.prototype = Object.create(null);\n\nexport default Namespace;\n", "import Namespace from \"./Namespace.js\";\n\nexport function requireNamespace(root: any, namespace: string | Array<string>): any {\n\tif (typeof root === \"object\") {\n\t\tif (typeof namespace === \"string\") {\n\t\t\tlet path = namespace.split(\".\");\n\n\t\t\treturn requireNamespace(root, path);\n\t\t} else if (Array.isArray(namespace)) {\n\t\t\tlet current: any = root;\n\t\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\t\tcurrent = current[namespace[i]] = current[namespace[i]] || new (Namespace as any)();\n\t\t\t}\n\n\t\t\treturn current;\n\t\t}\n\t}\n}\n", "import { invariant } from \"./invariant.js\";\nimport { parseFunc } from \"./parseFunc.js\";\nimport { requireNamespace } from \"./requireNamespace.js\";\n\nexport type ExposeOptions = {\n\t/**\n\t * Whether we should overwrite any existing values without warning.\n\t */\n\toverwrite?: boolean;\n};\n\n/**\n * Expose a value to a potentially deeply nested global variable\n * @param name {string | object} Either a dot-separated path to the global variable, or an object to expose the value on\n * @param value {object | Function | Function[]} The value(s) to expose\n */\nexport function expose(\n\tname: object | string,\n\tvalue: object | ((...args: any[]) => any) | ((...args: any[]) => any)[] | string | number,\n\toptions: ExposeOptions = {},\n): void {\n\tif (Array.isArray(value)) {\n\t\tfor (let func of value) {\n\t\t\tconst { name: funcName } = parseFunc(func);\n\n\t\t\tinvariant(\n\t\t\t\tfuncName,\n\t\t\t\t\"Unable to detect name of function! Name it, or only supply one function and include name in first parameter.\",\n\t\t\t);\n\t\t\texpose(name, func); // Expose func on namespace found in pName\n\t\t}\n\t} else {\n\t\tlet keyName: string | undefined;\n\t\tlet namespace: any;\n\n\t\tif (typeof value === \"function\") {\n\t\t\tkeyName = parseFunc(value as (...args: any[]) => any).name;\n\t\t}\n\n\t\tif (typeof name === \"string\") {\n\t\t\tlet pathParts = name.split(\".\");\n\n\t\t\tif (!keyName) {\n\t\t\t\tkeyName = pathParts[pathParts.length - 1];\n\t\t\t\tpathParts = pathParts.slice(0, pathParts.length - 1);\n\t\t\t}\n\n\t\t\tnamespace = requireNamespace(window, pathParts);\n\t\t} else if (keyName && (typeof name === \"object\" || typeof name === \"function\")) {\n\t\t\tnamespace = name;\n\t\t} else {\n\t\t\tinvariant(false, \"Invalid typeof parameter 'name', or unable to parse pValue!\");\n\t\t}\n\n\t\tif (Object.hasOwn(namespace, keyName) && options?.overwrite !== true) {\n\t\t\t// If class is already defined, warn or show an alert\n\t\t\tconsole.warn(`${[name, keyName].join(\".\")} is already defined!`);\n\t\t} else {\n\t\t\tnamespace[keyName] = value;\n\t\t}\n\t}\n}\n", "export type ImageSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface getUserImageOptions {\n\t/**\n\t * Prim key of the record in atbl_Personnel_Employees\n\t */\n\tprimKey: string | null;\n\t/**\n\t * Person ID of the employee\n\t */\n\tlogin: string | null;\n\t/**\n\t * The value of the ImageHash column in atbl_Personnel_Employees\n\t */\n\thash: string | number | null;\n\t/**\n\t * The image will be resized according to this value. Default is 'xs':\n\t * - xs: 64px\n\t * - sm: 128px\n\t * - md: 256px\n\t * - lg: 512px\n\t * - xl: image is not resized\n\t */\n\tsize?: ImageSize;\n}\n\nconst sizeMap: Record<ImageSize, number | undefined> = {\n\txs: 64,\n\tsm: 128,\n\tmd: 256,\n\tlg: 512,\n\txl: undefined,\n};\n\n/**\n * Returns the absolute path of a users profile picture. Uses the EmployeesLookup\n * data resource to enable caching across applications.\n *\n * If one of primKey or hash are not provided, or are null, an empty string will be returned.\n */\nexport function getUserImage(\n\tprimKey: string | null,\n\tlogin: string | null,\n\thash: string | number | null,\n\tsize?: ImageSize,\n): string;\nexport function getUserImage(options: getUserImageOptions): string;\nexport function getUserImage(\n\tprimKeyOrOptions: string | null | getUserImageOptions,\n\tlogin?: string | null,\n\thash?: string | number | null,\n\tsize: ImageSize = \"xs\",\n) {\n\tif (primKeyOrOptions && typeof primKeyOrOptions === \"object\") {\n\t\treturn getUserImage(primKeyOrOptions.primKey, primKeyOrOptions.login, primKeyOrOptions.hash, primKeyOrOptions.size);\n\t}\n\n\tif (!primKeyOrOptions || !hash) {\n\t\treturn \"\";\n\t}\n\n\tlet sizePx = sizeMap[size];\n\treturn `/api/data/blob/EmployeesLookup/${primKeyOrOptions}/Image/${encodeURIComponent(login ?? \"\")}${\n\t\tlogin ? \".\" : \"\"\n\t}${encodeURIComponent(hash)}.jpg${sizePx ? `?width=${sizePx}` : \"\"}`;\n}\n", "async function fetchLocalizedString(text: string) {\n\ttry {\n\t\tlet response = await fetch(`/api/user/localize/new/${af.article.id}`, {\n\t\t\tbody: JSON.stringify({ text }),\n\t\t\theaders: {\n\t\t\t\tAccept: \"application/json; */*\",\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\"X-Requested-With\": \"XMLHttpRequest\",\n\t\t\t},\n\t\t\tmethod: \"POST\",\n\t\t});\n\n\t\tif (response.ok) {\n\t\t\treturn (await response.json()) as string;\n\t\t}\n\t} catch (error) {}\n\n\treturn text;\n}\nexport function getLocalizedStringAsync(string: undefined | null): undefined | null;\nexport function getLocalizedStringAsync(string: string): Promise<string>;\nexport function getLocalizedStringAsync(string: string | undefined | null) {\n\tif (!string) return string;\n\n\treturn getLocalizedString(string, true);\n}\n\nexport function getLocalizedString(string: undefined | null): undefined | null;\nexport function getLocalizedString(string: string): string;\nexport function getLocalizedString(string: string, wait: false): string;\nexport function getLocalizedString(string: string, wait: true): Promise<string>;\nexport function getLocalizedString(string: undefined | null, wait: true): undefined | null;\nexport function getLocalizedString(\n\tstring: string | undefined | null,\n\twait?: boolean,\n): string | undefined | null | Promise<string> {\n\tif (typeof string === \"string\" && string.trim().length === 0) {\n\t\treturn string;\n\t}\n\n\tif (string === undefined || string === \"\" || string === null) {\n\t\treturn;\n\t}\n\n\tif (globalThis.af?.article?.i18n !== undefined) {\n\t\tif (!Object.hasOwn(af.article.i18n, string)) {\n\t\t\taf.article.i18n[string] = string;\n\n\t\t\tlet promise = fetchLocalizedString(string).then((text) => {\n\t\t\t\taf.article.i18n[string] = text;\n\t\t\t\treturn text;\n\t\t\t});\n\n\t\t\tif (wait) {\n\t\t\t\treturn promise;\n\t\t\t}\n\t\t}\n\n\t\treturn af.article.i18n[string];\n\t} else {\n\t\treturn string;\n\t}\n}\n", "import { getLocalizedString } from \"./getLocalizedString.js\";\nimport { invariant } from \"./invariant.js\";\n\n/**\n * Localization function for tagged templates. Replaces the arguments\n * with $n, where n is the index, before asking Appframe to translate\n * the string.\n *\n * For example, if you call localize`Page ${2} or ${5}`, the string\n * \"Page $0 of $1\" will be sent to Appframe, and for norwegian,\n * \"Side 2 av 5\" will be returned.\n *\n * @param stringParts\n * @param args\n * @returns Translated string\n */\nexport function localize(stringParts: TemplateStringsArray, ...args: any[]): string {\n\tinvariant(\n\t\tArray.isArray(stringParts) && stringParts.length === args.length + 1,\n\t\t\"Method 'localize' must be used as a tag function\",\n\t);\n\n\tlet stringToLocalize = stringParts.map((s, i) => (i === stringParts.length - 1 ? s : `${s}\\$${i}`)).join(\"\");\n\tlet localized = getLocalizedString(stringToLocalize);\n\n\targs.forEach((arg, index) => {\n\t\tlocalized = localized.replace(`$${index}`, arg);\n\t});\n\n\treturn localized;\n}\n", "function getKey(article?: string) {\n\tconst articleKey =\n\t\tarticle ?? globalThis.af?.article?.id ?? globalThis.window?.location.pathname.substring(1).split(\"/\")[0];\n\treturn `${articleKey}.${globalThis.af?.userSession.login ?? \"anonymous\"}`;\n}\n\nexport function getSettings<T>(setting: string, article?: string): T | null {\n\tif (!globalThis.af?.userSession) return null;\n\n\tconst key = getKey(article);\n\tconst settings = JSON.parse(localStorage.getItem(key) || \"{}\");\n\n\tif (setting) {\n\t\treturn settings[setting] || null;\n\t}\n\n\treturn settings;\n}\n\nexport function saveSettings<T>(setting: string, value: T | null, article?: string): void {\n\tif (!globalThis.af?.userSession) return;\n\n\tconst key = getKey(article);\n\tlet userSettings = JSON.parse(localStorage.getItem(key) || \"{}\");\n\n\tif (typeof value !== \"undefined\") {\n\t\tuserSettings[setting] = value;\n\t} else {\n\t\tuserSettings = setting;\n\t}\n\n\tlocalStorage.setItem(key, JSON.stringify(userSettings));\n}\n", "import { getLocalizedString } from \"./getLocalizedString.js\";\n\nconst template = `\n\t<dialog class=\"alert-dialog\">\n\t\t\t<form method=\"dialog\">\n\t\t\t\t\t<article></article>\n\t\t\t\t\t<footer>\n\t\t\t\t\t\t\t<menu></menu>\n\t\t\t\t\t</footer>\n\t\t\t</form>\n\t</dialog>\n`;\n\nif (globalThis.document && !document.querySelector(\"#AlertDialogTemplate\")) {\n\tlet $template = document.createElement(\"template\");\n\t$template.id = \"AlertDialogTemplate\";\n\t$template.innerHTML = template;\n\tdocument.body.append($template);\n}\n\nexport function waitForDialog(dialog: HTMLDialogElement, cancelValue = \"No\"): Promise<string> {\n\treturn new Promise((resolve) => {\n\t\tlet controller = new AbortController();\n\n\t\tdialog.addEventListener(\n\t\t\t\"close\",\n\t\t\t() => {\n\t\t\t\tresolve(dialog.returnValue);\n\t\t\t\tcontroller.abort();\n\t\t\t},\n\t\t\t{ signal: controller.signal },\n\t\t);\n\n\t\tdialog.addEventListener(\n\t\t\t\"cancel\",\n\t\t\t() => {\n\t\t\t\tresolve(cancelValue);\n\t\t\t\tcontroller.abort();\n\t\t\t},\n\t\t\t{ signal: controller.signal },\n\t\t);\n\t});\n}\nexport type AlertDialogButton = {\n\tlabel: string;\n\tvalue: string;\n\tprimary?: boolean;\n};\n\nexport type AlertDialogOptions = {\n\tbuttons: AlertDialogButton[];\n\tcontent: string | HTMLElement;\n\tclassName?: string;\n\tid?: string;\n\ttitle?: string;\n};\n\nconst alertDialogPromiseMap = new Map<string, Promise<string>>();\n\nexport async function openAlertDialog({ buttons, content, className, id, title }: AlertDialogOptions) {\n\tif (id && alertDialogPromiseMap.has(id)) {\n\t\treturn await alertDialogPromiseMap.get(id);\n\t}\n\n\tlet $template = document.querySelector<HTMLTemplateElement>(\"#AlertDialogTemplate\");\n\tif (!$template) throw Error(\"No alert dialog template found\");\n\n\tlet $dialog = $template.content.firstElementChild?.cloneNode(true) as HTMLDialogElement | null;\n\tlet $content = $dialog?.querySelector(\"article\");\n\tlet $menu = $dialog?.querySelector(\"footer menu\");\n\n\tif (!$dialog || !$content || !$menu) throw Error(\"Invalid alert dialog template\");\n\n\tif (className) {\n\t\tfor (const className_ of className.split(/\\s+/)) {\n\t\t\t$dialog?.classList.add(className_);\n\t\t}\n\t}\n\n\tif (title) {\n\t\tlet $header = document.createElement(\"header\");\n\t\t$header.append(title);\n\t\t$content.parentNode?.insertBefore($header, $content);\n\t}\n\n\t$content.appendChild(typeof content === \"string\" ? document.createTextNode(content) : content);\n\tfor (let { label, value, primary } of buttons) {\n\t\tlet listItem = document.createElement(\"li\");\n\t\tlet buttonElem = document.createElement(\"button\");\n\t\tbuttonElem.value = value;\n\t\tif (primary) {\n\t\t\tbuttonElem.classList.add(\"primary\");\n\t\t}\n\t\tbuttonElem.textContent = label;\n\t\tlistItem.appendChild(buttonElem);\n\t\t$menu.appendChild(buttonElem);\n\t}\n\n\tdocument.body.appendChild($dialog);\n\t$dialog.showModal();\n\n\tlet dialogPromise = waitForDialog($dialog).then((returnValue) => {\n\t\tif (id && alertDialogPromiseMap.has(id)) {\n\t\t\talertDialogPromiseMap.delete(id);\n\t\t}\n\t\tif ($dialog) document.body.removeChild($dialog);\n\t\treturn returnValue;\n\t});\n\n\tif (id) {\n\t\talertDialogPromiseMap.set(id, dialogPromise);\n\t}\n\n\treturn await dialogPromise;\n}\n\nexport enum ConfirmButtons {\n\tYesNo = 0,\n\tOkCancel = 1,\n}\n\nexport type ConfirmOptions = {\n\tbuttons?: ConfirmButtons;\n\ttitle?: string;\n};\n\nexport async function confirm(prompt: string, options: ConfirmOptions = {}): Promise<boolean> {\n\tlet { buttons: optionButtons = ConfirmButtons.YesNo, title } = options;\n\tlet buttons: AlertDialogButton[] =\n\t\toptionButtons === ConfirmButtons.OkCancel\n\t\t\t? [\n\t\t\t\t\t{ label: getLocalizedString(\"OK\"), value: \"yes\", primary: true },\n\t\t\t\t\t{ label: getLocalizedString(\"Cancel\"), value: \"no\" },\n\t\t\t\t]\n\t\t\t: [\n\t\t\t\t\t{ label: getLocalizedString(\"Yes\"), value: \"yes\", primary: true },\n\t\t\t\t\t{ label: getLocalizedString(\"No\"), value: \"no\" },\n\t\t\t\t];\n\n\tlet result = await openAlertDialog({ content: prompt, buttons, className: \"alert-dialog-confirm\", title });\n\treturn result === \"yes\";\n}\n\nexport type AlertOptions = {\n\ttitle?: string;\n};\n\nexport async function alert(prompt: string, options: AlertOptions = {}): Promise<void> {\n\tawait openAlertDialog({\n\t\tcontent: prompt,\n\t\tclassName: \"alert-dialog-alert\",\n\t\tbuttons: [{ label: getLocalizedString(\"OK\"), value: \"ok\", primary: true }],\n\t\t...options,\n\t});\n}\n", "import { UserSession } from \"./UserSession.js\";\nimport type { alert, confirm, openAlertDialog } from \"./alert.js\";\nimport \"./errorHandler.js\";\nimport type { expose } from \"./expose.js\";\nimport type { getLocalizedString } from \"./getLocalizedString.js\";\nimport afLocalStorage from \"./localStorage.js\";\nimport type { localize } from \"./localize.js\";\nimport type { getSessionData, logActivity, logError, startActivity, time } from \"./log.js\";\n\nexport { default as mitt } from \"mitt\";\nexport { toLocalISODate, toLocalISODateTime, toLocalDateTime } from \"./date.js\";\nexport { downloadBlob } from \"./downloadBlob.js\";\nexport { downloadRequest } from \"./downloadRequest.js\";\nexport type { DownloadParameters, DownloadItem } from \"./downloadRequest.js\";\nexport { expose } from \"./expose.js\";\nexport { getUserImage } from \"./getUserImage.js\";\nexport type { getUserImageOptions } from \"./getUserImage.js\";\nexport { getLocalizedString } from \"./getLocalizedString.js\";\nexport { invariant } from \"./invariant.js\";\nexport { localize } from \"./localize.js\";\nexport { afLocalStorage as localStorage };\nexport { getSessionData, logActivity, logError, startActivity, time } from \"./log.js\";\nexport { default as SessionHandler } from \"./SessionHandler.js\";\nexport { UserSession };\nexport { getSettings, saveSettings } from \"./settings.js\";\nexport { alert, confirm, ConfirmButtons, openAlertDialog, waitForDialog } from \"./alert.js\";\nexport type { AlertDialogButton, AlertDialogOptions, AlertOptions, ConfirmOptions } from \"./alert.js\";\n\n// biome-ignore lint/correctness/noInvalidUseBeforeDeclaration: <explanation>\nexport const version = __VERSION__;\n\ndeclare global {\n\tvar __VERSION__: string;\n\tvar __DEV__: number;\n\tvar af: AfCore;\n\n\tinterface Window {\n\t\taf: AfCore;\n\t}\n}\n\nexport interface AfArticle {\n\thostName: string;\n\ti18n: Record<string, string>;\n\tid: string;\n\tversion?: string;\n}\n\nexport interface AfCore {\n\tarticle: AfArticle;\n\tcommon: {\n\t\tgetLocalizedString: typeof getLocalizedString;\n\t\texpose: typeof expose;\n\t\tgetSessionData: typeof getSessionData;\n\t\tlocalize: typeof localize;\n\t\tlocalStorage: typeof afLocalStorage;\n\t\tlogActivity: typeof logActivity;\n\t\tlogError: typeof logError;\n\t\tstartActivity: typeof startActivity;\n\t\talert: typeof alert;\n\t\tconfirm: typeof confirm;\n\t\topenAlertDialog: typeof openAlertDialog;\n\t\ttime: typeof time;\n\t\tversion?: string;\n\t};\n\tcontrols?: {\n\t\talert?: (message: string, callback?: () => void) => void;\n\t\tconfirm?: (options: {\n\t\t\ttitle: string;\n\t\t\tmessage: string;\n\t\t\tbuttons: string[];\n\t\t\tcallback: (button: number) => void;\n\t\t}) => void;\n\t};\n\tuserSession: UserSession;\n}\n"],
5
+ "mappings": "kfA8CCA,EAAAA,CAOA,MAAO,CAINA,IANDA,EAAMA,GAAO,IAAIC,IAchBC,GAAAA,SAA6BC,EAAWC,EAAAA,CACvC,IAAMC,EAAmDL,EAAKM,IAAIH,CAAAA,EAC9DE,EACHA,EAASE,KAAKH,CAAAA,EAEdJ,EAAKQ,IAAIL,EAAM,CAACC,CAAAA,CAAAA,CAAAA,EAWlBK,IAAAA,SAA8BN,EAAWC,EAAAA,CACxC,IAAMC,EAAmDL,EAAKM,IAAIH,CAAAA,EAC9DE,IACCD,EACHC,EAASK,OAAOL,EAASM,QAAQP,CAAAA,IAAa,EAAG,CAAA,EAEjDJ,EAAKQ,IAAIL,EAAM,CAAA,CAAA,EAAA,EAelBS,KAAAA,SAA+BT,EAAWU,EAAAA,CACzC,IAAIR,EAAWL,EAAKM,IAAIH,CAAAA,EACpBE,GACFA,EACCS,MAAAA,EACAC,IAAI,SAACX,EAAAA,CACLA,EAAQS,CAAAA,CAAAA,CAAAA,GAIXR,EAAWL,EAAKM,IAAI,GAAA,IAElBD,EACCS,MAAAA,EACAC,IAAI,SAACX,EAAAA,CACLA,EAAQD,EAAMU,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CCjHpB,IAAqBG,EAArB,KAAoC,CAApC,cACCC,EAAA,KAAQ,eAA8EC,EAAK,GAE3F,eAAgB,CACf,KAAK,aAAa,KAAK,iBAAiB,CACzC,CAEA,MAAM,QAAQC,EAAuBC,EAA0C,CAC9E,GAAI,CACH,IAAIC,EAAc,IAAI,QAAeC,GAAY,CAChD,IAAIC,EAAe,IAAM,CACxB,KAAK,aAAa,IAAI,kBAAmBA,C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,EAAmB,QAAQ,EAAG,MAAO,IAAK,CACpD,EACC,CACA,CAAE,MAAOA,EAAmB,KAAK,EAAG,MAAO,MAAO,QAAS,EAAK,EAChE,CAAE,MAAOA,EAAmB,IAAI,EAAG,MAAO,IAAK,CAChD,EAGH,OADa,MAAMzB,EAAgB,CAAE,QAASsB,EAAQ,QAAArB,EAAS,UAAW,uBAAwB,MAAAI,CAAM,CAAC,IACvF,KACnB,CAMA,eAAsBqB,GAAMJ,EAAgBC,EAAwB,CAAC,EAAkB,CACtF,MAAMvB,EAAgB2B,EAAA,CACrB,QAASL,EACT,UAAW,qBACX,QAAS,CAAC,CAAE,MAAOG,EAAmB,IAAI,EAAG,MAAO,KAAM,QAAS,EAAK,CAAC,GACtEF,EACH,CACF,CC7HO,IAAMK,GAAU",
6
+ "names": ["all", "Map", "on", "type", "handler", "handlers", "get", "push", "set", "off", "splice", "indexOf", "emit", "evt", "slice", "map", "SessionHandler", "__publicField", "mitt_default", "callback", "type", "authPromise", "resolve", "eventHandler", "dialog", "link", "_", "eventName", "handler", "UserSession", "SessionHandler", "userData", "__publicField", "_a", "_b", "_c", "_d", "article", "logActivity", "activity", "parameters", "timeElapsed", "response", "__spreadProps", "__spreadValues", "getSessionData", "data", "error", "startActivity", "startParameters", "start", "endParameters", "time", "callback", "logError", "result", "e", "getSessionId", "sessionStart", "sessionId", "deviceId", "browserSessionId", "startSession", "_e", "_f", "_a", "event", "logError", "getLocalKey", "key", "_a", "LocalStorage", "__publicField", "global", "defaultValue", "lsKey", "value", "baseKey", "localStorage_default", "toLocalISODate", "date", "toLocalISODateTime", "pad", "num", "digits", "toLocalDateTime", "downloadBlob", "blob", "fileName", "resolve", "reject", "url", "parent", "anchor", "ex", "invariant", "condition", "message", "provided", "downloadRequest", "request", "fileName", "signal", "onProgress", "_a", "bytesReceived", "response", "data", "invariant", "reader", "stream", "controller", "pump", "read", "error", "blob", "downloadBlob", "err", "funcRegex", "parseFunc", "func", "_a", "match", "invariant", "a", "Namespace", "Namespace_default", "requireNamespace", "root", "namespace", "path", "current", "i", "Namespace_default", "expose", "name", "value", "options", "func", "funcName", "parseFunc", "invariant", "keyName", "namespace", "pathParts", "requireNamespace", "sizeMap", "getUserImage", "primKeyOrOptions", "login", "hash", "size", "sizePx", "fetchLocalizedString", "text", "response", "error", "getLocalizedString", "string", "wait", "_a", "_b", "promise", "fetchLocalizedString", "text", "localize", "stringParts", "args", "invariant", "stringToLocalize", "s", "localized", "getLocalizedString", "arg", "index", "getKey", "article", "_a", "_b", "_c", "_d", "_e", "_f", "articleKey", "getSettings", "setting", "key", "settings", "saveSettings", "value", "userSettings", "template", "$template", "waitForDialog", "dialog", "cancelValue", "resolve", "controller", "alertDialogPromiseMap", "openAlertDialog", "buttons", "content", "className", "id", "title", "_a", "_b", "$dialog", "$content", "$menu", "className_", "$header", "label", "value", "primary", "listItem", "buttonElem", "dialogPromise", "returnValue", "ConfirmButtons", "confirm", "prompt", "options", "optionButtons", "getLocalizedString", "alert", "__spreadValues", "version"]
7
7
  }