@schukai/monster 1.29.1 → 1.30.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. package/CHANGELOG +19 -0
  2. package/README.md +3 -3
  3. package/dist/modules/constants.js +1 -1
  4. package/dist/modules/constraints/abstract.js +1 -1
  5. package/dist/modules/constraints/abstractoperator.js +1 -1
  6. package/dist/modules/constraints/andoperator.js +1 -1
  7. package/dist/modules/constraints/invalid.js +1 -1
  8. package/dist/modules/constraints/isarray.js +1 -1
  9. package/dist/modules/constraints/isobject.js +1 -1
  10. package/dist/modules/constraints/namespace.js +1 -1
  11. package/dist/modules/constraints/oroperator.js +1 -1
  12. package/dist/modules/constraints/valid.js +1 -1
  13. package/dist/modules/data/buildmap.js +2 -2
  14. package/dist/modules/data/buildtree.js +2 -2
  15. package/dist/modules/data/datasource/namespace.js +1 -1
  16. package/dist/modules/data/datasource/restapi/writeerror.js +1 -1
  17. package/dist/modules/data/datasource/restapi.js +2 -2
  18. package/dist/modules/data/datasource/storage/localstorage.js +1 -1
  19. package/dist/modules/data/datasource/storage/namespace.js +1 -1
  20. package/dist/modules/data/datasource/storage/sessionstorage.js +1 -1
  21. package/dist/modules/data/datasource/storage.js +1 -1
  22. package/dist/modules/data/datasource.js +1 -1
  23. package/dist/modules/data/diff.js +2 -2
  24. package/dist/modules/data/extend.js +1 -1
  25. package/dist/modules/data/namespace.js +1 -1
  26. package/dist/modules/data/pathfinder.js +2 -2
  27. package/dist/modules/data/pipe.js +1 -1
  28. package/dist/modules/data/transformer.js +2 -2
  29. package/dist/modules/dom/assembler.js +1 -1
  30. package/dist/modules/dom/attributes.js +2 -2
  31. package/dist/modules/dom/constants.js +2 -2
  32. package/dist/modules/dom/customcontrol.js +1 -1
  33. package/dist/modules/dom/customelement.js +2 -2
  34. package/dist/modules/dom/events.js +1 -1
  35. package/dist/modules/dom/focusmanager.js +1 -1
  36. package/dist/modules/dom/locale.js +1 -1
  37. package/dist/modules/dom/namespace.js +1 -1
  38. package/dist/modules/dom/resource/data.js +1 -1
  39. package/dist/modules/dom/resource/link/stylesheet.js +1 -1
  40. package/dist/modules/dom/resource/link.js +1 -1
  41. package/dist/modules/dom/resource/script.js +1 -1
  42. package/dist/modules/dom/resource.js +1 -1
  43. package/dist/modules/dom/resourcemanager.js +2 -2
  44. package/dist/modules/dom/template.js +2 -2
  45. package/dist/modules/dom/theme.js +1 -1
  46. package/dist/modules/dom/updater.js +2 -2
  47. package/dist/modules/dom/util.js +1 -1
  48. package/dist/modules/dom/worker/factory.js +2 -2
  49. package/dist/modules/i18n/formatter.js +2 -2
  50. package/dist/modules/i18n/locale.js +1 -1
  51. package/dist/modules/i18n/namespace.js +1 -1
  52. package/dist/modules/i18n/provider.js +1 -1
  53. package/dist/modules/i18n/providers/fetch.js +1 -1
  54. package/dist/modules/i18n/providers/namespace.js +1 -1
  55. package/dist/modules/i18n/translations.js +1 -1
  56. package/dist/modules/logging/handler/console.js +1 -1
  57. package/dist/modules/logging/handler/namespace.js +1 -1
  58. package/dist/modules/logging/handler.js +1 -1
  59. package/dist/modules/logging/logentry.js +1 -1
  60. package/dist/modules/logging/logger.js +1 -1
  61. package/dist/modules/logging/namespace.js +1 -1
  62. package/dist/modules/math/namespace.js +1 -1
  63. package/dist/modules/math/random.js +2 -2
  64. package/dist/modules/monster.js +1 -1
  65. package/dist/modules/namespace.js +1 -1
  66. package/dist/modules/text/formatter.js +2 -2
  67. package/dist/modules/text/namespace.js +1 -1
  68. package/dist/modules/types/base.js +1 -1
  69. package/dist/modules/types/basewithoptions.js +2 -2
  70. package/dist/modules/types/binary.js +1 -1
  71. package/dist/modules/types/dataurl.js +2 -2
  72. package/dist/modules/types/global.js +1 -1
  73. package/dist/modules/types/id.js +2 -2
  74. package/dist/modules/types/is.js +1 -1
  75. package/dist/modules/types/mediatype.js +2 -2
  76. package/dist/modules/types/namespace.js +1 -1
  77. package/dist/modules/types/node.js +1 -1
  78. package/dist/modules/types/nodelist.js +1 -1
  79. package/dist/modules/types/noderecursiveiterator.js +1 -1
  80. package/dist/modules/types/observer.js +1 -1
  81. package/dist/modules/types/observerlist.js +1 -1
  82. package/dist/modules/types/proxyobserver.js +2 -2
  83. package/dist/modules/types/queue.js +1 -1
  84. package/dist/modules/types/randomid.js +1 -1
  85. package/dist/modules/types/regex.js +1 -1
  86. package/dist/modules/types/stack.js +1 -1
  87. package/dist/modules/types/tokenlist.js +1 -1
  88. package/dist/modules/types/typeof.js +1 -1
  89. package/dist/modules/types/uniquequeue.js +2 -2
  90. package/dist/modules/types/uuid.js +2 -2
  91. package/dist/modules/types/validate.js +1 -1
  92. package/dist/modules/types/version.js +2 -2
  93. package/dist/modules/util/clone.js +1 -1
  94. package/dist/modules/util/comparator.js +1 -1
  95. package/dist/modules/util/deadmansswitch.js +1 -1
  96. package/dist/modules/util/freeze.js +1 -1
  97. package/dist/modules/util/namespace.js +1 -1
  98. package/dist/modules/util/processing.js +1 -1
  99. package/dist/modules/util/trimspaces.js +2 -2
  100. package/dist/monster.dev.js +394 -255
  101. package/dist/monster.dev.js.map +1 -1
  102. package/dist/monster.js +2 -2
  103. package/package.json +1 -1
  104. package/source/constraints/andoperator.js +5 -5
  105. package/source/constraints/invalid.js +3 -3
  106. package/source/constraints/isarray.js +3 -3
  107. package/source/constraints/isobject.js +3 -3
  108. package/source/constraints/oroperator.js +5 -5
  109. package/source/constraints/valid.js +3 -3
  110. package/source/data/buildmap.js +12 -5
  111. package/source/data/buildtree.js +2 -2
  112. package/source/data/datasource/restapi.js +3 -3
  113. package/source/data/datasource/storage/localstorage.js +2 -2
  114. package/source/data/datasource/storage/sessionstorage.js +2 -2
  115. package/source/data/datasource/storage.js +3 -3
  116. package/source/data/datasource.js +3 -3
  117. package/source/data/diff.js +3 -3
  118. package/source/data/extend.js +2 -2
  119. package/source/data/pathfinder.js +5 -4
  120. package/source/data/pipe.js +3 -3
  121. package/source/data/transformer.js +3 -3
  122. package/source/dom/assembler.js +2 -2
  123. package/source/dom/attributes.js +27 -27
  124. package/source/dom/constants.js +11 -1
  125. package/source/dom/customcontrol.js +1 -1
  126. package/source/dom/customelement.js +137 -31
  127. package/source/dom/events.js +6 -6
  128. package/source/dom/focusmanager.js +2 -2
  129. package/source/dom/locale.js +2 -2
  130. package/source/dom/resource/data.js +2 -2
  131. package/source/dom/resource/link/stylesheet.js +2 -2
  132. package/source/dom/resource/link.js +2 -2
  133. package/source/dom/resource/script.js +2 -2
  134. package/source/dom/resource.js +2 -2
  135. package/source/dom/resourcemanager.js +2 -2
  136. package/source/dom/template.js +5 -5
  137. package/source/dom/theme.js +3 -3
  138. package/source/dom/updater.js +3 -3
  139. package/source/dom/util.js +6 -6
  140. package/source/dom/worker/factory.js +2 -2
  141. package/source/i18n/formatter.js +4 -4
  142. package/source/i18n/locale.js +4 -4
  143. package/source/i18n/provider.js +2 -2
  144. package/source/i18n/providers/fetch.js +3 -3
  145. package/source/i18n/translations.js +4 -4
  146. package/source/logging/handler/console.js +2 -2
  147. package/source/logging/handler.js +2 -2
  148. package/source/logging/logentry.js +2 -2
  149. package/source/logging/logger.js +2 -2
  150. package/source/math/random.js +2 -2
  151. package/source/namespace.js +1 -1
  152. package/source/text/formatter.js +3 -3
  153. package/source/types/base.js +2 -2
  154. package/source/types/basewithoptions.js +2 -2
  155. package/source/types/binary.js +4 -4
  156. package/source/types/dataurl.js +4 -4
  157. package/source/types/global.js +4 -4
  158. package/source/types/id.js +2 -2
  159. package/source/types/is.js +20 -20
  160. package/source/types/mediatype.js +4 -4
  161. package/source/types/node.js +2 -2
  162. package/source/types/nodelist.js +2 -2
  163. package/source/types/noderecursiveiterator.js +4 -4
  164. package/source/types/observer.js +3 -3
  165. package/source/types/observerlist.js +2 -2
  166. package/source/types/proxyobserver.js +5 -5
  167. package/source/types/queue.js +3 -3
  168. package/source/types/randomid.js +2 -2
  169. package/source/types/regex.js +2 -2
  170. package/source/types/stack.js +2 -2
  171. package/source/types/tokenlist.js +2 -2
  172. package/source/types/typeof.js +3 -3
  173. package/source/types/uniquequeue.js +2 -2
  174. package/source/types/uuid.js +2 -2
  175. package/source/types/validate.js +20 -20
  176. package/source/types/version.js +6 -6
  177. package/source/util/clone.js +2 -2
  178. package/source/util/comparator.js +3 -3
  179. package/source/util/deadmansswitch.js +3 -3
  180. package/source/util/freeze.js +2 -2
  181. package/source/util/processing.js +3 -3
  182. package/source/util/trimspaces.js +2 -2
  183. package/test/cases/dom/customelement.js +236 -3
  184. package/test/cases/dom/resource/link.js +3 -5
  185. package/test/cases/monster.js +1 -1
  186. package/test/util/jsdom.js +1 -0
  187. package/test/web/monster-dev.html +3 -3
  188. package/test/web/monster.html +2 -2
  189. package/test/web/test.html +3 -2
  190. package/test/web/tests.js +7 -13
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";import{validateString}from"../types/validate.js";function getDocument(){var t=getGlobal()?.document;if("object"!=typeof t)throw new Error("not supported environment");return t}function getWindow(){var t=getGlobal()?.window;if("object"!=typeof t)throw new Error("not supported environment");return t}function getDocumentFragmentFromString(t){validateString(t);const e=getDocument(),n=e.createElement("template");return n.innerHTML=t,n.content}assignToNamespace("Monster.DOM",getWindow,getDocument,getDocumentFragmentFromString);export{Monster,getWindow,getDocument,getDocumentFragmentFromString};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{internalSymbol}from"../../constants.js";import{assignToNamespace,Monster}from"../../namespace.js";import{Base}from"../../types/base.js";import{getGlobal,getGlobalFunction}from"../../types/global.js";import{isFunction}from"../../types/is.js";import{validateInstance,validateString}from"../../types/validate.js";class Factory extends Base{constructor(){super(),this[internalSymbol]={worker:new WeakMap}}createFromURL=function(t,e,r){t instanceof URL&&(t=t.toString());const o=getGlobalFunction("Worker");var n=new o(validateString(t));return isFunction(e)&&(n.onmessage=t=>{e.call(n,t)}),isFunction(r)&&(n.onerror=t=>{r.call(n,t)}),n};createFromScript=function(t,e,r){const o=new getGlobalFunction("Blob");t=new o([validateString(t)],{type:"script/javascript"}),t=getGlobalFunction("URL").createObjectURL(t),r=this.createFromURL(t,e,r);return this[internalSymbol].worker.set(r,t),r};terminate(t){var e=getGlobalFunction("Worker");return validateInstance(t,e),t.terminate(),this[internalSymbol].worker.has(t)&&(t=this[internalSymbol].worker.get(t),URL.revokeObjectURL(t)),this}}assignToNamespace("Monster.DOM.Worker",Factory);export{Monster,Factory};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{internalSymbol}from"../../constants.js";import{assignToNamespace,Monster}from"../../namespace.js";import{Base}from"../../types/base.js";import{getGlobal,getGlobalFunction}from"../../types/global.js";import{isFunction}from"../../types/is.js";import{validateInstance,validateString}from"../../types/validate.js";class Factory extends Base{constructor(){super(),this[internalSymbol]={worker:new WeakMap}}createFromURL=function(t,e,r){t instanceof URL&&(t=t.toString());const o=getGlobalFunction("Worker");var n=new o(validateString(t));return isFunction(e)&&(n.onmessage=t=>{e.call(n,t)}),isFunction(r)&&(n.onerror=t=>{r.call(n,t)}),n};createFromScript=function(t,e,r){const o=new getGlobalFunction("Blob");t=new o([validateString(t)],{type:"script/javascript"}),t=getGlobalFunction("URL").createObjectURL(t),e=this.createFromURL(t,e,r);return this[internalSymbol].worker.set(e,t),e};terminate(t){var e=getGlobalFunction("Worker");return validateInstance(t,e),t.terminate(),this[internalSymbol].worker.has(t)&&(e=this[internalSymbol].worker.get(t),URL.revokeObjectURL(e)),this}}assignToNamespace("Monster.DOM.Worker",Factory);export{Monster,Factory};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{Formatter as TextFormatter}from"../text/formatter.js";import{validateInstance,validateString}from"../types/validate.js";import{Translations}from"./translations.js";const internalTranslationSymbol=Symbol("internalTranslation");class Formatter extends TextFormatter{constructor(t,r,e){super(t,e),this[internalTranslationSymbol]=validateInstance(r,Translations)}get defaults(){const r=this;return extend({},super.defaults,{callbacks:{i18n:t=>r[internalTranslationSymbol].getText(validateString(t))},marker:{open:["i18n{","${"],close:["}"]}})}format(t){validateString(t);var r=this[internalSymbol].marker.open?.[0],e=this[internalSymbol].marker.close?.[0];if(0===t.indexOf(r)){if((t=t.substring(r.length)).indexOf(e)!==t.length-e.length)throw new Error("the closing marker is missing");t=t.substring(0,t.length-e.length)}const n=validateString(t).split("::");var a=n.shift().trim(),t=n.join("::").trim();let s=r+"static:"+a+" | call:i18n";return 0<t.length&&(s+="::"+t),s+=e,super.format(s)}}assignToNamespace("Monster.I18n",Formatter);export{Monster,Formatter};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{Formatter as TextFormatter}from"../text/formatter.js";import{validateInstance,validateString}from"../types/validate.js";import{Translations}from"./translations.js";const internalTranslationSymbol=Symbol("internalTranslation");class Formatter extends TextFormatter{constructor(t,r,e){super(t,e),this[internalTranslationSymbol]=validateInstance(r,Translations)}get defaults(){const r=this;return extend({},super.defaults,{callbacks:{i18n:t=>r[internalTranslationSymbol].getText(validateString(t))},marker:{open:["i18n{","${"],close:["}"]}})}format(t){validateString(t);var r=this[internalSymbol].marker.open?.[0],e=this[internalSymbol].marker.close?.[0];if(0===t.indexOf(r)){if((t=t.substring(r.length)).indexOf(e)!==t.length-e.length)throw new Error("the closing marker is missing");t=t.substring(0,t.length-e.length)}const n=validateString(t).split("::");var t=n.shift().trim(),a=n.join("::").trim();let s=r+"static:"+t+" | call:i18n";return 0<a.length&&(s+="::"+a),s+=e,super.format(s)}}assignToNamespace("Monster.I18n",Formatter);export{Monster,Formatter};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateString}from"../types/validate.js";import{clone}from"../util/clone.js";const propertiesSymbol=Symbol("properties"),localeStringSymbol=Symbol("localeString");class Locale extends Base{constructor(e,i,t,o,a,r){super(),this[propertiesSymbol]={language:void 0===e?void 0:validateString(e),script:void 0===t?void 0:validateString(t),region:void 0===i?void 0:validateString(i),variants:void 0===o?void 0:validateString(o),extlang:void 0===a?void 0:validateString(a),privateUse:void 0===r?void 0:validateString(r)};let n=[];if(void 0!==e&&n.push(e),void 0!==t&&n.push(t),void 0!==i&&n.push(i),void 0!==o&&n.push(o),void 0!==a&&n.push(a),void 0!==r&&n.push(r),0===n.length)throw new Error("unsupported locale");this[localeStringSymbol]=n.join("-")}get localeString(){return this[localeStringSymbol]}get language(){return this[propertiesSymbol].language}get region(){return this[propertiesSymbol].region}get script(){return this[propertiesSymbol].script}get variants(){return this[propertiesSymbol].variants}get extlang(){return this[propertiesSymbol].extlang}get privateUse(){return this[propertiesSymbol].privateValue}toString(){return""+this.localeString}getMap(){return clone(this[propertiesSymbol])}}function parseLocale(e){e=validateString(e).replace(/_/g,"-");let i,t,o,a,r,n,l=new RegExp("^(((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+))$"),s;if(null!==(s=l.exec(e))&&s.index===l.lastIndex&&l.lastIndex++,null==s)throw new Error("unsupported locale");return void 0!==s[6]&&(i=s[6],1<(a=i.split("-")).length&&(i=a[0],n=a[1])),void 0!==s[14]&&(t=s[14]),void 0!==s[12]&&(r=s[12]),void 0!==s[16]&&(o=s[16]),new Locale(i,t,r,o,n)}assignToNamespace("Monster.I18n",Locale,parseLocale);export{Monster,Locale,parseLocale};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.I18n";export{namespace};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{Locale}from"./locale.js";import{Translations}from"./translations.js";class Provider extends BaseWithOptions{getTranslations(e){return new Promise((s,o)=>{try{s(new Translations(e))}catch(s){o(s)}})}}assignToNamespace("Monster.I18n",Provider);export{Monster,Provider};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{internalSymbol}from"../../constants.js";import{extend}from"../../data/extend.js";import{assignToNamespace,Monster}from"../../namespace.js";import{Formatter}from"../../text/formatter.js";import{getGlobalFunction}from"../../types/global.js";import{isInstance,isString}from"../../types/is.js";import{validateObject,validateString}from"../../types/validate.js";import{parseLocale}from"../locale.js";import{Provider}from"../provider.js";import{Translations}from"../translations.js";class Fetch extends Provider{constructor(t,e){super(e),isInstance(t,URL)&&(t=t.toString()),void 0===e&&(e={}),validateString(t),this.url=t,this[internalSymbol]=extend({},super.defaults,this.defaults,validateObject(e))}get defaults(){return{fetch:{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrerPolicy:"no-referrer"}}}getTranslations(e){isString(e)&&(e=parseLocale(e));let t=new Formatter(e.getMap());return getGlobalFunction("fetch")(t.format(this.url),this.getOption("fetch",{})).then(t=>t.json()).then(t=>new Translations(e).assignTranslations(t))}}assignToNamespace("Monster.I18n.Providers",Fetch);export{Monster,Fetch};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.I18n.Providers";export{namespace};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isObject,isString}from"../types/is.js";import{validateInstance,validateInteger,validateObject,validateString}from"../types/validate.js";import{Locale,parseLocale}from"./locale.js";class Translations extends Base{constructor(t){super(),isString(t)&&(t=parseLocale(t)),this.locale=validateInstance(t,Locale),this.storage=new Map}getText(t,e){if(!this.storage.has(t)){if(void 0===e)throw new Error("key "+t+" not found");return validateString(e)}var r=this.storage.get(t);return isObject(r)?this.getPluralRuleText(t,"other",e):this.storage.get(t)}getPluralRuleText(t,e,r){if(!this.storage.has(t))return validateString(r);let a=validateObject(this.storage.get(t)),s;if(isString(e))s=e.toLocaleString();else{if(0===(e=validateInteger(e))&&a.hasOwnProperty("zero"))return validateString(a.zero);s=new Intl.PluralRules(this.locale.toString()).select(validateInteger(e))}return a.hasOwnProperty(s)?validateString(a[s]):a.hasOwnProperty(DEFAULT_KEY)?validateString(a[DEFAULT_KEY]):validateString(r)}setText(t,e){if(isString(e)||isObject(e))return this.storage.set(validateString(t),e),this;throw new TypeError("value is not a string or object")}assignTranslations(t){validateObject(t);for(var[e,r]of Object.entries(t))this.setText(e,r);return this}}assignToNamespace("Monster.I18n",Translations);export{Monster,Translations};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../../namespace.js";import{Base}from"../../types/base.js";import{getGlobalObject}from"../../types/global.js";import{Handler}from"../handler.js";import{LogEntry}from"../logentry.js";class ConsoleHandler extends Handler{constructor(){super()}log(o){if(super.log(o)){let e=getGlobalObject("console");return e?(e.log(o.toString()),!0):!1}return!1}}assignToNamespace("Monster.Logging.Handler",ConsoleHandler);export{Monster,ConsoleHandler};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.Logging.Handler";export{namespace};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateInstance,validateInteger}from"../types/validate.js";import{LogEntry}from"./logentry.js";import{ALL,DEBUG,ERROR,FATAL,INFO,OFF,TRACE,WARN}from"./logger.js";class Handler extends Base{constructor(){super(),this.loglevel=OFF}log(e){return validateInstance(e,LogEntry),!(this.loglevel<e.getLogLevel())}setLogLevel(e){return validateInteger(e),this.loglevel=e,this}getLogLevel(){return this.loglevel}setAll(){return this.setLogLevel(ALL),this}setTrace(){return this.setLogLevel(TRACE),this}setDebug(){return this.setLogLevel(DEBUG),this}setInfo(){return this.setLogLevel(INFO),this}setWarn(){return this.setLogLevel(WARN),this}setError(){return this.setLogLevel(ERROR),this}setFatal(){return this.setLogLevel(FATAL),this}setOff(){return this.setLogLevel(OFF),this}}assignToNamespace("Monster.Logging",Handler);export{Monster,Handler};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateInteger}from"../types/validate.js";class LogEntry extends Base{constructor(e,...t){super(),validateInteger(e),this.loglevel=e,this.arguments=t}getLogLevel(){return this.loglevel}getArguments(){return this.arguments}}assignToNamespace("Monster.Logging",LogEntry);export{Monster,LogEntry};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{Handler}from"../logging/handler.js";import{LogEntry}from"../logging/logentry.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateInteger,validateObject,validateString}from"../types/validate.js";const ALL=255,TRACE=64,DEBUG=32,INFO=16,WARN=8,ERROR=4,FATAL=2,OFF=0;class Logger extends Base{constructor(){super(),this.handler=new Set}addHandler(e){if(validateObject(e),!(e instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.add(e),this}removeHandler(e){if(validateObject(e),!(e instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.delete(e),this}logTrace(){return triggerLog.apply(this,[TRACE,...arguments]),this}logDebug(){return triggerLog.apply(this,[DEBUG,...arguments]),this}logInfo(){return triggerLog.apply(this,[INFO,...arguments]),this}logWarn(){return triggerLog.apply(this,[WARN,...arguments]),this}logError(){return triggerLog.apply(this,[ERROR,...arguments]),this}logFatal(){return triggerLog.apply(this,[FATAL,...arguments]),this}getLabel(e){return validateInteger(e),e===ALL?"ALL":e===TRACE?"TRACE":e===DEBUG?"DEBUG":e===INFO?"INFO":e===WARN?"WARN":e===ERROR?"ERROR":e===FATAL?"FATAL":e===OFF?"OFF":"unknown"}getLevel(e){return validateString(e),"ALL"===e?ALL:"TRACE"===e?TRACE:"DEBUG"===e?DEBUG:"INFO"===e?INFO:"WARN"===e?WARN:"ERROR"===e?ERROR:"FATAL"===e?FATAL:"OFF"===e?OFF:0}}function triggerLog(e,...r){var t;for(t of this.handler)t.log(new LogEntry(e,r));return this}assignToNamespace("Monster.Logging",Logger);export{Monster,Logger,ALL,TRACE,DEBUG,INFO,WARN,ERROR,FATAL,OFF};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.Logging";export{namespace};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.Math";export{namespace};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";function random(r,t){if((t=void 0===t?MAX:t)<(r=void 0===r?0:r))throw new Error("max must be greater than min");return Math.round(create(r,t))}var MAX=1e9;function create(r,t){let e;var o=getGlobal();if(e=o?.crypto||o?.msCrypto||o?.crypto||void 0,void 0===e)throw new Error("missing crypt");let a=0;var n=t-r;if(n<2)throw new Error("the distance is too small to create a random number.");o=Math.ceil(Math.log2(n));if(53<o)throw new Error("we cannot generate numbers larger than 53 bits.");var i=Math.ceil(o/8),o=Math.pow(2,o)-1,s=new Uint8Array(i);e.getRandomValues(s);let l=8*(i-1);for(var m=0;m<i;m++)a+=s[m]*Math.pow(2,l),l-=8;return a&=o,a>=n?create(r,t):(a<r&&(a+=r),a)}Math.log2=Math.log2||function(r){return Math.log(r)/Math.log(2)},assignToNamespace("Monster.Math",random);export{Monster,random};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";function random(r,t){if((t=void 0===t?MAX:t)<(r=void 0===r?0:r))throw new Error("max must be greater than min");return Math.round(create(r,t))}var MAX=1e9;function create(r,t){let e;var o=getGlobal();if(e=o?.crypto||o?.msCrypto||o?.crypto||void 0,void 0===e)throw new Error("missing crypt");let a=0;o=t-r;if(o<2)throw new Error("the distance is too small to create a random number.");var n=Math.ceil(Math.log2(o));if(53<n)throw new Error("we cannot generate numbers larger than 53 bits.");var i=Math.ceil(n/8),n=Math.pow(2,n)-1,s=new Uint8Array(i);e.getRandomValues(s);let l=8*(i-1);for(var m=0;m<i;m++)a+=s[m]*Math.pow(2,l),l-=8;return a&=n,a>=o?create(r,t):(a<r&&(a+=r),a)}Math.log2=Math.log2||function(r){return Math.log(r)/Math.log(2)},assignToNamespace("Monster.Math",random);export{Monster,random};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import"./constants.js";import"./constraints/abstract.js";import"./constraints/abstractoperator.js";import"./constraints/andoperator.js";import"./constraints/invalid.js";import"./constraints/isarray.js";import"./constraints/isobject.js";import"./constraints/oroperator.js";import"./constraints/valid.js";import"./data/buildmap.js";import"./data/diff.js";import"./data/extend.js";import"./data/pathfinder.js";import"./data/pipe.js";import"./data/transformer.js";import"./dom/assembler.js";import"./dom/attributes.js";import"./dom/constants.js";import"./dom/customcontrol.js";import"./dom/customelement.js";import"./dom/events.js";import"./dom/locale.js";import"./dom/template.js";import"./dom/theme.js";import"./dom/updater.js";import"./dom/util.js";import"./i18n/locale.js";import"./i18n/provider.js";import"./i18n/providers/fetch.js";import"./i18n/translations.js";import"./logging/handler.js";import"./logging/handler/console.js";import"./logging/logentry.js";import"./logging/logger.js";import"./math/random.js";import{Monster}from"./namespace.js";import"./text/formatter.js";import"./types/base.js";import"./types/basewithoptions.js";import"./types/global.js";import"./types/id.js";import"./types/is.js";import"./types/observer.js";import"./types/observerlist.js";import"./types/proxyobserver.js";import"./types/queue.js";import"./types/randomid.js";import"./types/stack.js";import"./types/tokenlist.js";import"./types/typeof.js";import"./types/uniquequeue.js";import"./types/validate.js";import"./types/version.js";import"./util/clone.js";import"./util/comparator.js";import"./util/freeze.js";let rootName;try{rootName=Monster.Types.getGlobalObject("__MonsterRootName__")}catch(t){}rootName=rootName||"Monster",Monster.Types.getGlobal()[rootName]=Monster;export{Monster};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";class Namespace{constructor(e){if(void 0===e||"string"!=typeof e)throw new Error("namespace is not a string");this.namespace=e}getNamespace(){return this.namespace}toString(){return this.getNamespace()}}const Monster=new Namespace("Monster");function assignToNamespace(e,...r){let n=namespaceFor(e.split("."));if(0===r.length)throw new Error("no functions have been passed.");for(let e=0,t=r.length;e<t;e++)n[objectName(r[e])]=r[e];return n}function objectName(t){try{if("function"!=typeof t)throw new Error("the first argument is not a function or class.");if(t.hasOwnProperty("name"))return t.name;if("function"==typeof t.toString){let e=t.toString();var r=e.match(/^\s*function\s+([^\s(]+)/);if(Array.isArray(r)&&"string"==typeof r[1])return r[1];var n=e.match(/^\s*class\s+([^\s(]+)/);if(Array.isArray(n)&&"string"==typeof n[1])return n[1]}}catch(e){throw new Error("exception "+e)}throw new Error("the name of the class or function cannot be resolved.")}function namespaceFor(t){let r=Monster,n="Monster";for(let e=0;e<t.length;e++)"Monster"!==t[e]&&(n+="."+t[e],r.hasOwnProperty(t[e])||(r[t[e]]=new Namespace(n)),r=r[t[e]]);return r}assignToNamespace("Monster",assignToNamespace,Namespace);export{Monster,assignToNamespace};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pipe}from"../data/pipe.js";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{isObject,isString}from"../types/is.js";import{validateArray,validateString}from"../types/validate.js";const internalObjectSymbol=Symbol("internalObject"),watchdogSymbol=Symbol("watchdog"),markerOpenIndexSymbol=Symbol("markerOpenIndex"),markerCloseIndexSymbol=Symbol("markercloseIndex"),workingDataSymbol=Symbol("workingData");class Formatter extends BaseWithOptions{constructor(t,e){super(e),this[internalObjectSymbol]=t||{},this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0}get defaults(){return extend({},super.defaults,{marker:{open:["${"],close:["}"]},parameter:{delimiter:"::",assignment:"="},callbacks:{}})}setParameterChars(t,e){return void 0!==t&&(this[internalSymbol].parameter.delimiter=validateString(t)),void 0!==e&&(this[internalSymbol].parameter.assignment=validateString(e)),this}setMarker(t,e){return void 0===e&&(e=t),isString(t)&&(t=[t]),isString(e)&&(e=[e]),this[internalSymbol].marker.open=validateArray(t),this[internalSymbol].marker.close=validateArray(e),this}format(t){return this[watchdogSymbol]=0,this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0,this[workingDataSymbol]={},format.call(this,t)}}function format(t){var e=this;if(e[watchdogSymbol]++,20<this[watchdogSymbol])throw new Error("too deep nesting");var r=e[internalSymbol].marker.open?.[this[markerOpenIndexSymbol]],n=e[internalSymbol].marker.close?.[this[markerCloseIndexSymbol]];if(-1===t.indexOf(r)||-1===t.indexOf(n))return t;n=tokenize.call(this,validateString(t),r,n);return e[internalSymbol].marker.open?.[this[markerOpenIndexSymbol]+1]&&this[markerOpenIndexSymbol]++,e[internalSymbol].marker.close?.[this[markerCloseIndexSymbol]+1]&&this[markerCloseIndexSymbol]++,format.call(e,n)}function tokenize(a,i,o){var s=this;let l=[];for(var m=s[internalSymbol].parameter.assignment,b=s[internalSymbol].parameter.delimiter,d=s[internalSymbol].callbacks;;){var h=a.indexOf(i);if(-1===h){l.push(a);break}0<h&&(l.push(a.substring(0,h)),a=a.substring(h));let t=a.substring(i.length).indexOf(o);-1!==t&&(t+=i.length);h=a.substring(i.length).indexOf(i);if(-1!==h&&(h+=i.length)<t&&(y=tokenize.call(s,a.substring(h),i,o),a=a.substring(0,h)+y,t=a.substring(i.length).indexOf(o),-1!==t&&(t+=i.length)),-1===t)throw new Error("syntax error in formatter template");let e=a.substring(i.length,t),r=e.split(b);h=r.shift();s[workingDataSymbol]=extend({},s[internalObjectSymbol],s[workingDataSymbol]);for(const u of r){var[p,S]=u.split(m);s[workingDataSymbol][p]=S}const f=e.split("|").shift().trim(),k=f.split("::").shift().trim();var y=k.split(".").shift().trim(),y=s[workingDataSymbol]?.[y]?"path:":"static:";let n="";y&&0!==e.indexOf(y)&&0!==e.indexOf("path:")&&0!==e.indexOf("static:")&&(n=y),n+=h;const x=new Pipe(n);if(isObject(d))for(var[g,c]of Object.entries(d))x.setCallback(g,c);l.push(validateString(x.run(s[workingDataSymbol]))),a=a.substring(t+o.length)}return l.join("")}assignToNamespace("Monster.Text",Formatter);export{Monster,Formatter};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pipe}from"../data/pipe.js";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{isObject,isString}from"../types/is.js";import{validateArray,validateString}from"../types/validate.js";const internalObjectSymbol=Symbol("internalObject"),watchdogSymbol=Symbol("watchdog"),markerOpenIndexSymbol=Symbol("markerOpenIndex"),markerCloseIndexSymbol=Symbol("markercloseIndex"),workingDataSymbol=Symbol("workingData");class Formatter extends BaseWithOptions{constructor(t,e){super(e),this[internalObjectSymbol]=t||{},this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0}get defaults(){return extend({},super.defaults,{marker:{open:["${"],close:["}"]},parameter:{delimiter:"::",assignment:"="},callbacks:{}})}setParameterChars(t,e){return void 0!==t&&(this[internalSymbol].parameter.delimiter=validateString(t)),void 0!==e&&(this[internalSymbol].parameter.assignment=validateString(e)),this}setMarker(t,e){return void 0===e&&(e=t),isString(t)&&(t=[t]),isString(e)&&(e=[e]),this[internalSymbol].marker.open=validateArray(t),this[internalSymbol].marker.close=validateArray(e),this}format(t){return this[watchdogSymbol]=0,this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0,this[workingDataSymbol]={},format.call(this,t)}}function format(t){var e=this;if(e[watchdogSymbol]++,20<this[watchdogSymbol])throw new Error("too deep nesting");var r=e[internalSymbol].marker.open?.[this[markerOpenIndexSymbol]],n=e[internalSymbol].marker.close?.[this[markerCloseIndexSymbol]];if(-1===t.indexOf(r)||-1===t.indexOf(n))return t;t=tokenize.call(this,validateString(t),r,n);return e[internalSymbol].marker.open?.[this[markerOpenIndexSymbol]+1]&&this[markerOpenIndexSymbol]++,e[internalSymbol].marker.close?.[this[markerCloseIndexSymbol]+1]&&this[markerCloseIndexSymbol]++,format.call(e,t)}function tokenize(a,i,o){var s=this;let l=[];for(var S=s[internalSymbol].parameter.assignment,y=s[internalSymbol].parameter.delimiter,m=s[internalSymbol].callbacks;;){var b=a.indexOf(i);if(-1===b){l.push(a);break}0<b&&(l.push(a.substring(0,b)),a=a.substring(b));let t=a.substring(i.length).indexOf(o);-1!==t&&(t+=i.length);b=a.substring(i.length).indexOf(i);if(-1!==b&&(b+=i.length)<t&&(d=tokenize.call(s,a.substring(b),i,o),a=a.substring(0,b)+d,t=a.substring(i.length).indexOf(o),-1!==t&&(t+=i.length)),-1===t)throw new Error("syntax error in formatter template");let e=a.substring(i.length,t),r=e.split(y);b=r.shift();s[workingDataSymbol]=extend({},s[internalObjectSymbol],s[workingDataSymbol]);for(const O of r){var[g,c]=O.split(S);s[workingDataSymbol][g]=c}const x=e.split("|").shift().trim(),u=x.split("::").shift().trim();var d=u.split(".").shift().trim(),h=s[workingDataSymbol]?.[d]?"path:":"static:";let n="";h&&0!==e.indexOf(h)&&0!==e.indexOf("path:")&&0!==e.indexOf("static:")&&(n=h),n+=b;const p=new Pipe(n);if(isObject(m))for(var[f,k]of Object.entries(m))p.setCallback(f,k);l.push(validateString(p.run(s[workingDataSymbol]))),a=a.substring(t+o.length)}return l.join("")}assignToNamespace("Monster.Text",Formatter);export{Monster,Formatter};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.Text";export{namespace};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";class Base extends Object{toString(){return JSON.stringify(this)}}assignToNamespace("Monster.Types",Base);export{Monster,Base};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pathfinder}from"../data/pathfinder.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{validateObject}from"./validate.js";class BaseWithOptions extends Base{constructor(t){super(),void 0===t&&(t={}),this[internalSymbol]=extend({},this.defaults,validateObject(t))}get defaults(){return{}}getOption(t,e){let s;try{s=new Pathfinder(this[internalSymbol]).getVia(t)}catch(t){}return void 0===s?e:s}}assignToNamespace("Monster.Types",BaseWithOptions);export{Monster,BaseWithOptions};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pathfinder}from"../data/pathfinder.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{validateObject}from"./validate.js";class BaseWithOptions extends Base{constructor(t){super(),this[internalSymbol]=extend({},this.defaults,validateObject(t=void 0===t?{}:t))}get defaults(){return{}}getOption(t,e){let s;try{s=new Pathfinder(this[internalSymbol]).getVia(t)}catch(t){}return void 0===s?e:s}}assignToNamespace("Monster.Types",BaseWithOptions);export{Monster,BaseWithOptions};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace}from"../namespace.js";import{Monster,validateString}from"./validate.js";function toBinary(t){const e=new Uint16Array(validateString(t).length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);var n=new Uint8Array(e.buffer);let a="";for(let r=0;r<n.byteLength;r++)a+=String.fromCharCode(n[r]);return a}function fromBinary(t){const e=new Uint8Array(validateString(t).length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);var n=new Uint16Array(e.buffer);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return a}assignToNamespace("Monster.Types",toBinary,fromBinary);export{Monster,toBinary,fromBinary};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{assignToNamespace}from"../namespace.js";import{Base,Monster}from"./base.js";import{isString}from"./is.js";import{MediaType,parseMediaType}from"./mediatype.js";import{validateBoolean,validateInstance,validateString}from"./validate.js";const internal=Symbol("internal");class DataUrl extends Base{constructor(t,e,a){super(),isString(e)&&(e=parseMediaType(e)),this[internal]={content:validateString(t),mediatype:validateInstance(e,MediaType),base64:validateBoolean(void 0===a||a)}}get content(){return this[internal].base64?atob(this[internal].content):this[internal].content}get mediatype(){return this[internal].mediatype}toString(){let t=this[internal].content;return t=!0===this[internal].base64?";base64,"+t:","+encodeURIComponent(t),"data:"+this[internal].mediatype.toString()+t}}function parseDataURL(t){if(validateString(t),"data:"!==(t=t.trim()).substring(0,5))throw new TypeError("incorrect or missing data protocol");var e=(t=t.substring(5)).indexOf(",");if(-1===e)throw new TypeError("malformed data url");let a=t.substring(e+1),n=t.substring(0,e).trim(),r="text/plain;charset=US-ASCII",i=!1;return""!==n?(r=n,n.endsWith("base64")?(e=n.lastIndexOf(";"),r=n.substring(0,e),i=!0):a=decodeURIComponent(a),r=parseMediaType(r)):a=decodeURIComponent(a),new DataUrl(a,r,i)}assignToNamespace("Monster.Types",parseDataURL,DataUrl);export{Monster,parseDataURL,DataUrl};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{assignToNamespace}from"../namespace.js";import{Base,Monster}from"./base.js";import{isString}from"./is.js";import{MediaType,parseMediaType}from"./mediatype.js";import{validateBoolean,validateInstance,validateString}from"./validate.js";const internal=Symbol("internal");class DataUrl extends Base{constructor(t,e,a){super(),isString(e)&&(e=parseMediaType(e)),this[internal]={content:validateString(t),mediatype:validateInstance(e,MediaType),base64:validateBoolean(void 0===a||a)}}get content(){return this[internal].base64?atob(this[internal].content):this[internal].content}get mediatype(){return this[internal].mediatype}toString(){let t=this[internal].content;return t=!0===this[internal].base64?";base64,"+t:","+encodeURIComponent(t),"data:"+this[internal].mediatype.toString()+t}}function parseDataURL(t){if(validateString(t),"data:"!==(t=t.trim()).substring(0,5))throw new TypeError("incorrect or missing data protocol");var e=(t=t.substring(5)).indexOf(",");if(-1===e)throw new TypeError("malformed data url");let a=t.substring(e+1),n=t.substring(0,e).trim(),r="text/plain;charset=US-ASCII",i=!1;return""!==n?(r=n,n.endsWith("base64")?(t=n.lastIndexOf(";"),r=n.substring(0,t),i=!0):a=decodeURIComponent(a),r=parseMediaType(r)):a=decodeURIComponent(a),new DataUrl(a,r,i)}assignToNamespace("Monster.Types",parseDataURL,DataUrl);export{Monster,parseDataURL,DataUrl};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{validateFunction,validateObject,validateString}from"./validate.js";let globalReference;function getGlobal(){return globalReference}function getGlobalObject(e){validateString(e);var t=globalReference?.[e];if(void 0===t)throw new Error("the object "+e+" is not defined");return validateObject(t),t}function getGlobalFunction(e){validateString(e);var t=globalReference?.[e];if(void 0===t)throw new Error("the function "+e+" is not defined");return validateFunction(t),t}!function(){if("object"!=typeof globalThis)if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function(){return this},configurable:!0}),"object"==typeof __monster__)return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,globalReference=globalThis;try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction);export{Monster,getGlobal,getGlobalObject,getGlobalFunction};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{validateString}from"./validate.js";let internalCounter=new Map;class ID extends Base{constructor(e){super(),void 0===e&&(e="id"),validateString(e),internalCounter.has(e)||internalCounter.set(e,1);var t=internalCounter.get(e);this.id=e+t,internalCounter.set(e,++t)}toString(){return this.id}}assignToNamespace("Monster.Types",ID);export{Monster,ID};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{validateString}from"./validate.js";let internalCounter=new Map;class ID extends Base{constructor(e){super(),validateString(e=void 0===e?"id":e),internalCounter.has(e)||internalCounter.set(e,1);var t=internalCounter.get(e);this.id=e+t,internalCounter.set(e,++t)}toString(){return this.id}}assignToNamespace("Monster.Types",ID);export{Monster,ID};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";function isIterable(i){return void 0!==i&&(null!==i&&"function"==typeof i?.[Symbol.iterator])}function isPrimitive(i){return null==i||("string"==(i=typeof i)||"number"==i||"boolean"==i||"symbol"==i)}function isSymbol(i){return"symbol"==typeof i}function isBoolean(i){return!0===i||!1===i}function isString(i){return void 0!==i&&"string"==typeof i}function isObject(i){return!isArray(i)&&(!isPrimitive(i)&&"object"==typeof i)}function isInstance(i,n){return!!isObject(i)&&(!!isFunction(n)&&(!!n.hasOwnProperty("prototype")&&i instanceof n))}function isArray(i){return Array.isArray(i)}function isFunction(i){return!isArray(i)&&(!isPrimitive(i)&&"function"==typeof i)}function isInteger(i){return Number.isInteger(i)}assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol);export{Monster,isPrimitive,isBoolean,isString,isObject,isInstance,isArray,isFunction,isIterable,isInteger,isSymbol};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{assignToNamespace}from"../namespace.js";import{Base,Monster}from"./base.js";import{isString}from"./is.js";import{validateArray,validateString}from"./validate.js";const internal=Symbol("internal");class MediaType extends Base{constructor(e,t,r){super(),this[internal]={type:validateString(e).toLowerCase(),subtype:validateString(t).toLowerCase(),parameter:[]},void 0!==r&&(this[internal].parameter=validateArray(r))}get type(){return this[internal].type}get subtype(){return this[internal].subtype}get parameter(){return this[internal].parameter}get parameter(){const r=new Map;return this[internal].parameter.forEach(e=>{let t=e.value;t.startsWith('"')&&t.endsWith('"')&&(t=t.substring(1,t.length-1)),r.set(e.key,t)}),r}toString(){let e=[];for(var t of this[internal].parameter)e.push(t.key+"="+t.value);return this[internal].type+"/"+this[internal].subtype+(0<e.length?";"+e.join(";"):"")}}function parseMediaType(e){var t=/(?<type>[A-Za-z]+|\*)\/(?<subtype>([a-zA-Z0-9.\+_\-]+)|\*|)(?<parameter>\s*;\s*([a-zA-Z0-9]+)\s*(=\s*("?[A-Za-z0-9_\-]+"?))?)*/g.exec(validateString(e))?.groups;if(void 0===t)throw new TypeError("the mimetype can not be parsed");var r=t?.type,e=t?.subtype,t=t?.parameter;if(""===e||""===r)throw new TypeError("blank value is not allowed");return new MediaType(r,e,parseParameter(t))}function parseParameter(e){if(isString(e)){let r=[];return e.split(";").forEach(e=>{var t;""!==(e=e.trim())&&(t=e.split("="),e=validateString(t?.[0]).trim(),t=validateString(t?.[1]).trim(),r.push({key:e,value:t}))}),r}}assignToNamespace("Monster.Types",parseMediaType,MediaType);export{Monster,parseMediaType,MediaType};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{assignToNamespace}from"../namespace.js";import{Base,Monster}from"./base.js";import{isString}from"./is.js";import{validateArray,validateString}from"./validate.js";const internal=Symbol("internal");class MediaType extends Base{constructor(e,t,r){super(),this[internal]={type:validateString(e).toLowerCase(),subtype:validateString(t).toLowerCase(),parameter:[]},void 0!==r&&(this[internal].parameter=validateArray(r))}get type(){return this[internal].type}get subtype(){return this[internal].subtype}get parameter(){return this[internal].parameter}get parameter(){const r=new Map;return this[internal].parameter.forEach(e=>{let t=e.value;t.startsWith('"')&&t.endsWith('"')&&(t=t.substring(1,t.length-1)),r.set(e.key,t)}),r}toString(){let e=[];for(var t of this[internal].parameter)e.push(t.key+"="+t.value);return this[internal].type+"/"+this[internal].subtype+(0<e.length?";"+e.join(";"):"")}}function parseMediaType(e){e=/(?<type>[A-Za-z]+|\*)\/(?<subtype>([a-zA-Z0-9.\+_\-]+)|\*|)(?<parameter>\s*;\s*([a-zA-Z0-9]+)\s*(=\s*("?[A-Za-z0-9_\-]+"?))?)*/g.exec(validateString(e))?.groups;if(void 0===e)throw new TypeError("the mimetype can not be parsed");var t=e?.type,r=e?.subtype,e=e?.parameter;if(""===r||""===t)throw new TypeError("blank value is not allowed");return new MediaType(t,r,parseParameter(e))}function parseParameter(e){if(isString(e)){let r=[];return e.split(";").forEach(e=>{var t;""!==(e=e.trim())&&(e=e.split("="),t=validateString(e?.[0]).trim(),e=validateString(e?.[1]).trim(),r.push({key:t,value:e}))}),r}}assignToNamespace("Monster.Types",parseMediaType,MediaType);export{Monster,parseMediaType,MediaType};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.Types";export{namespace};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isPrimitive}from"./is.js";import{NodeList}from"./nodelist.js";import{validateInstance}from"./validate.js";const internalValueSymbol=Symbol("internalData"),treeStructureSymbol=Symbol("treeStructure");class Node extends Base{constructor(e){super(),this[internalValueSymbol]=e,this[treeStructureSymbol]={parent:null,childNodes:new NodeList,level:0}}get value(){return this[internalValueSymbol]}set value(e){this[internalValueSymbol]=e}get parent(){return this[treeStructureSymbol].parent}get level(){return this[treeStructureSymbol].level}get childNodes(){return this[treeStructureSymbol].childNodes}set childNodes(e){this[treeStructureSymbol].childNodes=validateInstance(e,NodeList),setChildLevelAndParent.call(this,this,1)}appendChild(e){return this[treeStructureSymbol].childNodes.add(validateInstance(e,Node)),e[treeStructureSymbol].parent=this,e[treeStructureSymbol].level=this.level+1,setChildLevelAndParent.call(this,e,1),this}removeChild(e){return this[treeStructureSymbol].childNodes.remove(validateInstance(e,Node)),e[treeStructureSymbol].parent=null,e[treeStructureSymbol].level=0,setChildLevelAndParent.call(this,e,-1),this}hasChildNodes(){return 0<this[treeStructureSymbol].childNodes.length}hasChild(e){return this[treeStructureSymbol].childNodes.has(validateInstance(e,Node))}toString(){let t=[];if(this[internalValueSymbol]){let e=this[internalValueSymbol];isPrimitive(e)||(e=JSON.stringify(this[internalValueSymbol])),t.push(e)}if(!this.hasChildNodes())return t.join("\n");let e=this.childNodes.length,r=0;for(const s of this.childNodes){r++;var l=(e===r?"└":"├").padStart(2*s.level," |");t.push(l+s.toString())}return t.join("\n")}}function setChildLevelAndParent(t,r){const l=this;return t!==this&&(t[treeStructureSymbol].parent=this),t[treeStructureSymbol].childNodes.forEach(function(e){e[treeStructureSymbol].parent=t,e[treeStructureSymbol].level=t[treeStructureSymbol].level+r,setChildLevelAndParent.call(l,e,r)}),this}assignToNamespace("Monster.Types",Node);export{Monster,Node};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isInstance}from"./is.js";import{Node}from"./node.js";import{validateInstance}from"./validate.js";class NodeList extends Set{constructor(e){super();const r=this;if(void 0!==e)if(isArray(e))e.forEach(e=>r.add(e));else if(isInstance(e,NodeList))e.forEach(e=>r.add(e));else{if(!isInstance(e,Node))throw new Error("invalid value type");r.add(e)}}add(e){return super.add(validateInstance(e,Node)),this}remove(e){return super.delete(validateInstance(e,Node)),this}has(e){return super.has(validateInstance(e,Node))}clear(){return super.clear(),this}toArray(){return Array.from(this)}toJSON(){return this.toArray()}toString(){let e=[];for(const r of this.toArray())e.push(r.toString());return e.join("\n")}get length(){return super.size}}assignToNamespace("Monster.Types",NodeList);export{Monster,NodeList};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isInstance}from"./is.js";import{Node}from"./node.js";import{NodeList}from"./nodelist.js";import{validateInstance}from"./validate.js";const isNodeListSymbol=Symbol("isNodeList");class NodeRecursiveIterator extends Base{constructor(s){var e;super(),this[isNodeListSymbol]=!1,isInstance(s,NodeList)&&(e=s,(s=new Node).childNodes=e,this[isNodeListSymbol]=!0),this[internalSymbol]=validateInstance(s,Node)}[Symbol.iterator]=function*(){var s;if(void 0!==this[internalSymbol]&&(!0!==this[isNodeListSymbol]&&(yield this[internalSymbol]),this[internalSymbol].hasChildNodes()))for(s of this[internalSymbol].childNodes)yield*new NodeRecursiveIterator(s)};forEach(s){for(const e of this)s(e);return this}}assignToNamespace("Monster.Types",NodeRecursiveIterator);export{Monster,NodeRecursiveIterator};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isObject}from"./is.js";import{TokenList}from"./tokenlist.js";import{UniqueQueue}from"./uniquequeue.js";class Observer extends Base{constructor(e,...t){if(super(),"function"!=typeof e)throw new Error("observer callback must be a function");this.callback=e,this.arguments=t,this.tags=new TokenList,this.queue=new UniqueQueue}addTag(e){return this.tags.add(e),this}removeTag(e){return this.tags.remove(e),this}getTags(){return this.tags.entries()}hasTag(e){return this.tags.contains(e)}update(e){let i=this;return new Promise(function(s,r){isObject(e)?(i.queue.add(e),setTimeout(()=>{try{if(i.queue.isEmpty())return void s();var t=i.queue.poll();let e=i.callback.apply(t,i.arguments);if(isObject(e)&&e instanceof Promise)return void e.then(s).catch(r);s(e)}catch(e){r(e)}},0)):r("subject must be an object")})}}assignToNamespace("Monster.Types",Observer);export{Monster,Observer};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{Observer}from"./observer.js";import{validateInstance}from"./validate.js";class ObserverList extends Base{constructor(){super(),this.observers=[]}attach(e){return validateInstance(e,Observer),this.observers.push(e),this}detach(e){validateInstance(e,Observer);for(var s=0,r=this.observers.length;s<r;s++)this.observers[s]===e&&this.observers.splice(s,1);return this}contains(e){validateInstance(e,Observer);for(var s=0,r=this.observers.length;s<r;s++)if(this.observers[s]===e)return!0;return!1}notify(e){let s=[],r=0,t=this.observers.length;for(;r<t;r++)s.push(this.observers[r].update(e));return Promise.all(s)}}assignToNamespace("Monster.Types",ObserverList);export{Monster,ObserverList};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isArray,isObject,isPrimitive}from"./is.js";import{Observer}from"./observer.js";import{ObserverList}from"./observerlist.js";import{validateObject}from"./validate.js";import{extend}from"../data/extend.js";class ProxyObserver extends Base{constructor(e){super(),this.realSubject=validateObject(e),this.subject=new Proxy(e,getHandler.call(this)),this.objectMap=new WeakMap,this.objectMap.set(this.realSubject,this.subject),this.proxyMap=new WeakMap,this.proxyMap.set(this.subject,this.realSubject),this.observers=new ObserverList}getSubject(){return this.subject}setSubject(e){let t,r=Object.keys(this.subject);for(t=0;t<r.length;t++)delete this.subject[r[t]];return this.subject=extend(this.subject,e),this}getRealSubject(){return this.realSubject}attachObserver(e){return this.observers.attach(e),this}detachObserver(e){return this.observers.detach(e),this}notifyObservers(){return this.observers.notify(this)}containsObserver(e){return this.observers.contains(e)}}function getHandler(){const n=this,s={get:function(e,t,r){r=Reflect.get(e,t,r);if("symbol"==typeof t)return r;if(isPrimitive(r))return r;if(isArray(r)||isObject(r)){if(n.objectMap.has(r))return n.objectMap.get(r);if(n.proxyMap.has(r))return r;t=new Proxy(r,s);return n.objectMap.set(r,t),n.proxyMap.set(t,r),t}return r},set:function(e,t,r,s){n.proxyMap.has(r)&&(r=n.proxyMap.get(r)),n.proxyMap.has(e)&&(e=n.proxyMap.get(e));let o=Reflect.get(e,t,s);if(n.proxyMap.has(o)&&(o=n.proxyMap.get(o)),o===r)return!0;let i=Reflect.getOwnPropertyDescriptor(e,t);return void 0===i&&(i={writable:!0,enumerable:!0,configurable:!0}),i.value=r,e=Reflect.defineProperty(e,t,i),"symbol"!=typeof t&&n.observers.notify(n),e},deleteProperty:function(e,t){return t in e&&(delete e[t],"symbol"!=typeof t&&n.observers.notify(n),!0)},defineProperty:function(e,t,r){r=Reflect.defineProperty(e,t,r);return"symbol"!=typeof t&&n.observers.notify(n),r},setPrototypeOf:function(e,t){var r=Reflect.setPrototypeOf(object1,t);return"symbol"!=typeof t&&n.observers.notify(n),r}};return s}assignToNamespace("Monster.Types",ProxyObserver);export{Monster,ProxyObserver};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isArray,isObject,isPrimitive}from"./is.js";import{Observer}from"./observer.js";import{ObserverList}from"./observerlist.js";import{validateObject}from"./validate.js";import{extend}from"../data/extend.js";class ProxyObserver extends Base{constructor(e){super(),this.realSubject=validateObject(e),this.subject=new Proxy(e,getHandler.call(this)),this.objectMap=new WeakMap,this.objectMap.set(this.realSubject,this.subject),this.proxyMap=new WeakMap,this.proxyMap.set(this.subject,this.realSubject),this.observers=new ObserverList}getSubject(){return this.subject}setSubject(e){let t,r=Object.keys(this.subject);for(t=0;t<r.length;t++)delete this.subject[r[t]];return this.subject=extend(this.subject,e),this}getRealSubject(){return this.realSubject}attachObserver(e){return this.observers.attach(e),this}detachObserver(e){return this.observers.detach(e),this}notifyObservers(){return this.observers.notify(this)}containsObserver(e){return this.observers.contains(e)}}function getHandler(){const a=this,s={get:function(e,t,r){e=Reflect.get(e,t,r);return"symbol"!=typeof t&&!isPrimitive(e)&&(isArray(e)||isObject(e))?a.objectMap.has(e)?a.objectMap.get(e):a.proxyMap.has(e)?e:(r=new Proxy(e,s),a.objectMap.set(e,r),a.proxyMap.set(r,e),r):e},set:function(e,t,r,s){a.proxyMap.has(r)&&(r=a.proxyMap.get(r)),a.proxyMap.has(e)&&(e=a.proxyMap.get(e));let o=Reflect.get(e,t,s);if(a.proxyMap.has(o)&&(o=a.proxyMap.get(o)),o===r)return!0;let i=Reflect.getOwnPropertyDescriptor(e,t);return void 0===i&&(i={writable:!0,enumerable:!0,configurable:!0}),i.value=r,s=Reflect.defineProperty(e,t,i),"symbol"!=typeof t&&a.observers.notify(a),s},deleteProperty:function(e,t){return t in e&&(delete e[t],"symbol"!=typeof t&&a.observers.notify(a),!0)},defineProperty:function(e,t,r){e=Reflect.defineProperty(e,t,r);return"symbol"!=typeof t&&a.observers.notify(a),e},setPrototypeOf:function(e,t){var r=Reflect.setPrototypeOf(object1,t);return"symbol"!=typeof t&&a.observers.notify(a),r}};return s}assignToNamespace("Monster.Types",ProxyObserver);export{Monster,ProxyObserver};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Queue extends Base{constructor(){super(),this.data=[]}isEmpty(){return 0===this.data.length}peek(){if(!this.isEmpty())return this.data[0]}add(s){return this.data.push(s),this}clear(){return this.data=[],this}poll(){if(!this.isEmpty())return this.data.shift()}}assignToNamespace("Monster.Types",Queue);export{Monster,Queue};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{random}from"../math/random.js";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"./global.js";import{ID}from"./id.js";let internalCounter=0;class RandomID extends ID{constructor(){super(),internalCounter+=1,this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+internalCounter}}assignToNamespace("Monster.Types",RandomID);export{Monster,RandomID};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{validateString}from"./validate.js";function escapeString(e){return validateString(e).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}assignToNamespace("Monster.Types",escapeString);export{Monster,escapeString};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Stack extends Base{constructor(){super(),this.data=[]}isEmpty(){return 0===this.data.length}peek(){if(!this.isEmpty())return this.data?.[this.data.length-1]}push(t){return this.data.push(t),this}clear(){return this.data=[],this}pop(){if(!this.isEmpty())return this.data.pop()}}assignToNamespace("Monster.Types",Stack);export{Monster,Stack};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isIterable,isString}from"../types/is.js";import{validateFunction,validateString}from"../types/validate.js";import{Base}from"./base.js";class TokenList extends Base{constructor(t){super(),this.tokens=new Set,void 0!==t&&this.add(t)}getIterator(){return this[Symbol.iterator]()}[Symbol.iterator](){let t=0,e=this.entries();return{next:()=>t<e.length?{value:e?.[t++],done:!1}:{done:!0}}}contains(i){if(isString(i)){i=i.trim();let e=0;return i.split(" ").forEach(t=>!1!==this.tokens.has(t.trim())&&void e++),0<e}if(isIterable(i)){let t=0;for(var e of i){if(validateString(e),!1===this.tokens.has(e.trim()))return!1;t++}return 0<t}return!1}add(t){if(isString(t))t.split(" ").forEach(t=>{this.tokens.add(t.trim())});else if(isIterable(t))for(var e of t)validateString(e),this.tokens.add(e.trim());else if(void 0!==t)throw new TypeError("unsupported value");return this}clear(){return this.tokens.clear(),this}remove(t){if(isString(t))t.split(" ").forEach(t=>{this.tokens.delete(t.trim())});else if(isIterable(t))for(var e of t)validateString(e),this.tokens.delete(e.trim());else if(void 0!==t)throw new TypeError("unsupported value","types/tokenlist.js");return this}replace(t,e){if(validateString(t),validateString(e),!this.contains(t))return this;let i=Array.from(this.tokens);t=i.indexOf(t);return-1===t||(i.splice(t,1,e),this.tokens=new Set,this.add(i)),this}toggle(t){if(isString(t))t.split(" ").forEach(t=>{toggleValue.call(this,t)});else if(isIterable(t))for(var e of t)toggleValue.call(this,e);else if(void 0!==t)throw new TypeError("unsupported value","types/tokenlist.js");return this}entries(){return Array.from(this.tokens)}forEach(t){return validateFunction(t),this.tokens.forEach(t),this}toString(){return this.entries().join(" ")}}function toggleValue(t){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(t),t=t.trim(),this.contains(t)?this.remove(t):this.add(t),this}assignToNamespace("Monster.Types",TokenList);export{Monster,TokenList};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";function typeOf(t){let e={}.toString.call(t).match(/\s([a-zA-Z]+)/)[1];return"Object"===e&&(t=/^(class|function)\s+(\w+)/.exec(t.constructor.toString()),e=t&&2<t.length?t[2]:""),e.toLowerCase()}assignToNamespace("Monster.Types",typeOf);export{Monster,typeOf};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Queue}from"./queue.js";import{validateObject}from"./validate.js";class UniqueQueue extends Queue{constructor(){super(),this.unique=new WeakSet}add(e){return validateObject(e),this.unique.has(e)||(this.unique.add(e),super.add(e)),this}clear(){return super.clear(),this.unique=new WeakSet,this}poll(){if(!this.isEmpty()){var e=this.data.shift();return this.unique.delete(e),e}}}assignToNamespace("Monster.Types",UniqueQueue);export{Monster,UniqueQueue};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Queue}from"./queue.js";import{validateObject}from"./validate.js";class UniqueQueue extends Queue{constructor(){super(),this.unique=new WeakSet}add(e){return validateObject(e),this.unique.has(e)||(this.unique.add(e),super.add(e)),this}clear(){return super.clear(),this.unique=new WeakSet,this}poll(){var e;if(!this.isEmpty())return e=this.data.shift(),this.unique.delete(e),e}}assignToNamespace("Monster.Types",UniqueQueue);export{Monster,UniqueQueue};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{internalSymbol}from"../constants.js";import{random}from"../math/random.js";import{assignToNamespace,Monster}from"../namespace.js";import{isObject}from"../types/is.js";import{Base}from"./base.js";import{getGlobalObject}from"./global.js";class UUID extends Base{constructor(){super();let t=createWithCrypto();if(void 0===t&&(t=createWithRandom()),void 0===t)throw new Error("unsupported");this[internalSymbol]={value:t}}toString(){return this[internalSymbol].value}}function createWithRandom(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=16*random(0,65e3)|0;return("x"===t?r:3&r|8).toString(16)[0]})}function createWithCrypto(){const t=getGlobalObject("crypto");isObject(t)&&t}assignToNamespace("Monster.Types",UUID);export{Monster,UUID};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{internalSymbol}from"../constants.js";import{random}from"../math/random.js";import{assignToNamespace,Monster}from"../namespace.js";import{isObject}from"../types/is.js";import{Base}from"./base.js";import{getGlobalObject}from"./global.js";class UUID extends Base{constructor(){super();let t=createWithCrypto();if(void 0===t&&(t=createWithRandom()),void 0===t)throw new Error("unsupported");this[internalSymbol]={value:t}}toString(){return this[internalSymbol].value}}function createWithRandom(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=16*random(0,65e3)|0;return("x"===t?r:3&r|8).toString(16)[0]})}function createWithCrypto(){const t=getGlobalObject("crypto");isObject(t)&&t?.randomUUID}assignToNamespace("Monster.Types",UUID);export{Monster,UUID};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isBoolean,isFunction,isInstance,isInteger,isIterable,isObject,isPrimitive,isString,isSymbol}from"./is.js";function validateIterable(e){if(!isIterable(e))throw new TypeError("value is not iterable");return e}function validatePrimitive(e){if(!isPrimitive(e))throw new TypeError("value is not a primitive");return e}function validateBoolean(e){if(!isBoolean(e))throw new TypeError("value is not a boolean");return e}function validateString(e){if(!isString(e))throw new TypeError("value is not a string");return e}function validateObject(e){if(!isObject(e))throw new TypeError("value is not a object");return e}function validateInstance(e,i){if(isInstance(e,i))return e;{let e="";throw(isObject(i)||isFunction(i))&&(e=i?.name),e=e&&" "+e,new TypeError("value is not an instance of"+e)}}function validateArray(e){if(!isArray(e))throw new TypeError("value is not an array");return e}function validateSymbol(e){if(!isSymbol(e))throw new TypeError("value is not an symbol");return e}function validateFunction(e){if(!isFunction(e))throw new TypeError("value is not a function");return e}function validateInteger(e){if(!isInteger(e))throw new TypeError("value is not an integer");return e}assignToNamespace("Monster.Types",validatePrimitive,validateBoolean,validateString,validateObject,validateArray,validateFunction,validateIterable,validateInteger);export{Monster,validatePrimitive,validateBoolean,validateString,validateObject,validateInstance,validateArray,validateFunction,validateIterable,validateInteger,validateSymbol};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Version extends Base{constructor(r,t,e){var s;if(super(),"string"==typeof r&&void 0===t&&void 0===e&&(s=r.toString().split("."),r=parseInt(s[0]||0),t=parseInt(s[1]||0),e=parseInt(s[2]||0)),void 0===r)throw new Error("major version is undefined");if(void 0===t&&(t=0),void 0===e&&(e=0),this.major=parseInt(r),this.minor=parseInt(t),this.patch=parseInt(e),isNaN(this.major))throw new Error("major is not a number");if(isNaN(this.minor))throw new Error("minor is not a number");if(isNaN(this.patch))throw new Error("patch is not a number")}toString(){return this.major+"."+this.minor+"."+this.patch}compareTo(r){if("string"!=typeof(r=r instanceof Version?r.toString():r))throw new Error("type exception");if(r===this.toString())return 0;var t=[this.major,this.minor,this.patch],e=r.split("."),s=Math.max(t.length,e.length);for(let r=0;r<s;r+=1){if(t[r]&&!e[r]&&0<parseInt(t[r])||parseInt(t[r])>parseInt(e[r]))return 1;if(e[r]&&!t[r]&&0<parseInt(e[r])||parseInt(t[r])<parseInt(e[r]))return-1}return 0}}assignToNamespace("Monster.Types",Version);let monsterVersion;function getVersion(){return monsterVersion instanceof Version||(monsterVersion=new Version("1.29.1")),monsterVersion}assignToNamespace("Monster",getVersion);export{Monster,Version,getVersion};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Version extends Base{constructor(r,t,e){var s;if(super(),"string"==typeof r&&void 0===t&&void 0===e&&(s=r.toString().split("."),r=parseInt(s[0]||0),t=parseInt(s[1]||0),e=parseInt(s[2]||0)),void 0===r)throw new Error("major version is undefined");if(void 0===t&&(t=0),void 0===e&&(e=0),this.major=parseInt(r),this.minor=parseInt(t),this.patch=parseInt(e),isNaN(this.major))throw new Error("major is not a number");if(isNaN(this.minor))throw new Error("minor is not a number");if(isNaN(this.patch))throw new Error("patch is not a number")}toString(){return this.major+"."+this.minor+"."+this.patch}compareTo(r){if("string"!=typeof(r=r instanceof Version?r.toString():r))throw new Error("type exception");if(r===this.toString())return 0;var t=[this.major,this.minor,this.patch],e=r.split("."),s=Math.max(t.length,e.length);for(let r=0;r<s;r+=1){if(t[r]&&!e[r]&&0<parseInt(t[r])||parseInt(t[r])>parseInt(e[r]))return 1;if(e[r]&&!t[r]&&0<parseInt(e[r])||parseInt(t[r])<parseInt(e[r]))return-1}return 0}}assignToNamespace("Monster.Types",Version);let monsterVersion;function getVersion(){return monsterVersion instanceof Version||(monsterVersion=new Version("1.30.1")),monsterVersion}assignToNamespace("Monster",getVersion);export{Monster,Version,getVersion};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";import{isArray,isFunction,isObject,isPrimitive}from"../types/is.js";import{typeOf}from"../types/typeof.js";import{validateObject}from"../types/validate.js";function clone(t){if(null===t)return t;if(isPrimitive(t))return t;if(isFunction(t))return t;if(isArray(t)){let e=[];for(var n=0,o=t.length;n<o;n++)e[n]=clone(t[n]);return e}if(isObject(t)){if(t instanceof Date){let e=new Date;return e.setTime(t.getTime()),e}if("undefined"!=typeof Element&&t instanceof Element)return t;if("undefined"!=typeof HTMLDocument&&t instanceof HTMLDocument)return t;if("undefined"!=typeof DocumentFragment&&t instanceof DocumentFragment)return t;if(t===getGlobal())return t;if("undefined"!=typeof globalContext&&t===globalContext)return t;if("undefined"!=typeof window&&t===window)return t;if("undefined"!=typeof document&&t===document)return t;if("undefined"!=typeof navigator&&t===navigator)return t;if("undefined"!=typeof JSON&&t===JSON)return t;try{if(t instanceof Proxy)return t}catch(e){}return cloneObject(t)}throw new Error("unable to clone obj! its type isn't supported.")}function cloneObject(e){validateObject(e);var t,n=e?.constructor;if("function"===typeOf(n)){const r=n?.prototype;if("object"==typeof r&&r.hasOwnProperty("getClone")&&"function"===typeOf(e.getClone))return e.getClone()}let o={};for(t in"function"==typeof e.constructor&&"function"==typeof e.constructor.call&&(o=new e.constructor),e)e.hasOwnProperty(t)&&(isPrimitive(e[t])?o[t]=e[t]:o[t]=clone(e[t]));return o}assignToNamespace("Monster.Util",clone);export{Monster,clone};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isFunction}from"../types/is.js";class Comparator extends Base{constructor(r){if(super(),isFunction(r))this.compare=r;else{if(void 0!==r)throw new TypeError("unsupported type");this.compare=function(r,e){if(typeof r!=typeof e)throw new TypeError("impractical comparison","types/comparator.js");return r===e?0:r<e?-1:1}}}reverse(){const s=this.compare;return this.compare=(r,e)=>s(e,r),this}equal(r,e){return 0===this.compare(r,e)}greaterThan(r,e){return 0<this.compare(r,e)}greaterThanOrEqual(r,e){return this.greaterThan(r,e)||this.equal(r,e)}lessThanOrEqual(r,e){return this.lessThan(r,e)||this.equal(r,e)}lessThan(r,e){return this.compare(r,e)<0}}assignToNamespace("Monster.Util",Comparator);export{Monster,Comparator};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isInteger}from"../types/is.js";import{validateFunction,validateInteger}from"../types/validate.js";class DeadMansSwitch extends Base{constructor(t,e){super(),init.call(this,validateInteger(t),validateFunction(e))}touch(t){if(!0===this[internalSymbol].isAlreadyRun)throw new Error("has already run");if(isInteger(t))this[internalSymbol].delay=t;else if(void 0!==t)throw new Error("unsupported argument");return clearTimeout(this[internalSymbol].timer),initCallback.call(this),this}}function initCallback(){const t=this;t[internalSymbol].timer=setTimeout(()=>{t[internalSymbol].isAlreadyRun=!0,t[internalSymbol].callback()},t[internalSymbol].delay)}function init(t,e){this[internalSymbol]={callback:e,delay:t,isAlreadyRun:!1,timer:void 0},initCallback.call(this)}assignToNamespace("Monster.Util",DeadMansSwitch);export{Monster,DeadMansSwitch};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{validateObject}from"../types/validate.js";function deepFreeze(e){var t;validateObject(e);for(t of Object.getOwnPropertyNames(e)){var r=e[t];e[t]=r&&"object"==typeof r?deepFreeze(r):r}return Object.freeze(e)}assignToNamespace("Monster.Util",deepFreeze);export{Monster,deepFreeze};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.Util";export{namespace};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobalFunction}from"../types/global.js";import{isFunction,isInteger}from"../types/is.js";import{Queue}from"../types/queue.js";import{validateFunction,validateInteger}from"../types/validate.js";class Callback{constructor(e,t){this[internalSymbol]={callback:validateFunction(e),time:validateInteger(t??0)}}run(s){const n=this;return new Promise((e,t)=>{getGlobalFunction("setTimeout")(()=>{try{e(n[internalSymbol].callback(s))}catch(e){t(e)}},n[internalSymbol].time)})}}class Processing extends Base{constructor(){super(),this[internalSymbol]={queue:new Queue};let e=0;for(var[,t]of Object.entries(arguments))if(isInteger(t)&&0<=t)e=t;else{if(!isFunction(t))throw new TypeError("the arguments must be either integer or functions");this[internalSymbol].queue.add(new Callback(t,e))}}add(e,t){return this[internalSymbol].queue.add(new Callback(e,t)),this}run(e){const t=this;return this[internalSymbol].queue.isEmpty()?Promise.resolve(e):this[internalSymbol].queue.poll().run(e).then(e=>t.run(e))}}assignToNamespace("Monster.Util",Processing);export{Monster,Processing};
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{ID}from"../types/id.js";import{isObject}from"../types/is.js";import{validateString}from"../types/validate.js";function trimSpaces(r){validateString(r);let t=new Map;var e;for(e of r.matchAll(/((?<pattern>\\(?<char>.)){1})/gim)){var a,s,i=e?.groups;isObject(i)&&(s=i?.char,(a=i?.pattern)&&s&&(i="__"+(new ID).toString()+"__",t.set(i,s),r=r.replace(a,i)))}return r=r.trim(),t.forEach((t,e)=>{r=r.replace(e,"\\"+t)}),r}assignToNamespace("Monster.Util",trimSpaces);export{Monster,trimSpaces};
1
+ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{ID}from"../types/id.js";import{isObject}from"../types/is.js";import{validateString}from"../types/validate.js";function trimSpaces(r){validateString(r);let t=new Map;var e;for(e of r.matchAll(/((?<pattern>\\(?<char>.)){1})/gim)){var a,s,i=e?.groups;isObject(i)&&(a=i?.pattern,i=i?.char,a&&i&&(s="__"+(new ID).toString()+"__",t.set(s,i),r=r.replace(a,s)))}return r=r.trim(),t.forEach((t,e)=>{r=r.replace(e,"\\"+t)}),r}assignToNamespace("Monster.Util",trimSpaces);export{Monster,trimSpaces};