@foxy.io/elements 1.16.0-beta.3 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  5. package/dist/cdn/foxy-attribute-card.js +1 -1
  6. package/dist/cdn/foxy-attribute-form.js +1 -1
  7. package/dist/cdn/foxy-cancellation-form.js +1 -1
  8. package/dist/cdn/foxy-collection-page.js +1 -1
  9. package/dist/cdn/foxy-collection-pages.js +1 -1
  10. package/dist/cdn/foxy-coupon-card.js +1 -1
  11. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  12. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  13. package/dist/cdn/foxy-coupon-form.js +1 -1
  14. package/dist/cdn/foxy-custom-field-card.js +1 -1
  15. package/dist/cdn/foxy-custom-field-form.js +1 -1
  16. package/dist/cdn/foxy-customer-api.js +1 -1
  17. package/dist/cdn/foxy-customer-card.js +1 -1
  18. package/dist/cdn/foxy-customer-form.js +1 -1
  19. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  20. package/dist/cdn/foxy-customer-portal.js +7 -7
  21. package/dist/cdn/foxy-customer.js +6 -6
  22. package/dist/cdn/foxy-customers-table.js +1 -1
  23. package/dist/cdn/foxy-discount-card.js +1 -1
  24. package/dist/cdn/foxy-donation.js +1 -1
  25. package/dist/cdn/foxy-email-template-form.js +1 -1
  26. package/dist/cdn/foxy-error-entry-card.js +1 -1
  27. package/dist/cdn/foxy-form-dialog.js +1 -1
  28. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  29. package/dist/cdn/foxy-gift-card-card.js +1 -1
  30. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  31. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  32. package/dist/cdn/foxy-gift-card-form.js +1 -1
  33. package/dist/cdn/foxy-i18n.js +1 -1
  34. package/dist/cdn/foxy-items-form.js +1 -1
  35. package/dist/cdn/foxy-nucleon-element.js +1 -1
  36. package/dist/cdn/foxy-pagination.js +1 -1
  37. package/dist/cdn/foxy-payment-card.js +1 -1
  38. package/dist/cdn/foxy-payment-method-card.js +1 -1
  39. package/dist/cdn/foxy-query-builder.js +1 -1
  40. package/dist/cdn/foxy-sign-in-form.js +1 -1
  41. package/dist/cdn/foxy-spinner.js +2 -2
  42. package/dist/cdn/foxy-subscription-card.js +1 -1
  43. package/dist/cdn/foxy-subscription-form.js +4 -4
  44. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  45. package/dist/cdn/foxy-table.js +1 -1
  46. package/dist/cdn/foxy-tax-card.js +1 -1
  47. package/dist/cdn/foxy-tax-form.js +1 -1
  48. package/dist/cdn/foxy-template-config-form.js +1 -1
  49. package/dist/cdn/foxy-template-form.js +1 -1
  50. package/dist/cdn/foxy-transaction-card.js +1 -1
  51. package/dist/cdn/foxy-transactions-table.js +1 -1
  52. package/dist/cdn/foxy-user-form.js +1 -1
  53. package/dist/cdn/foxy-users-table.js +1 -1
  54. package/dist/cdn/{shared-f3b35364.js → shared-07134f93.js} +1 -1
  55. package/dist/cdn/{shared-7823570c.js → shared-073cb8e9.js} +1 -1
  56. package/dist/cdn/{shared-70d6309f.js → shared-0f38a631.js} +1 -1
  57. package/dist/cdn/{shared-9aed33de.js → shared-1a67bc75.js} +4 -4
  58. package/dist/cdn/{shared-ebd1dc3f.js → shared-1a91d467.js} +1 -1
  59. package/dist/cdn/shared-1de261b3.js +1 -0
  60. package/dist/cdn/shared-21419f10.js +1 -0
  61. package/dist/cdn/{shared-99065f2a.js → shared-218ba06e.js} +1 -1
  62. package/dist/cdn/{shared-ea015924.js → shared-30dd6de7.js} +15 -15
  63. package/dist/cdn/shared-39e3ae67.js +1 -0
  64. package/dist/cdn/{shared-571516a4.js → shared-448781f9.js} +1 -1
  65. package/dist/cdn/{shared-70c7bf00.js → shared-46ee137f.js} +10 -10
  66. package/dist/cdn/shared-4f1f4281.js +1 -0
  67. package/dist/cdn/{shared-7991f6c1.js → shared-4f424828.js} +2 -2
  68. package/dist/cdn/shared-50765afb.js +1 -0
  69. package/dist/cdn/{shared-447623da.js → shared-548f721a.js} +1 -1
  70. package/dist/cdn/{shared-50f0611d.js → shared-5535f38f.js} +1 -1
  71. package/dist/cdn/shared-55481c27.js +1 -0
  72. package/dist/cdn/{shared-1faaa1b6.js → shared-59e44f29.js} +1 -1
  73. package/dist/cdn/{shared-7a93239c.js → shared-5a54a9bc.js} +1 -1
  74. package/dist/cdn/{shared-9b0b7e4d.js → shared-60126eee.js} +1 -1
  75. package/dist/cdn/shared-63eaded9.js +159 -0
  76. package/dist/cdn/{shared-3a7ec144.js → shared-65dfd512.js} +1 -1
  77. package/dist/cdn/{shared-d3bf9ac0.js → shared-6d45a07b.js} +2 -2
  78. package/dist/cdn/{shared-42457145.js → shared-6f412a43.js} +6 -6
  79. package/dist/cdn/{shared-afa7534d.js → shared-756034e4.js} +1 -1
  80. package/dist/cdn/{shared-84731e61.js → shared-7f0a9790.js} +1 -1
  81. package/dist/cdn/shared-81cd9eac.js +1 -0
  82. package/dist/cdn/shared-87aa97d2.js +1 -0
  83. package/dist/cdn/shared-8b20bc23.js +12 -0
  84. package/dist/cdn/{shared-03949800.js → shared-8f2c9582.js} +1 -1
  85. package/dist/cdn/{shared-0479553e.js → shared-9221e6b2.js} +1 -1
  86. package/dist/cdn/{shared-15d3d613.js → shared-a040d79d.js} +1 -1
  87. package/dist/cdn/shared-a62e1a93.js +1 -0
  88. package/dist/cdn/shared-ad16479c.js +1 -0
  89. package/dist/cdn/{shared-11c2efc8.js → shared-b0f0e8b5.js} +1 -1
  90. package/dist/cdn/shared-b58b8353.js +1 -0
  91. package/dist/cdn/{shared-d519a301.js → shared-b710881a.js} +2 -2
  92. package/dist/cdn/shared-c64bc1a0.js +1 -0
  93. package/dist/cdn/shared-ce2ac6b4.js +1 -0
  94. package/dist/cdn/shared-db4f299b.js +1 -0
  95. package/dist/cdn/shared-df730f90.js +1 -0
  96. package/dist/cdn/{shared-712b7f69.js → shared-ea9f7255.js} +1 -1
  97. package/dist/cdn/{shared-6b326bd8.js → shared-f4ad24f4.js} +1 -1
  98. package/dist/cdn/shared-f6e51811.js +1 -0
  99. package/dist/cdn/{shared-7eaa7ada.js → shared-f7fbb249.js} +10 -10
  100. package/dist/cdn/{shared-dfb99fb9.js → shared-fab8c705.js} +10 -10
  101. package/dist/cdn/shared-ff79f3f9.js +230 -0
  102. package/dist/cdn/translations/customer-portal/se.json +223 -0
  103. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +3 -12
  104. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
  105. package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js +1 -2
  106. package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js.map +1 -1
  107. package/dist/elements/public/index.d.ts +0 -3
  108. package/dist/elements/public/index.defined.d.ts +0 -3
  109. package/dist/elements/public/index.defined.js +0 -3
  110. package/dist/elements/public/index.defined.js.map +1 -1
  111. package/dist/elements/public/index.js +0 -3
  112. package/dist/elements/public/index.js.map +1 -1
  113. package/dist/mixins/themeable.js +0 -6571
  114. package/dist/mixins/themeable.js.map +1 -1
  115. package/dist/mixins/translatable.js +1 -1
  116. package/dist/mixins/translatable.js.map +1 -1
  117. package/package.json +3 -3
  118. package/dist/cdn/foxy-report-form.js +0 -195
  119. package/dist/cdn/foxy-reports-table.js +0 -41
  120. package/dist/cdn/foxy-swipe-actions.js +0 -1
  121. package/dist/cdn/shared-102cccce.js +0 -1
  122. package/dist/cdn/shared-1b98e51a.js +0 -1
  123. package/dist/cdn/shared-1dedbcf4.js +0 -1
  124. package/dist/cdn/shared-3d12e221.js +0 -1
  125. package/dist/cdn/shared-5499ce50.js +0 -201
  126. package/dist/cdn/shared-58debe59.js +0 -1
  127. package/dist/cdn/shared-5bf4b9f9.js +0 -1
  128. package/dist/cdn/shared-5bf947db.js +0 -1
  129. package/dist/cdn/shared-667a8855.js +0 -1
  130. package/dist/cdn/shared-7f33a83a.js +0 -159
  131. package/dist/cdn/shared-864a9f46.js +0 -1
  132. package/dist/cdn/shared-8c308dc1.js +0 -12
  133. package/dist/cdn/shared-8c3463b5.js +0 -1
  134. package/dist/cdn/shared-930bbe32.js +0 -1
  135. package/dist/cdn/shared-a821b675.js +0 -1
  136. package/dist/cdn/shared-b4159722.js +0 -1
  137. package/dist/cdn/shared-c937b8af.js +0 -29
  138. package/dist/cdn/shared-e6dd0f55.js +0 -1
  139. package/dist/cdn/shared-f7a9db82.js +0 -1
  140. package/dist/cdn/shared-f92fa56a.js +0 -1
  141. package/dist/cdn/translations/report-form/en.json +0 -38
  142. package/dist/cdn/translations/reports-table/en.json +0 -21
  143. package/dist/elements/public/ReportForm/ReportForm.d.ts +0 -48
  144. package/dist/elements/public/ReportForm/ReportForm.js +0 -391
  145. package/dist/elements/public/ReportForm/ReportForm.js.map +0 -1
  146. package/dist/elements/public/ReportForm/index.d.ts +0 -11
  147. package/dist/elements/public/ReportForm/index.js +0 -13
  148. package/dist/elements/public/ReportForm/index.js.map +0 -1
  149. package/dist/elements/public/ReportForm/types.d.ts +0 -17
  150. package/dist/elements/public/ReportForm/types.js +0 -2
  151. package/dist/elements/public/ReportForm/types.js.map +0 -1
  152. package/dist/elements/public/ReportForm/utils.d.ts +0 -16
  153. package/dist/elements/public/ReportForm/utils.js +0 -73
  154. package/dist/elements/public/ReportForm/utils.js.map +0 -1
  155. package/dist/elements/public/ReportsTable/ReportsTable.d.ts +0 -21
  156. package/dist/elements/public/ReportsTable/ReportsTable.js +0 -101
  157. package/dist/elements/public/ReportsTable/ReportsTable.js.map +0 -1
  158. package/dist/elements/public/ReportsTable/index.d.ts +0 -4
  159. package/dist/elements/public/ReportsTable/index.js +0 -6
  160. package/dist/elements/public/ReportsTable/index.js.map +0 -1
  161. package/dist/elements/public/ReportsTable/types.d.ts +0 -3
  162. package/dist/elements/public/ReportsTable/types.js +0 -2
  163. package/dist/elements/public/ReportsTable/types.js.map +0 -1
  164. package/dist/elements/public/SwipeActions/SwipeActions.d.ts +0 -13
  165. package/dist/elements/public/SwipeActions/SwipeActions.js +0 -116
  166. package/dist/elements/public/SwipeActions/SwipeActions.js.map +0 -1
  167. package/dist/elements/public/SwipeActions/index.d.ts +0 -2
  168. package/dist/elements/public/SwipeActions/index.js +0 -4
  169. package/dist/elements/public/SwipeActions/index.js.map +0 -1
@@ -1,35 +1,35 @@
1
- import"./shared-9b0b7e4d.js";import"./shared-70c7bf00.js";import{_ as e}from"./shared-5bf947db.js";import{s as l,h as t,c as n,L as s}from"./shared-7f33a83a.js";import{c as a}from"./shared-4e709717.js";import{i as o}from"./shared-d3bf9ac0.js";import{s as i}from"./shared-2061be9a.js";import{r}from"./shared-d519a301.js";import{R as d,T as u,a as c}from"./shared-c937b8af.js";var v,p;!function(e){e.Attribute="attribute",e.Boolean="boolean",e.String="string",e.Number="number",e.Date="date",e.Any="any"}(v||(v={})),function(e){e.LessThanOrEqual="lessthanorequal",e.LessThan="lessthan",e.GreaterThanOrEqual="greaterthanorequal",e.GreaterThan="greaterthan",e.IsDefined="isdefined",e.Not="not",e.In="in"}(p||(p={}));let f;const h=l(f||(f=(e=>e)`
1
+ import"./shared-60126eee.js";import"./shared-46ee137f.js";import{s as e,h as l,_ as t,j as n,L as s}from"./shared-63eaded9.js";import{c as a}from"./shared-4e709717.js";import{i}from"./shared-6d45a07b.js";import{s as o}from"./shared-2061be9a.js";import{r}from"./shared-b710881a.js";import{R as u,T as d,a as c}from"./shared-f6e51811.js";var v,p;!function(e){e.Attribute="attribute",e.Boolean="boolean",e.String="string",e.Number="number",e.Date="date",e.Any="any"}(v||(v={})),function(e){e.LessThanOrEqual="lessthanorequal",e.LessThan="lessthan",e.GreaterThanOrEqual="greaterthanorequal",e.GreaterThan="greaterthan",e.IsDefined="isdefined",e.Not="not",e.In="in"}(p||(p={}));let f;const h=e(f||(f=(e=>e)`
2
2
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M26.4 14.7399C26.4 15.2922 25.9523 15.7399 25.4 15.7399H10.6C10.0477 15.7399 9.60001 15.2922 9.60001 14.7399V14.2C9.60001 13.6477 10.0477 13.2 10.6 13.2H25.4C25.9523 13.2 26.4 13.6477 26.4 14.2V14.7399ZM26.4 21.8C26.4 22.3523 25.9523 22.8 25.4 22.8H10.6C10.0477 22.8 9.60001 22.3523 9.60001 21.8V21.2601C9.60001 20.7078 10.0477 20.2601 10.6 20.2601H25.4C25.9523 20.2601 26.4 20.7078 26.4 21.2601V21.8Z" class="fill-current"/>
4
4
  </svg>
5
- `));let g;const C=l(g||(g=(e=>e)`
5
+ `));let g;const C=e(g||(g=(e=>e)`
6
6
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
7
7
  <path d="M12.8656 14.6695C12.3425 14.4581 12 13.9503 12 13.386C12 12.3748 13.0489 11.7048 13.9663 12.1299L23.8937 16.7295C24.5323 17.0254 24.941 17.6652 24.941 18.369C24.941 19.0735 24.5316 19.7137 23.8921 20.0092L13.971 24.5938C13.0509 25.019 12 24.347 12 23.3334C12 22.7709 12.3394 22.264 12.8594 22.0496L21.341 18.3046L12.8656 14.6695Z" class="fill-current"/>
8
8
  </svg>
9
- `));let b;const m=l(b||(b=(e=>e)`
9
+ `));let b;const m=e(b||(b=(e=>e)`
10
10
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
11
11
  <path d="M13.1293 19.569C12.6063 19.7786 12.264 20.2821 12.264 20.8416C12.264 21.8442 13.3124 22.5086 14.2296 22.0871L24.1531 17.5264C24.7915 17.233 25.2 16.5986 25.2 15.9008C25.2 15.2022 24.7907 14.5674 24.1515 14.2744L14.2342 9.72862C13.3144 9.30703 12.264 9.97337 12.264 10.9784C12.264 11.5361 12.6032 12.0388 13.1231 12.2513L21.6014 15.9646L13.1293 19.569Z" class="fill-current"/>
12
12
  <path fill-rule="evenodd" clip-rule="evenodd" d="M25.0832 20.8977C24.7867 20.2374 24.0068 19.9404 23.3411 20.2344L13.1498 24.7352C12.4841 25.0292 12.1847 25.8028 12.4811 26.4632C12.7775 27.1235 13.5575 27.4205 14.2232 27.1265L24.4144 22.6257C25.0802 22.3317 25.3796 21.5581 25.0832 20.8977Z" class="fill-current"/>
13
13
  </svg>
14
- `));let w;const x=l(w||(w=(e=>e)`
14
+ `));let w;const x=e(w||(w=(e=>e)`
15
15
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
16
16
  <path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/>
17
17
  <path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/>
18
18
  </svg>
19
- `));let V;const H=l(V||(V=(e=>e)`
19
+ `));let V;const H=e(V||(V=(e=>e)`
20
20
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
21
21
  <path fill-rule="evenodd" clip-rule="evenodd" d="M20.05 23.58L20.04 23.59L17.64 21.19L18.7 20.13L20.05 21.48L22.54 19L23.6 20.06L20.06 23.6L20.05 23.58ZM18 8C12.5 8 8 12.5 8 18C8 23.5 12.5 28 18 28C23.5 28 28 23.5 28 18C28 12.5 23.5 8 18 8ZM13.34 12.28L14.75 13.69L16.16 12.28L17.22 13.34L15.81 14.75L17.22 16.16L16.16 17.22L14.75 15.81L13.34 17.22L12.28 16.16L13.69 14.75L12.28 13.34L13.34 12.28ZM18 26C15.8 26 13.8 25.1 12.3 23.7L23.7 12.3C25.1 13.8 26 15.8 26 18C26 22.4 22.4 26 18 26Z" class="fill-current"/>
22
22
  </svg>
23
- `));let $;const L=l($||($=(e=>e)`
23
+ `));let $;const L=e($||($=(e=>e)`
24
24
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
25
25
  <path d="M22.8754 22.054C23.3985 22.2655 23.741 22.7733 23.741 23.3375C23.741 24.3487 22.6922 25.0187 21.7747 24.5936L11.8473 19.994C11.2087 19.6981 10.8 19.0583 10.8 18.3545C10.8 17.65 11.2094 17.0098 11.8489 16.7143L21.7701 12.1297C22.6902 11.7045 23.741 12.3765 23.741 13.3902C23.741 13.9526 23.4017 14.4596 22.8816 14.6739L14.4 18.4189L22.8754 22.054Z" class="fill-current"/>
26
26
  </svg>
27
- `));let y;const M=l(y||(y=(e=>e)`
27
+ `));let y;const M=e(y||(y=(e=>e)`
28
28
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
29
29
  <path d="M22.8754 19.654C23.3985 19.8655 23.741 20.3733 23.741 20.9375C23.741 21.9487 22.6922 22.6187 21.7747 22.1936L11.8473 17.594C11.2087 17.2981 10.8 16.6584 10.8 15.9545C10.8 15.25 11.2094 14.6098 11.8489 14.3143L21.7701 9.72971C22.6902 9.30453 23.741 9.97655 23.741 10.9902C23.741 11.5527 23.4017 12.0596 22.8816 12.2739L14.4 16.0189L22.8754 19.654Z" class="fill-current"/>
30
30
  <path fill-rule="evenodd" clip-rule="evenodd" d="M10.9169 20.9941C11.2134 20.3281 11.9937 20.0286 12.6597 20.3251L22.8548 24.8643C23.5208 25.1608 23.8203 25.9411 23.5238 26.6071C23.2273 27.2731 22.447 27.5726 21.781 27.2761L11.5859 22.7369C10.9199 22.4404 10.6204 21.6601 10.9169 20.9941Z" class="fill-current"/>
31
31
  </svg>
32
- `));let Z;const N=l(Z||(Z=(e=>e)`
32
+ `));let Z;const N=e(Z||(Z=(e=>e)`
33
33
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
34
34
  <path fill-rule="evenodd" clip-rule="evenodd" d="M24.0049 7.11C24.6649 7.49107 24.8911 8.33507 24.51 8.99511L13.1621 28.6503C12.781 29.3103 11.937 29.5365 11.277 29.1554C10.6169 28.7743 10.3908 27.9303 10.7719 27.2703L22.1198 7.61511C22.5009 6.95507 23.3448 6.72892 24.0049 7.11Z" class="fill-current"/>
35
35
  <path d="M17.5097 13.2H10.8C10.1373 13.2 9.60001 13.7373 9.60001 14.4V14.5399C9.60001 15.2026 10.1373 15.7399 10.8 15.7399H16.0433L17.5097 13.2Z" class="fill-current"/>
@@ -37,33 +37,33 @@ import"./shared-9b0b7e4d.js";import"./shared-70c7bf00.js";import{_ as e}from"./s
37
37
  <path d="M17.9254 22.8H25.2C25.8627 22.8 26.4 22.2627 26.4 21.6V21.4601C26.4 20.7973 25.8627 20.2601 25.2 20.2601H19.3918L17.9254 22.8Z" class="fill-current"/>
38
38
  <path d="M22.0015 15.7399H25.2C25.8627 15.7399 26.4 15.2026 26.4 14.5399V14.4C26.4 13.7373 25.8627 13.2 25.2 13.2H23.468L22.0015 15.7399Z" class="fill-current"/>
39
39
  </svg>
40
- `));let I;const j=l(I||(I=(e=>e)`
40
+ `));let I;const j=e(I||(I=(e=>e)`
41
41
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
42
42
  <path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/>
43
43
  <path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/>
44
44
  </svg>
45
- `));let B;const T=l(B||(B=(e=>e)`
45
+ `));let B;const T=e(B||(B=(e=>e)`
46
46
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
47
47
  <path d="M10 13V15C10 15.55 9.55 16 9 16H8V20H9C9.55 20 10 20.45 10 21V23C10 24.65 11.35 26 13 26H16V24H13C12.45 24 12 23.55 12 23V21C12 19.7 11.16 18.58 10 18.17V17.83C11.16 17.42 12 16.3 12 15V13C12 12.45 12.45 12 13 12H16V10H13C11.35 10 10 11.35 10 13Z" class="fill-current"/>
48
48
  <path d="M27 16C26.45 16 26 15.55 26 15V13C26 11.35 24.65 10 23 10H20V12H23C23.55 12 24 12.45 24 13V15C24 16.3 24.84 17.42 26 17.83V18.17C24.84 18.58 24 19.69 24 21V23C24 23.55 23.55 24 23 24H20V26H23C24.65 26 26 24.65 26 23V21C26 20.45 26.45 20 27 20H28V16H27Z" class="fill-current"/>
49
49
  </svg>
50
- `));let A;const D=l(A||(A=(e=>e)`
50
+ `));let A;const D=e(A||(A=(e=>e)`
51
51
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
52
52
  <path d="M23.8333 17.0588H22.0833V11.7647H20.3333V10H23.8333V17.0588Z" class="fill-current"/>
53
53
  <path d="M15.6667 10H12.1667C11.525 10 11 10.5294 11 11.1765V15.8824C11 16.5294 11.525 17.0588 12.1667 17.0588H15.6667C16.3083 17.0588 16.8333 16.5294 16.8333 15.8824V11.1765C16.8333 10.5294 16.3083 10 15.6667 10ZM15.0833 15.2941H12.75V11.7647H15.0833V15.2941Z" class="fill-current"/>
54
54
  <path d="M15.6667 26.4706H13.9167V21.1765H12.1667V19.4118H15.6667V26.4706Z" class="fill-current"/>
55
55
  <path d="M23.8333 19.4118H20.3333C19.6917 19.4118 19.1667 19.9412 19.1667 20.5882V25.2941C19.1667 25.9412 19.6917 26.4706 20.3333 26.4706H23.8333C24.475 26.4706 25 25.9412 25 25.2941V20.5882C25 19.9412 24.475 19.4118 23.8333 19.4118ZM23.25 24.7059H20.9167V21.1765H23.25V24.7059Z" class="fill-current"/>
56
56
  </svg>
57
- `));let _;const O=l(_||(_=(e=>e)`
57
+ `));let _;const O=e(_||(_=(e=>e)`
58
58
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
59
59
  <path d="M25 10H24V8H22V10H14V8H12V10H11C9.89 10 9.01 10.9 9.01 12L9 26C9 27.1 9.89 28 11 28H25C26.1 28 27 27.1 27 26V12C27 10.9 26.1 10 25 10ZM25 26H11V16H25V26ZM25 14H11V12H25V14ZM23 19H18V24H23V19Z" class="fill-current"/>
60
60
  </svg>
61
- `));let q;const E=l(q||(q=(e=>e)`
61
+ `));let q;const E=e(q||(q=(e=>e)`
62
62
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
63
63
  <path d="M26.5 16L27 14H23L24 10H22L21 14H17L18 10H16L15 14H11L10.5 16H14.5L13.5 20H9.5L9 22H13L12 26H14L15 22H19L18 26H20L21 22H25L25.5 20H21.5L22.5 16H26.5ZM19.5 20H15.5L16.5 16H20.5L19.5 20Z" class="fill-current"/>
64
64
  </svg>
65
- `));let S;const k=l(S||(S=(e=>e)`
65
+ `));let S;const k=e(S||(S=(e=>e)`
66
66
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
67
67
  <path d="M11 11V14H16.5V26H19.5V14H25V11H11Z" class="fill-current"/>
68
68
  </svg>
69
- `));let z,R,G,U,F,W=e=>e;function Q(e){var l,n,s;const o=null===(n=null===(l=e.list)||void 0===l?void 0:l.every((l=>l.value!==e.value)))||void 0===n||n;return t(z||(z=W` <label class="flex items-center cursor-pointer transition-colors group text-tertiary hover-bg-contrast-5"> <div class="relative flex-1 min-w-0 overflow-hidden"> <select class="${0}" @change="${0}"> ${0} ${0} </select> </div> ${0} </label> `),a({"cursor-pointer bg-transparent relative appearance-none flex h-m px-s":!0,"font-medium w-full max-w-full whitespace-nowrap focus-outline-none":!0,"text-tertiary":o,"text-body":!o}),(l=>{const t=l.currentTarget,n=t.options[t.options.selectedIndex].value;e.onChange(n)}),o?t(R||(R=W`<option value disabled="disabled" ?selected="${0}">${0}</option>`),o,e.t(e.label)):"",null===(s=e.list)||void 0===s?void 0:s.map((({label:l,value:n})=>t(G||(G=W` <option value="${0}" ?selected="${0}"> ${0} </option> `),n,n===e.value,e.t(l)))),o?"":t(U||(U=W` <span class="font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block"> ${0} </span> ${0} `),e.t(e.label),e.clearable?t(F||(F=W` <button aria-label="${0}" class="w-s h-s mr-xs text-body flex items-center justify-center transition-colors rounded-full focus-outline-none focus-ring-2 focus-ring-primary-50 hover-bg-contrast-5 hover-text-error" @click="${0}"> <iron-icon aria-hidden="true" class="icon-inline text-l" icon="icons:remove-circle-outline"> </iron-icon> </button> `),e.t("delete"),(()=>e.onChange(""))):""))}let J,K,P,X,Y,ee=e=>e;function le(e){var l;const n=`${null!==(l=e.id)&&void 0!==l?l:String(Math.floor(Math.random()*Math.pow(10,8)))}-list`,s=!!e.displayValue;let r=e.value;if("date"===e.type){const l=new Date(e.value);isNaN(l.getTime())||(r=i(l))}return t(J||(J=ee` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> ${0} <input placeholder="${0}" class="${0}" list="${0}" type="${0}" .value="${0}" ?disabled="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} ${0} </label> `),s?t(K||(K=ee` <div aria-hidden="true" class="absolute inset-0 h-m px-s font-medium text-body flex items-center"> <div class="truncate">${0}</div> </div> `),e.t(e.displayValue)):"",r||"date"===e.type?"":e.t(e.label),a({"bg-base text-body relative appearance-none flex h-m px-s font-medium w-full":!0,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0,"opacity-0 focus-opacity-100":s}),o(e.list?n:void 0),e.type,r,e.disabled,(l=>{var t,n;const s=l.currentTarget;"date"===e.type?e.onChange(null!==(n=null===(t=s.valueAsDate)||void 0===t?void 0:t.toISOString())&&void 0!==n?n:s.value):e.onChange(s.value)}),a({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!r||"date"===e.type,"sr-only":!r&&"date"!==e.type}),e.t(e.label),e.list?t(P||(P=ee` <datalist id="${0}"> ${0} </datalist> `),n,e.list.map((({label:l,value:n})=>t(X||(X=ee`<option value="${0}">${0}</option>`),n,e.t(l))))):"",e.disabled?"":t(Y||(Y=ee` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let te,ne,se=e=>e;let ae,oe=e=>e;function ie({parsedValue:l,option:t,options:n,t:s,onChange:a}){return le({displayValue:null==t?void 0:t.label,value:l.path,label:"field",list:n.map((l=>e(e({},l),{},{value:l.path}))),type:"text",id:"path",t:s,onChange:e=>a({operator:null,value:"",path:e})})}let re,de=e=>e;let ue,ce,ve=e=>e;function pe(l){var n,s;const{parsedValue:o,options:i,t:d,isNested:u,isFullSize:c,onChange:f,onDelete:g,onConvert:b}=l,w=null!==(n=i.find((e=>e.path===o.path)))&&void 0!==n?n:null,V=null!==(s=null==w?void 0:w.type)&&void 0!==s?s:v.Any,$=o.operator,y={parsedValue:o,option:w,options:i,t:d,onChange:f},Z={[v.Attribute]:T,[v.Boolean]:D,[v.Number]:E,[v.String]:k,[v.Date]:O,[v.Any]:j};return t(ue||(ue=ve` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="${0}"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base" title="${0}"> <div class="w-m h-m text-tertiary" aria-hidden="true"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base">${0}</div> <div class="bg-base"> ${0} </div> </div> </div> </div> <div class="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:remove-circle-outline"> </iron-icon> </button> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:add-circle-outline"> </iron-icon> </button> </div> </div> `),d("query_builder_rule"),a({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!u,"border-contrast-50":!!u}),d(`type_${V}`),w?Z[V]:j,o.path&&(V===v.Attribute||o.name)?t(ce||(ce=ve` <div class="bg-contrast-10 grid gap-1px grid-cols-1 sm-grid-cols-2"> <div class="bg-base">${0}</div> <div class="bg-base">${0}</div> </div> `),ie(y),function(l){var t;return le({value:null!==(t=l.parsedValue.name)&&void 0!==t?t:"",label:"name",type:"text",t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{name:t}))})}(y)):ie(y),function(l){const n=l.parsedValue.operator,s={[p.GreaterThan]:C,[p.GreaterThanOrEqual]:m,[p.In]:x,[p.IsDefined]:H,[p.LessThan]:L,[p.LessThanOrEqual]:M,[p.Not]:N},o={[v.Attribute]:[p.In,p.Not,p.IsDefined],[v.Boolean]:[],[v.String]:[p.In,p.Not],[v.Number]:[p.In,p.Not,p.GreaterThan,p.LessThan,p.GreaterThanOrEqual,p.LessThanOrEqual],[v.Date]:[p.In,p.Not],[v.Any]:Object.values(p)},i=l.option?o[l.option.type]:l.parsedValue.name?Object.values(p):Object.values(p).filter((e=>e!==p.IsDefined)),r=0===i.length||!l.parsedValue.path;return t(ae||(ae=oe` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),l.t(`operator_${null!=n?n:"equal"}`),a({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-tertiary cursor-default":r,"hover-bg-contrast-5":!r}),r,(()=>{var t;const s=n?i.indexOf(n):-1,a=null!==(t=i[s+1])&&void 0!==t?t:null;l.onChange(e(e({},l.parsedValue),{},{operator:a,value:l.parsedValue.value}))}),n?s[n]:h)}(y),$===p.In?function(l){var n,s,a,o;const i=(null===(n=l.option)||void 0===n?void 0:n.list)?Q:le,d=l.parsedValue.value.split(","),u=null!==(a=null===(s=l.option)||void 0===s?void 0:s.type)&&void 0!==a?a:v.Any,c=u===v.Number?"number":u===v.Date?"date":"text",p=null===(o=l.option)||void 0===o?void 0:o.list;return t(te||(te=se` <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> `),r([...d.filter((e=>!!e)),null],((e,l)=>l),((n,s)=>{var a;return t(ne||(ne=se` <div class="bg-base"> ${0} </div> `),i({type:c,list:p,t:l.t,value:null!=n?n:"",label:n?String(s+1):"add_value",clearable:!0,displayValue:null===(a=null==p?void 0:p.find((e=>e.value===n)))||void 0===a?void 0:a.label,onChange:t=>{t?d[s]=t:d.splice(s,1),l.onChange(e(e({},l.parsedValue),{},{value:d.join(",")}))}}))})))}(y):$===p.IsDefined?function(l){return Q({value:l.parsedValue.value,label:"value",list:[{label:"is_defined_true",value:"true"},{label:"is_defined_false",value:"false"}],t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{value:t}))})}(y):V===v.Boolean?function(l){var t,n,s,a,o,i;const{parsedValue:r,option:d,t:u,onChange:c}=l,v=null!==(s=null===(n=null===(t=null==d?void 0:d.list)||void 0===t?void 0:t.find((e=>"false"===e.value)))||void 0===n?void 0:n.label)&&void 0!==s?s:"false",p=[{label:null!==(i=null===(o=null===(a=null==d?void 0:d.list)||void 0===a?void 0:a.find((e=>"true"===e.value)))||void 0===o?void 0:o.label)&&void 0!==i?i:"true",value:"true"},{label:v,value:"false"}];return Q({value:r.value,label:"value",list:p,t:u,onChange:l=>c(e(e({},r),{},{value:l}))})}(y):null===$&&[v.Number,v.Date].includes(V)?function(l){var n,s,a;const{t:o,parsedValue:i,option:r,onChange:d}=l,[u,c]=i.value.split(".."),p=(null==r?void 0:r.list)?Q:le,f=null!==(n=null==r?void 0:r.type)&&void 0!==n?n:v.Any,h=f===v.Number?"number":f===v.Date?"date":"text",g=null==r?void 0:r.list;return t(re||(re=de` <div class="grid bg-contrast-10 gap-1px grid-cols-1 grid-rows-2 sm-grid-cols-2 sm-grid-rows-1"> <div class="bg-base"> ${0} </div> <div class="bg-base"> ${0} </div> </div> `),p({displayValue:null===(s=null==g?void 0:g.find((e=>e.value===u)))||void 0===s?void 0:s.label,value:u,label:"range_from",type:h,list:g,t:o,onChange:l=>d(e(e({},i),{},{value:`${l}..${c}`}))}),p({displayValue:null===(a=null==g?void 0:g.find((e=>e.value===c)))||void 0===a?void 0:a.label,label:"range_to",value:c,type:h,list:g,t:o,onChange:l=>d(e(e({},i),{},{value:`${u}..${l}`}))}))}(y):function(l){var t,n,s,a;const{t:o,option:i,parsedValue:r,onChange:d}=l,u=(null==i?void 0:i.list)?Q:le,c=null!==(t=null==i?void 0:i.type)&&void 0!==t?t:v.Any;return u({displayValue:null===(s=null===(n=null==i?void 0:i.list)||void 0===n?void 0:n.find((e=>e.value===r.value)))||void 0===s?void 0:s.label,disabled:!r.path,value:null!==(a=r.value)&&void 0!==a?a:"",label:"value",type:c===v.Number?"number":c===v.Date?"date":"text",list:null==i?void 0:i.list,t:o,onChange:l=>d(e(e({},r),{},{value:l}))})}(y),a({"-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center":!0,"border-t border-b border-transparent divide-y divide-transparent":!0,hidden:!!c,flex:!c}),d("delete"),a({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!0,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!o.path}),!o.path,g,d("add_or_clause"),a({"box-content flex w-m h-m rounded-full transition-colors text-success":!0,"hover-bg-contrast-5 focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!o.path||!!u}),!o.path,b)}let fe,he,ge,Ce,be=e=>e;function me(l){const n=t(fe||(fe=be`<div class="h-xs"></div>`)),s=t(he||(he=be` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-semibold text-xs text-contrast-30"> ${0} </div> <div class="flex-1 border-t border-contrast-20"></div> <div class="w-m ml-s flex-shrink-0"></div> <div class="hidden sm-block w-m flex-shrink-0"></div> </div> `),l.t("or"));return t(ge||(ge=be` <div aria-label="${0}"> ${0} </div> `),l.t("query_builder_group"),r([...l.parsedValues,null],((e,l)=>String(l)),((a,o)=>{const i=o>0?l.isNested?s:n:"";return null===a?[i,pe({isFullSize:!l.isNested&&0===l.parsedValues.length,isNested:l.isNested,options:l.options,parsedValue:{path:"",operator:null,value:""},t:l.t,onChange:e=>l.onChange([...l.parsedValues,e])})]:Array.isArray(a)?[i,t(Ce||(Ce=be` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),me({parsedValues:a,isNested:!0,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues],n=e;t[o]=e.length>1?n:n[0],l.onChange(t)}}))]:[i,pe({parsedValue:a,isNested:l.isNested,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues];t[o]=e,l.onChange(t)},onDelete:()=>{const e=l.parsedValues.filter(((e,l)=>l!==o));l.onChange(e)},onConvert:()=>{const t=[...l.parsedValues];t[o]=[a,e(e({},a),{},{operator:null,value:""})],l.onChange(t)}})]})))}function we(e){var l;const[t,n]=e.split("=").map(decodeURIComponent),s=null!==(l=Object.values(p).find((e=>t.endsWith(`:${e}`))))&&void 0!==l?l:null;let a,o=t.substring(0,s?t.lastIndexOf(":"):void 0);const i=t.lastIndexOf("[");return o.endsWith("]")&&-1!==i&&(a=o.substring(i+1,o.length-1),o=o.substring(0,i)),{name:a,path:o,value:n,operator:s}}function xe(e){let l=e.path;return e.name&&(l+=`[${e.name}]`),e.operator&&(l+=`:${e.operator}`),l=`${encodeURIComponent(l)}=${encodeURIComponent(e.value)}`,"="===l?"":l}let Ve;const He=n(Ve||(Ve=(e=>e)`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`)),$e=d(u(c(s,"query-builder")));class Le extends $e{constructor(){super(...arguments),this.options=null,this.value=null}static get properties(){return e(e({},super.properties),{},{options:{type:Array},value:{type:String}})}static get styles(){return[super.styles,He]}render(){var e,l,t;return me({parsedValues:(t=null!==(e=this.value)&&void 0!==e?e:"",t.split("&").filter((e=>!!e)).map((e=>{const[l,t]=e.split("=").map(decodeURIComponent);return(null==t?void 0:t.includes("|"))?`${encodeURIComponent(l)}=${t}`.split("|").map((e=>we(e))):we(e)}))),options:null!==(l=this.options)&&void 0!==l?l:[],t:this.t.bind(this),onChange:e=>{this.value=function(e){return e.map((e=>{if(Array.isArray(e)){const l=[e[0].value,e.slice(1).map((e=>xe(e)))].join("|");return`${e[0].path}=${encodeURIComponent(l)}`}return xe(e)})).join("&")}(e),this.dispatchEvent(new Le.ChangeEvent("change"))}})}}Le.ChangeEvent=class extends CustomEvent{},Le.Operator=p,Le.Type=v,customElements.define("foxy-query-builder",Le);export{Le as Q,v as T,m as o};
69
+ `));let z,R,G,U,F,W=e=>e;function Q(e){var t,n,s;const i=null===(n=null===(t=e.list)||void 0===t?void 0:t.every((l=>l.value!==e.value)))||void 0===n||n;return l(z||(z=W` <label class="flex items-center cursor-pointer transition-colors group text-tertiary hover-bg-contrast-5"> <div class="relative flex-1 min-w-0 overflow-hidden"> <select class="${0}" @change="${0}"> ${0} ${0} </select> </div> ${0} </label> `),a({"cursor-pointer bg-transparent relative appearance-none flex h-m px-s":!0,"font-medium w-full max-w-full whitespace-nowrap focus-outline-none":!0,"text-tertiary":i,"text-body":!i}),(l=>{const t=l.currentTarget,n=t.options[t.options.selectedIndex].value;e.onChange(n)}),i?l(R||(R=W`<option value disabled="disabled" ?selected="${0}">${0}</option>`),i,e.t(e.label)):"",null===(s=e.list)||void 0===s?void 0:s.map((({label:t,value:n})=>l(G||(G=W` <option value="${0}" ?selected="${0}"> ${0} </option> `),n,n===e.value,e.t(t)))),i?"":l(U||(U=W` <span class="font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block"> ${0} </span> ${0} `),e.t(e.label),e.clearable?l(F||(F=W` <button aria-label="${0}" class="w-s h-s mr-xs text-body flex items-center justify-center transition-colors rounded-full focus-outline-none focus-ring-2 focus-ring-primary-50 hover-bg-contrast-5 hover-text-error" @click="${0}"> <iron-icon aria-hidden="true" class="icon-inline text-l" icon="icons:remove-circle-outline"> </iron-icon> </button> `),e.t("delete"),(()=>e.onChange(""))):""))}let J,K,P,X,Y,ee=e=>e;function le(e){var t;const n=`${null!==(t=e.id)&&void 0!==t?t:String(Math.floor(Math.random()*Math.pow(10,8)))}-list`,s=!!e.displayValue;let r=e.value;if("date"===e.type){const l=new Date(e.value);isNaN(l.getTime())||(r=o(l))}return l(J||(J=ee` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> ${0} <input placeholder="${0}" class="${0}" list="${0}" type="${0}" .value="${0}" ?disabled="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} ${0} </label> `),s?l(K||(K=ee` <div aria-hidden="true" class="absolute inset-0 h-m px-s font-medium text-body flex items-center"> <div class="truncate">${0}</div> </div> `),e.t(e.displayValue)):"",r||"date"===e.type?"":e.t(e.label),a({"bg-base text-body relative appearance-none flex h-m px-s font-medium w-full":!0,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0,"opacity-0 focus-opacity-100":s}),i(e.list?n:void 0),e.type,r,e.disabled,(l=>{var t,n;const s=l.currentTarget;"date"===e.type?e.onChange(null!==(n=null===(t=s.valueAsDate)||void 0===t?void 0:t.toISOString())&&void 0!==n?n:s.value):e.onChange(s.value)}),a({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!r||"date"===e.type,"sr-only":!r&&"date"!==e.type}),e.t(e.label),e.list?l(P||(P=ee` <datalist id="${0}"> ${0} </datalist> `),n,e.list.map((({label:t,value:n})=>l(X||(X=ee`<option value="${0}">${0}</option>`),n,e.t(t))))):"",e.disabled?"":l(Y||(Y=ee` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let te,ne,se=e=>e;let ae,ie=e=>e;function oe({parsedValue:e,option:l,options:n,t:s,onChange:a}){return le({displayValue:null==l?void 0:l.label,value:e.path,label:"field",list:n.map((e=>t(t({},e),{},{value:e.path}))),type:"text",id:"path",t:s,onChange:e=>a({operator:null,value:"",path:e})})}let re,ue=e=>e;let de,ce,ve=e=>e;function pe(e){var n,s;const{parsedValue:i,options:o,t:u,isNested:d,isFullSize:c,onChange:f,onDelete:g,onConvert:b}=e,w=null!==(n=o.find((e=>e.path===i.path)))&&void 0!==n?n:null,V=null!==(s=null==w?void 0:w.type)&&void 0!==s?s:v.Any,$=i.operator,y={parsedValue:i,option:w,options:o,t:u,onChange:f},Z={[v.Attribute]:T,[v.Boolean]:D,[v.Number]:E,[v.String]:k,[v.Date]:O,[v.Any]:j};return l(de||(de=ve` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="${0}"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base" title="${0}"> <div class="w-m h-m text-tertiary" aria-hidden="true"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base">${0}</div> <div class="bg-base"> ${0} </div> </div> </div> </div> <div class="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:remove-circle-outline"> </iron-icon> </button> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:add-circle-outline"> </iron-icon> </button> </div> </div> `),u("query_builder_rule"),a({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!d,"border-contrast-50":!!d}),u(`type_${V}`),w?Z[V]:j,i.path&&(V===v.Attribute||i.name)?l(ce||(ce=ve` <div class="bg-contrast-10 grid gap-1px grid-cols-1 sm-grid-cols-2"> <div class="bg-base">${0}</div> <div class="bg-base">${0}</div> </div> `),oe(y),function(e){var l;return le({value:null!==(l=e.parsedValue.name)&&void 0!==l?l:"",label:"name",type:"text",t:e.t,onChange:l=>e.onChange(t(t({},e.parsedValue),{},{name:l}))})}(y)):oe(y),function(e){const n=e.parsedValue.operator,s={[p.GreaterThan]:C,[p.GreaterThanOrEqual]:m,[p.In]:x,[p.IsDefined]:H,[p.LessThan]:L,[p.LessThanOrEqual]:M,[p.Not]:N},i={[v.Attribute]:[p.In,p.Not,p.IsDefined],[v.Boolean]:[],[v.String]:[p.In,p.Not],[v.Number]:[p.In,p.Not,p.GreaterThan,p.LessThan,p.GreaterThanOrEqual,p.LessThanOrEqual],[v.Date]:[p.In,p.Not],[v.Any]:Object.values(p)},o=e.option?i[e.option.type]:e.parsedValue.name?Object.values(p):Object.values(p).filter((e=>e!==p.IsDefined)),r=0===o.length||!e.parsedValue.path;return l(ae||(ae=ie` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),e.t(`operator_${null!=n?n:"equal"}`),a({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-tertiary cursor-default":r,"hover-bg-contrast-5":!r}),r,(()=>{var l;const s=n?o.indexOf(n):-1,a=null!==(l=o[s+1])&&void 0!==l?l:null;e.onChange(t(t({},e.parsedValue),{},{operator:a,value:e.parsedValue.value}))}),n?s[n]:h)}(y),$===p.In?function(e){var n,s,a,i;const o=(null===(n=e.option)||void 0===n?void 0:n.list)?Q:le,u=e.parsedValue.value.split(","),d=null!==(a=null===(s=e.option)||void 0===s?void 0:s.type)&&void 0!==a?a:v.Any,c=d===v.Number?"number":d===v.Date?"date":"text",p=null===(i=e.option)||void 0===i?void 0:i.list;return l(te||(te=se` <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> `),r([...u.filter((e=>!!e)),null],((e,l)=>l),((n,s)=>{var a;return l(ne||(ne=se` <div class="bg-base"> ${0} </div> `),o({type:c,list:p,t:e.t,value:null!=n?n:"",label:n?String(s+1):"add_value",clearable:!0,displayValue:null===(a=null==p?void 0:p.find((e=>e.value===n)))||void 0===a?void 0:a.label,onChange:l=>{l?u[s]=l:u.splice(s,1),e.onChange(t(t({},e.parsedValue),{},{value:u.join(",")}))}}))})))}(y):$===p.IsDefined?function(e){return Q({value:e.parsedValue.value,label:"value",list:[{label:"is_defined_true",value:"true"},{label:"is_defined_false",value:"false"}],t:e.t,onChange:l=>e.onChange(t(t({},e.parsedValue),{},{value:l}))})}(y):V===v.Boolean?function(e){var l,n,s,a,i,o;const{parsedValue:r,option:u,t:d,onChange:c}=e,v=null!==(s=null===(n=null===(l=null==u?void 0:u.list)||void 0===l?void 0:l.find((e=>"false"===e.value)))||void 0===n?void 0:n.label)&&void 0!==s?s:"false",p=[{label:null!==(o=null===(i=null===(a=null==u?void 0:u.list)||void 0===a?void 0:a.find((e=>"true"===e.value)))||void 0===i?void 0:i.label)&&void 0!==o?o:"true",value:"true"},{label:v,value:"false"}];return Q({value:r.value,label:"value",list:p,t:d,onChange:e=>c(t(t({},r),{},{value:e}))})}(y):null===$&&[v.Number,v.Date].includes(V)?function(e){var n,s,a;const{t:i,parsedValue:o,option:r,onChange:u}=e,[d,c]=o.value.split(".."),p=(null==r?void 0:r.list)?Q:le,f=null!==(n=null==r?void 0:r.type)&&void 0!==n?n:v.Any,h=f===v.Number?"number":f===v.Date?"date":"text",g=null==r?void 0:r.list;return l(re||(re=ue` <div class="grid bg-contrast-10 gap-1px grid-cols-1 grid-rows-2 sm-grid-cols-2 sm-grid-rows-1"> <div class="bg-base"> ${0} </div> <div class="bg-base"> ${0} </div> </div> `),p({displayValue:null===(s=null==g?void 0:g.find((e=>e.value===d)))||void 0===s?void 0:s.label,value:d,label:"range_from",type:h,list:g,t:i,onChange:e=>u(t(t({},o),{},{value:`${e}..${c}`}))}),p({displayValue:null===(a=null==g?void 0:g.find((e=>e.value===c)))||void 0===a?void 0:a.label,label:"range_to",value:c,type:h,list:g,t:i,onChange:e=>u(t(t({},o),{},{value:`${d}..${e}`}))}))}(y):function(e){var l,n,s,a;const{t:i,option:o,parsedValue:r,onChange:u}=e,d=(null==o?void 0:o.list)?Q:le,c=null!==(l=null==o?void 0:o.type)&&void 0!==l?l:v.Any;return d({displayValue:null===(s=null===(n=null==o?void 0:o.list)||void 0===n?void 0:n.find((e=>e.value===r.value)))||void 0===s?void 0:s.label,disabled:!r.path,value:null!==(a=r.value)&&void 0!==a?a:"",label:"value",type:c===v.Number?"number":c===v.Date?"date":"text",list:null==o?void 0:o.list,t:i,onChange:e=>u(t(t({},r),{},{value:e}))})}(y),a({"-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center":!0,"border-t border-b border-transparent divide-y divide-transparent":!0,hidden:!!c,flex:!c}),u("delete"),a({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!0,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path}),!i.path,g,u("add_or_clause"),a({"box-content flex w-m h-m rounded-full transition-colors text-success":!0,"hover-bg-contrast-5 focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path||!!d}),!i.path,b)}let fe,he,ge,Ce,be=e=>e;function me(e){const n=l(fe||(fe=be`<div class="h-xs"></div>`)),s=l(he||(he=be` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-semibold text-xs text-contrast-30"> ${0} </div> <div class="flex-1 border-t border-contrast-20"></div> <div class="w-m ml-s flex-shrink-0"></div> <div class="hidden sm-block w-m flex-shrink-0"></div> </div> `),e.t("or"));return l(ge||(ge=be` <div aria-label="${0}"> ${0} </div> `),e.t("query_builder_group"),r([...e.parsedValues,null],((e,l)=>String(l)),((a,i)=>{const o=i>0?e.isNested?s:n:"";return null===a?[o,pe({isFullSize:!e.isNested&&0===e.parsedValues.length,isNested:e.isNested,options:e.options,parsedValue:{path:"",operator:null,value:""},t:e.t,onChange:l=>e.onChange([...e.parsedValues,l])})]:Array.isArray(a)?[o,l(Ce||(Ce=be` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),me({parsedValues:a,isNested:!0,options:e.options,t:e.t,onChange:l=>{const t=[...e.parsedValues],n=l;t[i]=l.length>1?n:n[0],e.onChange(t)}}))]:[o,pe({parsedValue:a,isNested:e.isNested,options:e.options,t:e.t,onChange:l=>{const t=[...e.parsedValues];t[i]=l,e.onChange(t)},onDelete:()=>{const l=e.parsedValues.filter(((e,l)=>l!==i));e.onChange(l)},onConvert:()=>{const l=[...e.parsedValues];l[i]=[a,t(t({},a),{},{operator:null,value:""})],e.onChange(l)}})]})))}function we(e){var l;const[t,n]=e.split("=").map(decodeURIComponent),s=null!==(l=Object.values(p).find((e=>t.endsWith(`:${e}`))))&&void 0!==l?l:null;let a,i=t.substring(0,s?t.lastIndexOf(":"):void 0);const o=t.lastIndexOf("[");return i.endsWith("]")&&-1!==o&&(a=i.substring(o+1,i.length-1),i=i.substring(0,o)),{name:a,path:i,value:n,operator:s}}function xe(e){let l=e.path;return e.name&&(l+=`[${e.name}]`),e.operator&&(l+=`:${e.operator}`),l=`${encodeURIComponent(l)}=${encodeURIComponent(e.value)}`,"="===l?"":l}let Ve;const He=n(Ve||(Ve=(e=>e)`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`)),$e=u(d(c(s,"query-builder")));class Le extends $e{constructor(){super(...arguments),this.options=null,this.value=null}static get properties(){return t(t({},super.properties),{},{options:{type:Array},value:{type:String}})}static get styles(){return[super.styles,He]}render(){var e,l,t;return me({parsedValues:(t=null!==(e=this.value)&&void 0!==e?e:"",t.split("&").filter((e=>!!e)).map((e=>{const[l,t]=e.split("=").map(decodeURIComponent);return(null==t?void 0:t.includes("|"))?`${encodeURIComponent(l)}=${t}`.split("|").map((e=>we(e))):we(e)}))),options:null!==(l=this.options)&&void 0!==l?l:[],t:this.t.bind(this),onChange:e=>{this.value=function(e){return e.map((e=>{if(Array.isArray(e)){const l=[e[0].value,e.slice(1).map((e=>xe(e)))].join("|");return`${e[0].path}=${encodeURIComponent(l)}`}return xe(e)})).join("&")}(e),this.dispatchEvent(new Le.ChangeEvent("change"))}})}}Le.ChangeEvent=class extends CustomEvent{},Le.Operator=p,Le.Type=v,customElements.define("foxy-query-builder",Le);export{Le as Q,v as T,m as o};
@@ -0,0 +1 @@
1
+ import{L as e,_ as t}from"./shared-63eaded9.js";import{t as s,m as r,a as i,b as n,R as h,F as o}from"./shared-5535f38f.js";import{A as a}from"./shared-7f0a9790.js";import{U as _}from"./shared-7684cb05.js";import{i as u}from"./shared-756034e4.js";function d(e,t){let r=null;return s(t).forEach((function(){var t,s,i,n,h,o,a,_,u,d,c;if(null===(i=null===(s=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===s?void 0:s.self)||void 0===i?void 0:i.href){const t=null===(o=null===(h=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===h?void 0:h.self)||void 0===o?void 0:o.href,s=new URL(null===(u=null===(_=null===(a=this.node)||void 0===a?void 0:a._links)||void 0===_?void 0:_.self)||void 0===u?void 0:u.href);if(s.searchParams.delete("zoom"),e===t||e===s.toString())return r=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(c=null===(d=this.node)||void 0===d?void 0:d._links)&&void 0!==c?c:{}).some((([t,s])=>{var i,n;if(s.href!==e)return!1;const h=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!h||!Array.isArray(h))return!1;const o=h.length<20?h.length:21,a=new URL(e),_=new URL(e);return a.searchParams.set("offset",h.length.toString()),_.searchParams.set("offset",o.toString()),r=JSON.stringify({returned_items:h.length,total_items:o,offset:0,limit:20,_embedded:{[t]:h},_links:{curies:this.node._links.curies,first:{href:e},last:{href:_.toString()},prev:{href:e},next:{href:a.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(r,{status:r?200:404})}class c extends e{constructor(){super(...arguments),this.lang="",this.parent="",this.related=[],this.__href="",this.__group="",this.__fetchEventQueue=[],this.__service=u(i.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:n({errors:e=>{const s=this.constructor.v8n,r=t(t({},e.data),e.edits);return s.map((e=>e(r))).filter((e=>"string"==typeof e)).filter(((e,t,s)=>s.indexOf(e)===t))}})}}))}static get properties(){return{related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){return this.__service.state.context.failure}get errors(){return this.__service.state.context.errors}get form(){const{data:e,edits:s}=this.__service.state.context;return t(t({},e),s)}get data(){return this.__service.state.context.data}set data(e){var t;this.__service.send({type:"SET_DATA",data:e}),this.__href=null!==(t=null==e?void 0:e._links.self.href)&&void 0!==t?t:""}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){return this.__href}set href(e){this.__href=e,e?this.__service.send({type:"FETCH"}):this.__service.send({type:"SET_DATA",data:null})}in(e){return this.__service.state.matches(e)}undo(){this.__service.send({type:"UNDO"})}edit(e){this.__service.send({type:"EDIT",data:e})}submit(){this.__service.send({type:"SUBMIT"})}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}connectedCallback(){super.connectedCallback(),this.__createService(),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue()}disconnectedCallback(){super.disconnectedCallback(),this.__destroyService(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected")}async _fetch(...e){const t=await new a(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){this.__destroyRumour();const t=JSON.stringify(e),s=await this._fetch(this.parent,{body:t,method:"POST"}),r=c.Rumour(this.group),i=[...this.related,this.parent];return r.share({data:s,related:i,source:s._links.self.href}),this.__createRumour(),s}async _sendGet(){this.__destroyRumour();const e=await this._fetch(this.href);return c.Rumour(this.group).share({data:e,source:this.href}),this.__createRumour(),e}async _sendPatch(e){this.__destroyRumour();const t=JSON.stringify(e),s=await this._fetch(this.href,{body:t,method:"PATCH"});return c.Rumour(this.group).share({data:s,source:this.href,related:this.related}),this.__createRumour(),s}async _sendDelete(){this.__destroyRumour();const e=await this._fetch(this.href,{method:"DELETE"}),t=c.Rumour(this.group),s=[...this.related,this.parent];return t.share({data:null,source:this.href,related:s}),this.__createRumour(),e}__createService(){this.__service.onTransition((e=>{if(!e.changed)return;const t=e.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);this.setAttribute("state",[...new Set(t)].join(" ")),this.requestUpdate(),this.dispatchEvent(new _),e.matches("busy")||this.__processFetchEventQueue()})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new _)})),this.__service.start()}__destroyService(){this.__service.stop()}__createRumour(){const e=c.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this)}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.data;if(!s)return;const r=e(s);r!==s&&this.__service.send({data:r,type:"SET_DATA"})}catch(e){if(!(e instanceof h.UpdateError))throw e;this.__service.send({type:"REFRESH"})}}__processFetchEventQueue(){const e=new c.API(this);this.__fetchEventQueue.forEach((t=>{const s=t.request,r=d(s.url,this.data),i=r.ok?r:e.fetch(s);t.respondWith(Promise.resolve(i)),r.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${s.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){e instanceof o&&(e.defaultPrevented||"GET"===e.request.method&&(e.request.url.startsWith("foxy://")||e.composedPath()[0]!==this&&(e.preventDefault(),this.__fetchEventQueue.push(e),this.in("busy")||this.__processFetchEventQueue())))}}c.UpdateEvent=_,c.Rumour=r((()=>new h)),c.API=a;export{c as N,d as s};
@@ -1 +1 @@
1
- import{A as e,a8 as t}from"./shared-50f0611d.js";import{d as s}from"./shared-5bf947db.js";var n=function(e,t,s,n){return new(s||(s=Promise))((function(i,o){function r(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,a)}c((n=n.apply(e,t||[])).next())}))};class i extends e{constructor(e){super(Object.assign(Object.assign({},e),{fetch:(...e)=>this.__fetch(...e)}))}signIn(t){return n(this,void 0,void 0,(function*(){i.v8n.credentials.check(t);const s=yield this.fetch(new URL("./authenticate",this.base).toString(),{body:JSON.stringify(t),method:"POST"});if(!s.ok){const t=401===s.status?"UNAUTHORIZED":"UNKNOWN";throw new e.AuthError({code:t})}{const e=yield s.json(),t=Object.assign(Object.assign({},e),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(t))}}))}sendPasswordResetEmail(t){return n(this,void 0,void 0,(function*(){i.v8n.email.check(t.email);if(!(yield this.fetch(new URL("./forgot_password",this.base).toString(),{body:JSON.stringify(t),method:"POST"})).ok)throw new e.AuthError({code:"UNKNOWN"})}))}signOut(){return n(this,void 0,void 0,(function*(){if(!(yield this.fetch(new URL("./authenticate",this.base).toString(),{method:"DELETE"})).ok)throw new e.AuthError({code:"UNKNOWN"});this.storage.clear(),this.cache.clear()}))}__fetch(e,t){var o;return n(this,void 0,void 0,(function*(){let n=JSON.parse(null!==(o=this.storage.getItem(i.SESSION))&&void 0!==o?o:"null");const r=new s.Request(e,t);if(null!==n){new Date(n.date_created).getTime()+1e3*n.expires_in<Date.now()?(this.console.info("Session has expired, signing out."),this.storage.clear(),this.cache.clear(),n=null):r.headers.set("Authorization",`Bearer ${n.session_token}`)}r.headers.set("Content-Type","application/json"),r.headers.set("FOXY-API-VERSION","1"),this.console.trace(`${r.method} ${r.url}`);const a=yield s.fetch(r);if(n&&a.ok){const e=Object.assign(Object.assign({},n),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(e))}return a}))}}i.SESSION="session",i.v8n=Object.assign({},e.v8n,{credentials:t().schema({email:t().string(),newPassword:t().optional(t().string()),password:t().string()}),email:t().string()});let o=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([a-zµμ]*)/gi;function r(e="",t="ms"){var s=null;return(e=e.replace(/(\d),(\d)/g,"$1$2")).replace(o,(function(e,t,n){(n=r[n]||r[n.toLowerCase().replace(/s$/,"")])&&(s=(s||0)+parseFloat(t,10)*n)})),s&&s/r[t]}r.nanosecond=r.ns=1e-6,r["µs"]=r["μs"]=r.us=r.microsecond=.001,r.millisecond=r.ms=1,r.second=r.sec=r.s=1e3*r.ms,r.minute=r.min=r.m=60*r.s,r.hour=r.hr=r.h=60*r.m,r.day=r.d=24*r.h,r.week=r.wk=r.w=7*r.d,r.month=r.b=30.4375*r.d,r.year=r.yr=r.y=365.25*r.d;export{i as A,r as p};
1
+ import{A as e,a8 as t}from"./shared-5535f38f.js";import{d as s}from"./shared-63eaded9.js";var n=function(e,t,s,n){return new(s||(s=Promise))((function(i,o){function r(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,a)}c((n=n.apply(e,t||[])).next())}))};class i extends e{constructor(e){super(Object.assign(Object.assign({},e),{fetch:(...e)=>this.__fetch(...e)}))}signIn(t){return n(this,void 0,void 0,(function*(){i.v8n.credentials.check(t);const s=yield this.fetch(new URL("./authenticate",this.base).toString(),{body:JSON.stringify(t),method:"POST"});if(!s.ok){const t=401===s.status?"UNAUTHORIZED":"UNKNOWN";throw new e.AuthError({code:t})}{const e=yield s.json(),t=Object.assign(Object.assign({},e),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(t))}}))}sendPasswordResetEmail(t){return n(this,void 0,void 0,(function*(){i.v8n.email.check(t.email);if(!(yield this.fetch(new URL("./forgot_password",this.base).toString(),{body:JSON.stringify(t),method:"POST"})).ok)throw new e.AuthError({code:"UNKNOWN"})}))}signOut(){return n(this,void 0,void 0,(function*(){if(!(yield this.fetch(new URL("./authenticate",this.base).toString(),{method:"DELETE"})).ok)throw new e.AuthError({code:"UNKNOWN"});this.storage.clear(),this.cache.clear()}))}__fetch(e,t){var o;return n(this,void 0,void 0,(function*(){let n=JSON.parse(null!==(o=this.storage.getItem(i.SESSION))&&void 0!==o?o:"null");const r=new s.Request(e,t);if(null!==n){new Date(n.date_created).getTime()+1e3*n.expires_in<Date.now()?(this.console.info("Session has expired, signing out."),this.storage.clear(),this.cache.clear(),n=null):r.headers.set("Authorization",`Bearer ${n.session_token}`)}r.headers.set("Content-Type","application/json"),r.headers.set("FOXY-API-VERSION","1"),this.console.trace(`${r.method} ${r.url}`);const a=yield s.fetch(r);if(n&&a.ok){const e=Object.assign(Object.assign({},n),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(e))}return a}))}}i.SESSION="session",i.v8n=Object.assign({},e.v8n,{credentials:t().schema({email:t().string(),newPassword:t().optional(t().string()),password:t().string()}),email:t().string()});let o=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([a-zµμ]*)/gi;function r(e="",t="ms"){var s=null;return(e=e.replace(/(\d),(\d)/g,"$1$2")).replace(o,(function(e,t,n){(n=r[n]||r[n.toLowerCase().replace(/s$/,"")])&&(s=(s||0)+parseFloat(t,10)*n)})),s&&s/r[t]}r.nanosecond=r.ns=1e-6,r["µs"]=r["μs"]=r.us=r.microsecond=.001,r.millisecond=r.ms=1,r.second=r.sec=r.s=1e3*r.ms,r.minute=r.min=r.m=60*r.s,r.hour=r.hr=r.h=60*r.m,r.day=r.d=24*r.h,r.week=r.wk=r.w=7*r.d,r.month=r.b=30.4375*r.d,r.year=r.yr=r.y=365.25*r.d;export{i as A,r as p};
@@ -1,4 +1,4 @@
1
- import{f as e,M as t,n as s,c as i,d as n,g as r,V as o,j as l,k as a,l as h,u as c,m as d,o as u,w as _,p,E as f,G as m,q as y,r as g,s as b,D as C,t as v,v as x,x as w,P as S,y as P,z as E,e as I,A as O,h as A}from"./shared-5499ce50.js";import{l as k,b as N,s as T,c as M,u as D,d as R,f as F}from"./shared-c937b8af.js";
1
+ import{f as e,M as t,n as s,d as i,g as n,j as r,V as o,k as l,l as a,m as h,u as c,o as d,p as u,w as _,q as p,E as f,G as m,r as y,s as g,v as b,x as C,y as v,a as x,t as w,z as S,A as P,B as E,C as I,F as O,P as A,H as k,I as N,J as T,e as M,K as D,L as R,h as F}from"./shared-ff79f3f9.js";
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -133,7 +133,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
133
133
  * Google as part of the polymer project is also subject to an additional IP
134
134
  * rights grant found at http://polymer.github.io/PATENTS.txt
135
135
  */
136
- const Ke=e=>{for(;e;){const t=Object.getOwnPropertyDescriptor(e,"observedAttributes");if(t)return t.get;e=Object.getPrototypeOf(e.prototype).constructor}return()=>[]},Ge=d((e=>{const t=f(e);let s=Ke(t);return class extends t{constructor(){super(),this.__isUpgradeDisabled}static get observedAttributes(){return s.call(this).concat("disable-upgrade")}_initializeProperties(){this.hasAttribute("disable-upgrade")?this.__isUpgradeDisabled=!0:super._initializeProperties()}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}attributeChangedCallback(e,t,s,i){"disable-upgrade"==e?this.__isUpgradeDisabled&&null==s&&(super._initializeProperties(),this.__isUpgradeDisabled=!1,_(this).isConnected&&super.connectedCallback()):super.attributeChangedCallback(e,t,s,i)}connectedCallback(){this.__isUpgradeDisabled||super.connectedCallback()}disconnectedCallback(){this.__isUpgradeDisabled||super.disconnectedCallback()}}}));let Xe=window.ShadyCSS;const We=d((e=>{const t=m(f(e)),s=y?t:Ae(t),i=Ke(s),n={x:"pan-x",y:"pan-y",none:"none",all:"auto"};class r extends s{constructor(){super(),this.isAttached,this.__boundListeners,this._debouncers,this.__isUpgradeDisabled,this.__needsAttributesAtConnected,this._legacyForceObservedAttributes}static get importMeta(){return this.prototype.importMeta}created(){}__attributeReaction(e,t,s){(this.__dataAttributes&&this.__dataAttributes[e]||"disable-upgrade"===e)&&this.attributeChangedCallback(e,t,s,null)}setAttribute(e,t){if(k&&!this._legacyForceObservedAttributes){const s=this.getAttribute(e);super.setAttribute(e,t),this.__attributeReaction(e,s,String(t))}else super.setAttribute(e,t)}removeAttribute(e){if(k&&!this._legacyForceObservedAttributes){const t=this.getAttribute(e);super.removeAttribute(e),this.__attributeReaction(e,t,null)}else super.removeAttribute(e)}static get observedAttributes(){return k&&!this.prototype._legacyForceObservedAttributes?(this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))||(this.__observedAttributes=[],g(this.prototype)),this.__observedAttributes):i.call(this).concat("disable-upgrade")}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}connectedCallback(){this.__needsAttributesAtConnected&&this._takeAttributes(),this.__isUpgradeDisabled||(super.connectedCallback(),this.isAttached=!0,this.attached())}attached(){}disconnectedCallback(){this.__isUpgradeDisabled||(super.disconnectedCallback(),this.isAttached=!1,this.detached())}detached(){}attributeChangedCallback(e,t,s,i){t!==s&&("disable-upgrade"==e?this.__isUpgradeDisabled&&null==s&&(this._initializeProperties(),this.__isUpgradeDisabled=!1,_(this).isConnected&&this.connectedCallback()):(super.attributeChangedCallback(e,t,s,i),this.attributeChanged(e,t,s)))}attributeChanged(e,t,s){}_initializeProperties(){if(N&&this.hasAttribute("disable-upgrade"))this.__isUpgradeDisabled=!0;else{let e=Object.getPrototypeOf(this);e.hasOwnProperty(JSCompiler_renameProperty("__hasRegisterFinished",e))||(this._registered(),e.__hasRegisterFinished=!0),super._initializeProperties(),this.root=this,this.created(),k&&!this._legacyForceObservedAttributes&&(this.hasAttributes()?this._takeAttributes():this.parentNode||(this.__needsAttributesAtConnected=!0)),this._applyListeners()}}_takeAttributes(){const e=this.attributes;for(let t=0,s=e.length;t<s;t++){const s=e[t];this.__attributeReaction(s.name,null,s.value)}}_registered(){}ready(){this._ensureAttributes(),super.ready()}_ensureAttributes(){}_applyListeners(){}serialize(e){return this._serializeValue(e)}deserialize(e,t){return this._deserializeValue(e,t)}reflectPropertyToAttribute(e,t,s){this._propertyToAttribute(e,t,s)}serializeValueToAttribute(e,t,s){this._valueToNodeAttribute(s||this,e,t)}extend(e,t){if(!e||!t)return e||t;let s=Object.getOwnPropertyNames(t);for(let i,n=0;n<s.length&&(i=s[n]);n++){let s=Object.getOwnPropertyDescriptor(t,i);s&&Object.defineProperty(e,i,s)}return e}mixin(e,t){for(let s in t)e[s]=t[s];return e}chainObject(e,t){return e&&t&&e!==t&&(e.__proto__=t),e}instanceTemplate(e){let t=this.constructor._contentForTemplate(e);return document.importNode(t,!0)}fire(e,t,s){s=s||{},t=null==t?{}:t;let i=new Event(e,{bubbles:void 0===s.bubbles||s.bubbles,cancelable:Boolean(s.cancelable),composed:void 0===s.composed||s.composed});i.detail=t;let n=s.node||this;return _(n).dispatchEvent(i),i}listen(e,t,s){e=e||this;let i=this.__boundListeners||(this.__boundListeners=new WeakMap),n=i.get(e);n||(n={},i.set(e,n));let r=t+s;n[r]||(n[r]=this._addMethodEventListenerToNode(e,t,s,this))}unlisten(e,t,s){e=e||this;let i=this.__boundListeners&&this.__boundListeners.get(e),n=t+s,r=i&&i[n];r&&(this._removeEventListenerFromNode(e,t,r),i[n]=null)}setScrollDirection(e,t){b(t||this,n[e]||"auto")}$$(e){return this.root.querySelector(e)}get domHost(){let e=_(this).getRootNode();return e instanceof DocumentFragment?e.host:e}distributeContent(){const e=qe(this);window.ShadyDOM&&e.shadowRoot&&ShadyDOM.flush()}getEffectiveChildNodes(){return qe(this).getEffectiveChildNodes()}queryDistributedElements(e){return qe(this).queryDistributedElements(e)}getEffectiveChildren(){return this.getEffectiveChildNodes().filter((function(e){return e.nodeType===Node.ELEMENT_NODE}))}getEffectiveTextContent(){let e=this.getEffectiveChildNodes(),t=[];for(let s,i=0;s=e[i];i++)s.nodeType!==Node.COMMENT_NODE&&t.push(s.textContent);return t.join("")}queryEffectiveChildren(e){let t=this.queryDistributedElements(e);return t&&t[0]}queryAllEffectiveChildren(e){return this.queryDistributedElements(e)}getContentChildNodes(e){let t=this.root.querySelector(e||"slot");return t?qe(t).getDistributedNodes():[]}getContentChildren(e){return this.getContentChildNodes(e).filter((function(e){return e.nodeType===Node.ELEMENT_NODE}))}isLightDescendant(e){const t=this;return t!==e&&_(t).contains(e)&&_(t).getRootNode()===_(e).getRootNode()}isLocalDescendant(e){return this.root===_(e).getRootNode()}scopeSubtree(e,t=!1){return function(e,t=!1){if(!Je||!Ve)return null;if(!Je.handlesDynamicScoping)return null;const s=Ve.ScopingShim;if(!s)return null;const i=s.scopeForNode(e),n=_(e).getRootNode(),r=e=>{if(!Ye(e,n))return;const t=Array.from(Je.nativeMethods.querySelectorAll.call(e,"*"));t.push(e);for(let e=0;e<t.length;e++){const r=t[e];if(!Ye(r,n))continue;const o=s.currentScopeForNode(r);o!==i&&(""!==o&&s.unscopeNode(r,o),s.scopeNode(r,i))}};if(r(e),t){const t=new MutationObserver((e=>{for(let t=0;t<e.length;t++){const s=e[t];for(let e=0;e<s.addedNodes.length;e++){const t=s.addedNodes[e];t.nodeType===Node.ELEMENT_NODE&&r(t)}}}));return t.observe(e,{childList:!0,subtree:!0}),t}return null}(e,t)}getComputedStyleValue(e){return Xe.getComputedStyleValue(this,e)}debounce(e,t,s){return this._debouncers=this._debouncers||{},this._debouncers[e]=C.debounce(this._debouncers[e],s>0?v.after(s):p,t.bind(this))}isDebouncerActive(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];return!(!t||!t.isActive())}flushDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.flush()}cancelDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.cancel()}async(e,t){return t>0?v.run(e.bind(this),t):~p.run(e.bind(this))}cancelAsync(e){e<0?p.cancel(~e):v.cancel(e)}create(e,t){let s=document.createElement(e);if(t)if(s.setProperties)s.setProperties(t);else for(let e in t)s[e]=t[e];return s}elementMatches(e,t){return je(t||this,e)}toggleAttribute(e,t){let s=this;return 3===arguments.length&&(s=arguments[2]),1==arguments.length&&(t=!s.hasAttribute(e)),t?(_(s).setAttribute(e,""),!0):(_(s).removeAttribute(e),!1)}toggleClass(e,t,s){s=s||this,1==arguments.length&&(t=!s.classList.contains(e)),t?s.classList.add(e):s.classList.remove(e)}transform(e,t){(t=t||this).style.webkitTransform=e,t.style.transform=e}translate3d(e,t,s,i){i=i||this,this.transform("translate3d("+e+","+t+","+s+")",i)}arrayDelete(e,t){let s;if(Array.isArray(e)){if(s=e.indexOf(t),s>=0)return e.splice(s,1)}else{if(s=x(this,e).indexOf(t),s>=0)return this.splice(e,s,1)}return null}_logger(e,t){switch(Array.isArray(t)&&1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"error":console[e](...t)}}_log(...e){this._logger("log",e)}_warn(...e){this._logger("warn",e)}_error(...e){this._logger("error",e)}_logf(e,...t){return["[%s::%s]",this.is,e,...t]}}return r.prototype.is="",r})),Qe={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,listeners:!0,hostAttributes:!0},Ze={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,behaviors:!0,_noAccessors:!0},et=Object.assign({listeners:!0,hostAttributes:!0,properties:!0,observers:!0},Ze);
136
+ const Ke=e=>{for(;e;){const t=Object.getOwnPropertyDescriptor(e,"observedAttributes");if(t)return t.get;e=Object.getPrototypeOf(e.prototype).constructor}return()=>[]},Ge=d((e=>{const t=f(e);let s=Ke(t);return class extends t{constructor(){super(),this.__isUpgradeDisabled}static get observedAttributes(){return s.call(this).concat("disable-upgrade")}_initializeProperties(){this.hasAttribute("disable-upgrade")?this.__isUpgradeDisabled=!0:super._initializeProperties()}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}attributeChangedCallback(e,t,s,i){"disable-upgrade"==e?this.__isUpgradeDisabled&&null==s&&(super._initializeProperties(),this.__isUpgradeDisabled=!1,_(this).isConnected&&super.connectedCallback()):super.attributeChangedCallback(e,t,s,i)}connectedCallback(){this.__isUpgradeDisabled||super.connectedCallback()}disconnectedCallback(){this.__isUpgradeDisabled||super.disconnectedCallback()}}}));let Xe=window.ShadyCSS;const We=d((e=>{const t=m(f(e)),s=y?t:Ae(t),i=Ke(s),n={x:"pan-x",y:"pan-y",none:"none",all:"auto"};class r extends s{constructor(){super(),this.isAttached,this.__boundListeners,this._debouncers,this.__isUpgradeDisabled,this.__needsAttributesAtConnected,this._legacyForceObservedAttributes}static get importMeta(){return this.prototype.importMeta}created(){}__attributeReaction(e,t,s){(this.__dataAttributes&&this.__dataAttributes[e]||"disable-upgrade"===e)&&this.attributeChangedCallback(e,t,s,null)}setAttribute(e,t){if(g&&!this._legacyForceObservedAttributes){const s=this.getAttribute(e);super.setAttribute(e,t),this.__attributeReaction(e,s,String(t))}else super.setAttribute(e,t)}removeAttribute(e){if(g&&!this._legacyForceObservedAttributes){const t=this.getAttribute(e);super.removeAttribute(e),this.__attributeReaction(e,t,null)}else super.removeAttribute(e)}static get observedAttributes(){return g&&!this.prototype._legacyForceObservedAttributes?(this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))||(this.__observedAttributes=[],b(this.prototype)),this.__observedAttributes):i.call(this).concat("disable-upgrade")}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}connectedCallback(){this.__needsAttributesAtConnected&&this._takeAttributes(),this.__isUpgradeDisabled||(super.connectedCallback(),this.isAttached=!0,this.attached())}attached(){}disconnectedCallback(){this.__isUpgradeDisabled||(super.disconnectedCallback(),this.isAttached=!1,this.detached())}detached(){}attributeChangedCallback(e,t,s,i){t!==s&&("disable-upgrade"==e?this.__isUpgradeDisabled&&null==s&&(this._initializeProperties(),this.__isUpgradeDisabled=!1,_(this).isConnected&&this.connectedCallback()):(super.attributeChangedCallback(e,t,s,i),this.attributeChanged(e,t,s)))}attributeChanged(e,t,s){}_initializeProperties(){if(C&&this.hasAttribute("disable-upgrade"))this.__isUpgradeDisabled=!0;else{let e=Object.getPrototypeOf(this);e.hasOwnProperty(JSCompiler_renameProperty("__hasRegisterFinished",e))||(this._registered(),e.__hasRegisterFinished=!0),super._initializeProperties(),this.root=this,this.created(),g&&!this._legacyForceObservedAttributes&&(this.hasAttributes()?this._takeAttributes():this.parentNode||(this.__needsAttributesAtConnected=!0)),this._applyListeners()}}_takeAttributes(){const e=this.attributes;for(let t=0,s=e.length;t<s;t++){const s=e[t];this.__attributeReaction(s.name,null,s.value)}}_registered(){}ready(){this._ensureAttributes(),super.ready()}_ensureAttributes(){}_applyListeners(){}serialize(e){return this._serializeValue(e)}deserialize(e,t){return this._deserializeValue(e,t)}reflectPropertyToAttribute(e,t,s){this._propertyToAttribute(e,t,s)}serializeValueToAttribute(e,t,s){this._valueToNodeAttribute(s||this,e,t)}extend(e,t){if(!e||!t)return e||t;let s=Object.getOwnPropertyNames(t);for(let i,n=0;n<s.length&&(i=s[n]);n++){let s=Object.getOwnPropertyDescriptor(t,i);s&&Object.defineProperty(e,i,s)}return e}mixin(e,t){for(let s in t)e[s]=t[s];return e}chainObject(e,t){return e&&t&&e!==t&&(e.__proto__=t),e}instanceTemplate(e){let t=this.constructor._contentForTemplate(e);return document.importNode(t,!0)}fire(e,t,s){s=s||{},t=null==t?{}:t;let i=new Event(e,{bubbles:void 0===s.bubbles||s.bubbles,cancelable:Boolean(s.cancelable),composed:void 0===s.composed||s.composed});i.detail=t;let n=s.node||this;return _(n).dispatchEvent(i),i}listen(e,t,s){e=e||this;let i=this.__boundListeners||(this.__boundListeners=new WeakMap),n=i.get(e);n||(n={},i.set(e,n));let r=t+s;n[r]||(n[r]=this._addMethodEventListenerToNode(e,t,s,this))}unlisten(e,t,s){e=e||this;let i=this.__boundListeners&&this.__boundListeners.get(e),n=t+s,r=i&&i[n];r&&(this._removeEventListenerFromNode(e,t,r),i[n]=null)}setScrollDirection(e,t){v(t||this,n[e]||"auto")}$$(e){return this.root.querySelector(e)}get domHost(){let e=_(this).getRootNode();return e instanceof DocumentFragment?e.host:e}distributeContent(){const e=qe(this);window.ShadyDOM&&e.shadowRoot&&ShadyDOM.flush()}getEffectiveChildNodes(){return qe(this).getEffectiveChildNodes()}queryDistributedElements(e){return qe(this).queryDistributedElements(e)}getEffectiveChildren(){return this.getEffectiveChildNodes().filter((function(e){return e.nodeType===Node.ELEMENT_NODE}))}getEffectiveTextContent(){let e=this.getEffectiveChildNodes(),t=[];for(let s,i=0;s=e[i];i++)s.nodeType!==Node.COMMENT_NODE&&t.push(s.textContent);return t.join("")}queryEffectiveChildren(e){let t=this.queryDistributedElements(e);return t&&t[0]}queryAllEffectiveChildren(e){return this.queryDistributedElements(e)}getContentChildNodes(e){let t=this.root.querySelector(e||"slot");return t?qe(t).getDistributedNodes():[]}getContentChildren(e){return this.getContentChildNodes(e).filter((function(e){return e.nodeType===Node.ELEMENT_NODE}))}isLightDescendant(e){const t=this;return t!==e&&_(t).contains(e)&&_(t).getRootNode()===_(e).getRootNode()}isLocalDescendant(e){return this.root===_(e).getRootNode()}scopeSubtree(e,t=!1){return function(e,t=!1){if(!Je||!Ve)return null;if(!Je.handlesDynamicScoping)return null;const s=Ve.ScopingShim;if(!s)return null;const i=s.scopeForNode(e),n=_(e).getRootNode(),r=e=>{if(!Ye(e,n))return;const t=Array.from(Je.nativeMethods.querySelectorAll.call(e,"*"));t.push(e);for(let e=0;e<t.length;e++){const r=t[e];if(!Ye(r,n))continue;const o=s.currentScopeForNode(r);o!==i&&(""!==o&&s.unscopeNode(r,o),s.scopeNode(r,i))}};if(r(e),t){const t=new MutationObserver((e=>{for(let t=0;t<e.length;t++){const s=e[t];for(let e=0;e<s.addedNodes.length;e++){const t=s.addedNodes[e];t.nodeType===Node.ELEMENT_NODE&&r(t)}}}));return t.observe(e,{childList:!0,subtree:!0}),t}return null}(e,t)}getComputedStyleValue(e){return Xe.getComputedStyleValue(this,e)}debounce(e,t,s){return this._debouncers=this._debouncers||{},this._debouncers[e]=x.debounce(this._debouncers[e],s>0?w.after(s):p,t.bind(this))}isDebouncerActive(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];return!(!t||!t.isActive())}flushDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.flush()}cancelDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.cancel()}async(e,t){return t>0?w.run(e.bind(this),t):~p.run(e.bind(this))}cancelAsync(e){e<0?p.cancel(~e):w.cancel(e)}create(e,t){let s=document.createElement(e);if(t)if(s.setProperties)s.setProperties(t);else for(let e in t)s[e]=t[e];return s}elementMatches(e,t){return je(t||this,e)}toggleAttribute(e,t){let s=this;return 3===arguments.length&&(s=arguments[2]),1==arguments.length&&(t=!s.hasAttribute(e)),t?(_(s).setAttribute(e,""),!0):(_(s).removeAttribute(e),!1)}toggleClass(e,t,s){s=s||this,1==arguments.length&&(t=!s.classList.contains(e)),t?s.classList.add(e):s.classList.remove(e)}transform(e,t){(t=t||this).style.webkitTransform=e,t.style.transform=e}translate3d(e,t,s,i){i=i||this,this.transform("translate3d("+e+","+t+","+s+")",i)}arrayDelete(e,t){let s;if(Array.isArray(e)){if(s=e.indexOf(t),s>=0)return e.splice(s,1)}else{if(s=S(this,e).indexOf(t),s>=0)return this.splice(e,s,1)}return null}_logger(e,t){switch(Array.isArray(t)&&1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"error":console[e](...t)}}_log(...e){this._logger("log",e)}_warn(...e){this._logger("warn",e)}_error(...e){this._logger("error",e)}_logf(e,...t){return["[%s::%s]",this.is,e,...t]}}return r.prototype.is="",r})),Qe={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,listeners:!0,hostAttributes:!0},Ze={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,behaviors:!0,_noAccessors:!0},et=Object.assign({listeners:!0,hostAttributes:!0,properties:!0,observers:!0},Ze);
137
137
  /**
138
138
  @license
139
139
  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -142,7 +142,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
142
142
  The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
143
143
  Code distributed by Google as part of the polymer project is also
144
144
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
145
- */function tt(e,t){return ot({},We(t),e)}function st(e,t,s,i){!function(e,t,s){const i=e._noAccessors,n=Object.getOwnPropertyNames(e);for(let r=0;r<n.length;r++){let o=n[r];if(!(o in s))if(i)t[o]=e[o];else{let s=Object.getOwnPropertyDescriptor(e,o);s&&(s.configurable=!0,Object.defineProperty(t,o,s))}}}(t,e,i);for(let e in Qe)t[e]&&(s[e]=s[e]||[],s[e].push(t[e]))}function it(e,t,s){t=t||[];for(let i=e.length-1;i>=0;i--){let n=e[i];n?Array.isArray(n)?it(n,t):t.indexOf(n)<0&&(!s||s.indexOf(n)<0)&&t.unshift(n):console.warn("behavior is null, check for missing or 404 import")}return t}function nt(e,t){for(const s in t){const i=e[s],n=t[s];e[s]=!("value"in n)&&i&&"value"in i?Object.assign({value:i.value},n):n}}const rt=We(HTMLElement);function ot(e,t,s){let i;const n={};class r extends t{static _finalizeClass(){if(this.hasOwnProperty(JSCompiler_renameProperty("generatedFrom",this))){if(i)for(let e,t=0;t<i.length;t++)e=i[t],e.properties&&this.createProperties(e.properties),e.observers&&this.createObservers(e.observers,e.properties);e.properties&&this.createProperties(e.properties),e.observers&&this.createObservers(e.observers,e.properties),this._prepareTemplate()}else t._finalizeClass.call(this)}static get properties(){const t={};if(i)for(let e=0;e<i.length;e++)nt(t,i[e].properties);return nt(t,e.properties),t}static get observers(){let t=[];if(i)for(let e,s=0;s<i.length;s++)e=i[s],e.observers&&(t=t.concat(e.observers));return e.observers&&(t=t.concat(e.observers)),t}created(){super.created();const e=n.created;if(e)for(let t=0;t<e.length;t++)e[t].call(this)}_registered(){const e=r.prototype;if(!e.hasOwnProperty(JSCompiler_renameProperty("__hasRegisterFinished",e))){e.__hasRegisterFinished=!0,super._registered(),N&&o(e);const t=Object.getPrototypeOf(this);let s=n.beforeRegister;if(s)for(let e=0;e<s.length;e++)s[e].call(t);if(s=n.registered,s)for(let e=0;e<s.length;e++)s[e].call(t)}}_applyListeners(){super._applyListeners();const e=n.listeners;if(e)for(let t=0;t<e.length;t++){const s=e[t];if(s)for(let e in s)this._addMethodEventListenerToNode(this,e,s[e])}}_ensureAttributes(){const e=n.hostAttributes;if(e)for(let t=e.length-1;t>=0;t--){const s=e[t];for(let e in s)this._ensureAttribute(e,s[e])}super._ensureAttributes()}ready(){super.ready();let e=n.ready;if(e)for(let t=0;t<e.length;t++)e[t].call(this)}attached(){super.attached();let e=n.attached;if(e)for(let t=0;t<e.length;t++)e[t].call(this)}detached(){super.detached();let e=n.detached;if(e)for(let t=0;t<e.length;t++)e[t].call(this)}attributeChanged(e,t,s){super.attributeChanged();let i=n.attributeChanged;if(i)for(let n=0;n<i.length;n++)i[n].call(this,e,t,s)}}if(s){Array.isArray(s)||(s=[s]);let e=t.prototype.behaviors;i=it(s,null,e),r.prototype.behaviors=e?e.concat(s):i}const o=t=>{i&&function(e,t,s){for(let i=0;i<t.length;i++)st(e,t[i],s,et)}(t,i,n),st(t,e,n,Ze)};return N||o(r.prototype),r.generatedFrom=e,r}const lt=function(e){let t;return t="function"==typeof e?e:lt.Class(e),e._legacyForceObservedAttributes&&(t.prototype._legacyForceObservedAttributes=e._legacyForceObservedAttributes),customElements.define(t.is,t),t};
145
+ */function tt(e,t){return ot({},We(t),e)}function st(e,t,s,i){!function(e,t,s){const i=e._noAccessors,n=Object.getOwnPropertyNames(e);for(let r=0;r<n.length;r++){let o=n[r];if(!(o in s))if(i)t[o]=e[o];else{let s=Object.getOwnPropertyDescriptor(e,o);s&&(s.configurable=!0,Object.defineProperty(t,o,s))}}}(t,e,i);for(let e in Qe)t[e]&&(s[e]=s[e]||[],s[e].push(t[e]))}function it(e,t,s){t=t||[];for(let i=e.length-1;i>=0;i--){let n=e[i];n?Array.isArray(n)?it(n,t):t.indexOf(n)<0&&(!s||s.indexOf(n)<0)&&t.unshift(n):console.warn("behavior is null, check for missing or 404 import")}return t}function nt(e,t){for(const s in t){const i=e[s],n=t[s];e[s]=!("value"in n)&&i&&"value"in i?Object.assign({value:i.value},n):n}}const rt=We(HTMLElement);function ot(e,t,s){let i;const n={};class r extends t{static _finalizeClass(){if(this.hasOwnProperty(JSCompiler_renameProperty("generatedFrom",this))){if(i)for(let e,t=0;t<i.length;t++)e=i[t],e.properties&&this.createProperties(e.properties),e.observers&&this.createObservers(e.observers,e.properties);e.properties&&this.createProperties(e.properties),e.observers&&this.createObservers(e.observers,e.properties),this._prepareTemplate()}else t._finalizeClass.call(this)}static get properties(){const t={};if(i)for(let e=0;e<i.length;e++)nt(t,i[e].properties);return nt(t,e.properties),t}static get observers(){let t=[];if(i)for(let e,s=0;s<i.length;s++)e=i[s],e.observers&&(t=t.concat(e.observers));return e.observers&&(t=t.concat(e.observers)),t}created(){super.created();const e=n.created;if(e)for(let t=0;t<e.length;t++)e[t].call(this)}_registered(){const e=r.prototype;if(!e.hasOwnProperty(JSCompiler_renameProperty("__hasRegisterFinished",e))){e.__hasRegisterFinished=!0,super._registered(),C&&o(e);const t=Object.getPrototypeOf(this);let s=n.beforeRegister;if(s)for(let e=0;e<s.length;e++)s[e].call(t);if(s=n.registered,s)for(let e=0;e<s.length;e++)s[e].call(t)}}_applyListeners(){super._applyListeners();const e=n.listeners;if(e)for(let t=0;t<e.length;t++){const s=e[t];if(s)for(let e in s)this._addMethodEventListenerToNode(this,e,s[e])}}_ensureAttributes(){const e=n.hostAttributes;if(e)for(let t=e.length-1;t>=0;t--){const s=e[t];for(let e in s)this._ensureAttribute(e,s[e])}super._ensureAttributes()}ready(){super.ready();let e=n.ready;if(e)for(let t=0;t<e.length;t++)e[t].call(this)}attached(){super.attached();let e=n.attached;if(e)for(let t=0;t<e.length;t++)e[t].call(this)}detached(){super.detached();let e=n.detached;if(e)for(let t=0;t<e.length;t++)e[t].call(this)}attributeChanged(e,t,s){super.attributeChanged();let i=n.attributeChanged;if(i)for(let n=0;n<i.length;n++)i[n].call(this,e,t,s)}}if(s){Array.isArray(s)||(s=[s]);let e=t.prototype.behaviors;i=it(s,null,e),r.prototype.behaviors=e?e.concat(s):i}const o=t=>{i&&function(e,t,s){for(let i=0;i<t.length;i++)st(e,t[i],s,et)}(t,i,n),st(t,e,n,Ze)};return C||o(r.prototype),r.generatedFrom=e,r}const lt=function(e){let t;return t="function"==typeof e?e:lt.Class(e),e._legacyForceObservedAttributes&&(t.prototype._legacyForceObservedAttributes=e._legacyForceObservedAttributes),customElements.define(t.is,t),t};
146
146
  /**
147
147
  @license
148
148
  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -171,7 +171,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
171
171
  Code distributed by Google as part of the polymer project is also
172
172
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
173
173
  */
174
- let dt=null;function ut(){return dt}ut.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:ut,writable:!0}});const _t=w(ut),pt=ht(_t);const ft=w(class{});function mt(e,t){for(let s=0;s<t.length;s++){let i=t[s];if(Boolean(e)!=Boolean(i.__hideTemplateChildren__))if(i.nodeType===Node.TEXT_NODE)e?(i.__polymerTextContent__=i.textContent,i.textContent=""):i.textContent=i.__polymerTextContent__;else if("slot"===i.localName)if(e)i.__polymerReplaced__=document.createComment("hidden-slot"),_(_(i).parentNode).replaceChild(i.__polymerReplaced__,i);else{const e=i.__polymerReplaced__;e&&_(_(e).parentNode).replaceChild(i,e)}else i.style&&(e?(i.__polymerDisplay__=i.style.display,i.style.display="none"):i.style.display=i.__polymerDisplay__);i.__hideTemplateChildren__=e,i._showHideChildren&&i._showHideChildren(e)}}class yt extends ft{constructor(e){super(),this._configureProperties(e),this.root=this._stampTemplate(this.__dataHost);let t=[];this.children=t;for(let e=this.root.firstChild;e;e=e.nextSibling)t.push(e),e.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let s=this.__templatizeOptions;(e&&s.instanceProps||!s.instanceProps)&&this._enableProperties()}_configureProperties(e){if(this.__templatizeOptions.forwardHostProp)for(let e in this.__hostProps)this._setPendingProperty(e,this.__dataHost["_host_"+e]);for(let t in e)this._setPendingProperty(t,e[t])}forwardHostProp(e,t){this._setPendingPropertyOrPath(e,t,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(e,t,s){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(e,t,(e=>{e.model=this,s(e)}));else{let i=this.__dataHost.__dataHost;i&&i._addEventListenerToNode(e,t,s)}}_showHideChildren(e){mt(e,this.children)}_setUnmanagedPropertyToNode(e,t,s){e.__hideTemplateChildren__&&e.nodeType==Node.TEXT_NODE&&"textContent"==t?e.__polymerTextContent__=s:super._setUnmanagedPropertyToNode(e,t,s)}get parentModel(){let e=this.__parentModel;if(!e){let t;e=this;do{e=e.__dataHost.__dataHost}while((t=e.__templatizeOptions)&&!t.parentModel);this.__parentModel=e}return e}dispatchEvent(e){return!0}}yt.prototype.__dataHost,yt.prototype.__templatizeOptions,yt.prototype._methodHost,yt.prototype.__templatizeOwner,yt.prototype.__hostProps;const gt=ht(yt);function bt(e){let t=e.__dataHost;return t&&t._methodHost||t}function Ct(e,t,s){let i=s.mutableData?gt:yt;St.mixin&&(i=St.mixin(i));let n=class extends i{};return n.prototype.__templatizeOptions=s,n.prototype._bindTemplate(e),function(e,t,s,i){let n=s.hostProps||{};for(let t in i.instanceProps){delete n[t];let s=i.notifyInstanceProp;s&&e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:wt(t,s)})}if(i.forwardHostProp&&t.__dataHost)for(let t in n)s.hasHostProps||(s.hasHostProps=!0),e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(e,t,s){e.__dataHost._setPendingPropertyOrPath("_host_"+t,s[t],!0,!0)}})}(n,e,t,s),n}function vt(e,t,s,i){let n=s.forwardHostProp;if(n&&t.hasHostProps){const r="template"==e.localName;let o=t.templatizeTemplateClass;if(!o){if(r){let e=s.mutableData?pt:_t;class i extends e{}o=t.templatizeTemplateClass=i}else{const s=e.constructor;class i extends s{}o=t.templatizeTemplateClass=i}let l=t.hostProps;for(let e in l)o.prototype._addPropertyEffect("_host_"+e,o.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:xt(e,n)}),o.prototype._createNotifyingProperty("_host_"+e);M&&i&&function(e,t,s){const i=s.constructor._properties,{propertyEffects:n}=e,{instanceProps:r}=t;for(let e in n)if(!(i[e]||r&&r[e])){const t=n[e];for(let s=0;s<t.length;s++){const{part:i}=t[s].info;if(!i.signature||!i.signature.static){console.warn(`Property '${e}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}(t,s,i)}if(e.__dataProto&&Object.assign(e.__data,e.__dataProto),r)!function(e,t){dt=e,Object.setPrototypeOf(e,t.prototype),new t,dt=null}(e,o),e.__dataTemp={},e.__dataPending=null,e.__dataOld=null,e._enableProperties();else{Object.setPrototypeOf(e,o.prototype);const s=t.hostProps;for(let t in s)if(t="_host_"+t,t in e){const s=e[t];delete e[t],e.__data[t]=s}}}}function xt(e,t){return function(e,s,i){t.call(e.__templatizeOwner,s.substring("_host_".length),i[s])}}function wt(e,t){return function(e,s,i){t.call(e.__templatizeOwner,e,s,i[s])}}function St(e,t,s){if(T&&!bt(e))throw new Error("strictTemplatePolicy: template owner not trusted");if(s=s||{},e.__templatizeOwner)throw new Error("A <template> can only be templatized once");e.__templatizeOwner=t;let i=(t?t.constructor:yt)._parseTemplate(e),n=i.templatizeInstanceClass;n||(n=Ct(e,i,s),i.templatizeInstanceClass=n);const r=bt(e);vt(e,i,s,r);let o=class extends n{};return o.prototype._methodHost=r,o.prototype.__dataHost=e,o.prototype.__templatizeOwner=t,o.prototype.__hostProps=i.hostProps,o=o,o}function Pt(e,t){let s;for(;t;)if(s=t.__dataHost?t:t.__templatizeInstance){if(s.__dataHost==e)return s;t=s.__dataHost}else t=_(t).parentNode;return null}
174
+ let dt=null;function ut(){return dt}ut.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:ut,writable:!0}});const _t=P(ut),pt=ht(_t);const ft=P(class{});function mt(e,t){for(let s=0;s<t.length;s++){let i=t[s];if(Boolean(e)!=Boolean(i.__hideTemplateChildren__))if(i.nodeType===Node.TEXT_NODE)e?(i.__polymerTextContent__=i.textContent,i.textContent=""):i.textContent=i.__polymerTextContent__;else if("slot"===i.localName)if(e)i.__polymerReplaced__=document.createComment("hidden-slot"),_(_(i).parentNode).replaceChild(i.__polymerReplaced__,i);else{const e=i.__polymerReplaced__;e&&_(_(e).parentNode).replaceChild(i,e)}else i.style&&(e?(i.__polymerDisplay__=i.style.display,i.style.display="none"):i.style.display=i.__polymerDisplay__);i.__hideTemplateChildren__=e,i._showHideChildren&&i._showHideChildren(e)}}class yt extends ft{constructor(e){super(),this._configureProperties(e),this.root=this._stampTemplate(this.__dataHost);let t=[];this.children=t;for(let e=this.root.firstChild;e;e=e.nextSibling)t.push(e),e.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let s=this.__templatizeOptions;(e&&s.instanceProps||!s.instanceProps)&&this._enableProperties()}_configureProperties(e){if(this.__templatizeOptions.forwardHostProp)for(let e in this.__hostProps)this._setPendingProperty(e,this.__dataHost["_host_"+e]);for(let t in e)this._setPendingProperty(t,e[t])}forwardHostProp(e,t){this._setPendingPropertyOrPath(e,t,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(e,t,s){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(e,t,(e=>{e.model=this,s(e)}));else{let i=this.__dataHost.__dataHost;i&&i._addEventListenerToNode(e,t,s)}}_showHideChildren(e){mt(e,this.children)}_setUnmanagedPropertyToNode(e,t,s){e.__hideTemplateChildren__&&e.nodeType==Node.TEXT_NODE&&"textContent"==t?e.__polymerTextContent__=s:super._setUnmanagedPropertyToNode(e,t,s)}get parentModel(){let e=this.__parentModel;if(!e){let t;e=this;do{e=e.__dataHost.__dataHost}while((t=e.__templatizeOptions)&&!t.parentModel);this.__parentModel=e}return e}dispatchEvent(e){return!0}}yt.prototype.__dataHost,yt.prototype.__templatizeOptions,yt.prototype._methodHost,yt.prototype.__templatizeOwner,yt.prototype.__hostProps;const gt=ht(yt);function bt(e){let t=e.__dataHost;return t&&t._methodHost||t}function Ct(e,t,s){let i=s.mutableData?gt:yt;St.mixin&&(i=St.mixin(i));let n=class extends i{};return n.prototype.__templatizeOptions=s,n.prototype._bindTemplate(e),function(e,t,s,i){let n=s.hostProps||{};for(let t in i.instanceProps){delete n[t];let s=i.notifyInstanceProp;s&&e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:wt(t,s)})}if(i.forwardHostProp&&t.__dataHost)for(let t in n)s.hasHostProps||(s.hasHostProps=!0),e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(e,t,s){e.__dataHost._setPendingPropertyOrPath("_host_"+t,s[t],!0,!0)}})}(n,e,t,s),n}function vt(e,t,s,i){let n=s.forwardHostProp;if(n&&t.hasHostProps){const r="template"==e.localName;let o=t.templatizeTemplateClass;if(!o){if(r){let e=s.mutableData?pt:_t;class i extends e{}o=t.templatizeTemplateClass=i}else{const s=e.constructor;class i extends s{}o=t.templatizeTemplateClass=i}let l=t.hostProps;for(let e in l)o.prototype._addPropertyEffect("_host_"+e,o.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:xt(e,n)}),o.prototype._createNotifyingProperty("_host_"+e);I&&i&&function(e,t,s){const i=s.constructor._properties,{propertyEffects:n}=e,{instanceProps:r}=t;for(let e in n)if(!(i[e]||r&&r[e])){const t=n[e];for(let s=0;s<t.length;s++){const{part:i}=t[s].info;if(!i.signature||!i.signature.static){console.warn(`Property '${e}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}(t,s,i)}if(e.__dataProto&&Object.assign(e.__data,e.__dataProto),r)!function(e,t){dt=e,Object.setPrototypeOf(e,t.prototype),new t,dt=null}(e,o),e.__dataTemp={},e.__dataPending=null,e.__dataOld=null,e._enableProperties();else{Object.setPrototypeOf(e,o.prototype);const s=t.hostProps;for(let t in s)if(t="_host_"+t,t in e){const s=e[t];delete e[t],e.__data[t]=s}}}}function xt(e,t){return function(e,s,i){t.call(e.__templatizeOwner,s.substring("_host_".length),i[s])}}function wt(e,t){return function(e,s,i){t.call(e.__templatizeOwner,e,s,i[s])}}function St(e,t,s){if(E&&!bt(e))throw new Error("strictTemplatePolicy: template owner not trusted");if(s=s||{},e.__templatizeOwner)throw new Error("A <template> can only be templatized once");e.__templatizeOwner=t;let i=(t?t.constructor:yt)._parseTemplate(e),n=i.templatizeInstanceClass;n||(n=Ct(e,i,s),i.templatizeInstanceClass=n);const r=bt(e);vt(e,i,s,r);let o=class extends n{};return o.prototype._methodHost=r,o.prototype.__dataHost=e,o.prototype.__templatizeOwner=t,o.prototype.__hostProps=i.hostProps,o=o,o}function Pt(e,t){let s;for(;t;)if(s=t.__dataHost?t:t.__templatizeInstance){if(s.__dataHost==e)return s;t=s.__dataHost}else t=_(t).parentNode;return null}
175
175
  /**
176
176
  @license
177
177
  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -180,7 +180,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
180
180
  The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
181
181
  Code distributed by Google as part of the polymer project is also
182
182
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
183
- */let Et=!1;function It(){if(N&&!D){if(!Et){Et=!0;const e=document.createElement("style");e.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(e)}return!0}return!1}
183
+ */let Et=!1;function It(){if(C&&!O){if(!Et){Et=!0;const e=document.createElement("style");e.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(e)}return!0}return!1}
184
184
  /**
185
185
  @license
186
186
  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -189,7 +189,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
189
189
  The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
190
190
  Code distributed by Google as part of the polymer project is also
191
191
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
192
- */const Ot=m(ct(w(HTMLElement)));customElements.define("dom-bind",class extends Ot{static get observedAttributes(){return["mutable-data"]}constructor(){if(super(),T)throw new Error("strictTemplatePolicy: dom-bind not allowed");this.root=null,this.$=null,this.__children=null}attributeChangedCallback(e,t,s,i){this.mutableData=!0}connectedCallback(){It()||(this.style.display="none"),this.render()}disconnectedCallback(){this.__removeChildren()}__insertChildren(){_(_(this).parentNode).insertBefore(this.root,this)}__removeChildren(){if(this.__children)for(let e=0;e<this.__children.length;e++)this.root.appendChild(this.__children[e])}render(){let e;if(!this.__children){if(e=e||this.querySelector("template"),!e){let t=new MutationObserver((()=>{if(e=this.querySelector("template"),!e)throw new Error("dom-bind requires a <template> child");t.disconnect(),this.render()}));return void t.observe(this,{childList:!0})}this.root=this._stampTemplate(e),this.$=this.root.$,this.__children=[];for(let e=this.root.firstChild;e;e=e.nextSibling)this.__children[this.__children.length]=e;this._enableProperties()}this.__insertChildren(),this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}});
192
+ */const Ot=m(ct(P(HTMLElement)));customElements.define("dom-bind",class extends Ot{static get observedAttributes(){return["mutable-data"]}constructor(){if(super(),E)throw new Error("strictTemplatePolicy: dom-bind not allowed");this.root=null,this.$=null,this.__children=null}attributeChangedCallback(e,t,s,i){this.mutableData=!0}connectedCallback(){It()||(this.style.display="none"),this.render()}disconnectedCallback(){this.__removeChildren()}__insertChildren(){_(_(this).parentNode).insertBefore(this.root,this)}__removeChildren(){if(this.__children)for(let e=0;e<this.__children.length;e++)this.root.appendChild(this.__children[e])}render(){let e;if(!this.__children){if(e=e||this.querySelector("template"),!e){let t=new MutationObserver((()=>{if(e=this.querySelector("template"),!e)throw new Error("dom-bind requires a <template> child");t.disconnect(),this.render()}));return void t.observe(this,{childList:!0})}this.root=this._stampTemplate(e),this.$=this.root.$,this.__children=[];for(let e=this.root.firstChild;e;e=e.nextSibling)this.__children[this.__children.length]=e;this._enableProperties()}this.__insertChildren(),this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}});
193
193
  /**
194
194
  @license
195
195
  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -199,7 +199,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
199
199
  Code distributed by Google as part of the polymer project is also
200
200
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
201
201
  */
202
- const At=ct(S);class kt extends At{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!R,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super(),this.__instances=[],this.__renderDebouncer=null,this.__itemsIdxToInstIdx={},this.__chunkCount=null,this.__renderStartTime=null,this.__itemsArrayChanged=!1,this.__shouldMeasureChunk=!1,this.__shouldContinueChunking=!1,this.__chunkingId=0,this.__sortFn=null,this.__filterFn=null,this.__observePaths=null,this.__ctor=null,this.__isDetached=!0,this.template=null,this._templateInfo}disconnectedCallback(){super.disconnectedCallback(),this.__isDetached=!0;for(let e=0;e<this.__instances.length;e++)this.__detachInstance(e)}connectedCallback(){if(super.connectedCallback(),It()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;let e=_(_(this).parentNode);for(let t=0;t<this.__instances.length;t++)this.__attachInstance(t,e)}}__ensureTemplatized(){if(!this.__ctor){const e=this;let t=this.template=e._templateInfo?e:this.querySelector("template");if(!t){let e=new MutationObserver((()=>{if(!this.querySelector("template"))throw new Error("dom-repeat requires a <template> child");e.disconnect(),this.__render()}));return e.observe(this,{childList:!0}),!1}let s={};s[this.as]=!0,s[this.indexAs]=!0,s[this.itemsIndexAs]=!0,this.__ctor=St(t,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:s,forwardHostProp:function(e,t){let s=this.__instances;for(let i,n=0;n<s.length&&(i=s[n]);n++)i.forwardHostProp(e,t)},notifyInstanceProp:function(e,t,s){if(P(this.as,t)){let i=e[this.itemsIndexAs];t==this.as&&(this.items[i]=s);let n=E(this.as,`${JSCompiler_renameProperty("items",this)}.${i}`,t);this.notifyPath(n,s)}}})}return!0}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(e){if("string"==typeof e){let t=e,s=this.__getMethodHost();return function(){return s[t].apply(s,arguments)}}return e}__sortChanged(e){this.__sortFn=this.__functionFromPropertyValue(e),this.items&&this.__debounceRender(this.__render)}__filterChanged(e){this.__filterFn=this.__functionFromPropertyValue(e),this.items&&this.__debounceRender(this.__render)}__computeFrameTime(e){return Math.ceil(1e3/e)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__handleObservedPaths(e){if(this.__sortFn||this.__filterFn)if(e){if(this.__observePaths){let t=this.__observePaths;for(let s=0;s<t.length;s++)0===e.indexOf(t[s])&&this.__debounceRender(this.__render,this.delay)}}else this.__debounceRender(this.__render,this.delay)}__itemsChanged(e){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(e.path,e.value)||("items"===e.path&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}__debounceRender(e,t=0){this.__renderDebouncer=C.debounce(this.__renderDebouncer,t>0?v.after(t):p,e.bind(this)),I(this.__renderDebouncer)}render(){this.__debounceRender(this.__render),L()}__render(){if(!this.__ensureTemplatized())return;let e=this.items||[];const t=this.__sortAndFilterItems(e),s=this.__calculateLimit(t.length);this.__updateInstances(e,s,t),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame((()=>this.__continueChunking()))),this._setRenderedItemCount(this.__instances.length),R&&!this.notifyDomChange||this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}__sortAndFilterItems(e){let t=new Array(e.length);for(let s=0;s<e.length;s++)t[s]=s;return this.__filterFn&&(t=t.filter(((t,s,i)=>this.__filterFn(e[t],s,i)))),this.__sortFn&&t.sort(((t,s)=>this.__sortFn(e[t],e[s]))),t}__calculateLimit(e){let t=e;const s=this.__instances.length;if(this.initialCount){let i;!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(t=Math.min(e,this.initialCount),i=Math.max(t-s,0),this.__chunkCount=i||1):(i=Math.min(Math.max(e-s,0),this.__chunkCount),t=Math.min(s+i,e)),this.__shouldMeasureChunk=i===this.__chunkCount,this.__shouldContinueChunking=t<e,this.__renderStartTime=performance.now()}return this.__itemsArrayChanged=!1,t}__continueChunking(){if(this.__shouldMeasureChunk){const e=performance.now()-this.__renderStartTime,t=this._targetFrameTime/e;this.__chunkCount=Math.round(this.__chunkCount*t)||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}__updateInstances(e,t,s){const i=this.__itemsIdxToInstIdx={};let n;for(n=0;n<t;n++){let t=this.__instances[n],r=s[n],o=e[r];i[r]=n,t?(t._setPendingProperty(this.as,o),t._setPendingProperty(this.indexAs,n),t._setPendingProperty(this.itemsIndexAs,r),t._flushProperties()):this.__insertInstance(o,n,r)}for(let e=this.__instances.length-1;e>=n;e--)this.__detachAndRemoveInstance(e)}__detachInstance(e){let t=this.__instances[e];const s=_(t.root);for(let e=0;e<t.children.length;e++){let i=t.children[e];s.appendChild(i)}return t}__attachInstance(e,t){let s=this.__instances[e];t.insertBefore(s.root,this)}__detachAndRemoveInstance(e){this.__detachInstance(e),this.__instances.splice(e,1)}__stampInstance(e,t,s){let i={};return i[this.as]=e,i[this.indexAs]=t,i[this.itemsIndexAs]=s,new this.__ctor(i)}__insertInstance(e,t,s){const i=this.__stampInstance(e,t,s);let n=this.__instances[t+1],r=n?n.children[0]:this;return _(_(this).parentNode).insertBefore(i.root,r),this.__instances[t]=i,i}_showHideChildren(e){for(let t=0;t<this.__instances.length;t++)this.__instances[t]._showHideChildren(e)}__handleItemPath(e,t){let s=e.slice(6),i=s.indexOf("."),n=i<0?s:s.substring(0,i);if(n==parseInt(n,10)){let e=i<0?"":s.substring(i+1);this.__handleObservedPaths(e);let r=this.__itemsIdxToInstIdx[n],o=this.__instances[r];if(o){let s=this.as+(e?"."+e:"");o._setPendingPropertyOrPath(s,t,!1,!0),o._flushProperties()}return!0}}itemForElement(e){let t=this.modelForElement(e);return t&&t[this.as]}indexForElement(e){let t=this.modelForElement(e);return t&&t[this.indexAs]}modelForElement(e){return Pt(this.template,e)}}customElements.define(kt.is,kt);
202
+ const At=ct(A);class kt extends At{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!k,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super(),this.__instances=[],this.__renderDebouncer=null,this.__itemsIdxToInstIdx={},this.__chunkCount=null,this.__renderStartTime=null,this.__itemsArrayChanged=!1,this.__shouldMeasureChunk=!1,this.__shouldContinueChunking=!1,this.__chunkingId=0,this.__sortFn=null,this.__filterFn=null,this.__observePaths=null,this.__ctor=null,this.__isDetached=!0,this.template=null,this._templateInfo}disconnectedCallback(){super.disconnectedCallback(),this.__isDetached=!0;for(let e=0;e<this.__instances.length;e++)this.__detachInstance(e)}connectedCallback(){if(super.connectedCallback(),It()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;let e=_(_(this).parentNode);for(let t=0;t<this.__instances.length;t++)this.__attachInstance(t,e)}}__ensureTemplatized(){if(!this.__ctor){const e=this;let t=this.template=e._templateInfo?e:this.querySelector("template");if(!t){let e=new MutationObserver((()=>{if(!this.querySelector("template"))throw new Error("dom-repeat requires a <template> child");e.disconnect(),this.__render()}));return e.observe(this,{childList:!0}),!1}let s={};s[this.as]=!0,s[this.indexAs]=!0,s[this.itemsIndexAs]=!0,this.__ctor=St(t,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:s,forwardHostProp:function(e,t){let s=this.__instances;for(let i,n=0;n<s.length&&(i=s[n]);n++)i.forwardHostProp(e,t)},notifyInstanceProp:function(e,t,s){if(N(this.as,t)){let i=e[this.itemsIndexAs];t==this.as&&(this.items[i]=s);let n=T(this.as,`${JSCompiler_renameProperty("items",this)}.${i}`,t);this.notifyPath(n,s)}}})}return!0}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(e){if("string"==typeof e){let t=e,s=this.__getMethodHost();return function(){return s[t].apply(s,arguments)}}return e}__sortChanged(e){this.__sortFn=this.__functionFromPropertyValue(e),this.items&&this.__debounceRender(this.__render)}__filterChanged(e){this.__filterFn=this.__functionFromPropertyValue(e),this.items&&this.__debounceRender(this.__render)}__computeFrameTime(e){return Math.ceil(1e3/e)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__handleObservedPaths(e){if(this.__sortFn||this.__filterFn)if(e){if(this.__observePaths){let t=this.__observePaths;for(let s=0;s<t.length;s++)0===e.indexOf(t[s])&&this.__debounceRender(this.__render,this.delay)}}else this.__debounceRender(this.__render,this.delay)}__itemsChanged(e){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(e.path,e.value)||("items"===e.path&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}__debounceRender(e,t=0){this.__renderDebouncer=x.debounce(this.__renderDebouncer,t>0?w.after(t):p,e.bind(this)),M(this.__renderDebouncer)}render(){this.__debounceRender(this.__render),L()}__render(){if(!this.__ensureTemplatized())return;let e=this.items||[];const t=this.__sortAndFilterItems(e),s=this.__calculateLimit(t.length);this.__updateInstances(e,s,t),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame((()=>this.__continueChunking()))),this._setRenderedItemCount(this.__instances.length),k&&!this.notifyDomChange||this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}__sortAndFilterItems(e){let t=new Array(e.length);for(let s=0;s<e.length;s++)t[s]=s;return this.__filterFn&&(t=t.filter(((t,s,i)=>this.__filterFn(e[t],s,i)))),this.__sortFn&&t.sort(((t,s)=>this.__sortFn(e[t],e[s]))),t}__calculateLimit(e){let t=e;const s=this.__instances.length;if(this.initialCount){let i;!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(t=Math.min(e,this.initialCount),i=Math.max(t-s,0),this.__chunkCount=i||1):(i=Math.min(Math.max(e-s,0),this.__chunkCount),t=Math.min(s+i,e)),this.__shouldMeasureChunk=i===this.__chunkCount,this.__shouldContinueChunking=t<e,this.__renderStartTime=performance.now()}return this.__itemsArrayChanged=!1,t}__continueChunking(){if(this.__shouldMeasureChunk){const e=performance.now()-this.__renderStartTime,t=this._targetFrameTime/e;this.__chunkCount=Math.round(this.__chunkCount*t)||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}__updateInstances(e,t,s){const i=this.__itemsIdxToInstIdx={};let n;for(n=0;n<t;n++){let t=this.__instances[n],r=s[n],o=e[r];i[r]=n,t?(t._setPendingProperty(this.as,o),t._setPendingProperty(this.indexAs,n),t._setPendingProperty(this.itemsIndexAs,r),t._flushProperties()):this.__insertInstance(o,n,r)}for(let e=this.__instances.length-1;e>=n;e--)this.__detachAndRemoveInstance(e)}__detachInstance(e){let t=this.__instances[e];const s=_(t.root);for(let e=0;e<t.children.length;e++){let i=t.children[e];s.appendChild(i)}return t}__attachInstance(e,t){let s=this.__instances[e];t.insertBefore(s.root,this)}__detachAndRemoveInstance(e){this.__detachInstance(e),this.__instances.splice(e,1)}__stampInstance(e,t,s){let i={};return i[this.as]=e,i[this.indexAs]=t,i[this.itemsIndexAs]=s,new this.__ctor(i)}__insertInstance(e,t,s){const i=this.__stampInstance(e,t,s);let n=this.__instances[t+1],r=n?n.children[0]:this;return _(_(this).parentNode).insertBefore(i.root,r),this.__instances[t]=i,i}_showHideChildren(e){for(let t=0;t<this.__instances.length;t++)this.__instances[t]._showHideChildren(e)}__handleItemPath(e,t){let s=e.slice(6),i=s.indexOf("."),n=i<0?s:s.substring(0,i);if(n==parseInt(n,10)){let e=i<0?"":s.substring(i+1);this.__handleObservedPaths(e);let r=this.__itemsIdxToInstIdx[n],o=this.__instances[r];if(o){let s=this.as+(e?"."+e:"");o._setPendingPropertyOrPath(s,t,!1,!0),o._flushProperties()}return!0}}itemForElement(e){let t=this.modelForElement(e);return t&&t[this.as]}indexForElement(e){let t=this.modelForElement(e);return t&&t[this.indexAs]}modelForElement(e){return Pt(this.template,e)}}customElements.define(kt.is,kt);
203
203
  /**
204
204
  @license
205
205
  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -209,7 +209,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
209
209
  Code distributed by Google as part of the polymer project is also
210
210
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
211
211
  */
212
- class Nt extends S{static get is(){return"dom-if"}static get template(){return null}static get properties(){return{if:{type:Boolean,observer:"__debounceRender"},restamp:{type:Boolean,observer:"__debounceRender"},notifyDomChange:{type:Boolean}}}constructor(){super(),this.__renderDebouncer=null,this._lastIf=!1,this.__hideTemplateChildren__=!1,this.__template,this._templateInfo}__debounceRender(){this.__renderDebouncer=C.debounce(this.__renderDebouncer,p,(()=>this.__render())),I(this.__renderDebouncer)}disconnectedCallback(){super.disconnectedCallback();const e=_(this).parentNode;e&&(e.nodeType!=Node.DOCUMENT_FRAGMENT_NODE||_(e).host)||this.__teardownInstance()}connectedCallback(){super.connectedCallback(),It()||(this.style.display="none"),this.if&&this.__debounceRender()}__ensureTemplate(){if(!this.__template){const e=this;let t=e._templateInfo?e:_(e).querySelector("template");if(!t){let e=new MutationObserver((()=>{if(!_(this).querySelector("template"))throw new Error("dom-if requires a <template> child");e.disconnect(),this.__render()}));return e.observe(this,{childList:!0}),!1}this.__template=t}return!0}__ensureInstance(){let e=_(this).parentNode;if(this.__hasInstance()){let t=this.__getInstanceNodes();if(t&&t.length){if(_(this).previousSibling!==t[t.length-1])for(let s,i=0;i<t.length&&(s=t[i]);i++)_(e).insertBefore(s,this)}}else{if(!e)return!1;if(!this.__ensureTemplate())return!1;this.__createAndInsertInstance(e)}return!0}render(){L()}__render(){if(this.if){if(!this.__ensureInstance())return}else this.restamp&&this.__teardownInstance();this._showHideChildren(),R&&!this.notifyDomChange||this.if==this._lastIf||(this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0})),this._lastIf=this.if)}__hasInstance(){}__getInstanceNodes(){}__createAndInsertInstance(e){}__teardownInstance(){}_showHideChildren(){}}const Tt=F?class extends Nt{constructor(){super(),this.__instance=null,this.__syncInfo=null}__hasInstance(){return Boolean(this.__instance)}__getInstanceNodes(){return this.__instance.templateInfo.childNodes}__createAndInsertInstance(e){const t=this.__dataHost||this;if(T&&!this.__dataHost)throw new Error("strictTemplatePolicy: template owner not trusted");const s=t._bindTemplate(this.__template,!0);s.runEffects=(e,t,s)=>{let i=this.__syncInfo;if(this.if)i&&(this.__syncInfo=null,this._showHideChildren(),t=Object.assign(i.changedProps,t)),e(t,s);else if(this.__instance)if(i||(i=this.__syncInfo={runEffects:e,changedProps:{}}),s)for(const e in t){const t=O(e);i.changedProps[t]=this.__dataHost[t]}else Object.assign(i.changedProps,t)},this.__instance=t._stampTemplate(this.__template,s),_(e).insertBefore(this.__instance,this)}__syncHostProperties(){const e=this.__syncInfo;e&&(this.__syncInfo=null,e.runEffects(e.changedProps,!1))}__teardownInstance(){const e=this.__dataHost||this;this.__instance&&(e._removeBoundDom(this.__instance),this.__instance=null,this.__syncInfo=null)}_showHideChildren(){const e=this.__hideTemplateChildren__||!this.if;this.__instance&&Boolean(this.__instance.__hidden)!==e&&(this.__instance.__hidden=e,mt(e,this.__instance.templateInfo.childNodes)),e||this.__syncHostProperties()}}:class extends Nt{constructor(){super(),this.__ctor=null,this.__instance=null,this.__invalidProps=null}__hasInstance(){return Boolean(this.__instance)}__getInstanceNodes(){return this.__instance.children}__createAndInsertInstance(e){this.__ctor||(this.__ctor=St(this.__template,this,{mutableData:!0,forwardHostProp:function(e,t){this.__instance&&(this.if?this.__instance.forwardHostProp(e,t):(this.__invalidProps=this.__invalidProps||Object.create(null),this.__invalidProps[O(e)]=!0))}})),this.__instance=new this.__ctor,_(e).insertBefore(this.__instance.root,this)}__teardownInstance(){if(this.__instance){let e=this.__instance.children;if(e&&e.length){let t=_(e[0]).parentNode;if(t){t=_(t);for(let s,i=0;i<e.length&&(s=e[i]);i++)t.removeChild(s)}}this.__invalidProps=null,this.__instance=null}}__syncHostProperties(){let e=this.__invalidProps;if(e){this.__invalidProps=null;for(let t in e)this.__instance._setPendingProperty(t,this.__dataHost[t]);this.__instance._flushProperties()}}_showHideChildren(){const e=this.__hideTemplateChildren__||!this.if;this.__instance&&Boolean(this.__instance.__hidden)!==e&&(this.__instance.__hidden=e,this.__instance._showHideChildren(e)),e||this.__syncHostProperties()}};customElements.define(Tt.is,Tt);
212
+ class Nt extends A{static get is(){return"dom-if"}static get template(){return null}static get properties(){return{if:{type:Boolean,observer:"__debounceRender"},restamp:{type:Boolean,observer:"__debounceRender"},notifyDomChange:{type:Boolean}}}constructor(){super(),this.__renderDebouncer=null,this._lastIf=!1,this.__hideTemplateChildren__=!1,this.__template,this._templateInfo}__debounceRender(){this.__renderDebouncer=x.debounce(this.__renderDebouncer,p,(()=>this.__render())),M(this.__renderDebouncer)}disconnectedCallback(){super.disconnectedCallback();const e=_(this).parentNode;e&&(e.nodeType!=Node.DOCUMENT_FRAGMENT_NODE||_(e).host)||this.__teardownInstance()}connectedCallback(){super.connectedCallback(),It()||(this.style.display="none"),this.if&&this.__debounceRender()}__ensureTemplate(){if(!this.__template){const e=this;let t=e._templateInfo?e:_(e).querySelector("template");if(!t){let e=new MutationObserver((()=>{if(!_(this).querySelector("template"))throw new Error("dom-if requires a <template> child");e.disconnect(),this.__render()}));return e.observe(this,{childList:!0}),!1}this.__template=t}return!0}__ensureInstance(){let e=_(this).parentNode;if(this.__hasInstance()){let t=this.__getInstanceNodes();if(t&&t.length){if(_(this).previousSibling!==t[t.length-1])for(let s,i=0;i<t.length&&(s=t[i]);i++)_(e).insertBefore(s,this)}}else{if(!e)return!1;if(!this.__ensureTemplate())return!1;this.__createAndInsertInstance(e)}return!0}render(){L()}__render(){if(this.if){if(!this.__ensureInstance())return}else this.restamp&&this.__teardownInstance();this._showHideChildren(),k&&!this.notifyDomChange||this.if==this._lastIf||(this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0})),this._lastIf=this.if)}__hasInstance(){}__getInstanceNodes(){}__createAndInsertInstance(e){}__teardownInstance(){}_showHideChildren(){}}const Tt=D?class extends Nt{constructor(){super(),this.__instance=null,this.__syncInfo=null}__hasInstance(){return Boolean(this.__instance)}__getInstanceNodes(){return this.__instance.templateInfo.childNodes}__createAndInsertInstance(e){const t=this.__dataHost||this;if(E&&!this.__dataHost)throw new Error("strictTemplatePolicy: template owner not trusted");const s=t._bindTemplate(this.__template,!0);s.runEffects=(e,t,s)=>{let i=this.__syncInfo;if(this.if)i&&(this.__syncInfo=null,this._showHideChildren(),t=Object.assign(i.changedProps,t)),e(t,s);else if(this.__instance)if(i||(i=this.__syncInfo={runEffects:e,changedProps:{}}),s)for(const e in t){const t=R(e);i.changedProps[t]=this.__dataHost[t]}else Object.assign(i.changedProps,t)},this.__instance=t._stampTemplate(this.__template,s),_(e).insertBefore(this.__instance,this)}__syncHostProperties(){const e=this.__syncInfo;e&&(this.__syncInfo=null,e.runEffects(e.changedProps,!1))}__teardownInstance(){const e=this.__dataHost||this;this.__instance&&(e._removeBoundDom(this.__instance),this.__instance=null,this.__syncInfo=null)}_showHideChildren(){const e=this.__hideTemplateChildren__||!this.if;this.__instance&&Boolean(this.__instance.__hidden)!==e&&(this.__instance.__hidden=e,mt(e,this.__instance.templateInfo.childNodes)),e||this.__syncHostProperties()}}:class extends Nt{constructor(){super(),this.__ctor=null,this.__instance=null,this.__invalidProps=null}__hasInstance(){return Boolean(this.__instance)}__getInstanceNodes(){return this.__instance.children}__createAndInsertInstance(e){this.__ctor||(this.__ctor=St(this.__template,this,{mutableData:!0,forwardHostProp:function(e,t){this.__instance&&(this.if?this.__instance.forwardHostProp(e,t):(this.__invalidProps=this.__invalidProps||Object.create(null),this.__invalidProps[R(e)]=!0))}})),this.__instance=new this.__ctor,_(e).insertBefore(this.__instance.root,this)}__teardownInstance(){if(this.__instance){let e=this.__instance.children;if(e&&e.length){let t=_(e[0]).parentNode;if(t){t=_(t);for(let s,i=0;i<e.length&&(s=e[i]);i++)t.removeChild(s)}}this.__invalidProps=null,this.__instance=null}}__syncHostProperties(){let e=this.__invalidProps;if(e){this.__invalidProps=null;for(let t in e)this.__instance._setPendingProperty(t,this.__dataHost[t]);this.__instance._flushProperties()}}_showHideChildren(){const e=this.__hideTemplateChildren__||!this.if;this.__instance&&Boolean(this.__instance.__hidden)!==e&&(this.__instance.__hidden=e,this.__instance._showHideChildren(e)),e||this.__syncHostProperties()}};customElements.define(Tt.is,Tt);
213
213
  /**
214
214
  @license
215
215
  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -219,7 +219,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
219
219
  Code distributed by Google as part of the polymer project is also
220
220
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
221
221
  */
222
- let Mt,Dt=d((e=>{let t=f(e);return class extends t{static get properties(){return{items:{type:Array},multi:{type:Boolean,value:!1},selected:{type:Object,notify:!0},selectedItem:{type:Object,notify:!0},toggle:{type:Boolean,value:!1}}}static get observers(){return["__updateSelection(multi, items.*)"]}constructor(){super(),this.__lastItems=null,this.__lastMulti=null,this.__selectedMap=null}__updateSelection(e,t){let s=t.path;if(s==JSCompiler_renameProperty("items",this)){let s=t.base||[],i=this.__lastItems;if(e!==this.__lastMulti&&this.clearSelection(),i){let e=Me(s,i);this.__applySplices(e)}this.__lastItems=s,this.__lastMulti=e}else if(t.path==`${JSCompiler_renameProperty("items",this)}.splices`)this.__applySplices(t.value.indexSplices);else{let e=s.slice(`${JSCompiler_renameProperty("items",this)}.`.length),t=parseInt(e,10);e.indexOf(".")<0&&e==t&&this.__deselectChangedIdx(t)}}__applySplices(e){let t=this.__selectedMap;for(let s=0;s<e.length;s++){let i=e[s];t.forEach(((e,s)=>{e<i.index||(e>=i.index+i.removed.length?t.set(s,e+i.addedCount-i.removed.length):t.set(s,-1))}));for(let e=0;e<i.addedCount;e++){let s=i.index+e;t.has(this.items[s])&&t.set(this.items[s],s)}}this.__updateLinks();let s=0;t.forEach(((e,i)=>{e<0?(this.multi?this.splice(JSCompiler_renameProperty("selected",this),s,1):this.selected=this.selectedItem=null,t.delete(i)):s++}))}__updateLinks(){if(this.__dataLinkedPaths={},this.multi){let e=0;this.__selectedMap.forEach((t=>{t>=0&&this.linkPaths(`${JSCompiler_renameProperty("items",this)}.${t}`,`${JSCompiler_renameProperty("selected",this)}.${e++}`)}))}else this.__selectedMap.forEach((e=>{this.linkPaths(JSCompiler_renameProperty("selected",this),`${JSCompiler_renameProperty("items",this)}.${e}`),this.linkPaths(JSCompiler_renameProperty("selectedItem",this),`${JSCompiler_renameProperty("items",this)}.${e}`)}))}clearSelection(){this.__dataLinkedPaths={},this.__selectedMap=new Map,this.selected=this.multi?[]:null,this.selectedItem=null}isSelected(e){return this.__selectedMap.has(e)}isIndexSelected(e){return this.isSelected(this.items[e])}__deselectChangedIdx(e){let t=this.__selectedIndexForItemIndex(e);if(t>=0){let e=0;this.__selectedMap.forEach(((s,i)=>{t==e++&&this.deselect(i)}))}}__selectedIndexForItemIndex(e){let t=this.__dataLinkedPaths[`${JSCompiler_renameProperty("items",this)}.${e}`];if(t)return parseInt(t.slice(`${JSCompiler_renameProperty("selected",this)}.`.length),10)}deselect(e){let t=this.__selectedMap.get(e);if(t>=0){let s;this.__selectedMap.delete(e),this.multi&&(s=this.__selectedIndexForItemIndex(t)),this.__updateLinks(),this.multi?this.splice(JSCompiler_renameProperty("selected",this),s,1):this.selected=this.selectedItem=null}}deselectIndex(e){this.deselect(this.items[e])}select(e){this.selectIndex(this.items.indexOf(e))}selectIndex(e){let t=this.items[e];this.isSelected(t)?this.toggle&&this.deselectIndex(e):(this.multi||this.__selectedMap.clear(),this.__selectedMap.set(t,e),this.__updateLinks(),this.multi?this.push(JSCompiler_renameProperty("selected",this),t):this.selected=this.selectedItem=t)}}}))(S);class Rt extends Dt{static get is(){return"array-selector"}static get template(){return null}}customElements.define(Rt.is,Rt),Mt=ht._mutablePropertyChange;const Ft={properties:{mutableData:Boolean},_shouldPropertyChange(e,t,s){return Mt(this,e,t,s,this.mutableData)}},Lt=We(HTMLElement).prototype,Ht=A`
222
+ let Mt,Dt=d((e=>{let t=f(e);return class extends t{static get properties(){return{items:{type:Array},multi:{type:Boolean,value:!1},selected:{type:Object,notify:!0},selectedItem:{type:Object,notify:!0},toggle:{type:Boolean,value:!1}}}static get observers(){return["__updateSelection(multi, items.*)"]}constructor(){super(),this.__lastItems=null,this.__lastMulti=null,this.__selectedMap=null}__updateSelection(e,t){let s=t.path;if(s==JSCompiler_renameProperty("items",this)){let s=t.base||[],i=this.__lastItems;if(e!==this.__lastMulti&&this.clearSelection(),i){let e=Me(s,i);this.__applySplices(e)}this.__lastItems=s,this.__lastMulti=e}else if(t.path==`${JSCompiler_renameProperty("items",this)}.splices`)this.__applySplices(t.value.indexSplices);else{let e=s.slice(`${JSCompiler_renameProperty("items",this)}.`.length),t=parseInt(e,10);e.indexOf(".")<0&&e==t&&this.__deselectChangedIdx(t)}}__applySplices(e){let t=this.__selectedMap;for(let s=0;s<e.length;s++){let i=e[s];t.forEach(((e,s)=>{e<i.index||(e>=i.index+i.removed.length?t.set(s,e+i.addedCount-i.removed.length):t.set(s,-1))}));for(let e=0;e<i.addedCount;e++){let s=i.index+e;t.has(this.items[s])&&t.set(this.items[s],s)}}this.__updateLinks();let s=0;t.forEach(((e,i)=>{e<0?(this.multi?this.splice(JSCompiler_renameProperty("selected",this),s,1):this.selected=this.selectedItem=null,t.delete(i)):s++}))}__updateLinks(){if(this.__dataLinkedPaths={},this.multi){let e=0;this.__selectedMap.forEach((t=>{t>=0&&this.linkPaths(`${JSCompiler_renameProperty("items",this)}.${t}`,`${JSCompiler_renameProperty("selected",this)}.${e++}`)}))}else this.__selectedMap.forEach((e=>{this.linkPaths(JSCompiler_renameProperty("selected",this),`${JSCompiler_renameProperty("items",this)}.${e}`),this.linkPaths(JSCompiler_renameProperty("selectedItem",this),`${JSCompiler_renameProperty("items",this)}.${e}`)}))}clearSelection(){this.__dataLinkedPaths={},this.__selectedMap=new Map,this.selected=this.multi?[]:null,this.selectedItem=null}isSelected(e){return this.__selectedMap.has(e)}isIndexSelected(e){return this.isSelected(this.items[e])}__deselectChangedIdx(e){let t=this.__selectedIndexForItemIndex(e);if(t>=0){let e=0;this.__selectedMap.forEach(((s,i)=>{t==e++&&this.deselect(i)}))}}__selectedIndexForItemIndex(e){let t=this.__dataLinkedPaths[`${JSCompiler_renameProperty("items",this)}.${e}`];if(t)return parseInt(t.slice(`${JSCompiler_renameProperty("selected",this)}.`.length),10)}deselect(e){let t=this.__selectedMap.get(e);if(t>=0){let s;this.__selectedMap.delete(e),this.multi&&(s=this.__selectedIndexForItemIndex(t)),this.__updateLinks(),this.multi?this.splice(JSCompiler_renameProperty("selected",this),s,1):this.selected=this.selectedItem=null}}deselectIndex(e){this.deselect(this.items[e])}select(e){this.selectIndex(this.items.indexOf(e))}selectIndex(e){let t=this.items[e];this.isSelected(t)?this.toggle&&this.deselectIndex(e):(this.multi||this.__selectedMap.clear(),this.__selectedMap.set(t,e),this.__updateLinks(),this.multi?this.push(JSCompiler_renameProperty("selected",this),t):this.selected=this.selectedItem=t)}}}))(A);class Rt extends Dt{static get is(){return"array-selector"}static get template(){return null}}customElements.define(Rt.is,Rt),Mt=ht._mutablePropertyChange;const Ft={properties:{mutableData:Boolean},_shouldPropertyChange(e,t,s){return Mt(this,e,t,s,this.mutableData)}},Lt=We(HTMLElement).prototype,Ht=F`
223
223
  <custom-style>
224
224
  <style is="custom-style">
225
225
  [hidden] {
@@ -602,7 +602,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
602
602
  part of the polymer project is also subject to an additional IP rights grant
603
603
  found at http://polymer.github.io/PATENTS.txt
604
604
  */
605
- lt({_template:A`
605
+ lt({_template:F`
606
606
  <style>
607
607
  :host {
608
608
  @apply --layout-inline;
@@ -0,0 +1 @@
1
+ import{_ as e,h as t}from"./shared-63eaded9.js";import{C as l}from"./shared-df730f90.js";import"./foxy-nucleon-element.js";import{R as s,T as a,a as i}from"./shared-f6e51811.js";import{c as r}from"./shared-4e709717.js";import{N as d}from"./shared-39e3ae67.js";let n,o,h,c,m,u=e=>e;const p=l(s(a(i(d))));class v extends p{constructor(){super(...arguments),this.templates={},this.columns=[]}static get properties(){return e(e({},super.properties),{},{columns:{attribute:!1}})}render(){var e,l;const s=this.columns.some((e=>!!e.header));return t(n||(n=u` <div data-testid="wrapper" aria-busy="${0}" aria-live="polite" class="relative font-lumo text-m"> <table class="table-fixed w-full" data-testid="table"> <thead class="${0}"> <tr> ${0} </tr> </thead> <tbody class="divide-y divide-contrast-10"> ${0} </tbody> </table> ${0} </div> ${0} `),this.in("busy"),s?"border-b border-contrast-10":"sr-only",this.columns.map(((e,l)=>{var s;return t(o||(o=u` <th class="${0}"> ${0} </th> `),r({"truncate h-l text-tertiary text-m text-left font-medium":!0,"text-right":l===this.columns.length-1,"hidden sm-table-cell":"sm"===e.hideBelow,"hidden md-table-cell":"md"===e.hideBelow,"hidden lg-table-cell":"lg"===e.hideBelow,"hidden xl-table-cell":"xl"===e.hideBelow}),null===(s=e.header)||void 0===s?void 0:s.call(e,{html:t,lang:this.lang,data:this.data,ns:this.ns}))})),this.__rows.map((e=>{var l;return t(h||(h=u` <tr class="h-l"> ${0} </tr> `),null===(l=this.columns)||void 0===l?void 0:l.map(((l,s)=>{var a;return t(c||(c=u` <td class="${0}"> ${0} </td> `),r({"text-right":s===this.columns.length-1,"hidden sm-table-cell":"sm"===l.hideBelow,"hidden md-table-cell":"md"===l.hideBelow,"hidden lg-table-cell":"lg"===l.hideBelow,"hidden xl-table-cell":"xl"===l.hideBelow,"truncate h-l text-body":!0}),e?null===(a=l.cell)||void 0===a?void 0:a.call(l,{html:t,lang:this.lang,data:e,ns:this.ns}):"")})))})),this.in({idle:"snapshot"})?"":t(m||(m=u` <div class="absolute inset-0 flex items-center justify-center"> <foxy-spinner data-testid="spinner" layout="vertical" state="${0}" class="p-m bg-base shadow-xs rounded-t-l rounded-b-l" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> `),this.in("busy")?"busy":this.in("idle")?"empty":"error",this.lang,this.ns,null!==(l=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==l?l:""),this.renderTemplateOrSlot())}get __rows(){var e,t,l;const s=Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e._embedded)&&void 0!==t?t:{}).reduce(((e,t)=>[...e,...t]),[]);let a;if(0===s.length)try{const e=new URL(null!==(l=this.href)&&void 0!==l?l:"").searchParams.get("limit"),t=parseInt(null!=e?e:"");a=isNaN(t)?20:t}catch(e){a=20}else a=s.length;return new Array(a).fill(null).map(((e,t)=>{var l;return null!==(l=s[t])&&void 0!==l?l:e}))}}export{v as T};
@@ -1,4 +1,4 @@
1
- import{T as e,D as t,E as a,C as i}from"./shared-8c308dc1.js";import{O as s,a as o,b as r,c as n,I as l}from"./shared-dfb99fb9.js";import{h as d,G as h,P as u,D as c,t as p,b as m,s as _}from"./shared-5499ce50.js";import"./shared-7a93239c.js";import{T as f}from"./shared-15d3d613.js";import"./shared-7eaa7ada.js";import{D as v,t as g,f as y,a as b}from"./shared-70c7bf00.js";const D=d`<dom-module id="lumo-date-picker-overlay" theme-for="vaadin-date-picker-overlay">
1
+ import{T as e,D as t,E as a,C as i}from"./shared-8b20bc23.js";import{O as s,a as o,b as r,c as n,I as l}from"./shared-fab8c705.js";import{h as d,G as h,P as u,a as c,t as p,c as m,y as _}from"./shared-ff79f3f9.js";import"./shared-5a54a9bc.js";import{T as f}from"./shared-a040d79d.js";import"./shared-f7fbb249.js";import{D as v,t as g,f as y,a as b}from"./shared-46ee137f.js";const D=d`<dom-module id="lumo-date-picker-overlay" theme-for="vaadin-date-picker-overlay">
2
2
  <template>
3
3
  <style include="lumo-menu-overlay">
4
4
  [part="overlay"] {
@@ -801,4 +801,4 @@ This program is available under Apache License Version 2.0, available at https:/
801
801
 
802
802
  <iron-media-query query="[[_fullscreenMediaQuery]]" query-matches="{{_fullscreen}}">
803
803
  </iron-media-query>
804
- `}static get is(){return"vaadin-date-picker"}static get version(){return"4.4.2"}static get properties(){return{clearButtonVisible:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},errorMessage:String,placeholder:String,helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_userInputValue:String}}static get observers(){return["_userInputValueChanged(_userInputValue)","_setClearButtonLabel(i18n.clear)"]}ready(){super.ready(),o(this,(()=>this._inputElement.validate=()=>{})),this._inputElement.addEventListener("change",(e=>{""!==this._inputElement.value||e.__fromClearButton||(this.__dispatchChange=!0)}))}_onVaadinOverlayClose(e){this._openedWithFocusRing&&this.hasAttribute("focused")?this.focusElement.setAttribute("focus-ring",""):this.hasAttribute("focused")||this.focusElement.blur(),e.detail.sourceEvent&&-1!==e.detail.sourceEvent.composedPath().indexOf(this)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this[this._overlayInitialized&&this.$.overlay.opened?"close":"open"]()}_input(){return this.$.input}set _inputValue(e){this._inputElement.value=e}get _inputValue(){return this._inputElement.value}_getAriaExpanded(e){return Boolean(e).toString()}get focusElement(){return this._input()||this}_setClearButtonLabel(e){this._inputElement.shadowRoot.querySelector('[part="clear-button"]').setAttribute("aria-label",e)}}customElements.define(Y.is,Y);export{Y as D,M as a};
804
+ `}static get is(){return"vaadin-date-picker"}static get version(){return"4.4.2"}static get properties(){return{clearButtonVisible:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},errorMessage:String,placeholder:String,helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_userInputValue:String}}static get observers(){return["_userInputValueChanged(_userInputValue)","_setClearButtonLabel(i18n.clear)"]}ready(){super.ready(),o(this,(()=>this._inputElement.validate=()=>{})),this._inputElement.addEventListener("change",(e=>{""!==this._inputElement.value||e.__fromClearButton||(this.__dispatchChange=!0)}))}_onVaadinOverlayClose(e){this._openedWithFocusRing&&this.hasAttribute("focused")?this.focusElement.setAttribute("focus-ring",""):this.hasAttribute("focused")||this.focusElement.blur(),e.detail.sourceEvent&&-1!==e.detail.sourceEvent.composedPath().indexOf(this)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this[this._overlayInitialized&&this.$.overlay.opened?"close":"open"]()}_input(){return this.$.input}set _inputValue(e){this._inputElement.value=e}get _inputValue(){return this._inputElement.value}_getAriaExpanded(e){return Boolean(e).toString()}get focusElement(){return this._input()||this}_setClearButtonLabel(e){this._inputElement.shadowRoot.querySelector('[part="clear-button"]').setAttribute("aria-label",e)}}customElements.define(Y.is,Y);export{Y as D};
@@ -0,0 +1 @@
1
+ import{L as t,_ as e,j as i,h as s}from"./shared-63eaded9.js";import"./shared-5a54a9bc.js";import{p as r}from"./shared-c64bc1a0.js";import"./shared-46ee137f.js";import"./shared-8b20bc23.js";import"./shared-073cb8e9.js";import{b as a,S as n,c as o}from"./shared-f6e51811.js";import"./shared-6f412a43.js";import"./shared-b58b8353.js";import{I as l,D as c}from"./shared-f7fbb249.js";import{E as h}from"./shared-1de261b3.js";import"./shared-65dfd512.js";import"./shared-a040d79d.js";import"./shared-fab8c705.js";import"./shared-60126eee.js";import{s as d}from"./shared-b0f0e8b5.js";class u extends CustomEvent{constructor(t){super("change",{detail:t})}}class m extends CustomEvent{constructor(t){super("submit",{detail:t,cancelable:!0})}}let _,p,g=t=>t;var y;!function(t){t[t.Excluded=0]="Excluded",t[t.BeforeEnter=1]="BeforeEnter",t[t.Default=2]="Default",t[t.Previous=3]="Previous",t[t.BeforeExit=4]="BeforeExit"}(y||(y={}));class f extends t{constructor(){super(...arguments),this.quantity=0,this.image=""}static get properties(){return e(e({},super.properties),{},{quantity:{attribute:!1},image:{attribute:!1}})}static get styles(){return[a.styles,i(_||(_=g`.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.blur-1{filter:blur(1px)}.blur-2{filter:blur(2px)}.grayscale{filter:grayscale()}.rotate-12{--tw-rotate:12deg}.-rotate-12{--tw-rotate:-12deg}.-rotate-24{--tw-rotate:-24deg}.translate-y-half{--tw-translate-y:50%}`))]}set empty(t){this.updateComplete.then((()=>{if(t){const[,...t]=this.__stack;t.forEach((t=>t.remove()))}else this.quantity>1&&this.__stack.length<2&&this.__insertImage(y.Previous,this.__stack[0])}))}set data({quantity:t,image:e}){this.quantity=t,this.image=e}render(){return s(p||(p=g`<div id="image" class="w-full h-full relative"></div>`))}firstUpdated(){const t=this.__insertImage(y.Default);this.quantity>1&&this.__insertImage(y.Previous,t)}updated(t){if(t.has("quantity")){const e=t.get("quantity");void 0!==e&&(this.quantity>e?this.__add():this.__remove())}t.has("image")&&this.__stack.forEach((t=>t.src=this.image))}get __container(){return this.shadowRoot.getElementById("image")}get __stack(){var t,e;return[...null!==(e=null===(t=this.__container)||void 0===t?void 0:t.querySelectorAll(":not(.opacity-0)"))&&void 0!==e?e:[]].reverse()}__add(){const[t,e]=this.__stack;this.quantity>1?(t&&this.__setImageState(t,y.Previous),e&&(this.__setImageState(e,y.BeforeExit),e.ontransitionend=()=>e.remove()),this.__setImageState(this.__insertImage(y.BeforeEnter),y.Default)):t&&this.__setImageState(t,y.Default)}__remove(){const[t,e]=this.__stack;let i;if(this.quantity>0?(e&&this.__setImageState(e,y.Default),i=t):(t&&this.__setImageState(t,y.Excluded),i=e),i&&(this.__setImageState(i,y.BeforeEnter),i.ontransitionend=()=>i.remove()),this.quantity>1){const t=this.__insertImage(y.BeforeExit,this.__container.firstElementChild);this.__setImageState(t,y.Previous)}}__insertImage(t,e=null){const i=new Image;return i.src=this.image,i.setAttribute("part","picture"),i.addEventListener("error",(()=>i.src=f.placeholder)),this.__setImageState(i,t),this.__container.insertBefore(i,e),i}__setImageState(t,e){t.offsetHeight,t.className=["absolute inset-0 w-full h-full object-cover rounded transform transition duration-700 ease-out-back",["grayscale","shadow-m translate-y-half scale-110 rotate-12 opacity-0","shadow-m","blur-1 -rotate-12 opacity-25","blur-2 -rotate-24 opacity-0"][e]].join(" ")}}f.placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E';let v,b,w,x,q,I,E,$,C=t=>t;class S extends(n(t)){constructor(){super(...arguments),this.empty=!1,this.data=[]}static get properties(){return e(e({},super.properties),{},{empty:{attribute:!1},data:{attribute:!1}})}static get styles(){return[a.styles,i(v||(v=C`.w-preview{width:5.5rem}.h-preview{height:5.5rem}.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.grayscale{filter:grayscale()}.grid-2>:nth-child(1),.grid-3>:nth-child(1),.grid-4-plus>:nth-child(1),.grid-4>:nth-child(1){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(2){opacity:0;--tw-translate-x:100%;--tw-translate-y:var(--tw-translate-x)}.grid-2>:nth-child(2),.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){transform-origin:top right}.grid-1>:nth-child(3),.grid-2>:nth-child(3),.grid-3>:nth-child(3),.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(3),.grid-2>:nth-child(3){opacity:0;--tw-translate-y:100%}.grid-3>:nth-child(3){transform-origin:bottom right}.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){transform-origin:bottom left}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4),.grid-4-plus>:nth-child(4),.grid-4>:nth-child(4){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4){opacity:0;transform-origin:bottom left;--tw-translate-x:100%}.grid-1>:nth-child(4)>:first-child,.grid-2>:nth-child(4)>:first-child,.grid-3>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:first-child{transform:perspective(250px) rotateX(-90deg)}.grid-4-plus>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:last-child{transition-delay:.15s;transition-timing-function:ease-out}.grid-4-plus>:nth-child(4)>:last-child,.grid-4>:nth-child(4)>:first-child{transition-timing-function:ease-in}.grid-4-plus>:nth-child(4)>:last-child{transform:perspective(250px) rotateX(90deg)}.grid-1>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){opacity:0}.grid-1>:nth-child(5){--tw-translate-x:100%}.grid-2>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-translate-y:-100%}.grid-1>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){opacity:0}.grid-1>:nth-child(6){--tw-translate-y:100%}.grid-2>:nth-child(6),.grid-3>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-translate-x:-100%}`))]}render(){const t=this.data.length,e="rounded bg-contrast-10",i="transition-all duration-700 ease-out-back transform absolute inset-0",r=this.empty?"grayscale":"",a=t>4?"grid-4-plus":`grid-${Math.max(1,t)}`,n=d({exportparts:"picture",class:"w-full h-full",".empty":this.empty}),[o,l,c,h]=this.data;return s(b||(b=C` <div class="${0} w-preview h-preview relative font-lumo"> <div class="${0} ${0} origin-top-left"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> ${0} </div> <div class="${0} ${0} origin-top-right"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> <div class="${0} flex text-body transition duration-150 absolute inset-0"> ${0} </div> <div class="transition duration-150 absolute inset-0"> ${0} </div> </div> <div class="${0} ${0} origin-top-right"></div> <div class="${0} ${0} origin-bottom-left"></div> </div> `),a,i,r,o?s(w||(w=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,o):"",i,r,l?s(x||(x=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,l):"",i,r,c?s(q||(q=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,c):"",i,r,e,t>102?s(I||(I=C`<iron-icon icon="icons:more-horiz" class="m-auto w-xl h-xl"></iron-icon>`)):s(E||(E=C`<div class="m-auto text-xxxl">+${0}</div>`),t-3),h?s($||($=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,h):"",i,e,i,e)}}let D,k,L=t=>t;class A extends S{static get scopedElements(){return{"x-pic":f}}}class N extends S{static get scopedElements(){return{"x-pic":A}}}class P extends(n(t)){constructor(){super(...arguments),this.quantity=0,this.items=[]}static get scopedElements(){return{"x-picture":f,"x-bundle-grid":N}}static get properties(){return{quantity:{attribute:!1},image:{attribute:!1},items:{attribute:!1}}}static get styles(){return a.styles}render(){const{quantity:t,image:e=""}=this,i=0===t,r=d({class:"w-full h-full",exportparts:"picture"});if(0===this.items.length)return s(D||(D=L`<x-picture ...="${0}" .data="${0}"></x-picture>`),r,{quantity:t,image:e});{const e=new Array(Math.max(1,t)).fill(this.items);return s(k||(k=L`<x-bundle-grid ...="${0}" .empty="${0}" .data="${0}"></x-bundle-grid>`),r,i,e)}}}class j extends o{static get properties(){return e(e({},super.properties),{},{open:{type:Object},signatures:{type:Object,converter:t=>{const e=JSON.parse(t);for(const t of Object.keys(e))64!=e[t].length&&console.error("There is something wrong with the signature. It should have 64 characters.");return e}}})}signedName(t){return this.signatures&&this.signatures[t]?`${t}||${this.signatures[t]}${this.isOpen(t)?"||open":""}`:t}isOpen(t){return!(!this.open||!this.open[t])}}let F,T,O,V,M,H,B,Z=t=>t;class R extends j{constructor(){super("items-form"),this.rel="product_item",this.readonly=!1,this.quantity=0,this.total=this.__computeTotalPrice(),this.currency="",this.isItem=!0,this.isChildItem=!1,this.pid=R.__newId(),this.__modified=!1,this.__childPrices=[],this.__images=[],this.__childrenCount=0,this.__itemDescription="",this.__handleQuantity={handleEvent:t=>{const e=Number(t.target.value);this.quantity=e,this.__modified=!0,this.__images=[this.getImageDescription()].concat(this.__images.slice(1,this.__images.length))}},this.__childItemsObserver=new MutationObserver(this.__observeItems.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__setCode(),this.__acknowledgeChildItems(),this.__changedChildItem(),this.__isValid()||console.error("Invalid item",this.value)}))}static get styles(){return[super.styles,i(F||(F=Z`:host{--quantity-width:6.5rem;--preview-size:5.5rem;--threshold:20rem}.min-w-description::before{content:'';width:var(--threshold);display:block;overflow:hidden}.ml-description{--min-width:calc(var(--threshold) + var(--preview-size) + var(--lumo-space-l));--free-space:calc(100% - var(--min-width));--max-margin-left:calc(var(--preview-size) + var(--lumo-space-l));--final-margin-left:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-left));margin-left:var(--final-margin-left)}.mr-quantity{--min-width:var(--threshold);--free-space:calc(100% - var(--min-width));--max-margin-right:calc(var(--quantity-width) + var(--lumo-space-l));--final-margin-right:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-right));margin-right:var(--final-margin-right)}:host([data-bundled]:not(:last-of-type)) .separator::after{content:' ';display:block;position:absolute;width:100vw;border-bottom:solid thin var(--lumo-shade-10pct);left:0;bottom:0}.w-quantity{width:var(--quantity-width)}.w-preview{width:var(--preview-size)}.h-preview{height:var(--preview-size)}`))]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"x-error-screen":h,"x-preview":P,"x-i18n":l}}static get properties(){return e(e({},super.properties),{},{__modified:{},readonly:{type:Boolean,reflect:!0},currency:{type:String},category:{type:String},code:{type:String,reflect:!0},expires:{type:String},height:{type:Number},image:{type:String},length:{type:Number},name:{type:String},parent_code:{type:String},price:{type:Number},quantity:{type:Number,reflect:!0},quantity_max:{type:Number},quantity_min:{type:String},shipto:{type:String},total:{type:Number,reflect:!0,attribute:"total"},url:{type:String},value:{type:Object},weight:{type:Number},width:{type:Number},__childPrices:{},__childrenCount:{},__images:{},alt:{type:String},isChildItem:{type:Boolean,reflect:!0,attribute:"data-bundled"},isItem:{type:Boolean,reflect:!0,attribute:"data-item"},open:{type:Object},pid:{type:Number,reflect:!0},items:{type:Array}})}get items(){const t=[];return this.__onEachChildItem([e=>t.push(e.value)]),t}set items(t){this.__createItems(t)}get value(){const t={};for(let e=0;e<this.attributes.length;e++)t[this.attributes[e].name]=this.attributes[e].value;return t.items=this.items,t}set value(t){this.__itemDescription="";for(const e in t){let i="";if("description"!=e){if("object"==typeof t[e])i=JSON.stringify(t[e]);else{const s=e;(t[s]&&"undefined"!==t[s]||0===t[s])&&(i=t[e].toString())}this.setAttribute(e,t[e]?i:"")}else this.__itemDescription=t[e]}}updated(t){t.forEach(((t,e)=>{"__itemDescription"!=e&&"isChildItem"!=e||this.__updateDescriptionEl()})),this.__setTotalPrice(),this.dispatchEvent(new Event("change"))}render(){var t;if(!this.__isValid())return s(T||(T=Z`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`));const e=`font-lumo text-body text-s leading-m transition duration-100 ${this.quantity?"":"removed opacity-50"}`;if(this.isChildItem)return s(O||(O=Z` <article part="item" class="py-s w-full relative separator item-summary flex justify-between ${0}"> <div class="description flex-1"> <h1 class="text-header font-medium">${0}</h1> <section class="description text-secondary"> <slot></slot> </section> </div> ${0} </article> `),e,this.name,this.quantity<2?"":s(V||(V=Z` <section class="quantity font-medium text-tertiary whitespace-nowrap"> ${0} </section> `),this._t("item.items",{quantity:this.quantity})));{const i=(null!==(t=this.price)&&void 0!==t?t:0)+this.__childPrices.reduce(((t,e)=>t+e),0),r=this.__translateAmount(i*this.quantity),a=this.__translateAmount(i);return s(M||(M=Z` <article part="item" class="p-l relative item ${0} ${0}"> <x-preview class="preview float-left w-preview h-preview mr-l mb-l" exportparts="picture" .image="${0}" .quantity="${0}" .items="${0}"> </x-preview> <section class="description min-w-description ml-description"> <h1 class="text-header font-medium text-l leading-none mr-quantity mb-s"> ${0} </h1> <div class="item-description text-secondary mr-quantity mb-s"> <slot></slot> </div> <div class="child-items mb-s"> <slot name="items"></slot> </div> ${0} </section> <section class="quantity w-quantity absolute top-0 right-0 m-l"> <vaadin-integer-field class="w-full p-0" name="quantity" @change="${0}" value="${0}" min="0" has-controls ?readonly="${0}"> </vaadin-integer-field> ${0} </section> </article> `),e,this.__modified?"modified":"",this.image,this.quantity,[...this.querySelectorAll("[data-bundled]")].map((t=>{var e;return{quantity:t.quantity,image:null!==(e=t.image)&&void 0!==e?e:""}})),this.name,a?s(H||(H=Z`<div class="font-medium price text-l">${0}</div>`),a):"",this.__handleQuantity,this.quantity,this.readonly,this.quantity>1?s(B||(B=Z` <x-i18n .ns="${0}" .lang="${0}" .opts="${0}" class="price-total text-secondary text-xs text-center block mt-xs" key="price.total"> </x-i18n> `),this.ns,this.lang,{amount:r}):"")}}getImageDescription(){return{src:this.image,alt:this.alt,quantity:this.quantity}}signedName(t){const e=super.signedName(t);return`${this.pid.toString()}:${e}`}static __newId(){const t=R.__existingIds.reduce(((t,e)=>e>t?e:t),0)+1;return R.__existingIds.push(t),t}__updateDescriptionEl(){if(this.__itemDescription){let t=this.shadowRoot.querySelector("data-item-description");t||(t=document.createElement("p"),t.dataset.itemDescription="true",this.__addSlottedEl(t)),t.innerText=this.__itemDescription}else{const t=this.shadowRoot.querySelector("data-item-description");t&&t.remove()}}__addSlottedEl(t){const e=this.shadowRoot.querySelector("article");e&&e.appendChild(t)}__setCode(){this.code||(this.code=`RAND${Math.random()}`)}__createItems(t){t.forEach((t=>{const e=document.createElement(this.tagName);e.value=t,e.currency=this.currency,e.__computeTotalPrice(),this.__acknowledgeItem(e),this.appendChild(e)}))}__setTotalPrice(){this.total=this.__computeTotalPrice()}__computeTotalPrice(){if(!this.__childPrices)return this.price?this.price*this.quantity:0;let t=0;return this.__childPrices.forEach((e=>{t+=e})),t+=this.price,t*=this.quantity,t}__isValid(){const t=[];return this.name&&this.name.length||t.push("The name attribute of an item is required."),this.price||0===this.price||t.push("The price attribute of an item is required."),this.price&&this.price<0&&t.push("Item added with negative price."),this.quantity_min&&this.quantity&&this.quantity<this.quantity_min&&t.push("Quantity amount is less than minimum quantity."),this.quantity_max&&this.quantity&&this.quantity>this.quantity_max&&t.push("Quantity amount is more than maximum quantity."),console.error(...t),!t.length}__translateAmount(t){return this.currency?t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"}):""}__observeItems(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.nodeType===Node.DOCUMENT_NODE&&this.__acknowledgeItem(t)}))})),this.__setTotalPrice()}__acknowledgeChildItems(){var t;null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t))),this.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t)))}__acknowledgeItem(t){t.addEventListener("change",this.__changedChildItem.bind(this)),t.currency=this.currency,t.isItem=!1,t.isChildItem=!0,this.code&&(t.parent_code=this.code)}__changedChildItem(){const t=[],e=[];let i=0;this.__onEachChildItem([e=>{void 0!==e.total&&t.push(e.total)},t=>{e.push(t.getImageDescription())},()=>i+=1]),this.image&&0===e.length&&e.push(this.getImageDescription()),this.__childPrices=t,this.__images=e,this.__childrenCount=i,this.__setTotalPrice()}__onEachChildItem(t){const e=this.querySelectorAll("[data-bundled]");for(const i of e)for(const e of t)e(i)}}R.__existingIds=[];let z,Q,W,J,U,X,G=t=>t;class K extends j{constructor(){super("items-form"),this.readonly=!1,this.target="_top",this.cart="checkout",this.sub_modify="replace",this.sub_restart="auto",this.frequencies=[],this.handleSubmit={handleEvent:()=>{null!==this.__data&&this.dispatchEvent(new m(this.__data))&&this.shadowRoot.querySelector("form").submit()}},this.__hasValidItems=!1,this.__total=0,this.__handleFrequency={handleEvent:t=>{const e=t.detail.replace(/([wydm])\w*/,"$1").replace(/ /g,"").replace(/^0/,"");K.__validFrequency(e)?this.sub_frequency=e:this.sub_frequency="",this.__updateData()}},this.__data=new FormData,this.__childItemsObserver=new MutationObserver(this.__observeChildren.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}))}static get scopedElements(){return{"x-error-screen":h,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":c,"x-item":R}}static get properties(){return e(e({},super.properties),{},{currency:{type:String},readonly:{type:Boolean},cart:{type:String,converter:t=>t&&!["checkout","add"].includes(t)?null:t},target:{type:String},store:{type:String,attribute:"store"},sub_frequency:{type:String},sub_startdate:{type:String,converter:t=>K.__validDate(t)?t:(console.error("Invalid start date",t),"")},sub_enddate:{type:String,converter:t=>K.__validDateFuture(t)?t:(console.error("Invalid end date",t),"")},sub_token:{type:String},sub_modify:{type:String,converter:t=>""===t||"append"===t?"":"replace"},sub_restart:{type:String,converter:t=>"true"===t?t:"auto"},frequencies:{converter:t=>{if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return console.error("Invalid frequency","Frequency options must be an array."),[];for(const t of e)if(!K.__validFrequency(t))return console.error("Invalid frequency","Invalid frequency option.\n Please, check https://wiki.foxycart.com/v/2.0/products#subscription_product_options for possible values.\n Each frequency must be a in the format:\n - 1d (a number followed by d, for day)\n - 1w (a number followed by w, for week)\n - 1m (a number followed by m, for month)\n - 1y (a number followed by y, for year)\n or .5m (no other decimals are allowed, and this is only for months)\n ",t),[];return e.filter(K.__validFrequency)}},items:{type:Array},__hasValidItems:{attribute:!1},__total:{attribute:!1},__data:{attribute:!1}})}get items(){const t=[];return this.__itemElements.forEach((e=>{const i=new Proxy(e,{set:function(t,e,i){const s=Object.keys(t.value);return!("string"!=typeof e||!s.includes(e))&&(t[e]=i,!0)},get:function(t,e){return t.value[e]}});t.push(i)})),t}set items(t){this.__removeItems(),this.__createItemsFromItemArray(t)}get total(){return this.__total}render(){var t;return this.store&&this.currency?s(Q||(Q=G` <div> <form class="overflow-hidden" method="POST" target="${0}" action="https://${0}/cart" data-testid="form" class="hidden" hidden> ${0} </form> <section class="items"> <slot></slot> </section> ${0} </div> `),this.target,this.store,this.__data?s(W||(W=G` ${0}`),[...this.__data.entries()].map((([t,e])=>s(J||(J=G`<input type="hidden" name="${0}" value="${0}">`),t,e)))):"",this.readonly?"":s(U||(U=G` <section class="actions flex flex-wrap justify-end m-m"> ${0} <vaadin-button class="m-s w-full sm-w-auto" theme="primary" data-testid="submit" ?disabled="${0}" @click="${0}"> <span class="total"> ${0} </span> </vaadin-button> </section> `),this.frequencies&&this.frequencies.length?s(X||(X=G` <x-dropdown type="text" name="frequency" class="subscription m-s w-full sm-w-auto" lang="${0}" .value="${0}" .items="${0}" .getText="${0}" @change="${0}"> </x-dropdown> `),this.lang,null!==(t=this.sub_frequency)&&void 0!==t?t:"0",this.frequencies.concat(["0"]),this.__translateFrequency.bind(this),this.__handleFrequency):"",!this.__hasValidItems,this.handleSubmit,this.__submitBtnText(this.__translateAmount(this.total)))):s(z||(z=G`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`))}addItems(t){for(const e of t){const t=this.createItem(e);this.appendChild(t),this.__acknowledgeItemElement(t)}}removeItems(t){this.__removeItems((e=>t.includes(e.pid)))}updated(){this.dispatchEvent(new u(this.__data))}createItem(t){const e=this.constructor.getScopedTagName("x-item"),i=document.createElement(e);return i.value=t,i.currency=this.currency,i.readonly=this.readonly,i}__submitBtnText(t){if(this.sub_frequency&&"0"!=this.sub_frequency){const e=r(this.sub_frequency);return 1===e.count?this._t("checkout.subscribe_single_unit",{value:t,period:this._t(e.units).toLowerCase()}):this._t("checkout.subscribe_muiltiple_units",{value:t,period:this.__translateFrequency(this.sub_frequency).toLowerCase()})}return this._t("checkout.buy",{value:t})}get __itemElements(){return this.querySelectorAll("[data-item]")}__createItemsFromItemArray(t){this.addItems(t)}__removeItems(t=(()=>!0)){this.__itemElements.forEach((e=>{t(e)&&e.remove()}))}__addSignature(t,e,i){return`${t}||${e}${i?"||open":""}`}__formDataFill(t){let e=0;return this.__itemElements.forEach((i=>{e+=this.__formDataAddItem(t,i)})),this.__formDataAddCartWideSubscriptionFields(t),e}__formDataCustomInputs(t){this.querySelectorAll("[name]").forEach((e=>{const i=e;"INPUT"==i.tagName&&["checkbox","radio"].includes(i.type)&&!i.checked||"OPTION"!=i.tagName&&i.value&&["number","string"].includes(typeof i.value)&&t.set(i.name,i.value)}))}__isAttributeReserved(t){return["alt","currency","description","isChildren","isItem","items","open","pid","signatures","slot","total"].includes(t)}__formDataAddItem(t,e,i=null){let s=0;if(this.__validItem(e)){if(!e.value.pid)throw new Error("Attempt to convert a item without a propper ID");i&&i.getAttribute("code")&&e.setAttribute("parent_code",i.getAttribute("code"));for(let s=0;s<e.attributes.length;s++){const r=e.attributes[s];if(!this.__isAttributeReserved(r.name)&&!r.name.startsWith("data-")){let s=e[r.name];e.code&&["string","number"].includes(typeof s)&&(i&&"quantity"==r.name&&(s=Number(r.value)*i.quantity),t.set(e.signedName(r.name),s.toString()))}}s+=1,this.__formDataAddSubscriptionFields(t,e)}const r=e.querySelectorAll("[data-bundled]");if(r&&e.quantity>0)for(const i of r)s+=this.__formDataAddItem(t,i,e);return s}__formDataAddSubscriptionFields(t,e){if(this.sub_frequency)for(const i of["sub_frequency","sub_startdate","sub_enddate"])this[i]&&t.set(e.signedName(i),this[i])}__formDataAddCartWideSubscriptionFields(t){this.sub_frequency&&(this.sub_token&&t.set(this.signedName("sub_token"),this.sub_token),t.set(this.signedName("sub_modify"),this.sub_modify),t.set(this.signedName("sub_restart"),this.sub_restart))}__formDataAddCartFields(t){this.cart?t.set("cart",this.cart):t.delete("cart")}static __validDate(t){return null!=t&&(t.match(/^(\d{1,2}|\d{8})$/)?!(t.match(/^\d{2}$/)&&Number(t)>31):!(t.match(/^\.5m/)||!K.__validFrequency(t)))}static __validDateFuture(t){let e=!1;if(K.__validDate(t))if(t.match(/^\d{8}/)){e=(new Date).toISOString().replace(/(-|T.*)/g,"")<=t}else e=!0;return e}static __validFrequency(t){return!!t&&!!t.match(/^(\.5m|\d+[dwmy])$/)}__observeChildren(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.addEventListener("change",this.__itemChange.bind(this))}))})),this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}__itemChange(){this.__computeTotalPrice(),this.__updateData()}__computeTotalPrice(){let t=0;this.__itemElements.forEach((e=>{const i=e;i.total&&(t+=Number(i.total))})),this.__total=Number(t.toFixed(2))}__acknowledgeItemElements(){this.__itemElements.forEach((t=>{const e=t;this.__acknowledgeItemElement(e)}))}__acknowledgeItemElement(t){t.addEventListener("change",this.__itemChange.bind(this)),t.currency=this.currency}__validItem(t){const e=t.getAttribute("pid"),i=Number(t.getAttribute("quantity")),s=Number(t.getAttribute("price"));return!!(e&&i>0&&s>=0)}__translateFrequency(t){if(t.startsWith("0"))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:i}=r(t);return this._t("frequency",{units:this._t(i,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"})}__updateData(){this.__data=null;if(!this.shadowRoot.querySelector("form"))return;const t=new FormData,e=this.__formDataFill(t);this.__hasValidItems=!!e,this.__formDataAddCartFields(t),this.__formDataCustomInputs(t),this.__data=t}}customElements.define("foxy-items-form",K),customElements.define("foxy-item",R);export{K as I,P,R as a};
@@ -1,4 +1,4 @@
1
- import{T as t}from"./shared-3d12e221.js";import{a as s}from"./shared-c937b8af.js";let e,n,a,o,l,i,r=t=>t;class c extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.idColumn,c.dateColumn,c.receiptColumn]}}c.priceColumn={cell:t=>t.html(e||(e=r`
1
+ import{T as t}from"./shared-4f1f4281.js";import{a as s}from"./shared-f6e51811.js";let e,n,a,o,l,i,r=t=>t;class c extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.idColumn,c.dateColumn,c.receiptColumn]}}c.priceColumn={cell:t=>t.html(e||(e=r`
2
2
  <foxy-i18n
3
3
  data-testclass="i18n totals"
4
4
  class="text-m font-semibold font-tnum"
@@ -1,4 +1,4 @@
1
- import{S as t,i as e,e as n,f as r,r as i,h as o,j as a,c as s,a as c,g as u,d as l}from"./shared-5bf947db.js";class f extends Event{constructor(t,e){super(t,e),this.request=e.request,this.__reject=e.reject,this.__resolve=e.resolve}respondWith(t){this.preventDefault(),this.stopImmediatePropagation(),t.then(this.__resolve).catch(this.__reject)}}
1
+ import{S as t,i as e,e as n,l as r,r as i,n as o,o as a,c as s,a as c,g as u,d as l}from"./shared-63eaded9.js";class f extends Event{constructor(t,e){super(t,e),this.request=e.request,this.__reject=e.reject,this.__resolve=e.resolve}respondWith(t){this.preventDefault(),this.stopImmediatePropagation(),t.then(this.__resolve).catch(this.__reject)}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -0,0 +1 @@
1
+ import{L as e,_ as s,h as t}from"./shared-63eaded9.js";import{b as r}from"./shared-f6e51811.js";let o,a=e=>e;class d extends e{constructor(){super(...arguments),this.frame=!1}static get properties(){return s(s({},super.properties),{},{frame:{type:Boolean}})}static get styles(){return r.styles}render(){return t(o||(o=a` <section class="space-y-s font-lumo antialiased"> <h3 class="${0}"> <slot name="header"></slot> </h3> <div class="rounded-t-l rounded-b-l ${0}"> <slot></slot> </div> </section> `),"text-s font-medium text-secondary leading-none "+(this.frame?"":"pl-m"),this.frame?"border border-contrast-10 overflow-hidden":"")}}export{d as G};