@feathery/react 2.11.1 → 2.12.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 (126) hide show
  1. package/dist/cjs/elements/fields/FileUploadField/index.d.ts.map +1 -1
  2. package/dist/cjs/elements/fields/index.d.ts.map +1 -1
  3. package/dist/cjs/{fthry_FormControl.BoBlGUv-.js → fthry_FormControl.CD7ZX9HS.js} +1 -1
  4. package/dist/cjs/{fthry_InlineTooltip.BDg-8hjR.js → fthry_InlineTooltip.CoBn0AOC.js} +2 -2
  5. package/dist/cjs/{fthry_Overlay.9cAIeP6E.js → fthry_Overlay.CshBlW3v.js} +1 -1
  6. package/dist/cjs/{fthry_PaymentMethodField.CoByJr6K.js → fthry_PaymentMethodField.ClmgrMDW.js} +4 -4
  7. package/dist/cjs/{fthry_Placeholder.B8Fiv4tG.js → fthry_Placeholder.CL_PBAhS.js} +1 -1
  8. package/dist/cjs/{fthry_ShowEyeIcon.BR6TU49u.js → fthry_ShowEyeIcon.DQYOkuGq.js} +1 -1
  9. package/dist/cjs/{fthry_index.HrTSyg9B.js → fthry_index.B8m8NcYS.js} +1 -1
  10. package/dist/cjs/{fthry_index.Bg1tnBes.js → fthry_index.BMq3dBRB.js} +602 -465
  11. package/dist/cjs/{fthry_index.BOdVGl5l.js → fthry_index.BpPVWOqt.js} +4 -4
  12. package/dist/cjs/{fthry_index.BT4rLIaG.js → fthry_index.BrzbrcQa.js} +6 -6
  13. package/dist/cjs/{fthry_index.CEvNFKQL.js → fthry_index.C8jtezTq.js} +2 -2
  14. package/dist/cjs/{fthry_index.C5e1CIOA.js → fthry_index.CRJbToBF.js} +3 -3
  15. package/dist/cjs/{fthry_index.EgnUQ81x.js → fthry_index.CVGTkuBu.js} +5 -5
  16. package/dist/cjs/{fthry_index.Bz00U1qW.js → fthry_index.CX0W0jE1.js} +2 -2
  17. package/dist/cjs/{fthry_index.BWxbbmA2.js → fthry_index.CcgrLEuS.js} +5 -5
  18. package/dist/cjs/{fthry_index.CyKbm52O.js → fthry_index.CdGAa2gf.js} +4 -4
  19. package/dist/cjs/{fthry_index.gF97kiKa.js → fthry_index.Ce9wiHSK.js} +5 -5
  20. package/dist/cjs/{fthry_index.D-DmJrvp.js → fthry_index.CmHODiIC.js} +3 -3
  21. package/dist/cjs/{fthry_index.B61Fc5yV.js → fthry_index.CpHzsH9n.js} +1 -1
  22. package/dist/cjs/{fthry_index.C67RyE6s.js → fthry_index.CpIBnF75.js} +1 -1
  23. package/dist/cjs/{fthry_index.DD21qdc8.js → fthry_index.CuICsq3u.js} +5 -5
  24. package/dist/cjs/{fthry_index.rFGfbGIk.js → fthry_index.CxZygKnY.js} +6 -6
  25. package/dist/cjs/{fthry_index.B1HntmiS.js → fthry_index.D94gkYbC.js} +8 -8
  26. package/dist/cjs/{fthry_index.ClWRtApG.js → fthry_index.DBr9A2ZJ.js} +1 -1
  27. package/dist/cjs/{fthry_index.BD1AaCkS.js → fthry_index.DM58Cupo.js} +18 -3
  28. package/dist/cjs/{fthry_index.CPoExiaS.js → fthry_index.R9WKq_P8.js} +1 -1
  29. package/dist/cjs/{fthry_index.CKUbCvsH.js → fthry_index.e1NDYANz.js} +6 -6
  30. package/dist/cjs/{fthry_index.JnLQZ_md.js → fthry_index.iaUi_vwz.js} +4 -4
  31. package/dist/cjs/{fthry_index.CoeM5YQu.js → fthry_index.x3WPDwFM.js} +1 -1
  32. package/dist/cjs/{fthry_input.CogPcc6M.js → fthry_input.xxDrXTUh.js} +1 -1
  33. package/dist/cjs/{fthry_script.6P1NJRwv.js → fthry_script.rT4Hk6hO.js} +1 -1
  34. package/dist/cjs/{fthry_styles.IzrEmUeD.js → fthry_styles.CBznbkq1.js} +1 -1
  35. package/dist/cjs/{fthry_useElementSize.BnoWET1V.js → fthry_useElementSize.BtewtYuf.js} +1 -1
  36. package/dist/cjs/{fthry_useSalesforceSync.DQAPSVmr.js → fthry_useSalesforceSync.CuD01OZB.js} +1 -1
  37. package/dist/cjs/{fthry_webfontloader.z-pzQOVm.js → fthry_webfontloader.BpYY6eaS.js} +1 -1
  38. package/dist/cjs/index.d.ts +2 -2
  39. package/dist/cjs/index.js +1 -1
  40. package/dist/cjs/utils/error.d.ts +0 -5
  41. package/dist/cjs/utils/error.d.ts.map +1 -1
  42. package/dist/cjs/utils/featheryClient/index.d.ts +12 -20
  43. package/dist/cjs/utils/featheryClient/index.d.ts.map +1 -1
  44. package/dist/cjs/utils/featheryClient/integrationClient.d.ts +2 -8
  45. package/dist/cjs/utils/featheryClient/integrationClient.d.ts.map +1 -1
  46. package/dist/cjs/utils/featheryClient/utils.d.ts.map +1 -1
  47. package/dist/cjs/utils/formContext.d.ts +2 -1
  48. package/dist/cjs/utils/formContext.d.ts.map +1 -1
  49. package/dist/cjs/utils/formHelperFunctions.d.ts.map +1 -1
  50. package/dist/cjs/utils/image.d.ts.map +1 -1
  51. package/dist/cjs/utils/internalState.d.ts +1 -12
  52. package/dist/cjs/utils/internalState.d.ts.map +1 -1
  53. package/dist/elements/fields/FileUploadField/index.d.ts.map +1 -1
  54. package/dist/elements/fields/index.d.ts.map +1 -1
  55. package/dist/esm/elements/fields/FileUploadField/index.d.ts.map +1 -1
  56. package/dist/esm/elements/fields/index.d.ts.map +1 -1
  57. package/dist/esm/{fthry_FormControl.1iiH8b4i.js → fthry_FormControl.CJgP5gkl.js} +1 -1
  58. package/dist/esm/{fthry_InlineTooltip.CREexk6k.js → fthry_InlineTooltip.C6FcOG7t.js} +2 -2
  59. package/dist/esm/{fthry_Overlay.4bM7bqaM.js → fthry_Overlay.OaYtZbBy.js} +1 -1
  60. package/dist/esm/{fthry_PaymentMethodField.Cb-ULdGb.js → fthry_PaymentMethodField.w3gN7Laz.js} +4 -4
  61. package/dist/esm/{fthry_Placeholder.CcLGjl1u.js → fthry_Placeholder.B8o3b6LD.js} +1 -1
  62. package/dist/esm/{fthry_ShowEyeIcon.eF1-xhvT.js → fthry_ShowEyeIcon.CTL96Xla.js} +1 -1
  63. package/dist/esm/{fthry_index.e5_-aYH2.js → fthry_index.B3p8f_0T.js} +3 -3
  64. package/dist/esm/{fthry_index.CKCDUf3w.js → fthry_index.BG0CKa54.js} +1 -1
  65. package/dist/esm/{fthry_index.B_5JaMZj.js → fthry_index.BJfTO9uE.js} +5 -5
  66. package/dist/esm/{fthry_index.BWkhkeXW.js → fthry_index.BmTsB6Yu.js} +4 -4
  67. package/dist/esm/{fthry_index.JZQuYqHY.js → fthry_index.BrukVpyc.js} +18 -3
  68. package/dist/esm/{fthry_index.BSpj1J3t.js → fthry_index.Bwx-PVUc.js} +1 -1
  69. package/dist/esm/{fthry_index.CS2Bl6C1.js → fthry_index.CX_yIpjx.js} +5 -5
  70. package/dist/esm/{fthry_index.CB2vMsnM.js → fthry_index.D2sLtI7z.js} +602 -465
  71. package/dist/esm/{fthry_index.gMIrcjef.js → fthry_index.D5EZxrPq.js} +6 -6
  72. package/dist/esm/{fthry_index.DpdhPVtE.js → fthry_index.DVcP5-xw.js} +3 -3
  73. package/dist/esm/{fthry_index.BM1AattI.js → fthry_index.DfQXHyGI.js} +5 -5
  74. package/dist/esm/{fthry_index.De_KEVYz.js → fthry_index.Dh6l3Gzh.js} +1 -1
  75. package/dist/esm/{fthry_index.C41oCBcm.js → fthry_index.DhAebwSP.js} +1 -1
  76. package/dist/esm/{fthry_index.Dr1twar-.js → fthry_index.DjBNWso3.js} +4 -4
  77. package/dist/esm/{fthry_index.DzJNxFJS.js → fthry_index.W81Z3_36.js} +2 -2
  78. package/dist/esm/{fthry_index.Ci7ibGUI.js → fthry_index._VpRor3C.js} +4 -4
  79. package/dist/esm/{fthry_index.UO0V9XrA.js → fthry_index._Vy4-Wu1.js} +1 -1
  80. package/dist/esm/{fthry_index.CQWTQtLw.js → fthry_index.f0EL1oG0.js} +6 -6
  81. package/dist/esm/{fthry_index.9mFiTG-F.js → fthry_index.q1Cc80ox.js} +2 -2
  82. package/dist/esm/{fthry_index.I2ya6REt.js → fthry_index.rA0-tPwD.js} +8 -8
  83. package/dist/esm/{fthry_index.H8MtZv8B.js → fthry_index.xPB4gauQ.js} +1 -1
  84. package/dist/esm/{fthry_index.BgQOfF85.js → fthry_index.xmk6gHHa.js} +5 -5
  85. package/dist/esm/{fthry_index.x12MCTQ7.js → fthry_index.yOjuSCdP.js} +6 -6
  86. package/dist/esm/{fthry_input.BrLpC149.js → fthry_input.IXRyP1Bj.js} +1 -1
  87. package/dist/esm/{fthry_script.ePkzRcPc.js → fthry_script.BM2vGrj6.js} +1 -1
  88. package/dist/esm/{fthry_styles.D641KtAd.js → fthry_styles.DfbJMfa4.js} +1 -1
  89. package/dist/esm/{fthry_useElementSize.Ce2Hmk3y.js → fthry_useElementSize.9TQixaBM.js} +1 -1
  90. package/dist/esm/{fthry_useSalesforceSync.DL2Ww72M.js → fthry_useSalesforceSync.kfFiE0MN.js} +1 -1
  91. package/dist/esm/{fthry_webfontloader.ColEuyZc.js → fthry_webfontloader.Bg-Ggiji.js} +1 -1
  92. package/dist/esm/index.d.ts +2 -2
  93. package/dist/esm/index.js +1 -1
  94. package/dist/esm/utils/error.d.ts +0 -5
  95. package/dist/esm/utils/error.d.ts.map +1 -1
  96. package/dist/esm/utils/featheryClient/index.d.ts +12 -20
  97. package/dist/esm/utils/featheryClient/index.d.ts.map +1 -1
  98. package/dist/esm/utils/featheryClient/integrationClient.d.ts +2 -8
  99. package/dist/esm/utils/featheryClient/integrationClient.d.ts.map +1 -1
  100. package/dist/esm/utils/featheryClient/utils.d.ts.map +1 -1
  101. package/dist/esm/utils/formContext.d.ts +2 -1
  102. package/dist/esm/utils/formContext.d.ts.map +1 -1
  103. package/dist/esm/utils/formHelperFunctions.d.ts.map +1 -1
  104. package/dist/esm/utils/image.d.ts.map +1 -1
  105. package/dist/esm/utils/internalState.d.ts +1 -12
  106. package/dist/esm/utils/internalState.d.ts.map +1 -1
  107. package/dist/index.d.ts +2 -2
  108. package/dist/utils/error.d.ts +0 -5
  109. package/dist/utils/error.d.ts.map +1 -1
  110. package/dist/utils/featheryClient/index.d.ts +12 -20
  111. package/dist/utils/featheryClient/index.d.ts.map +1 -1
  112. package/dist/utils/featheryClient/integrationClient.d.ts +2 -8
  113. package/dist/utils/featheryClient/integrationClient.d.ts.map +1 -1
  114. package/dist/utils/featheryClient/utils.d.ts.map +1 -1
  115. package/dist/utils/formContext.d.ts +2 -1
  116. package/dist/utils/formContext.d.ts.map +1 -1
  117. package/dist/utils/formHelperFunctions.d.ts.map +1 -1
  118. package/dist/utils/image.d.ts.map +1 -1
  119. package/dist/utils/internalState.d.ts +1 -12
  120. package/dist/utils/internalState.d.ts.map +1 -1
  121. package/package.json +2 -1
  122. package/umd/{509.4236d4d76d2fa2ccd971.js → 509.f9d0245d6c94d15722a0.js} +2 -2
  123. package/umd/FileUploadField.ea0067dd62b0454b7c2e.js +1 -0
  124. package/umd/index.js +1 -1
  125. package/umd/FileUploadField.5b99c480e0eec74a3867.js +0 -1
  126. /package/umd/{509.4236d4d76d2fa2ccd971.js.LICENSE.txt → 509.f9d0245d6c94d15722a0.js.LICENSE.txt} +0 -0
@@ -5780,66 +5780,6 @@ function v4$1(options, buf, offset) {
5780
5780
  return stringify$1(rnds);
5781
5781
  }
5782
5782
 
5783
- var SDKKeyError = /** @class */ (function (_super) {
5784
- __extends(SDKKeyError, _super);
5785
- function SDKKeyError(message) {
5786
- if (message === void 0) { message = 'Invalid SDK Key'; }
5787
- var _this = _super.call(this, message) || this;
5788
- _this.name = 'SDKKeyError';
5789
- return _this;
5790
- }
5791
- return SDKKeyError;
5792
- }(Error));
5793
- var UserIdError = /** @class */ (function (_super) {
5794
- __extends(UserIdError, _super);
5795
- function UserIdError() {
5796
- var _this = _super.call(this, 'Invalid User ID') || this;
5797
- _this.name = 'UserIdError';
5798
- return _this;
5799
- }
5800
- return UserIdError;
5801
- }(Error));
5802
- var FetchError = /** @class */ (function (_super) {
5803
- __extends(FetchError, _super);
5804
- function FetchError(message, payload) {
5805
- if (payload === void 0) { payload = null; }
5806
- var _this = _super.call(this, message) || this;
5807
- _this.name = 'FetchError';
5808
- _this.payload = payload;
5809
- return _this;
5810
- }
5811
- return FetchError;
5812
- }(Error));
5813
- function parseError(err) {
5814
- if (Array.isArray(err) && err.length) {
5815
- var payloadError = err[0];
5816
- if (typeof payloadError === 'object' && 'message' in payloadError) {
5817
- return payloadError.message;
5818
- }
5819
- else
5820
- return 'Invalid';
5821
- }
5822
- else if (err.message || err.error)
5823
- return err.message || err.error;
5824
- else
5825
- return err.toString();
5826
- }
5827
- var handleCustomScriptError = function (e) {
5828
- var _a, _b;
5829
- var errorReason = (_a = e.reason) !== null && _a !== void 0 ? _a : e.error;
5830
- // If stack is at 'eval', it is a logic rule error.
5831
- // Note this only works for unhandledrejection events, not error events.
5832
- console.warn('Error caught in custom HTML. Error Message: ', (_b = errorReason.message) !== null && _b !== void 0 ? _b : '');
5833
- e.stopPropagation();
5834
- e.preventDefault(); // Prevent the error in the log
5835
- };
5836
- var setCustomErrorHandler = function () {
5837
- featheryWindow().addEventListener('error', handleCustomScriptError);
5838
- };
5839
- var removeCustomErrorHandler = function () {
5840
- featheryWindow().removeEventListener('error', handleCustomScriptError);
5841
- };
5842
-
5843
5783
  function encodeGetParams(params) {
5844
5784
  return (Object.entries(params)
5845
5785
  // @ts-expect-error TS(2345): Argument of type '(uriComponent: string | number |... Remove this comment to see the full error message
@@ -5900,6 +5840,507 @@ function numMatchingItems(arr1, arr2) {
5900
5840
  return i;
5901
5841
  }
5902
5842
 
5843
+ var dist$2 = {};
5844
+
5845
+ var api$1 = {};
5846
+
5847
+ var utils = {};
5848
+
5849
+ var error = {};
5850
+
5851
+ var hasRequiredError;
5852
+
5853
+ function requireError () {
5854
+ if (hasRequiredError) return error;
5855
+ hasRequiredError = 1;
5856
+ Object.defineProperty(error, "__esModule", { value: true });
5857
+ error.ValidationError = error.FetchError = void 0;
5858
+ error.parseAPIError = parseAPIError;
5859
+ class FetchError extends Error {
5860
+ constructor(message, payload = null) {
5861
+ super(message);
5862
+ this.name = 'FetchError';
5863
+ this.payload = payload;
5864
+ }
5865
+ }
5866
+ error.FetchError = FetchError;
5867
+ class ValidationError extends Error {
5868
+ constructor(message) {
5869
+ super(message);
5870
+ this.name = 'ValidationError';
5871
+ }
5872
+ }
5873
+ error.ValidationError = ValidationError;
5874
+ function parseAPIError(err) {
5875
+ if (Array.isArray(err) && err.length) {
5876
+ const payloadError = err[0];
5877
+ if (typeof payloadError === 'object' && 'message' in payloadError) {
5878
+ return payloadError.message;
5879
+ }
5880
+ else
5881
+ return 'Invalid';
5882
+ }
5883
+ else if (err.message || err.error)
5884
+ return err.message || err.error;
5885
+ else
5886
+ return err.toString();
5887
+ }
5888
+ return error;
5889
+ }
5890
+
5891
+ var setup = {};
5892
+
5893
+ var hasRequiredSetup;
5894
+
5895
+ function requireSetup () {
5896
+ if (hasRequiredSetup) return setup;
5897
+ hasRequiredSetup = 1;
5898
+ Object.defineProperty(setup, "__esModule", { value: true });
5899
+ setup.S3_URL_OPTIONS = setup.CDN_URL_OPTIONS = setup.STATIC_URL_OPTIONS = setup.API_URL_OPTIONS = void 0;
5900
+ setup.getEnvironment = getEnvironment;
5901
+ setup.setEnvironment = setEnvironment;
5902
+ setup.API_URL_OPTIONS = {
5903
+ local: 'http://localhost:8006/api/',
5904
+ docker: 'http://host.docker.internal:8006/api/',
5905
+ staging: 'https://staging.feathery.io/api/',
5906
+ production: 'https://api.feathery.io/api/',
5907
+ productionAU: 'https://api-au.feathery.io/api/',
5908
+ productionEU: 'https://api-eu.feathery.io/api/',
5909
+ productionCA: 'https://api-ca.feathery.io/api/',
5910
+ };
5911
+ setup.STATIC_URL_OPTIONS = {
5912
+ local: 'http://localhost:8006/api/',
5913
+ docker: 'http://host.docker.internal:8006/api/',
5914
+ staging: 'https://staging.feathery.io/api/',
5915
+ production: 'https://api-static-2.feathery.io/api/',
5916
+ productionAU: 'https://api-au.feathery.io/api/',
5917
+ productionEU: 'https://api-eu.feathery.io/api/',
5918
+ productionCA: 'https://api-ca.feathery.io/api/',
5919
+ };
5920
+ setup.CDN_URL_OPTIONS = {
5921
+ local: 'http://localhost:8006/api/',
5922
+ docker: 'http://host.docker.internal:8006/api/',
5923
+ staging: 'https://staging.feathery.io/api/',
5924
+ production: 'https://cdn.feathery.io/api/',
5925
+ productionAU: 'https://cdn-au.feathery.io/api/',
5926
+ productionEU: 'https://cdn-eu.feathery.io/api/',
5927
+ productionCA: 'https://cdn-ca.feathery.io/api/',
5928
+ };
5929
+ setup.S3_URL_OPTIONS = {
5930
+ local: 'http://localhost:8006',
5931
+ docker: 'http://host.docker.internal:8006',
5932
+ staging: 's3.us-west-1.amazonaws.com',
5933
+ production: 's3.us-west-1.amazonaws.com',
5934
+ productionAU: 's3.ap-southeast-2.amazonaws.com',
5935
+ productionEU: 's3.eu-west-1.amazonaws.com',
5936
+ productionCA: 's3.ca-central-1.amazonaws.com',
5937
+ };
5938
+ let configuredEnvironment;
5939
+ let isClientSide = true;
5940
+ let internalSecretKey = null;
5941
+ function getEnvironment() {
5942
+ if (!configuredEnvironment)
5943
+ throw new Error('Environment not set');
5944
+ return { configuredEnvironment, isClientSide, internalSecretKey };
5945
+ }
5946
+ /**
5947
+ * Set the environment for the SDK.
5948
+ * @param environment - The environment to set (local, staging, production, etc.).
5949
+ * @param clientSide - Whether the SDK is running in the browser or server side.
5950
+ * @param secretKey - The secret key to use for the SDK.
5951
+ */
5952
+ function setEnvironment(environment, clientSide = true, secretKey = null) {
5953
+ configuredEnvironment = environment;
5954
+ isClientSide = clientSide;
5955
+ internalSecretKey = secretKey;
5956
+ }
5957
+ return setup;
5958
+ }
5959
+
5960
+ var hasRequiredUtils;
5961
+
5962
+ function requireUtils () {
5963
+ if (hasRequiredUtils) return utils;
5964
+ hasRequiredUtils = 1;
5965
+ Object.defineProperty(utils, "__esModule", { value: true });
5966
+ utils.getApiUrl = getApiUrl;
5967
+ utils.getStaticUrl = getStaticUrl;
5968
+ utils.getCdnUrl = getCdnUrl;
5969
+ utils.getS3Url = getS3Url;
5970
+ utils.checkResponseSuccess = checkResponseSuccess;
5971
+ utils.apiFetch = apiFetch;
5972
+ utils.createHttpHelpers = createHttpHelpers;
5973
+ const api_1 = requireApi();
5974
+ const error_1 = requireError();
5975
+ const setup_1 = requireSetup();
5976
+ function getApiUrl() {
5977
+ const { configuredEnvironment, isClientSide } = (0, setup_1.getEnvironment)();
5978
+ if (configuredEnvironment === 'local' && !isClientSide)
5979
+ return setup_1.API_URL_OPTIONS.docker;
5980
+ return setup_1.API_URL_OPTIONS[configuredEnvironment];
5981
+ }
5982
+ function getStaticUrl() {
5983
+ const { configuredEnvironment, isClientSide } = (0, setup_1.getEnvironment)();
5984
+ if (configuredEnvironment === 'local' && !isClientSide)
5985
+ return setup_1.STATIC_URL_OPTIONS.docker;
5986
+ return setup_1.STATIC_URL_OPTIONS[configuredEnvironment];
5987
+ }
5988
+ function getCdnUrl() {
5989
+ const { configuredEnvironment, isClientSide } = (0, setup_1.getEnvironment)();
5990
+ if (configuredEnvironment === 'local' && !isClientSide)
5991
+ return setup_1.CDN_URL_OPTIONS.docker;
5992
+ return setup_1.CDN_URL_OPTIONS[configuredEnvironment];
5993
+ }
5994
+ function getS3Url() {
5995
+ const { configuredEnvironment, isClientSide } = (0, setup_1.getEnvironment)();
5996
+ if (configuredEnvironment === 'local' && !isClientSide)
5997
+ return setup_1.S3_URL_OPTIONS.docker;
5998
+ return setup_1.S3_URL_OPTIONS[configuredEnvironment];
5999
+ }
6000
+ async function checkResponseSuccess(response) {
6001
+ let payload;
6002
+ switch (response.status) {
6003
+ case 200:
6004
+ case 201:
6005
+ case 202:
6006
+ return;
6007
+ case 400:
6008
+ payload = JSON.stringify(await response.clone().text());
6009
+ throw new error_1.FetchError(payload.toString());
6010
+ case 404:
6011
+ throw new error_1.FetchError("Can't find object");
6012
+ case 500:
6013
+ throw new error_1.FetchError('Internal server error');
6014
+ default:
6015
+ throw new error_1.FetchError('Unknown error');
6016
+ }
6017
+ }
6018
+ async function apiFetch(sdkKey, url, options, parseResponse = true) {
6019
+ options = options ?? {};
6020
+ const { headers, ...otherOptions } = options;
6021
+ options = {
6022
+ cache: 'no-store',
6023
+ // write requests must succeed so data is tracked
6024
+ keepalive: ['POST', 'PATCH', 'PUT'].includes(options.method),
6025
+ headers: {
6026
+ Authorization: 'Token ' + sdkKey,
6027
+ ...headers,
6028
+ },
6029
+ ...otherOptions,
6030
+ };
6031
+ const { internalSecretKey } = (0, setup_1.getEnvironment)();
6032
+ if (internalSecretKey)
6033
+ options.headers['X-Lambda-Secret'] = internalSecretKey;
6034
+ return fetch(url, options).then(async (response) => {
6035
+ if (parseResponse)
6036
+ await checkResponseSuccess(response);
6037
+ return response;
6038
+ });
6039
+ }
6040
+ function createHttpHelpers(sdkKey, formId, userId, fieldValues, updateFieldData, offlineHandler) {
6041
+ const helpers = {};
6042
+ ['get', 'patch', 'post', 'put', 'delete'].forEach((method) => (helpers[method] = async (url, data, headers) => {
6043
+ if (!url)
6044
+ return {};
6045
+ const response = await (0, api_1.runCustomRequest)(sdkKey, formId, { method: method.toUpperCase(), url, data, headers }, userId, fieldValues, offlineHandler);
6046
+ if (!response)
6047
+ return {};
6048
+ if (response.field_values && updateFieldData) {
6049
+ updateFieldData(response.field_values);
6050
+ }
6051
+ return {
6052
+ data: response.data,
6053
+ statusCode: response.status_code,
6054
+ // status_code for backwards compatibility
6055
+ status_code: response.statusCode,
6056
+ };
6057
+ }));
6058
+ helpers.connect = async (name, data, headers) => {
6059
+ if (!name)
6060
+ return {};
6061
+ const response = await (0, api_1.runCustomRequest)(sdkKey, formId, { name, data, headers }, userId, fieldValues, offlineHandler);
6062
+ if (!response)
6063
+ return {};
6064
+ if (response.field_values && updateFieldData) {
6065
+ updateFieldData(response.field_values);
6066
+ }
6067
+ return {
6068
+ data: response.data,
6069
+ statusCode: response.status_code,
6070
+ };
6071
+ };
6072
+ return helpers;
6073
+ }
6074
+ return utils;
6075
+ }
6076
+
6077
+ var hasRequiredApi;
6078
+
6079
+ function requireApi () {
6080
+ if (hasRequiredApi) return api$1;
6081
+ hasRequiredApi = 1;
6082
+ Object.defineProperty(api$1, "__esModule", { value: true });
6083
+ api$1.customRolloutAction = customRolloutAction;
6084
+ api$1.extractAIDocument = extractAIDocument;
6085
+ api$1.pollForCompletion = pollForCompletion;
6086
+ api$1.inviteFormCollaborator = inviteFormCollaborator;
6087
+ api$1.sendEmail = sendEmail;
6088
+ api$1.forwardInboxEmail = forwardInboxEmail;
6089
+ api$1.runCustomRequest = runCustomRequest;
6090
+ const utils_1 = requireUtils();
6091
+ const error_1 = requireError();
6092
+ async function customRolloutAction(sdkKey, automationIds, formId, fieldData, options, userId) {
6093
+ const url = `${(0, utils_1.getApiUrl)()}rollout/custom-trigger/`;
6094
+ if (typeof automationIds === 'string')
6095
+ automationIds = [automationIds];
6096
+ const reqOptions = {
6097
+ headers: { 'Content-Type': 'application/json' },
6098
+ method: 'POST',
6099
+ body: JSON.stringify({
6100
+ automation_ids: automationIds,
6101
+ sync: options.waitForCompletion ?? true,
6102
+ multiple: options.multiple ?? false,
6103
+ payload: fieldData,
6104
+ form_key: formId,
6105
+ fuser_key: userId,
6106
+ }),
6107
+ };
6108
+ const res = await (0, utils_1.apiFetch)(sdkKey, url, reqOptions, false);
6109
+ if (res && res.status === 200)
6110
+ return { ok: true, payload: await res.json() };
6111
+ else
6112
+ return { ok: false, error: (await res?.text()) ?? '' };
6113
+ }
6114
+ async function extractAIDocument(sdkKey, extractionId, options, userId, pages, triggerExtractionRunId, collaboratorId, onMeetingInfo, onStatusUpdate) {
6115
+ let runAsync;
6116
+ let variantId;
6117
+ let meetingUrl;
6118
+ if (typeof options === 'object') {
6119
+ runAsync = !options.waitForCompletion;
6120
+ pages = options.pages;
6121
+ variantId = options.variantId;
6122
+ meetingUrl = options.meetingUrl;
6123
+ }
6124
+ else {
6125
+ // deprecated usage, options is runAsync
6126
+ runAsync = options;
6127
+ }
6128
+ const data = {
6129
+ fuser_key: userId,
6130
+ extraction_id: extractionId,
6131
+ extraction_variant_id: variantId,
6132
+ trigger_extraction_run_id: triggerExtractionRunId,
6133
+ pages,
6134
+ meeting_url: meetingUrl,
6135
+ collaborator_user: collaboratorId,
6136
+ };
6137
+ const res = await (0, utils_1.apiFetch)(sdkKey, `${(0, utils_1.getStaticUrl)()}ai/vision/`, {
6138
+ headers: { 'Content-Type': 'application/json' },
6139
+ method: 'POST',
6140
+ body: JSON.stringify(data),
6141
+ });
6142
+ if (runAsync)
6143
+ return {};
6144
+ const response = await res?.json();
6145
+ if (response?.meeting_info) {
6146
+ onMeetingInfo?.();
6147
+ return {};
6148
+ }
6149
+ const pollUrl = `${(0, utils_1.getStaticUrl)()}ai/vision/completion/?fid=${userId}&eid=${extractionId}&evid=${variantId ?? ''}`;
6150
+ const CHECK_INTERVAL = 2000;
6151
+ const MAX_TIME = 3 * 60 * 1000;
6152
+ return await pollForCompletion(sdkKey, pollUrl, CHECK_INTERVAL, MAX_TIME, 'Extraction', onStatusUpdate);
6153
+ }
6154
+ async function pollForCompletion(sdkKey, pollUrl, checkInterval, maxTime, operationName = 'Operation', onStatusUpdate) {
6155
+ return new Promise((resolve) => {
6156
+ let attempts = 0;
6157
+ const maxAttempts = maxTime / checkInterval;
6158
+ const checkCompletion = async () => {
6159
+ const response = await (0, utils_1.apiFetch)(sdkKey, pollUrl, { method: 'GET' }, false);
6160
+ if (!response)
6161
+ return;
6162
+ const data = await response.json();
6163
+ if (onStatusUpdate) {
6164
+ onStatusUpdate(data);
6165
+ }
6166
+ if (response.ok) {
6167
+ if (data.status === 'complete') {
6168
+ return resolve(data);
6169
+ }
6170
+ else {
6171
+ attempts += 1;
6172
+ if (attempts < maxAttempts) {
6173
+ setTimeout(checkCompletion, checkInterval);
6174
+ }
6175
+ else {
6176
+ const message = `${operationName} took too long...`;
6177
+ console.error(message);
6178
+ return resolve({ status: 'error', message });
6179
+ }
6180
+ }
6181
+ }
6182
+ else {
6183
+ const message = (0, error_1.parseAPIError)(data);
6184
+ console.error(message);
6185
+ if (onStatusUpdate) {
6186
+ onStatusUpdate({ error: message });
6187
+ }
6188
+ return resolve({ status: 'error', message });
6189
+ }
6190
+ };
6191
+ // check every few seconds for a response
6192
+ setTimeout(checkCompletion, checkInterval);
6193
+ });
6194
+ }
6195
+ async function inviteFormCollaborator(sdkKey, formId, templateId, usersGroups, userId, collaboratorId) {
6196
+ const data = {
6197
+ form_key: formId,
6198
+ fuser_key: userId,
6199
+ users_groups: usersGroups,
6200
+ template_id: templateId,
6201
+ collaborator_user: collaboratorId,
6202
+ };
6203
+ return (0, utils_1.apiFetch)(sdkKey, `${(0, utils_1.getApiUrl)()}collaborator/invite/`, {
6204
+ headers: { 'Content-Type': 'application/json' },
6205
+ method: 'POST',
6206
+ body: JSON.stringify(data),
6207
+ }, false).then(async (response) => {
6208
+ if (response) {
6209
+ if (response && response.status === 201)
6210
+ return { ok: true, payload: await response.json() };
6211
+ else
6212
+ return { ok: false, error: (await response?.text()) ?? '' };
6213
+ }
6214
+ });
6215
+ }
6216
+ async function sendEmail(sdkKey, userId, formId, templateId, skipPfd = false) {
6217
+ const url = `${(0, utils_1.getApiUrl)()}email/logic-rule/`;
6218
+ const options = {
6219
+ headers: { 'Content-Type': 'application/json' },
6220
+ method: 'POST',
6221
+ body: JSON.stringify({
6222
+ template_id: templateId,
6223
+ form_key: formId,
6224
+ fuser_key: userId,
6225
+ skip_pfd: skipPfd,
6226
+ }),
6227
+ };
6228
+ return await (0, utils_1.apiFetch)(sdkKey, url, options, false);
6229
+ }
6230
+ async function forwardInboxEmail(sdkKey, userId, emailGroup, extractionRunId, emailMessageId, allGroups) {
6231
+ const recipients = allGroups?.find((group) => group.name === emailGroup)?.emails ?? [];
6232
+ const url = `${(0, utils_1.getApiUrl)()}email/forward/`;
6233
+ if (recipients.length === 0) {
6234
+ throw new error_1.ValidationError(`No recipients found for email group: ${emailGroup}`);
6235
+ }
6236
+ const options = {
6237
+ headers: { 'Content-Type': 'application/json' },
6238
+ method: 'POST',
6239
+ body: JSON.stringify({
6240
+ email_message_id: emailMessageId,
6241
+ recipients,
6242
+ extraction_run_id: extractionRunId,
6243
+ user_id: userId,
6244
+ email_group: emailGroup,
6245
+ }),
6246
+ };
6247
+ await (0, utils_1.apiFetch)(sdkKey, url, options);
6248
+ }
6249
+ function runCustomRequest(sdkKey, formId, payload, userId, fieldValues, offlineHandler) {
6250
+ const data = {
6251
+ fuser_key: userId,
6252
+ form_key: formId,
6253
+ name: payload.name,
6254
+ method: payload.method,
6255
+ url: payload.url,
6256
+ user_data: payload.data,
6257
+ headers: payload.headers,
6258
+ field_values: fieldValues,
6259
+ };
6260
+ const url = `${(0, utils_1.getStaticUrl)()}custom_request/`;
6261
+ const options = {
6262
+ headers: { 'Content-Type': 'application/json' },
6263
+ method: 'POST',
6264
+ body: JSON.stringify(data),
6265
+ keepalive: false,
6266
+ };
6267
+ const run = () => (0, utils_1.apiFetch)(sdkKey, url, options).then((response) => (response ? response.json() : Promise.resolve()));
6268
+ if (payload.method === 'GET' || !offlineHandler)
6269
+ return run();
6270
+ return offlineHandler(run, url, options, 'customRequest');
6271
+ }
6272
+ return api$1;
6273
+ }
6274
+
6275
+ var hasRequiredDist$2;
6276
+
6277
+ function requireDist$2 () {
6278
+ if (hasRequiredDist$2) return dist$2;
6279
+ hasRequiredDist$2 = 1;
6280
+ (function (exports$1) {
6281
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6282
+ exports$1.setEnvironment = exports$1.parseAPIError = exports$1.FetchError = exports$1.getS3Url = exports$1.getCdnUrl = exports$1.getStaticUrl = exports$1.getApiUrl = exports$1.createHttpHelpers = exports$1.checkResponseSuccess = exports$1.apiFetch = exports$1.sendEmail = exports$1.pollForCompletion = exports$1.inviteFormCollaborator = exports$1.forwardInboxEmail = exports$1.extractAIDocument = exports$1.customRolloutAction = void 0;
6283
+ var api_1 = requireApi();
6284
+ Object.defineProperty(exports$1, "customRolloutAction", { enumerable: true, get: function () { return api_1.customRolloutAction; } });
6285
+ Object.defineProperty(exports$1, "extractAIDocument", { enumerable: true, get: function () { return api_1.extractAIDocument; } });
6286
+ Object.defineProperty(exports$1, "forwardInboxEmail", { enumerable: true, get: function () { return api_1.forwardInboxEmail; } });
6287
+ Object.defineProperty(exports$1, "inviteFormCollaborator", { enumerable: true, get: function () { return api_1.inviteFormCollaborator; } });
6288
+ Object.defineProperty(exports$1, "pollForCompletion", { enumerable: true, get: function () { return api_1.pollForCompletion; } });
6289
+ Object.defineProperty(exports$1, "sendEmail", { enumerable: true, get: function () { return api_1.sendEmail; } });
6290
+ var utils_1 = requireUtils();
6291
+ Object.defineProperty(exports$1, "apiFetch", { enumerable: true, get: function () { return utils_1.apiFetch; } });
6292
+ Object.defineProperty(exports$1, "checkResponseSuccess", { enumerable: true, get: function () { return utils_1.checkResponseSuccess; } });
6293
+ Object.defineProperty(exports$1, "createHttpHelpers", { enumerable: true, get: function () { return utils_1.createHttpHelpers; } });
6294
+ Object.defineProperty(exports$1, "getApiUrl", { enumerable: true, get: function () { return utils_1.getApiUrl; } });
6295
+ Object.defineProperty(exports$1, "getStaticUrl", { enumerable: true, get: function () { return utils_1.getStaticUrl; } });
6296
+ Object.defineProperty(exports$1, "getCdnUrl", { enumerable: true, get: function () { return utils_1.getCdnUrl; } });
6297
+ Object.defineProperty(exports$1, "getS3Url", { enumerable: true, get: function () { return utils_1.getS3Url; } });
6298
+ var error_1 = requireError();
6299
+ Object.defineProperty(exports$1, "FetchError", { enumerable: true, get: function () { return error_1.FetchError; } });
6300
+ Object.defineProperty(exports$1, "parseAPIError", { enumerable: true, get: function () { return error_1.parseAPIError; } });
6301
+ var setup_1 = requireSetup();
6302
+ Object.defineProperty(exports$1, "setEnvironment", { enumerable: true, get: function () { return setup_1.setEnvironment; } });
6303
+ } (dist$2));
6304
+ return dist$2;
6305
+ }
6306
+
6307
+ var distExports$2 = requireDist$2();
6308
+
6309
+ var SDKKeyError = /** @class */ (function (_super) {
6310
+ __extends(SDKKeyError, _super);
6311
+ function SDKKeyError(message) {
6312
+ if (message === void 0) { message = 'Invalid SDK Key'; }
6313
+ var _this = _super.call(this, message) || this;
6314
+ _this.name = 'SDKKeyError';
6315
+ return _this;
6316
+ }
6317
+ return SDKKeyError;
6318
+ }(Error));
6319
+ var UserIdError = /** @class */ (function (_super) {
6320
+ __extends(UserIdError, _super);
6321
+ function UserIdError() {
6322
+ var _this = _super.call(this, 'Invalid User ID') || this;
6323
+ _this.name = 'UserIdError';
6324
+ return _this;
6325
+ }
6326
+ return UserIdError;
6327
+ }(Error));
6328
+ var handleCustomScriptError = function (e) {
6329
+ var _a, _b;
6330
+ var errorReason = (_a = e.reason) !== null && _a !== void 0 ? _a : e.error;
6331
+ // If stack is at 'eval', it is a logic rule error.
6332
+ // Note this only works for unhandledrejection events, not error events.
6333
+ console.warn('Error caught in custom HTML. Error Message: ', (_b = errorReason.message) !== null && _b !== void 0 ? _b : '');
6334
+ e.stopPropagation();
6335
+ e.preventDefault(); // Prevent the error in the log
6336
+ };
6337
+ var setCustomErrorHandler = function () {
6338
+ featheryWindow().addEventListener('error', handleCustomScriptError);
6339
+ };
6340
+ var removeCustomErrorHandler = function () {
6341
+ featheryWindow().removeEventListener('error', handleCustomScriptError);
6342
+ };
6343
+
5903
6344
  var conflictAlertShown = false;
5904
6345
  function checkResponseSuccess(response) {
5905
6346
  return __awaiter$2(this, void 0, void 0, function () {
@@ -5928,7 +6369,7 @@ function checkResponseSuccess(response) {
5928
6369
  console.error(payload.toString());
5929
6370
  return [2 /*return*/];
5930
6371
  case 4: throw new SDKKeyError();
5931
- case 5: throw new FetchError("Can't find object");
6372
+ case 5: throw new distExports$2.FetchError("Can't find object");
5932
6373
  case 6:
5933
6374
  // prevent multiple 409s from displaying multiple alerts
5934
6375
  if (conflictAlertShown)
@@ -5939,8 +6380,8 @@ function checkResponseSuccess(response) {
5939
6380
  featheryWindow().alert('This form has been updated. Please fill it out again.');
5940
6381
  location.reload();
5941
6382
  return [2 /*return*/];
5942
- case 7: throw new FetchError('Internal server error');
5943
- case 8: throw new FetchError('Unknown error');
6383
+ case 7: throw new distExports$2.FetchError('Internal server error');
6384
+ case 8: throw new distExports$2.FetchError('Unknown error');
5944
6385
  }
5945
6386
  });
5946
6387
  });
@@ -6891,26 +7332,7 @@ var IntegrationClient = /** @class */ (function () {
6891
7332
  if (parseResponse === void 0) { parseResponse = true; }
6892
7333
  if (propagateNetworkErrors === void 0) { propagateNetworkErrors = false; }
6893
7334
  var sdkKey = initInfo().sdkKey;
6894
- options = options !== null && options !== void 0 ? options : {};
6895
- var headers = options.headers, otherOptions = __rest$1(options, ["headers"]);
6896
- options = exports.__assign({ cache: 'no-store',
6897
- // Write requests must succeed so data is tracked
6898
- keepalive: ['POST', 'PATCH', 'PUT'].includes(options.method), headers: exports.__assign({ Authorization: 'Token ' + sdkKey }, headers) }, otherOptions);
6899
- return fetch(url, options)
6900
- .then(function (response) { return __awaiter$2(_this, void 0, void 0, function () {
6901
- return __generator(this, function (_a) {
6902
- switch (_a.label) {
6903
- case 0:
6904
- if (!parseResponse) return [3 /*break*/, 2];
6905
- return [4 /*yield*/, checkResponseSuccess(response)];
6906
- case 1:
6907
- _a.sent();
6908
- _a.label = 2;
6909
- case 2: return [2 /*return*/, response];
6910
- }
6911
- });
6912
- }); })
6913
- .catch(function (e) {
7335
+ return distExports$2.apiFetch(sdkKey, url, options, parseResponse).catch(function (e) {
6914
7336
  var _a;
6915
7337
  // Ignore TypeErrors if form has redirected because `fetch` in
6916
7338
  // Safari will error after redirect
@@ -6941,7 +7363,7 @@ var IntegrationClient = /** @class */ (function () {
6941
7363
  payload = _a.sent();
6942
7364
  if ((res === null || res === void 0 ? void 0 : res.status) === 200)
6943
7365
  return [2 /*return*/, { token: payload.link_token }];
6944
- return [2 /*return*/, { err: parseError(payload) || 'Ran into an error' }];
7366
+ return [2 /*return*/, { err: distExports$2.parseAPIError(payload) || 'Ran into an error' }];
6945
7367
  }
6946
7368
  });
6947
7369
  });
@@ -7215,7 +7637,7 @@ var IntegrationClient = /** @class */ (function () {
7215
7637
  case 1: return [2 /*return*/, _c.sent()];
7216
7638
  case 2:
7217
7639
  _a = Error;
7218
- _b = parseError;
7640
+ _b = distExports$2.parseAPIError;
7219
7641
  return [4 /*yield*/, response.json()];
7220
7642
  case 3: throw _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
7221
7643
  case 4: return [2 /*return*/];
@@ -7254,7 +7676,7 @@ var IntegrationClient = /** @class */ (function () {
7254
7676
  case 1: return [2 /*return*/, _c.sent()];
7255
7677
  case 2:
7256
7678
  _a = Error;
7257
- _b = parseError;
7679
+ _b = distExports$2.parseAPIError;
7258
7680
  return [4 /*yield*/, response.json()];
7259
7681
  case 3: throw _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
7260
7682
  case 4: return [2 /*return*/];
@@ -7292,7 +7714,7 @@ var IntegrationClient = /** @class */ (function () {
7292
7714
  case 1: return [2 /*return*/, _c.sent()];
7293
7715
  case 2:
7294
7716
  _a = Error;
7295
- _b = parseError;
7717
+ _b = distExports$2.parseAPIError;
7296
7718
  return [4 /*yield*/, response.json()];
7297
7719
  case 3: throw _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
7298
7720
  case 4: return [2 /*return*/];
@@ -7302,66 +7724,10 @@ var IntegrationClient = /** @class */ (function () {
7302
7724
  });
7303
7725
  });
7304
7726
  };
7305
- IntegrationClient.prototype.pollForCompletion = function (_a) {
7306
- var pollUrl = _a.pollUrl, checkInterval = _a.checkInterval, maxTime = _a.maxTime, onStatusUpdate = _a.onStatusUpdate, _b = _a.operationName, operationName = _b === void 0 ? 'Operation' : _b;
7307
- return __awaiter$2(this, void 0, void 0, function () {
7308
- var _this = this;
7309
- return __generator(this, function (_c) {
7310
- return [2 /*return*/, new Promise(function (resolve) {
7311
- var attempts = 0;
7312
- var maxAttempts = maxTime / checkInterval;
7313
- var checkCompletion = function () { return __awaiter$2(_this, void 0, void 0, function () {
7314
- var response, data, message, message;
7315
- return __generator(this, function (_a) {
7316
- switch (_a.label) {
7317
- case 0: return [4 /*yield*/, this._fetch(pollUrl, {}, false)];
7318
- case 1:
7319
- response = _a.sent();
7320
- if (!response)
7321
- return [2 /*return*/];
7322
- return [4 /*yield*/, response.json()];
7323
- case 2:
7324
- data = _a.sent();
7325
- if (onStatusUpdate) {
7326
- onStatusUpdate(data);
7327
- }
7328
- if (response.ok) {
7329
- if (data.status === 'complete') {
7330
- return [2 /*return*/, resolve(data)];
7331
- }
7332
- else {
7333
- attempts += 1;
7334
- if (attempts < maxAttempts) {
7335
- setTimeout(checkCompletion, checkInterval);
7336
- }
7337
- else {
7338
- message = "".concat(operationName, " took too long...");
7339
- console.error(message);
7340
- return [2 /*return*/, resolve({ status: 'error', message: message })];
7341
- }
7342
- }
7343
- }
7344
- else {
7345
- message = parseError(data);
7346
- console.error(message);
7347
- if (onStatusUpdate) {
7348
- onStatusUpdate({ error: message });
7349
- }
7350
- return [2 /*return*/, resolve({ status: 'error', message: message })];
7351
- }
7352
- return [2 /*return*/];
7353
- }
7354
- });
7355
- }); };
7356
- setTimeout(checkCompletion, checkInterval);
7357
- })];
7358
- });
7359
- });
7360
- };
7361
7727
  IntegrationClient.prototype.generateEnvelopes = function (action) {
7362
7728
  var _this = this;
7363
7729
  var _a, _b, _c;
7364
- var userId = initInfo().userId;
7730
+ var _d = initInfo(), userId = _d.userId, sdkKey = _d.sdkKey;
7365
7731
  var signer = exports.fieldValues[action.envelope_signer_field_key];
7366
7732
  var runAsync = (_a = action.run_async) !== null && _a !== void 0 ? _a : true;
7367
7733
  var documents = (_b = action.documents) !== null && _b !== void 0 ? _b : [];
@@ -7392,14 +7758,9 @@ var IntegrationClient = /** @class */ (function () {
7392
7758
  if (!runAsync || data.files)
7393
7759
  return [2 /*return*/, data];
7394
7760
  pollUrl = "".concat(API_URL, "document/form/generate/poll/?fid=").concat(userId, "&dids=").concat(documents);
7395
- return [4 /*yield*/, this.pollForCompletion({
7396
- pollUrl: pollUrl,
7397
- checkInterval: this.ENVELOPE_CHECK_INTERVAL,
7398
- maxTime: this.ENVELOPE_MAX_TIME,
7399
- operationName: 'Envelope generation'
7400
- })];
7761
+ return [4 /*yield*/, distExports$2.pollForCompletion(sdkKey, pollUrl, this.ENVELOPE_CHECK_INTERVAL, this.ENVELOPE_MAX_TIME, 'Envelope generation')];
7401
7762
  case 2: return [2 /*return*/, _a.sent()];
7402
- case 3: throw Error(parseError(data));
7763
+ case 3: throw Error(distExports$2.parseAPIError(data));
7403
7764
  case 4: return [2 /*return*/];
7404
7765
  }
7405
7766
  });
@@ -7443,7 +7804,7 @@ var IntegrationClient = /** @class */ (function () {
7443
7804
  case 1: return [2 /*return*/, _c.sent()];
7444
7805
  case 2:
7445
7806
  _a = Error;
7446
- _b = parseError;
7807
+ _b = distExports$2.parseAPIError;
7447
7808
  return [4 /*yield*/, response.json()];
7448
7809
  case 3: throw _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
7449
7810
  case 4: return [2 /*return*/];
@@ -7465,7 +7826,7 @@ var IntegrationClient = /** @class */ (function () {
7465
7826
  if (!((response === null || response === void 0 ? void 0 : response.status) === 400)) return [3 /*break*/, 3];
7466
7827
  _a = resolve;
7467
7828
  _c = {};
7468
- _b = parseError;
7829
+ _b = distExports$2.parseAPIError;
7469
7830
  return [4 /*yield*/, response.json()];
7470
7831
  case 2: return [2 /*return*/, _a.apply(void 0, [(_c.error = _b.apply(void 0, [_d.sent()]), _c)])];
7471
7832
  case 3:
@@ -7547,7 +7908,7 @@ var IntegrationClient = /** @class */ (function () {
7547
7908
  return [4 /*yield*/, response.json()];
7548
7909
  case 2:
7549
7910
  errorData = _a.sent();
7550
- return [2 /*return*/, resolve({ error: parseError(errorData) })];
7911
+ return [2 /*return*/, resolve({ error: distExports$2.parseAPIError(errorData) })];
7551
7912
  case 3:
7552
7913
  if (!((response === null || response === void 0 ? void 0 : response.status) === 200)) return [3 /*break*/, 5];
7553
7914
  return [4 /*yield*/, response.json()];
@@ -7642,7 +8003,7 @@ var IntegrationClient = /** @class */ (function () {
7642
8003
  return [2 /*return*/, finalStatus];
7643
8004
  case 6:
7644
8005
  _b = Error;
7645
- _c = parseError;
8006
+ _c = distExports$2.parseAPIError;
7646
8007
  return [4 /*yield*/, finalResponse.json()];
7647
8008
  case 7: throw _b.apply(void 0, [_c.apply(void 0, [_d.sent()])]);
7648
8009
  case 8: return [2 /*return*/, false];
@@ -7731,7 +8092,7 @@ var IntegrationClient = /** @class */ (function () {
7731
8092
  return [2 /*return*/, otpStatus];
7732
8093
  case 3:
7733
8094
  _a = Error;
7734
- _b = parseError;
8095
+ _b = distExports$2.parseAPIError;
7735
8096
  return [4 /*yield*/, response.json()];
7736
8097
  case 4: throw _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
7737
8098
  case 5: return [2 /*return*/];
@@ -7741,24 +8102,14 @@ var IntegrationClient = /** @class */ (function () {
7741
8102
  };
7742
8103
  IntegrationClient.prototype.sendEmail = function (templateId) {
7743
8104
  return __awaiter$2(this, void 0, void 0, function () {
7744
- var userId, url, options;
7745
- return __generator(this, function (_a) {
7746
- switch (_a.label) {
8105
+ var _a, userId, sdkKey;
8106
+ return __generator(this, function (_b) {
8107
+ switch (_b.label) {
7747
8108
  case 0:
7748
- userId = initInfo().userId;
7749
- url = "".concat(API_URL, "email/logic-rule/");
7750
- options = {
7751
- headers: { 'Content-Type': 'application/json' },
7752
- method: 'POST',
7753
- body: JSON.stringify({
7754
- template_id: templateId,
7755
- form_key: this.formKey,
7756
- fuser_key: userId
7757
- })
7758
- };
7759
- return [4 /*yield*/, this._fetch(url, options, false)];
8109
+ _a = initInfo(), userId = _a.userId, sdkKey = _a.sdkKey;
8110
+ return [4 /*yield*/, distExports$2.sendEmail(sdkKey, userId !== null && userId !== void 0 ? userId : '', this.formKey, templateId)];
7760
8111
  case 1:
7761
- _a.sent();
8112
+ _b.sent();
7762
8113
  return [2 /*return*/];
7763
8114
  }
7764
8115
  });
@@ -7900,43 +8251,16 @@ var IntegrationClient = /** @class */ (function () {
7900
8251
  });
7901
8252
  };
7902
8253
  IntegrationClient.prototype.customRolloutAction = function (automationIds, options) {
7903
- var _a, _b, _c;
7904
8254
  return __awaiter$2(this, void 0, void 0, function () {
7905
- var userId, url, reqOptions, res;
7906
- var _d, _e;
7907
- return __generator(this, function (_f) {
7908
- switch (_f.label) {
8255
+ var _a, userId, sdkKey;
8256
+ return __generator(this, function (_b) {
8257
+ switch (_b.label) {
7909
8258
  case 0:
7910
- userId = initInfo().userId;
7911
- url = "".concat(API_URL, "rollout/custom-trigger/");
7912
- if (typeof automationIds === 'string')
7913
- automationIds = [automationIds];
7914
- reqOptions = {
7915
- headers: { 'Content-Type': 'application/json' },
7916
- method: 'POST',
7917
- body: JSON.stringify({
7918
- automation_ids: automationIds,
7919
- sync: (_a = options.waitForCompletion) !== null && _a !== void 0 ? _a : true,
7920
- multiple: (_b = options.multiple) !== null && _b !== void 0 ? _b : false,
7921
- payload: exports.fieldValues,
7922
- form_key: this.formKey,
7923
- fuser_key: userId
7924
- })
7925
- };
8259
+ _a = initInfo(), userId = _a.userId, sdkKey = _a.sdkKey;
7926
8260
  return [4 /*yield*/, this.submitQueue];
7927
8261
  case 1:
7928
- _f.sent();
7929
- return [4 /*yield*/, this._fetch(url, reqOptions, false)];
7930
- case 2:
7931
- res = _f.sent();
7932
- if (!(res && res.status === 200)) return [3 /*break*/, 4];
7933
- _d = { ok: true };
7934
- return [4 /*yield*/, res.json()];
7935
- case 3: return [2 /*return*/, (_d.payload = _f.sent(), _d)];
7936
- case 4:
7937
- _e = { ok: false };
7938
- return [4 /*yield*/, (res === null || res === void 0 ? void 0 : res.text())];
7939
- case 5: return [2 /*return*/, (_e.error = (_c = (_f.sent())) !== null && _c !== void 0 ? _c : '', _e)];
8262
+ _b.sent();
8263
+ return [2 /*return*/, distExports$2.customRolloutAction(sdkKey, automationIds, this.formKey, exports.fieldValues, options, userId)];
7940
8264
  }
7941
8265
  });
7942
8266
  });
@@ -17052,10 +17376,9 @@ var BASE64_REGEX = /(data:image\/(png|jpg|jpeg);base64,)([0-9a-zA-Z+/]{4})*(([0-
17052
17376
  function getThumbnailType(file) {
17053
17377
  var thumbnailType = THUMBNAIL_TYPE.UNKNOWN;
17054
17378
  if (file) {
17055
- // TIFF images are not supported by most browsers' <img> tag,
17056
- // so treat them as unknown (display filename only)
17057
- // Covers: image/tiff, image/x-tiff, image/tif
17058
- if (/image\//.test(file.type) && !/image\/(?:x-)?tiff?/i.test(file.type)) {
17379
+ // Allow all image/*; unsupported ones (e.g., TIFF, HEIC off Safari)
17380
+ // will fall back via the <img> onError handler in FileUploadField
17381
+ if (/image\//.test(file.type)) {
17059
17382
  thumbnailType = THUMBNAIL_TYPE.IMAGE;
17060
17383
  }
17061
17384
  else if (/application\/pdf/.test(file.type)) {
@@ -42276,66 +42599,28 @@ function loadQRScanner() {
42276
42599
  exports.qrPromise = dynamicImport(QR_SCANNER_LIB_URL);
42277
42600
  }
42278
42601
 
42279
- var API_URL_OPTIONS = {
42280
- local: 'http://localhost:8006/api/',
42281
- staging: 'https://staging.feathery.io/api/',
42282
- production: 'https://api.feathery.io/api/',
42283
- productionAU: 'https://api-au.feathery.io/api/',
42284
- productionEU: 'https://api-eu.feathery.io/api/',
42285
- productionCA: 'https://api-ca.feathery.io/api/'
42286
- };
42287
- var CDN_URL_OPTIONS = {
42288
- local: 'http://localhost:8006/api/',
42289
- staging: 'https://staging.feathery.io/api/',
42290
- production: 'https://cdn.feathery.io/api/',
42291
- productionAU: 'https://cdn-au.feathery.io/api/',
42292
- productionEU: 'https://cdn-eu.feathery.io/api/',
42293
- productionCA: 'https://cdn-ca.feathery.io/api/'
42294
- };
42295
- var STATIC_URL_OPTIONS = {
42296
- local: 'http://localhost:8006/api/',
42297
- staging: 'https://staging.feathery.io/api/',
42298
- production: 'https://api-static-2.feathery.io/api/',
42299
- productionAU: 'https://api-au.feathery.io/api/',
42300
- productionEU: 'https://api-eu.feathery.io/api/',
42301
- productionCA: 'https://api-ca.feathery.io/api/'
42302
- };
42303
- var S3_URL_OPTIONS = {
42304
- local: 'http://localhost:8006',
42305
- staging: 's3.us-west-1.amazonaws.com',
42306
- production: 's3.us-west-1.amazonaws.com',
42307
- productionAU: 's3.ap-southeast-2.amazonaws.com',
42308
- productionEU: 's3.eu-west-1.amazonaws.com',
42309
- productionCA: 's3.ca-central-1.amazonaws.com'
42310
- };
42311
- var environment = 'production';
42602
+ distExports$2.setEnvironment('production');
42312
42603
  try {
42313
- environment = (process.env.BACKEND_ENV || 'production');
42604
+ distExports$2.setEnvironment((process.env.BACKEND_ENV || 'production'));
42314
42605
  }
42315
42606
  catch (e) { } // process.env won't exist in production build
42316
- var API_URL = API_URL_OPTIONS[environment];
42317
- var CDN_URL = CDN_URL_OPTIONS[environment];
42318
- var STATIC_URL = STATIC_URL_OPTIONS[environment];
42319
- var S3_URL = S3_URL_OPTIONS[environment];
42607
+ var API_URL = distExports$2.getApiUrl();
42608
+ var CDN_URL = distExports$2.getCdnUrl();
42609
+ var STATIC_URL = distExports$2.getStaticUrl();
42610
+ var S3_URL = distExports$2.getS3Url();
42320
42611
  var updateRegionApiUrls = function (region) {
42321
- if (region === 'au') {
42322
- CDN_URL = CDN_URL_OPTIONS.productionAU;
42323
- API_URL = API_URL_OPTIONS.productionAU;
42324
- STATIC_URL = STATIC_URL_OPTIONS.productionAU;
42325
- S3_URL = S3_URL_OPTIONS.productionAU;
42326
- }
42327
- else if (region === 'eu') {
42328
- CDN_URL = CDN_URL_OPTIONS.productionEU;
42329
- API_URL = API_URL_OPTIONS.productionEU;
42330
- STATIC_URL = STATIC_URL_OPTIONS.productionEU;
42331
- S3_URL = S3_URL_OPTIONS.productionEU;
42332
- }
42333
- else if (region === 'ca') {
42334
- CDN_URL = CDN_URL_OPTIONS.productionCA;
42335
- API_URL = API_URL_OPTIONS.productionCA;
42336
- STATIC_URL = STATIC_URL_OPTIONS.productionCA;
42337
- S3_URL = S3_URL_OPTIONS.productionCA;
42338
- }
42612
+ var environmentMap = {
42613
+ au: 'productionAU',
42614
+ ca: 'productionCA',
42615
+ eu: 'productionEU'
42616
+ };
42617
+ if (!environmentMap[region])
42618
+ return;
42619
+ distExports$2.setEnvironment(environmentMap[region]);
42620
+ API_URL = distExports$2.getApiUrl();
42621
+ CDN_URL = distExports$2.getCdnUrl();
42622
+ STATIC_URL = distExports$2.getStaticUrl();
42623
+ S3_URL = distExports$2.getS3Url();
42339
42624
  };
42340
42625
  /**
42341
42626
  * The number of milliseconds waited until another submitCustom call
@@ -43143,39 +43428,6 @@ var FeatheryClient = /** @class */ (function (_super) {
43143
43428
  });
43144
43429
  });
43145
43430
  };
43146
- // Logic custom APIs
43147
- FeatheryClient.prototype.runCustomRequest = function (payload, fieldValues) {
43148
- var _this = this;
43149
- if (fieldValues === void 0) { fieldValues = null; }
43150
- var userId = initInfo().userId;
43151
- var data = {
43152
- fuser_key: userId,
43153
- form_key: this.formKey,
43154
- name: payload.name,
43155
- method: payload.method,
43156
- url: payload.url,
43157
- user_data: payload.data,
43158
- headers: payload.headers
43159
- };
43160
- if (fieldValues) {
43161
- data.field_values = fieldValues;
43162
- }
43163
- var url = "".concat(STATIC_URL, "custom_request/");
43164
- var options = {
43165
- headers: { 'Content-Type': 'application/json' },
43166
- method: 'POST',
43167
- body: JSON.stringify(data),
43168
- keepalive: false
43169
- };
43170
- var run = function () {
43171
- return _this._fetch(url, options).then(function (response) {
43172
- return response ? response.json() : Promise.resolve();
43173
- });
43174
- };
43175
- if (payload.method === 'GET')
43176
- return run();
43177
- return this.offlineRequestHandler.runOrSaveRequest(run, url, options, 'customRequest');
43178
- };
43179
43431
  FeatheryClient.prototype.runServerSideLogicRule = function (id) {
43180
43432
  var userId = initInfo().userId;
43181
43433
  var data = {
@@ -43198,54 +43450,13 @@ var FeatheryClient = /** @class */ (function (_super) {
43198
43450
  FeatheryClient.prototype.runAIExtraction = function (_a) {
43199
43451
  var extractionId = _a.extractionId, options = _a.options, pages = _a.pages, setPollFuserData = _a.setPollFuserData, onStatusUpdate = _a.onStatusUpdate;
43200
43452
  return __awaiter$2(this, void 0, void 0, function () {
43201
- var runAsync, variantId, meetingUrl, _b, userId, collaboratorId, data, res, response, pollUrl;
43453
+ var _b, userId, sdkKey, collaboratorId;
43202
43454
  return __generator(this, function (_c) {
43203
43455
  switch (_c.label) {
43204
43456
  case 0:
43205
- if (typeof options === 'object') {
43206
- runAsync = !options.waitForCompletion;
43207
- pages = options.pages;
43208
- variantId = options.variantId;
43209
- meetingUrl = options.meetingUrl || undefined;
43210
- }
43211
- else {
43212
- // deprecated usage, options is waitForCompletion
43213
- runAsync = !options;
43214
- }
43215
- _b = initInfo(), userId = _b.userId, collaboratorId = _b.collaboratorId;
43216
- data = {
43217
- fuser_key: userId,
43218
- collaborator_user: collaboratorId,
43219
- extraction_id: extractionId,
43220
- extraction_variant_id: variantId,
43221
- pages: pages,
43222
- meeting_url: meetingUrl
43223
- };
43224
- return [4 /*yield*/, this._fetch("".concat(STATIC_URL, "ai/vision/"), {
43225
- headers: { 'Content-Type': 'application/json' },
43226
- method: 'POST',
43227
- body: JSON.stringify(data)
43228
- })];
43229
- case 1:
43230
- res = _c.sent();
43231
- return [4 /*yield*/, (res === null || res === void 0 ? void 0 : res.json())];
43232
- case 2:
43233
- response = _c.sent();
43234
- if (runAsync)
43235
- return [2 /*return*/, {}];
43236
- if (response.meeting_info) {
43237
- setPollFuserData(true);
43238
- return [2 /*return*/, {}];
43239
- }
43240
- pollUrl = "".concat(STATIC_URL, "ai/vision/completion/?fid=").concat(userId, "&eid=").concat(extractionId, "&evid=").concat(variantId !== null && variantId !== void 0 ? variantId : '');
43241
- return [4 /*yield*/, this.pollForCompletion({
43242
- pollUrl: pollUrl,
43243
- checkInterval: this.AI_CHECK_INTERVAL,
43244
- maxTime: this.AI_MAX_TIME,
43245
- onStatusUpdate: onStatusUpdate,
43246
- operationName: 'Extraction'
43247
- })];
43248
- case 3: return [2 /*return*/, _c.sent()];
43457
+ _b = initInfo(), userId = _b.userId, sdkKey = _b.sdkKey, collaboratorId = _b.collaboratorId;
43458
+ return [4 /*yield*/, distExports$2.extractAIDocument(sdkKey, extractionId, options, userId, pages, undefined, collaboratorId, function () { return setPollFuserData === null || setPollFuserData === void 0 ? void 0 : setPollFuserData(true); }, onStatusUpdate)];
43459
+ case 1: return [2 /*return*/, _c.sent()];
43249
43460
  }
43250
43461
  });
43251
43462
  });
@@ -43295,41 +43506,20 @@ var FeatheryClient = /** @class */ (function (_super) {
43295
43506
  };
43296
43507
  FeatheryClient.prototype.inviteCollaborator = function (usersGroups, templateId) {
43297
43508
  return __awaiter$2(this, void 0, void 0, function () {
43298
- var _a, userId, collaboratorId, data, url;
43299
- var _this = this;
43509
+ var _a, userId, collaboratorId, sdkKey, res;
43300
43510
  return __generator(this, function (_b) {
43301
- _a = initInfo(), userId = _a.userId, collaboratorId = _a.collaboratorId;
43302
- data = {
43303
- form_key: this.formKey,
43304
- fuser_key: userId,
43305
- users_groups: usersGroups,
43306
- template_id: templateId
43307
- };
43308
- if (collaboratorId)
43309
- data.collaborator_user = collaboratorId;
43310
- url = "".concat(API_URL, "collaborator/invite/");
43311
- return [2 /*return*/, this._fetch(url, {
43312
- headers: { 'Content-Type': 'application/json' },
43313
- method: 'POST',
43314
- body: JSON.stringify(data)
43315
- }, false).then(function (response) { return __awaiter$2(_this, void 0, void 0, function () {
43316
- var _a, _b;
43317
- return __generator(this, function (_c) {
43318
- switch (_c.label) {
43319
- case 0:
43320
- if (!response) return [3 /*break*/, 4];
43321
- if (!response.ok) return [3 /*break*/, 2];
43322
- return [4 /*yield*/, response.json()];
43323
- case 1: return [2 /*return*/, _c.sent()];
43324
- case 2:
43325
- _a = Error;
43326
- _b = parseError;
43327
- return [4 /*yield*/, response.json()];
43328
- case 3: throw _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
43329
- case 4: return [2 /*return*/];
43330
- }
43331
- });
43332
- }); })];
43511
+ switch (_b.label) {
43512
+ case 0:
43513
+ _a = initInfo(), userId = _a.userId, collaboratorId = _a.collaboratorId, sdkKey = _a.sdkKey;
43514
+ return [4 /*yield*/, distExports$2.inviteFormCollaborator(sdkKey, this.formKey, templateId, usersGroups, userId, collaboratorId)];
43515
+ case 1:
43516
+ res = _b.sent();
43517
+ if (res && res.ok) {
43518
+ return [2 /*return*/, res];
43519
+ }
43520
+ else
43521
+ throw Error(distExports$2.parseAPIError(res));
43522
+ }
43333
43523
  });
43334
43524
  });
43335
43525
  };
@@ -43363,7 +43553,7 @@ var FeatheryClient = /** @class */ (function (_super) {
43363
43553
  case 1: return [2 /*return*/, _c.sent()];
43364
43554
  case 2:
43365
43555
  _a = Error;
43366
- _b = parseError;
43556
+ _b = distExports$2.parseAPIError;
43367
43557
  return [4 /*yield*/, response.json()];
43368
43558
  case 3: throw _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
43369
43559
  case 4: return [2 /*return*/];
@@ -43400,7 +43590,7 @@ var FeatheryClient = /** @class */ (function (_super) {
43400
43590
  case 1: return [2 /*return*/, _c.sent()];
43401
43591
  case 2:
43402
43592
  _a = Error;
43403
- _b = parseError;
43593
+ _b = distExports$2.parseAPIError;
43404
43594
  return [4 /*yield*/, response.json()];
43405
43595
  case 3: throw _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
43406
43596
  case 4: return [2 /*return*/];
@@ -43446,7 +43636,7 @@ var FeatheryClient = /** @class */ (function (_super) {
43446
43636
  case 3: return [2 /*return*/, { files: files }];
43447
43637
  case 4:
43448
43638
  _a = Error;
43449
- _b = parseError;
43639
+ _b = distExports$2.parseAPIError;
43450
43640
  return [4 /*yield*/, response.json()];
43451
43641
  case 5: throw _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
43452
43642
  case 6: return [2 /*return*/];
@@ -43562,9 +43752,9 @@ function init(sdkKey, options) {
43562
43752
  if (runningInClient()) {
43563
43753
  // Dynamically load libraries that must be client side
43564
43754
  global.scriptjsLoadPromise = Promise.resolve().then(function () { return require(
43565
- /* webpackChunkName: "scriptjs" */ './fthry_script.6P1NJRwv.js'); }).then(function (n) { return n.script; });
43755
+ /* webpackChunkName: "scriptjs" */ './fthry_script.rT4Hk6hO.js'); }).then(function (n) { return n.script; });
43566
43756
  global.webfontloaderPromise = Promise.resolve().then(function () { return require(
43567
- /* webpackChunkName: "webfontloader" */ './fthry_webfontloader.z-pzQOVm.js'); }).then(function (n) { return n.webfontloader; });
43757
+ /* webpackChunkName: "webfontloader" */ './fthry_webfontloader.BpYY6eaS.js'); }).then(function (n) { return n.webfontloader; });
43568
43758
  // Client-side tracking logic
43569
43759
  if (initState.userTracking === 'cookie') {
43570
43760
  var cookieKey = "feathery-user-id-".concat(sdkKey);
@@ -43710,7 +43900,7 @@ function getFieldValues() {
43710
43900
  return exports.__assign({}, exports.fieldValues);
43711
43901
  }
43712
43902
  function logFeatheryBadge() {
43713
- console.log('%c Feathery %c v' + "2.11.1" + ' ', // replaced with real version during build
43903
+ console.log('%c Feathery %c v' + "2.12.0" + ' ', // replaced with real version during build
43714
43904
  'background: #e2626e; color: white; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;', 'background: #fce7e9; color: #c5495a; padding: 2px 6px; border-radius: 0 3px 3px 0;');
43715
43905
  }
43716
43906
 
@@ -44057,63 +44247,13 @@ function isElementInViewport(el) {
44057
44247
  rect.right <= width);
44058
44248
  }
44059
44249
  function httpHelpers(client, connectorFields) {
44060
- var _this = this;
44061
44250
  if (connectorFields === void 0) { connectorFields = []; }
44062
- var helpers = {};
44063
- [
44064
- 'GET',
44065
- 'get',
44066
- 'PATCH',
44067
- 'patch',
44068
- 'POST',
44069
- 'post',
44070
- 'PUT',
44071
- 'put',
44072
- 'DELETE',
44073
- 'delete'
44074
- ].forEach(function (method) {
44075
- return (helpers[method] = function (url, data, headers) { return __awaiter$2(_this, void 0, void 0, function () {
44076
- var response;
44077
- return __generator(this, function (_a) {
44078
- switch (_a.label) {
44079
- case 0:
44080
- if (!url)
44081
- return [2 /*return*/, {}];
44082
- return [4 /*yield*/, client.runCustomRequest({ method: method.toUpperCase(), url: url, data: data, headers: headers }, getConnectorFieldValues(connectorFields))];
44083
- case 1:
44084
- response = _a.sent();
44085
- return [2 /*return*/, {
44086
- data: response.data,
44087
- statusCode: response.status_code,
44088
- // status_code for backwards compatibility
44089
- status_code: response.statusCode
44090
- }];
44091
- }
44092
- });
44093
- }); });
44094
- });
44095
- helpers.connect = function (name, data, headers) { return __awaiter$2(_this, void 0, void 0, function () {
44096
- var response;
44097
- return __generator(this, function (_a) {
44098
- switch (_a.label) {
44099
- case 0:
44100
- if (!name)
44101
- return [2 /*return*/, {}];
44102
- return [4 /*yield*/, client.runCustomRequest({ name: name, data: data, headers: headers }, getConnectorFieldValues(connectorFields))];
44103
- case 1:
44104
- response = _a.sent();
44105
- if (response === null || response === void 0 ? void 0 : response.field_values)
44106
- // skip server submit when setting field values here
44107
- // because these values were just created on the server
44108
- setFieldValues(response === null || response === void 0 ? void 0 : response.field_values, true, true);
44109
- return [2 /*return*/, {
44110
- data: response.data,
44111
- statusCode: response.status_code
44112
- }];
44113
- }
44114
- });
44115
- }); };
44116
- return helpers;
44251
+ var _a = initInfo(), sdkKey = _a.sdkKey, userId = _a.userId;
44252
+ return distExports$2.createHttpHelpers(sdkKey, client.formKey, userId, getConnectorFieldValues(connectorFields), function (fieldValues) {
44253
+ // skip server submit when setting field values here
44254
+ // because these values were just created on the server
44255
+ setFieldValues(fieldValues, true, true);
44256
+ }, client.offlineRequestHandler.runOrSaveRequest.bind(client.offlineRequestHandler));
44117
44257
  }
44118
44258
 
44119
44259
  function runningInClient() {
@@ -45182,39 +45322,39 @@ breakpoint) {
45182
45322
  return styles.getTarget('inner-container', undefined, viewport === 'mobile');
45183
45323
  };
45184
45324
 
45185
- var AddressLine1 = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "AddressField" */ './fthry_index.BWxbbmA2.js'); }); });
45186
- var ButtonGroupField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "ButtonGroupField" */ './fthry_index.BOdVGl5l.js'); }); });
45187
- var CheckboxField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "CheckboxField" */ './fthry_index.HrTSyg9B.js'); }); });
45325
+ var AddressLine1 = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "AddressField" */ './fthry_index.CcgrLEuS.js'); }); });
45326
+ var ButtonGroupField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "ButtonGroupField" */ './fthry_index.BpPVWOqt.js'); }); });
45327
+ var CheckboxField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "CheckboxField" */ './fthry_index.B8m8NcYS.js'); }); });
45188
45328
  var CheckboxGroupField = React.lazy(function () {
45189
- return Promise.resolve().then(function () { return require(/* webpackChunkName: "CheckboxGroupField" */ './fthry_index.CKUbCvsH.js'); });
45329
+ return Promise.resolve().then(function () { return require(/* webpackChunkName: "CheckboxGroupField" */ './fthry_index.e1NDYANz.js'); });
45190
45330
  });
45191
- var ColorPickerField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "ColorPickerField" */ './fthry_index.B61Fc5yV.js'); }); });
45192
- var CustomField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "CustomField" */ './fthry_index.ClWRtApG.js'); }); });
45331
+ var ColorPickerField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "ColorPickerField" */ './fthry_index.CpHzsH9n.js'); }); });
45332
+ var CustomField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "CustomField" */ './fthry_index.DBr9A2ZJ.js'); }); });
45193
45333
  var DateSelectorField = React.lazy(function () {
45194
- return Promise.resolve().then(function () { return require(/* webpackChunkName: "DateSelectorField" */ './fthry_index.rFGfbGIk.js'); });
45334
+ return Promise.resolve().then(function () { return require(/* webpackChunkName: "DateSelectorField" */ './fthry_index.CxZygKnY.js'); });
45195
45335
  });
45196
- var DropdownField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "DropdownField" */ './fthry_index.JnLQZ_md.js'); }); });
45336
+ var DropdownField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "DropdownField" */ './fthry_index.iaUi_vwz.js'); }); });
45197
45337
  var DropdownMultiField = React.lazy(function () {
45198
- return Promise.resolve().then(function () { return require(/* webpackChunkName: "DropdownMultiField" */ './fthry_index.DD21qdc8.js'); });
45338
+ return Promise.resolve().then(function () { return require(/* webpackChunkName: "DropdownMultiField" */ './fthry_index.CuICsq3u.js'); });
45199
45339
  });
45200
- var FileUploadField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "FileUploadField" */ './fthry_index.BD1AaCkS.js'); }); });
45201
- var MatrixField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "MatrixField" */ './fthry_index.C5e1CIOA.js'); }); });
45202
- var PasswordField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "PasswordField" */ './fthry_index.EgnUQ81x.js'); }); });
45340
+ var FileUploadField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "FileUploadField" */ './fthry_index.DM58Cupo.js'); }); });
45341
+ var MatrixField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "MatrixField" */ './fthry_index.CRJbToBF.js'); }); });
45342
+ var PasswordField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "PasswordField" */ './fthry_index.CVGTkuBu.js'); }); });
45203
45343
  var PaymentMethodField = React.lazy(function () {
45204
- return Promise.resolve().then(function () { return require(/* webpackChunkName: "PaymentMethodField" */ './fthry_PaymentMethodField.CoByJr6K.js'); });
45344
+ return Promise.resolve().then(function () { return require(/* webpackChunkName: "PaymentMethodField" */ './fthry_PaymentMethodField.ClmgrMDW.js'); });
45205
45345
  });
45206
- var PhoneField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "PhoneField" */ './fthry_index.gF97kiKa.js'); }); });
45207
- var PinInputField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "PinInputField" */ './fthry_index.CoeM5YQu.js'); }); });
45208
- var QRScanner = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "QRScanner" */ './fthry_index.Bz00U1qW.js'); }); });
45346
+ var PhoneField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "PhoneField" */ './fthry_index.Ce9wiHSK.js'); }); });
45347
+ var PinInputField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "PinInputField" */ './fthry_index.x3WPDwFM.js'); }); });
45348
+ var QRScanner = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "QRScanner" */ './fthry_index.CX0W0jE1.js'); }); });
45209
45349
  var RadioButtonGroupField = React.lazy(function () {
45210
45350
  return Promise.resolve().then(function () { return require(
45211
- /* webpackChunkName: "RadioButtonGroupField" */ './fthry_index.BT4rLIaG.js'); });
45351
+ /* webpackChunkName: "RadioButtonGroupField" */ './fthry_index.BrzbrcQa.js'); });
45212
45352
  });
45213
- var RatingField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "RatingField" */ './fthry_index.C67RyE6s.js'); }); });
45214
- var SignatureField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "SignatureField" */ './fthry_index.D-DmJrvp.js'); }); });
45215
- var SliderField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "SliderField" */ './fthry_index.CEvNFKQL.js'); }); });
45216
- var TextField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "TextField" */ './fthry_index.B1HntmiS.js'); }); });
45217
- var TextArea = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "TextArea" */ './fthry_index.CyKbm52O.js'); }); });
45353
+ var RatingField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "RatingField" */ './fthry_index.CpIBnF75.js'); }); });
45354
+ var SignatureField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "SignatureField" */ './fthry_index.CmHODiIC.js'); }); });
45355
+ var SliderField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "SliderField" */ './fthry_index.C8jtezTq.js'); }); });
45356
+ var TextField = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "TextField" */ './fthry_index.D94gkYbC.js'); }); });
45357
+ var TextArea = React.lazy(function () { return Promise.resolve().then(function () { return require(/* webpackChunkName: "TextArea" */ './fthry_index.CdGAa2gf.js'); }); });
45218
45358
  var Fields = {
45219
45359
  AddressLine1: AddressLine1,
45220
45360
  ButtonGroupField: ButtonGroupField,
@@ -45303,7 +45443,7 @@ function applyFieldStyles$1(field, styles) {
45303
45443
  styles.applyBoxShadow('field');
45304
45444
  break;
45305
45445
  case 'file_upload':
45306
- styles.addTargets('ac', 'add', 'filename');
45446
+ styles.addTargets('ac', 'add');
45307
45447
  styles.applyHeight('ac');
45308
45448
  if (field.servar.metadata.multiple) {
45309
45449
  styles.apply('field', 'padding_bottom', function (a) { return ({
@@ -45315,9 +45455,6 @@ function applyFieldStyles$1(field, styles) {
45315
45455
  styles.applyCorners('field');
45316
45456
  styles.applyBoxShadow('field');
45317
45457
  styles.applyColor('field', 'background_color', 'backgroundColor');
45318
- // filename target: only font styles + background for the filename span
45319
- styles.applyFontStyles('filename');
45320
- styles.applyColor('filename', 'background_color', 'backgroundColor');
45321
45458
  styles.applyColor('ac', 'background_color', 'backgroundColor');
45322
45459
  styles.applyBorders({ target: 'ac' });
45323
45460
  styles.applyCorners('ac');