                  return response.text().then(text => {
                        throw new Error('HTTP ' + response.status + ': ' + text);
                    });
                }
                return response.json();
            })
            .then(data => {
                console.log('Available devices data:', data);
                window.availableDevicesForCase = data.devices || data || [];
                
                if (window.availableDevicesForCase.length === 0) {
                    conten