@happyvertical/smrt-planner 0.57.43 → 0.57.45

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 (529) hide show
  1. package/app/404.html +18 -18
  2. package/app/_app/immutable/chunks/{BQgJ05r2.js → 51bIF3zu.js} +1 -1
  3. package/app/_app/immutable/chunks/{DSdlNRNs.js → B2zXE0hq.js} +1 -1
  4. package/app/_app/immutable/chunks/{CBwPTTnw.js → B4qoe2Wc.js} +1 -1
  5. package/app/_app/immutable/chunks/{CxwaJzH4.js → BFmQFLcS.js} +1 -1
  6. package/app/_app/immutable/chunks/{HarHvnXF.js → BIFDoB2k.js} +1 -1
  7. package/app/_app/immutable/chunks/{CGaC_GdN.js → BOIG68-H.js} +1 -1
  8. package/app/_app/immutable/chunks/{EVM4wuMZ.js → BdYJ1pr6.js} +1 -1
  9. package/app/_app/immutable/chunks/Berfh5jP.js +1 -0
  10. package/app/_app/immutable/chunks/{P0teM5Ra.js → Br8B1_fx.js} +1 -1
  11. package/app/_app/immutable/chunks/{D3cv8Pui.js → BtUkduqy.js} +1 -1
  12. package/app/_app/immutable/chunks/{BgOimu0u.js → ByYMR4Nv.js} +1 -1
  13. package/app/_app/immutable/chunks/C4LXhqJ6.js +1 -0
  14. package/app/_app/immutable/chunks/{BhY9m7ye.js → CGm5iL4O.js} +1 -1
  15. package/app/_app/immutable/chunks/{0HEEaKDE.js → CXCKbdz7.js} +1 -1
  16. package/app/_app/immutable/chunks/{OkFnmq-I.js → CXxP8-A-.js} +1 -1
  17. package/app/_app/immutable/chunks/{DYJvnJSH.js → C_3mHM3Z.js} +2 -2
  18. package/app/_app/immutable/chunks/{Bi1YzXmx.js → Clp9QNa3.js} +3 -3
  19. package/app/_app/immutable/chunks/{BeocJqqC.js → Cp6dpm4U.js} +1 -1
  20. package/app/_app/immutable/chunks/{fuxyXxHR.js → CphQscz8.js} +1 -1
  21. package/app/_app/immutable/chunks/{CXSW_54w.js → DFKfC8W_.js} +1 -1
  22. package/app/_app/immutable/chunks/{3XhH_h7e.js → DLUMSQYQ.js} +1 -1
  23. package/app/_app/immutable/chunks/DejeH9L2.js +1 -0
  24. package/app/_app/immutable/chunks/{BBmzhVVE.js → DevFsuaC.js} +1 -1
  25. package/app/_app/immutable/chunks/{Cc87O25b.js → DgXC4_Ux.js} +1 -1
  26. package/app/_app/immutable/chunks/{DCxyGpWs.js → J09d_KFN.js} +1 -1
  27. package/app/_app/immutable/chunks/{DKO8GXxX.js → JbseW4hD.js} +33 -33
  28. package/app/_app/immutable/chunks/{DhruBIjb.js → Jluc5nsc.js} +1 -1
  29. package/app/_app/immutable/chunks/{77cA2IHw.js → Z76Z2dFo.js} +1 -1
  30. package/app/_app/immutable/chunks/{wpZcOjrw.js → zXfxVHrm.js} +1 -1
  31. package/app/_app/immutable/entry/{app.CdnA1Er5.js → app.DaSpX7br.js} +2 -2
  32. package/app/_app/immutable/entry/start.BHH71upK.js +1 -0
  33. package/app/_app/immutable/nodes/{0.B3BTaMcH.js → 0.CbeqbAsy.js} +1 -1
  34. package/app/_app/immutable/nodes/{1.Di4EzJ2c.js → 1.DLie9tbF.js} +1 -1
  35. package/app/_app/immutable/nodes/{10.B_vnof3P.js → 10.BwBDy5aS.js} +1 -1
  36. package/app/_app/immutable/nodes/{11.Cy9jIwzn.js → 11.BcDFRMxr.js} +1 -1
  37. package/app/_app/immutable/nodes/{12.DrWof3gr.js → 12.CBXp19Yf.js} +1 -1
  38. package/app/_app/immutable/nodes/{13.Zp6Jo_m4.js → 13.Ch0VLM_r.js} +1 -1
  39. package/app/_app/immutable/nodes/{14.jRpiEp9_.js → 14.BRwbqFiB.js} +1 -1
  40. package/app/_app/immutable/nodes/{2.Ct5aEJ66.js → 2.DgS9_qRQ.js} +3 -3
  41. package/app/_app/immutable/nodes/{3.D_V2kkhg.js → 3.CAJx68df.js} +1 -1
  42. package/app/_app/immutable/nodes/{4.ClirjmB_.js → 4.7V9xWUnv.js} +1 -1
  43. package/app/_app/immutable/nodes/{5.B_Y-4dWg.js → 5.BFdEU9j6.js} +1 -1
  44. package/app/_app/immutable/nodes/{6.BcHTAs2z.js → 6.mobne2IG.js} +1 -1
  45. package/app/_app/immutable/nodes/{7.DgihUOPX.js → 7.DtMgwe9d.js} +1 -1
  46. package/app/_app/immutable/nodes/{8.BsOFrJvG.js → 8.DwDoH9uN.js} +1 -1
  47. package/app/_app/immutable/nodes/{9.DyMr7eTc.js → 9.BVlLo7QK.js} +1 -1
  48. package/app/_app/version.json +1 -1
  49. package/app/advanced-styles/index.html +21 -21
  50. package/app/ai/index.html +24 -24
  51. package/app/blueprint/index.html +19 -19
  52. package/app/cookbook/index.html +19 -19
  53. package/app/index.html +27 -27
  54. package/app/m/ads/AdDeliveryTier/index.html +23 -23
  55. package/app/m/ads/AdEvent/index.html +23 -23
  56. package/app/m/ads/AdFormat/index.html +23 -23
  57. package/app/m/ads/AdGroup/index.html +23 -23
  58. package/app/m/ads/AdVariation/index.html +23 -23
  59. package/app/m/analytics/AnalyticsDataStream/index.html +23 -23
  60. package/app/m/analytics/AnalyticsEvent/index.html +23 -23
  61. package/app/m/analytics/AnalyticsProperty/index.html +23 -23
  62. package/app/m/analytics/AnalyticsReport/index.html +23 -23
  63. package/app/m/approvals/ApprovalEvent/index.html +23 -23
  64. package/app/m/approvals/ApprovalPolicy/index.html +23 -23
  65. package/app/m/approvals/ApprovalRequest/index.html +23 -23
  66. package/app/m/assets/Asset/attachments/index.html +24 -24
  67. package/app/m/assets/Asset/index.html +23 -23
  68. package/app/m/assets/AssetAssociation/index.html +23 -23
  69. package/app/m/assets/AssetMetafield/index.html +23 -23
  70. package/app/m/assets/AssetStatus/index.html +23 -23
  71. package/app/m/assets/AssetType/index.html +23 -23
  72. package/app/m/assets/Folder/index.html +23 -23
  73. package/app/m/chat/AgentSession/index.html +23 -23
  74. package/app/m/chat/ChatMessage/index.html +23 -23
  75. package/app/m/chat/ChatParticipant/index.html +23 -23
  76. package/app/m/chat/ChatReaction/index.html +23 -23
  77. package/app/m/chat/ChatRoom/index.html +23 -23
  78. package/app/m/chat/ChatThread/index.html +23 -23
  79. package/app/m/chat/VoiceGatewayTurn/index.html +23 -23
  80. package/app/m/chat/VoiceSession/index.html +23 -23
  81. package/app/m/commerce/Agreement/index.html +23 -23
  82. package/app/m/commerce/Cart/index.html +23 -23
  83. package/app/m/commerce/Contract/index.html +23 -23
  84. package/app/m/commerce/ContractLineItem/index.html +23 -23
  85. package/app/m/commerce/Customer/index.html +23 -23
  86. package/app/m/commerce/DocumentTax/index.html +23 -23
  87. package/app/m/commerce/Estimate/index.html +23 -23
  88. package/app/m/commerce/Fulfillment/index.html +23 -23
  89. package/app/m/commerce/FulfillmentLineItem/index.html +23 -23
  90. package/app/m/commerce/HistoricalCustomerFunds/index.html +23 -23
  91. package/app/m/commerce/HistoricalCustomerFundsAllocation/index.html +23 -23
  92. package/app/m/commerce/HistoricalSalesLine/index.html +23 -23
  93. package/app/m/commerce/Invoice/index.html +23 -23
  94. package/app/m/commerce/InvoiceLineItem/index.html +23 -23
  95. package/app/m/commerce/Lease/index.html +23 -23
  96. package/app/m/commerce/LicenseSale/index.html +23 -23
  97. package/app/m/commerce/Order/index.html +23 -23
  98. package/app/m/commerce/Payment/index.html +23 -23
  99. package/app/m/commerce/PaymentAllocation/index.html +23 -23
  100. package/app/m/commerce/PaymentInstrument/index.html +23 -23
  101. package/app/m/commerce/PaymentIntent/index.html +23 -23
  102. package/app/m/commerce/Payout/index.html +23 -23
  103. package/app/m/commerce/ProductionOrder/index.html +23 -23
  104. package/app/m/commerce/PurchaseContract/index.html +23 -23
  105. package/app/m/commerce/PurchaseOrder/index.html +23 -23
  106. package/app/m/commerce/SalesContract/index.html +23 -23
  107. package/app/m/commerce/SupplierQuote/index.html +23 -23
  108. package/app/m/commerce/TaxCode/index.html +23 -23
  109. package/app/m/commerce/TaxComponent/index.html +23 -23
  110. package/app/m/commerce/TaxSettings/index.html +23 -23
  111. package/app/m/commerce/TaxSummaryReport/index.html +23 -23
  112. package/app/m/commerce/TenantPaymentAccount/index.html +23 -23
  113. package/app/m/commerce/Vendor/index.html +23 -23
  114. package/app/m/commerce/WholesaleOrder/index.html +23 -23
  115. package/app/m/content/Content/articles/index.html +24 -24
  116. package/app/m/content/Content/index.html +23 -23
  117. package/app/m/content/ContentContribution/index.html +23 -23
  118. package/app/m/content/ContentContributionAttachment/index.html +23 -23
  119. package/app/m/content/ContentContributionRevision/index.html +23 -23
  120. package/app/m/content/ContentContributionType/index.html +23 -23
  121. package/app/m/content/ContentContributor/index.html +23 -23
  122. package/app/m/content/ContentCorrection/index.html +23 -23
  123. package/app/m/content/ContentFeedSource/index.html +23 -23
  124. package/app/m/content/ContentGovernanceAssignment/index.html +23 -23
  125. package/app/m/content/ContentGovernancePolicy/index.html +23 -23
  126. package/app/m/content/ContentGovernanceProfile/index.html +23 -23
  127. package/app/m/content/ContentReference/index.html +23 -23
  128. package/app/m/content/ContentReview/index.html +23 -23
  129. package/app/m/content/ContentVersion/index.html +23 -23
  130. package/app/m/events/Event/index.html +23 -23
  131. package/app/m/events/EventParticipant/index.html +23 -23
  132. package/app/m/events/EventSeries/index.html +23 -23
  133. package/app/m/events/EventType/index.html +23 -23
  134. package/app/m/expenses/Expense/index.html +23 -23
  135. package/app/m/facts/Fact/index.html +23 -23
  136. package/app/m/facts/FactContent/index.html +23 -23
  137. package/app/m/facts/FactEvidence/index.html +23 -23
  138. package/app/m/facts/FactSource/index.html +23 -23
  139. package/app/m/facts/FactSubject/index.html +23 -23
  140. package/app/m/facts/FactTag/index.html +23 -23
  141. package/app/m/fields/FieldPolicy/index.html +23 -23
  142. package/app/m/fields/FieldPolicySuggestion/index.html +23 -23
  143. package/app/m/fields/FieldUsageCounter/index.html +23 -23
  144. package/app/m/human-resources/Employment/index.html +23 -23
  145. package/app/m/human-resources/EmploymentTerm/index.html +23 -23
  146. package/app/m/human-resources/HeldQualification/index.html +23 -23
  147. package/app/m/human-resources/Qualification/index.html +23 -23
  148. package/app/m/images/Image/index.html +23 -23
  149. package/app/m/inventory/InventoryLocation/index.html +23 -23
  150. package/app/m/inventory/Lot/index.html +23 -23
  151. package/app/m/inventory/LotCorrection/index.html +23 -23
  152. package/app/m/inventory/LotDocument/index.html +23 -23
  153. package/app/m/inventory/LotStockLevel/index.html +23 -23
  154. package/app/m/inventory/LotUsage/index.html +23 -23
  155. package/app/m/inventory/StockLevel/index.html +23 -23
  156. package/app/m/inventory/StockMovement/index.html +23 -23
  157. package/app/m/ledgers/Account/index.html +23 -23
  158. package/app/m/ledgers/Journal/index.html +23 -23
  159. package/app/m/ledgers/JournalEntry/index.html +23 -23
  160. package/app/m/ledgers/Ledger/index.html +23 -23
  161. package/app/m/manufacturing/Assembly/index.html +23 -23
  162. package/app/m/manufacturing/BillOfMaterials/index.html +23 -23
  163. package/app/m/manufacturing/BomLine/index.html +23 -23
  164. package/app/m/manufacturing/Operation/index.html +23 -23
  165. package/app/m/manufacturing/ProductionRun/index.html +23 -23
  166. package/app/m/manufacturing/ProductionRunCompletion/index.html +23 -23
  167. package/app/m/manufacturing/RoutingStep/index.html +23 -23
  168. package/app/m/marketing/Campaign/index.html +23 -23
  169. package/app/m/marketing/CampaignChannel/index.html +23 -23
  170. package/app/m/marketing/CampaignMetricSnapshot/index.html +23 -23
  171. package/app/m/messages/Account/index.html +23 -23
  172. package/app/m/messages/Attachment/index.html +23 -23
  173. package/app/m/messages/Blacklist/index.html +23 -23
  174. package/app/m/messages/Email/failed-sends/index.html +24 -24
  175. package/app/m/messages/Email/index.html +23 -23
  176. package/app/m/messages/Email/mailbox/index.html +24 -24
  177. package/app/m/messages/EmailAccount/index.html +23 -23
  178. package/app/m/messages/EmailAttachment/index.html +23 -23
  179. package/app/m/messages/EmailFolder/index.html +23 -23
  180. package/app/m/messages/Message/index.html +23 -23
  181. package/app/m/messages/MessagingEndpoint/index.html +23 -23
  182. package/app/m/messages/PersonaMessageRoute/index.html +23 -23
  183. package/app/m/messages/SlackAccount/index.html +23 -23
  184. package/app/m/messages/SlackMessage/index.html +23 -23
  185. package/app/m/messages/SlackMessage/slack-messages/index.html +24 -24
  186. package/app/m/messages/TelegramAccount/index.html +23 -23
  187. package/app/m/messages/Tweet/index.html +23 -23
  188. package/app/m/messages/TwitterAccount/index.html +23 -23
  189. package/app/m/messages/Whitelist/index.html +23 -23
  190. package/app/m/messages/ZulipAccount/index.html +23 -23
  191. package/app/m/places/Place/index.html +23 -23
  192. package/app/m/places/PlaceType/index.html +23 -23
  193. package/app/m/products/Category/index.html +23 -23
  194. package/app/m/products/Material/index.html +23 -23
  195. package/app/m/products/Product/index.html +23 -23
  196. package/app/m/products/Product/ingredients/index.html +24 -24
  197. package/app/m/products/ProductVariant/index.html +23 -23
  198. package/app/m/products/Sku/index.html +23 -23
  199. package/app/m/profiles/ApiKey/index.html +23 -23
  200. package/app/m/profiles/Bot/index.html +23 -23
  201. package/app/m/profiles/MagicLinkToken/index.html +23 -23
  202. package/app/m/profiles/NostrIdentity/index.html +23 -23
  203. package/app/m/profiles/OidcIdentity/index.html +23 -23
  204. package/app/m/profiles/Organization/index.html +23 -23
  205. package/app/m/profiles/Person/index.html +23 -23
  206. package/app/m/profiles/Profile/index.html +23 -23
  207. package/app/m/profiles/ProfileMetadata/index.html +23 -23
  208. package/app/m/profiles/ProfileMetafield/index.html +23 -23
  209. package/app/m/profiles/ProfileRelationship/index.html +23 -23
  210. package/app/m/profiles/ProfileRelationshipTerm/index.html +23 -23
  211. package/app/m/profiles/ProfileRelationshipType/index.html +23 -23
  212. package/app/m/profiles/ProfileType/index.html +23 -23
  213. package/app/m/projects/Comment/index.html +23 -23
  214. package/app/m/projects/Issue/index.html +23 -23
  215. package/app/m/projects/Label/index.html +23 -23
  216. package/app/m/projects/Project/index.html +23 -23
  217. package/app/m/projects/ProjectIntegration/index.html +23 -23
  218. package/app/m/projects/PullRequest/index.html +23 -23
  219. package/app/m/projects/Repository/index.html +23 -23
  220. package/app/m/properties/Property/index.html +23 -23
  221. package/app/m/properties/Zone/index.html +23 -23
  222. package/app/m/reports/RuntimeReport/index.html +23 -23
  223. package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +23 -23
  224. package/app/m/reports/SmrtReportLock/index.html +23 -23
  225. package/app/m/reports/SmrtReportRefreshTask/index.html +23 -23
  226. package/app/m/reports/SmrtReportRun/index.html +23 -23
  227. package/app/m/reports/SmrtReportSchedule/index.html +23 -23
  228. package/app/m/reports/SmrtReportWatermark/index.html +23 -23
  229. package/app/m/sales/Agreement/index.html +23 -23
  230. package/app/m/sales/AttributionException/index.html +23 -23
  231. package/app/m/sales/AttributionPolicy/index.html +23 -23
  232. package/app/m/sales/Commission/index.html +23 -23
  233. package/app/m/sales/CommissionAdjustment/index.html +23 -23
  234. package/app/m/sales/CommissionPayout/index.html +23 -23
  235. package/app/m/sales/CommissionPlan/index.html +23 -23
  236. package/app/m/sales/Earner/index.html +23 -23
  237. package/app/m/sales/EarnerSourceAttribution/index.html +23 -23
  238. package/app/m/sales/EarningEvent/index.html +23 -23
  239. package/app/m/sales/ExecutedAgreement/index.html +23 -23
  240. package/app/m/sales/Lead/index.html +23 -23
  241. package/app/m/sales/Opportunity/index.html +23 -23
  242. package/app/m/sales/OpportunityConversion/index.html +23 -23
  243. package/app/m/sales/PipelineDefinition/index.html +23 -23
  244. package/app/m/sales/PipelineStage/index.html +23 -23
  245. package/app/m/sales/Referral/index.html +23 -23
  246. package/app/m/sales/ReferralAgreement/index.html +23 -23
  247. package/app/m/sales/ReferralLink/index.html +23 -23
  248. package/app/m/sales/ReferralProgram/index.html +23 -23
  249. package/app/m/sales/ReferralTermSnapshot/index.html +23 -23
  250. package/app/m/sales/ReferralTouch/index.html +23 -23
  251. package/app/m/sales/Referrer/index.html +23 -23
  252. package/app/m/sales/SalesActivity/index.html +23 -23
  253. package/app/m/sales/SalesRepresentative/index.html +23 -23
  254. package/app/m/sites/Site/index.html +23 -23
  255. package/app/m/sites/SiteAgentBinding/index.html +23 -23
  256. package/app/m/social/OAuthState/index.html +23 -23
  257. package/app/m/social/SocialAccount/index.html +23 -23
  258. package/app/m/social/SocialPost/index.html +23 -23
  259. package/app/m/social/SocialPostAnalyticsSnapshot/index.html +23 -23
  260. package/app/m/subscriptions/BillingAdjustment/index.html +23 -23
  261. package/app/m/subscriptions/ClientCharge/index.html +23 -23
  262. package/app/m/subscriptions/CreditGrant/index.html +23 -23
  263. package/app/m/subscriptions/PricingRule/index.html +23 -23
  264. package/app/m/subscriptions/RetailCharge/index.html +23 -23
  265. package/app/m/subscriptions/SpendingPolicy/index.html +23 -23
  266. package/app/m/subscriptions/SubscriptionPlan/index.html +23 -23
  267. package/app/m/subscriptions/SubscriptionPlanVersion/index.html +23 -23
  268. package/app/m/subscriptions/TenantSubscription/index.html +23 -23
  269. package/app/m/subscriptions/TenantUsageMetric/index.html +23 -23
  270. package/app/m/support/ServiceTimeEntry/index.html +23 -23
  271. package/app/m/support/SupportAiRun/index.html +23 -23
  272. package/app/m/support/SupportAvailability/index.html +23 -23
  273. package/app/m/support/SupportCase/index.html +23 -23
  274. package/app/m/support/SupportCaseEvent/index.html +23 -23
  275. package/app/m/support/SupportChannelBinding/index.html +23 -23
  276. package/app/m/support/SupportCharge/index.html +23 -23
  277. package/app/m/support/SupportCompensation/index.html +23 -23
  278. package/app/m/support/SupportCompensationPlan/index.html +23 -23
  279. package/app/m/support/SupportEscalation/index.html +23 -23
  280. package/app/m/support/SupportInteraction/index.html +23 -23
  281. package/app/m/support/SupportPlan/index.html +23 -23
  282. package/app/m/support/SupportPolicy/index.html +23 -23
  283. package/app/m/support/SupportQualification/index.html +23 -23
  284. package/app/m/support/SupportServiceTarget/index.html +23 -23
  285. package/app/m/support/SupportSpecialist/index.html +23 -23
  286. package/app/m/support/SupportWorkLink/index.html +23 -23
  287. package/app/m/tags/Tag/index.html +23 -23
  288. package/app/m/tags/TagAlias/index.html +23 -23
  289. package/app/m/timesheets/AttendanceBreak/index.html +23 -23
  290. package/app/m/timesheets/AttendancePunch/index.html +23 -23
  291. package/app/m/timesheets/AttendanceSegment/index.html +23 -23
  292. package/app/m/timesheets/ServiceChargeSnapshot/index.html +23 -23
  293. package/app/m/timesheets/ServiceCompensationSnapshot/index.html +23 -23
  294. package/app/m/timesheets/ServiceTimeEntry/index.html +23 -23
  295. package/app/m/users/Group/index.html +23 -23
  296. package/app/m/users/GroupMember/index.html +23 -23
  297. package/app/m/users/GroupRole/index.html +23 -23
  298. package/app/m/users/Membership/index.html +23 -23
  299. package/app/m/users/MembershipOverride/index.html +23 -23
  300. package/app/m/users/Permission/index.html +23 -23
  301. package/app/m/users/Role/index.html +23 -23
  302. package/app/m/users/RolePermission/index.html +23 -23
  303. package/app/m/users/Session/index.html +23 -23
  304. package/app/m/users/Tenant/index.html +23 -23
  305. package/app/m/users/TenantIntegration/index.html +23 -23
  306. package/app/m/users/TenantPermissionOverride/index.html +23 -23
  307. package/app/m/users/User/index.html +23 -23
  308. package/app/m/video/Character/index.html +23 -23
  309. package/app/m/video/CharacterAsset/index.html +23 -23
  310. package/app/m/video/CompositeJob/index.html +23 -23
  311. package/app/m/video/Performer/index.html +23 -23
  312. package/app/m/video/PerformerAsset/index.html +23 -23
  313. package/app/m/video/Scene/index.html +23 -23
  314. package/app/m/video/SceneAsset/index.html +23 -23
  315. package/app/m/video/VideoComposition/index.html +23 -23
  316. package/app/m/video/VideoCompositionAsset/index.html +23 -23
  317. package/app/m/video/VideoSequence/index.html +23 -23
  318. package/app/m/video/VideoSequenceAsset/index.html +23 -23
  319. package/app/m/video/VideoShot/index.html +23 -23
  320. package/app/m/video/VideoShotAsset/index.html +23 -23
  321. package/app/m/video/VideoShotCharacter/index.html +23 -23
  322. package/app/m/video/VideoWorkflow/index.html +23 -23
  323. package/app/m/voice/VoiceOutput/index.html +23 -23
  324. package/app/m/voice/VoiceProfile/index.html +23 -23
  325. package/app/m/voice/VoiceSample/index.html +23 -23
  326. package/app/mcp.html +1 -1
  327. package/app/packages/ads/index.html +21 -21
  328. package/app/packages/analytics/index.html +21 -21
  329. package/app/packages/approvals/index.html +21 -21
  330. package/app/packages/assets/index.html +21 -21
  331. package/app/packages/chat/index.html +21 -21
  332. package/app/packages/comments/index.html +21 -21
  333. package/app/packages/commerce/index.html +21 -21
  334. package/app/packages/content/index.html +21 -21
  335. package/app/packages/events/index.html +21 -21
  336. package/app/packages/expenses/index.html +21 -21
  337. package/app/packages/facts/index.html +21 -21
  338. package/app/packages/fields/index.html +21 -21
  339. package/app/packages/human-resources/index.html +21 -21
  340. package/app/packages/images/index.html +21 -21
  341. package/app/packages/index.html +20 -20
  342. package/app/packages/ingestion/index.html +21 -21
  343. package/app/packages/inventory/index.html +21 -21
  344. package/app/packages/ledgers/index.html +21 -21
  345. package/app/packages/manufacturing/index.html +21 -21
  346. package/app/packages/marketing/index.html +21 -21
  347. package/app/packages/messages/index.html +21 -21
  348. package/app/packages/places/index.html +21 -21
  349. package/app/packages/preferences/index.html +21 -21
  350. package/app/packages/products/index.html +21 -21
  351. package/app/packages/profiles/index.html +21 -21
  352. package/app/packages/projects/index.html +21 -21
  353. package/app/packages/properties/index.html +21 -21
  354. package/app/packages/reactions/index.html +21 -21
  355. package/app/packages/reports/index.html +21 -21
  356. package/app/packages/sales/index.html +21 -21
  357. package/app/packages/sites/index.html +21 -21
  358. package/app/packages/social/index.html +21 -21
  359. package/app/packages/subscriptions/index.html +21 -21
  360. package/app/packages/support/index.html +21 -21
  361. package/app/packages/tags/index.html +21 -21
  362. package/app/packages/timesheets/index.html +21 -21
  363. package/app/packages/users/index.html +21 -21
  364. package/app/packages/video/index.html +21 -21
  365. package/app/packages/voice/index.html +21 -21
  366. package/app/packages/webhooks/index.html +21 -21
  367. package/app/recipes/account-access/help/index.html +21 -21
  368. package/app/recipes/account-access/index.html +23 -23
  369. package/app/recipes/activity/help/index.html +21 -21
  370. package/app/recipes/activity/index.html +23 -23
  371. package/app/recipes/ads.campaigns/help/index.html +21 -21
  372. package/app/recipes/ads.campaigns/index.html +23 -23
  373. package/app/recipes/affiliates.referrals/help/index.html +21 -21
  374. package/app/recipes/affiliates.referrals/index.html +23 -23
  375. package/app/recipes/agreements/help/index.html +21 -21
  376. package/app/recipes/agreements/index.html +23 -23
  377. package/app/recipes/analytics.reports/help/index.html +21 -21
  378. package/app/recipes/analytics.reports/index.html +23 -23
  379. package/app/recipes/approvals.requests/help/index.html +21 -21
  380. package/app/recipes/approvals.requests/index.html +23 -23
  381. package/app/recipes/assets/help/index.html +21 -21
  382. package/app/recipes/assets/index.html +23 -23
  383. package/app/recipes/billing/help/index.html +21 -21
  384. package/app/recipes/billing/index.html +23 -23
  385. package/app/recipes/chat.assistant/help/index.html +21 -21
  386. package/app/recipes/chat.assistant/index.html +23 -23
  387. package/app/recipes/comments/help/index.html +21 -21
  388. package/app/recipes/comments/index.html +23 -23
  389. package/app/recipes/commerce.customers/help/index.html +21 -21
  390. package/app/recipes/commerce.customers/index.html +23 -23
  391. package/app/recipes/commerce.estimates/help/index.html +21 -21
  392. package/app/recipes/commerce.estimates/index.html +23 -23
  393. package/app/recipes/commerce.purchases/help/index.html +21 -21
  394. package/app/recipes/commerce.purchases/index.html +23 -23
  395. package/app/recipes/commerce.sales/help/index.html +21 -21
  396. package/app/recipes/commerce.sales/index.html +23 -23
  397. package/app/recipes/commerce.vendors/help/index.html +21 -21
  398. package/app/recipes/commerce.vendors/index.html +23 -23
  399. package/app/recipes/commerce.wholesale/help/index.html +21 -21
  400. package/app/recipes/commerce.wholesale/index.html +23 -23
  401. package/app/recipes/content.articles/help/index.html +21 -21
  402. package/app/recipes/content.articles/index.html +23 -23
  403. package/app/recipes/events.calendar/help/index.html +21 -21
  404. package/app/recipes/events.calendar/index.html +23 -23
  405. package/app/recipes/expenses.tracking/help/index.html +21 -21
  406. package/app/recipes/expenses.tracking/index.html +23 -23
  407. package/app/recipes/fields.form-customization/help/index.html +21 -21
  408. package/app/recipes/fields.form-customization/index.html +23 -23
  409. package/app/recipes/human-resources.people/help/index.html +21 -21
  410. package/app/recipes/human-resources.people/index.html +23 -23
  411. package/app/recipes/human-resources.qualifications/help/index.html +21 -21
  412. package/app/recipes/human-resources.qualifications/index.html +23 -23
  413. package/app/recipes/ingestion/help/index.html +21 -21
  414. package/app/recipes/ingestion/index.html +23 -23
  415. package/app/recipes/integrations/help/index.html +21 -21
  416. package/app/recipes/integrations/index.html +23 -23
  417. package/app/recipes/inventory.stock/help/index.html +21 -21
  418. package/app/recipes/inventory.stock/index.html +23 -23
  419. package/app/recipes/ledgers.bookkeeping/help/index.html +21 -21
  420. package/app/recipes/ledgers.bookkeeping/index.html +23 -23
  421. package/app/recipes/manufacturing.assemblies/help/index.html +21 -21
  422. package/app/recipes/manufacturing.assemblies/index.html +23 -23
  423. package/app/recipes/manufacturing.production/help/index.html +21 -21
  424. package/app/recipes/manufacturing.production/index.html +23 -23
  425. package/app/recipes/marketing.campaigns/help/index.html +21 -21
  426. package/app/recipes/marketing.campaigns/index.html +23 -23
  427. package/app/recipes/messages/help/index.html +21 -21
  428. package/app/recipes/messages/index.html +23 -23
  429. package/app/recipes/places.locations/help/index.html +21 -21
  430. package/app/recipes/places.locations/index.html +23 -23
  431. package/app/recipes/products/help/index.html +21 -21
  432. package/app/recipes/products/index.html +23 -23
  433. package/app/recipes/projects.tracker/help/index.html +21 -21
  434. package/app/recipes/projects.tracker/index.html +23 -23
  435. package/app/recipes/reports.materialized/help/index.html +21 -21
  436. package/app/recipes/reports.materialized/index.html +23 -23
  437. package/app/recipes/reports.runtime/help/index.html +21 -21
  438. package/app/recipes/reports.runtime/index.html +23 -23
  439. package/app/recipes/sales.pipeline/help/index.html +21 -21
  440. package/app/recipes/sales.pipeline/index.html +23 -23
  441. package/app/recipes/social.posts/help/index.html +21 -21
  442. package/app/recipes/social.posts/index.html +23 -23
  443. package/app/recipes/subscriptions.plans/help/index.html +21 -21
  444. package/app/recipes/subscriptions.plans/index.html +23 -23
  445. package/app/recipes/support.tickets/help/index.html +21 -21
  446. package/app/recipes/support.tickets/index.html +23 -23
  447. package/app/recipes/tags.taxonomy/help/index.html +21 -21
  448. package/app/recipes/tags.taxonomy/index.html +23 -23
  449. package/app/recipes/team-collaboration/help/index.html +21 -21
  450. package/app/recipes/team-collaboration/index.html +23 -23
  451. package/app/recipes/timesheets.time-entries/help/index.html +21 -21
  452. package/app/recipes/timesheets.time-entries/index.html +23 -23
  453. package/app/recipes/video.library/help/index.html +21 -21
  454. package/app/recipes/video.library/index.html +23 -23
  455. package/app/recipes/voice.profiles/help/index.html +21 -21
  456. package/app/recipes/voice.profiles/index.html +23 -23
  457. package/app/s/custom-accounts/index.html +19 -19
  458. package/app/s/custom-appointments/index.html +19 -19
  459. package/app/s/custom-billing/index.html +19 -19
  460. package/app/s/custom-bookings/index.html +19 -19
  461. package/app/s/custom-buying/index.html +19 -19
  462. package/app/s/custom-checkout/index.html +19 -19
  463. package/app/s/custom-classes/index.html +19 -19
  464. package/app/s/custom-clients/index.html +19 -19
  465. package/app/s/custom-events/index.html +19 -19
  466. package/app/s/custom-fleet/index.html +19 -19
  467. package/app/s/custom-gigs/index.html +19 -19
  468. package/app/s/custom-giving/index.html +19 -19
  469. package/app/s/custom-instruments/index.html +19 -19
  470. package/app/s/custom-jobs/index.html +19 -19
  471. package/app/s/custom-kitchen/index.html +19 -19
  472. package/app/s/custom-lessons/index.html +19 -19
  473. package/app/s/custom-material/index.html +19 -19
  474. package/app/s/custom-meetings/index.html +19 -19
  475. package/app/s/custom-members/index.html +19 -19
  476. package/app/s/custom-merch/index.html +19 -19
  477. package/app/s/custom-money/index.html +19 -19
  478. package/app/s/custom-paint/index.html +19 -19
  479. package/app/s/custom-parts/index.html +19 -19
  480. package/app/s/custom-rentals/index.html +19 -19
  481. package/app/s/custom-roastery/index.html +19 -19
  482. package/app/s/custom-schedule/index.html +19 -19
  483. package/app/s/custom-shelf/index.html +19 -19
  484. package/app/s/custom-shop/index.html +19 -19
  485. package/app/s/custom-students/index.html +19 -19
  486. package/app/s/custom-wholesale/index.html +19 -19
  487. package/app/s/custom-work/index.html +19 -19
  488. package/app/s/custom-yard/index.html +19 -19
  489. package/app/s/section-access-control/index.html +19 -19
  490. package/app/s/section-account-security/index.html +19 -19
  491. package/app/s/section-accounting/index.html +19 -19
  492. package/app/s/section-activity/index.html +19 -19
  493. package/app/s/section-agreements/index.html +19 -19
  494. package/app/s/section-analytics/index.html +19 -19
  495. package/app/s/section-approvals/index.html +19 -19
  496. package/app/s/section-assets/index.html +19 -19
  497. package/app/s/section-billing/index.html +19 -19
  498. package/app/s/section-calendar/index.html +19 -19
  499. package/app/s/section-catalog/index.html +19 -19
  500. package/app/s/section-chat.assistant/index.html +19 -19
  501. package/app/s/section-comments/index.html +19 -19
  502. package/app/s/section-fields.form-customization/index.html +19 -19
  503. package/app/s/section-grow/index.html +19 -19
  504. package/app/s/section-ingestion/index.html +19 -19
  505. package/app/s/section-integrations/index.html +19 -19
  506. package/app/s/section-make/index.html +19 -19
  507. package/app/s/section-messages/index.html +19 -19
  508. package/app/s/section-more/index.html +19 -19
  509. package/app/s/section-operations/index.html +19 -19
  510. package/app/s/section-places/index.html +19 -19
  511. package/app/s/section-projects/index.html +19 -19
  512. package/app/s/section-publish/index.html +19 -19
  513. package/app/s/section-purchasing/index.html +19 -19
  514. package/app/s/section-reports.materialized/index.html +19 -19
  515. package/app/s/section-reports.runtime/index.html +19 -19
  516. package/app/s/section-sales/index.html +19 -19
  517. package/app/s/section-staff/index.html +19 -19
  518. package/app/s/section-support/index.html +19 -19
  519. package/app/s/section-taxonomy/index.html +19 -19
  520. package/app/s/section-team/index.html +19 -19
  521. package/app/s/section-work/index.html +19 -19
  522. package/dist/catalog/catalog.json +39 -39
  523. package/dist/smrt-version.d.ts +1 -1
  524. package/dist/smrt-version.js +1 -1
  525. package/package.json +55 -55
  526. package/app/_app/immutable/chunks/B9-iYiTV.js +0 -1
  527. package/app/_app/immutable/chunks/BAPJxs8s.js +0 -1
  528. package/app/_app/immutable/chunks/B_DUvQ2-.js +0 -1
  529. package/app/_app/immutable/entry/start.yXp5URgB.js +0 -1
package/app/404.html CHANGED
@@ -3,35 +3,35 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <link href="/_app/immutable/entry/start.yXp5URgB.js" rel="modulepreload">
7
- <link href="/_app/immutable/chunks/B_DUvQ2-.js" rel="modulepreload">
6
+ <link href="/_app/immutable/entry/start.BHH71upK.js" rel="modulepreload">
7
+ <link href="/_app/immutable/chunks/DejeH9L2.js" rel="modulepreload">
8
8
  <link href="/_app/immutable/chunks/DG3qFFTE.js" rel="modulepreload">
9
9
  <link href="/_app/immutable/chunks/COiEfhsA.js" rel="modulepreload">
10
10
  <link href="/_app/immutable/chunks/Dt-HX3Vu.js" rel="modulepreload">
11
- <link href="/_app/immutable/entry/app.CdnA1Er5.js" rel="modulepreload">
11
+ <link href="/_app/immutable/entry/app.DaSpX7br.js" rel="modulepreload">
12
12
  <link href="/_app/immutable/chunks/BaNbYf_w.js" rel="modulepreload">
13
13
  <link href="/_app/immutable/chunks/xihTtKlq.js" rel="modulepreload">
14
- <link href="/_app/immutable/nodes/0.B3BTaMcH.js" rel="modulepreload">
15
- <link href="/_app/immutable/chunks/DKO8GXxX.js" rel="modulepreload">
14
+ <link href="/_app/immutable/nodes/0.CbeqbAsy.js" rel="modulepreload">
15
+ <link href="/_app/immutable/chunks/JbseW4hD.js" rel="modulepreload">
16
16
  <link href="/_app/immutable/chunks/Bq8E3AWP.js" rel="modulepreload">
17
17
  <link href="/_app/immutable/chunks/DK8Blf1Y.js" rel="modulepreload">
18
- <link href="/_app/immutable/chunks/Bi1YzXmx.js" rel="modulepreload">
18
+ <link href="/_app/immutable/chunks/Clp9QNa3.js" rel="modulepreload">
19
19
  <link href="/_app/immutable/chunks/BLUInGBV.js" rel="modulepreload">
20
20
  <link href="/_app/immutable/chunks/v8gneLl4.js" rel="modulepreload">
21
21
  <link href="/_app/immutable/chunks/DIE02RSm.js" rel="modulepreload">
22
- <link href="/_app/immutable/chunks/HarHvnXF.js" rel="modulepreload">
22
+ <link href="/_app/immutable/chunks/BIFDoB2k.js" rel="modulepreload">
23
23
  <link href="/_app/immutable/chunks/CUyVrfsu.js" rel="modulepreload">
24
24
  <link href="/_app/immutable/chunks/CGVkRTMI.js" rel="modulepreload">
25
25
  <link href="/_app/immutable/chunks/BYcBM-fh.js" rel="modulepreload">
26
- <link href="/_app/immutable/chunks/BAPJxs8s.js" rel="modulepreload">
27
- <link href="/_app/immutable/chunks/B9-iYiTV.js" rel="modulepreload">
28
- <link href="/_app/immutable/chunks/0HEEaKDE.js" rel="modulepreload">
26
+ <link href="/_app/immutable/chunks/C4LXhqJ6.js" rel="modulepreload">
27
+ <link href="/_app/immutable/chunks/Berfh5jP.js" rel="modulepreload">
28
+ <link href="/_app/immutable/chunks/CXCKbdz7.js" rel="modulepreload">
29
29
  <link href="/_app/immutable/chunks/d934w91N.js" rel="modulepreload">
30
- <link href="/_app/immutable/chunks/OkFnmq-I.js" rel="modulepreload">
31
- <link href="/_app/immutable/chunks/BQgJ05r2.js" rel="modulepreload">
32
- <link href="/_app/immutable/chunks/BgOimu0u.js" rel="modulepreload">
33
- <link href="/_app/immutable/chunks/D3cv8Pui.js" rel="modulepreload">
34
- <link href="/_app/immutable/chunks/DSdlNRNs.js" rel="modulepreload">
30
+ <link href="/_app/immutable/chunks/CXxP8-A-.js" rel="modulepreload">
31
+ <link href="/_app/immutable/chunks/51bIF3zu.js" rel="modulepreload">
32
+ <link href="/_app/immutable/chunks/ByYMR4Nv.js" rel="modulepreload">
33
+ <link href="/_app/immutable/chunks/BtUkduqy.js" rel="modulepreload">
34
+ <link href="/_app/immutable/chunks/B2zXE0hq.js" rel="modulepreload">
35
35
  <link href="/_app/immutable/chunks/BMgzWMdF.js" rel="modulepreload">
36
36
  <link href="/_app/immutable/chunks/CgAkqYsL.js" rel="modulepreload">
37
37
 
@@ -51,15 +51,15 @@
51
51
  <div style="display: contents">
52
52
  <script>
53
53
  {
54
- __sveltekit_18i6w6w = {
54
+ __sveltekit_eptl8w = {
55
55
  base: ""
56
56
  };
57
57
 
58
58
  const element = document.currentScript.parentElement;
59
59
 
60
60
  Promise.all([
61
- import("/_app/immutable/entry/start.yXp5URgB.js"),
62
- import("/_app/immutable/entry/app.CdnA1Er5.js")
61
+ import("/_app/immutable/entry/start.BHH71upK.js"),
62
+ import("/_app/immutable/entry/app.DaSpX7br.js")
63
63
  ]).then(([kit, app]) => {
64
64
  kit.start(app, element);
65
65
  });
@@ -1 +1 @@
1
- import{$ as e,A as t,D as n,E as r,J as i,M as a,N as o,P as s,Q as c,S as l,T as u,Y as d,Z as f,at as p,bt as m,ct as h,dt as g,et as _,ft as ee,gt as v,it as y,j as te,k as b,lt as x,mt as ne,rt as re,st as S,ut as C,w,x as T,y as E,z as ie}from"./DKO8GXxX.js";var D=e=>{let t=m(e);if(!t)throw Error(`The catalog has no model ${e}`);return t.model};function O(e){return String(e??``).toUpperCase().replace(/[^A-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}var k=/\{([A-Za-z_][\w]*\.[A-Za-z_][\w]*)(?:\|(slug))?\}/g;function A(e,t){return e.replace(k,(e,n,r)=>{let i=t[n],a=i==null?``:String(i);return r===`slug`?O(a):a})}function j(e,t,n=e=>e){return typeof e==`string`?A(e,t):typeof e==`object`&&e?{ref:n(e.ref),...e.field?{field:e.field}:{}}:e}function M(e,t,n){return Object.fromEntries(Object.entries(e??{}).map(([e,r])=>[e,j(r,t,n)]))}function N(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`object`&&e&&!Array.isArray(e)?e:null}function P(e,t,n){return Object.fromEntries(e.flatMap(e=>{let r=F(e.to);return r.alias===t?[[r.field,N(n[e.id])]]:[]}))}function F(e){let t=e.indexOf(`.`);if(t<1||t===e.length-1)throw Error(`A form field maps to "alias.field", got "${e}"`);return{alias:e.slice(0,t),field:e.slice(t+1)}}function I(e,t,n){let{alias:r,field:i}=F(e.to),a=t.find(e=>e.as===r);if(!a)throw Error(`Form field ${e.id} maps to unknown ${r}`);let o=n(a.model).fields.find(e=>e.name===i);if(!o)throw Error(`${a.model} has no field ${i} (form field ${e.id})`);return o}function L(e,t){let{alias:n}=F(e.to),r=t.find(e=>e.as===n);if(!r)throw Error(`Form field ${e.id} maps to unknown ${n}`);return r.model}function R(e,t){return e.default===void 0?t.default===void 0?t.type===`text`?``:null:t.default:e.default}function z(e,t){return Object.fromEntries(e.map(e=>[e.to,t[e.id]]))}var B=(e,t)=>e===t;async function V(e,t,n,r){let i={...n};for(let n of t){if(n.as in i)continue;if(!n.match){i[n.as]=void 0;continue}let t={},a=!0;for(let[e,r]of Object.entries(n.match))if(typeof r==`object`&&r){let n=i[r.ref];n||(a=!1),t[e]=r.field?n?.[r.field]:n?.id}else t[e]=r;i[n.as]=a?(await e.list(r(n.model))).find(e=>Object.entries(t).every(([t,n])=>B(e[t],n))):void 0}return i}var H=4,U=(e,t)=>e.fields.some(e=>e.name===t);function W(e,r,i,o,s){let c=l(n(`${o}:${e.id}:${i.id}`)),d=U(e,`debit`)&&U(e,`credit`),f=d?2*(1+Math.floor(c()*2)):1+Math.floor(c()*H),p=_(e),m=1e3*(1+Math.floor(c()*90));return Array.from({length:f},(l,f)=>{let h=n(`${i.id}:${f}`)%997,g={...u(e,h,o,s),id:w(`${e.id}:${i.id}:${f}`),[r]:i.id};if(U(e,`sortOrder`)&&(g.sortOrder=f),p){let n=e.fields.find(e=>e.related?.endsWith(`:Product`)&&e.name in g),r=a(),{products:o}=r,l=n?o[t(n,{modelId:e.id,index:h,rows:s})%o.length]:o[h%o.length],u=b(h);u?(U(e,`description`)&&(g.description=u.description),g.unitPrice=u.price,n&&(g[n.name]=``)):n&&l&&(U(e,`description`)&&(g.description=l.name),g.unitPrice=l.price);let[d,p]=u?.quantity??l?.quantity??r.lineQuantity??[1,5],m=d+Math.floor(c()*(p-d+1));U(e,`quantity`)&&(g.quantity=m),Object.assign(g,ae(e,i,f,m,Number(g.unitPrice??0))),g.amount=C(g)}if(d){let e=f%2==0;g.debit=e?m/100:0,g.credit=e?0:m/100}return g})}function G(e){return n(`discount:${e.id}`)%3==0}function K(e,t){return Math.round(e*t/1e3)*100}function q(e,t){return t>0&&n(`tax-override:${e.id}:${t}`)%7==0}function J(e,t,r=o().currency){let i=n(`tax-override-kind:${e.id}:${t}`)%4,a=x(r);if(a&&i<2)return a;let s=i%2==0?`exempt`:`zero-rated`;return S.find(e=>e.kind===s)}function ae(e,t,r,i,a){let o={},s=r===0&&G(t),c=n(`discount-kind:${t.id}`)%2==0;U(e,`discountType`)&&(o.discountType=s?c?`percent`:`amount`:`none`),U(e,`discountRate`)&&(o.discountRate=s&&c?`10`:null),U(e,`discount`)&&(o.discount=s&&!(c&&U(e,`discountType`))?K(i,a):0),!U(e,`discountType`)&&o.discount&&(o.discountType=`amount`);let l=q(t,r)?J(t,r):void 0;return U(e,`taxMode`)&&(o.taxMode=l?`override`:`inherit`),U(e,`taxCodeId`)&&(o.taxCodeId=l?.id??null),o}function oe(e,t){let n={...e,...t};return`discount`in t&&!(`discountType`in t)&&n.discountType===`amount`&&(n.discountType=`percent`,n.discountRate=`10`,n.discount=0),`discountRate`in t&&n.discountType===`percent`&&(n.discountType=`none`,n.discountRate=null,n.discount=0),n}var se=[`@happyvertical/smrt-commerce:Order`,`@happyvertical/smrt-commerce:Invoice`],Y=2500;function ce(e,t,n){n===2&&se.includes(t.id)&&typeof e.subtotal==`number`&&typeof e.totalAmount==`number`&&(t.fields.some(e=>e.name===`status`&&e.enum?.includes(`draft`))&&(e.status=`draft`),e.subtotal+=Y,e.totalAmount+=Y)}function le(e,t,n,r){if(!n.length||!n.every(e=>`unitPrice`in e))return[...n];let i=y(t,e,n,r);return Object.assign(e,i.row),i.lines}var X=e=>typeof e==`number`&&Number.isFinite(e)?e:0,ue=e=>e.status!==`draft`&&e.status!==`cancelled`&&X(e.totalAmount)>0;function de(e,t,r,i){let a=new Map(r.map(e=>[e.id,X(e.totalAmount)])),o=[];for(let s of t){if(s.status!==`completed`){s.status!==`refunded`&&(s.paidAt=null);continue}let t=l(n(`${i}:alloc:${s.id}`)),c=r.filter(e=>ue(e)&&e.customerId===s.customerId&&(a.get(e.id)??0)>0).slice(0,t()<.3?2:1);if(c.length===0)continue;let d=c.map((e,n)=>{let r=a.get(e.id)??0,i=n>0||t()<.6?r:Math.min(r,Math.max(100,Math.round(r*(.3+t()*.4)/100)*100));return a.set(e.id,r-i),{inv:e,part:i}}),f=Math.max(...d.map(({inv:e})=>Date.parse(String(e.issueDate)))),p=new Date(Math.max(f,Math.min(f+(1+Math.floor(t()*20))*E,T))).toISOString();s.amount=d.reduce((e,t)=>e+t.part,0),s.paidAt=p,`contractId`in s&&d[0]?.inv.contractId&&(s.contractId=d[0].inv.contractId);for(let{inv:t,part:n}of d)o.push({...u(e.model,o.length,i),id:w(`${e.model.id}:${s.id}:${t.id}`),[e.paymentFk]:s.id,[e.invoiceFk]:t.id,amount:n,allocatedAt:p})}return o}function Z(e){return typeof e==`object`&&!!e&&typeof e.ref==`string`}var Q=`smrt-planner:data:v6:`,fe=`@happyvertical/smrt-commerce:TaxCode`,pe=`@happyvertical/smrt-commerce:TaxComponent`,me=[`taxable`,`zero-rated`,`exempt`,`out-of-scope`];function he(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}var $=`${Q}_created`;function ge(e){if(e)try{let t=[];for(let n=0;n<e.length;n++){let r=e.key(n);r?.startsWith(`smrt-planner:data:v6:`)&&t.push(r)}for(let n of t)e.removeItem(n)}catch{}}function _e(t={}){let n=t.seed??1,a=t.rowsPerModel??8,l=new Set(t.empty??[]),u=new Map,m=new Set,b=t.storage??null,x=e=>`${Q}${e.id}`,S=e=>{if(b)try{let t=b.getItem(x(e));if(t===null)return;let n=JSON.parse(t);if(Array.isArray(n)&&n.every(e=>typeof e==`object`&&!!e&&typeof e.id==`string`))return n}catch{}},C=0;if(b)try{C=Number(b.getItem($))||0}catch{C=0}let E=new Map,D=e=>{let n=E.get(e);return n||(n=t.children?.links(e)??[],E.set(e,n)),n},O,k,A=e=>{if(!O){O=new Map;for(let e of t.children?.models??[])for(let t of D(e.id)){let n=O.get(t.model.id)??[];n.push({parent:e,fk:t.fk}),O.set(t.model.id,n)}k=new Map(O);for(let[e,t]of O){let n=e.slice(e.lastIndexOf(`:`)+1).toLowerCase(),r=t.find(e=>n.startsWith(e.fk.replace(/Id$/,``).toLowerCase()))?.fk??t[0]?.fk;O.set(e,t.filter(e=>e.fk===r))}}return O.get(e)??[]},j=t=>{if(!e(t))return;A(t.id);let n=k?.get(t.id)??[],r=d(t)?.name,a=i(t)?.name,o=n.find(e=>e.fk===r)?.parent,s=n.find(e=>e.fk===a)?.parent;return o&&s&&r&&a?{model:t,paymentFk:r,invoiceFk:a,payment:o,invoice:s}:void 0},M=(n,r)=>{if(!p(n))return r;let i=D(n.id).find(t=>e(t.model)),a=i&&j(i.model);if(!i||!a)return r;let o=new Map(P(a.payment).map(e=>[e.id,e])),s=P(i.model).filter(e=>e[i.fk]===r.id&&o.get(String(e[a.paymentFk]))?.status===`completed`).map(e=>({amount:Number(e.amount??0),at:String(e.allocatedAt??``)})),c=re(r,s,(t.now??(()=>T))()),l={...r,amountPaid:c.amountPaid,status:c.status};return n.fields.some(e=>e.name===`paidDate`)&&(l.paidDate=c.paidDate),l},N=(e,t)=>{let n=P(e),r=n.findIndex(e=>e.id===t);r>=0&&(n[r]=M(e,n[r]))},P=e=>{let i=u.get(e.id);if(i)return i;let o=S(e);if(o){u.set(e.id,o);for(let t of D(e.id))P(t.model);return o}let s=l.has(e.id)?void 0:t.samples?.[e.id];if(s){let t=[];return u.set(e.id,t),t.push(...s.make(s.from.map(P),n)),t}let c=j(e),d=c?[]:A(e.id),f=l.has(e.id)||d.length||c?[]:r(e,te(e.id,a),n,a);u.set(e.id,f);for(let t of D(e.id))P(t.model);if(c&&!l.has(e.id)){for(let e of D(c.invoice.id))_(e.model)&&P(e.model);let e=P(c.invoice);f.push(...de(c,P(c.payment),e,n)),e.forEach((t,n)=>{e[n]=M(c.invoice,t)})}if(!l.has(e.id))for(let{parent:r,fk:i}of d){let o=t.defaults?.(e)??{};P(r).forEach((t,s)=>{let c=W(e,i,t,n,a).map(e=>oe(e,o));_(e)?(f.push(...le(t,r,c,L(r,t))),ce(t,r,s)):f.push(...c)})}return f},F=new Map((t.children?.models??[]).map(e=>[e.id,e])),I=e=>{let t=ee(e),n=F.get(fe),r=F.get(pe),i=n?P(n):[];if(!i.length)return t;let a=new Map(t.flatMap(e=>e.components.map(e=>[e.id,e])));for(let e of r?P(r):[])a.set(e.id,{id:e.id,key:e.id,name:String(e.name??``),percent:String(e.percent??`0`),recoverable:e.recoverable===!0});let o=i.map(e=>{let t=[];try{t=JSON.parse(String(e.componentsJson??`[]`))}catch{t=[]}let n=(Array.isArray(t)?t:[]).flatMap(e=>{let t=e&&typeof e==`object`?a.get(String(e.taxComponentId)):void 0;return t?[t]:[]}),r=me.includes(String(e.kind))?e.kind:`taxable`,i=[`sales`,`purchases`,`both`].includes(String(e.appliesTo))?e.appliesTo:`both`;return{id:e.id,code:String(e.code??``),name:String(e.name??``),kind:r,appliesTo:i,active:e.active!==!1,components:n}}),s=new Map(o.map(e=>[e.id,e]));if(t.some(e=>s.has(e.id))){let n=h(e);return[...t.filter(e=>s.has(e.id)||e.id===n.id).map(e=>s.get(e.id)??e),...o.filter(e=>!t.some(t=>t.id===e.id))]}return[...t,...o]},L=(e,t)=>{let n=o(),r=s()??.05,i=I(r),a=e.fields.find(e=>e.name===`customerId`&&e.related),l=a?.related?F.get(a.related):void 0,d=l?P(l).find(e=>e.id===t.customerId):void 0,p=e=>{for(let[t,n]of u){if(!t.endsWith(`:Product`))continue;let r=n.find(t=>t.id===e);if(r)return r}},m=e=>typeof e==`string`&&e?e:null;return{lineAmountType:f(t,n.pricesIncludeTax?`inclusive`:`exclusive`),roundingScope:c(t,n.taxRounding),currency:g(t.currency,g(n.currency)),codes:i,appDefaultCodeId:h(r).id,customerTaxExempt:d?.taxExempt===!0,partyCodeId:m(d?.defaultTaxCodeId),productCodeOf:e=>m(p(e)?.defaultSalesTaxCodeId)}},R=e=>{if(!b)return;let t=e=>{let t=j(e);return t?[t.payment,t.invoice]:[]},n=[e,...D(e.id).map(e=>e.model),...A(e.id).map(e=>e.parent),...t(e),...D(e.id).flatMap(e=>t(e.model))];try{for(let e of n){let t=u.get(e.id);t&&b.setItem(x(e),JSON.stringify(t))}b.setItem($,String(C))}catch{}},z=e=>D(e.id).find(t=>_(t.model)&&A(t.model.id).some(n=>n.parent.id===e.id&&n.fk===t.fk)),B=(e,t,n=!1)=>{let r=z(e);if(!r)return!1;let i=P(e),a=i.findIndex(e=>e.id===t);if(a<0)return!1;let o=P(r.model),s=o.filter(e=>e[r.fk]===t),c=i[a];if(he(e,c)){if(n)throw new v(`FROZEN_DOCUMENT`,`This ${e.name.toLowerCase()} has been issued, so its lines can no longer change.`);return!0}let l=y(e,c,s,L(e,c));i[a]=l.row;for(let e of l.lines){let t=o.findIndex(t=>t.id===e.id);t>=0&&(o[t]=e)}return!0},V=(e,t)=>{let n=t;if(z(e)&&(B(e,t.id),n=P(e).find(e=>e.id===t.id)??n),_(e)){let r=A(e.id).some(({parent:e,fk:n})=>B(e,t[n],!0)),i=P(e),a=i.findIndex(e=>e.id===t.id);if(!r&&a>=0){let e=o(),n=s()??.05;i[a]=ne([t],{lineAmountType:e.pricesIncludeTax?`inclusive`:`exclusive`,roundingScope:e.taxRounding,currency:g(e.currency),codes:I(n),appDefaultCodeId:h(n).id}).lines[0]}n=P(e).find(e=>e.id===t.id)??n}p(e)&&(N(e,t.id),n=P(e).find(e=>e.id===t.id)??n);let r=j(e);r&&N(r.invoice,t[r.invoiceFk]);for(let n of D(e.id)){let r=j(n.model);if(r&&r.payment.id===e.id)for(let e of P(n.model))e[r.paymentFk]===t.id&&N(r.invoice,e[r.invoiceFk])}return n},H=e=>{let t=[e,...D(e.id).map(e=>e.model),...A(e.id).map(e=>e.parent)];return new Map(t.map(e=>[e.id,P(e).map(e=>({...e}))]))},U=e=>{for(let[t,n]of e){let e=u.get(t);e&&e.splice(0,e.length,...n)}},G=(e,n)=>({...n,...t.defaults?.(e)??{}}),K=e=>w(`${e.id}:new:${n}:${C++}`),q=(e,t)=>Object.entries(t).every(([t,n])=>e[t]===n);return{async list(e){return P(e).map(t=>G(e,t))},async listWhere(e,t,n){return P(e).filter(e=>String(e[t]??``)===n).map(t=>G(e,t))},async get(e,t){let n=P(e).find(e=>e.id===t);return n?G(e,n):void 0},async create(e,n){let r={...t.defaults?.(e)??{},...n,id:K(e)},i=H(e);P(e).push(r);let a;try{a=V(e,r)}catch(e){throw U(i),C--,e}return R(e),{...a}},async update(e,t,n){let r=P(e),i=r.findIndex(e=>e.id===t);if(i<0)return;let a=H(e),o=r[i],s={...o,...n,id:t};r[i]=s;let c;try{if(c=V(e,s),_(e))for(let{parent:t,fk:n}of A(e.id))o[n]!==s[n]&&B(t,o[n],!0)}catch(e){throw U(a),e}return R(e),{...c}},async delete(e,t){let n=P(e),r=n.findIndex(e=>e.id===t);if(r<0)return!1;let i=H(e),[a]=n.splice(r,1);try{let t=j(e);t&&a&&N(t.invoice,a[t.invoiceFk]);for(let{parent:t,fk:n}of A(e.id))_(e)&&a&&B(t,a[n],!0)}catch(e){throw U(i),e}return R(e),!0},reset(){ie(),u.clear(),C=0,ge(b);for(let e of[...m])e()},onReset(e){return m.add(e),()=>{m.delete(e)}},async apply(e){let n=new Map,r=C,i=new Map,a=e=>{i.set(e.id,e);let t=P(e);return n.has(e.id)||n.set(e.id,t.map(e=>({...e}))),t},o={},s=e=>Object.fromEntries(Object.entries(e??{}).map(([e,t])=>{if(!Z(t))return[e,t];let n=o[t.ref];if(!n)throw Error(`Unknown record reference ${t.ref}`);return[e,t.field?n[t.field]:n.id]}));try{for(let n of e){let e=a(n.model),r=s(n.match);if(n.op===`delete`){let t=e.filter(e=>n.id===void 0?q(e,r):e.id===n.id);if(n.id===void 0&&Object.keys(r).length===0)throw Error(`A delete needs an id or a match`);for(let n of t)e.splice(e.indexOf(n),1);continue}let i=s(n.values),c=-1;if(n.id!==void 0){if(c=e.findIndex(e=>e.id===n.id),c<0)throw Error(`No ${n.model.name} with id ${n.id}`)}else Object.keys(r).length>0&&(c=e.findIndex(e=>q(e,r)));let l;if(c>=0){let t=e[c];l={...t,...i,id:t.id},e[c]=l}else l={...t.defaults?.(n.model)??{},...r,...s(n.onCreate),...i,id:K(n.model)},e.push(l);n.as&&(o[n.as]={...l})}}catch(e){for(let[e,t]of n)u.set(e,t);throw C=r,e}for(let e of i.values())R(e);return o}}}export{V as a,N as c,I as d,L as f,z as i,O as l,Z as n,P as o,M as p,D as r,F as s,_e as t,R as u};
1
+ import{$ as e,A as t,D as n,E as r,J as i,M as a,N as o,P as s,Q as c,S as l,T as u,Y as d,Z as f,at as p,bt as m,ct as h,dt as g,et as _,ft as ee,gt as v,it as y,j as te,k as b,lt as x,mt as ne,rt as re,st as S,ut as C,w,x as T,y as E,z as ie}from"./JbseW4hD.js";var D=e=>{let t=m(e);if(!t)throw Error(`The catalog has no model ${e}`);return t.model};function O(e){return String(e??``).toUpperCase().replace(/[^A-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}var k=/\{([A-Za-z_][\w]*\.[A-Za-z_][\w]*)(?:\|(slug))?\}/g;function A(e,t){return e.replace(k,(e,n,r)=>{let i=t[n],a=i==null?``:String(i);return r===`slug`?O(a):a})}function j(e,t,n=e=>e){return typeof e==`string`?A(e,t):typeof e==`object`&&e?{ref:n(e.ref),...e.field?{field:e.field}:{}}:e}function M(e,t,n){return Object.fromEntries(Object.entries(e??{}).map(([e,r])=>[e,j(r,t,n)]))}function N(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`object`&&e&&!Array.isArray(e)?e:null}function P(e,t,n){return Object.fromEntries(e.flatMap(e=>{let r=F(e.to);return r.alias===t?[[r.field,N(n[e.id])]]:[]}))}function F(e){let t=e.indexOf(`.`);if(t<1||t===e.length-1)throw Error(`A form field maps to "alias.field", got "${e}"`);return{alias:e.slice(0,t),field:e.slice(t+1)}}function I(e,t,n){let{alias:r,field:i}=F(e.to),a=t.find(e=>e.as===r);if(!a)throw Error(`Form field ${e.id} maps to unknown ${r}`);let o=n(a.model).fields.find(e=>e.name===i);if(!o)throw Error(`${a.model} has no field ${i} (form field ${e.id})`);return o}function L(e,t){let{alias:n}=F(e.to),r=t.find(e=>e.as===n);if(!r)throw Error(`Form field ${e.id} maps to unknown ${n}`);return r.model}function R(e,t){return e.default===void 0?t.default===void 0?t.type===`text`?``:null:t.default:e.default}function z(e,t){return Object.fromEntries(e.map(e=>[e.to,t[e.id]]))}var B=(e,t)=>e===t;async function V(e,t,n,r){let i={...n};for(let n of t){if(n.as in i)continue;if(!n.match){i[n.as]=void 0;continue}let t={},a=!0;for(let[e,r]of Object.entries(n.match))if(typeof r==`object`&&r){let n=i[r.ref];n||(a=!1),t[e]=r.field?n?.[r.field]:n?.id}else t[e]=r;i[n.as]=a?(await e.list(r(n.model))).find(e=>Object.entries(t).every(([t,n])=>B(e[t],n))):void 0}return i}var H=4,U=(e,t)=>e.fields.some(e=>e.name===t);function W(e,r,i,o,s){let c=l(n(`${o}:${e.id}:${i.id}`)),d=U(e,`debit`)&&U(e,`credit`),f=d?2*(1+Math.floor(c()*2)):1+Math.floor(c()*H),p=_(e),m=1e3*(1+Math.floor(c()*90));return Array.from({length:f},(l,f)=>{let h=n(`${i.id}:${f}`)%997,g={...u(e,h,o,s),id:w(`${e.id}:${i.id}:${f}`),[r]:i.id};if(U(e,`sortOrder`)&&(g.sortOrder=f),p){let n=e.fields.find(e=>e.related?.endsWith(`:Product`)&&e.name in g),r=a(),{products:o}=r,l=n?o[t(n,{modelId:e.id,index:h,rows:s})%o.length]:o[h%o.length],u=b(h);u?(U(e,`description`)&&(g.description=u.description),g.unitPrice=u.price,n&&(g[n.name]=``)):n&&l&&(U(e,`description`)&&(g.description=l.name),g.unitPrice=l.price);let[d,p]=u?.quantity??l?.quantity??r.lineQuantity??[1,5],m=d+Math.floor(c()*(p-d+1));U(e,`quantity`)&&(g.quantity=m),Object.assign(g,ae(e,i,f,m,Number(g.unitPrice??0))),g.amount=C(g)}if(d){let e=f%2==0;g.debit=e?m/100:0,g.credit=e?0:m/100}return g})}function G(e){return n(`discount:${e.id}`)%3==0}function K(e,t){return Math.round(e*t/1e3)*100}function q(e,t){return t>0&&n(`tax-override:${e.id}:${t}`)%7==0}function J(e,t,r=o().currency){let i=n(`tax-override-kind:${e.id}:${t}`)%4,a=x(r);if(a&&i<2)return a;let s=i%2==0?`exempt`:`zero-rated`;return S.find(e=>e.kind===s)}function ae(e,t,r,i,a){let o={},s=r===0&&G(t),c=n(`discount-kind:${t.id}`)%2==0;U(e,`discountType`)&&(o.discountType=s?c?`percent`:`amount`:`none`),U(e,`discountRate`)&&(o.discountRate=s&&c?`10`:null),U(e,`discount`)&&(o.discount=s&&!(c&&U(e,`discountType`))?K(i,a):0),!U(e,`discountType`)&&o.discount&&(o.discountType=`amount`);let l=q(t,r)?J(t,r):void 0;return U(e,`taxMode`)&&(o.taxMode=l?`override`:`inherit`),U(e,`taxCodeId`)&&(o.taxCodeId=l?.id??null),o}function oe(e,t){let n={...e,...t};return`discount`in t&&!(`discountType`in t)&&n.discountType===`amount`&&(n.discountType=`percent`,n.discountRate=`10`,n.discount=0),`discountRate`in t&&n.discountType===`percent`&&(n.discountType=`none`,n.discountRate=null,n.discount=0),n}var se=[`@happyvertical/smrt-commerce:Order`,`@happyvertical/smrt-commerce:Invoice`],Y=2500;function ce(e,t,n){n===2&&se.includes(t.id)&&typeof e.subtotal==`number`&&typeof e.totalAmount==`number`&&(t.fields.some(e=>e.name===`status`&&e.enum?.includes(`draft`))&&(e.status=`draft`),e.subtotal+=Y,e.totalAmount+=Y)}function le(e,t,n,r){if(!n.length||!n.every(e=>`unitPrice`in e))return[...n];let i=y(t,e,n,r);return Object.assign(e,i.row),i.lines}var X=e=>typeof e==`number`&&Number.isFinite(e)?e:0,ue=e=>e.status!==`draft`&&e.status!==`cancelled`&&X(e.totalAmount)>0;function de(e,t,r,i){let a=new Map(r.map(e=>[e.id,X(e.totalAmount)])),o=[];for(let s of t){if(s.status!==`completed`){s.status!==`refunded`&&(s.paidAt=null);continue}let t=l(n(`${i}:alloc:${s.id}`)),c=r.filter(e=>ue(e)&&e.customerId===s.customerId&&(a.get(e.id)??0)>0).slice(0,t()<.3?2:1);if(c.length===0)continue;let d=c.map((e,n)=>{let r=a.get(e.id)??0,i=n>0||t()<.6?r:Math.min(r,Math.max(100,Math.round(r*(.3+t()*.4)/100)*100));return a.set(e.id,r-i),{inv:e,part:i}}),f=Math.max(...d.map(({inv:e})=>Date.parse(String(e.issueDate)))),p=new Date(Math.max(f,Math.min(f+(1+Math.floor(t()*20))*E,T))).toISOString();s.amount=d.reduce((e,t)=>e+t.part,0),s.paidAt=p,`contractId`in s&&d[0]?.inv.contractId&&(s.contractId=d[0].inv.contractId);for(let{inv:t,part:n}of d)o.push({...u(e.model,o.length,i),id:w(`${e.model.id}:${s.id}:${t.id}`),[e.paymentFk]:s.id,[e.invoiceFk]:t.id,amount:n,allocatedAt:p})}return o}function Z(e){return typeof e==`object`&&!!e&&typeof e.ref==`string`}var Q=`smrt-planner:data:v6:`,fe=`@happyvertical/smrt-commerce:TaxCode`,pe=`@happyvertical/smrt-commerce:TaxComponent`,me=[`taxable`,`zero-rated`,`exempt`,`out-of-scope`];function he(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}var $=`${Q}_created`;function ge(e){if(e)try{let t=[];for(let n=0;n<e.length;n++){let r=e.key(n);r?.startsWith(`smrt-planner:data:v6:`)&&t.push(r)}for(let n of t)e.removeItem(n)}catch{}}function _e(t={}){let n=t.seed??1,a=t.rowsPerModel??8,l=new Set(t.empty??[]),u=new Map,m=new Set,b=t.storage??null,x=e=>`${Q}${e.id}`,S=e=>{if(b)try{let t=b.getItem(x(e));if(t===null)return;let n=JSON.parse(t);if(Array.isArray(n)&&n.every(e=>typeof e==`object`&&!!e&&typeof e.id==`string`))return n}catch{}},C=0;if(b)try{C=Number(b.getItem($))||0}catch{C=0}let E=new Map,D=e=>{let n=E.get(e);return n||(n=t.children?.links(e)??[],E.set(e,n)),n},O,k,A=e=>{if(!O){O=new Map;for(let e of t.children?.models??[])for(let t of D(e.id)){let n=O.get(t.model.id)??[];n.push({parent:e,fk:t.fk}),O.set(t.model.id,n)}k=new Map(O);for(let[e,t]of O){let n=e.slice(e.lastIndexOf(`:`)+1).toLowerCase(),r=t.find(e=>n.startsWith(e.fk.replace(/Id$/,``).toLowerCase()))?.fk??t[0]?.fk;O.set(e,t.filter(e=>e.fk===r))}}return O.get(e)??[]},j=t=>{if(!e(t))return;A(t.id);let n=k?.get(t.id)??[],r=d(t)?.name,a=i(t)?.name,o=n.find(e=>e.fk===r)?.parent,s=n.find(e=>e.fk===a)?.parent;return o&&s&&r&&a?{model:t,paymentFk:r,invoiceFk:a,payment:o,invoice:s}:void 0},M=(n,r)=>{if(!p(n))return r;let i=D(n.id).find(t=>e(t.model)),a=i&&j(i.model);if(!i||!a)return r;let o=new Map(P(a.payment).map(e=>[e.id,e])),s=P(i.model).filter(e=>e[i.fk]===r.id&&o.get(String(e[a.paymentFk]))?.status===`completed`).map(e=>({amount:Number(e.amount??0),at:String(e.allocatedAt??``)})),c=re(r,s,(t.now??(()=>T))()),l={...r,amountPaid:c.amountPaid,status:c.status};return n.fields.some(e=>e.name===`paidDate`)&&(l.paidDate=c.paidDate),l},N=(e,t)=>{let n=P(e),r=n.findIndex(e=>e.id===t);r>=0&&(n[r]=M(e,n[r]))},P=e=>{let i=u.get(e.id);if(i)return i;let o=S(e);if(o){u.set(e.id,o);for(let t of D(e.id))P(t.model);return o}let s=l.has(e.id)?void 0:t.samples?.[e.id];if(s){let t=[];return u.set(e.id,t),t.push(...s.make(s.from.map(P),n)),t}let c=j(e),d=c?[]:A(e.id),f=l.has(e.id)||d.length||c?[]:r(e,te(e.id,a),n,a);u.set(e.id,f);for(let t of D(e.id))P(t.model);if(c&&!l.has(e.id)){for(let e of D(c.invoice.id))_(e.model)&&P(e.model);let e=P(c.invoice);f.push(...de(c,P(c.payment),e,n)),e.forEach((t,n)=>{e[n]=M(c.invoice,t)})}if(!l.has(e.id))for(let{parent:r,fk:i}of d){let o=t.defaults?.(e)??{};P(r).forEach((t,s)=>{let c=W(e,i,t,n,a).map(e=>oe(e,o));_(e)?(f.push(...le(t,r,c,L(r,t))),ce(t,r,s)):f.push(...c)})}return f},F=new Map((t.children?.models??[]).map(e=>[e.id,e])),I=e=>{let t=ee(e),n=F.get(fe),r=F.get(pe),i=n?P(n):[];if(!i.length)return t;let a=new Map(t.flatMap(e=>e.components.map(e=>[e.id,e])));for(let e of r?P(r):[])a.set(e.id,{id:e.id,key:e.id,name:String(e.name??``),percent:String(e.percent??`0`),recoverable:e.recoverable===!0});let o=i.map(e=>{let t=[];try{t=JSON.parse(String(e.componentsJson??`[]`))}catch{t=[]}let n=(Array.isArray(t)?t:[]).flatMap(e=>{let t=e&&typeof e==`object`?a.get(String(e.taxComponentId)):void 0;return t?[t]:[]}),r=me.includes(String(e.kind))?e.kind:`taxable`,i=[`sales`,`purchases`,`both`].includes(String(e.appliesTo))?e.appliesTo:`both`;return{id:e.id,code:String(e.code??``),name:String(e.name??``),kind:r,appliesTo:i,active:e.active!==!1,components:n}}),s=new Map(o.map(e=>[e.id,e]));if(t.some(e=>s.has(e.id))){let n=h(e);return[...t.filter(e=>s.has(e.id)||e.id===n.id).map(e=>s.get(e.id)??e),...o.filter(e=>!t.some(t=>t.id===e.id))]}return[...t,...o]},L=(e,t)=>{let n=o(),r=s()??.05,i=I(r),a=e.fields.find(e=>e.name===`customerId`&&e.related),l=a?.related?F.get(a.related):void 0,d=l?P(l).find(e=>e.id===t.customerId):void 0,p=e=>{for(let[t,n]of u){if(!t.endsWith(`:Product`))continue;let r=n.find(t=>t.id===e);if(r)return r}},m=e=>typeof e==`string`&&e?e:null;return{lineAmountType:f(t,n.pricesIncludeTax?`inclusive`:`exclusive`),roundingScope:c(t,n.taxRounding),currency:g(t.currency,g(n.currency)),codes:i,appDefaultCodeId:h(r).id,customerTaxExempt:d?.taxExempt===!0,partyCodeId:m(d?.defaultTaxCodeId),productCodeOf:e=>m(p(e)?.defaultSalesTaxCodeId)}},R=e=>{if(!b)return;let t=e=>{let t=j(e);return t?[t.payment,t.invoice]:[]},n=[e,...D(e.id).map(e=>e.model),...A(e.id).map(e=>e.parent),...t(e),...D(e.id).flatMap(e=>t(e.model))];try{for(let e of n){let t=u.get(e.id);t&&b.setItem(x(e),JSON.stringify(t))}b.setItem($,String(C))}catch{}},z=e=>D(e.id).find(t=>_(t.model)&&A(t.model.id).some(n=>n.parent.id===e.id&&n.fk===t.fk)),B=(e,t,n=!1)=>{let r=z(e);if(!r)return!1;let i=P(e),a=i.findIndex(e=>e.id===t);if(a<0)return!1;let o=P(r.model),s=o.filter(e=>e[r.fk]===t),c=i[a];if(he(e,c)){if(n)throw new v(`FROZEN_DOCUMENT`,`This ${e.name.toLowerCase()} has been issued, so its lines can no longer change.`);return!0}let l=y(e,c,s,L(e,c));i[a]=l.row;for(let e of l.lines){let t=o.findIndex(t=>t.id===e.id);t>=0&&(o[t]=e)}return!0},V=(e,t)=>{let n=t;if(z(e)&&(B(e,t.id),n=P(e).find(e=>e.id===t.id)??n),_(e)){let r=A(e.id).some(({parent:e,fk:n})=>B(e,t[n],!0)),i=P(e),a=i.findIndex(e=>e.id===t.id);if(!r&&a>=0){let e=o(),n=s()??.05;i[a]=ne([t],{lineAmountType:e.pricesIncludeTax?`inclusive`:`exclusive`,roundingScope:e.taxRounding,currency:g(e.currency),codes:I(n),appDefaultCodeId:h(n).id}).lines[0]}n=P(e).find(e=>e.id===t.id)??n}p(e)&&(N(e,t.id),n=P(e).find(e=>e.id===t.id)??n);let r=j(e);r&&N(r.invoice,t[r.invoiceFk]);for(let n of D(e.id)){let r=j(n.model);if(r&&r.payment.id===e.id)for(let e of P(n.model))e[r.paymentFk]===t.id&&N(r.invoice,e[r.invoiceFk])}return n},H=e=>{let t=[e,...D(e.id).map(e=>e.model),...A(e.id).map(e=>e.parent)];return new Map(t.map(e=>[e.id,P(e).map(e=>({...e}))]))},U=e=>{for(let[t,n]of e){let e=u.get(t);e&&e.splice(0,e.length,...n)}},G=(e,n)=>({...n,...t.defaults?.(e)??{}}),K=e=>w(`${e.id}:new:${n}:${C++}`),q=(e,t)=>Object.entries(t).every(([t,n])=>e[t]===n);return{async list(e){return P(e).map(t=>G(e,t))},async listWhere(e,t,n){return P(e).filter(e=>String(e[t]??``)===n).map(t=>G(e,t))},async get(e,t){let n=P(e).find(e=>e.id===t);return n?G(e,n):void 0},async create(e,n){let r={...t.defaults?.(e)??{},...n,id:K(e)},i=H(e);P(e).push(r);let a;try{a=V(e,r)}catch(e){throw U(i),C--,e}return R(e),{...a}},async update(e,t,n){let r=P(e),i=r.findIndex(e=>e.id===t);if(i<0)return;let a=H(e),o=r[i],s={...o,...n,id:t};r[i]=s;let c;try{if(c=V(e,s),_(e))for(let{parent:t,fk:n}of A(e.id))o[n]!==s[n]&&B(t,o[n],!0)}catch(e){throw U(a),e}return R(e),{...c}},async delete(e,t){let n=P(e),r=n.findIndex(e=>e.id===t);if(r<0)return!1;let i=H(e),[a]=n.splice(r,1);try{let t=j(e);t&&a&&N(t.invoice,a[t.invoiceFk]);for(let{parent:t,fk:n}of A(e.id))_(e)&&a&&B(t,a[n],!0)}catch(e){throw U(i),e}return R(e),!0},reset(){ie(),u.clear(),C=0,ge(b);for(let e of[...m])e()},onReset(e){return m.add(e),()=>{m.delete(e)}},async apply(e){let n=new Map,r=C,i=new Map,a=e=>{i.set(e.id,e);let t=P(e);return n.has(e.id)||n.set(e.id,t.map(e=>({...e}))),t},o={},s=e=>Object.fromEntries(Object.entries(e??{}).map(([e,t])=>{if(!Z(t))return[e,t];let n=o[t.ref];if(!n)throw Error(`Unknown record reference ${t.ref}`);return[e,t.field?n[t.field]:n.id]}));try{for(let n of e){let e=a(n.model),r=s(n.match);if(n.op===`delete`){let t=e.filter(e=>n.id===void 0?q(e,r):e.id===n.id);if(n.id===void 0&&Object.keys(r).length===0)throw Error(`A delete needs an id or a match`);for(let n of t)e.splice(e.indexOf(n),1);continue}let i=s(n.values),c=-1;if(n.id!==void 0){if(c=e.findIndex(e=>e.id===n.id),c<0)throw Error(`No ${n.model.name} with id ${n.id}`)}else Object.keys(r).length>0&&(c=e.findIndex(e=>q(e,r)));let l;if(c>=0){let t=e[c];l={...t,...i,id:t.id},e[c]=l}else l={...t.defaults?.(n.model)??{},...r,...s(n.onCreate),...i,id:K(n.model)},e.push(l);n.as&&(o[n.as]={...l})}}catch(e){for(let[e,t]of n)u.set(e,t);throw C=r,e}for(let e of i.values())R(e);return o}}}export{V as a,N as c,I as d,L as f,z as i,O as l,Z as n,P as o,M as p,D as r,F as s,_e as t,R as u};
@@ -1 +1 @@
1
- import{$ as e,Ct as t,Dt as n,E as r,Ft as i,G as a,Ot as o,U as s,a as c,ft as l,ht as u,st as d,v as f}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{t as p}from"./DKO8GXxX.js";import{nt as m}from"./BhY9m7ye.js";var h=a(`<div><a class="svelte-1fbsd8p"><!></a> <a class="svelte-1fbsd8p"><!></a></div>`);function g(a,g){o(g,!0);let _=c(g,`compact`,3,!1),v=t(()=>`${p(`/recipes/${g.section}/help/`)}${g.helpAnchor?`#${g.helpAnchor}`:``}`);var y=h();let b;var x=l(y),S=l(x);{let n=t(()=>_()?16:22);m(S,{path:`M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z`,get size(){return e(n)}})}i(x);var C=u(x,2),w=l(C);{let n=t(()=>_()?16:22);m(w,{path:`M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z`,get size(){return e(n)}})}i(C),i(y),d(t=>{b=r(y,1,`icons svelte-1fbsd8p`,null,b,{compact:_()}),f(x,`href`,e(v)),f(x,`title`,`${g.label} help`),f(x,`aria-label`,`${g.label} help`),f(x,`aria-current`,g.current===`help`?`page`:void 0),f(C,`href`,t),f(C,`title`,`${g.label} options`),f(C,`aria-label`,`${g.label} options`),f(C,`aria-current`,g.current===`options`?`page`:void 0)},[()=>p(`/recipes/${g.section}/`)]),s(a,y),n()}export{g as t};
1
+ import{$ as e,Ct as t,Dt as n,E as r,Ft as i,G as a,Ot as o,U as s,a as c,ft as l,ht as u,st as d,v as f}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{t as p}from"./JbseW4hD.js";import{nt as m}from"./CGm5iL4O.js";var h=a(`<div><a class="svelte-1fbsd8p"><!></a> <a class="svelte-1fbsd8p"><!></a></div>`);function g(a,g){o(g,!0);let _=c(g,`compact`,3,!1),v=t(()=>`${p(`/recipes/${g.section}/help/`)}${g.helpAnchor?`#${g.helpAnchor}`:``}`);var y=h();let b;var x=l(y),S=l(x);{let n=t(()=>_()?16:22);m(S,{path:`M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z`,get size(){return e(n)}})}i(x);var C=u(x,2),w=l(C);{let n=t(()=>_()?16:22);m(w,{path:`M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z`,get size(){return e(n)}})}i(C),i(y),d(t=>{b=r(y,1,`icons svelte-1fbsd8p`,null,b,{compact:_()}),f(x,`href`,e(v)),f(x,`title`,`${g.label} help`),f(x,`aria-label`,`${g.label} help`),f(x,`aria-current`,g.current===`help`?`page`:void 0),f(C,`href`,t),f(C,`title`,`${g.label} options`),f(C,`aria-label`,`${g.label} options`),f(C,`aria-current`,g.current===`options`?`page`:void 0)},[()=>p(`/recipes/${g.section}/`)]),s(a,y),n()}export{g as t};
@@ -1,4 +1,4 @@
1
- import{$ as e,A as t,B as n,Ct as r,Dt as i,E as a,F as o,Ft as s,G as c,H as l,J as u,K as d,L as f,Lt as p,Ot as m,Pt as h,R as g,Rt as _,U as v,W as y,X as b,Y as x,Z as S,_ as C,a as w,b as T,bt as E,ct as D,dt as O,ft as k,gt as A,ht as j,it as M,k as N,mt as P,n as F,o as I,pt as L,q as R,s as z,st as B,tt as V,ut as H,v as U,vt as W,xt as G,y as K,z as ee}from"./DG3qFFTE.js";import{n as q}from"./B_DUvQ2-.js";import"./xihTtKlq.js";import{i as J,r as Y}from"./BLUInGBV.js";import{a as X,t as te}from"./Bq8E3AWP.js";import{$ as ne,C as re,St as ie,X as ae,_ as oe,_t as se,a as ce,bt as le,c as ue,d as de,et as fe,f as pe,g as me,h as he,nt as ge,p as _e,q as ve,t as ye,tt as be,u as xe,ut as Se,v as Ce,yt as we}from"./DKO8GXxX.js";import{n as Z}from"./DK8Blf1Y.js";import{n as Te}from"./v8gneLl4.js";import"./BeocJqqC.js";import{u as Ee}from"./DIE02RSm.js";import{b as De,d as Oe,f as ke,l as Ae,n as je,r as Me,x as Ne}from"./CGVkRTMI.js";import"./B9-iYiTV.js";import{t as Pe}from"./0HEEaKDE.js";import{S as Fe,_ as Ie,a as Le,d as Re,f as ze,g as Be,h as Ve,m as He,n as Ue,p as We,r as Ge,t as Ke,u as qe,v as Je,x as Ye}from"./EVM4wuMZ.js";import{A as Xe,C as Ze,E as Qe,O as $e,S as et,j as tt,k as nt,n as rt,v as it,w as at,x as ot,y as st}from"./DYJvnJSH.js";import{G as ct,H as lt,M as ut,Q as dt,U as ft,W as pt,X as mt,b as ht,g as gt,h as _t,q as vt,t as yt,v as bt,x as xt}from"./BhY9m7ye.js";import{a as St,i as Ct,n as wt,r as Tt}from"./CO-Ek-HE.js";import{a as Et,c as Dt,i as Ot,l as kt,n as At}from"./P0teM5Ra.js";import{r as jt}from"./D_U_DYjx.js";import"./wpZcOjrw.js";import{t as Mt}from"./DSdlNRNs.js";import{a as Nt,d as Pt,i as Ft,l as It,o as Lt,p as Rt,r as zt,s as Bt,u as Vt}from"./BQgJ05r2.js";import{a as Ht,d as Ut,f as Wt,i as Gt,l as Kt,o as qt,p as Jt,r as Yt,s as Xt,u as Zt}from"./BgOimu0u.js";import{n as Qt}from"./CgAkqYsL.js";import{a as $t,i as en,n as tn,o as nn,r as rn,s as an,t as on}from"./BBmzhVVE.js";import{t as sn}from"./JBD5vUbP.js";function cn(e,t){return{key:t,direction:e?.key===t&&e.direction===`ascending`?`descending`:`ascending`}}var ln=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function un(e){return e==null||e===``||typeof e==`number`&&!Number.isFinite(e)}function dn(e,t){if(typeof e==`number`&&typeof t==`number`)return e-t;if(typeof e==`boolean`&&typeof t==`boolean`)return Number(e)-Number(t);let n=e instanceof Date?e.getTime():e,r=t instanceof Date?t.getTime():t;return typeof n==`number`&&typeof r==`number`?n-r:ln.compare(String(n),String(r))}function fn(e,t,n){return t?e.map((e,r)=>({row:e,index:r,value:n(e,t.key)})).sort((e,n)=>{let r=un(e.value);if(r!==un(n.value))return r?1:-1;let i=r?0:dn(e.value,n.value);return(t.direction===`ascending`?i:-i)||e.index-n.index}).map(({row:e})=>e):[...e]}var pn={name:`@happyvertical/smrt-assets`,displayName:`Assets`,description:`Provider-agnostic asset management with versioning, metadata, folders, and associations`,uiSlots:{"attachment-list":{id:`attachment-list`,label:`Attachment List`,description:`Authorized private links and supplied version history`,icon:`file-text`,category:`list`,order:8,propsInterface:`AttachmentListProps`},"attachment-upload":{id:`attachment-upload`,label:`Attachment Upload`,description:`Native multipart upload with retained request fields and recovery guidance`,icon:`upload`,category:`form`,order:9,propsInterface:`AttachmentUploadProps`},"attachment-panel":{id:`attachment-panel`,label:`Attachments`,description:`Attachment list and optional native upload composition`,icon:`file-text`,category:`display`,order:10,propsInterface:`AttachmentPanelProps`},"asset-manager":{id:`asset-manager`,label:`Asset Manager`,description:`Combined asset management surface with toolbar, grid/list view, detail, and selection`,icon:`folder-image`,category:`admin`,order:1,propsInterface:`AssetManagerProps`},"asset-grid":{id:`asset-grid`,label:`Asset Grid`,description:`Grid view of asset thumbnails with selection`,icon:`grid`,category:`list`,order:2,propsInterface:`AssetGridProps`},"asset-list":{id:`asset-list`,label:`Asset List`,description:`Sortable list view of assets with metadata columns`,icon:`list`,category:`list`,order:3,propsInterface:`AssetListProps`},"asset-detail":{id:`asset-detail`,label:`Asset Detail`,description:`Detailed view of a single asset with metadata and preview`,icon:`file-text`,category:`detail`,order:4,propsInterface:`AssetDetailProps`},"asset-toolbar":{id:`asset-toolbar`,label:`Asset Toolbar`,description:`Toolbar with view toggle, filters, sort, and upload action`,icon:`sliders`,category:`action`,order:5,propsInterface:`AssetToolbarProps`},"asset-action-bar":{id:`asset-action-bar`,label:`Asset Action Bar`,description:`Bulk action bar shown when assets are selected`,icon:`more-horizontal`,category:`action`,order:6,propsInterface:`ActionBarProps`},"asset-create-modal":{id:`asset-create-modal`,label:`Create Asset Modal`,description:`Modal dialog for uploading and creating a new asset`,icon:`upload`,category:`form`,order:7,propsInterface:`CreateAssetModalProps`}},models:[`Asset`,`AssetType`,`AssetStatus`,`AssetMetafield`,`Folder`],collections:[`AssetCollection`,`AssetTypeCollection`,`AssetStatusCollection`,`AssetMetafieldCollection`,`AssetAssociationCollection`,`FolderCollection`]},Q=X({"assets.action_bar.delete_confirm_title":`Delete {count} asset{plural}?`,"assets.action_bar.delete_confirm_message_one":`This action cannot be undone. The asset and its file data will be permanently removed.`,"assets.action_bar.delete_confirm_message_other":`This action cannot be undone. The assets and their file data will be permanently removed.`,"assets.action_bar.delete":`Delete`,"assets.action_bar.cancel":`Cancel`,"assets.asset_detail.open_pdf_in_new_tab":`Open PDF in new tab`,"assets.asset_detail.alt_text":`Alt Text`,"assets.asset_detail.alt_text_missing_warning":`⚠️ Missing — required for accessibility`,"assets.asset_detail.quick_actions":`Quick Actions`,"assets.asset_detail.copy_url":`📋 Copy URL`,"assets.asset_detail.copy_markdown":`📝 Copy Markdown`,"assets.asset_detail.edit_image":`✏️ Edit Image`,"assets.asset_detail.used_in":`Used In`,"assets.asset_detail.alt_text_placeholder":`Describe this image for screen readers`,"assets.asset_detail.description_placeholder":`Optional description`,"assets.asset_grid.loading":`Loading assets...`,"assets.asset_grid.no_assets_found":`No assets found`,"assets.asset_grid.empty_hint":`Upload an asset or change your search filters to see results.`,"assets.asset_grid.no_alt":`⚠️ No alt`,"assets.asset_grid.missing_alt_text":`Missing alt text`,"assets.asset_grid.open_named":`Open {name}`,"assets.asset_grid.select_named":`Select {name}`,"assets.asset_grid.select_named_checkbox":`Select {name}`,"assets.asset_list.loading":`Loading assets...`,"assets.asset_list.no_assets_found":`No assets found`,"assets.asset_list.empty_hint":`Upload an asset or change your search filters to see results.`,"assets.asset_list.select_all":`Select all`,"assets.asset_list.select_named":`Select {name}`,"assets.asset_manager.drop_file_to_upload":`Drop file to upload`,"assets.asset_toolbar.all_types":`All types`,"assets.asset_toolbar.newest_first":`Newest first`,"assets.asset_toolbar.oldest_first":`Oldest first`,"assets.asset_toolbar.name_a_z":`Name A–Z`,"assets.asset_toolbar.name_z_a":`Name Z–A`,"assets.asset_toolbar.recently_updated":`Recently updated`,"assets.asset_toolbar.search_placeholder":`Search assets...`,"assets.asset_toolbar.search_assets":`Search assets`,"assets.asset_toolbar.clear_search":`Clear search`,"assets.asset_toolbar.filter_by_type":`Filter by type`,"assets.asset_toolbar.sort_assets":`Sort assets`,"assets.asset_toolbar.view_mode":`View mode`,"assets.asset_toolbar.view_label":`{label} view`,"assets.create_asset_modal.dropzone_text":`Drag & drop a file here, or click to browse`,"assets.create_asset_modal.dropzone_hint":`You can also paste an image from your clipboard`,"assets.create_asset_modal.large_file_warning":`⚠️ Large file — may slow page loads`,"assets.create_asset_modal.alt_text":`Alt Text`,"assets.create_asset_modal.alt_text_recommended_warning":`⚠️ Recommended for accessibility`,"assets.create_asset_modal.name_placeholder":`Asset name`,"assets.create_asset_modal.description_placeholder":`Optional description`,"assets.create_asset_modal.alt_text_placeholder":`Describe this image for screen readers`,"assets.create_asset_modal.upload_asset":`Upload Asset`,"assets.create_asset_modal.preview_alt":`Preview`,"assets.create_asset_modal.remove_file":`Remove file`,"assets.create_asset_modal.upload_failed":`Upload failed. Please try again.`,"assets.asset_detail_preview.modal_preview":`Modal Preview`,"assets.asset_detail_preview.description":`Launch the asset detail dialog from inside the preview stage so the shared
1
+ import{$ as e,A as t,B as n,Ct as r,Dt as i,E as a,F as o,Ft as s,G as c,H as l,J as u,K as d,L as f,Lt as p,Ot as m,Pt as h,R as g,Rt as _,U as v,W as y,X as b,Y as x,Z as S,_ as C,a as w,b as T,bt as E,ct as D,dt as O,ft as k,gt as A,ht as j,it as M,k as N,mt as P,n as F,o as I,pt as L,q as R,s as z,st as B,tt as V,ut as H,v as U,vt as W,xt as G,y as K,z as ee}from"./DG3qFFTE.js";import{n as q}from"./DejeH9L2.js";import"./xihTtKlq.js";import{i as J,r as Y}from"./BLUInGBV.js";import{a as X,t as te}from"./Bq8E3AWP.js";import{$ as ne,C as re,St as ie,X as ae,_ as oe,_t as se,a as ce,bt as le,c as ue,d as de,et as fe,f as pe,g as me,h as he,nt as ge,p as _e,q as ve,t as ye,tt as be,u as xe,ut as Se,v as Ce,yt as we}from"./JbseW4hD.js";import{n as Z}from"./DK8Blf1Y.js";import{n as Te}from"./v8gneLl4.js";import"./Cp6dpm4U.js";import{u as Ee}from"./DIE02RSm.js";import{b as De,d as Oe,f as ke,l as Ae,n as je,r as Me,x as Ne}from"./CGVkRTMI.js";import"./Berfh5jP.js";import{t as Pe}from"./CXCKbdz7.js";import{S as Fe,_ as Ie,a as Le,d as Re,f as ze,g as Be,h as Ve,m as He,n as Ue,p as We,r as Ge,t as Ke,u as qe,v as Je,x as Ye}from"./BdYJ1pr6.js";import{A as Xe,C as Ze,E as Qe,O as $e,S as et,j as tt,k as nt,n as rt,v as it,w as at,x as ot,y as st}from"./C_3mHM3Z.js";import{G as ct,H as lt,M as ut,Q as dt,U as ft,W as pt,X as mt,b as ht,g as gt,h as _t,q as vt,t as yt,v as bt,x as xt}from"./CGm5iL4O.js";import{a as St,i as Ct,n as wt,r as Tt}from"./CO-Ek-HE.js";import{a as Et,c as Dt,i as Ot,l as kt,n as At}from"./Br8B1_fx.js";import{r as jt}from"./D_U_DYjx.js";import"./zXfxVHrm.js";import{t as Mt}from"./B2zXE0hq.js";import{a as Nt,d as Pt,i as Ft,l as It,o as Lt,p as Rt,r as zt,s as Bt,u as Vt}from"./51bIF3zu.js";import{a as Ht,d as Ut,f as Wt,i as Gt,l as Kt,o as qt,p as Jt,r as Yt,s as Xt,u as Zt}from"./ByYMR4Nv.js";import{n as Qt}from"./CgAkqYsL.js";import{a as $t,i as en,n as tn,o as nn,r as rn,s as an,t as on}from"./DevFsuaC.js";import{t as sn}from"./JBD5vUbP.js";function cn(e,t){return{key:t,direction:e?.key===t&&e.direction===`ascending`?`descending`:`ascending`}}var ln=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function un(e){return e==null||e===``||typeof e==`number`&&!Number.isFinite(e)}function dn(e,t){if(typeof e==`number`&&typeof t==`number`)return e-t;if(typeof e==`boolean`&&typeof t==`boolean`)return Number(e)-Number(t);let n=e instanceof Date?e.getTime():e,r=t instanceof Date?t.getTime():t;return typeof n==`number`&&typeof r==`number`?n-r:ln.compare(String(n),String(r))}function fn(e,t,n){return t?e.map((e,r)=>({row:e,index:r,value:n(e,t.key)})).sort((e,n)=>{let r=un(e.value);if(r!==un(n.value))return r?1:-1;let i=r?0:dn(e.value,n.value);return(t.direction===`ascending`?i:-i)||e.index-n.index}).map(({row:e})=>e):[...e]}var pn={name:`@happyvertical/smrt-assets`,displayName:`Assets`,description:`Provider-agnostic asset management with versioning, metadata, folders, and associations`,uiSlots:{"attachment-list":{id:`attachment-list`,label:`Attachment List`,description:`Authorized private links and supplied version history`,icon:`file-text`,category:`list`,order:8,propsInterface:`AttachmentListProps`},"attachment-upload":{id:`attachment-upload`,label:`Attachment Upload`,description:`Native multipart upload with retained request fields and recovery guidance`,icon:`upload`,category:`form`,order:9,propsInterface:`AttachmentUploadProps`},"attachment-panel":{id:`attachment-panel`,label:`Attachments`,description:`Attachment list and optional native upload composition`,icon:`file-text`,category:`display`,order:10,propsInterface:`AttachmentPanelProps`},"asset-manager":{id:`asset-manager`,label:`Asset Manager`,description:`Combined asset management surface with toolbar, grid/list view, detail, and selection`,icon:`folder-image`,category:`admin`,order:1,propsInterface:`AssetManagerProps`},"asset-grid":{id:`asset-grid`,label:`Asset Grid`,description:`Grid view of asset thumbnails with selection`,icon:`grid`,category:`list`,order:2,propsInterface:`AssetGridProps`},"asset-list":{id:`asset-list`,label:`Asset List`,description:`Sortable list view of assets with metadata columns`,icon:`list`,category:`list`,order:3,propsInterface:`AssetListProps`},"asset-detail":{id:`asset-detail`,label:`Asset Detail`,description:`Detailed view of a single asset with metadata and preview`,icon:`file-text`,category:`detail`,order:4,propsInterface:`AssetDetailProps`},"asset-toolbar":{id:`asset-toolbar`,label:`Asset Toolbar`,description:`Toolbar with view toggle, filters, sort, and upload action`,icon:`sliders`,category:`action`,order:5,propsInterface:`AssetToolbarProps`},"asset-action-bar":{id:`asset-action-bar`,label:`Asset Action Bar`,description:`Bulk action bar shown when assets are selected`,icon:`more-horizontal`,category:`action`,order:6,propsInterface:`ActionBarProps`},"asset-create-modal":{id:`asset-create-modal`,label:`Create Asset Modal`,description:`Modal dialog for uploading and creating a new asset`,icon:`upload`,category:`form`,order:7,propsInterface:`CreateAssetModalProps`}},models:[`Asset`,`AssetType`,`AssetStatus`,`AssetMetafield`,`Folder`],collections:[`AssetCollection`,`AssetTypeCollection`,`AssetStatusCollection`,`AssetMetafieldCollection`,`AssetAssociationCollection`,`FolderCollection`]},Q=X({"assets.action_bar.delete_confirm_title":`Delete {count} asset{plural}?`,"assets.action_bar.delete_confirm_message_one":`This action cannot be undone. The asset and its file data will be permanently removed.`,"assets.action_bar.delete_confirm_message_other":`This action cannot be undone. The assets and their file data will be permanently removed.`,"assets.action_bar.delete":`Delete`,"assets.action_bar.cancel":`Cancel`,"assets.asset_detail.open_pdf_in_new_tab":`Open PDF in new tab`,"assets.asset_detail.alt_text":`Alt Text`,"assets.asset_detail.alt_text_missing_warning":`⚠️ Missing — required for accessibility`,"assets.asset_detail.quick_actions":`Quick Actions`,"assets.asset_detail.copy_url":`📋 Copy URL`,"assets.asset_detail.copy_markdown":`📝 Copy Markdown`,"assets.asset_detail.edit_image":`✏️ Edit Image`,"assets.asset_detail.used_in":`Used In`,"assets.asset_detail.alt_text_placeholder":`Describe this image for screen readers`,"assets.asset_detail.description_placeholder":`Optional description`,"assets.asset_grid.loading":`Loading assets...`,"assets.asset_grid.no_assets_found":`No assets found`,"assets.asset_grid.empty_hint":`Upload an asset or change your search filters to see results.`,"assets.asset_grid.no_alt":`⚠️ No alt`,"assets.asset_grid.missing_alt_text":`Missing alt text`,"assets.asset_grid.open_named":`Open {name}`,"assets.asset_grid.select_named":`Select {name}`,"assets.asset_grid.select_named_checkbox":`Select {name}`,"assets.asset_list.loading":`Loading assets...`,"assets.asset_list.no_assets_found":`No assets found`,"assets.asset_list.empty_hint":`Upload an asset or change your search filters to see results.`,"assets.asset_list.select_all":`Select all`,"assets.asset_list.select_named":`Select {name}`,"assets.asset_manager.drop_file_to_upload":`Drop file to upload`,"assets.asset_toolbar.all_types":`All types`,"assets.asset_toolbar.newest_first":`Newest first`,"assets.asset_toolbar.oldest_first":`Oldest first`,"assets.asset_toolbar.name_a_z":`Name A–Z`,"assets.asset_toolbar.name_z_a":`Name Z–A`,"assets.asset_toolbar.recently_updated":`Recently updated`,"assets.asset_toolbar.search_placeholder":`Search assets...`,"assets.asset_toolbar.search_assets":`Search assets`,"assets.asset_toolbar.clear_search":`Clear search`,"assets.asset_toolbar.filter_by_type":`Filter by type`,"assets.asset_toolbar.sort_assets":`Sort assets`,"assets.asset_toolbar.view_mode":`View mode`,"assets.asset_toolbar.view_label":`{label} view`,"assets.create_asset_modal.dropzone_text":`Drag & drop a file here, or click to browse`,"assets.create_asset_modal.dropzone_hint":`You can also paste an image from your clipboard`,"assets.create_asset_modal.large_file_warning":`⚠️ Large file — may slow page loads`,"assets.create_asset_modal.alt_text":`Alt Text`,"assets.create_asset_modal.alt_text_recommended_warning":`⚠️ Recommended for accessibility`,"assets.create_asset_modal.name_placeholder":`Asset name`,"assets.create_asset_modal.description_placeholder":`Optional description`,"assets.create_asset_modal.alt_text_placeholder":`Describe this image for screen readers`,"assets.create_asset_modal.upload_asset":`Upload Asset`,"assets.create_asset_modal.preview_alt":`Preview`,"assets.create_asset_modal.remove_file":`Remove file`,"assets.create_asset_modal.upload_failed":`Upload failed. Please try again.`,"assets.asset_detail_preview.modal_preview":`Modal Preview`,"assets.asset_detail_preview.description":`Launch the asset detail dialog from inside the preview stage so the shared
2
2
  playground stays navigable.`,"assets.asset_detail_preview.open_asset_detail":`Open Asset Detail`,"assets.create_asset_modal_preview.modal_preview":`Modal Preview`,"assets.create_asset_modal_preview.title":`Create Asset Modal`,"assets.create_asset_modal_preview.description":`Open the upload dialog from inside the preview stage to exercise the real
3
3
  modal flow without covering the host navigation.`,"assets.create_asset_modal_preview.open_upload_modal":`Open Upload Modal`,"assets.create_asset_modal_preview.alt_text":`Alt Text`,"assets.asset_manager_route.eyebrow":`Package Route Surface`,"assets.asset_manager_route.title":`Asset Manager`,"assets.asset_manager_route.lede":`The reference route for browsing, selecting, and reviewing uploaded
4
4
  assets with the package-owned asset manager UI.`,"assets.asset_manager_route.selection_state":`Selection State`,"assets.asset_manager_route.no_assets_selected":`No assets selected.`,"assets.asset_manager_route.assets_selected":`asset{plural} selected.`,"assets.asset_manager_route.custom_action_example":`Custom Action Example`,"assets.asset_manager_route.custom_action_description":`This route keeps package-owned defaults while leaving room for app
@@ -1,2 +1,2 @@
1
- import{$ as e,B as t,Ct as n,Dt as r,Ft as i,G as a,H as o,L as s,Ot as c,Pt as l,U as u,ft as d,ht as f,mt as p,pt as m,st as h}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{At as g}from"./DKO8GXxX.js";var _=a(`<li><code class="svelte-kxkftj"><b> </b> </code></li>`),v=a(`<li class="none svelte-kxkftj">None</li>`),y=a(`<li><code class="svelte-kxkftj"> </code></li>`),b=a(`<mark class="svelte-kxkftj">AI</mark>`),x=a(`<li><code class="svelte-kxkftj"> </code> <!></li>`),S=a(`<article class="svelte-kxkftj"><h3 class="svelte-kxkftj"> </h3> <div class="grid svelte-kxkftj"><div><h4 class="svelte-kxkftj">REST routes <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">MCP tools <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">CLI commands <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">Methods <span class="svelte-kxkftj"> </span> AI-callable</h4> <ul class="svelte-kxkftj"></ul></div></div></article>`),C=a(`<p class="svelte-kxkftj">This app exposes no generated REST, MCP or CLI surface.</p>`),w=a(`<p class="lede svelte-kxkftj">For connecting other software or an AI assistant to this app. All of it is
1
+ import{$ as e,B as t,Ct as n,Dt as r,Ft as i,G as a,H as o,L as s,Ot as c,Pt as l,U as u,ft as d,ht as f,mt as p,pt as m,st as h}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{At as g}from"./JbseW4hD.js";var _=a(`<li><code class="svelte-kxkftj"><b> </b> </code></li>`),v=a(`<li class="none svelte-kxkftj">None</li>`),y=a(`<li><code class="svelte-kxkftj"> </code></li>`),b=a(`<mark class="svelte-kxkftj">AI</mark>`),x=a(`<li><code class="svelte-kxkftj"> </code> <!></li>`),S=a(`<article class="svelte-kxkftj"><h3 class="svelte-kxkftj"> </h3> <div class="grid svelte-kxkftj"><div><h4 class="svelte-kxkftj">REST routes <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">MCP tools <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">CLI commands <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">Methods <span class="svelte-kxkftj"> </span> AI-callable</h4> <ul class="svelte-kxkftj"></ul></div></div></article>`),C=a(`<p class="svelte-kxkftj">This app exposes no generated REST, MCP or CLI surface.</p>`),w=a(`<p class="lede svelte-kxkftj">For connecting other software or an AI assistant to this app. All of it is
2
2
  generated by s-m-r-t from the model; none of it was written by hand.</p> <!>`,1),T=a(`<section class="panel svelte-kxkftj" aria-label="Connect other tools"><!></section>`);function E(a,E){c(E,!0);let D=n(()=>E.models.filter(e=>e.exposed));var O=T(),k=d(O);g(k,{title:`Connect other tools`,children:(n,r)=>{var a=w(),c=f(m(a),2);s(c,17,()=>e(D),e=>e.id,(n,r)=>{var a=S(),c=d(a),m=p(c,!0),g=f(c,2),C=d(g),w=d(C),T=f(d(w)),E=p(T,!0);i(w);var D=f(w,2);s(D,21,()=>e(r).rest,e=>e.method+e.path,(t,n)=>{var r=_(),a=d(r),s=d(a),c=p(s,!0),l=f(s);i(a),i(r),h(()=>{o(c,e(n).method),o(l,` /api${e(n).path??``}`)}),u(t,r)},e=>{var t=v();u(e,t)}),i(D),i(C);var O=f(C,2),k=d(O),A=f(d(k)),j=p(A,!0);i(k);var M=f(k,2);s(M,21,()=>e(r).mcp,e=>e.name,(t,n)=>{var r=y(),a=d(r),s=p(a,!0);i(r),h(()=>o(s,e(n).name)),u(t,r)},e=>{var t=v();u(e,t)}),i(M),i(O);var N=f(O,2),P=d(N),F=f(d(P)),I=p(F,!0);i(P);var L=f(P,2);s(L,21,()=>e(r).cli,e=>e.name,(t,n)=>{var r=y(),a=d(r),s=p(a,!0);i(r),h(()=>o(s,e(n).name)),u(t,r)},e=>{var t=v();u(e,t)}),i(L),i(N);var R=f(N,2),z=d(R),B=f(d(z)),V=p(B,!0);l(),i(z);var H=f(z,2);s(H,21,()=>e(r).methods,e=>e.name,(n,r)=>{var a=x(),s=d(a),c=p(s),l=f(s,2),m=e=>{var t=b();u(e,t)};t(l,t=>{e(r).aiCallable&&t(m)}),i(a),h(t=>o(c,`${e(r).name??``}(${t??``})`),[()=>e(r).parameters.join(`, `)]),u(n,a)},e=>{var t=v();u(e,t)}),i(H),i(R),i(g),i(a),h(t=>{o(m,e(r).name),o(E,e(r).rest.length),o(j,e(r).mcp.length),o(I,e(r).cli.length),o(V,t)},[()=>e(r).methods.filter(e=>e.aiCallable).length]),u(n,a)},e=>{var t=C();u(e,t)}),u(n,a)},$$slots:{default:!0}}),i(O),u(a,O),r()}export{E as t};