@ohif/mode-microscopy 3.13.0-beta.9 → 3.13.0-beta.93
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/ohif-mode-microscopy.umd.js +1 -1
- package/package.json +30 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["ohif-mode-microscopy"]=t():e["ohif-mode-microscopy"]=t()}(globalThis,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},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},n(e)}function o(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var i=o.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function i(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),o.forEach(function(t){i(e,t,n[t])})}return e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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,o(i.key),i)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function g(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.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)?h(e,t):void 0}}function v(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(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 y(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 o,i,r,a,s=[],l=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(s.push(o.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||g(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.")}()}e.d(t,{default:()=>te});var m={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){var n;console&&console[e]&&(n=console)[e].apply(n,v(t))}},b=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),this.init(t,n)}return l(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||m,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,o){return o&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,r({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),x=function(){function e(){a(this,e),this.observers={}}return l(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach(function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)}),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter(function(e){return e!==t}):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(void 0,n)});this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(t){t.apply(t,[e].concat(n))})}}]),e}();function k(){var e,t,n=new Promise(function(n,o){e=n,t=o});return n.resolve=e,n.reject=t,n}function S(e){return null==e?"":""+e}function w(e,t,n){function o(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var r="string"!=typeof t?[].concat(t):t.split(".");r.length>1;){if(i())return{};var a=o(r.shift());!e[a]&&n&&(e[a]=new n),e=e[a]}return i()?{}:{obj:e,k:o(r.shift())}}function O(e,t,n){var o=w(e,t,Object);o.obj[o.k]=n}function N(e,t){var n=w(e,t),o=n.obj,i=n.k;if(o)return o[i]}function L(e,t,n){var o=N(e,n);return void 0!==o?o:N(t,n)}function P(e,t,n){for(var o in t)o in e?"string"==typeof e[o]||e[o]instanceof String||"string"==typeof t[o]||t[o]instanceof String?n&&(e[o]=t[o]):P(e[o],t[o],n):e[o]=t[o];return e}function C(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var R={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function j(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return R[e]}):e}var T=function(e){function t(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return a(this,t),n=c(this,p(t).call(this)),x.call(u(n)),n.data=e||{},n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return d(t,e),l(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,r=[e,t];return n&&"string"!=typeof n&&(r=r.concat(n)),n&&"string"==typeof n&&(r=r.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=e.split(".")),N(this.data,r)}},{key:"addResource",value:function(e,t,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},r=this.options.keySeparator;void 0===r&&(r=".");var a=[e,t];n&&(a=a.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(o=t,t=(a=e.split("."))[1]),this.addNamespaces(t),O(this.data,a,o),i.silent||this.emit("added",e,t,n,o)}},{key:"addResources",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});o.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,o,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(o=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var l=N(this.data,s)||{};o?P(l,n,i):l=r({},l,n),O(this.data,s,l),a.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?r({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(x),E={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,o,i){var r=this;return e.forEach(function(e){r.processors[e]&&(t=r.processors[e].process(t,n,o,i))}),t}},M=function(e){function t(e){var n,o,i,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a(this,t),n=c(this,p(t).call(this)),x.call(u(n)),o=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i=e,r=u(n),o.forEach(function(e){i[e]&&(r[e]=i[e])}),n.options=s,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=b.create("translator"),n}return d(t,e),l(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=t.nsSeparator||this.options.nsSeparator;void 0===n&&(n=":");var o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var r=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(r[0])>-1)&&(i=r.shift()),e=r.join(o)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t){var o=this;if("object"!==n(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),s=a.key,l=a.namespaces,u=l[l.length-1],c=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(p){var f=t.nsSeparator||this.options.nsSeparator;return u+f+s}return s}var d=this.resolve(e,t),h=d&&d.res,g=d&&d.usedKey||s,v=d&&d.exactUsedKey||s,y=Object.prototype.toString.apply(h),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&h&&("string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(y)<0&&("string"!=typeof m||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,h,t):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(i){var x="[object Array]"===y,k=x?[]:{},S=x?v:g;for(var w in h)if(Object.prototype.hasOwnProperty.call(h,w)){var O="".concat(S).concat(i).concat(w);k[w]=this.translate(O,r({},t,{joinArrays:!1,ns:l})),k[w]===O&&(k[w]=h[w])}h=k}}else if(b&&"string"==typeof m&&"[object Array]"===y)(h=h.join(m))&&(h=this.extendTranslation(h,e,t));else{var N=!1,L=!1;if(!this.isValidLookup(h)&&void 0!==t.defaultValue){if(N=!0,void 0!==t.count){var P=this.pluralResolver.getSuffix(c,t.count);h=t["defaultValue".concat(P)]}h||(h=t.defaultValue)}this.isValidLookup(h)||(L=!0,h=s);var C=t.defaultValue&&t.defaultValue!==h&&this.options.updateMissing;if(L||N||C){this.logger.log(C?"updateKey":"missingKey",c,u,s,C?t.defaultValue:h);var R=[],j=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&j&&j[0])for(var T=0;T<j.length;T++)R.push(j[T]);else"all"===this.options.saveMissingTo?R=this.languageUtils.toResolveHierarchy(t.lng||this.language):R.push(t.lng||this.language);var E=function(e,n){o.options.missingKeyHandler?o.options.missingKeyHandler(e,u,n,C?t.defaultValue:h,C,t):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,u,n,C?t.defaultValue:h,C,t),o.emit("missingKey",e,u,n,h)};if(this.options.saveMissing){var M=void 0!==t.count&&"string"!=typeof t.count;this.options.saveMissingPlurals&&M?R.forEach(function(e){o.pluralResolver.getPluralFormsOfKey(e,s).forEach(function(t){return E([e],t)})}):E(R,s)}}h=this.extendTranslation(h,e,t,d),L&&h===s&&this.options.appendNamespaceToMissingKey&&(h="".concat(u,":").concat(s)),L&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,t,n,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(r({},n,{interpolation:r({},this.options.interpolation,n.interpolation)}));var a=n.replace&&"string"!=typeof n.replace?n.replace:n;this.options.interpolation.defaultVariables&&(a=r({},this.options.interpolation.defaultVariables,a)),e=this.interpolator.interpolate(e,a,n.lng||this.language,n),!1!==n.nest&&(e=this.interpolator.nest(e,function(){return i.translate.apply(i,arguments)},n)),n.interpolation&&this.interpolator.reset()}var s=n.postProcess||this.options.postProcess,l="string"==typeof s?[s]:s;return null!=e&&l&&l.length&&!1!==n.applyPostProcessor&&(e=E.handle(l,e,t,this.options&&this.options.postProcessPassResolved?r({i18nResolved:o},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,o,i,r,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),u=l.key;n=u;var c=l.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var p=void 0!==s.count&&"string"!=typeof s.count,f=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,d=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);c.forEach(function(e){a.isValidLookup(t)||(r=e,a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(r)&&a.logger.warn('key "'.concat(n,'" for namespace "').concat(r,"\" won't get resolved as namespace was not yet loaded"),"This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"),d.forEach(function(n){if(!a.isValidLookup(t)){i=n;var r,l,c=u,d=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(d,u,n,e,s);else p&&(r=a.pluralResolver.getSuffix(n,s.count)),p&&f&&d.push(c+r),f&&d.push(c+="".concat(a.options.contextSeparator).concat(s.context)),p&&d.push(c+=r);for(;l=d.pop();)a.isValidLookup(t)||(o=l,t=a.getResource(n,e,l,s))}}))})}}),{res:t,usedKey:n,exactUsedKey:o,usedLng:i,usedNS:r}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}}]),t}(x);function B(e){return e.charAt(0).toUpperCase()+e.slice(1)}var F=function(){function e(t){a(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=b.create("languageUtils")}return l(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(function(e){return e.toLowerCase()}):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=B(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=B(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=B(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],r=function(e){e&&(n.isWhitelisted(e)?i.push(e):n.logger.warn("rejecting non-whitelisted language code: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&&r(this.formatLanguageCode(e)),o.forEach(function(e){i.indexOf(e)<0&&r(n.formatLanguageCode(e))}),i}}]),e}(),A=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he"],nr:[1,2,20,21],fc:22}],D={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1===e?0:2===e?1:(e<0||e>10)&&e%10==0?2:3)}};var H=function(){function e(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),this.languageUtils=t,this.options=o,this.logger=b.create("pluralResolver"),this.rules=(n={},A.forEach(function(e){e.lngs.forEach(function(t){n[t]={numbers:e.nr,plurals:D[e.fc]}})}),n)}return l(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=this,o=[],i=this.getRule(e);return i?(i.numbers.forEach(function(i){var r=n.getSuffix(e,i);o.push("".concat(t).concat(r))}),o):o}},{key:"getSuffix",value:function(e,t){var n=this,o=this.getRule(e);if(o){var i=o.noAbs?o.plurals(t):o.plurals(Math.abs(t)),r=o.numbers[i];this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var a=function(){return n.options.prepend&&r.toString()?n.options.prepend+r.toString():r.toString()};return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_".concat(r.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),V=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.logger=b.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return l(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:j,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?C(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?C(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?C(t.nestingPrefix):t.nestingPrefixEscaped||C("$t("),this.nestingSuffix=t.nestingSuffix?C(t.nestingSuffix):t.nestingSuffixEscaped||C(")"),this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,o){var i,r,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSeparator)<0)return L(t,l,e);var o=e.split(s.formatSeparator),i=o.shift().trim(),r=o.join(s.formatSeparator).trim();return s.format(L(t,l,i),r,n)};this.resetRegExp();var p=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler;for(a=0;i=this.regexpUnescape.exec(e);){if(void 0===(r=c(i[1].trim())))if("function"==typeof p){var f=p(e,i,o);r="string"==typeof f?f:""}else this.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),r="";else"string"==typeof r||this.useRawValueToEscape||(r=S(r));if(e=e.replace(i[0],u(r)),this.regexpUnescape.lastIndex=0,++a>=this.maxReplaces)break}for(a=0;i=this.regexp.exec(e);){if(void 0===(r=c(i[1].trim())))if("function"==typeof p){var d=p(e,i,o);r="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),r="";else"string"==typeof r||this.useRawValueToEscape||(r=S(r));if(r=this.escapeValue?u(this.escape(r)):u(r),e=e.replace(i[0],r),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t){var n,o,i=r({},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});function a(e,t){if(e.indexOf(",")<0)return e;var n=e.split(",");e=n.shift();var o=n.join(",");o=(o=this.interpolate(o,i)).replace(/'/g,'"');try{i=JSON.parse(o),t&&(i=r({},t,i))}catch(t){this.logger.error("failed parsing options string in nesting for key ".concat(e),t)}return delete i.defaultValue,e}for(i.applyPostProcessor=!1,delete i.defaultValue;n=this.nestingRegexp.exec(e);){if((o=t(a.call(this,n[1].trim(),i),i))&&n[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=S(o)),o||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),o=""),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}]),e}();var U=function(e){function t(e,n,o){var i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return a(this,t),i=c(this,p(t).call(this)),x.call(u(i)),i.backend=e,i.store=n,i.services=o,i.languageUtils=o.languageUtils,i.options=r,i.logger=b.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,r.backend,r),i}return d(t,e),l(t,[{key:"queueLoad",value:function(e,t,n,o){var i=this,r=[],a=[],s=[],l=[];return e.forEach(function(e){var o=!0;t.forEach(function(t){var s="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?a.indexOf(s)<0&&a.push(s):(i.state[s]=1,o=!1,a.indexOf(s)<0&&a.push(s),r.indexOf(s)<0&&r.push(s),l.indexOf(t)<0&&l.push(t)))}),o||s.push(e)}),(r.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:o}),{toLoad:r,pending:a,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(e,t,n){var o=y(e.split("|"),2),i=o[0],r=o[1];t&&this.emit("failedLoading",i,r,t),n&&this.store.addResourceBundle(i,r,n),this.state[e]=t?-1:2;var a={};this.queue.forEach(function(n){var o,s,l,u,c,p;o=n.loaded,s=r,u=w(o,[i],Object),c=u.obj,p=u.k,c[p]=c[p]||[],l&&(c[p]=c[p].concat(s)),l||c[p].push(s),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach(function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach(function(t){a[e].indexOf(t)<0&&a[e].push(t)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(function(e){return!e.done})}},{key:"read",value:function(e,t,n){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,a=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,function(s,l){s&&l&&i<5?setTimeout(function(){o.read.call(o,e,t,n,i+1,2*r,a)},r):a(s,l)}):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var r=this.queueLoad(e,t,o,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(function(e){n.loadOne(e)})}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=y(e.split("|"),2),i=o[0],r=o[1];this.read(i,r,"read",null,null,function(o,a){o&&t.logger.warn("".concat(n,"loading namespace ").concat(r," for language ").concat(i," failed"),o),!o&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(r," for language ").concat(i),a),t.loaded(e,o,a)})}},{key:"saveMissing",value:function(e,t,n,o,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" for namespace "').concat(t,'" as the namespace was not yet loaded'),"This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):(this.backend&&this.backend.create&&this.backend.create(e,t,n,o,null,r({},a,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,o))}}]),t}(x);function I(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e}function K(){}const z=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(a(this,t),e=c(this,p(t).call(this)),x.call(u(e)),e.options=I(n),e.services={},e.logger=b,e.modules={external:[]},o&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,o),c(e,u(e));setTimeout(function(){e.init(n,o)},0)}return e}return d(t,e),l(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;function i(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(o=t,t={}),this.options=r({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===n(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===n(e[2])||"object"===n(e[3])){var o=e[3]||e[2];Object.keys(o).forEach(function(e){t[e]=o[e]})}return t},interpolation:{escapeValue:!0,format:function(e,t,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}},this.options,I(t)),this.format=this.options.interpolation.format,o||(o=K),!this.options.isClone){this.modules.logger?b.init(i(this.modules.logger),this.options):b.init(null,this.options);var a=new F(this.options);this.store=new T(this.options.resources,this.options);var s=this.services;s.logger=b,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new H(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new V(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new U(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];e.emit.apply(e,[t].concat(o))}),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new M(this.services,this.options),this.translator.on("*",function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];e.emit.apply(e,[t].concat(o))}),this.modules.external.forEach(function(t){t.init&&t.init(e)})}["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}});var l=k(),u=function(){e.changeLanguage(e.options.lng,function(t,n){e.isInitialized=!0,e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(n),o(t,n)})};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}},{key:"loadResources",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&"cimode"===this.language.toLowerCase())return t();var n=[],o=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach(function(e){n.indexOf(e)<0&&n.push(e)})};if(this.language)o(this.language);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e){return o(e)});this.options.preload&&this.options.preload.forEach(function(e){return o(e)}),this.services.backendConnector.load(n,this.options.ns,t)}else t(null)}},{key:"reloadResources",value:function(e,t,n){var o=k();return e||(e=this.languages),t||(t=this.options.ns),n||(n=K),this.services.backendConnector.reload(e,t,function(e){o.resolve(),n(e)}),o}},{key:"use",value:function(e){return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&E.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this,o=k();this.emit("languageChanging",e);var i=function(e){e&&(n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.translator.language||n.translator.changeLanguage(e),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(e)),n.loadResources(function(i){!function(e,i){n.translator.changeLanguage(i),i&&(n.emit("languageChanged",i),n.logger.log("languageChanged",i)),o.resolve(function(){return n.t.apply(n,arguments)}),t&&t(e,function(){return n.t.apply(n,arguments)})}(i,e)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(e,t){var o=this,i=function e(t,i){var a;if("object"!==n(i)){for(var s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];a=o.options.overloadTranslationOptionHandler([t,i].concat(l))}else a=r({},i);return a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,o.t(t,a)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this;if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var r=function(e,n){var o=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===o||2===o};return!!this.hasResourceBundle(n,e)||(!this.services.backendConnector.backend||!(!r(n,e)||o&&!r(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,o=k();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)}),this.loadResources(function(e){o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=k();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],i=e.filter(function(e){return o.indexOf(e)<0});return i.length?(this.options.preload=o.concat(i),this.loadResources(function(e){n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K,i=r({},this.options,n,{isClone:!0}),a=new t(i);return["store","services","language"].forEach(function(t){a[t]=e[t]}),a.translator=new M(a.services,a.options),a.translator.on("*",function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];a.emit.apply(a,[e].concat(n))}),a.init(i,o),a.translator.options=a.options,a}}]),t}(x)),q=JSON.parse('{"UU":"@ohif/mode-microscopy"}').UU,_={commandName:"setToolActive",commandOptions:{toolName:"line"},context:"MICROSCOPY"},W=[{id:"MeasurementTools",uiType:"ohif.toolButtonList",props:{buttonSection:!0}},{id:"line",uiType:"ohif.toolButton",props:{icon:"tool-length",label:z.t("Buttons:Line"),tooltip:z.t("Buttons:Line Tool"),commands:_,evaluate:"evaluate.microscopyTool"}},{id:"point",uiType:"ohif.toolButton",props:{icon:"tool-point",label:z.t("Buttons:Point"),tooltip:z.t("Buttons:Point Tool"),commands:{..._,commandOptions:{toolName:"point"}},evaluate:"evaluate.microscopyTool"}},{id:"polygon",uiType:"ohif.toolButton",props:{icon:"tool-polygon",label:z.t("Buttons:Polygon"),tooltip:z.t("Buttons:Polygon Tool"),commands:{..._,commandOptions:{toolName:"polygon"}},evaluate:"evaluate.microscopyTool"}},{id:"circle",uiType:"ohif.toolButton",props:{icon:"tool-circle",label:z.t("Buttons:Circle"),tooltip:z.t("Buttons:Circle Tool"),commands:{..._,commandOptions:{toolName:"circle"}},evaluate:"evaluate.microscopyTool"}},{id:"box",uiType:"ohif.toolButton",props:{icon:"tool-rectangle",label:z.t("Buttons:Box"),tooltip:z.t("Buttons:Box Tool"),commands:{..._,commandOptions:{toolName:"box"}},evaluate:"evaluate.microscopyTool"}},{id:"freehandpolygon",uiType:"ohif.toolButton",props:{icon:"tool-freehand-polygon",label:z.t("Buttons:Freehand Polygon"),tooltip:z.t("Buttons:Freehand Polygon Tool"),commands:{..._,commandOptions:{toolName:"freehandpolygon"}},evaluate:"evaluate.microscopyTool"}},{id:"freehandline",uiType:"ohif.toolButton",props:{icon:"tool-freehand-line",label:z.t("Buttons:Freehand Line"),tooltip:z.t("Buttons:Freehand Line Tool"),commands:{..._,commandOptions:{toolName:"freehandline"}},evaluate:"evaluate.microscopyTool"}},{id:"dragPan",uiType:"ohif.toolButton",props:{icon:"tool-move",label:z.t("Buttons:Pan"),commands:{..._,commandOptions:{toolName:"dragPan"}},evaluate:"evaluate.microscopyTool"}},{id:"TagBrowser",uiType:"ohif.toolButton",props:{icon:"dicom-tag-browser",label:z.t("Buttons:Dicom Tag Browser"),tooltip:z.t("Buttons:Dicom Tag Browser"),commands:"openDICOMTagViewer",evaluate:"evaluate.action"}}],$="@ohif/extension-default.layoutTemplateModule.viewerLayout",J="@ohif/extension-default.panelModule.seriesList",G="@ohif/extension-dicom-microscopy.panelModule.measure",Y="@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video",Q="@ohif/extension-dicom-video.viewportModule.dicom-video",X="@ohif/extension-dicom-pdf.sopClassHandlerModule.dicom-pdf",Z="@ohif/extension-dicom-pdf.viewportModule.dicom-pdf",ee={"@ohif/extension-default":"^3.0.0","@ohif/extension-cornerstone":"^3.0.0","@ohif/extension-cornerstone-dicom-sr":"^3.0.0","@ohif/extension-dicom-pdf":"^3.0.1","@ohif/extension-dicom-video":"^3.0.1","@ohif/extension-dicom-microscopy":"^3.0.0"};const te={id:q,modeFactory:function({modeConfiguration:e}){return{id:q,routeName:"microscopy",displayName:z.t("Modes:Microscopy"),onModeEnter:({servicesManager:e})=>{const{toolbarService:t}=e.services;t.register(W),t.updateSection("primary",["MeasurementTools","dragPan","TagBrowser"]),t.updateSection("MeasurementTools",["line","point","polygon","circle","box","freehandpolygon","freehandline"])},onModeExit:({servicesManager:e})=>{const{toolbarService:t,uiDialogService:n,uiModalService:o}=e.services;n.hideAll(),o.hide(),t.reset()},validationTags:{study:[],series:[]},isValidMode:({modalities:e})=>({valid:e.split("\\").includes("SM"),description:"Microscopy mode only supports the SM modality"}),routes:[{path:"microscopy",layoutTemplate:({location:e,servicesManager:t})=>({id:$,props:{leftPanels:[J],leftPanelResizable:!0,leftPanelClosed:!0,rightPanels:[G],rightPanelResizable:!0,viewports:[{namespace:"@ohif/extension-dicom-microscopy.viewportModule.microscopy-dicom",displaySetsToDisplay:["@ohif/extension-cornerstone.sopClassHandlerModule.DicomMicroscopySopClassHandler","@ohif/extension-dicom-microscopy.sopClassHandlerModule.DicomMicroscopySRSopClassHandler","@ohif/extension-dicom-microscopy.sopClassHandlerModule.DicomMicroscopyANNSopClassHandler"]},{namespace:Q,displaySetsToDisplay:[Y]},{namespace:Z,displaySetsToDisplay:[X]}]}})}],extensions:ee,hangingProtocol:"default",sopClassHandlers:["@ohif/extension-cornerstone.sopClassHandlerModule.DicomMicroscopySopClassHandler","@ohif/extension-dicom-microscopy.sopClassHandlerModule.DicomMicroscopySRSopClassHandler","@ohif/extension-dicom-microscopy.sopClassHandlerModule.DicomMicroscopyANNSopClassHandler",Y,X],...e}},extensionDependencies:ee};return t=t.default})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["ohif-mode-microscopy"]=t():e["ohif-mode-microscopy"]=t()}(globalThis,()=>(()=>{"use strict";var e={};e.d=(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var t={};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 n(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function i(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})),i.forEach(function(t){var i,r;i=t,r=o[t],(i=n(i))in e?Object.defineProperty(e,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[i]=r})}return e}function r(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}function s(e,t,o){return t&&a(e.prototype,t),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return l(e)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function d(e,t){if(e){if("string"==typeof e)return h(e,t);var o=({}).toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?h(e,t):void 0}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,i,r,a,s=[],l=!0,u=!1;try{if(r=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;l=!1}else for(;!(l=(n=r.call(o)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=o.return&&(a=o.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||d(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.d(t,{default:()=>$});var v={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){var o;console&&console[e]&&(o=console)[e].apply(o,function(e){if(Array.isArray(e))return h(e)}(t)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||d(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}},y=new(function(){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),this.init(t,o)}return s(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||v,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,o,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(o).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,i({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),m=function(){function e(){r(this,e),this.observers={}}return s(e,[{key:"on",value:function(e,t){var o=this;return e.split(" ").forEach(function(e){o.observers[e]=o.observers[e]||[],o.observers[e].push(t)}),this}},{key:"off",value:function(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e]=this.observers[e].filter(function(e){return e!==t})}}},{key:"emit",value:function(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(void 0,o)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(t){t.apply(t,[e].concat(o))})}}]),e}();function b(){var e,t,o=new Promise(function(o,n){e=o,t=n});return o.resolve=e,o.reject=t,o}function x(e){return null==e?"":""+e}function k(e,t,o){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var r="string"!=typeof t?[].concat(t):t.split(".");r.length>1;){if(i())return{};var a=n(r.shift());!e[a]&&o&&(e[a]=new o),e=e[a]}return i()?{}:{obj:e,k:n(r.shift())}}function S(e,t,o){var n=k(e,t,Object);n.obj[n.k]=o}function w(e,t){var o=k(e,t),n=o.obj,i=o.k;if(n)return n[i]}function O(e,t,o){var n=w(e,o);return void 0!==n?n:w(t,o)}function N(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var L={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function P(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return L[e]}):e}var R=function(e){function t(e){var o,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return r(this,t),o=u(this,c(t).call(this)),m.call(l(o)),o.data=e||{},o.options=n,void 0===o.options.keySeparator&&(o.options.keySeparator="."),o}return f(t,e),s(t,[{key:"addNamespaces",value:function(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,r=[e,t];return o&&"string"!=typeof o&&(r=r.concat(o)),o&&"string"==typeof o&&(r=r.concat(i?o.split(i):o)),e.indexOf(".")>-1&&(r=e.split(".")),w(this.data,r)}},{key:"addResource",value:function(e,t,o,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},r=this.options.keySeparator;void 0===r&&(r=".");var a=[e,t];o&&(a=a.concat(r?o.split(r):o)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),S(this.data,a,n),i.silent||this.emit("added",e,t,o,n)}},{key:"addResources",value:function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in o)("string"==typeof o[i]||"[object Array]"===Object.prototype.toString.apply(o[i]))&&this.addResource(e,t,i,o[i],{silent:!0});n.silent||this.emit("added",e,t,o)}},{key:"addResourceBundle",value:function(e,t,o,n,r){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),n=o,o=t,t=s[1]),this.addNamespaces(t);var l=w(this.data,s)||{};n?function e(t,o,n){for(var i in o)i in t?"string"==typeof t[i]||t[i]instanceof String||"string"==typeof o[i]||o[i]instanceof String?n&&(t[i]=o[i]):e(t[i],o[i],n):t[i]=o[i];return t}(l,o,r):l=i({},l,o),S(this.data,s,l),a.silent||this.emit("added",e,t,o)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?i({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(m),j={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,o,n,i){var r=this;return e.forEach(function(e){r.processors[e]&&(t=r.processors[e].process(t,o,n,i))}),t}},C=function(e){function t(e){var o,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(this,t),i=u(this,c(t).call(this)),m.call(l(i)),o=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n=l(i),o.forEach(function(t){e[t]&&(n[t]=e[t])}),i.options=a,void 0===i.options.keySeparator&&(i.options.keySeparator="."),i.logger=y.create("translator"),i}return f(t,e),s(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},o=this.resolve(e,t);return o&&void 0!==o.res}},{key:"extractFromKey",value:function(e,t){var o=t.nsSeparator||this.options.nsSeparator;void 0===o&&(o=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(o&&e.indexOf(o)>-1){var r=e.split(o);(o!==n||o===n&&this.options.ns.indexOf(r[0])>-1)&&(i=r.shift()),e=r.join(n)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t){var n=this;if("object"!==o(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),s=a.key,l=a.namespaces,u=l[l.length-1],c=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase())return p?u+(t.nsSeparator||this.options.nsSeparator)+s:s;var f=this.resolve(e,t),h=f&&f.res,d=f&&f.usedKey||s,g=f&&f.exactUsedKey||s,v=Object.prototype.toString.apply(h),y=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject,b="string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h;if(m&&h&&b&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(v)&&("string"!=typeof y||"[object Array]"!==v)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,h,t):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(r){var x="[object Array]"===v,k=x?[]:{},S=x?g:d;for(var w in h)if(Object.prototype.hasOwnProperty.call(h,w)){var O="".concat(S).concat(r).concat(w);k[w]=this.translate(O,i({},t,{joinArrays:!1,ns:l})),k[w]===O&&(k[w]=h[w])}h=k}}else if(m&&"string"==typeof y&&"[object Array]"===v)(h=h.join(y))&&(h=this.extendTranslation(h,e,t));else{var N=!1,L=!1;if(!this.isValidLookup(h)&&void 0!==t.defaultValue){if(N=!0,void 0!==t.count){var P=this.pluralResolver.getSuffix(c,t.count);h=t["defaultValue".concat(P)]}h||(h=t.defaultValue)}this.isValidLookup(h)||(L=!0,h=s);var R=t.defaultValue&&t.defaultValue!==h&&this.options.updateMissing;if(L||N||R){this.logger.log(R?"updateKey":"missingKey",c,u,s,R?t.defaultValue:h);var j=[],C=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&C&&C[0])for(var T=0;T<C.length;T++)j.push(C[T]);else"all"===this.options.saveMissingTo?j=this.languageUtils.toResolveHierarchy(t.lng||this.language):j.push(t.lng||this.language);var E=function(e,o){n.options.missingKeyHandler?n.options.missingKeyHandler(e,u,o,R?t.defaultValue:h,R,t):n.backendConnector&&n.backendConnector.saveMissing&&n.backendConnector.saveMissing(e,u,o,R?t.defaultValue:h,R,t),n.emit("missingKey",e,u,o,h)};if(this.options.saveMissing){var M=void 0!==t.count&&"string"!=typeof t.count;this.options.saveMissingPlurals&&M?j.forEach(function(e){n.pluralResolver.getPluralFormsOfKey(e,s).forEach(function(t){return E([e],t)})}):E(j,s)}}h=this.extendTranslation(h,e,t,f),L&&h===s&&this.options.appendNamespaceToMissingKey&&(h="".concat(u,":").concat(s)),L&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,t,o,n){var r=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,o,n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(i({},o,{interpolation:i({},this.options.interpolation,o.interpolation)}));var a=o.replace&&"string"!=typeof o.replace?o.replace:o;this.options.interpolation.defaultVariables&&(a=i({},this.options.interpolation.defaultVariables,a)),e=this.interpolator.interpolate(e,a,o.lng||this.language,o),!1!==o.nest&&(e=this.interpolator.nest(e,function(){return r.translate.apply(r,arguments)},o)),o.interpolation&&this.interpolator.reset()}var s=o.postProcess||this.options.postProcess,l="string"==typeof s?[s]:s;return null!=e&&l&&l.length&&!1!==o.applyPostProcessor&&(e=j.handle(l,e,t,this.options&&this.options.postProcessPassResolved?i({i18nResolved:n},o):o,this)),e}},{key:"resolve",value:function(e){var t,o,n,i,r,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),u=l.key;o=u;var c=l.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var p=void 0!==s.count&&"string"!=typeof s.count,f=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,h=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);c.forEach(function(e){a.isValidLookup(t)||(r=e,a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(r)&&a.logger.warn('key "'.concat(o,'" for namespace "').concat(r,"\" won't get resolved as namespace was not yet loaded"),"This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"),h.forEach(function(o){if(!a.isValidLookup(t)){i=o;var r,l,c=u,h=[c];for(a.i18nFormat&&a.i18nFormat.addLookupKeys?a.i18nFormat.addLookupKeys(h,u,o,e,s):(p&&(r=a.pluralResolver.getSuffix(o,s.count)),p&&f&&h.push(c+r),f&&h.push(c+="".concat(a.options.contextSeparator).concat(s.context)),p&&h.push(c+=r));l=h.pop();)a.isValidLookup(t)||(n=l,t=a.getResource(o,e,l,s))}}))})}}),{res:t,usedKey:o,exactUsedKey:n,usedLng:i,usedNS:r}}},{key:"isValidLookup",value:function(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,o,n):this.resourceStore.getResource(e,t,o,n)}}]),t}(m);function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}var E=function(){function e(t){r(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=y.create("languageUtils")}return s(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],o=e.split("-");return this.options.lowerCaseLng?o=o.map(function(e){return e.toLowerCase()}):2===o.length?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),t.indexOf(o[1].toLowerCase())>-1&&(o[1]=T(o[1].toLowerCase()))):3===o.length&&(o[0]=o[0].toLowerCase(),2===o[1].length&&(o[1]=o[1].toUpperCase()),"sgn"!==o[0]&&2===o[2].length&&(o[2]=o[2].toUpperCase()),t.indexOf(o[1].toLowerCase())>-1&&(o[1]=T(o[1].toLowerCase())),t.indexOf(o[2].toLowerCase())>-1&&(o[2]=T(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e.default),o||[]}},{key:"toResolveHierarchy",value:function(e,t){var o=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],r=function(e){e&&(o.isWhitelisted(e)?i.push(e):o.logger.warn("rejecting non-whitelisted language code: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&&r(this.formatLanguageCode(e)),n.forEach(function(e){0>i.indexOf(e)&&r(o.formatLanguageCode(e))}),i}}]),e}(),M=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he"],nr:[1,2,20,21],fc:22}],B={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(+(1!=e&&e%10!=1))},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:3*(e%100==3||e%100==4))},22:function(e){return Number(1===e?0:2===e?1:(e<0||e>10)&&e%10==0?2:3)}},F=function(){function e(t){var o,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),this.languageUtils=t,this.options=n,this.logger=y.create("pluralResolver"),this.rules=(o={},M.forEach(function(e){e.lngs.forEach(function(t){o[t]={numbers:e.nr,plurals:B[e.fc]}})}),o)}return s(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var o=this,n=[],i=this.getRule(e);return i&&i.numbers.forEach(function(i){var r=o.getSuffix(e,i);n.push("".concat(t).concat(r))}),n}},{key:"getSuffix",value:function(e,t){var o=this,n=this.getRule(e);if(n){var i=n.noAbs?n.plurals(t):n.plurals(Math.abs(t)),r=n.numbers[i];this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var a=function(){return o.options.prepend&&r.toString()?o.options.prepend+r.toString():r.toString()};return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_".concat(r.toString()):a():"v2"===this.options.compatibilityJSON?a():this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),A=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),this.logger=y.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return s(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:P,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?N(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?N(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?N(t.nestingPrefix):t.nestingPrefixEscaped||N("$t("),this.nestingSuffix=t.nestingSuffix?N(t.nestingSuffix):t.nestingSuffixEscaped||N(")"),this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(t,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(o,"g")}},{key:"interpolate",value:function(e,t,o,n){var i,r,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(0>e.indexOf(s.formatSeparator))return O(t,l,e);var n=e.split(s.formatSeparator),i=n.shift().trim(),r=n.join(s.formatSeparator).trim();return s.format(O(t,l,i),r,o)};this.resetRegExp();var p=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler;for(a=0;i=this.regexpUnescape.exec(e);){if(void 0===(r=c(i[1].trim())))if("function"==typeof p){var f=p(e,i,n);r="string"==typeof f?f:""}else this.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),r="";else"string"==typeof r||this.useRawValueToEscape||(r=x(r));if(e=e.replace(i[0],u(r)),this.regexpUnescape.lastIndex=0,++a>=this.maxReplaces)break}for(a=0;i=this.regexp.exec(e);){if(void 0===(r=c(i[1].trim())))if("function"==typeof p){var h=p(e,i,n);r="string"==typeof h?h:""}else this.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),r="";else"string"==typeof r||this.useRawValueToEscape||(r=x(r));if(r=u(this.escapeValue?this.escape(r):r),e=e.replace(i[0],r),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t){var o,n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=i({},r);function s(e,t){if(0>e.indexOf(","))return e;var o=e.split(",");e=o.shift();var n=o.join(",");n=(n=this.interpolate(n,a)).replace(/'/g,'"');try{a=JSON.parse(n),t&&(a=i({},t,a))}catch(t){this.logger.error("failed parsing options string in nesting for key ".concat(e),t)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;o=this.nestingRegexp.exec(e);){if((n=t(s.call(this,o[1].trim(),a),a))&&o[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=x(n)),n||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(e)),n=""),e=e.replace(o[0],n),this.regexp.lastIndex=0}return e}}]),e}(),H=function(e){function t(e,o,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return r(this,t),i=u(this,c(t).call(this)),m.call(l(i)),i.backend=e,i.store=o,i.services=n,i.languageUtils=n.languageUtils,i.options=a,i.logger=y.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(n,a.backend,a),i}return f(t,e),s(t,[{key:"queueLoad",value:function(e,t,o,n){var i=this,r=[],a=[],s=[],l=[];return e.forEach(function(e){var n=!0;t.forEach(function(t){var s="".concat(e,"|").concat(t);!o.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?0>a.indexOf(s)&&a.push(s):(i.state[s]=1,n=!1,0>a.indexOf(s)&&a.push(s),0>r.indexOf(s)&&r.push(s),0>l.indexOf(t)&&l.push(t)))}),n||s.push(e)}),(r.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:n}),{toLoad:r,pending:a,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(e,t,o){var n=g(e.split("|"),2),i=n[0],r=n[1];t&&this.emit("failedLoading",i,r,t),o&&this.store.addResourceBundle(i,r,o),this.state[e]=t?-1:2;var a={};this.queue.forEach(function(o){n=o.loaded,(l=(s=k(n,[i],Object)).obj)[u=s.k]=l[u]||[],l[u].push(r);for(var n,s,l,u,c=o.pending,p=c.indexOf(e);-1!==p;)c.splice(p,1),p=c.indexOf(e);t&&o.errors.push(t),0!==o.pending.length||o.done||(Object.keys(o.loaded).forEach(function(e){a[e]||(a[e]=[]),o.loaded[e].length&&o.loaded[e].forEach(function(t){0>a[e].indexOf(t)&&a[e].push(t)})}),o.done=!0,o.errors.length?o.callback(o.errors):o.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(function(e){return!e.done})}},{key:"read",value:function(e,t,o){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,a=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[o](e,t,function(s,l){s&&l&&i<5?setTimeout(function(){n.read.call(n,e,t,o,i+1,2*r,a)},r):a(s,l)}):a(null,{})}},{key:"prepareLoading",value:function(e,t){var o=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var r=this.queueLoad(e,t,n,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(function(e){o.loadOne(e)})}},{key:"load",value:function(e,t,o){this.prepareLoading(e,t,{},o)}},{key:"reload",value:function(e,t,o){this.prepareLoading(e,t,{reload:!0},o)}},{key:"loadOne",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=g(e.split("|"),2),i=n[0],r=n[1];this.read(i,r,"read",null,null,function(n,a){n&&t.logger.warn("".concat(o,"loading namespace ").concat(r," for language ").concat(i," failed"),n),!n&&a&&t.logger.log("".concat(o,"loaded namespace ").concat(r," for language ").concat(i),a),t.loaded(e,n,a)})}},{key:"saveMissing",value:function(e,t,o,n,r){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(o,'" for namespace "').concat(t,'" as the namespace was not yet loaded'),"This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):(this.backend&&this.backend.create&&this.backend.create(e,t,o,n,null,i({},a,{isUpdate:r})),e&&e[0]&&this.store.addResource(e[0],t,o,n))}}]),t}(m);function D(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&0>e.whitelist.indexOf("cimode")&&(e.whitelist=e.whitelist.concat(["cimode"])),e}function V(){}var U=new(function(e){function t(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(r(this,t),e=u(this,c(t).call(this)),m.call(l(e)),e.options=D(o),e.services={},e.logger=y,e.modules={external:[]},n&&!e.isInitialized&&!o.isClone){if(!e.options.initImmediate)return e.init(o,n),u(e,l(e));setTimeout(function(){e.init(o,n)},0)}return e}return f(t,e),s(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),this.options=i({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===o(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===o(e[2])||"object"===o(e[3])){var n=e[3]||e[2];Object.keys(n).forEach(function(e){t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:function(e,t,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}},this.options,D(t)),this.format=this.options.interpolation.format,n||(n=V),!this.options.isClone){this.modules.logger?y.init(r(this.modules.logger),this.options):y.init(null,this.options);var a=new E(this.options);this.store=new R(this.options.resources,this.options);var s=this.services;s.logger=y,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new F(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new A(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new H(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(t){for(var o=arguments.length,n=Array(o>1?o-1:0),i=1;i<o;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))}),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new C(this.services,this.options),this.translator.on("*",function(t){for(var o=arguments.length,n=Array(o>1?o-1:0),i=1;i<o;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))}),this.modules.external.forEach(function(t){t.init&&t.init(e)})}["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(t){e[t]=function(){var o;return(o=e.store)[t].apply(o,arguments)}});var l=b(),u=function(){e.changeLanguage(e.options.lng,function(t,o){e.isInitialized=!0,e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(o),n(t,o)})};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}},{key:"loadResources",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&"cimode"===this.language.toLowerCase())return t();var o=[],n=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach(function(e){0>o.indexOf(e)&&o.push(e)})};this.language?n(this.language):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e){return n(e)}),this.options.preload&&this.options.preload.forEach(function(e){return n(e)}),this.services.backendConnector.load(o,this.options.ns,t)}else t(null)}},{key:"reloadResources",value:function(e,t,o){var n=b();return e||(e=this.languages),t||(t=this.options.ns),o||(o=V),this.services.backendConnector.reload(e,t,function(e){n.resolve(),o(e)}),n}},{key:"use",value:function(e){return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&j.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var o=this,n=b();this.emit("languageChanging",e);var i=function(e,i){o.translator.changeLanguage(i),i&&(o.emit("languageChanged",i),o.logger.log("languageChanged",i)),n.resolve(function(){return o.t.apply(o,arguments)}),t&&t(e,function(){return o.t.apply(o,arguments)})},r=function(e){e&&(o.language=e,o.languages=o.services.languageUtils.toResolveHierarchy(e),o.translator.language||o.translator.changeLanguage(e),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage(e)),o.loadResources(function(t){i(t,e)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t){var n=this,r=function e(t,r){var a;if("object"!==o(r)){for(var s=arguments.length,l=Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];a=n.options.overloadTranslationOptionHandler([t,r].concat(l))}else a=i({},r);return a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,n.t(t,a)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=t,r}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this;if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;var r=function(e,o){var n=t.services.backendConnector.state["".concat(e,"|").concat(o)];return -1===n||2===n};return!!(this.hasResourceBundle(o,e)||!this.services.backendConnector.backend||r(o,e)&&(!n||r(i,e)))}},{key:"loadNamespaces",value:function(e,t){var o=this,n=b();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){0>o.options.ns.indexOf(e)&&o.options.ns.push(e)}),this.loadResources(function(e){n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var o=b();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],i=e.filter(function(e){return 0>n.indexOf(e)});return i.length?(this.options.preload=n.concat(i),this.loadResources(function(e){o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;return new t(e,o)}},{key:"cloneInstance",value:function(){var e=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V,r=i({},this.options,o,{isClone:!0}),a=new t(r);return["store","services","language"].forEach(function(t){a[t]=e[t]}),a.translator=new C(a.services,a.options),a.translator.on("*",function(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];a.emit.apply(a,[e].concat(o))}),a.init(r,n),a.translator.options=a.options,a}}]),t}(m));let I=JSON.parse('{"UU":"@ohif/mode-microscopy"}').UU,K={commandName:"setToolActive",commandOptions:{toolName:"line"},context:"MICROSCOPY"},z=[{id:"MeasurementTools",uiType:"ohif.toolButtonList",props:{buttonSection:!0}},{id:"line",uiType:"ohif.toolButton",props:{icon:"tool-length",label:U.t("Buttons:Line"),tooltip:U.t("Buttons:Line Tool"),commands:K,evaluate:"evaluate.microscopyTool"}},{id:"point",uiType:"ohif.toolButton",props:{icon:"tool-point",label:U.t("Buttons:Point"),tooltip:U.t("Buttons:Point Tool"),commands:{...K,commandOptions:{toolName:"point"}},evaluate:"evaluate.microscopyTool"}},{id:"polygon",uiType:"ohif.toolButton",props:{icon:"tool-polygon",label:U.t("Buttons:Polygon"),tooltip:U.t("Buttons:Polygon Tool"),commands:{...K,commandOptions:{toolName:"polygon"}},evaluate:"evaluate.microscopyTool"}},{id:"circle",uiType:"ohif.toolButton",props:{icon:"tool-circle",label:U.t("Buttons:Circle"),tooltip:U.t("Buttons:Circle Tool"),commands:{...K,commandOptions:{toolName:"circle"}},evaluate:"evaluate.microscopyTool"}},{id:"box",uiType:"ohif.toolButton",props:{icon:"tool-rectangle",label:U.t("Buttons:Box"),tooltip:U.t("Buttons:Box Tool"),commands:{...K,commandOptions:{toolName:"box"}},evaluate:"evaluate.microscopyTool"}},{id:"freehandpolygon",uiType:"ohif.toolButton",props:{icon:"tool-freehand-polygon",label:U.t("Buttons:Freehand Polygon"),tooltip:U.t("Buttons:Freehand Polygon Tool"),commands:{...K,commandOptions:{toolName:"freehandpolygon"}},evaluate:"evaluate.microscopyTool"}},{id:"freehandline",uiType:"ohif.toolButton",props:{icon:"tool-freehand-line",label:U.t("Buttons:Freehand Line"),tooltip:U.t("Buttons:Freehand Line Tool"),commands:{...K,commandOptions:{toolName:"freehandline"}},evaluate:"evaluate.microscopyTool"}},{id:"dragPan",uiType:"ohif.toolButton",props:{icon:"tool-move",label:U.t("Buttons:Pan"),commands:{...K,commandOptions:{toolName:"dragPan"}},evaluate:"evaluate.microscopyTool"}},{id:"TagBrowser",uiType:"ohif.toolButton",props:{icon:"dicom-tag-browser",label:U.t("Buttons:Dicom Tag Browser"),tooltip:U.t("Buttons:Dicom Tag Browser"),commands:"openDICOMTagViewer",evaluate:"evaluate.action"}}],q="@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video",_="@ohif/extension-dicom-pdf.sopClassHandlerModule.dicom-pdf",W={"@ohif/extension-default":"^3.0.0","@ohif/extension-cornerstone":"^3.0.0","@ohif/extension-cornerstone-dicom-sr":"^3.0.0","@ohif/extension-dicom-pdf":"^3.0.1","@ohif/extension-dicom-video":"^3.0.1","@ohif/extension-dicom-microscopy":"^3.0.0"},$={id:I,modeFactory:function({modeConfiguration:e}){return{id:I,routeName:"microscopy",displayName:U.t("Modes:Microscopy"),onModeEnter:({servicesManager:e})=>{let{toolbarService:t}=e.services;t.register(z),t.updateSection("primary",["MeasurementTools","dragPan","TagBrowser"]),t.updateSection("MeasurementTools",["line","point","polygon","circle","box","freehandpolygon","freehandline"])},onModeExit:({servicesManager:e})=>{let{toolbarService:t,uiDialogService:o,uiModalService:n}=e.services;o.hideAll(),n.hide(),t.reset()},validationTags:{study:[],series:[]},isValidMode:({modalities:e})=>({valid:e.split("\\").includes("SM"),description:"Microscopy mode only supports the SM modality"}),routes:[{path:"microscopy",layoutTemplate:({location:e,servicesManager:t})=>({id:"@ohif/extension-default.layoutTemplateModule.viewerLayout",props:{leftPanels:["@ohif/extension-default.panelModule.seriesList"],leftPanelResizable:!0,leftPanelClosed:!0,rightPanels:["@ohif/extension-dicom-microscopy.panelModule.measure"],rightPanelResizable:!0,viewports:[{namespace:"@ohif/extension-dicom-microscopy.viewportModule.microscopy-dicom",displaySetsToDisplay:["@ohif/extension-cornerstone.sopClassHandlerModule.DicomMicroscopySopClassHandler","@ohif/extension-dicom-microscopy.sopClassHandlerModule.DicomMicroscopySRSopClassHandler","@ohif/extension-dicom-microscopy.sopClassHandlerModule.DicomMicroscopyANNSopClassHandler"]},{namespace:"@ohif/extension-dicom-video.viewportModule.dicom-video",displaySetsToDisplay:[q]},{namespace:"@ohif/extension-dicom-pdf.viewportModule.dicom-pdf",displaySetsToDisplay:[_]}]}})}],extensions:W,hangingProtocol:"default",sopClassHandlers:["@ohif/extension-cornerstone.sopClassHandlerModule.DicomMicroscopySopClassHandler","@ohif/extension-dicom-microscopy.sopClassHandlerModule.DicomMicroscopySRSopClassHandler","@ohif/extension-dicom-microscopy.sopClassHandlerModule.DicomMicroscopyANNSopClassHandler",q,_],...e}},extensionDependencies:W};return t.default})());
|
package/package.json
CHANGED
|
@@ -1,45 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohif/mode-microscopy",
|
|
3
|
-
"version": "3.13.0-beta.
|
|
3
|
+
"version": "3.13.0-beta.93",
|
|
4
4
|
"description": "OHIF mode for DICOM microscopy",
|
|
5
5
|
"author": "OHIF",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "OHIF/Viewers"
|
|
10
|
+
},
|
|
7
11
|
"main": "dist/ohif-mode-microscopy.umd.js",
|
|
12
|
+
"module": "src/index.tsx",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=24"
|
|
15
|
+
},
|
|
8
16
|
"files": [
|
|
9
17
|
"dist/**",
|
|
10
18
|
"public/**",
|
|
11
19
|
"README.md"
|
|
12
20
|
],
|
|
13
|
-
"repository": "OHIF/Viewers",
|
|
14
|
-
"keywords": [
|
|
15
|
-
"ohif-mode"
|
|
16
|
-
],
|
|
17
21
|
"publishConfig": {
|
|
18
22
|
"access": "public"
|
|
19
23
|
},
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@ohif/core": "3.13.0-beta.93",
|
|
26
|
+
"@ohif/extension-dicom-microscopy": "3.13.0-beta.93"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@babel/runtime": "7.29.7",
|
|
30
|
+
"i18next": "17.3.1"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"cross-env": "7.0.3",
|
|
34
|
+
"webpack-merge": "5.10.0"
|
|
25
35
|
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"ohif-mode"
|
|
38
|
+
],
|
|
26
39
|
"scripts": {
|
|
27
40
|
"clean": "shx rm -rf dist",
|
|
28
|
-
"clean:deep": "
|
|
29
|
-
"dev": "cross-env NODE_ENV=development
|
|
30
|
-
"dev:cornerstone": "
|
|
31
|
-
"build": "cross-env NODE_ENV=production
|
|
32
|
-
"build:package": "
|
|
33
|
-
"start": "
|
|
41
|
+
"clean:deep": "pnpm run clean && shx rm -rf node_modules",
|
|
42
|
+
"dev": "cross-env NODE_ENV=development rspack build --config .webpack/webpack.dev.js --watch",
|
|
43
|
+
"dev:cornerstone": "pnpm run dev",
|
|
44
|
+
"build": "cross-env NODE_ENV=production rspack build --config .webpack/webpack.prod.js",
|
|
45
|
+
"build:package": "pnpm run build",
|
|
46
|
+
"start": "pnpm run dev",
|
|
34
47
|
"test:unit": "jest --watchAll",
|
|
35
48
|
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
|
|
36
|
-
},
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"@ohif/core": "3.13.0-beta.9",
|
|
39
|
-
"@ohif/extension-dicom-microscopy": "3.13.0-beta.9"
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"@babel/runtime": "7.28.2",
|
|
43
|
-
"i18next": "17.3.1"
|
|
44
49
|
}
|
|
45
|
-
}
|
|
50
|
+
}
|