smoothly 0.3.41 → 0.3.43

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.
@@ -739,7 +739,7 @@ class Listenable {
739
739
  set(value) {
740
740
  var _a;
741
741
  backend[name] = value;
742
- (_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[name]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(value));
742
+ (_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[name]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(backend[name]));
743
743
  },
744
744
  }
745
745
  : {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-879bbabb.js');
6
- const Listenable = require('./Listenable-c8d2f8ef.js');
6
+ const Listenable = require('./Listenable-d0c6deb9.js');
7
7
  const GoogleFont = require('./GoogleFont-6c4f0da1.js');
8
8
  require('./index-de46f836.js');
9
9
 
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-de46f836.js');
6
6
  const index$1 = require('./index-879bbabb.js');
7
- const Listenable = require('./Listenable-c8d2f8ef.js');
7
+ const Listenable = require('./Listenable-d0c6deb9.js');
8
8
  require('./GoogleFont-6c4f0da1.js');
9
9
  const getLanguage = require('./getLanguage-430ecf04.js');
10
10
 
@@ -130,6 +130,8 @@ const SmoothlyAppDemo = class {
130
130
  index$1.redirect("/routing/pathParameter1");
131
131
  } }, "Internal"), index.h("smoothly-button", { style: { "max-width": "300px" }, onClick: () => {
132
132
  index$1.redirect("https://google.com");
133
+ } }, "External"), index.h("smoothly-button", { disabled: true, style: { "max-width": "300px" }, onClick: () => {
134
+ index$1.redirect("https://google.com");
133
135
  } }, "External")), index.h("smoothly-room", { path: /^\/routing\/\w+\/?/, label: "No effect" }, index.h("h2", null, "Regex routing")), index.h("smoothly-room", { path: "old", label: "Old", to: "select" }), index.h("span", { slot: "header", style: { width: "100%", maxWidth: "500px" } }, index.h("smoothly-picker", { label: "All Animals Selected", style: { minWidth: "100px" }, labelSetting: "hide", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, "select-none-name": "Select All", options: [
134
136
  { name: "Big Dog", value: "dog", aliases: ["WOFF"] },
135
137
  { name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew 🐈" },
@@ -21700,7 +21702,7 @@ const SmoothlyInputDemo = class {
21700
21702
  }
21701
21703
  render() {
21702
21704
  return [
21703
- index.h("form", { action: "done", style: { position: "relative" } }, index.h("header", null, index.h("h5", null, "Form")), index.h("main", null, index.h("fieldset", null, index.h("h2", null, "Smoothly Input"), index.h("h3", null, "Card"), index.h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), index.h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), index.h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), index.h("smoothly-input-date", null), index.h("smoothly-input", { type: "date", name: "date" }, "Date"), index.h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), index.h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), index.h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), index.h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), index.h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), index.h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), index.h("h3", null, "Contact"), index.h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), index.h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), index.h("smoothly-input", { type: "password", name: "password" }, "Password"), index.h("smoothly-input", { type: "email", name: "email" }, "Email"), index.h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), index.h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), index.h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), index.h("smoothly-input-date", { name: "some-date" }, "Calendar"), index.h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)")), index.h("fieldset", null, index.h("h2", null, "Smoothly Radio"), index.h("h3", null, "Deselectable Radio List with button"), index.h("smoothly-radio-button", { deselectable: true, decoration: "button" }, index.h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, index.h("span", null, "Option 1"), index.h("span", { slot: "expansion" }, "Some description.")), index.h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, index.h("span", null, "Option 2"), index.h("span", { slot: "expansion" }, "Some other description.")), index.h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, index.h("span", null, "Option 3")), index.h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, index.h("span", null, "Option 4 (Disabled)"))), index.h("h3", null, "Radio List with button"), index.h("smoothly-radio-button", { decoration: "button" }, index.h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, index.h("span", null, "Option 1"), index.h("span", { slot: "expansion" }, "Some description.")), index.h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, index.h("span", null, "Option 2"), index.h("span", { slot: "expansion" }, "Some other description.")), index.h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, index.h("span", null, "Option 3"))), index.h("h3", null, "Radio List ", index.h("b", null, "without button")), index.h("smoothly-radio-button", null, index.h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, index.h("span", null, "Option 1"), index.h("span", { slot: "expansion" }, "Some description.")), index.h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, index.h("span", null, "Option 2"), index.h("span", { slot: "expansion" }, "Some other description.")), index.h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, index.h("span", null, "Option 3"))), index.h("smoothly-radio", { name: "option", value: "1" }, "option 1"), index.h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), index.h("smoothly-radio", { name: "option", value: "3" }, "option 3")), index.h("fieldset", null, index.h("h2", null, "Smoothly Accordion"), index.h("smoothly-accordion", null, index.h("smoothly-accordion-item", { name: "A", open: true }, index.h("smoothly-radio", { name: "a", value: "1" }, "a 1"), index.h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), index.h("smoothly-radio", { name: "a", value: "3" }, "a 3")), index.h("smoothly-accordion-item", { name: "B" }, index.h("smoothly-radio", { name: "b", value: "1" }, "b 1"), index.h("smoothly-radio", { name: "b", value: "2" }, "b 2"), index.h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), index.h("fieldset", null, index.h("h2", null, "Smoothly checkbox"), index.h("smoothly-checkbox", { selectAll: true, intermediate: true }), index.h("smoothly-checkbox", null), index.h("smoothly-checkbox", { disabled: true })), index.h("fieldset", null, index.h("h2", null, "Smoothly addresses"), index.h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), index.h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), index.h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), index.h("footer", null, index.h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), index.h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
21705
+ index.h("form", { action: "done", style: { position: "relative" } }, index.h("header", null, index.h("h5", null, "Form")), index.h("main", null, index.h("fieldset", null, index.h("h2", null, "Smoothly Input"), index.h("h3", null, "Card"), index.h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), index.h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), index.h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), index.h("smoothly-input-date", null), index.h("smoothly-input", { type: "date", name: "date" }, "Date"), index.h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), index.h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), index.h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), index.h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), index.h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), index.h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), index.h("h3", null, "Contact"), index.h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), index.h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), index.h("smoothly-input", { type: "password", name: "password" }, "Password"), index.h("smoothly-input", { type: "email", name: "email" }, "Email"), index.h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), index.h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), index.h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), index.h("smoothly-input-date", { name: "some-date" }, "Calendar"), index.h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)")), index.h("fieldset", null, index.h("h2", null, "Smoothly Radio"), index.h("h3", null, "Deselectable Radio List with button"), index.h("smoothly-radio-button", { deselectable: true, decoration: "button" }, index.h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, index.h("span", null, "Option 1"), index.h("span", { slot: "expansion" }, "Some description.")), index.h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, index.h("span", null, "Option 2"), index.h("span", { slot: "expansion" }, "Some other description.")), index.h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, index.h("span", null, "Option 3")), index.h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, index.h("span", null, "Option 4 (Disabled)"))), index.h("h3", null, "Radio List with button"), index.h("smoothly-radio-button", { decoration: "button" }, index.h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, index.h("span", null, "Option 1"), index.h("span", { slot: "expansion" }, "Some description.")), index.h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, index.h("span", null, "Option 2"), index.h("span", { slot: "expansion" }, "Some other description.")), index.h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, index.h("span", null, "Option 3"))), index.h("h3", null, "Radio List ", index.h("b", null, "without button")), index.h("smoothly-radio-button", null, index.h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, index.h("span", null, "Option 1"), index.h("span", { slot: "expansion" }, "Some description.")), index.h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, index.h("span", null, "Option 2"), index.h("span", { slot: "expansion" }, "Some other description.")), index.h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, index.h("span", null, "Option 3"))), index.h("smoothly-radio", { name: "option", value: "1" }, "option 1"), index.h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), index.h("smoothly-radio", { name: "option", value: "3" }, "option 3")), index.h("fieldset", null, index.h("h2", null, "Smoothly Accordion"), index.h("smoothly-accordion", null, index.h("smoothly-accordion-item", { name: "A", open: true }, index.h("smoothly-radio", { name: "a", value: "1" }, "a 1"), index.h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), index.h("smoothly-radio", { name: "a", value: "3" }, "a 3")), index.h("smoothly-accordion-item", { name: "B" }, index.h("smoothly-radio", { name: "b", value: "1" }, "b 1"), index.h("smoothly-radio", { name: "b", value: "2" }, "b 2"), index.h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), index.h("fieldset", null, index.h("h2", null, "Smoothly checkbox"), index.h("smoothly-checkbox", { selectAll: true, intermediate: true }), index.h("smoothly-checkbox", null), index.h("smoothly-checkbox", { disabled: true })), index.h("fieldset", null, index.h("h2", null, "Smoothly addresses"), index.h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), index.h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), index.h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), index.h("footer", null, index.h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), index.h("smoothly-submit", { disabled: true, expand: "block", onClick: e => console.log(e), onSubmit: (e) => alert(e), color: "success" }, "Submit"), index.h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
21704
21706
  index.h("smoothly-backtotop", null),
21705
21707
  ];
21706
21708
  }
@@ -22687,6 +22689,9 @@ const SmoothlySubmit = class {
22687
22689
  this.processing = false;
22688
22690
  }
22689
22691
  }
22692
+ handleClick(e) {
22693
+ this.disabled && e.stopImmediatePropagation();
22694
+ }
22690
22695
  async submit() {
22691
22696
  let result;
22692
22697
  if ((result = !!this.form))
@@ -22694,10 +22699,7 @@ const SmoothlySubmit = class {
22694
22699
  return result;
22695
22700
  }
22696
22701
  render() {
22697
- return [
22698
- index.h("smoothly-spinner", { active: this.processing }),
22699
- index.h("button", { type: "submit", disabled: this.disabled || this.processing, ref: (element) => (this.button = element) }, index.h("slot", null)),
22700
- ];
22702
+ return (index.h(index.Host, { onClick: (e) => this.handleClick(e) }, index.h("smoothly-spinner", { active: this.processing }), index.h("button", { type: "submit", disabled: this.disabled || this.processing, ref: (element) => (this.button = element) }, index.h("slot", null))));
22701
22703
  }
22702
22704
  };
22703
22705
  function hasNameAndValue(element) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-de46f836.js');
6
- const Listenable = require('./Listenable-c8d2f8ef.js');
6
+ const Listenable = require('./Listenable-d0c6deb9.js');
7
7
  require('./GoogleFont-6c4f0da1.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-de46f836.js');
6
- const Listenable = require('./Listenable-c8d2f8ef.js');
6
+ const Listenable = require('./Listenable-d0c6deb9.js');
7
7
  require('./GoogleFont-6c4f0da1.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";
@@ -10,6 +10,8 @@ export class SmoothlyAppDemo {
10
10
  redirect("/routing/pathParameter1");
11
11
  } }, "Internal"), h("smoothly-button", { style: { "max-width": "300px" }, onClick: () => {
12
12
  redirect("https://google.com");
13
+ } }, "External"), h("smoothly-button", { disabled: true, style: { "max-width": "300px" }, onClick: () => {
14
+ redirect("https://google.com");
13
15
  } }, "External")), h("smoothly-room", { path: /^\/routing\/\w+\/?/, label: "No effect" }, h("h2", null, "Regex routing")), h("smoothly-room", { path: "old", label: "Old", to: "select" }), h("span", { slot: "header", style: { width: "100%", maxWidth: "500px" } }, h("smoothly-picker", { label: "All Animals Selected", style: { minWidth: "100px" }, labelSetting: "hide", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, "select-none-name": "Select All", options: [
14
16
  { name: "Big Dog", value: "dog", aliases: ["WOFF"] },
15
17
  { name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew 🐈" },
@@ -2,7 +2,7 @@ import { h } from "@stencil/core";
2
2
  export class SmoothlyInputDemo {
3
3
  render() {
4
4
  return [
5
- h("form", { action: "done", style: { position: "relative" } }, h("header", null, h("h5", null, "Form")), h("main", null, h("fieldset", null, h("h2", null, "Smoothly Input"), h("h3", null, "Card"), h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input-date", null), h("smoothly-input", { type: "date", name: "date" }, "Date"), h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), h("h3", null, "Contact"), h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), h("smoothly-input", { type: "password", name: "password" }, "Password"), h("smoothly-input", { type: "email", name: "email" }, "Email"), h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), h("smoothly-input-date", { name: "some-date" }, "Calendar"), h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)")), h("fieldset", null, h("h2", null, "Smoothly Radio"), h("h3", null, "Deselectable Radio List with button"), h("smoothly-radio-button", { deselectable: true, decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, h("span", null, "Option 3")), h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, h("span", null, "Option 4 (Disabled)"))), h("h3", null, "Radio List with button"), h("smoothly-radio-button", { decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, h("span", null, "Option 3"))), h("h3", null, "Radio List ", h("b", null, "without button")), h("smoothly-radio-button", null, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, h("span", null, "Option 3"))), h("smoothly-radio", { name: "option", value: "1" }, "option 1"), h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), h("smoothly-radio", { name: "option", value: "3" }, "option 3")), h("fieldset", null, h("h2", null, "Smoothly Accordion"), h("smoothly-accordion", null, h("smoothly-accordion-item", { name: "A", open: true }, h("smoothly-radio", { name: "a", value: "1" }, "a 1"), h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), h("smoothly-radio", { name: "a", value: "3" }, "a 3")), h("smoothly-accordion-item", { name: "B" }, h("smoothly-radio", { name: "b", value: "1" }, "b 1"), h("smoothly-radio", { name: "b", value: "2" }, "b 2"), h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), h("fieldset", null, h("h2", null, "Smoothly checkbox"), h("smoothly-checkbox", { selectAll: true, intermediate: true }), h("smoothly-checkbox", null), h("smoothly-checkbox", { disabled: true })), h("fieldset", null, h("h2", null, "Smoothly addresses"), h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), h("footer", null, h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
5
+ h("form", { action: "done", style: { position: "relative" } }, h("header", null, h("h5", null, "Form")), h("main", null, h("fieldset", null, h("h2", null, "Smoothly Input"), h("h3", null, "Card"), h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input-date", null), h("smoothly-input", { type: "date", name: "date" }, "Date"), h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), h("h3", null, "Contact"), h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), h("smoothly-input", { type: "password", name: "password" }, "Password"), h("smoothly-input", { type: "email", name: "email" }, "Email"), h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), h("smoothly-input-date", { name: "some-date" }, "Calendar"), h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)")), h("fieldset", null, h("h2", null, "Smoothly Radio"), h("h3", null, "Deselectable Radio List with button"), h("smoothly-radio-button", { deselectable: true, decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, h("span", null, "Option 3")), h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, h("span", null, "Option 4 (Disabled)"))), h("h3", null, "Radio List with button"), h("smoothly-radio-button", { decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, h("span", null, "Option 3"))), h("h3", null, "Radio List ", h("b", null, "without button")), h("smoothly-radio-button", null, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, h("span", null, "Option 3"))), h("smoothly-radio", { name: "option", value: "1" }, "option 1"), h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), h("smoothly-radio", { name: "option", value: "3" }, "option 3")), h("fieldset", null, h("h2", null, "Smoothly Accordion"), h("smoothly-accordion", null, h("smoothly-accordion-item", { name: "A", open: true }, h("smoothly-radio", { name: "a", value: "1" }, "a 1"), h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), h("smoothly-radio", { name: "a", value: "3" }, "a 3")), h("smoothly-accordion-item", { name: "B" }, h("smoothly-radio", { name: "b", value: "1" }, "b 1"), h("smoothly-radio", { name: "b", value: "2" }, "b 2"), h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), h("fieldset", null, h("h2", null, "Smoothly checkbox"), h("smoothly-checkbox", { selectAll: true, intermediate: true }), h("smoothly-checkbox", null), h("smoothly-checkbox", { disabled: true })), h("fieldset", null, h("h2", null, "Smoothly addresses"), h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), h("footer", null, h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-submit", { disabled: true, expand: "block", onClick: e => console.log(e), onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
6
6
  h("smoothly-backtotop", null),
7
7
  ];
8
8
  }
@@ -1,4 +1,4 @@
1
- import { h } from "@stencil/core";
1
+ import { h, Host } from "@stencil/core";
2
2
  import { Data } from "./Data";
3
3
  export class SmoothlySubmit {
4
4
  constructor() {
@@ -36,6 +36,9 @@ export class SmoothlySubmit {
36
36
  this.processing = false;
37
37
  }
38
38
  }
39
+ handleClick(e) {
40
+ this.disabled && e.stopImmediatePropagation();
41
+ }
39
42
  async submit() {
40
43
  let result;
41
44
  if ((result = !!this.form))
@@ -43,10 +46,7 @@ export class SmoothlySubmit {
43
46
  return result;
44
47
  }
45
48
  render() {
46
- return [
47
- h("smoothly-spinner", { active: this.processing }),
48
- h("button", { type: "submit", disabled: this.disabled || this.processing, ref: (element) => (this.button = element) }, h("slot", null)),
49
- ];
49
+ return (h(Host, { onClick: (e) => this.handleClick(e) }, h("smoothly-spinner", { active: this.processing }), h("button", { type: "submit", disabled: this.disabled || this.processing, ref: (element) => (this.button = element) }, h("slot", null))));
50
50
  }
51
51
  static get is() { return "smoothly-submit"; }
52
52
  static get encapsulation() { return "scoped"; }
@@ -40,7 +40,7 @@ export class Listenable {
40
40
  set(value) {
41
41
  var _a;
42
42
  backend[name] = value;
43
- (_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[name]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(value));
43
+ (_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[name]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(backend[name]));
44
44
  },
45
45
  }
46
46
  : {
@@ -1264,7 +1264,7 @@ class Listenable {
1264
1264
  set(value) {
1265
1265
  var _a;
1266
1266
  backend[name] = value;
1267
- (_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[name]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(value));
1267
+ (_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[name]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(backend[name]));
1268
1268
  },
1269
1269
  }
1270
1270
  : {
@@ -1774,6 +1774,8 @@ const SmoothlyAppDemo$1 = class extends HTMLElement {
1774
1774
  redirect("/routing/pathParameter1");
1775
1775
  } }, "Internal"), h("smoothly-button", { style: { "max-width": "300px" }, onClick: () => {
1776
1776
  redirect("https://google.com");
1777
+ } }, "External"), h("smoothly-button", { disabled: true, style: { "max-width": "300px" }, onClick: () => {
1778
+ redirect("https://google.com");
1777
1779
  } }, "External")), h("smoothly-room", { path: /^\/routing\/\w+\/?/, label: "No effect" }, h("h2", null, "Regex routing")), h("smoothly-room", { path: "old", label: "Old", to: "select" }), h("span", { slot: "header", style: { width: "100%", maxWidth: "500px" } }, h("smoothly-picker", { label: "All Animals Selected", style: { minWidth: "100px" }, labelSetting: "hide", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, "select-none-name": "Select All", options: [
1778
1780
  { name: "Big Dog", value: "dog", aliases: ["WOFF"] },
1779
1781
  { name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew 🐈" },
@@ -47322,7 +47324,7 @@ const SmoothlyInputDemo$1 = class extends HTMLElement {
47322
47324
  }
47323
47325
  render() {
47324
47326
  return [
47325
- h("form", { action: "done", style: { position: "relative" } }, h("header", null, h("h5", null, "Form")), h("main", null, h("fieldset", null, h("h2", null, "Smoothly Input"), h("h3", null, "Card"), h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input-date", null), h("smoothly-input", { type: "date", name: "date" }, "Date"), h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), h("h3", null, "Contact"), h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), h("smoothly-input", { type: "password", name: "password" }, "Password"), h("smoothly-input", { type: "email", name: "email" }, "Email"), h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), h("smoothly-input-date", { name: "some-date" }, "Calendar"), h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)")), h("fieldset", null, h("h2", null, "Smoothly Radio"), h("h3", null, "Deselectable Radio List with button"), h("smoothly-radio-button", { deselectable: true, decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, h("span", null, "Option 3")), h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, h("span", null, "Option 4 (Disabled)"))), h("h3", null, "Radio List with button"), h("smoothly-radio-button", { decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, h("span", null, "Option 3"))), h("h3", null, "Radio List ", h("b", null, "without button")), h("smoothly-radio-button", null, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, h("span", null, "Option 3"))), h("smoothly-radio", { name: "option", value: "1" }, "option 1"), h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), h("smoothly-radio", { name: "option", value: "3" }, "option 3")), h("fieldset", null, h("h2", null, "Smoothly Accordion"), h("smoothly-accordion", null, h("smoothly-accordion-item", { name: "A", open: true }, h("smoothly-radio", { name: "a", value: "1" }, "a 1"), h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), h("smoothly-radio", { name: "a", value: "3" }, "a 3")), h("smoothly-accordion-item", { name: "B" }, h("smoothly-radio", { name: "b", value: "1" }, "b 1"), h("smoothly-radio", { name: "b", value: "2" }, "b 2"), h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), h("fieldset", null, h("h2", null, "Smoothly checkbox"), h("smoothly-checkbox", { selectAll: true, intermediate: true }), h("smoothly-checkbox", null), h("smoothly-checkbox", { disabled: true })), h("fieldset", null, h("h2", null, "Smoothly addresses"), h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), h("footer", null, h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
47327
+ h("form", { action: "done", style: { position: "relative" } }, h("header", null, h("h5", null, "Form")), h("main", null, h("fieldset", null, h("h2", null, "Smoothly Input"), h("h3", null, "Card"), h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input-date", null), h("smoothly-input", { type: "date", name: "date" }, "Date"), h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), h("h3", null, "Contact"), h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), h("smoothly-input", { type: "password", name: "password" }, "Password"), h("smoothly-input", { type: "email", name: "email" }, "Email"), h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), h("smoothly-input-date", { name: "some-date" }, "Calendar"), h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)")), h("fieldset", null, h("h2", null, "Smoothly Radio"), h("h3", null, "Deselectable Radio List with button"), h("smoothly-radio-button", { deselectable: true, decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, h("span", null, "Option 3")), h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, h("span", null, "Option 4 (Disabled)"))), h("h3", null, "Radio List with button"), h("smoothly-radio-button", { decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, h("span", null, "Option 3"))), h("h3", null, "Radio List ", h("b", null, "without button")), h("smoothly-radio-button", null, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, h("span", null, "Option 3"))), h("smoothly-radio", { name: "option", value: "1" }, "option 1"), h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), h("smoothly-radio", { name: "option", value: "3" }, "option 3")), h("fieldset", null, h("h2", null, "Smoothly Accordion"), h("smoothly-accordion", null, h("smoothly-accordion-item", { name: "A", open: true }, h("smoothly-radio", { name: "a", value: "1" }, "a 1"), h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), h("smoothly-radio", { name: "a", value: "3" }, "a 3")), h("smoothly-accordion-item", { name: "B" }, h("smoothly-radio", { name: "b", value: "1" }, "b 1"), h("smoothly-radio", { name: "b", value: "2" }, "b 2"), h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), h("fieldset", null, h("h2", null, "Smoothly checkbox"), h("smoothly-checkbox", { selectAll: true, intermediate: true }), h("smoothly-checkbox", null), h("smoothly-checkbox", { disabled: true })), h("fieldset", null, h("h2", null, "Smoothly addresses"), h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), h("footer", null, h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-submit", { disabled: true, expand: "block", onClick: e => console.log(e), onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
47326
47328
  h("smoothly-backtotop", null),
47327
47329
  ];
47328
47330
  }
@@ -48442,6 +48444,9 @@ const SmoothlySubmit$1 = class extends HTMLElement {
48442
48444
  this.processing = false;
48443
48445
  }
48444
48446
  }
48447
+ handleClick(e) {
48448
+ this.disabled && e.stopImmediatePropagation();
48449
+ }
48445
48450
  async submit() {
48446
48451
  let result;
48447
48452
  if ((result = !!this.form))
@@ -48449,10 +48454,7 @@ const SmoothlySubmit$1 = class extends HTMLElement {
48449
48454
  return result;
48450
48455
  }
48451
48456
  render() {
48452
- return [
48453
- h("smoothly-spinner", { active: this.processing }),
48454
- h("button", { type: "submit", disabled: this.disabled || this.processing, ref: (element) => (this.button = element) }, h("slot", null)),
48455
- ];
48457
+ return (h(Host, { onClick: (e) => this.handleClick(e) }, h("smoothly-spinner", { active: this.processing }), h("button", { type: "submit", disabled: this.disabled || this.processing, ref: (element) => (this.button = element) }, h("slot", null))));
48456
48458
  }
48457
48459
  static get style() { return styleCss$d; }
48458
48460
  };
@@ -737,7 +737,7 @@ class Listenable {
737
737
  set(value) {
738
738
  var _a;
739
739
  backend[name] = value;
740
- (_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[name]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(value));
740
+ (_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[name]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(backend[name]));
741
741
  },
742
742
  }
743
743
  : {
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { A as App, C as Cosmetic, N as Notice, r as redirect } from './index-d7a4e405.js';
2
- import { I as Identifier } from './Listenable-55a1f6af.js';
3
- export { L as Listenable, M as Message, T as Trigger } from './Listenable-55a1f6af.js';
2
+ import { I as Identifier } from './Listenable-5d2def19.js';
3
+ export { L as Listenable, M as Message, T as Trigger } from './Listenable-5d2def19.js';
4
4
  export { G as GoogleFont } from './GoogleFont-8474516b.js';
5
5
  import './index-d3421c35.js';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, a as getElement, c as createEvent, H as Host } from './index-d3421c35.js';
2
2
  import { r as redirect, A as App, N as Notice } from './index-d7a4e405.js';
3
- import { T as Trigger, M as Message } from './Listenable-55a1f6af.js';
3
+ import { T as Trigger, M as Message } from './Listenable-5d2def19.js';
4
4
  import './GoogleFont-8474516b.js';
5
5
  import { D as Date$1, L as Language, g as getLanguage, a as DateTime, b as Locale, c as Language$1, C as Currency, d as DateRange } from './getLanguage-cccb8418.js';
6
6
 
@@ -126,6 +126,8 @@ const SmoothlyAppDemo = class {
126
126
  redirect("/routing/pathParameter1");
127
127
  } }, "Internal"), h("smoothly-button", { style: { "max-width": "300px" }, onClick: () => {
128
128
  redirect("https://google.com");
129
+ } }, "External"), h("smoothly-button", { disabled: true, style: { "max-width": "300px" }, onClick: () => {
130
+ redirect("https://google.com");
129
131
  } }, "External")), h("smoothly-room", { path: /^\/routing\/\w+\/?/, label: "No effect" }, h("h2", null, "Regex routing")), h("smoothly-room", { path: "old", label: "Old", to: "select" }), h("span", { slot: "header", style: { width: "100%", maxWidth: "500px" } }, h("smoothly-picker", { label: "All Animals Selected", style: { minWidth: "100px" }, labelSetting: "hide", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, "select-none-name": "Select All", options: [
130
132
  { name: "Big Dog", value: "dog", aliases: ["WOFF"] },
131
133
  { name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew 🐈" },
@@ -21696,7 +21698,7 @@ const SmoothlyInputDemo = class {
21696
21698
  }
21697
21699
  render() {
21698
21700
  return [
21699
- h("form", { action: "done", style: { position: "relative" } }, h("header", null, h("h5", null, "Form")), h("main", null, h("fieldset", null, h("h2", null, "Smoothly Input"), h("h3", null, "Card"), h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input-date", null), h("smoothly-input", { type: "date", name: "date" }, "Date"), h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), h("h3", null, "Contact"), h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), h("smoothly-input", { type: "password", name: "password" }, "Password"), h("smoothly-input", { type: "email", name: "email" }, "Email"), h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), h("smoothly-input-date", { name: "some-date" }, "Calendar"), h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)")), h("fieldset", null, h("h2", null, "Smoothly Radio"), h("h3", null, "Deselectable Radio List with button"), h("smoothly-radio-button", { deselectable: true, decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, h("span", null, "Option 3")), h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, h("span", null, "Option 4 (Disabled)"))), h("h3", null, "Radio List with button"), h("smoothly-radio-button", { decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, h("span", null, "Option 3"))), h("h3", null, "Radio List ", h("b", null, "without button")), h("smoothly-radio-button", null, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, h("span", null, "Option 3"))), h("smoothly-radio", { name: "option", value: "1" }, "option 1"), h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), h("smoothly-radio", { name: "option", value: "3" }, "option 3")), h("fieldset", null, h("h2", null, "Smoothly Accordion"), h("smoothly-accordion", null, h("smoothly-accordion-item", { name: "A", open: true }, h("smoothly-radio", { name: "a", value: "1" }, "a 1"), h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), h("smoothly-radio", { name: "a", value: "3" }, "a 3")), h("smoothly-accordion-item", { name: "B" }, h("smoothly-radio", { name: "b", value: "1" }, "b 1"), h("smoothly-radio", { name: "b", value: "2" }, "b 2"), h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), h("fieldset", null, h("h2", null, "Smoothly checkbox"), h("smoothly-checkbox", { selectAll: true, intermediate: true }), h("smoothly-checkbox", null), h("smoothly-checkbox", { disabled: true })), h("fieldset", null, h("h2", null, "Smoothly addresses"), h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), h("footer", null, h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
21701
+ h("form", { action: "done", style: { position: "relative" } }, h("header", null, h("h5", null, "Form")), h("main", null, h("fieldset", null, h("h2", null, "Smoothly Input"), h("h3", null, "Card"), h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input-date", null), h("smoothly-input", { type: "date", name: "date" }, "Date"), h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), h("h3", null, "Contact"), h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), h("smoothly-input", { type: "password", name: "password" }, "Password"), h("smoothly-input", { type: "email", name: "email" }, "Email"), h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), h("smoothly-input-date", { name: "some-date" }, "Calendar"), h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)")), h("fieldset", null, h("h2", null, "Smoothly Radio"), h("h3", null, "Deselectable Radio List with button"), h("smoothly-radio-button", { deselectable: true, decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, h("span", null, "Option 3")), h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, h("span", null, "Option 4 (Disabled)"))), h("h3", null, "Radio List with button"), h("smoothly-radio-button", { decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, h("span", null, "Option 3"))), h("h3", null, "Radio List ", h("b", null, "without button")), h("smoothly-radio-button", null, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, h("span", null, "Option 3"))), h("smoothly-radio", { name: "option", value: "1" }, "option 1"), h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), h("smoothly-radio", { name: "option", value: "3" }, "option 3")), h("fieldset", null, h("h2", null, "Smoothly Accordion"), h("smoothly-accordion", null, h("smoothly-accordion-item", { name: "A", open: true }, h("smoothly-radio", { name: "a", value: "1" }, "a 1"), h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), h("smoothly-radio", { name: "a", value: "3" }, "a 3")), h("smoothly-accordion-item", { name: "B" }, h("smoothly-radio", { name: "b", value: "1" }, "b 1"), h("smoothly-radio", { name: "b", value: "2" }, "b 2"), h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), h("fieldset", null, h("h2", null, "Smoothly checkbox"), h("smoothly-checkbox", { selectAll: true, intermediate: true }), h("smoothly-checkbox", null), h("smoothly-checkbox", { disabled: true })), h("fieldset", null, h("h2", null, "Smoothly addresses"), h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), h("footer", null, h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-submit", { disabled: true, expand: "block", onClick: e => console.log(e), onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
21700
21702
  h("smoothly-backtotop", null),
21701
21703
  ];
21702
21704
  }
@@ -22683,6 +22685,9 @@ const SmoothlySubmit = class {
22683
22685
  this.processing = false;
22684
22686
  }
22685
22687
  }
22688
+ handleClick(e) {
22689
+ this.disabled && e.stopImmediatePropagation();
22690
+ }
22686
22691
  async submit() {
22687
22692
  let result;
22688
22693
  if ((result = !!this.form))
@@ -22690,10 +22695,7 @@ const SmoothlySubmit = class {
22690
22695
  return result;
22691
22696
  }
22692
22697
  render() {
22693
- return [
22694
- h("smoothly-spinner", { active: this.processing }),
22695
- h("button", { type: "submit", disabled: this.disabled || this.processing, ref: (element) => (this.button = element) }, h("slot", null)),
22696
- ];
22698
+ return (h(Host, { onClick: (e) => this.handleClick(e) }, h("smoothly-spinner", { active: this.processing }), h("button", { type: "submit", disabled: this.disabled || this.processing, ref: (element) => (this.button = element) }, h("slot", null))));
22697
22699
  }
22698
22700
  };
22699
22701
  function hasNameAndValue(element) {
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-d3421c35.js';
2
- import { T as Trigger, M as Message } from './Listenable-55a1f6af.js';
2
+ import { T as Trigger, M as Message } from './Listenable-5d2def19.js';
3
3
  import './GoogleFont-8474516b.js';
4
4
 
5
5
  const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, a as getElement } from './index-d3421c35.js';
2
- import { M as Message, T as Trigger } from './Listenable-55a1f6af.js';
2
+ import { M as Message, T as Trigger } from './Listenable-5d2def19.js';
3
3
  import './GoogleFont-8474516b.js';
4
4
 
5
5
  const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";
@@ -1 +1 @@
1
- export{A as App,C as Cosmetic,N as Notice,r as redirect}from"./p-94e08cee.js";import{I as e}from"./p-156763cd.js";export{L as Listenable,M as Message,T as Trigger}from"./p-156763cd.js";export{G as GoogleFont}from"./p-bd478a53.js";import"./p-4a0b35b7.js";class t{constructor(){}static get value(){return t.valueCache=localStorage.getItem("clientIdentifier")||void 0,t.valueCache||(t.valueCache=e.generate(12),localStorage.setItem("clientIdentifier",t.valueCache)),t.valueCache}}export{t as ClientIdentifier}
1
+ export{A as App,C as Cosmetic,N as Notice,r as redirect}from"./p-94e08cee.js";import{I as e}from"./p-796b1024.js";export{L as Listenable,M as Message,T as Trigger}from"./p-796b1024.js";export{G as GoogleFont}from"./p-bd478a53.js";import"./p-4a0b35b7.js";class t{constructor(){}static get value(){return t.valueCache=localStorage.getItem("clientIdentifier")||void 0,t.valueCache||(t.valueCache=e.generate(12),localStorage.setItem("clientIdentifier",t.valueCache)),t.valueCache}}export{t as ClientIdentifier}
@@ -1 +1 @@
1
- import{r as s,h as i}from"./p-4a0b35b7.js";import{T as t,M as r}from"./p-156763cd.js";import"./p-bd478a53.js";const o=class{constructor(i){s(this,i),this.context=void 0,this.destination=void 0,this.filter=void 0}get filters(){return this.filtersValue||(this.filtersValue=this.filter?this.filter.split(" "):[]),this.filtersValue}TriggerListener(s){t.is(s.detail)&&this.filters.some((i=>i==s.detail.name))&&(r.send(this.destination,s.detail,this.context||window),s.preventDefault(),s.stopPropagation())}render(){return i("slot",null)}};o.style=".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";export{o as smoothly_trigger_sink}
1
+ import{r as s,h as i}from"./p-4a0b35b7.js";import{T as t,M as r}from"./p-796b1024.js";import"./p-bd478a53.js";const o=class{constructor(i){s(this,i),this.context=void 0,this.destination=void 0,this.filter=void 0}get filters(){return this.filtersValue||(this.filtersValue=this.filter?this.filter.split(" "):[]),this.filtersValue}TriggerListener(s){t.is(s.detail)&&this.filters.some((i=>i==s.detail.name))&&(r.send(this.destination,s.detail,this.context||window),s.preventDefault(),s.stopPropagation())}render(){return i("slot",null)}};o.style=".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";export{o as smoothly_trigger_sink}
@@ -1 +1 @@
1
- import{r as s,c as t,h as o,a as r}from"./p-4a0b35b7.js";import{M as i,T as e}from"./p-156763cd.js";import"./p-bd478a53.js";const n=class{constructor(o){s(this,o),this.trigger=t(this,"trigger",7),this.message=t(this,"message",7),this.listen=void 0}componentDidLoad(){i.listen(this.listen,((s,t)=>{e.is(t)?this.trigger.emit(t):this.message.emit({destination:s,content:t})}),window)}render(){return o("slot",null)}get element(){return r(this)}};n.style=".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";export{n as smoothly_trigger_source}
1
+ import{r as s,c as t,h as o,a as r}from"./p-4a0b35b7.js";import{M as i,T as e}from"./p-796b1024.js";import"./p-bd478a53.js";const n=class{constructor(o){s(this,o),this.trigger=t(this,"trigger",7),this.message=t(this,"message",7),this.listen=void 0}componentDidLoad(){i.listen(this.listen,((s,t)=>{e.is(t)?this.trigger.emit(t):this.message.emit({destination:s,content:t})}),window)}render(){return o("slot",null)}get element(){return r(this)}};n.style=".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";export{n as smoothly_trigger_source}
@@ -1 +1 @@
1
- class t{constructor(){this.encoding="utf-8"}encode(t){return Uint8Array.from(unescape(encodeURIComponent(t)).split(""),(t=>t.charCodeAt(0)))}}const n={standard:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",url:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function e(e,r="standard",i=""){"string"==typeof e&&(e=(new t).encode(e));const s=n[r],a=[];for(let t=0;t<e.length;t+=3){const n=e[t],r=t+1<e.length?e[t+1]:0,i=t+2<e.length?e[t+2]:0;a.push(s[n>>>2]),a.push(s[(3&n)<<4|r>>>4]),a.push(s[(15&r)<<2|i>>>6]),a.push(s[63&i])}const o=Math.ceil(e.length/3*4);return a.join("").substr(0,o)+i.repeat(a.length-o)}function r(t,e="standard"){for(;t.endsWith("=")&&t.length>0;)t=t.substr(0,t.length-1);const r=n[e],i=t.split("").map((t=>r.indexOf(t))),s=new Uint8Array(Math.floor(i.length/4*3));for(let t=0;t<s.length;t+=3){const n=i.shift()||0,e=i.shift()||0,r=i.shift()||0,a=i.shift()||0;s[t]=n<<2|e>>>4,s[t+1]=(15&e)<<4|r>>>2,s[t+2]=(3&r)<<6|a}return s}const i="undefined"!=typeof window?window.crypto||window.msCrypto:self.crypto||self.msCrypto;var s,a,o,c,u,f,S,y,p,l,h,w,A,b,d,g;!function(t){t.create=function(t,n,...e){const[r,...i]=(s=e,Array.isArray(s)&&s.length>0&&"string"==typeof s[0]?e.map((t=>Object.fromEntries(t.split(",").map((t=>t.split(":",2).map((t=>t.trim()))))))):e);var s;const a=Object.assign({},...Object.entries(r).map((([t,n])=>[t,[n,...i.map((n=>n[t])).filter((t=>t))]])).map((([n,e])=>({get[n](){return Object.assign(t(e),{name:n})}}))));return{current:a[n],...a}}}(s||(s={})),function(t){t.is=function(t){return"object"==typeof t&&(null==t.key||"string"==typeof t.key)&&"string"==typeof t.value&&"string"==typeof t.salt},t.stringify=function(t){return t.key=t.key&&4!=t.key.length?t.key.slice(-2):t.key,[t.key,t.salt,t.value].join(".")},t.parse=function(n){const e=n.split("."),r={key:e[0],salt:e[1],value:e[2]};return t.is(r)?r:void 0}}(a||(a={})),function(t){function n(t){return e(t,"url")}function s(t){t.length%2==1&&(t+="0");const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++)e[n]=16*Number.parseInt(t[2*n],16)+Number.parseInt(t[2*n+1],16);return n(e)}function a(t,n){const e=r(t,"url");let i=[];for(const t of e)i.push(Math.floor(t/16).toString(16),(t%16).toString(16));return n&&(i=i.slice(0,n)),i.join("")}t.is=function(t,n){return"string"==typeof t&&(null==n||t.length==n)&&Array.from(t).every((t=>t>="0"&&t<="9"||t>="A"&&t<="Z"||t>="a"&&t<="z"||"-"==t||"_"==t))},t.fromUint24=function(t){return s(t.toString(16).padStart(6,"0"))},t.toUint24=function(t){return Number.parseInt(a(t,6),16)},t.fromUint48=function(t){return s(t.toString(16).padStart(12,"0"))},t.toUint48=function(t){return Number.parseInt(a(t,12),16)},t.fromBinary=n,t.toBinary=function(t){return r(t,"url")},t.generate=function(t){return n(i.getRandomValues(new Uint8Array(t/4*3)))},t.fromHexadecimal=s,t.toHexadecimal=a,t.length=[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128],(t.Length||(t.Length={})).is=function(t){return"number"==typeof t&&t>=4&&t<=128&&(252&t)==t}}(o||(o={})),function(t){t.is=function(t){return"string"==typeof t||"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt},t.hash=async function(t,n,r){return r||(r=e(i.getRandomValues(new Uint8Array(64)))),{hash:await t.sign(r+n),salt:r}},t.verify=async function(n,e,r){return(await t.hash(n,r,e.salt)).hash==e.hash},(t.Hashed||(t.Hashed={})).is=function(t){return"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt}}(c||(c={})),function(t){t.generate=function(t){return i.getRandomValues(t)}}(u||(u={})),(f||(f={})).is=function(t){return"HMAC"==t||"RSA"==t||"ECDSA"==t||"RSA-PSS"==t};class v{async sign(n){return"string"==typeof n?e(await this.signBinary((new t).encode(n)),"url"):this.signBinary(n)}verify(n,e){return"string"==typeof e&&(e=r(e,"url")),this.verifyBinary("string"==typeof n?(new t).encode(n):n,e)}}class H extends v{constructor(t,n,e){super(),this.hash=t,n&&("string"==typeof n&&(n=r(n)),this.publicKey=i.subtle.importKey("spki",n,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!1,["verify"])),e&&("string"==typeof e&&(e=r(e)),this.privateKey=i.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!0,["sign","verify"]))}async signBinary(t){return new Uint8Array(await i.subtle.sign({name:"ECDSA",hash:{name:this.hash}},await this.privateKey,t))}async verifyBinary(t,n){return i.subtle.verify({name:"ECDSA",hash:{name:this.hash}},await this.publicKey,n,t)}}!function(t){t.is=function(t){return"SHA-1"==t||"SHA-256"==t||"SHA-384"==t||"SHA-512"==t}}(S||(S={}));class m extends v{async verifyBinary(t,n){return e(await this.signBinary(t),"url")==e(n,"url")}}class P extends m{constructor(t,n){super(),this.hash=t,"string"==typeof n&&(n=r(n,"url")),this.key=i.subtle.importKey("raw",n,{name:"HMAC",hash:{name:t}},!1,["sign","verify"])}async signBinary(t){return new Uint8Array(await i.subtle.sign("HMAC",await this.key,t))}}class E extends m{signBinary(t){return Promise.resolve(new Uint8Array(0))}}class k extends v{constructor(t,n,e){super(),this.variant=t,this.publicKey=n,this.privateKey=e}get parameters(){return j(this.variant)}async signBinary(t){return this.privateKey?new Uint8Array(await i.subtle.sign(this.parameters,await this.privateKey,t)):new Uint8Array(0)}async verifyBinary(t,n){return!!this.publicKey&&i.subtle.verify(this.parameters,await this.publicKey,n,t)}async export(t,n="base64"){const r=await("private"==t?this.privateKey:this.publicKey);let s;if(r)switch(n){case"jwk":s=await i.subtle.exportKey("jwk",r);break;case"buffer":s=await i.subtle.exportKey("private"==t?"pkcs8":"spki",r);break;case"base64":{const n=await this.export(t,"buffer");s=n&&e(new Uint8Array(n),"standard","=")}break;case"pem":{const n=await this.export(t,"base64");s=n&&[`-----BEGIN ${t.toUpperCase()} KEY-----`,...R(n,64),`-----END ${t.toUpperCase()} KEY-----`].join("\n")}}return s}static import(t,n,e,r){return new k(t,k.importHelper(t,n,"public",e),k.importHelper(t,n,"private",r))}static importHelper(t,n,e,s){return"string"==typeof s&&(s=r(s)),s&&i.subtle.importKey("private"==e?"pkcs8":"spki",s,{name:j(t).name,hash:{name:n}},!0,["private"==e?"sign":"verify"])}static generate(t,n,e){const r=i.subtle.generateKey({name:j(t).name,modulusLength:e,publicExponent:new Uint8Array([1,0,1]),hash:n},!0,["sign","verify"]);return new k(t,r.then((t=>t.publicKey)),r.then((t=>t.privateKey)))}}function*R(t,n){let e=0;for(;e<t.length;)yield t.slice(e,e+=n)}function j(t){return"PSS"==t?{name:"RSA-PSS",saltLength:128}:{name:"RSASSA-PKCS1-v1_5"}}!function(t){!function(t){t.is=f.is}(t.Algorithm||(t.Algorithm={})),(t.Hash||(t.Hash={})).is=S.is,t.generate=function(t,n,e){let r;switch(t){case"RSA":r=k.generate("SSA",n,e);break;case"RSA-PSS":r=k.generate("PSS",n,e)}return r},t.create=function(t,n,...e){let r;if(null!=n)switch(t){case"HMAC":r=new P(n,e[0]);break;case"RSA":r=k.import("SSA",n,e[0],e[1]);break;case"RSA-PSS":r=k.import("PSS",n,e[0],e[1]);break;case"ECDSA":r=new H(n,e[0],e[1])}else"None"==t&&(r=new E);return r}}(y||(y={})),Uint8Array.__proto__.from||(Uint8Array.__proto__.from=function(t,n,e){const r=Uint8Array.__proto__;if("function"!=typeof this)throw new TypeError("# is not a constructor");if(this.__proto__!==r)throw new TypeError("this is not a typed array.");if("function"!=typeof(n=n||(t=>t)))throw new TypeError("specified argument is not a function");if(!(t=Object(t)).length)return new this(0);let i=[];for(const t of i)i.push(t);i=i.map(n,e);const s=new this(i.length);for(let t=0;t<s.length;t++)s[t]=i[t];return s}),function(t){t.is=function(t){return"object"==typeof t&&Object.entries(t).every((t=>"function"==typeof t))}}(p||(p={})),function(t){t.is=function(t){return Array.isArray(t)&&t.every((t=>"string"==typeof t))}}(l||(l={})),function(t){t.is=function(t){return"object"==typeof t&&Object.entries(t).every((t=>"string"==typeof t[1]))}}(h||(h={})),function(t){t.is=function(t){return l.is(t)||p.is(t)||h.is(t)},(t.Converter||(t.Converter={})).is=p.is,(t.Crypto||(t.Crypto={})).is=l.is,(t.Renamer||(t.Renamer={})).is=h.is}(w||(w={})),function(t){t.is=function(t){return"object"==typeof t&&"function"==typeof t.apply&&"function"==typeof t.reverse},t.create=function(t){return{apply:t.apply?t.apply:t=>t,reverse:t.reverse?t.reverse:t=>t}}}(A||(A={})),function(t){t.is=function(t){return"RS256"==t||"RS384"==t||"RS512"==t||"ES256"==t||"ES384"==t||"ES512"==t||"PS256"==t||"PS384"==t||"PS512"==t}}(b||(b={})),function(t){t.is=function(t){return"HS256"==t||"HS384"==t||"HS512"==t}}(d||(d={})),function(t){t.is=function(t){return"none"==t||d.is(t)||b.is(t)},function(t){t.is=d.is}(t.Symmetric||(t.Symmetric={})),(t.Asymmetric||(t.Asymmetric={})).is=b.is}(g||(g={}));var C;class U{constructor(t,n){this.name=t,this.signer=n}sign(t){return n=this,e=void 0,i=function*(){return this.signer.sign(t)},new((r=void 0)||(r=Promise))((function(t,s){function a(t){try{c(i.next(t))}catch(t){s(t)}}function o(t){try{c(i.throw(t))}catch(t){s(t)}}function c(n){var e;n.done?t(n.value):(e=n.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,o)}c((i=i.apply(n,e||[])).next())}));var n,e,r,i}verify(t,n){return this.signer.verify(t,n)}static create(t,...n){let e;switch(t){case"ES256":e=y.create("ECDSA","SHA-256",n[0],n[1]);break;case"ES384":e=y.create("ECDSA","SHA-384",n[0],n[1]);break;case"ES512":e=y.create("ECDSA","SHA-512",n[0],n[1]);break;case"PS256":e=y.create("RSA-PSS","SHA-256",n[0],n[1]);break;case"PS384":e=y.create("RSA-PSS","SHA-384",n[0],n[1]);break;case"PS512":e=y.create("RSA-PSS","SHA-512",n[0],n[1]);break;case"HS256":e=y.create("HMAC","SHA-256",n[0]);break;case"HS384":e=y.create("HMAC","SHA-384",n[0]);break;case"HS512":e=y.create("HMAC","SHA-512",n[0]);break;case"RS256":e=y.create("RSA","SHA-256",n[0],n[1]);break;case"RS384":e=y.create("RSA","SHA-384",n[0],n[1]);break;case"RS512":e=y.create("RSA","SHA-512",n[0],n[1]);break;case"none":e=y.create("None")}return e&&new U(t,e)}static none(){return U.create("none")}static HS256(t){return U.create("HS256",t)}static HS384(t){return U.create("HS384",t)}static HS512(t){return U.create("HS512",t)}static RS256(t,n){return U.create("RS256",t,n)}static RS384(t,n){return U.create("RS384",t,n)}static RS512(t,n){return U.create("RS512",t,n)}static ES256(t,n){return U.create("ES256",t,n)}static ES384(t,n){return U.create("ES384",t,n)}static ES512(t,n){return U.create("ES512",t,n)}static PS256(t,n){return U.create("PS256",t,n)}static PS384(t,n){return U.create("PS384",t,n)}static PS512(t,n){return U.create("PS512",t,n)}}!function(t){var n;(n=t.Name||(t.Name={})).is=g.is,function(t){t.is=g.Symmetric.is}(n.Symmetric||(n.Symmetric={})),function(t){t.is=g.Asymmetric.is}(n.Asymmetric||(n.Asymmetric={}))}(U||(U={})),function(t){t.is=function(t){return"string"==typeof t&&/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/.test(t)}}(C||(C={}));class O{static is(t){return"object"==typeof t&&"string"==typeof t.destination&&null!=t.content}static send(t,n,e){if(O.is(t)&&null==e){(e=n)||(e=window);const r=t.destination.split("#",2);e.postMessage(t={destination:r[1],content:t.content},r[0])}else"string"!=typeof e&&(e||(e=window),"string"==typeof t&&O.send({destination:t,content:n},e))}static listen(t,n,e){const r=t.split("#",2);let i="";2==r.length&&(t=r[0],i=r[1]),(e||window).addEventListener("message",(e=>{const r=e.data;!O.is(r)||"*"!=t&&e.origin!=t||""!=i&&r.destination!=i||n(r.destination,r.content)}))}}class M{static is(t){return"object"==typeof t&&"string"==typeof t.name}}var D,x=function(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)};class B{constructor(){D.set(this,{})}listen(t,n){var e,r;null!==(r=null===(e=x(this,D,"f")[t])||void 0===e?void 0:e.push(n))&&void 0!==r||(x(this,D,"f")[t]=[n]),n(this[t])}unlisten(t,n){var e,r;const i=null===(e=x(this,D,"f")[t])||void 0===e?void 0:e.indexOf(n);null!=i&&i>=0&&(null===(r=x(this,D,"f")[t])||void 0===r||r.splice(i,1))}static load(t,n){const e=null!=n?n:new B;return Object.defineProperties(e,function(t){return Object.fromEntries(Object.entries(Object.assign(Object.assign({},Object.getOwnPropertyDescriptors(t)),Object.getOwnPropertyDescriptors(Object.getPrototypeOf(t)))).map((([n,r])=>[n,"function"==typeof r.value?{get:()=>t[n].bind(t)}:r.writable||r.set?{get:()=>t[n],set(r){var i;t[n]=r,null===(i=x(e,D,"f")[n])||void 0===i||i.forEach((t=>t(r)))}}:{get:()=>t[n].bind(t)}])))}(t))}}D=new WeakMap;export{o as I,B as L,O as M,M as T}
1
+ class t{constructor(){this.encoding="utf-8"}encode(t){return Uint8Array.from(unescape(encodeURIComponent(t)).split(""),(t=>t.charCodeAt(0)))}}const n={standard:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",url:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function e(e,r="standard",i=""){"string"==typeof e&&(e=(new t).encode(e));const s=n[r],a=[];for(let t=0;t<e.length;t+=3){const n=e[t],r=t+1<e.length?e[t+1]:0,i=t+2<e.length?e[t+2]:0;a.push(s[n>>>2]),a.push(s[(3&n)<<4|r>>>4]),a.push(s[(15&r)<<2|i>>>6]),a.push(s[63&i])}const o=Math.ceil(e.length/3*4);return a.join("").substr(0,o)+i.repeat(a.length-o)}function r(t,e="standard"){for(;t.endsWith("=")&&t.length>0;)t=t.substr(0,t.length-1);const r=n[e],i=t.split("").map((t=>r.indexOf(t))),s=new Uint8Array(Math.floor(i.length/4*3));for(let t=0;t<s.length;t+=3){const n=i.shift()||0,e=i.shift()||0,r=i.shift()||0,a=i.shift()||0;s[t]=n<<2|e>>>4,s[t+1]=(15&e)<<4|r>>>2,s[t+2]=(3&r)<<6|a}return s}const i="undefined"!=typeof window?window.crypto||window.msCrypto:self.crypto||self.msCrypto;var s,a,o,c,u,f,S,y,p,l,h,w,A,b,d,g;!function(t){t.create=function(t,n,...e){const[r,...i]=(s=e,Array.isArray(s)&&s.length>0&&"string"==typeof s[0]?e.map((t=>Object.fromEntries(t.split(",").map((t=>t.split(":",2).map((t=>t.trim()))))))):e);var s;const a=Object.assign({},...Object.entries(r).map((([t,n])=>[t,[n,...i.map((n=>n[t])).filter((t=>t))]])).map((([n,e])=>({get[n](){return Object.assign(t(e),{name:n})}}))));return{current:a[n],...a}}}(s||(s={})),function(t){t.is=function(t){return"object"==typeof t&&(null==t.key||"string"==typeof t.key)&&"string"==typeof t.value&&"string"==typeof t.salt},t.stringify=function(t){return t.key=t.key&&4!=t.key.length?t.key.slice(-2):t.key,[t.key,t.salt,t.value].join(".")},t.parse=function(n){const e=n.split("."),r={key:e[0],salt:e[1],value:e[2]};return t.is(r)?r:void 0}}(a||(a={})),function(t){function n(t){return e(t,"url")}function s(t){t.length%2==1&&(t+="0");const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++)e[n]=16*Number.parseInt(t[2*n],16)+Number.parseInt(t[2*n+1],16);return n(e)}function a(t,n){const e=r(t,"url");let i=[];for(const t of e)i.push(Math.floor(t/16).toString(16),(t%16).toString(16));return n&&(i=i.slice(0,n)),i.join("")}t.is=function(t,n){return"string"==typeof t&&(null==n||t.length==n)&&Array.from(t).every((t=>t>="0"&&t<="9"||t>="A"&&t<="Z"||t>="a"&&t<="z"||"-"==t||"_"==t))},t.fromUint24=function(t){return s(t.toString(16).padStart(6,"0"))},t.toUint24=function(t){return Number.parseInt(a(t,6),16)},t.fromUint48=function(t){return s(t.toString(16).padStart(12,"0"))},t.toUint48=function(t){return Number.parseInt(a(t,12),16)},t.fromBinary=n,t.toBinary=function(t){return r(t,"url")},t.generate=function(t){return n(i.getRandomValues(new Uint8Array(t/4*3)))},t.fromHexadecimal=s,t.toHexadecimal=a,t.length=[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128],(t.Length||(t.Length={})).is=function(t){return"number"==typeof t&&t>=4&&t<=128&&(252&t)==t}}(o||(o={})),function(t){t.is=function(t){return"string"==typeof t||"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt},t.hash=async function(t,n,r){return r||(r=e(i.getRandomValues(new Uint8Array(64)))),{hash:await t.sign(r+n),salt:r}},t.verify=async function(n,e,r){return(await t.hash(n,r,e.salt)).hash==e.hash},(t.Hashed||(t.Hashed={})).is=function(t){return"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt}}(c||(c={})),function(t){t.generate=function(t){return i.getRandomValues(t)}}(u||(u={})),(f||(f={})).is=function(t){return"HMAC"==t||"RSA"==t||"ECDSA"==t||"RSA-PSS"==t};class v{async sign(n){return"string"==typeof n?e(await this.signBinary((new t).encode(n)),"url"):this.signBinary(n)}verify(n,e){return"string"==typeof e&&(e=r(e,"url")),this.verifyBinary("string"==typeof n?(new t).encode(n):n,e)}}class H extends v{constructor(t,n,e){super(),this.hash=t,n&&("string"==typeof n&&(n=r(n)),this.publicKey=i.subtle.importKey("spki",n,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!1,["verify"])),e&&("string"==typeof e&&(e=r(e)),this.privateKey=i.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!0,["sign","verify"]))}async signBinary(t){return new Uint8Array(await i.subtle.sign({name:"ECDSA",hash:{name:this.hash}},await this.privateKey,t))}async verifyBinary(t,n){return i.subtle.verify({name:"ECDSA",hash:{name:this.hash}},await this.publicKey,n,t)}}!function(t){t.is=function(t){return"SHA-1"==t||"SHA-256"==t||"SHA-384"==t||"SHA-512"==t}}(S||(S={}));class m extends v{async verifyBinary(t,n){return e(await this.signBinary(t),"url")==e(n,"url")}}class P extends m{constructor(t,n){super(),this.hash=t,"string"==typeof n&&(n=r(n,"url")),this.key=i.subtle.importKey("raw",n,{name:"HMAC",hash:{name:t}},!1,["sign","verify"])}async signBinary(t){return new Uint8Array(await i.subtle.sign("HMAC",await this.key,t))}}class E extends m{signBinary(t){return Promise.resolve(new Uint8Array(0))}}class k extends v{constructor(t,n,e){super(),this.variant=t,this.publicKey=n,this.privateKey=e}get parameters(){return j(this.variant)}async signBinary(t){return this.privateKey?new Uint8Array(await i.subtle.sign(this.parameters,await this.privateKey,t)):new Uint8Array(0)}async verifyBinary(t,n){return!!this.publicKey&&i.subtle.verify(this.parameters,await this.publicKey,n,t)}async export(t,n="base64"){const r=await("private"==t?this.privateKey:this.publicKey);let s;if(r)switch(n){case"jwk":s=await i.subtle.exportKey("jwk",r);break;case"buffer":s=await i.subtle.exportKey("private"==t?"pkcs8":"spki",r);break;case"base64":{const n=await this.export(t,"buffer");s=n&&e(new Uint8Array(n),"standard","=")}break;case"pem":{const n=await this.export(t,"base64");s=n&&[`-----BEGIN ${t.toUpperCase()} KEY-----`,...R(n,64),`-----END ${t.toUpperCase()} KEY-----`].join("\n")}}return s}static import(t,n,e,r){return new k(t,k.importHelper(t,n,"public",e),k.importHelper(t,n,"private",r))}static importHelper(t,n,e,s){return"string"==typeof s&&(s=r(s)),s&&i.subtle.importKey("private"==e?"pkcs8":"spki",s,{name:j(t).name,hash:{name:n}},!0,["private"==e?"sign":"verify"])}static generate(t,n,e){const r=i.subtle.generateKey({name:j(t).name,modulusLength:e,publicExponent:new Uint8Array([1,0,1]),hash:n},!0,["sign","verify"]);return new k(t,r.then((t=>t.publicKey)),r.then((t=>t.privateKey)))}}function*R(t,n){let e=0;for(;e<t.length;)yield t.slice(e,e+=n)}function j(t){return"PSS"==t?{name:"RSA-PSS",saltLength:128}:{name:"RSASSA-PKCS1-v1_5"}}!function(t){!function(t){t.is=f.is}(t.Algorithm||(t.Algorithm={})),(t.Hash||(t.Hash={})).is=S.is,t.generate=function(t,n,e){let r;switch(t){case"RSA":r=k.generate("SSA",n,e);break;case"RSA-PSS":r=k.generate("PSS",n,e)}return r},t.create=function(t,n,...e){let r;if(null!=n)switch(t){case"HMAC":r=new P(n,e[0]);break;case"RSA":r=k.import("SSA",n,e[0],e[1]);break;case"RSA-PSS":r=k.import("PSS",n,e[0],e[1]);break;case"ECDSA":r=new H(n,e[0],e[1])}else"None"==t&&(r=new E);return r}}(y||(y={})),Uint8Array.__proto__.from||(Uint8Array.__proto__.from=function(t,n,e){const r=Uint8Array.__proto__;if("function"!=typeof this)throw new TypeError("# is not a constructor");if(this.__proto__!==r)throw new TypeError("this is not a typed array.");if("function"!=typeof(n=n||(t=>t)))throw new TypeError("specified argument is not a function");if(!(t=Object(t)).length)return new this(0);let i=[];for(const t of i)i.push(t);i=i.map(n,e);const s=new this(i.length);for(let t=0;t<s.length;t++)s[t]=i[t];return s}),function(t){t.is=function(t){return"object"==typeof t&&Object.entries(t).every((t=>"function"==typeof t))}}(p||(p={})),function(t){t.is=function(t){return Array.isArray(t)&&t.every((t=>"string"==typeof t))}}(l||(l={})),function(t){t.is=function(t){return"object"==typeof t&&Object.entries(t).every((t=>"string"==typeof t[1]))}}(h||(h={})),function(t){t.is=function(t){return l.is(t)||p.is(t)||h.is(t)},(t.Converter||(t.Converter={})).is=p.is,(t.Crypto||(t.Crypto={})).is=l.is,(t.Renamer||(t.Renamer={})).is=h.is}(w||(w={})),function(t){t.is=function(t){return"object"==typeof t&&"function"==typeof t.apply&&"function"==typeof t.reverse},t.create=function(t){return{apply:t.apply?t.apply:t=>t,reverse:t.reverse?t.reverse:t=>t}}}(A||(A={})),function(t){t.is=function(t){return"RS256"==t||"RS384"==t||"RS512"==t||"ES256"==t||"ES384"==t||"ES512"==t||"PS256"==t||"PS384"==t||"PS512"==t}}(b||(b={})),function(t){t.is=function(t){return"HS256"==t||"HS384"==t||"HS512"==t}}(d||(d={})),function(t){t.is=function(t){return"none"==t||d.is(t)||b.is(t)},function(t){t.is=d.is}(t.Symmetric||(t.Symmetric={})),(t.Asymmetric||(t.Asymmetric={})).is=b.is}(g||(g={}));var C;class U{constructor(t,n){this.name=t,this.signer=n}sign(t){return n=this,e=void 0,i=function*(){return this.signer.sign(t)},new((r=void 0)||(r=Promise))((function(t,s){function a(t){try{c(i.next(t))}catch(t){s(t)}}function o(t){try{c(i.throw(t))}catch(t){s(t)}}function c(n){var e;n.done?t(n.value):(e=n.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,o)}c((i=i.apply(n,e||[])).next())}));var n,e,r,i}verify(t,n){return this.signer.verify(t,n)}static create(t,...n){let e;switch(t){case"ES256":e=y.create("ECDSA","SHA-256",n[0],n[1]);break;case"ES384":e=y.create("ECDSA","SHA-384",n[0],n[1]);break;case"ES512":e=y.create("ECDSA","SHA-512",n[0],n[1]);break;case"PS256":e=y.create("RSA-PSS","SHA-256",n[0],n[1]);break;case"PS384":e=y.create("RSA-PSS","SHA-384",n[0],n[1]);break;case"PS512":e=y.create("RSA-PSS","SHA-512",n[0],n[1]);break;case"HS256":e=y.create("HMAC","SHA-256",n[0]);break;case"HS384":e=y.create("HMAC","SHA-384",n[0]);break;case"HS512":e=y.create("HMAC","SHA-512",n[0]);break;case"RS256":e=y.create("RSA","SHA-256",n[0],n[1]);break;case"RS384":e=y.create("RSA","SHA-384",n[0],n[1]);break;case"RS512":e=y.create("RSA","SHA-512",n[0],n[1]);break;case"none":e=y.create("None")}return e&&new U(t,e)}static none(){return U.create("none")}static HS256(t){return U.create("HS256",t)}static HS384(t){return U.create("HS384",t)}static HS512(t){return U.create("HS512",t)}static RS256(t,n){return U.create("RS256",t,n)}static RS384(t,n){return U.create("RS384",t,n)}static RS512(t,n){return U.create("RS512",t,n)}static ES256(t,n){return U.create("ES256",t,n)}static ES384(t,n){return U.create("ES384",t,n)}static ES512(t,n){return U.create("ES512",t,n)}static PS256(t,n){return U.create("PS256",t,n)}static PS384(t,n){return U.create("PS384",t,n)}static PS512(t,n){return U.create("PS512",t,n)}}!function(t){var n;(n=t.Name||(t.Name={})).is=g.is,function(t){t.is=g.Symmetric.is}(n.Symmetric||(n.Symmetric={})),function(t){t.is=g.Asymmetric.is}(n.Asymmetric||(n.Asymmetric={}))}(U||(U={})),function(t){t.is=function(t){return"string"==typeof t&&/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/.test(t)}}(C||(C={}));class O{static is(t){return"object"==typeof t&&"string"==typeof t.destination&&null!=t.content}static send(t,n,e){if(O.is(t)&&null==e){(e=n)||(e=window);const r=t.destination.split("#",2);e.postMessage(t={destination:r[1],content:t.content},r[0])}else"string"!=typeof e&&(e||(e=window),"string"==typeof t&&O.send({destination:t,content:n},e))}static listen(t,n,e){const r=t.split("#",2);let i="";2==r.length&&(t=r[0],i=r[1]),(e||window).addEventListener("message",(e=>{const r=e.data;!O.is(r)||"*"!=t&&e.origin!=t||""!=i&&r.destination!=i||n(r.destination,r.content)}))}}class M{static is(t){return"object"==typeof t&&"string"==typeof t.name}}var D,x=function(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)};class B{constructor(){D.set(this,{})}listen(t,n){var e,r;null!==(r=null===(e=x(this,D,"f")[t])||void 0===e?void 0:e.push(n))&&void 0!==r||(x(this,D,"f")[t]=[n]),n(this[t])}unlisten(t,n){var e,r;const i=null===(e=x(this,D,"f")[t])||void 0===e?void 0:e.indexOf(n);null!=i&&i>=0&&(null===(r=x(this,D,"f")[t])||void 0===r||r.splice(i,1))}static load(t,n){const e=null!=n?n:new B;return Object.defineProperties(e,function(t){return Object.fromEntries(Object.entries(Object.assign(Object.assign({},Object.getOwnPropertyDescriptors(t)),Object.getOwnPropertyDescriptors(Object.getPrototypeOf(t)))).map((([n,r])=>[n,"function"==typeof r.value?{get:()=>t[n].bind(t)}:r.writable||r.set?{get:()=>t[n],set(r){var i;t[n]=r,null===(i=x(e,D,"f")[n])||void 0===i||i.forEach((e=>e(t[n])))}}:{get:()=>t[n].bind(t)}])))}(t))}}D=new WeakMap;export{o as I,B as L,O as M,M as T}