@happyvertical/smrt-planner 0.57.19 → 0.57.21

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 (493) hide show
  1. package/app/404.html +23 -23
  2. package/app/_app/immutable/assets/{forms.BRdbPdvs.css → forms.Zvn0Ncy0.css} +1 -1
  3. package/app/_app/immutable/chunks/{DbPr-Y_R.js → 034gKwXK.js} +1 -1
  4. package/app/_app/immutable/chunks/{CF-iy4N9.js → 04JbAxsx.js} +1 -1
  5. package/app/_app/immutable/chunks/{3nInxoCv.js → 2CZMWuMZ.js} +1 -1
  6. package/app/_app/immutable/chunks/{Qxx7HWld.js → 9L3dNfkK.js} +2 -2
  7. package/app/_app/immutable/chunks/{B58ycq6u.js → 9S2SE2Cw.js} +1 -1
  8. package/app/_app/immutable/chunks/{DTWraE40.js → BFedypji.js} +1 -1
  9. package/app/_app/immutable/chunks/{Cn8IkTI5.js → BSQQRZLf.js} +1 -1
  10. package/app/_app/immutable/chunks/{1Uq1awDD.js → BYHjfE-b.js} +1 -1
  11. package/app/_app/immutable/chunks/{D95Ltrhv.js → BegAToqi.js} +1 -1
  12. package/app/_app/immutable/chunks/{glUGUrBl.js → BgFP_gck.js} +1 -1
  13. package/app/_app/immutable/chunks/{OH7CqE-U.js → BkqGBcp-.js} +1 -1
  14. package/app/_app/immutable/chunks/{CSvhNT33.js → BnDPWJHW.js} +1 -1
  15. package/app/_app/immutable/chunks/{B81CeftJ.js → BoVMZ9pI.js} +21 -21
  16. package/app/_app/immutable/chunks/{YUSKx8_q.js → Bq8E3AWP.js} +1 -1
  17. package/app/_app/immutable/chunks/{Cne67d4c.js → ByPF7fil.js} +1 -1
  18. package/app/_app/immutable/chunks/{0GttNSaG.js → BzjnmYMQ.js} +2 -2
  19. package/app/_app/immutable/chunks/{K9O-e-XY.js → CLRd5WcG.js} +1 -1
  20. package/app/_app/immutable/chunks/{Cptq9dTD.js → CVPUZMYa.js} +1 -1
  21. package/app/_app/immutable/chunks/{DV8QsFnv.js → CWhoR5nU.js} +3 -3
  22. package/app/_app/immutable/chunks/{B3xHH6q-.js → CY0bsyDW.js} +1 -1
  23. package/app/_app/immutable/chunks/CuBVy8LW.js +16 -0
  24. package/app/_app/immutable/chunks/CzdJFGwk.js +1 -0
  25. package/app/_app/immutable/chunks/{DmWCr2ul.js → D6hOYAW8.js} +1 -1
  26. package/app/_app/immutable/chunks/{CTz6b8sX.js → DIQNmSES.js} +1 -1
  27. package/app/_app/immutable/chunks/{BgDByODt.js → DTkJSyRi.js} +1 -1
  28. package/app/_app/immutable/chunks/{Bv5jGtB8.js → DptKR1hv.js} +1 -1
  29. package/app/_app/immutable/chunks/{BL-j01wI.js → Dr4W205w.js} +1 -1
  30. package/app/_app/immutable/chunks/{BBYjYdwL.js → Dx3XnAZJ.js} +1 -1
  31. package/app/_app/immutable/chunks/{BQbkHzk8.js → GBDr68lf.js} +1 -1
  32. package/app/_app/immutable/chunks/{G8JeRda5.js → Jx3glPjJ.js} +1 -1
  33. package/app/_app/immutable/chunks/{Cv3FXeyB.js → Qj-ZNsG3.js} +2 -2
  34. package/app/_app/immutable/chunks/SH2UaYRd.js +1 -0
  35. package/app/_app/immutable/chunks/{DBfU27Yr.js → hnmkjdq_.js} +1 -1
  36. package/app/_app/immutable/chunks/{B2aomX_k.js → icQ9pGib.js} +1 -1
  37. package/app/_app/immutable/chunks/{D_tBQk4S.js → pftg-FId.js} +1 -1
  38. package/app/_app/immutable/entry/{app.CtiuMMEF.js → app.C4dfCuTe.js} +2 -2
  39. package/app/_app/immutable/entry/start.QIp2kIYv.js +1 -0
  40. package/app/_app/immutable/nodes/{0.CoxJIO4G.js → 0.DbGVebJs.js} +1 -1
  41. package/app/_app/immutable/nodes/{1.BvqpKwaf.js → 1.DJpLE7YV.js} +1 -1
  42. package/app/_app/immutable/nodes/{10.CEltwRBa.js → 10.C3C30Jca.js} +1 -1
  43. package/app/_app/immutable/nodes/{11.DJ3womq-.js → 11.DNC2K3_K.js} +1 -1
  44. package/app/_app/immutable/nodes/{12.1DKCRq9W.js → 12.Dj1z2XfI.js} +1 -1
  45. package/app/_app/immutable/nodes/{13.Bm9LIH2r.js → 13.5N4q_ejZ.js} +1 -1
  46. package/app/_app/immutable/nodes/{14.B0zmE2Ph.js → 14.Bw0ykPLS.js} +1 -1
  47. package/app/_app/immutable/nodes/{2.BlDb4AmE.js → 2.Cgic832M.js} +3 -3
  48. package/app/_app/immutable/nodes/{3.ct99VOlW.js → 3.DJ3BxT21.js} +1 -1
  49. package/app/_app/immutable/nodes/{4.C-cw-lFZ.js → 4.Bp3luPsG.js} +1 -1
  50. package/app/_app/immutable/nodes/{5.DY71Ssxa.js → 5.6Q6245Tv.js} +1 -1
  51. package/app/_app/immutable/nodes/{6.Dy6iU6zE.js → 6.DCt1lnIa.js} +1 -1
  52. package/app/_app/immutable/nodes/{7.69phJC5H.js → 7.D0U1WRlZ.js} +1 -1
  53. package/app/_app/immutable/nodes/{8.CjTHnpj3.js → 8.BkE4jMFb.js} +1 -1
  54. package/app/_app/immutable/nodes/{9.uRTCr8p2.js → 9.DDp4tqt8.js} +1 -1
  55. package/app/_app/version.json +1 -1
  56. package/app/advanced-styles/index.html +26 -26
  57. package/app/ai/index.html +29 -29
  58. package/app/blueprint/index.html +24 -24
  59. package/app/cookbook/index.html +24 -24
  60. package/app/index.html +32 -32
  61. package/app/m/ads/AdDeliveryTier/index.html +28 -28
  62. package/app/m/ads/AdEvent/index.html +28 -28
  63. package/app/m/ads/AdFormat/index.html +28 -28
  64. package/app/m/ads/AdGroup/index.html +28 -28
  65. package/app/m/ads/AdVariation/index.html +28 -28
  66. package/app/m/analytics/AnalyticsDataStream/index.html +28 -28
  67. package/app/m/analytics/AnalyticsEvent/index.html +28 -28
  68. package/app/m/analytics/AnalyticsProperty/index.html +28 -28
  69. package/app/m/analytics/AnalyticsReport/index.html +28 -28
  70. package/app/m/approvals/ApprovalEvent/index.html +28 -28
  71. package/app/m/approvals/ApprovalPolicy/index.html +28 -28
  72. package/app/m/approvals/ApprovalRequest/index.html +28 -28
  73. package/app/m/assets/Asset/attachments/index.html +29 -29
  74. package/app/m/assets/Asset/index.html +28 -28
  75. package/app/m/assets/AssetAssociation/index.html +28 -28
  76. package/app/m/assets/AssetMetafield/index.html +28 -28
  77. package/app/m/assets/AssetStatus/index.html +28 -28
  78. package/app/m/assets/AssetType/index.html +28 -28
  79. package/app/m/assets/Folder/index.html +28 -28
  80. package/app/m/chat/AgentSession/index.html +28 -28
  81. package/app/m/chat/ChatMessage/index.html +28 -28
  82. package/app/m/chat/ChatParticipant/index.html +28 -28
  83. package/app/m/chat/ChatReaction/index.html +28 -28
  84. package/app/m/chat/ChatRoom/index.html +28 -28
  85. package/app/m/chat/ChatThread/index.html +28 -28
  86. package/app/m/chat/VoiceGatewayTurn/index.html +28 -28
  87. package/app/m/chat/VoiceSession/index.html +28 -28
  88. package/app/m/commerce/Agreement/index.html +28 -28
  89. package/app/m/commerce/Cart/index.html +28 -28
  90. package/app/m/commerce/Contract/index.html +28 -28
  91. package/app/m/commerce/ContractLineItem/index.html +28 -28
  92. package/app/m/commerce/Customer/index.html +28 -28
  93. package/app/m/commerce/DocumentTax/index.html +28 -28
  94. package/app/m/commerce/Estimate/index.html +28 -28
  95. package/app/m/commerce/Fulfillment/index.html +28 -28
  96. package/app/m/commerce/FulfillmentLineItem/index.html +28 -28
  97. package/app/m/commerce/HistoricalCustomerFunds/index.html +28 -28
  98. package/app/m/commerce/HistoricalCustomerFundsAllocation/index.html +28 -28
  99. package/app/m/commerce/HistoricalSalesLine/index.html +28 -28
  100. package/app/m/commerce/Invoice/index.html +28 -28
  101. package/app/m/commerce/InvoiceLineItem/index.html +28 -28
  102. package/app/m/commerce/Lease/index.html +28 -28
  103. package/app/m/commerce/LicenseSale/index.html +28 -28
  104. package/app/m/commerce/Order/index.html +28 -28
  105. package/app/m/commerce/Payment/index.html +28 -28
  106. package/app/m/commerce/PaymentAllocation/index.html +28 -28
  107. package/app/m/commerce/PaymentInstrument/index.html +28 -28
  108. package/app/m/commerce/PaymentIntent/index.html +28 -28
  109. package/app/m/commerce/Payout/index.html +28 -28
  110. package/app/m/commerce/ProductionOrder/index.html +28 -28
  111. package/app/m/commerce/PurchaseContract/index.html +28 -28
  112. package/app/m/commerce/PurchaseOrder/index.html +28 -28
  113. package/app/m/commerce/SalesContract/index.html +28 -28
  114. package/app/m/commerce/SupplierQuote/index.html +28 -28
  115. package/app/m/commerce/TaxCode/index.html +28 -28
  116. package/app/m/commerce/TaxComponent/index.html +28 -28
  117. package/app/m/commerce/TaxSettings/index.html +28 -28
  118. package/app/m/commerce/TaxSummaryReport/index.html +28 -28
  119. package/app/m/commerce/TenantPaymentAccount/index.html +28 -28
  120. package/app/m/commerce/Vendor/index.html +28 -28
  121. package/app/m/commerce/WholesaleOrder/index.html +28 -28
  122. package/app/m/content/Content/index.html +28 -28
  123. package/app/m/content/ContentContribution/index.html +28 -28
  124. package/app/m/content/ContentContributionAttachment/index.html +28 -28
  125. package/app/m/content/ContentContributionRevision/index.html +28 -28
  126. package/app/m/content/ContentContributionType/index.html +28 -28
  127. package/app/m/content/ContentContributor/index.html +28 -28
  128. package/app/m/content/ContentCorrection/index.html +28 -28
  129. package/app/m/content/ContentFeedSource/index.html +28 -28
  130. package/app/m/content/ContentGovernanceAssignment/index.html +28 -28
  131. package/app/m/content/ContentGovernancePolicy/index.html +28 -28
  132. package/app/m/content/ContentGovernanceProfile/index.html +28 -28
  133. package/app/m/content/ContentReference/index.html +28 -28
  134. package/app/m/content/ContentReview/index.html +28 -28
  135. package/app/m/content/ContentVersion/index.html +28 -28
  136. package/app/m/events/Event/index.html +28 -28
  137. package/app/m/events/EventParticipant/index.html +28 -28
  138. package/app/m/events/EventSeries/index.html +28 -28
  139. package/app/m/events/EventType/index.html +28 -28
  140. package/app/m/expenses/Expense/index.html +28 -28
  141. package/app/m/facts/Fact/index.html +28 -28
  142. package/app/m/facts/FactContent/index.html +28 -28
  143. package/app/m/facts/FactEvidence/index.html +28 -28
  144. package/app/m/facts/FactSource/index.html +28 -28
  145. package/app/m/facts/FactSubject/index.html +28 -28
  146. package/app/m/facts/FactTag/index.html +28 -28
  147. package/app/m/fields/FieldPolicy/index.html +28 -28
  148. package/app/m/fields/FieldPolicySuggestion/index.html +28 -28
  149. package/app/m/fields/FieldUsageCounter/index.html +28 -28
  150. package/app/m/images/Image/index.html +28 -28
  151. package/app/m/inventory/InventoryLocation/index.html +28 -28
  152. package/app/m/inventory/Lot/index.html +28 -28
  153. package/app/m/inventory/LotCorrection/index.html +28 -28
  154. package/app/m/inventory/LotDocument/index.html +28 -28
  155. package/app/m/inventory/LotStockLevel/index.html +28 -28
  156. package/app/m/inventory/LotUsage/index.html +28 -28
  157. package/app/m/inventory/StockLevel/index.html +28 -28
  158. package/app/m/inventory/StockMovement/index.html +28 -28
  159. package/app/m/ledgers/Account/index.html +28 -28
  160. package/app/m/ledgers/Journal/index.html +28 -28
  161. package/app/m/ledgers/JournalEntry/index.html +28 -28
  162. package/app/m/ledgers/Ledger/index.html +28 -28
  163. package/app/m/manufacturing/Assembly/index.html +28 -28
  164. package/app/m/manufacturing/BillOfMaterials/index.html +28 -28
  165. package/app/m/manufacturing/BomLine/index.html +28 -28
  166. package/app/m/manufacturing/Operation/index.html +28 -28
  167. package/app/m/manufacturing/ProductionRun/index.html +28 -28
  168. package/app/m/manufacturing/ProductionRunCompletion/index.html +28 -28
  169. package/app/m/manufacturing/RoutingStep/index.html +28 -28
  170. package/app/m/marketing/Campaign/index.html +28 -28
  171. package/app/m/marketing/CampaignChannel/index.html +28 -28
  172. package/app/m/marketing/CampaignMetricSnapshot/index.html +28 -28
  173. package/app/m/messages/Account/index.html +28 -28
  174. package/app/m/messages/Attachment/index.html +28 -28
  175. package/app/m/messages/Blacklist/index.html +28 -28
  176. package/app/m/messages/Email/failed-sends/index.html +29 -29
  177. package/app/m/messages/Email/index.html +28 -28
  178. package/app/m/messages/Email/mailbox/index.html +29 -29
  179. package/app/m/messages/EmailAccount/index.html +28 -28
  180. package/app/m/messages/EmailAttachment/index.html +28 -28
  181. package/app/m/messages/EmailFolder/index.html +28 -28
  182. package/app/m/messages/Message/index.html +28 -28
  183. package/app/m/messages/MessagingEndpoint/index.html +28 -28
  184. package/app/m/messages/PersonaMessageRoute/index.html +28 -28
  185. package/app/m/messages/SlackAccount/index.html +28 -28
  186. package/app/m/messages/SlackMessage/index.html +28 -28
  187. package/app/m/messages/TelegramAccount/index.html +28 -28
  188. package/app/m/messages/Tweet/index.html +28 -28
  189. package/app/m/messages/TwitterAccount/index.html +28 -28
  190. package/app/m/messages/Whitelist/index.html +28 -28
  191. package/app/m/messages/ZulipAccount/index.html +28 -28
  192. package/app/m/places/Place/index.html +28 -28
  193. package/app/m/places/PlaceType/index.html +28 -28
  194. package/app/m/products/Category/index.html +28 -28
  195. package/app/m/products/Material/index.html +28 -28
  196. package/app/m/products/Product/index.html +28 -28
  197. package/app/m/products/Product/ingredients/index.html +29 -29
  198. package/app/m/products/ProductVariant/index.html +28 -28
  199. package/app/m/products/Sku/index.html +28 -28
  200. package/app/m/profiles/ApiKey/index.html +28 -28
  201. package/app/m/profiles/Bot/index.html +28 -28
  202. package/app/m/profiles/MagicLinkToken/index.html +28 -28
  203. package/app/m/profiles/NostrIdentity/index.html +28 -28
  204. package/app/m/profiles/OidcIdentity/index.html +28 -28
  205. package/app/m/profiles/Organization/index.html +28 -28
  206. package/app/m/profiles/Person/index.html +28 -28
  207. package/app/m/profiles/Profile/index.html +28 -28
  208. package/app/m/profiles/ProfileMetadata/index.html +28 -28
  209. package/app/m/profiles/ProfileMetafield/index.html +28 -28
  210. package/app/m/profiles/ProfileRelationship/index.html +28 -28
  211. package/app/m/profiles/ProfileRelationshipTerm/index.html +28 -28
  212. package/app/m/profiles/ProfileRelationshipType/index.html +28 -28
  213. package/app/m/profiles/ProfileType/index.html +28 -28
  214. package/app/m/projects/Comment/index.html +28 -28
  215. package/app/m/projects/Issue/index.html +28 -28
  216. package/app/m/projects/Label/index.html +28 -28
  217. package/app/m/projects/Project/index.html +28 -28
  218. package/app/m/projects/ProjectIntegration/index.html +28 -28
  219. package/app/m/projects/PullRequest/index.html +28 -28
  220. package/app/m/projects/Repository/index.html +28 -28
  221. package/app/m/properties/Property/index.html +28 -28
  222. package/app/m/properties/Zone/index.html +28 -28
  223. package/app/m/reports/RuntimeReport/index.html +28 -28
  224. package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +28 -28
  225. package/app/m/reports/SmrtReportLock/index.html +28 -28
  226. package/app/m/reports/SmrtReportRefreshTask/index.html +28 -28
  227. package/app/m/reports/SmrtReportRun/index.html +28 -28
  228. package/app/m/reports/SmrtReportSchedule/index.html +28 -28
  229. package/app/m/reports/SmrtReportWatermark/index.html +28 -28
  230. package/app/m/sales/Agreement/index.html +28 -28
  231. package/app/m/sales/AttributionException/index.html +28 -28
  232. package/app/m/sales/AttributionPolicy/index.html +28 -28
  233. package/app/m/sales/Commission/index.html +28 -28
  234. package/app/m/sales/CommissionAdjustment/index.html +28 -28
  235. package/app/m/sales/CommissionPayout/index.html +28 -28
  236. package/app/m/sales/CommissionPlan/index.html +28 -28
  237. package/app/m/sales/Earner/index.html +28 -28
  238. package/app/m/sales/EarnerSourceAttribution/index.html +28 -28
  239. package/app/m/sales/EarningEvent/index.html +28 -28
  240. package/app/m/sales/ExecutedAgreement/index.html +28 -28
  241. package/app/m/sales/Lead/index.html +28 -28
  242. package/app/m/sales/Opportunity/index.html +28 -28
  243. package/app/m/sales/OpportunityConversion/index.html +28 -28
  244. package/app/m/sales/PipelineDefinition/index.html +28 -28
  245. package/app/m/sales/PipelineStage/index.html +28 -28
  246. package/app/m/sales/Referral/index.html +28 -28
  247. package/app/m/sales/ReferralAgreement/index.html +28 -28
  248. package/app/m/sales/ReferralLink/index.html +28 -28
  249. package/app/m/sales/ReferralProgram/index.html +28 -28
  250. package/app/m/sales/ReferralTermSnapshot/index.html +28 -28
  251. package/app/m/sales/ReferralTouch/index.html +28 -28
  252. package/app/m/sales/Referrer/index.html +28 -28
  253. package/app/m/sales/SalesActivity/index.html +28 -28
  254. package/app/m/sales/SalesRepresentative/index.html +28 -28
  255. package/app/m/sites/Site/index.html +28 -28
  256. package/app/m/sites/SiteAgentBinding/index.html +28 -28
  257. package/app/m/social/OAuthState/index.html +28 -28
  258. package/app/m/social/SocialAccount/index.html +28 -28
  259. package/app/m/social/SocialPost/index.html +28 -28
  260. package/app/m/social/SocialPostAnalyticsSnapshot/index.html +28 -28
  261. package/app/m/subscriptions/BillingAdjustment/index.html +28 -28
  262. package/app/m/subscriptions/ClientCharge/index.html +28 -28
  263. package/app/m/subscriptions/CreditGrant/index.html +28 -28
  264. package/app/m/subscriptions/PricingRule/index.html +28 -28
  265. package/app/m/subscriptions/RetailCharge/index.html +28 -28
  266. package/app/m/subscriptions/SpendingPolicy/index.html +28 -28
  267. package/app/m/subscriptions/SubscriptionPlan/index.html +28 -28
  268. package/app/m/subscriptions/SubscriptionPlanVersion/index.html +28 -28
  269. package/app/m/subscriptions/TenantSubscription/index.html +28 -28
  270. package/app/m/subscriptions/TenantUsageMetric/index.html +28 -28
  271. package/app/m/support/ServiceTimeEntry/index.html +28 -28
  272. package/app/m/support/SupportAiRun/index.html +28 -28
  273. package/app/m/support/SupportAvailability/index.html +28 -28
  274. package/app/m/support/SupportCase/index.html +28 -28
  275. package/app/m/support/SupportCaseEvent/index.html +28 -28
  276. package/app/m/support/SupportChannelBinding/index.html +28 -28
  277. package/app/m/support/SupportCharge/index.html +28 -28
  278. package/app/m/support/SupportCompensation/index.html +28 -28
  279. package/app/m/support/SupportCompensationPlan/index.html +28 -28
  280. package/app/m/support/SupportEscalation/index.html +28 -28
  281. package/app/m/support/SupportInteraction/index.html +28 -28
  282. package/app/m/support/SupportPlan/index.html +28 -28
  283. package/app/m/support/SupportPolicy/index.html +28 -28
  284. package/app/m/support/SupportQualification/index.html +28 -28
  285. package/app/m/support/SupportServiceTarget/index.html +28 -28
  286. package/app/m/support/SupportSpecialist/index.html +28 -28
  287. package/app/m/support/SupportWorkLink/index.html +28 -28
  288. package/app/m/tags/Tag/index.html +28 -28
  289. package/app/m/tags/TagAlias/index.html +28 -28
  290. package/app/m/timesheets/AttendanceBreak/index.html +28 -28
  291. package/app/m/timesheets/AttendancePunch/index.html +28 -28
  292. package/app/m/timesheets/AttendanceSegment/index.html +28 -28
  293. package/app/m/timesheets/ServiceChargeSnapshot/index.html +28 -28
  294. package/app/m/timesheets/ServiceCompensationSnapshot/index.html +28 -28
  295. package/app/m/timesheets/ServiceTimeEntry/index.html +28 -28
  296. package/app/m/users/Group/index.html +28 -28
  297. package/app/m/users/GroupMember/index.html +28 -28
  298. package/app/m/users/GroupRole/index.html +28 -28
  299. package/app/m/users/Membership/index.html +28 -28
  300. package/app/m/users/MembershipOverride/index.html +28 -28
  301. package/app/m/users/Permission/index.html +28 -28
  302. package/app/m/users/Role/index.html +28 -28
  303. package/app/m/users/RolePermission/index.html +28 -28
  304. package/app/m/users/Session/index.html +28 -28
  305. package/app/m/users/Tenant/index.html +28 -28
  306. package/app/m/users/TenantIntegration/index.html +28 -28
  307. package/app/m/users/TenantPermissionOverride/index.html +28 -28
  308. package/app/m/users/User/index.html +28 -28
  309. package/app/m/video/Character/index.html +28 -28
  310. package/app/m/video/CharacterAsset/index.html +28 -28
  311. package/app/m/video/CompositeJob/index.html +28 -28
  312. package/app/m/video/Performer/index.html +28 -28
  313. package/app/m/video/PerformerAsset/index.html +28 -28
  314. package/app/m/video/Scene/index.html +28 -28
  315. package/app/m/video/SceneAsset/index.html +28 -28
  316. package/app/m/video/VideoComposition/index.html +28 -28
  317. package/app/m/video/VideoCompositionAsset/index.html +28 -28
  318. package/app/m/video/VideoSequence/index.html +28 -28
  319. package/app/m/video/VideoSequenceAsset/index.html +28 -28
  320. package/app/m/video/VideoShot/index.html +28 -28
  321. package/app/m/video/VideoShotAsset/index.html +28 -28
  322. package/app/m/video/VideoShotCharacter/index.html +28 -28
  323. package/app/m/video/VideoWorkflow/index.html +28 -28
  324. package/app/m/voice/VoiceOutput/index.html +28 -28
  325. package/app/m/voice/VoiceProfile/index.html +28 -28
  326. package/app/m/voice/VoiceSample/index.html +28 -28
  327. package/app/mcp.html +2 -2
  328. package/app/packages/ads/index.html +26 -26
  329. package/app/packages/analytics/index.html +26 -26
  330. package/app/packages/approvals/index.html +26 -26
  331. package/app/packages/assets/index.html +26 -26
  332. package/app/packages/chat/index.html +26 -26
  333. package/app/packages/comments/index.html +26 -26
  334. package/app/packages/commerce/index.html +26 -26
  335. package/app/packages/content/index.html +26 -26
  336. package/app/packages/events/index.html +26 -26
  337. package/app/packages/expenses/index.html +26 -26
  338. package/app/packages/facts/index.html +26 -26
  339. package/app/packages/fields/index.html +26 -26
  340. package/app/packages/human-resources/index.html +26 -26
  341. package/app/packages/images/index.html +26 -26
  342. package/app/packages/index.html +25 -25
  343. package/app/packages/ingestion/index.html +26 -26
  344. package/app/packages/inventory/index.html +26 -26
  345. package/app/packages/ledgers/index.html +26 -26
  346. package/app/packages/manufacturing/index.html +26 -26
  347. package/app/packages/marketing/index.html +26 -26
  348. package/app/packages/messages/index.html +26 -26
  349. package/app/packages/places/index.html +26 -26
  350. package/app/packages/preferences/index.html +26 -26
  351. package/app/packages/products/index.html +26 -26
  352. package/app/packages/profiles/index.html +26 -26
  353. package/app/packages/projects/index.html +26 -26
  354. package/app/packages/properties/index.html +26 -26
  355. package/app/packages/reports/index.html +26 -26
  356. package/app/packages/sales/index.html +26 -26
  357. package/app/packages/sites/index.html +26 -26
  358. package/app/packages/social/index.html +26 -26
  359. package/app/packages/subscriptions/index.html +26 -26
  360. package/app/packages/support/index.html +26 -26
  361. package/app/packages/tags/index.html +26 -26
  362. package/app/packages/timesheets/index.html +26 -26
  363. package/app/packages/users/index.html +26 -26
  364. package/app/packages/video/index.html +26 -26
  365. package/app/packages/voice/index.html +26 -26
  366. package/app/packages/webhooks/index.html +26 -26
  367. package/app/recipes/account-access/help/index.html +26 -26
  368. package/app/recipes/account-access/index.html +28 -28
  369. package/app/recipes/activity/help/index.html +26 -26
  370. package/app/recipes/activity/index.html +28 -28
  371. package/app/recipes/agreements/help/index.html +26 -26
  372. package/app/recipes/agreements/index.html +28 -28
  373. package/app/recipes/analytics.reports/help/index.html +26 -26
  374. package/app/recipes/analytics.reports/index.html +28 -28
  375. package/app/recipes/assets/help/index.html +26 -26
  376. package/app/recipes/assets/index.html +28 -28
  377. package/app/recipes/billing/help/index.html +26 -26
  378. package/app/recipes/billing/index.html +28 -28
  379. package/app/recipes/chat.assistant/help/index.html +26 -26
  380. package/app/recipes/chat.assistant/index.html +28 -28
  381. package/app/recipes/comments/help/index.html +26 -26
  382. package/app/recipes/comments/index.html +28 -28
  383. package/app/recipes/commerce.customers/help/index.html +26 -26
  384. package/app/recipes/commerce.customers/index.html +28 -28
  385. package/app/recipes/commerce.estimates/help/index.html +26 -26
  386. package/app/recipes/commerce.estimates/index.html +28 -28
  387. package/app/recipes/commerce.purchases/help/index.html +26 -26
  388. package/app/recipes/commerce.purchases/index.html +28 -28
  389. package/app/recipes/commerce.sales/help/index.html +26 -26
  390. package/app/recipes/commerce.sales/index.html +28 -28
  391. package/app/recipes/commerce.vendors/help/index.html +26 -26
  392. package/app/recipes/commerce.vendors/index.html +28 -28
  393. package/app/recipes/commerce.wholesale/help/index.html +26 -26
  394. package/app/recipes/commerce.wholesale/index.html +28 -28
  395. package/app/recipes/events.calendar/help/index.html +26 -26
  396. package/app/recipes/events.calendar/index.html +28 -28
  397. package/app/recipes/expenses.tracking/help/index.html +26 -26
  398. package/app/recipes/expenses.tracking/index.html +28 -28
  399. package/app/recipes/fields.form-customization/help/index.html +26 -26
  400. package/app/recipes/fields.form-customization/index.html +28 -28
  401. package/app/recipes/ingestion/help/index.html +26 -26
  402. package/app/recipes/ingestion/index.html +28 -28
  403. package/app/recipes/integrations/help/index.html +26 -26
  404. package/app/recipes/integrations/index.html +28 -28
  405. package/app/recipes/inventory.stock/help/index.html +26 -26
  406. package/app/recipes/inventory.stock/index.html +28 -28
  407. package/app/recipes/ledgers.bookkeeping/help/index.html +26 -26
  408. package/app/recipes/ledgers.bookkeeping/index.html +28 -28
  409. package/app/recipes/messages/help/index.html +26 -26
  410. package/app/recipes/messages/index.html +28 -28
  411. package/app/recipes/products/help/index.html +26 -26
  412. package/app/recipes/products/index.html +28 -28
  413. package/app/recipes/projects.tracker/help/index.html +26 -26
  414. package/app/recipes/projects.tracker/index.html +28 -28
  415. package/app/recipes/reports.materialized/help/index.html +26 -26
  416. package/app/recipes/reports.materialized/index.html +28 -28
  417. package/app/recipes/reports.runtime/help/index.html +26 -26
  418. package/app/recipes/reports.runtime/index.html +28 -28
  419. package/app/recipes/sales.pipeline/help/index.html +26 -26
  420. package/app/recipes/sales.pipeline/index.html +28 -28
  421. package/app/recipes/tags.taxonomy/help/index.html +26 -26
  422. package/app/recipes/tags.taxonomy/index.html +28 -28
  423. package/app/recipes/team-collaboration/help/index.html +26 -26
  424. package/app/recipes/team-collaboration/index.html +28 -28
  425. package/app/recipes/timesheets.time-entries/help/index.html +26 -26
  426. package/app/recipes/timesheets.time-entries/index.html +28 -28
  427. package/app/s/custom-accounts/index.html +24 -24
  428. package/app/s/custom-appointments/index.html +24 -24
  429. package/app/s/custom-billing/index.html +24 -24
  430. package/app/s/custom-bookings/index.html +24 -24
  431. package/app/s/custom-buying/index.html +24 -24
  432. package/app/s/custom-checkout/index.html +24 -24
  433. package/app/s/custom-classes/index.html +24 -24
  434. package/app/s/custom-clients/index.html +24 -24
  435. package/app/s/custom-events/index.html +24 -24
  436. package/app/s/custom-fleet/index.html +24 -24
  437. package/app/s/custom-gigs/index.html +24 -24
  438. package/app/s/custom-giving/index.html +24 -24
  439. package/app/s/custom-instruments/index.html +24 -24
  440. package/app/s/custom-jobs/index.html +24 -24
  441. package/app/s/custom-kitchen/index.html +24 -24
  442. package/app/s/custom-lessons/index.html +24 -24
  443. package/app/s/custom-material/index.html +24 -24
  444. package/app/s/custom-meetings/index.html +24 -24
  445. package/app/s/custom-members/index.html +24 -24
  446. package/app/s/custom-merch/index.html +24 -24
  447. package/app/s/custom-money/index.html +24 -24
  448. package/app/s/custom-paint/index.html +24 -24
  449. package/app/s/custom-parts/index.html +24 -24
  450. package/app/s/custom-rentals/index.html +24 -24
  451. package/app/s/custom-roastery/index.html +24 -24
  452. package/app/s/custom-schedule/index.html +24 -24
  453. package/app/s/custom-shelf/index.html +24 -24
  454. package/app/s/custom-shop/index.html +24 -24
  455. package/app/s/custom-students/index.html +24 -24
  456. package/app/s/custom-wholesale/index.html +24 -24
  457. package/app/s/custom-work/index.html +24 -24
  458. package/app/s/custom-yard/index.html +24 -24
  459. package/app/s/section-access-control/index.html +24 -24
  460. package/app/s/section-account-security/index.html +24 -24
  461. package/app/s/section-accounting/index.html +24 -24
  462. package/app/s/section-activity/index.html +24 -24
  463. package/app/s/section-agreements/index.html +24 -24
  464. package/app/s/section-analytics/index.html +24 -24
  465. package/app/s/section-assets/index.html +24 -24
  466. package/app/s/section-billing/index.html +24 -24
  467. package/app/s/section-calendar/index.html +24 -24
  468. package/app/s/section-catalog/index.html +24 -24
  469. package/app/s/section-chat.assistant/index.html +24 -24
  470. package/app/s/section-comments/index.html +24 -24
  471. package/app/s/section-fields.form-customization/index.html +24 -24
  472. package/app/s/section-ingestion/index.html +24 -24
  473. package/app/s/section-integrations/index.html +24 -24
  474. package/app/s/section-messages/index.html +24 -24
  475. package/app/s/section-more/index.html +24 -24
  476. package/app/s/section-operations/index.html +24 -24
  477. package/app/s/section-projects/index.html +24 -24
  478. package/app/s/section-purchasing/index.html +24 -24
  479. package/app/s/section-reports.materialized/index.html +24 -24
  480. package/app/s/section-reports.runtime/index.html +24 -24
  481. package/app/s/section-sales/index.html +24 -24
  482. package/app/s/section-taxonomy/index.html +24 -24
  483. package/app/s/section-team/index.html +24 -24
  484. package/app/s/section-work/index.html +24 -24
  485. package/dist/catalog/catalog.json +634 -39
  486. package/dist/planner/instance.d.ts +1 -1
  487. package/dist/smrt-version.d.ts +1 -1
  488. package/dist/smrt-version.js +1 -1
  489. package/package.json +54 -54
  490. package/app/_app/immutable/chunks/BoTniyTY.js +0 -1
  491. package/app/_app/immutable/chunks/CGILVblc.js +0 -16
  492. package/app/_app/immutable/chunks/DjWoxxBo.js +0 -1
  493. package/app/_app/immutable/entry/start.DZqoRv5o.js +0 -1
@@ -1 +1 @@
1
- import{$ as e,Et as t,bt as n,gt as r,kt as i,vt as a}from"./DG3qFFTE.js";var o=new Map;function s(e){let t={};for(let[n,r]of Object.entries(e)){if(!n||n.trim()===``)throw Error(`defineMessages: message keys must be non-empty`);let e=o.get(n);if(e!==void 0&&e!==r)throw Error(`defineMessages: message "${n}" is already registered with a different default`);o.set(n,r),t[n]=n}return t}function c(e){return o.get(e)}var l=s({"ui.calendar.previous_month":`Previous month`,"ui.calendar.next_month":`Next month`,"ui.calendar.select_month":`Select month`,"ui.calendar.select_year":`Select year`,"ui.calendar.previous_week":`Previous week`,"ui.calendar.next_week":`Next week`,"ui.calendar.nothing_week":`Nothing scheduled this week`,"ui.calendar.today":`Today`,"ui.calendar.more":`+{count} more`,"ui.calendar.more_short":`+{count}`,"ui.calendar.all_day":`All day`,"ui.calendar.until":`Until {date}`,"ui.calendar.items_one":`1 item`,"ui.calendar.items_other":`{count} items`,"ui.calendar.nothing_day":`Nothing scheduled`,"ui.calendar.nothing_month":`Nothing scheduled this month`,"ui.calendar.days_in":`Days in {month}`,"ui.calendar.close_day":`Close {date}`,"ui.day_view.back_to_calendar":`Back to Calendar`,"ui.day_view.no_events":`No events scheduled for this day`,"ui.modal.close":`Close modal`,"ui.phone_sheet.close":`Close {title}`,"ui.working_strip.working":`Working…`,"ui.working_strip.done":`Done`,"ui.working_strip.open":`Open`,"ui.working_strip.stop":`Stop`,"ui.working_strip.paused":`Paused`,"ui.working_strip.waiting":`Waiting for you`,"ui.working_strip.failed":`Couldn't finish`,"ui.working_strip.cancelled":`Stopped`,"ui.working_strip.pause":`Pause`,"ui.working_strip.resume":`Continue`,"ui.working_strip.review":`Review`,"ui.working_strip.dismiss":`Close`,"ui.form_action_bar.label":`Form actions`,"ui.dictation.start":`Speak instead of typing`,"ui.dictation.start_hint":`Speak instead of typing. You can also press and hold the text box.`,"ui.dictation.start_hands_free":`Speak instead of typing, hands-free. It writes each sentence down when you pause.`,"ui.dictation.stop":`Stop listening`,"ui.dictation.listening_hands_free":`Listening. Just talk; I write it down when you pause. Tap the microphone when you are done.`,"ui.dictation.listening_short":`Listening`,"ui.dictation.hearing":`Hearing you…`,"ui.dictation.sending":`Sending…`,"ui.dictation.paused_speaking":`Paused while the assistant speaks`,"ui.dictation.starting":`Getting the microphone ready…`,"ui.dictation.listening":`Listening. Tap the microphone when you are done.`,"ui.dictation.unsupported":`Speech recognition isn't available in this browser. Brave blocks it; try Chrome, Edge or Safari, or type instead.`,"ui.dictation.denied":`The microphone is blocked. Allow it for this site in your browser settings, then try again.`,"ui.dictation.no_speech":`Didn't hear anything. Tap the mic and try again.`,"ui.dictation.microphone":`Couldn't use the microphone. Check that one is connected and no other app is using it, then try again.`,"ui.dictation.interrupted":`Listening stopped straight away. This browser may not support speaking into text; try Chrome, Edge or Safari, or type instead.`,"ui.dictation.failed":`Listening stopped. Tap the microphone to try again.`,"ui.dictation.transcribing":`Writing it down…`,"ui.dictation.too_long":`That was too long to write down. Try a shorter message, or type instead.`,"ui.dictation.not_transcribed":`Couldn't write that down. Tap the microphone to try again, or type instead.`,"ui.dictation.unavailable":`Speaking isn't set up here yet. Please type instead.`,"ui.dictation.model_missing":`The speech model isn't downloaded yet. Download it first, or type instead.`,"ui.dictation.forbidden":`You can't use speaking here. Please type instead.`,"ui.progress_bar.label":`Progress`,"ui.progress_bar.over_by":`Over by {amount}`,"ui.footer.all_rights_reserved":`All rights reserved.`,"ui.masthead.home":`Home`,"ui.masthead.primary_nav":`Primary`,"ui.masthead.mobile_nav":`Mobile`,"ui.membership_card.change_role":`Change Role`,"ui.membership_list.loading":`Loading memberships...`,"ui.module_panel.component_not_registered":`Component not registered`,"ui.module_panel.register_hint":`Import the module's Svelte package to register components.`,"ui.pagination.first_page":`First page`,"ui.pagination.previous_page":`Previous page`,"ui.pagination.page_current":`Page {page}, current`,"ui.pagination.go_to_page":`Go to page {page}`,"ui.pagination.next_page":`Next page`,"ui.pagination.last_page":`Last page ({totalPages})`,"ui.reaction_picker.label":`Add reaction`,"ui.reaction_picker.react_with":`React with {emoji}`,"ui.camera_capture.region":`Camera`,"ui.camera_capture.preview":`Live camera preview`,"ui.camera_capture.starting":`Starting camera…`,"ui.camera_capture.off":`The camera is off.`,"ui.camera_capture.unsupported":`This browser cannot use the camera. Open this page over HTTPS in a current browser.`,"ui.camera_capture.permission_denied":`Camera access was denied. Allow camera access for this site, then try again.`,"ui.camera_capture.no_camera":`No camera was found on this device.`,"ui.camera_capture.error":`Could not access the camera.`,"ui.camera_capture.retry":`Try again`,"ui.camera_capture.capture":`Take photo`,"ui.camera_capture.retake":`Retake`,"ui.camera_capture.use_photo":`Use photo`,"ui.camera_capture.review_alt":`Captured photo, not yet used`,"ui.camera_capture.committed_alt":`Attached photo`,"ui.camera_capture.committed":`Photo attached.`,"ui.camera_capture.choose_photo":`Take or choose a photo`,"ui.signature_pad.region":`Signature`,"ui.signature_pad.canvas_empty":`Signature area, not yet signed`,"ui.signature_pad.canvas_signed":`Signature area, signed`,"ui.signature_pad.hint_any":`Sign with a stylus, your finger, or the mouse.`,"ui.signature_pad.hint_stylus":`Sign with the stylus.`,"ui.signature_pad.clear":`Clear`,"ui.signature_pad.use_signature":`Use signature`,"ui.signature_pad.committed":`Signature attached.`,"ui.staged_control_review.region":`Review proposed changes`,"ui.staged_control_review.heading":`Proposed changes`,"ui.staged_control_review.description":`Review changes before they update the form.`,"ui.staged_control_review.proposed_by":`Proposed by`,"ui.staged_control_review.staged_at":`staged`,"ui.staged_control_review.before":`Current`,"ui.staged_control_review.after":`Proposed`,"ui.staged_control_review.redacted":`Hidden for privacy`,"ui.staged_control_review.stale":`The field changed after this proposal was staged.`,"ui.staged_control_review.invalid":`This proposal is not valid.`,"ui.staged_control_review.apply":`Apply`,"ui.staged_control_review.discard":`Discard`,"ui.staged_control_review.apply_all":`Apply valid changes`,"ui.staged_control_review.discard_all":`Discard valid changes`,"ui.staged_control_review.edit":`Edit proposed value for`,"ui.staged_control_review.applied_status":`Applied proposed change.`,"ui.staged_control_review.discarded_status":`Discarded proposed change.`,"ui.staged_control_review.batch_status":`Processed {completed} of {total} proposed changes.`});function u(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function d(e,t){return!t||Object.keys(t).length===0?e:e.replace(/\{([^{}]+)\}/g,(e,n)=>{let r=t[n.trim()];if(r==null)return``;if(r instanceof Date)return r.toISOString();if(Array.isArray(r)||u(r))try{return JSON.stringify(r)}catch{return``}return String(r)})}var f=class{#e=n(`en`);#t=n(r({}));constructor(e){e?.locale&&a(this.#e,e.locale,!0),e?.messages&&a(this.#t,e.messages,!0)}get locale(){return e(this.#e)}set snapshot(e){a(this.#e,e.locale,!0),a(this.#t,e.messages,!0)}t=(t,n)=>d(e(this.#t)[t]??c(t)??t,n)},p=Symbol(`smrt-i18n`);function m(e){return new f(e)}function h(e){return i(p,e)}function g(){return t(p)??null}var _=null;function v(){return g()||(_||=new f,_)}function y(){return v()}export{s as a,l as i,m as n,h as r,y as t};
1
+ import{$ as e,Et as t,bt as n,gt as r,kt as i,vt as a}from"./DG3qFFTE.js";var o=new Map;function s(e){let t={};for(let[n,r]of Object.entries(e)){if(!n||n.trim()===``)throw Error(`defineMessages: message keys must be non-empty`);let e=o.get(n);if(e!==void 0&&e!==r)throw Error(`defineMessages: message "${n}" is already registered with a different default`);o.set(n,r),t[n]=n}return t}function c(e){return o.get(e)}var l=s({"ui.calendar.previous_month":`Previous month`,"ui.calendar.next_month":`Next month`,"ui.calendar.select_month":`Select month`,"ui.calendar.select_year":`Select year`,"ui.calendar.previous_week":`Previous week`,"ui.calendar.next_week":`Next week`,"ui.calendar.nothing_week":`Nothing scheduled this week`,"ui.calendar.today":`Today`,"ui.calendar.more":`+{count} more`,"ui.calendar.more_short":`+{count}`,"ui.calendar.all_day":`All day`,"ui.calendar.until":`Until {date}`,"ui.calendar.items_one":`1 item`,"ui.calendar.items_other":`{count} items`,"ui.calendar.nothing_day":`Nothing scheduled`,"ui.calendar.nothing_month":`Nothing scheduled this month`,"ui.calendar.days_in":`Days in {month}`,"ui.calendar.close_day":`Close {date}`,"ui.day_view.back_to_calendar":`Back to Calendar`,"ui.day_view.no_events":`No events scheduled for this day`,"ui.modal.close":`Close modal`,"ui.phone_sheet.close":`Close {title}`,"ui.working_strip.working":`Working…`,"ui.working_strip.done":`Done`,"ui.working_strip.open":`Open`,"ui.working_strip.stop":`Stop`,"ui.working_strip.paused":`Paused`,"ui.working_strip.waiting":`Waiting for you`,"ui.working_strip.failed":`Couldn't finish`,"ui.working_strip.cancelled":`Stopped`,"ui.working_strip.pause":`Pause`,"ui.working_strip.resume":`Continue`,"ui.working_strip.review":`Review`,"ui.working_strip.dismiss":`Close`,"ui.form_action_bar.label":`Form actions`,"ui.dictation.start":`Speak instead of typing`,"ui.dictation.start_hint":`Speak instead of typing. You can also press and hold the text box.`,"ui.dictation.start_hands_free":`Speak instead of typing, hands-free. It writes each sentence down when you pause.`,"ui.dictation.stop":`Stop listening`,"ui.dictation.listening_hands_free":`Listening. Just talk; I write it down when you pause. Tap the microphone when you are done.`,"ui.dictation.listening_short":`Listening`,"ui.dictation.hearing":`Hearing you…`,"ui.dictation.sending":`Sending…`,"ui.dictation.paused_speaking":`Paused while the assistant speaks`,"ui.dictation.starting":`Getting the microphone ready…`,"ui.dictation.listening":`Listening. Tap the microphone when you are done.`,"ui.dictation.unsupported":`Speech recognition isn't available in this browser. Brave blocks it; try Chrome, Edge or Safari, or type instead.`,"ui.dictation.denied":`The microphone is blocked. Allow it for this site in your browser settings, then try again.`,"ui.dictation.no_speech":`Didn't hear anything. Tap the mic and try again.`,"ui.dictation.microphone":`Couldn't use the microphone. Check that one is connected and no other app is using it, then try again.`,"ui.dictation.interrupted":`Listening stopped straight away. This browser may not support speaking into text; try Chrome, Edge or Safari, or type instead.`,"ui.dictation.failed":`Listening stopped. Tap the microphone to try again.`,"ui.dictation.transcribing":`Writing it down…`,"ui.dictation.too_long":`That was too long to write down. Try a shorter message, or type instead.`,"ui.dictation.not_transcribed":`Couldn't write that down. Tap the microphone to try again, or type instead.`,"ui.dictation.unavailable":`Speaking isn't set up here yet. Please type instead.`,"ui.dictation.model_missing":`The speech model isn't downloaded yet. Download it first, or type instead.`,"ui.dictation.forbidden":`You can't use speaking here. Please type instead.`,"ui.progress_bar.label":`Progress`,"ui.progress_bar.over_by":`Over by {amount}`,"ui.footer.all_rights_reserved":`All rights reserved.`,"ui.masthead.home":`Home`,"ui.masthead.primary_nav":`Primary`,"ui.masthead.mobile_nav":`Mobile`,"ui.membership_card.change_role":`Change Role`,"ui.membership_list.loading":`Loading memberships...`,"ui.module_panel.component_not_registered":`Component not registered`,"ui.module_panel.register_hint":`Import the module's Svelte package to register components.`,"ui.pagination.first_page":`First page`,"ui.pagination.previous_page":`Previous page`,"ui.pagination.page_current":`Page {page}, current`,"ui.pagination.go_to_page":`Go to page {page}`,"ui.pagination.next_page":`Next page`,"ui.pagination.last_page":`Last page ({totalPages})`,"ui.reaction_picker.label":`Add reaction`,"ui.reaction_picker.react_with":`React with {emoji}`,"ui.camera_capture.region":`Camera`,"ui.camera_capture.preview":`Live camera preview`,"ui.camera_capture.starting":`Starting camera…`,"ui.camera_capture.off":`The camera is off.`,"ui.camera_capture.unsupported":`This browser cannot use the camera. Open this page over HTTPS in a current browser.`,"ui.camera_capture.permission_denied":`Camera access was denied. Allow camera access for this site, then try again.`,"ui.camera_capture.no_camera":`No camera was found on this device.`,"ui.camera_capture.error":`Could not access the camera.`,"ui.camera_capture.retry":`Try again`,"ui.camera_capture.capture":`Take photo`,"ui.camera_capture.retake":`Retake`,"ui.camera_capture.use_photo":`Use photo`,"ui.camera_capture.review_alt":`Captured photo, not yet used`,"ui.camera_capture.committed_alt":`Attached photo`,"ui.camera_capture.committed":`Photo attached.`,"ui.camera_capture.choose_photo":`Take or choose a photo`,"ui.signature_pad.region":`Signature`,"ui.signature_pad.canvas_empty":`Signature area, not yet signed`,"ui.signature_pad.canvas_signed":`Signature area, signed`,"ui.signature_pad.hint_any":`Sign with a stylus, your finger, or the mouse.`,"ui.signature_pad.hint_stylus":`Sign with the stylus.`,"ui.signature_pad.clear":`Clear`,"ui.signature_pad.use_signature":`Use signature`,"ui.signature_pad.committed":`Signature attached.`,"ui.numeric_keypad.region":`Number keypad`,"ui.numeric_keypad.display":`Entered amount`,"ui.numeric_keypad.decimal":`Decimal point`,"ui.numeric_keypad.backspace":`Delete last character`,"ui.numeric_keypad.clear":`Clear`,"ui.numeric_keypad.submit":`Confirm`,"ui.numeric_keypad.below_min":`Must be at least {min}.`,"ui.numeric_keypad.above_max":`Must be at most {max}.`,"ui.numeric_keypad.invalid_amount":`Enter an amount within the supported range.`,"ui.document_viewer.region":`Document`,"ui.document_viewer.pages":`Pages`,"ui.document_viewer.zoom":`Zoom`,"ui.document_viewer.previous_page":`Previous page`,"ui.document_viewer.next_page":`Next page`,"ui.document_viewer.page_of":`Page {page} of {pages}`,"ui.document_viewer.page_label":`{label}, page {page}`,"ui.document_viewer.zoom_out":`Zoom out`,"ui.document_viewer.zoom_in":`Zoom in`,"ui.document_viewer.fit":`Fit`,"ui.document_viewer.loading":`Loading the document…`,"ui.document_viewer.failed":`This document could not be opened. Check the network and try again.`,"ui.document_viewer.retry":`Try again`,"ui.document_viewer.unsupported":`This kind of file cannot be shown here. Use a PDF or a picture.`,"ui.staged_control_review.region":`Review proposed changes`,"ui.staged_control_review.heading":`Proposed changes`,"ui.staged_control_review.description":`Review changes before they update the form.`,"ui.staged_control_review.proposed_by":`Proposed by`,"ui.staged_control_review.staged_at":`staged`,"ui.staged_control_review.before":`Current`,"ui.staged_control_review.after":`Proposed`,"ui.staged_control_review.redacted":`Hidden for privacy`,"ui.staged_control_review.stale":`The field changed after this proposal was staged.`,"ui.staged_control_review.invalid":`This proposal is not valid.`,"ui.staged_control_review.apply":`Apply`,"ui.staged_control_review.discard":`Discard`,"ui.staged_control_review.apply_all":`Apply valid changes`,"ui.staged_control_review.discard_all":`Discard valid changes`,"ui.staged_control_review.edit":`Edit proposed value for`,"ui.staged_control_review.applied_status":`Applied proposed change.`,"ui.staged_control_review.discarded_status":`Discarded proposed change.`,"ui.staged_control_review.batch_status":`Processed {completed} of {total} proposed changes.`});function u(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function d(e,t){return!t||Object.keys(t).length===0?e:e.replace(/\{([^{}]+)\}/g,(e,n)=>{let r=t[n.trim()];if(r==null)return``;if(r instanceof Date)return r.toISOString();if(Array.isArray(r)||u(r))try{return JSON.stringify(r)}catch{return``}return String(r)})}var f=class{#e=n(`en`);#t=n(r({}));constructor(e){e?.locale&&a(this.#e,e.locale,!0),e?.messages&&a(this.#t,e.messages,!0)}get locale(){return e(this.#e)}set snapshot(e){a(this.#e,e.locale,!0),a(this.#t,e.messages,!0)}t=(t,n)=>d(e(this.#t)[t]??c(t)??t,n)},p=Symbol(`smrt-i18n`);function m(e){return new f(e)}function h(e){return i(p,e)}function g(){return t(p)??null}var _=null;function v(){return g()||(_||=new f,_)}function y(){return v()}export{s as a,l as i,m as n,h as r,y as t};
@@ -1 +1 @@
1
- import{D as e,M as t,w as n}from"./B81CeftJ.js";import{r}from"./G8JeRda5.js";var i=`@happyvertical/smrt-assets:Asset`,a=`@happyvertical/smrt-products:ProductAsset`,o=`assets.library`;function s(e,t,n){let r=new Map(t.map(e=>[e.id,e]));return n.filter(t=>t.productId===e).flatMap(e=>{let t=r.get(String(e.assetId)),n=t?.sourceUri;return!t||typeof n!=`string`?[]:[{id:t.id,name:String(t.name??`Product image`),sourceUri:n,mimeType:String(t.mimeType??`image/*`),description:String(t.description??``),sortOrder:Number(e.sortOrder??0)}]}).sort((e,t)=>e.sortOrder-t.sortOrder||e.name.localeCompare(t.name))}function c(e,t,n,o){return[{op:`save`,as:`asset`,model:r(i),values:{name:t.name||`Product image`,sourceUri:n,mimeType:t.type||`image/*`,description:`Image selected for this product in the browser demo.`,sourceType:`browser-demo`}},{op:`save`,model:r(a),values:{productId:e,assetId:{ref:`asset`},relationship:`gallery`,sortOrder:o}}]}function l(e,t){return t.filter(t=>t.productId===e).flatMap(e=>[{op:`delete`,model:r(a),id:e.id},{op:`delete`,model:r(i),id:String(e.assetId)}])}var u=`@happyvertical/smrt-products:Product`,d=`@happyvertical/smrt-products:ProductVariant`,f=`@happyvertical/smrt-products:Sku`,p=`@happyvertical/smrt-inventory:StockLevel`,m=`@happyvertical/smrt-profiles:ProfileType`,h=`@happyvertical/smrt-inventory:InventoryLocation`;function g(r){return{[h]:{from:[],make:()=>(t().locations??[]).map((e,t)=>({id:n(`${h}:sample:${t}`),...e,placeId:``,active:!0}))},[f]:{from:[r(u)],make:([e])=>(e??[]).map((e,t)=>({id:n(`${f}:sample:${e.id}`),productId:e.id,code:`SKU-${String(t+1).padStart(3,`0`)}`,barcode:``,name:String(e.name??``),attributes:``,parentSkuId:``,active:!0}))},[p]:{from:[r(f),r(h)],make:([r,i])=>{let a=t(),o=new Map(a.products.map(e=>[e.name,e.at]));return(r??[]).flatMap(t=>(i??[]).flatMap((r,i)=>{let a=e(`${t.id}:${r.id}`),s=o.get(String(t.name));if(s!==void 0){if(s!==i)return[]}else if(i>0&&a%3==0)return[];let c=10+a%4*5;return[{id:n(`${p}:sample:${t.id}:${r.id}`),skuId:t.id,locationId:r.id,state:`available`,qty:a%5==0?c-3:c+a%40,reorderPoint:c,reorderQuantity:c*3}]}))}}}}function _(e,t){let n=new Map(e.map(e=>[e.id,e.productId])),r=new Map;for(let e of t){let t=n.get(String(e.skuId));typeof t==`string`&&r.set(t,(r.get(t)??0)+Number(e.qty??0))}return r}function v(e,t,n,r=[]){return[...l(e,r),...t.flatMap(e=>[{op:`delete`,model:n(p),match:{skuId:e.id}},{op:`delete`,model:n(f),id:e.id}]),{op:`delete`,model:n(d),match:{productId:e}},{op:`delete`,model:n(u),id:e}]}export{d as a,g as c,a as d,c as f,p as i,i as l,m as n,v as o,s as p,f as r,_ as s,u as t,o as u};
1
+ import{D as e,M as t,w as n}from"./BoVMZ9pI.js";import{r}from"./Jx3glPjJ.js";var i=`@happyvertical/smrt-assets:Asset`,a=`@happyvertical/smrt-products:ProductAsset`,o=`assets.library`;function s(e,t,n){let r=new Map(t.map(e=>[e.id,e]));return n.filter(t=>t.productId===e).flatMap(e=>{let t=r.get(String(e.assetId)),n=t?.sourceUri;return!t||typeof n!=`string`?[]:[{id:t.id,name:String(t.name??`Product image`),sourceUri:n,mimeType:String(t.mimeType??`image/*`),description:String(t.description??``),sortOrder:Number(e.sortOrder??0)}]}).sort((e,t)=>e.sortOrder-t.sortOrder||e.name.localeCompare(t.name))}function c(e,t,n,o){return[{op:`save`,as:`asset`,model:r(i),values:{name:t.name||`Product image`,sourceUri:n,mimeType:t.type||`image/*`,description:`Image selected for this product in the browser demo.`,sourceType:`browser-demo`}},{op:`save`,model:r(a),values:{productId:e,assetId:{ref:`asset`},relationship:`gallery`,sortOrder:o}}]}function l(e,t){return t.filter(t=>t.productId===e).flatMap(e=>[{op:`delete`,model:r(a),id:e.id},{op:`delete`,model:r(i),id:String(e.assetId)}])}var u=`@happyvertical/smrt-products:Product`,d=`@happyvertical/smrt-products:ProductVariant`,f=`@happyvertical/smrt-products:Sku`,p=`@happyvertical/smrt-inventory:StockLevel`,m=`@happyvertical/smrt-profiles:ProfileType`,h=`@happyvertical/smrt-inventory:InventoryLocation`;function g(r){return{[h]:{from:[],make:()=>(t().locations??[]).map((e,t)=>({id:n(`${h}:sample:${t}`),...e,placeId:``,active:!0}))},[f]:{from:[r(u)],make:([e])=>(e??[]).map((e,t)=>({id:n(`${f}:sample:${e.id}`),productId:e.id,code:`SKU-${String(t+1).padStart(3,`0`)}`,barcode:``,name:String(e.name??``),attributes:``,parentSkuId:``,active:!0}))},[p]:{from:[r(f),r(h)],make:([r,i])=>{let a=t(),o=new Map(a.products.map(e=>[e.name,e.at]));return(r??[]).flatMap(t=>(i??[]).flatMap((r,i)=>{let a=e(`${t.id}:${r.id}`),s=o.get(String(t.name));if(s!==void 0){if(s!==i)return[]}else if(i>0&&a%3==0)return[];let c=10+a%4*5;return[{id:n(`${p}:sample:${t.id}:${r.id}`),skuId:t.id,locationId:r.id,state:`available`,qty:a%5==0?c-3:c+a%40,reorderPoint:c,reorderQuantity:c*3}]}))}}}}function _(e,t){let n=new Map(e.map(e=>[e.id,e.productId])),r=new Map;for(let e of t){let t=n.get(String(e.skuId));typeof t==`string`&&r.set(t,(r.get(t)??0)+Number(e.qty??0))}return r}function v(e,t,n,r=[]){return[...l(e,r),...t.flatMap(e=>[{op:`delete`,model:n(p),match:{skuId:e.id}},{op:`delete`,model:n(f),id:e.id}]),{op:`delete`,model:n(d),match:{productId:e}},{op:`delete`,model:n(u),id:e}]}export{d as a,g as c,a as d,c as f,p as i,i as l,m as n,v as o,s as p,f as r,_ as s,u as t,o as u};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CSvhNT33.js","./DG3qFFTE.js","./COiEfhsA.js","./xihTtKlq.js","./B81CeftJ.js","./YUSKx8_q.js","./DK8Blf1Y.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.BHwMQ9Zv.css","./3nInxoCv.js","./Bv5jGtB8.js","../assets/feedback.qFktqYFY.css","./DV8QsFnv.js","./BaNbYf_w.js","./B2aomX_k.js","../assets/SegmentedControl.DMqHG5fn.css","./DIE02RSm.js","../assets/webmcp-ui-context.hO24Ni5w.css","./DBfU27Yr.js","../assets/data.CVlX_W0i.css","./CUyVrfsu.js","./Qxx7HWld.js","../assets/forms.BRdbPdvs.css","./BYcBM-fh.js","../assets/AppShell.Y0ysizZK.css","./OH7CqE-U.js","../assets/workspace.C40zM0Mb.css","./CTz6b8sX.js","./CGILVblc.js","../assets/state.C0UZEhxS.css","../assets/labels.Dxa6EyRI.css","./D95Ltrhv.js","./B58ycq6u.js","./glUGUrBl.js","../assets/planner.DOQVfcOi.css","./D_U_DYjx.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,Et as t,Mt as n,bt as r,vt as i}from"./DG3qFFTE.js";import{t as a}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{I as o,L as s,O as c,Q as l,W as u,Z as d,_ as f,_t as p,bt as m,et as h,h as g,ht as _,p as v,x as y,yt as b}from"./B81CeftJ.js";import{v as x}from"./DV8QsFnv.js";import"./B2aomX_k.js";import"./DIE02RSm.js";import{u as S}from"./DBfU27Yr.js";import{A as ee,C,E as te,F as ne,G as re,I as ie,M as ae,N as oe,O as se,P as ce,T as le,U as ue,V as de,W as w,b as fe,h as pe,j as me,k as he,n as ge,q as _e,r as ve,w as ye}from"./CTz6b8sX.js";import{B as be,D as xe,G as Se,H as Ce,J as we,K as Te,M as Ee,V as De,X as Oe,Y as ke,Z as Ae,a as je,b as T,c as Me,d as Ne,l as Pe,n as Fe,r as Ie,s as Le,t as E,v as Re,x as D,z as ze}from"./CGILVblc.js";function Be(e){let t=e?.surfaces?.find(e=>e.kind===`widget`&&e.sectionDefault===!0);return t?{id:t.type,type:t.type,span:4,options:{}}:void 0}function Ve(e){let t=e.lastIndexOf(`#`);if(t<=0||t===e.length-1)return null;let n=e.slice(0,t),r=e.slice(t+1);return n.startsWith(`.`)||n.startsWith(`/`)||/\s/.test(n)||!/^[A-Za-z_$][\w$]*$/.test(r)?null:{specifier:n,exportName:r}}function O(e,t){let n=Ve(e);return n?Promise.resolve(t(n.specifier,n.exportName)).then(t=>{if(t==null)throw Error(`export "${e}" was not found`);return t}):Promise.reject(Error(`invalid export ref "${e}"`))}function k(e){let t;return()=>(t??=e(),t)}function He(e){return typeof e==`object`&&!!e&&`default`in e&&!!e.default}function Ue(e,t,n){let r=k(()=>O(e.export,t)),i=e.optionsEditor?k(()=>O(e.optionsEditor,t)):void 0,a=e.data?.load?k(()=>O(e.data?.load,t)):void 0,o={type:e.type,title:e.label,options:e.options??[],loadComponent:async()=>{let e=await r();return He(e)?e.default:e}};return e.description!==void 0&&(o.description=e.description),e.icon!==void 0&&(o.icon=e.icon),e.version!==void 0&&(o.version=e.version),e.allowedIn&&(o.allowedIn=e.allowedIn),e.defaultSpan!==void 0&&(o.defaultSpan=e.defaultSpan),e.minSpan!==void 0&&(o.minSpan=e.minSpan),e.maxSpan!==void 0&&(o.maxSpan=e.maxSpan),n&&(o.migrate=n),i&&(o.loadOptionsEditor=async()=>{let e=await i();return He(e)?e.default:e}),a&&(o.load=async(t,n)=>{let r=await a();if(typeof r!=`function`)throw Error(`loader "${e.data?.load}" is not a function`);return r(t,n)}),o}async function We(e,t,n,r={}){let i=[],a=[],o=[];for(let s of t)if(!r.enabled||r.enabled(s.id))for(let t of s.surfaces??[]){if(t.kind!==`widget`)continue;let c=(e,n)=>a.push({recipeId:s.id,type:t.type,reason:e,message:n});if(e.has(t.type)&&!r.replace){c(`duplicate_type`,`"${t.type}" is already registered`);continue}let l;if(t.migrate)try{let e=await O(t.migrate,n);if(typeof e!=`function`)throw Error(`not a function`);l=e}catch(e){c(`unresolved`,`migrate "${t.migrate}": ${e instanceof Error?e.message:String(e)}`);continue}try{o.push(e.register(Ue(t,n,l),{replace:r.replace})),i.push(t.type)}catch(e){c(`invalid`,e instanceof Error?e.message:String(e))}}return{registered:i,skipped:a,dispose:()=>{for(let e of o.splice(0))e()}}}var Ge=[`identifier`,`status`,`date`,`party`,`total`,`money`];function Ke(e){for(let t of[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`])if(e.includes(t))return t}function qe(e,t,n={}){let r=new Set(n.exclude??[]),i=n.max??4,a=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),o=e=>a.find(n=>t[n]?.includes(e)),s=[],c=e=>{e&&!s.includes(e)&&s.push(e)};c(o(`identifier`)??o(`title`));for(let e of Ge)e!==`identifier`&&(e===`money`&&s.some(e=>t[e]?.includes(`money`))||c(e===`date`?a.find(e=>t[e]?.includes(`date`)&&e!==`createdAt`&&e!==`updatedAt`)??o(`date`):o(e)));return s.slice(0,i).map(n=>({key:n,label:A(n,e),...Ke(t[n]??[])?{role:Ke(t[n]??[])}:{}}))}function Je(e,t,n={}){let r=new Set(n.exclude??[]),i=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),a=i.filter(t=>e.fields[t]?.type===`text`),o=a.find(e=>/^(?:description|title|name|label)$/.test(e))??a.find(e=>t[e]?.includes(`title`))??a.find(e=>!t[e]?.includes(`identifier`)),s=i.find(e=>t[e]?.includes(`quantity`)),c=i.filter(e=>t[e]?.includes(`money`)),l=c.find(e=>/unit|price|rate/i.test(e)),u=c.find(e=>/^(?:amount|lineTotal|total|lineAmount)$/.test(e))??[...c].reverse().find(e=>e!==l),d=[];return o&&d.push({key:o,label:A(o,e)}),s&&d.push({key:s,label:A(s,e),role:`quantity`}),l&&d.push({key:l,label:A(l,e),role:`money`,summarize:!1}),u&&u!==l&&d.push({key:u,label:A(u,e),role:`money`}),d}function A(e,t){let n=t.fields[e];return n&&(n.type===`foreignKey`||n.type===`crossPackageRef`)&&/.[a-z]Id$/.test(e)?ce(e.slice(0,-2)):ce(e)}function Ye(e){if(e.dataWidgets&&e.page)return[e.page];let t=[{id:`shortcuts`,type:`shortcuts`,span:4,options:{}}];if(e.dataWidgets&&e.lead){let n=e.lead,r=e.override,i=r&&typeof r==`object`&&!Array.isArray(r)?r:void 0,a=i?.changed;a&&typeof a==`object`&&!Array.isArray(a)&&Object.hasOwn(a,`count`)&&!(Array.isArray(i?.removed)&&i.removed.includes(`count`))&&t.push({id:`count`,type:`metric`,span:1,options:{title:n.plural,model:n.id,measure:`count`}}),t.push({id:`latest`,type:`records`,span:4,options:{title:`${n.name} records`,model:n.id,limit:5,summaries:!1}})}return t}var Xe=[`text`,`integer`,`decimal`,`boolean`,`datetime`,`json`,`foreignKey`,`crossPackageRef`];function Ze(e){return Xe.includes(e)?e:`text`}var Qe=/(Date|^date|period(Start|End))$/;function $e(e,t){return t.type===`datetime`&&!t.system&&Qe.test(t.name)&&!e.fields.some(e=>e.name===`allDay`)?`date`:void 0}function et(e){return fe(e)[0]}function tt(e,t){let n=t.ui?{...t.ui}:void 0,r=c(t)?`money`:$e(e,t);return{type:Ze(t.type),required:t.required,nullable:!t.required,...t.default===void 0?{}:{default:t.default},...t.description?{description:t.description}:{},...n?{ui:n}:{},...t.enum?.length?{enum:[...t.enum]}:{},...r?{format:r}:{},...et(e)===t.name?{display:!0}:{}}}function nt(e,t){return e.includes(`:`)?e:`${t.slice(0,t.lastIndexOf(`:`))}:${e}`}function rt(e,t){if(!t.related)return!1;let n=nt(t.related,e.id);return ke(p,n,h).some(t=>t.id===e.id)}function it(e){return e.fields.flatMap(t=>{if(t.type!==`foreignKey`&&t.type!==`crossPackageRef`||!t.related)return[];let n=m(nt(t.related,e.id));return n?[{field:t.name,kind:t.type===`crossPackageRef`?`crossPackageRef`:`foreignKey`,relatedCollection:n.model.collection,...rt(e,t)?{role:`items`}:{}}]:[]})}function j(e){let t=it(e);return{name:e.collection,objectRef:e.id,className:e.name,idField:`id`,fields:Object.fromEntries(e.fields.map(t=>[t.name,tt(e,t)])),...t.length?{relationships:t}:{}}}function at(e,t){return{objectRef:e.id,fields:Object.fromEntries(t.map((e,t)=>[e.name,{visibility:`basic`,label:e.label,help:e.help??null,order:t,required:e.required}]))}}function ot(e,t){let n=new Set(t);for(let t of e)for(let e of t.models)n.add(e);return n}function st(e){return v(e.replace(/_?id$/i,``)||e)}function M(e,t,n){let r=Oe(e,t),i=Ae(e,t).filter(e=>e.model.exposed&&n.has(e.model.id)),a=new Set(ke(e,t,h).map(e=>e.id)),o=new Map;for(let e of i)o.set(e.model.id,(o.get(e.model.id)??0)+1);let s=i.map(e=>{let t=a.has(e.model.id)?`items`:`children`,n=j(e.model),i=ie(n),s=[e.fk];return{model:e.model.id,field:e.fk,label:(o.get(e.model.id)??0)>1?`${Se(e.model.name,r)} (${st(e.fk).toLowerCase()})`:Se(e.model.name,r),kind:t,columns:t===`items`?Je(n,i,{exclude:s}):qe(n,i,{exclude:s,max:5}),...t===`items`&&`sortOrder`in n.fields?{sort:`sortOrder`}:{}}});for(let n of Te(e,t))s.push({model:n.model.id,field:n.fk,label:st(n.fk),kind:`reference`});return s}var ct=Symbol(`smrt-cookbook`);function lt(){return t(ct)}function ut(e,t){let{sections:n}=t;if(!n)throw Error(`the cookbook widget context is missing`);let r=typeof e.section==`string`?e.section:``,i=r?n.find(e=>e.id===`section:${r}`||e.id===`custom:${r}`)?.id:t.overviewId;if(!i)throw Error(`unknown section ${r}`);return oe(n,i)}function dt(e){return e?async(t,n)=>{let r=ut(t,n);try{let t=await e(n,r.items.map(e=>({...e})));if(!Array.isArray(t))return r;let i=new Set,a=[];for(let e of t){if(!e||typeof e.href!=`string`)continue;let t=typeof e.id==`string`&&e.id?e.id:e.href;i.has(t)&&(t=`${t}#${a.length}`),i.add(t),a.push({...e,id:t})}return{items:a}}catch(e){if(n.signal?.aborted)throw e;return r}}:ut}var ft=new Set([`foreignKey`,`crossPackageRef`]);function N(e,t){return`/m/${e}/${t}/`}function pt(e,t,n,r=`view`){let i=`${N(e,t)}${encodeURIComponent(n)}/`;return r===`edit`?`${i}edit/`:i}function mt(e,t,n,r){return`${N(e,t)}?${encodeURIComponent(n)}=${encodeURIComponent(r)}`}function ht(e,t){let n=new URLSearchParams(e);for(let e of t.fields){if(!ft.has(e.type))continue;let t=n.get(e.name);if(t)return{field:e.name,equals:t}}}function gt(e){return e?.equals===void 0?``:`${encodeURIComponent(e.field)}=${encodeURIComponent(e.equals)}`}var P=e=>typeof e==`number`&&Number.isSafeInteger(e)?e:null,_t=(e,t)=>e.fields.some(e=>e.name===t);function vt(e,t){let n=ie(j(e)),r=C(t,n);return Object.values(r).some(e=>P(e)!==null)?r:void 0}function yt(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}function bt(e,t,n){if(!yt(e,t)||![`subtotal`,`taxAmount`,`totalAmount`,`discountTotal`].every(t=>_t(e,t)))return;let r=P(t.subtotal),i=P(t.taxAmount),a=P(t.totalAmount),o=P(t.discountTotal)??0;if(r===null||i===null||a===null)return;let s=d(t,`exclusive`);return{subtotal:r,discount:o,tax:i,total:a,lineAmountType:s,roundingScope:l(t,`line`),showNetSubtotal:s===`inclusive`,taxes:_(n,s).flatMap(e=>e.taxComponentId?[{taxComponentId:e.taxComponentId,name:e.name,percent:e.percent,taxable:e.taxable,tax:e.tax}]:[])}}var F=de();function I(e){let{source:t,href:n}=e;if(!t||!n)throw Error(`the planner widget context is missing`);return{source:t,href:n}}function L(e){let t=typeof e==`string`?m(e):void 0;if(!t)throw Error(`unknown model ${String(e)}`);return{model:t.model,packageId:t.pkg.id,path:N(t.pkg.id,t.model.name)}}var R=new Set([`foreignKey`,`crossPackageRef`]);function z(e,t,n){let r=e.filter;if(typeof r!=`string`||r===``)return;if(r!==`parent`)throw Error(`unknown filter ${r}`);let{record:i}=t;if(!i?.id)throw Error(`the parent filter needs a record`);let a=typeof e.parentField==`string`&&e.parentField?e.parentField:e.field,o=typeof a==`string`?a:``,s=n.fields.find(e=>e.name===o);if(!s||!R.has(s.type))throw Error(`${n.name} has no reference field ${o}`);return{field:o,id:i.id}}async function B(e,t,n){return n?e.listWhere(t,n.field,n.id):e.list(t)}function V(e,t,n){return e(n?mt(t.packageId,t.model.name,n.field,n.id):t.path)}var H=e=>typeof e==`number`&&Number.isFinite(e);async function xt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o),l=V(r,i,o),u=typeof e.measure==`string`?e.measure:``;if(u===`count`||u===``)return{value:s.length,format:`integer`,href:l};let d=a.fields.find(t=>t.name===e.field);if(!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`);let f=s.map(e=>e[d.name]).filter(H),p=0;if(f.length){if(u===`sum`||u===`avg`)p=f.reduce((e,t)=>e+t,0),u===`avg`&&(p/=f.length);else if(u===`min`)p=Math.min(...f);else if(u===`max`)p=Math.max(...f);else throw Error(`unknown measure ${u}`)}let m=c(d);return{value:m?Math.round(p):p,format:m?`money`:d.type===`integer`?`integer`:`decimal`,...m?{currency:`USD`}:{},href:l}}function St(e,t){return H(e)&&H(t)?e-t:String(e??``).localeCompare(String(t??``))}var Ct=new Set([`createdAt`,`updatedAt`]),wt=[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`];function Tt(e=[]){return wt.find(t=>e.includes(t))}function Et(e,t,n,r){let i=j(e),a=r?[r]:[],o=ae(n),s=o.length?[]:pe(E.apply(e).fields.filter(t=>!a.includes(t.name)&&!xe(e,t))).filter(e=>!e.derive),c=o.length?o:s.map(e=>e.name),l=[...Je(i,t,{exclude:a}),...qe(i,t,{exclude:a,max:c.length+8})];return c.map(n=>{let r=e.fields.find(e=>e.name===n);if(!r)throw Error(`${e.name} has no field ${n}`);let i=l.find(e=>e.key===n),a=s.find(e=>e.name===n)?.label;if(i)return a?{...i,label:a}:i;let o=Tt(t[n]);return{key:n,label:a??(R.has(r.type)?v(n.replace(/Id$/,``)):v(n)),...o?{role:o}:{}}})}var Dt=new Set([`money`,`quantity`]);function Ot(e,t){let n={};for(let r of e)(r.summarize??Dt.has(r.role))&&(n[r.key]=t.reduce((e,t)=>{let n=t[r.key];return H(n)?e+n:e},0));return n}function kt(e,t){let n=ne(j(e)),r=new Set(t.map(e=>n?e[n]:void 0).filter(e=>typeof e==`string`&&e!==``));return r.size===1?[...r][0]??`USD`:`USD`}async function At(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o);if(typeof e.sort==`string`&&e.sort){if(!a.fields.find(t=>t.name===e.sort)&&!Ct.has(e.sort))throw Error(`${a.name} has no field ${e.sort}`);let t=s.some(t=>t[e.sort]!==void 0)?e.sort:W(a)?.name;if(t){let n=e.direction===`asc`?1:-1;s=[...s].sort((e,r)=>n*St(e[t],r[t]))}}let c=Et(a,ie(j(a)),e.columns,o?.field),l=H(e.limit)?e.limit:5,u=s.slice(0,l),d=a.fields.filter(e=>R.has(e.type)&&c.some(t=>t.key===e.name)),f=await ve(n,d,u),p=e=>Object.fromEntries(c.map(t=>{let n=e[t.key],r=d.find(e=>e.name===t.key);return r?.related&&typeof n==`string`&&n?[t.key,f.get(g(r.related,n))??``]:[t.key,n??null]})),m=Ot(c,s),h=!we(a);return{rows:await Promise.all(u.map(async e=>({id:String(e.id),title:await ge(n,a,e,0,o?.field),...h?{href:r(pt(i.packageId,a.name,String(e.id)))}:{},cells:p(e)}))),...e.summaries===!1?{}:{total:s.length},...h?{href:V(r,i,o)}:{},columns:c,currency:kt(a,s),...Object.keys(m).length?{summaries:m}:{}}}var jt={"7d":7,"30d":30,"90d":90,"12m":365,all:null},U=864e5;function Mt(e){return e===`7d`||e===`30d`?`day`:e===`90d`?`week`:`month`}function Nt(e,t){let n=new Date(e);if(t===`month`)return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1);let r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());return t===`week`?r-(n.getUTCDay()+6)%7*U:r}function Pt(e,t){if(t===`month`){let t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)}return e+(t===`week`?7:1)*U}function Ft(e,t){let n=new Date(e).toISOString();return t===`month`?n.slice(0,7):n.slice(0,10)}var It=e=>e.type===`datetime`&&!e.system;function W(e){let t=e.fields.filter(It);return t.find(e=>/^(issue|order|start|created)/i.test(e.name))??t[0]}function Lt(e){if(typeof e!=`string`&&typeof e!=`number`)return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}async function Rt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=typeof e.groupBy==`string`?e.groupBy:``,l=s?a.fields.find(e=>e.name===s):W(a);if(!l)throw Error(s?`${a.name} has no field ${s}`:`${a.name} has no date field to chart; choose a group-by field`);let u=typeof e.measure==`string`?e.measure:``,d;if(u&&u!==`count`){if(u!==`sum`&&u!==`avg`)throw Error(`unknown measure ${u}`);if(d=a.fields.find(t=>t.name===e.field),!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`)}let f=typeof e.period==`string`?e.period:`30d`;if(!Object.hasOwn(jt,f))throw Error(`unknown period ${f}`);let p=jt[f],m=It(l),h=m?l:W(a),g=p!==null&&h?y-p*U:-1/0,_=await B(n,a,o);h&&g!==-1/0&&(_=_.filter(e=>{let t=Lt(e[h.name]);return t!==void 0&&t>=g&&t<=y}));let v=new Map,b=(e,t,n)=>{let r=v.get(e)??{key:t,sum:0,n:0};if(d){let e=n[d.name];if(!H(e))return;r.sum+=e}r.n+=1,v.set(e,r)},x=Mt(f);if(m){let e=g===-1/0?Math.min(..._.map(e=>Lt(e[l.name])??y),y):g;for(let t=Nt(e,x);t<=y;t=Pt(t,x))v.set(Ft(t,x),{key:t,sum:0,n:0});for(let e of _){let t=Lt(e[l.name]);if(t===void 0)continue;let n=Nt(t,x);b(Ft(n,x),n,e)}}else for(let e of _){let t=e[l.name],n=t==null||t===``?`(none)`:String(t);b(n,n,e)}let S=d?c(d):!1,ee=e=>{if(!d)return e.n;let t=u===`avg`&&e.n?e.sum/e.n:e.sum;return S?Math.round(t):t},C=[...v.entries()].map(([e,t])=>({label:e,value:ee(t),key:t.key}));return C=m?C.sort((e,t)=>Number(e.key)-Number(t.key)):C.sort((e,t)=>t.value-e.value||e.label.localeCompare(t.label)),{points:C.map(({label:e,value:t})=>({label:e,value:t})),format:d?S?`money`:d.type===`integer`?`integer`:`decimal`:`integer`,...S?{currency:`USD`}:{},href:V(r,i,o)}}te(F,{metric:xt,records:At,chart:Rt,shortcuts:async(e,t)=>t,shortcuts:dt()});function zt(e){let{relations:t,viewAllHref:n}=e;if(!t)throw Error(`the record page context is missing`);return{relations:t,records:At,viewAllHref:n}}async function Bt(e,t){let{source:n}=I(e),r=e.record;if(!r?.id)throw Error(`line items need a record`);let{model:i}=L(r.model),a=await n.get(i,r.id);if(!a)return{};let o=t.find(e=>e.kind===`items`),s=o?m(o.model)?.model:void 0,c=bt(i,a,o&&s?await n.listWhere(s,o.field,r.id):[]),l=c?void 0:vt(i,a),u=ne(j(i)),d=u?a[u]:void 0;return{...c?{storedTotals:c}:{},...l?{totals:l}:{},...typeof d==`string`&&d?{currency:d}:{}}}F.register(le((e,t)=>he(zt(t))(e,t))),F.register(ye(async(e,t)=>{let n=zt(t),{totals:r,storedTotals:i,currency:a}=await Bt(t,n.relations);return se({...n,totals:()=>r,storedTotals:()=>i,currency:()=>a})(e,t)}));var Vt=[`shortcuts`,`metric`,`records`,`chart`,`note`],Ht={"@happyvertical/smrt-reports/svelte":async()=>({SavedReportsWidget:(await a(async()=>{let{default:e}=await import(`./CSvhNT33.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]),import.meta.url)).default})},Ut=async(e,t)=>{let n=Ht[e];if(n)return(await n())[t]},Wt=T.filter(e=>e.surfaces?.some(e=>e.kind===`widget`)),Gt=Wt.flatMap(e=>(e.surfaces??[]).flatMap(e=>e.kind===`widget`?[e.type]:[]));We(F,Wt,Ut);var Kt=new Map(ze(T).map(e=>[`section:${e.id}`,e])),qt=p.packages.flatMap(e=>e.models.map(e=>e.id)),Jt=[...Vt,...Gt];function Yt(e){let t=Kt.get(e);for(let e of t?.recipes??[]){let t=Re(e)[0];if(t)return{id:t.model.id,name:v(t.model.name)}}}function Xt(e,t){let n=Be(Kt.get(e)?.recipes[0]),r=Yt(e);return Ye({lead:r?{...r,plural:f(r.name)}:void 0,dataWidgets:!0,page:n&&Gt.includes(n.type)?n:void 0,override:t})}var Zt=new Map;function Qt(e,t){if(!_e.test(e))return;let n=Zt.get(e);return n||(n=w({id:e,allowed:Jt,models:qt,defaults:Xt(e)}),Zt.set(e,n)),t===void 0?n:w({...n,defaults:Xt(e,t)})}function $t(e,t){return`detail:${e}.${t}`}var en=new Map(p.packages.flatMap(e=>e.models.filter(e=>e.exposed).map(t=>[me(t.id),{packageId:e.id,model:t}])));function tn(e){let[,t,n]=/^detail:([A-Za-z0-9_-]+)\.([A-Za-z0-9_]+)$/.exec(e)??[],r=t&&n?b(t,n):void 0;return t&&r?.exposed?{packageId:t,model:r}:en.get(e)}var nn=new Set(p.packages.flatMap(e=>e.models.filter(e=>e.exposed).map(e=>e.id))),rn=new Map;function an(e){let t=rn.get(e);if(t)return t;let n=tn(e);if(!n)return;let r=M(p,n.model.id,nn),i=ee(j(n.model),r,{id:e,maxMetrics:2*r.length});return t=w({...i,maxWidgets:Math.max(i.maxWidgets??24,i.defaults.length+24)}),rn.set(e,t),t}function on(e,t){let n=an(e),r=tn(e);if(!n||!r)return;let i=M(p,r.model.id,t),a=0,o=n.defaults.filter(e=>e.type===`line-items`?i.some(e=>e.kind===`items`):e.type===`related`?i.some(e=>e.kind===`children`):t.has(String(e.options.model))?e.type!==`metric`||(a+=1,a<=4):!1);return w({...n,defaults:o})}function sn(e,t){return e.startsWith(`detail:`)?an(e):Qt(e,t)}function cn(e,t){return Kt.has(e)||e===`section:${Ee.id}`?!0:e.startsWith(`detail:`)?tn(e)!==void 0:e.startsWith(`custom:`)&&_e.test(e)&&(t?.customSections??[]).some(t=>t.id===e)}var ln=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function un(e,t){let n=t.widgetId?`widget ${t.widgetId}${t.type?` (${t.type})`:``}`:`an entry`,r=t.options?.length?`: ${t.options.map(e=>`${e.key} ${e.code}`).join(`, `)}`:``;return`Overview ${e}: ${n} was dropped (${t.code}${r}).`}function dn(e,t){let n={...e};return e.added&&(n.added=e.added.filter(e=>!t.has(e.id))),e.changed&&(n.changed=Object.fromEntries(Object.entries(e.changed).filter(([e])=>!t.has(e)))),n}function fn(e,t){let n=sn(e,t);if(!n)return{override:null,issues:[{widgetId:null,type:null,code:`malformed`,message:`not an overview id`}]};let r=ue(n,t,F);if(r.ok){let e=re(t).override?.changed?.count;return e&&n.defaults.some(e=>e.id===`count`)?{override:{...r.override??{version:1},changed:{...r.override?.changed,count:e}},issues:[]}:{override:r.override,issues:[]}}let i=re(t),a=new Set(r.issues.flatMap(e=>e.widgetId?[e.widgetId]:[]));if(!i.override)return{override:null,issues:r.issues};let o=ue(n,dn(i.override,a),F);return o.ok?{override:o.override,issues:r.issues}:{override:null,issues:[...r.issues,...o.issues]}}function pn(e,t){if(!ln(e))return null;let n=[],r=[];for(let i of Object.keys(e).sort()){if(!cn(i,t)){r.push(`Overview ${i} is not a page in this app and was dropped.`);continue}let{override:a,issues:o}=fn(i,e[i]);for(let e of o)r.push(un(i,e));a&&n.push([i,a])}return{overviews:Object.fromEntries(n),dropped:r}}var mn=S,hn=`glass`,gn=`system`,_n=[`light`,`dark`,`system`],vn=[`none`,`sm`,`md`,`lg`,`xl`,`full`],yn=[`comfortable`,`touch`],bn=[`auto`,`standard`,`more`],G={"system-ui":`system-ui, -apple-system, "Segoe UI", sans-serif`,Inter:`Inter, system-ui, sans-serif`,Georgia:`Georgia, "Times New Roman", serif`,"ui-rounded":`ui-rounded, "SF Pro Rounded", system-ui, sans-serif`,"ui-monospace":`ui-monospace, "SF Mono", Menlo, monospace`},xn=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;function Sn(e){if(typeof e!=`string`)return null;let t=xn.exec(e.trim());if(!t)return null;let n=t[1].toLowerCase();return n.length===3&&(n=[...n].map(e=>e+e).join(``)),`#${n}`}var Cn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function wn(e){if(e===void 0)return{ok:!0,theme:void 0};if(!Cn(e))return{ok:!1,error:`The cookbook "theme" must be an object.`};let t={};if(e.preset!==void 0){if(typeof e.preset!=`string`||!mn.includes(e.preset))return{ok:!1,error:`The theme preset must be one of ${mn.join(`, `)}.`};t.preset=e.preset}if(e.colorScheme!==void 0){if(!_n.includes(e.colorScheme))return{ok:!1,error:`The theme colorScheme must be light, dark or system.`};t.colorScheme=e.colorScheme}for(let[n,r]of[[`borderRadius`,vn],[`density`,yn],[`contrast`,bn]]){let i=e[n];if(i!==void 0){if(!r.includes(i))return{ok:!1,error:`The theme ${n} must be one of ${r.join(`, `)}.`};t[n]=i}}if(e.fontFamily!==void 0){if(typeof e.fontFamily!=`string`||!Object.hasOwn(G,e.fontFamily))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};t.fontFamily=e.fontFamily}if(e.custom!==void 0){if(!Cn(e.custom))return{ok:!1,error:`The theme "custom" must be an object.`};let n=Sn(e.custom.primary);if(!n)return{ok:!1,error:`The theme custom primary must be a hex colour like #c2410c.`};let r={primary:n};if(e.custom.fontFamily!==void 0){let t=e.custom.fontFamily;if(typeof t!=`string`||!Object.hasOwn(G,t))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};r.fontFamily=t}t.custom=r}if(e.customCss!==void 0){if(typeof e.customCss!=`string`)return{ok:!1,error:`The theme customCss must be a string.`};if(Array.from(e.customCss).length>65536)return{ok:!1,error:`The theme customCss is too long (65,536 characters maximum).`};e.customCss&&(t.customCss=e.customCss)}return{ok:!0,theme:Object.keys(t).length?t:void 0}}function Tn(e){if(!e)return;let t={};return e.preset&&(t.preset=e.preset),e.colorScheme&&(t.colorScheme=e.colorScheme),e.borderRadius&&(t.borderRadius=e.borderRadius),e.density&&(t.density=e.density),e.contrast&&(t.contrast=e.contrast),e.fontFamily&&(t.fontFamily=e.fontFamily),e.custom&&(t.custom={...e.custom}),e.customCss&&(t.customCss=e.customCss),Object.keys(t).length?t:void 0}function En(e){let t=e?.colorScheme??`system`,n=e?.custom?`brand colour ${e.custom.primary}`:e?.preset??`glass`;return t===`system`?n:`${n}, ${t}`}var K=`section:`;function Dn(e,t=be(T)){let n=Object.keys(t).sort((e,t)=>t.length-e.length);if(!n.length)return e;let r=e=>{if(!e.startsWith(K))return e;let r=e.slice(8);for(let e of n){if(r===e)return`${K}${t[e]}`;if(r.startsWith(`${e}:`))return`${K}${t[e]}${r.slice(e.length)}`}return e},i=e=>e.startsWith(K)&&n.includes(e.slice(8)),a=e=>[...new Set(e)],o={...e};if(e.sectionOrder&&(o.sectionOrder=a(e.sectionOrder.map(r))),e.hidden&&(o.hidden=a(e.hidden.filter(e=>!i(e)).map(r))),e.itemOrder){let t={};for(let[n,i]of Object.entries(e.itemOrder)){let e=r(n);t[e]=a([...t[e]??[],...i.map(r)])}o.itemOrder=t}return e.moved&&(o.moved=Object.fromEntries(Object.entries(e.moved).map(([e,t])=>[r(e),r(t)]))),o}function On(e,t=T){let n=new Map;for(let e of t){let t=Ce(e).id;for(let r of Re(e))r.key&&n.set(`${K}${t}:${r.packageId}:${r.model.name}:${r.label}`,De(r.packageId,r.model.name,r.key))}let r=e=>{let t=n.get(e);if(t)return t;if(!e.startsWith(K))return e;let r=e.slice(8).split(`:`);return r.length<3||!r[1]||!r[2]?e:De(r[1],r[2])},i=e=>[...new Set(e)],a=(e,t)=>{let n={};for(let[i,a]of Object.entries(e)){let e=r(i);e in n||(n[e]=t(a))}return n},o={...e};return e.hidden&&(o.hidden=i(e.hidden.map(r))),e.itemOrder&&(o.itemOrder=a(e.itemOrder,e=>i(e.map(r)))),e.moved&&(o.moved=a(e.moved,r)),e.items&&(o.items=a(e.items,e=>e)),o}var q=`https://s-m-r-t.dev/schemas/cookbook/v1.json`,kn=new Set([`basic`,`advanced`,`hidden`]),An=new Set([`api`,`mcp`,`cli`]),J=e=>({ok:!1,error:e}),Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`);function jn(e,t){if(!Y(e))return`${t} is not an object`;let{objectRef:n,fieldName:r}=e;if(typeof n!=`string`||!n)return`${t} has no objectRef`;if(typeof r!=`string`||!r)return`${t} has no fieldName`;if(e.scopeType!==`app`)return`${t} must have scopeType "app"`;let i={objectRef:n,fieldName:r,scopeType:`app`};for(let n of[`defaultValue`,`help`,`label`]){let r=e[n];if(r!==void 0){if(typeof r!=`string`&&r!==null)return`${t}.${n} is invalid`;i[n]=r}}if(e.visibility!==void 0){let n=e.visibility;if(n!==null&&!(typeof n==`string`&&kn.has(n)))return`${t}.visibility is invalid`;i.visibility=n}if(e.displayOrder!==void 0){let n=e.displayOrder;if(n!==null&&!(typeof n==`number`&&Number.isFinite(n)))return`${t}.displayOrder is invalid`;i.displayOrder=n}if(e.locked!==void 0){if(e.locked!==null&&typeof e.locked!=`boolean`)return`${t}.locked is invalid`;i.locked=e.locked}return i}function Mn(e){if(!Y(e)||e.version!==1)return`layout must be an object with version 1`;for(let t of[`sectionOrder`,`hidden`])if(e[t]!==void 0&&!X(e[t]))return`layout.${t} must be a list of strings`;for(let t of[`itemOrder`,`moved`,`panels`])if(e[t]!==void 0&&!Y(e[t]))return`layout.${t} must be an object`;let t=e.itemOrder;if(Y(t)){for(let[e,n]of Object.entries(t))if(e===`__proto__`||!X(n))return`layout.itemOrder.${e} must be a list of strings`}let n=e.moved;if(Y(n)){for(let[e,t]of Object.entries(n))if(e===`__proto__`||typeof t!=`string`)return`layout.moved.${e} must be a string`}return e}function Nn(e,t={}){if(!Y(e))return J(`This is not a cookbook: expected a JSON object.`);if(e.$schema!==void 0&&e.$schema!==`https://s-m-r-t.dev/schemas/cookbook/v1.json`&&e.$schema!==`https://s-m-r-t.dev/schemas/blueprint/v1.json`)return J(`This is not a cookbook: its "$schema" is not a cookbook schema this planner knows.`);let{version:n}=e;if(n===void 0)return J(`This is not a cookbook: it has no "version".`);if(typeof n!=`number`||!Number.isInteger(n))return J(`The cookbook "version" must be a whole number.`);if(n>1)return J(`This cookbook is version ${n}, newer than this planner understands (1). Update the planner or re-export it.`);if(n!==1)return J(`Cookbook version ${n} is not supported (this planner reads version 1).`);if(!X(e.recipes))return J(`The cookbook "recipes" must be a list of recipe ids.`);let r=e.recipes.filter(e=>!D.has(e)),i=[...new Set([...je(e.recipes.filter(e=>D.has(e)),D),...r])].sort(),a=[];if(e.features!==void 0){if(!X(e.features))return J(`The cookbook "features" must be a list of model names.`);let t=new Set;for(let n of e.features){if(t.has(n))return J(`The cookbook lists the feature ${n} more than once.`);t.add(n)}a=[...e.features].sort()}let o=new Set([...i.flatMap(e=>D.get(e)?.models??[]),...a]);if(!Array.isArray(e.policies))return J(`The cookbook "policies" must be a list.`);let s=[];for(let[t,n]of e.policies.entries()){let e=jn(n,`policies[${t}]`);if(typeof e==`string`)return J(`Invalid cookbook: ${e}.`);(o.has(e.objectRef)||Me(e))&&s.push(e)}let c;if(e.exposure!==void 0){if(!Y(e.exposure))return J(`The cookbook "exposure" must be an object.`);let t=[];for(let[n,r]of Object.entries(e.exposure)){if(!X(r)||!r.every(e=>An.has(e)))return J(`Invalid cookbook: exposure for ${n} must list api, mcp or cli.`);r.length&&o.has(n)&&t.push([n,[...r]])}c=Object.fromEntries(t)}let l;if(e.layout!==void 0){let t=Mn(e.layout);if(typeof t==`string`)return J(`Invalid cookbook: ${t}.`);l=On(Dn(t))}let u;if(e.theme!==void 0){let n=wn(e.theme);if(n.ok)u=n.theme;else if(!t.dropUnknownRecipes)return J(n.error)}let d,f=[];if(e.overviews!==void 0){if(t.overviews){let n=t.overviews(e.overviews,l);if(!n)return J(`The cookbook "overviews" must be an object.`);d=n.overviews,f=n.dropped}else{if(!Y(e.overviews))return J(`The cookbook "overviews" must be an object.`);Object.keys(e.overviews).length&&(f=[`Page customisations (overviews) are not kept by this host and were dropped.`])}}let p={$schema:q,version:1,recipes:i,features:a,policies:s};for(let t of[`name`,`description`]){let n=e[t];if(n!==void 0){if(typeof n!=`string`)return J(`The cookbook "${t}" must be a string.`);n.trim()&&(p[t]=n.trim())}}if(e.specs!==void 0){if(typeof e.specs!=`string`)return J(`The cookbook "specs" must be a string.`);e.specs.trim()&&(p.specs=e.specs.trim())}return c&&Object.keys(c).length&&(p.exposure=c),l&&(p.layout=l),u&&(p.theme=u),d&&Object.keys(d).length&&(p.overviews=d),f.length?{ok:!0,cookbook:p,dropped:f}:{ok:!0,cookbook:p}}var Pn=e=>({ok:!1,error:e});function Fn(e,t={}){return Nn(e,{...t,overviews:pn})}function In(e,t={}){let n;try{n=JSON.parse(e)}catch{return Pn(`This file is not valid JSON.`)}try{return Fn(n,t)}catch{return Pn(`This file is not a valid cookbook.`)}}var Z=`smrt-planner:cookbook-doc:v1`,Ln=`smrt-planner:blueprint:v1`,Rn=`smrt-planner:cookbook-doc:unreadable`;function zn(){try{return globalThis.localStorage??null}catch{return null}}function Bn(e){if(!e)return{status:`unavailable`};let t;try{t=e.getItem(Z)}catch{return{status:`unavailable`}}let n=null;try{n=e.getItem(Ln)}catch{}let r=t===null&&n!==null,i=r?n:t;if(i===null)return{status:`empty`};let a=In(i,{dropUnknownRecipes:!0});if(a.ok)return r&&Q(e,Z,JSON.stringify(a.cookbook)),{status:`loaded`,cookbook:a.cookbook,previousKept:n!==null,...a.dropped?{dropped:a.dropped}:{}};t=i;let o=Q(e,Rn,t);return{status:`unreadable`,reason:a.error,keptAside:o}}function Q(e,t,n){if(!e)return!1;try{return e.setItem(t,n),!0}catch{return!1}}function Vn(e,t){if(!e)return!1;try{return e.removeItem(t),!0}catch{return!1}}function Hn(e,t){return Q(e,Z,JSON.stringify(t))}function Un(e,t={}){let n={$schema:q,version:1,...Fe(e)};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.specs&&(n.specs=t.specs),t.layout&&(n.layout=t.layout);let r=Tn(t.theme);r&&(n.theme=r);let i=t.overviews??{},a=Object.keys(i).sort();return a.length&&(n.overviews=Object.fromEntries(a.map(e=>[e,i[e]]))),n}var Wn=new Set([`basic`,`advanced`,`hidden`]),Gn=new Set([`api`,`mcp`,`cli`]);function Kn(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t+`=`.repeat((4-t.length%4)%4));return new TextDecoder().decode(Uint8Array.from(n,e=>e.charCodeAt(0)))}function qn(e){let t=new URLSearchParams(e);return t.has(`r`)||t.has(`o`)}function Jn(e){let t={rows:[],narrowed:{}};if(!e)return t;let n;try{n=JSON.parse(Kn(e))}catch{return t}if(!n||typeof n!=`object`)return t;let r=[];for(let[e,t]of Object.entries(n.r??{}))if(t&&typeof t==`object`)for(let[n,i]of Object.entries(t)){if(!i||typeof i!=`object`)continue;let t={objectRef:e,fieldName:n,scopeType:`app`};typeof i.v==`string`&&Wn.has(i.v)&&(t.visibility=i.v),typeof i.l==`string`&&(t.label=i.l),(typeof i.h==`string`||i.h===null)&&(t.help=i.h),(typeof i.d==`string`||i.d===null)&&(t.defaultValue=i.d),typeof i.o==`number`&&Number.isFinite(i.o)&&(t.displayOrder=i.o),typeof i.k==`boolean`&&(t.locked=i.k),r.push(t)}let i={};for(let[e,t]of Object.entries(n.x??{})){if(!Array.isArray(t))continue;let n=t.filter(e=>Gn.has(e));n.length&&(i[e]=n)}return{rows:r,narrowed:i}}function Yn(e){let t=new URLSearchParams(e),n=(t.get(`r`)??``).split(`,`).filter(Boolean),r=je(Ie(n,D),D),i=new Set(r.flatMap(e=>D.get(e)?.models??[])),{rows:a,narrowed:o}=Jn(t.get(`o`)??``),s={$schema:q,version:1,recipes:r,features:[],policies:a.filter(e=>i.has(e.objectRef))},c=Object.fromEntries(Object.entries(o).filter(([e])=>i.has(e)));return Object.keys(c).length&&(s.exposure=c),s}var Xn=`smrt-planner:shell`;function $(e){let t=Pe(e),n=e.policies.some(e=>e.defaultValue!==void 0&&Me(e));s(Le(e)||n?t.taxRate:void 0),o({pricesIncludeTax:t.pricesIncludeTax,taxRounding:t.taxRounding,currency:t.currency})}var Zn=new class{#e=r(0);get replacementGeneration(){return e(this.#e)}set replacementGeneration(e){i(this.#e,e,!0)}#t=r();get layout(){return e(this.#t)}set layout(e){i(this.#t,e,!0)}#n=r();get name(){return e(this.#n)}set name(e){i(this.#n,e,!0)}#r=r();get description(){return e(this.#r)}set description(e){i(this.#r,e,!0)}#i=r();get specs(){return e(this.#i)}set specs(e){i(this.#i,e,!0)}#a=r();get theme(){return e(this.#a)}set theme(e){i(this.#a,e,!0)}#o=r({});get overviews(){return e(this.#o)}set overviews(e){i(this.#o,e)}#s=r(`unknown`);get persist(){return e(this.#s)}set persist(e){i(this.#s,e,!0)}#c=r(!1);get loaded(){return e(this.#c)}set loaded(e){i(this.#c,e,!0)}hostManaged=!1;#l=r(``);get loadNotice(){return e(this.#l)}set loadNotice(e){i(this.#l,e,!0)}saveBlocked=!1;#u=r(!1);get keepLegacyUrl(){return e(this.#u)}set keepLegacyUrl(e){i(this.#u,e,!0)}replacedBeforeLoad=!1;previousKept=!1;storage=null;timer;snapshot(){return Un(n(E.data),{layout:n(this.layout),theme:n(this.theme),overviews:n(this.overviews),name:this.name,description:this.description,specs:this.specs})}overview(e){return Object.hasOwn(this.overviews,e)?this.overviews[e]:null}setOverview(e,t){let n=Object.fromEntries(Object.entries(this.overviews).filter(([t])=>t!==e));t&&(n[e]=t),this.overviews=n}setLayout(e){this.layout=x(e)?void 0:e}setSpecs(e){let t=e.trimEnd();this.specs=t.trim()?t:void 0}apply(e){E.load(e),this.layout=e.layout,this.theme=e.theme,this.name=e.name,this.description=e.description,this.specs=e.specs,this.overviews={...e.overviews??{}},$(e)}get unavailableNotice(){let e=[...E.unavailableRecipes,...E.unavailableFeatures];if(!e.length)return``;let t=e.length;return`${t} ${t===1?`recipe`:`recipes`} in this cookbook ${t===1?`isn't`:`aren't`} available in this version: ${e.join(`, `)}. They are kept when you save or export.`}removeUnavailable(){E.removeUnavailable(),this.scheduleSave()}setTheme(e){this.theme=Tn(e)}settings(){return Pe(this.snapshot())}setSettings(e){let t=Ne(this.snapshot(),e);E.rows=t.policies.map(e=>({...e})),$(t)}replace(e){this.replacementGeneration++,this.apply(e),this.loaded||(this.replacedBeforeLoad=!0),this.saveBlocked=!1,this.keepLegacyUrl=!1}reset(e={}){this.replacementGeneration++,E.clear(),$({policies:[]}),this.layout=void 0,e.preserveTheme||(this.theme=void 0),this.name=void 0,this.description=void 0,this.specs=void 0,this.overviews={},this.saveBlocked=!1,this.keepLegacyUrl=!1}importText(e){let t=In(e);return t.ok&&this.replace(t.cookbook),t}hydrate(e,t=u()){this.storage=t;let n=Bn(t);n.status===`loaded`&&(this.previousKept=n.previousKept),n.status===`loaded`&&!this.replacedBeforeLoad?(this.apply(n.cookbook),n.dropped?.length&&(this.loadNotice=`Some saved page customisations could not be used and were removed: ${n.dropped.join(` `)}`)):n.status===`unreadable`&&(this.saveBlocked=!n.keptAside,this.loadNotice=n.keptAside?`The saved cookbook could not be read (${n.reason}) and was kept aside; starting empty.`:`The saved cookbook could not be read (${n.reason}). Starting empty without overwriting it; import or reset to save again.`);let r=!1;if(qn(e)&&(n.status===`loaded`&&!Q(t,`smrt-planner:cookbook-doc:backup`,JSON.stringify(n.cookbook))&&(this.saveBlocked=!0),this.apply(Yn(e)),r=!0),this.persist=n.status===`unavailable`?`memory`:`unknown`,this.loaded=!0,r){let e=this.save();this.keepLegacyUrl=!e}return r}save(){if(clearTimeout(this.timer),this.timer=void 0,!this.loaded)return!1;if(this.hostManaged)return!0;if(this.saveBlocked)return this.persist=`memory`,!1;let e=Hn(this.storage,this.snapshot());return this.persist=e?`ok`:`memory`,e&&this.previousKept&&(this.previousKept=!Vn(this.storage,Ln)),e&&(this.keepLegacyUrl=!1),e}scheduleSave(){this.loaded&&!this.hostManaged&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.save(),300))}flush(){this.timer!==void 0&&this.save()}};export{j as A,N as C,lt as D,pt as E,ot as O,mt as S,gt as T,Sn as _,zn as a,Qt as b,q as c,gn as d,hn as f,En as g,mn as h,Z as i,at as j,M as k,vn as l,G as m,Zn as n,Fn as o,yn as p,$ as r,In as s,Xn as t,bn as u,on as v,ht as w,F as x,$t as y};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BnDPWJHW.js","./DG3qFFTE.js","./COiEfhsA.js","./xihTtKlq.js","./BoVMZ9pI.js","./Bq8E3AWP.js","./DK8Blf1Y.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.BHwMQ9Zv.css","./2CZMWuMZ.js","./DptKR1hv.js","../assets/feedback.qFktqYFY.css","./CWhoR5nU.js","./BaNbYf_w.js","./icQ9pGib.js","../assets/SegmentedControl.DMqHG5fn.css","./DIE02RSm.js","../assets/webmcp-ui-context.hO24Ni5w.css","./hnmkjdq_.js","../assets/data.CVlX_W0i.css","./CUyVrfsu.js","./9L3dNfkK.js","../assets/forms.Zvn0Ncy0.css","./BYcBM-fh.js","../assets/AppShell.Y0ysizZK.css","./BkqGBcp-.js","../assets/workspace.C40zM0Mb.css","./DIQNmSES.js","./CuBVy8LW.js","../assets/state.C0UZEhxS.css","../assets/labels.Dxa6EyRI.css","./BegAToqi.js","./9S2SE2Cw.js","./BgFP_gck.js","../assets/planner.DOQVfcOi.css","./D_U_DYjx.js"])))=>i.map(i=>d[i]);
2
+ import{$ as e,Et as t,Mt as n,bt as r,vt as i}from"./DG3qFFTE.js";import{t as a}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{I as o,L as s,O as c,Q as l,W as u,Z as d,_ as f,_t as p,bt as m,et as h,h as g,ht as _,p as v,x as y,yt as b}from"./BoVMZ9pI.js";import{v as x}from"./CWhoR5nU.js";import"./icQ9pGib.js";import"./DIE02RSm.js";import{u as S}from"./hnmkjdq_.js";import{A as ee,C,E as te,F as ne,G as re,I as ie,M as ae,N as oe,O as se,P as ce,T as le,U as ue,V as de,W as w,b as fe,h as pe,j as me,k as he,n as ge,q as _e,r as ve,w as ye}from"./DIQNmSES.js";import{B as be,D as xe,G as Se,H as Ce,J as we,K as Te,M as Ee,V as De,X as Oe,Y as ke,Z as Ae,a as je,b as T,c as Me,d as Ne,l as Pe,n as Fe,r as Ie,s as Le,t as E,v as Re,x as D,z as ze}from"./CuBVy8LW.js";function Be(e){let t=e?.surfaces?.find(e=>e.kind===`widget`&&e.sectionDefault===!0);return t?{id:t.type,type:t.type,span:4,options:{}}:void 0}function Ve(e){let t=e.lastIndexOf(`#`);if(t<=0||t===e.length-1)return null;let n=e.slice(0,t),r=e.slice(t+1);return n.startsWith(`.`)||n.startsWith(`/`)||/\s/.test(n)||!/^[A-Za-z_$][\w$]*$/.test(r)?null:{specifier:n,exportName:r}}function O(e,t){let n=Ve(e);return n?Promise.resolve(t(n.specifier,n.exportName)).then(t=>{if(t==null)throw Error(`export "${e}" was not found`);return t}):Promise.reject(Error(`invalid export ref "${e}"`))}function k(e){let t;return()=>(t??=e(),t)}function He(e){return typeof e==`object`&&!!e&&`default`in e&&!!e.default}function Ue(e,t,n){let r=k(()=>O(e.export,t)),i=e.optionsEditor?k(()=>O(e.optionsEditor,t)):void 0,a=e.data?.load?k(()=>O(e.data?.load,t)):void 0,o={type:e.type,title:e.label,options:e.options??[],loadComponent:async()=>{let e=await r();return He(e)?e.default:e}};return e.description!==void 0&&(o.description=e.description),e.icon!==void 0&&(o.icon=e.icon),e.version!==void 0&&(o.version=e.version),e.allowedIn&&(o.allowedIn=e.allowedIn),e.defaultSpan!==void 0&&(o.defaultSpan=e.defaultSpan),e.minSpan!==void 0&&(o.minSpan=e.minSpan),e.maxSpan!==void 0&&(o.maxSpan=e.maxSpan),n&&(o.migrate=n),i&&(o.loadOptionsEditor=async()=>{let e=await i();return He(e)?e.default:e}),a&&(o.load=async(t,n)=>{let r=await a();if(typeof r!=`function`)throw Error(`loader "${e.data?.load}" is not a function`);return r(t,n)}),o}async function We(e,t,n,r={}){let i=[],a=[],o=[];for(let s of t)if(!r.enabled||r.enabled(s.id))for(let t of s.surfaces??[]){if(t.kind!==`widget`)continue;let c=(e,n)=>a.push({recipeId:s.id,type:t.type,reason:e,message:n});if(e.has(t.type)&&!r.replace){c(`duplicate_type`,`"${t.type}" is already registered`);continue}let l;if(t.migrate)try{let e=await O(t.migrate,n);if(typeof e!=`function`)throw Error(`not a function`);l=e}catch(e){c(`unresolved`,`migrate "${t.migrate}": ${e instanceof Error?e.message:String(e)}`);continue}try{o.push(e.register(Ue(t,n,l),{replace:r.replace})),i.push(t.type)}catch(e){c(`invalid`,e instanceof Error?e.message:String(e))}}return{registered:i,skipped:a,dispose:()=>{for(let e of o.splice(0))e()}}}var Ge=[`identifier`,`status`,`date`,`party`,`total`,`money`];function Ke(e){for(let t of[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`])if(e.includes(t))return t}function qe(e,t,n={}){let r=new Set(n.exclude??[]),i=n.max??4,a=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),o=e=>a.find(n=>t[n]?.includes(e)),s=[],c=e=>{e&&!s.includes(e)&&s.push(e)};c(o(`identifier`)??o(`title`));for(let e of Ge)e!==`identifier`&&(e===`money`&&s.some(e=>t[e]?.includes(`money`))||c(e===`date`?a.find(e=>t[e]?.includes(`date`)&&e!==`createdAt`&&e!==`updatedAt`)??o(`date`):o(e)));return s.slice(0,i).map(n=>({key:n,label:A(n,e),...Ke(t[n]??[])?{role:Ke(t[n]??[])}:{}}))}function Je(e,t,n={}){let r=new Set(n.exclude??[]),i=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),a=i.filter(t=>e.fields[t]?.type===`text`),o=a.find(e=>/^(?:description|title|name|label)$/.test(e))??a.find(e=>t[e]?.includes(`title`))??a.find(e=>!t[e]?.includes(`identifier`)),s=i.find(e=>t[e]?.includes(`quantity`)),c=i.filter(e=>t[e]?.includes(`money`)),l=c.find(e=>/unit|price|rate/i.test(e)),u=c.find(e=>/^(?:amount|lineTotal|total|lineAmount)$/.test(e))??[...c].reverse().find(e=>e!==l),d=[];return o&&d.push({key:o,label:A(o,e)}),s&&d.push({key:s,label:A(s,e),role:`quantity`}),l&&d.push({key:l,label:A(l,e),role:`money`,summarize:!1}),u&&u!==l&&d.push({key:u,label:A(u,e),role:`money`}),d}function A(e,t){let n=t.fields[e];return n&&(n.type===`foreignKey`||n.type===`crossPackageRef`)&&/.[a-z]Id$/.test(e)?ce(e.slice(0,-2)):ce(e)}function Ye(e){if(e.dataWidgets&&e.page)return[e.page];let t=[{id:`shortcuts`,type:`shortcuts`,span:4,options:{}}];if(e.dataWidgets&&e.lead){let n=e.lead,r=e.override,i=r&&typeof r==`object`&&!Array.isArray(r)?r:void 0,a=i?.changed;a&&typeof a==`object`&&!Array.isArray(a)&&Object.hasOwn(a,`count`)&&!(Array.isArray(i?.removed)&&i.removed.includes(`count`))&&t.push({id:`count`,type:`metric`,span:1,options:{title:n.plural,model:n.id,measure:`count`}}),t.push({id:`latest`,type:`records`,span:4,options:{title:`${n.name} records`,model:n.id,limit:5,summaries:!1}})}return t}var Xe=[`text`,`integer`,`decimal`,`boolean`,`datetime`,`json`,`foreignKey`,`crossPackageRef`];function Ze(e){return Xe.includes(e)?e:`text`}var Qe=/(Date|^date|period(Start|End))$/;function $e(e,t){return t.type===`datetime`&&!t.system&&Qe.test(t.name)&&!e.fields.some(e=>e.name===`allDay`)?`date`:void 0}function et(e){return fe(e)[0]}function tt(e,t){let n=t.ui?{...t.ui}:void 0,r=c(t)?`money`:$e(e,t);return{type:Ze(t.type),required:t.required,nullable:!t.required,...t.default===void 0?{}:{default:t.default},...t.description?{description:t.description}:{},...n?{ui:n}:{},...t.enum?.length?{enum:[...t.enum]}:{},...r?{format:r}:{},...et(e)===t.name?{display:!0}:{}}}function nt(e,t){return e.includes(`:`)?e:`${t.slice(0,t.lastIndexOf(`:`))}:${e}`}function rt(e,t){if(!t.related)return!1;let n=nt(t.related,e.id);return ke(p,n,h).some(t=>t.id===e.id)}function it(e){return e.fields.flatMap(t=>{if(t.type!==`foreignKey`&&t.type!==`crossPackageRef`||!t.related)return[];let n=m(nt(t.related,e.id));return n?[{field:t.name,kind:t.type===`crossPackageRef`?`crossPackageRef`:`foreignKey`,relatedCollection:n.model.collection,...rt(e,t)?{role:`items`}:{}}]:[]})}function j(e){let t=it(e);return{name:e.collection,objectRef:e.id,className:e.name,idField:`id`,fields:Object.fromEntries(e.fields.map(t=>[t.name,tt(e,t)])),...t.length?{relationships:t}:{}}}function at(e,t){return{objectRef:e.id,fields:Object.fromEntries(t.map((e,t)=>[e.name,{visibility:`basic`,label:e.label,help:e.help??null,order:t,required:e.required}]))}}function ot(e,t){let n=new Set(t);for(let t of e)for(let e of t.models)n.add(e);return n}function st(e){return v(e.replace(/_?id$/i,``)||e)}function M(e,t,n){let r=Oe(e,t),i=Ae(e,t).filter(e=>e.model.exposed&&n.has(e.model.id)),a=new Set(ke(e,t,h).map(e=>e.id)),o=new Map;for(let e of i)o.set(e.model.id,(o.get(e.model.id)??0)+1);let s=i.map(e=>{let t=a.has(e.model.id)?`items`:`children`,n=j(e.model),i=ie(n),s=[e.fk];return{model:e.model.id,field:e.fk,label:(o.get(e.model.id)??0)>1?`${Se(e.model.name,r)} (${st(e.fk).toLowerCase()})`:Se(e.model.name,r),kind:t,columns:t===`items`?Je(n,i,{exclude:s}):qe(n,i,{exclude:s,max:5}),...t===`items`&&`sortOrder`in n.fields?{sort:`sortOrder`}:{}}});for(let n of Te(e,t))s.push({model:n.model.id,field:n.fk,label:st(n.fk),kind:`reference`});return s}var ct=Symbol(`smrt-cookbook`);function lt(){return t(ct)}function ut(e,t){let{sections:n}=t;if(!n)throw Error(`the cookbook widget context is missing`);let r=typeof e.section==`string`?e.section:``,i=r?n.find(e=>e.id===`section:${r}`||e.id===`custom:${r}`)?.id:t.overviewId;if(!i)throw Error(`unknown section ${r}`);return oe(n,i)}function dt(e){return e?async(t,n)=>{let r=ut(t,n);try{let t=await e(n,r.items.map(e=>({...e})));if(!Array.isArray(t))return r;let i=new Set,a=[];for(let e of t){if(!e||typeof e.href!=`string`)continue;let t=typeof e.id==`string`&&e.id?e.id:e.href;i.has(t)&&(t=`${t}#${a.length}`),i.add(t),a.push({...e,id:t})}return{items:a}}catch(e){if(n.signal?.aborted)throw e;return r}}:ut}var ft=new Set([`foreignKey`,`crossPackageRef`]);function N(e,t){return`/m/${e}/${t}/`}function pt(e,t,n,r=`view`){let i=`${N(e,t)}${encodeURIComponent(n)}/`;return r===`edit`?`${i}edit/`:i}function mt(e,t,n,r){return`${N(e,t)}?${encodeURIComponent(n)}=${encodeURIComponent(r)}`}function ht(e,t){let n=new URLSearchParams(e);for(let e of t.fields){if(!ft.has(e.type))continue;let t=n.get(e.name);if(t)return{field:e.name,equals:t}}}function gt(e){return e?.equals===void 0?``:`${encodeURIComponent(e.field)}=${encodeURIComponent(e.equals)}`}var P=e=>typeof e==`number`&&Number.isSafeInteger(e)?e:null,_t=(e,t)=>e.fields.some(e=>e.name===t);function vt(e,t){let n=ie(j(e)),r=C(t,n);return Object.values(r).some(e=>P(e)!==null)?r:void 0}function yt(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}function bt(e,t,n){if(!yt(e,t)||![`subtotal`,`taxAmount`,`totalAmount`,`discountTotal`].every(t=>_t(e,t)))return;let r=P(t.subtotal),i=P(t.taxAmount),a=P(t.totalAmount),o=P(t.discountTotal)??0;if(r===null||i===null||a===null)return;let s=d(t,`exclusive`);return{subtotal:r,discount:o,tax:i,total:a,lineAmountType:s,roundingScope:l(t,`line`),showNetSubtotal:s===`inclusive`,taxes:_(n,s).flatMap(e=>e.taxComponentId?[{taxComponentId:e.taxComponentId,name:e.name,percent:e.percent,taxable:e.taxable,tax:e.tax}]:[])}}var F=de();function I(e){let{source:t,href:n}=e;if(!t||!n)throw Error(`the planner widget context is missing`);return{source:t,href:n}}function L(e){let t=typeof e==`string`?m(e):void 0;if(!t)throw Error(`unknown model ${String(e)}`);return{model:t.model,packageId:t.pkg.id,path:N(t.pkg.id,t.model.name)}}var R=new Set([`foreignKey`,`crossPackageRef`]);function z(e,t,n){let r=e.filter;if(typeof r!=`string`||r===``)return;if(r!==`parent`)throw Error(`unknown filter ${r}`);let{record:i}=t;if(!i?.id)throw Error(`the parent filter needs a record`);let a=typeof e.parentField==`string`&&e.parentField?e.parentField:e.field,o=typeof a==`string`?a:``,s=n.fields.find(e=>e.name===o);if(!s||!R.has(s.type))throw Error(`${n.name} has no reference field ${o}`);return{field:o,id:i.id}}async function B(e,t,n){return n?e.listWhere(t,n.field,n.id):e.list(t)}function V(e,t,n){return e(n?mt(t.packageId,t.model.name,n.field,n.id):t.path)}var H=e=>typeof e==`number`&&Number.isFinite(e);async function xt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o),l=V(r,i,o),u=typeof e.measure==`string`?e.measure:``;if(u===`count`||u===``)return{value:s.length,format:`integer`,href:l};let d=a.fields.find(t=>t.name===e.field);if(!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`);let f=s.map(e=>e[d.name]).filter(H),p=0;if(f.length){if(u===`sum`||u===`avg`)p=f.reduce((e,t)=>e+t,0),u===`avg`&&(p/=f.length);else if(u===`min`)p=Math.min(...f);else if(u===`max`)p=Math.max(...f);else throw Error(`unknown measure ${u}`)}let m=c(d);return{value:m?Math.round(p):p,format:m?`money`:d.type===`integer`?`integer`:`decimal`,...m?{currency:`USD`}:{},href:l}}function St(e,t){return H(e)&&H(t)?e-t:String(e??``).localeCompare(String(t??``))}var Ct=new Set([`createdAt`,`updatedAt`]),wt=[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`];function Tt(e=[]){return wt.find(t=>e.includes(t))}function Et(e,t,n,r){let i=j(e),a=r?[r]:[],o=ae(n),s=o.length?[]:pe(E.apply(e).fields.filter(t=>!a.includes(t.name)&&!xe(e,t))).filter(e=>!e.derive),c=o.length?o:s.map(e=>e.name),l=[...Je(i,t,{exclude:a}),...qe(i,t,{exclude:a,max:c.length+8})];return c.map(n=>{let r=e.fields.find(e=>e.name===n);if(!r)throw Error(`${e.name} has no field ${n}`);let i=l.find(e=>e.key===n),a=s.find(e=>e.name===n)?.label;if(i)return a?{...i,label:a}:i;let o=Tt(t[n]);return{key:n,label:a??(R.has(r.type)?v(n.replace(/Id$/,``)):v(n)),...o?{role:o}:{}}})}var Dt=new Set([`money`,`quantity`]);function Ot(e,t){let n={};for(let r of e)(r.summarize??Dt.has(r.role))&&(n[r.key]=t.reduce((e,t)=>{let n=t[r.key];return H(n)?e+n:e},0));return n}function kt(e,t){let n=ne(j(e)),r=new Set(t.map(e=>n?e[n]:void 0).filter(e=>typeof e==`string`&&e!==``));return r.size===1?[...r][0]??`USD`:`USD`}async function At(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o);if(typeof e.sort==`string`&&e.sort){if(!a.fields.find(t=>t.name===e.sort)&&!Ct.has(e.sort))throw Error(`${a.name} has no field ${e.sort}`);let t=s.some(t=>t[e.sort]!==void 0)?e.sort:W(a)?.name;if(t){let n=e.direction===`asc`?1:-1;s=[...s].sort((e,r)=>n*St(e[t],r[t]))}}let c=Et(a,ie(j(a)),e.columns,o?.field),l=H(e.limit)?e.limit:5,u=s.slice(0,l),d=a.fields.filter(e=>R.has(e.type)&&c.some(t=>t.key===e.name)),f=await ve(n,d,u),p=e=>Object.fromEntries(c.map(t=>{let n=e[t.key],r=d.find(e=>e.name===t.key);return r?.related&&typeof n==`string`&&n?[t.key,f.get(g(r.related,n))??``]:[t.key,n??null]})),m=Ot(c,s),h=!we(a);return{rows:await Promise.all(u.map(async e=>({id:String(e.id),title:await ge(n,a,e,0,o?.field),...h?{href:r(pt(i.packageId,a.name,String(e.id)))}:{},cells:p(e)}))),...e.summaries===!1?{}:{total:s.length},...h?{href:V(r,i,o)}:{},columns:c,currency:kt(a,s),...Object.keys(m).length?{summaries:m}:{}}}var jt={"7d":7,"30d":30,"90d":90,"12m":365,all:null},U=864e5;function Mt(e){return e===`7d`||e===`30d`?`day`:e===`90d`?`week`:`month`}function Nt(e,t){let n=new Date(e);if(t===`month`)return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1);let r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());return t===`week`?r-(n.getUTCDay()+6)%7*U:r}function Pt(e,t){if(t===`month`){let t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)}return e+(t===`week`?7:1)*U}function Ft(e,t){let n=new Date(e).toISOString();return t===`month`?n.slice(0,7):n.slice(0,10)}var It=e=>e.type===`datetime`&&!e.system;function W(e){let t=e.fields.filter(It);return t.find(e=>/^(issue|order|start|created)/i.test(e.name))??t[0]}function Lt(e){if(typeof e!=`string`&&typeof e!=`number`)return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}async function Rt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=typeof e.groupBy==`string`?e.groupBy:``,l=s?a.fields.find(e=>e.name===s):W(a);if(!l)throw Error(s?`${a.name} has no field ${s}`:`${a.name} has no date field to chart; choose a group-by field`);let u=typeof e.measure==`string`?e.measure:``,d;if(u&&u!==`count`){if(u!==`sum`&&u!==`avg`)throw Error(`unknown measure ${u}`);if(d=a.fields.find(t=>t.name===e.field),!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`)}let f=typeof e.period==`string`?e.period:`30d`;if(!Object.hasOwn(jt,f))throw Error(`unknown period ${f}`);let p=jt[f],m=It(l),h=m?l:W(a),g=p!==null&&h?y-p*U:-1/0,_=await B(n,a,o);h&&g!==-1/0&&(_=_.filter(e=>{let t=Lt(e[h.name]);return t!==void 0&&t>=g&&t<=y}));let v=new Map,b=(e,t,n)=>{let r=v.get(e)??{key:t,sum:0,n:0};if(d){let e=n[d.name];if(!H(e))return;r.sum+=e}r.n+=1,v.set(e,r)},x=Mt(f);if(m){let e=g===-1/0?Math.min(..._.map(e=>Lt(e[l.name])??y),y):g;for(let t=Nt(e,x);t<=y;t=Pt(t,x))v.set(Ft(t,x),{key:t,sum:0,n:0});for(let e of _){let t=Lt(e[l.name]);if(t===void 0)continue;let n=Nt(t,x);b(Ft(n,x),n,e)}}else for(let e of _){let t=e[l.name],n=t==null||t===``?`(none)`:String(t);b(n,n,e)}let S=d?c(d):!1,ee=e=>{if(!d)return e.n;let t=u===`avg`&&e.n?e.sum/e.n:e.sum;return S?Math.round(t):t},C=[...v.entries()].map(([e,t])=>({label:e,value:ee(t),key:t.key}));return C=m?C.sort((e,t)=>Number(e.key)-Number(t.key)):C.sort((e,t)=>t.value-e.value||e.label.localeCompare(t.label)),{points:C.map(({label:e,value:t})=>({label:e,value:t})),format:d?S?`money`:d.type===`integer`?`integer`:`decimal`:`integer`,...S?{currency:`USD`}:{},href:V(r,i,o)}}te(F,{metric:xt,records:At,chart:Rt,shortcuts:async(e,t)=>t,shortcuts:dt()});function zt(e){let{relations:t,viewAllHref:n}=e;if(!t)throw Error(`the record page context is missing`);return{relations:t,records:At,viewAllHref:n}}async function Bt(e,t){let{source:n}=I(e),r=e.record;if(!r?.id)throw Error(`line items need a record`);let{model:i}=L(r.model),a=await n.get(i,r.id);if(!a)return{};let o=t.find(e=>e.kind===`items`),s=o?m(o.model)?.model:void 0,c=bt(i,a,o&&s?await n.listWhere(s,o.field,r.id):[]),l=c?void 0:vt(i,a),u=ne(j(i)),d=u?a[u]:void 0;return{...c?{storedTotals:c}:{},...l?{totals:l}:{},...typeof d==`string`&&d?{currency:d}:{}}}F.register(le((e,t)=>he(zt(t))(e,t))),F.register(ye(async(e,t)=>{let n=zt(t),{totals:r,storedTotals:i,currency:a}=await Bt(t,n.relations);return se({...n,totals:()=>r,storedTotals:()=>i,currency:()=>a})(e,t)}));var Vt=[`shortcuts`,`metric`,`records`,`chart`,`note`],Ht={"@happyvertical/smrt-reports/svelte":async()=>({SavedReportsWidget:(await a(async()=>{let{default:e}=await import(`./BnDPWJHW.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]),import.meta.url)).default})},Ut=async(e,t)=>{let n=Ht[e];if(n)return(await n())[t]},Wt=T.filter(e=>e.surfaces?.some(e=>e.kind===`widget`)),Gt=Wt.flatMap(e=>(e.surfaces??[]).flatMap(e=>e.kind===`widget`?[e.type]:[]));We(F,Wt,Ut);var Kt=new Map(ze(T).map(e=>[`section:${e.id}`,e])),qt=p.packages.flatMap(e=>e.models.map(e=>e.id)),Jt=[...Vt,...Gt];function Yt(e){let t=Kt.get(e);for(let e of t?.recipes??[]){let t=Re(e)[0];if(t)return{id:t.model.id,name:v(t.model.name)}}}function Xt(e,t){let n=Be(Kt.get(e)?.recipes[0]),r=Yt(e);return Ye({lead:r?{...r,plural:f(r.name)}:void 0,dataWidgets:!0,page:n&&Gt.includes(n.type)?n:void 0,override:t})}var Zt=new Map;function Qt(e,t){if(!_e.test(e))return;let n=Zt.get(e);return n||(n=w({id:e,allowed:Jt,models:qt,defaults:Xt(e)}),Zt.set(e,n)),t===void 0?n:w({...n,defaults:Xt(e,t)})}function $t(e,t){return`detail:${e}.${t}`}var en=new Map(p.packages.flatMap(e=>e.models.filter(e=>e.exposed).map(t=>[me(t.id),{packageId:e.id,model:t}])));function tn(e){let[,t,n]=/^detail:([A-Za-z0-9_-]+)\.([A-Za-z0-9_]+)$/.exec(e)??[],r=t&&n?b(t,n):void 0;return t&&r?.exposed?{packageId:t,model:r}:en.get(e)}var nn=new Set(p.packages.flatMap(e=>e.models.filter(e=>e.exposed).map(e=>e.id))),rn=new Map;function an(e){let t=rn.get(e);if(t)return t;let n=tn(e);if(!n)return;let r=M(p,n.model.id,nn),i=ee(j(n.model),r,{id:e,maxMetrics:2*r.length});return t=w({...i,maxWidgets:Math.max(i.maxWidgets??24,i.defaults.length+24)}),rn.set(e,t),t}function on(e,t){let n=an(e),r=tn(e);if(!n||!r)return;let i=M(p,r.model.id,t),a=0,o=n.defaults.filter(e=>e.type===`line-items`?i.some(e=>e.kind===`items`):e.type===`related`?i.some(e=>e.kind===`children`):t.has(String(e.options.model))?e.type!==`metric`||(a+=1,a<=4):!1);return w({...n,defaults:o})}function sn(e,t){return e.startsWith(`detail:`)?an(e):Qt(e,t)}function cn(e,t){return Kt.has(e)||e===`section:${Ee.id}`?!0:e.startsWith(`detail:`)?tn(e)!==void 0:e.startsWith(`custom:`)&&_e.test(e)&&(t?.customSections??[]).some(t=>t.id===e)}var ln=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function un(e,t){let n=t.widgetId?`widget ${t.widgetId}${t.type?` (${t.type})`:``}`:`an entry`,r=t.options?.length?`: ${t.options.map(e=>`${e.key} ${e.code}`).join(`, `)}`:``;return`Overview ${e}: ${n} was dropped (${t.code}${r}).`}function dn(e,t){let n={...e};return e.added&&(n.added=e.added.filter(e=>!t.has(e.id))),e.changed&&(n.changed=Object.fromEntries(Object.entries(e.changed).filter(([e])=>!t.has(e)))),n}function fn(e,t){let n=sn(e,t);if(!n)return{override:null,issues:[{widgetId:null,type:null,code:`malformed`,message:`not an overview id`}]};let r=ue(n,t,F);if(r.ok){let e=re(t).override?.changed?.count;return e&&n.defaults.some(e=>e.id===`count`)?{override:{...r.override??{version:1},changed:{...r.override?.changed,count:e}},issues:[]}:{override:r.override,issues:[]}}let i=re(t),a=new Set(r.issues.flatMap(e=>e.widgetId?[e.widgetId]:[]));if(!i.override)return{override:null,issues:r.issues};let o=ue(n,dn(i.override,a),F);return o.ok?{override:o.override,issues:r.issues}:{override:null,issues:[...r.issues,...o.issues]}}function pn(e,t){if(!ln(e))return null;let n=[],r=[];for(let i of Object.keys(e).sort()){if(!cn(i,t)){r.push(`Overview ${i} is not a page in this app and was dropped.`);continue}let{override:a,issues:o}=fn(i,e[i]);for(let e of o)r.push(un(i,e));a&&n.push([i,a])}return{overviews:Object.fromEntries(n),dropped:r}}var mn=S,hn=`glass`,gn=`system`,_n=[`light`,`dark`,`system`],vn=[`none`,`sm`,`md`,`lg`,`xl`,`full`],yn=[`comfortable`,`touch`],bn=[`auto`,`standard`,`more`],G={"system-ui":`system-ui, -apple-system, "Segoe UI", sans-serif`,Inter:`Inter, system-ui, sans-serif`,Georgia:`Georgia, "Times New Roman", serif`,"ui-rounded":`ui-rounded, "SF Pro Rounded", system-ui, sans-serif`,"ui-monospace":`ui-monospace, "SF Mono", Menlo, monospace`},xn=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;function Sn(e){if(typeof e!=`string`)return null;let t=xn.exec(e.trim());if(!t)return null;let n=t[1].toLowerCase();return n.length===3&&(n=[...n].map(e=>e+e).join(``)),`#${n}`}var Cn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function wn(e){if(e===void 0)return{ok:!0,theme:void 0};if(!Cn(e))return{ok:!1,error:`The cookbook "theme" must be an object.`};let t={};if(e.preset!==void 0){if(typeof e.preset!=`string`||!mn.includes(e.preset))return{ok:!1,error:`The theme preset must be one of ${mn.join(`, `)}.`};t.preset=e.preset}if(e.colorScheme!==void 0){if(!_n.includes(e.colorScheme))return{ok:!1,error:`The theme colorScheme must be light, dark or system.`};t.colorScheme=e.colorScheme}for(let[n,r]of[[`borderRadius`,vn],[`density`,yn],[`contrast`,bn]]){let i=e[n];if(i!==void 0){if(!r.includes(i))return{ok:!1,error:`The theme ${n} must be one of ${r.join(`, `)}.`};t[n]=i}}if(e.fontFamily!==void 0){if(typeof e.fontFamily!=`string`||!Object.hasOwn(G,e.fontFamily))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};t.fontFamily=e.fontFamily}if(e.custom!==void 0){if(!Cn(e.custom))return{ok:!1,error:`The theme "custom" must be an object.`};let n=Sn(e.custom.primary);if(!n)return{ok:!1,error:`The theme custom primary must be a hex colour like #c2410c.`};let r={primary:n};if(e.custom.fontFamily!==void 0){let t=e.custom.fontFamily;if(typeof t!=`string`||!Object.hasOwn(G,t))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};r.fontFamily=t}t.custom=r}if(e.customCss!==void 0){if(typeof e.customCss!=`string`)return{ok:!1,error:`The theme customCss must be a string.`};if(Array.from(e.customCss).length>65536)return{ok:!1,error:`The theme customCss is too long (65,536 characters maximum).`};e.customCss&&(t.customCss=e.customCss)}return{ok:!0,theme:Object.keys(t).length?t:void 0}}function Tn(e){if(!e)return;let t={};return e.preset&&(t.preset=e.preset),e.colorScheme&&(t.colorScheme=e.colorScheme),e.borderRadius&&(t.borderRadius=e.borderRadius),e.density&&(t.density=e.density),e.contrast&&(t.contrast=e.contrast),e.fontFamily&&(t.fontFamily=e.fontFamily),e.custom&&(t.custom={...e.custom}),e.customCss&&(t.customCss=e.customCss),Object.keys(t).length?t:void 0}function En(e){let t=e?.colorScheme??`system`,n=e?.custom?`brand colour ${e.custom.primary}`:e?.preset??`glass`;return t===`system`?n:`${n}, ${t}`}var K=`section:`;function Dn(e,t=be(T)){let n=Object.keys(t).sort((e,t)=>t.length-e.length);if(!n.length)return e;let r=e=>{if(!e.startsWith(K))return e;let r=e.slice(8);for(let e of n){if(r===e)return`${K}${t[e]}`;if(r.startsWith(`${e}:`))return`${K}${t[e]}${r.slice(e.length)}`}return e},i=e=>e.startsWith(K)&&n.includes(e.slice(8)),a=e=>[...new Set(e)],o={...e};if(e.sectionOrder&&(o.sectionOrder=a(e.sectionOrder.map(r))),e.hidden&&(o.hidden=a(e.hidden.filter(e=>!i(e)).map(r))),e.itemOrder){let t={};for(let[n,i]of Object.entries(e.itemOrder)){let e=r(n);t[e]=a([...t[e]??[],...i.map(r)])}o.itemOrder=t}return e.moved&&(o.moved=Object.fromEntries(Object.entries(e.moved).map(([e,t])=>[r(e),r(t)]))),o}function On(e,t=T){let n=new Map;for(let e of t){let t=Ce(e).id;for(let r of Re(e))r.key&&n.set(`${K}${t}:${r.packageId}:${r.model.name}:${r.label}`,De(r.packageId,r.model.name,r.key))}let r=e=>{let t=n.get(e);if(t)return t;if(!e.startsWith(K))return e;let r=e.slice(8).split(`:`);return r.length<3||!r[1]||!r[2]?e:De(r[1],r[2])},i=e=>[...new Set(e)],a=(e,t)=>{let n={};for(let[i,a]of Object.entries(e)){let e=r(i);e in n||(n[e]=t(a))}return n},o={...e};return e.hidden&&(o.hidden=i(e.hidden.map(r))),e.itemOrder&&(o.itemOrder=a(e.itemOrder,e=>i(e.map(r)))),e.moved&&(o.moved=a(e.moved,r)),e.items&&(o.items=a(e.items,e=>e)),o}var q=`https://s-m-r-t.dev/schemas/cookbook/v1.json`,kn=new Set([`basic`,`advanced`,`hidden`]),An=new Set([`api`,`mcp`,`cli`]),J=e=>({ok:!1,error:e}),Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`);function jn(e,t){if(!Y(e))return`${t} is not an object`;let{objectRef:n,fieldName:r}=e;if(typeof n!=`string`||!n)return`${t} has no objectRef`;if(typeof r!=`string`||!r)return`${t} has no fieldName`;if(e.scopeType!==`app`)return`${t} must have scopeType "app"`;let i={objectRef:n,fieldName:r,scopeType:`app`};for(let n of[`defaultValue`,`help`,`label`]){let r=e[n];if(r!==void 0){if(typeof r!=`string`&&r!==null)return`${t}.${n} is invalid`;i[n]=r}}if(e.visibility!==void 0){let n=e.visibility;if(n!==null&&!(typeof n==`string`&&kn.has(n)))return`${t}.visibility is invalid`;i.visibility=n}if(e.displayOrder!==void 0){let n=e.displayOrder;if(n!==null&&!(typeof n==`number`&&Number.isFinite(n)))return`${t}.displayOrder is invalid`;i.displayOrder=n}if(e.locked!==void 0){if(e.locked!==null&&typeof e.locked!=`boolean`)return`${t}.locked is invalid`;i.locked=e.locked}return i}function Mn(e){if(!Y(e)||e.version!==1)return`layout must be an object with version 1`;for(let t of[`sectionOrder`,`hidden`])if(e[t]!==void 0&&!X(e[t]))return`layout.${t} must be a list of strings`;for(let t of[`itemOrder`,`moved`,`panels`])if(e[t]!==void 0&&!Y(e[t]))return`layout.${t} must be an object`;let t=e.itemOrder;if(Y(t)){for(let[e,n]of Object.entries(t))if(e===`__proto__`||!X(n))return`layout.itemOrder.${e} must be a list of strings`}let n=e.moved;if(Y(n)){for(let[e,t]of Object.entries(n))if(e===`__proto__`||typeof t!=`string`)return`layout.moved.${e} must be a string`}return e}function Nn(e,t={}){if(!Y(e))return J(`This is not a cookbook: expected a JSON object.`);if(e.$schema!==void 0&&e.$schema!==`https://s-m-r-t.dev/schemas/cookbook/v1.json`&&e.$schema!==`https://s-m-r-t.dev/schemas/blueprint/v1.json`)return J(`This is not a cookbook: its "$schema" is not a cookbook schema this planner knows.`);let{version:n}=e;if(n===void 0)return J(`This is not a cookbook: it has no "version".`);if(typeof n!=`number`||!Number.isInteger(n))return J(`The cookbook "version" must be a whole number.`);if(n>1)return J(`This cookbook is version ${n}, newer than this planner understands (1). Update the planner or re-export it.`);if(n!==1)return J(`Cookbook version ${n} is not supported (this planner reads version 1).`);if(!X(e.recipes))return J(`The cookbook "recipes" must be a list of recipe ids.`);let r=e.recipes.filter(e=>!D.has(e)),i=[...new Set([...je(e.recipes.filter(e=>D.has(e)),D),...r])].sort(),a=[];if(e.features!==void 0){if(!X(e.features))return J(`The cookbook "features" must be a list of model names.`);let t=new Set;for(let n of e.features){if(t.has(n))return J(`The cookbook lists the feature ${n} more than once.`);t.add(n)}a=[...e.features].sort()}let o=new Set([...i.flatMap(e=>D.get(e)?.models??[]),...a]);if(!Array.isArray(e.policies))return J(`The cookbook "policies" must be a list.`);let s=[];for(let[t,n]of e.policies.entries()){let e=jn(n,`policies[${t}]`);if(typeof e==`string`)return J(`Invalid cookbook: ${e}.`);(o.has(e.objectRef)||Me(e))&&s.push(e)}let c;if(e.exposure!==void 0){if(!Y(e.exposure))return J(`The cookbook "exposure" must be an object.`);let t=[];for(let[n,r]of Object.entries(e.exposure)){if(!X(r)||!r.every(e=>An.has(e)))return J(`Invalid cookbook: exposure for ${n} must list api, mcp or cli.`);r.length&&o.has(n)&&t.push([n,[...r]])}c=Object.fromEntries(t)}let l;if(e.layout!==void 0){let t=Mn(e.layout);if(typeof t==`string`)return J(`Invalid cookbook: ${t}.`);l=On(Dn(t))}let u;if(e.theme!==void 0){let n=wn(e.theme);if(n.ok)u=n.theme;else if(!t.dropUnknownRecipes)return J(n.error)}let d,f=[];if(e.overviews!==void 0){if(t.overviews){let n=t.overviews(e.overviews,l);if(!n)return J(`The cookbook "overviews" must be an object.`);d=n.overviews,f=n.dropped}else{if(!Y(e.overviews))return J(`The cookbook "overviews" must be an object.`);Object.keys(e.overviews).length&&(f=[`Page customisations (overviews) are not kept by this host and were dropped.`])}}let p={$schema:q,version:1,recipes:i,features:a,policies:s};for(let t of[`name`,`description`]){let n=e[t];if(n!==void 0){if(typeof n!=`string`)return J(`The cookbook "${t}" must be a string.`);n.trim()&&(p[t]=n.trim())}}if(e.specs!==void 0){if(typeof e.specs!=`string`)return J(`The cookbook "specs" must be a string.`);e.specs.trim()&&(p.specs=e.specs.trim())}return c&&Object.keys(c).length&&(p.exposure=c),l&&(p.layout=l),u&&(p.theme=u),d&&Object.keys(d).length&&(p.overviews=d),f.length?{ok:!0,cookbook:p,dropped:f}:{ok:!0,cookbook:p}}var Pn=e=>({ok:!1,error:e});function Fn(e,t={}){return Nn(e,{...t,overviews:pn})}function In(e,t={}){let n;try{n=JSON.parse(e)}catch{return Pn(`This file is not valid JSON.`)}try{return Fn(n,t)}catch{return Pn(`This file is not a valid cookbook.`)}}var Z=`smrt-planner:cookbook-doc:v1`,Ln=`smrt-planner:blueprint:v1`,Rn=`smrt-planner:cookbook-doc:unreadable`;function zn(){try{return globalThis.localStorage??null}catch{return null}}function Bn(e){if(!e)return{status:`unavailable`};let t;try{t=e.getItem(Z)}catch{return{status:`unavailable`}}let n=null;try{n=e.getItem(Ln)}catch{}let r=t===null&&n!==null,i=r?n:t;if(i===null)return{status:`empty`};let a=In(i,{dropUnknownRecipes:!0});if(a.ok)return r&&Q(e,Z,JSON.stringify(a.cookbook)),{status:`loaded`,cookbook:a.cookbook,previousKept:n!==null,...a.dropped?{dropped:a.dropped}:{}};t=i;let o=Q(e,Rn,t);return{status:`unreadable`,reason:a.error,keptAside:o}}function Q(e,t,n){if(!e)return!1;try{return e.setItem(t,n),!0}catch{return!1}}function Vn(e,t){if(!e)return!1;try{return e.removeItem(t),!0}catch{return!1}}function Hn(e,t){return Q(e,Z,JSON.stringify(t))}function Un(e,t={}){let n={$schema:q,version:1,...Fe(e)};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.specs&&(n.specs=t.specs),t.layout&&(n.layout=t.layout);let r=Tn(t.theme);r&&(n.theme=r);let i=t.overviews??{},a=Object.keys(i).sort();return a.length&&(n.overviews=Object.fromEntries(a.map(e=>[e,i[e]]))),n}var Wn=new Set([`basic`,`advanced`,`hidden`]),Gn=new Set([`api`,`mcp`,`cli`]);function Kn(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t+`=`.repeat((4-t.length%4)%4));return new TextDecoder().decode(Uint8Array.from(n,e=>e.charCodeAt(0)))}function qn(e){let t=new URLSearchParams(e);return t.has(`r`)||t.has(`o`)}function Jn(e){let t={rows:[],narrowed:{}};if(!e)return t;let n;try{n=JSON.parse(Kn(e))}catch{return t}if(!n||typeof n!=`object`)return t;let r=[];for(let[e,t]of Object.entries(n.r??{}))if(t&&typeof t==`object`)for(let[n,i]of Object.entries(t)){if(!i||typeof i!=`object`)continue;let t={objectRef:e,fieldName:n,scopeType:`app`};typeof i.v==`string`&&Wn.has(i.v)&&(t.visibility=i.v),typeof i.l==`string`&&(t.label=i.l),(typeof i.h==`string`||i.h===null)&&(t.help=i.h),(typeof i.d==`string`||i.d===null)&&(t.defaultValue=i.d),typeof i.o==`number`&&Number.isFinite(i.o)&&(t.displayOrder=i.o),typeof i.k==`boolean`&&(t.locked=i.k),r.push(t)}let i={};for(let[e,t]of Object.entries(n.x??{})){if(!Array.isArray(t))continue;let n=t.filter(e=>Gn.has(e));n.length&&(i[e]=n)}return{rows:r,narrowed:i}}function Yn(e){let t=new URLSearchParams(e),n=(t.get(`r`)??``).split(`,`).filter(Boolean),r=je(Ie(n,D),D),i=new Set(r.flatMap(e=>D.get(e)?.models??[])),{rows:a,narrowed:o}=Jn(t.get(`o`)??``),s={$schema:q,version:1,recipes:r,features:[],policies:a.filter(e=>i.has(e.objectRef))},c=Object.fromEntries(Object.entries(o).filter(([e])=>i.has(e)));return Object.keys(c).length&&(s.exposure=c),s}var Xn=`smrt-planner:shell`;function $(e){let t=Pe(e),n=e.policies.some(e=>e.defaultValue!==void 0&&Me(e));s(Le(e)||n?t.taxRate:void 0),o({pricesIncludeTax:t.pricesIncludeTax,taxRounding:t.taxRounding,currency:t.currency})}var Zn=new class{#e=r(0);get replacementGeneration(){return e(this.#e)}set replacementGeneration(e){i(this.#e,e,!0)}#t=r();get layout(){return e(this.#t)}set layout(e){i(this.#t,e,!0)}#n=r();get name(){return e(this.#n)}set name(e){i(this.#n,e,!0)}#r=r();get description(){return e(this.#r)}set description(e){i(this.#r,e,!0)}#i=r();get specs(){return e(this.#i)}set specs(e){i(this.#i,e,!0)}#a=r();get theme(){return e(this.#a)}set theme(e){i(this.#a,e,!0)}#o=r({});get overviews(){return e(this.#o)}set overviews(e){i(this.#o,e)}#s=r(`unknown`);get persist(){return e(this.#s)}set persist(e){i(this.#s,e,!0)}#c=r(!1);get loaded(){return e(this.#c)}set loaded(e){i(this.#c,e,!0)}hostManaged=!1;#l=r(``);get loadNotice(){return e(this.#l)}set loadNotice(e){i(this.#l,e,!0)}saveBlocked=!1;#u=r(!1);get keepLegacyUrl(){return e(this.#u)}set keepLegacyUrl(e){i(this.#u,e,!0)}replacedBeforeLoad=!1;previousKept=!1;storage=null;timer;snapshot(){return Un(n(E.data),{layout:n(this.layout),theme:n(this.theme),overviews:n(this.overviews),name:this.name,description:this.description,specs:this.specs})}overview(e){return Object.hasOwn(this.overviews,e)?this.overviews[e]:null}setOverview(e,t){let n=Object.fromEntries(Object.entries(this.overviews).filter(([t])=>t!==e));t&&(n[e]=t),this.overviews=n}setLayout(e){this.layout=x(e)?void 0:e}setSpecs(e){let t=e.trimEnd();this.specs=t.trim()?t:void 0}apply(e){E.load(e),this.layout=e.layout,this.theme=e.theme,this.name=e.name,this.description=e.description,this.specs=e.specs,this.overviews={...e.overviews??{}},$(e)}get unavailableNotice(){let e=[...E.unavailableRecipes,...E.unavailableFeatures];if(!e.length)return``;let t=e.length;return`${t} ${t===1?`recipe`:`recipes`} in this cookbook ${t===1?`isn't`:`aren't`} available in this version: ${e.join(`, `)}. They are kept when you save or export.`}removeUnavailable(){E.removeUnavailable(),this.scheduleSave()}setTheme(e){this.theme=Tn(e)}settings(){return Pe(this.snapshot())}setSettings(e){let t=Ne(this.snapshot(),e);E.rows=t.policies.map(e=>({...e})),$(t)}replace(e){this.replacementGeneration++,this.apply(e),this.loaded||(this.replacedBeforeLoad=!0),this.saveBlocked=!1,this.keepLegacyUrl=!1}reset(e={}){this.replacementGeneration++,E.clear(),$({policies:[]}),this.layout=void 0,e.preserveTheme||(this.theme=void 0),this.name=void 0,this.description=void 0,this.specs=void 0,this.overviews={},this.saveBlocked=!1,this.keepLegacyUrl=!1}importText(e){let t=In(e);return t.ok&&this.replace(t.cookbook),t}hydrate(e,t=u()){this.storage=t;let n=Bn(t);n.status===`loaded`&&(this.previousKept=n.previousKept),n.status===`loaded`&&!this.replacedBeforeLoad?(this.apply(n.cookbook),n.dropped?.length&&(this.loadNotice=`Some saved page customisations could not be used and were removed: ${n.dropped.join(` `)}`)):n.status===`unreadable`&&(this.saveBlocked=!n.keptAside,this.loadNotice=n.keptAside?`The saved cookbook could not be read (${n.reason}) and was kept aside; starting empty.`:`The saved cookbook could not be read (${n.reason}). Starting empty without overwriting it; import or reset to save again.`);let r=!1;if(qn(e)&&(n.status===`loaded`&&!Q(t,`smrt-planner:cookbook-doc:backup`,JSON.stringify(n.cookbook))&&(this.saveBlocked=!0),this.apply(Yn(e)),r=!0),this.persist=n.status===`unavailable`?`memory`:`unknown`,this.loaded=!0,r){let e=this.save();this.keepLegacyUrl=!e}return r}save(){if(clearTimeout(this.timer),this.timer=void 0,!this.loaded)return!1;if(this.hostManaged)return!0;if(this.saveBlocked)return this.persist=`memory`,!1;let e=Hn(this.storage,this.snapshot());return this.persist=e?`ok`:`memory`,e&&this.previousKept&&(this.previousKept=!Vn(this.storage,Ln)),e&&(this.keepLegacyUrl=!1),e}scheduleSave(){this.loaded&&!this.hostManaged&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.save(),300))}flush(){this.timer!==void 0&&this.save()}};export{j as A,N as C,lt as D,pt as E,ot as O,mt as S,gt as T,Sn as _,zn as a,Qt as b,q as c,gn as d,hn as f,En as g,mn as h,Z as i,at as j,M as k,vn as l,G as m,Zn as n,Fn as o,yn as p,$ as r,In as s,Xn as t,bn as u,on as v,ht as w,F as x,$t as y};
@@ -1 +1 @@
1
- import"./DG3qFFTE.js";import{c as e}from"./BBYjYdwL.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
1
+ import"./DG3qFFTE.js";import{c as e}from"./Dx3XnAZJ.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
@@ -1 +1 @@
1
- import{t as e}from"./DjWoxxBo.js";var t=new Map;function n(n,r){if(e())return 0;if(typeof document>`u`)return r;let i=t.get(n);if(i!==void 0)return i;let a=getComputedStyle(document.documentElement).getPropertyValue(`--smrt-duration-${n}`).trim(),o=/^([\d.]+)(ms|s)$/.exec(a),s=o?Number(o[1])*(o[2]===`s`?1e3:1):r;return t.set(n,s),s}export{n as t};
1
+ import{t as e}from"./CzdJFGwk.js";var t=new Map;function n(n,r){if(e())return 0;if(typeof document>`u`)return r;let i=t.get(n);if(i!==void 0)return i;let a=getComputedStyle(document.documentElement).getPropertyValue(`--smrt-duration-${n}`).trim(),o=/^([\d.]+)(ms|s)$/.exec(a),s=o?Number(o[1])*(o[2]===`s`?1e3:1):r;return t.set(n,s),s}export{n as t};