package nodeshape

import (
	

	
	
	
)

type shapePackage struct {
	shape.Shape
}

func ( shapePackage) ( LabelTier) map[label.Position]struct{} {
	switch  {
	case Good:
		return map[label.Position]struct{}{
			label.InsideMiddleCenter:  {},
			label.InsideMiddleLeft:    {},
			label.InsideBottomLeft:    {},
			label.InsideBottomCenter:  {},
			label.OutsideBottomLeft:   {},
			label.OutsideBottomCenter: {},
			label.InsideTopLeft:       {},
			label.InsideTopCenter:     {},
			label.InsideTopRight:      {},
		}
	case OK:
		return map[label.Position]struct{}{
			label.OutsideTopLeft:     {},
			label.InsideMiddleRight:  {},
			label.InsideBottomRight:  {},
			label.OutsideBottomRight: {},
		}
	case Unideal:
		return map[label.Position]struct{}{
			label.OutsideTopCenter:   {},
			label.OutsideLeftMiddle:  {},
			label.OutsideRightMiddle: {},
			label.OutsideLeftTop:     {},
			label.OutsideLeftBottom:  {},
			label.OutsideRightBottom: {},
		}
	case Bad:
		return map[label.Position]struct{}{
			label.OutsideTopRight: {},
			label.OutsideRightTop: {},
		}
	}
	return map[label.Position]struct{}{}
}

func ( shapePackage) () [][]*geo.RelativePoint {
	 := .GetBox()
	 := .Width
	 := .Height
	 := 0.2
	 := 0.5
	 := 34.0
	 := 55.0

	 := 50.0
	 := 150.0

	 := math.Min(, math.Max(, *))

	if  < 2* {
		 =  * 
	}

	 := math.Min(, math.Max(, *))

	if  < 2* {
		 =  * 
	}

	 :=  / 
	 :=  / 

	// Space occupied by main shape not overlapping
	 := 1 - 
	 := 1 - 

	return [][]*geo.RelativePoint{
		// Top
		{
			geo.NewRelativePoint(*0.33, 0),
			geo.NewRelativePoint(*0.66, 0),
			geo.NewRelativePoint(+*0.5, ),
		},
		// Left
		{
			geo.NewRelativePoint(0, +*0.25),
			geo.NewRelativePoint(0, +*0.5),
			geo.NewRelativePoint(0, +*0.75),
		},
		// Bottom
		{
			geo.NewRelativePoint(0.25, 1),
			geo.NewRelativePoint(0.5, 1),
			geo.NewRelativePoint(0.75, 1),
		},
		// Right
		{
			geo.NewRelativePoint(1, +*0.25),
			geo.NewRelativePoint(1, +*0.5),
			geo.NewRelativePoint(1, +*0.75),
		},
	}
}

func ( shapePackage) ( geo.Orientation) []int {
	switch  {
	case geo.Top:
		return []int{0, 1, 2}
	case geo.Left:
		return []int{3, 4, 5}
	case geo.Bottom:
		return []int{6, 7, 8}
	case geo.Right:
		return []int{9, 10, 11}
	case geo.TopLeft:
		return []int{0, 1, 2, 3, 4, 5}
	case geo.TopRight:
		return []int{0, 1, 2, 9, 10, 11}
	case geo.BottomLeft:
		return []int{6, 7, 8, 3, 4, 5}
	case geo.BottomRight:
		return []int{6, 7, 8, 9, 10, 11}
	default:
		return []int{}
	}
}

func ( shapePackage) () map[int]int {
	return map[int]int{
		// Left and right
		4:  10,
		10: 4,
	}
}

func ( shapePackage) () []int {
	return []int{0, 1, 4, 7, 10}
}

func ( shapePackage) ( geo.Orientation) int {
	// Package type has two top center ports: 0 is also a center port, but 1 is closer to the center
	 := .CenterPortIndices()
	var  int
	switch  {
	case geo.Top:
		 = 1
	case geo.Left:
		 = 2
	case geo.Bottom:
		 = 3
	case geo.Right:
		 = 4
	default:
		return -1
	}

	return []
}