smoothly 0.2.10 → 0.2.11

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.
Files changed (37) hide show
  1. package/dist/cjs/{Notice-a540b9fb.js → index-2a011313.js} +380 -4
  2. package/dist/cjs/index.cjs.js +9 -372
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{smoothly-accordion_51.cjs.entry.js → smoothly-accordion_50.cjs.entry.js} +90 -108
  5. package/dist/cjs/smoothly-svg.cjs.entry.js +41 -0
  6. package/dist/cjs/smoothly.cjs.js +1 -1
  7. package/dist/collection/components/App.js +9 -4
  8. package/dist/collection/components/app-demo/index.js +10 -0
  9. package/dist/collection/components/display-demo/index.js +16 -12
  10. package/dist/collection/components/input-date/index.js +18 -1
  11. package/dist/collection/components/input-demo/index.js +3 -1
  12. package/dist/collection/components/room/index.js +7 -3
  13. package/dist/collection/components/submit/Data.js +12 -0
  14. package/dist/collection/components/submit/index.js +10 -4
  15. package/dist/collection/index.js +1 -1
  16. package/dist/custom-elements/index.js +33 -11
  17. package/dist/esm/{Notice-4d3fbaaf.js → index-1d438ba2.js} +380 -5
  18. package/dist/esm/index.js +2 -372
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/esm/{smoothly-accordion_51.entry.js → smoothly-accordion_50.entry.js} +90 -107
  21. package/dist/esm/smoothly-svg.entry.js +37 -0
  22. package/dist/esm/smoothly.js +1 -1
  23. package/dist/smoothly/index.esm.js +1 -1
  24. package/dist/smoothly/p-76e88859.js +1 -0
  25. package/dist/smoothly/p-8aefcb54.entry.js +1 -0
  26. package/dist/smoothly/p-956089d5.entry.js +1 -0
  27. package/dist/smoothly/smoothly.esm.js +1 -1
  28. package/dist/types/components/App.d.ts +1 -0
  29. package/dist/types/components/input-date/index.d.ts +1 -0
  30. package/dist/types/components/room/index.d.ts +1 -1
  31. package/dist/types/components/submit/Data.d.ts +7 -0
  32. package/dist/types/components/submit/index.d.ts +2 -3
  33. package/dist/types/components.d.ts +6 -3
  34. package/dist/types/index.d.ts +1 -1
  35. package/package.json +1 -1
  36. package/dist/smoothly/p-d8a81a07.js +0 -1
  37. package/dist/smoothly/p-fbcf1356.entry.js +0 -1
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-191ee4b8.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-8e4e941e",[[2,"smoothly-google-font",{value:[1]}]]],["p-9bc77fba",[[4,"smoothly-radio-group",{orientation:[513]}]]],["p-7a5eda51",[[0,"smoothly-reorder"]]],["p-d5d4832d",[[6,"smoothly-trigger-sink",{context:[16],destination:[1],filter:[1]},[[0,"trigger","TriggerListener"]]]]],["p-919ae3e8",[[6,"smoothly-trigger-source",{listen:[1]}]]],["p-fbcf1356",[[0,"smoothly-app-demo",{baseUrl:[1,"base-url"]}],[0,"smoothly-input-demo"],[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]],[0,"smoothly-display-demo"],[2,"smoothly-table-demo"],[4,"smoothly-app",{color:[1]}],[0,"smoothly-dialog-demo"],[2,"smoothly-icon-demo"],[6,"smoothly-button",{color:[513],expand:[513],fill:[513],disabled:[516],type:[513],link:[1],download:[4]}],[4,"smoothly-room",{label:[1],icon:[1],path:[1],to:[1]}],[2,"smoothly-input-date-range",{value:[1025],start:[1025],end:[1025],max:[1025],min:[1025],open:[1028],showLabel:[516,"show-label"]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"],[0,"dateRangeSet","onDateRangeSet"]]],[6,"smoothly-notifier",{notices:[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]],[1,"smoothly-picker",{disabled:[516],readonly:[516],maxMenuHeight:[1,"max-menu-height"],maxHeight:[1,"max-height"],emptyMenuLabel:[1025,"empty-menu-label"],multiple:[516],mutable:[4],optionStyle:[8,"option-style"],options:[16],labelSetting:[513,"label-setting"],label:[513],selections:[1040],selectNoneName:[1025,"select-none-name"],selectAllName:[1025,"select-all-name"],selectionName:[1025,"selection-name"],newOptionLabel:[1025,"new-option-label"],valueValidator:[16],isOpen:[32],empty:[32]},[[0,"optionSelect","optionSelectHandler"],[0,"optionAdd","optionAddHandler"],[0,"menuEmpty","emptyHandler"]]],[6,"smoothly-dialog",{color:[513],open:[1540],closable:[516],header:[513]},[[0,"trigger","TriggerListener"]]],[2,"smoothly-backtotop",{opacity:[1],bottom:[1],right:[1],visible:[32]}],[2,"smoothly-checkbox",{selectAll:[4,"select-all"],size:[1],intermediate:[1540],selected:[1540],disabled:[1540],t:[32]}],[6,"smoothly-submit",{processing:[1540],color:[513],expand:[513],fill:[513],disabled:[516],prevent:[4],submit:[64]},[[0,"click","handleSubmit"]]],[6,"smoothly-table-expandable-cell",{align:[1],open:[1540]},[[0,"click","onClick"]]],[6,"smoothly-table-expandable-row",{align:[1],open:[1540]},[[0,"click","onClick"]]],[0,"smoothly-urlencoded",{data:[1]}],[6,"smoothly-accordion",{value:[1025]},[[0,"smoothlyOpen","handleOpenClose"],[0,"smoothlyClose","handleOpenClose"],[0,"smoothlyAccordionItemDidLoad","onAccordionItemDidLoad"],[0,"smoothlyAccordionItemDidUnload","onAccordionItemDidUnload"]]],[6,"smoothly-accordion-item",{name:[1],brand:[1],open:[1540]}],[2,"smoothly-display",{type:[1],value:[8],currency:[1],country:[1],format:[16]}],[2,"smoothly-display-amount",{amount:[8],currency:[1]}],[2,"smoothly-frame",{url:[1],name:[1],origin:[1],send:[64]}],[6,"smoothly-popup",{visible:[1540],direction:[1537],cssVariables:[32]}],[6,"smoothly-quiet",{color:[1]}],[6,"smoothly-radio",{name:[1],value:[1],checked:[1540],tabIndex:[2,"tab-index"]}],[6,"smoothly-select",{identifier:[1],background:[513],value:[1025]}],[2,"smoothly-skeleton",{widths:[16],width:[1],color:[1],period:[2],distance:[1],align:[513]}],[2,"smoothly-svg",{url:[513],size:[513],color:[1]}],[6,"smoothly-table",null,[[0,"expansionLoad","handleEvents"],[0,"expansionOpen","handleEvents"]]],[6,"smoothly-table-cell"],[6,"smoothly-table-header",{name:[1]}],[6,"smoothly-table-row",null,[[0,"expansionLoad","onExpansionLoad"],[0,"expansionOpen","onExpansionOpen"]]],[6,"smoothly-input-date",{value:[1025],open:[1028],max:[1025],min:[1025],disabled:[1028]},[[0,"dateSet","dateSetHandler"]]],[1,"smoothly-menu-options",{emptyMenuLabel:[1025,"empty-menu-label"],newOptionLabel:[1,"new-option-label"],maxMenuHeight:[1,"max-menu-height"],order:[4],optionStyle:[8,"option-style"],options:[1040],resetHighlightOnOptionsChange:[1028,"reset-highlight-on-options-change"],mutable:[4],filteredOptions:[32],highlightIndex:[32],keyword:[32],moveHighlight:[64],setHighlight:[64],getHighlighted:[64],filterOptions:[64]},[[0,"optionHover","optionHoverHandler"]]],[2,"smoothly-notification",{notice:[16],tick:[32]},[[0,"trigger","onTrigger"]]],[2,"smoothly-display-date-time",{datetime:[1]}],[6,"smoothly-tab",{label:[1],open:[1540]},[[0,"click","onClick"]]],[6,"smoothly-tab-switch",{selectedElement:[32]},[[0,"expansionOpen","openChanged"]]],[0,"smoothly-tuple",{tuple:[16]}],[1,"smoothly-option",{aliases:[513],dataHighlight:[1540,"data-highlight"],name:[1537],value:[1537],divider:[1540],new:[4]}],[2,"smoothly-spinner",{active:[516],size:[513]}],[2,"smoothly-calendar",{month:[1025],value:[1025],start:[1025],end:[1025],max:[1025],min:[1025],doubleInput:[516,"double-input"],firstSelected:[32]}],[6,"smoothly-input",{name:[513],value:[1032],type:[513],required:[1540],minLength:[1026,"min-length"],showLabel:[516,"show-label"],maxLength:[1026,"max-length"],autocomplete:[1028],pattern:[1040],placeholder:[1025],disabled:[1028],readonly:[1028],currency:[513],initialValue:[32],getFormData:[64],setKeepFocusOnReRender:[64],setSelectionRange:[64]}],[2,"smoothly-input-month",{value:[1025]}],[6,"smoothly-selector",{opened:[32],selectedElement:[32],missing:[32],filter:[32]},[[0,"click","onClick"],[0,"itemSelected","onItemSelected"],[0,"keydown","onKeyDown"]]],[6,"smoothly-item",{value:[8],selected:[1540],filter:[64]},[[0,"click","onClick"]]],[6,"smoothly-trigger",{color:[513],expand:[513],fill:[513],disabled:[516],type:[513],name:[1],value:[8]},[[0,"click","onClick"]]],[2,"smoothly-icon",{color:[513],fill:[513],name:[1],size:[513],toolTip:[1,"tool-tip"],document:[32]}]]]],e)));
1
+ import{p as e,b as o}from"./p-191ee4b8.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-8e4e941e",[[2,"smoothly-google-font",{value:[1]}]]],["p-9bc77fba",[[4,"smoothly-radio-group",{orientation:[513]}]]],["p-7a5eda51",[[0,"smoothly-reorder"]]],["p-8aefcb54",[[2,"smoothly-svg",{url:[513],size:[513],color:[1]}]]],["p-d5d4832d",[[6,"smoothly-trigger-sink",{context:[16],destination:[1],filter:[1]},[[0,"trigger","TriggerListener"]]]]],["p-919ae3e8",[[6,"smoothly-trigger-source",{listen:[1]}]]],["p-956089d5",[[0,"smoothly-app-demo",{baseUrl:[1,"base-url"]}],[0,"smoothly-input-demo"],[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]],[2,"smoothly-table-demo"],[0,"smoothly-display-demo"],[4,"smoothly-app",{color:[1]}],[0,"smoothly-dialog-demo"],[2,"smoothly-icon-demo"],[6,"smoothly-button",{color:[513],expand:[513],fill:[513],disabled:[516],type:[513],link:[1],download:[4]}],[4,"smoothly-room",{label:[1],icon:[1],path:[1],to:[1]}],[2,"smoothly-input-date-range",{value:[1025],start:[1025],end:[1025],max:[1025],min:[1025],open:[1028],showLabel:[516,"show-label"]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"],[0,"dateRangeSet","onDateRangeSet"]]],[6,"smoothly-notifier",{notices:[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]],[1,"smoothly-picker",{disabled:[516],readonly:[516],maxMenuHeight:[1,"max-menu-height"],maxHeight:[1,"max-height"],emptyMenuLabel:[1025,"empty-menu-label"],multiple:[516],mutable:[4],optionStyle:[8,"option-style"],options:[16],labelSetting:[513,"label-setting"],label:[513],selections:[1040],selectNoneName:[1025,"select-none-name"],selectAllName:[1025,"select-all-name"],selectionName:[1025,"selection-name"],newOptionLabel:[1025,"new-option-label"],valueValidator:[16],isOpen:[32],empty:[32]},[[0,"optionSelect","optionSelectHandler"],[0,"optionAdd","optionAddHandler"],[0,"menuEmpty","emptyHandler"]]],[6,"smoothly-dialog",{color:[513],open:[1540],closable:[516],header:[513]},[[0,"trigger","TriggerListener"]]],[2,"smoothly-backtotop",{opacity:[1],bottom:[1],right:[1],visible:[32]}],[2,"smoothly-checkbox",{selectAll:[4,"select-all"],size:[1],intermediate:[1540],selected:[1540],disabled:[1540],t:[32]}],[6,"smoothly-submit",{processing:[1540],color:[513],expand:[513],fill:[513],disabled:[516],prevent:[4],submit:[64]},[[0,"click","handleSubmit"]]],[6,"smoothly-table-expandable-cell",{align:[1],open:[1540]},[[0,"click","onClick"]]],[6,"smoothly-table-expandable-row",{align:[1],open:[1540]},[[0,"click","onClick"]]],[0,"smoothly-urlencoded",{data:[1]}],[6,"smoothly-accordion",{value:[1025]},[[0,"smoothlyOpen","handleOpenClose"],[0,"smoothlyClose","handleOpenClose"],[0,"smoothlyAccordionItemDidLoad","onAccordionItemDidLoad"],[0,"smoothlyAccordionItemDidUnload","onAccordionItemDidUnload"]]],[6,"smoothly-accordion-item",{name:[1],brand:[1],open:[1540]}],[2,"smoothly-display",{type:[1],value:[8],currency:[1],country:[1],format:[16]}],[2,"smoothly-display-amount",{amount:[8],currency:[1]}],[2,"smoothly-frame",{url:[1],name:[1],origin:[1],send:[64]}],[6,"smoothly-popup",{visible:[1540],direction:[1537],cssVariables:[32]}],[6,"smoothly-quiet",{color:[1]}],[6,"smoothly-radio",{name:[1],value:[1],checked:[1540],tabIndex:[2,"tab-index"]}],[6,"smoothly-select",{identifier:[1],background:[513],value:[1025]}],[2,"smoothly-skeleton",{widths:[16],width:[1],color:[1],period:[2],distance:[1],align:[513]}],[6,"smoothly-table",null,[[0,"expansionLoad","handleEvents"],[0,"expansionOpen","handleEvents"]]],[6,"smoothly-table-cell"],[6,"smoothly-table-header",{name:[1]}],[6,"smoothly-table-row",null,[[0,"expansionLoad","onExpansionLoad"],[0,"expansionOpen","onExpansionOpen"]]],[6,"smoothly-input-date",{name:[513],value:[1025],open:[1028],max:[1025],min:[1025],disabled:[1028]},[[0,"dateSet","dateSetHandler"]]],[1,"smoothly-menu-options",{emptyMenuLabel:[1025,"empty-menu-label"],newOptionLabel:[1,"new-option-label"],maxMenuHeight:[1,"max-menu-height"],order:[4],optionStyle:[8,"option-style"],options:[1040],resetHighlightOnOptionsChange:[1028,"reset-highlight-on-options-change"],mutable:[4],filteredOptions:[32],highlightIndex:[32],keyword:[32],moveHighlight:[64],setHighlight:[64],getHighlighted:[64],filterOptions:[64]},[[0,"optionHover","optionHoverHandler"]]],[2,"smoothly-notification",{notice:[16],tick:[32]},[[0,"trigger","onTrigger"]]],[2,"smoothly-display-date-time",{datetime:[1]}],[2,"smoothly-spinner",{active:[516],size:[513]}],[6,"smoothly-tab",{label:[1],open:[1540]},[[0,"click","onClick"]]],[6,"smoothly-tab-switch",{selectedElement:[32]},[[0,"expansionOpen","openChanged"]]],[0,"smoothly-tuple",{tuple:[16]}],[1,"smoothly-option",{aliases:[513],dataHighlight:[1540,"data-highlight"],name:[1537],value:[1537],divider:[1540],new:[4]}],[2,"smoothly-calendar",{month:[1025],value:[1025],start:[1025],end:[1025],max:[1025],min:[1025],doubleInput:[516,"double-input"],firstSelected:[32]}],[6,"smoothly-input",{name:[513],value:[1032],type:[513],required:[1540],minLength:[1026,"min-length"],showLabel:[516,"show-label"],maxLength:[1026,"max-length"],autocomplete:[1028],pattern:[1040],placeholder:[1025],disabled:[1028],readonly:[1028],currency:[513],initialValue:[32],getFormData:[64],setKeepFocusOnReRender:[64],setSelectionRange:[64]}],[2,"smoothly-input-month",{value:[1025]}],[6,"smoothly-selector",{opened:[32],selectedElement:[32],missing:[32],filter:[32]},[[0,"click","onClick"],[0,"itemSelected","onItemSelected"],[0,"keydown","onKeyDown"]]],[6,"smoothly-item",{value:[8],selected:[1540],filter:[64]},[[0,"click","onClick"]]],[6,"smoothly-trigger",{color:[513],expand:[513],fill:[513],disabled:[516],type:[513],name:[1],value:[8]},[[0,"click","onClick"]]],[2,"smoothly-icon",{color:[513],fill:[513],name:[1],size:[513],toolTip:[1,"tool-tip"],document:[32]}]]]],e)));
@@ -1,4 +1,5 @@
1
1
  import { FunctionalComponent } from "../stencil-public-runtime";
2
+ export declare function redirect(url: string): void;
2
3
  export declare const App: FunctionalComponent<{
3
4
  label: string;
4
5
  }>;
@@ -1,6 +1,7 @@
1
1
  import { EventEmitter } from "../../stencil-public-runtime";
2
2
  import { Date } from "isoly";
3
3
  export declare class InputDate {
4
+ name: string;
4
5
  value?: Date;
5
6
  open: boolean;
6
7
  max: Date;
@@ -1,7 +1,7 @@
1
1
  export declare class SmoothlyRoom {
2
2
  label?: string;
3
3
  icon?: string;
4
- path: string;
4
+ path: string | RegExp;
5
5
  to?: string;
6
6
  render(): any;
7
7
  }
@@ -0,0 +1,7 @@
1
+ export declare type Data = {
2
+ [name: string]: Data | string;
3
+ };
4
+ export declare namespace Data {
5
+ function set(data: Data, [head, ...tail]: string[], value: string): Data;
6
+ function deepen(data: Record<string, string>): Data;
7
+ }
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from "../../stencil-public-runtime";
2
2
  import { Color, Expand, Fill } from "../../model";
3
+ import { Data } from "./Data";
3
4
  export declare class SmoothlySubmit {
4
5
  private button?;
5
6
  get form(): HTMLFormElement | undefined;
@@ -9,9 +10,7 @@ export declare class SmoothlySubmit {
9
10
  fill?: Fill;
10
11
  disabled: boolean;
11
12
  prevent?: boolean;
12
- submitEvent: EventEmitter<{
13
- [key: string]: string;
14
- }>;
13
+ submitEvent: EventEmitter<Data>;
15
14
  handleSubmit(event: UIEvent): Promise<void>;
16
15
  submit(): Promise<boolean>;
17
16
  render(): any[];
@@ -9,6 +9,7 @@ import { Color, Expand, Fill, Message, Notice, OptionType, Trigger } from "./mod
9
9
  import { CountryCode, Currency, Date, DateRange, DateTime } from "isoly";
10
10
  import { Direction, Type } from "tidily";
11
11
  import { GoogleFont } from "./model/GoogleFont";
12
+ import { Data } from "./components/submit/Data";
12
13
  export namespace Components {
13
14
  interface SmoothlyAccordion {
14
15
  "value"?: string;
@@ -118,6 +119,7 @@ export namespace Components {
118
119
  "disabled": boolean;
119
120
  "max": Date;
120
121
  "min": Date;
122
+ "name": string;
121
123
  "open": boolean;
122
124
  "value"?: Date;
123
125
  }
@@ -207,7 +209,7 @@ export namespace Components {
207
209
  interface SmoothlyRoom {
208
210
  "icon"?: string;
209
211
  "label"?: string;
210
- "path": string;
212
+ "path": string | RegExp;
211
213
  "to"?: string;
212
214
  }
213
215
  interface SmoothlySelect {
@@ -915,6 +917,7 @@ declare namespace LocalJSX {
915
917
  "disabled"?: boolean;
916
918
  "max"?: Date;
917
919
  "min"?: Date;
920
+ "name"?: string;
918
921
  "onValueChanged"?: (event: SmoothlyInputDateCustomEvent<Date>) => void;
919
922
  "open"?: boolean;
920
923
  "value"?: Date;
@@ -1014,7 +1017,7 @@ declare namespace LocalJSX {
1014
1017
  interface SmoothlyRoom {
1015
1018
  "icon"?: string;
1016
1019
  "label"?: string;
1017
- "path"?: string;
1020
+ "path"?: string | RegExp;
1018
1021
  "to"?: string;
1019
1022
  }
1020
1023
  interface SmoothlySelect {
@@ -1045,7 +1048,7 @@ declare namespace LocalJSX {
1045
1048
  "disabled"?: boolean;
1046
1049
  "expand"?: Expand;
1047
1050
  "fill"?: Fill;
1048
- "onSubmit"?: (event: SmoothlySubmitCustomEvent<{ [key: string]: string }>) => void;
1051
+ "onSubmit"?: (event: SmoothlySubmitCustomEvent<Data>) => void;
1049
1052
  "prevent"?: boolean;
1050
1053
  "processing"?: boolean;
1051
1054
  }
@@ -1,4 +1,4 @@
1
1
  export { Components, JSX } from "./components";
2
- export { App } from "./components/App";
2
+ export { App, redirect } from "./components/App";
3
3
  export { Autocomplete, ClientIdentifier, Color, Expand, Fill, GoogleFont, Message, Notice, Trigger, OptionType, } from "./model";
4
4
  export { Cosmetic } from "./utilities";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoothly",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Web component library written in Stencil.",
5
5
  "author": "PayFunc",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{g as t,f as e,h as n}from"./p-191ee4b8.js";const i=t=>!("isConnected"in t)||t.isConnected,s=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(i))})(...e)}),2e3)}})();let o;const r=(t,e)=>{var n;return"to"in t?{path:t.path,to:t.to}:{path:t.path,id:t.id,jsx:null!==(n=t.render)&&void 0!==n?n:e}},l=(t,e=o)=>({href:t,onClick:n=>{n.metaKey||n.ctrlKey||2!=n.which&&1!=n.button&&(n.preventDefault(),e.push(t))}}),u=(t,e)=>{if("string"==typeof e){if(e===t)return{}}else if("function"==typeof e){const n=e(t);if(n)return!0===n?{}:{...n}}else{const n=e.exec(t);if(n)return e.lastIndex=0,{...n}}},c=t=>t.pathname.toLowerCase(),a=(()=>{const n=window,i=new URL(n.location.href),r=(void 0,c),{state:l,onChange:a,dispose:d}=((n,i)=>{const o=((t,e=((t,e)=>t!==e))=>{let n=new Map(Object.entries(null!=t?t:{}));const i={dispose:[],get:[],set:[],reset:[]},s=()=>{n=new Map(Object.entries(null!=t?t:{})),i.reset.forEach((t=>t()))},o=t=>(i.get.forEach((e=>e(t))),n.get(t)),r=(t,s)=>{const o=n.get(t);e(s,o,t)&&(n.set(t,s),i.set.forEach((e=>e(t,s,o))))},l="undefined"==typeof Proxy?{}:new Proxy(t,{get:(t,e)=>o(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,n)=>(r(e,n),!0)}),u=(t,e)=>(i[t].push(e),()=>{((t,e)=>{const n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.length--)})(i[t],e)});return{state:l,get:o,set:r,on:u,onChange:(e,n)=>{const i=u("set",((t,i)=>{t===e&&n(i)})),s=u("reset",(()=>n(t[e])));return()=>{i(),s()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(u("set",e.set)),e.get&&t.push(u("get",e.get)),e.reset&&t.push(u("reset",e.reset)),e.dispose&&t.push(u("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{i.dispose.forEach((t=>t())),s()},reset:s,forceUpdate:t=>{const e=n.get(t);i.set.forEach((n=>n(t,e,e)))}}})(n,i);return o.use((()=>{if("function"!=typeof t)return{};const n=new Map;return{dispose:()=>n.clear(),get:e=>{const i=t();i&&((t,e,n)=>{const i=t.get(e);i?i.includes(n)||i.push(n):t.set(e,[n])})(n,e,i)},set:t=>{const i=n.get(t);i&&n.set(t,i.filter(e)),s(n)},reset:()=>{n.forEach((t=>t.forEach(e))),s(n)}}})()),o})({url:i,activePath:r(i)},((t,e,n)=>"url"===n?t.href!==e.href:t!==e)),v=t=>{history.pushState(null,null,t);const e=new URL(t,document.baseURI);l.url=e,l.activePath=r(e)},h=t=>{const{activePath:e}=l;for(let n of t){const i=u(e,n.path);if(i){if(null!=n.to){const i="string"==typeof n.to?n.to:n.to(e);return v(i),h(t)}return{params:i,route:n}}}},f=()=>{const t=new URL(n.location.href);l.url=t,l.activePath=r(t)},p=o={Switch:(t,e)=>{const n=h(e);if(n)return"function"==typeof n.route.jsx?n.route.jsx(n.params):n.route.jsx},get url(){return l.url},get activePath(){return l.activePath},push:v,onChange:a,dispose:()=>{o=void 0,n.removeEventListener("popstate",f),d()}};return f(),n.addEventListener("popstate",f),p})(),d=(t,e,i)=>{var s;const o=Object.entries(e[0]).reduce(((t,e)=>(t[e[0]]=null,t)),{}),u=c(o);function c(t){let e;return i.forEach([t],(t=>e=t)),null!=e?e:u}function d(t){return i.map([o],(e=>Object.assign(Object.assign({},e),t)))[0]}const h=e.map((t=>Object.assign(Object.assign({},c(t)),{node:t})));return n("smoothly-app",null,n("header",null,n("h1",null,n("a",Object.assign({},l(null!==(s=v(""))&&void 0!==s?s:"/")),t.label)),n("nav",null,n("ul",null,i.map([...h.filter((t=>{var e;return"nav-start"==(null===(e=t.vattrs)||void 0===e?void 0:e.slot)})),...h.filter((t=>{var e,n;return(null===(e=t.vattrs)||void 0===e?void 0:e.label)&&(null===(n=t.vattrs)||void 0===n?void 0:n.path)})),...h.filter((t=>{var e;return"nav-end"==(null===(e=t.vattrs)||void 0===e?void 0:e.slot)}))].map((t=>t.node)),(t=>{var e,n,i,s,o,r,l,c,h;(null===(e=t.vattrs)||void 0===e?void 0:e.label)&&(null===(n=t.vattrs)||void 0===n?void 0:n.path)&&(t=Object.assign(Object.assign({},u),{vtag:"a",vattrs:{href:null===(i=t.vattrs)||void 0===i?void 0:i.path},vchildren:[(null===(s=t.vattrs)||void 0===s?void 0:s.icon)?d({vtag:"smoothly-icon",vattrs:{toolTip:null===(o=t.vattrs)||void 0===o?void 0:o.label,name:null===(r=t.vattrs)||void 0===r?void 0:r.icon,size:"medium"}}):d({vtext:null===(l=t.vattrs)||void 0===l?void 0:l.label})]}));const f=v(null===(c=t.vattrs)||void 0===c?void 0:c.href);return"a"!=t.vtag?t:Object.assign(Object.assign({},t),f?{vattrs:Object.assign(Object.assign({},t.vattrs),{class:[null===(h=t.vattrs)||void 0===h?void 0:h.class,a.activePath==f?"active":""].join(" ")||void 0,href:f})}:{vattrs:Object.assign(Object.assign({},t.vattrs),{target:"new"})})})).map((t=>{var e,i;const s=c(t);return"a"!=s.vtag||(null===(e=s.vattrs)||void 0===e?void 0:e.target)?t:n("a",Object.assign({},s.vattrs,l(null===(i=s.vattrs)||void 0===i?void 0:i.href)),s.vchildren)})).map((t=>n("li",null,t))))),h.filter((t=>{var e;return"header"==(null===(e=t.vattrs)||void 0===e?void 0:e.slot)})).map((t=>t.node))),n("main",null,n(a.Switch,null,h.filter((t=>{var e;return null!=(null===(e=t.vattrs)||void 0===e?void 0:e.path)})).map((t=>{var e,i,s,o,l,u,c,a;return(null===(e=t.vattrs)||void 0===e?void 0:e.to)?n(r,{path:null!==(s=v(null===(i=t.vattrs)||void 0===i?void 0:i.path))&&void 0!==s?s:null===(o=t.vattrs)||void 0===o?void 0:o.path,to:null===(l=t.vattrs)||void 0===l?void 0:l.to}):n(r,{path:null!==(c=v(null===(u=t.vattrs)||void 0===u?void 0:u.path))&&void 0!==c?c:null===(a=t.vattrs)||void 0===a?void 0:a.path},t.node)})))))};function v(t){const e=new URL(t,document.baseURI);return""==t?new URL(document.baseURI).pathname:e.toString().startsWith(document.baseURI)?e.pathname:void 0}class h{constructor(t,e,n){switch(this.stateValue=t,this.messageValue=e,this.task=n,this.listeners=[],t){case"delayed":this.timer=window.setTimeout((()=>this.execute()),5e3);break;case"executing":this.execute();break;case"success":case"warning":case"failed":this.startCloseTimer()}}get state(){return this.stateValue}set state(t){this.stateValue!=t&&(this.stateValue=t,this.emit())}get message(){return this.messageValue}set message(t){this.messageValue!=t&&(this.messageValue=t,this.emit())}listen(t){this.listeners.push(t)}unlisten(t){this.listeners.filter((e=>e!=t))}emit(){this.listeners.forEach((t=>t(this)))}execute(){this.clearTimer(),this.task?(this.state="executing",this.task(this).then((t=>{this.messageValue=t[1],this.state=t[0]?"success":"failed",this.startCloseTimer()}))):this.state="failed"}startCloseTimer(){this.timer=window.setTimeout((()=>this.close()),15e3)}close(){this.clearTimer(),this.state="closed"}clearTimer(){this.timer&&(window.clearTimeout(this.timer),this.timer=void 0)}static delay(t,e){return new h("delayed",t,e)}static execute(t,e){return new h("executing",t,e)}static succeded(t){return new h("success",t)}static failed(t){return new h("failed",t)}static warn(t){return new h("warning",t)}}export{d as A,h as N}