true, default => false, }; } public function allowsRememberedEnvironmentRestore(): bool { return match ($this) { self::WorkspaceScoped, self::OnboardingWorkflow, self::CanonicalWorkspaceRecordViewer => true, default => false, }; } public function allowsEnvironmentlessState(): bool { return match ($this) { self::WorkspaceWideSurface, self::WorkspaceScoped, self::WorkspaceChooserException, self::OnboardingWorkflow, self::CanonicalWorkspaceRecordViewer => true, default => false, }; } public function forcesEnvironmentlessShellContext(): bool { return match ($this) { self::WorkspaceWideSurface, self::WorkspaceChooserException, self::CanonicalWorkspaceRecordViewer => true, default => false, }; } public function requiresExplicitEnvironment(): bool { return match ($this) { self::EnvironmentBound, self::EnvironmentScopedEvidence => true, default => false, }; } public function lane(): TenantInteractionLane { return TenantInteractionLane::fromSurfaceScope($this); } private static function isWorkspaceWideSurfacePath(string $normalizedPath): bool { return WorkspaceHubRegistry::isWorkspaceHubPath($normalizedPath); } private static function effectivePath(Request $request): string { $path = '/'.ltrim((string) $request->path(), '/'); if (! self::isLivewireRequestPath($path) && ! $request->headers->has('x-livewire')) { return $path; } $refererPath = parse_url((string) $request->headers->get('referer', ''), PHP_URL_PATH); return is_string($refererPath) && $refererPath !== '' ? '/'.ltrim($refererPath, '/') : $path; } private static function isLivewireRequestPath(string $path): bool { return preg_match('#^/(?:livewire(?:-[^/]+)?/update|livewire-unit-test-endpoint)(?:/|$)#', $path) === 1; } }