@react-pakistan/util-functions 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (494) hide show
  1. package/constants/api-methods.d.mts +13 -0
  2. package/constants/api-methods.js +1 -1
  3. package/constants/api-methods.mjs +1 -0
  4. package/constants/cache-time.d.mts +7 -0
  5. package/constants/cache-time.js +1 -1
  6. package/constants/cache-time.mjs +1 -0
  7. package/constants/countries-timezones.d.mts +8 -0
  8. package/constants/countries-timezones.js +1 -1
  9. package/constants/countries-timezones.mjs +1 -0
  10. package/constants/currencies.d.mts +14 -0
  11. package/constants/currencies.js +1 -1
  12. package/constants/currencies.mjs +1 -0
  13. package/constants/dial-codes.d.mts +9 -0
  14. package/constants/dial-codes.js +1 -1
  15. package/constants/dial-codes.mjs +1 -0
  16. package/constants/layout-direction.d.mts +6 -0
  17. package/constants/layout-direction.js +1 -1
  18. package/constants/layout-direction.mjs +1 -0
  19. package/constants/react-pakistan-meta.d.mts +32 -0
  20. package/constants/react-pakistan-meta.js +1 -1
  21. package/constants/react-pakistan-meta.mjs +1 -0
  22. package/constants/react-pakistan.d.mts +15 -0
  23. package/constants/react-pakistan.js +1 -12
  24. package/constants/react-pakistan.mjs +1 -0
  25. package/constants/select-value-delimiter.d.mts +12 -0
  26. package/constants/select-value-delimiter.js +1 -1
  27. package/constants/select-value-delimiter.mjs +1 -0
  28. package/constants/social-media-colors.d.mts +40 -0
  29. package/constants/social-media-colors.js +1 -1
  30. package/constants/social-media-colors.mjs +1 -0
  31. package/constants/social-media-sizes.d.mts +323 -0
  32. package/constants/social-media-sizes.js +1 -1
  33. package/constants/social-media-sizes.mjs +1 -0
  34. package/constants/user-roles.d.mts +7 -0
  35. package/constants/user-roles.js +1 -1
  36. package/constants/user-roles.mjs +1 -0
  37. package/factory/generic-component-factory.d.mts +78 -0
  38. package/factory/generic-component-factory.js +1 -1
  39. package/factory/generic-component-factory.mjs +1 -0
  40. package/factory/generic-module-factory.d.mts +80 -0
  41. package/factory/generic-module-factory.js +1 -1
  42. package/factory/generic-module-factory.mjs +1 -0
  43. package/general/basic-get.d.mts +8 -0
  44. package/general/basic-get.js +1 -1
  45. package/general/basic-get.mjs +1 -0
  46. package/general/basic-post.d.mts +8 -0
  47. package/general/basic-post.js +1 -1
  48. package/general/basic-post.mjs +1 -0
  49. package/general/calculate-pages.d.mts +9 -0
  50. package/general/calculate-pages.js +1 -1
  51. package/general/calculate-pages.mjs +1 -0
  52. package/general/camel-to-sentence-case.d.mts +12 -0
  53. package/general/camel-to-sentence-case.js +1 -1
  54. package/general/camel-to-sentence-case.mjs +1 -0
  55. package/general/check-even-odd-length.d.mts +13 -0
  56. package/general/check-even-odd-length.js +1 -1
  57. package/general/check-even-odd-length.mjs +1 -0
  58. package/general/clear-cache.d.mts +10 -0
  59. package/general/clear-cache.js +1 -1
  60. package/general/clear-cache.mjs +1 -0
  61. package/general/cnic-formatter.d.mts +20 -0
  62. package/general/cnic-formatter.js +1 -1
  63. package/general/cnic-formatter.mjs +1 -0
  64. package/general/convert-url-to-base64.d.mts +57 -0
  65. package/general/convert-url-to-base64.js +1 -1
  66. package/general/convert-url-to-base64.mjs +1 -0
  67. package/general/countries.d.mts +268 -0
  68. package/general/countries.js +1 -1
  69. package/general/countries.mjs +1 -0
  70. package/general/create-date.d.mts +12 -0
  71. package/general/create-date.js +1 -1
  72. package/general/create-date.mjs +1 -0
  73. package/general/crypto.d.mts +11 -0
  74. package/general/crypto.js +1 -1
  75. package/general/crypto.mjs +1 -0
  76. package/general/currencies.d.mts +2 -0
  77. package/general/currencies.mjs +0 -0
  78. package/general/delete-image-from-private-supabase.d.mts +16 -0
  79. package/general/delete-image-from-private-supabase.js +1 -1
  80. package/general/delete-image-from-private-supabase.mjs +1 -0
  81. package/general/delete-image-from-public-supabase.d.mts +16 -0
  82. package/general/delete-image-from-public-supabase.js +1 -1
  83. package/general/delete-image-from-public-supabase.mjs +1 -0
  84. package/general/download-from-url.d.mts +8 -0
  85. package/general/download-from-url.js +1 -1
  86. package/general/download-from-url.mjs +1 -0
  87. package/general/dynamic-page-limit.d.mts +12 -0
  88. package/general/dynamic-page-limit.js +1 -1
  89. package/general/dynamic-page-limit.mjs +1 -0
  90. package/general/enum-to-text.d.mts +8 -0
  91. package/general/enum-to-text.js +1 -1
  92. package/general/enum-to-text.mjs +1 -0
  93. package/general/fetch-data.d.mts +25 -0
  94. package/general/fetch-data.js +1 -1
  95. package/general/fetch-data.mjs +1 -0
  96. package/general/fetch-supabase-image.d.mts +16 -0
  97. package/general/fetch-supabase-image.js +1 -1
  98. package/general/fetch-supabase-image.mjs +1 -0
  99. package/general/fetch-supabase-private-assets.d.mts +15 -0
  100. package/general/fetch-supabase-private-assets.js +1 -1
  101. package/general/fetch-supabase-private-assets.mjs +1 -0
  102. package/general/format-date.d.mts +18 -0
  103. package/general/format-date.js +1 -1
  104. package/general/format-date.mjs +1 -0
  105. package/general/format-number.d.mts +16 -0
  106. package/general/format-number.js +1 -1
  107. package/general/format-number.mjs +1 -0
  108. package/general/format-phone-display.d.mts +9 -0
  109. package/general/format-phone-display.js +1 -1
  110. package/general/format-phone-display.mjs +1 -0
  111. package/general/format-phone.d.mts +13 -0
  112. package/general/format-phone.d.ts +1 -3
  113. package/general/format-phone.js +1 -1
  114. package/general/format-phone.mjs +1 -0
  115. package/general/format-pricing.d.mts +8 -0
  116. package/general/format-pricing.js +1 -1
  117. package/general/format-pricing.mjs +1 -0
  118. package/general/format-secs.d.mts +8 -0
  119. package/general/format-secs.js +1 -1
  120. package/general/format-secs.mjs +1 -0
  121. package/general/format-time.d.mts +11 -0
  122. package/general/format-time.js +1 -1
  123. package/general/format-time.mjs +1 -0
  124. package/general/format-value.d.mts +8 -0
  125. package/general/format-value.js +1 -1
  126. package/general/format-value.mjs +1 -0
  127. package/general/full-month-range.d.mts +13 -0
  128. package/general/full-month-range.js +1 -1
  129. package/general/full-month-range.mjs +1 -0
  130. package/general/full-year-range.d.mts +12 -0
  131. package/general/full-year-range.js +1 -1
  132. package/general/full-year-range.mjs +1 -0
  133. package/general/generate-article-schema.d.mts +50 -0
  134. package/general/generate-article-schema.js +1 -1
  135. package/general/generate-article-schema.mjs +1 -0
  136. package/general/generate-blog-schema.d.mts +37 -0
  137. package/general/generate-blog-schema.js +1 -1
  138. package/general/generate-blog-schema.mjs +1 -0
  139. package/general/generate-book-schema.d.mts +58 -0
  140. package/general/generate-book-schema.js +1 -1
  141. package/general/generate-book-schema.mjs +1 -0
  142. package/general/generate-breadcrumb-schema.d.mts +40 -0
  143. package/general/generate-breadcrumb-schema.js +1 -1
  144. package/general/generate-breadcrumb-schema.mjs +1 -0
  145. package/general/generate-carousel-schema.d.mts +52 -0
  146. package/general/generate-carousel-schema.js +1 -1
  147. package/general/generate-carousel-schema.mjs +1 -0
  148. package/general/generate-course-schema.d.mts +53 -0
  149. package/general/generate-course-schema.js +1 -1
  150. package/general/generate-course-schema.mjs +1 -0
  151. package/general/generate-dataset-schema.d.mts +65 -0
  152. package/general/generate-dataset-schema.js +1 -1
  153. package/general/generate-dataset-schema.mjs +1 -0
  154. package/general/generate-discussion-forum-schema.d.mts +39 -0
  155. package/general/generate-discussion-forum-schema.js +1 -1
  156. package/general/generate-discussion-forum-schema.mjs +1 -0
  157. package/general/generate-education-schema.d.mts +68 -0
  158. package/general/generate-education-schema.js +1 -1
  159. package/general/generate-education-schema.mjs +1 -0
  160. package/general/generate-employer-aggregate-rating-schema.d.mts +29 -0
  161. package/general/generate-employer-aggregate-rating-schema.js +1 -1
  162. package/general/generate-employer-aggregate-rating-schema.mjs +1 -0
  163. package/general/generate-event-schema.d.mts +63 -0
  164. package/general/generate-event-schema.js +1 -1
  165. package/general/generate-event-schema.mjs +1 -0
  166. package/general/generate-faq-schema.d.mts +32 -0
  167. package/general/generate-faq-schema.js +1 -1
  168. package/general/generate-faq-schema.mjs +1 -0
  169. package/general/generate-grid.d.mts +17 -0
  170. package/general/generate-grid.js +1 -1
  171. package/general/generate-grid.mjs +1 -0
  172. package/general/generate-image-metadata-schema.d.mts +36 -0
  173. package/general/generate-image-metadata-schema.js +1 -1
  174. package/general/generate-image-metadata-schema.mjs +1 -0
  175. package/general/generate-job-posting-schema.d.mts +49 -0
  176. package/general/generate-job-posting-schema.js +1 -1
  177. package/general/generate-job-posting-schema.mjs +1 -0
  178. package/general/generate-local-business-schema.d.mts +42 -0
  179. package/general/generate-local-business-schema.js +1 -1
  180. package/general/generate-local-business-schema.mjs +1 -0
  181. package/general/generate-math-solver-schema.d.mts +45 -0
  182. package/general/generate-math-solver-schema.js +1 -1
  183. package/general/generate-math-solver-schema.mjs +1 -0
  184. package/general/generate-movie-carousel-schema.d.mts +51 -0
  185. package/general/generate-movie-carousel-schema.js +1 -1
  186. package/general/generate-movie-carousel-schema.mjs +1 -0
  187. package/general/generate-organization-schema.d.mts +49 -0
  188. package/general/generate-organization-schema.js +1 -1
  189. package/general/generate-organization-schema.mjs +1 -0
  190. package/general/generate-profile-page-schema.d.mts +37 -0
  191. package/general/generate-profile-page-schema.js +1 -1
  192. package/general/generate-profile-page-schema.mjs +1 -0
  193. package/general/generate-qa-page-schema.d.mts +34 -0
  194. package/general/generate-qa-page-schema.js +1 -1
  195. package/general/generate-qa-page-schema.mjs +1 -0
  196. package/general/generate-recipe-schema.d.mts +49 -0
  197. package/general/generate-recipe-schema.js +1 -1
  198. package/general/generate-recipe-schema.mjs +1 -0
  199. package/general/generate-ref.d.mts +11 -0
  200. package/general/generate-ref.js +1 -1
  201. package/general/generate-ref.mjs +1 -0
  202. package/general/generate-review-snippet-schema.d.mts +52 -0
  203. package/general/generate-review-snippet-schema.js +1 -1
  204. package/general/generate-review-snippet-schema.mjs +1 -0
  205. package/general/generate-shopping-loyalty-program-schema.d.mts +38 -0
  206. package/general/generate-shopping-loyalty-program-schema.js +1 -1
  207. package/general/generate-shopping-loyalty-program-schema.mjs +1 -0
  208. package/general/generate-shopping-merchant-listing-schema.d.mts +53 -0
  209. package/general/generate-shopping-merchant-listing-schema.js +1 -1
  210. package/general/generate-shopping-merchant-listing-schema.mjs +1 -0
  211. package/general/generate-shopping-merchant-return-policy-schema.d.mts +32 -0
  212. package/general/generate-shopping-merchant-return-policy-schema.js +1 -1
  213. package/general/generate-shopping-merchant-return-policy-schema.mjs +1 -0
  214. package/general/generate-shopping-merchant-shipping-policy-schema.d.mts +36 -0
  215. package/general/generate-shopping-merchant-shipping-policy-schema.js +1 -1
  216. package/general/generate-shopping-merchant-shipping-policy-schema.mjs +1 -0
  217. package/general/generate-shopping-overview-schema.d.mts +52 -0
  218. package/general/generate-shopping-overview-schema.js +1 -1
  219. package/general/generate-shopping-overview-schema.mjs +1 -0
  220. package/general/generate-shopping-product-snippet-schema.d.mts +57 -0
  221. package/general/generate-shopping-product-snippet-schema.js +1 -1
  222. package/general/generate-shopping-product-snippet-schema.mjs +1 -0
  223. package/general/generate-shopping-variants-schema.d.mts +46 -0
  224. package/general/generate-shopping-variants-schema.js +1 -1
  225. package/general/generate-shopping-variants-schema.mjs +1 -0
  226. package/general/generate-software-app-schema.d.mts +62 -0
  227. package/general/generate-software-app-schema.js +1 -1
  228. package/general/generate-software-app-schema.mjs +1 -0
  229. package/general/generate-speakable-schema.d.mts +64 -0
  230. package/general/generate-speakable-schema.js +1 -1
  231. package/general/generate-speakable-schema.mjs +1 -0
  232. package/general/generate-subscription-schema.d.mts +60 -0
  233. package/general/generate-subscription-schema.js +1 -1
  234. package/general/generate-subscription-schema.mjs +1 -0
  235. package/general/generate-vacation-rental-schema.d.mts +67 -0
  236. package/general/generate-vacation-rental-schema.js +1 -1
  237. package/general/generate-vacation-rental-schema.mjs +1 -0
  238. package/general/generate-video-schema.d.mts +75 -0
  239. package/general/generate-video-schema.js +1 -1
  240. package/general/generate-video-schema.mjs +1 -0
  241. package/general/generic-cache.d.mts +193 -0
  242. package/general/generic-cache.js +1 -1
  243. package/general/generic-cache.mjs +1 -0
  244. package/general/get-available-page-limit.d.mts +11 -0
  245. package/general/get-available-page-limit.js +1 -1
  246. package/general/get-available-page-limit.mjs +1 -0
  247. package/general/get-calendar-current-month.d.mts +15 -0
  248. package/general/get-calendar-current-month.js +1 -1
  249. package/general/get-calendar-current-month.mjs +1 -0
  250. package/general/get-calendar-dates.d.mts +15 -0
  251. package/general/get-calendar-dates.js +1 -1
  252. package/general/get-calendar-dates.mjs +1 -0
  253. package/general/get-calendar-next-month.d.mts +17 -0
  254. package/general/get-calendar-next-month.js +1 -1
  255. package/general/get-calendar-next-month.mjs +1 -0
  256. package/general/get-calendar-previous-month.d.mts +17 -0
  257. package/general/get-calendar-previous-month.js +1 -1
  258. package/general/get-calendar-previous-month.mjs +1 -0
  259. package/general/get-current-year.d.mts +7 -0
  260. package/general/get-current-year.js +1 -1
  261. package/general/get-current-year.mjs +1 -0
  262. package/general/get-day-name.d.mts +10 -0
  263. package/general/get-day-name.js +1 -1
  264. package/general/get-day-name.mjs +1 -0
  265. package/general/get-dial-code.d.mts +8 -0
  266. package/general/get-dial-code.js +1 -1
  267. package/general/get-dial-code.mjs +1 -0
  268. package/general/get-full-name.d.mts +13 -0
  269. package/general/get-full-name.js +1 -1
  270. package/general/get-full-name.mjs +1 -0
  271. package/general/get-href.d.mts +11 -0
  272. package/general/get-href.js +1 -1
  273. package/general/get-href.mjs +1 -0
  274. package/general/get-month-name.d.mts +10 -0
  275. package/general/get-month-name.js +1 -1
  276. package/general/get-month-name.mjs +1 -0
  277. package/general/get-month-number.d.mts +15 -0
  278. package/general/get-month-number.js +1 -1
  279. package/general/get-month-number.mjs +1 -0
  280. package/general/get-number-of-days-in-month.d.mts +13 -0
  281. package/general/get-number-of-days-in-month.js +1 -1
  282. package/general/get-number-of-days-in-month.mjs +1 -0
  283. package/general/get-pathname.d.mts +11 -0
  284. package/general/get-pathname.js +1 -1
  285. package/general/get-pathname.mjs +1 -0
  286. package/general/get-week-day.d.mts +8 -0
  287. package/general/get-week-day.js +1 -1
  288. package/general/get-week-day.mjs +1 -0
  289. package/general/image-url-to-base64.d.mts +9 -0
  290. package/general/image-url-to-base64.js +1 -1
  291. package/general/image-url-to-base64.mjs +1 -0
  292. package/general/is-created-or-updated.d.mts +13 -0
  293. package/general/is-created-or-updated.js +1 -1
  294. package/general/is-created-or-updated.mjs +1 -0
  295. package/general/is-next-button-disabled.d.mts +9 -0
  296. package/general/is-next-button-disabled.js +1 -1
  297. package/general/is-next-button-disabled.mjs +1 -0
  298. package/general/is-odd.d.mts +11 -0
  299. package/general/is-odd.js +1 -1
  300. package/general/is-odd.mjs +1 -0
  301. package/general/is-previous-button-disabled.d.mts +8 -0
  302. package/general/is-previous-button-disabled.js +1 -1
  303. package/general/is-previous-button-disabled.mjs +1 -0
  304. package/general/linear-gradients.d.mts +14 -0
  305. package/general/linear-gradients.js +1 -1
  306. package/general/linear-gradients.mjs +1 -0
  307. package/general/multi-part-search.d.mts +22 -0
  308. package/general/multi-part-search.js +1 -1
  309. package/general/multi-part-search.mjs +1 -0
  310. package/general/normalize-phone.d.mts +15 -0
  311. package/general/normalize-phone.js +1 -1
  312. package/general/normalize-phone.mjs +1 -0
  313. package/general/parse-frontmatter.d.mts +36 -0
  314. package/general/parse-frontmatter.js +1 -2
  315. package/general/parse-frontmatter.mjs +1 -0
  316. package/general/remove-data-image-prefix.d.mts +8 -0
  317. package/general/remove-data-image-prefix.js +1 -1
  318. package/general/remove-data-image-prefix.mjs +1 -0
  319. package/general/repeat-times.d.mts +15 -0
  320. package/general/repeat-times.js +1 -1
  321. package/general/repeat-times.mjs +1 -0
  322. package/general/resolve-anchor-link.d.mts +13 -0
  323. package/general/resolve-anchor-link.js +1 -1
  324. package/general/resolve-anchor-link.mjs +1 -0
  325. package/general/resolve-current-date.d.mts +12 -0
  326. package/general/resolve-current-date.js +1 -1
  327. package/general/resolve-current-date.mjs +1 -0
  328. package/general/resolve-grid.d.mts +14 -0
  329. package/general/resolve-grid.js +1 -1
  330. package/general/resolve-grid.mjs +1 -0
  331. package/general/resolve-initials.d.mts +12 -0
  332. package/general/resolve-initials.js +1 -1
  333. package/general/resolve-initials.mjs +1 -0
  334. package/general/set-timezone.d.mts +9 -0
  335. package/general/set-timezone.d.ts +1 -3
  336. package/general/set-timezone.js +1 -1
  337. package/general/set-timezone.mjs +1 -0
  338. package/general/slugify.d.mts +12 -0
  339. package/general/slugify.js +1 -1
  340. package/general/slugify.mjs +1 -0
  341. package/general/text-to-enum.d.mts +8 -0
  342. package/general/text-to-enum.js +1 -1
  343. package/general/text-to-enum.mjs +1 -0
  344. package/general/text-to-sentence-case.d.mts +12 -0
  345. package/general/text-to-sentence-case.js +1 -1
  346. package/general/text-to-sentence-case.mjs +1 -0
  347. package/general/time-out.d.mts +12 -0
  348. package/general/time-out.js +1 -1
  349. package/general/time-out.mjs +1 -0
  350. package/general/time-zones.d.mts +11 -0
  351. package/general/time-zones.js +1 -1
  352. package/general/time-zones.mjs +1 -0
  353. package/general/truncate-text.d.mts +14 -0
  354. package/general/truncate-text.js +1 -1
  355. package/general/truncate-text.mjs +1 -0
  356. package/general/type.d.mts +8 -0
  357. package/general/type.js +1 -1
  358. package/general/type.mjs +0 -0
  359. package/general/upload-blob-to-private-supabase.d.mts +24 -0
  360. package/general/upload-blob-to-private-supabase.js +1 -1
  361. package/general/upload-blob-to-private-supabase.mjs +1 -0
  362. package/general/upload-blob-to-public-supabase.d.mts +24 -0
  363. package/general/upload-blob-to-public-supabase.js +1 -1
  364. package/general/upload-blob-to-public-supabase.mjs +1 -0
  365. package/general/upload-image-to-private-supabase.d.mts +26 -0
  366. package/general/upload-image-to-private-supabase.js +1 -1
  367. package/general/upload-image-to-private-supabase.mjs +1 -0
  368. package/general/upload-image-to-public-supabase.d.mts +26 -0
  369. package/general/upload-image-to-public-supabase.js +1 -1
  370. package/general/upload-image-to-public-supabase.mjs +1 -0
  371. package/general/url-to-sentence-case.d.mts +12 -0
  372. package/general/url-to-sentence-case.js +1 -1
  373. package/general/url-to-sentence-case.mjs +1 -0
  374. package/general/validate-comment.d.mts +14 -0
  375. package/general/validate-comment.js +1 -1
  376. package/general/validate-comment.mjs +1 -0
  377. package/general/validate-email.d.mts +15 -0
  378. package/general/validate-email.js +1 -1
  379. package/general/validate-email.mjs +1 -0
  380. package/general/validate-form.d.mts +18 -0
  381. package/general/validate-form.js +1 -1
  382. package/general/validate-form.mjs +1 -0
  383. package/general/validate-name.d.mts +14 -0
  384. package/general/validate-name.js +1 -1
  385. package/general/validate-name.mjs +1 -0
  386. package/hooks/use-change.d.mts +11 -0
  387. package/hooks/use-change.js +1 -1
  388. package/hooks/use-change.mjs +1 -0
  389. package/hooks/use-debounce.d.mts +10 -0
  390. package/hooks/use-debounce.js +1 -1
  391. package/hooks/use-debounce.mjs +1 -0
  392. package/hooks/use-fetch.d.mts +42 -0
  393. package/hooks/use-fetch.js +1 -1
  394. package/hooks/use-fetch.mjs +1 -0
  395. package/hooks/use-force-render.d.mts +14 -0
  396. package/hooks/use-force-render.js +1 -1
  397. package/hooks/use-force-render.mjs +1 -0
  398. package/hooks/use-ip-geo-location.d.mts +12 -0
  399. package/hooks/use-ip-geo-location.js +1 -1
  400. package/hooks/use-ip-geo-location.mjs +1 -0
  401. package/hooks/use-is-mobile.d.mts +8 -0
  402. package/hooks/use-is-mobile.js +1 -1
  403. package/hooks/use-is-mobile.mjs +1 -0
  404. package/hooks/use-module-entity-v2.d.mts +105 -0
  405. package/hooks/use-module-entity-v2.js +1 -1
  406. package/hooks/use-module-entity-v2.mjs +1 -0
  407. package/hooks/use-module-entity.d.mts +98 -0
  408. package/hooks/use-module-entity.js +1 -1
  409. package/hooks/use-module-entity.mjs +1 -0
  410. package/hooks/use-phone-formatter.d.mts +17 -0
  411. package/hooks/use-phone-formatter.d.ts +1 -3
  412. package/hooks/use-phone-formatter.js +1 -1
  413. package/hooks/use-phone-formatter.mjs +1 -0
  414. package/hooks/use-position.d.mts +29 -0
  415. package/hooks/use-position.js +1 -1
  416. package/hooks/use-position.mjs +1 -0
  417. package/hooks/use-rtl.d.mts +46 -0
  418. package/hooks/use-rtl.js +1 -1
  419. package/hooks/use-rtl.mjs +1 -0
  420. package/hooks/use-sticky.d.mts +13 -0
  421. package/hooks/use-sticky.js +1 -1
  422. package/hooks/use-sticky.mjs +1 -0
  423. package/hooks/use-toggle-state.d.mts +14 -0
  424. package/hooks/use-toggle-state.js +1 -1
  425. package/hooks/use-toggle-state.mjs +1 -0
  426. package/hooks/use-window-event-listener.d.mts +9 -0
  427. package/hooks/use-window-event-listener.js +1 -1
  428. package/hooks/use-window-event-listener.mjs +1 -0
  429. package/hooks/with-seo.d.mts +19 -0
  430. package/hooks/with-seo.js +1 -1
  431. package/hooks/with-seo.mjs +1 -0
  432. package/local-storage/get-storage-value.d.mts +5 -0
  433. package/local-storage/get-storage-value.js +1 -1
  434. package/local-storage/get-storage-value.mjs +1 -0
  435. package/local-storage/remove-storage-value.d.mts +3 -0
  436. package/local-storage/remove-storage-value.js +1 -1
  437. package/local-storage/remove-storage-value.mjs +1 -0
  438. package/local-storage/set-storage-value.d.mts +3 -0
  439. package/local-storage/set-storage-value.js +1 -1
  440. package/local-storage/set-storage-value.mjs +1 -0
  441. package/local-storage/type.d.mts +3 -0
  442. package/local-storage/type.js +1 -1
  443. package/local-storage/type.mjs +0 -0
  444. package/npm.d.d.mts +2 -0
  445. package/npm.d.mjs +0 -0
  446. package/package.json +7 -6
  447. package/edu-pilot-pro/types/academics.d.ts +0 -2
  448. package/edu-pilot-pro/types/academics.js +0 -1
  449. package/edu-pilot-pro/types/admission.d.ts +0 -878
  450. package/edu-pilot-pro/types/admission.js +0 -1
  451. package/edu-pilot-pro/types/communication.d.ts +0 -2
  452. package/edu-pilot-pro/types/communication.js +0 -1
  453. package/edu-pilot-pro/types/enums.d.ts +0 -413
  454. package/edu-pilot-pro/types/enums.js +0 -1
  455. package/edu-pilot-pro/types/finance.d.ts +0 -2
  456. package/edu-pilot-pro/types/finance.js +0 -1
  457. package/edu-pilot-pro/types/index.d.ts +0 -2
  458. package/edu-pilot-pro/types/index.js +0 -1
  459. package/edu-pilot-pro/types/user-management.d.ts +0 -2
  460. package/edu-pilot-pro/types/user-management.js +0 -1
  461. package/storybook/generate-sitemap.d.ts +0 -16
  462. package/storybook/generate-sitemap.js +0 -17
  463. package/storybook/preview.d.ts +0 -148
  464. package/storybook/preview.js +0 -1
  465. package/storybook/react-design-story-script.d.ts +0 -12
  466. package/storybook/react-design-story-script.js +0 -5
  467. package/storybook/react-emoji-collection.d.ts +0 -13
  468. package/storybook/react-emoji-collection.js +0 -11
  469. package/storybook/react-emoji-story-script.d.ts +0 -12
  470. package/storybook/react-emoji-story-script.js +0 -5
  471. package/storybook/react-emoji-story-template.d.ts +0 -14
  472. package/storybook/react-emoji-story-template.js +0 -46
  473. package/storybook/react-icon-collection.d.ts +0 -13
  474. package/storybook/react-icon-collection.js +0 -11
  475. package/storybook/react-icon-story-script.d.ts +0 -12
  476. package/storybook/react-icon-story-script.js +0 -5
  477. package/storybook/react-icon-story-template.d.ts +0 -13
  478. package/storybook/react-icon-story-template.js +0 -46
  479. package/storybook/react-logo-collection.d.ts +0 -13
  480. package/storybook/react-logo-collection.js +0 -11
  481. package/storybook/react-logo-story-script.d.ts +0 -12
  482. package/storybook/react-logo-story-script.js +0 -5
  483. package/storybook/react-logo-story-template.d.ts +0 -13
  484. package/storybook/react-logo-story-template.js +0 -46
  485. package/storybook/react-pakistan-theme.d.ts +0 -25
  486. package/storybook/react-pakistan-theme.js +0 -1
  487. package/storybook/responsive-args.d.ts +0 -22
  488. package/storybook/responsive-args.js +0 -1
  489. package/storybook/responsive-component.d.ts +0 -33
  490. package/storybook/responsive-component.js +0 -37
  491. package/storybook/responsive-screens.d.ts +0 -108
  492. package/storybook/responsive-screens.js +0 -1
  493. package/storybook/theme.d.ts +0 -96
  494. package/storybook/theme.js +0 -1
@@ -0,0 +1,42 @@
1
+ interface FetchResult {
2
+ data: any;
3
+ error: any;
4
+ status?: number;
5
+ ok?: boolean;
6
+ }
7
+ interface FetchConfig extends Omit<RequestInit, 'credentials'> {
8
+ autoFetch?: boolean;
9
+ callback?: (result: FetchResult) => void;
10
+ /**
11
+ * If `true`, the fetch will be invoked with `credentials: 'include'`.
12
+ * String values from the standard `RequestCredentials` are also supported
13
+ * (e.g. 'omit' | 'same-origin' | 'include').
14
+ */
15
+ credentials?: boolean | RequestCredentials;
16
+ /**
17
+ * Query parameters to append to GET requests.
18
+ * Supports strings, numbers, booleans, arrays, and objects.
19
+ * - Primitives (string, number, boolean) are converted to strings
20
+ * - Arrays are repeated as multiple params with the same key
21
+ * - Objects are JSON-stringified
22
+ * - null and undefined values are skipped
23
+ *
24
+ * Example: { active: true, page: 1, tags: ['a', 'b'] }
25
+ * Results in: ?active=true&page=1&tags=a&tags=b
26
+ */
27
+ params?: Record<string, any>;
28
+ }
29
+ interface Return {
30
+ apiResult: API_RESULT | undefined;
31
+ data: any;
32
+ error: any;
33
+ fetchNow: (url?: string, config?: FetchConfig) => void;
34
+ loading: boolean;
35
+ }
36
+ declare enum API_RESULT {
37
+ SUCCESS = "SUCCESS",
38
+ ERROR = "ERROR"
39
+ }
40
+ declare const useFetch: (url: string, config?: FetchConfig, deps?: Array<string> | Array<any>) => Return;
41
+
42
+ export { API_RESULT, type FetchConfig, type FetchResult, type Return, useFetch };
@@ -1 +1 @@
1
- var A=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var Q=(r,n)=>{for(var a in n)A(r,a,{get:n[a],enumerable:!0})},V=(r,n,a,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of B(n))!K.call(r,s)&&s!==a&&A(r,s,{get:()=>n[s],enumerable:!(c=z(n,s))||c.enumerable});return r};var W=r=>V(A({},"__esModule",{value:!0}),r);var Y={};Q(Y,{API_RESULT:()=>T,useFetch:()=>X});module.exports=W(Y);var e=require("react"),T=(a=>(a.SUCCESS="SUCCESS",a.ERROR="ERROR",a))(T||{});const X=(r,n={},a=[])=>{const{callback:c,autoFetch:s=!1,...F}=n,[L,h]=(0,e.useState)(null),[j,y]=(0,e.useState)(null),[q,P]=(0,e.useState)(!1),[D,g]=(0,e.useState)(void 0),U=(0,e.useRef)(null),d=(0,e.useRef)(!0),w=(0,e.useRef)(!1);(0,e.useEffect)(()=>(d.current=!0,()=>{d.current=!1,U.current?.abort()}),[]);const S=(0,e.useCallback)(async(N,_)=>{let u=N||r;const{params:G,...b}=F||{},{params:$,...m}=_||{},E={...G||{},...$||{}},l={...b,...m,headers:{...b.headers||{},...m.headers||{}}},H=(l.method||"GET").toString().toUpperCase(),C=m.credentials,O=b.credentials;if(typeof C=="string"?l.credentials=C:C===!0?l.credentials="include":typeof O=="string"?l.credentials=O:O===!0&&(l.credentials="include"),H==="GET"&&E&&Object.keys(E).length){const t=u.indexOf("#"),o=t>=0?u.slice(t):"",i=t>=0?u.slice(0,t):u,p=i.indexOf("?"),J=p>=0?i.slice(0,p):i,M=p>=0?i.slice(p+1):"",R=new URLSearchParams(M);Object.entries(E).forEach(([x,f])=>{f!=null&&(Array.isArray(f)?f.forEach(v=>R.append(x,String(v))):typeof f=="object"?R.append(x,JSON.stringify(f)):R.append(x,String(f)))});const I=R.toString();u=J+(I?`?${I}`:"")+o}P(!0),y(null),h(null);const k=new AbortController;U.current=k,l.signal=k.signal;try{const t=await fetch(u,l);let o=null;try{o=await t.json()}catch{o=null}if(d.current)if(t.ok)h(o),y(null),g("SUCCESS"),c?.({data:o,error:null,status:t.status,ok:!0});else{const i=new Error(`HTTP error! status: ${t.status}`);y(i),h(o),g("ERROR"),c?.({data:o,error:i,status:t.status,ok:!1})}}catch(t){d.current&&(y(t),h(null),g("ERROR"),c?.({data:null,error:t,status:void 0,ok:!1}))}finally{d.current&&P(!1)}},[r,F,c,...a]);return(0,e.useEffect)(()=>{s&&!w.current&&(w.current=!0,S())},[S,s]),{apiResult:D,data:L,error:j,fetchNow:S,loading:q}};0&&(module.exports={API_RESULT,useFetch});
1
+ function _0x4353(_0x7978b0,_0x33075e){_0x7978b0=_0x7978b0-0x11f;var _0xf31e0b=_0x2294();var _0x2c2e0c=_0xf31e0b[_0x7978b0];return _0x2c2e0c;}function _0x2294(){var _0x9883e3=['18ttVVyO','credentials','indexOf','log','32876RnOWTk','315664tspkLs','enumerable','length','ERROR','console','HTTP\x20error!\x20status:\x20','error','useCallback','88092OQPJlN','object','105iyEjJs','headers','__proto__','7275212sbFDHD','__esModule','abort','15bSnIly','1039570bhAxbV','function','SUCCESS','call','slice','789510cRSUrr','toString','useEffect','forEach','react','return\x20(function()\x20','include','string','280694DkLHeL','status','apply','exception','trace','defineProperty','json','GET','current','constructor','bind'];_0x2294=function(){return _0x9883e3;};return _0x2294();}var _0x10fb01=_0x4353;(function(_0x12aba7,_0x216d2b){var _0x3466d4=_0x4353,_0x192930=_0x12aba7();while(!![]){try{var _0x3b8dd0=-parseInt(_0x3466d4(0x13e))/0x1+-parseInt(_0x3466d4(0x128))/0x2+parseInt(_0x3466d4(0x12a))/0x3*(parseInt(_0x3466d4(0x11f))/0x4)+parseInt(_0x3466d4(0x130))/0x5*(-parseInt(_0x3466d4(0x136))/0x6)+parseInt(_0x3466d4(0x12d))/0x7+-parseInt(_0x3466d4(0x120))/0x8*(-parseInt(_0x3466d4(0x149))/0x9)+-parseInt(_0x3466d4(0x131))/0xa;if(_0x3b8dd0===_0x216d2b)break;else _0x192930['push'](_0x192930['shift']());}catch(_0x4db64e){_0x192930['push'](_0x192930['shift']());}}}(_0x2294,0x8e32d));var _0x4cb768=(function(){var _0x1781b6=!![];return function(_0x4553a9,_0x37a23a){var _0x2864c7=_0x1781b6?function(){var _0x11fa18=_0x4353;if(_0x37a23a){var _0x257265=_0x37a23a[_0x11fa18(0x140)](_0x4553a9,arguments);return _0x37a23a=null,_0x257265;}}:function(){};return _0x1781b6=![],_0x2864c7;};}()),_0x2c2e0c=_0x4cb768(this,function(){var _0x9ebcdc=_0x4353,_0xfc8ecd;try{var _0x4743b5=Function(_0x9ebcdc(0x13b)+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');_0xfc8ecd=_0x4743b5();}catch(_0x2cd7eb){_0xfc8ecd=window;}var _0xbb0831=_0xfc8ecd[_0x9ebcdc(0x124)]=_0xfc8ecd[_0x9ebcdc(0x124)]||{},_0x2a61d4=[_0x9ebcdc(0x14c),'warn','info',_0x9ebcdc(0x126),_0x9ebcdc(0x141),'table',_0x9ebcdc(0x142)];for(var _0x123774=0x0;_0x123774<_0x2a61d4[_0x9ebcdc(0x122)];_0x123774++){var _0x34fdb7=_0x4cb768[_0x9ebcdc(0x147)]['prototype'][_0x9ebcdc(0x148)](_0x4cb768),_0x3785da=_0x2a61d4[_0x123774],_0x62acbd=_0xbb0831[_0x3785da]||_0x34fdb7;_0x34fdb7[_0x9ebcdc(0x12c)]=_0x4cb768[_0x9ebcdc(0x148)](_0x4cb768),_0x34fdb7['toString']=_0x62acbd['toString']['bind'](_0x62acbd),_0xbb0831[_0x3785da]=_0x34fdb7;}});_0x2c2e0c();var A=Object[_0x10fb01(0x143)],z=Object['getOwnPropertyDescriptor'],B=Object['getOwnPropertyNames'],K=Object['prototype']['hasOwnProperty'],Q=(_0x59c5b9,_0x1cdae6)=>{for(var _0x5eeae7 in _0x1cdae6)A(_0x59c5b9,_0x5eeae7,{'get':_0x1cdae6[_0x5eeae7],'enumerable':!0x0});},V=(_0x4f0676,_0x48887f,_0x20c0c6,_0x245150)=>{var _0x5fb331=_0x10fb01;if(_0x48887f&&typeof _0x48887f==_0x5fb331(0x129)||typeof _0x48887f==_0x5fb331(0x132)){for(let _0x55a121 of B(_0x48887f))!K[_0x5fb331(0x134)](_0x4f0676,_0x55a121)&&_0x55a121!==_0x20c0c6&&A(_0x4f0676,_0x55a121,{'get':()=>_0x48887f[_0x55a121],'enumerable':!(_0x245150=z(_0x48887f,_0x55a121))||_0x245150[_0x5fb331(0x121)]});}return _0x4f0676;},W=_0x2a8bd4=>V(A({},_0x10fb01(0x12e),{'value':!0x0}),_0x2a8bd4),Y={};Q(Y,{'API_RESULT':()=>T,'useFetch':()=>X}),module['exports']=W(Y);var e=require(_0x10fb01(0x13a)),T=(_0x2bbfc0=>(_0x2bbfc0[_0x10fb01(0x133)]='SUCCESS',_0x2bbfc0['ERROR']=_0x10fb01(0x123),_0x2bbfc0))(T||{});const X=(_0x56968c,_0x56be50={},_0xa56419=[])=>{var _0x5af89f=_0x10fb01;const {callback:_0x3b7d2f,autoFetch:_0x13311c=!0x1,..._0x140804}=_0x56be50,[_0x44f2ce,_0x42c7a3]=(0x0,e['useState'])(null),[_0x568184,_0x402a2f]=(0x0,e['useState'])(null),[_0x3ac7cb,_0x5d830d]=(0x0,e['useState'])(!0x1),[_0x2509e0,_0x309336]=(0x0,e['useState'])(void 0x0),_0x286c54=(0x0,e['useRef'])(null),_0x25563f=(0x0,e['useRef'])(!0x0),_0x22d9c9=(0x0,e['useRef'])(!0x1);(0x0,e['useEffect'])(()=>(_0x25563f[_0x5af89f(0x146)]=!0x0,()=>{var _0x12b700=_0x5af89f;_0x25563f['current']=!0x1,_0x286c54[_0x12b700(0x146)]?.[_0x12b700(0x12f)]();}),[]);const _0x2c594d=(0x0,e[_0x5af89f(0x127)])(async(_0x54957b,_0x75de14)=>{var _0x2d4d6e=_0x5af89f;let _0x2008bf=_0x54957b||_0x56968c;const {params:_0x18a163,..._0x4b67b3}=_0x140804||{},{params:_0x33d84b,..._0x25683a}=_0x75de14||{},_0x483e6d={..._0x18a163||{},..._0x33d84b||{}},_0x9baa64={..._0x4b67b3,..._0x25683a,'headers':{..._0x4b67b3[_0x2d4d6e(0x12b)]||{},..._0x25683a[_0x2d4d6e(0x12b)]||{}}},_0x810b50=(_0x9baa64['method']||_0x2d4d6e(0x145))[_0x2d4d6e(0x137)]()['toUpperCase'](),_0x6a47fa=_0x25683a[_0x2d4d6e(0x14a)],_0x6d7274=_0x4b67b3[_0x2d4d6e(0x14a)];if(typeof _0x6a47fa==_0x2d4d6e(0x13d)?_0x9baa64[_0x2d4d6e(0x14a)]=_0x6a47fa:_0x6a47fa===!0x0?_0x9baa64['credentials']=_0x2d4d6e(0x13c):typeof _0x6d7274==_0x2d4d6e(0x13d)?_0x9baa64[_0x2d4d6e(0x14a)]=_0x6d7274:_0x6d7274===!0x0&&(_0x9baa64[_0x2d4d6e(0x14a)]=_0x2d4d6e(0x13c)),_0x810b50===_0x2d4d6e(0x145)&&_0x483e6d&&Object['keys'](_0x483e6d)[_0x2d4d6e(0x122)]){const _0x56443f=_0x2008bf[_0x2d4d6e(0x14b)]('#'),_0xaede7f=_0x56443f>=0x0?_0x2008bf[_0x2d4d6e(0x135)](_0x56443f):'',_0x2be5b5=_0x56443f>=0x0?_0x2008bf[_0x2d4d6e(0x135)](0x0,_0x56443f):_0x2008bf,_0x101903=_0x2be5b5['indexOf']('?'),_0x1c93de=_0x101903>=0x0?_0x2be5b5['slice'](0x0,_0x101903):_0x2be5b5,_0x3177bb=_0x101903>=0x0?_0x2be5b5['slice'](_0x101903+0x1):'',_0x35d71d=new URLSearchParams(_0x3177bb);Object['entries'](_0x483e6d)[_0x2d4d6e(0x139)](([_0x39f29d,_0x119c51])=>{var _0x220a22=_0x2d4d6e;_0x119c51!=null&&(Array['isArray'](_0x119c51)?_0x119c51[_0x220a22(0x139)](_0x439eb1=>_0x35d71d['append'](_0x39f29d,String(_0x439eb1))):typeof _0x119c51==_0x220a22(0x129)?_0x35d71d['append'](_0x39f29d,JSON['stringify'](_0x119c51)):_0x35d71d['append'](_0x39f29d,String(_0x119c51)));});const _0x42069f=_0x35d71d[_0x2d4d6e(0x137)]();_0x2008bf=_0x1c93de+(_0x42069f?'?'+_0x42069f:'')+_0xaede7f;}_0x5d830d(!0x0),_0x402a2f(null),_0x42c7a3(null);const _0x2cc0d7=new AbortController();_0x286c54[_0x2d4d6e(0x146)]=_0x2cc0d7,_0x9baa64['signal']=_0x2cc0d7['signal'];try{const _0x4e4103=await fetch(_0x2008bf,_0x9baa64);let _0x34a40d=null;try{_0x34a40d=await _0x4e4103[_0x2d4d6e(0x144)]();}catch{_0x34a40d=null;}if(_0x25563f[_0x2d4d6e(0x146)]){if(_0x4e4103['ok'])_0x42c7a3(_0x34a40d),_0x402a2f(null),_0x309336('SUCCESS'),_0x3b7d2f?.({'data':_0x34a40d,'error':null,'status':_0x4e4103[_0x2d4d6e(0x13f)],'ok':!0x0});else{const _0x4570f0=new Error(_0x2d4d6e(0x125)+_0x4e4103['status']);_0x402a2f(_0x4570f0),_0x42c7a3(_0x34a40d),_0x309336('ERROR'),_0x3b7d2f?.({'data':_0x34a40d,'error':_0x4570f0,'status':_0x4e4103[_0x2d4d6e(0x13f)],'ok':!0x1});}}}catch(_0x5ae5fa){_0x25563f[_0x2d4d6e(0x146)]&&(_0x402a2f(_0x5ae5fa),_0x42c7a3(null),_0x309336('ERROR'),_0x3b7d2f?.({'data':null,'error':_0x5ae5fa,'status':void 0x0,'ok':!0x1}));}finally{_0x25563f['current']&&_0x5d830d(!0x1);}},[_0x56968c,_0x140804,_0x3b7d2f,..._0xa56419]);return(0x0,e[_0x5af89f(0x138)])(()=>{var _0x5bef5f=_0x5af89f;_0x13311c&&!_0x22d9c9[_0x5bef5f(0x146)]&&(_0x22d9c9[_0x5bef5f(0x146)]=!0x0,_0x2c594d());},[_0x2c594d,_0x13311c]),{'apiResult':_0x2509e0,'data':_0x44f2ce,'error':_0x568184,'fetchNow':_0x2c594d,'loading':_0x3ac7cb};};0x0&&(module['exports']={'API_RESULT':API_RESULT,'useFetch':useFetch});
@@ -0,0 +1 @@
1
+ const _0x38317d=_0x113c;(function(_0x1bf76c,_0x226acf){const _0x17a8e5=_0x113c,_0x1ad46f=_0x1bf76c();while(!![]){try{const _0x979443=parseInt(_0x17a8e5(0x119))/0x1*(parseInt(_0x17a8e5(0x105))/0x2)+parseInt(_0x17a8e5(0x10c))/0x3*(parseInt(_0x17a8e5(0xf7))/0x4)+-parseInt(_0x17a8e5(0xfc))/0x5*(parseInt(_0x17a8e5(0xf9))/0x6)+-parseInt(_0x17a8e5(0xf4))/0x7+parseInt(_0x17a8e5(0xff))/0x8+-parseInt(_0x17a8e5(0xfd))/0x9+parseInt(_0x17a8e5(0x100))/0xa*(-parseInt(_0x17a8e5(0x115))/0xb);if(_0x979443===_0x226acf)break;else _0x1ad46f['push'](_0x1ad46f['shift']());}catch(_0xee43e6){_0x1ad46f['push'](_0x1ad46f['shift']());}}}(_0x2374,0x19fe9));const _0x3115a2=(function(){let _0x1ee309=!![];return function(_0x4ef422,_0x468086){const _0x46d495=_0x1ee309?function(){if(_0x468086){const _0x995b81=_0x468086['apply'](_0x4ef422,arguments);return _0x468086=null,_0x995b81;}}:function(){};return _0x1ee309=![],_0x46d495;};}()),_0x19ad87=_0x3115a2(this,function(){const _0x5ad96b=_0x113c,_0x5238b3=function(){const _0x400907=_0x113c;let _0x20487f;try{_0x20487f=Function('return\x20(function()\x20'+_0x400907(0x111)+');')();}catch(_0x182afa){_0x20487f=window;}return _0x20487f;},_0x5a0e20=_0x5238b3(),_0x49be1c=_0x5a0e20['console']=_0x5a0e20[_0x5ad96b(0x10f)]||{},_0x4ec20c=[_0x5ad96b(0xfa),_0x5ad96b(0xf3),'info','error',_0x5ad96b(0x10a),'table','trace'];for(let _0x25868b=0x0;_0x25868b<_0x4ec20c['length'];_0x25868b++){const _0x42f017=_0x3115a2[_0x5ad96b(0x11a)]['prototype']['bind'](_0x3115a2),_0x520e09=_0x4ec20c[_0x25868b],_0x139da5=_0x49be1c[_0x520e09]||_0x42f017;_0x42f017[_0x5ad96b(0x114)]=_0x3115a2['bind'](_0x3115a2),_0x42f017[_0x5ad96b(0x10e)]=_0x139da5['toString'][_0x5ad96b(0x118)](_0x139da5),_0x49be1c[_0x520e09]=_0x42f017;}});_0x19ad87();import{useState as _0x1ae7cd,useRef as _0x3b4ea7,useCallback as _0x2768b1,useEffect as _0x5bcca2}from'react';function _0x2374(){const _0x4376a9=['1383ozkxFj','isArray','toString','console','status','{}.constructor(\x22return\x20this\x22)(\x20)','keys','string','__proto__','5423sRWkEo','current','HTTP\x20error!\x20status:\x20','bind','1TmQRRY','constructor','warn','1208949iSnrQL','SUCCESS','slice','964CEkQWW','json','78gWXSRg','log','length','46010UWUeCQ','405774geiltK','append','1171048wbsVpE','110bLXdIB','stringify','ERROR','credentials','GET','383666kBjHGM','method','include','indexOf','headers','exception','forEach'];_0x2374=function(){return _0x4376a9;};return _0x2374();}var B=(_0x50ef46=>(_0x50ef46[_0x38317d(0xf5)]=_0x38317d(0xf5),_0x50ef46[_0x38317d(0x102)]=_0x38317d(0x102),_0x50ef46))(B||{});function _0x113c(_0x387422,_0x56a775){_0x387422=_0x387422-0xf3;const _0x5c7bcc=_0x2374();let _0x19ad87=_0x5c7bcc[_0x387422];return _0x19ad87;}const Q=(_0x26b953,_0x2b8709={},_0x3bd47e=[])=>{const {callback:_0x41690f,autoFetch:_0x3e7ce8=!0x1,..._0x5beeeb}=_0x2b8709,[_0xac62f,_0xa6078a]=_0x1ae7cd(null),[_0x5a1de1,_0x28d78b]=_0x1ae7cd(null),[_0x461223,_0x132ed0]=_0x1ae7cd(!0x1),[_0x2118e9,_0xc5be3c]=_0x1ae7cd(void 0x0),_0x2b4acb=_0x3b4ea7(null),_0x43035e=_0x3b4ea7(!0x0),_0x5e70b6=_0x3b4ea7(!0x1);_0x5bcca2(()=>(_0x43035e['current']=!0x0,()=>{const _0x5adac1=_0x113c;_0x43035e[_0x5adac1(0x116)]=!0x1,_0x2b4acb[_0x5adac1(0x116)]?.['abort']();}),[]);const _0x568a0a=_0x2768b1(async(_0x4dc6c3,_0x2e6a94)=>{const _0x5af71e=_0x113c;let _0x4380ea=_0x4dc6c3||_0x26b953;const {params:_0x1418b4,..._0x247cf5}=_0x5beeeb||{},{params:_0xde8252,..._0x20d1fe}=_0x2e6a94||{},_0x586acc={..._0x1418b4||{},..._0xde8252||{}},_0x2796f6={..._0x247cf5,..._0x20d1fe,'headers':{..._0x247cf5['headers']||{},..._0x20d1fe[_0x5af71e(0x109)]||{}}},_0x564a9e=(_0x2796f6[_0x5af71e(0x106)]||'GET')['toString']()['toUpperCase'](),_0xb26701=_0x20d1fe[_0x5af71e(0x103)],_0x36ccbf=_0x247cf5['credentials'];if(typeof _0xb26701==_0x5af71e(0x113)?_0x2796f6[_0x5af71e(0x103)]=_0xb26701:_0xb26701===!0x0?_0x2796f6[_0x5af71e(0x103)]=_0x5af71e(0x107):typeof _0x36ccbf==_0x5af71e(0x113)?_0x2796f6['credentials']=_0x36ccbf:_0x36ccbf===!0x0&&(_0x2796f6[_0x5af71e(0x103)]='include'),_0x564a9e===_0x5af71e(0x104)&&_0x586acc&&Object[_0x5af71e(0x112)](_0x586acc)[_0x5af71e(0xfb)]){const _0x125f5e=_0x4380ea['indexOf']('#'),_0xfcb346=_0x125f5e>=0x0?_0x4380ea[_0x5af71e(0xf6)](_0x125f5e):'',_0x1d3a46=_0x125f5e>=0x0?_0x4380ea['slice'](0x0,_0x125f5e):_0x4380ea,_0x2de55d=_0x1d3a46[_0x5af71e(0x108)]('?'),_0x37c51c=_0x2de55d>=0x0?_0x1d3a46['slice'](0x0,_0x2de55d):_0x1d3a46,_0x5f4a66=_0x2de55d>=0x0?_0x1d3a46[_0x5af71e(0xf6)](_0x2de55d+0x1):'',_0x2c3f37=new URLSearchParams(_0x5f4a66);Object['entries'](_0x586acc)['forEach'](([_0x5c6462,_0x493509])=>{const _0x14330d=_0x5af71e;_0x493509!=null&&(Array[_0x14330d(0x10d)](_0x493509)?_0x493509[_0x14330d(0x10b)](_0x36571a=>_0x2c3f37['append'](_0x5c6462,String(_0x36571a))):typeof _0x493509=='object'?_0x2c3f37[_0x14330d(0xfe)](_0x5c6462,JSON[_0x14330d(0x101)](_0x493509)):_0x2c3f37['append'](_0x5c6462,String(_0x493509)));});const _0x57f59f=_0x2c3f37['toString']();_0x4380ea=_0x37c51c+(_0x57f59f?'?'+_0x57f59f:'')+_0xfcb346;}_0x132ed0(!0x0),_0x28d78b(null),_0xa6078a(null);const _0x5a5a48=new AbortController();_0x2b4acb[_0x5af71e(0x116)]=_0x5a5a48,_0x2796f6['signal']=_0x5a5a48['signal'];try{const _0x4d1804=await fetch(_0x4380ea,_0x2796f6);let _0x1410f9=null;try{_0x1410f9=await _0x4d1804[_0x5af71e(0xf8)]();}catch{_0x1410f9=null;}if(_0x43035e[_0x5af71e(0x116)]){if(_0x4d1804['ok'])_0xa6078a(_0x1410f9),_0x28d78b(null),_0xc5be3c(_0x5af71e(0xf5)),_0x41690f?.({'data':_0x1410f9,'error':null,'status':_0x4d1804[_0x5af71e(0x110)],'ok':!0x0});else{const _0x987376=new Error(_0x5af71e(0x117)+_0x4d1804['status']);_0x28d78b(_0x987376),_0xa6078a(_0x1410f9),_0xc5be3c('ERROR'),_0x41690f?.({'data':_0x1410f9,'error':_0x987376,'status':_0x4d1804[_0x5af71e(0x110)],'ok':!0x1});}}}catch(_0x520291){_0x43035e['current']&&(_0x28d78b(_0x520291),_0xa6078a(null),_0xc5be3c(_0x5af71e(0x102)),_0x41690f?.({'data':null,'error':_0x520291,'status':void 0x0,'ok':!0x1}));}finally{_0x43035e[_0x5af71e(0x116)]&&_0x132ed0(!0x1);}},[_0x26b953,_0x5beeeb,_0x41690f,..._0x3bd47e]);return _0x5bcca2(()=>{const _0x479274=_0x113c;_0x3e7ce8&&!_0x5e70b6['current']&&(_0x5e70b6[_0x479274(0x116)]=!0x0,_0x568a0a());},[_0x568a0a,_0x3e7ce8]),{'apiResult':_0x2118e9,'data':_0xac62f,'error':_0x5a1de1,'fetchNow':_0x568a0a,'loading':_0x461223};};export{B as API_RESULT,Q as useFetch};
@@ -0,0 +1,14 @@
1
+ import { DispatchWithoutAction } from 'react';
2
+
3
+ /**
4
+ * A util hook to enable force renders.
5
+ *
6
+ * @returns dispatch without action
7
+ * @author Taimoor Khan
8
+ * @remarks
9
+ */
10
+ /** End file docs */
11
+
12
+ declare const useForceRender: () => DispatchWithoutAction;
13
+
14
+ export { useForceRender };
@@ -1 +1 @@
1
- var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var p=(e,t)=>{for(var c in t)r(e,c,{get:t[c],enumerable:!0})},a=(e,t,c,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of u(t))!h.call(e,o)&&o!==c&&r(e,o,{get:()=>t[o],enumerable:!(i=s(t,o))||i.enumerable});return e};var d=e=>a(r({},"__esModule",{value:!0}),e);var A={};p(A,{useForceRender:()=>m});module.exports=d(A);var n=require("react");const m=()=>{const[,e]=(0,n.useReducer)(t=>t+1,0);return e};0&&(module.exports={useForceRender});
1
+ function _0x3212(_0x4052c1,_0x28ca4e){_0x4052c1=_0x4052c1-0x12e;var _0x15d5e0=_0x43d7();var _0x4b37eb=_0x15d5e0[_0x4052c1];return _0x4b37eb;}var _0x16ebd4=_0x3212;(function(_0x2c50fd,_0x39447a){var _0x390d13=_0x3212,_0xd05321=_0x2c50fd();while(!![]){try{var _0x5dbda2=parseInt(_0x390d13(0x13c))/0x1*(parseInt(_0x390d13(0x139))/0x2)+-parseInt(_0x390d13(0x12e))/0x3+-parseInt(_0x390d13(0x132))/0x4+parseInt(_0x390d13(0x13b))/0x5+-parseInt(_0x390d13(0x13a))/0x6+parseInt(_0x390d13(0x12f))/0x7+-parseInt(_0x390d13(0x13d))/0x8;if(_0x5dbda2===_0x39447a)break;else _0xd05321['push'](_0xd05321['shift']());}catch(_0xdcda){_0xd05321['push'](_0xd05321['shift']());}}}(_0x43d7,0x279cb));var _0x536cf2=(function(){var _0x36c6ae=!![];return function(_0x170093,_0x4dacf7){var _0x540e11=_0x36c6ae?function(){var _0x296c62=_0x3212;if(_0x4dacf7){var _0x52f1ca=_0x4dacf7[_0x296c62(0x131)](_0x170093,arguments);return _0x4dacf7=null,_0x52f1ca;}}:function(){};return _0x36c6ae=![],_0x540e11;};}()),_0x4b37eb=_0x536cf2(this,function(){var _0xeb851c=_0x3212,_0x32dfa7=function(){var _0x210974;try{_0x210974=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x1ed272){_0x210974=window;}return _0x210974;},_0x1986ea=_0x32dfa7(),_0x33e7c7=_0x1986ea[_0xeb851c(0x133)]=_0x1986ea[_0xeb851c(0x133)]||{},_0x71bacc=[_0xeb851c(0x136),'warn','info','error','exception','table',_0xeb851c(0x141)];for(var _0x5522d2=0x0;_0x5522d2<_0x71bacc['length'];_0x5522d2++){var _0x535639=_0x536cf2['constructor'][_0xeb851c(0x130)]['bind'](_0x536cf2),_0x6b91b3=_0x71bacc[_0x5522d2],_0x131719=_0x33e7c7[_0x6b91b3]||_0x535639;_0x535639[_0xeb851c(0x137)]=_0x536cf2['bind'](_0x536cf2),_0x535639['toString']=_0x131719['toString'][_0xeb851c(0x138)](_0x131719),_0x33e7c7[_0x6b91b3]=_0x535639;}});_0x4b37eb();var r=Object[_0x16ebd4(0x134)],s=Object[_0x16ebd4(0x135)],u=Object[_0x16ebd4(0x13e)],h=Object[_0x16ebd4(0x130)]['hasOwnProperty'],p=(_0x1bfd33,_0x4bbc45)=>{for(var _0x2c6987 in _0x4bbc45)r(_0x1bfd33,_0x2c6987,{'get':_0x4bbc45[_0x2c6987],'enumerable':!0x0});},a=(_0x3ae25a,_0x188abf,_0x5e0c07,_0x47a16c)=>{var _0x13fe67=_0x16ebd4;if(_0x188abf&&typeof _0x188abf=='object'||typeof _0x188abf==_0x13fe67(0x140)){for(let _0xb2a041 of u(_0x188abf))!h['call'](_0x3ae25a,_0xb2a041)&&_0xb2a041!==_0x5e0c07&&r(_0x3ae25a,_0xb2a041,{'get':()=>_0x188abf[_0xb2a041],'enumerable':!(_0x47a16c=s(_0x188abf,_0xb2a041))||_0x47a16c['enumerable']});}return _0x3ae25a;},d=_0x405d6e=>a(r({},_0x16ebd4(0x13f),{'value':!0x0}),_0x405d6e),A={};p(A,{'useForceRender':()=>m}),module['exports']=d(A);var n=require('react');const m=()=>{const [,_0xfc1a0d]=(0x0,n['useReducer'])(_0x2b8ca3=>_0x2b8ca3+0x1,0x0);return _0xfc1a0d;};function _0x43d7(){var _0x2bd751=['console','defineProperty','getOwnPropertyDescriptor','log','__proto__','bind','6vuownP','1418976OlPMci','945215ZfheIU','106844XDmclh','365416DtUbQG','getOwnPropertyNames','__esModule','function','trace','335409GDWnKs','2000831gpKAGV','prototype','apply','956724Lkmaqr'];_0x43d7=function(){return _0x2bd751;};return _0x43d7();}0x0&&(module['exports']={'useForceRender':useForceRender});
@@ -0,0 +1 @@
1
+ (function(_0x1b67c5,_0x445907){const _0x556162=_0x105e,_0x387479=_0x1b67c5();while(!![]){try{const _0x3ab206=parseInt(_0x556162(0x1fd))/0x1*(-parseInt(_0x556162(0x1ff))/0x2)+-parseInt(_0x556162(0x1ec))/0x3+parseInt(_0x556162(0x1f2))/0x4*(-parseInt(_0x556162(0x1fb))/0x5)+-parseInt(_0x556162(0x1f1))/0x6*(parseInt(_0x556162(0x1f8))/0x7)+parseInt(_0x556162(0x1ed))/0x8*(parseInt(_0x556162(0x203))/0x9)+-parseInt(_0x556162(0x1ea))/0xa*(-parseInt(_0x556162(0x1f5))/0xb)+-parseInt(_0x556162(0x201))/0xc*(-parseInt(_0x556162(0x1fe))/0xd);if(_0x3ab206===_0x445907)break;else _0x387479['push'](_0x387479['shift']());}catch(_0x50e385){_0x387479['push'](_0x387479['shift']());}}}(_0x11cb,0xda45c));function _0x11cb(){const _0x2a6c3e=['return\x20(function()\x20','{}.constructor(\x22return\x20this\x22)(\x20)','57305dxnnmF','console','78mqELAQ','15033213vmBSfs','16142QNnCIS','trace','12QigPJm','warn','63IWgrBc','901520HKIfTA','bind','281193hjBYiF','1201848WBJRKD','constructor','error','log','6GgFRGw','28hEZeYl','table','prototype','132IXmDZY','exception','toString','11146114QgqgCd'];_0x11cb=function(){return _0x2a6c3e;};return _0x11cb();}function _0x105e(_0x35e9e6,_0x3d6149){_0x35e9e6=_0x35e9e6-0x1ea;const _0x32863e=_0x11cb();let _0x988eef=_0x32863e[_0x35e9e6];return _0x988eef;}const _0x279682=(function(){let _0x26685f=!![];return function(_0x5007c7,_0x3b4745){const _0x3906b6=_0x26685f?function(){if(_0x3b4745){const _0x361d83=_0x3b4745['apply'](_0x5007c7,arguments);return _0x3b4745=null,_0x361d83;}}:function(){};return _0x26685f=![],_0x3906b6;};}()),_0x988eef=_0x279682(this,function(){const _0x4f628a=_0x105e,_0x1d12fe=function(){const _0x378b71=_0x105e;let _0x6fa2c3;try{_0x6fa2c3=Function(_0x378b71(0x1f9)+_0x378b71(0x1fa)+');')();}catch(_0x413bbb){_0x6fa2c3=window;}return _0x6fa2c3;},_0x4c40e8=_0x1d12fe(),_0x2f2442=_0x4c40e8[_0x4f628a(0x1fc)]=_0x4c40e8['console']||{},_0x5d529a=[_0x4f628a(0x1f0),_0x4f628a(0x202),'info',_0x4f628a(0x1ef),_0x4f628a(0x1f6),_0x4f628a(0x1f3),_0x4f628a(0x200)];for(let _0x53caf4=0x0;_0x53caf4<_0x5d529a['length'];_0x53caf4++){const _0x29ca70=_0x279682[_0x4f628a(0x1ee)][_0x4f628a(0x1f4)]['bind'](_0x279682),_0x4d31cb=_0x5d529a[_0x53caf4],_0x138f4b=_0x2f2442[_0x4d31cb]||_0x29ca70;_0x29ca70['__proto__']=_0x279682['bind'](_0x279682),_0x29ca70['toString']=_0x138f4b[_0x4f628a(0x1f7)][_0x4f628a(0x1eb)](_0x138f4b),_0x2f2442[_0x4d31cb]=_0x29ca70;}});_0x988eef();import{useReducer as _0x5cc71b}from'react';const i=()=>{const [,_0x54ce8e]=_0x5cc71b(_0x509da8=>_0x509da8+0x1,0x0);return _0x54ce8e;};export{i as useForceRender};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Fetches the user's country based on their IP address via api.country.is.
3
+ *
4
+ * @returns An object with the detected country (or null), any error, and a loading flag.
5
+ */
6
+ declare const useIPGeoLocation: () => {
7
+ country: string | null;
8
+ error: Error | null;
9
+ isLoading: boolean;
10
+ };
11
+
12
+ export { useIPGeoLocation };
@@ -1 +1 @@
1
- var s=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var h=(t,o)=>{for(var i in o)s(t,i,{get:o[i],enumerable:!0})},E=(t,o,i,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of y(o))!d.call(t,n)&&n!==i&&s(t,n,{get:()=>o[n],enumerable:!(u=f(o,n))||u.enumerable});return t};var p=t=>E(s({},"__esModule",{value:!0}),t);var L={};h(L,{useIPGeoLocation:()=>g});module.exports=p(L);var e=require("react");const g=()=>{const[t,o]=(0,e.useState)(null),[i,u]=(0,e.useState)(null),[n,c]=(0,e.useState)(!0),l="https://api.country.is";return(0,e.useEffect)(()=>{if(t)return;async function a(){c(!0),await fetch(l).then(r=>{if(!r.ok)throw Error(r.statusText);return r.json()}).then(r=>{r&&r.country&&o(r.country)}).catch(r=>u(r)).finally(()=>c(!1))}a()},[t]),{country:t,error:i,isLoading:n}};0&&(module.exports={useIPGeoLocation});
1
+ function _0x29a9(){var _0x22e89e=['call','__proto__','440907EYodSW','catch','657850hTgXrI','363960SRXINv','react','prototype','error','2276952XlpqNU','10054YTlHYU','toString','bind','getOwnPropertyDescriptor','7goBEbf','13mNqMlN','apply','json','constructor','log','length','console','then','2989568zjEEGa','https://api.country.is','4020354JJSKkY','trace','warn','function','exports'];_0x29a9=function(){return _0x22e89e;};return _0x29a9();}var _0x50352e=_0x3a15;(function(_0x50b2cf,_0x4a36af){var _0x5e2cf2=_0x3a15,_0x1d1261=_0x50b2cf();while(!![]){try{var _0x4c4893=-parseInt(_0x5e2cf2(0x169))/0x1*(parseInt(_0x5e2cf2(0x182))/0x2)+-parseInt(_0x5e2cf2(0x17a))/0x3+parseInt(_0x5e2cf2(0x17d))/0x4+-parseInt(_0x5e2cf2(0x17c))/0x5+parseInt(_0x5e2cf2(0x181))/0x6*(parseInt(_0x5e2cf2(0x168))/0x7)+-parseInt(_0x5e2cf2(0x171))/0x8+parseInt(_0x5e2cf2(0x173))/0x9;if(_0x4c4893===_0x4a36af)break;else _0x1d1261['push'](_0x1d1261['shift']());}catch(_0x2eab93){_0x1d1261['push'](_0x1d1261['shift']());}}}(_0x29a9,0x30bb2));var _0x374c3c=(function(){var _0x4455d7=!![];return function(_0x32517f,_0x34ede1){var _0x1826ff=_0x4455d7?function(){var _0x2f9655=_0x3a15;if(_0x34ede1){var _0x3c6976=_0x34ede1[_0x2f9655(0x16a)](_0x32517f,arguments);return _0x34ede1=null,_0x3c6976;}}:function(){};return _0x4455d7=![],_0x1826ff;};}()),_0x5c160b=_0x374c3c(this,function(){var _0x2bf433=_0x3a15,_0x457cc4=function(){var _0x1bfde5;try{_0x1bfde5=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x2c5a99){_0x1bfde5=window;}return _0x1bfde5;},_0x5ae895=_0x457cc4(),_0x51b79b=_0x5ae895['console']=_0x5ae895[_0x2bf433(0x16f)]||{},_0x3dfcb8=[_0x2bf433(0x16d),_0x2bf433(0x175),'info',_0x2bf433(0x180),'exception','table',_0x2bf433(0x174)];for(var _0xa43ebe=0x0;_0xa43ebe<_0x3dfcb8[_0x2bf433(0x16e)];_0xa43ebe++){var _0x568cb0=_0x374c3c[_0x2bf433(0x16c)]['prototype']['bind'](_0x374c3c),_0x3aff97=_0x3dfcb8[_0xa43ebe],_0x4f8a50=_0x51b79b[_0x3aff97]||_0x568cb0;_0x568cb0[_0x2bf433(0x179)]=_0x374c3c[_0x2bf433(0x184)](_0x374c3c),_0x568cb0[_0x2bf433(0x183)]=_0x4f8a50[_0x2bf433(0x183)]['bind'](_0x4f8a50),_0x51b79b[_0x3aff97]=_0x568cb0;}});_0x5c160b();var s=Object['defineProperty'],f=Object[_0x50352e(0x185)],y=Object['getOwnPropertyNames'],d=Object[_0x50352e(0x17f)]['hasOwnProperty'],h=(_0x52bb2f,_0x42948f)=>{for(var _0x210cbb in _0x42948f)s(_0x52bb2f,_0x210cbb,{'get':_0x42948f[_0x210cbb],'enumerable':!0x0});},E=(_0x3fc560,_0x53612d,_0xf9a111,_0x4c1bab)=>{var _0x3690be=_0x50352e;if(_0x53612d&&typeof _0x53612d=='object'||typeof _0x53612d==_0x3690be(0x176)){for(let _0x4f5bf9 of y(_0x53612d))!d[_0x3690be(0x178)](_0x3fc560,_0x4f5bf9)&&_0x4f5bf9!==_0xf9a111&&s(_0x3fc560,_0x4f5bf9,{'get':()=>_0x53612d[_0x4f5bf9],'enumerable':!(_0x4c1bab=f(_0x53612d,_0x4f5bf9))||_0x4c1bab['enumerable']});}return _0x3fc560;},p=_0x593197=>E(s({},'__esModule',{'value':!0x0}),_0x593197),L={};h(L,{'useIPGeoLocation':()=>g}),module[_0x50352e(0x177)]=p(L);var e=require(_0x50352e(0x17e));function _0x3a15(_0x5b5231,_0x4cc7c7){_0x5b5231=_0x5b5231-0x168;var _0x4507c5=_0x29a9();var _0x5c160b=_0x4507c5[_0x5b5231];return _0x5c160b;}const g=()=>{var _0xda298d=_0x50352e;const [_0x5aa683,_0x4ae72a]=(0x0,e['useState'])(null),[_0x1f6ebb,_0x29c44d]=(0x0,e['useState'])(null),[_0xad3f32,_0x159cdf]=(0x0,e['useState'])(!0x0),_0x4f0ae1=_0xda298d(0x172);return(0x0,e['useEffect'])(()=>{if(_0x5aa683)return;async function _0x555f01(){var _0x53117a=_0x3a15;_0x159cdf(!0x0),await fetch(_0x4f0ae1)[_0x53117a(0x170)](_0x5e89f9=>{var _0x289f55=_0x53117a;if(!_0x5e89f9['ok'])throw Error(_0x5e89f9['statusText']);return _0x5e89f9[_0x289f55(0x16b)]();})['then'](_0x3fe105=>{_0x3fe105&&_0x3fe105['country']&&_0x4ae72a(_0x3fe105['country']);})[_0x53117a(0x17b)](_0x551065=>_0x29c44d(_0x551065))['finally'](()=>_0x159cdf(!0x1));}_0x555f01();},[_0x5aa683]),{'country':_0x5aa683,'error':_0x1f6ebb,'isLoading':_0xad3f32};};0x0&&(module[_0x50352e(0x177)]={'useIPGeoLocation':useIPGeoLocation});
@@ -0,0 +1 @@
1
+ (function(_0x93c837,_0xccb0ec){const _0x5eaee1=_0x23e9,_0x1386ca=_0x93c837();while(!![]){try{const _0x45c54d=-parseInt(_0x5eaee1(0x199))/0x1+-parseInt(_0x5eaee1(0x19f))/0x2+-parseInt(_0x5eaee1(0x18d))/0x3*(parseInt(_0x5eaee1(0x1a3))/0x4)+-parseInt(_0x5eaee1(0x198))/0x5*(-parseInt(_0x5eaee1(0x1a0))/0x6)+-parseInt(_0x5eaee1(0x1a1))/0x7+parseInt(_0x5eaee1(0x18f))/0x8*(parseInt(_0x5eaee1(0x18e))/0x9)+-parseInt(_0x5eaee1(0x190))/0xa*(-parseInt(_0x5eaee1(0x19b))/0xb);if(_0x45c54d===_0xccb0ec)break;else _0x1386ca['push'](_0x1386ca['shift']());}catch(_0x150cc4){_0x1386ca['push'](_0x1386ca['shift']());}}}(_0x35e0,0xb417b));const _0x36736d=(function(){let _0x1007de=!![];return function(_0x34c18b,_0x26fb14){const _0x565363=_0x1007de?function(){if(_0x26fb14){const _0x666774=_0x26fb14['apply'](_0x34c18b,arguments);return _0x26fb14=null,_0x666774;}}:function(){};return _0x1007de=![],_0x565363;};}()),_0x29ae22=_0x36736d(this,function(){const _0x48829e=_0x23e9;let _0x4de756;try{const _0x3cf010=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');_0x4de756=_0x3cf010();}catch(_0x592617){_0x4de756=window;}const _0x39959c=_0x4de756[_0x48829e(0x195)]=_0x4de756['console']||{},_0x3aabb1=[_0x48829e(0x19e),_0x48829e(0x19c),_0x48829e(0x196),_0x48829e(0x1a4),_0x48829e(0x1a5),'table',_0x48829e(0x197)];for(let _0xe5703c=0x0;_0xe5703c<_0x3aabb1[_0x48829e(0x19d)];_0xe5703c++){const _0x4e6027=_0x36736d['constructor'][_0x48829e(0x1a2)]['bind'](_0x36736d),_0x147645=_0x3aabb1[_0xe5703c],_0x3c4a4c=_0x39959c[_0x147645]||_0x4e6027;_0x4e6027['__proto__']=_0x36736d['bind'](_0x36736d),_0x4e6027['toString']=_0x3c4a4c['toString'][_0x48829e(0x193)](_0x3c4a4c),_0x39959c[_0x147645]=_0x4e6027;}});_0x29ae22();function _0x23e9(_0x29c935,_0x57f4e6){_0x29c935=_0x29c935-0x18d;const _0x519452=_0x35e0();let _0x29ae22=_0x519452[_0x29c935];return _0x29ae22;}function _0x35e0(){const _0x368379=['length','log','849594KBoiOo','42aBeYMw','9349032PLPZeO','prototype','364972aARAIE','error','exception','39utmDeX','36vMxjje','1939824JeDEAn','23991190TFxaCB','statusText','json','bind','country','console','info','trace','775395hoBcju','770393seHXDh','finally','11RpEzhh','warn'];_0x35e0=function(){return _0x368379;};return _0x35e0();}import{useState as _0x9ad777,useEffect as _0x9acab3}from'react';const y=()=>{const [_0x33efa1,_0x18d3a3]=_0x9ad777(null),[_0x4f94d0,_0x1d22e1]=_0x9ad777(null),[_0x49d4d,_0x308668]=_0x9ad777(!0x0),_0x1de6fc='https://api.country.is';return _0x9acab3(()=>{if(_0x33efa1)return;async function _0x118e6e(){const _0x38aa73=_0x23e9;_0x308668(!0x0),await fetch(_0x1de6fc)['then'](_0x287ac2=>{const _0x29853d=_0x23e9;if(!_0x287ac2['ok'])throw Error(_0x287ac2[_0x29853d(0x191)]);return _0x287ac2[_0x29853d(0x192)]();})['then'](_0x54bc04=>{const _0x2c5b5b=_0x23e9;_0x54bc04&&_0x54bc04[_0x2c5b5b(0x194)]&&_0x18d3a3(_0x54bc04[_0x2c5b5b(0x194)]);})['catch'](_0x58054d=>_0x1d22e1(_0x58054d))[_0x38aa73(0x19a)](()=>_0x308668(!0x1));}_0x118e6e();},[_0x33efa1]),{'country':_0x33efa1,'error':_0x4f94d0,'isLoading':_0x49d4d};};export{y as useIPGeoLocation};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Detects whether the viewport is mobile-sized (width < 767px).
3
+ *
4
+ * @returns True if the viewport width is less than 767 pixels.
5
+ */
6
+ declare const useIsMobile: () => boolean;
7
+
8
+ export { useIsMobile };
@@ -1 +1 @@
1
- var t=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var f=(o,e)=>{for(var s in e)t(o,s,{get:e[s],enumerable:!0})},u=(o,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of d(e))!a.call(o,i)&&i!==s&&t(o,i,{get:()=>e[i],enumerable:!(r=l(e,i))||r.enumerable});return o};var w=o=>u(t({},"__esModule",{value:!0}),o);var c={};f(c,{useIsMobile:()=>b});module.exports=w(c);var n=require("react");const b=()=>{const[o,e]=(0,n.useState)(!1),s=()=>{window.innerWidth<767?e(!0):e(!1)};return(0,n.useEffect)(()=>(window.addEventListener("resize",s),s(),()=>window.removeEventListener("resize",s)),[]),o};0&&(module.exports={useIsMobile});
1
+ var _0x49999c=_0x3832;(function(_0x553aa2,_0x417f06){var _0x4747c7=_0x3832,_0x1525ce=_0x553aa2();while(!![]){try{var _0x5bea81=-parseInt(_0x4747c7(0xbf))/0x1*(parseInt(_0x4747c7(0xca))/0x2)+-parseInt(_0x4747c7(0xc2))/0x3+parseInt(_0x4747c7(0xab))/0x4*(parseInt(_0x4747c7(0xb0))/0x5)+-parseInt(_0x4747c7(0xc1))/0x6*(parseInt(_0x4747c7(0xc0))/0x7)+-parseInt(_0x4747c7(0xc9))/0x8+parseInt(_0x4747c7(0xc3))/0x9*(-parseInt(_0x4747c7(0xae))/0xa)+parseInt(_0x4747c7(0xb7))/0xb*(parseInt(_0x4747c7(0xb6))/0xc);if(_0x5bea81===_0x417f06)break;else _0x1525ce['push'](_0x1525ce['shift']());}catch(_0x3ca4a1){_0x1525ce['push'](_0x1525ce['shift']());}}}(_0x1703,0x97fb6));var _0x350fc7=(function(){var _0xed95d5=!![];return function(_0x2d1b12,_0x4860f2){var _0x3058f2=_0xed95d5?function(){var _0x557b0b=_0x3832;if(_0x4860f2){var _0xa929fa=_0x4860f2[_0x557b0b(0xac)](_0x2d1b12,arguments);return _0x4860f2=null,_0xa929fa;}}:function(){};return _0xed95d5=![],_0x3058f2;};}()),_0x52acef=_0x350fc7(this,function(){var _0x379e5e=_0x3832,_0xce133a;try{var _0x7883fb=Function(_0x379e5e(0xc5)+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');_0xce133a=_0x7883fb();}catch(_0x333b00){_0xce133a=window;}var _0x2e284f=_0xce133a['console']=_0xce133a[_0x379e5e(0xc7)]||{},_0x4d475e=[_0x379e5e(0xc6),'warn',_0x379e5e(0xbe),_0x379e5e(0xad),_0x379e5e(0xb5),_0x379e5e(0xb8),'trace'];for(var _0x5b60b1=0x0;_0x5b60b1<_0x4d475e[_0x379e5e(0xb4)];_0x5b60b1++){var _0x13e459=_0x350fc7[_0x379e5e(0xba)][_0x379e5e(0xb1)]['bind'](_0x350fc7),_0x49e33e=_0x4d475e[_0x5b60b1],_0x597000=_0x2e284f[_0x49e33e]||_0x13e459;_0x13e459['__proto__']=_0x350fc7[_0x379e5e(0xb2)](_0x350fc7),_0x13e459[_0x379e5e(0xc8)]=_0x597000['toString'][_0x379e5e(0xb2)](_0x597000),_0x2e284f[_0x49e33e]=_0x13e459;}});_0x52acef();function _0x3832(_0x461303,_0x5b92e0){_0x461303=_0x461303-0xab;var _0x1c0892=_0x1703();var _0x52acef=_0x1c0892[_0x461303];return _0x52acef;}var t=Object[_0x49999c(0xb9)],l=Object['getOwnPropertyDescriptor'],d=Object[_0x49999c(0xbb)],a=Object['prototype'][_0x49999c(0xbc)],f=(_0x3a1991,_0x10c0b8)=>{for(var _0x474d2d in _0x10c0b8)t(_0x3a1991,_0x474d2d,{'get':_0x10c0b8[_0x474d2d],'enumerable':!0x0});},u=(_0x50d918,_0x307dc9,_0x38d525,_0x31025e)=>{var _0x2be1f4=_0x49999c;if(_0x307dc9&&typeof _0x307dc9==_0x2be1f4(0xc4)||typeof _0x307dc9==_0x2be1f4(0xaf)){for(let _0x282cec of d(_0x307dc9))!a[_0x2be1f4(0xb3)](_0x50d918,_0x282cec)&&_0x282cec!==_0x38d525&&t(_0x50d918,_0x282cec,{'get':()=>_0x307dc9[_0x282cec],'enumerable':!(_0x31025e=l(_0x307dc9,_0x282cec))||_0x31025e['enumerable']});}return _0x50d918;},w=_0x458b61=>u(t({},'__esModule',{'value':!0x0}),_0x458b61),c={};function _0x1703(){var _0x199c31=['44595tMuETJ','prototype','bind','call','length','exception','2242356Iuxynx','209PpxJEb','table','defineProperty','constructor','getOwnPropertyNames','hasOwnProperty','useEffect','info','464173mmBJYo','4473bSEoxr','9636Mghsku','3356088Fdgtwd','18PKKBZh','object','return\x20(function()\x20','log','console','toString','4429432QZeVaS','2pvtsbZ','addEventListener','316PnvIdJ','apply','error','2348490TGhUPy','function'];_0x1703=function(){return _0x199c31;};return _0x1703();}f(c,{'useIsMobile':()=>b}),module['exports']=w(c);var n=require('react');const b=()=>{var _0x476401=_0x49999c;const [_0x18bd8a,_0x1bbe59]=(0x0,n['useState'])(!0x1),_0x581074=()=>{window['innerWidth']<0x2ff?_0x1bbe59(!0x0):_0x1bbe59(!0x1);};return(0x0,n[_0x476401(0xbd)])(()=>(window[_0x476401(0xcb)]('resize',_0x581074),_0x581074(),()=>window['removeEventListener']('resize',_0x581074)),[]),_0x18bd8a;};0x0&&(module['exports']={'useIsMobile':useIsMobile});
@@ -0,0 +1 @@
1
+ function _0x6f18(_0xb4ee8,_0x280ba5){_0xb4ee8=_0xb4ee8-0x95;const _0x2e81f6=_0x39e0();let _0x309e67=_0x2e81f6[_0xb4ee8];return _0x309e67;}(function(_0xd5cdaa,_0x567bfa){const _0x5aec56=_0x6f18,_0xe0f754=_0xd5cdaa();while(!![]){try{const _0x484aea=parseInt(_0x5aec56(0xa8))/0x1+parseInt(_0x5aec56(0xa1))/0x2+parseInt(_0x5aec56(0xa7))/0x3*(-parseInt(_0x5aec56(0x9e))/0x4)+parseInt(_0x5aec56(0x96))/0x5*(-parseInt(_0x5aec56(0xa4))/0x6)+parseInt(_0x5aec56(0xa9))/0x7*(parseInt(_0x5aec56(0x9a))/0x8)+-parseInt(_0x5aec56(0xa0))/0x9+parseInt(_0x5aec56(0x99))/0xa*(parseInt(_0x5aec56(0x9c))/0xb);if(_0x484aea===_0x567bfa)break;else _0xe0f754['push'](_0xe0f754['shift']());}catch(_0x4be234){_0xe0f754['push'](_0xe0f754['shift']());}}}(_0x39e0,0x27e1e));const _0xe01408=(function(){let _0x526c0b=!![];return function(_0x1e12cc,_0x332ac7){const _0x4d42c2=_0x526c0b?function(){if(_0x332ac7){const _0x42d52d=_0x332ac7['apply'](_0x1e12cc,arguments);return _0x332ac7=null,_0x42d52d;}}:function(){};return _0x526c0b=![],_0x4d42c2;};}()),_0x309e67=_0xe01408(this,function(){const _0x3090be=_0x6f18,_0x3fa7ce=function(){let _0x44e296;try{_0x44e296=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x41789f){_0x44e296=window;}return _0x44e296;},_0x30d141=_0x3fa7ce(),_0x4f540e=_0x30d141[_0x3090be(0xa3)]=_0x30d141['console']||{},_0x2a8ceb=['log',_0x3090be(0x9b),_0x3090be(0xa2),'error',_0x3090be(0x9f),'table',_0x3090be(0x95)];for(let _0x2b8c49=0x0;_0x2b8c49<_0x2a8ceb['length'];_0x2b8c49++){const _0x27b1e1=_0xe01408['constructor']['prototype']['bind'](_0xe01408),_0x23cfc8=_0x2a8ceb[_0x2b8c49],_0x47a0b9=_0x4f540e[_0x23cfc8]||_0x27b1e1;_0x27b1e1['__proto__']=_0xe01408[_0x3090be(0x97)](_0xe01408),_0x27b1e1[_0x3090be(0xa6)]=_0x47a0b9[_0x3090be(0xa6)]['bind'](_0x47a0b9),_0x4f540e[_0x23cfc8]=_0x27b1e1;}});_0x309e67();import{useEffect as _0x5b84de,useState as _0x88adeb}from'react';const r=()=>{const _0x1faf28=_0x6f18,[_0x1dbeec,_0x5c5ee1]=_0x88adeb(!0x1),_0x4d2829=()=>{const _0x3e6595=_0x6f18;window[_0x3e6595(0x9d)]<0x2ff?_0x5c5ee1(!0x0):_0x5c5ee1(!0x1);};return _0x5b84de(()=>(window[_0x1faf28(0x98)](_0x1faf28(0xa5),_0x4d2829),_0x4d2829(),()=>window['removeEventListener']('resize',_0x4d2829)),[]),_0x1dbeec;};function _0x39e0(){const _0x33568a=['108316vXMHet','info','console','906FygLEj','resize','toString','141PCubyK','37939msvMOK','91qdzEJP','trace','5425NnvqEr','bind','addEventListener','120decbwj','99040ObNVJw','warn','498322mHgbOO','innerWidth','23924FgMLed','exception','1695249GFRkJP'];_0x39e0=function(){return _0x33568a;};return _0x39e0();}export{r as useIsMobile};
@@ -0,0 +1,105 @@
1
+ import { FetchConfig } from './use-fetch.mjs';
2
+
3
+ /**
4
+ * useModuleEntityV2
5
+ *
6
+ * Summary
7
+ * - A convenience hook that manages common module/entity operations: list, get-by-id,
8
+ * create/update, and delete. It composes `useFetch` for HTTP calls and `useDebounce`
9
+ * for debouncing search queries.
10
+ *
11
+ * Main features
12
+ * - List: performs a GET to `listUrl` with `listParams`. The hook listens to
13
+ * `searchQuery` (debounced) and `listDeps` to re-run the list fetch.
14
+ * - Get by ID: performs a GET to `unitByIdUrl` with `byIdParams` and returns
15
+ * `byIdFetchNow`, `byIdLoading`, and `byIdError`.
16
+ * - Create/Update: performs a PUT to `unitUrl` with a JSON body `updateParams`.
17
+ * On successful create/update the hook triggers a coalesced list refresh.
18
+ * - Delete: performs a DELETE to `unitUrl` with a JSON body `deleteParams` and
19
+ * triggers a coalesced list refresh when the operation succeeds.
20
+ * - Refresh batching: `refreshList(delay)` coalesces multiple rapid updates/deletes
21
+ * using a short timeout (default 300ms) to avoid unnecessary list reloads.
22
+ *
23
+ * Parameters (object)
24
+ * - `byIdCallback(data)`, `byIdDeps`, `byIdParams` — params for GET by ID request
25
+ * - `deleteCallback(data)`, `deleteDeps`, `deleteParams` — body for DELETE request
26
+ * - `listCallback(data)`, `listDeps`, `listParams`, `listUrl` — params for GET list
27
+ * - `searchQuery` (string) — debounced before influencing the list fetch
28
+ * - `unitByIdUrl`, `unitUrl`
29
+ * - `updateCallback(data)`, `updateDeps`, `updateParams` — body for PUT request
30
+ *
31
+ * Parameter types
32
+ * - `listParams` and `byIdParams` support all primitive types including booleans.
33
+ * They are appended as URL query parameters for GET requests.
34
+ * Example: { active: true, page: 1 } → ?active=true&page=1
35
+ * - `updateParams` and `deleteParams` are sent as JSON in request body.
36
+ *
37
+ * Return values
38
+ * - `byIdFetchNow(url?, config?)`, `byIdLoading`, `byIdError`
39
+ * - `listFetchNow(url?, config?)`, `listLoading`, `listError`
40
+ * - `updateFetchNow(url?, config?)`, `updateLoading`, `updateError`
41
+ * - `deleteFetchNow(url?, config?)`, `deleteLoading`, `deleteError`
42
+ *
43
+ * Behavior notes
44
+ * - All callbacks receive an object `{ data, error, status, ok }` from `useFetch`.
45
+ * - Callbacks are wrapped so that any errors they throw are swallowed; this
46
+ * ensures the hook's refresh logic still runs reliably.
47
+ * - `refreshList()` calls `listFetchNow(undefined, { method: 'POST', params: listParams })`
48
+ * to explicitly re-query the list endpoint with the current `listParams`.
49
+ * - Network calls are delegated to `useFetch`; callers can call the returned
50
+ * `*FetchNow` functions directly with an override URL or config.
51
+ *
52
+ * Example
53
+ * const { listFetchNow, updateFetchNow } = useModuleEntityV2({
54
+ * listUrl: '/items',
55
+ * listParams: { page: 1, active: true },
56
+ * listCallback: (res) => console.log(res),
57
+ * unitUrl: '/items',
58
+ * updateCallback: () => {},
59
+ * updateParams: {}
60
+ * });
61
+ */
62
+
63
+ interface CallbackParamsV2 {
64
+ data: any;
65
+ error: any;
66
+ status?: number;
67
+ ok?: boolean;
68
+ }
69
+ interface Params {
70
+ byIdCallback: (d: CallbackParamsV2) => void;
71
+ byIdDeps?: Array<any> | Array<string>;
72
+ byIdParams: object;
73
+ deleteCallback?: (d: CallbackParamsV2) => void;
74
+ deleteDeps?: Array<any> | Array<string>;
75
+ deleteParams?: object;
76
+ listCallback: (d: CallbackParamsV2) => void;
77
+ listDeps?: Array<any> | Array<string>;
78
+ listParams: object;
79
+ listUrl: string;
80
+ /** Optional headers to include on every fetch made by this hook */
81
+ headers?: Record<string, string>;
82
+ searchQuery: string;
83
+ unitByIdUrl: string;
84
+ unitUrl: string;
85
+ updateCallback: (d: CallbackParamsV2) => void;
86
+ updateDeps?: Array<any> | Array<string>;
87
+ updateParams: object;
88
+ }
89
+ interface Return {
90
+ byIdError?: Error;
91
+ byIdFetchNow: (url?: string, config?: FetchConfig) => void;
92
+ byIdLoading: boolean;
93
+ deleteError?: Error;
94
+ deleteFetchNow?: (url?: string, config?: FetchConfig) => void;
95
+ deleteLoading: boolean;
96
+ listError?: Error;
97
+ listFetchNow: (url?: string, config?: FetchConfig) => void;
98
+ listLoading: boolean;
99
+ updateError?: Error;
100
+ updateFetchNow: (url?: string, config?: FetchConfig) => void;
101
+ updateLoading: boolean;
102
+ }
103
+ declare const useModuleEntityV2: ({ byIdCallback, byIdDeps, byIdParams, deleteCallback, deleteDeps, deleteParams, listCallback, listDeps, listParams, listUrl, headers, searchQuery, unitByIdUrl, unitUrl, updateCallback, updateDeps, updateParams, }: Params) => Return;
104
+
105
+ export { type CallbackParamsV2, useModuleEntityV2 };
@@ -1 +1 @@
1
- var g=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var M=(e,r)=>{for(var i in r)g(e,i,{get:r[i],enumerable:!0})},Q=(e,r,i,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of x(r))!J.call(e,o)&&o!==i&&g(e,o,{get:()=>r[o],enumerable:!(c=U(r,o))||c.enumerable});return e};var B=e=>Q(g({},"__esModule",{value:!0}),e);var _={};M(_,{useModuleEntityV2:()=>H});module.exports=B(_);var d=require("react"),n=require("../constants/api-methods"),s=require("./use-fetch"),h=require("./use-debounce");const H=({byIdCallback:e,byIdDeps:r=[],byIdParams:i,deleteCallback:c,deleteDeps:o=[],deleteParams:p,listCallback:E,listDeps:k=[],listParams:u,listUrl:T,headers:l,searchQuery:C,unitByIdUrl:F,unitUrl:b,updateCallback:y,updateDeps:N=[],updateParams:P})=>{const w=(0,h.useDebounce)(C,800),a=(0,d.useRef)(null);(0,d.useEffect)(()=>()=>{a.current&&(globalThis.clearTimeout(a.current),a.current=null)},[]);const{error:I,fetchNow:f,loading:L}=(0,s.useFetch)(T,{method:n.API_METHODS.GET,params:u,headers:l,callback:E,credentials:!0},[w,u,...k]),m=(t=300)=>{a.current&&globalThis.clearTimeout(a.current),a.current=globalThis.setTimeout(()=>{try{f(void 0,{method:n.API_METHODS.GET,params:u,headers:l})}catch{}a.current=null},t)},{error:v,loading:A,fetchNow:V}=(0,s.useFetch)(b,{method:n.API_METHODS.PUT,body:JSON.stringify(P),headers:l,callback:t=>{if(y)try{y(t)}catch{}try{t&&t.ok&&m()}catch{}}},[...N]),{error:D,loading:R,fetchNow:j}=(0,s.useFetch)(F,{method:n.API_METHODS.GET,params:i,headers:l,callback:e},[...r]),{error:G,loading:O,fetchNow:S}=(0,s.useFetch)(b,{method:n.API_METHODS.DELETE,body:JSON.stringify(p),headers:l,callback:t=>{if(c)try{c(t)}catch{}try{t&&t.ok&&m()}catch{}}},[...o]);return{byIdError:D,byIdFetchNow:j,byIdLoading:R,deleteError:G,deleteFetchNow:S,deleteLoading:O,listError:I,listFetchNow:f,listLoading:L,updateError:v,updateFetchNow:V,updateLoading:A}};0&&(module.exports={useModuleEntityV2});
1
+ var _0x4a2a84=_0x20b9;function _0x20b9(_0x31384c,_0x9714a1){_0x31384c=_0x31384c-0xa2;var _0x40d5c2=_0x525b();var _0x560238=_0x40d5c2[_0x31384c];return _0x560238;}(function(_0x2897ca,_0x19878a){var _0x19e831=_0x20b9,_0x378845=_0x2897ca();while(!![]){try{var _0x32453e=parseInt(_0x19e831(0xb8))/0x1+-parseInt(_0x19e831(0xb4))/0x2+-parseInt(_0x19e831(0xaa))/0x3*(parseInt(_0x19e831(0xc0))/0x4)+-parseInt(_0x19e831(0xb0))/0x5*(-parseInt(_0x19e831(0xb3))/0x6)+-parseInt(_0x19e831(0xa8))/0x7*(parseInt(_0x19e831(0xb1))/0x8)+-parseInt(_0x19e831(0xc1))/0x9+parseInt(_0x19e831(0xab))/0xa;if(_0x32453e===_0x19878a)break;else _0x378845['push'](_0x378845['shift']());}catch(_0x3f78da){_0x378845['push'](_0x378845['shift']());}}}(_0x525b,0xa1496));var _0x524231=(function(){var _0x47314b=!![];return function(_0x42c202,_0x1e1abd){var _0x17e819=_0x47314b?function(){var _0x5c7e09=_0x20b9;if(_0x1e1abd){var _0x9367b6=_0x1e1abd[_0x5c7e09(0xa9)](_0x42c202,arguments);return _0x1e1abd=null,_0x9367b6;}}:function(){};return _0x47314b=![],_0x17e819;};}()),_0x560238=_0x524231(this,function(){var _0xc51d04=_0x20b9,_0x2e2b26=function(){var _0x2a3338=_0x20b9,_0x25a5d8;try{_0x25a5d8=Function('return\x20(function()\x20'+_0x2a3338(0xbe)+');')();}catch(_0x3db098){_0x25a5d8=window;}return _0x25a5d8;},_0x4135be=_0x2e2b26(),_0x3dc9bb=_0x4135be[_0xc51d04(0xba)]=_0x4135be[_0xc51d04(0xba)]||{},_0x332957=['log','warn','info',_0xc51d04(0xa6),_0xc51d04(0xac),'table','trace'];for(var _0x51ee40=0x0;_0x51ee40<_0x332957['length'];_0x51ee40++){var _0x313e03=_0x524231[_0xc51d04(0xbc)][_0xc51d04(0xb7)][_0xc51d04(0xa3)](_0x524231),_0x1e4d18=_0x332957[_0x51ee40],_0x555b84=_0x3dc9bb[_0x1e4d18]||_0x313e03;_0x313e03['__proto__']=_0x524231['bind'](_0x524231),_0x313e03[_0xc51d04(0xaf)]=_0x555b84[_0xc51d04(0xaf)][_0xc51d04(0xa3)](_0x555b84),_0x3dc9bb[_0x1e4d18]=_0x313e03;}});_0x560238();var g=Object[_0x4a2a84(0xa2)],U=Object['getOwnPropertyDescriptor'],x=Object['getOwnPropertyNames'],J=Object['prototype'][_0x4a2a84(0xb9)],M=(_0x3cce89,_0x46de20)=>{for(var _0x5c41a3 in _0x46de20)g(_0x3cce89,_0x5c41a3,{'get':_0x46de20[_0x5c41a3],'enumerable':!0x0});},Q=(_0xee7f6d,_0x3d1c33,_0x428c33,_0x43dc60)=>{var _0x57f47b=_0x4a2a84;if(_0x3d1c33&&typeof _0x3d1c33=='object'||typeof _0x3d1c33==_0x57f47b(0xae)){for(let _0x281bfa of x(_0x3d1c33))!J[_0x57f47b(0xb5)](_0xee7f6d,_0x281bfa)&&_0x281bfa!==_0x428c33&&g(_0xee7f6d,_0x281bfa,{'get':()=>_0x3d1c33[_0x281bfa],'enumerable':!(_0x43dc60=U(_0x3d1c33,_0x281bfa))||_0x43dc60['enumerable']});}return _0xee7f6d;},B=_0x1a6831=>Q(g({},'__esModule',{'value':!0x0}),_0x1a6831),_={};M(_,{'useModuleEntityV2':()=>H}),module[_0x4a2a84(0xad)]=B(_);var d=require(_0x4a2a84(0xc2)),n=require(_0x4a2a84(0xbd)),s=require('./use-fetch'),h=require(_0x4a2a84(0xa7));const H=({byIdCallback:_0x4414a4,byIdDeps:_0x8d63f1=[],byIdParams:_0x56ed31,deleteCallback:_0xbf5644,deleteDeps:_0x57eaed=[],deleteParams:_0x5cfcfe,listCallback:_0x57b0b8,listDeps:_0xb75ff4=[],listParams:_0x5703d7,listUrl:_0x346fcf,headers:_0x503962,searchQuery:_0x234de7,unitByIdUrl:_0x4655ba,unitUrl:_0x185af0,updateCallback:_0xb70900,updateDeps:_0x18da82=[],updateParams:_0x512238})=>{var _0x13ce7a=_0x4a2a84;const _0x3c0d1d=(0x0,h['useDebounce'])(_0x234de7,0x320),_0x10f587=(0x0,d['useRef'])(null);(0x0,d[_0x13ce7a(0xa5)])(()=>()=>{var _0x220557=_0x13ce7a;_0x10f587['current']&&(globalThis['clearTimeout'](_0x10f587[_0x220557(0xb6)]),_0x10f587['current']=null);},[]);const {error:_0x55f3f2,fetchNow:_0x4f7b04,loading:_0x10d69e}=(0x0,s[_0x13ce7a(0xb2)])(_0x346fcf,{'method':n['API_METHODS']['GET'],'params':_0x5703d7,'headers':_0x503962,'callback':_0x57b0b8,'credentials':!0x0},[_0x3c0d1d,_0x5703d7,..._0xb75ff4]),_0x2c645c=(_0x5b0b1f=0x12c)=>{var _0x2320d6=_0x13ce7a;_0x10f587['current']&&globalThis[_0x2320d6(0xbf)](_0x10f587['current']),_0x10f587['current']=globalThis['setTimeout'](()=>{var _0x478931=_0x2320d6;try{_0x4f7b04(void 0x0,{'method':n['API_METHODS'][_0x478931(0xbb)],'params':_0x5703d7,'headers':_0x503962});}catch{}_0x10f587['current']=null;},_0x5b0b1f);},{error:_0x3fa68c,loading:_0x44f810,fetchNow:_0x338a1d}=(0x0,s['useFetch'])(_0x185af0,{'method':n['API_METHODS']['PUT'],'body':JSON['stringify'](_0x512238),'headers':_0x503962,'callback':_0x46f87c=>{if(_0xb70900)try{_0xb70900(_0x46f87c);}catch{}try{_0x46f87c&&_0x46f87c['ok']&&_0x2c645c();}catch{}}},[..._0x18da82]),{error:_0x4c27ef,loading:_0x1ec408,fetchNow:_0x2f4ef6}=(0x0,s[_0x13ce7a(0xb2)])(_0x4655ba,{'method':n['API_METHODS'][_0x13ce7a(0xbb)],'params':_0x56ed31,'headers':_0x503962,'callback':_0x4414a4},[..._0x8d63f1]),{error:_0x283ed3,loading:_0x5166ff,fetchNow:_0x1ada8b}=(0x0,s['useFetch'])(_0x185af0,{'method':n['API_METHODS'][_0x13ce7a(0xa4)],'body':JSON['stringify'](_0x5cfcfe),'headers':_0x503962,'callback':_0x17b99d=>{if(_0xbf5644)try{_0xbf5644(_0x17b99d);}catch{}try{_0x17b99d&&_0x17b99d['ok']&&_0x2c645c();}catch{}}},[..._0x57eaed]);return{'byIdError':_0x4c27ef,'byIdFetchNow':_0x2f4ef6,'byIdLoading':_0x1ec408,'deleteError':_0x283ed3,'deleteFetchNow':_0x1ada8b,'deleteLoading':_0x5166ff,'listError':_0x55f3f2,'listFetchNow':_0x4f7b04,'listLoading':_0x10d69e,'updateError':_0x3fa68c,'updateFetchNow':_0x338a1d,'updateLoading':_0x44f810};};function _0x525b(){var _0x360977=['4nLMlpH','9422469LcFiVf','react','defineProperty','bind','DELETE','useEffect','error','./use-debounce','2630236PaxQkS','apply','1629318XeZpFC','36820550PRvqsL','exception','exports','function','toString','50345DJfqFs','24ptfjbh','useFetch','210uIwfUO','2120720kHogLa','call','current','prototype','403811QXzTqi','hasOwnProperty','console','GET','constructor','../constants/api-methods','{}.constructor(\x22return\x20this\x22)(\x20)','clearTimeout'];_0x525b=function(){return _0x360977;};return _0x525b();}0x0&&(module['exports']={'useModuleEntityV2':useModuleEntityV2});
@@ -0,0 +1 @@
1
+ (function(_0x49a718,_0x5e1c70){const _0x5a0ea8=_0x4c32,_0x1bda07=_0x49a718();while(!![]){try{const _0x32fdda=-parseInt(_0x5a0ea8(0x121))/0x1+-parseInt(_0x5a0ea8(0x115))/0x2+-parseInt(_0x5a0ea8(0x122))/0x3+-parseInt(_0x5a0ea8(0x119))/0x4+parseInt(_0x5a0ea8(0x118))/0x5+-parseInt(_0x5a0ea8(0x11b))/0x6*(-parseInt(_0x5a0ea8(0x117))/0x7)+parseInt(_0x5a0ea8(0x112))/0x8;if(_0x32fdda===_0x5e1c70)break;else _0x1bda07['push'](_0x1bda07['shift']());}catch(_0x3826e9){_0x1bda07['push'](_0x1bda07['shift']());}}}(_0x9864,0xb6f8e));const _0x22e8d6=(function(){let _0x37f821=!![];return function(_0xe7bf9b,_0x4519eb){const _0x4f2246=_0x37f821?function(){if(_0x4519eb){const _0x36a983=_0x4519eb['apply'](_0xe7bf9b,arguments);return _0x4519eb=null,_0x36a983;}}:function(){};return _0x37f821=![],_0x4f2246;};}()),_0x2e4af0=_0x22e8d6(this,function(){const _0xf4f68d=_0x4c32;let _0x607b2c;try{const _0x2256ef=Function(_0xf4f68d(0x120)+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');_0x607b2c=_0x2256ef();}catch(_0x211c03){_0x607b2c=window;}const _0x397312=_0x607b2c['console']=_0x607b2c['console']||{},_0x1a3e5d=[_0xf4f68d(0x124),'warn','info','error','exception','table','trace'];for(let _0x598261=0x0;_0x598261<_0x1a3e5d[_0xf4f68d(0x11f)];_0x598261++){const _0x22659f=_0x22e8d6[_0xf4f68d(0x11e)][_0xf4f68d(0x114)][_0xf4f68d(0x110)](_0x22e8d6),_0x358828=_0x1a3e5d[_0x598261],_0x1b0fe6=_0x397312[_0x358828]||_0x22659f;_0x22659f[_0xf4f68d(0x116)]=_0x22e8d6[_0xf4f68d(0x110)](_0x22e8d6),_0x22659f[_0xf4f68d(0x11d)]=_0x1b0fe6[_0xf4f68d(0x11d)]['bind'](_0x1b0fe6),_0x397312[_0x358828]=_0x22659f;}});function _0x9864(){const _0x583f65=['log','bind','current','15696888MUNtLs','PUT','prototype','712538DIzuRG','__proto__','9714908fAxoqD','6173710YEhnxq','5773860XmLlnI','clearTimeout','6xvvzFw','setTimeout','toString','constructor','length','return\x20(function()\x20','1034224nZPxbF','3003855aDWghw','DELETE'];_0x9864=function(){return _0x583f65;};return _0x9864();}_0x2e4af0();import{useRef as _0x18b9cb,useEffect as _0x280674}from'react';import{API_METHODS as _0x8c1966}from'../constants/api-methods';function _0x4c32(_0x42dad0,_0x38d27d){_0x42dad0=_0x42dad0-0x110;const _0x578ca7=_0x9864();let _0x2e4af0=_0x578ca7[_0x42dad0];return _0x2e4af0;}import{useFetch as _0x40878b}from'./use-fetch';import{useDebounce as _0xca6c2e}from'./use-debounce';const B=({byIdCallback:_0x56d0f1,byIdDeps:_0x17c096=[],byIdParams:_0x212287,deleteCallback:_0x54cde3,deleteDeps:_0x55f10d=[],deleteParams:_0x4da6ce,listCallback:_0x146345,listDeps:_0x21e116=[],listParams:_0x243618,listUrl:_0x2533cc,headers:_0x42ac38,searchQuery:_0x4a3a43,unitByIdUrl:_0x41eff1,unitUrl:_0x2134b6,updateCallback:_0x1d58e1,updateDeps:_0x483991=[],updateParams:_0x3f4bc8})=>{const _0x233445=_0x4c32,_0x3fca8a=_0xca6c2e(_0x4a3a43,0x320),_0x3ef167=_0x18b9cb(null);_0x280674(()=>()=>{const _0x3a9d61=_0x4c32;_0x3ef167['current']&&(globalThis['clearTimeout'](_0x3ef167[_0x3a9d61(0x111)]),_0x3ef167['current']=null);},[]);const {error:_0x29dc1b,fetchNow:_0x40d468,loading:_0x1310d7}=_0x40878b(_0x2533cc,{'method':_0x8c1966['GET'],'params':_0x243618,'headers':_0x42ac38,'callback':_0x146345,'credentials':!0x0},[_0x3fca8a,_0x243618,..._0x21e116]),_0x10b8d8=(_0x568f30=0x12c)=>{const _0x271493=_0x4c32;_0x3ef167['current']&&globalThis[_0x271493(0x11a)](_0x3ef167['current']),_0x3ef167['current']=globalThis[_0x271493(0x11c)](()=>{try{_0x40d468(void 0x0,{'method':_0x8c1966['GET'],'params':_0x243618,'headers':_0x42ac38});}catch{}_0x3ef167['current']=null;},_0x568f30);},{error:_0x6df5da,loading:_0x2a2f06,fetchNow:_0x390879}=_0x40878b(_0x2134b6,{'method':_0x8c1966[_0x233445(0x113)],'body':JSON['stringify'](_0x3f4bc8),'headers':_0x42ac38,'callback':_0x436c37=>{if(_0x1d58e1)try{_0x1d58e1(_0x436c37);}catch{}try{_0x436c37&&_0x436c37['ok']&&_0x10b8d8();}catch{}}},[..._0x483991]),{error:_0x207ebb,loading:_0x50e30c,fetchNow:_0x525737}=_0x40878b(_0x41eff1,{'method':_0x8c1966['GET'],'params':_0x212287,'headers':_0x42ac38,'callback':_0x56d0f1},[..._0x17c096]),{error:_0x10df15,loading:_0x1510c8,fetchNow:_0x8012c5}=_0x40878b(_0x2134b6,{'method':_0x8c1966[_0x233445(0x123)],'body':JSON['stringify'](_0x4da6ce),'headers':_0x42ac38,'callback':_0x553b7d=>{if(_0x54cde3)try{_0x54cde3(_0x553b7d);}catch{}try{_0x553b7d&&_0x553b7d['ok']&&_0x10b8d8();}catch{}}},[..._0x55f10d]);return{'byIdError':_0x207ebb,'byIdFetchNow':_0x525737,'byIdLoading':_0x50e30c,'deleteError':_0x10df15,'deleteFetchNow':_0x8012c5,'deleteLoading':_0x1510c8,'listError':_0x29dc1b,'listFetchNow':_0x40d468,'listLoading':_0x1310d7,'updateError':_0x6df5da,'updateFetchNow':_0x390879,'updateLoading':_0x2a2f06};};export{B as useModuleEntityV2};
@@ -0,0 +1,98 @@
1
+ import { FetchConfig } from './use-fetch.mjs';
2
+
3
+ /**
4
+ * useModuleEntity
5
+ *
6
+ * Summary
7
+ * - A convenience hook that manages common module/entity operations: list, get-by-id,
8
+ * create/update, and delete. It composes `useFetch` for HTTP calls and `useDebounce`
9
+ * for debouncing search queries.
10
+ *
11
+ * Main features
12
+ * - List: performs a POST to `listUrl` with a JSON body `listParams` and re-runs
13
+ * when `searchQuery` (debounced) or `listDeps` change.
14
+ * - Get by ID: performs a POST to `unitByIdUrl` with `byIdParams` in the JSON body
15
+ * and exposes `byIdFetchNow`, `byIdLoading`, and `byIdError`.
16
+ * - Create/Update: performs a POST to `unitUrl` with a JSON body `updateParams`.
17
+ * On successful create/update the hook triggers a coalesced list refresh.
18
+ * - Delete: performs a DELETE to `unitUrl` with a JSON body `deleteParams` and
19
+ * triggers a coalesced list refresh when the operation succeeds.
20
+ * - Refresh batching: `refreshList(delay)` coalesces multiple rapid updates/deletes
21
+ * using a short timeout (default 300ms) to avoid unnecessary list reloads.
22
+ *
23
+ * Parameters (object)
24
+ * - `byIdCallback(data)`, `byIdDeps`, `byIdParams`
25
+ * - `deleteCallback(data)`, `deleteDeps`, `deleteParams`
26
+ * - `listCallback(data)`, `listDeps`, `listParams`, `listUrl`
27
+ * - `searchQuery` (string) — debounced before influencing the list fetch
28
+ * - `unitByIdUrl`, `unitUrl`
29
+ * - `updateCallback(data)`, `updateDeps`, `updateParams`
30
+ *
31
+ * Return values
32
+ * - `byIdFetchNow(url?, config?)`, `byIdLoading`, `byIdError`
33
+ * - `listFetchNow(url?, config?)`, `listLoading`, `listError`
34
+ * - `updateFetchNow(url?, config?)`, `updateLoading`, `updateError`
35
+ * - `deleteFetchNow(url?, config?)`, `deleteLoading`, `deleteError`
36
+ *
37
+ * Behavior notes
38
+ * - All requests that accept parameters send them in the JSON request body (stringified).
39
+ * - All callbacks receive an object `{ data, error, status, ok }` from `useFetch`.
40
+ * - Callbacks are wrapped so thrown errors are swallowed to ensure refresh logic
41
+ * still runs reliably.
42
+ * - `refreshList()` calls `listFetchNow(undefined, { method: 'POST', body: JSON.stringify(listParams) })`
43
+ * to explicitly re-query the list endpoint with the current `listParams`.
44
+ * - Network calls are delegated to `useFetch`; callers can invoke the returned
45
+ * `*FetchNow` functions directly with an override URL or config.
46
+ *
47
+ * Example
48
+ * const { listFetchNow, updateFetchNow } = useModuleEntity({
49
+ * listUrl: '/items',
50
+ * listParams: { page: 1 },
51
+ * listCallback: (res) => console.log(res),
52
+ * unitUrl: '/items',
53
+ * updateCallback: () => {},
54
+ * updateParams: {}
55
+ * });
56
+ */
57
+
58
+ interface CallbackParams {
59
+ data: any;
60
+ error: any;
61
+ status?: number;
62
+ ok?: boolean;
63
+ }
64
+ interface Params {
65
+ byIdCallback: (d: CallbackParams) => void;
66
+ byIdDeps?: Array<any> | Array<string>;
67
+ byIdParams: object;
68
+ deleteCallback?: (d: CallbackParams) => void;
69
+ deleteDeps?: Array<any> | Array<string>;
70
+ deleteParams?: object;
71
+ listCallback: (d: CallbackParams) => void;
72
+ listDeps?: Array<any> | Array<string>;
73
+ listParams: object;
74
+ listUrl: string;
75
+ searchQuery: string;
76
+ unitByIdUrl: string;
77
+ unitUrl: string;
78
+ updateCallback: (d: CallbackParams) => void;
79
+ updateDeps?: Array<any> | Array<string>;
80
+ updateParams: object;
81
+ }
82
+ interface Return {
83
+ byIdError?: Error;
84
+ byIdFetchNow: (url?: string, config?: FetchConfig) => void;
85
+ byIdLoading: boolean;
86
+ deleteError?: Error;
87
+ deleteFetchNow?: (url?: string, config?: FetchConfig) => void;
88
+ deleteLoading: boolean;
89
+ listError?: Error;
90
+ listFetchNow: (url?: string, config?: FetchConfig) => void;
91
+ listLoading: boolean;
92
+ updateError?: Error;
93
+ updateFetchNow: (url?: string, config?: FetchConfig) => void;
94
+ updateLoading: boolean;
95
+ }
96
+ declare const useModuleEntity: ({ byIdCallback, byIdDeps, byIdParams, deleteCallback, deleteDeps, deleteParams, listCallback, listDeps, listParams, listUrl, searchQuery, unitByIdUrl, unitUrl, updateCallback, updateDeps, updateParams, }: Params) => Return;
97
+
98
+ export { type CallbackParams, useModuleEntity };
@@ -1 +1 @@
1
- var u=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var U=(e,r)=>{for(var i in r)u(e,i,{get:r[i],enumerable:!0})},B=(e,r,i,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of M(r))!Q.call(e,o)&&o!==i&&u(e,o,{get:()=>r[o],enumerable:!(c=x(r,o))||c.enumerable});return e};var H=e=>B(u({},"__esModule",{value:!0}),e);var q={};U(q,{useModuleEntity:()=>_});module.exports=H(q);var s=require("react"),n=require("../constants/api-methods"),l=require("./use-fetch"),h=require("./use-debounce");const _=({byIdCallback:e,byIdDeps:r=[],byIdParams:i,deleteCallback:c,deleteDeps:o=[],deleteParams:m,listCallback:p,listDeps:E=[],listParams:d,listUrl:N,searchQuery:k,unitByIdUrl:P,unitUrl:y,updateCallback:b,updateDeps:T=[],updateParams:C})=>{const F=(0,h.useDebounce)(k,800),a=(0,s.useRef)(null);(0,s.useEffect)(()=>()=>{a.current&&(globalThis.clearTimeout(a.current),a.current=null)},[]);const{error:w,fetchNow:g,loading:I}=(0,l.useFetch)(N,{method:n.API_METHODS.POST,body:JSON.stringify(d),callback:p},[F,JSON.stringify(d),...E]),f=(t=300)=>{a.current&&globalThis.clearTimeout(a.current),a.current=globalThis.setTimeout(()=>{try{g(void 0,{method:n.API_METHODS.POST,body:JSON.stringify(d)})}catch{}a.current=null},t)},{error:O,loading:S,fetchNow:L}=(0,l.useFetch)(y,{method:n.API_METHODS.POST,body:JSON.stringify(C),callback:t=>{if(b)try{b(t)}catch{}try{t&&t.ok&&f()}catch{}}},[...T]),{error:v,loading:A,fetchNow:D}=(0,l.useFetch)(P,{method:n.API_METHODS.POST,body:JSON.stringify(i),callback:e},[...r]),{error:J,loading:R,fetchNow:j}=(0,l.useFetch)(y,{method:n.API_METHODS.DELETE,body:JSON.stringify(m),callback:t=>{if(c)try{c(t)}catch{}try{t&&t.ok&&f()}catch{}}},[...o]);return{byIdError:v,byIdFetchNow:D,byIdLoading:A,deleteError:J,deleteFetchNow:j,deleteLoading:R,listError:w,listFetchNow:g,listLoading:I,updateError:O,updateFetchNow:L,updateLoading:S}};0&&(module.exports={useModuleEntity});
1
+ var _0x2c1e4c=_0x1411;(function(_0x449652,_0x1f77a4){var _0x308492=_0x1411,_0x519ad1=_0x449652();while(!![]){try{var _0x2a62b3=-parseInt(_0x308492(0x129))/0x1*(parseInt(_0x308492(0x113))/0x2)+parseInt(_0x308492(0x115))/0x3+-parseInt(_0x308492(0x122))/0x4*(-parseInt(_0x308492(0x11c))/0x5)+-parseInt(_0x308492(0x128))/0x6+parseInt(_0x308492(0x114))/0x7*(-parseInt(_0x308492(0x118))/0x8)+parseInt(_0x308492(0x12e))/0x9+-parseInt(_0x308492(0x119))/0xa*(-parseInt(_0x308492(0x116))/0xb);if(_0x2a62b3===_0x1f77a4)break;else _0x519ad1['push'](_0x519ad1['shift']());}catch(_0x53ed5a){_0x519ad1['push'](_0x519ad1['shift']());}}}(_0x3212,0x63923));var _0x382051=(function(){var _0x467cfe=!![];return function(_0x116c90,_0x3e7967){var _0x8a560f=_0x467cfe?function(){var _0xcdd7ff=_0x1411;if(_0x3e7967){var _0x2a3245=_0x3e7967[_0xcdd7ff(0x127)](_0x116c90,arguments);return _0x3e7967=null,_0x2a3245;}}:function(){};return _0x467cfe=![],_0x8a560f;};}()),_0x212072=_0x382051(this,function(){var _0x466707=_0x1411,_0x5db6e3=function(){var _0x391bd0=_0x1411,_0x3dbccc;try{_0x3dbccc=Function('return\x20(function()\x20'+_0x391bd0(0x124)+');')();}catch(_0x5e25d6){_0x3dbccc=window;}return _0x3dbccc;},_0x76e12=_0x5db6e3(),_0x14258f=_0x76e12[_0x466707(0x12b)]=_0x76e12[_0x466707(0x12b)]||{},_0x756954=['log','warn',_0x466707(0x123),_0x466707(0x120),'exception',_0x466707(0x11a),_0x466707(0x12d)];for(var _0x58c532=0x0;_0x58c532<_0x756954['length'];_0x58c532++){var _0x142ae1=_0x382051[_0x466707(0x11f)]['prototype']['bind'](_0x382051),_0x5cf434=_0x756954[_0x58c532],_0x40028a=_0x14258f[_0x5cf434]||_0x142ae1;_0x142ae1[_0x466707(0x11b)]=_0x382051['bind'](_0x382051),_0x142ae1[_0x466707(0x133)]=_0x40028a[_0x466707(0x133)]['bind'](_0x40028a),_0x14258f[_0x5cf434]=_0x142ae1;}});_0x212072();var u=Object['defineProperty'],x=Object[_0x2c1e4c(0x12c)],M=Object['getOwnPropertyNames'],Q=Object['prototype']['hasOwnProperty'],U=(_0x27724b,_0x58602e)=>{for(var _0x5e684e in _0x58602e)u(_0x27724b,_0x5e684e,{'get':_0x58602e[_0x5e684e],'enumerable':!0x0});},B=(_0x154344,_0x1faf92,_0x44e779,_0xfd546d)=>{var _0xdca1cc=_0x2c1e4c;if(_0x1faf92&&typeof _0x1faf92==_0xdca1cc(0x134)||typeof _0x1faf92=='function'){for(let _0x1f337d of M(_0x1faf92))!Q['call'](_0x154344,_0x1f337d)&&_0x1f337d!==_0x44e779&&u(_0x154344,_0x1f337d,{'get':()=>_0x1faf92[_0x1f337d],'enumerable':!(_0xfd546d=x(_0x1faf92,_0x1f337d))||_0xfd546d[_0xdca1cc(0x121)]});}return _0x154344;},H=_0x5b2873=>B(u({},_0x2c1e4c(0x11d),{'value':!0x0}),_0x5b2873),q={};function _0x1411(_0x3a2580,_0x529a98){_0x3a2580=_0x3a2580-0x112;var _0x1f0a11=_0x3212();var _0x212072=_0x1f0a11[_0x3a2580];return _0x212072;}U(q,{'useModuleEntity':()=>_}),module[_0x2c1e4c(0x11e)]=H(q);var s=require(_0x2c1e4c(0x130)),n=require(_0x2c1e4c(0x126)),l=require('./use-fetch'),h=require(_0x2c1e4c(0x12f));function _0x3212(){var _0x3edf95=['214448biKcYO','useEffect','console','getOwnPropertyDescriptor','trace','5753457BoFvbR','./use-debounce','react','clearTimeout','current','toString','object','API_METHODS','useFetch','4fxVMYD','7Oaxvru','2154741hyHwiB','1840223ibcdZP','POST','5053448vCWrkC','40cQdOUV','table','__proto__','965570zeqEEM','__esModule','exports','constructor','error','enumerable','4myjYWG','info','{}.constructor(\x22return\x20this\x22)(\x20)','stringify','../constants/api-methods','apply','4508316ACrcwo'];_0x3212=function(){return _0x3edf95;};return _0x3212();}const _=({byIdCallback:_0x3bfe40,byIdDeps:_0x22746a=[],byIdParams:_0x2ffc75,deleteCallback:_0x5b1864,deleteDeps:_0x4ec75c=[],deleteParams:_0x21e47d,listCallback:_0x451181,listDeps:_0x54a42c=[],listParams:_0x28a408,listUrl:_0x29d95b,searchQuery:_0x3abc8a,unitByIdUrl:_0x446b05,unitUrl:_0x22dc5f,updateCallback:_0xafe40b,updateDeps:_0x121ca1=[],updateParams:_0x3bc2c9})=>{var _0x2f9453=_0x2c1e4c;const _0x3649a8=(0x0,h['useDebounce'])(_0x3abc8a,0x320),_0x55637f=(0x0,s['useRef'])(null);(0x0,s[_0x2f9453(0x12a)])(()=>()=>{var _0xc9bdda=_0x2f9453;_0x55637f['current']&&(globalThis[_0xc9bdda(0x131)](_0x55637f['current']),_0x55637f[_0xc9bdda(0x132)]=null);},[]);const {error:_0x190b27,fetchNow:_0x1ee2f6,loading:_0x22dc1d}=(0x0,l[_0x2f9453(0x112)])(_0x29d95b,{'method':n[_0x2f9453(0x135)][_0x2f9453(0x117)],'body':JSON['stringify'](_0x28a408),'callback':_0x451181},[_0x3649a8,JSON[_0x2f9453(0x125)](_0x28a408),..._0x54a42c]),_0x3f509c=(_0xfea7b8=0x12c)=>{var _0x5ebeb7=_0x2f9453;_0x55637f['current']&&globalThis['clearTimeout'](_0x55637f[_0x5ebeb7(0x132)]),_0x55637f['current']=globalThis['setTimeout'](()=>{var _0x3844b6=_0x5ebeb7;try{_0x1ee2f6(void 0x0,{'method':n['API_METHODS'][_0x3844b6(0x117)],'body':JSON['stringify'](_0x28a408)});}catch{}_0x55637f[_0x3844b6(0x132)]=null;},_0xfea7b8);},{error:_0x416949,loading:_0x3fca33,fetchNow:_0x20bda2}=(0x0,l['useFetch'])(_0x22dc5f,{'method':n['API_METHODS'][_0x2f9453(0x117)],'body':JSON[_0x2f9453(0x125)](_0x3bc2c9),'callback':_0x4c846e=>{if(_0xafe40b)try{_0xafe40b(_0x4c846e);}catch{}try{_0x4c846e&&_0x4c846e['ok']&&_0x3f509c();}catch{}}},[..._0x121ca1]),{error:_0x350f30,loading:_0x2ff6b1,fetchNow:_0x4e74db}=(0x0,l['useFetch'])(_0x446b05,{'method':n[_0x2f9453(0x135)][_0x2f9453(0x117)],'body':JSON['stringify'](_0x2ffc75),'callback':_0x3bfe40},[..._0x22746a]),{error:_0x5f1856,loading:_0x18a974,fetchNow:_0x4d1f27}=(0x0,l['useFetch'])(_0x22dc5f,{'method':n[_0x2f9453(0x135)]['DELETE'],'body':JSON['stringify'](_0x21e47d),'callback':_0x50967f=>{if(_0x5b1864)try{_0x5b1864(_0x50967f);}catch{}try{_0x50967f&&_0x50967f['ok']&&_0x3f509c();}catch{}}},[..._0x4ec75c]);return{'byIdError':_0x350f30,'byIdFetchNow':_0x4e74db,'byIdLoading':_0x2ff6b1,'deleteError':_0x5f1856,'deleteFetchNow':_0x4d1f27,'deleteLoading':_0x18a974,'listError':_0x190b27,'listFetchNow':_0x1ee2f6,'listLoading':_0x22dc1d,'updateError':_0x416949,'updateFetchNow':_0x20bda2,'updateLoading':_0x3fca33};};0x0&&(module[_0x2c1e4c(0x11e)]={'useModuleEntity':useModuleEntity});
@@ -0,0 +1 @@
1
+ function _0x3a1e(){const _0x58f5ff=['table','6647848trtYnR','warn','length','stringify','setTimeout','clearTimeout','trace','3jvdqRY','POST','314694ntdhgW','error','1255491EcuMGb','toString','current','console','__proto__','69754nnHEjc','10xWoWoe','5681060fdyAZG','171088Jungrk','797421fMwiOL'];_0x3a1e=function(){return _0x58f5ff;};return _0x3a1e();}(function(_0x4d5e4b,_0x243598){const _0xc0bcec=_0x17bd,_0x414b23=_0x4d5e4b();while(!![]){try{const _0x4ca3e5=parseInt(_0xc0bcec(0x75))/0x1+parseInt(_0xc0bcec(0x71))/0x2*(-parseInt(_0xc0bcec(0x7e))/0x3)+parseInt(_0xc0bcec(0x74))/0x4*(-parseInt(_0xc0bcec(0x72))/0x5)+-parseInt(_0xc0bcec(0x6a))/0x6+parseInt(_0xc0bcec(0x73))/0x7+-parseInt(_0xc0bcec(0x77))/0x8+-parseInt(_0xc0bcec(0x6c))/0x9;if(_0x4ca3e5===_0x243598)break;else _0x414b23['push'](_0x414b23['shift']());}catch(_0x3fdcc7){_0x414b23['push'](_0x414b23['shift']());}}}(_0x3a1e,0x71af3));const _0x24f213=(function(){let _0x3d68ba=!![];return function(_0x470c02,_0x1414cf){const _0x2eaa6e=_0x3d68ba?function(){if(_0x1414cf){const _0xad6c04=_0x1414cf['apply'](_0x470c02,arguments);return _0x1414cf=null,_0xad6c04;}}:function(){};return _0x3d68ba=![],_0x2eaa6e;};}()),_0x1e85b6=_0x24f213(this,function(){const _0x148d99=_0x17bd,_0x1941bc=function(){let _0x4909e4;try{_0x4909e4=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x2f7f6c){_0x4909e4=window;}return _0x4909e4;},_0x17402b=_0x1941bc(),_0x46a8d1=_0x17402b[_0x148d99(0x6f)]=_0x17402b['console']||{},_0x53dd15=['log',_0x148d99(0x78),'info',_0x148d99(0x6b),'exception',_0x148d99(0x76),_0x148d99(0x7d)];for(let _0x5eda64=0x0;_0x5eda64<_0x53dd15[_0x148d99(0x79)];_0x5eda64++){const _0x37887f=_0x24f213['constructor']['prototype']['bind'](_0x24f213),_0x47d019=_0x53dd15[_0x5eda64],_0x384bf8=_0x46a8d1[_0x47d019]||_0x37887f;_0x37887f[_0x148d99(0x70)]=_0x24f213['bind'](_0x24f213),_0x37887f['toString']=_0x384bf8[_0x148d99(0x6d)]['bind'](_0x384bf8),_0x46a8d1[_0x47d019]=_0x37887f;}});_0x1e85b6();import{useRef as _0x5082e3,useEffect as _0xe56ba6}from'react';import{API_METHODS as _0x217d25}from'../constants/api-methods';function _0x17bd(_0x358eb1,_0x44af3f){_0x358eb1=_0x358eb1-0x69;const _0x310b5d=_0x3a1e();let _0x1e85b6=_0x310b5d[_0x358eb1];return _0x1e85b6;}import{useFetch as _0x23f0e5}from'./use-fetch';import{useDebounce as _0x56a68e}from'./use-debounce';const H=({byIdCallback:_0x2ed3b0,byIdDeps:_0x2bff06=[],byIdParams:_0x5b3ac5,deleteCallback:_0x67f244,deleteDeps:_0x305f30=[],deleteParams:_0x1992d4,listCallback:_0x1edd4c,listDeps:_0x4c4986=[],listParams:_0x5f544c,listUrl:_0x3df481,searchQuery:_0xd0c3cb,unitByIdUrl:_0x2aa2e7,unitUrl:_0xf5942d,updateCallback:_0x3afc34,updateDeps:_0x1282b0=[],updateParams:_0x36fb04})=>{const _0x44dcd5=_0x17bd,_0x38e4d7=_0x56a68e(_0xd0c3cb,0x320),_0x34da2c=_0x5082e3(null);_0xe56ba6(()=>()=>{const _0x54d026=_0x17bd;_0x34da2c['current']&&(globalThis[_0x54d026(0x7c)](_0x34da2c[_0x54d026(0x6e)]),_0x34da2c['current']=null);},[]);const {error:_0x47783f,fetchNow:_0x54df7f,loading:_0xf011a4}=_0x23f0e5(_0x3df481,{'method':_0x217d25[_0x44dcd5(0x69)],'body':JSON[_0x44dcd5(0x7a)](_0x5f544c),'callback':_0x1edd4c},[_0x38e4d7,JSON[_0x44dcd5(0x7a)](_0x5f544c),..._0x4c4986]),_0xd06726=(_0x2e51dd=0x12c)=>{const _0x531903=_0x44dcd5;_0x34da2c[_0x531903(0x6e)]&&globalThis['clearTimeout'](_0x34da2c[_0x531903(0x6e)]),_0x34da2c[_0x531903(0x6e)]=globalThis[_0x531903(0x7b)](()=>{const _0x3a611c=_0x531903;try{_0x54df7f(void 0x0,{'method':_0x217d25['POST'],'body':JSON[_0x3a611c(0x7a)](_0x5f544c)});}catch{}_0x34da2c['current']=null;},_0x2e51dd);},{error:_0x2ab030,loading:_0x8afade,fetchNow:_0x16c041}=_0x23f0e5(_0xf5942d,{'method':_0x217d25['POST'],'body':JSON['stringify'](_0x36fb04),'callback':_0x5d0268=>{if(_0x3afc34)try{_0x3afc34(_0x5d0268);}catch{}try{_0x5d0268&&_0x5d0268['ok']&&_0xd06726();}catch{}}},[..._0x1282b0]),{error:_0x81ee95,loading:_0x4cafb3,fetchNow:_0x4094c2}=_0x23f0e5(_0x2aa2e7,{'method':_0x217d25['POST'],'body':JSON[_0x44dcd5(0x7a)](_0x5b3ac5),'callback':_0x2ed3b0},[..._0x2bff06]),{error:_0x216a2e,loading:_0x5b8024,fetchNow:_0x5d87b5}=_0x23f0e5(_0xf5942d,{'method':_0x217d25['DELETE'],'body':JSON['stringify'](_0x1992d4),'callback':_0xe67b12=>{if(_0x67f244)try{_0x67f244(_0xe67b12);}catch{}try{_0xe67b12&&_0xe67b12['ok']&&_0xd06726();}catch{}}},[..._0x305f30]);return{'byIdError':_0x81ee95,'byIdFetchNow':_0x4094c2,'byIdLoading':_0x4cafb3,'deleteError':_0x216a2e,'deleteFetchNow':_0x5d87b5,'deleteLoading':_0x5b8024,'listError':_0x47783f,'listFetchNow':_0x54df7f,'listLoading':_0xf011a4,'updateError':_0x2ab030,'updateFetchNow':_0x16c041,'updateLoading':_0x8afade};};export{H as useModuleEntity};
@@ -0,0 +1,17 @@
1
+ interface FormattedPhoneNumber {
2
+ e164: string;
3
+ international: string;
4
+ }
5
+ interface Return {
6
+ formatted: FormattedPhoneNumber | null;
7
+ formatNumber: (v: string) => void;
8
+ }
9
+ /**
10
+ * Parses and formats phone numbers into E.164 and international formats.
11
+ *
12
+ * @param defaultCountry - The default country code to use when parsing (default 'US').
13
+ * @returns An object containing the formatted phone number (or null) and a setter function.
14
+ */
15
+ declare const usePhoneFormatter: (defaultCountry?: string) => Return;
16
+
17
+ export { usePhoneFormatter };
@@ -1,5 +1,3 @@
1
- import { CountryCode } from 'libphonenumber-js';
2
-
3
1
  interface FormattedPhoneNumber {
4
2
  e164: string;
5
3
  international: string;
@@ -14,6 +12,6 @@ interface Return {
14
12
  * @param defaultCountry - The default country code to use when parsing (default 'US').
15
13
  * @returns An object containing the formatted phone number (or null) and a setter function.
16
14
  */
17
- declare const usePhoneFormatter: (defaultCountry?: CountryCode) => Return;
15
+ declare const usePhoneFormatter: (defaultCountry?: string) => Return;
18
16
 
19
17
  export { usePhoneFormatter };
@@ -1 +1 @@
1
- var a=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var d=(r,t)=>{for(var e in t)a(r,e,{get:t[e],enumerable:!0})},b=(r,t,e,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of l(t))!f.call(r,o)&&o!==e&&a(r,o,{get:()=>t[o],enumerable:!(m=s(t,o))||m.enumerable});return r};var N=r=>b(a({},"__esModule",{value:!0}),r);var h={};d(h,{usePhoneFormatter:()=>c});module.exports=N(h);var i=require("react"),u=require("libphonenumber-js");const c=(r="US")=>{const[t,e]=(0,i.useState)(null);return{formatted:t,formatNumber:o=>{const n=(0,u.parsePhoneNumberFromString)(o,r);e(n?{e164:n.isValid()?n.format("E.164"):"",international:n.formatInternational()}:null)}}};0&&(module.exports={usePhoneFormatter});
1
+ var _0x432df6=_0x29f4;(function(_0x2156fc,_0x24ccfb){var _0x72d0f9=_0x29f4,_0x16a091=_0x2156fc();while(!![]){try{var _0x96b0c3=parseInt(_0x72d0f9(0x196))/0x1*(parseInt(_0x72d0f9(0x18c))/0x2)+-parseInt(_0x72d0f9(0x182))/0x3+parseInt(_0x72d0f9(0x18d))/0x4*(-parseInt(_0x72d0f9(0x180))/0x5)+-parseInt(_0x72d0f9(0x18e))/0x6+-parseInt(_0x72d0f9(0x199))/0x7*(parseInt(_0x72d0f9(0x19b))/0x8)+-parseInt(_0x72d0f9(0x187))/0x9+parseInt(_0x72d0f9(0x17d))/0xa;if(_0x96b0c3===_0x24ccfb)break;else _0x16a091['push'](_0x16a091['shift']());}catch(_0x4c0914){_0x16a091['push'](_0x16a091['shift']());}}}(_0x7d7d,0x28b35));var _0x53b696=(function(){var _0x13bed4=!![];return function(_0x3dcee1,_0x9f5f75){var _0x5e0e97=_0x13bed4?function(){var _0x536e2f=_0x29f4;if(_0x9f5f75){var _0x1fc8c9=_0x9f5f75[_0x536e2f(0x17f)](_0x3dcee1,arguments);return _0x9f5f75=null,_0x1fc8c9;}}:function(){};return _0x13bed4=![],_0x5e0e97;};}()),_0x22557e=_0x53b696(this,function(){var _0x3b0467=_0x29f4,_0x4d3061;try{var _0x4dcf38=Function('return\x20(function()\x20'+_0x3b0467(0x19a)+');');_0x4d3061=_0x4dcf38();}catch(_0x55a5fa){_0x4d3061=window;}var _0x5366b7=_0x4d3061[_0x3b0467(0x191)]=_0x4d3061[_0x3b0467(0x191)]||{},_0x367f3c=[_0x3b0467(0x17e),'warn','info','error',_0x3b0467(0x192),'table','trace'];for(var _0x4f7845=0x0;_0x4f7845<_0x367f3c[_0x3b0467(0x198)];_0x4f7845++){var _0x5b4303=_0x53b696[_0x3b0467(0x190)][_0x3b0467(0x18b)]['bind'](_0x53b696),_0x58c9ee=_0x367f3c[_0x4f7845],_0x3d88ac=_0x5366b7[_0x58c9ee]||_0x5b4303;_0x5b4303[_0x3b0467(0x188)]=_0x53b696['bind'](_0x53b696),_0x5b4303['toString']=_0x3d88ac[_0x3b0467(0x18a)][_0x3b0467(0x186)](_0x3d88ac),_0x5366b7[_0x58c9ee]=_0x5b4303;}});_0x22557e();var m=Object[_0x432df6(0x19d)],s=Object['getOwnPropertyDescriptor'],l=Object[_0x432df6(0x181)],f=Object[_0x432df6(0x18b)][_0x432df6(0x189)],d=(_0x560e29,_0x8714ea)=>{for(var _0x99cee5 in _0x8714ea)m(_0x560e29,_0x99cee5,{'get':_0x8714ea[_0x99cee5],'enumerable':!0x0});},b=(_0x18fc5f,_0x314a37,_0x295fb0,_0x17edcf)=>{var _0x3f2287=_0x432df6;if(_0x314a37&&typeof _0x314a37==_0x3f2287(0x193)||typeof _0x314a37=='function'){for(let _0x38b531 of l(_0x314a37))!f['call'](_0x18fc5f,_0x38b531)&&_0x38b531!==_0x295fb0&&m(_0x18fc5f,_0x38b531,{'get':()=>_0x314a37[_0x38b531],'enumerable':!(_0x17edcf=s(_0x314a37,_0x38b531))||_0x17edcf['enumerable']});}return _0x18fc5f;},N=_0x5ae204=>b(m({},_0x432df6(0x19c),{'value':!0x0}),_0x5ae204),g={};d(g,{'usePhoneFormatter':()=>c}),module['exports']=N(g);function _0x29f4(_0x5b270c,_0x41799f){_0x5b270c=_0x5b270c-0x17d;var _0x1298b9=_0x7d7d();var _0x22557e=_0x1298b9[_0x5b270c];return _0x22557e;}function _0x7d7d(){var _0x3c62fe=['defineProperty','5223610SdloFf','log','apply','10tJprgg','getOwnPropertyNames','215349PzMHVW','react','E.164','format','bind','418878FZzzPK','__proto__','hasOwnProperty','toString','prototype','2FsPaTR','162340mqDbaI','1143036tJhgnu','isValid','constructor','console','exception','object','formatInternational','exports','215771BRXVkR','useState','length','141106YEFexh','{}.constructor(\x22return\x20this\x22)(\x20)','72rePWmn','__esModule'];_0x7d7d=function(){return _0x3c62fe;};return _0x7d7d();}var i=require(_0x432df6(0x183));const c=(_0x2eba72='US')=>{var _0x346260=_0x432df6;const [_0x3aa977,_0x2ff254]=(0x0,i[_0x346260(0x197)])(null);return{'formatted':_0x3aa977,'formatNumber':_0x521ea7=>{var _0x58104f=_0x346260;const {parsePhoneNumberFromString:_0x5b7410}=require('libphonenumber-js'),_0x5c914b=_0x5b7410(_0x521ea7,_0x2eba72);_0x2ff254(_0x5c914b?{'e164':_0x5c914b[_0x58104f(0x18f)]()?_0x5c914b[_0x58104f(0x185)](_0x58104f(0x184)):'','international':_0x5c914b[_0x58104f(0x194)]()}:null);}};};0x0&&(module[_0x432df6(0x195)]={'usePhoneFormatter':usePhoneFormatter});
@@ -0,0 +1 @@
1
+ function _0x1f93(){const _0x11e615=['15TJWicv','__proto__','exception','isValid','length','console','368bfNVBc','return\x20(function()\x20','toString','11302650KxkioT','6267254SOmFSM','{}.constructor(\x22return\x20this\x22)(\x20)','formatInternational','20wHfUbv','698028gCmzoH','3187312lvAMHV','bind','constructor','table','E.164','libphonenumber-js','4391WnHpaZ','65990aDGSqt','error','2013WrWvcy','2564814ZvcRzN'];_0x1f93=function(){return _0x11e615;};return _0x1f93();}(function(_0x27b529,_0xbe5df2){const _0x492189=_0x2487,_0x33c6c3=_0x27b529();while(!![]){try{const _0x3c3fe9=parseInt(_0x492189(0x18d))/0x1*(-parseInt(_0x492189(0x17e))/0x2)+parseInt(_0x492189(0x186))/0x3*(-parseInt(_0x492189(0x185))/0x4)+parseInt(_0x492189(0x192))/0x5*(parseInt(_0x492189(0x191))/0x6)+parseInt(_0x492189(0x182))/0x7+parseInt(_0x492189(0x187))/0x8+parseInt(_0x492189(0x181))/0x9+-parseInt(_0x492189(0x18e))/0xa*(parseInt(_0x492189(0x190))/0xb);if(_0x3c3fe9===_0xbe5df2)break;else _0x33c6c3['push'](_0x33c6c3['shift']());}catch(_0x296130){_0x33c6c3['push'](_0x33c6c3['shift']());}}}(_0x1f93,0x9f6fc));const _0x10f330=(function(){let _0x13709b=!![];return function(_0x5d0af3,_0x456409){const _0x48ec7f=_0x13709b?function(){if(_0x456409){const _0x4de4be=_0x456409['apply'](_0x5d0af3,arguments);return _0x456409=null,_0x4de4be;}}:function(){};return _0x13709b=![],_0x48ec7f;};}()),_0x42225c=_0x10f330(this,function(){const _0x46ad30=_0x2487;let _0x37f1ae;try{const _0x417f66=Function(_0x46ad30(0x17f)+_0x46ad30(0x183)+');');_0x37f1ae=_0x417f66();}catch(_0x4db645){_0x37f1ae=window;}const _0x3dfd47=_0x37f1ae[_0x46ad30(0x17d)]=_0x37f1ae['console']||{},_0x1f3c80=['log','warn','info',_0x46ad30(0x18f),_0x46ad30(0x194),_0x46ad30(0x18a),'trace'];for(let _0x4ed7f0=0x0;_0x4ed7f0<_0x1f3c80[_0x46ad30(0x17c)];_0x4ed7f0++){const _0x8173c3=_0x10f330[_0x46ad30(0x189)]['prototype'][_0x46ad30(0x188)](_0x10f330),_0x4f4839=_0x1f3c80[_0x4ed7f0],_0x26640d=_0x3dfd47[_0x4f4839]||_0x8173c3;_0x8173c3[_0x46ad30(0x193)]=_0x10f330['bind'](_0x10f330),_0x8173c3['toString']=_0x26640d[_0x46ad30(0x180)][_0x46ad30(0x188)](_0x26640d),_0x3dfd47[_0x4f4839]=_0x8173c3;}});_0x42225c();function _0x2487(_0x43b3f4,_0x388943){_0x43b3f4=_0x43b3f4-0x17b;const _0x3edcb2=_0x1f93();let _0x42225c=_0x3edcb2[_0x43b3f4];return _0x42225c;}import{useState as _0x179908}from'react';const s=(_0x2f3632='US')=>{const [_0x1001cc,_0x1bc77d]=_0x179908(null);return{'formatted':_0x1001cc,'formatNumber':_0x2d2695=>{const _0x514e8f=_0x2487,{parsePhoneNumberFromString:_0xe2367c}=require(_0x514e8f(0x18c)),_0x14fd07=_0xe2367c(_0x2d2695,_0x2f3632);_0x1bc77d(_0x14fd07?{'e164':_0x14fd07[_0x514e8f(0x17b)]()?_0x14fd07['format'](_0x514e8f(0x18b)):'','international':_0x14fd07[_0x514e8f(0x184)]()}:null);}};};export{s as usePhoneFormatter};