mudlet-map-browser-script 0.0.14 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-DN84wJBG.js +2 -0
- package/dist/assets/index-DN84wJBG.js.map +1 -0
- package/dist/embedded.min.js +2 -0
- package/dist/embedded.min.js.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/mobile.min.js +2 -0
- package/dist/mobile.min.js.map +1 -0
- package/package.json +12 -34
- package/dist/bundle.min.js +0 -1
- package/index.js +0 -917
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{m as t,f as e,p as s,z as o}from"./assets/index-DN84wJBG.js";const n={polnoc:"north",poludnie:"south",wschod:"east",zachod:"west","polnocny-wschod":"northeast","polnocny-zachod":"northwest","poludniowy-wschod":"southeast","poludniowy-zachod":"southwest",dol:"down",gora:"up",gore:"up"},r={north:"n",south:"s",east:"e",west:"w",northeast:"ne",northwest:"nw",southeast:"se",southwest:"sw",up:"u",down:"d"},a={e:"east",w:"west",n:"north",s:"south",sw:"southwest",se:"southeast",nw:"northwest",ne:"northeast",u:"up",d:"down"};function i(t){return n[t]??a[t]??t}window.embedded=new class{constructor(){this.map=document.querySelector("#map"),this.reader=new t(mapData,colors);const n=o();this.renderer=new e(this.map,this.reader,n),this.pathFinder=new s(this.reader),this.gmcpPosition={},this.event=new EventTarget,this.hashes={},this.reader.getRooms().forEach(t=>{t.hash&&(this.hashes[t.hash]=t)}),window.addEventListener("message",t=>{switch(t.data.type){case"mapPosition":this.gmcpPosition=t.data.data,this.event.dispatchEvent(new CustomEvent("mapPosition"));break;case"refreshPosition":this.setMapPosition(this.gmcpPosition);break;case"command":parent.postMessage({type:"command",payload:this.parseCommand(t.data.data)},"https://arkadia.rpg.pl")}})}renderRoomById(t){const e=this.reader.getRoom(t);e&&this.renderRoom(e)}renderRoom(t){this.renderer.drawArea(t.area,t.z),this.renderer.centerOn(t.id),this.renderer.setZoom(.35),this.currentRoom=t,this.renderer.clearPaths();const e=this.pathFinder.findPath(t.id,5168);e&&this.renderer.renderPath(e,"#FF0000")}parseCommand(t){let e=t;if("zerknij"!==t&&"spojrz"!==t&&"sp"!==t||this.event.addEventListener("mapPosition",()=>{this.setMapPosition(this.gmcpPosition)},{once:!0}),this.currentRoom){const o={...this.currentRoom.exits,...this.currentRoom.specialExits},n=i(t);if(!this.currentRoom.exits[n]){const n=Object.entries(o).filter(([,e])=>{const s=this.reader.getRoom(e);return s&&this.findRoomByExit(this.currentRoom,s,i(t))}).map(([t])=>t);n.length>0&&(s=n[0],e=r[s]??s)}const a=o[i(e)];a&&this.renderRoomById(a)}var s;return e??t}setMapPosition(t){if(t&&t.x&&t.y&&t.id&&t.name){const e=`${t.x}:${t.y-19}:0:${t.name}`,s=this.hashes[e];s&&this.renderRoom(s)}}findRoomByExit(t,e,s){const o=e.x,n=e.y,r=e.z,a=t.x,i=t.y,h=t.z;return"south"===s?o===a&&n>i&&r===h:"north"===s?o===a&&n<i&&r===h:"east"===s?o>a&&n===i&&r===h:"west"===s?o<a&&n===i&&r===h:"northwest"===s?o<a&&n>i&&r===h:"northeast"===s?o>a&&n>i&&r===h:"southwest"===s?o<a&&n<i&&r===h:"southeast"===s?o>a&&n<i&&r===h:"down"===s?o===a&&n===i&&r<h:"up"===s&&(o===a&&n===i&&r>h)}};const h=window.embedded;h.renderRoomById(3756),h.parseCommand("n");
|
|
2
|
+
//# sourceMappingURL=embedded.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedded.min.js","sources":["../src/embedded.ts"],"sourcesContent":["import {MapReader, Renderer, createSettings, PathFinder} from \"mudlet-map-renderer\";\r\n\r\nconst polishToEnglish: Record<string, string> = {\r\n [\"polnoc\"]: \"north\",\r\n [\"poludnie\"]: \"south\",\r\n [\"wschod\"]: \"east\",\r\n [\"zachod\"]: \"west\",\r\n [\"polnocny-wschod\"]: \"northeast\",\r\n [\"polnocny-zachod\"]: \"northwest\",\r\n [\"poludniowy-wschod\"]: \"southeast\",\r\n [\"poludniowy-zachod\"]: \"southwest\",\r\n [\"dol\"]: \"down\",\r\n [\"gora\"]: \"up\",\r\n [\"gore\"]: \"up\",\r\n};\r\n\r\nconst longToShort: Record<string, string> = {\r\n north: \"n\",\r\n south: \"s\",\r\n east: \"e\",\r\n west: \"w\",\r\n northeast: \"ne\",\r\n northwest: \"nw\",\r\n southeast: \"se\",\r\n southwest: \"sw\",\r\n up: \"u\",\r\n down: \"d\",\r\n};\r\n\r\nconst exits: Record<string, string> = {\r\n e: \"east\",\r\n w: \"west\",\r\n n: \"north\",\r\n s: \"south\",\r\n sw: \"southwest\",\r\n se: \"southeast\",\r\n nw: \"northwest\",\r\n ne: \"northeast\",\r\n u: \"up\",\r\n d: \"down\",\r\n};\r\n\r\nfunction getLongDir(dir: string): string {\r\n return polishToEnglish[dir] ?? exits[dir] ?? dir;\r\n}\r\n\r\nfunction getShortDir(dir: string): string {\r\n return longToShort[dir] ?? dir;\r\n}\r\n\r\nclass EmbeddedMap {\r\n map: HTMLDivElement;\r\n reader: MapReader;\r\n renderer: Renderer;\r\n pathFinder: PathFinder;\r\n gmcpPosition: any;\r\n event: EventTarget;\r\n hashes: Record<string, MapData.Room>;\r\n currentRoom: MapData.Room | undefined;\r\n\r\n constructor() {\r\n this.map = document.querySelector(\"#map\") as HTMLDivElement;\r\n\r\n this.reader = new MapReader(mapData, colors);\r\n\r\n const settings = createSettings();\r\n this.renderer = new Renderer(this.map, this.reader, settings);\r\n this.pathFinder = new PathFinder(this.reader);\r\n this.gmcpPosition = {};\r\n this.event = new EventTarget();\r\n\r\n this.hashes = {};\r\n this.reader.getRooms().forEach(room => {\r\n if (room.hash) {\r\n this.hashes[room.hash] = room;\r\n }\r\n });\r\n\r\n window.addEventListener(\"message\", (e) => {\r\n switch (e.data.type) {\r\n case \"mapPosition\":\r\n this.gmcpPosition = e.data.data;\r\n this.event.dispatchEvent(new CustomEvent(\"mapPosition\"));\r\n break;\r\n case \"refreshPosition\":\r\n this.setMapPosition(this.gmcpPosition);\r\n break;\r\n case \"command\":\r\n parent.postMessage({\r\n type: \"command\",\r\n payload: this.parseCommand(e.data.data),\r\n }, \"https://arkadia.rpg.pl\");\r\n break;\r\n }\r\n });\r\n }\r\n\r\n renderRoomById(id: number) {\r\n const room = this.reader.getRoom(id);\r\n if (room) {\r\n this.renderRoom(room);\r\n }\r\n }\r\n\r\n renderRoom(room: MapData.Room) {\r\n this.renderer.drawArea(room.area, room.z);\r\n this.renderer.centerOn(room.id);\r\n this.renderer.setZoom(0.35);\r\n this.currentRoom = room;\r\n\r\n this.renderer.clearPaths();\r\n const pathLocations = this.pathFinder.findPath(room.id, 5168);\r\n if (pathLocations) {\r\n this.renderer.renderPath(pathLocations, \"#FF0000\");\r\n }\r\n }\r\n\r\n parseCommand(command: string): string {\r\n let commandToBeSent = command;\r\n if (command === \"zerknij\" || command === \"spojrz\" || command === \"sp\") {\r\n this.event.addEventListener(\"mapPosition\", () => {\r\n this.setMapPosition(this.gmcpPosition);\r\n }, {once: true});\r\n }\r\n if (this.currentRoom) {\r\n const allExits: Record<string, number> = {...this.currentRoom.exits, ...this.currentRoom.specialExits};\r\n const potentialExit = getLongDir(command);\r\n if (!this.currentRoom.exits[potentialExit as MapData.direction]) {\r\n const foundExits = Object.entries(allExits).filter(([, id]) => {\r\n const target = this.reader.getRoom(id);\r\n return target && this.findRoomByExit(this.currentRoom!, target, getLongDir(command));\r\n }).map(([exit]) => exit);\r\n if (foundExits.length > 0) {\r\n commandToBeSent = getShortDir(foundExits[0]);\r\n }\r\n }\r\n\r\n const targetId = allExits[getLongDir(commandToBeSent)];\r\n if (targetId) {\r\n this.renderRoomById(targetId);\r\n }\r\n }\r\n\r\n return commandToBeSent ?? command;\r\n }\r\n\r\n setMapPosition(data: any) {\r\n if (data && data.x && data.y && data.id && data.name) {\r\n const hash = `${data.x}:${data.y - 19}:0:${data.name}`;\r\n const room = this.hashes[hash];\r\n if (room) {\r\n this.renderRoom(room);\r\n }\r\n }\r\n }\r\n\r\n findRoomByExit(room: MapData.Room, targetRoom: MapData.Room, targetDir: string): boolean {\r\n const x = targetRoom.x;\r\n const y = targetRoom.y;\r\n const z = targetRoom.z;\r\n const c_x = room.x;\r\n const c_y = room.y;\r\n const c_z = room.z;\r\n\r\n if (targetDir === \"south\") return x === c_x && y > c_y && z === c_z;\r\n if (targetDir === \"north\") return x === c_x && y < c_y && z === c_z;\r\n if (targetDir === \"east\") return x > c_x && y === c_y && z === c_z;\r\n if (targetDir === \"west\") return x < c_x && y === c_y && z === c_z;\r\n if (targetDir === \"northwest\") return x < c_x && y > c_y && z === c_z;\r\n if (targetDir === \"northeast\") return x > c_x && y > c_y && z === c_z;\r\n if (targetDir === \"southwest\") return x < c_x && y < c_y && z === c_z;\r\n if (targetDir === \"southeast\") return x > c_x && y < c_y && z === c_z;\r\n if (targetDir === \"down\") return x === c_x && y === c_y && z < c_z;\r\n if (targetDir === \"up\") return x === c_x && y === c_y && z > c_z;\r\n return false;\r\n }\r\n}\r\n\r\n(window as any).embedded = new EmbeddedMap();\r\nconst embedded = (window as any).embedded as EmbeddedMap;\r\nembedded.renderRoomById(3756);\r\nembedded.parseCommand(\"n\");\r\n"],"names":["polishToEnglish","polnoc","poludnie","wschod","zachod","dol","gora","gore","longToShort","north","south","east","west","northeast","northwest","southeast","southwest","up","down","exits","e","w","n","s","sw","se","nw","ne","u","d","getLongDir","dir","window","embedded","constructor","this","map","document","querySelector","reader","MapReader","mapData","colors","settings","createSettings","renderer","Renderer","pathFinder","PathFinder","gmcpPosition","event","EventTarget","hashes","getRooms","forEach","room","hash","addEventListener","data","type","dispatchEvent","CustomEvent","setMapPosition","parent","postMessage","payload","parseCommand","renderRoomById","id","getRoom","renderRoom","drawArea","area","z","centerOn","setZoom","currentRoom","clearPaths","pathLocations","findPath","renderPath","command","commandToBeSent","once","allExits","specialExits","potentialExit","foundExits","Object","entries","filter","target","findRoomByExit","exit","length","targetId","x","y","name","targetRoom","targetDir","c_x","c_y","c_z"],"mappings":"oEAEA,MAAMA,EAA0C,CAC5CC,OAAY,QACZC,SAAc,QACdC,OAAY,OACZC,OAAY,OACZ,kBAAqB,YACrB,kBAAqB,YACrB,oBAAuB,YACvB,oBAAuB,YACvBC,IAAS,OACTC,KAAU,KACVC,KAAU,MAGRC,EAAsC,CACxCC,MAAO,IACPC,MAAO,IACPC,KAAM,IACNC,KAAM,IACNC,UAAW,KACXC,UAAW,KACXC,UAAW,KACXC,UAAW,KACXC,GAAI,IACJC,KAAM,KAGJC,EAAgC,CAClCC,EAAG,OACHC,EAAG,OACHC,EAAG,QACHC,EAAG,QACHC,GAAI,YACJC,GAAI,YACJC,GAAI,YACJC,GAAI,YACJC,EAAG,KACHC,EAAG,QAGP,SAASC,EAAWC,GAChB,OAAO/B,EAAgB+B,IAAQZ,EAAMY,IAAQA,CACjD,CAsICC,OAAeC,SAAW,IAhI3B,MAUI,WAAAC,GACIC,KAAKC,IAAMC,SAASC,cAAc,QAElCH,KAAKI,OAAS,IAAIC,EAAUC,QAASC,QAErC,MAAMC,EAAWC,IACjBT,KAAKU,SAAW,IAAIC,EAASX,KAAKC,IAAKD,KAAKI,OAAQI,GACpDR,KAAKY,WAAa,IAAIC,EAAWb,KAAKI,QACtCJ,KAAKc,aAAe,CAAA,EACpBd,KAAKe,MAAQ,IAAIC,YAEjBhB,KAAKiB,OAAS,CAAA,EACdjB,KAAKI,OAAOc,WAAWC,QAAQC,IACvBA,EAAKC,OACLrB,KAAKiB,OAAOG,EAAKC,MAAQD,KAIjCvB,OAAOyB,iBAAiB,UAAYrC,IAChC,OAAQA,EAAEsC,KAAKC,MACX,IAAK,cACDxB,KAAKc,aAAe7B,EAAEsC,KAAKA,KAC3BvB,KAAKe,MAAMU,cAAc,IAAIC,YAAY,gBACzC,MACJ,IAAK,kBACD1B,KAAK2B,eAAe3B,KAAKc,cACzB,MACJ,IAAK,UACDc,OAAOC,YAAY,CACfL,KAAM,UACNM,QAAS9B,KAAK+B,aAAa9C,EAAEsC,KAAKA,OACnC,4BAInB,CAEA,cAAAS,CAAeC,GACX,MAAMb,EAAOpB,KAAKI,OAAO8B,QAAQD,GAC7Bb,GACApB,KAAKmC,WAAWf,EAExB,CAEA,UAAAe,CAAWf,GACPpB,KAAKU,SAAS0B,SAAShB,EAAKiB,KAAMjB,EAAKkB,GACvCtC,KAAKU,SAAS6B,SAASnB,EAAKa,IAC5BjC,KAAKU,SAAS8B,QAAQ,KACtBxC,KAAKyC,YAAcrB,EAEnBpB,KAAKU,SAASgC,aACd,MAAMC,EAAgB3C,KAAKY,WAAWgC,SAASxB,EAAKa,GAAI,MACpDU,GACA3C,KAAKU,SAASmC,WAAWF,EAAe,UAEhD,CAEA,YAAAZ,CAAae,GACT,IAAIC,EAAkBD,EAMtB,GALgB,YAAZA,GAAqC,WAAZA,GAAoC,OAAZA,GACjD9C,KAAKe,MAAMO,iBAAiB,cAAe,KACvCtB,KAAK2B,eAAe3B,KAAKc,eAC1B,CAACkC,MAAM,IAEVhD,KAAKyC,YAAa,CAClB,MAAMQ,EAAmC,IAAIjD,KAAKyC,YAAYzD,SAAUgB,KAAKyC,YAAYS,cACnFC,EAAgBxD,EAAWmD,GACjC,IAAK9C,KAAKyC,YAAYzD,MAAMmE,GAAqC,CAC7D,MAAMC,EAAaC,OAAOC,QAAQL,GAAUM,OAAO,EAAC,CAAGtB,MACnD,MAAMuB,EAASxD,KAAKI,OAAO8B,QAAQD,GACnC,OAAOuB,GAAUxD,KAAKyD,eAAezD,KAAKyC,YAAce,EAAQ7D,EAAWmD,MAC5E7C,IAAI,EAAEyD,KAAUA,GACfN,EAAWO,OAAS,IAtFnB/D,EAuF6BwD,EAAW,GAAzCL,EAtFT1E,EAAYuB,IAAQA,EAwFnB,CAEA,MAAMgE,EAAWX,EAAStD,EAAWoD,IACjCa,GACA5D,KAAKgC,eAAe4B,EAE5B,CA/FR,IAAqBhE,EAiGb,OAAOmD,GAAmBD,CAC9B,CAEA,cAAAnB,CAAeJ,GACX,GAAIA,GAAQA,EAAKsC,GAAKtC,EAAKuC,GAAKvC,EAAKU,IAAMV,EAAKwC,KAAM,CAClD,MAAM1C,EAAO,GAAGE,EAAKsC,KAAKtC,EAAKuC,EAAI,QAAQvC,EAAKwC,OAC1C3C,EAAOpB,KAAKiB,OAAOI,GACrBD,GACApB,KAAKmC,WAAWf,EAExB,CACJ,CAEA,cAAAqC,CAAerC,EAAoB4C,EAA0BC,GACzD,MAAMJ,EAAIG,EAAWH,EACfC,EAAIE,EAAWF,EACfxB,EAAI0B,EAAW1B,EACf4B,EAAM9C,EAAKyC,EACXM,EAAM/C,EAAK0C,EACXM,EAAMhD,EAAKkB,EAEjB,MAAkB,UAAd2B,EAA8BJ,IAAMK,GAAOJ,EAAIK,GAAO7B,IAAM8B,EAC9C,UAAdH,EAA8BJ,IAAMK,GAAOJ,EAAIK,GAAO7B,IAAM8B,EAC9C,SAAdH,EAA6BJ,EAAIK,GAAOJ,IAAMK,GAAO7B,IAAM8B,EAC7C,SAAdH,EAA6BJ,EAAIK,GAAOJ,IAAMK,GAAO7B,IAAM8B,EAC7C,cAAdH,EAAkCJ,EAAIK,GAAOJ,EAAIK,GAAO7B,IAAM8B,EAChD,cAAdH,EAAkCJ,EAAIK,GAAOJ,EAAIK,GAAO7B,IAAM8B,EAChD,cAAdH,EAAkCJ,EAAIK,GAAOJ,EAAIK,GAAO7B,IAAM8B,EAChD,cAAdH,EAAkCJ,EAAIK,GAAOJ,EAAIK,GAAO7B,IAAM8B,EAChD,SAAdH,EAA6BJ,IAAMK,GAAOJ,IAAMK,GAAO7B,EAAI8B,EAC7C,OAAdH,IAA2BJ,IAAMK,GAAOJ,IAAMK,GAAO7B,EAAI8B,EAEjE,GAIJ,MAAMtE,EAAYD,OAAeC,SACjCA,EAASkC,eAAe,MACxBlC,EAASiC,aAAa"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.getOwnPropertyNames;import{m as t,z as n,p as i,f as s}from"./assets/index-DN84wJBG.js";var r,o,a=(r={"index.min.js"(e,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var c={INVALID_PARAM_LANGUAGE:function(e){return"Invalid parameter for `language` provided. Expected a string, but got ".concat(o(e),".")},INVALID_PARAM_JSON:function(e){return"Invalid parameter for `json` provided. Expected an object, but got ".concat(o(e),".")},EMPTY_PARAM_LANGUAGE:function(){return"The parameter for `language` can't be an empty string."},EMPTY_PARAM_JSON:function(){return"The parameter for `json` must have at least one key/value pair."},INVALID_PARAM_KEY:function(e){return"Invalid parameter for `key` provided. Expected a string, but got ".concat(o(e),".")},NO_LANGUAGE_REGISTERED:function(e){return'No translation for language "'.concat(e,'" has been added, yet. Make sure to register that language using the `.add()` method first.')},TRANSLATION_NOT_FOUND:function(e,t){return'No translation found for key "'.concat(e,'" in language "').concat(t,'". Is there a key/value in your translation file?')},INVALID_PARAMETER_SOURCES:function(e){return"Invalid parameter for `sources` provided. Expected either a string or an array, but got ".concat(o(e),".")},FETCH_ERROR:function(e){return'Could not fetch "'.concat(e.url,'": ').concat(e.status," (").concat(e.statusText,")")},INVALID_ENVIRONMENT:function(){return"You are trying to execute the method `translatePageTo()`, which is only available in the browser. Your environment is most likely Node.js"},MODULE_NOT_FOUND:function(e){return e},MISMATCHING_ATTRIBUTES:function(e,t,n){return'The attributes "data-i18n" and "data-i18n-attr" must contain the same number of keys.\n\nValues in `data-i18n`: ('.concat(e.length,") `").concat(e.join(" "),"`\nValues in `data-i18n-attr`: (").concat(t.length,") `").concat(t.join(" "),"`\n\nThe HTML element is:\n").concat(n.outerHTML)},INVALID_OPTIONS:function(e){return"Invalid config passed to the `Translator` constructor. Expected an object, but got ".concat(o(e),". Using default config instead.")}};function u(e){return function(t){if(e)try{for(var n=c[t],i=arguments.length,s=new Array(i>1?i-1:0),r=1;r<i;r++)s[r-1]=arguments[r];throw new TypeError(n?n.apply(void 0,s):"Unhandled Error")}catch(d){var o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,s,r=[],o=!0,a=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!t||r.length!==t);o=!0);}catch(l){a=!0,s=l}finally{try{o||null==n.return||n.return()}finally{if(a)throw s}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(d.stack.split(/\n/g)[1].split(/@/),2),a=o[0],u=o[1];console.error("".concat(d.message,"\n\nThis error happened in the method `").concat(a,"` from: `").concat(u,"`.\n\nIf you don't want to see these error messages, turn off debugging by passing `{ debug: false }` to the constructor.\n\nError code: ").concat(t,"\n\nCheck out the documentation for more details about the API:\nhttps://github.com/andreasremdt/simple-translator#usage\n "))}}}var d=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.debug=u(!0),("object"!=o(t)||Array.isArray(t))&&(this.debug("INVALID_OPTIONS",t),t={}),this.languages=new Map,this.config=Object.assign(e.defaultConfig,t);var n=this.config,i=n.debug,s=n.registerGlobally,r=n.detectLanguage;this.debug=u(i),s&&(this._globalObject[s]=this.translateForKey.bind(this)),r&&"browser"==this._env&&this._detectLanguage()}var t,n,i;return t=e,n=[{key:"_globalObject",get:function(){return"browser"==this._env?window:global}},{key:"_env",get:function(){return"undefined"!=typeof window?"browser":void 0!==r&&r.exports?"node":"browser"}},{key:"_detectLanguage",value:function(){var e=window.localStorage?localStorage.getItem(this.config.persistKey):void 0;if(e)this.config.defaultLanguage=e;else{var t=navigator.languages?navigator.languages[0]:navigator.language;this.config.defaultLanguage=t.substr(0,2)}}},{key:"_getValueFromJSON",value:function(e,t){var n=this.languages.get(t);return e.split(".").reduce(function(e,t){return e?e[t]:null},n)}},{key:"_replace",value:function(e,t){var n,i,s=this,r=null===(n=e.getAttribute("data-i18n"))||void 0===n?void 0:n.split(/\s/g),o=null==e||null===(i=e.getAttribute("data-i18n-attr"))||void 0===i?void 0:i.split(/\s/g);o&&r.length!=o.length&&this.debug("MISMATCHING_ATTRIBUTES",r,o,e),r.forEach(function(n,i){var r=s._getValueFromJSON(n,t),a=o?o[i]:"innerHTML";r?"innerHTML"==a?e[a]=r:e.setAttribute(a,r):s.debug("TRANSLATION_NOT_FOUND",n,t)})}},{key:"translatePageTo",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.defaultLanguage;if("node"!=this._env)if("string"==typeof t)if(0!=t.length)if(this.languages.has(t)){var n="string"==typeof this.config.selector?Array.from(document.querySelectorAll(this.config.selector)):this.config.selector;n.length&&n.length>0?n.forEach(function(n){return e._replace(n,t)}):null==n.length&&this._replace(n,t),this._currentLanguage=t,document.documentElement.lang=t,this.config.persist&&window.localStorage&&localStorage.setItem(this.config.persistKey,t)}else this.debug("NO_LANGUAGE_REGISTERED",t);else this.debug("EMPTY_PARAM_LANGUAGE");else this.debug("INVALID_PARAM_LANGUAGE",t);else this.debug("INVALID_ENVIRONMENT")}},{key:"translateForKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.defaultLanguage;return"string"!=typeof e?(this.debug("INVALID_PARAM_KEY",e),null):this.languages.has(t)?this._getValueFromJSON(e,t)||(this.debug("TRANSLATION_NOT_FOUND",e,t),null):(this.debug("NO_LANGUAGE_REGISTERED",t),null)}},{key:"add",value:function(e,t){return"string"!=typeof e?(this.debug("INVALID_PARAM_LANGUAGE",e),this):0==e.length?(this.debug("EMPTY_PARAM_LANGUAGE"),this):Array.isArray(t)||"object"!=o(t)?(this.debug("INVALID_PARAM_JSON",t),this):0==Object.keys(t).length?(this.debug("EMPTY_PARAM_JSON"),this):(this.languages.set(e,t),this)}},{key:"remove",value:function(e){return"string"!=typeof e?(this.debug("INVALID_PARAM_LANGUAGE",e),this):0==e.length?(this.debug("EMPTY_PARAM_LANGUAGE"),this):(this.languages.delete(e),this)}},{key:"fetch",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!Array.isArray(e)&&"string"!=typeof e)return this.debug("INVALID_PARAMETER_SOURCES",e),null;Array.isArray(e)||(e=[e]);var i=e.map(function(e){var n=e.replace(/\.json$/,"").replace(/^\//,""),i=t.config.filesLocation.replace(/\/$/,"");return"".concat(i,"/").concat(n,".json")});return"browser"==this._env?Promise.all(i.map(function(e){return fetch(e)})).then(function(e){return Promise.all(e.map(function(e){if(e.ok)return e.json();t.debug("FETCH_ERROR",e)}))}).then(function(i){return i=i.filter(function(e){return e}),n&&i.forEach(function(n,i){t.add(e[i],n)}),i.length>1?i:i[0]}):"node"==this._env?new Promise(function(s){var r=[];i.forEach(function(i,s){try{var o=JSON.parse(require("fs").readFileSync(process.cwd()+i,"utf-8"));n&&t.add(e[s],o),r.push(o)}catch(a){t.debug("MODULE_NOT_FOUND",a.message)}}),s(r.length>1?r:r[0])}):void 0})},{key:"setDefaultLanguage",value:function(e){if("string"==typeof e){if(0!=e.length)return this.languages.has(e)?void(this.config.defaultLanguage=e):(this.debug("NO_LANGUAGE_REGISTERED",e),null);this.debug("EMPTY_PARAM_LANGUAGE")}else this.debug("INVALID_PARAM_LANGUAGE",e)}},{key:"currentLanguage",get:function(){return this._currentLanguage||this.config.defaultLanguage}},{key:"defaultLanguage",get:function(){return this.config.defaultLanguage}}],i=[{key:"defaultConfig",get:function(){return{defaultLanguage:"en",detectLanguage:!0,selector:"[data-i18n]",debug:!1,registerGlobally:"__",persist:!1,persistKey:"preferred_language",filesLocation:"/i18n"}}}],n&&a(t.prototype,n),i&&a(t,i),e}(),h="top",f="bottom",p="right",g="left",m="auto",_=[h,f,p,g],v="start",b="end",y="clippingParents",w="viewport",A="popper",E="reference",S=_.reduce(function(e,t){return e.concat([t+"-"+v,t+"-"+b])},[]),T=[].concat(_,[m]).reduce(function(e,t){return e.concat([t,t+"-"+v,t+"-"+b])},[]),L="beforeRead",x="read",O="afterRead",C="beforeMain",k="main",I="afterMain",N="beforeWrite",M="write",D="afterWrite",P=[L,x,O,C,k,I,N,M,D];function $(e){return e?(e.nodeName||"").toLowerCase():null}function j(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function B(e){return e instanceof j(e).Element||e instanceof Element}function R(e){return e instanceof j(e).HTMLElement||e instanceof HTMLElement}function q(e){return"undefined"!=typeof ShadowRoot&&(e instanceof j(e).ShadowRoot||e instanceof ShadowRoot)}const H={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},s=t.elements[e];R(s)&&$(s)&&(Object.assign(s.style,n),Object.keys(i).forEach(function(e){var t=i[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var i=t.elements[e],s=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});R(i)&&$(i)&&(Object.assign(i.style,r),Object.keys(s).forEach(function(e){i.removeAttribute(e)}))})}},requires:["computeStyles"]};function F(e){return e.split("-")[0]}var z=Math.max,W=Math.min,V=Math.round;function K(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function G(){return!/^((?!chrome|android).)*safari/i.test(K())}function U(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),s=1,r=1;t&&R(e)&&(s=e.offsetWidth>0&&V(i.width)/e.offsetWidth||1,r=e.offsetHeight>0&&V(i.height)/e.offsetHeight||1);var o=(B(e)?j(e):window).visualViewport,a=!G()&&n,l=(i.left+(a&&o?o.offsetLeft:0))/s,c=(i.top+(a&&o?o.offsetTop:0))/r,u=i.width/s,d=i.height/r;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function Y(e){var t=U(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function X(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&q(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Z(e){return j(e).getComputedStyle(e)}function Q(e){return["table","td","th"].indexOf($(e))>=0}function J(e){return((B(e)?e.ownerDocument:e.document)||window.document).documentElement}function ee(e){return"html"===$(e)?e:e.assignedSlot||e.parentNode||(q(e)?e.host:null)||J(e)}function te(e){return R(e)&&"fixed"!==Z(e).position?e.offsetParent:null}function ne(e){for(var t=j(e),n=te(e);n&&Q(n)&&"static"===Z(n).position;)n=te(n);return n&&("html"===$(n)||"body"===$(n)&&"static"===Z(n).position)?t:n||function(e){var t=/firefox/i.test(K());if(/Trident/i.test(K())&&R(e)&&"fixed"===Z(e).position)return null;var n=ee(e);for(q(n)&&(n=n.host);R(n)&&["html","body"].indexOf($(n))<0;){var i=Z(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function ie(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function se(e,t,n){return z(e,W(t,n))}function re(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function oe(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}const ae={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=F(n.placement),l=ie(a),c=[g,p].indexOf(a)>=0?"height":"width";if(r&&o){var u=function(e,t){return re("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:oe(e,_))}(s.padding,n),d=Y(r),m="y"===l?h:g,v="y"===l?f:p,b=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],y=o[l]-n.rects.reference[l],w=ne(r),A=w?"y"===l?w.clientHeight||0:w.clientWidth||0:0,E=b/2-y/2,S=u[m],T=A-d[c]-u[v],L=A/2-d[c]/2+E,x=se(S,L,T),O=l;n.modifiersData[i]=((t={})[O]=x,t.centerOffset=x-L,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&X(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function le(e){return e.split("-")[1]}var ce={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ue(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,m=o.x,_=void 0===m?0:m,v=o.y,y=void 0===v?0:v,w="function"==typeof u?u({x:_,y:y}):{x:_,y:y};_=w.x,y=w.y;var A=o.hasOwnProperty("x"),E=o.hasOwnProperty("y"),S=g,T=h,L=window;if(c){var x=ne(n),O="clientHeight",C="clientWidth";x===j(n)&&"static"!==Z(x=J(n)).position&&"absolute"===a&&(O="scrollHeight",C="scrollWidth"),(s===h||(s===g||s===p)&&r===b)&&(T=f,y-=(d&&x===L&&L.visualViewport?L.visualViewport.height:x[O])-i.height,y*=l?1:-1),s!==g&&(s!==h&&s!==f||r!==b)||(S=p,_-=(d&&x===L&&L.visualViewport?L.visualViewport.width:x[C])-i.width,_*=l?1:-1)}var k,I=Object.assign({position:a},c&&ce),N=!0===u?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:V(t*i)/i||0,y:V(n*i)/i||0}}({x:_,y:y}):{x:_,y:y};return _=N.x,y=N.y,l?Object.assign({},I,((k={})[T]=E?"0":"",k[S]=A?"0":"",k.transform=(L.devicePixelRatio||1)<=1?"translate("+_+"px, "+y+"px)":"translate3d("+_+"px, "+y+"px, 0)",k)):Object.assign({},I,((t={})[T]=E?y+"px":"",t[S]=A?_+"px":"",t.transform="",t))}const de={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=void 0===i||i,r=n.adaptive,o=void 0===r||r,a=n.roundOffsets,l=void 0===a||a,c={placement:F(t.placement),variation:le(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ue(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ue(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var he={passive:!0};const fe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=void 0===s||s,o=i.resize,a=void 0===o||o,l=j(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(e){e.addEventListener("scroll",n.update,he)}),a&&l.addEventListener("resize",n.update,he),function(){r&&c.forEach(function(e){e.removeEventListener("scroll",n.update,he)}),a&&l.removeEventListener("resize",n.update,he)}},data:{}};var pe={left:"right",right:"left",bottom:"top",top:"bottom"};function ge(e){return e.replace(/left|right|bottom|top/g,function(e){return pe[e]})}var me={start:"end",end:"start"};function _e(e){return e.replace(/start|end/g,function(e){return me[e]})}function ve(e){var t=j(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function be(e){return U(J(e)).left+ve(e).scrollLeft}function ye(e){var t=Z(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function we(e){return["html","body","#document"].indexOf($(e))>=0?e.ownerDocument.body:R(e)&&ye(e)?e:we(ee(e))}function Ae(e,t){var n;void 0===t&&(t=[]);var i=we(e),s=i===(null==(n=e.ownerDocument)?void 0:n.body),r=j(i),o=s?[r].concat(r.visualViewport||[],ye(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(Ae(ee(o)))}function Ee(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Se(e,t,n){return t===w?Ee(function(e,t){var n=j(e),i=J(e),s=n.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=G();(c||!c&&"fixed"===t)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+be(e),y:l}}(e,n)):B(t)?function(e,t){var n=U(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Ee(function(e){var t,n=J(e),i=ve(e),s=null==(t=e.ownerDocument)?void 0:t.body,r=z(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=z(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+be(e),l=-i.scrollTop;return"rtl"===Z(s||n).direction&&(a+=z(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}(J(e)))}function Te(e,t,n,i){var s="clippingParents"===t?function(e){var t=Ae(ee(e)),n=["absolute","fixed"].indexOf(Z(e).position)>=0&&R(e)?ne(e):e;return B(n)?t.filter(function(e){return B(e)&&X(e,n)&&"body"!==$(e)}):[]}(e):[].concat(t),r=[].concat(s,[n]),o=r[0],a=r.reduce(function(t,n){var s=Se(e,n,i);return t.top=z(s.top,t.top),t.right=W(s.right,t.right),t.bottom=W(s.bottom,t.bottom),t.left=z(s.left,t.left),t},Se(e,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Le(e){var t,n=e.reference,i=e.element,s=e.placement,r=s?F(s):null,o=s?le(s):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(r){case h:t={x:a,y:n.y-i.height};break;case f:t={x:a,y:n.y+n.height};break;case p:t={x:n.x+n.width,y:l};break;case g:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var c=r?ie(r):null;if(null!=c){var u="y"===c?"height":"width";switch(o){case v:t[c]=t[c]-(n[u]/2-i[u]/2);break;case b:t[c]=t[c]+(n[u]/2-i[u]/2)}}return t}function xe(e,t){void 0===t&&(t={});var n=t,i=n.placement,s=void 0===i?e.placement:i,r=n.strategy,o=void 0===r?e.strategy:r,a=n.boundary,l=void 0===a?y:a,c=n.rootBoundary,u=void 0===c?w:c,d=n.elementContext,g=void 0===d?A:d,m=n.altBoundary,v=void 0!==m&&m,b=n.padding,S=void 0===b?0:b,T=re("number"!=typeof S?S:oe(S,_)),L=g===A?E:A,x=e.rects.popper,O=e.elements[v?L:g],C=Te(B(O)?O:O.contextElement||J(e.elements.popper),l,u,o),k=U(e.elements.reference),I=Le({reference:k,element:x,placement:s}),N=Ee(Object.assign({},x,I)),M=g===A?N:k,D={top:C.top-M.top+T.top,bottom:M.bottom-C.bottom+T.bottom,left:C.left-M.left+T.left,right:M.right-C.right+T.right},P=e.modifiersData.offset;if(g===A&&P){var $=P[s];Object.keys(D).forEach(function(e){var t=[p,f].indexOf(e)>=0?1:-1,n=[h,f].indexOf(e)>=0?"y":"x";D[e]+=$[n]*t})}return D}const Oe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=void 0===s||s,o=n.altAxis,a=void 0===o||o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,b=n.altBoundary,y=n.flipVariations,w=void 0===y||y,A=n.allowedAutoPlacements,E=t.options.placement,L=F(E),x=l||(L!==E&&w?function(e){if(F(e)===m)return[];var t=ge(e);return[_e(e),t,_e(t)]}(E):[ge(E)]),O=[E].concat(x).reduce(function(e,n){return e.concat(F(n)===m?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?T:l,u=le(i),d=u?a?S:S.filter(function(e){return le(e)===u}):_,h=d.filter(function(e){return c.indexOf(e)>=0});0===h.length&&(h=d);var f=h.reduce(function(t,n){return t[n]=xe(e,{placement:n,boundary:s,rootBoundary:r,padding:o})[F(n)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:w,allowedAutoPlacements:A}):n)},[]),C=t.rects.reference,k=t.rects.popper,I=new Map,N=!0,M=O[0],D=0;D<O.length;D++){var P=O[D],$=F(P),j=le(P)===v,B=[h,f].indexOf($)>=0,R=B?"width":"height",q=xe(t,{placement:P,boundary:u,rootBoundary:d,altBoundary:b,padding:c}),H=B?j?p:g:j?f:h;C[R]>k[R]&&(H=ge(H));var z=ge(H),W=[];if(r&&W.push(q[$]<=0),a&&W.push(q[H]<=0,q[z]<=0),W.every(function(e){return e})){M=P,N=!1;break}I.set(P,W)}if(N)for(var V=function(e){var t=O.find(function(t){var n=I.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return M=t,"break"},K=w?3:1;K>0&&"break"!==V(K);K--);t.placement!==M&&(t.modifiersData[i]._skip=!0,t.placement=M,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ce(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ke(e){return[h,p,f,g].some(function(t){return e[t]>=0})}const Ie={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=xe(t,{elementContext:"reference"}),a=xe(t,{altBoundary:!0}),l=Ce(o,i),c=Ce(a,s,r),u=ke(l),d=ke(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}},Ne={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=void 0===s?[0,0]:s,o=T.reduce(function(e,n){return e[n]=function(e,t,n){var i=F(e),s=[g,h].indexOf(i)>=0?-1:1,r="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[g,p].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}(n,t.rects,r),e},{}),a=o[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}},Me={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Le({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}},De={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=void 0===s||s,o=n.altAxis,a=void 0!==o&&o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,m=n.tether,_=void 0===m||m,b=n.tetherOffset,y=void 0===b?0:b,w=xe(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),A=F(t.placement),E=le(t.placement),S=!E,T=ie(A),L="x"===T?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,C=t.rects.popper,k="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,I="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(x){if(r){var D,P="y"===T?h:g,$="y"===T?f:p,j="y"===T?"height":"width",B=x[T],R=B+w[P],q=B-w[$],H=_?-C[j]/2:0,V=E===v?O[j]:C[j],K=E===v?-C[j]:-O[j],G=t.elements.arrow,U=_&&G?Y(G):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=X[P],Q=X[$],J=se(0,O[j],U[j]),ee=S?O[j]/2-H-J-Z-I.mainAxis:V-J-Z-I.mainAxis,te=S?-O[j]/2+H+J+Q+I.mainAxis:K+J+Q+I.mainAxis,re=t.elements.arrow&&ne(t.elements.arrow),oe=re?"y"===T?re.clientTop||0:re.clientLeft||0:0,ae=null!=(D=null==N?void 0:N[T])?D:0,ce=B+te-ae,ue=se(_?W(R,B+ee-ae-oe):R,B,_?z(q,ce):q);x[T]=ue,M[T]=ue-B}if(a){var de,he="x"===T?h:g,fe="x"===T?f:p,pe=x[L],ge="y"===L?"height":"width",me=pe+w[he],_e=pe-w[fe],ve=-1!==[h,g].indexOf(A),be=null!=(de=null==N?void 0:N[L])?de:0,ye=ve?me:pe-O[ge]-C[ge]-be+I.altAxis,we=ve?pe+O[ge]+C[ge]-be-I.altAxis:_e,Ae=_&&ve?(Se=se(ye,pe,Ee=we))>Ee?Ee:Se:se(_?ye:me,pe,_?we:_e);x[L]=Ae,M[L]=Ae-pe}var Ee,Se;t.modifiersData[i]=M}},requiresIfExists:["offset"]};function Pe(e,t,n){void 0===n&&(n=!1);var i,s,r=R(t),o=R(t)&&function(e){var t=e.getBoundingClientRect(),n=V(t.width)/e.offsetWidth||1,i=V(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),a=J(t),l=U(e,o,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==$(t)||ye(a))&&(c=(i=t)!==j(i)&&R(i)?{scrollLeft:(s=i).scrollLeft,scrollTop:s.scrollTop}:ve(i)),R(t)?((u=U(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=be(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function $e(e){var t=new Map,n=new Set,i=[];function s(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var i=t.get(e);i&&s(i)}}),i.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||s(e)}),i}var je={placement:"bottom",modifiers:[],strategy:"absolute"};function Be(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function Re(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,s=t.defaultOptions,r=void 0===s?je:s;return function(e,t,n){void 0===n&&(n=r);var s,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},je,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:a,setOptions:function(n){var s="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},r,a.options,s),a.scrollParents={reference:B(e)?Ae(e):e.contextElement?Ae(e.contextElement):[],popper:Ae(t)};var o,c,h=function(e){var t=$e(e);return P.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}((o=[].concat(i,a.options.modifiers),c=o.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return a.orderedModifiers=h.filter(function(e){return e.enabled}),a.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,s=e.effect;if("function"==typeof s){var r=s({state:a,name:t,instance:u,options:i}),o=function(){};l.push(r||o)}}),u.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(Be(t,n)){a.rects={reference:Pe(t,ne(n),"fixed"===a.options.strategy),popper:Y(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(e){return a.modifiersData[e.name]=Object.assign({},e.data)});for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var s=a.orderedModifiers[i],r=s.fn,o=s.options,l=void 0===o?{}:o,d=s.name;"function"==typeof r&&(a=r({state:a,options:l,name:d,instance:u})||a)}else a.reset=!1,i=-1}}},update:(s=function(){return new Promise(function(e){u.forceUpdate(),e(a)})},function(){return o||(o=new Promise(function(e){Promise.resolve().then(function(){o=void 0,e(s())})})),o}),destroy:function(){d(),c=!0}};if(!Be(e,t))return u;function d(){l.forEach(function(e){return e()}),l=[]}return u.setOptions(n).then(function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)}),u}}var qe=Re({defaultModifiers:[fe,Me,de,H,Ne,Oe,De,ae,Ie]});const He=Object.freeze(Object.defineProperty({__proto__:null,afterMain:I,afterRead:O,afterWrite:D,applyStyles:H,arrow:ae,auto:m,basePlacements:_,beforeMain:C,beforeRead:L,beforeWrite:N,bottom:f,clippingParents:y,computeStyles:de,createPopper:qe,detectOverflow:xe,end:b,eventListeners:fe,flip:Oe,hide:Ie,left:g,main:k,modifierPhases:P,offset:Ne,placements:T,popper:A,popperGenerator:Re,popperOffsets:Me,preventOverflow:De,read:x,reference:E,right:p,start:v,top:h,variationPlacements:S,viewport:w,write:M},Symbol.toStringTag,{value:"Module"})),Fe="transitionend",ze=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),We=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return t},Ve=e=>{const t=We(e);return t&&document.querySelector(t)?t:null},Ke=e=>{const t=We(e);return t?document.querySelector(t):null},Ge=e=>{e.dispatchEvent(new Event(Fe))},Ue=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),Ye=e=>Ue(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(e):null,Xe=e=>{if(!Ue(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},Ze=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),Qe=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?Qe(e.parentNode):null},Je=()=>{},et=e=>{e.offsetHeight},tt=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,nt=[],it=()=>"rtl"===document.documentElement.dir,st=e=>{var t;t=()=>{const t=tt();if(t){const n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=i,e.jQueryInterface)}},"loading"===document.readyState?(nt.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of nt)e()}),nt.push(t)):t()},rt=e=>{"function"==typeof e&&e()},ot=(e,t,n=!0)=>{if(!n)return void rt(e);const i=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const i=Number.parseFloat(t),s=Number.parseFloat(n);return i||s?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let s=!1;const r=({target:n})=>{n===t&&(s=!0,t.removeEventListener(Fe,r),rt(e))};t.addEventListener(Fe,r),setTimeout(()=>{s||Ge(t)},i)},at=(e,t,n,i)=>{const s=e.length;let r=e.indexOf(t);return-1===r?!n&&i?e[s-1]:e[0]:(r+=n?1:-1,i&&(r=(r+s)%s),e[Math.max(0,Math.min(r,s-1))])},lt=/[^.]*(?=\..*)\.|.*/,ct=/\..*/,ut=/::\d+$/,dt={};let ht=1;const ft={mouseenter:"mouseover",mouseleave:"mouseout"},pt=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function gt(e,t){return t&&`${t}::${ht++}`||e.uidEvent||ht++}function mt(e){const t=gt(e);return e.uidEvent=t,dt[t]=dt[t]||{},dt[t]}function _t(e,t,n=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===n)}function vt(e,t,n){const i="string"==typeof t,s=i?n:t||n;let r=At(e);return pt.has(r)||(r=e),[i,s,r]}function bt(e,t,n,i,s){if("string"!=typeof t||!e)return;let[r,o,a]=vt(t,n,i);var l;t in ft&&(l=o,o=function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return l.call(this,e)});const c=mt(e),u=c[a]||(c[a]={}),d=_t(u,o,r?n:null);if(d)return void(d.oneOff=d.oneOff&&s);const h=gt(o,t.replace(lt,"")),f=r?function(e,t,n){return function i(s){const r=e.querySelectorAll(t);for(let{target:o}=s;o&&o!==this;o=o.parentNode)for(const a of r)if(a===o)return St(s,{delegateTarget:o}),i.oneOff&&Et.off(e,s.type,t,n),n.apply(o,[s])}}(e,n,o):function(e,t){return function n(i){return St(i,{delegateTarget:e}),n.oneOff&&Et.off(e,i.type,t),t.apply(e,[i])}}(e,o);f.delegationSelector=r?n:null,f.callable=o,f.oneOff=s,f.uidEvent=h,u[h]=f,e.addEventListener(a,f,r)}function yt(e,t,n,i,s){const r=_t(t[n],i,s);r&&(e.removeEventListener(n,r,Boolean(s)),delete t[n][r.uidEvent])}function wt(e,t,n,i){const s=t[n]||{};for(const r of Object.keys(s))if(r.includes(i)){const i=s[r];yt(e,t,n,i.callable,i.delegationSelector)}}function At(e){return e=e.replace(ct,""),ft[e]||e}const Et={on(e,t,n,i){bt(e,t,n,i,!1)},one(e,t,n,i){bt(e,t,n,i,!0)},off(e,t,n,i){if("string"!=typeof t||!e)return;const[s,r,o]=vt(t,n,i),a=o!==t,l=mt(e),c=l[o]||{},u=t.startsWith(".");if(void 0===r){if(u)for(const n of Object.keys(l))wt(e,l,n,t.slice(1));for(const n of Object.keys(c)){const i=n.replace(ut,"");if(!a||t.includes(i)){const t=c[n];yt(e,l,o,t.callable,t.delegationSelector)}}}else{if(!Object.keys(c).length)return;yt(e,l,o,r,s?n:null)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const i=tt();let s=null,r=!0,o=!0,a=!1;t!==At(t)&&i&&(s=i.Event(t,n),i(e).trigger(s),r=!s.isPropagationStopped(),o=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());let l=new Event(t,{bubbles:r,cancelable:!0});return l=St(l,n),a&&l.preventDefault(),o&&e.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function St(e,t){for(const[i,s]of Object.entries(t||{}))try{e[i]=s}catch(n){Object.defineProperty(e,i,{configurable:!0,get:()=>s})}return e}const Tt=new Map,Lt={set(e,t,n){Tt.has(e)||Tt.set(e,new Map);const i=Tt.get(e);i.has(t)||0===i.size?i.set(t,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`)},get:(e,t)=>Tt.has(e)&&Tt.get(e).get(t)||null,remove(e,t){if(!Tt.has(e))return;const n=Tt.get(e);n.delete(t),0===n.size&&Tt.delete(e)}};function xt(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function Ot(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const Ct={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${Ot(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${Ot(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=xt(e.dataset[i])}return t},getDataAttribute:(e,t)=>xt(e.getAttribute(`data-bs-${Ot(t)}`))};class kt{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=Ue(t)?Ct.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...Ue(t)?Ct.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const n of Object.keys(t)){const i=t[n],s=e[n],r=Ue(s)?"element":ze(s);if(!new RegExp(i).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${r}" but expected type "${i}".`)}}}class It extends kt{constructor(e,t){super(),(e=Ye(e))&&(this._element=e,this._config=this._getConfig(t),Lt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Lt.remove(this._element,this.constructor.DATA_KEY),Et.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){ot(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Lt.get(Ye(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.2.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const Nt=(e,t="hide")=>{const n=`click.dismiss${e.EVENT_KEY}`,i=e.NAME;Et.on(document,n,`[data-bs-dismiss="${i}"]`,function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Ze(this))return;const s=Ke(this)||this.closest(`.${i}`);e.getOrCreateInstance(s)[t]()})},Mt=".bs.alert",Dt=`close${Mt}`,Pt=`closed${Mt}`;class $t extends It{static get NAME(){return"alert"}close(){if(Et.trigger(this._element,Dt).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),Et.trigger(this._element,Pt),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=$t.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Nt($t,"close"),st($t);const jt='[data-bs-toggle="button"]';class Bt extends It{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=Bt.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}Et.on(document,"click.bs.button.data-api",jt,e=>{e.preventDefault();const t=e.target.closest(jt);Bt.getOrCreateInstance(t).toggle()}),st(Bt);const Rt={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const n=[];let i=e.parentNode.closest(t);for(;i;)n.push(i),i=i.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>`${e}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(e=>!Ze(e)&&Xe(e))}},qt=".bs.swipe",Ht=`touchstart${qt}`,Ft=`touchmove${qt}`,zt=`touchend${qt}`,Wt=`pointerdown${qt}`,Vt=`pointerup${qt}`,Kt={endCallback:null,leftCallback:null,rightCallback:null},Gt={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Ut extends kt{constructor(e,t){super(),this._element=e,e&&Ut.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Kt}static get DefaultType(){return Gt}static get NAME(){return"swipe"}dispose(){Et.off(this._element,qt)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),rt(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&rt(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Et.on(this._element,Wt,e=>this._start(e)),Et.on(this._element,Vt,e=>this._end(e)),this._element.classList.add("pointer-event")):(Et.on(this._element,Ht,e=>this._start(e)),Et.on(this._element,Ft,e=>this._move(e)),Et.on(this._element,zt,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Yt=".bs.carousel",Xt=".data-api",Zt="ArrowLeft",Qt="ArrowRight",Jt="next",en="prev",tn="left",nn="right",sn=`slide${Yt}`,rn=`slid${Yt}`,on=`keydown${Yt}`,an=`mouseenter${Yt}`,ln=`mouseleave${Yt}`,cn=`dragstart${Yt}`,un=`load${Yt}${Xt}`,dn=`click${Yt}${Xt}`,hn="carousel",fn="active",pn=".active",gn=".carousel-item",mn=pn+gn,_n={[Zt]:nn,[Qt]:tn},vn={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},bn={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class yn extends It{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Rt.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===hn&&this.cycle()}static get Default(){return vn}static get DefaultType(){return bn}static get NAME(){return"carousel"}next(){this._slide(Jt)}nextWhenVisible(){!document.hidden&&Xe(this._element)&&this.next()}prev(){this._slide(en)}pause(){this._isSliding&&Ge(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?Et.one(this._element,rn,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void Et.one(this._element,rn,()=>this.to(e));const n=this._getItemIndex(this._getActive());if(n===e)return;const i=e>n?Jt:en;this._slide(i,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&Et.on(this._element,on,e=>this._keydown(e)),"hover"===this._config.pause&&(Et.on(this._element,an,()=>this.pause()),Et.on(this._element,ln,()=>this._maybeEnableCycle())),this._config.touch&&Ut.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of Rt.find(".carousel-item img",this._element))Et.on(t,cn,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(tn)),rightCallback:()=>this._slide(this._directionToOrder(nn)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new Ut(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=_n[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=Rt.findOne(pn,this._indicatorsElement);t.classList.remove(fn),t.removeAttribute("aria-current");const n=Rt.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add(fn),n.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const n=this._getActive(),i=e===Jt,s=t||at(this._getItems(),n,i,this._config.wrap);if(s===n)return;const r=this._getItemIndex(s),o=t=>Et.trigger(this._element,t,{relatedTarget:s,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:r});if(o(sn).defaultPrevented)return;if(!n||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(r),this._activeElement=s;const l=i?"carousel-item-start":"carousel-item-end",c=i?"carousel-item-next":"carousel-item-prev";s.classList.add(c),et(s),n.classList.add(l),s.classList.add(l),this._queueCallback(()=>{s.classList.remove(l,c),s.classList.add(fn),n.classList.remove(fn,c,l),this._isSliding=!1,o(rn)},n,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return Rt.findOne(mn,this._element)}_getItems(){return Rt.find(gn,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return it()?e===tn?en:Jt:e===tn?Jt:en}_orderToDirection(e){return it()?e===en?tn:nn:e===en?nn:tn}static jQueryInterface(e){return this.each(function(){const t=yn.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)})}}Et.on(document,dn,"[data-bs-slide], [data-bs-slide-to]",function(e){const t=Ke(this);if(!t||!t.classList.contains(hn))return;e.preventDefault();const n=yn.getOrCreateInstance(t),i=this.getAttribute("data-bs-slide-to");return i?(n.to(i),void n._maybeEnableCycle()):"next"===Ct.getDataAttribute(this,"slide")?(n.next(),void n._maybeEnableCycle()):(n.prev(),void n._maybeEnableCycle())}),Et.on(window,un,()=>{const e=Rt.find('[data-bs-ride="carousel"]');for(const t of e)yn.getOrCreateInstance(t)}),st(yn);const wn=".bs.collapse",An=`show${wn}`,En=`shown${wn}`,Sn=`hide${wn}`,Tn=`hidden${wn}`,Ln=`click${wn}.data-api`,xn="show",On="collapse",Cn="collapsing",kn=`:scope .${On} .${On}`,In='[data-bs-toggle="collapse"]',Nn={parent:null,toggle:!0},Mn={parent:"(null|element)",toggle:"boolean"};class Dn extends It{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=Rt.find(In);for(const i of n){const e=Ve(i),t=Rt.find(e).filter(e=>e===this._element);null!==e&&t.length&&this._triggerArray.push(i)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Nn}static get DefaultType(){return Mn}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(e=>e!==this._element).map(e=>Dn.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(Et.trigger(this._element,An).defaultPrevented)return;for(const i of e)i.hide();const t=this._getDimension();this._element.classList.remove(On),this._element.classList.add(Cn),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Cn),this._element.classList.add(On,xn),this._element.style[t]="",Et.trigger(this._element,En)},this._element,!0),this._element.style[t]=`${this._element[n]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(Et.trigger(this._element,Sn).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,et(this._element),this._element.classList.add(Cn),this._element.classList.remove(On,xn);for(const t of this._triggerArray){const e=Ke(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Cn),this._element.classList.add(On),Et.trigger(this._element,Tn)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(xn)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=Ye(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(In);for(const t of e){const e=Ke(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=Rt.find(kn,this._config.parent);return Rt.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const n of e)n.classList.toggle("collapsed",!t),n.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const n=Dn.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e]()}})}}Et.on(document,Ln,In,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();const t=Ve(this),n=Rt.find(t);for(const i of n)Dn.getOrCreateInstance(i,{toggle:!1}).toggle()}),st(Dn);const Pn="dropdown",$n=".bs.dropdown",jn=".data-api",Bn="ArrowUp",Rn="ArrowDown",qn=`hide${$n}`,Hn=`hidden${$n}`,Fn=`show${$n}`,zn=`shown${$n}`,Wn=`click${$n}${jn}`,Vn=`keydown${$n}${jn}`,Kn=`keyup${$n}${jn}`,Gn="show",Un='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Yn=`${Un}.${Gn}`,Xn=".dropdown-menu",Zn=it()?"top-end":"top-start",Qn=it()?"top-start":"top-end",Jn=it()?"bottom-end":"bottom-start",ei=it()?"bottom-start":"bottom-end",ti=it()?"left-start":"right-start",ni=it()?"right-start":"left-start",ii={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},si={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class ri extends It{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=Rt.next(this._element,Xn)[0]||Rt.prev(this._element,Xn)[0]||Rt.findOne(Xn,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return ii}static get DefaultType(){return si}static get NAME(){return Pn}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Ze(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!Et.trigger(this._element,Fn,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))Et.on(e,"mouseover",Je);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Gn),this._element.classList.add(Gn),Et.trigger(this._element,zn,e)}}hide(){if(Ze(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!Et.trigger(this._element,qn,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Et.off(e,"mouseover",Je);this._popper&&this._popper.destroy(),this._menu.classList.remove(Gn),this._element.classList.remove(Gn),this._element.setAttribute("aria-expanded","false"),Ct.removeDataAttribute(this._menu,"popper"),Et.trigger(this._element,Hn,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!Ue(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${Pn.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===He)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:Ue(this._config.reference)?e=Ye(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=qe(e,this._menu,t)}_isShown(){return this._menu.classList.contains(Gn)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return ti;if(e.classList.contains("dropstart"))return ni;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?Qn:Zn:t?ei:Jn}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(Ct.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,..."function"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_selectMenuItem({key:e,target:t}){const n=Rt.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>Xe(e));n.length&&at(n,t,e===Rn,!n.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=ri.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=Rt.find(Yn);for(const n of t){const t=ri.getInstance(n);if(!t||!1===t._config.autoClose)continue;const i=e.composedPath(),s=i.includes(t._menu);if(i.includes(t._element)||"inside"===t._config.autoClose&&!s||"outside"===t._config.autoClose&&s)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const r={relatedTarget:t._element};"click"===e.type&&(r.clickEvent=e),t._completeHide(r)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n="Escape"===e.key,i=[Bn,Rn].includes(e.key);if(!i&&!n)return;if(t&&!n)return;e.preventDefault();const s=this.matches(Un)?this:Rt.prev(this,Un)[0]||Rt.next(this,Un)[0]||Rt.findOne(Un,e.delegateTarget.parentNode),r=ri.getOrCreateInstance(s);if(i)return e.stopPropagation(),r.show(),void r._selectMenuItem(e);r._isShown()&&(e.stopPropagation(),r.hide(),s.focus())}}Et.on(document,Vn,Un,ri.dataApiKeydownHandler),Et.on(document,Vn,Xn,ri.dataApiKeydownHandler),Et.on(document,Wn,ri.clearMenus),Et.on(document,Kn,ri.clearMenus),Et.on(document,Wn,Un,function(e){e.preventDefault(),ri.getOrCreateInstance(this).toggle()}),st(ri);const oi=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",ai=".sticky-top",li="padding-right",ci="margin-right";class ui{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,li,t=>t+e),this._setElementAttributes(oi,li,t=>t+e),this._setElementAttributes(ai,ci,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,li),this._resetElementAttributes(oi,li),this._resetElementAttributes(ai,ci)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const i=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+i)return;this._saveInitialAttribute(e,t);const s=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${n(Number.parseFloat(s))}px`)})}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&Ct.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const n=Ct.getDataAttribute(e,t);null!==n?(Ct.removeDataAttribute(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(Ue(e))t(e);else for(const n of Rt.find(e,this._element))t(n)}}const di="backdrop",hi="show",fi=`mousedown.bs.${di}`,pi={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},gi={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class mi extends kt{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return pi}static get DefaultType(){return gi}static get NAME(){return di}show(e){if(!this._config.isVisible)return void rt(e);this._append();const t=this._getElement();this._config.isAnimated&&et(t),t.classList.add(hi),this._emulateAnimation(()=>{rt(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(hi),this._emulateAnimation(()=>{this.dispose(),rt(e)})):rt(e)}dispose(){this._isAppended&&(Et.off(this._element,fi),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=Ye(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),Et.on(e,fi,()=>{rt(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){ot(e,this._getElement(),this._config.isAnimated)}}const _i=".bs.focustrap",vi=`focusin${_i}`,bi=`keydown.tab${_i}`,yi="backward",wi={autofocus:!0,trapElement:null},Ai={autofocus:"boolean",trapElement:"element"};class Ei extends kt{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return wi}static get DefaultType(){return Ai}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),Et.off(document,_i),Et.on(document,vi,e=>this._handleFocusin(e)),Et.on(document,bi,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,Et.off(document,_i))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=Rt.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===yi?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?yi:"forward")}}const Si=".bs.modal",Ti=`hide${Si}`,Li=`hidePrevented${Si}`,xi=`hidden${Si}`,Oi=`show${Si}`,Ci=`shown${Si}`,ki=`resize${Si}`,Ii=`click.dismiss${Si}`,Ni=`mousedown.dismiss${Si}`,Mi=`keydown.dismiss${Si}`,Di=`click${Si}.data-api`,Pi="modal-open",$i="show",ji="modal-static",Bi={backdrop:!0,focus:!0,keyboard:!0},Ri={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class qi extends It{constructor(e,t){super(e,t),this._dialog=Rt.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new ui,this._addEventListeners()}static get Default(){return Bi}static get DefaultType(){return Ri}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||Et.trigger(this._element,Oi,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Pi),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){this._isShown&&!this._isTransitioning&&(Et.trigger(this._element,Ti).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove($i),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){for(const e of[window,this._dialog])Et.off(e,Si);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new mi({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Ei({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=Rt.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),et(this._element),this._element.classList.add($i),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Et.trigger(this._element,Ci,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){Et.on(this._element,Mi,e=>{if("Escape"===e.key)return this._config.keyboard?(e.preventDefault(),void this.hide()):void this._triggerBackdropTransition()}),Et.on(window,ki,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Et.on(this._element,Ni,e=>{Et.one(this._element,Ii,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Pi),this._resetAdjustments(),this._scrollBar.reset(),Et.trigger(this._element,xi)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(Et.trigger(this._element,Li).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(ji)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(ji),this._queueCallback(()=>{this._element.classList.remove(ji),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){const e=it()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!n&&e){const e=it()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const n=qi.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e](t)}})}}Et.on(document,Di,'[data-bs-toggle="modal"]',function(e){const t=Ke(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),Et.one(t,Oi,e=>{e.defaultPrevented||Et.one(t,xi,()=>{Xe(this)&&this.focus()})});const n=Rt.findOne(".modal.show");n&&qi.getInstance(n).hide(),qi.getOrCreateInstance(t).toggle(this)}),Nt(qi),st(qi);const Hi=".bs.offcanvas",Fi=".data-api",zi=`load${Hi}${Fi}`,Wi="show",Vi="showing",Ki="hiding",Gi=".offcanvas.show",Ui=`show${Hi}`,Yi=`shown${Hi}`,Xi=`hide${Hi}`,Zi=`hidePrevented${Hi}`,Qi=`hidden${Hi}`,Ji=`resize${Hi}`,es=`click${Hi}${Fi}`,ts=`keydown.dismiss${Hi}`,ns={backdrop:!0,keyboard:!0,scroll:!1},is={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class ss extends It{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return ns}static get DefaultType(){return is}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||Et.trigger(this._element,Ui,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new ui).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Vi),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Wi),this._element.classList.remove(Vi),Et.trigger(this._element,Yi,{relatedTarget:e})},this._element,!0))}hide(){this._isShown&&(Et.trigger(this._element,Xi).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Ki),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(Wi,Ki),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new ui).reset(),Et.trigger(this._element,Qi)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new mi({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():Et.trigger(this._element,Zi)}:null})}_initializeFocusTrap(){return new Ei({trapElement:this._element})}_addEventListeners(){Et.on(this._element,ts,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():Et.trigger(this._element,Zi))})}static jQueryInterface(e){return this.each(function(){const t=ss.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Et.on(document,es,'[data-bs-toggle="offcanvas"]',function(e){const t=Ke(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),Ze(this))return;Et.one(t,Qi,()=>{Xe(this)&&this.focus()});const n=Rt.findOne(Gi);n&&n!==t&&ss.getInstance(n).hide(),ss.getOrCreateInstance(t).toggle(this)}),Et.on(window,zi,()=>{for(const e of Rt.find(Gi))ss.getOrCreateInstance(e).show()}),Et.on(window,Ji,()=>{for(const e of Rt.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&ss.getOrCreateInstance(e).hide()}),Nt(ss),st(ss);const rs=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),os=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i,as=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i,ls=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!rs.has(n)||Boolean(os.test(e.nodeValue)||as.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))},cs={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},us={allowList:cs,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},ds={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},hs={entry:"(string|element|function|null)",selector:"(string|element)"};class fs extends kt{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return us}static get DefaultType(){return ds}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[i,s]of Object.entries(this._config.content))this._setContent(e,s,i);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},hs)}_setContent(e,t,n){const i=Rt.findOne(n,e);i&&((t=this._resolvePossibleFunction(t))?Ue(t)?this._putElementInTemplate(Ye(t),i):this._config.html?i.innerHTML=this._maybeSanitize(t):i.textContent=t:i.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const i=(new window.DOMParser).parseFromString(e,"text/html"),s=[].concat(...i.body.querySelectorAll("*"));for(const r of s){const e=r.nodeName.toLowerCase();if(!Object.keys(t).includes(e)){r.remove();continue}const n=[].concat(...r.attributes),i=[].concat(t["*"]||[],t[e]||[]);for(const t of n)ls(t,i)||r.removeAttribute(t.nodeName)}return i.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return"function"==typeof e?e(this):e}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const ps=new Set(["sanitize","allowList","sanitizeFn"]),gs="fade",ms="show",_s=".tooltip-inner",vs=".modal",bs="hide.bs.modal",ys="hover",ws="focus",As={AUTO:"auto",TOP:"top",RIGHT:it()?"left":"right",BOTTOM:"bottom",LEFT:it()?"right":"left"},Es={allowList:cs,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,0],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Ss={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Ts extends It{constructor(e,t){if(void 0===He)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Es}static get DefaultType(){return Ss}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),Et.off(this._element.closest(vs),bs,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=Et.trigger(this._element,this.constructor.eventName("show")),t=(Qe(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:i}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(n),Et.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(n),n.classList.add(ms),"ontouchstart"in document.documentElement)for(const s of[].concat(...document.body.children))Et.on(s,"mouseover",Je);this._queueCallback(()=>{Et.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!Et.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(ms),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Et.off(e,"mouseover",Je);this._activeTrigger.click=!1,this._activeTrigger[ws]=!1,this._activeTrigger[ys]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Et.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(gs,ms),t.classList.add(`bs-${this.constructor.NAME}-auto`);const n=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(gs),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new fs({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[_s]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(gs)}_isShown(){return this.tip&&this.tip.classList.contains(ms)}_createPopper(e){const t="function"==typeof this._config.placement?this._config.placement.call(this,e,this._element):this._config.placement,n=As[t.toUpperCase()];return qe(this._element,e,this._getPopperConfig(n))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return"function"==typeof e?e.call(this._element):e}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)Et.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{this._initializeOnDelegatedTarget(e).toggle()});else if("manual"!==t){const e=t===ys?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),n=t===ys?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");Et.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?ws:ys]=!0,t._enter()}),Et.on(this._element,n,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?ws:ys]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Et.on(this._element.closest(vs),bs,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=Ct.getDataAttributes(this._element);for(const n of Object.keys(t))ps.has(n)&&delete t[n];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:Ye(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const t in this._config)this.constructor.Default[t]!==this._config[t]&&(e[t]=this._config[t]);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=Ts.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}st(Ts);const Ls=".popover-header",xs=".popover-body",Os={...Ts.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Cs={...Ts.DefaultType,content:"(null|string|element|function)"};class ks extends Ts{static get Default(){return Os}static get DefaultType(){return Cs}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Ls]:this._getTitle(),[xs]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=ks.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}st(ks);const Is=".bs.scrollspy",Ns=`activate${Is}`,Ms=`click${Is}`,Ds=`load${Is}.data-api`,Ps="active",$s="[href]",js=".nav-link",Bs=`${js}, .nav-item > ${js}, .list-group-item`,Rs={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},qs={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Hs extends It{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Rs}static get DefaultType(){return qs}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=Ye(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Et.off(this._config.target,Ms),Et.on(this._config.target,Ms,$s,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const n=this._rootElement||window,i=t.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:i,behavior:"smooth"});n.scrollTop=i}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),n=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},i=(this._rootElement||document.documentElement).scrollTop,s=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const r of e){if(!r.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(r));continue}const e=r.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&e){if(n(r),!i)return}else s||e||n(r)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=Rt.find($s,this._config.target);for(const t of e){if(!t.hash||Ze(t))continue;const e=Rt.findOne(t.hash,this._element);Xe(e)&&(this._targetLinks.set(t.hash,t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Ps),this._activateParents(e),Et.trigger(this._element,Ns,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))Rt.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Ps);else for(const t of Rt.parents(e,".nav, .list-group"))for(const e of Rt.prev(t,Bs))e.classList.add(Ps)}_clearActiveClass(e){e.classList.remove(Ps);const t=Rt.find(`${$s}.${Ps}`,e);for(const n of t)n.classList.remove(Ps)}static jQueryInterface(e){return this.each(function(){const t=Hs.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}Et.on(window,Ds,()=>{for(const e of Rt.find('[data-bs-spy="scroll"]'))Hs.getOrCreateInstance(e)}),st(Hs);const Fs=".bs.tab",zs=`hide${Fs}`,Ws=`hidden${Fs}`,Vs=`show${Fs}`,Ks=`shown${Fs}`,Gs=`click${Fs}`,Us=`keydown${Fs}`,Ys=`load${Fs}`,Xs="ArrowLeft",Zs="ArrowRight",Qs="ArrowUp",Js="ArrowDown",er="active",tr="fade",nr="show",ir=":not(.dropdown-toggle)",sr='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',rr=`.nav-link${ir}, .list-group-item${ir}, [role="tab"]${ir}, ${sr}`,or=`.${er}[data-bs-toggle="tab"], .${er}[data-bs-toggle="pill"], .${er}[data-bs-toggle="list"]`;class ar extends It{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Et.on(this._element,Us,e=>this._keydown(e)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?Et.trigger(t,zs,{relatedTarget:e}):null;Et.trigger(e,Vs,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){e&&(e.classList.add(er),this._activate(Ke(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),Et.trigger(e,Ks,{relatedTarget:t})):e.classList.add(nr)},e,e.classList.contains(tr)))}_deactivate(e,t){e&&(e.classList.remove(er),e.blur(),this._deactivate(Ke(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),Et.trigger(e,Ws,{relatedTarget:t})):e.classList.remove(nr)},e,e.classList.contains(tr)))}_keydown(e){if(![Xs,Zs,Qs,Js].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=[Zs,Js].includes(e.key),n=at(this._getChildren().filter(e=>!Ze(e)),e.target,t,!0);n&&(n.focus({preventScroll:!0}),ar.getOrCreateInstance(n).show())}_getChildren(){return Rt.find(rr,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const n of t)this._setInitialAttributesOnChild(n)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=Ke(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`#${e.id}`))}_toggleDropDown(e,t){const n=this._getOuterElement(e);if(!n.classList.contains("dropdown"))return;const i=(e,i)=>{const s=Rt.findOne(e,n);s&&s.classList.toggle(i,t)};i(".dropdown-toggle",er),i(".dropdown-menu",nr),n.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(er)}_getInnerElement(e){return e.matches(rr)?e:Rt.findOne(rr,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=ar.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}Et.on(document,Gs,sr,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),Ze(this)||ar.getOrCreateInstance(this).show()}),Et.on(window,Ys,()=>{for(const e of Rt.find(or))ar.getOrCreateInstance(e)}),st(ar);const lr=".bs.toast",cr=`mouseover${lr}`,ur=`mouseout${lr}`,dr=`focusin${lr}`,hr=`focusout${lr}`,fr=`hide${lr}`,pr=`hidden${lr}`,gr=`show${lr}`,mr=`shown${lr}`,_r="hide",vr="show",br="showing",yr={animation:"boolean",autohide:"boolean",delay:"number"},wr={animation:!0,autohide:!0,delay:5e3};class Ar extends It{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return wr}static get DefaultType(){return yr}static get NAME(){return"toast"}show(){Et.trigger(this._element,gr).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(_r),et(this._element),this._element.classList.add(vr,br),this._queueCallback(()=>{this._element.classList.remove(br),Et.trigger(this._element,mr),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(Et.trigger(this._element,fr).defaultPrevented||(this._element.classList.add(br),this._queueCallback(()=>{this._element.classList.add(_r),this._element.classList.remove(br,vr),Et.trigger(this._element,pr)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(vr),super.dispose()}isShown(){return this._element.classList.contains(vr)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){Et.on(this._element,cr,e=>this._onInteraction(e,!0)),Et.on(this._element,ur,e=>this._onInteraction(e,!1)),Et.on(this._element,dr,e=>this._onInteraction(e,!0)),Et.on(this._element,hr,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Ar.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Nt(Ar),st(Ar);const Er=400;class Sr{constructor(e,t){this.areaBounds=null,this.map=e,this.preview=document.querySelector(".preview-container"),this.previewBg=document.querySelector(".preview"),this.previewPan=document.querySelector(".preview-pan"),this.pageControls=t,this.map.addEventListener("pan",()=>{this.update()})}init(e,t){this.areaBounds=e;const n=e.maxX-e.minX,i=e.maxY-e.minY;if(n<=0||i<=0)return void(this.preview.style.opacity="0");const s=n/i;let r,o;s>=1?(r=Er,o=Er/s):(o=Er,r=Er*s),this.preview.style.width=`${Math.round(r)}px`,this.preview.style.height=`${Math.round(o)}px`,t?(this.previewBg.style.backgroundImage=`url(${t})`,this.previewBg.style.backgroundSize="100% 100%",this.previewBg.style.opacity="0.6"):(this.previewBg.style.backgroundImage="",this.previewBg.style.opacity=""),this.update()}update(){if(!this.pageControls.pageSettings?.preview)return;this.preview.style.opacity="1",clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.preview.style.opacity="0"},4e3);const e=this.pageControls.renderer;if(!e||!this.areaBounds)return;const t=e.getViewportBounds(),n=this.areaBounds.maxX-this.areaBounds.minX,i=this.areaBounds.maxY-this.areaBounds.minY;if(n<=0||i<=0)return;const s=(t.minX-this.areaBounds.minX)/n*100,r=(t.minY-this.areaBounds.minY)/i*100,o=(t.maxX-t.minX)/n*100,a=(t.maxY-t.minY)/i*100,l=Math.max(0,Math.min(s,100)),c=Math.max(0,Math.min(r,100)),u=Math.min(100,s+o),d=Math.min(100,r+a);this.previewPan.style.left=`${l}%`,this.previewPan.style.top=`${c}%`,this.previewPan.style.width=`${Math.max(0,u-l)}%`,this.previewPan.style.height=`${Math.max(0,d-c)}%`}}function Tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lr,xr,Or={exports:{}},Cr=(Lr||(Lr=1,xr=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function t(t){for(var n=1;n<arguments.length;n++){var s=null!=arguments[n]?arguments[n]:{};n%2?e(Object(s),!0).forEach(function(e){i(t,e,s[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):e(Object(s)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))})}return t}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var a=function(e){return"string"==typeof e?document.querySelector(e):e()},l=function(e,t){var n="string"==typeof e?document.createElement(e):e;for(var i in t){var s=t[i];if("inside"===i)s.append(n);else if("dest"===i)a(s[0]).insertAdjacentElement(s[1],n);else if("around"===i){var r=s;r.parentNode.insertBefore(n,r),n.append(r),null!=r.getAttribute("autofocus")&&r.focus()}else i in n?n[i]=s:n.setAttribute(i,s)}return n},c=function(e,t){return e=String(e).toLowerCase(),t?e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):e},u=function(e,n){return l("mark",t({innerHTML:e},"string"==typeof n&&{class:n})).outerHTML},d=function(e,t){t.input.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t.feedback,cancelable:!0}))},h=function(e,t,n){var i=n||{},s=i.mode,r=i.diacritics,o=i.highlight,a=c(t,r);if(t=String(t),e=c(e,r),"loose"===s){var l=(e=e.replace(/ /g,"")).length,d=0,h=Array.from(t).map(function(t,n){return d<l&&a[n]===e[d]&&(t=o?u(t,o):t,d++),t}).join("");if(d===l)return h}else{var f=a.indexOf(e);if(~f)return e=t.substring(f,f+e.length),o?t.replace(e,u(e,o)):t}},f=function(e,t){return new Promise(function(n,i){var s;return(s=e.data).cache&&s.store?n():new Promise(function(e,n){return"function"==typeof s.src?s.src(t).then(e,n):e(s.src)}).then(function(t){try{return e.feedback=s.store=t,d("response",e),n()}catch(r){return i(r)}},i)})},p="aria-expanded",g="aria-activedescendant",m="aria-selected",_=function(e,n){e.feedback.selection=t({index:n},e.feedback.results[n])},v=function(e){e.isOpen||((e.wrapper||e.input).setAttribute(p,!0),e.list.removeAttribute("hidden"),e.isOpen=!0,d("open",e))},b=function(e){e.isOpen&&((e.wrapper||e.input).setAttribute(p,!1),e.input.setAttribute(g,""),e.list.setAttribute("hidden",""),e.isOpen=!1,d("close",e))},y=function(e,t){var n=t.resultItem,i=t.list.getElementsByTagName(n.tag),r=!!n.selected&&n.selected.split(" ");if(t.isOpen&&i.length){var o,a,l=t.cursor;e>=i.length&&(e=0),e<0&&(e=i.length-1),t.cursor=e,l>-1&&(i[l].removeAttribute(m),r&&(a=i[l].classList).remove.apply(a,s(r))),i[e].setAttribute(m,!0),r&&(o=i[e].classList).add.apply(o,s(r)),t.input.setAttribute(g,i[t.cursor].id),t.list.scrollTop=i[e].offsetTop-t.list.clientHeight+i[e].clientHeight+5,t.feedback.cursor=t.cursor,_(t,e),d("navigate",t)}},w=function(e){y(e.cursor+1,e)},A=function(e){y(e.cursor-1,e)},E=function(e,t,n){(n=n>=0?n:e.cursor)<0||(e.feedback.event=t,_(e,n),d("selection",e),b(e))};function S(e,n){var i=this;return new Promise(function(s,o){var a,c,u,p,g;return a=n||((c=e.input)instanceof HTMLInputElement||c instanceof HTMLTextAreaElement?c.value:c.innerHTML),u=a=e.query?e.query(a):a,p=e.trigger,g=e.threshold,(p?p(u):u.length>=g)?f(e,a).then(function(n){try{return e.feedback instanceof Error?s():(function(e,t){var n=t.data,i=t.searchEngine,s=[];n.store.forEach(function(o,a){var l=function(n){var r=n?o[n]:o,a="function"==typeof i?i(e,r):h(e,r,{mode:i,diacritics:t.diacritics,highlight:t.resultItem.highlight});if(a){var l={match:a,value:o};n&&(l.key=n),s.push(l)}};if(n.keys){var c,d=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=r(e))){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw s}}}}(n.keys);try{for(d.s();!(c=d.n()).done;)l(c.value)}catch(u){d.e(u)}finally{d.f()}}else l()}),n.filter&&(s=n.filter(s));var o=s.slice(0,t.resultsList.maxResults);t.feedback={query:e,matches:s,results:o},d("results",t)}(a,e),e.resultsList&&function(e){var n=e.resultsList,i=e.list,s=e.resultItem,r=e.feedback,o=r.matches,a=r.results;if(e.cursor=-1,i.innerHTML="",o.length||n.noResults){var c=new DocumentFragment;a.forEach(function(e,n){var i=l(s.tag,t({id:"".concat(s.id,"_").concat(n),role:"option",innerHTML:e.match,inside:c},s.class&&{class:s.class}));s.element&&s.element(i,e)}),i.append(c),n.element&&n.element(i,r),v(e)}else b(e)}(e),m.call(i))}catch(u){return o(u)}},o):(b(e),m.call(i));function m(){return s()}})}var T=function(e,t){for(var n in e)for(var i in e[n])t(n,i)};function L(e){var n=this;return new Promise(function(i,s){var r,o,a;if(r=e.placeHolder,a={role:"combobox","aria-owns":(o=e.resultsList).id,"aria-haspopup":!0,"aria-expanded":!1},l(e.input,t(t({"aria-controls":o.id,"aria-autocomplete":"both"},r&&{placeholder:r}),!e.wrapper&&t({},a))),e.wrapper&&(e.wrapper=l("div",t({around:e.input,class:e.name+"_wrapper"},a))),o&&(e.list=l(o.tag,t({dest:[o.destination,o.position],id:o.id,role:"listbox",hidden:"hidden"},o.class&&{class:o.class}))),function(e){var n,i,s,r=e.events,o=(n=function(){return S(e)},i=e.debounce,function(){clearTimeout(s),s=setTimeout(function(){return n()},i)}),a=e.events=t({input:t({},r&&r.input)},e.resultsList&&{list:r?t({},r.list):{}}),l={input:{input:function(){o()},keydown:function(t){!function(e,t){switch(e.keyCode){case 40:case 38:e.preventDefault(),40===e.keyCode?w(t):A(t);break;case 13:t.submit||e.preventDefault(),t.cursor>=0&&E(t,e);break;case 9:t.resultsList.tabSelect&&t.cursor>=0&&E(t,e);break;case 27:t.input.value="",b(t)}}(t,e)},blur:function(){b(e)}},list:{mousedown:function(e){e.preventDefault()},click:function(t){var n,i,s,r,o;n=t,s=(i=e).resultItem.tag.toUpperCase(),r=Array.from(i.list.querySelectorAll(s)),(o=n.target.closest(s))&&o.nodeName===s&&E(i,n,r.indexOf(o))}}};T(l,function(t,n){(e.resultsList||"input"===n)&&(a[t][n]||(a[t][n]=l[t][n]))}),T(a,function(t,n){e[t].addEventListener(n,a[t][n])})}(e),e.data.cache)return f(e).then(function(e){try{return c.call(n)}catch(t){return s(t)}},s);function c(){return d("init",e),i()}return c.call(n)})}function x(e){var t=e.prototype;t.init=function(){L(this)},t.start=function(e){S(this,e)},t.unInit=function(){if(this.wrapper){var e=this.wrapper.parentNode;e.insertBefore(this.input,this.wrapper),e.removeChild(this.wrapper)}var t;T((t=this).events,function(e,n){t[e].removeEventListener(n,t.events[e][n])})},t.open=function(){v(this)},t.close=function(){b(this)},t.goTo=function(e){y(e,this)},t.next=function(){w(this)},t.previous=function(){A(this)},t.select=function(e){E(this,null,e)},t.search=function(e,t,n){return h(e,t,n)}}return function e(t){this.options=t,this.id=e.instances=(e.instances||0)+1,this.name="autoComplete",this.wrapper=1,this.threshold=1,this.debounce=0,this.resultsList={position:"afterend",tag:"ul",maxResults:5},this.resultItem={tag:"li"},function(e){var t=e.name,i=e.options,s=e.resultsList,r=e.resultItem;for(var o in i)if("object"===n(i[o]))for(var l in e[o]||(e[o]={}),i[o])e[o][l]=i[o][l];else e[o]=i[o];e.selector=e.selector||"#"+t,s.destination=s.destination||e.selector,s.id=s.id||t+"_list_"+e.id,r.id=r.id||t+"_result",e.input=a(e.selector)}(this),x.call(this,e),L(this)}},Or.exports=xr()),Or.exports);const kr=Tr(Cr),Ir={},Nr="#search-id";let Mr=10;const Dr=document.querySelector(Nr),Pr=async()=>{const e={},t=Dr?.getAttribute("data-npc");if(!t)return e;const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch NPCs: ${n.status} ${n.statusText}`);return(await n.json()).forEach(t=>{e[t.loc]||(e[t.loc]=[]),e[t.loc].push(t.name),Ir[t.name]=Ir[t.name]&&-1===Ir[t.name].indexOf(t.loc)?Ir[t.name].concat([t.loc]):[t.loc]}),e},$r=new kr({selector:Nr,data:{src:async()=>(await Pr(),Object.keys(Ir).map(e=>({value:Ir[e],text:e}))),keys:["text"],cache:!0},resultItem:{tag:"a",class:"dropdown-item",selected:"active",highlight:!0},resultsList:{tag:"div",class:"npc-autocomplete dropdown-menu show",maxResults:void 0,destination:"#search .advancedAutoComplete"},submit:!1});let jr=!0;document.querySelector(Nr)?.addEventListener("selection",function(e){e.detail.selection.value instanceof Function?e.detail.selection.value():(e.detail.selection.value&&Dr&&(Dr.value=e.detail.selection.value.value),Dr?.form?.requestSubmit())}),document.querySelector(Nr)?.addEventListener("keyup",e=>{13===e.keyCode&&(jr&&$r.select(0),Dr&&""!==Dr.value.trim()&&!isNaN(Number(Dr.value))&&Dr.form?.requestSubmit())}),document.querySelector(Nr)?.addEventListener("navigate",()=>{jr=!1}),document.querySelector(Nr)?.addEventListener("results",function(e){let t=e.detail.results;const n=t.length;n>0&&(t.sort((t,n)=>{const i=t.value.text.toLowerCase(),s=n.value.text.toLowerCase(),r=e.detail.query.toLowerCase();return i.startsWith(r)&&!s.startsWith(r)?-1:!i.startsWith(e.detail.query)&&s.startsWith(r)?1:i.localeCompare(s)}),t=t.slice(0,Mr),n>Mr&&t.push({value:function(){const e=Mr+10;$r.start(),Mr=e},match:"Więcej..."})),e.detail.results=t}),Dr?.addEventListener("input",()=>{Mr=10});const Br=["#CC99C9","#9EC1CF","#9EE09E","#FDFD97","#FEB144","#FF6663"];let Rr=0;const qr=document.querySelector("html").getAttribute("lang")??"pl",Hr=new d({defaultLanguage:qr,detectLanguage:!1,selector:"[data-i18n]",debug:!1,registerGlobally:"__",persist:!0,persistKey:"preferred_language",filesLocation:"i18n"});if(window.translator=Hr,""!==location.hostname)Hr.fetch([qr],!1).then(e=>{const t={};document.querySelectorAll("[data-i18n]").forEach(e=>{t[e.getAttribute("data-i18n")]=e.innerHTML}),Hr.add(qr,{...t,...e})}).catch(e=>console.log(`Cannot fetch translations. ${e.message}`)),Hr.fetch(["en"]).then(()=>{Hr.translatePageTo()}).catch(e=>console.log(`Cannot fetch translations. ${e.message}`));else if("undefined"!=typeof translations){const e={};document.querySelectorAll("[data-i18n]").forEach(t=>{e[t.getAttribute("data-i18n")]=t.innerHTML}),Hr.add("pl",{...e,...translations.pl}),Hr.add("en",translations.en)}const Fr=new URLSearchParams(window.location.search),zr=Object.fromEntries(Fr.entries()),Wr=window.location.origin+window.location.pathname;function Vr(e){if(e.startsWith("#"))return e;const t=e.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);return t?`#${parseInt(t[1]).toString(16).padStart(2,"0")}${parseInt(t[2]).toString(16).padStart(2,"0")}${parseInt(t[3]).toString(16).padStart(2,"0")}`:e}let Kr={};Pr().then(e=>Kr=e);let Gr=null;const Ur=localStorage.getItem("position");Ur&&(Gr=JSON.parse(Ur));const Yr=new class{constructor(e){this.areaId=0,this.zIndex=0,this.zoom=1,this.selectedRoom=null,this.paths={},this.map=document.querySelector("#map"),this.reader=e,this.settings=n(),this.pathFinder=new i(this.reader),this.pageSettings={preview:!0,keepZoomLevel:!1,disableKeyBinds:!1};const t=localStorage.getItem("settings");if(t){const e=JSON.parse(t);void 0!==e.mapBackground&&void 0===e.backgroundColor&&(e.backgroundColor=e.mapBackground),void 0!==e.linesColor&&void 0===e.lineColor&&(e.lineColor=e.linesColor),void 0!==e.exitsSize&&void 0===e.lineWidth&&(e.lineWidth=e.exitsSize),void 0!==e.isRound&&void 0===e.roomShape&&(e.roomShape=e.isRound?"circle":"rectangle"),void 0!==e.roomSize&&e.roomSize>5&&(e.roomSize=e.roomSize/25),void 0!==e.lineWidth&&e.lineWidth>1&&(e.lineWidth=e.lineWidth/100),delete e.mapBackground,delete e.linesColor,delete e.exitsSize,delete e.isRound,delete e.optimizeDrag,delete e.showLabels,delete e.gridColor,delete e.gridLineWidth,delete e.areaName;const i=n();for(const t of Object.keys(i))void 0!==e[t]&&(this.settings[t]=e[t]);void 0!==e.preview&&(this.pageSettings.preview=e.preview),void 0!==e.keepZoomLevel&&(this.pageSettings.keepZoomLevel=e.keepZoomLevel),void 0!==e.disableKeyBinds&&(this.pageSettings.disableKeyBinds=e.disableKeyBinds)}this.map.addEventListener("roomclick",e=>{const t=this.reader.getRoom(e.detail.roomId);t&&this.selectRoom(t)}),this.map.addEventListener("zoom",e=>{this.adjustZoomBar(e.detail),this.zoom=e.detail.zoom,this.preview.update()}),this.map.addEventListener("mapclick",()=>{this.deselectRoom()}),this.map.addEventListener("roomcontextmenu",e=>{this.renderer.centerOn(e.detail.roomId)}),this.map.addEventListener("areaexitclick",e=>{setTimeout(()=>{e.detail.targetRoomId&&this.findRoom(e.detail.targetRoomId)})}),this.select=document.querySelector("#area"),this.infoBox=document.querySelector(".info-box"),this.levels=document.querySelector(".levels"),this.saveImageButton=document.querySelector(".save-image"),this.saveSvgImageButton=document.querySelector(".save-image-svg"),this.copyImageButton=document.querySelector(".copy-image"),this.zoomButtons=document.querySelectorAll(".zoom-controls .btn"),this.toastContainer=document.querySelector(".toast"),this.searchModal=document.querySelector("#search"),this.search=document.querySelector(".search-form"),this.findPathForm=document.querySelector(".findpath-form"),this.findPathModal=document.querySelector("#findpath"),this.helpModal=document.querySelector("#help"),this.zoomBar=document.querySelector(".progress-container"),this.settingsModal=document.querySelector("#settings"),this.settingsForm=document.querySelector("#settings form"),this.resetSettingsButton=document.querySelector("#settings button[type='reset']"),this.versions=document.querySelector("#versions"),this.releaseDescription=document.querySelector(".release-description"),this.versionBadge=document.querySelector(".version-number"),this.languageSelector=document.querySelector(".lang-dropdown"),this.currentLanguageFlag=document.querySelector(".current-language-flag"),this.pathBox=document.querySelector(".path-box ul"),this.areaModal=document.getElementById("area-info"),this.preview=new Sr(this.map,this),this.versions&&(this.versions.addEventListener("change",e=>{const t=e.target;this.replaceVersion(t.value),this.releaseDescription.innerHTML=t.selectedOptions[0].getAttribute("data-description")??"",qi.getInstance(this.helpModal)?.hide()}),this.helpModal.addEventListener("shown.bs.modal",()=>{0==this.versions.children.length&&(async e=>{const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch tags: ${t.status} ${t.statusText}`);return t.json()})(this.versions.getAttribute("data-tags")).then(e=>{e.forEach(e=>{const t=document.createElement("option");t.setAttribute("value",e.tag_name),t.setAttribute("data-description",(e.body??"").replaceAll("\n\n","\n")),t.innerHTML=e.tag_name,this.versions.append(t)}),this.releaseDescription.innerHTML=this.versions.firstElementChild?.getAttribute("data-description")??""})})),this.saveImageButton?.addEventListener("click",()=>this.saveImage()),this.saveSvgImageButton?.addEventListener("click",e=>{e.preventDefault(),this.downloadImage()}),this.copyImageButton?.addEventListener("click",()=>this.copyImage()),this.zoomButtons.forEach(e=>e.addEventListener("click",e=>{const t=parseFloat(e.currentTarget.getAttribute("data-factor"));this.renderer.zoomToCenter(this.renderer.getZoom()*t)})),this.search.addEventListener("submit",e=>{e.preventDefault(),this.submitSearch()}),this.findPathForm?.addEventListener("submit",e=>{e.preventDefault(),this.submitPathFind()}),this.findPathModal?.addEventListener("shown.bs.modal",()=>{this.findPathModal.querySelector("input")?.focus()}),this.searchModal.addEventListener("shown.bs.modal",()=>{this.searchModal.querySelector("input")?.focus()}),this.settingsModal.addEventListener("show.bs.modal",()=>{this.populateSettings()}),this.settingsModal.addEventListener("shown.bs.modal",()=>{this.settingsModal.querySelector("input")?.focus()}),this.settingsForm.addEventListener("submit",e=>{e.preventDefault(),this.handleSaveSettings()}),this.resetSettingsButton.addEventListener("click",e=>{e.preventDefault(),this.resetSettings()}),this.areaModal?.addEventListener("show.bs.modal",()=>{this.populateAreaInfo(this.areaId,this.zIndex)}),this.translatePage(),this.languageSelector.querySelectorAll("a").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),this.translatePage(e.getAttribute("data-lang")??void 0)})}),this.renderer=new s(this.map,this.reader,this.settings)}init(){if(zr.version&&this.versions)return this.replaceVersion(zr.version),void history.replaceState(null,"",Wr);let e=this.reader.getAreas()[0].getAreaId(),t=0;zr.loc?(this.findRoom(parseInt(zr.loc)),history.replaceState(null,"",Wr)):(zr.area?(e=parseInt(zr.area),history.replaceState(null,"",Wr)):null!==Gr&&Gr.area&&(e=Gr.area,t=Gr.zIndex),this.renderArea(e,t))}handleSaveSettings(){const e={};this.settingsModal.querySelectorAll("#nav-map input").forEach(t=>{const n=t.getAttribute("name");if(!n)return;const i=t.getAttribute("type");e[n]="checkbox"===i?t.checked:"number"===i?parseFloat(t.value):t.value}),this.settingsModal.querySelectorAll("#nav-map select[name]").forEach(t=>{const n=t.getAttribute("name");n&&(e[n]=t.value)});const t=n();for(const n of Object.keys(t))void 0!==e[n]&&(this.settings[n]=e[n]);void 0!==e.preview&&(this.pageSettings.preview=e.preview),void 0!==e.keepZoomLevel&&(this.pageSettings.keepZoomLevel=e.keepZoomLevel),void 0!==e.disableKeyBinds&&(this.pageSettings.disableKeyBinds=e.disableKeyBinds),this.showToast(Hr.translateForKey("settings-saved",Hr.currentLanguage)),qi.getInstance(this.settingsModal)?.hide(),this.saveSettings(),this.render(!0)}saveSettings(){localStorage.setItem("settings",JSON.stringify({...this.settings,...this.pageSettings}))}render(e){return this.renderArea(parseInt(this.select.value),this.zIndex,e)}renderArea(e,t,n){if(this.areaId!==e||this.zIndex!==t||n){this.areaId=e,this.zIndex=t,localStorage.setItem("position",JSON.stringify({area:e,zIndex:t})),document.querySelector("body").style.background=this.settings.backgroundColor,this.renderer.updateBackground(),this.renderer.drawArea(e,t),this.renderer.fitArea();const n=this.renderer.getViewportBounds(),i=this.renderer.exportPng({pixelRatio:.25})??null,s=this.reader.getArea(e);return this.select.value=String(e),s&&this.populateLevelButtons(s.getZLevels(),t),this.hideRoomInfo(),this.reRenderAllPaths(),this.renderer.clearHighlights(),this.pageSettings.keepZoomLevel&&this.zoom&&this.renderer.zoomToCenter(this.zoom),this.preview.init(n,i),!0}return!1}genericSetup(){document.querySelectorAll(".btn").forEach(e=>e.addEventListener("click",()=>e.blur()))}populateLevelButtons(e,t){if(this.levels.innerHTML="",e.length<=1)return;const n=e.slice().sort((e,t)=>e-t);if(n.length>10){const e=document.createElement("div");e.classList.add("dropdown");const i=document.createElement("button");i.classList.add("btn","btn-secondary","dropdown-toggle"),i.setAttribute("type","button"),i.setAttribute("data-bs-toggle","dropdown"),i.append(document.createTextNode(String(t)));const s=document.createElement("div");s.classList.add("dropdown-menu"),e.append(i),e.append(s);for(const t of n){const e=document.createElement("a");e.classList.add("dropdown-item","btn-level"),e.setAttribute("href","#"),e.setAttribute("data-level",String(t)),e.append(document.createTextNode(String(t))),s.append(e)}this.levels.append(e)}else for(const i of n){const e=document.createElement("button");e.setAttribute("type","button"),e.setAttribute("data-level",String(i)),e.classList.add("btn","btn-level"),i===t?e.classList.add("btn-primary"):e.classList.add("btn-secondary"),e.append(document.createTextNode(String(i))),this.levels.append(e)}this.levels.querySelectorAll(".btn-level").forEach(e=>{e.addEventListener("click",e=>{e.preventDefault();const t=parseInt(e.target.getAttribute("data-level"));this.renderArea(parseInt(this.select.value),t)})})}populateAreaInfo(e,t){const n=this.reader.getArea(e);if(!n)return;this.areaModal.querySelector(".area-name").innerHTML=`${n.getAreaName()} (id: ${n.getAreaId()})`;const i=n.getRooms();this.areaModal.querySelector(".area-room-count").innerHTML=String(i.length);const s=this.areaModal.querySelector(".area-exits");s.innerHTML="",i.flatMap(e=>this.getAreaExits(e)).forEach(([e,t])=>{const n=this.reader.getArea(this.reader.getRoom(t)?.area??0),i=document.createElement("li"),r=document.createElement("a");r.setAttribute("href","#"),r.setAttribute("data-room",String(e)),r.appendChild(document.createTextNode(String(e))),r.addEventListener("click",e=>{e.preventDefault(),this.findRoom(parseInt(e.currentTarget.getAttribute("data-room")))});const o=document.createTextNode(" -> "),a=document.createElement("a");a.setAttribute("href","#"),a.setAttribute("data-room",String(t)),a.appendChild(document.createTextNode(`${t} (${n?.getAreaName()??"?"})`)),a.addEventListener("click",e=>{e.preventDefault(),this.findRoom(parseInt(e.currentTarget.getAttribute("data-room")))}),i.append(r,o,a),s.appendChild(i)})}getAreaExits(e){const t=[];return Object.values(e.exits).filter(e=>this.isExitTarget(e)).forEach(n=>t.push([e.id,n])),Object.values(e.specialExits).filter(e=>this.isExitTarget(e)).forEach(n=>t.push([e.id,n])),t}isExitTarget(e){const t=this.reader.getRoom(e);if(!t)return!1;const n=this.renderer.getCurrentArea();return t.area!==n?.getAreaId()}populateSelectBox(){this.select.querySelectorAll("option").forEach(e=>e.remove()),this.reader.getAreas().filter(e=>e.getRooms().length>0&&void 0!==e.getAreaName()&&""!==e.getAreaName()).sort((e,t)=>{const n=e.getAreaName().toLowerCase(),i=t.getAreaName().toLowerCase();return n<i?-1:n>i?1:0}).forEach(e=>{e.getRooms().length&&this.select.append(new Option(e.getAreaName(),String(e.getAreaId())))}),this.select.addEventListener("change",e=>{this.renderArea(parseInt(e.target.value),0)})}submitSearch(){qi.getInstance(this.searchModal)?.hide();const e=this.search.querySelectorAll("input"),t={};if(e.forEach(e=>{t[e.name]=e.value,e.value=""}),void 0!==t.roomId){let e=t.roomId.split(",");isNaN(e[0])&&(e=Ir[e]??!1),this.findRooms(e)}}submitPathFind(){qi.getInstance(this.findPathModal)?.hide();const e=this.findPathForm.querySelectorAll("input"),t={};e.forEach(e=>{t[e.name]=e.value,e.value=""}),this.findPath(t["start-loc"],t["end-loc"])&&this.findRoom(parseInt(t["start-loc"]))}findRoom(e){if(!e)return;const t=this.reader.getRoom(e);if(t){const n=this.renderArea(t.area,t.z);this.renderer.setZoom(.5),this.renderer.centerOn(e,n),this.selectRoom(t)}else this.showToast(Hr.translateForKey("location-not-found",Hr.currentLanguage))}findRooms(e){const t=this.reader.getRoom(parseInt(String(e[0])));if(t){const n=this.renderArea(t.area,t.z);this.renderer.setZoom(.5),this.renderer.centerOn(t.id,n),this.selectRoom(t),e.length>1&&e.slice(1).forEach(e=>{this.renderer.renderHighlight(parseInt(String(e)),"#FFFF00")})}else this.showToast(Hr.translateForKey("location-not-found",Hr.currentLanguage))}findPath(e,t){const n=`${e}#${t}`,i=this.pathBox.querySelector(`[data-path-key='${n}'] input[type='color']`)?.value,s=i??Br[Rr++%Br.length],r=this.pathFinder.findPath(parseInt(e),parseInt(t));if(!r)return this.showToast(Hr.translateForKey("no-path",Hr.currentLanguage)),Rr--,!1;if(this.paths[n]={locations:r,color:s},this.reRenderAllPaths(),!this.pathBox.querySelector(`[data-path-key='${n}']`)){const i=document.createElement("li");i.classList.add("list-group-item","d-inline-flex","align-items-center","position-relative"),i.setAttribute("data-path-key",n);const r=document.createElement("input");r.setAttribute("type","color"),r.classList.add("small-color","me-2"),r.value=s,r.addEventListener("input",()=>{this.paths[n].color=r.value,this.reRenderAllPaths()}),i.appendChild(r),i.appendChild(document.createTextNode(`${e} -> ${t}`));const o=document.createElement("span");o.classList.add("badge","bg-secondary","position-absolute","end-0","me-2"),o.appendChild(document.createTextNode(Hr.translateForKey("delete",Hr.currentLanguage))),o.onclick=()=>{delete this.paths[n],this.reRenderAllPaths(),i.remove(),0===Object.keys(this.paths).length&&this.pathBox.parentElement.classList.add("invisible")},i.appendChild(o),this.pathBox.appendChild(i),this.pathBox.parentElement.classList.remove("invisible")}return!0}reRenderAllPaths(){this.renderer.clearPaths(),Object.entries(this.paths).forEach(([e,t])=>{const n=this.pathBox.querySelector(`[data-path-key='${e}'] input[type='color']`),i=n?.value??t.color;this.renderer.renderPath(t.locations,i)})}adjustZoomBar(e){const t=(e.zoom-.1)/4.9;this.zoomBar.querySelector(".progress-bar").style.width=100*t+"%",this.zoomBar.classList.contains("visible")?(void 0!==this.progressTimeout&&(clearTimeout(this.progressTimeout),this.progressTimeout=void 0),this.progressTimeout=setTimeout(()=>{this.zoomBar.classList.add("hidden"),this.zoomBar.classList.remove("visible")},3e3)):(this.zoomBar.classList.add("visible"),this.zoomBar.classList.remove("hidden"),this.progressTimeout=setTimeout(()=>{this.zoomBar.classList.add("hidden"),this.zoomBar.classList.remove("visible")},3e3))}selectRoom(e){this.renderer.clearHighlights(),this.selectedRoom=e,this.renderer.updatePositionMarker(e.id),this.showRoomInfo(e)}deselectRoom(){this.selectedRoom=null,this.renderer.clearHighlights(),this.renderer.clearPosition(),this.hideRoomInfo()}showRoomInfo(e){const t=this.reader.getColorValue(e.env);this.infoBox.style.border=`2px solid ${t.replace("rgb(","rgba(").replace(")",", 0.5)")}`,this.infoBox.style.display="initial",this.infoBox.querySelector(".room-id").innerHTML=String(e.id),this.infoBox.querySelector(".room-link").setAttribute("href",`${Wr}?loc=${e.id}`),this.infoBox.querySelector(".room-name").innerHTML=e.name,this.infoBox.querySelector(".room-env").innerHTML=String(e.env),this.infoBox.querySelector(".coord-x").innerHTML=String(e.x),this.infoBox.querySelector(".coord-y").innerHTML=String(e.y),this.infoBox.querySelector(".coord-z").innerHTML=String(e.z),this.infoBox.querySelector(".room-hash").innerHTML=e.hash??"",this.infoExitsGroup(this.infoBox.querySelector(".exits"),e.exits),this.infoExitsGroup(this.infoBox.querySelector(".special"),e.specialExits),this.userDataGroup(this.infoBox.querySelector(".userData"),e.userData),this.npcDataGroup(this.infoBox.querySelector(".npc"),Kr[e.id]||[])}userDataGroup(e,t){const n=e.querySelector("ul");n.innerHTML="";let i=!1;for(const s in t){i=!0;const e=document.createElement("li");e.classList.add("user-data");const r=document.createElement("p");r.append(`${s}:`);const o=document.createElement("p");o.append(`${t[s].replaceAll("\\n","\n")}`),o.className="value",e.append(r,o),n.append(e)}e.style.display=i?"initial":"none"}infoExitsGroup(e,t){const n=e.querySelector("ul");n.innerHTML="";let i=!1;for(const s in t)i=!0,n.append(this.infoExit(s,t[s]));e.style.display=i?"initial":"none"}npcDataGroup(e,t){const n=e.querySelector("ul");n.innerHTML="";let i=!1;for(const s of t){i=!0;const e=document.createElement("li");e.append(document.createTextNode(s)),n.append(e)}e.style.display=i?"initial":"none"}infoExit(e,t){const n=document.createElement("li"),i=document.createElement("span");i.setAttribute("data-i18n",e),i.innerHTML=this.translateDir(e),n.append(i),n.append(document.createTextNode(": "));const s=document.createElement("a");s.setAttribute("href","#"),s.setAttribute("data-room",String(t)),s.innerHTML=String(t),s.addEventListener("click",e=>{e.preventDefault(),this.findRoom(parseInt(e.currentTarget.getAttribute("data-room")))}),n.append(s);const r=this.reader.getRoom(t);if(r){const e=this.renderer.getCurrentArea();if(r.area!==e?.getAreaId()){const e=this.reader.getArea(r.area);n.append(document.createTextNode(" -> "));const t=document.createElement("a");t.setAttribute("href","#"),t.setAttribute("data-room",String(r.id)),t.innerHTML=e?.getAreaName()??"?",t.addEventListener("click",e=>{e.preventDefault(),this.findRoom(parseInt(e.currentTarget.getAttribute("data-room")))}),n.append(t)}}return n}showToast(e){this.toastContainer.querySelector(".toast-body").innerHTML=e,Ar.getOrCreateInstance(this.toastContainer).show()}translateDir(e){return Hr.translateForKey(e)??e}translatePage(e){this.currentLanguageFlag.classList.remove(`flag-${Hr.currentLanguage}`),e&&Hr.translatePageTo(e),this.currentLanguageFlag.classList.add(`flag-${Hr.currentLanguage}`)}hideRoomInfo(){this.infoBox.style.display="none"}populateSettings(){const e={...this.settings,...this.pageSettings},t=this.settingsModal.querySelector("#nav-map");if(t)for(const n in e){const i=t.querySelector(`input[name='${n}']`);if(i){"checkbox"===i.getAttribute("type")?i.checked=e[n]:"color"===i.getAttribute("type")?i.value=Vr(e[n]):i.value=e[n];continue}const s=t.querySelector(`select[name='${n}']`);s&&(s.value=e[n])}}resetSettings(){const e={...n(),preview:!0,keepZoomLevel:!1,disableKeyBinds:!1},t=this.settingsModal.querySelector("#nav-map");if(t)for(const n in e){const i=t.querySelector(`input[name='${n}']`);if(i){"checkbox"===i.getAttribute("type")?i.checked=e[n]:"color"===i.getAttribute("type")?i.value=Vr(e[n]):i.value=e[n];continue}const s=t.querySelector(`select[name='${n}']`);s&&(s.value=e[n])}}saveImage(){const e=this.renderer.exportPng();if(!e)return;const t=document.createElement("a");t.setAttribute("href",e),t.setAttribute("download",(this.renderer.getCurrentArea()?.getAreaName()??"map")+".png"),document.querySelector("body").append(t),t.click(),t.remove()}downloadImage(){const e=this.renderer.exportSvg();if(!e)return;const t=document.createElement("a");t.setAttribute("href","data:image/svg+xml,"+encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22")),t.setAttribute("download",(this.renderer.getCurrentArea()?.getAreaName()??"map")+".svg"),document.querySelector("body").append(t),t.click(),t.remove()}copyImage(){if("undefined"!=typeof ClipboardItem){const e=this.renderer.exportPngBlob();e&&e.then(e=>navigator.clipboard.write([new ClipboardItem({"image/png":e})])),this.showToast(Hr.translateForKey("copied",Hr.currentLanguage))}else this.showToast(Hr.translateForKey("no-clipboard",Hr.currentLanguage))}goDirection(e){const t=function(e){const t=function(e,t){for(const n in e)if(e.hasOwnProperty(n)&&e[n]===t)return n}(Xr,e);return void 0!==t?t:e}(e);this.selectedRoom&&this.selectedRoom.exits[t]&&this.findRoom(this.selectedRoom.exits[t])}registerKeyBoard(){const e={Numpad1:"sw",Numpad2:"s",Numpad3:"se",Numpad4:"w",Numpad6:"e",Numpad7:"nw",Numpad8:"n",Numpad9:"ne",NumpadMultiply:"u",NumpadDivide:"d"};window.addEventListener("keydown",e=>{this.pageSettings.disableKeyBinds||("F1"===e.code&&(e.preventDefault(),this.showHelp()),e.ctrlKey&&"KeyF"===e.code&&(e.preventDefault(),this.showSearch()))}),window.addEventListener("keydown",t=>{document.querySelector("input:focus")||this.pageSettings.disableKeyBinds||(t.ctrlKey&&"KeyS"===t.code&&(this.saveImage(),t.preventDefault()),"Equal"===t.code&&(this.renderer.zoomToCenter(1.1*this.renderer.getZoom()),t.preventDefault()),"Minus"===t.code&&(this.renderer.zoomToCenter(.9*this.renderer.getZoom()),t.preventDefault()),e.hasOwnProperty(t.code)&&(this.goDirection(e[t.code]),t.preventDefault()))})}showHelp(){qi.getOrCreateInstance(this.helpModal).show()}showSearch(){qi.getOrCreateInstance(this.searchModal).show()}replaceVersion(e){(async(e,t)=>{const n=t.replace("%tag%",e),i=await fetch(n);if(!i.ok)throw new Error(`Failed to fetch version: ${i.status} ${i.statusText}`);return i.json()})(e,this.versions.getAttribute("data-files")).then(n=>{this.reader=new t(n,colors),this.pathFinder=new i(this.reader),this.renderer=new s(this.map,this.reader,this.settings),this.populateSelectBox(),this.renderArea(this.areaId,this.zIndex,!0),this.showToast(`Przeladowano wersje na ${e}`),this.versionBadge.innerHTML=`v${e}`,this.versionBadge.style.display="initial"})}}(new t(mapData,colors));window.controls=Yr,Yr.genericSetup(),Yr.populateSelectBox(),Yr.init(),Yr.registerKeyBoard();const Xr={north:"n",south:"s",east:"e",west:"w",northeast:"ne",northwest:"nw",southeast:"se",southwest:"sw",up:"u",down:"d"}}},function(){return o||(0,r[e(r)[0]])((o={exports:{}}).exports,o),o.exports});export default a();
|
|
2
|
+
//# sourceMappingURL=index.min.js.map
|