@tesouro/embedded-components-react 0.2.131 → 0.2.132

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 (384) hide show
  1. package/README.md +6 -7
  2. package/dist/index.d.ts +1 -2
  3. package/dist/lib/ReceivablesWidget.js +22 -22
  4. package/dist/lib/WidgetProvider.d.ts +1 -2
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +22 -22
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index2.js +22 -22
  7. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index10.js +2 -2
  8. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index101.js +2 -2
  9. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index103.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index107.js +2 -2
  11. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index108.js +2 -2
  12. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index11.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index111.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index113.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index115.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index117.js +10 -13
  17. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index118.js +9 -35
  18. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index119.js +24 -4
  19. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index12.js +10 -10
  20. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index120.js +23 -2
  21. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index121.js +2 -25
  22. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index123.js +32 -1270
  23. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index124.js +12 -32
  24. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index125.js +34 -22
  25. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index126.js +4 -2
  26. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index127.js +2 -24
  27. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index128.js +24 -9
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index129.js +1270 -8
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index13.js +14 -14
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index130.js +8 -60
  31. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index131.js +25 -397
  32. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index132.js +76 -69
  33. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index133.js +6 -2
  34. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index134.js +9 -407
  35. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index135.js +21 -64
  36. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index136.js +32 -6
  37. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index137.js +8 -5
  38. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index138.js +12 -33
  39. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index139.js +23 -29
  40. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index14.js +12 -12
  41. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index140.js +14 -12
  42. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index141.js +12 -12
  43. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index142.js +117 -22
  44. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index143.js +217 -13
  45. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index144.js +6 -6
  46. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index145.js +10 -119
  47. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index146.js +48 -7
  48. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index147.js +48 -217
  49. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index148.js +10 -8
  50. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index149.js +44 -10
  51. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index15.js +4 -4
  52. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index150.js +15 -49
  53. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index151.js +11 -49
  54. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index152.js +150 -12
  55. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index153.js +54 -43
  56. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index154.js +71 -15
  57. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index155.js +29 -11
  58. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index156.js +3 -152
  59. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index157.js +61 -23
  60. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index158.js +37 -55
  61. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index159.js +79 -68
  62. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index160.js +5 -29
  63. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index161.js +9 -3
  64. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index162.js +41 -59
  65. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index163.js +74 -37
  66. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index164.js +56 -80
  67. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index165.js +14 -5
  68. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index166.js +21 -94
  69. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index167.js +80 -57
  70. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index168.js +29 -9
  71. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index169.js +39 -43
  72. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index170.js +6 -75
  73. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index171.js +114 -54
  74. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index172.js +70 -14
  75. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index173.js +189 -25
  76. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index174.js +29 -78
  77. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index175.js +110 -28
  78. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index176.js +134 -39
  79. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index177.js +20 -7
  80. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index178.js +18 -115
  81. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index179.js +22 -69
  82. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index180.js +25 -188
  83. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index181.js +183 -31
  84. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index182.js +12 -110
  85. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index183.js +18 -133
  86. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index184.js +48 -18
  87. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index185.js +4 -21
  88. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index186.js +5 -23
  89. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index187.js +88 -27
  90. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index188.js +37 -183
  91. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index189.js +7 -12
  92. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index19.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index190.js +44 -19
  94. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index191.js +48 -48
  95. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index192.js +205 -4
  96. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index193.js +435 -5
  97. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index194.js +24 -88
  98. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index195.js +94 -32
  99. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index196.js +57 -8
  100. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index197.js +24 -44
  101. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index198.js +9 -46
  102. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index199.js +17 -202
  103. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index2.js +21 -21
  104. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index200.js +18 -432
  105. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index201.js +2 -24
  106. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index202.js +11 -25
  107. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index203.js +19 -93
  108. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index204.js +19 -98
  109. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index205.js +27 -18
  110. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index206.js +114 -11
  111. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index207.js +68 -12
  112. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index208.js +13 -100
  113. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index209.js +12 -26
  114. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index210.js +26 -6
  115. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index211.js +96 -12
  116. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index212.js +101 -7
  117. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index213.js +17 -9
  118. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index214.js +12 -212
  119. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index215.js +14 -10
  120. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index216.js +60 -12
  121. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index217.js +398 -12
  122. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index218.js +69 -7
  123. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index219.js +2 -35
  124. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index220.js +406 -26
  125. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index221.js +7 -13
  126. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index222.js +32 -17
  127. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index223.js +99 -19
  128. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index224.js +26 -2
  129. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index225.js +6 -12
  130. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index226.js +12 -22
  131. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index227.js +7 -22
  132. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index228.js +10 -27
  133. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index229.js +211 -114
  134. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index230.js +10 -70
  135. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index231.js +12 -14
  136. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index232.js +12 -12
  137. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index234.js +7 -7
  138. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index235.js +1 -1
  139. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index241.js +1 -1
  140. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index254.js +11 -11
  141. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index257.js +1 -1
  142. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index258.js +2 -2
  143. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index260.js +4 -4
  144. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index261.js +1 -1
  145. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index262.js +1 -1
  146. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index263.js +1 -1
  147. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index264.js +4 -4
  148. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index265.js +4 -4
  149. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index266.js +1 -1
  150. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index269.js +3 -3
  151. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index272.js +487 -16
  152. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index273.js +163 -25
  153. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index274.js +38 -38
  154. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index275.js +59 -60
  155. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index276.js +29 -94
  156. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index277.js +113 -111
  157. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index278.js +21 -87
  158. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index279.js +42 -65
  159. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index280.js +56 -62
  160. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index281.js +21 -73
  161. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index282.js +43 -44
  162. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index283.js +14 -24
  163. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index284.js +80 -2
  164. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index285.js +75 -94
  165. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index286.js +43 -96
  166. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index287.js +71 -211
  167. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index288.js +67 -22
  168. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index289.js +20 -55
  169. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index290.js +17 -28
  170. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index291.js +17 -58
  171. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index292.js +167 -16
  172. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index293.js +129 -36
  173. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index294.js +153 -338
  174. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index295.js +10 -301
  175. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index296.js +18 -102
  176. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index297.js +60 -159
  177. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index298.js +62 -261
  178. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index299.js +57 -22
  179. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index3.js +3 -3
  180. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index300.js +7 -19
  181. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index301.js +9 -26
  182. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index302.js +61 -126
  183. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index303.js +22 -158
  184. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index304.js +63 -28
  185. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index305.js +14 -29
  186. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index306.js +149 -78
  187. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index307.js +10 -65
  188. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index308.js +19 -43
  189. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index309.js +22 -23
  190. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index310.js +44 -141
  191. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index311.js +31 -109
  192. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index312.js +61 -80
  193. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index313.js +25 -282
  194. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index314.js +126 -48
  195. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index315.js +160 -15
  196. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index316.js +27 -85
  197. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index317.js +27 -223
  198. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index318.js +78 -39
  199. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index319.js +22 -11
  200. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index320.js +55 -9
  201. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index321.js +28 -10
  202. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index322.js +58 -10
  203. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index323.js +19 -6
  204. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index324.js +65 -2
  205. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index325.js +43 -149
  206. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index326.js +21 -92
  207. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index327.js +139 -15
  208. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index328.js +107 -80
  209. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index329.js +81 -16
  210. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index330.js +283 -48
  211. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index331.js +47 -10
  212. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index332.js +15 -50
  213. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index333.js +86 -10
  214. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index334.js +218 -484
  215. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index335.js +34 -163
  216. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index336.js +11 -42
  217. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index337.js +8 -59
  218. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index338.js +10 -30
  219. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index339.js +11 -113
  220. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index340.js +6 -21
  221. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index341.js +2 -44
  222. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index342.js +90 -51
  223. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index343.js +16 -21
  224. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index344.js +82 -15
  225. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index345.js +16 -18
  226. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index346.js +43 -164
  227. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index347.js +10 -132
  228. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index348.js +46 -158
  229. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index349.js +17 -9
  230. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index350.js +29 -18
  231. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index351.js +40 -61
  232. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index352.js +60 -65
  233. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index353.js +92 -56
  234. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index354.js +110 -6
  235. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index355.js +86 -9
  236. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index356.js +35 -56
  237. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index357.js +344 -21
  238. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index358.js +302 -62
  239. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index359.js +103 -14
  240. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index36.js +11 -11
  241. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index360.js +162 -19
  242. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index361.js +262 -16
  243. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index362.js +23 -41
  244. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index363.js +20 -14
  245. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index364.js +2 -80
  246. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index365.js +94 -75
  247. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index366.js +96 -43
  248. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index367.js +211 -32
  249. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index37.js +10 -10
  250. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index375.js +1 -1
  251. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index378.js +1 -1
  252. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index38.js +9 -9
  253. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index382.js +9 -30
  254. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index383.js +120 -13
  255. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index384.js +18 -24
  256. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index385.js +16 -50
  257. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index386.js +16 -11
  258. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index387.js +16 -34
  259. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index388.js +16 -54
  260. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index389.js +70 -33
  261. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index39.js +24 -24
  262. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index390.js +16 -26
  263. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index391.js +16 -69
  264. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index392.js +16 -47
  265. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index393.js +11 -28
  266. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index394.js +66 -19
  267. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index395.js +42 -91
  268. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index396.js +26 -36
  269. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index397.js +18 -31
  270. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index398.js +15 -31
  271. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index399.js +23 -4
  272. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index4.js +5 -5
  273. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index40.js +4 -4
  274. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index400.js +49 -126
  275. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index401.js +32 -7
  276. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index402.js +70 -49
  277. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index403.js +67 -17
  278. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index404.js +35 -24
  279. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index405.js +2 -38
  280. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index406.js +7 -22
  281. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index407.js +48 -61
  282. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index408.js +16 -17
  283. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index409.js +66 -20
  284. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index41.js +1 -1
  285. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index410.js +12 -16
  286. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index411.js +64 -18
  287. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index412.js +8 -14
  288. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index413.js +21 -66
  289. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index414.js +29 -21
  290. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index415.js +24 -2
  291. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index416.js +39 -8
  292. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index417.js +32 -11
  293. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index418.js +85 -10
  294. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index419.js +23 -32
  295. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index42.js +2 -2
  296. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index420.js +105 -85
  297. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index421.js +110 -22
  298. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index422.js +31 -102
  299. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index423.js +23 -109
  300. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index424.js +53 -74
  301. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index425.js +34 -66
  302. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index426.js +5 -39
  303. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index427.js +93 -26
  304. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index428.js +37 -23
  305. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index429.js +33 -37
  306. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index43.js +12 -12
  307. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index430.js +28 -5
  308. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index431.js +33 -118
  309. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index432.js +10 -18
  310. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index433.js +19 -16
  311. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index434.js +21 -16
  312. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index435.js +16 -16
  313. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index436.js +21 -16
  314. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index437.js +12 -71
  315. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index438.js +21 -16
  316. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index439.js +32 -16
  317. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index44.js +5 -5
  318. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index440.js +5 -16
  319. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index441.js +127 -11
  320. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index446.js +29 -19
  321. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index447.js +39 -42
  322. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index448.js +15 -36
  323. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index449.js +81 -14
  324. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index45.js +11 -11
  325. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index450.js +48 -49
  326. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index451.js +39 -18
  327. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index452.js +45 -49
  328. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index453.js +18 -57
  329. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index454.js +70 -29
  330. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index455.js +82 -92
  331. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index456.js +53 -14
  332. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index457.js +53 -74
  333. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index458.js +53 -20
  334. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index459.js +57 -9
  335. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index46.js +9 -9
  336. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index460.js +68 -53
  337. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index461.js +21 -72
  338. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index462.js +43 -21
  339. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index463.js +36 -33
  340. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index464.js +13 -71
  341. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index465.js +50 -82
  342. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index466.js +92 -51
  343. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index467.js +14 -52
  344. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index468.js +74 -54
  345. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index469.js +21 -29
  346. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index47.js +7 -7
  347. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index470.js +9 -40
  348. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index471.js +18 -46
  349. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index472.js +48 -50
  350. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index473.js +58 -39
  351. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index474.js +31 -81
  352. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index475.js +30 -12
  353. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index476.js +9 -64
  354. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index477.js +64 -9
  355. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index478.js +51 -47
  356. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index479.js +52 -36
  357. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index48.js +2 -2
  358. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index480.js +41 -50
  359. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index481.js +18 -54
  360. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index482.js +48 -43
  361. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index483.js +38 -18
  362. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index5.js +9 -9
  363. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index50.js +1 -1
  364. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index52.js +9 -9
  365. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index53.js +4 -4
  366. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index54.js +2 -2
  367. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index55.js +1 -1
  368. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index58.js +1 -1
  369. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index6.js +10 -10
  370. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index78.js +1 -1
  371. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index8.js +3 -3
  372. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index86.js +1 -1
  373. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index87.js +2 -2
  374. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index88.js +6 -6
  375. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index89.js +4 -4
  376. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index9.js +12 -12
  377. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index94.js +1 -1
  378. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index2.js +21 -21
  379. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RefreshingRootWidgetProvider.js +9 -10
  380. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetTokenRefreshProvider.js +24 -53
  381. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  382. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/events.js +0 -1
  383. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +22 -22
  384. package/package.json +1 -1
@@ -1,493 +1,227 @@
1
- import { jsxs as h, Fragment as P, jsx as t } from "@emotion/react/jsx-runtime";
2
- import { ConditionsTable as Le } from "./index464.js";
3
- import { RulesTable as Re } from "./index465.js";
4
- import { AutocompleteUsers as te } from "./index466.js";
5
- import { AutocompleteRoles as Fe } from "./index467.js";
6
- import { AutocompleteUser as Ve } from "./index468.js";
7
- import { NAMED_VALUES as w, OPERATOR_OPERATIONS as z } from "./index469.js";
8
- import { useApprovalPolicyScript as Ie } from "./index437.js";
9
- import { useApprovalPolicyTrigger as Te } from "./index431.js";
10
- import { CounterpartAutocomplete as qe } from "./index4.js";
11
- import "./index84.js";
12
- import { useLingui as Ue, Trans as Pe } from "@lingui/react";
13
- import "clsx";
14
- import "tailwind-merge";
15
- import "@radix-ui/react-dialog";
16
- import "lucide-react";
17
- import { useId as we, useState as E, useEffect as B } from "react";
18
- import "./index159.js";
19
- import "@radix-ui/react-label";
20
- import "@radix-ui/react-radio-group";
21
- import "./index85.js";
22
- import { useForm as Ee, FormProvider as Se } from "react-hook-form";
23
- import { zodResolver as De } from "@hookform/resolvers/zod";
24
- import { z as a } from "zod";
25
- import { CurrencyEnumSchema as pe } from "./index325.js";
26
- import { useMoniteContext as Oe } from "./index57.js";
27
- import { toast as H } from "react-hot-toast";
28
- import "date-fns";
29
- import { getCounterpartName as $e } from "./index7.js";
30
- import "@radix-ui/react-checkbox";
31
- import "@radix-ui/react-select";
32
- import "./index90.js";
33
- import "../../shared/data-access/dist/lib/rest/client/utils.gen.js";
34
- import "../../shared/data-access/dist/lib/EmbedApiContext.js";
35
- import "../../shared/data-access/dist/lib/rest/client.gen.js";
36
- import "@tanstack/react-query";
37
- import "../../shared/data-access/dist/lib/rest/zod.gen.js";
38
- import { useDialog as Me } from "./index50.js";
39
- import "@mui/icons-material/ArrowBack";
40
- import "@mui/icons-material/Close";
41
- import "@mui/material/IconButton";
42
- import "@mui/material/Tooltip";
43
- import { useCurrencies as je } from "./index58.js";
44
- import "./index83.js";
45
- import { DialogContent as xe, Stack as Ne, MenuItem as y, Grid as A, Box as Qe, Typography as ae } from "@mui/material";
46
- import "@radix-ui/react-dropdown-menu";
47
- import "@tanstack/react-table";
48
- import "radix-ui";
49
- import "./index92.js";
50
- import "react-dom";
51
- import "@mui/x-data-grid";
52
- import "./index150.js";
53
- import "./index55.js";
54
- import { MoniteCurrency as We } from "./index460.js";
55
- import "./index101.js";
56
- import { DialogFooter as ze } from "./index470.js";
57
- import { DialogHeader as Be } from "./index471.js";
58
- import { RHFTextField as b } from "./index444.js";
59
- import "./index461.js";
60
- import { TagsAutocompleteInput as He } from "./index462.js";
61
- const Ge = (r) => a.object({
62
- name: a.string().min(1, r._("Policy name is required")),
63
- description: a.string().optional(),
64
- object_type: a.string(),
65
- triggerType: a.union([a.literal("was_created_by_user_id"), a.literal("counterpart_id"), a.literal("amount"), a.literal("currency"), a.literal("tags")]).nullish(),
66
- triggers: a.object({
67
- was_created_by_user_id: a.array(a.any()).optional(),
68
- tags: a.array(a.any()).optional(),
69
- counterpart_id: a.array(a.any()).optional(),
70
- amount: a.object({
71
- currency: pe,
72
- value: a.array(a.any())
73
- }).optional()
74
- }),
75
- amountOperator: a.union([a.literal("range"), a.literal("in"), a.literal("=="), a.literal("<"), a.literal("<="), a.literal(">"), a.literal(">=")]).optional(),
76
- amountValue: a.number().positive(r._("Amount must be a positive number")).optional(),
77
- amountRangeLeftValue: a.number().positive(r._("Amount must be a positive number")).optional(),
78
- amountRangeRightValue: a.number().positive(r._("Amount must be a positive number")).optional(),
79
- amountCurrency: pe.optional(),
80
- scriptType: a.union([a.literal("single_user"), a.literal("users_from_list"), a.literal("roles_from_list"), a.literal("approval_chain")]).nullish(),
81
- rules: a.object({
82
- single_user: a.any().optional(),
83
- users_from_list: a.array(a.any()).optional(),
84
- roles_from_list: a.array(a.any()).optional(),
85
- approval_chain: a.array(a.any()).optional()
86
- }),
87
- usersFromListCount: a.number().min(1, r._("Minimum number of approvals required must be at least 1")).optional(),
88
- rolesFromListCount: a.number().min(1, r._("Minimum number of approvals required must be at least 1")).optional()
89
- }).superRefine((l, G) => {
90
- const L = l.rules?.users_from_list;
91
- L && L.length > 0 && l.usersFromListCount !== void 0 && l.usersFromListCount > L.length && G.addIssue({
92
- code: a.ZodIssueCode.custom,
93
- message: r._("Cannot exceed the number of selected users ({selectedUsersLength})", {
94
- selectedUsersLength: L.length
95
- }),
96
- path: ["usersFromListCount"]
97
- });
98
- }), ke = (r) => ({
99
- name: r.name,
100
- description: r.description,
101
- trigger: {
102
- all: [
103
- "{event_name == 'submitted_for_approval'}",
104
- ...r.triggers.was_created_by_user_id?.length && r.triggers.was_created_by_user_id?.length > 0 ? [{
105
- operator: z.IN,
106
- left_operand: {
107
- name: `invoice.${w.WAS_CREATED_BY_USER_ID}`
108
- },
109
- right_operand: r.triggers.was_created_by_user_id.map((l) => l.id)
110
- }] : [],
111
- ...r.triggers.counterpart_id?.length && r.triggers.counterpart_id?.length > 0 ? [{
112
- operator: z.IN,
113
- left_operand: {
114
- name: `invoice.${w.COUNTERPART_ID}`
115
- },
116
- right_operand: r.triggers.counterpart_id.map((l) => l.id)
117
- }] : [],
118
- // Named value `tags.id` is a list. So in order to use the 'x in list' format, we need to build a trigger for each tag
119
- ...r.triggers.tags?.length && r.triggers.tags?.length > 0 ? r.triggers.tags.map((l) => ({
120
- operator: z.IN,
121
- left_operand: l.id,
122
- right_operand: {
123
- name: `invoice.${w.TAGS}`
124
- }
125
- })) : [],
126
- ...r.triggers.amount?.value?.length && r.triggers.amount?.value?.length > 0 ? [...r.triggers.amount.value.map((l) => ({
127
- operator: l[0],
128
- left_operand: {
129
- name: `invoice.${w.AMOUNT}`
130
- },
131
- right_operand: typeof l[1] == "number" ? l[1] : parseInt(l[1])
132
- })), {
133
- operator: z.EQUALS,
134
- left_operand: {
135
- name: `invoice.${w.CURRENCY}`
136
- },
137
- right_operand: r.triggers.amount.currency
138
- }] : []
139
- ]
140
- },
141
- script: [{
142
- if: {
143
- run_concurrently: !1,
144
- all: [...r.rules.single_user ? [{
145
- call: "ApprovalRequests.request_approval_by_users",
146
- params: {
147
- user_ids: [r.rules.single_user.id],
148
- required_approval_count: 1
149
- }
150
- }] : [], ...r.rules.users_from_list && r.rules.users_from_list?.length > 0 ? [{
151
- call: "ApprovalRequests.request_approval_by_users",
152
- params: {
153
- user_ids: r.rules.users_from_list.map((l) => l.id) || [],
154
- required_approval_count: r.usersFromListCount ? typeof r.usersFromListCount == "number" ? r.usersFromListCount : parseInt(r.usersFromListCount) : 0
155
- }
156
- }] : [], ...r.rules.roles_from_list && r.rules.roles_from_list?.length > 0 ? [{
157
- call: "ApprovalRequests.request_approval_by_roles",
158
- params: {
159
- role_ids: r.rules.roles_from_list.map((l) => l.id) || [],
160
- required_approval_count: r.rolesFromListCount ? typeof r.rolesFromListCount == "number" ? r.rolesFromListCount : parseInt(r.rolesFromListCount) : 0
161
- }
162
- }] : [], ...r.rules.approval_chain && r.rules.approval_chain?.length > 0 ? [{
163
- run_concurrently: !1,
164
- all: [...r.rules.approval_chain.map((l) => ({
165
- call: "ApprovalRequests.request_approval_by_users",
166
- params: {
167
- user_ids: [l.id],
168
- required_approval_count: 1
169
- }
170
- })) || []]
171
- }] : []]
172
- },
173
- then: ["{Payables.approve(invoice.id)}"],
174
- else: ["{Payables.reject(invoice.id)}"]
175
- }]
176
- }), rt = ({
177
- approvalPolicy: r,
178
- setIsEdit: l,
179
- onCreated: G,
180
- onUpdated: L
181
- }) => {
1
+ import { jsxs as c, jsx as e, Fragment as p } from "@emotion/react/jsx-runtime";
2
+ import { useLingui as U } from "@lingui/react";
3
+ import { useFormContext as W, Controller as m } from "react-hook-form";
4
+ import { Field as h, FieldContent as _ } from "./index154.js";
5
+ import { Select as D, SelectTrigger as k, SelectValue as C, SelectContent as S, SelectItem as d, SelectSeparator as K } from "./index287.js";
6
+ import { Typography as w } from "./index85.js";
7
+ import { DatePicker as j } from "./index419.js";
8
+ import { Input as E } from "./index117.js";
9
+ import { RECEIPT_DUE_PAYMENT_TERM as z, CUSTOM_DATE_PAYMENT_TERM as B } from "./index174.js";
10
+ const G = ["day", "week", "month"], $ = (t) => {
11
+ (t.key === "." || t.key === ",") && t.preventDefault();
12
+ }, J = (t) => {
13
+ const o = ["th", "st", "nd", "rd"], s = t % 100;
14
+ return `${t}${o[(s - 20) % 10] ?? o[s] ?? o[0]}`;
15
+ }, Q = Array.from({
16
+ length: 31
17
+ }, (t, o) => o + 1), F = ["recurrence_start_date", "recurrence_end_date", "recurrence_issue_mode", "recurrence_days_of_week", "recurrence_end_mode", "recurrence_max_occurrences"], A = {
18
+ su: 0,
19
+ mo: 1,
20
+ tu: 2,
21
+ we: 3,
22
+ th: 4,
23
+ fr: 5,
24
+ sa: 6
25
+ }, P = () => {
26
+ const t = /* @__PURE__ */ new Date();
27
+ return t.setHours(0, 0, 0, 0), t;
28
+ }, X = (t) => {
29
+ const o = P(), s = (A[t] - o.getDay() + 7) % 7, f = new Date(o);
30
+ return f.setDate(o.getDate() + s), f;
31
+ }, ie = () => {
182
32
  const {
183
- i18n: o
184
- } = Ue(), _e = Me(), {
185
- api: g,
186
- queryClient: S
187
- } = Oe(), {
188
- formatFromMinorUnits: k,
189
- formatToMinorUnits: D
190
- } = je(), C = !!r, oe = `Monite-Form-approvalPolicyBuilder-${we()}`, {
191
- triggers: i,
192
- getTriggerName: O
193
- } = Te({
194
- approvalPolicy: r
195
- }), {
196
- rules: v
197
- } = Ie({
198
- approvalPolicy: r
199
- }), [d, Y] = E(!1), [c, K] = E(!1), [u, X] = E(null), [s, V] = E(null), [m, Z] = E(null), {
200
- data: de
201
- } = g.finops.getApprovalPolicies.useQuery({
202
- query: {
203
- object_type: "payable"
204
- }
205
- }, {
206
- enabled: !C
207
- }), {
208
- data: $
209
- } = g.finops.getEntityUsers.useQuery({
210
- query: {
211
- id__in: Array.isArray(i?.was_created_by_user_id) ? i.was_created_by_user_id : []
212
- }
213
- }, {
214
- enabled: !!i?.was_created_by_user_id?.length
215
- }), {
216
- data: M
217
- } = g.finops.getTags.useQuery({
218
- query: {
219
- id__in: Array.isArray(i?.tags) ? i.tags : []
220
- }
221
- }, {
222
- enabled: !!i?.tags?.length
223
- }), {
224
- data: J
225
- } = g.finops.getCounterparts.useQuery({
226
- query: {
227
- id__in: Array.isArray(i?.counterpart_id) ? i.counterpart_id : []
228
- }
229
- }, {
230
- enabled: !!i?.counterpart_id?.length
231
- }), {
232
- data: ee
233
- } = g.finops.getEntityUsersId.useQuery({
234
- path: {
235
- entity_user_id: v?.single_user?.userId ?? ""
236
- }
237
- }, {
238
- enabled: !!v?.single_user?.userId
239
- }), {
240
- data: j
241
- } = g.finops.getEntityUsers.useQuery({
242
- query: {
243
- id__in: Array.isArray(v?.users_from_list?.userIds) ? v.users_from_list.userIds : []
244
- }
245
- }, {
246
- enabled: !!v?.users_from_list?.userIds?.length
247
- }), {
248
- data: x
249
- } = g.finops.getRoles.useQuery({
250
- query: {
251
- id__in: Array.isArray(v?.roles_from_list?.roleIds) ? v.roles_from_list.roleIds : []
252
- }
253
- }, {
254
- enabled: !!v?.roles_from_list?.roleIds?.length
255
- }), {
256
- data: N
257
- } = g.finops.getEntityUsers.useQuery({
258
- query: {
259
- id__in: Array.isArray(v?.approval_chain?.chainUserIds) ? v.approval_chain.chainUserIds : []
260
- }
261
- }, {
262
- enabled: !!v?.approval_chain?.chainUserIds?.length
263
- }), ie = g.finops.postApprovalPolicies.useMutation({}, {
264
- onSuccess: async (n) => {
265
- await Promise.all([g.finops.getApprovalPolicies.invalidateQueries(S), g.finops.getApprovalPoliciesId.invalidateQueries({
266
- parameters: {
267
- path: {
268
- approval_policy_id: n.id
269
- }
270
- }
271
- }, S)]), H.success(o._("Approval policy created"));
272
- },
273
- onError: async () => {
274
- H.error(o._("Error creating approval policy"));
275
- }
276
- }), se = g.finops.patchApprovalPoliciesId.useMutation(void 0, {
277
- onSuccess: async (n) => {
278
- await Promise.all([g.finops.getApprovalPolicies.invalidateQueries(S), g.finops.getApprovalPoliciesId.invalidateQueries({
279
- parameters: {
280
- path: {
281
- approval_policy_id: n.id
282
- }
283
- }
284
- }, S)]), H.success(o._("Approval policy updated"));
285
- },
286
- onError: async () => {
287
- H.error(o._("Error updating approval policy"));
288
- }
289
- }), ce = async (n) => {
290
- const f = de?.data?.map((Ae) => Ae.priority ?? 0) ?? [];
291
- n.priority = Math.max(0, ...f) + 1;
292
- const F = await ie.mutateAsync(n);
293
- if (F)
294
- return l(!1), G?.(F.id), F;
295
- }, ge = async (n, f) => {
296
- const F = await se.mutateAsync({
297
- path: {
298
- approval_policy_id: n
299
- },
300
- body: f
301
- });
302
- return F && (l(!1), L?.(n)), F;
303
- }, ne = Ee({
304
- resolver: De(Ge(o)),
305
- mode: "onChange",
306
- defaultValues: {
307
- name: r?.name || "",
308
- description: r?.description || "",
309
- scriptType: void 0,
310
- triggerType: void 0,
311
- triggers: {},
312
- rules: {},
313
- object_type: r?.object_type || "payable",
314
- amountOperator: void 0,
315
- amountValue: void 0,
316
- amountCurrency: "USD",
317
- amountRangeLeftValue: void 0,
318
- amountRangeRightValue: void 0,
319
- usersFromListCount: 1,
320
- rolesFromListCount: 1
321
- }
322
- }), {
323
- control: p,
324
- handleSubmit: ye,
325
- setValue: e,
326
- getValues: _,
327
- watch: ve
328
- } = ne, [le, re, I, T, q, U, R, Q, W, fe, he] = ve(["triggers", "rules", "amountOperator", "amountValue", "amountRangeLeftValue", "amountRangeRightValue", "amountCurrency", "triggerType", "scriptType", "usersFromListCount", "rolesFromListCount"]);
329
- B(
330
- () => {
331
- C && ($?.data && $?.data.length > 0 && e("triggers.was_created_by_user_id", $?.data), M?.data && M?.data.length > 0 && e("triggers.tags", M?.data), (J?.data?.length ?? 0) > 0 && e("triggers.counterpart_id", J?.data.map((n) => ({
332
- id: n.id,
333
- label: $e(n)
334
- }))), i.amount && i.amount?.value?.length > 0 && (e("triggers.amount", i.amount), i.amount.value.length === 2 ? (e("amountOperator", "range"), e("amountRangeLeftValue", k(typeof i.amount.value[0][1] == "number" ? i.amount.value[0][1] : parseInt(i.amount.value[0][1]), i.amount.currency) || 0), e("amountRangeRightValue", k(typeof i.amount.value[1][1] == "number" ? i.amount.value[1][1] : parseInt(i.amount.value[1][1]), i.amount.currency) || 0), e("amountCurrency", i.amount.currency)) : (e("amountOperator", i.amount.value[0][0]), e("amountValue", k(typeof i.amount.value[0][1] == "number" ? i.amount.value[0][1] : parseInt(i.amount.value[0][1]), i.amount.currency) || 0), e("amountCurrency", i.amount.currency))), ee && e("rules.single_user", ee), j?.data && j?.data.length > 0 && (e("rules.users_from_list", j?.data), e("usersFromListCount", v?.users_from_list?.count)), x?.data && x?.data.length > 0 && (e("rules.roles_from_list", x?.data), e("rolesFromListCount", v?.roles_from_list?.count)), N?.data && N?.data.length > 0 && e("rules.approval_chain", N?.data));
335
- },
336
- // eslint-disable-next-line react-hooks/exhaustive-deps
337
- [$?.data, M?.data, J?.data, ee, j?.data, x?.data, N?.data, C, e]
338
- ), B(() => {
339
- u && e("triggerType", u);
340
- }, [e, u]), B(() => {
341
- m && e("scriptType", m);
342
- }, [e, m]), B(() => {
343
- I && (I === "range" && q && U ? e("triggers.amount", {
344
- currency: R ?? "USD",
345
- value: [[">=", D(typeof q == "number" ? q : parseInt(q), R ?? "USD") || 0], ["<=", D(typeof U == "number" ? U : parseInt(U), R ?? "USD") || 0]]
346
- }) : T && e("triggers.amount", {
347
- currency: R ?? "USD",
348
- value: [[I, D(typeof T == "number" ? T : parseInt(T), R ?? "USD") || 0]]
349
- }));
350
- }, [D, I, q, U, T, R, e]);
351
- const ue = () => {
352
- !d && u === "was_created_by_user_id" && e("triggers.was_created_by_user_id", s?.triggers?.was_created_by_user_id || []), !d && u === "tags" && e("triggers.tags", s?.triggers?.tags || []), !d && u === "counterpart_id" && e("triggers.counterpart_id", s?.triggers?.counterpart_id || []), !d && u === "amount" && (e("triggers.amount", s?.triggers?.amount || void 0), e("amountOperator", s?.amountOperator || void 0), e("amountValue", s?.amountValue || void 0), e("amountRangeLeftValue", s?.amountRangeLeftValue || void 0), e("amountRangeRightValue", s?.amountRangeRightValue || void 0), e("amountCurrency", s?.amountCurrency || void 0)), d && s?.triggers && e("triggers", s?.triggers), !c && m === "single_user" && e("rules.single_user", s?.rules?.single_user || void 0), !c && m === "users_from_list" && (e("rules.users_from_list", s?.rules?.users_from_list || void 0), e("usersFromListCount", s?.usersFromListCount || 1)), !c && m === "roles_from_list" && (e("rules.roles_from_list", s?.rules?.roles_from_list || void 0), e("rolesFromListCount", s?.rolesFromListCount || 1)), !c && m === "approval_chain" && e("rules.approval_chain", s?.rules?.approval_chain || void 0), c && s?.rules && e("rules", s?.rules), X(null), Z(null), Y(!1), K(!1), V(null), e("triggerType", null), e("scriptType", null);
353
- }, me = !!u || !!m || d || c, be = () => u ? o._("Edit Condition") : d ? o._("Add Condition") : m ? o._("Edit Rule") : c ? o._("Add Rule") : C ? o._("Edit Approval Policy") : o._("Create Approval Policy"), Ce = () => {
354
- if (me)
355
- return C ? o._("Edit Approval Policy") : o._("Create Approval Policy");
356
- };
357
- return /* @__PURE__ */ h(P, { children: [
358
- /* @__PURE__ */ t(Be, { secondaryLevel: C || me, title: be(), previousLevelTitle: Ce(), closeSecondaryLevelDialog: ue }),
359
- /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ t(Se, { ...ne, children: /* @__PURE__ */ t("form", { id: oe, noValidate: !0, onSubmit: ye((n) => {
360
- const f = ke(n);
361
- if (C) {
362
- ge(r.id, f);
363
- return;
364
- }
365
- ce({
366
- ...f,
367
- object_type: n.object_type
368
- });
369
- }), children: /* @__PURE__ */ h(Ne, { gap: 3, children: [
370
- (u || d) && /* @__PURE__ */ h(b, { label: o._("Condition type"), name: "triggerType", control: p, fullWidth: !0, required: !0, select: !0, value: u || void 0, disabled: !!u, children: [
371
- (!s?.triggers?.amount || u === "amount") && /* @__PURE__ */ t(y, { value: "amount", children: O("amount") }),
372
- (!s?.triggers?.counterpart_id || u === "counterpart_id") && /* @__PURE__ */ t(y, { value: "counterpart_id", children: O("counterpart_id") }),
373
- (!s?.triggers?.was_created_by_user_id || u === "was_created_by_user_id") && /* @__PURE__ */ t(y, { value: "was_created_by_user_id", children: O("was_created_by_user_id") }),
374
- (!s?.triggers?.tags || u === "tags") && /* @__PURE__ */ t(y, { value: "tags", children: O("tags") })
375
- ] }),
376
- (m || c) && /* @__PURE__ */ h(b, { label: o._("Approval flow"), name: "scriptType", control: p, fullWidth: !0, required: !0, select: !0, value: m, disabled: !!m, children: [
377
- (!s?.rules?.single_user || m === "single_user") && /* @__PURE__ */ t(y, { value: "single_user", children: o._("Single user") }),
378
- (!s?.rules?.users_from_list || m === "users_from_list") && /* @__PURE__ */ t(y, { value: "users_from_list", children: o._("Users from the list - Any") }),
379
- m === "roles_from_list" && /* @__PURE__ */ t(y, { value: "roles_from_list", children: o._("Any user that has user role") }),
380
- (!s?.rules?.approval_chain || m === "approval_chain") && /* @__PURE__ */ t(y, { value: "approval_chain", children: o._("Users from list - One by one") })
381
- ] }),
382
- (u === "was_created_by_user_id" || d && Q === "was_created_by_user_id") && /* @__PURE__ */ t(te, { control: p, name: "triggers.was_created_by_user_id", label: o._("Users") }),
383
- (u === "tags" || d && Q === "tags") && /* @__PURE__ */ t(He, { control: p, name: "triggers.tags", label: o._("Tags"), variant: "standard", required: !0 }),
384
- (u === "counterpart_id" || d && Q === "counterpart_id") && /* @__PURE__ */ t(qe, { control: p, name: "triggers.counterpart_id", label: o._("Vendors"), multiple: !0, customerType: "vendor" }),
385
- (u === "amount" || d && Q === "amount") && /* @__PURE__ */ h(A, { container: !0, spacing: 2, children: [
386
- /* @__PURE__ */ t(A, { item: !0, xs: 4, children: /* @__PURE__ */ h(b, { label: o._("If amount is"), name: "amountOperator", control: p, select: !0, fullWidth: !0, children: [
387
- /* @__PURE__ */ t(y, { value: ">", children: o._("Greater than") }),
388
- /* @__PURE__ */ t(y, { value: "<", children: o._("Less than") }),
389
- /* @__PURE__ */ t(y, { value: ">=", children: o._("Greater than or equal to") }),
390
- /* @__PURE__ */ t(y, { value: "<=", children: o._("Less than or equal to") }),
391
- /* @__PURE__ */ t(y, { value: "==", children: o._("Equal to") }),
392
- /* @__PURE__ */ t(y, { value: "range", children: o._("In range") })
393
- ] }) }),
394
- I === "range" ? /* @__PURE__ */ h(A, { item: !0, container: !0, spacing: 2, children: [
395
- /* @__PURE__ */ t(A, { item: !0, xs: 6, children: /* @__PURE__ */ t(b, { label: o._("From (including)"), name: "amountRangeLeftValue", control: p, type: "number", fullWidth: !0 }) }),
396
- /* @__PURE__ */ t(A, { item: !0, xs: 6, children: /* @__PURE__ */ t(b, { label: o._("To (including)"), name: "amountRangeRightValue", control: p, type: "number", fullWidth: !0 }) })
397
- ] }) : /* @__PURE__ */ t(A, { item: !0, xs: 4, children: /* @__PURE__ */ t(b, { label: o._("Amount"), name: "amountValue", control: p, type: "number", fullWidth: !0 }) }),
398
- /* @__PURE__ */ t(A, { item: !0, xs: 4, children: /* @__PURE__ */ t(We, { name: "amountCurrency", control: p, showCodeOnly: !0 }) })
399
- ] }),
400
- (m === "single_user" || c && W === "single_user") && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(Ve, { control: p, name: "rules.single_user", label: o._("User allowed to approve") }) }),
401
- (m === "users_from_list" || c && W === "users_from_list") && /* @__PURE__ */ h(P, { children: [
402
- /* @__PURE__ */ t(te, { control: p, name: "rules.users_from_list", label: o._("Users allowed to approve") }),
403
- /* @__PURE__ */ t(b, { control: p, label: o._("Minimum number of approvals required"), name: "usersFromListCount", type: "number", required: !0, inputProps: {
404
- min: 1,
405
- max: re?.users_from_list?.length || void 0
406
- } })
407
- ] }),
408
- (m === "roles_from_list" || c && W === "roles_from_list") && /* @__PURE__ */ h(P, { children: [
409
- /* @__PURE__ */ t(Fe, { control: p, name: "rules.roles_from_list", label: o._("Any user that has user role") }),
410
- /* @__PURE__ */ t(b, { control: p, label: o._("Minimum number of approvals required"), name: "rolesFromListCount", type: "number", required: !0, inputProps: {
411
- min: 1
412
- } })
413
- ] }),
414
- (m === "approval_chain" || c && W === "approval_chain") && /* @__PURE__ */ t(te, { control: p, name: "rules.approval_chain", label: o._("Users allowed to approve") }),
415
- !u && !m && !d && !c && /* @__PURE__ */ h(P, { children: [
416
- /* @__PURE__ */ t(b, { label: o._("Policy Name"), name: "name", control: p, fullWidth: !0, required: !0 }),
417
- /* @__PURE__ */ t(b, { label: o._("Description"), name: "description", control: p, fullWidth: !0, multiline: !0, rows: 4 }),
418
- /* @__PURE__ */ h(Qe, { children: [
419
- /* @__PURE__ */ t(ae, { variant: "h5", mt: 4, mb: 1, children: o._("Conditions") }),
420
- /* @__PURE__ */ t(ae, { variant: "body1", mb: 1, children: /* @__PURE__ */ t(Pe, { id: "INKhSX", components: {
421
- 0: /* @__PURE__ */ t("strong", {})
422
- } }) }),
423
- /* @__PURE__ */ t(Le, { triggers: le, onAddTrigger: () => {
424
- Y(!0), V({
425
- triggers: {
426
- ..._("triggers")
427
- },
428
- amountOperator: _("amountOperator"),
429
- amountValue: _("amountValue"),
430
- amountRangeLeftValue: _("amountRangeLeftValue"),
431
- amountRangeRightValue: _("amountRangeRightValue"),
432
- amountCurrency: _("amountCurrency")
33
+ i18n: t
34
+ } = U(), {
35
+ control: o,
36
+ watch: s,
37
+ clearErrors: f,
38
+ setValue: l
39
+ } = W(), i = s("frequency"), R = s("payment_terms_id"), g = s("recurrence_issue_mode"), V = s("recurrence_end_mode"), x = s("recurrence_days_of_week"), Y = s("recurrence_max_occurrences"), v = Number(Y) === 1, M = s("recurrence_start_date"), y = M ? new Date(M) : void 0, T = s("recurrence_end_date"), b = T ? new Date(T) : void 0, q = (r) => {
40
+ if (r < P()) return !0;
41
+ if (i === "week")
42
+ return x ? r.getDay() !== A[x] : !1;
43
+ if (i !== "month" || !g) return !1;
44
+ const n = r.getDate(), a = new Date(r.getFullYear(), r.getMonth() + 1, 0).getDate();
45
+ if (g === "first_day") return n !== 1;
46
+ if (g === "last_day") return n !== a;
47
+ const u = Number(g);
48
+ return Number.isNaN(u) ? !1 : n !== Math.min(u, a);
49
+ }, I = (r) => {
50
+ if (q(r)) return !0;
51
+ if (!y) return !1;
52
+ const n = new Date(y);
53
+ return n.setHours(0, 0, 0, 0), r < n;
54
+ }, O = (r) => {
55
+ if (q(r)) return !0;
56
+ if (!b) return !1;
57
+ const n = new Date(b);
58
+ return n.setHours(0, 0, 0, 0), r > n;
59
+ }, H = () => {
60
+ switch (i) {
61
+ case "once":
62
+ case "day":
63
+ case "quarter":
64
+ case "year":
65
+ default:
66
+ return null;
67
+ case "month":
68
+ return /* @__PURE__ */ c(p, { children: [
69
+ /* @__PURE__ */ e(w, { variant: "body2", color: "muted", className: "ttw:text-nowrap", children: t._("on the") }),
70
+ /* @__PURE__ */ e(m, { name: "recurrence_issue_mode", control: o, render: ({
71
+ field: r,
72
+ fieldState: {
73
+ error: n
74
+ }
75
+ }) => /* @__PURE__ */ e(h, { className: "ttw:w-fit", children: /* @__PURE__ */ e(_, { className: "ttw:grow-0", children: /* @__PURE__ */ c(D, { value: r.value, onValueChange: (a) => {
76
+ r.onChange(a), f("recurrence_issue_mode"), l("recurrence_start_date", void 0, {
77
+ shouldDirty: !1
433
78
  });
434
- }, onEditTrigger: (n) => {
435
- X(n), V({
436
- triggers: {
437
- ..._("triggers")
438
- },
439
- amountOperator: _("amountOperator"),
440
- amountValue: _("amountValue"),
441
- amountRangeLeftValue: _("amountRangeLeftValue"),
442
- amountRangeRightValue: _("amountRangeRightValue"),
443
- amountCurrency: _("amountCurrency")
444
- });
445
- }, onDeleteTrigger: (n) => {
446
- const f = {
447
- ...le
79
+ }, children: [
80
+ /* @__PURE__ */ e(k, { id: "recurrence_issue_mode", className: "ttw:min-w-21 ttw:w-fit", "aria-invalid": !!n, children: /* @__PURE__ */ e(C, {}) }),
81
+ /* @__PURE__ */ c(S, { children: [
82
+ /* @__PURE__ */ e(d, { value: "first_day", children: t._("First day") }),
83
+ /* @__PURE__ */ e(d, { value: "last_day", children: t._("Last day") }),
84
+ /* @__PURE__ */ e(K, {}),
85
+ Q.map((a) => /* @__PURE__ */ e(d, { value: String(a), children: J(a) }, a))
86
+ ] })
87
+ ] }) }) }) }),
88
+ /* @__PURE__ */ e(w, { variant: "body2", color: "muted", className: "ttw:text-nowrap", children: t._("day of every month") })
89
+ ] });
90
+ case "week":
91
+ return /* @__PURE__ */ c(p, { children: [
92
+ /* @__PURE__ */ e(w, { variant: "body2", color: "muted", children: t._("on") }),
93
+ /* @__PURE__ */ e(m, { name: "recurrence_days_of_week", control: o, render: ({
94
+ field: r,
95
+ fieldState: {
96
+ error: n
97
+ }
98
+ }) => {
99
+ const a = r.value, u = (N) => {
100
+ a !== N && (r.onChange(N), l("recurrence_start_date", X(N), {
101
+ shouldDirty: !0
102
+ }), f("recurrence_start_date"));
448
103
  };
449
- delete f[n], e("triggers", f), e("amountOperator", void 0), e("amountValue", void 0), e("amountRangeLeftValue", void 0), e("amountRangeRightValue", void 0), e("amountCurrency", void 0);
450
- } }),
451
- /* @__PURE__ */ t(ae, { variant: "h5", mt: 4, mb: 1, children: o._("Approval flow") }),
452
- /* @__PURE__ */ t(Re, { rules: re, usersFromListCount: fe, rolesFromListCount: he, onAddRule: () => {
453
- K(!0), V({
454
- rules: {
455
- ..._("rules")
456
- },
457
- usersFromListCount: _("usersFromListCount"),
458
- rolesFromListCount: _("rolesFromListCount")
459
- });
460
- }, onEditRule: (n) => {
461
- Z(n), V({
462
- rules: {
463
- ..._("rules")
464
- },
465
- usersFromListCount: _("usersFromListCount"),
466
- rolesFromListCount: _("rolesFromListCount")
467
- });
468
- }, onDeleteRule: (n) => {
469
- const f = {
470
- ...re
471
- };
472
- delete f[n], e("rules", f), e("usersFromListCount", void 0), e("rolesFromListCount", void 0);
104
+ return /* @__PURE__ */ e(h, { className: "ttw:w-fit", children: /* @__PURE__ */ e(_, { className: "ttw:grow-0", children: /* @__PURE__ */ c("div", { "aria-invalid": !!n, className: "ttw:flex ttw:border ttw:border-border ttw:rounded-md ttw:h-8 ttw:w-56 ttw:aria-invalid:border-destructive", children: [
105
+ /* @__PURE__ */ e("button", { type: "button", "aria-pressed": a === "mo", "data-active": a === "mo", onClick: () => u("mo"), className: "ttw:hover:cursor-pointer ttw:transition-colors ttw:hover:bg-muted ttw:data-[active=true]:bg-muted ttw:text-sm ttw:font-medium ttw:border-r ttw:border-border ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center", children: t._("Mo") }),
106
+ /* @__PURE__ */ e("button", { type: "button", "aria-pressed": a === "tu", "data-active": a === "tu", onClick: () => u("tu"), className: "ttw:hover:cursor-pointer ttw:transition-colors ttw:hover:bg-muted ttw:data-[active=true]:bg-muted ttw:text-sm ttw:font-medium ttw:border-r ttw:border-border ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center", children: t._("Tu") }),
107
+ /* @__PURE__ */ e("button", { type: "button", "aria-pressed": a === "we", "data-active": a === "we", onClick: () => u("we"), className: "ttw:hover:cursor-pointer ttw:transition-colors ttw:hover:bg-muted ttw:data-[active=true]:bg-muted ttw:text-sm ttw:font-medium ttw:border-r ttw:border-border ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center", children: t._("We") }),
108
+ /* @__PURE__ */ e("button", { type: "button", "aria-pressed": a === "th", "data-active": a === "th", onClick: () => u("th"), className: "ttw:hover:cursor-pointer ttw:transition-colors ttw:hover:bg-muted ttw:data-[active=true]:bg-muted ttw:text-sm ttw:font-medium ttw:border-r ttw:border-border ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center", children: t._("Th") }),
109
+ /* @__PURE__ */ e("button", { type: "button", "aria-pressed": a === "fr", "data-active": a === "fr", onClick: () => u("fr"), className: "ttw:hover:cursor-pointer ttw:transition-colors ttw:hover:bg-muted ttw:data-[active=true]:bg-muted ttw:text-sm ttw:font-medium ttw:border-r ttw:border-border ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center", children: t._("Fr") }),
110
+ /* @__PURE__ */ e("button", { type: "button", "aria-pressed": a === "sa", "data-active": a === "sa", onClick: () => u("sa"), className: "ttw:hover:cursor-pointer ttw:transition-colors ttw:hover:bg-muted ttw:data-[active=true]:bg-muted ttw:text-sm ttw:font-medium ttw:border-r ttw:border-border ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center", children: t._("Sa") }),
111
+ /* @__PURE__ */ e("button", { type: "button", "aria-pressed": a === "su", "data-active": a === "su", onClick: () => u("su"), className: "ttw:hover:cursor-pointer ttw:transition-colors ttw:hover:bg-muted ttw:data-[active=true]:bg-muted ttw:text-sm ttw:font-medium ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center", children: t._("Su") })
112
+ ] }) }) });
473
113
  } })
114
+ ] });
115
+ }
116
+ }, L = () => {
117
+ switch (i) {
118
+ case "once":
119
+ default:
120
+ return null;
121
+ case "day":
122
+ return /* @__PURE__ */ c(p, { children: [
123
+ /* @__PURE__ */ e(w, { variant: "body2", color: "muted", className: "ttw:text-nowrap", children: t._("and end") }),
124
+ /* @__PURE__ */ e(m, { name: "recurrence_end_mode", control: o, render: ({
125
+ field: r,
126
+ fieldState: {
127
+ error: n
128
+ }
129
+ }) => /* @__PURE__ */ e(h, { className: "ttw:w-fit", children: /* @__PURE__ */ e(_, { className: "ttw:grow-0", children: /* @__PURE__ */ c(D, { value: r.value, onValueChange: (a) => {
130
+ r.onChange(a), a === "after" ? l("recurrence_end_date", void 0, {
131
+ shouldDirty: !1
132
+ }) : l("recurrence_max_occurrences", void 0, {
133
+ shouldDirty: !1
134
+ });
135
+ }, children: [
136
+ /* @__PURE__ */ e(k, { id: "recurrence_end_mode", className: "ttw:w-21", "aria-invalid": !!n, children: /* @__PURE__ */ e(C, {}) }),
137
+ /* @__PURE__ */ c(S, { children: [
138
+ /* @__PURE__ */ e(d, { value: "after", children: t._("After") }),
139
+ /* @__PURE__ */ e(d, { value: "on", children: t._("On") })
140
+ ] })
141
+ ] }) }) }) }),
142
+ V === "on" ? /* @__PURE__ */ e(m, { control: o, name: "recurrence_end_date", render: ({
143
+ field: r,
144
+ fieldState: {
145
+ error: n
146
+ }
147
+ }) => /* @__PURE__ */ e(h, { className: "ttw:grow-0 ttw:w-44", children: /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(j, { ...r, selected: r.value ? new Date(r.value) : void 0, onSelect: r.onChange, showOutsideDays: !1, disabled: I, "aria-invalid": !!n, startMonth: y ? new Date(y.getFullYear(), y.getMonth(), 1) : /* @__PURE__ */ new Date(), endMonth: new Date(2050, 11) }) }) }) }) : /* @__PURE__ */ c(p, { children: [
148
+ /* @__PURE__ */ e(m, { name: "recurrence_max_occurrences", control: o, render: ({
149
+ field: r,
150
+ fieldState: {
151
+ error: n
152
+ }
153
+ }) => /* @__PURE__ */ e(h, { className: "ttw:w-fit", children: /* @__PURE__ */ e(_, { className: "ttw:grow-0", children: /* @__PURE__ */ e(E, { ...r, className: "ttw:w-16", value: r.value ?? "", type: "number", min: 0, max: 1e3, onKeyDown: $, "aria-invalid": !!n }) }) }) }),
154
+ /* @__PURE__ */ e(w, { variant: "body2", color: "muted", className: "ttw:text-nowrap", children: v ? t._("day") : t._("days") })
155
+ ] })
156
+ ] });
157
+ case "month":
158
+ case "quarter":
159
+ case "year":
160
+ case "week":
161
+ return /* @__PURE__ */ c(p, { children: [
162
+ /* @__PURE__ */ e(w, { variant: "body2", color: "muted", className: "ttw:text-nowrap", children: t._("and end after") }),
163
+ /* @__PURE__ */ e(m, { name: "recurrence_max_occurrences", control: o, render: ({
164
+ field: r,
165
+ fieldState: {
166
+ error: n
167
+ }
168
+ }) => /* @__PURE__ */ e(h, { className: "ttw:w-fit", children: /* @__PURE__ */ e(_, { className: "ttw:grow-0", children: /* @__PURE__ */ e(E, { ...r, className: "ttw:w-16", value: r.value ?? "", type: "number", min: 0, max: 1e3, onKeyDown: $, "aria-invalid": !!n }) }) }) }),
169
+ /* @__PURE__ */ c(w, { variant: "body2", color: "muted", className: "ttw:text-nowrap", children: [
170
+ i === "month" && (v ? t._("month") : t._("months")),
171
+ i === "quarter" && (v ? t._("quarter") : t._("quarters")),
172
+ i === "week" && (v ? t._("week") : t._("weeks")),
173
+ i === "year" && (v ? t._("year") : t._("years"))
174
+ ] })
175
+ ] });
176
+ }
177
+ };
178
+ return /* @__PURE__ */ c("section", { className: "ttw:flex ttw:flex-col ttw:gap-2.5", children: [
179
+ /* @__PURE__ */ c("div", { className: "ttw:flex ttw:items-center ttw:gap-2.5", children: [
180
+ /* @__PURE__ */ e(w, { variant: "body2", color: "muted", className: "ttw:text-nowrap", children: t._("Repeat this invoice") }),
181
+ /* @__PURE__ */ e(m, { name: "frequency", control: o, render: ({
182
+ field: r
183
+ }) => /* @__PURE__ */ e(h, { className: "ttw:w-fit", children: /* @__PURE__ */ e(_, { className: "ttw:grow-0", children: /* @__PURE__ */ c(D, { value: r.value, onValueChange: (n) => {
184
+ f(F), F.forEach((a) => {
185
+ l(a, void 0, {
186
+ shouldDirty: !1
187
+ });
188
+ }), G.includes(n) ? (l("payment_terms_id", z, {
189
+ shouldDirty: !0
190
+ }), l("payment_terms_custom_date", null, {
191
+ shouldDirty: !1
192
+ }), l("payment_reminder_id", "", {
193
+ shouldDirty: !0
194
+ })) : n !== "once" && R === B && (l("payment_terms_id", "", {
195
+ shouldDirty: !0
196
+ }), l("payment_terms_custom_date", null, {
197
+ shouldDirty: !1
198
+ })), r.onChange(n);
199
+ }, children: [
200
+ /* @__PURE__ */ e(k, { id: "frequency", className: "ttw:w-31", children: /* @__PURE__ */ e(C, {}) }),
201
+ /* @__PURE__ */ c(S, { children: [
202
+ /* @__PURE__ */ e(d, { value: "once", children: t._("Once") }),
203
+ /* @__PURE__ */ e(d, { value: "day", children: t._("Daily") }),
204
+ /* @__PURE__ */ e(d, { value: "week", children: t._("Weekly") }),
205
+ /* @__PURE__ */ e(d, { value: "month", children: t._("Monthly") }),
206
+ /* @__PURE__ */ e(d, { value: "quarter", children: t._("Quarterly") }),
207
+ /* @__PURE__ */ e(d, { value: "year", children: t._("Annually") })
474
208
  ] })
475
- ] })
476
- ] }) }) }) }),
477
- /* @__PURE__ */ t(ze, { primaryButton: u || m || d || c ? {
478
- label: u ? o._("Update") : o._("Add"),
479
- onClick: (n) => {
480
- n?.preventDefault(), X(null), Z(null), Y(!1), K(!1), e("triggerType", null), e("scriptType", null);
481
- }
482
- } : {
483
- label: o._("Save"),
484
- formId: oe,
485
- isLoading: se.isPending || ie.isPending
486
- }, cancelButton: {
487
- onClick: u || m || d || c ? ue : C ? () => l(!1) : _e?.onClose
488
- } })
209
+ ] }) }) }) }),
210
+ H()
211
+ ] }),
212
+ i !== "once" && /* @__PURE__ */ c("div", { className: "ttw:flex ttw:items-center ttw:gap-2.5", children: [
213
+ /* @__PURE__ */ e(w, { variant: "body2", color: "muted", className: "ttw:text-nowrap", children: t._("Start on") }),
214
+ /* @__PURE__ */ e(m, { control: o, name: "recurrence_start_date", render: ({
215
+ field: r,
216
+ fieldState: {
217
+ error: n
218
+ }
219
+ }) => /* @__PURE__ */ e(h, { className: "ttw:grow-0 ttw:w-44", children: /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(j, { ...r, selected: r.value ? new Date(r.value) : void 0, onSelect: r.onChange, showOutsideDays: !1, shouldDisableButton: i === "week" && !x, disabled: O, "aria-invalid": !!n, startMonth: /* @__PURE__ */ new Date(), endMonth: b ? new Date(b.getFullYear(), b.getMonth(), 1) : new Date(2050, 11) }) }) }) }),
220
+ L()
221
+ ] }),
222
+ ["month", "quarter", "year"].includes(i) && /* @__PURE__ */ e(w, { variant: "caption", color: "muted", children: t._("If the issue day doesn't exist in a given month, e.g., the 31st, then the invoice will be sent on the last day of that month.") })
489
223
  ] });
490
224
  };
491
225
  export {
492
- rt as ApprovalPolicyForm
226
+ ie as RecurrenceSection
493
227
  };