import { Daylily, defineGroup, Flower, FlowerBed, Tree } from "../lib/yard-features.js";
import * as geo from "../lib/geometry.js";
import { lotCorner } from "./anchors.js";

export const juniperTreesGroup = defineGroup("group:juniper-trees", "Juniper Trees");

const flowerBeds = [
  new FlowerBed("Herbs").trace([
    [-100.89863446807426, 46.82677625460535],
    [-100.89862628077022, 46.82677780036216],
    [-100.89863677743469, 46.82681615158733],
    [-100.89864678466313, 46.826814966528865],
  ]),
  new FlowerBed("Garden").trace([
    [-100.89865910125202, 46.82684024777001],
    [-100.89865409763779, 46.82682773882406],
    [-100.89853785983037, 46.82684209119338],
    [-100.89854344078469, 46.82685618021274],
  ]),
  new FlowerBed("Back day lily").trace([
    [-100.89854344078469, 46.82685618021274],
    [-100.89852458100802, 46.82685815530862],
    [-100.89850764569832, 46.82680482769446],
    [-100.89851239198609, 46.82679937725647],
    [-100.89851803782018, 46.82680087749872],
    [-100.89852554324152, 46.826804564348095],
  ]),
  new FlowerBed("Coneflowers").trace([
    [-100.89852458100802, 46.82685815530862],
    [-100.89851482473702, 46.82685818966149],
    [-100.89850049853712, 46.82681602228328],
    [-100.89850764569832, 46.82680482769446],
  ]),
  new FlowerBed("Pathway border").trace([
    [-100.89881515684904, 46.82671629075389],
    [-100.89881830278543, 46.82671252471132],
    [-100.89882138193263, 46.82670673108083],
    [-100.89881445385141, 46.8266828981853],
    [-100.89877269291729, 46.82668908683872],
    [-100.89877211557717, 46.8266923786754],
    [-100.89876884398328, 46.82669501214458],
    [-100.89876326302891, 46.82669764561363],
    [-100.89875979898829, 46.82670304422476],
    [-100.89875979898829, 46.826708574508785],
    [-100.89876461015585, 46.826720556788906],
    [-100.8988050654378, 46.82671481119343],
  ]),
];

const daylilies = [
  new Daylily("Not sure", {
    gardenOrgId: "4765",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(2))),
  new Daylily("Wayside King Royale", {
    gardenOrgId: "5090",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(4))),
  new Daylily("Joan Derifield", {
    gardenOrgId: "4765",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(6))),
  new Daylily("Predatory Flamingo", {
    gardenOrgId: "61201",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(8))),
  new Daylily("Unknown", {
  }).add(geo.offset(lotCorner), geo.east(geo.ft(109)), geo.south(geo.ft(7))),
  new Daylily("Unknown", {
  }).add(geo.offset(lotCorner), geo.east(geo.ft(109)), geo.south(geo.ft(9))),
  new Daylily("Unknown", {
  }).add(geo.offset(lotCorner), geo.east(geo.ft(107)), geo.south(geo.ft(8))),
  new Daylily("Unknown", {
  }).add(geo.offset(lotCorner), geo.east(geo.ft(107)), geo.south(geo.ft(10))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(24))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(26))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(28))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(30))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(32))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(34))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(36))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(38))),
  new Daylily("You Had Me at Hello", {
    gardenOrgId: "235117",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(28)), geo.south(geo.ft(45))),
  new Daylily("Mapping North Dakota", {
    gardenOrgId: "56003",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(28)), geo.south(geo.ft(47))),
  new Daylily("Daylily").add(geo.offset(lotCorner), geo.east(geo.ft(31)), geo.south(geo.ft(47))),
];

const flowers = [
  new Flower("Purple Coneflower", {
    gardenOrgId: "71445",
    plantedDate: "2024-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(111.5)), geo.south(geo.ft(15))),
  new Flower("Purple Coneflower", {
    gardenOrgId: "71445",
    plantedDate: "2024-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(111.5)), geo.south(geo.ft(17))),
  new Flower("Purple Coneflower", {
    gardenOrgId: "71445",
    plantedDate: "2024-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112.5)), geo.south(geo.ft(16))),
  new Flower("Purple Coneflower", {
    gardenOrgId: "71445",
    plantedDate: "2024-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112.5)), geo.south(geo.ft(14))),
  new Flower("Tiny Tortuga Turtlehead", {
    gardenOrgId: "697986",
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(3)), geo.south(geo.ft(8))),
  new Flower("Tiny Tortuga Turtlehead", {
    gardenOrgId: "697986",
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(3)), geo.south(geo.ft(17))),
  new Flower("Peony", {
    gardenOrgId: "697986",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(19)), geo.south(geo.ft(1.5))),
  new Flower("Peony", {
    gardenOrgId: "697986",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(75)), geo.south(geo.ft(2))),
];

const houseplants = [
    new Flower("Variegata", {
        gardenOrgId: "126796",
    }).add(geo.offset(lotCorner), geo.east(geo.ft(60)), geo.south(geo.ft(28))),
]

const cutDownTrees = [
  new Tree("Maybe elm", {
    canopyDiameterMeters: 15,
    heightMeters: 15,
    removedDate: "2021-05-05",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(65)), geo.south(geo.ft(-2))),
  new Tree("Big pine tree", {
    canopyDiameterMeters: 8,
    heightMeters: 15,
    removedDate: "2021-05-06",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(98)), geo.south(geo.ft(-15))),
  new Tree("Walnut by house", {
    canopyDiameterMeters: 6,
    heightMeters: 7,
    removedDate: "2021-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(32)), geo.south(geo.ft(40))),
  new Tree("Walnut by shed", {
    canopyDiameterMeters: 7,
    heightMeters: 7,
    removedDate: "2021-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(100)), geo.south(geo.ft(40))),
];

const trees = [
  new Tree("Northern Empress Japanese Elm", {
    species: "Northern Empress Japanese Elm",
    canopyDiameterMeters: 6,
    heightMeters: 7,
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(9)), geo.south(geo.ft(16))),
  new Tree("Hot Wings Maple", {
    species: "Hot Wings Maple",
    canopyDiameterMeters: 5,
    heightMeters: 5,
    gardenOrgId: "536120",
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(60)), geo.south(geo.ft(40))),
  new Tree("Prairie Expedition American Elm", {
    species: "Prairie Expedition American Elm",
    canopyDiameterMeters: 5,
    heightMeters: 5,
    gardenOrgId: "736267",
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(95)), geo.south(geo.ft(15))),
  new Tree("Dwarf Korean Lilac", {
    species: "Dwarf Korean Lilac",
    canopyDiameterMeters: 1.75,
    heightMeters: 2.5,
    gardenOrgId: "79137",
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(3)), geo.south(geo.ft(3))),
  new Tree("Dwarf Korean Lilac", {
    species: "Dwarf Korean Lilac",
    canopyDiameterMeters: 1.75,
    heightMeters: 2.5,
    gardenOrgId: "79137",
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(3)), geo.south(geo.ft(20))),
  new Tree("Dwarf Korean Lilac", {
    species: "Dwarf Korean Lilac",
    canopyDiameterMeters: 1.75,
    heightMeters: 2.5,
    gardenOrgId: "79137",
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(3)), geo.south(geo.ft(37))),
  new Tree("Boulevard Linden", {
    species: "Boulevard Linden",
    canopyDiameterMeters: 3,
    heightMeters: 6,
    plantedDate: "2021-09-21",
  }).add(geo.lngLat(-100.8990003556445, 46.826776648309774)),
  new Tree("Boulevard Linden 2", {
    species: "Boulevard Linden",
    canopyDiameterMeters: 3,
    heightMeters: 6,
    plantedDate: "2021-09-21",
  }).add(geo.lngLat(-100.89898269567485, 46.826709328342595)),
  new Tree("Evergreen", {
    species: "Evergreen",
    canopyDiameterMeters: 8,
    heightMeters: 15,
  }).add(geo.lngLat(-100.89888268258135, 46.826680107011924)),
];

const bushes = [
  new Tree("Medora Juniper 1", {
    species: "Medora Juniper",
    canopyDiameterMeters: 1.5,
    heightMeters: 2.5,
    plantedDate: "2021-09-21",
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.89880933964611, 46.826705259550664)),
  new Tree("Medora Juniper 2", {
    species: "Medora Juniper",
    canopyDiameterMeters: 1.5,
    heightMeters: 2.5,
    plantedDate: "2021-09-21",
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.89877004677517, 46.82670396593881)),
  new Tree("Medora Juniper 3", {
    species: "Medora Juniper",
    canopyDiameterMeters: 1.5,
    heightMeters: 2.5,
    plantedDate: "2021-09-21",
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.898799106227, 46.82669830398086)),
  new Tree("Medora Juniper 4", {
    species: "Medora Juniper",
    canopyDiameterMeters: 1.5,
    heightMeters: 2.5,
    plantedDate: "2021-09-21",
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.89878871410515, 46.82669251034885)),
  new Tree("Medora Juniper 5", {
    species: "Medora Juniper",
    canopyDiameterMeters: 1.5,
    heightMeters: 2.5,
    plantedDate: "2021-09-21",
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.8987812086838, 46.82671120797719)),
  new Tree("Black Currant", {
    species: "Black Currant",
    canopyDiameterMeters: 2,
    heightMeters: 2,
    gardenOrgId: "87767",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(107)), geo.south(geo.ft(3))),
  new Tree("Elderberry", {
    species: "Elderberry",
    canopyDiameterMeters: 3,
    heightMeters: 3,
    gardenOrgId: "78882",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(52))),
  new Tree("Spirea", {
    species: "Spirea",
    canopyDiameterMeters: 1.5,
    heightMeters: 1,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(70)), geo.south(geo.ft(31))),
  new Tree("Spirea", {
    species: "Spirea",
    canopyDiameterMeters: 1.5,
    heightMeters: 1,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(74)), geo.south(geo.ft(31))),
  new Tree("Spirea", {
    species: "Spirea",
    canopyDiameterMeters: 1.5,
    heightMeters: 1,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(78)), geo.south(geo.ft(31))),
];

export const plantFeatures = [...flowerBeds, ...daylilies, ...flowers, ...houseplants, ...trees, ...bushes, ...cutDownTrees];
export const plantGroups = [juniperTreesGroup];
