onairos 4.0.21 → 4.0.23

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 (50) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +397 -397
  3. package/dist/10.js +1 -1
  4. package/dist/123.js +1 -1
  5. package/dist/129.js +1 -1
  6. package/dist/18.js +1 -1
  7. package/dist/185.js +1 -1
  8. package/dist/22.js +1 -1
  9. package/dist/225.js +1 -1
  10. package/dist/241.js +1 -1
  11. package/dist/31.js +1 -1
  12. package/dist/336.js +1 -1
  13. package/dist/342.js +1 -1
  14. package/dist/342.js.map +1 -1
  15. package/dist/360.js +1 -1
  16. package/dist/421.js +1 -1
  17. package/dist/433.js +1 -1
  18. package/dist/502.js +1 -1
  19. package/dist/540.js +1 -1
  20. package/dist/540.js.map +1 -1
  21. package/dist/575.js +1 -1
  22. package/dist/592.js +1 -1
  23. package/dist/659.js +1 -1
  24. package/dist/672.js +1 -1
  25. package/dist/672.js.map +1 -1
  26. package/dist/845.js +1 -1
  27. package/dist/911.js +1 -1
  28. package/dist/947.js +1 -1
  29. package/dist/961.js +1 -1
  30. package/dist/961.js.map +1 -1
  31. package/dist/991.js +1 -1
  32. package/dist/999.js +1 -1
  33. package/dist/data_request_iframe.html +11 -11
  34. package/dist/data_request_popup.html +320 -320
  35. package/dist/iframe.bundle.js +1 -1
  36. package/dist/iframe.bundle.js.map +1 -1
  37. package/dist/oauth-callback.html +137 -206
  38. package/dist/onairos-laravel.js +1 -1
  39. package/dist/onairos-laravel.js.map +1 -1
  40. package/dist/onairos.bundle.js +1 -1
  41. package/dist/onairos.bundle.js.map +1 -1
  42. package/dist/onairos.esm.js +1 -1
  43. package/dist/onairos.esm.js.map +1 -1
  44. package/dist/src_onairosButton_jsx.js +1 -1
  45. package/dist/static/8c5b220bf6f482881a90.png +1 -1
  46. package/dist/vendors-node_modules_lottie-react_build_index_umd_js-node_modules_lucide-react_dist_esm_icons-20f774.js +1 -1
  47. package/dist/vendors-node_modules_react-dom_index_js.js +1 -1
  48. package/dist/vendors-node_modules_react_index_js.js +1 -1
  49. package/llm.txt +333 -333
  50. package/package.json +171 -167
@@ -1,207 +1,138 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>OAuth Callback - Onairos</title>
7
- <style>
8
- body {
9
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
10
- display: flex;
11
- align-items: center;
12
- justify-content: center;
13
- min-height: 100vh;
14
- margin: 0;
15
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
16
- color: white;
17
- }
18
- .container {
19
- text-align: center;
20
- padding: 2rem;
21
- background: rgba(255, 255, 255, 0.1);
22
- border-radius: 16px;
23
- backdrop-filter: blur(10px);
24
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
25
- }
26
- .success-icon {
27
- font-size: 4rem;
28
- margin-bottom: 1rem;
29
- animation: bounce 0.6s ease-in-out;
30
- }
31
- .error-icon {
32
- font-size: 4rem;
33
- margin-bottom: 1rem;
34
- color: #ef4444;
35
- }
36
- @keyframes bounce {
37
- 0%, 20%, 53%, 80%, 100% {
38
- transform: translate3d(0,0,0);
39
- }
40
- 40%, 43% {
41
- transform: translate3d(0, -30px, 0);
42
- }
43
- 70% {
44
- transform: translate3d(0, -15px, 0);
45
- }
46
- 90% {
47
- transform: translate3d(0, -4px, 0);
48
- }
49
- }
50
- .message {
51
- font-size: 1.2rem;
52
- margin-bottom: 1rem;
53
- }
54
- .details {
55
- font-size: 0.9rem;
56
- opacity: 0.8;
57
- }
58
- .spinner {
59
- border: 2px solid rgba(255,255,255,0.3);
60
- border-radius: 50%;
61
- border-top: 2px solid white;
62
- width: 40px;
63
- height: 40px;
64
- animation: spin 2s linear infinite;
65
- margin: 0 auto 1rem;
66
- }
67
- @keyframes spin {
68
- 0% { transform: rotate(0deg); }
69
- 100% { transform: rotate(360deg); }
70
- }
71
- </style>
72
- </head>
73
- <body>
74
- <div class="container">
75
- <div id="loading-state">
76
- <div class="spinner"></div>
77
- <div class="message">Processing your connection...</div>
78
- <div class="details">Please wait while we complete the setup.</div>
79
- </div>
80
-
81
- <div id="success-state" style="display: none;">
82
- <div class="success-icon">✅</div>
83
- <div class="message">Successfully Connected!</div>
84
- <div class="details">This window will close automatically.</div>
85
- </div>
86
-
87
- <div id="error-state" style="display: none;">
88
- <div class="error-icon">❌</div>
89
- <div class="message">Connection Failed</div>
90
- <div class="details" id="error-details">Please try again.</div>
91
- </div>
92
- </div>
93
-
94
- <script>
95
- // Parse URL parameters
96
- const urlParams = new URLSearchParams(window.location.search);
97
- const success = urlParams.get('success');
98
- const error = urlParams.get('error');
99
- const platform = urlParams.get('platform');
100
- const details = urlParams.get('details');
101
- const email = urlParams.get('email'); // Extract email from URL params
102
-
103
- // Get elements
104
- const loadingState = document.getElementById('loading-state');
105
- const successState = document.getElementById('success-state');
106
- const errorState = document.getElementById('error-state');
107
- const errorDetails = document.getElementById('error-details');
108
-
109
- console.log('🔄 OAuth callback received:', { success, error, platform, details, email });
110
-
111
- if (success === 'true' && platform) {
112
- // Success flow
113
- console.log(`✅ OAuth success for platform: ${platform}`);
114
-
115
- // Signal success to parent window
116
- localStorage.setItem(`onairos_${platform}_success`, 'true');
117
- localStorage.setItem(`onairos_${platform}_timestamp`, Date.now().toString());
118
-
119
- // Store email if provided (for Gmail OAuth)
120
- if (email) {
121
- localStorage.setItem(`onairos_${platform}_email`, email);
122
- // Also store as generic oauth_email for compatibility
123
- localStorage.setItem('onairos_oauth_email', email);
124
- localStorage.setItem('onairos_gmail_email', email); // Direct key for Gmail
125
- console.log(`📧 Stored ${platform} email in localStorage:`, email);
126
- }
127
-
128
- // Also try to send postMessage to parent window (if same origin)
129
- try {
130
- if (window.opener && !window.opener.closed) {
131
- window.opener.postMessage({
132
- type: 'oauth-success',
133
- platform: platform,
134
- email: email,
135
- gmailEmail: email, // Alias for Gmail
136
- success: true
137
- }, '*');
138
- console.log('📤 Sent postMessage to parent window');
139
- }
140
- } catch (e) {
141
- console.log('⚠️ Could not send postMessage (cross-origin):', e.message);
142
- }
143
-
144
- // Update UI
145
- loadingState.style.display = 'none';
146
- successState.style.display = 'block';
147
-
148
- // Close window after delay (4 seconds so users can read the message)
149
- setTimeout(() => {
150
- console.log('🚪 Closing OAuth popup window');
151
- window.close();
152
- }, 4000);
153
-
154
- } else if (error || success === 'false') {
155
- // Error flow
156
- console.log(`❌ OAuth error for platform: ${platform}`, error);
157
-
158
- // Signal error to parent window
159
- localStorage.setItem(`onairos_${platform}_error`, error || 'Unknown error');
160
- localStorage.setItem(`onairos_${platform}_timestamp`, Date.now().toString());
161
-
162
- // Update UI
163
- loadingState.style.display = 'none';
164
- errorState.style.display = 'block';
165
-
166
- if (details) {
167
- errorDetails.textContent = details;
168
- } else if (error) {
169
- errorDetails.textContent = error;
170
- }
171
-
172
- // Close window after longer delay for error
173
- setTimeout(() => {
174
- console.log('🚪 Closing OAuth popup window (error)');
175
- window.close();
176
- }, 5000);
177
-
178
- } else {
179
- // No clear success or error - treat as potential success
180
- console.log('🤔 Ambiguous OAuth callback, treating as success');
181
-
182
- if (platform) {
183
- localStorage.setItem(`onairos_${platform}_success`, 'true');
184
- localStorage.setItem(`onairos_${platform}_timestamp`, Date.now().toString());
185
- }
186
-
187
- loadingState.style.display = 'none';
188
- successState.style.display = 'block';
189
-
190
- setTimeout(() => {
191
- window.close();
192
- }, 4000);
193
- }
194
-
195
- // Fallback: close window if no action taken after 10 seconds
196
- setTimeout(() => {
197
- console.log('🚪 Fallback: Closing OAuth popup window');
198
- window.close();
199
- }, 10000);
200
-
201
- // Handle cases where window.close() might not work
202
- window.addEventListener('beforeunload', () => {
203
- console.log('🚪 OAuth popup window closing');
204
- });
205
- </script>
206
- </body>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>OAuth Callback - Onairos</title>
7
+ <style>
8
+ /* Make the callback visually minimal and auto-close quickly.
9
+ The real UX is handled by the parent window via postMessage. */
10
+ body {
11
+ margin: 0;
12
+ background: transparent;
13
+ }
14
+ .container {
15
+ display: none; /* Hide UI; we just use this page as a silent bridge */
16
+ }
17
+ </style>
18
+ </head>
19
+ <body>
20
+ <div class="container">
21
+ <div id="loading-state">
22
+ <div class="spinner"></div>
23
+ <div class="message">Processing your connection...</div>
24
+ <div class="details">Please wait while we complete the setup.</div>
25
+ </div>
26
+
27
+ <div id="success-state" style="display: none;">
28
+ <div class="success-icon">✅</div>
29
+ <div class="message">Successfully Connected!</div>
30
+ <div class="details">This window will close automatically.</div>
31
+ </div>
32
+
33
+ <div id="error-state" style="display: none;">
34
+ <div class="error-icon">❌</div>
35
+ <div class="message">Connection Failed</div>
36
+ <div class="details" id="error-details">Please try again.</div>
37
+ </div>
38
+ </div>
39
+
40
+ <script>
41
+ // Parse URL parameters
42
+ const urlParams = new URLSearchParams(window.location.search);
43
+ const success = urlParams.get('success');
44
+ const error = urlParams.get('error');
45
+ const platform = urlParams.get('platform');
46
+ const details = urlParams.get('details');
47
+ const email = urlParams.get('email'); // Extract email from URL params
48
+
49
+ // Get elements
50
+ const loadingState = document.getElementById('loading-state');
51
+ const successState = document.getElementById('success-state');
52
+ const errorState = document.getElementById('error-state');
53
+ const errorDetails = document.getElementById('error-details');
54
+
55
+ console.log('🔄 OAuth callback received:', { success, error, platform, details, email });
56
+
57
+ if (success === 'true' && platform) {
58
+ // Success flow
59
+ console.log(`✅ OAuth success for platform: ${platform}`);
60
+
61
+ // Signal success to parent window
62
+ localStorage.setItem(`onairos_${platform}_success`, 'true');
63
+ localStorage.setItem(`onairos_${platform}_timestamp`, Date.now().toString());
64
+
65
+ // Store email if provided (for Gmail OAuth)
66
+ if (email) {
67
+ localStorage.setItem(`onairos_${platform}_email`, email);
68
+ // Also store as generic oauth_email for compatibility
69
+ localStorage.setItem('onairos_oauth_email', email);
70
+ localStorage.setItem('onairos_gmail_email', email); // Direct key for Gmail
71
+ console.log(`📧 Stored ${platform} email in localStorage:`, email);
72
+ }
73
+
74
+ // Try to notify parent (popup / iframe host)
75
+ try {
76
+ if (window.opener && !window.opener.closed) {
77
+ window.opener.postMessage({
78
+ type: 'oauth-success',
79
+ platform: platform,
80
+ email: email,
81
+ gmailEmail: email, // Alias for Gmail
82
+ success: true
83
+ }, '*');
84
+ console.log('📤 Sent onairos oauth-success postMessage to parent window');
85
+ }
86
+ } catch (e) {
87
+ console.log('⚠️ Could not send postMessage (cross-origin):', e.message);
88
+ }
89
+
90
+ // Immediately attempt to close the popup (no visible success screen)
91
+ setTimeout(() => {
92
+ console.log('🚪 Closing OAuth popup window (success)');
93
+ window.close();
94
+ }, 100);
95
+
96
+ } else if (error || success === 'false') {
97
+ // Error flow
98
+ console.log(`❌ OAuth error for platform: ${platform}`, error);
99
+
100
+ // Signal error to parent window
101
+ localStorage.setItem(`onairos_${platform}_error`, error || 'Unknown error');
102
+ localStorage.setItem(`onairos_${platform}_timestamp`, Date.now().toString());
103
+
104
+ // Immediately close on error as well; parent can show its own UI
105
+ setTimeout(() => {
106
+ console.log('🚪 Closing OAuth popup window (error)');
107
+ window.close();
108
+ }, 300);
109
+
110
+ } else {
111
+ // No clear success or error - treat as potential success
112
+ console.log('🤔 Ambiguous OAuth callback, treating as success');
113
+
114
+ if (platform) {
115
+ localStorage.setItem(`onairos_${platform}_success`, 'true');
116
+ localStorage.setItem(`onairos_${platform}_timestamp`, Date.now().toString());
117
+ }
118
+
119
+ // Best-effort close after a short delay
120
+ setTimeout(() => {
121
+ console.log('🚪 Closing OAuth popup window (ambiguous result)');
122
+ window.close();
123
+ }, 300);
124
+ }
125
+
126
+ // Fallback: close window if no action taken after a short time
127
+ setTimeout(() => {
128
+ console.log('🚪 Fallback: Closing OAuth popup window');
129
+ window.close();
130
+ }, 2000);
131
+
132
+ // Handle cases where window.close() might not work
133
+ window.addEventListener('beforeunload', () => {
134
+ console.log('🚪 OAuth popup window closing');
135
+ });
136
+ </script>
137
+ </body>
207
138
  </html>
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("OnairosLaravel",[],t):"object"==typeof exports?exports.OnairosLaravel=t():e.OnairosLaravel=t()}(this,(()=>(()=>{"use strict";var e,t,n,o,r={},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e].call(n.exports,n,n.exports,a),n.exports}a.m=r,a.amdO={},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"==typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"==typeof n.then)return n}var r=Object.create(null);a.r(r);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>i[e]=()=>n[e]));return i.default=()=>n,a.d(r,i),r},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>e+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},o="OnairosLaravel:",a.l=(e,t,r,i)=>{if(n[e])n[e].push(t);else{var s,c;if(void 0!==r)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==o+r){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",o+r),s.src=e),n[e]=[t];var p=(t,o)=>{s.onerror=s.onload=null,clearTimeout(f);var r=n[e];if(delete n[e],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach((e=>e(o))),t)return t(o)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={787:0};a.f.j=(t,n)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,r)=>o=e[t]=[n,r]));n.push(o[2]=r);var i=a.p+a.u(t),s=new Error;a.l(i,(n=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,o[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var o,r,i=n[0],s=n[1],c=n[2],l=0;if(i.some((t=>0!==e[t]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);if(c)c(a)}for(t&&t(n);l<i.length;l++)r=i[l],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0},n=this.webpackChunkOnairosLaravel=this.webpackChunkOnairosLaravel||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s={};function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}a.r(s),a.d(s,{createOnairosButton:()=>p,initializeOnairosForBlade:()=>u,renderOnairosDirective:()=>m});function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.OnairosConfig=l(l({},{apiKey:null,baseUrl:"https://api2.onairos.uk",testMode:!1,autoDetectMobile:!0,globalStyles:!0}),e),window.OnairosConfig.globalStyles&&function(){if(document.getElementById("onairos-styles"))return;const e="\n <style id=\"onairos-styles\">\n .onairos-button-container {\n display: inline-block;\n margin: 10px 0;\n }\n \n .onairos-btn {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border: none;\n border-radius: 25px;\n padding: 12px 24px;\n color: white;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.3s ease;\n box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);\n }\n \n .onairos-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);\n }\n \n .onairos-btn-pill {\n border-radius: 25px;\n }\n \n .onairos-btn-icon {\n border-radius: 50%;\n width: 45px;\n height: 45px;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .onairos-btn-loading {\n color: #888;\n }\n \n @media (max-width: 768px) {\n .onairos-btn {\n width: 100%;\n padding: 15px 20px;\n font-size: 16px;\n }\n }\n </style>\n ";document.head.insertAdjacentHTML("beforeend",e)}(),window.OnairosUtils={isMobile:b(),detectMobile:b},console.log("🔥 Onairos initialized for Laravel Blade templates")}function p(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=document.getElementById(e);if(!o){if(!window.OnairosUtils||!window.OnairosUtils.isMobile)return void console.error('❌ Element with ID "'.concat(e,'" not found'));{const t=document.createElement("div");t.id=e,document.body.appendChild(t),o=t}}const r=l(l({},{requestData:["email","profile"],webpageName:"Laravel App",testMode:(null===(t=window.OnairosConfig)||void 0===t?void 0:t.testMode)||!1,autoFetch:!0,buttonType:"pill",textColor:"black"}),n);o.innerHTML='\n <div class="onairos-button-container">\n <button \n id="'.concat(e,'-btn" \n class="onairos-btn onairos-btn-').concat(r.buttonType,"\"\n data-onairos-config='").concat(JSON.stringify(r),'\'\n >\n <span class="onairos-btn-text" style="color: ').concat(r.textColor,'">\n Connect with Onairos\n </span>\n <span class="onairos-btn-loading" style="display: none;">\n Loading...\n </span>\n </button>\n </div>\n ');const i=document.getElementById("".concat(e,"-btn"));i.onclick=()=>f(r),i.addEventListener("click",(()=>f(r)))}function f(e){!async function(e){try{const t="onairos-react-".concat(Math.random().toString(36).substr(2,9)),n=document.createElement("div");n.id=t,document.body.appendChild(n);const o=(await a.e(294).then(a.t.bind(a,294,19))).default||await a.e(294).then(a.t.bind(a,294,19)),r=(await a.e(935).then(a.t.bind(a,935,19))).default||await a.e(935).then(a.t.bind(a,935,19)),{OnairosButton:i}=await Promise.all([a.e(726),a.e(664)]).then(a.bind(a,664)),s=t=>{e.onComplete&&"function"==typeof e.onComplete&&e.onComplete(t),setTimeout((()=>{n&&n.parentNode&&n.parentNode.removeChild(n)}),0)},c=o.createElement(i,{requestData:e.requestData,webpageName:e.webpageName,autoFetch:e.autoFetch,testMode:e.testMode,textColor:e.textColor||"white",buttonType:e.buttonType||"pill",onComplete:s});r.render(c,n),setTimeout((()=>{const e=n.querySelector("button");e&&e.click()}),0)}catch(e){console.error("Failed to mount React overlay for Laravel:",e)}}(e)}function b(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768}function m(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="onairos-".concat(Math.random().toString(36).substr(2,9));return'\n <div id="'.concat(t,"\"></div>\n <script>\n document.addEventListener('DOMContentLoaded', function() {\n if (window.createOnairosButton) {\n window.createOnairosButton('").concat(t,"', ").concat(JSON.stringify(e),");\n }\n });\n <\/script>\n ")}return"undefined"!=typeof window&&(window.initializeOnairosForBlade=u,window.createOnairosButton=p,window.renderOnairosDirective=m),s})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("OnairosLaravel",[],t):"object"==typeof exports?exports.OnairosLaravel=t():e.OnairosLaravel=t()}(this,()=>(()=>{"use strict";var e,t,n,o,r={},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e].call(n.exports,n,n.exports,a),n.exports}a.m=r,a.amdO={},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"==typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"==typeof n.then)return n}var r=Object.create(null);a.r(r);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,a.d(r,i),r},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,n)=>(a.f[n](e,t),t),[])),a.u=e=>e+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},o="OnairosLaravel:",a.l=(e,t,r,i)=>{if(n[e])n[e].push(t);else{var s,c;if(void 0!==r)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==o+r){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",o+r),s.src=e),n[e]=[t];var p=(t,o)=>{s.onerror=s.onload=null,clearTimeout(f);var r=n[e];if(delete n[e],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach(e=>e(o)),t)return t(o)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={930:0};a.f.j=(t,n)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise((n,r)=>o=e[t]=[n,r]);n.push(o[2]=r);var i=a.p+a.u(t),s=new Error;a.l(i,n=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,o[1](s)}},"chunk-"+t,t)}};var t=(t,n)=>{var o,r,[i,s,c]=n,l=0;if(i.some(t=>0!==e[t])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);if(c)c(a)}for(t&&t(n);l<i.length;l++)r=i[l],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0},n=this.webpackChunkOnairosLaravel=this.webpackChunkOnairosLaravel||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s={};function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}a.r(s),a.d(s,{createOnairosButton:()=>p,initializeOnairosForBlade:()=>u,renderOnairosDirective:()=>m});function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.OnairosConfig=l(l({},{apiKey:null,baseUrl:"https://api2.onairos.uk",testMode:!1,autoDetectMobile:!0,globalStyles:!0}),e),window.OnairosConfig.globalStyles&&function(){if(document.getElementById("onairos-styles"))return;const e="\n <style id=\"onairos-styles\">\n .onairos-button-container {\n display: inline-block;\n margin: 10px 0;\n }\n \n .onairos-btn {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border: none;\n border-radius: 25px;\n padding: 12px 24px;\n color: white;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.3s ease;\n box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);\n }\n \n .onairos-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);\n }\n \n .onairos-btn-pill {\n border-radius: 25px;\n }\n \n .onairos-btn-icon {\n border-radius: 50%;\n width: 45px;\n height: 45px;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .onairos-btn-loading {\n color: #888;\n }\n \n @media (max-width: 768px) {\n .onairos-btn {\n width: 100%;\n padding: 15px 20px;\n font-size: 16px;\n }\n }\n </style>\n ";document.head.insertAdjacentHTML("beforeend",e)}(),window.OnairosUtils={isMobile:b(),detectMobile:b},console.log("🔥 Onairos initialized for Laravel Blade templates")}function p(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=document.getElementById(e);if(!o){if(!window.OnairosUtils||!window.OnairosUtils.isMobile)return void console.error('❌ Element with ID "'.concat(e,'" not found'));{const t=document.createElement("div");t.id=e,document.body.appendChild(t),o=t}}const r=l(l({},{requestData:["email","profile"],webpageName:"Laravel App",testMode:(null===(t=window.OnairosConfig)||void 0===t?void 0:t.testMode)||!1,autoFetch:!0,buttonType:"pill",textColor:"black"}),n);o.innerHTML='\n <div class="onairos-button-container">\n <button \n id="'.concat(e,'-btn" \n class="onairos-btn onairos-btn-').concat(r.buttonType,"\"\n data-onairos-config='").concat(JSON.stringify(r),'\'\n >\n <span class="onairos-btn-text" style="color: ').concat(r.textColor,'">\n Connect with Onairos\n </span>\n <span class="onairos-btn-loading" style="display: none;">\n Loading...\n </span>\n </button>\n </div>\n ');const i=document.getElementById("".concat(e,"-btn"));i.onclick=()=>f(r),i.addEventListener("click",()=>f(r))}function f(e){!async function(e){try{const t="onairos-react-".concat(Math.random().toString(36).substr(2,9)),n=document.createElement("div");n.id=t,document.body.appendChild(n);const o=(await a.e(540).then(a.t.bind(a,540,19))).default||await a.e(540).then(a.t.bind(a,540,19)),r=(await a.e(961).then(a.t.bind(a,961,19))).default||await a.e(961).then(a.t.bind(a,961,19)),{OnairosButton:i}=await Promise.all([a.e(672),a.e(342)]).then(a.bind(a,342)),s=t=>{e.onComplete&&"function"==typeof e.onComplete&&e.onComplete(t),setTimeout(()=>{n&&n.parentNode&&n.parentNode.removeChild(n)},0)},c=o.createElement(i,{requestData:e.requestData,webpageName:e.webpageName,autoFetch:e.autoFetch,testMode:e.testMode,textColor:e.textColor||"white",buttonType:e.buttonType||"pill",onComplete:s});r.render(c,n),setTimeout(()=>{const e=n.querySelector("button");e&&e.click()},0)}catch(e){console.error("Failed to mount React overlay for Laravel:",e)}}(e)}function b(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768}function m(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="onairos-".concat(Math.random().toString(36).substr(2,9));return'\n <div id="'.concat(t,"\"></div>\n <script>\n document.addEventListener('DOMContentLoaded', function() {\n if (window.createOnairosButton) {\n window.createOnairosButton('").concat(t,"', ").concat(JSON.stringify(e),");\n }\n });\n <\/script>\n ")}return"undefined"!=typeof window&&(window.initializeOnairosForBlade=u,window.createOnairosButton=p,window.renderOnairosDirective=m),s})());
2
2
  //# sourceMappingURL=onairos-laravel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"onairos-laravel.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,iBAAkB,GAAIH,GACH,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,GAC1B,CATD,CASGK,MAAM,I,uBCRLC,EADAC,ECAAC,EACAC,E,KCAAC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,CAAC,GAOX,OAHAc,EAAoBH,GAAUI,KAAKd,EAAOD,QAASC,EAAQA,EAAOD,QAASU,GAGpET,EAAOD,OACf,CAGAU,EAAoBM,EAAIF,ECzBxBJ,EAAoBO,KAAO,CAAC,ECC5BP,EAAoBQ,EAAKjB,IACxB,IAAIkB,EAASlB,GAAUA,EAAOmB,WAC7B,IAAOnB,EAAiB,QACxB,IAAM,EAEP,OADAS,EAAoBW,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,EJNVb,EAAWiB,OAAOC,eAAkBC,GAASF,OAAOC,eAAeC,GAASA,GAASA,EAAa,UAQtGf,EAAoBgB,EAAI,SAASC,EAAOC,GAEvC,GADU,EAAPA,IAAUD,EAAQvB,KAAKuB,IAChB,EAAPC,EAAU,OAAOD,EACpB,GAAoB,iBAAVA,GAAsBA,EAAO,CACtC,GAAW,EAAPC,GAAaD,EAAMP,WAAY,OAAOO,EAC1C,GAAW,GAAPC,GAAoC,mB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YyD,GAE1B,MAAMoB,SAAe,mCAAiBC,eAAkB,kCAClDC,SAAkB,mCAAqBD,eAAkB,mCACzD,cAAEE,SAAwB,qDAE1BC,EAAcC,IACdlD,EAAOiD,YAA2C,mBAAtBjD,EAAOiD,YACrCjD,EAAOiD,WAAWC,GAEpBvF,YAAW,KACL8D,GAAaA,EAAUjE,YACzBiE,EAAUjE,WAAWC,YAAYgE,EACnC,GACC,EAAE,EAGDF,EAAUsB,EAAMlG,cAAcqG,EAAe,CACjDrB,YAAa3B,EAAO2B,YACpBC,YAAa5B,EAAO4B,YACpBC,UAAW7B,EAAO6B,UAClBvB,SAAUN,EAAOM,SACjByB,UAAW/B,EAAO+B,WAAa,QAC/BD,WAAY9B,EAAO8B,YAAc,OACjCmB,eAGFF,EAASI,OAAO5B,EAASE,GAGzB9D,YAAW,KACT,MAAMyF,EAAM3B,EAAU4B,cAAc,UAChCD,GACFA,EAAIE,OACN,GACC,EACL,CAAE,MAAOtE,GACPiC,QAAQjC,MAAM,6CAA8CA,EAC9D,CACF,CA/MEuE,CAAkBvD,EACpB,CA0EA,SAASe,IACP,MAAO,iEAAiEyC,KAAKC,UAAUC,YAC/EhI,OAAOiI,YAAc,GAC/B,CAqEO,SAASC,IAAqC,IAAdtC,EAAOrB,UAAAzD,OAAA,QAAAzD,IAAAkH,UAAA,GAAAA,UAAA,GAAG,CAAC,EAChD,MAAM4D,EAAY,WAAHrC,OAAciB,KAAKC,SAASC,SAAS,IAAIC,OAAO,EAAG,IAElE,MAAO,kBAAPpB,OACaqC,EAAS,gLAAArC,OAIgBqC,EAAS,OAAArC,OAAMS,KAAKC,UAAUZ,GAAQ,+CAK9E,C,MAkDsB,oBAAX5F,SACTA,OAAOqE,0BAA4BA,EACnCrE,OAAOyF,oBAAsBA,EAC7BzF,OAAOkI,uBAAyBA,G","sources":["webpack://OnairosLaravel/webpack/universalModuleDefinition","webpack://OnairosLaravel/webpack/runtime/create fake namespace object","webpack://OnairosLaravel/webpack/runtime/load script","webpack://OnairosLaravel/webpack/bootstrap","webpack://OnairosLaravel/webpack/runtime/amd options","webpack://OnairosLaravel/webpack/runtime/compat get default export","webpack://OnairosLaravel/webpack/runtime/define property getters","webpack://OnairosLaravel/webpack/runtime/ensure chunk","webpack://OnairosLaravel/webpack/runtime/get javascript chunk filename","webpack://OnairosLaravel/webpack/runtime/global","webpack://OnairosLaravel/webpack/runtime/hasOwnProperty shorthand","webpack://OnairosLaravel/webpack/runtime/make namespace object","webpack://OnairosLaravel/webpack/runtime/publicPath","webpack://OnairosLaravel/webpack/runtime/jsonp chunk loading","webpack://OnairosLaravel/./src/laravel/blade-helpers.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"OnairosLaravel\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OnairosLaravel\"] = factory();\n\telse\n\t\troot[\"OnairosLaravel\"] = factory();\n})(this, () => {\nreturn ","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"OnairosLaravel:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t787: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = this[\"webpackChunkOnairosLaravel\"] = this[\"webpackChunkOnairosLaravel\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","/**\r\n * Onairos Laravel Blade Integration Helpers\r\n * \r\n * This file provides utilities for integrating Onairos components\r\n * directly in PHP Blade templates without requiring React setup.\r\n */\r\n\r\n// Global Onairos instance for Blade templates\r\nlet onairosInstance = null;\r\n\r\n/**\r\n * Initialize Onairos for Blade template usage\r\n * @param {Object} config - Global configuration\r\n */\r\nexport function initializeOnairosForBlade(config = {}) {\r\n const defaultConfig = {\r\n apiKey: null,\r\n baseUrl: 'https://api2.onairos.uk',\r\n testMode: false,\r\n autoDetectMobile: true,\r\n globalStyles: true\r\n };\r\n\r\n window.OnairosConfig = { ...defaultConfig, ...config };\r\n \r\n // Inject global styles if enabled\r\n if (window.OnairosConfig.globalStyles) {\r\n injectOnairosStyles();\r\n }\r\n\r\n // Initialize mobile detection\r\n window.OnairosUtils = {\r\n isMobile: detectMobileDevice(),\r\n detectMobile: detectMobileDevice\r\n };\r\n\r\n console.log('🔥 Onairos initialized for Laravel Blade templates');\r\n}\r\n\r\n/**\r\n * Create an Onairos button element that can be used in Blade templates\r\n * @param {string} targetElementId - ID of the element to mount to\r\n * @param {Object} options - Onairos button options\r\n */\r\nexport function createOnairosButton(targetElementId, options = {}) {\r\n let element = document.getElementById(targetElementId);\r\n if (!element) {\r\n if (window.OnairosUtils && window.OnairosUtils.isMobile) {\r\n const container = document.createElement('div');\r\n container.id = targetElementId;\r\n document.body.appendChild(container);\r\n element = container;\r\n } else {\r\n console.error(`❌ Element with ID \"${targetElementId}\" not found`);\r\n return;\r\n }\r\n }\r\n\r\n const defaultOptions = {\r\n requestData: ['email', 'profile'],\r\n webpageName: 'Laravel App',\r\n testMode: window.OnairosConfig?.testMode || false,\r\n autoFetch: true,\r\n buttonType: 'pill',\r\n textColor: 'black'\r\n };\r\n\r\n const config = { ...defaultOptions, ...options };\r\n\r\n // Create button HTML\r\n element.innerHTML = `\r\n <div class=\"onairos-button-container\">\r\n <button \r\n id=\"${targetElementId}-btn\" \r\n class=\"onairos-btn onairos-btn-${config.buttonType}\"\r\n data-onairos-config='${JSON.stringify(config)}'\r\n >\r\n <span class=\"onairos-btn-text\" style=\"color: ${config.textColor}\">\r\n Connect with Onairos\r\n </span>\r\n <span class=\"onairos-btn-loading\" style=\"display: none;\">\r\n Loading...\r\n </span>\r\n </button>\r\n </div>\r\n `;\r\n\r\n // Add event listener\r\n const button = document.getElementById(`${targetElementId}-btn`);\r\n // Ensure both property and event listener are set for testing compatibility\r\n button.onclick = () => handleOnairosButtonClick(config);\r\n button.addEventListener('click', () => handleOnairosButtonClick(config));\r\n}\r\n\r\n/**\r\n * Handle Onairos button click in Blade context\r\n * @param {Object} config - Button configuration\r\n */\r\nfunction handleOnairosButtonClick(config) {\r\n // For Blade templates, reuse the React overlay logic by mounting the React component dynamically\r\n mountReactOverlay(config);\r\n}\r\n\r\n/**\r\n * Handle mobile OAuth flow (redirect-based)\r\n * @param {Object} config - Configuration\r\n */\r\nfunction handleMobileFlow(config) {\r\n const authUrl = buildAuthUrl(config);\r\n window.location.href = authUrl;\r\n}\r\n\r\n/**\r\n * Handle desktop OAuth flow (popup-based)\r\n * @param {Object} config - Configuration\r\n */\r\nfunction handleDesktopFlow(config) {\r\n const authUrl = buildAuthUrl(config);\r\n \r\n const popup = window.open(\r\n authUrl,\r\n 'onairosAuth',\r\n 'width=450,height=700,scrollbars=yes,resizable=yes'\r\n );\r\n\r\n if (popup) {\r\n const checkClosed = setInterval(() => {\r\n if (popup.closed) {\r\n clearInterval(checkClosed);\r\n handleAuthComplete(config);\r\n }\r\n }, 1000);\r\n }\r\n}\r\n\r\n/**\r\n * Build authentication URL for OAuth flow\r\n * @param {Object} config - Configuration\r\n * @returns {string} Auth URL\r\n */\r\nfunction buildAuthUrl(config) {\r\n const baseUrl = window.OnairosConfig.baseUrl;\r\n const params = new URLSearchParams({\r\n webpageName: config.webpageName,\r\n requestData: JSON.stringify(config.requestData),\r\n testMode: config.testMode,\r\n returnUrl: window.location.href\r\n });\r\n \r\n return `${baseUrl}/auth/laravel?${params.toString()}`;\r\n}\r\n\r\n/**\r\n * Handle authentication completion\r\n * @param {Object} config - Configuration\r\n */\r\nfunction handleAuthComplete(config) {\r\n if (config.onComplete && typeof config.onComplete === 'function') {\r\n config.onComplete({\r\n success: true,\r\n timestamp: new Date().toISOString()\r\n });\r\n }\r\n \r\n // Trigger custom event for Laravel apps to listen to\r\n const event = new CustomEvent('onairosAuthComplete', {\r\n detail: { config, success: true }\r\n });\r\n window.dispatchEvent(event);\r\n}\r\n\r\n/**\r\n * Detect if device is mobile\r\n * @returns {boolean}\r\n */\r\nfunction detectMobileDevice() {\r\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||\r\n (window.innerWidth <= 768);\r\n}\r\n\r\n/**\r\n * Inject Onairos styles into the page\r\n */\r\nfunction injectOnairosStyles() {\r\n if (document.getElementById('onairos-styles')) return;\r\n\r\n const styles = `\r\n <style id=\"onairos-styles\">\r\n .onairos-button-container {\r\n display: inline-block;\r\n margin: 10px 0;\r\n }\r\n \r\n .onairos-btn {\r\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\r\n border: none;\r\n border-radius: 25px;\r\n padding: 12px 24px;\r\n color: white;\r\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\r\n font-size: 14px;\r\n font-weight: 600;\r\n cursor: pointer;\r\n transition: all 0.3s ease;\r\n box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);\r\n }\r\n \r\n .onairos-btn:hover {\r\n transform: translateY(-2px);\r\n box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);\r\n }\r\n \r\n .onairos-btn-pill {\r\n border-radius: 25px;\r\n }\r\n \r\n .onairos-btn-icon {\r\n border-radius: 50%;\r\n width: 45px;\r\n height: 45px;\r\n padding: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n }\r\n \r\n .onairos-btn-loading {\r\n color: #888;\r\n }\r\n \r\n @media (max-width: 768px) {\r\n .onairos-btn {\r\n width: 100%;\r\n padding: 15px 20px;\r\n font-size: 16px;\r\n }\r\n }\r\n </style>\r\n `;\r\n \r\n document.head.insertAdjacentHTML('beforeend', styles);\r\n}\r\n\r\n/**\r\n * Laravel Blade template directive helper\r\n * Usage in Blade: @onairos(['requestData' => ['email'], 'webpageName' => 'My App'])\r\n */\r\nexport function renderOnairosDirective(options = {}) {\r\n const elementId = `onairos-${Math.random().toString(36).substr(2, 9)}`;\r\n \r\n return `\r\n <div id=\"${elementId}\"></div>\r\n <script>\r\n document.addEventListener('DOMContentLoaded', function() {\r\n if (window.createOnairosButton) {\r\n window.createOnairosButton('${elementId}', ${JSON.stringify(options)});\r\n }\r\n });\r\n </script>\r\n `;\r\n}\r\n\r\n// Dynamically mount the React OnairosButton to reuse overlay flow\r\nasync function mountReactOverlay(config) {\r\n try {\r\n const containerId = `onairos-react-${Math.random().toString(36).substr(2, 9)}`;\r\n const container = document.createElement('div');\r\n container.id = containerId;\r\n document.body.appendChild(container);\r\n\r\n const React = (await import('react')).default || (await import('react'));\r\n const ReactDOM = (await import('react-dom')).default || (await import('react-dom'));\r\n const { OnairosButton } = await import('../onairosButton.jsx');\r\n\r\n const onComplete = (result) => {\r\n if (config.onComplete && typeof config.onComplete === 'function') {\r\n config.onComplete(result);\r\n }\r\n setTimeout(() => {\r\n if (container && container.parentNode) {\r\n container.parentNode.removeChild(container);\r\n }\r\n }, 0);\r\n };\r\n\r\n const element = React.createElement(OnairosButton, {\r\n requestData: config.requestData,\r\n webpageName: config.webpageName,\r\n autoFetch: config.autoFetch,\r\n testMode: config.testMode,\r\n textColor: config.textColor || 'white',\r\n buttonType: config.buttonType || 'pill',\r\n onComplete\r\n });\r\n\r\n ReactDOM.render(element, container);\r\n\r\n // Programmatically click the button to open overlay immediately\r\n setTimeout(() => {\r\n const btn = container.querySelector('button');\r\n if (btn) {\r\n btn.click();\r\n }\r\n }, 0);\r\n } catch (error) {\r\n console.error('Failed to mount React overlay for Laravel:', error);\r\n }\r\n}\r\n\r\n// Expose functions globally for Blade template access\r\nif (typeof window !== 'undefined') {\r\n window.initializeOnairosForBlade = initializeOnairosForBlade;\r\n window.createOnairosButton = createOnairosButton;\r\n window.renderOnairosDirective = renderOnairosDirective;\r\n} "],"names":["root","factory","exports","module","define","amd","this","leafPrototypes","getProto","inProgress","dataWebpackPrefix","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","m","amdO","n","getter","__esModule","d","a","Object","getPrototypeOf","obj","t","value","mode","then","ns","create","r","def","current","indexOf","getOwnPropertyNames","forEach","key","definition","o","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","Function","window","prop","prototype","hasOwnProperty","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","fn","setTimeout","bind","type","target","head","appendChild","Symbol","toStringTag","scriptUrl","importScripts","location","currentScript","Error","replace","p","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","id","chunkLoadingGlobal","initializeOnairosForBlade","config","arguments","OnairosConfig","_objectSpread","apiKey","baseUrl","testMode","autoDetectMobile","globalStyles","getElementById","styles","insertAdjacentHTML","injectOnairosStyles","OnairosUtils","isMobile","detectMobileDevice","detectMobile","console","log","createOnairosButton","targetElementId","_window$OnairosConfig","options","element","concat","container","body","requestData","webpageName","autoFetch","buttonType","textColor","innerHTML","JSON","stringify","button","onclick","handleOnairosButtonClick","addEventListener","async","containerId","Math","random","toString","substr","React","default","ReactDOM","OnairosButton","onComplete","result","render","btn","querySelector","click","mountReactOverlay","test","navigator","userAgent","innerWidth","renderOnairosDirective","elementId"],"sourceRoot":""}
1
+ {"version":3,"file":"onairos-laravel.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,iBAAkB,GAAIH,GACH,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,GAC1B,CATD,CASGK,KAAM,I,uBCRLC,EADAC,ECAAC,EACAC,E,KCAAC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,CAAC,GAOX,OAHAc,EAAoBH,GAAUI,KAAKd,EAAOD,QAASC,EAAQA,EAAOD,QAASU,GAGpET,EAAOD,OACf,CAGAU,EAAoBM,EAAIF,ECzBxBJ,EAAoBO,KAAO,CAAC,ECC5BP,EAAoBQ,EAAKjB,IACxB,IAAIkB,EAASlB,GAAUA,EAAOmB,WAC7B,IAAOnB,EAAiB,QACxB,IAAM,EAEP,OADAS,EAAoBW,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GJNJb,EAAWiB,OAAOC,eAAkBC,GAASF,OAAOC,eAAeC,GAASA,GAASA,EAAa,UAQtGf,EAAoBgB,EAAI,SAASC,EAAOC,GAEvC,GADU,EAAPA,IAAUD,EAAQvB,KAAKuB,IAChB,EAAPC,EAAU,OAAOD,EACpB,GAAoB,iBAAVA,GAAsBA,EAAO,CACtC,GAAW,EAAPC,GAAaD,EAAMP,WAAY,OAAOO,E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,GAAK2C,EACftG,SAASwF,KAAK7D,YAAY4D,GAE1B,MAAMoB,SAAe,mCAAiBC,eAAkB,kCAClDC,SAAkB,mCAAqBD,eAAkB,mCACzD,cAAEE,SAAwB,qDAE1BC,EAAcC,IACdlD,EAAOiD,YAA2C,mBAAtBjD,EAAOiD,YACrCjD,EAAOiD,WAAWC,GAEpB1F,WAAW,KACLiE,GAAaA,EAAUpE,YACzBoE,EAAUpE,WAAWC,YAAYmE,IAElC,IAGCF,EAAUsB,EAAMrG,cAAcwG,EAAe,CACjDrB,YAAa3B,EAAO2B,YACpBC,YAAa5B,EAAO4B,YACpBC,UAAW7B,EAAO6B,UAClBvB,SAAUN,EAAOM,SACjByB,UAAW/B,EAAO+B,WAAa,QAC/BD,WAAY9B,EAAO8B,YAAc,OACjCmB,eAGFF,EAASI,OAAO5B,EAASE,GAGzBjE,WAAW,KACT,MAAM4F,EAAM3B,EAAU4B,cAAc,UAChCD,GACFA,EAAIE,SAEL,EACL,CAAE,MAAOtE,GACPiC,QAAQjC,MAAM,6CAA8CA,EAC9D,CACF,CA/MEuE,CAAkBvD,EACpB,CA0EA,SAASe,IACP,MAAO,iEAAiEzC,KAAKkF,UAAUC,YAC/ElI,OAAOmI,YAAc,GAC/B,CAqEO,SAASC,IAAqC,IAAdrC,EAAOrB,UAAA5D,OAAA,QAAAzD,IAAAqH,UAAA,GAAAA,UAAA,GAAG,CAAC,EAChD,MAAM2D,EAAY,WAAHpC,OAAciB,KAAKC,SAASC,SAAS,IAAIC,OAAO,EAAG,IAElE,MAAO,kBAAPpB,OACaoC,EAAS,gLAAApC,OAIgBoC,EAAS,OAAApC,OAAMS,KAAKC,UAAUZ,GAAQ,+CAK9E,C,MAkDsB,oBAAX/F,SACTA,OAAOwE,0BAA4BA,EACnCxE,OAAO4F,oBAAsBA,EAC7B5F,OAAOoI,uBAAyBA,G","sources":["webpack://OnairosLaravel/webpack/universalModuleDefinition","webpack://OnairosLaravel/webpack/runtime/create fake namespace object","webpack://OnairosLaravel/webpack/runtime/load script","webpack://OnairosLaravel/webpack/bootstrap","webpack://OnairosLaravel/webpack/runtime/amd options","webpack://OnairosLaravel/webpack/runtime/compat get default export","webpack://OnairosLaravel/webpack/runtime/define property getters","webpack://OnairosLaravel/webpack/runtime/ensure chunk","webpack://OnairosLaravel/webpack/runtime/get javascript chunk filename","webpack://OnairosLaravel/webpack/runtime/global","webpack://OnairosLaravel/webpack/runtime/hasOwnProperty shorthand","webpack://OnairosLaravel/webpack/runtime/make namespace object","webpack://OnairosLaravel/webpack/runtime/publicPath","webpack://OnairosLaravel/webpack/runtime/jsonp chunk loading","webpack://OnairosLaravel/./src/laravel/blade-helpers.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"OnairosLaravel\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OnairosLaravel\"] = factory();\n\telse\n\t\troot[\"OnairosLaravel\"] = factory();\n})(this, () => {\nreturn ","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"OnairosLaravel:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t930: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = this[\"webpackChunkOnairosLaravel\"] = this[\"webpackChunkOnairosLaravel\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","/**\n * Onairos Laravel Blade Integration Helpers\n * \n * This file provides utilities for integrating Onairos components\n * directly in PHP Blade templates without requiring React setup.\n */\n\n// Global Onairos instance for Blade templates\nlet onairosInstance = null;\n\n/**\n * Initialize Onairos for Blade template usage\n * @param {Object} config - Global configuration\n */\nexport function initializeOnairosForBlade(config = {}) {\n const defaultConfig = {\n apiKey: null,\n baseUrl: 'https://api2.onairos.uk',\n testMode: false,\n autoDetectMobile: true,\n globalStyles: true\n };\n\n window.OnairosConfig = { ...defaultConfig, ...config };\n \n // Inject global styles if enabled\n if (window.OnairosConfig.globalStyles) {\n injectOnairosStyles();\n }\n\n // Initialize mobile detection\n window.OnairosUtils = {\n isMobile: detectMobileDevice(),\n detectMobile: detectMobileDevice\n };\n\n console.log('🔥 Onairos initialized for Laravel Blade templates');\n}\n\n/**\n * Create an Onairos button element that can be used in Blade templates\n * @param {string} targetElementId - ID of the element to mount to\n * @param {Object} options - Onairos button options\n */\nexport function createOnairosButton(targetElementId, options = {}) {\n let element = document.getElementById(targetElementId);\n if (!element) {\n if (window.OnairosUtils && window.OnairosUtils.isMobile) {\n const container = document.createElement('div');\n container.id = targetElementId;\n document.body.appendChild(container);\n element = container;\n } else {\n console.error(`❌ Element with ID \"${targetElementId}\" not found`);\n return;\n }\n }\n\n const defaultOptions = {\n requestData: ['email', 'profile'],\n webpageName: 'Laravel App',\n testMode: window.OnairosConfig?.testMode || false,\n autoFetch: true,\n buttonType: 'pill',\n textColor: 'black'\n };\n\n const config = { ...defaultOptions, ...options };\n\n // Create button HTML\n element.innerHTML = `\n <div class=\"onairos-button-container\">\n <button \n id=\"${targetElementId}-btn\" \n class=\"onairos-btn onairos-btn-${config.buttonType}\"\n data-onairos-config='${JSON.stringify(config)}'\n >\n <span class=\"onairos-btn-text\" style=\"color: ${config.textColor}\">\n Connect with Onairos\n </span>\n <span class=\"onairos-btn-loading\" style=\"display: none;\">\n Loading...\n </span>\n </button>\n </div>\n `;\n\n // Add event listener\n const button = document.getElementById(`${targetElementId}-btn`);\n // Ensure both property and event listener are set for testing compatibility\n button.onclick = () => handleOnairosButtonClick(config);\n button.addEventListener('click', () => handleOnairosButtonClick(config));\n}\n\n/**\n * Handle Onairos button click in Blade context\n * @param {Object} config - Button configuration\n */\nfunction handleOnairosButtonClick(config) {\n // For Blade templates, reuse the React overlay logic by mounting the React component dynamically\n mountReactOverlay(config);\n}\n\n/**\n * Handle mobile OAuth flow (redirect-based)\n * @param {Object} config - Configuration\n */\nfunction handleMobileFlow(config) {\n const authUrl = buildAuthUrl(config);\n window.location.href = authUrl;\n}\n\n/**\n * Handle desktop OAuth flow (popup-based)\n * @param {Object} config - Configuration\n */\nfunction handleDesktopFlow(config) {\n const authUrl = buildAuthUrl(config);\n \n const popup = window.open(\n authUrl,\n 'onairosAuth',\n 'width=450,height=700,scrollbars=yes,resizable=yes'\n );\n\n if (popup) {\n const checkClosed = setInterval(() => {\n if (popup.closed) {\n clearInterval(checkClosed);\n handleAuthComplete(config);\n }\n }, 1000);\n }\n}\n\n/**\n * Build authentication URL for OAuth flow\n * @param {Object} config - Configuration\n * @returns {string} Auth URL\n */\nfunction buildAuthUrl(config) {\n const baseUrl = window.OnairosConfig.baseUrl;\n const params = new URLSearchParams({\n webpageName: config.webpageName,\n requestData: JSON.stringify(config.requestData),\n testMode: config.testMode,\n returnUrl: window.location.href\n });\n \n return `${baseUrl}/auth/laravel?${params.toString()}`;\n}\n\n/**\n * Handle authentication completion\n * @param {Object} config - Configuration\n */\nfunction handleAuthComplete(config) {\n if (config.onComplete && typeof config.onComplete === 'function') {\n config.onComplete({\n success: true,\n timestamp: new Date().toISOString()\n });\n }\n \n // Trigger custom event for Laravel apps to listen to\n const event = new CustomEvent('onairosAuthComplete', {\n detail: { config, success: true }\n });\n window.dispatchEvent(event);\n}\n\n/**\n * Detect if device is mobile\n * @returns {boolean}\n */\nfunction detectMobileDevice() {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||\n (window.innerWidth <= 768);\n}\n\n/**\n * Inject Onairos styles into the page\n */\nfunction injectOnairosStyles() {\n if (document.getElementById('onairos-styles')) return;\n\n const styles = `\n <style id=\"onairos-styles\">\n .onairos-button-container {\n display: inline-block;\n margin: 10px 0;\n }\n \n .onairos-btn {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border: none;\n border-radius: 25px;\n padding: 12px 24px;\n color: white;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.3s ease;\n box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);\n }\n \n .onairos-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);\n }\n \n .onairos-btn-pill {\n border-radius: 25px;\n }\n \n .onairos-btn-icon {\n border-radius: 50%;\n width: 45px;\n height: 45px;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .onairos-btn-loading {\n color: #888;\n }\n \n @media (max-width: 768px) {\n .onairos-btn {\n width: 100%;\n padding: 15px 20px;\n font-size: 16px;\n }\n }\n </style>\n `;\n \n document.head.insertAdjacentHTML('beforeend', styles);\n}\n\n/**\n * Laravel Blade template directive helper\n * Usage in Blade: @onairos(['requestData' => ['email'], 'webpageName' => 'My App'])\n */\nexport function renderOnairosDirective(options = {}) {\n const elementId = `onairos-${Math.random().toString(36).substr(2, 9)}`;\n \n return `\n <div id=\"${elementId}\"></div>\n <script>\n document.addEventListener('DOMContentLoaded', function() {\n if (window.createOnairosButton) {\n window.createOnairosButton('${elementId}', ${JSON.stringify(options)});\n }\n });\n </script>\n `;\n}\n\n// Dynamically mount the React OnairosButton to reuse overlay flow\nasync function mountReactOverlay(config) {\n try {\n const containerId = `onairos-react-${Math.random().toString(36).substr(2, 9)}`;\n const container = document.createElement('div');\n container.id = containerId;\n document.body.appendChild(container);\n\n const React = (await import('react')).default || (await import('react'));\n const ReactDOM = (await import('react-dom')).default || (await import('react-dom'));\n const { OnairosButton } = await import('../onairosButton.jsx');\n\n const onComplete = (result) => {\n if (config.onComplete && typeof config.onComplete === 'function') {\n config.onComplete(result);\n }\n setTimeout(() => {\n if (container && container.parentNode) {\n container.parentNode.removeChild(container);\n }\n }, 0);\n };\n\n const element = React.createElement(OnairosButton, {\n requestData: config.requestData,\n webpageName: config.webpageName,\n autoFetch: config.autoFetch,\n testMode: config.testMode,\n textColor: config.textColor || 'white',\n buttonType: config.buttonType || 'pill',\n onComplete\n });\n\n ReactDOM.render(element, container);\n\n // Programmatically click the button to open overlay immediately\n setTimeout(() => {\n const btn = container.querySelector('button');\n if (btn) {\n btn.click();\n }\n }, 0);\n } catch (error) {\n console.error('Failed to mount React overlay for Laravel:', error);\n }\n}\n\n// Expose functions globally for Blade template access\nif (typeof window !== 'undefined') {\n window.initializeOnairosForBlade = initializeOnairosForBlade;\n window.createOnairosButton = createOnairosButton;\n window.renderOnairosDirective = renderOnairosDirective;\n} "],"names":["root","factory","exports","module","define","amd","this","leafPrototypes","getProto","inProgress","dataWebpackPrefix","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","m","amdO","n","getter","__esModule","d","a","Object","getPrototypeOf","obj","t","value","mode","then","ns","create","r","def","current","indexOf","getOwnPropertyNames","forEach","key","definition","o","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","Function","window","prop","prototype","hasOwnProperty","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","timeout","doneFns","parentNode","removeChild","fn","setTimeout","bind","type","target","head","appendChild","Symbol","toStringTag","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","Error","replace","p","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","id","chunkLoadingGlobal","initializeOnairosForBlade","config","arguments","OnairosConfig","_objectSpread","apiKey","baseUrl","testMode","autoDetectMobile","globalStyles","getElementById","styles","insertAdjacentHTML","injectOnairosStyles","OnairosUtils","isMobile","detectMobileDevice","detectMobile","console","log","createOnairosButton","targetElementId","_window$OnairosConfig","options","element","concat","container","body","requestData","webpageName","autoFetch","buttonType","textColor","innerHTML","JSON","stringify","button","onclick","handleOnairosButtonClick","addEventListener","async","containerId","Math","random","toString","substr","React","default","ReactDOM","OnairosButton","onComplete","result","render","btn","querySelector","click","mountReactOverlay","navigator","userAgent","innerWidth","renderOnairosDirective","elementId"],"ignoreList":[],"sourceRoot":""}