@react-pakistan/util-functions 2.0.2 → 3.0.1

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 (369) hide show
  1. package/constants/api-methods.d.mts +13 -0
  2. package/constants/api-methods.mjs +1 -0
  3. package/constants/cache-time.d.mts +7 -0
  4. package/constants/cache-time.mjs +1 -0
  5. package/constants/countries-timezones.d.mts +8 -0
  6. package/constants/countries-timezones.mjs +1 -0
  7. package/constants/currencies.d.mts +14 -0
  8. package/constants/currencies.mjs +1 -0
  9. package/constants/dial-codes.d.mts +9 -0
  10. package/constants/dial-codes.mjs +1 -0
  11. package/constants/layout-direction.d.mts +6 -0
  12. package/constants/layout-direction.mjs +1 -0
  13. package/constants/react-pakistan-meta.d.mts +32 -0
  14. package/constants/react-pakistan-meta.mjs +1 -0
  15. package/constants/react-pakistan.d.mts +15 -0
  16. package/constants/react-pakistan.mjs +12 -0
  17. package/constants/select-value-delimiter.d.mts +12 -0
  18. package/constants/select-value-delimiter.mjs +1 -0
  19. package/constants/social-media-colors.d.mts +40 -0
  20. package/constants/social-media-colors.mjs +1 -0
  21. package/constants/social-media-sizes.d.mts +323 -0
  22. package/constants/social-media-sizes.mjs +1 -0
  23. package/constants/user-roles.d.mts +7 -0
  24. package/constants/user-roles.mjs +1 -0
  25. package/factory/generic-component-factory.d.mts +78 -0
  26. package/factory/generic-component-factory.mjs +1 -0
  27. package/factory/generic-module-factory.d.mts +80 -0
  28. package/factory/generic-module-factory.mjs +1 -0
  29. package/general/basic-get.d.mts +8 -0
  30. package/general/basic-get.mjs +1 -0
  31. package/general/basic-post.d.mts +8 -0
  32. package/general/basic-post.mjs +1 -0
  33. package/general/calculate-pages.d.mts +9 -0
  34. package/general/calculate-pages.mjs +1 -0
  35. package/general/camel-to-sentence-case.d.mts +12 -0
  36. package/general/camel-to-sentence-case.mjs +1 -0
  37. package/general/check-even-odd-length.d.mts +13 -0
  38. package/general/check-even-odd-length.mjs +1 -0
  39. package/general/clear-cache.d.mts +10 -0
  40. package/general/clear-cache.mjs +1 -0
  41. package/general/cnic-formatter.d.mts +20 -0
  42. package/general/cnic-formatter.mjs +1 -0
  43. package/general/convert-url-to-base64.d.mts +57 -0
  44. package/general/convert-url-to-base64.mjs +1 -0
  45. package/general/countries.d.mts +268 -0
  46. package/general/countries.mjs +1 -0
  47. package/general/create-date.d.mts +12 -0
  48. package/general/create-date.js +1 -1
  49. package/general/create-date.mjs +1 -0
  50. package/general/crypto.d.mts +11 -0
  51. package/general/crypto.mjs +1 -0
  52. package/general/currencies.d.mts +2 -0
  53. package/general/currencies.mjs +0 -0
  54. package/general/delete-image-from-private-supabase.d.mts +16 -0
  55. package/general/delete-image-from-private-supabase.mjs +1 -0
  56. package/general/delete-image-from-public-supabase.d.mts +16 -0
  57. package/general/delete-image-from-public-supabase.mjs +1 -0
  58. package/general/download-from-url.d.mts +8 -0
  59. package/general/download-from-url.mjs +1 -0
  60. package/general/dynamic-page-limit.d.mts +12 -0
  61. package/general/dynamic-page-limit.mjs +1 -0
  62. package/general/enum-to-text.d.mts +8 -0
  63. package/general/enum-to-text.mjs +1 -0
  64. package/general/fetch-data.d.mts +25 -0
  65. package/general/fetch-data.mjs +1 -0
  66. package/general/fetch-supabase-image.d.mts +16 -0
  67. package/general/fetch-supabase-image.mjs +1 -0
  68. package/general/fetch-supabase-private-assets.d.mts +15 -0
  69. package/general/fetch-supabase-private-assets.mjs +1 -0
  70. package/general/format-date.d.mts +18 -0
  71. package/general/format-date.mjs +1 -0
  72. package/general/format-number.d.mts +16 -0
  73. package/general/format-number.mjs +1 -0
  74. package/general/format-phone-display.d.mts +9 -0
  75. package/general/format-phone-display.js +1 -1
  76. package/general/format-phone-display.mjs +1 -0
  77. package/general/format-phone.d.mts +13 -0
  78. package/general/format-phone.d.ts +1 -3
  79. package/general/format-phone.js +1 -1
  80. package/general/format-phone.mjs +1 -0
  81. package/general/format-pricing.d.mts +8 -0
  82. package/general/format-pricing.mjs +1 -0
  83. package/general/format-secs.d.mts +8 -0
  84. package/general/format-secs.mjs +1 -0
  85. package/general/format-time.d.mts +11 -0
  86. package/general/format-time.mjs +1 -0
  87. package/general/format-value.d.mts +8 -0
  88. package/general/format-value.mjs +1 -0
  89. package/general/full-month-range.d.mts +13 -0
  90. package/general/full-month-range.mjs +1 -0
  91. package/general/full-year-range.d.mts +12 -0
  92. package/general/full-year-range.mjs +1 -0
  93. package/general/generate-article-schema.d.mts +50 -0
  94. package/general/generate-article-schema.mjs +1 -0
  95. package/general/generate-blog-schema.d.mts +37 -0
  96. package/general/generate-blog-schema.mjs +1 -0
  97. package/general/generate-book-schema.d.mts +58 -0
  98. package/general/generate-book-schema.mjs +1 -0
  99. package/general/generate-breadcrumb-schema.d.mts +40 -0
  100. package/general/generate-breadcrumb-schema.mjs +1 -0
  101. package/general/generate-carousel-schema.d.mts +52 -0
  102. package/general/generate-carousel-schema.mjs +1 -0
  103. package/general/generate-course-schema.d.mts +53 -0
  104. package/general/generate-course-schema.mjs +1 -0
  105. package/general/generate-dataset-schema.d.mts +65 -0
  106. package/general/generate-dataset-schema.mjs +1 -0
  107. package/general/generate-discussion-forum-schema.d.mts +39 -0
  108. package/general/generate-discussion-forum-schema.mjs +1 -0
  109. package/general/generate-education-schema.d.mts +68 -0
  110. package/general/generate-education-schema.mjs +1 -0
  111. package/general/generate-employer-aggregate-rating-schema.d.mts +29 -0
  112. package/general/generate-employer-aggregate-rating-schema.mjs +1 -0
  113. package/general/generate-event-schema.d.mts +63 -0
  114. package/general/generate-event-schema.mjs +1 -0
  115. package/general/generate-faq-schema.d.mts +32 -0
  116. package/general/generate-faq-schema.mjs +1 -0
  117. package/general/generate-grid.d.mts +17 -0
  118. package/general/generate-grid.mjs +1 -0
  119. package/general/generate-image-metadata-schema.d.mts +36 -0
  120. package/general/generate-image-metadata-schema.mjs +1 -0
  121. package/general/generate-job-posting-schema.d.mts +49 -0
  122. package/general/generate-job-posting-schema.mjs +1 -0
  123. package/general/generate-local-business-schema.d.mts +42 -0
  124. package/general/generate-local-business-schema.mjs +1 -0
  125. package/general/generate-math-solver-schema.d.mts +45 -0
  126. package/general/generate-math-solver-schema.mjs +1 -0
  127. package/general/generate-movie-carousel-schema.d.mts +51 -0
  128. package/general/generate-movie-carousel-schema.mjs +1 -0
  129. package/general/generate-organization-schema.d.mts +49 -0
  130. package/general/generate-organization-schema.mjs +1 -0
  131. package/general/generate-profile-page-schema.d.mts +37 -0
  132. package/general/generate-profile-page-schema.mjs +1 -0
  133. package/general/generate-qa-page-schema.d.mts +34 -0
  134. package/general/generate-qa-page-schema.mjs +1 -0
  135. package/general/generate-recipe-schema.d.mts +49 -0
  136. package/general/generate-recipe-schema.mjs +1 -0
  137. package/general/generate-ref.d.mts +11 -0
  138. package/general/generate-ref.js +1 -1
  139. package/general/generate-ref.mjs +1 -0
  140. package/general/generate-review-snippet-schema.d.mts +52 -0
  141. package/general/generate-review-snippet-schema.mjs +1 -0
  142. package/general/generate-shopping-loyalty-program-schema.d.mts +38 -0
  143. package/general/generate-shopping-loyalty-program-schema.mjs +1 -0
  144. package/general/generate-shopping-merchant-listing-schema.d.mts +53 -0
  145. package/general/generate-shopping-merchant-listing-schema.mjs +1 -0
  146. package/general/generate-shopping-merchant-return-policy-schema.d.mts +32 -0
  147. package/general/generate-shopping-merchant-return-policy-schema.mjs +1 -0
  148. package/general/generate-shopping-merchant-shipping-policy-schema.d.mts +36 -0
  149. package/general/generate-shopping-merchant-shipping-policy-schema.mjs +1 -0
  150. package/general/generate-shopping-overview-schema.d.mts +52 -0
  151. package/general/generate-shopping-overview-schema.mjs +1 -0
  152. package/general/generate-shopping-product-snippet-schema.d.mts +57 -0
  153. package/general/generate-shopping-product-snippet-schema.mjs +1 -0
  154. package/general/generate-shopping-variants-schema.d.mts +46 -0
  155. package/general/generate-shopping-variants-schema.mjs +1 -0
  156. package/general/generate-software-app-schema.d.mts +62 -0
  157. package/general/generate-software-app-schema.mjs +1 -0
  158. package/general/generate-speakable-schema.d.mts +64 -0
  159. package/general/generate-speakable-schema.mjs +1 -0
  160. package/general/generate-subscription-schema.d.mts +60 -0
  161. package/general/generate-subscription-schema.mjs +1 -0
  162. package/general/generate-vacation-rental-schema.d.mts +67 -0
  163. package/general/generate-vacation-rental-schema.mjs +1 -0
  164. package/general/generate-video-schema.d.mts +75 -0
  165. package/general/generate-video-schema.mjs +1 -0
  166. package/general/generic-cache.d.mts +193 -0
  167. package/general/generic-cache.mjs +1 -0
  168. package/general/get-available-page-limit.d.mts +11 -0
  169. package/general/get-available-page-limit.mjs +1 -0
  170. package/general/get-calendar-current-month.d.mts +15 -0
  171. package/general/get-calendar-current-month.js +1 -1
  172. package/general/get-calendar-current-month.mjs +1 -0
  173. package/general/get-calendar-dates.d.mts +15 -0
  174. package/general/get-calendar-dates.js +1 -1
  175. package/general/get-calendar-dates.mjs +1 -0
  176. package/general/get-calendar-next-month.d.mts +17 -0
  177. package/general/get-calendar-next-month.js +1 -1
  178. package/general/get-calendar-next-month.mjs +1 -0
  179. package/general/get-calendar-previous-month.d.mts +17 -0
  180. package/general/get-calendar-previous-month.js +1 -1
  181. package/general/get-calendar-previous-month.mjs +1 -0
  182. package/general/get-current-year.d.mts +7 -0
  183. package/general/get-current-year.mjs +1 -0
  184. package/general/get-day-name.d.mts +10 -0
  185. package/general/get-day-name.mjs +1 -0
  186. package/general/get-dial-code.d.mts +8 -0
  187. package/general/get-dial-code.mjs +1 -0
  188. package/general/get-full-name.d.mts +13 -0
  189. package/general/get-full-name.mjs +1 -0
  190. package/general/get-href.d.mts +11 -0
  191. package/general/get-href.mjs +1 -0
  192. package/general/get-month-name.d.mts +10 -0
  193. package/general/get-month-name.mjs +1 -0
  194. package/general/get-month-number.d.mts +15 -0
  195. package/general/get-month-number.mjs +1 -0
  196. package/general/get-number-of-days-in-month.d.mts +13 -0
  197. package/general/get-number-of-days-in-month.js +1 -1
  198. package/general/get-number-of-days-in-month.mjs +1 -0
  199. package/general/get-pathname.d.mts +11 -0
  200. package/general/get-pathname.mjs +1 -0
  201. package/general/get-week-day.d.mts +8 -0
  202. package/general/get-week-day.js +1 -1
  203. package/general/get-week-day.mjs +1 -0
  204. package/general/image-url-to-base64.d.mts +9 -0
  205. package/general/image-url-to-base64.mjs +1 -0
  206. package/general/is-created-or-updated.d.mts +13 -0
  207. package/general/is-created-or-updated.mjs +1 -0
  208. package/general/is-next-button-disabled.d.mts +9 -0
  209. package/general/is-next-button-disabled.mjs +1 -0
  210. package/general/is-odd.d.mts +11 -0
  211. package/general/is-odd.mjs +1 -0
  212. package/general/is-previous-button-disabled.d.mts +8 -0
  213. package/general/is-previous-button-disabled.mjs +1 -0
  214. package/general/linear-gradients.d.mts +14 -0
  215. package/general/linear-gradients.mjs +1 -0
  216. package/general/multi-part-search.d.mts +22 -0
  217. package/general/multi-part-search.mjs +1 -0
  218. package/general/normalize-phone.d.mts +15 -0
  219. package/general/normalize-phone.js +1 -1
  220. package/general/normalize-phone.mjs +1 -0
  221. package/general/parse-frontmatter.d.mts +36 -0
  222. package/general/parse-frontmatter.mjs +2 -0
  223. package/general/remove-data-image-prefix.d.mts +8 -0
  224. package/general/remove-data-image-prefix.mjs +1 -0
  225. package/general/repeat-times.d.mts +15 -0
  226. package/general/repeat-times.mjs +1 -0
  227. package/general/resolve-anchor-link.d.mts +13 -0
  228. package/general/resolve-anchor-link.mjs +1 -0
  229. package/general/resolve-current-date.d.mts +12 -0
  230. package/general/resolve-current-date.mjs +1 -0
  231. package/general/resolve-grid.d.mts +14 -0
  232. package/general/resolve-grid.mjs +1 -0
  233. package/general/resolve-initials.d.mts +12 -0
  234. package/general/resolve-initials.mjs +1 -0
  235. package/general/set-timezone.d.mts +9 -0
  236. package/general/set-timezone.d.ts +1 -3
  237. package/general/set-timezone.js +1 -1
  238. package/general/set-timezone.mjs +1 -0
  239. package/general/slugify.d.mts +12 -0
  240. package/general/slugify.mjs +1 -0
  241. package/general/text-to-enum.d.mts +8 -0
  242. package/general/text-to-enum.mjs +1 -0
  243. package/general/text-to-sentence-case.d.mts +12 -0
  244. package/general/text-to-sentence-case.mjs +1 -0
  245. package/general/time-out.d.mts +12 -0
  246. package/general/time-out.mjs +1 -0
  247. package/general/time-zones.d.mts +11 -0
  248. package/general/time-zones.mjs +1 -0
  249. package/general/truncate-text.d.mts +14 -0
  250. package/general/truncate-text.mjs +1 -0
  251. package/general/type.d.mts +8 -0
  252. package/general/type.mjs +0 -0
  253. package/general/upload-blob-to-private-supabase.d.mts +24 -0
  254. package/general/upload-blob-to-private-supabase.mjs +1 -0
  255. package/general/upload-blob-to-public-supabase.d.mts +24 -0
  256. package/general/upload-blob-to-public-supabase.mjs +1 -0
  257. package/general/upload-image-to-private-supabase.d.mts +26 -0
  258. package/general/upload-image-to-private-supabase.mjs +1 -0
  259. package/general/upload-image-to-public-supabase.d.mts +26 -0
  260. package/general/upload-image-to-public-supabase.mjs +1 -0
  261. package/general/url-to-sentence-case.d.mts +12 -0
  262. package/general/url-to-sentence-case.mjs +1 -0
  263. package/general/validate-comment.d.mts +14 -0
  264. package/general/validate-comment.mjs +1 -0
  265. package/general/validate-email.d.mts +15 -0
  266. package/general/validate-email.mjs +1 -0
  267. package/general/validate-form.d.mts +18 -0
  268. package/general/validate-form.mjs +1 -0
  269. package/general/validate-name.d.mts +14 -0
  270. package/general/validate-name.mjs +1 -0
  271. package/hooks/use-change.d.mts +11 -0
  272. package/hooks/use-change.mjs +1 -0
  273. package/hooks/use-debounce.d.mts +10 -0
  274. package/hooks/use-debounce.mjs +1 -0
  275. package/hooks/use-fetch.d.mts +42 -0
  276. package/hooks/use-fetch.mjs +1 -0
  277. package/hooks/use-force-render.d.mts +14 -0
  278. package/hooks/use-force-render.mjs +1 -0
  279. package/hooks/use-ip-geo-location.d.mts +12 -0
  280. package/hooks/use-ip-geo-location.mjs +1 -0
  281. package/hooks/use-is-mobile.d.mts +8 -0
  282. package/hooks/use-is-mobile.mjs +1 -0
  283. package/hooks/use-module-entity-v2.d.mts +105 -0
  284. package/hooks/use-module-entity-v2.mjs +1 -0
  285. package/hooks/use-module-entity.d.mts +98 -0
  286. package/hooks/use-module-entity.mjs +1 -0
  287. package/hooks/use-phone-formatter.d.mts +17 -0
  288. package/hooks/use-phone-formatter.d.ts +1 -3
  289. package/hooks/use-phone-formatter.js +1 -1
  290. package/hooks/use-phone-formatter.mjs +1 -0
  291. package/hooks/use-position.d.mts +29 -0
  292. package/hooks/use-position.mjs +1 -0
  293. package/hooks/use-rtl.d.mts +46 -0
  294. package/hooks/use-rtl.mjs +1 -0
  295. package/hooks/use-sticky.d.mts +13 -0
  296. package/hooks/use-sticky.mjs +1 -0
  297. package/hooks/use-toggle-state.d.mts +14 -0
  298. package/hooks/use-toggle-state.mjs +1 -0
  299. package/hooks/use-window-event-listener.d.mts +9 -0
  300. package/hooks/use-window-event-listener.mjs +1 -0
  301. package/hooks/with-seo.d.mts +19 -0
  302. package/hooks/with-seo.mjs +1 -0
  303. package/local-storage/get-storage-value.d.mts +5 -0
  304. package/local-storage/get-storage-value.mjs +1 -0
  305. package/local-storage/remove-storage-value.d.mts +3 -0
  306. package/local-storage/remove-storage-value.mjs +1 -0
  307. package/local-storage/set-storage-value.d.mts +3 -0
  308. package/local-storage/set-storage-value.mjs +1 -0
  309. package/local-storage/type.d.mts +3 -0
  310. package/local-storage/type.mjs +0 -0
  311. package/npm.d.d.mts +2 -0
  312. package/npm.d.mjs +0 -0
  313. package/package.json +1 -10
  314. package/edu-pilot-pro/types/academics.d.ts +0 -2
  315. package/edu-pilot-pro/types/academics.js +0 -1
  316. package/edu-pilot-pro/types/admission.d.ts +0 -878
  317. package/edu-pilot-pro/types/admission.js +0 -1
  318. package/edu-pilot-pro/types/communication.d.ts +0 -2
  319. package/edu-pilot-pro/types/communication.js +0 -1
  320. package/edu-pilot-pro/types/enums.d.ts +0 -413
  321. package/edu-pilot-pro/types/enums.js +0 -1
  322. package/edu-pilot-pro/types/finance.d.ts +0 -2
  323. package/edu-pilot-pro/types/finance.js +0 -1
  324. package/edu-pilot-pro/types/index.d.ts +0 -2
  325. package/edu-pilot-pro/types/index.js +0 -1
  326. package/edu-pilot-pro/types/user-management.d.ts +0 -2
  327. package/edu-pilot-pro/types/user-management.js +0 -1
  328. package/stellar-solution/types/common.d.ts +0 -26
  329. package/stellar-solution/types/common.js +0 -1
  330. package/stellar-solution/types/erp.d.ts +0 -305
  331. package/stellar-solution/types/erp.js +0 -1
  332. package/stellar-solution/types/index.d.ts +0 -3
  333. package/stellar-solution/types/index.js +0 -1
  334. package/stellar-solution/types/pos.d.ts +0 -179
  335. package/stellar-solution/types/pos.js +0 -1
  336. package/storybook/generate-sitemap.d.ts +0 -16
  337. package/storybook/generate-sitemap.js +0 -17
  338. package/storybook/preview.d.ts +0 -148
  339. package/storybook/preview.js +0 -1
  340. package/storybook/react-design-story-script.d.ts +0 -12
  341. package/storybook/react-design-story-script.js +0 -5
  342. package/storybook/react-emoji-collection.d.ts +0 -13
  343. package/storybook/react-emoji-collection.js +0 -11
  344. package/storybook/react-emoji-story-script.d.ts +0 -12
  345. package/storybook/react-emoji-story-script.js +0 -5
  346. package/storybook/react-emoji-story-template.d.ts +0 -14
  347. package/storybook/react-emoji-story-template.js +0 -46
  348. package/storybook/react-icon-collection.d.ts +0 -13
  349. package/storybook/react-icon-collection.js +0 -11
  350. package/storybook/react-icon-story-script.d.ts +0 -12
  351. package/storybook/react-icon-story-script.js +0 -5
  352. package/storybook/react-icon-story-template.d.ts +0 -13
  353. package/storybook/react-icon-story-template.js +0 -46
  354. package/storybook/react-logo-collection.d.ts +0 -13
  355. package/storybook/react-logo-collection.js +0 -11
  356. package/storybook/react-logo-story-script.d.ts +0 -12
  357. package/storybook/react-logo-story-script.js +0 -5
  358. package/storybook/react-logo-story-template.d.ts +0 -13
  359. package/storybook/react-logo-story-template.js +0 -46
  360. package/storybook/react-pakistan-theme.d.ts +0 -25
  361. package/storybook/react-pakistan-theme.js +0 -1
  362. package/storybook/responsive-args.d.ts +0 -22
  363. package/storybook/responsive-args.js +0 -1
  364. package/storybook/responsive-component.d.ts +0 -33
  365. package/storybook/responsive-component.js +0 -37
  366. package/storybook/responsive-screens.d.ts +0 -108
  367. package/storybook/responsive-screens.js +0 -1
  368. package/storybook/theme.d.ts +0 -96
  369. package/storybook/theme.js +0 -1
@@ -0,0 +1,57 @@
1
+ /**
2
+ * URL to Base64 Conversion Utility
3
+ *
4
+ * Functions to convert URLs to base64 encoded strings.
5
+ */
6
+ /**
7
+ * Convert a URL to base64 encoded string
8
+ *
9
+ * @param url - The URL to fetch and convert
10
+ * @returns Promise<string> - Base64 encoded string
11
+ * @throws Error if the URL cannot be fetched or converted
12
+ */
13
+ declare function convertUrlToBase64(url: string): Promise<string>;
14
+ /**
15
+ * Convert a URL to base64 data URI format
16
+ *
17
+ * @param url - The URL to fetch and convert
18
+ * @param mimeType - Optional MIME type (will try to detect from response if not provided)
19
+ * @returns Promise<string> - Base64 data URI string (e.g., "data:image/png;base64,iVBORw0KGgo...")
20
+ * @throws Error if the URL cannot be fetched or converted
21
+ */
22
+ declare function convertUrlToBase64DataUri(url: string, mimeType?: string): Promise<string>;
23
+ /**
24
+ * Convert multiple URLs to base64 strings
25
+ *
26
+ * @param urls - Array of URLs to convert
27
+ * @returns Promise<string[]> - Array of base64 encoded strings
28
+ * @throws Error if any URL cannot be fetched or converted
29
+ */
30
+ declare function convertUrlsToBase64(urls: string[]): Promise<string[]>;
31
+ /**
32
+ * Convert multiple URLs to base64 data URIs
33
+ *
34
+ * @param urls - Array of URLs to convert
35
+ * @param mimeTypes - Optional array of MIME types (will try to detect if not provided)
36
+ * @returns Promise<string[]> - Array of base64 data URI strings
37
+ * @throws Error if any URL cannot be fetched or converted
38
+ */
39
+ declare function convertUrlsToBase64DataUris(urls: string[], mimeTypes?: (string | undefined)[]): Promise<string[]>;
40
+ /**
41
+ * Check if a string is a valid URL
42
+ *
43
+ * @param url - The string to check
44
+ * @returns boolean - True if the string is a valid URL
45
+ */
46
+ declare function isValidUrl(url: string): boolean;
47
+ /**
48
+ * Convert a URL to base64 with timeout
49
+ *
50
+ * @param url - The URL to fetch and convert
51
+ * @param timeoutMs - Timeout in milliseconds (default: 10000)
52
+ * @returns Promise<string> - Base64 encoded string
53
+ * @throws Error if the URL cannot be fetched within timeout or converted
54
+ */
55
+ declare function convertUrlToBase64WithTimeout(url: string, timeoutMs?: number): Promise<string>;
56
+
57
+ export { convertUrlToBase64, convertUrlToBase64DataUri, convertUrlToBase64WithTimeout, convertUrlsToBase64, convertUrlsToBase64DataUris, isValidUrl };
@@ -0,0 +1 @@
1
+ async function f(o){try{const t=await fetch(o);if(!t.ok)throw new Error(`Failed to fetch URL: ${t.status} ${t.statusText}`);const r=await t.arrayBuffer(),n=new Uint8Array(r);let e="";for(let a=0;a<n.length;a++)e+=String.fromCharCode(n[a]);return btoa(e)}catch(t){throw console.error("Error converting URL to base64:",t),new Error(`Failed to convert URL to base64: ${t instanceof Error?t.message:"Unknown error"}`)}}async function l(o,t){try{const r=await fetch(o);if(!r.ok)throw new Error(`Failed to fetch URL: ${r.status} ${r.statusText}`);const n=t||r.headers.get("content-type")||"application/octet-stream",e=await r.arrayBuffer(),a=new Uint8Array(e);let i="";for(let s=0;s<a.length;s++)i+=String.fromCharCode(a[s]);const c=btoa(i);return`data:${n};base64,${c}`}catch(r){throw console.error("Error converting URL to base64 data URI:",r),new Error(`Failed to convert URL to base64 data URI: ${r instanceof Error?r.message:"Unknown error"}`)}}async function u(o){const t=o.map(r=>f(r));return Promise.all(t)}async function g(o,t){const r=o.map((n,e)=>l(n,t?.[e]));return Promise.all(r)}function w(o){try{return new URL(o),!0}catch{return!1}}async function m(o,t=1e4){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{const e=await fetch(o,{signal:r.signal});if(clearTimeout(n),!e.ok)throw new Error(`Failed to fetch URL: ${e.status} ${e.statusText}`);const a=await e.arrayBuffer(),i=new Uint8Array(a);let c="";for(let s=0;s<i.length;s++)c+=String.fromCharCode(i[s]);return btoa(c)}catch(e){throw clearTimeout(n),e instanceof Error&&e.name==="AbortError"?new Error(`Request timed out after ${t}ms`):(console.error("Error converting URL to base64:",e),new Error(`Failed to convert URL to base64: ${e instanceof Error?e.message:"Unknown error"}`))}}export{f as convertUrlToBase64,l as convertUrlToBase64DataUri,m as convertUrlToBase64WithTimeout,u as convertUrlsToBase64,g as convertUrlsToBase64DataUris,w as isValidUrl};
@@ -0,0 +1,268 @@
1
+ /**
2
+ * A util library of worldwide countries
3
+ *
4
+ * @returns country code and country name
5
+ * @author Taimoor Khan
6
+ * @remarks Forum App
7
+ */
8
+ /** End file docs */
9
+ declare enum COUNTRY_CODE {
10
+ AF = "AF",
11
+ AX = "AX",
12
+ AL = "AL",
13
+ DZ = "DZ",
14
+ AS = "AS",
15
+ AD = "AD",
16
+ AO = "AO",
17
+ AI = "AI",
18
+ AQ = "AQ",
19
+ AG = "AG",
20
+ AR = "AR",
21
+ AM = "AM",
22
+ AW = "AW",
23
+ AU = "AU",
24
+ AT = "AT",
25
+ AZ = "AZ",
26
+ BS = "BS",
27
+ BH = "BH",
28
+ BD = "BD",
29
+ BB = "BB",
30
+ BY = "BY",
31
+ BE = "BE",
32
+ BZ = "BZ",
33
+ BJ = "BJ",
34
+ BM = "BM",
35
+ BT = "BT",
36
+ BO = "BO",
37
+ BQ = "BQ",
38
+ BA = "BA",
39
+ BW = "BW",
40
+ BV = "BV",
41
+ BR = "BR",
42
+ IO = "IO",
43
+ BN = "BN",
44
+ BG = "BG",
45
+ BF = "BF",
46
+ BI = "BI",
47
+ KH = "KH",
48
+ CM = "CM",
49
+ CA = "CA",
50
+ CV = "CV",
51
+ KY = "KY",
52
+ CF = "CF",
53
+ TD = "TD",
54
+ CL = "CL",
55
+ CN = "CN",
56
+ CX = "CX",
57
+ CC = "CC",
58
+ CO = "CO",
59
+ KM = "KM",
60
+ CG = "CG",
61
+ CD = "CD",
62
+ CK = "CK",
63
+ CR = "CR",
64
+ CI = "CI",
65
+ HR = "HR",
66
+ CU = "CU",
67
+ CW = "CW",
68
+ CY = "CY",
69
+ CZ = "CZ",
70
+ DK = "DK",
71
+ DJ = "DJ",
72
+ DM = "DM",
73
+ DO = "DO",
74
+ EC = "EC",
75
+ EG = "EG",
76
+ SV = "SV",
77
+ GQ = "GQ",
78
+ ER = "ER",
79
+ EE = "EE",
80
+ ET = "ET",
81
+ FK = "FK",
82
+ FO = "FO",
83
+ FJ = "FJ",
84
+ FI = "FI",
85
+ FR = "FR",
86
+ GF = "GF",
87
+ PF = "PF",
88
+ TF = "TF",
89
+ GA = "GA",
90
+ GM = "GM",
91
+ GE = "GE",
92
+ DE = "DE",
93
+ GH = "GH",
94
+ GI = "GI",
95
+ GR = "GR",
96
+ GL = "GL",
97
+ GD = "GD",
98
+ GP = "GP",
99
+ GU = "GU",
100
+ GT = "GT",
101
+ GG = "GG",
102
+ GN = "GN",
103
+ GW = "GW",
104
+ GY = "GY",
105
+ HT = "HT",
106
+ HM = "HM",
107
+ VA = "VA",
108
+ HN = "HN",
109
+ HK = "HK",
110
+ HU = "HU",
111
+ IS = "IS",
112
+ IN = "IN",
113
+ ID = "ID",
114
+ IR = "IR",
115
+ IQ = "IQ",
116
+ IE = "IE",
117
+ IM = "IM",
118
+ IL = "IL",
119
+ IT = "IT",
120
+ JM = "JM",
121
+ JP = "JP",
122
+ JE = "JE",
123
+ JO = "JO",
124
+ KZ = "KZ",
125
+ KE = "KE",
126
+ KI = "KI",
127
+ KP = "KP",
128
+ KR = "KR",
129
+ KW = "KW",
130
+ KG = "KG",
131
+ LA = "LA",
132
+ LV = "LV",
133
+ LB = "LB",
134
+ LS = "LS",
135
+ LR = "LR",
136
+ LY = "LY",
137
+ LI = "LI",
138
+ LT = "LT",
139
+ LU = "LU",
140
+ MO = "MO",
141
+ MK = "MK",
142
+ MG = "MG",
143
+ MW = "MW",
144
+ MY = "MY",
145
+ MV = "MV",
146
+ ML = "ML",
147
+ MT = "MT",
148
+ MH = "MH",
149
+ MQ = "MQ",
150
+ MR = "MR",
151
+ MU = "MU",
152
+ YT = "YT",
153
+ MX = "MX",
154
+ FM = "FM",
155
+ MD = "MD",
156
+ MC = "MC",
157
+ MN = "MN",
158
+ ME = "ME",
159
+ MS = "MS",
160
+ MA = "MA",
161
+ MZ = "MZ",
162
+ MM = "MM",
163
+ NA = "NA",
164
+ NR = "NR",
165
+ NP = "NP",
166
+ NL = "NL",
167
+ NC = "NC",
168
+ NZ = "NZ",
169
+ NI = "NI",
170
+ NE = "NE",
171
+ NG = "NG",
172
+ NU = "NU",
173
+ NF = "NF",
174
+ MP = "MP",
175
+ NO = "NO",
176
+ OM = "OM",
177
+ PK = "PK",
178
+ PW = "PW",
179
+ PS = "PS",
180
+ PA = "PA",
181
+ PG = "PG",
182
+ PY = "PY",
183
+ PE = "PE",
184
+ PH = "PH",
185
+ PN = "PN",
186
+ PL = "PL",
187
+ PT = "PT",
188
+ PR = "PR",
189
+ QA = "QA",
190
+ RE = "RE",
191
+ RO = "RO",
192
+ RU = "RU",
193
+ RW = "RW",
194
+ BL = "BL",
195
+ SH = "SH",
196
+ KN = "KN",
197
+ LC = "LC",
198
+ MF = "MF",
199
+ PM = "PM",
200
+ VC = "VC",
201
+ WS = "WS",
202
+ SM = "SM",
203
+ ST = "ST",
204
+ SA = "SA",
205
+ SN = "SN",
206
+ RS = "RS",
207
+ SC = "SC",
208
+ SL = "SL",
209
+ SG = "SG",
210
+ SX = "SX",
211
+ SK = "SK",
212
+ SI = "SI",
213
+ SB = "SB",
214
+ SO = "SO",
215
+ ZA = "ZA",
216
+ GS = "GS",
217
+ SS = "SS",
218
+ ES = "ES",
219
+ LK = "LK",
220
+ SD = "SD",
221
+ SR = "SR",
222
+ SJ = "SJ",
223
+ SZ = "SZ",
224
+ SE = "SE",
225
+ CH = "CH",
226
+ SY = "SY",
227
+ TW = "TW",
228
+ TJ = "TJ",
229
+ TZ = "TZ",
230
+ TH = "TH",
231
+ TL = "TL",
232
+ TG = "TG",
233
+ TK = "TK",
234
+ TO = "TO",
235
+ TT = "TT",
236
+ TN = "TN",
237
+ TR = "TR",
238
+ TM = "TM",
239
+ TC = "TC",
240
+ TV = "TV",
241
+ UG = "UG",
242
+ UA = "UA",
243
+ AE = "AE",
244
+ GB = "GB",
245
+ US = "US",
246
+ UM = "UM",
247
+ UY = "UY",
248
+ UZ = "UZ",
249
+ VU = "VU",
250
+ VE = "VE",
251
+ VN = "VN",
252
+ VG = "VG",
253
+ VI = "VI",
254
+ WF = "WF",
255
+ EH = "EH",
256
+ YE = "YE",
257
+ ZM = "ZM",
258
+ ZW = "ZW"
259
+ }
260
+ type ICountries = {
261
+ [key in COUNTRY_CODE]: {
262
+ code: string;
263
+ country: string;
264
+ };
265
+ };
266
+ declare const countries: ICountries;
267
+
268
+ export { COUNTRY_CODE, type ICountries, countries };
@@ -0,0 +1 @@
1
+ var c=(o=>(o.AF="AF",o.AX="AX",o.AL="AL",o.DZ="DZ",o.AS="AS",o.AD="AD",o.AO="AO",o.AI="AI",o.AQ="AQ",o.AG="AG",o.AR="AR",o.AM="AM",o.AW="AW",o.AU="AU",o.AT="AT",o.AZ="AZ",o.BS="BS",o.BH="BH",o.BD="BD",o.BB="BB",o.BY="BY",o.BE="BE",o.BZ="BZ",o.BJ="BJ",o.BM="BM",o.BT="BT",o.BO="BO",o.BQ="BQ",o.BA="BA",o.BW="BW",o.BV="BV",o.BR="BR",o.IO="IO",o.BN="BN",o.BG="BG",o.BF="BF",o.BI="BI",o.KH="KH",o.CM="CM",o.CA="CA",o.CV="CV",o.KY="KY",o.CF="CF",o.TD="TD",o.CL="CL",o.CN="CN",o.CX="CX",o.CC="CC",o.CO="CO",o.KM="KM",o.CG="CG",o.CD="CD",o.CK="CK",o.CR="CR",o.CI="CI",o.HR="HR",o.CU="CU",o.CW="CW",o.CY="CY",o.CZ="CZ",o.DK="DK",o.DJ="DJ",o.DM="DM",o.DO="DO",o.EC="EC",o.EG="EG",o.SV="SV",o.GQ="GQ",o.ER="ER",o.EE="EE",o.ET="ET",o.FK="FK",o.FO="FO",o.FJ="FJ",o.FI="FI",o.FR="FR",o.GF="GF",o.PF="PF",o.TF="TF",o.GA="GA",o.GM="GM",o.GE="GE",o.DE="DE",o.GH="GH",o.GI="GI",o.GR="GR",o.GL="GL",o.GD="GD",o.GP="GP",o.GU="GU",o.GT="GT",o.GG="GG",o.GN="GN",o.GW="GW",o.GY="GY",o.HT="HT",o.HM="HM",o.VA="VA",o.HN="HN",o.HK="HK",o.HU="HU",o.IS="IS",o.IN="IN",o.ID="ID",o.IR="IR",o.IQ="IQ",o.IE="IE",o.IM="IM",o.IL="IL",o.IT="IT",o.JM="JM",o.JP="JP",o.JE="JE",o.JO="JO",o.KZ="KZ",o.KE="KE",o.KI="KI",o.KP="KP",o.KR="KR",o.KW="KW",o.KG="KG",o.LA="LA",o.LV="LV",o.LB="LB",o.LS="LS",o.LR="LR",o.LY="LY",o.LI="LI",o.LT="LT",o.LU="LU",o.MO="MO",o.MK="MK",o.MG="MG",o.MW="MW",o.MY="MY",o.MV="MV",o.ML="ML",o.MT="MT",o.MH="MH",o.MQ="MQ",o.MR="MR",o.MU="MU",o.YT="YT",o.MX="MX",o.FM="FM",o.MD="MD",o.MC="MC",o.MN="MN",o.ME="ME",o.MS="MS",o.MA="MA",o.MZ="MZ",o.MM="MM",o.NA="NA",o.NR="NR",o.NP="NP",o.NL="NL",o.NC="NC",o.NZ="NZ",o.NI="NI",o.NE="NE",o.NG="NG",o.NU="NU",o.NF="NF",o.MP="MP",o.NO="NO",o.OM="OM",o.PK="PK",o.PW="PW",o.PS="PS",o.PA="PA",o.PG="PG",o.PY="PY",o.PE="PE",o.PH="PH",o.PN="PN",o.PL="PL",o.PT="PT",o.PR="PR",o.QA="QA",o.RE="RE",o.RO="RO",o.RU="RU",o.RW="RW",o.BL="BL",o.SH="SH",o.KN="KN",o.LC="LC",o.MF="MF",o.PM="PM",o.VC="VC",o.WS="WS",o.SM="SM",o.ST="ST",o.SA="SA",o.SN="SN",o.RS="RS",o.SC="SC",o.SL="SL",o.SG="SG",o.SX="SX",o.SK="SK",o.SI="SI",o.SB="SB",o.SO="SO",o.ZA="ZA",o.GS="GS",o.SS="SS",o.ES="ES",o.LK="LK",o.SD="SD",o.SR="SR",o.SJ="SJ",o.SZ="SZ",o.SE="SE",o.CH="CH",o.SY="SY",o.TW="TW",o.TJ="TJ",o.TZ="TZ",o.TH="TH",o.TL="TL",o.TG="TG",o.TK="TK",o.TO="TO",o.TT="TT",o.TN="TN",o.TR="TR",o.TM="TM",o.TC="TC",o.TV="TV",o.UG="UG",o.UA="UA",o.AE="AE",o.GB="GB",o.US="US",o.UM="UM",o.UY="UY",o.UZ="UZ",o.VU="VU",o.VE="VE",o.VN="VN",o.VG="VG",o.VI="VI",o.WF="WF",o.EH="EH",o.YE="YE",o.ZM="ZM",o.ZW="ZW",o))(c||{});const n={AF:{code:"AF",country:"Afghanistan"},AX:{code:"AX",country:"\xC5land Islands"},AL:{code:"AL",country:"Albania"},DZ:{code:"DZ",country:"Algeria"},AS:{code:"AS",country:"American Samoa"},AD:{code:"AD",country:"Andorra"},AO:{code:"AO",country:"Angola"},AI:{code:"AI",country:"Anguilla"},AQ:{code:"AQ",country:"Antarctica"},AG:{code:"AG",country:"Antigua and Barbuda"},AR:{code:"AR",country:"Argentina"},AM:{code:"AM",country:"Armenia"},AW:{code:"AW",country:"Aruba"},AU:{code:"AU",country:"Australia"},AT:{code:"AT",country:"Austria"},AZ:{code:"AZ",country:"Azerbaijan"},BS:{code:"BS",country:"Bahamas"},BH:{code:"BH",country:"Bahrain"},BD:{code:"BD",country:"Bangladesh"},BB:{code:"BB",country:"Barbados"},BY:{code:"BY",country:"Belarus"},BE:{code:"BE",country:"Belgium"},BZ:{code:"BZ",country:"Belize"},BJ:{code:"BJ",country:"Benin"},BM:{code:"BM",country:"Bermuda"},BT:{code:"BT",country:"Bhutan"},BO:{code:"BO",country:"Bolivia, Plurinational State of"},BQ:{code:"BQ",country:"Bonaire, Sint Eustatius and Saba"},BA:{code:"BA",country:"Bosnia and Herzegovina"},BW:{code:"BW",country:"Botswana"},BV:{code:"BV",country:"Bouvet Island"},BR:{code:"BR",country:"Brazil"},IO:{code:"IO",country:"British Indian Ocean Territory"},BN:{code:"BN",country:"Brunei Darussalam"},BG:{code:"BG",country:"Bulgaria"},BF:{code:"BF",country:"Burkina Faso"},BI:{code:"BI",country:"Burundi"},KH:{code:"KH",country:"Cambodia"},CM:{code:"CM",country:"Cameroon"},CA:{code:"CA",country:"Canada"},CV:{code:"CV",country:"Cape Verde"},KY:{code:"KY",country:"Cayman Islands"},CF:{code:"CF",country:"Central African Republic"},TD:{code:"TD",country:"Chad"},CL:{code:"CL",country:"Chile"},CN:{code:"CN",country:"China"},CX:{code:"CX",country:"Christmas Island"},CC:{code:"CC",country:"Cocos (Keeling) Islands"},CO:{code:"CO",country:"Colombia"},KM:{code:"KM",country:"Comoros"},CG:{code:"CG",country:"Congo"},CD:{code:"CD",country:"Congo, the Democratic Republic of the"},CK:{code:"CK",country:"Cook Islands"},CR:{code:"CR",country:"Costa Rica"},CI:{code:"CI",country:"C\xF4te d'Ivoire"},HR:{code:"HR",country:"Croatia"},CU:{code:"CU",country:"Cuba"},CW:{code:"CW",country:"Cura\xE7ao"},CY:{code:"CY",country:"Cyprus"},CZ:{code:"CZ",country:"Czech Republic"},DK:{code:"DK",country:"Denmark"},DJ:{code:"DJ",country:"Djibouti"},DM:{code:"DM",country:"Dominica"},DO:{code:"DO",country:"Dominican Republic"},EC:{code:"EC",country:"Ecuador"},EG:{code:"EG",country:"Egypt"},SV:{code:"SV",country:"El Salvador"},GQ:{code:"GQ",country:"Equatorial Guinea"},ER:{code:"ER",country:"Eritrea"},EE:{code:"EE",country:"Estonia"},ET:{code:"ET",country:"Ethiopia"},FK:{code:"FK",country:"Falkland Islands (Malvinas)"},FO:{code:"FO",country:"Faroe Islands"},FJ:{code:"FJ",country:"Fiji"},FI:{code:"FI",country:"Finland"},FR:{code:"FR",country:"France"},GF:{code:"GF",country:"French Guiana"},PF:{code:"PF",country:"French Polynesia"},TF:{code:"TF",country:"French Southern Territories"},GA:{code:"GA",country:"Gabon"},GM:{code:"GM",country:"Gambia"},GE:{code:"GE",country:"Georgia"},DE:{code:"DE",country:"Germany"},GH:{code:"GH",country:"Ghana"},GI:{code:"GI",country:"Gibraltar"},GR:{code:"GR",country:"Greece"},GL:{code:"GL",country:"Greenland"},GD:{code:"GD",country:"Grenada"},GP:{code:"GP",country:"Guadeloupe"},GU:{code:"GU",country:"Guam"},GT:{code:"GT",country:"Guatemala"},GG:{code:"GG",country:"Guernsey"},GN:{code:"GN",country:"Guinea"},GW:{code:"GW",country:"Guinea-Bissau"},GY:{code:"GY",country:"Guyana"},HT:{code:"HT",country:"Haiti"},HM:{code:"HM",country:"Heard Island and McDonald Islands"},VA:{code:"VA",country:"Holy See (Vatican City State)"},HN:{code:"HN",country:"Honduras"},HK:{code:"HK",country:"Hong Kong"},HU:{code:"HU",country:"Hungary"},IS:{code:"IS",country:"Iceland"},IN:{code:"IN",country:"India"},ID:{code:"ID",country:"Indonesia"},IR:{code:"IR",country:"Iran, Islamic Republic of"},IQ:{code:"IQ",country:"Iraq"},IE:{code:"IE",country:"Ireland"},IM:{code:"IM",country:"Isle of Man"},IL:{code:"IL",country:"Israel"},IT:{code:"IT",country:"Italy"},JM:{code:"JM",country:"Jamaica"},JP:{code:"JP",country:"Japan"},JE:{code:"JE",country:"Jersey"},JO:{code:"JO",country:"Jordan"},KZ:{code:"KZ",country:"Kazakhstan"},KE:{code:"KE",country:"Kenya"},KI:{code:"KI",country:"Kiribati"},KP:{code:"KP",country:"Korea, Democratic People's Republic of"},KR:{code:"KR",country:"Korea, Republic of"},KW:{code:"KW",country:"Kuwait"},KG:{code:"KG",country:"Kyrgyzstan"},LA:{code:"LA",country:"Lao People's Democratic Republic"},LV:{code:"LV",country:"Latvia"},LB:{code:"LB",country:"Lebanon"},LS:{code:"LS",country:"Lesotho"},LR:{code:"LR",country:"Liberia"},LY:{code:"LY",country:"Libya"},LI:{code:"LI",country:"Liechtenstein"},LT:{code:"LT",country:"Lithuania"},LU:{code:"LU",country:"Luxembourg"},MO:{code:"MO",country:"Macao"},MK:{code:"MK",country:"Macedonia, the Former Yugoslav Republic of"},MG:{code:"MG",country:"Madagascar"},MW:{code:"MW",country:"Malawi"},MY:{code:"MY",country:"Malaysia"},MV:{code:"MV",country:"Maldives"},ML:{code:"ML",country:"Mali"},MT:{code:"MT",country:"Malta"},MH:{code:"MH",country:"Marshall Islands"},MQ:{code:"MQ",country:"Martinique"},MR:{code:"MR",country:"Mauritania"},MU:{code:"MU",country:"Mauritius"},YT:{code:"YT",country:"Mayotte"},MX:{code:"MX",country:"Mexico"},FM:{code:"FM",country:"Micronesia, Federated States of"},MD:{code:"MD",country:"Moldova, Republic of"},MC:{code:"MC",country:"Monaco"},MN:{code:"MN",country:"Mongolia"},ME:{code:"ME",country:"Montenegro"},MS:{code:"MS",country:"Montserrat"},MA:{code:"MA",country:"Morocco"},MZ:{code:"MZ",country:"Mozambique"},MM:{code:"MM",country:"Myanmar"},NA:{code:"NA",country:"Namibia"},NR:{code:"NR",country:"Nauru"},NP:{code:"NP",country:"Nepal"},NL:{code:"NL",country:"Netherlands"},NC:{code:"NC",country:"New Caledonia"},NZ:{code:"NZ",country:"New Zealand"},NI:{code:"NI",country:"Nicaragua"},NE:{code:"NE",country:"Niger"},NG:{code:"NG",country:"Nigeria"},NU:{code:"NU",country:"Niue"},NF:{code:"NF",country:"Norfolk Island"},MP:{code:"MP",country:"Northern Mariana Islands"},NO:{code:"NO",country:"Norway"},OM:{code:"OM",country:"Oman"},PK:{code:"PK",country:"Pakistan"},PW:{code:"PW",country:"Palau"},PS:{code:"PS",country:"Palestine, State of"},PA:{code:"PA",country:"Panama"},PG:{code:"PG",country:"Papua New Guinea"},PY:{code:"PY",country:"Paraguay"},PE:{code:"PE",country:"Peru"},PH:{code:"PH",country:"Philippines"},PN:{code:"PN",country:"Pitcairn"},PL:{code:"PL",country:"Poland"},PT:{code:"PT",country:"Portugal"},PR:{code:"PR",country:"Puerto Rico"},QA:{code:"QA",country:"Qatar"},RE:{code:"RE",country:"R\xE9union"},RO:{code:"RO",country:"Romania"},RU:{code:"RU",country:"Russian Federation"},RW:{code:"RW",country:"Rwanda"},BL:{code:"BL",country:"Saint Barth\xE9lemy"},SH:{code:"SH",country:"Saint Helena, Ascension and Tristan da Cunha"},KN:{code:"KN",country:"Saint Kitts and Nevis"},LC:{code:"LC",country:"Saint Lucia"},MF:{code:"MF",country:"Saint Martin (French part)"},PM:{code:"PM",country:"Saint Pierre and Miquelon"},VC:{code:"VC",country:"Saint Vincent and the Grenadines"},WS:{code:"WS",country:"Samoa"},SM:{code:"SM",country:"San Marino"},ST:{code:"ST",country:"Sao Tome and Principe"},SA:{code:"SA",country:"Saudi Arabia"},SN:{code:"SN",country:"Senegal"},RS:{code:"RS",country:"Serbia"},SC:{code:"SC",country:"Seychelles"},SL:{code:"SL",country:"Sierra Leone"},SG:{code:"SG",country:"Singapore"},SX:{code:"SX",country:"Sint Maarten (Dutch part)"},SK:{code:"SK",country:"Slovakia"},SI:{code:"SI",country:"Slovenia"},SB:{code:"SB",country:"Solomon Islands"},SO:{code:"SO",country:"Somalia"},ZA:{code:"ZA",country:"South Africa"},GS:{code:"GS",country:"South Georgia and the South Sandwich Islands"},SS:{code:"SS",country:"South Sudan"},ES:{code:"ES",country:"Spain"},LK:{code:"LK",country:"Sri Lanka"},SD:{code:"SD",country:"Sudan"},SR:{code:"SR",country:"Suriname"},SJ:{code:"SJ",country:"Svalbard and Jan Mayen"},SZ:{code:"SZ",country:"Swaziland"},SE:{code:"SE",country:"Sweden"},CH:{code:"CH",country:"Switzerland"},SY:{code:"SY",country:"Syrian Arab Republic"},TW:{code:"TW",country:"Taiwan, Province of China"},TJ:{code:"TJ",country:"Tajikistan"},TZ:{code:"TZ",country:"Tanzania, United Republic of"},TH:{code:"TH",country:"Thailand"},TL:{code:"TL",country:"Timor-Leste"},TG:{code:"TG",country:"Togo"},TK:{code:"TK",country:"Tokelau"},TO:{code:"TO",country:"Tonga"},TT:{code:"TT",country:"Trinidad and Tobago"},TN:{code:"TN",country:"Tunisia"},TR:{code:"TR",country:"Turkey"},TM:{code:"TM",country:"Turkmenistan"},TC:{code:"TC",country:"Turks and Caicos Islands"},TV:{code:"TV",country:"Tuvalu"},UG:{code:"UG",country:"Uganda"},UA:{code:"UA",country:"Ukraine"},AE:{code:"AE",country:"United Arab Emirates"},GB:{code:"GB",country:"United Kingdom"},US:{code:"US",country:"United States"},UM:{code:"UM",country:"United States Minor Outlying Islands"},UY:{code:"UY",country:"Uruguay"},UZ:{code:"UZ",country:"Uzbekistan"},VU:{code:"VU",country:"Vanuatu"},VE:{code:"VE",country:"Venezuela, Bolivarian Republic of"},VN:{code:"VN",country:"Viet Nam"},VG:{code:"VG",country:"Virgin Islands, British"},VI:{code:"VI",country:"Virgin Islands, U.S."},WF:{code:"WF",country:"Wallis and Futuna"},EH:{code:"EH",country:"Western Sahara"},YE:{code:"YE",country:"Yemen"},ZM:{code:"ZM",country:"Zambia"},ZW:{code:"ZW",country:"Zimbabwe"}};export{c as COUNTRY_CODE,n as countries};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * A util function to create date from provided string
3
+ * eg: Saturday, 11/01/2020
4
+ *
5
+ * @returns formatted date - Saturday, 11/01/2020
6
+ * @author Taimoor Khan
7
+ * @remarks
8
+ */
9
+ /** End file docs */
10
+ declare const createDate: (date?: string | Date, tz?: string) => Date;
11
+
12
+ export { createDate };
@@ -1 +1 @@
1
- var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},p=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of D(t))!c.call(e,r)&&r!==o&&i(e,r,{get:()=>t[r],enumerable:!(a=s(t,r))||a.enumerable});return e};var u=e=>p(i({},"__esModule",{value:!0}),e);var h={};f(h,{createDate:()=>T});module.exports=u(h);var n=require("date-fns-tz"),m=require("./set-timezone");const g="Asia/Karachi",T=(e,t)=>t||!e?(0,m.setTimezone)(e?(0,n.toDate)(e):new Date,t||g):(0,n.toDate)(e);0&&(module.exports={createDate});
1
+ var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var m=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},u=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of c(t))!D.call(e,n)&&n!==r&&i(e,n,{get:()=>t[n],enumerable:!(o=s(t,n))||o.enumerable});return e};var f=e=>u(i({},"__esModule",{value:!0}),e);var T={};m(T,{createDate:()=>p});module.exports=f(T);var a=require("./set-timezone");const g="Asia/Karachi",p=(e,t)=>{const{toDate:r}=require("date-fns-tz");return t||!e?(0,a.setTimezone)(e?r(e):new Date,t||g):r(e)};0&&(module.exports={createDate});
@@ -0,0 +1 @@
1
+ import{setTimezone as n}from"./set-timezone";const i="Asia/Karachi",a=(e,t)=>{const{toDate:r}=require("date-fns-tz");return t||!e?n(e?r(e):new Date,t||i):r(e)};export{a as createDate};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Encrypt a string using a password. Returns a base64 payload containing
3
+ * salt + iv + authTag + ciphertext.
4
+ */
5
+ declare function encryptString(plain: string, password: string): string;
6
+ /**
7
+ * Decrypt a base64 payload produced by `encryptString` using the same password.
8
+ */
9
+ declare function decryptString(payload: string, password: string): string;
10
+
11
+ export { decryptString, encryptString };
@@ -0,0 +1 @@
1
+ import{randomBytes as g,createCipheriv as h,createDecipheriv as l,scryptSync as p}from"crypto";const d="aes-256-gcm",c=16,n=12,y=16,T=32;function L(o,i){const t=g(c),s=g(n),a=p(i,t,T),e=h(d,a,s),f=Buffer.concat([e.update(o,"utf8"),e.final()]),u=e.getAuthTag();return Buffer.concat([t,s,u,f]).toString("base64")}function S(o,i){const t=Buffer.from(o,"base64"),s=t.slice(0,c),a=t.slice(c,c+n),e=t.slice(c+n,c+n+y),f=t.slice(c+n+y),u=p(i,s,T),r=l(d,u,a);return r.setAuthTag(e),Buffer.concat([r.update(f),r.final()]).toString("utf8")}export{S as decryptString,L as encryptString};
@@ -0,0 +1,2 @@
1
+
2
+ export { }
File without changes
@@ -0,0 +1,16 @@
1
+ interface DeleteImageFromPrivateSupabaseArgs {
2
+ supabase: any;
3
+ urls: Array<string>;
4
+ }
5
+ /**
6
+ * Deletes images from the private Supabase storage bucket.
7
+ * @param params.supabase - Supabase client instance.
8
+ * @param params.urls - Array of file URLs to delete.
9
+ * @returns Object containing `data` and `error` from Supabase.
10
+ */
11
+ declare const deleteImageFromPrivateSupabase: ({ supabase, urls, }: DeleteImageFromPrivateSupabaseArgs) => Promise<{
12
+ data: any;
13
+ error: any;
14
+ }>;
15
+
16
+ export { type DeleteImageFromPrivateSupabaseArgs, deleteImageFromPrivateSupabase };
@@ -0,0 +1 @@
1
+ const t=async({supabase:e,urls:r})=>{const{data:a,error:s}=await e.storage.from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET).remove([...r]);return{data:a,error:s}};export{t as deleteImageFromPrivateSupabase};
@@ -0,0 +1,16 @@
1
+ interface DeleteImageFromPublicSupabaseArgs {
2
+ supabase: any;
3
+ urls: Array<string>;
4
+ }
5
+ /**
6
+ * Deletes images from the public Supabase storage bucket.
7
+ * @param params.supabase - Supabase client instance.
8
+ * @param params.urls - Array of file URLs to delete.
9
+ * @returns Object containing `data` and `error` from Supabase.
10
+ */
11
+ declare const deleteImageFromPublicSupabase: ({ supabase, urls, }: DeleteImageFromPublicSupabaseArgs) => Promise<{
12
+ data: any;
13
+ error: any;
14
+ }>;
15
+
16
+ export { type DeleteImageFromPublicSupabaseArgs, deleteImageFromPublicSupabase };
@@ -0,0 +1 @@
1
+ const t=async({supabase:e,urls:r})=>{const{data:a,error:s}=await e.storage.from(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET).remove([...r]);return{data:a,error:s}};export{t as deleteImageFromPublicSupabase};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Triggers a browser file download from a URL string or Blob.
3
+ * @param source - URL string or Blob to download.
4
+ * @param filename - Optional filename for the downloaded file.
5
+ */
6
+ declare const downloadFromUrl: (source: string | Blob, filename?: string) => Promise<void>;
7
+
8
+ export { downloadFromUrl };
@@ -0,0 +1 @@
1
+ const a=async(o,n)=>{try{let t;if(typeof o=="string"){const r=await fetch(o);if(!r.ok)throw new Error(`Failed to fetch file: ${r.status}`);t=await r.blob()}else t=o;const l=URL.createObjectURL(t),e=document.createElement("a");e.href=l,e.download=n??(typeof o=="string"?o.split("/").pop()??"download":"download"),document.body.appendChild(e),e.click(),e.remove(),URL.revokeObjectURL(l)}catch(t){console.error("downloadFromUrl error:",t)}};export{a as downloadFromUrl};
@@ -0,0 +1,12 @@
1
+ type PageLimitOption = 5 | 10 | 15 | 25 | 100;
2
+ interface Return {
3
+ option: string;
4
+ }
5
+ /**
6
+ * Converts an array of numeric page-limit options into dropdown option objects.
7
+ * @param availableOptions - Array of page limit numbers.
8
+ * @returns Array of objects with `option` string property.
9
+ */
10
+ declare const dynamicPageLimit: (availableOptions: Array<PageLimitOption>) => Array<Return>;
11
+
12
+ export { type PageLimitOption, dynamicPageLimit };
@@ -0,0 +1 @@
1
+ const n=t=>t.map(i=>({option:String(i)}));export{n as dynamicPageLimit};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Converts a SCREAMING_SNAKE_CASE enum value to Title Case.
3
+ * @param e - The enum string to convert.
4
+ * @returns The formatted title-case string.
5
+ */
6
+ declare const enumToText: (e: string) => string;
7
+
8
+ export { enumToText };
@@ -0,0 +1 @@
1
+ const o=e=>e.toLowerCase().split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ");export{o as enumToText};
@@ -0,0 +1,25 @@
1
+ import { API_METHODS } from '../constants/api-methods.mjs';
2
+
3
+ type FetchDataParamValue = string | number | boolean | null | undefined;
4
+ interface FetchDataParams {
5
+ url: string;
6
+ method?: API_METHODS;
7
+ body?: string;
8
+ headers?: Record<string, string>;
9
+ params?: Record<string, FetchDataParamValue>;
10
+ }
11
+ /**
12
+ * Fetches data from an API endpoint with optional query params, headers, and body.
13
+ * @param params.url - The request URL.
14
+ * @param params.method - HTTP method (default GET).
15
+ * @param params.body - Optional request body string.
16
+ * @param params.headers - Optional request headers.
17
+ * @param params.params - Optional query parameters appended to the URL.
18
+ * @returns Object containing `data` and `error`.
19
+ */
20
+ declare const fetchData: ({ url, method, body, headers, params, }: FetchDataParams) => Promise<{
21
+ data: any | undefined;
22
+ error: Error | undefined;
23
+ }>;
24
+
25
+ export { type FetchDataParamValue, type FetchDataParams, fetchData };
@@ -0,0 +1 @@
1
+ import{API_METHODS as c}from"../constants/api-methods";const d=(t,e)=>{if(!e)return t;const a=Object.entries(e).filter(r=>r[1]!==null&&r[1]!==void 0);if(a.length===0)return t;const n=new URLSearchParams(a.map(([r,i])=>[r,String(i)])),o=t.includes("?")?"&":"?";return`${t}${o}${n.toString()}`},u=async({url:t,method:e=c.GET,body:a,headers:n,params:o})=>{let r,i;try{const s=await fetch(d(t,o),{method:e,...n?{headers:n}:{},...e!==c.GET&&a&&{body:a}});if(r=await s.json(),!s.ok)throw new Error(r.error)}catch(s){i=s}return{data:r,error:i}};export{u as fetchData};
@@ -0,0 +1,16 @@
1
+ interface FetchSupabasePrivateImageArgs {
2
+ apikey: string;
3
+ callback: (url: string | Blob) => void;
4
+ fetchUrl: string;
5
+ token: string;
6
+ }
7
+ /**
8
+ * Fetches a private Supabase image as a Blob and passes an object URL to the callback.
9
+ * @param params.apikey - Supabase API key.
10
+ * @param params.callback - Callback receiving the Blob URL.
11
+ * @param params.fetchUrl - The image URL to fetch.
12
+ * @param params.token - Auth bearer token.
13
+ */
14
+ declare const fetchSupabasePrivateImage: ({ apikey, callback, fetchUrl, token, }: FetchSupabasePrivateImageArgs) => Promise<void>;
15
+
16
+ export { type FetchSupabasePrivateImageArgs, fetchSupabasePrivateImage };
@@ -0,0 +1 @@
1
+ import{API_METHODS as n}from"../constants/api-methods";const p=async({apikey:t,callback:a,fetchUrl:r,token:o})=>{const e=await fetch(r,{method:n.GET,headers:{"Content-Type":"application/json",apikey:t,Authorization:`Bearer ${o}`}});if(e.ok){const i=await e.blob(),s=URL.createObjectURL(i);a(s)}};export{p as fetchSupabasePrivateImage};
@@ -0,0 +1,15 @@
1
+ interface FetchSupabasePrivateAssetsArgs {
2
+ apikey: string;
3
+ fetchUrls: Array<string>;
4
+ token: string;
5
+ }
6
+ /**
7
+ * Fetches multiple private Supabase assets in parallel and returns an array of Blobs.
8
+ * @param params.apikey - Supabase API key.
9
+ * @param params.fetchUrls - Array of asset URLs to fetch.
10
+ * @param params.token - Auth bearer token.
11
+ * @returns Array of Blob objects.
12
+ */
13
+ declare const fetchSupabasePrivateAssets: ({ apikey, fetchUrls, token, }: FetchSupabasePrivateAssetsArgs) => Promise<Array<Blob>>;
14
+
15
+ export { type FetchSupabasePrivateAssetsArgs, fetchSupabasePrivateAssets };
@@ -0,0 +1 @@
1
+ import{API_METHODS as i}from"../constants/api-methods";const h=async({apikey:e,fetchUrls:s,token:a})=>{const o=s.map(r=>fetch(r,{method:i.GET,headers:{"Content-Type":"application/json",apikey:e,Authorization:`Bearer ${a}`}}).then(t=>{if(!t.ok)throw new Error(`HTTP error! status: ${t.status} from ${r}`);return t.blob()}));return await Promise.all(o)};export{h as fetchSupabasePrivateAssets};
@@ -0,0 +1,18 @@
1
+ declare enum DATE_FORMATS {
2
+ LOCALE_DATE = "LOCALE_DATE",
3
+ DD_MM = "DD_MM",
4
+ YYYY_MM_DD = "YYYY_MM_DD",
5
+ DAY_DD_MM_YYYY = "DAY_DD_MM_YYYY",
6
+ DAY_DD_MM_YY_COMPACT = "DAY_DD_MM_YY_COMPACT",
7
+ HH_MM_AM_PM = "HH_MM_AM_PM",
8
+ HH_MM_SS_AM_PM = "HH_MM_SS_AM_PM"
9
+ }
10
+ /**
11
+ * Formats a date string into the specified DATE_FORMATS format.
12
+ * @param str - A date string parsable by Date constructor.
13
+ * @param format - The target DATE_FORMATS format.
14
+ * @returns The formatted date string.
15
+ */
16
+ declare const formatDate: (str: string, format: DATE_FORMATS) => string;
17
+
18
+ export { DATE_FORMATS, formatDate };
@@ -0,0 +1 @@
1
+ import{getDayName as a}from"./get-day-name";import{getMonthName as o}from"./get-month-name";var m=(M=>(M.LOCALE_DATE="LOCALE_DATE",M.DD_MM="DD_MM",M.YYYY_MM_DD="YYYY_MM_DD",M.DAY_DD_MM_YYYY="DAY_DD_MM_YYYY",M.DAY_DD_MM_YY_COMPACT="DAY_DD_MM_YY_COMPACT",M.HH_MM_AM_PM="HH_MM_AM_PM",M.HH_MM_SS_AM_PM="HH_MM_SS_AM_PM",M))(m||{});const T=(r,$)=>{const t=new Date(r),e=t.getMonth()+1,A=String(e).length<2?`0${e}`:e,_=t.getDate(),i=String(_).length<2?`0${_}`:_;let M=t.getHours();const D=t.getMinutes(),n=t.getSeconds(),Y=M>=12?"PM":"AM";M=M%12,M=M||12;const s=D<10?`0${D}`:D,c=n<10?`0${n}`:n,g=M<10?`0${M}`:M;return{LOCALE_DATE:t.toLocaleDateString(),DD_MM:`${t.getDate()} ${o(t.getMonth())}`,YYYY_MM_DD:`${t.getFullYear()}-${A}-${i}`,DAY_DD_MM_YYYY:`${a(t.getDay())}, ${t.getDate()} ${o(t.getMonth())} ${t.getFullYear()}`,DAY_DD_MM_YY_COMPACT:`${a(t.getDay())?.slice(0,3)}, ${t.getDate()} ${o(t.getMonth())} ${String(t.getFullYear())?.slice(2,5)}`,HH_MM_AM_PM:`${g}:${s} ${Y}`,HH_MM_SS_AM_PM:`${g}:${s}:${c} ${Y}`}[$]};export{m as DATE_FORMATS,T as formatDate};
@@ -0,0 +1,16 @@
1
+ type FormatOptions = {
2
+ decimals?: number;
3
+ useLocale?: boolean;
4
+ customSuffixes?: Array<string>;
5
+ };
6
+ /**
7
+ * Formats a number with abbreviations (K, M, B, etc.) and optional locale formatting.
8
+ * @param input - The number or numeric string to format.
9
+ * @param options.decimals - Number of decimal places (default 2).
10
+ * @param options.useLocale - Whether to use locale separators (default true).
11
+ * @param options.customSuffixes - Custom suffix array for magnitudes.
12
+ * @returns The formatted number string.
13
+ */
14
+ declare const formatNumber: (input: any, options?: FormatOptions) => string;
15
+
16
+ export { type FormatOptions, formatNumber };
@@ -0,0 +1 @@
1
+ const g=(s,u={})=>{const{decimals:r=2,useLocale:n=!0,customSuffixes:i}=u,t=Number(s);if(Number.isNaN(t)||!Number.isFinite(t))return"Invalid number";if(s===0||s==="0")return"0";const e=Math.abs(t),a=t<0?"-":"",f=i||["","K","M","B","T","Q"],o=Math.floor(Math.log10(e)/3);if(o===0){const b=n?e.toLocaleString():e.toFixed(r);return a+b}const m=f[o]||`e${o*3}`,l=Math.pow(10,o*3),c=(e/l).toFixed(r),d=n?Number(c).toLocaleString():c;return`${a}${d}${m}`};export{g as formatNumber};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Formats a phone number for display in international format with fallback.
3
+ * @param value - The raw phone number value.
4
+ * @param defaultCountry - Optional default country code for parsing.
5
+ * @returns The formatted phone number, or undefined if invalid.
6
+ */
7
+ declare function formatPhoneDisplay(value: unknown, defaultCountry?: string): string | undefined;
8
+
9
+ export { formatPhoneDisplay };
@@ -1 +1 @@
1
- var f=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var a=(r,t)=>{for(var i in t)f(r,i,{get:t[i],enumerable:!0})},g=(r,t,i,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of o(t))!s.call(r,n)&&n!==i&&f(r,n,{get:()=>t[n],enumerable:!(e=u(t,n))||e.enumerable});return r};var l=r=>g(f({},"__esModule",{value:!0}),r);var p={};a(p,{formatPhoneDisplay:()=>m});module.exports=l(p);var d=require("libphonenumber-js");function m(r,t){if(r==null)return;const i=String(r).trim();if(i==="")return;try{let n=(0,d.parsePhoneNumberFromString)(i,t);if((!n||!n.isValid())&&/^\d+$/.test(i)&&(n=(0,d.parsePhoneNumberFromString)(`+${i}`)),n&&n.isValid())return n.formatInternational()}catch{}const e=i.replace(/\D/g,"");if(e)return e.length>12?`+${e}`:e}0&&(module.exports={formatPhoneDisplay});
1
+ var d=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var a=(n,r)=>{for(var t in r)d(n,t,{get:r[t],enumerable:!0})},c=(n,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of o(r))!s.call(n,e)&&e!==t&&d(n,e,{get:()=>r[e],enumerable:!(i=f(r,e))||i.enumerable});return n};var g=n=>c(d({},"__esModule",{value:!0}),n);var p={};a(p,{formatPhoneDisplay:()=>l});module.exports=g(p);function l(n,r){if(n==null)return;const t=String(n).trim();if(t==="")return;try{const{parsePhoneNumberFromString:e}=require("libphonenumber-js");let u=e(t,r);if((!u||!u.isValid())&&/^\d+$/.test(t)&&(u=e(`+${t}`)),u&&u.isValid())return u.formatInternational()}catch{}const i=t.replace(/\D/g,"");if(i)return i.length>12?`+${i}`:i}0&&(module.exports={formatPhoneDisplay});
@@ -0,0 +1 @@
1
+ function d(e,u){if(e==null)return;const r=String(e).trim();if(r==="")return;try{const{parsePhoneNumberFromString:i}=require("libphonenumber-js");let n=i(r,u);if((!n||!n.isValid())&&/^\d+$/.test(r)&&(n=i(`+${r}`)),n&&n.isValid())return n.formatInternational()}catch{}const t=r.replace(/\D/g,"");if(t)return t.length>12?`+${t}`:t}export{d as formatPhoneDisplay};