content: package androidx.constraintlayout.core.widgets.analyzer;
  
  import androidx.constraintlayout.core.widgets.ConstraintWidget;
  import androidx.constraintlayout.core.widgets.Guideline;
  
  class GuidelineReference extends WidgetRun {
      public GuidelineReference(ConstraintWidget widget) {
          super(widget);
          widget.horizontalRun.clear();
          widget.verticalRun.clear();
          this.orientation = ((Guideline) widget).getOrientation();
      }
  
      private void addDependency(DependencyNode node) {
          this.start.dependencies.add(node);
          node.targets.add(this.start);
      }
  
      /* access modifiers changed from: package-private */
      public void apply() {
          Guideline guideline = (Guideline) this.widget;
          int relativeBegin = guideline.getRelativeBegin();
          int relativeEnd = guideline.getRelativeEnd();
          float relativePercent = guideline.getRelativePercent();
          if (guideline.getOrientation() == 1) {
              if (relativeBegin != -1) {
                  this.start.targets.add(this.widget.mParent.horizontalRun.start);
                  this.widget.mParent.horizontalRun.start.dependencies.add(this.start);
                  this.start.margin = relativeBegin;
              } else if (relativeEnd != -1) {
                  this.start.targets.add(this.widget.mParent.horizontalRun.end);
                  this.widget.mParent.horizontalRun.end.dependencies.add(this.start);
                  this.start.margin = -relativeEnd;
              } else {
                  this.start.delegateToWidgetRun = true;
                  this.start.targets.add(this.widget.mParent.horizontalRun.end);
                  this.widget.mParent.horizontalRun.end.dependencies.add(this.start);
              }
              addDependency(this.widget.horizontalRun.start);
              addDependency(this.widget.horizontalRun.end);
              return;
          }
          if (relativeBegin != -1) {
              this.start.targets.add(this.widget.mParent.verticalRun.start);
              this.widget.mParent.verticalRun.start.dependencies.add(this.start);
              this.start.margin = relativeBegin;
          } else if (relativeEnd != -1) {
              this.start.targets.add(this.widget.mParent.verticalRun.end);
              this.widget.mParent.verticalRun.end.dependencies.add(this.start);
              this.start.margin = -relativeEnd;
          } else {
              this.start.delegateToWidgetRun = true;
              this.start.targets.add(this.widget.mParent.verticalRun.end);
              this.widget.mParent.verticalRun.end.dependencies.add(this.start);
          }
          addDependency(this.widget.verticalRun.start);
          addDependency(this.widget.verticalRun.end);
      }
  
      public void applyToWidget() {
          if (((Guideline) this.widget).getOrientation() == 1) {
              this.widget.setX(this.start.value);
          } else {
              this.widget.setY(this.start.value);
          }
      }
  
      /* access modifiers changed from: package-private */
      public void clear() {
          this.start.clear();
      }
  
      /* access modifiers changed from: package-private */
      public void reset() {
          this.start.resolved = false;
          this.end.resolved = false;
      }
  
      /* access modifiers changed from: package-private */
      public boolean supportsWrapComputation() {
          return false;
      }
  
      public void update(Dependency dependency) {
          if (this.start.readyToSolve && !this.start.resolved) {
              this.start.resolve((int) ((((float) this.start.targets.get(0).value) * ((Guideline) this.widget).getRelativePercent()) + 0.5f));
          }
      }
  }
  