// Path: client/src/main/java/lighthouse/utils/I18nUtil.java
// public class I18nUtil {
//     private static final Logger log = LoggerFactory.getLogger(I18nUtil.class);
//     @Nullable private static ResourceBundle locale;
// 
//     public static ResourceBundle translations = new ResourceBundle() {
//         @Override
//         protected Object handleGetObject(String key) {
//             if (locale == null)
//                 return key;
//             else
//                 try {
//                     return locale.getObject(key);
//                 } catch (MissingResourceException e) {
//                     return key;
//                 }
//         }
// 
//         @Override
//         public boolean containsKey(String key) {
//             return true;
//         }
// 
//         @NotNull
//         @Override
//         public Enumeration<String> getKeys() {
//             if (locale != null)
//                 return locale.getKeys();
//             else
//                 return Collections.emptyEnumeration();
//         }
//     };
// 
//     static {
//         try {
//             locale = ResourceBundle.getBundle("lighthouse.locale.lighthouse");
//             log.info("Using language translations for {}", locale.getLocale());
//         } catch (MissingResourceException e) {
//             // Ignore.
//         }
//     }
// 
//     public static String tr(String s) {
//         if (locale != null)
//             return gettext(locale, s);
//         else
//             return s;
//     }
// }


import com.google.common.base.Charsets;
import com.google.common.base.*;
import com.google.common.collect.*;
import javafx.animation.*;
import javafx.application.Platform;
import javafx.beans.binding.*;
import javafx.beans.property.*;
import javafx.collections.*;
import javafx.collections.transformation.*;
import javafx.event.*;
import javafx.fxml.*;
import javafx.geometry.*;
import javafx.scene.*;
import javafx.scene.chart.*;
import javafx.scene.control.*;
import javafx.scene.effect.*;
import javafx.scene.image.*;
import javafx.scene.input.*;
import javafx.scene.layout.*;
import javafx.stage.*;
import kotlin.*;
import lighthouse.*;
import lighthouse.controls.*;
import lighthouse.nav.*;
import lighthouse.protocol.*;
import lighthouse.subwindows.*;
import lighthouse.threading.*;
import lighthouse.utils.*;
import org.bitcoinj.core.*;
import org.bitcoinj.params.*;
import org.slf4j.*;
import javax.annotation.*;
import java.io.*;
import java.nio.file.*;
import java.time.*;
import java.time.format.*;
import java.util.*;
import java.util.concurrent.*;
import static com.google.common.base.Preconditions.*;
import static javafx.beans.binding.Bindings.*;
import static javafx.collections.FXCollections.*;
import static lighthouse.utils.GuiUtils.*;
import static lighthouse.utils.I18nUtil.*;
import static lighthouse.utils.MoreBindings.*;

    public final ObjectProperty<Project> project = new SimpleObjectProperty<>();

    private PieChart.Data emptySlice;
    private ObservableSet<LHProtos.Pledge> pledges;
    private UIBindings bindings;
    private LongProperty pledgedValue;
    private ObjectBinding<LighthouseBackend.CheckStatus> checkStatus;
    private ObservableMap<Sha256Hash, LighthouseBackend.ProjectStateInfo> projectStates;  // project id -> status
    private ObservableMap<Project, LighthouseBackend.CheckStatus> statusMap;
    @Nullable private NotificationBarPane.Item notifyBarItem;
    @Nullable private Sha256Hash myPledgeHash;

    private String goalAmountFormatStr;
    private BooleanBinding isFullyFundedAndNotParticipating;

    private enum Mode {
        OPEN_FOR_PLEDGES,
        PLEDGED,
        CAN_CLAIM,
        CLAIMED,
    }
    private SimpleObjectProperty<Mode> mode = new SimpleObjectProperty<>(Mode.OPEN_FOR_PLEDGES);
    private Mode priorMode;

    public ProjectActivity(ObservableList<Project> projects, Project project, ObservableMap<Project, LighthouseBackend.CheckStatus> statusMap) {
        // Don't try and access Main.backend here in case you race with startup.
        try {
            this.statusMap = statusMap;

// Path: client/src/main/java/lighthouse/utils/I18nUtil.java
// public class I18nUtil {
//     private static final Logger log = LoggerFactory.getLogger(I18nUtil.class);
//     @Nullable private static ResourceBundle locale;
// 
//     public static ResourceBundle translations = new ResourceBundle() {
//         @Override
//         protected Object handleGetObject(String key) {
//             if (locale == null)
//                 return key;
//             else
//                 try {
//                     return locale.getObject(key);
//                 } catch (MissingResourceException e) {
//                     return key;
//                 }
//         }
// 
//         @Override
//         public boolean containsKey(String key) {
//             return true;
//         }
// 
//         @NotNull
//         @Override
//         public Enumeration<String> getKeys() {
//             if (locale != null)
//                 return locale.getKeys();
//             else
//                 return Collections.emptyEnumeration();
//         }
//     };
// 
//     static {
//         try {
//             locale = ResourceBundle.getBundle("lighthouse.locale.lighthouse");
//             log.info("Using language translations for {}", locale.getLocale());
//         } catch (MissingResourceException e) {
//             // Ignore.
//         }
//     }
// 
//     public static String tr(String s) {
//         if (locale != null)
//             return gettext(locale, s);
//         else
//             return s;
//     }
// }


// Path: client/src/main/java/lighthouse/activities/ProjectActivity.java
import com.google.common.base.Charsets;
import com.google.common.base.*;
import com.google.common.collect.*;
import javafx.animation.*;
import javafx.application.Platform;
import javafx.beans.binding.*;
import javafx.beans.property.*;
import javafx.collections.*;
import javafx.collections.transformation.*;
import javafx.event.*;
import javafx.fxml.*;
import javafx.geometry.*;
import javafx.scene.*;
import javafx.scene.chart.*;
import javafx.scene.control.*;
import javafx.scene.effect.*;
import javafx.scene.image.*;
import javafx.scene.input.*;
import javafx.scene.layout.*;
import javafx.stage.*;
import kotlin.*;
import lighthouse.*;
import lighthouse.controls.*;
import lighthouse.nav.*;
import lighthouse.protocol.*;
import lighthouse.subwindows.*;
import lighthouse.threading.*;
import lighthouse.utils.*;
import org.bitcoinj.core.*;
import org.bitcoinj.params.*;
import org.slf4j.*;
import javax.annotation.*;
import java.io.*;
import java.nio.file.*;
import java.time.*;
import java.time.format.*;
import java.util.*;
import java.util.concurrent.*;
import static com.google.common.base.Preconditions.*;
import static javafx.beans.binding.Bindings.*;
import static javafx.collections.FXCollections.*;
import static lighthouse.utils.GuiUtils.*;
import static lighthouse.utils.I18nUtil.*;
import static lighthouse.utils.MoreBindings.*;


    public final ObjectProperty<Project> project = new SimpleObjectProperty<>();

    private PieChart.Data emptySlice;
    private ObservableSet<LHProtos.Pledge> pledges;
    private UIBindings bindings;
    private LongProperty pledgedValue;
    private ObjectBinding<LighthouseBackend.CheckStatus> checkStatus;
    private ObservableMap<Sha256Hash, LighthouseBackend.ProjectStateInfo> projectStates;  // project id -> status
    private ObservableMap<Project, LighthouseBackend.CheckStatus> statusMap;
    @Nullable private NotificationBarPane.Item notifyBarItem;
    @Nullable private Sha256Hash myPledgeHash;

    private String goalAmountFormatStr;
    private BooleanBinding isFullyFundedAndNotParticipating;

    private enum Mode {
        OPEN_FOR_PLEDGES,
        PLEDGED,
        CAN_CLAIM,
        CLAIMED,
    }
    private SimpleObjectProperty<Mode> mode = new SimpleObjectProperty<>(Mode.OPEN_FOR_PLEDGES);
    private Mode priorMode;

    public ProjectActivity(ObservableList<Project> projects, Project project, ObservableMap<Project, LighthouseBackend.CheckStatus> statusMap) {
        // Don't try and access Main.backend here in case you race with startup.
        try {
            this.statusMap = statusMap;

            FXMLLoader loader = new FXMLLoader(getResource("activities/project.fxml"), I18nUtil.translations);